| | |
| | | success: (res) => { |
| | | if (res.data.code == 1 && res.data.data && res.data.data.length > 0) { |
| | | this.listData = []; |
| | | this.tabs=1; |
| | | this.tabs = 1; |
| | | res.data.data.forEach((item, index) => { |
| | | this.listData.push({ |
| | | index: index + 1, |
| | |
| | | 器具数量: 0 |
| | | }); |
| | | }); |
| | | |
| | | |
| | | this.selectedRows = [...this.listData]; |
| | | } else { |
| | | uni.showToast({ |
| | |
| | | }) |
| | | } |
| | | // 如果是事业一处组织,校验器具数量 |
| | | if (uni.getStorageSync('OrganizationID') === "100007" && uni.getStorageSync('Organization') === "事业一处") { |
| | | const zeroQtyItem = this.listData.find(item => { |
| | | // 考虑0、null、undefined等异常情况 |
| | | const qty = Number(item.器具数量) || 0; |
| | | return qty <= 0; |
| | | }); |
| | | |
| | | if (zeroQtyItem) { |
| | | // 找到第一个数量异常项的位置(索引+1) |
| | | const index = this.listData.indexOf(zeroQtyItem) + 1; |
| | | const code = zeroQtyItem.器具编码 || '未知编码'; |
| | | uni.showToast({ |
| | | title: `第${index}行【${code}】器具数量为0,请检查`, |
| | | icon: 'none', |
| | | duration: 3000 |
| | | }); |
| | | return; |
| | | } |
| | | } |
| | | // if (uni.getStorageSync('OrganizationID') === "100007" && uni.getStorageSync('Organization') === "事业一处") { |
| | | // const zeroQtyItem = this.listData.find(item => { |
| | | // // 考虑0、null、undefined等异常情况 |
| | | // const qty = Number(item.器具数量) || 0; |
| | | // return qty <= 0; |
| | | // }); |
| | | |
| | | // if (zeroQtyItem) { |
| | | // // 找到第一个数量异常项的位置(索引+1) |
| | | // const index = this.listData.indexOf(zeroQtyItem) + 1; |
| | | // const code = zeroQtyItem.器具编码 || '未知编码'; |
| | | // uni.showToast({ |
| | | // title: `第${index}行【${code}】器具数量为0,请检查`, |
| | | // icon: 'none', |
| | | // duration: 3000 |
| | | // }); |
| | | // return; |
| | | // } |
| | | // } |
| | | if (!this.hform.HEmpName) { |
| | | uni.showToast({ |
| | | title: '请选择操作员', |