| | |
| | | |
| | | <view> 扣渣后净重:<text class="count"> {{ cleanWeight(item) ? cleanWeight(item) + '吨' : ''}}</text></view> |
| | | </view> |
| | | <view v-else class='weigh-qualified-no'> |
| | | <view v-else-if ='unqualifiedArr(i).length && item.clean' class='weigh-qualified-no'> |
| | | <view > 扣渣后净重:<text class="count">{{ cleanWeight(item) ? cleanWeight(item) + '吨' : '' }}</text></view> |
| | | <view > 合格净重: <text class="count">{{ item.clean ? item.clean + '吨' : '' }}</text></view> |
| | | <view > 合格净重: <text class="count">{{ qualifiedWeight(item,i) ? qualifiedWeight(item,i) + '吨' : '' }}</text></view> |
| | | </view> |
| | | <view v-else-if ='unqualifiedArr(i).length && !item.clean' class='weigh-qualified-no'> |
| | | |
| | | </view> |
| | | |
| | | </view> |
| | |
| | | <view style="font-size: 35rpx;">{{ coalDetailsData.customerName || '' }}</view> |
| | | </view> |
| | | <!-- 物资明细 --> |
| | | <view class="level"> |
| | | <view class="level" v-if="!flag"> |
| | | <view style="width: 180rpx;"> |
| | | <u--text text="物资明细" |
| | | size='32'></u--text> |
| | |
| | | <u--image :showLoading="true" |
| | | :src="`${BaseUrl}${val}`" |
| | | width="80px" |
| | | height="80px"> |
| | | height="80px" |
| | | @click="imageClick(val)" |
| | | > |
| | | <view slot="error" |
| | | style="font-size: 24rpx;">加载失败</view> |
| | | </u--image> |
| | |
| | | height="150" |
| | | :previewFullImage="true"> |
| | | </u-upload> |
| | | </view> |
| | | </view> |
| | | <u--list |
| | | :height="0" |
| | | style=" margin-left: 50rpx;margin-top: 30rpx;" |
| | |
| | | <view class="tag-select"> |
| | | <text> |
| | | <!-- {{!flag?(globalShowWeigh[i].unqualifiedBreed?globalShowWeigh[i].unqualifiedBreed:item.unqualifiedBreed):(item.unqualifiedBreed||"请选择")}} --> |
| | | {{ el.unqualifiedBreed }} |
| | | {{ el.unsecondClass }} |
| | | </text> |
| | | </view> |
| | | </view> |
| | | <view class="unqualifiedBreed"> |
| | | <view style="width: 180rpx;"> |
| | | <u--text text="不合格规格" |
| | | size='32'></u--text> |
| | | </view> |
| | | <view class="tag-select"> |
| | | <text> |
| | | <!-- {{!flag?(globalShowWeigh[i].unqualifiedBreed?globalShowWeigh[i].unqualifiedBreed:item.unqualifiedBreed):(item.unqualifiedBreed||"请选择")}} --> |
| | | {{ el.unSpecifications }} |
| | | </text> |
| | | </view> |
| | | </view> |
| | |
| | | :closeOnClickOverlay='true' |
| | | @close='unqualifiedClose' |
| | | @select="selectUnqualifiedClick"></u-action-sheet> |
| | | </view> |
| | | </view> |
| | | <!-- 原发出场时间 --> |
| | | <view v-if="roleType!==3"> |
| | | <view> |
| | | <text>货物发货地出场时间或发货磅单时间:</text> |
| | | </view> |
| | | <view> |
| | | <uni-datetime-picker |
| | | v-model="outDate" |
| | | type="datetime" |
| | | @change="datechange" |
| | | /> |
| | | </view> |
| | | </view> |
| | | <!-- 新增 验质备注。验质说明 --> |
| | |
| | | @close='unqualifiedClose' |
| | | @select="selectUnqualifiedClick"></u-action-sheet> |
| | | </view> |
| | | |
| | | |
| | | </view> |
| | | </view> |
| | | |
| | | <!-- 图片预览弹出框 --> |
| | | <view class="previewImage-container"> |
| | | <u-popup :show="previewImageShow" |
| | | mode="center" |
| | | @close="previewImageClose" |
| | | @open="previewImageOpen"> |
| | | <u--image :src="previewImageSrc != null ? BaseUrl + previewImageSrc : ''" |
| | | width="400px" |
| | | height="400px"></u--image> |
| | | </u-popup> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import BigNumber from "bignumber.js" |
| | | import formatDate from '@/utils/date' |
| | | import { BaseUrl } from '@/api/publicInterface.js'; |
| | | import { onlineurl } from '@/api/request.js' |
| | | import { mapState, mapMutations } from "vuex" |
| | | export default { |
| | | data() { |
| | | return { |
| | | dateInpShow:false, |
| | | outDate:'', |
| | | dateValue:'', |
| | | previewImageShow:false, |
| | | qualityInstructions:"", |
| | | previewImageSrc: '', |
| | | penaltyType:[], |
| | | indexFlag:0, // 下标标志位 |
| | | remarks:'', |
| | |
| | | // } |
| | | |
| | | let result = arr.length && arr.map((el,index)=>{ |
| | | let obj = {unqualifiedBreed:el,unqualifiedWeight:temp[index],unqualifiedType:noPin[index],penaltyUnitPrice:noPrice[index]} |
| | | const pinming = el.split("/")[0]; |
| | | const guige = el.split("/")[1]; |
| | | let obj = {unqualifiedBreed:el,unqualifiedWeight:temp[index],unqualifiedType:noPin[index],penaltyUnitPrice:noPrice[index], |
| | | unsecondClass:pinming,unSpecifications:guige |
| | | } |
| | | return obj |
| | | }) |
| | | console.log(result,temp,'arr') |
| | |
| | | }, |
| | | cleanWeight(){ |
| | | return function(item){ |
| | | if(!item.weight){ |
| | | return '' |
| | | }else if(item.weight && !item.unqualifiedWeight){ |
| | | // if(!item.weight){ |
| | | // return '' |
| | | // }else if(item.weight && !item.unqualifiedWeight){ |
| | | // return item.weight |
| | | // }else if(item.weight && item.unqualifiedWeight){ |
| | | // return item.weight |
| | | // } |
| | | if(item.weight){ |
| | | return item.weight |
| | | }else if(item.weight && item.unqualifiedWeight){ |
| | | return (item.weight - (item.unqualifiedWeight - 0)).toFixed(2) |
| | | }else{ |
| | | }else if(!item.clean){ |
| | | return '' |
| | | |
| | | } else if(item.clean && !item.unqualifiedWeight){ |
| | | return item.clean |
| | | }else if(item.clean && item.cinderWeight){ |
| | | return new BigNumber(item.clean - 0).minus(item.cinderWeight - 0); |
| | | } |
| | | console.log(item,'clearnWeight') |
| | | } |
| | | }, |
| | | //合格净重 |
| | | qualifiedWeight(){ |
| | | return function(item,i){ |
| | | console.log(item,'itemnsssajdakdj'); |
| | | let znums; |
| | | if(this.globalShowWeigh[i].unqualifiedWeights){ |
| | | znums = this.globalShowWeigh[i].unqualifiedWeights.split(',') |
| | | }else{ |
| | | znums = [] |
| | | } |
| | | let z = new BigNumber(znums.reduce((p,n)=>{ |
| | | return (p - 0) + (n - 0) |
| | | },0)) |
| | | let y = new BigNumber(item.cinderWeight) |
| | | return new BigNumber(item.clean - 0).minus(z).minus(y); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | }, |
| | |
| | | // let y = new BigNumber(value - 0) // 因为value 是 0 所以需要循环 取减 |
| | | let z = new BigNumber(this.showWeigh[index].cinderWeight - 0); |
| | | let y; |
| | | if(value.filter(Boolean) .length){ |
| | | y = value.reduce((p,n)=>{ |
| | | return (p - 0) + (n - 0); |
| | | },0); |
| | | // if(value.filter(Boolean) .length){ |
| | | // y = value.reduce((p,n)=>{ |
| | | // return (p - 0) + (n - 0); |
| | | // },0); |
| | | |
| | | }else{ |
| | | y = 0; |
| | | } |
| | | // }else{ |
| | | // y = 0; |
| | | // } |
| | | if(clean){ |
| | | 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) ; |
| | | this.showWeigh[index].weight = x.minus(z).toFixed(4); |
| | | } |
| | | } |
| | | |
| | |
| | | uni.hideLoading() |
| | | this.coalDetailsData = res.data; |
| | | this.remarks = res.data.remarks; |
| | | this.dateValue = res.data.startTime; |
| | | this.outDate = res.data.startTime; |
| | | this.qualityInstructions = res.data.qualityInstructions |
| | | this.orderCode = res.data.orderCode |
| | | this.showWeigh = this.coalDetailsData.tmTaskCoalItems ? this.coalDetailsData |
| | |
| | | }) |
| | | }) |
| | | }, |
| | | previewImageClose() { |
| | | this.previewImageShow = false; |
| | | }, |
| | | previewImageOpen() { |
| | | this.previewImageShow = true; |
| | | console.log('preview open'); |
| | | }, |
| | | GetOrderPlan() { |
| | | uni.showLoading({ title: '加载中...' }); |
| | | this.$reqGet('GetOrderPlan').then(res => { |
| | |
| | | } |
| | | }) |
| | | }, |
| | | imageClick(imgStr){ |
| | | console.log(imgStr,'触发') |
| | | this.previewImageSrc = imgStr; |
| | | |
| | | this.$nextTick(() => { |
| | | this.previewImageShow = true; |
| | | }); |
| | | |
| | | |
| | | }, |
| | | // 点击确认 |
| | | confirmInput() { |
| | | let flag = true; |
| | | let params = {},unqualifiedWeightAll; |
| | | params.qualityInstructions = this.qualityInstructions; |
| | | params.remarks = this.remarks; |
| | | params.startTime = this.dateValue; |
| | | console.log( this.showWeigh,' this.showWeigh') |
| | | this.showWeigh = this.showWeigh.map((v, i) => { |
| | | console.log(this.penaltyType,this.$refs.checkbox,'123') |
| | | // let tempArr = v.penaltyType.split(','); |
| | | v.unqualifiedType = ''; |
| | | if(this.globalShowWeigh[i].unqualifiedWeights){ |
| | | unqualifiedWeightAll = this.globalShowWeigh[i].unqualifiedWeights.split(",").reduce((p,n)=>{return (p - 0) + (n - 0)},0).toFixed(2) || '' |
| | | unqualifiedWeightAll = this.globalShowWeigh[i].unqualifiedWeights.split(",").reduce((p,n)=>{return (p - 0) + (n - 0)},0).toFixed(4) || '' |
| | | }else{ |
| | | unqualifiedWeightAll = 0; |
| | | } |
| | |
| | | value = parseFloat(value); |
| | | value = value + ""; // 变回为字符串 |
| | | }else{ |
| | | value = value.replace(/^(-)*(\d+)\.(\d\d).*$/,"$1$2.$3"); |
| | | value = value.replace(/^(-)*(\d+)\.(\d\d\d\d).*$/,"$1$2.$3"); |
| | | this.$nextTick(()=>{ |
| | | this.showWeigh[index].cinderWeight = value.replace(/[^\d.]/g, ""); |
| | | }); |
| | |
| | | this.showWeigh[index].weight = '0'; |
| | | this.$u.toast('当前净重不合格,请检查皮重,毛重是否准确') |
| | | }else{ |
| | | this.showWeigh[index].weight = x.minus(y).minus(z); |
| | | console.log(znums.length) |
| | | this.showWeigh[index].weight = x.minus(y); |
| | | } |
| | | }else{ |
| | | this.$u.toast('当前无净重') |
| | |
| | | this.showWeigh[index].weight = '0'; |
| | | this.$u.toast('当前净重不合格,请检查皮重,毛重是否准确') |
| | | }else{ |
| | | this.showWeigh[index].weight = x.minus(y).minus(z).toFixed(2) ; |
| | | this.showWeigh[index].weight = x.minus(y).minus(z).toFixed(4) ; |
| | | } |
| | | |
| | | |
| | |
| | | // } |
| | | console.log(event,'event') |
| | | |
| | | }, |
| | | dateInpFoucs(){ |
| | | console.log('聚焦'); |
| | | this.dateInpShow = true; |
| | | }, |
| | | datechange(value){ |
| | | console.log('dateChange',value,formatDate.formatDate(new Date(value)) ); |
| | | this.dateValue = (formatDate.formatDate(new Date(value)) + ':' + '00'); |
| | | |
| | | |
| | | } |
| | | }, |
| | | } |