| | |
| | | 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> |
| | |
| | | :height="0" |
| | | > |
| | | <u-cell |
| | | :title="(index + 1) + '.' + '不合格规格'" |
| | | :title="(index + 1) + '.' + '不合格品类'" |
| | | style="text-indent: 30RPX;" |
| | | @click="editItem(i,index)" |
| | | > |
| | |
| | | </u--list> |
| | | <!-- 增加不合格规矩 --> |
| | | |
| | | <button class="addBtn" type="primary" :plain="false" @click="addUnqualified(i)">添加不合格规矩</button> |
| | | <button class="addBtn" type="primary" :plain="false" @click="addUnqualified(i)">添加不合格品类</button> |
| | | <!-- 物资明细 --> |
| | | <u-action-sheet :actions="goodsList" |
| | | :show="goodsShow" |
| | |
| | | // 点击确认 |
| | | confirmInput() { |
| | | this.loading = true; |
| | | let params = {}; |
| | | 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 = ''; |
| | | } |
| | | if(this.globalShowWeigh[i].unqualifiedWeight){ |
| | | unqualifiedWeightAll = this.globalShowWeigh[i].unqualifiedWeight.split(",").reduce((p,n)=>{return (p - 0) + (n - 0)},0) || '' |
| | | }else{ |
| | | unqualifiedWeightAll ='' |
| | | } |
| | | return { |
| | | ...v, |
| | |
| | | spec: this.globalShowWeigh[i].modifyProductName ? this.globalShowWeigh[i].spec : v.spec, |
| | | inspectionJpg: v.fileList.map(v => v.url.replace(BaseUrl, '')).join(','), |
| | | unqualifiedWeights :this.globalShowWeigh[i].unqualifiedWeights, |
| | | unqualifiedWeight :this.globalShowWeigh[i].unqualifiedWeight.split(",").reduce((p,n)=>{return (p - 0) + (n - 0)},0) |
| | | unqualifiedWeight :unqualifiedWeightAll |
| | | |
| | | } |
| | | }) |
| | |
| | | }, |
| | | // 折扣率输入 |
| | | 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.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的值 |
| | | |
| | | |
| | | this.showWeigh[index].cinderWeight = (value - 0) |
| | | let x = new BigNumber(clean - 0) |
| | | let y = new BigNumber(value - 0) |
| | | let z = new BigNumber(this.globalShowWeigh[index].unqualifiedWeights.split(',').reduce((p,n)=>{ |
| | | let z = new BigNumber(znums.reduce((p,n)=>{ |
| | | return (p - 0) + (n - 0) |
| | | },0)) |
| | | console.log(clean,value,'扣渣'); |