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