yangan
2023-12-14 f8efcc177dcde3bbeec6a64bf2597a871e2ca64a
pages/driver-page/driver-index/bill-of-lading-details/weighDetail/weighDetail.vue
@@ -46,7 +46,7 @@
                  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>
@@ -280,7 +280,7 @@
               :height="0"
            >
               <u-cell
                  :title="(index + 1) +  '.' + '不合格规格'"
                  :title="(index + 1) +  '.' + '不合格品类'"
                  style="text-indent: 30RPX;"
                  @click="editItem(i,index)"
               >
@@ -329,7 +329,7 @@
      </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"
@@ -778,13 +778,18 @@
         // 点击确认
         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,
@@ -794,7 +799,7 @@
                  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
                  
               }
            })
@@ -871,12 +876,33 @@
         },
         // 折扣率输入
         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,'扣渣');