From ae24e7283bc2ef61eda5211ebb8d702f930200d0 Mon Sep 17 00:00:00 2001 From: caill <815519168@qq.com> Date: Tue, 24 Jun 2025 16:25:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/outbound/stock-list.vue | 38 +++++++++++++++++++++----------- pages/pick/pick-task.vue | 41 +++++++++++++++++++++++------------ vuex/modules/data.js | 12 ++++++++-- vuex/types.js | 3 ++- 4 files changed, 64 insertions(+), 30 deletions(-) diff --git a/pages/outbound/stock-list.vue b/pages/outbound/stock-list.vue index 2c2c6d4..2cac68b 100644 --- a/pages/outbound/stock-list.vue +++ b/pages/outbound/stock-list.vue @@ -9,7 +9,7 @@ 仓库 - + @@ -17,7 +17,7 @@ 物料编码 - + @@ -25,7 +25,7 @@ 载具编码 - + @@ -33,7 +33,7 @@ 仓位编码 - + @@ -41,7 +41,7 @@ 物料批次 - + @@ -93,12 +93,14 @@ data() { return { title: '', - val1: '', + formData: { + storCode: 'FStockId', + materialCode: '', + vehicleCode: '', + structCode: '', + pcsn: '' + }, options: [{value: 'FStockPallet', text: '托盘库'}, {value: 'FStockId', text: '料箱库'}], - index: 'FStockId', - val2: '', - val3: '', - val4: '', dataList: [], pkId: '', pkObj: {}, @@ -116,6 +118,9 @@ }, onLoad (options) { this.title = options.title + if (this.$store.getters.formData !== '') { + this.formData = this.$store.getters.formData + } }, methods: { searchList () { @@ -124,7 +129,7 @@ this._structattrPage() }, async _structattrPage () { - let res = await structattrPage(this.pageNum + '', this.pageSize + '', this.index, this.val1, true, this.val2, this.val3, this.val4) + let res = await structattrPage(this.pageNum + '', this.pageSize + '', this.formData.storCode, this.formData.materialCode, true, this.formData.pcsn, this.formData.vehicleCode, this.formData.structCode) if (res.code === '200') { this.totalCount = res.totalElements if (res.totalElements > 0) { @@ -156,8 +161,14 @@ this.pkObj = this.pkId === e.id ? e : {} }, toEmpty () { - this.index = '' - this.val1 = '' + this.formData = { + storCode: 'FStockId', + materialCode: '', + vehicleCode: '', + structCode: '', + pcsn: '' + } + this.$store.dispatch('setFormData', '') this.dataList = [] this.pageNum = 1 this.pkId = '' @@ -165,6 +176,7 @@ toSure () { if (this.pkId) { this.$store.dispatch('setPublicObj', this.pkObj) + this.$store.dispatch('setFormData', this.formData) uni.navigateBack() } } diff --git a/pages/pick/pick-task.vue b/pages/pick/pick-task.vue index 10989b8..c9c1948 100644 --- a/pages/pick/pick-task.vue +++ b/pages/pick/pick-task.vue @@ -98,8 +98,9 @@ - - + + + @@ -142,7 +143,8 @@ isChecked1: true, data: {}, disabled: false, - show: false + show: false, + isPrintSuccessful: false }; }, onLoad (options) { @@ -194,9 +196,27 @@ this.isChecked1 = true this.disabled = false this.show = false + this.isPrintSuccessful = false + }, + handlePrint () { + this.disabled = true + if (!this.val1|| !this.val2 || !this.val3) { + this.disabled = false + return + } + if (this.val2 === this.val3) { + uni.showToast({ + title: '出库和入库料箱不能相同', + icon: 'none' + }) + this.disabled = false + return + } + let data = Object.assign({}, this.data, {lxCode: this.val2}) + this.toPrint(data) }, toSure () { - if (!this.val1|| !this.val2 || !this.val3) { + if (!this.val1|| !this.val2 || !this.val3 || (this.isChecked1 && !this.isPrintSuccessful)) { return } if (this.val2 === this.val3) { @@ -209,13 +229,7 @@ this.show = true }, toConfirm () { - if (this.isChecked1) { - this.disabled = true - let data = Object.assign({}, this.data, {lxCode: this.val2}) - this.toPrint(data) - } else { - this._savePickTask() - } + this._savePickTask() }, async _savePickTask () { this.disabled = true @@ -281,9 +295,8 @@ title: '打印成功', icon: 'none' }) - if (this.isChecked1) { - this._savePickTask() - } + this.disabled = false + this.isPrintSuccessful = true } } } diff --git a/vuex/modules/data.js b/vuex/modules/data.js index e2914f9..b7cf909 100644 --- a/vuex/modules/data.js +++ b/vuex/modules/data.js @@ -1,11 +1,13 @@ import * as types from '../types' const state = { publicObj: '', - publicArr: '' + publicArr: '', + formData: '' } const getters = { publicObj: state => state.publicObj, - publicArr: state => state.publicArr + publicArr: state => state.publicArr, + formData: state => state.formData } const actions = { setPublicObj ({commit}, res) { @@ -13,6 +15,9 @@ const actions = { }, setPublicArr ({commit}, res) { commit(types.PUBLIC_ARR, res) + }, + setFormData ({commit}, res) { + commit(types.FORM_DATA, res) } } const mutations = { @@ -21,6 +26,9 @@ const mutations = { }, [types.PUBLIC_ARR] (state, res) { state.publicArr = res + }, + [types.FORM_DATA] (state, res) { + state.formData = res } } export default { diff --git a/vuex/types.js b/vuex/types.js index e66f0dc..36e9930 100644 --- a/vuex/types.js +++ b/vuex/types.js @@ -11,4 +11,5 @@ export const SAVE_TOKEN = 'SAVE_TOKEN' * data */ export const PUBLIC_OBJ = 'PUBLIC_OBJ' -export const PUBLIC_ARR = 'PUBLIC_ARR' \ No newline at end of file +export const PUBLIC_ARR = 'PUBLIC_ARR' +export const FORM_DATA = 'FORM_DATA' \ No newline at end of file