| | |
| | | <view class="num">{{ item.clean }}</view> |
| | | </view> |
| | | </view> |
| | | <view v-if="isShow(item) && isYanz()"> |
| | | <view class="discount"> |
| | | <view class="rate"> |
| | | <view class="label-text"> |
| | |
| | | class="count-input"> |
| | | <u--input placeholder="请输入扣渣" |
| | | border="bottom" |
| | | type="number" |
| | | type="digit" |
| | | clearable |
| | | v-model="item.cinderWeight" |
| | | @input='v=>discountInputHandle(v,i,item.clean)'></u--input> |
| | |
| | | <view class="label-text"> |
| | | 扣渣后净重 |
| | | </view> |
| | | <view class="count">{{ item.weight || item.clean}}</view> |
| | | <view class="count"> {{ cleanWeight(item) }}</view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <!-- 判断是否检验质量 --> |
| | | <view v-if="isShow(item)"> |
| | | <view v-if="isShow(item) && isYanz()"> |
| | | <view class="level"> |
| | | <view style="width: 140rpx;"> |
| | | <view style="width: 180rpx;"> |
| | | <u--text text="供应商" |
| | | size='32'></u--text> |
| | | |
| | | </view> |
| | | <view style="font-size: 35rpx;">{{ coalDetailsData.customerName || '' }}</view> |
| | | </view> |
| | | |
| | | <view class="level"> |
| | | <view style="width: 180rpx;"> |
| | | <u--text text="物料名称" |
| | | size='32'></u--text> |
| | | |
| | | </view> |
| | | <view style="font-size: 35rpx;">{{ (coalDetailsData.coalName ? coalDetailsData.coalName: '') }}</view> |
| | | </view> |
| | | <view class="level"> |
| | | <view style="width: 180rpx;"> |
| | | <u--text text="物资明细" |
| | | size='32'></u--text> |
| | | </view> |
| | |
| | | </text> |
| | | </view> |
| | | </view> |
| | | <view class="unqualifiedBreed"> |
| | | <!-- <view class="unqualifiedBreed"> |
| | | <view style="width: 180rpx;"> |
| | | <u--text text="不合格品名" |
| | | size='32'></u--text> |
| | |
| | | v-else-if="flag"> |
| | | {{item.unqualifiedWeight}} |
| | | </view> |
| | | </view> |
| | | </view> --> |
| | | |
| | | <view class="notice-num"> |
| | | <view class="num-text" |
| | | style="margin-left: 10rpx;"> |
| | | <u--text text="通知数量" |
| | | size='32'></u--text> |
| | | </view> |
| | | <view class="num-input" |
| | | <view class="num-input " |
| | | v-if='roleType===4&&!flag'> |
| | | <u--input placeholder="请输入通知数量" |
| | | <u-input placeholder="请输入通知数量" |
| | | border="bottom" |
| | | clearable |
| | | v-model="item.num"></u--input> |
| | | style="width: 70%;" |
| | | v-model="item.num"> |
| | | <template slot="suffix"> |
| | | <text class="inp-unit">{{ item.numUnit}}</text> |
| | | </template> |
| | | </u-input> |
| | | </view> |
| | | <view class="num-show" |
| | | v-else-if="flag"> |
| | | {{item.num}} |
| | | {{item.num + item.numUnit}} |
| | | </view> |
| | | </view> |
| | | <view class="notice-num"> |
| | |
| | | <view class="num-input" |
| | | v-if='roleType===4&&!flag' |
| | | > |
| | | <u--input placeholder="请输入通知重量" |
| | | <u-input placeholder="请输入通知重量" |
| | | border="bottom" |
| | | clearable |
| | | v-model="item.weight1"></u--input> |
| | | style="width: 70%;" |
| | | v-model="item.weight1"> |
| | | <template slot="suffix"> |
| | | <text class="inp-unit">{{ item.weightUnit }}</text> |
| | | </template> |
| | | </u-input> |
| | | </view> |
| | | <view class="num-show" |
| | | v-else-if="flag"> |
| | | {{item.weight1}} |
| | | {{item.weight1 + item.weightUnit }} |
| | | </view> |
| | | </view> |
| | | <!-- 新增扣罚种类、 扣罚金额,不合格判定种类--> |
| | | <view class="notice-num"> |
| | | <!-- <view class="notice-num"> |
| | | <view class="num-text" |
| | | style="margin-left: 10rpx;"> |
| | | <u--text text="扣罚种类" |
| | |
| | | </view> |
| | | <view class="num-show" |
| | | v-else-if="flag"> |
| | | {{item.penaltyType}} |
| | | {{item.penaltyType == '0' ? '无扣罚' : '其他扣罚'}} |
| | | </view> |
| | | </view> |
| | | </view> --> |
| | | <!-- 扣罚金额 --> |
| | | <view class="notice-num" v-if="item.penaltyType == '其他扣罚'"> |
| | | <view class="notice-num"> |
| | | <view class="num-text" |
| | | style="margin-left: 10rpx;"> |
| | | <u--text text="扣罚金额" |
| | |
| | | {{item.penaltyAmount}} |
| | | </view> |
| | | </view> |
| | | <!--不合格判定种类 --> |
| | | <view class="notice-num" v-if="item.penaltyType == '其他扣罚'" > |
| | | <!-- 单价 --> |
| | | <view class="notice-num"> |
| | | <view class="num-text" |
| | | style="margin-left: 10rpx;"> |
| | | <u--text text="不合格判定种类" |
| | | <u--text text="单价" |
| | | size='32'></u--text> |
| | | </view> |
| | | <view class="num-input" |
| | | v-if='roleType===4&&!flag' |
| | | > |
| | | <u--input placeholder="请输入单价" |
| | | border="bottom" |
| | | clearable |
| | | v-model="item.unitPrice"></u--input> |
| | | </view> |
| | | <view class="num-show" |
| | | v-else-if="flag"> |
| | | {{item.unitPrice}} |
| | | </view> |
| | | </view> |
| | | <!--不合格判定种类 --> |
| | | <view class="notice-num"> |
| | | <view class="num-text" |
| | | style="margin-left: 10rpx;"> |
| | | <u--text text="不合格判定" |
| | | size='32'></u--text> |
| | | </view> |
| | | <view class="num-radio" |
| | |
| | | @click.stop="onFoucus" |
| | | style="height: 50rpx;" |
| | | > |
| | | <u-radio-group size='32' v-model="item.unqualifiedType"> |
| | | <u-radio :label-size="25" :name="1" :label="'长度扣罚'" :disabled="disabled">长度扣罚</u-radio> |
| | | <u-radio-group size='32' v-model="item.penaltyType"> |
| | | <u-radio :label-size="25" :name="'1'" :label="'长度扣罚'" :disabled="disabled">长度扣罚</u-radio> |
| | | <u-radio :label-size="25" :name="'2'" :label="'厚度扣罚'" :disabled="disabled">厚度扣罚</u-radio> |
| | | <u-radio :label-size="25" :name="'3'" :label="'密闭器'" :disabled="disabled">密闭器</u-radio> |
| | | </u-radio-group> |
| | | </view> |
| | | <view class="num-show" |
| | | v-else-if="flag"> |
| | | {{item.unqualifiedType}} |
| | | <text> {{item.penaltyType == 1 ? '长度扣罚' : item.penaltyType == 2 ? '厚度扣罚' :item.penaltyType == 3 ? '密闭器' : null }} </text> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <u-empty v-else icon-size="200" text="''" > |
| | | <u-empty v-if=" isYanz() && !isShow(item) " icon-size="200" text="''" > |
| | | <text>暂未验质</text> |
| | | </u-empty> |
| | | <u-empty v-if="!isYanz()" icon-size="200" text="''" > |
| | | <text>暂无数据</text> |
| | | </u-empty> |
| | | <view style="display: flex;margin-top: 20rpx;margin-left: 20rpx;" |
| | | v-if="item.isImage"> |
| | |
| | | :previewFullImage="true"> |
| | | </u-upload> |
| | | </view> |
| | | <u--list |
| | | :height="0" |
| | | style=" margin-left: 50rpx;margin-top: 30rpx;" |
| | | > |
| | | <u--list-item |
| | | |
| | | v-for="(el,index) in unqualifiedArr(i) " |
| | | style=" box-shadow: 0px 0 0 0px #ccc;" |
| | | :key="index" |
| | | :height="0" |
| | | > |
| | | <u-cell |
| | | :title="(index + 1) + '.' + '不合格品类'" |
| | | style="text-indent: 30RPX;" |
| | | @click="editItem(i,index)" |
| | | > |
| | | <text slot="value" @click.stop="deleteItem(i,index)" style="color: red;">删除</text> |
| | | </u-cell> |
| | | |
| | | <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.unqualifiedBreed }} |
| | | </text> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view> |
| | | <view class="notice-num"> |
| | | <view class="num-text"> |
| | | <u--text text="不合格重量" |
| | | size='32'></u--text> |
| | | </view> |
| | | <view class="num-input" |
| | | v-if='roleType===4&&!flag'> |
| | | <!-- <u--input placeholder="请输入不合格重量" |
| | | border="bottom" |
| | | clearable |
| | | v-model="el.unqualifiedWeight" |
| | | readonly |
| | | @input='v=>unqualifiedWeightInputHandle(v,i,item.clean)'></u--input> --> |
| | | <view class="num-show" |
| | | > {{el.unqualifiedWeight || ''}} |
| | | </view> |
| | | </view> |
| | | <view class="num-show" |
| | | v-else-if="flag"> |
| | | {{el.unqualifiedWeight || ''}} |
| | | </view> |
| | | |
| | | </view> |
| | | <!-- <view class="notice-num"> |
| | | <view class="num-text"> |
| | | <u--text text="不合格品判定" |
| | | size='32'></u--text> |
| | | </view> |
| | | <view class="num-input" |
| | | v-if='roleType===4&&!flag'> |
| | | <view class="num-show"> |
| | | {{selectlist.find(item=>item.value ==el.unqualifiedType ) ? selectlist.find(item=>item.value ==el.unqualifiedType ).name : '' }} |
| | | </view> |
| | | </view> |
| | | <view class="num-show" |
| | | v-else-if="flag"> |
| | | {{selectlist.find(item=>item.value ==el.unqualifiedType ) ? selectlist.find(item=>item.value ==el.unqualifiedType ).name : '' }} |
| | | </view> |
| | | |
| | | </view> --> |
| | | <view class="notice-num"> |
| | | <view class="num-text"> |
| | | <u--text text="单价" |
| | | size='32'></u--text> |
| | | </view> |
| | | <view class="num-input" |
| | | v-if='roleType===4&&!flag'> |
| | | <!-- <u--input placeholder="请输入不合格重量" |
| | | border="bottom" |
| | | clearable |
| | | v-model="el.unqualifiedWeight" |
| | | readonly |
| | | @input='v=>unqualifiedWeightInputHandle(v,i,item.clean)'></u--input> --> |
| | | <view class="num-show" |
| | | > {{el.penaltyUnitPrice || ''}} |
| | | </view> |
| | | </view> |
| | | <view class="num-show" |
| | | v-else-if="flag"> |
| | | {{el.penaltyUnitPrice || ''}} |
| | | </view> |
| | | |
| | | </view> |
| | | |
| | | </view> |
| | | </u--list-item> |
| | | </u--list> |
| | | <!-- 增加不合格规矩 --> |
| | | |
| | | <button class="addBtn" v-if="isShow(item) && isYanz()" type="primary" :plain="false" @click="addUnqualified(i)">添加不合格品类</button> |
| | | <!-- 物资明细 --> |
| | | <u-action-sheet :actions="goodsList" |
| | | :show="goodsShow" |
| | |
| | | </view> |
| | | </view> |
| | | <!-- 新增 验质备注。验质说明 --> |
| | | <view v-if=" isYanz()"> |
| | | <view v-if="coalDetailsData.orderType == '外购'"> |
| | | <view style="padding: 10rpx;"> |
| | | <u-row > |
| | | <u-col span="24" > |
| | |
| | | </u-col> |
| | | </u-row> |
| | | </view> |
| | | </view> |
| | | <view class="confirm-button" |
| | | v-if='roleType===4&&!flag'> |
| | | <u-button type="primary" |
| | |
| | | :loading="loading" |
| | | loading-text="确认"></u-button> |
| | | </view></view> |
| | | </view> |
| | | |
| | | <!-- 物料明细 --> |
| | | <view v-if="!current"> |
| | | <view class="main-block" |
| | | v-for="(item,i) in goodsList" |
| | | :key="item.id"> |
| | | <view class="level"> |
| | | <view style="width: 140rpx;"> |
| | | <view style="width: 180rpx;"> |
| | | <u--text text="物资名称" |
| | | size='32'></u--text> |
| | | </view> |
| | |
| | | data() { |
| | | return { |
| | | qualityInstructions:"", |
| | | indexFlag:0, // 下标标志位 |
| | | remarks:'', |
| | | selectlist:[ |
| | | { |
| | | value: '1', |
| | | name:'长度扣罚', |
| | | name:'超尺扣罚', |
| | | fontSize:'40' |
| | | }, |
| | | { |
| | |
| | | return uni.getStorageSync('roleType')!== 4 && item.iszj == 1 ? true : uni.getStorageSync('roleType')== 4 ? true : false; |
| | | // 已经验质 |
| | | } |
| | | }, |
| | | //判断需不需要验质 |
| | | isYanz(){ |
| | | return function(item){ |
| | | // return ( this.coalDetailsData.orderType !=='外购' || this.coalDetailsData.weighingType !=='回磅') ? false : true; |
| | | if(this.coalDetailsData.orderType =='外购'){ |
| | | if(this.coalDetailsData.weighingType == '回磅'){ |
| | | return true |
| | | }else{ |
| | | return false |
| | | } |
| | | }else if(this.coalDetailsData.orderType =='外销'){ |
| | | return false; |
| | | |
| | | } |
| | | // 已经验质 |
| | | } |
| | | }, |
| | | //计算不合格规格数组 |
| | | unqualifiedArr(){ |
| | | return function(index){ |
| | | let arr = []; |
| | | let temp = []; |
| | | let noPin = []; |
| | | let noPrice = []; |
| | | const item = this.globalShowWeigh[index]; |
| | | console.log(this.globalShowWeigh[index],'index') |
| | | if(item){ |
| | | if(item.unqualifiedBreed){ |
| | | arr = item.unqualifiedBreed.split(","); |
| | | if(item.unqualifiedWeights){ |
| | | temp = item.unqualifiedWeights.toString().split(','); |
| | | } |
| | | if(item.unqualifiedType){ |
| | | noPin = item.unqualifiedType.toString().split(','); |
| | | |
| | | } |
| | | if(item.penaltyUnitPrice){ |
| | | noPrice = item.penaltyUnitPrice.toString().split(',') |
| | | } |
| | | // if(item.penaltyType){ |
| | | // noPin = item.penaltyType.toString().split(','); |
| | | // } |
| | | |
| | | let result = arr.length && arr.map((el,index)=>{ |
| | | let obj = {unqualifiedBreed:el,unqualifiedWeight:temp[index],unqualifiedType:noPin[index],penaltyUnitPrice:noPrice[index]} |
| | | return obj |
| | | }) |
| | | console.log(result,temp,'arr') |
| | | return result; |
| | | |
| | | }else{ |
| | | return [] |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | }, |
| | | cleanWeight(){ |
| | | return function(item){ |
| | | console.log(item,'itemsssss') |
| | | if(!item.weight){ |
| | | return '' |
| | | }else if(item.weight && !item.unqualifiedWeight){ |
| | | return item.weight |
| | | }else if(item.weight && item.unqualifiedWeight){ |
| | | return (item.weight - (item.unqualifiedWeight - 0)).toFixed(2) |
| | | }else{ |
| | | return '' |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | }, |
| | | onShow(params){ |
| | | console.log(params,'paramss') |
| | | this.numAll(this.globalShowWeigh[this.indexFlag].unqualifiedWeights.split(","),this.indexFlag,this.showWeigh[this.indexFlag].clean) |
| | | }, |
| | | mounted() { |
| | | this.roleType === 1 ? this.GetOrderPlan() : this.getTakeCoal() |
| | | this.roleType === 1 ? this.GetOrderPlan() : this.getTakeCoal(); |
| | | |
| | | }, |
| | | onLoad(params) { |
| | | console.log(params,this.showWeighCopyStorge,'params路由') |
| | | console.log(params,this.showWeighCopyStorge,this.globalShowWeigh,'params路由') |
| | | this.orderPlanId = params.orderPlanId ? params.orderPlanId : ''; |
| | | this.flag = params.flag ? params.flag : false; |
| | | this.ModifiedOrderIndex = params.index |
| | |
| | | this.alterUnqualified = params.unqualified === "true" || false |
| | | this.havedSubmit = params.havedSubmit === "true" || false; |
| | | console.log(this.havedSubmit,'this.havedSubmit') |
| | | uni.$on("handClick", res => { |
| | | console.log(res.tempArr); |
| | | this.showWeigh[res.index].tempArr = res.tempArr; |
| | | // 清除监听 |
| | | |
| | | }) |
| | | }, |
| | | methods: { |
| | | ...mapMutations(['changeglobalShowWeigh']), |
| | | numAll(value, index, clean){ |
| | | console.log(value,'valusess') |
| | | // 计算扣渣净重 |
| | | // 判断是不是有净重才进行计算 |
| | | let x = new BigNumber(clean - 0) |
| | | // 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); |
| | | |
| | | }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) ; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | }, |
| | | getTakeCoal() { |
| | | uni.showLoading({ |
| | | title: '加载中' |
| | |
| | | this.orderCode = res.data.orderCode |
| | | this.showWeigh = this.coalDetailsData.tmTaskCoalItems ? this.coalDetailsData |
| | | .tmTaskCoalItems : []; |
| | | this.showWeigh = this.showWeigh.map(v => { |
| | | if(!v.penaltyType) v.penaltyType = '0' |
| | | this.showWeigh = this.showWeigh.map((v,i) => { |
| | | if(!v.tempArr){ |
| | | v.tempArr = '' |
| | | }else{ |
| | | v.tempArr = JSON.parse(v.tempArr) |
| | | } |
| | | |
| | | return { |
| | | ...v, |
| | | modifyProductName: '', |
| | | modifygoodsName: '', |
| | | fileList: [], |
| | | inspectionJpg: v.inspectionJpg.split(','), |
| | | isImage: v.inspectionJpg |
| | | isImage: v.inspectionJpg, |
| | | unqualifiedType:v.penaltyType, |
| | | tempArr:v.tempArr |
| | | } |
| | | }) |
| | | this.showWeighCopy = JSON.parse(JSON.stringify(this.showWeigh)) |
| | | uni.setStorageSync("showWeighCopyStorge", this.showWeighCopy) |
| | | if (this.havedSubmit) { |
| | | this.changeglobalShowWeigh(uni.getStorageSync('showWeighCopyStorgeOther')) |
| | | } else { |
| | | this.changeglobalShowWeigh(uni.getStorageSync('showWeighCopyStorge')) |
| | | } |
| | | uni.setStorageSync('showWeighCopyStorgeOther',this.showWeighCopy) |
| | | // if (this.havedSubmit) { |
| | | // this.changeglobalShowWeigh(uni.getStorageSync('showWeighCopyStorge')) |
| | | // this.changeglobalShowWeigh(uni.getStorageSync('showWeighCopyStorgeOther')) |
| | | // } else { |
| | | // this.changeglobalShowWeigh(uni.getStorageSync('showWeighCopyStorgeOther')) |
| | | // this.changeglobalShowWeigh(uni.getStorageSync('showWeighCopyStorge')) |
| | | // } |
| | | this.changeglobalShowWeigh(uni.getStorageSync('showWeighCopyStorge')) |
| | | this.changeglobalShowWeigh(uni.getStorageSync('showWeighCopyStorgeOther')) |
| | | //称重明细无数据时显示物资明细 |
| | | if(!this.coalDetailsData.tmTaskCoalItems.length){ |
| | | this.current = 0; |
| | |
| | | }, |
| | | // 点击确认 |
| | | confirmInput() { |
| | | this.loading = true; |
| | | let params = {}; |
| | | let flag = true; |
| | | let params = {},unqualifiedWeightAll; |
| | | params.qualityInstructions = this.qualityInstructions; |
| | | params.remarks = this.remarks; |
| | | this.showWeigh = this.showWeigh.map((v, i) => { |
| | | if(!v.penaltyType) { |
| | | v.penaltyAmount = ''; |
| | | v.unqualifiedType = ''; |
| | | v.unqualifiedType = ''; |
| | | if(!v.unitPrice){ |
| | | flag = false; |
| | | } |
| | | |
| | | |
| | | |
| | | if(this.globalShowWeigh[i].unqualifiedWeights){ |
| | | unqualifiedWeightAll = this.globalShowWeigh[i].unqualifiedWeights.split(",").reduce((p,n)=>{return (p - 0) + (n - 0)},0).toFixed(2) || '' |
| | | }else{ |
| | | unqualifiedWeightAll = 0; |
| | | } |
| | | return { |
| | | ...v, |
| | | unqualifiedBreed: this.globalShowWeigh[i].unqualifiedBreed ? this.globalShowWeigh[i] |
| | | .unqualifiedBreed : v.unqualifiedBreed, |
| | | unqualifiedBreed: this.globalShowWeigh[i].unqualifiedBreed , |
| | | breed: this.globalShowWeigh[i].modifyProductName ? this.globalShowWeigh[i].breed : v.breed, |
| | | spec: this.globalShowWeigh[i].modifyProductName ? this.globalShowWeigh[i].spec : v.spec, |
| | | inspectionJpg: v.fileList.map(v => v.url.replace(BaseUrl, '')).join(',') |
| | | |
| | | inspectionJpg: v.fileList.map(v => v.url.replace(BaseUrl, '')).join(','), |
| | | unqualifiedWeights :this.globalShowWeigh[i].unqualifiedWeights ? this.globalShowWeigh[i].unqualifiedWeights : 0, |
| | | unqualifiedWeight :unqualifiedWeightAll , |
| | | // penaltyType:this.globalShowWeigh[i].unqualifiedType, |
| | | tempArr:this.globalShowWeigh[i].tempArr ? JSON.stringify(this.globalShowWeigh[i].tempArr) : '', |
| | | penaltyUnitPrice:this.globalShowWeigh[i].penaltyUnitPrice, |
| | | |
| | | } |
| | | }) |
| | | }); |
| | | if(flag){ |
| | | this.loading = true; |
| | | params.tmTaskCoalItems = this.showWeigh; |
| | | this.$reqPost('updateTmTaskCoalItem', params, 'json').then( |
| | | res => { |
| | |
| | | this.$u.toast(res.msg ? res.msg : '操作失败') |
| | | } |
| | | }) |
| | | }else{ |
| | | this.$u.toast('请输入单价') |
| | | return |
| | | } |
| | | |
| | | }, |
| | | // 校验数据是否合格 |
| | | checkValue(data,target){ |
| | |
| | | this.showWeigh[this.goodsIndex].breed = val.breed |
| | | this.showWeigh[this.goodsIndex].spec = val.spec |
| | | this.showWeigh[this.goodsIndex].weightUnit = val.weightUnit |
| | | this.showWeigh[this.goodsIndex].weight1 = val.weight; |
| | | }, |
| | | // 品名与规格 |
| | | productNamePopoverShow(index) { |
| | |
| | | }, |
| | | // 折扣率输入 |
| | | discountInputHandle(value, index, clean) { |
| | | let znums; |
| | | // if(this.globalShowWeigh[index].unqualifiedWeights){ |
| | | // znums = this.globalShowWeigh[index].unqualifiedWeights.split(',') |
| | | // }else{ |
| | | // znums = [] |
| | | // } |
| | | console.log('计算净重',value, index, clean) |
| | | this.showWeigh[index].cinderWeight = (value - 0) |
| | | this.indexFlag = index; // 记录标识位 |
| | | if ( |
| | | value && |
| | | value.indexOf(".") < 0 && |
| | | value != "" |
| | | ) { |
| | | value = parseFloat(value); |
| | | value = value + ""; // 变回为字符串 |
| | | }else{ |
| | | value = value.replace(/^(-)*(\d+)\.(\d\d).*$/,"$1$2.$3"); |
| | | this.$nextTick(()=>{ |
| | | this.showWeigh[index].cinderWeight = value.replace(/[^\d.]/g, ""); |
| | | }); |
| | | } // 如果没有小数点,首位不能为类似于 01、02的值 |
| | | |
| | | // 如果没有净重 ,则不进行计算 |
| | | if(clean){ |
| | | 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){ |
| | | // let z = new BigNumber(znums.reduce((p,n)=>{ |
| | | // return (p - 0) + (n - 0) |
| | | // },0)) |
| | | console.log(clean,value,'扣渣'); |
| | | if(x.minus(y).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(y); |
| | | } |
| | | }else{ |
| | | this.$u.toast('当前无净重') |
| | | } |
| | | |
| | | |
| | | |
| | | }, |
| | |
| | | // this.unqualifiedShow = true |
| | | // this.unqualifiedIndex = index |
| | | uni.navigateTo({ |
| | | url: `/pages/public-page/selectSpecifications/selectSpecifications?index=${index}&takeCoalId=${this.orderPlanId}&unqualified=${this.willUnqualified}` |
| | | url: `/pages/public-page/selectSpecifications/selectSpecifications?index=${index}&takeCoalId=${this.orderPlanId}&unqualified=${this.willUnqualified}&type=edit` |
| | | }) |
| | | } |
| | | }, |
| | |
| | | unqualifiedWeightInputHandle(value, index, clean) { |
| | | // 判断是不是有净重才进行计算 |
| | | let x = new BigNumber(clean - 0) |
| | | this.indexFlag = index; // 记录标识位 |
| | | let y = new BigNumber(value - 0) |
| | | let z = new BigNumber(this.showWeigh[index].cinderWeight - 0); |
| | | if(x.minus(y).minus(z).toFixed(2) <= 0){ |
| | |
| | | }, |
| | | closeEvent(){ |
| | | this.focusSelect = false; |
| | | }, |
| | | //增加不合格规矩 |
| | | addUnqualified(i){ |
| | | if (this.roleType === 4 && !this.flag) { |
| | | // this.unqualifiedShow = true |
| | | // this.unqualifiedIndex = index |
| | | this.indexFlag = i; // 记录标识位 |
| | | uni.navigateTo({ |
| | | url: `/pages/public-page/selectSpecifications/selectSpecifications?index=${i}&takeCoalId=${this.orderPlanId}&unqualified=${this.willUnqualified}&type=add` |
| | | }) |
| | | console.log(this.globalShowWeigh[i],'2222') |
| | | // this.numAll(this.globalShowWeigh[i].unqualifiedWeights.split(","),i,this.showWeigh[i].clean) |
| | | } |
| | | }, |
| | | deleteItem(i,index){ |
| | | let {unqualifiedBreed,unqualifiedWeights,unqualifiedType,penaltyUnitPrice} = this.globalShowWeigh[i]; |
| | | this.indexFlag = i; // 记录标识位 |
| | | console.log(this.globalShowWeigh[i],'index') |
| | | if (this.roleType === 4 && !this.flag) { |
| | | if( unqualifiedBreed !== void 0 && unqualifiedWeights!== void 0 ){ |
| | | if(unqualifiedBreed.split(',').length > 1){ |
| | | // unqualifiedBreed = unqualifiedBreed.split(',').splice(index ,1).join(",") |
| | | let strArr = unqualifiedBreed.split(','); |
| | | strArr.splice(index ,1) |
| | | unqualifiedBreed = strArr.join(",") |
| | | }else{ |
| | | unqualifiedBreed = ''; |
| | | } |
| | | |
| | | if(unqualifiedWeights.split(',').length > 1){ |
| | | // unqualifiedWeights = unqualifiedWeights.split(',').splice(index,1).join(",") |
| | | let strArr = unqualifiedWeights.split(','); |
| | | strArr.splice(index ,1) |
| | | unqualifiedWeights = strArr.join(",") |
| | | }else{ |
| | | unqualifiedWeights = ''; |
| | | } |
| | | |
| | | // if(unqualifiedType.split(",").length > 1){ |
| | | // let strArr = unqualifiedType.split(','); |
| | | // strArr.splice(index ,1) |
| | | // unqualifiedType = strArr.join(",") |
| | | // }else{ |
| | | // unqualifiedType = ''; |
| | | // } |
| | | if(penaltyUnitPrice.split(",").length > 1){ |
| | | let strArr = penaltyUnitPrice.split(','); |
| | | strArr.splice(index ,1) |
| | | penaltyUnitPrice = strArr.join(",") |
| | | }else{ |
| | | penaltyUnitPrice = ''; |
| | | } |
| | | this.globalShowWeigh[i].unqualifiedBreed = unqualifiedBreed; |
| | | this.globalShowWeigh[i].unqualifiedWeights = unqualifiedWeights; |
| | | // this.globalShowWeigh[i].unqualifiedType = unqualifiedType; |
| | | this.globalShowWeigh[i].penaltyUnitPrice = penaltyUnitPrice; |
| | | this.globalShowWeigh[i].tempArr.splice(index,1) |
| | | console.log(this.globalShowWeigh[i].unqualifiedBreed,'unqualifiedBreed') |
| | | this.changeglobalShowWeigh(this.globalShowWeigh) |
| | | |
| | | } |
| | | this.numAll(this.globalShowWeigh[this.indexFlag].unqualifiedWeights.split(","),this.indexFlag,this.showWeigh[this.indexFlag].clean) |
| | | console.log(this.globalShowWeigh[i],'deleteItem'); |
| | | } |
| | | |
| | | }, |
| | | editItem(i,index){ |
| | | this.indexFlag = i; // 记录标识位 |
| | | if (this.roleType === 4 && !this.flag) { |
| | | // this.unqualifiedShow = true |
| | | // this.unqualifiedIndex = index |
| | | uni.navigateTo({ |
| | | url: `/pages/public-page/selectSpecifications/selectSpecifications?index=${i}&takeCoalId=${this.orderPlanId}&unqualified=${this.willUnqualified}&type=edit&indexTo=${index}` |
| | | }) |
| | | } |
| | | } |
| | | }, |
| | | } |
| | |
| | | |
| | | /deep/ .u-picker { |
| | | height: 600rpx; |
| | | } |
| | | .addBtn{ |
| | | width: 65%; |
| | | font-size: 26rpx; |
| | | background-color: #3c9cff;; |
| | | } |
| | | |
| | | .main { |
| | |
| | | .num-input { |
| | | width: 60%; |
| | | border-bottom: 1px solid rgb(218, 219, 222); |
| | | position: relative; |
| | | } |
| | | .num-radio{ |
| | | width: 60%; |