|  | @@ -42,7 +42,7 @@
 | 
	
		
			
				|  |  |                <el-form-item :label="item.label" :prop="item.prop" :rules="item.rules">
 | 
	
		
			
				|  |  |                  <el-date-picker v-if="item.type === 'datetime'" style="width: 100%;" v-model="form[item.prop]" :disabled="receiptDisable" size="small" type="date" placeholder="请选择日期" value-format="yyyy-MM-dd HH:mm:ss"/>
 | 
	
		
			
				|  |  |                  <selectComponent v-else-if="item.prop === 'corpId'" :disabled="receiptDisable" v-model="form[item.prop]" :configuration="configuration"/>
 | 
	
		
			
				|  |  | -                <el-select v-else-if="item.prop === 'storageId'" style="width: 100%" :disabled="receiptDisable" @change="warehouseChange" v-model="form[item.prop]" size="small" placeholder="请选择" clearable filterable>
 | 
	
		
			
				|  |  | +                <el-select v-else-if="item.prop === 'storageId'" style="width: 100%" :disabled="receiptDisable" v-model="form[item.prop]" size="small" placeholder="请选择" clearable filterable>
 | 
	
		
			
				|  |  |                    <el-option v-for="(item,index) in storageIdDic" :key="index" :label="item.cname" :value="item.id"></el-option>
 | 
	
		
			
				|  |  |                  </el-select>
 | 
	
		
			
				|  |  |  <!--                <warehouse-select v-else-if="item.prop === 'storageId'" v-model="form[item.prop]" @change="warehouseChange" :configuration="configuration" />-->
 | 
	
	
		
			
				|  | @@ -120,12 +120,10 @@
 | 
	
		
			
				|  |  |                  v-model="row.cntrNo"
 | 
	
		
			
				|  |  |                  placeholder="请输入"
 | 
	
		
			
				|  |  |                  size="small"
 | 
	
		
			
				|  |  | -                @change="selectInventory(row)"
 | 
	
		
			
				|  |  |                ></el-input>
 | 
	
		
			
				|  |  |                <span v-else>{{ row.cntrNo }}</span>
 | 
	
		
			
				|  |  |              </template>
 | 
	
		
			
				|  |  |              <template slot="billWeight" slot-scope="{ row }">
 | 
	
		
			
				|  |  | -              <span v-if="row.$cellEdit" class="required_fields">*</span>
 | 
	
		
			
				|  |  |                <el-input
 | 
	
		
			
				|  |  |                  style="width:90%"
 | 
	
		
			
				|  |  |                  v-if="row.$cellEdit"
 | 
	
	
		
			
				|  | @@ -193,6 +191,18 @@
 | 
	
		
			
				|  |  |                </el-select>
 | 
	
		
			
				|  |  |                <span v-else>{{ row.currency }}</span>
 | 
	
		
			
				|  |  |              </template>
 | 
	
		
			
				|  |  | +            <template slot="taxRate" slot-scope="{ row }">
 | 
	
		
			
				|  |  | +              <el-input
 | 
	
		
			
				|  |  | +                v-if="row.$cellEdit"
 | 
	
		
			
				|  |  | +                v-model="row.taxRate"
 | 
	
		
			
				|  |  | +                size="small"
 | 
	
		
			
				|  |  | +                oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d\d\d\d\d).*$/, "$1.$2")'
 | 
	
		
			
				|  |  | +                autocomplete="off"
 | 
	
		
			
				|  |  | +              >
 | 
	
		
			
				|  |  | +                <i slot="suffix" style="margin-top:3px;margin-right: 10px;display:inline-block">%</i>
 | 
	
		
			
				|  |  | +              </el-input>
 | 
	
		
			
				|  |  | +              <span v-else>{{ row.taxRate }}</span>
 | 
	
		
			
				|  |  | +            </template>
 | 
	
		
			
				|  |  |              <template slot-scope="{row,index}" slot="menu">
 | 
	
		
			
				|  |  |                <el-button
 | 
	
		
			
				|  |  |                  type="text"
 | 
	
	
		
			
				|  | @@ -554,43 +564,43 @@ export default {
 | 
	
		
			
				|  |  |      //货物名称 回显
 | 
	
		
			
				|  |  |      valueName(value,row){
 | 
	
		
			
				|  |  |        this.$set(row,"priceCategory",value)
 | 
	
		
			
				|  |  | -      this.selectInventory(row)
 | 
	
		
			
				|  |  | +      // this.selectInventory(row)
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      //选择仓库  带出库存
 | 
	
		
			
				|  |  | -    warehouseChange(){
 | 
	
		
			
				|  |  | -      this.contactsData.forEach(item =>{
 | 
	
		
			
				|  |  | -        this.selectInventory(item);
 | 
	
		
			
				|  |  | -      })
 | 
	
		
			
				|  |  | -    },
 | 
	
		
			
				|  |  | -    //查询库存
 | 
	
		
			
				|  |  | -    selectInventory(row){
 | 
	
		
			
				|  |  | -      if(row.billNo && row.contractNumber && row.cntrNo && row.priceCategory && this.form.storageId){
 | 
	
		
			
				|  |  | -        const params = {
 | 
	
		
			
				|  |  | -          billNo:row.billNo,
 | 
	
		
			
				|  |  | -          contractNumber:row.contractNumber,
 | 
	
		
			
				|  |  | -          goodsId:row.priceCategory,
 | 
	
		
			
				|  |  | -          storageId:this.form.storageId,
 | 
	
		
			
				|  |  | -          cntrNo:row.cntrNo
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | -        selectJKGoodsNum(params).then(res =>{
 | 
	
		
			
				|  |  | -          if(res.data.data){
 | 
	
		
			
				|  |  | -            this.$set(this.contactsData[row.$index],"inventoryNumber",res.data.data.inQuantity)
 | 
	
		
			
				|  |  | -            this.$set(this.contactsData[row.$index],"inWeight",res.data.data.inWeight)
 | 
	
		
			
				|  |  | -          }else {
 | 
	
		
			
				|  |  | -            this.$set(this.contactsData[row.$index],"inventoryNumber",0.00)
 | 
	
		
			
				|  |  | -            this.$set(this.contactsData[row.$index],"inWeight",0.00)
 | 
	
		
			
				|  |  | -          }
 | 
	
		
			
				|  |  | -        })
 | 
	
		
			
				|  |  | -      }
 | 
	
		
			
				|  |  | -    },
 | 
	
		
			
				|  |  | +    // warehouseChange(){
 | 
	
		
			
				|  |  | +    //   this.contactsData.forEach(item =>{
 | 
	
		
			
				|  |  | +    //     this.selectInventory(item);
 | 
	
		
			
				|  |  | +    //   })
 | 
	
		
			
				|  |  | +    // },
 | 
	
		
			
				|  |  | +    // //查询库存
 | 
	
		
			
				|  |  | +    // selectInventory(row){
 | 
	
		
			
				|  |  | +    //   if(row.billNo && row.contractNumber && row.cntrNo && row.priceCategory && this.form.storageId){
 | 
	
		
			
				|  |  | +    //     const params = {
 | 
	
		
			
				|  |  | +    //       billNo:row.billNo,
 | 
	
		
			
				|  |  | +    //       contractNumber:row.contractNumber,
 | 
	
		
			
				|  |  | +    //       goodsId:row.priceCategory,
 | 
	
		
			
				|  |  | +    //       storageId:this.form.storageId,
 | 
	
		
			
				|  |  | +    //       cntrNo:row.cntrNo
 | 
	
		
			
				|  |  | +    //     }
 | 
	
		
			
				|  |  | +    //     selectJKGoodsNum(params).then(res =>{
 | 
	
		
			
				|  |  | +    //       if(res.data.data){
 | 
	
		
			
				|  |  | +    //         this.$set(this.contactsData[row.$index],"inventoryNumber",res.data.data.inQuantity)
 | 
	
		
			
				|  |  | +    //         this.$set(this.contactsData[row.$index],"inWeight",res.data.data.inWeight)
 | 
	
		
			
				|  |  | +    //       }else {
 | 
	
		
			
				|  |  | +    //         this.$set(this.contactsData[row.$index],"inventoryNumber",0.00)
 | 
	
		
			
				|  |  | +    //         this.$set(this.contactsData[row.$index],"inWeight",0.00)
 | 
	
		
			
				|  |  | +    //       }
 | 
	
		
			
				|  |  | +    //     })
 | 
	
		
			
				|  |  | +    //   }
 | 
	
		
			
				|  |  | +    // },
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      //拿到所有明细合同号 去重加逗号放到主表合同号
 | 
	
		
			
				|  |  |      sumOrderNo(row){
 | 
	
		
			
				|  |  |        const contractNumberList =  this.contactsData.map(item =>{return  item.contractNumber})
 | 
	
		
			
				|  |  |        this.$set(this.form,'orderNo', Array.from(new Set(contractNumberList)).join(","))
 | 
	
		
			
				|  |  | -      if(row){
 | 
	
		
			
				|  |  | -        this.selectInventory(row);
 | 
	
		
			
				|  |  | -      }
 | 
	
		
			
				|  |  | +      // if(row){
 | 
	
		
			
				|  |  | +      //   this.selectInventory(row);
 | 
	
		
			
				|  |  | +      // }
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      //计算
 | 
	
		
			
				|  |  |      // actualQuantityChange(row){
 | 
	
	
		
			
				|  | @@ -632,24 +642,18 @@ export default {
 | 
	
		
			
				|  |  |        }).catch(()=>{
 | 
	
		
			
				|  |  |          row.contractNumber = ''
 | 
	
		
			
				|  |  |        })
 | 
	
		
			
				|  |  | -      this.selectInventory(row);
 | 
	
		
			
				|  |  | +      // this.selectInventory(row);
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      //单价
 | 
	
		
			
				|  |  |      priceChange(row) {
 | 
	
		
			
				|  |  | -      if (!row.price) {
 | 
	
		
			
				|  |  | -        row.price = "";
 | 
	
		
			
				|  |  | -        row.contractAmount = 0
 | 
	
		
			
				|  |  | -      } else {
 | 
	
		
			
				|  |  | -        row.contractAmount = _.multiply(row.billWeight,row.price).toFixed(2);
 | 
	
		
			
				|  |  | +      if (row.price && row.billWeight) {
 | 
	
		
			
				|  |  | +        row.contractAmount = _.multiply(row.billWeight, row.price).toFixed(2);
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      //码单重量
 | 
	
		
			
				|  |  |      billWeightChange(row) {
 | 
	
		
			
				|  |  | -      if (!row.billWeight) {
 | 
	
		
			
				|  |  | -        row.billWeight = "";
 | 
	
		
			
				|  |  | -        row.contractAmount = 0
 | 
	
		
			
				|  |  | -      } else {
 | 
	
		
			
				|  |  | -        row.contractAmount = _.multiply(row.billWeight,row.price).toFixed(2);
 | 
	
		
			
				|  |  | +      if (row.billWeight &&  row.price) {
 | 
	
		
			
				|  |  | +        row.contractAmount = _.multiply(row.billWeight, row.price).toFixed(2);
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      //新增商品信息保存触发
 | 
	
	
		
			
				|  | @@ -714,9 +718,6 @@ export default {
 | 
	
		
			
				|  |  |            if (this.contactsData[i].actualQuantity === (null || "" )) {
 | 
	
		
			
				|  |  |              return this.$message.error(`请输入第${i + 1}行的件数`);
 | 
	
		
			
				|  |  |            }
 | 
	
		
			
				|  |  | -          if (this.contactsData[i].billWeight === (null || "" )) {
 | 
	
		
			
				|  |  | -            return this.$message.error(`请输入第${i + 1}行的码单重量`);
 | 
	
		
			
				|  |  | -          }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          this.form.billNo = this.contactsData.map(item =>{return item.billNo}).join(",")
 | 
	
		
			
				|  |  |          if (valid) {
 | 
	
	
		
			
				|  | @@ -841,7 +842,7 @@ export default {
 | 
	
		
			
				|  |  |          // }
 | 
	
		
			
				|  |  |          delete item.id
 | 
	
		
			
				|  |  |          this.$refs.crudContact.rowCellAdd(item);
 | 
	
		
			
				|  |  | -        this.selectInventory(item)
 | 
	
		
			
				|  |  | +        // this.selectInventory(item)
 | 
	
		
			
				|  |  |        })
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |        this.totalChange()
 |