| | |
| | | return { |
| | | id: item.id, |
| | | orderPlanId: item.orderPlanId, |
| | | name: item.xsUserName === null ? item.fleetName : item.xsUserName, |
| | | name: item.xsUserName ? item.xsUserName : item.fleetName, |
| | | carNum: item.carNum, |
| | | xsUserId: item.xsUserId === null ? 0 : item.xsUserId, |
| | | fleetId: item.fleetId === null ? 0 : item.fleetId, |
| | | xsUserId: item.xsUserId ? item.xsUserId : 0, |
| | | fleetId: item.fleetId ? item.fleetId : 0, |
| | | checkboxValue1: '', |
| | | vid: `${new Date().getTime()}${index}${item.id}` |
| | | }; |
| | |
| | | orderPlanId: item.orderPlanId, |
| | | name: item.fleetName, |
| | | carNum: item.carNum, |
| | | xsUserId: item.xsUserId === null ? 0 : item.xsUserId, |
| | | fleetId: item.fleetId === null ? 0 : item.fleetId, |
| | | xsUserId: item.xsUserId ? 0 : item.xsUserId, |
| | | fleetId: item.fleetId ? 0 : item.fleetId, |
| | | checkboxValue1: '', |
| | | vid: `${new Date().getTime()}${index}${item.id}` |
| | | }; |
| | |
| | | return uni.getStorageSync('roleType'); |
| | | }, |
| | | text() { |
| | | return `已领取${this.cars2}张提煤单,剩余${this.carNumSurplus1}张提煤单`; |
| | | return `已领取${this.cars2}张通知单,剩余${this.carNumSurplus1}张通知单`; |
| | | }, |
| | | text1() { |
| | | return `已拥有${this.carNum}张提煤单,剩余${this.carNumSurplusHuodai}张提煤单`; |
| | | return `已拥有${this.carNum}张通知单,剩余${this.carNumSurplusHuodai}张通知单`; |
| | | } |
| | | }, |
| | | methods: { |
| | |
| | | } |
| | | }); |
| | | }, |
| | | // 计算提煤单数量,添加或删除时调用 |
| | | // 计算通知单数量,添加或删除时调用 |
| | | calculate(arr) { |
| | | let total = arr.reduce((prev, cur) => { |
| | | return cur.carNum + prev; |
| | | }, 0); |
| | | console.log(total, '提煤单一共的数据'); |
| | | console.log(total, '通知单一共的数据'); |
| | | if (this.roleType == 1) { |
| | | if (Number(this.cars2) >= total) { |
| | | this.carNumSurplus1 = Number(this.cars2) - total; |
| | |
| | | this.whetherClick1 = false; |
| | | } else { |
| | | this.carNumSurplus1 = 0; |
| | | this.$u.toast('剩余提煤单数量不足'); |
| | | this.$u.toast('剩余通知单数量不足'); |
| | | this.whetherClick = true; |
| | | this.whetherClick1 = true; |
| | | } |
| | |
| | | this.whetherClick1 = false; |
| | | } else { |
| | | this.carNumSurplusHuodai = 0; |
| | | this.$u.toast('剩余提煤单数量不足'); |
| | | this.$u.toast('剩余通知单数量不足'); |
| | | this.whetherClick = true; |
| | | this.whetherClick1 = true; |
| | | } |
| | |
| | | that.calculate(that.jhOrderPlanForwardList); |
| | | if (that.roleType == 1) { |
| | | if (that.jhOrderPlanForwardList[index].carNum < Number(that |
| | | .carNumSurplus1)) { |
| | | .carNumSurplus1)) { |
| | | that.$set(that.jhOrderPlanForwardList[index], 'checkboxValue1', ''); |
| | | that.jhOrderPlanForwardList.forEach((v, i) => { |
| | | if (index != i) { |