From 1e06bc56b74292f1d69984cc0d0cc489e68e57da Mon Sep 17 00:00:00 2001 From: xiangxy Date: Wed, 6 Aug 2025 15:03:47 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=84=E7=9B=98=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/common/mater-list.vue | 37 +++++++++++---- pages/entry/mater-group.vue | 94 +++++++++++++++---------------------- 2 files changed, 66 insertions(+), 65 deletions(-) diff --git a/pages/common/mater-list.vue b/pages/common/mater-list.vue index c27db37..8534aa7 100644 --- a/pages/common/mater-list.vue +++ b/pages/common/mater-list.vue @@ -6,7 +6,7 @@ - 物料 + 物料信息 @@ -18,16 +18,22 @@ + - + + - + + - + + +
物料名称物料规格 物料编码数量批次号
{{e.material_name}}{{e.material_spec}} {{e.material_code}}
@@ -57,8 +63,10 @@ title: '', val1: '', dataList: [], + // dataList: [{material_name: 'name1', checked: false, qty:'100', pcsn:'p001'},{material_name: 'name2', checked: false},{material_name: 'name3', checked: false}], pkId: '', pkObj: {}, + allCheck: false, reload: false, status: 'more', contentText: { @@ -73,7 +81,7 @@ }, onLoad (options) { this.title = options.title - this.searchList() + // this.searchList() }, methods: { searchList () { @@ -88,6 +96,9 @@ if (res.totalElements > 0) { const dataMap = res.data this.dataList = this.reload ? dataMap : this.dataList.concat(dataMap) + this.dataList.map(el => { + this.$set(el, 'checked', false) + }) this.reload = false } else { this.dataList = [] @@ -108,9 +119,16 @@ this.status = 'noMore' } }, + toAllCheck () { + this.allCheck = !this.allCheck + this.dataList.map(el => { + el.checked = this.allCheck + }) + }, toCheck (e) { - this.pkId = this.pkId === e.material_id ? '' : e.material_id - this.pkObj = this.pkId === e.material_id ? e : {} + e.checked = !e.checked + let arr = this.dataList.filter(el => el.checked === true) + this.allCheck = arr.length === this.dataList.length }, toEmpty () { this.val1 = '' @@ -119,8 +137,9 @@ this.pkId = '' }, toSure () { - if (this.pkId) { - this.$store.dispatch('setPublicObj', this.pkObj) + let arr = this.dataList.filter(el => el.checked === true) + if (arr.length) { + this.$store.dispatch('setPublicArr', arr) uni.navigateBack() } } diff --git a/pages/entry/mater-group.vue b/pages/entry/mater-group.vue index b0b425f..8d20d2b 100644 --- a/pages/entry/mater-group.vue +++ b/pages/entry/mater-group.vue @@ -4,6 +4,14 @@ + + + 源单编码 + + + + + 载具编码 @@ -17,62 +25,36 @@ 物料信息 - + - - - 物料名称 - - - - - - - - 物料规格 - - - - - - - - 物料编码 - - - - - - - - 物料数量 - - - - - - - - 物料批次 - - - - - - - - 源单编码 - - - - + + + + + + + + + + + + + + + + + + + + +
物料名称物料编码数量批次号
{{e.material_name}}{{e.material_code}}{{e.qty}}{{e.pcsn}}
- +
@@ -94,7 +76,8 @@ val1: '', val2: '', val3: '', - currentData: {}, + wlxxtext: '', + dataList: [], options: [], index: '', disabled: false @@ -104,8 +87,8 @@ this.title = options.title }, onShow() { - if (this.$store.getters.publicObj !== '') { - this.currentData = this.$store.getters.publicObj + if (this.$store.getters.publicArr.length) { + this.dataList = this.$store.getters.publicArr } }, methods: { @@ -115,19 +98,18 @@ }) }, toEmpty () { - this.currentData = {} + this.dataList = [] this.index = '' this.disabled = false }, async _groupPlate () { this.disabled = true - if (JSON.stringify(this.currentData) === '{}') { + if (!this.val2 || !this.dataList.length) { this.disabled = false return } try { - this.currentData.stor_code = this.index - let res = await groupPlate(this.currentData.material_id, this.val3, this.currentData.qty, this.val2, this.val1) + let res = await groupPlate(this.dataList, this.val2, this.val1) uni.showToast({ title: res.message, icon: 'none'