feat: 默认测试环境并优化出仓与网络提示

This commit is contained in:
2026-09-24 17:56:06 +08:00
parent 53a059f16b
commit 26c7085ab2
10 changed files with 182 additions and 43 deletions
@@ -122,7 +122,13 @@
<u-select v-model="selectShow" :list="selectList" @confirm="selectConfirmFun"></u-select>
<search-select-popup
:show.sync="selectShow"
title="选择接收单位"
placeholder="请输入染厂名称"
:list="selectList"
@confirm="selectConfirmFun"
/>
<FabricInfoPopup :show.sync="fabricInfoShow" :data="currentFabricInfo" />
@@ -152,6 +158,8 @@ import FabricOutScanDetail from '@/components/storefabric/FabricOutScanDetail.vu
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
import SearchSelectPopup from '@/components/storefabric/SearchSelectPopup.vue';
export default {
@@ -172,6 +180,8 @@ export default {
FabricOutFooter,
SearchSelectPopup,
},
mixins: [formMixin],
@@ -51,7 +51,13 @@
<FabricOutFooter :buttons="statusActionButtons" @action="handleStatusAction" />
<u-select v-model="selectShow" :list="selectList" @confirm="selectConfirmFun"></u-select>
<search-select-popup
:show.sync="selectShow"
title="选择接收单位"
placeholder="请输入染厂名称"
:list="selectList"
@confirm="selectConfirmFun"
/>
<FabricInfoPopup :show.sync="fabricInfoShow" :data="currentFabricInfo" />
<FineCodePopup :show.sync="fineCodeShow" :list="currentFineCodes" :readonly="false" @delete="onDeleteFineCode" />
</view>
@@ -66,6 +72,7 @@ import FabricOutDetailList from '@/components/storefabric/FabricOutDetailList.vu
import FabricOutScanBar from '@/components/storefabric/FabricOutScanBar.vue';
import FabricOutScanDetail from '@/components/storefabric/FabricOutScanDetail.vue';
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
import SearchSelectPopup from '@/components/storefabric/SearchSelectPopup.vue';
export default {
components: {
@@ -76,6 +83,7 @@ export default {
FabricOutScanBar,
FabricOutScanDetail,
FabricOutFooter,
SearchSelectPopup,
},
mixins: [formMixin],
onLoad(e) {
@@ -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] || {};
@@ -13,7 +13,7 @@ import scanMixin from '@/common/scanMixin.js';
import {
AUDIT_STATUS_MAP,
BILL_TYPES,
BUSINESS_UNIT_TYPE_KNITTING_FACTORY,
BUSINESS_UNIT_TYPE_DYEING_FACTORY,
normalizeOrder,
mapToSelectOptions,
getFineCodeScanCode,
@@ -136,7 +136,7 @@ export default {
},
ensureBusinessUnitOptions() {
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;
@@ -197,12 +197,10 @@ export default {
.catch((e) => this.showError(e.message || '加载单位列表失败'));
}
},
selectConfirmFun(e) {
const item = e[0];
if (this.selectType === '接收单位') {
this.form.business_unit_id = item.value;
this.form.business_unit_name = item.label;
}
selectConfirmFun(item) {
if (!item || this.selectType !== '接收单位') return;
this.form.business_unit_id = item.value;
this.form.business_unit_name = item.label;
},
bindDateChange(e) {
this.form.delivery_time = e.detail.value;
+5 -12
View File
@@ -116,7 +116,7 @@
/**
* Copyright (c) 2013-Now http://aidex.vip All rights reserved.
*/
import config from '@/common/config.js';
import config, { getTestApiUrl } from '@/common/config.js';
import base64 from '@/common/base64.js';
import util from '@/common/util.js';
import md5 from '@/common/md5.js';
@@ -134,10 +134,7 @@ export default {
password: ""
},
showApiUrlPicker: false,
// 暂时在打包后也展示服务器选项;生产包默认正式环境
selectedApiUrl: config.isDevelopment
? config.devApiUrlOptions[0].value
: ((config.devApiUrlOptions.find(item => item.label === '正式环境') || {}).value || config.productionApiUrl),
selectedApiUrl: getTestApiUrl(),
customApiUrl: 'http://192.168.1.66:50002/hcscm_weave/pda/v1',
apiUrlList: config.devApiUrlOptions,
phoneNo: '',
@@ -168,13 +165,9 @@ export default {
},
onShow() {
uni.getStorage({
key: 'ApiUrl',
success: (e) => {
util.updateApiUrl(e.data);
this.selectedApiUrl = e.data;
}
});
const testUrl = getTestApiUrl();
util.updateApiUrl(testUrl);
this.selectedApiUrl = testUrl;
uni.getStorage({
key: 'UserInfo',