yangan
2024-01-10 9cb5cd3735f58bd62c3ad0d20b89646801bc05bf
pages/public-page/selectSpecifications/selectSpecifications.vue
@@ -45,22 +45,32 @@
               @input="$u.debounce(specInputHandle, 500)"></u-input>
         </u-form-item>
         <!-- 新增不合格称重 -->
         <u-form-item label="不合格罚款"
         <u-form-item label="不合格重量"
            prop="unqualifiedWeight"
            borderBottom>
            <u-input v-model="dataForm.unqualifiedWeight"
               placeholder="请输罚款"
               placeholder="请输入重量"
               type="digit"
               border="bottom"
               @change="v=>checkNum(v)"
               @change="v=>checkNum(v,'unqualifiedWeight')"
               @input="$u.debounce(specInputHandle, 500)"></u-input>
         </u-form-item>
         <u-form-item label="不合格判定" prop="unqualifiedType">
         <!-- <u-form-item label="不合格判定" prop="unqualifiedType">
            <u-radio-group  size='32' v-model="dataForm.unqualifiedType">
            <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>
         </u-form-item> -->
         <u-form-item label="单价"
            prop="penaltyUnitPrice"
            borderBottom>
            <u-input v-model="dataForm.penaltyUnitPrice"
               placeholder="请输入不合格单价"
               type="digit"
               border="bottom"
               @change="v=>checkNum(v,'penaltyUnitPrice')"
               @input="$u.debounce(specInputHandle, 500)"></u-input>
         </u-form-item>
      </u--form>
      <Transition name="slide-fade">
@@ -109,7 +119,8 @@
               secondClass: "",
               specifications: "",
               unqualifiedWeight:'',
               unqualifiedType:''
               // unqualifiedType:'',
               penaltyUnitPrice:''
            },
            index: '',
            takeCoalId: "",
@@ -150,7 +161,12 @@
               message: '请选择值',
               trigger: ['blur', 'change']
            },
            'unqualifiedType':{
            // 'unqualifiedType':{
            //    required: true,
            //    message: '请选择值',
            //    trigger: ['blur', 'change']
            // },
            'penaltyUnitPrice':{
               required: true,
               message: '请选择值',
               trigger: ['blur', 'change']
@@ -209,7 +225,9 @@
          Object.assign(this.dataForm,{firstClass,secondClass,specifications});
          this.dataForm.unqualifiedWeight = this.showWeighCopyStorge[params.index].unqualifiedWeights.split(',')[params.indexTo];
          //不合格类判定
          this.dataForm.unqualifiedType = this.showWeighCopyStorge[params.index].unqualifiedType.split(',')[params.indexTo];
         //  this.dataForm.unqualifiedType = this.showWeighCopyStorge[params.index].unqualifiedType.split(',')[params.indexTo];
          //单价
         this.dataForm.penaltyUnitPrice = this.showWeighCopyStorge[params.index].penaltyUnitPrice.split(',')[params.indexTo];
         },
         //一级品类菜单
         firstClassSelect() {
@@ -294,12 +312,15 @@
                let tempArr =    this.showWeighCopyStorge[this.index].unqualifiedBreed.split(",")
                let tempWeightArr =    this.showWeighCopyStorge[this.index].unqualifiedWeights.split(",")
                let noPinArr =this.showWeighCopyStorge[this.index].unqualifiedType.split(",")
                let noPriceArr = this.showWeighCopyStorge[this.index].penaltyUnitPrice.split(",");
                tempArr[this.params.indexTo] = str;
               tempWeightArr[this.params.indexTo] = this.dataForm.unqualifiedWeight;
               noPinArr[this.params.indexTo] = this.dataForm.unqualifiedType;
               // noPinArr[this.params.indexTo] = this.dataForm.unqualifiedType;
               noPriceArr[this.params.indexTo] = this.dataForm.penaltyUnitPrice;
               this.showWeighCopyStorge[this.index].unqualifiedBreed = tempArr.join(',');
               this.showWeighCopyStorge[this.index].unqualifiedWeights = tempWeightArr.join(',');
               this.showWeighCopyStorge[this.index].unqualifiedType = noPinArr.join(',');
               this.showWeighCopyStorge[this.index].penaltyUnitPrice = noPriceArr.join(',');
               this.showWeighCopyStorge[this.index].breed = this.dataForm.secondClass
               this.showWeighCopyStorge[this.index].spec = this.dataForm.specifications
               //如果这个  tempArr不为 空
@@ -337,19 +358,29 @@
                  tempWeightArr =  [];
               }
               // 添加不合格品类判定
                let noPin;
               if(this.showWeighCopyStorge[this.index].unqualifiedType){
                  noPin = this.showWeighCopyStorge[this.index].unqualifiedType.split(",").filter(Boolean)
                // let noPin;
               // if(this.showWeighCopyStorge[this.index].unqualifiedType){
               //    noPin = this.showWeighCopyStorge[this.index].unqualifiedType.split(",").filter(Boolean)
               // }else{
               //    noPin = []
               // }
               //添加不合格单价
               let noPrice;
               if(this.showWeighCopyStorge[this.index].penaltyUnitPrice){
                  noPrice = this.showWeighCopyStorge[this.index].penaltyUnitPrice.split(",").filter(Boolean)
               }else{
                  noPin = []
                  noPrice = []
               }
               tempWeightArr.push(this.dataForm.unqualifiedWeight);
               tempArr.push(str);
               noPin.push(this.dataForm.unqualifiedType)
               // noPin.push(this.dataForm.unqualifiedType)
               noPrice.push(this.dataForm.penaltyUnitPrice)
               this.showWeighCopyStorge[this.index].unqualifiedBreed = tempArr.join(',')
               this.showWeighCopyStorge[this.index].unqualifiedWeights = tempWeightArr.join(',')
               this.showWeighCopyStorge[this.index].unqualifiedType = noPin.join(',')
               // this.showWeighCopyStorge[this.index].unqualifiedType = noPin.join(',')
               this.showWeighCopyStorge[this.index].penaltyUnitPrice = noPrice.join(',')
               this.showWeighCopyStorge[this.index].breed = this.dataForm.secondClass
               this.showWeighCopyStorge[this.index].spec = this.dataForm.specifications
@@ -386,7 +417,7 @@
               })
   
         },
         checkNum(value){
         checkNum(value,name){
            if (
               value &&
               value.indexOf(".") < 0 &&
@@ -399,7 +430,7 @@
                  
               } // 如果没有小数点,首位不能为类似于 01、02的值
               this.$nextTick(()=>{
                     this.dataForm.unqualifiedWeight  = value.replace(/[^\d.]/g, "");
                     this.dataForm[name]  = value.replace(/[^\d.]/g, "");
                  });
            
         }