feat: 默认测试环境并优化出仓与网络提示
This commit is contained in:
@@ -60,24 +60,32 @@
|
||||
|
||||
<u-select v-model="statusSelectShow" :list="statusSelectList" @confirm="onStatusConfirm"></u-select>
|
||||
<u-select v-model="unitSelectShow" :list="unitSelectList" @confirm="onUnitConfirm"></u-select>
|
||||
<search-select-popup
|
||||
:show.sync="businessUnitSelectShow"
|
||||
title="选择接收单位"
|
||||
placeholder="请输入染厂名称"
|
||||
:list="businessUnitSelectList"
|
||||
@confirm="onBusinessUnitConfirm"
|
||||
/>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import addBtn from '@/components/addBtn/addBtn.vue';
|
||||
import FabricOutItem from '@/components/card/storeFabricBusinessOutItem.vue';
|
||||
import SearchSelectPopup from '@/components/storefabric/SearchSelectPopup.vue';
|
||||
import {
|
||||
getStatusOptions,
|
||||
AUDIT_STATUS_MAP,
|
||||
BILL_TYPES,
|
||||
BUSINESS_UNIT_TYPE_KNITTING_FACTORY,
|
||||
BUSINESS_UNIT_TYPE_DYEING_FACTORY,
|
||||
formatRoll,
|
||||
mapToSelectOptions,
|
||||
fetchAllOrderList,
|
||||
} from '@/common/storeFabricBusinessOut';
|
||||
|
||||
export default {
|
||||
components: { addBtn, FabricOutItem },
|
||||
components: { addBtn, FabricOutItem, SearchSelectPopup },
|
||||
data() {
|
||||
return {
|
||||
list: [],
|
||||
@@ -86,6 +94,7 @@ export default {
|
||||
filterShow: false,
|
||||
statusSelectShow: false,
|
||||
unitSelectShow: false,
|
||||
businessUnitSelectShow: false,
|
||||
unitSelectType: '',
|
||||
deliveryUnitOptions: [],
|
||||
businessUnitOptions: [],
|
||||
@@ -119,8 +128,10 @@ export default {
|
||||
return this.filters.business_unit_name || '';
|
||||
},
|
||||
unitSelectList() {
|
||||
const options = this.unitSelectType === 'delivery' ? this.deliveryUnitOptions : this.businessUnitOptions;
|
||||
return [{ value: '', label: '全部' }, ...options];
|
||||
return [{ value: '', label: '全部' }, ...this.deliveryUnitOptions];
|
||||
},
|
||||
businessUnitSelectList() {
|
||||
return [{ value: '', label: '全部' }, ...this.businessUnitOptions];
|
||||
},
|
||||
},
|
||||
onLoad() {
|
||||
@@ -150,7 +161,7 @@ export default {
|
||||
},
|
||||
loadBusinessUnitOptions() {
|
||||
if (this.businessUnitOptions.length) return Promise.resolve(this.businessUnitOptions);
|
||||
return this.$u.api.businessUnit.list({ unit_type_id: BUSINESS_UNIT_TYPE_KNITTING_FACTORY })
|
||||
return this.$u.api.businessUnit.list({ unit_type_id: BUSINESS_UNIT_TYPE_DYEING_FACTORY })
|
||||
.then((res) => {
|
||||
this.businessUnitOptions = mapToSelectOptions(res);
|
||||
return this.businessUnitOptions;
|
||||
@@ -181,7 +192,23 @@ export default {
|
||||
this.openUnitSelect('delivery');
|
||||
},
|
||||
openBusinessUnitSelect() {
|
||||
this.openUnitSelect('business');
|
||||
if (this.unitOptionsLoading) return;
|
||||
this.unitOptionsLoading = true;
|
||||
this.loadBusinessUnitOptions()
|
||||
.then((list) => {
|
||||
if (!list.length) {
|
||||
uni.showToast({ title: '暂无可选单位', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
this.businessUnitSelectShow = true;
|
||||
})
|
||||
.finally(() => {
|
||||
this.unitOptionsLoading = false;
|
||||
});
|
||||
},
|
||||
onBusinessUnitConfirm(item) {
|
||||
this.filters.business_unit_id = item.value;
|
||||
this.filters.business_unit_name = item.value ? item.label : '';
|
||||
},
|
||||
onUnitConfirm(e) {
|
||||
const item = e[0] || {};
|
||||
|
||||
Reference in New Issue
Block a user