| | |
| | | <view class="label-text"> |
| | | 扣渣后净重 |
| | | </view> |
| | | <view class="count">{{ item.weight }}</view> |
| | | <view class="count">{{ item.weight || item.clean}}</view> |
| | | </view> |
| | | </view> |
| | | <!-- 判断是否检验质量 --> |
| | |
| | | } else { |
| | | this.changeglobalShowWeigh(uni.getStorageSync('showWeighCopyStorge')) |
| | | } |
| | | //称重明细无数据时显示物资明细 |
| | | if(!this.coalDetailsData.tmTaskCoalItems.length){ |
| | | this.current = 0; |
| | | } |
| | | } else { |
| | | this.$u.toast('加载失败') |
| | | uni.hideLoading() |
| | |
| | | } |
| | | }) |
| | | }, |
| | | // 校验数据是否合格 |
| | | checkValue(data,target){ |
| | | if(!data.length){ |
| | | return |
| | | } |
| | | let flag = data.find(item=>item[target] <=0); |
| | | console.log(flag,'flag'); |
| | | if(flag){ |
| | | return false |
| | | }else{ |
| | | return true; |
| | | } |
| | | |
| | | }, |
| | | // 物资明细 |
| | | goodsPopoverShow(index) { |
| | | if (this.roleType === 4 && !this.flag) { |
| | |
| | | // 折扣率输入 |
| | | discountInputHandle(value, index, clean) { |
| | | console.log('计算净重',value, index, clean) |
| | | value = Number(value) |
| | | this.showWeigh[index].cinderWeight = Number(value) |
| | | if (clean) { |
| | | let x = new BigNumber(clean) |
| | | let y = new BigNumber(value) |
| | | this.showWeigh[index].weight = x.minus(y).toFixed(2) |
| | | } |
| | | this.showWeigh[index].cinderWeight = (value - 0) |
| | | let x = new BigNumber(clean - 0) |
| | | let y = new BigNumber(value - 0) |
| | | let z = new BigNumber(this.showWeigh[index].unqualifiedWeight - 0) |
| | | console.log(clean,value,this.showWeigh[index].unqualifiedWeight - 0,'扣渣'); |
| | | if(x.minus(y).minus(z).toFixed(2) <= 0){ |
| | | this.showWeigh[index].weight = '0'; |
| | | this.$u.toast('当前净重不合格,请检查皮重,毛重是否准确') |
| | | }else{ |
| | | this.showWeigh[index].weight = x.minus(y).minus(z).toFixed(2) |
| | | } |
| | | |
| | | |
| | | }, |
| | | // 选择不合格品名 |
| | |
| | | }, |
| | | // 不合格重量输入 |
| | | unqualifiedWeightInputHandle(value, index, clean) { |
| | | value = value + 0; |
| | | let x = new BigNumber(clean) |
| | | let y = new BigNumber(value) |
| | | let z; |
| | | if(!this.showWeigh[index].cinderWeight){ |
| | | z = 0; |
| | | }else{ |
| | | z = new BigNumber(this.showWeigh[index].cinderWeight); |
| | | } |
| | | console.log(value, index, clean,'不合格重量输入') |
| | | this.showWeigh[index].weight = x.minus(y).minus(z).toFixed(2) || '' |
| | | // 判断是不是有净重才进行计算 |
| | | let x = new BigNumber(clean - 0) |
| | | let y = new BigNumber(value - 0) |
| | | let z = new BigNumber(this.showWeigh[index].cinderWeight - 0); |
| | | if(x.minus(y).minus(z).toFixed(2) <= 0){ |
| | | this.showWeigh[index].weight = '0'; |
| | | this.$u.toast('当前净重不合格,请检查皮重,毛重是否准确') |
| | | }else{ |
| | | this.showWeigh[index].weight = x.minus(y).minus(z).toFixed(2) ; |
| | | } |
| | | |
| | | |
| | | }, |
| | | // 删除图片 |
| | | deletePic(event) { |