From 9210d98ff85085d17d79efd376f8aafd97dfd1af Mon Sep 17 00:00:00 2001 From: xiaofajia <1665375861@qq.com> Date: Mon, 25 Nov 2024 18:10:13 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=80=E6=96=99=E6=B5=81=E7=A8=8B=E8=BF=98?= =?UTF-8?q?=E6=98=AF=E6=8C=89=E7=85=A7=E7=9B=AE=E5=89=8D=E7=9A=84=E6=B5=81?= =?UTF-8?q?=E7=A8=8B=EF=BC=8C=E9=9C=80=E8=A6=81=E5=A2=9E=E5=8A=A0=E5=8F=8C?= =?UTF-8?q?=E6=96=B9=E6=8B=8D=E7=85=A7=E4=B8=8A=E4=BC=A0=E7=9A=84=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inOutWarehouse/inOutWarehouse.vue | 60 ++++++++++--------- 1 file changed, 32 insertions(+), 28 deletions(-) diff --git a/pages-warehouse/inOutWarehouse/inOutWarehouse.vue b/pages-warehouse/inOutWarehouse/inOutWarehouse.vue index c341c21..98f3001 100644 --- a/pages-warehouse/inOutWarehouse/inOutWarehouse.vue +++ b/pages-warehouse/inOutWarehouse/inOutWarehouse.vue @@ -56,7 +56,7 @@ - + @@ -123,32 +123,36 @@ export default { computed: {}, methods: { async submitBefore(){ - if (this.isReceive){ - if (!this.selectRows || this.selectRows.length === 0){ - uni.showToast({ - title: '请选择配件!', - icon: 'none' - }) - return - } - request({ - url: '/admin-api/repair/worker/listByTicketId?ticketId=' + this.ticketId, - method: 'get' - }).then(res => { - this.chooseStaff = [] - const data = res.data - this.staffs = data.map(item => { - return { - text: item.userName, - value: item.userId - } - }) - this.chooseStaff.push(this.nowStaffId) - this.$refs.popup.open() + if (!this.selectRows || this.selectRows.length === 0){ + uni.showToast({ + title: '请选择配件!', + icon: 'none' }) - }else { - this.submit() + return } + const flag = this.selectRows.filter(item => item.thisNum > 0) + if (!flag || flag.length === 0) { + uni.showToast({ + title: '请设置配件数量!', + icon: 'none' + }) + return + } + request({ + url: '/admin-api/repair/worker/listByTicketId?ticketId=' + this.ticketId, + method: 'get' + }).then(res => { + this.chooseStaff = [] + const data = res.data + this.staffs = data.map(item => { + return { + text: item.userName, + value: item.userId + } + }) + this.chooseStaff.push(this.nowStaffId) + this.$refs.popup.open() + }) }, afterRead(file) { for (let i = 0; i < file.tempFilePaths.length; i++) { @@ -310,14 +314,14 @@ export default { } })] } - if (this.isReceive && this.fileList && this.fileList.length > 0){ + if (this.fileList && this.fileList.length > 0){ this.formData.images = this.fileList.map(item => { return item.path.replace(config.baseImageUrl, "") }).join(",") } - if (this.isReceive && (!this.chooseStaff || this.chooseStaff.length === 0)){ + if ((!this.chooseStaff || this.chooseStaff.length === 0)){ uni.showToast({ - title: '请选择领料人!', + title: `请选择${this.isReceive ? '领' : '退'}料人!`, icon: 'none' }) return