From 3f3fb152931389524fdb2eb70d5d08cc828df1e5 Mon Sep 17 00:00:00 2001 From: xiangxy Date: Fri, 14 Nov 2025 10:33:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/zw/ltzp.vue | 76 ++++++++++++++++++++++++++++++++++++++++++++--- utils/getData4.js | 6 ++++ 2 files changed, 78 insertions(+), 4 deletions(-) diff --git a/pages/zw/ltzp.vue b/pages/zw/ltzp.vue index 36c820c..8ecfefc 100644 --- a/pages/zw/ltzp.vue +++ b/pages/zw/ltzp.vue @@ -67,7 +67,6 @@ - + + + 仓位编码 + + + + + - - + + + @@ -104,7 +112,7 @@ import NavBar from '@/components/NavBar.vue' import SearchBox from '@/components/SearchBox.vue' import NumberInput from '@/components/NumberInput.vue' - import {vehiclelist, suppList, combination} from '@/utils/getData4.js' + import {vehiclelist, suppList, structList, combination, groupAndBind} from '@/utils/getData4.js' export default { components: { @@ -118,6 +126,8 @@ currentData: {}, options: [], index: '', + options2: [], + index2: '', // options1: [{text:'t1', value: 't1'}, {text:'t2', value: 't2'}], // index1: '', vehicleCode: '', @@ -140,6 +150,7 @@ this.title = options.title this._suppList() this._vehiclelist() + this._structList() }, onShow () { if (this.$store.getters.publicObj !== '') { @@ -148,6 +159,21 @@ } }, methods: { + async _structList () { + try { + let res = await structList() + if (res) { + this.options2 = res.data + } else { + this.options2 = [] + } + } catch (e) { + this.options2 = [] + } + }, + selectChange2 (e) { + this.index2 = e + }, onInput(e) { // console.log('输入内容:', e.detail.value) }, @@ -207,7 +233,11 @@ toEmpty () { this.currentData = {} this.index = '' + this.vehicleCode = '' + this.index2 = '' this.disabled = false + this._vehiclelist() + this._structList() }, toSure () { this.disabled = true @@ -240,6 +270,44 @@ title: res.message, icon: 'none' }) + this.toEmpty() + this.disabled = false + } catch (e) { + this.disabled = false + } + }, + toSure2 () { + this.disabled = true + if (JSON.stringify(this.currentData) === '{}') { + this.disabled = false + return + } + if (Number(this.currentData.single_weight) > 2000) { + uni.showModal({ + title: '提示', + content: '输入的重量'+ Number(this.currentData.single_weight) +'过大,是否继续?', + confirmColor: '#ff6a00', + success: (res) => { + if (res.confirm) { + this._groupAndBind() + } else if (res.cancel) { + this.disabled = false + } + } + }) + } else { + this._groupAndBind() + } + }, + async _groupAndBind () { + try { + let selobj = this.options.find(item => item.value === this.index) + let res = await groupAndBind(this.vehicleCode, this.currentData.pcsn, this.currentData.material_id, selobj.value, selobj.text, this.currentData.single_weight, this.index2) + uni.showToast({ + title: res.message, + icon: 'none' + }) + this.toEmpty() this.disabled = false } catch (e) { this.disabled = false diff --git a/utils/getData4.js b/utils/getData4.js index 1d95eee..9ae507d 100644 --- a/utils/getData4.js +++ b/utils/getData4.js @@ -344,6 +344,12 @@ export const combination = (vcode, pcsn, mid, spcode, spname, sweight) => reques data: {vehicle_code: vcode, pcsn: pcsn, material_id: mid, supp_code: spcode, supp_name: spname, single_weight: sweight} }) +// 组盘并绑定 +export const groupAndBind = (vcode, pcsn, mid, spcode, spname, sweight, pcode) => request({ + url:'api/pda/jb/groupAndBind', + data: {vehicle_code: vcode, pcsn: pcsn, material_id: mid, supp_code: spcode, supp_name: spname, single_weight: sweight, point_code: pcode} +}) + // 料桶组盘-可用载具数组 export const vehiclelist = () => request({ url:'api/pda/jb/vehiclelist',