Browse Source

前端gjy

gjy 3 years ago
parent
commit
c01f35d089

+ 179 - 27
src/views/warehouse/warehouseManagementDelivery.vue

@@ -35,22 +35,43 @@
         </h2>
         <div class="small-title">基本信息</div>
         <ws-info-table>
+          <ws-form-item label="合同编号" span="1" prop="contractNo">
+            <ws-select
+              v-model="deptBudgetList.contractNo"
+              placeholder="请选择合同编号或移库任务编号"
+              class="typeselect"
+              @change='contractNoChange'
+            >
+              <ws-option
+                v-for="item in outContractNo"
+                :key="item.constKey"
+                :label="item.contractNo"
+                :value="item.contractNo"
+              />
+            </ws-select>
+          </ws-form-item>
           <!-- 货名 -->
           <ws-form-item label="货名" span="1">
             <ws-select
+            disabled
               v-model="deptBudgetList.goodsName"
-              placeholder=""
+              placeholder
               class="typeselect"
               @change="selectgoodsName"
             >
               <ws-option
                 v-for="item in goodnameList"
                 :key="item.constKey"
-                :label="item.goodsName"
-                :value="item.goodsName"
+                :label="item.constValue"
+                :value="item.constValue"
               />
             </ws-select>
           </ws-form-item>
+          <ws-form-item label="类型" span="1" prop="type">
+              <ws-select v-model="deptBudgetList.type"  @change="typeChange">
+                <ws-option v-for="item in typeList" :key="item" :label="item" :value="item" />
+              </ws-select>
+            </ws-form-item>
           <!--毛重(吨)-->
           <ws-form-item label="毛重(吨)" span="1" prop="grossWeight">
             <ws-input
@@ -61,13 +82,9 @@
               size="small"
             />
           </ws-form-item>
+
           <!--皮重(吨)-->
-          <ws-form-item
-            label="皮重(吨)"
-            span="1"
-            prop="tare"
-            class="readonly"
-          >
+          <ws-form-item label="皮重(吨)" span="1" prop="tare" class="readonly">
             <ws-input
               @input="tarechange"
               v-model="deptBudgetList.tare"
@@ -79,10 +96,54 @@
           <!--净重(吨)-->
           <ws-form-item label="净重(吨)" span="1" prop="netWeight">
             <ws-input
-              :readonly="readonly"
-              v-model.number="deptBudgetList.netWeight"
+              readonly="readonly"
+              v-model="deptBudgetList.netWeight"
               placeholder="不可编辑,自动计算"
-              type="number"
+              maxlength="120"
+              size="small"
+            />
+          </ws-form-item>
+          <ws-form-item v-if='deptBudgetList.type=="潮粮"' label="扣重比" span="1" prop="buckleWeightRatio" class="readonly">
+            <ws-input
+              @input='pureweight'
+              v-model="deptBudgetList.buckleWeightRatio"
+              placeholder="请输入扣重比"
+              maxlength="100"
+              size="small"
+            />
+          </ws-form-item>
+          <ws-form-item v-if='deptBudgetList.type=="潮粮"' label="干粮水分占比" span="1" prop="solidGrainWater" class="readonly">
+            <ws-input
+            @input='pureweight'
+              v-model="deptBudgetList.solidGrainWater"
+              placeholder="请输入干粮水分占比"
+              maxlength="100"
+              size="small"
+            />
+          </ws-form-item>
+          <ws-form-item v-if='deptBudgetList.type=="潮粮"' label="潮粮水分占比" span="1" prop="tidalGrainWater" class="readonly">
+            <ws-input
+            @input='pureweight'
+              v-model="deptBudgetList.tidalGrainWater"
+              placeholder="请输入潮粮水分占比"
+              maxlength="100"
+              size="small"
+            />
+          </ws-form-item>
+          <ws-form-item v-if='deptBudgetList.type=="潮粮"' label="纯重" span="1" prop="pureWeight" class="readonly">
+            <ws-input
+              disabled
+              v-model="deptBudgetList.pureWeight"
+              placeholder="不可编辑,自动计算"
+              maxlength="100"
+              size="small"
+            />
+          </ws-form-item>
+          <!--净重(吨)-->
+          <ws-form-item label="扣款" span="1" prop="deductionAmount">
+            <ws-input
+              v-model="deptBudgetList.deductionAmount"
+              placeholder="请输入扣款金额"
               maxlength="120"
               size="small"
             />
@@ -159,21 +220,6 @@
               size="small"
             />
           </ws-form-item>
-          <!--合同编号-->
-          <ws-form-item label="合同编号" span="1" prop="contractNo">
-            <ws-select
-              v-model="deptBudgetList.contractNo"
-              placeholder="请选择合同编号或移库任务编号"
-              class="typeselect"
-            >
-              <ws-option
-                v-for="item in outContractNo"
-                :key="item.constKey"
-                :label="item.contractNo"
-                :value="item.contractNo"
-              />
-            </ws-select>
-          </ws-form-item>
         </ws-info-table>
       </div>
       <div class="small-title">上传仓库照片</div>
@@ -324,6 +370,7 @@ export default {
       // 提交类型
       submitType: true,
       deliveryType: [],
+      typeList:['干粮','潮粮'],
       outContractNo: [],
       appendixIdsAdd: '',
       uploadSuccess: {},
@@ -353,6 +400,7 @@ export default {
       },
       contractList: [],
       deptBudgetList: {
+        type:'干粮',
         warehouseInOutDetail: {},
       },
       historyList: [],
@@ -379,6 +427,18 @@ export default {
     revert() {
       this.$router.push({ path: 'warehouseManagementList' })
     },
+    typeChange(e){
+
+    },
+    contractNoChange(e){
+      for (var i = 0; i < this.outContractNo.length; i++) {
+        if (this.outContractNo[i].contractNo == e) {
+          this.deptBudgetList.goodsName = this.outContractNo[i].goodsName
+          this.deptBudgetList.goodsNameKey = this.outContractNo[i].goodsNameKey
+        }
+      }
+    },
+    
     dataFilter(val) {
       // console.log(val,"名")
       this.deptBudgetList.staffList = val
@@ -404,6 +464,12 @@ export default {
         }
       }
     },
+    pureweight(e){
+      console.log(this.deptBudgetList)
+      if(this.deptBudgetList.netWeight&&this.deptBudgetList.tidalGrainWater&&this.deptBudgetList.solidGrainWater&&this.deptBudgetList.buckleWeightRatio){
+        this.deptBudgetList.pureWeight=(this.deptBudgetList.netWeight*(100-(this.deptBudgetList.tidalGrainWater-this.deptBudgetList.solidGrainWater)*this.deptBudgetList.buckleWeightRatio))/100
+      }
+    },
     temporaryStorage() {
       if (!this.deptBudgetList.goodsName) {
         this.$message({
@@ -707,6 +773,7 @@ export default {
               this.deptBudgetList.compId =
                 sessionStorage.getItem('ws-pf_compId')
               this.deptBudgetList.inOutFlag = 1
+              this.deptBudgetList.pcFlag = 1
               this.deptBudgetList.statusFlag = 1
               addstorageputList(this.deptBudgetList)
                 .toPromise()
@@ -799,6 +866,91 @@ export default {
         })
         return
       }
+      if (this.deptBudgetList.type=='潮粮'&&!this.deptBudgetList.buckleWeightRatio) {
+        this.$message({
+          message: '扣重比不能为空',
+          type: 'warning'
+        })
+        return
+      }
+      if (
+        this.deptBudgetList.type=='潮粮'&&this.deptBudgetList.buckleWeightRatio < 0 ||
+        this.deptBudgetList.type=='潮粮'&&this.deptBudgetList.buckleWeightRatio > 3 ||
+        (this.deptBudgetList.type=='潮粮'&&String(this.deptBudgetList.buckleWeightRatio).indexOf('.') != -1 &&
+          String(this.deptBudgetList.buckleWeightRatio).length -
+            (String(this.deptBudgetList.buckleWeightRatio).indexOf('.') + 1) >
+            2)
+      ) {
+        this.$message({
+          message: '扣重比输入错误',
+          type: 'warning'
+        })
+        return
+      }
+      if (this.deptBudgetList.type=='潮粮'&&!this.deptBudgetList.tidalGrainWater) {
+        this.$message({
+          message: '潮粮水分不能为空',
+          type: 'warning'
+        })
+        return
+      }
+      if (
+        this.deptBudgetList.type=='潮粮'&&this.deptBudgetList.tidalGrainWater < 1 ||
+        this.deptBudgetList.type=='潮粮'&&this.deptBudgetList.tidalGrainWater > 40 ||
+        (this.deptBudgetList.type=='潮粮'&&String(this.deptBudgetList.tidalGrainWater).indexOf('.') != -1 &&
+          String(this.deptBudgetList.tidalGrainWater).length -
+            (String(this.deptBudgetList.tidalGrainWater).indexOf('.') + 1) >
+            2)
+      ) {
+        this.$message({
+          message: '潮粮水分输入错误',
+          type: 'warning'
+        })
+        return
+      }
+      if (this.deptBudgetList.type=='潮粮'&&!this.deptBudgetList.solidGrainWater) {
+        this.$message({
+          message: '干粮水分不能为空',
+          type: 'warning'
+        })
+        return
+      }
+      if (
+        this.deptBudgetList.type=='潮粮'&&this.deptBudgetList.solidGrainWater < 1 ||
+        this.deptBudgetList.type=='潮粮'&&this.deptBudgetList.solidGrainWater > 40 ||
+        (this.deptBudgetList.type=='潮粮'&&String(this.deptBudgetList.solidGrainWater).indexOf('.') != -1 &&
+          String(this.deptBudgetList.solidGrainWater).length -
+            (String(this.deptBudgetList.solidGrainWater).indexOf('.') + 1) >
+            1)
+      ) {
+        this.$message({
+          message: '干粮水分输入错误',
+          type: 'warning'
+        })
+        return
+      }
+      if (!this.deptBudgetList.deductionAmount) {
+        this.$message({
+          message: '扣款不能为空',
+          type: 'warning'
+        })
+        return
+      }
+      if (
+        this.deptBudgetList.deductionAmount < 0 ||
+        this.deptBudgetList.deductionAmount > 10000 ||
+        (String(this.deptBudgetList.deductionAmount).indexOf('.') != -1 &&
+          String(this.deptBudgetList.deductionAmount).length -
+            (String(this.deptBudgetList.deductionAmount).indexOf('.') + 1) >
+            2)
+      ) {
+        this.$message({
+          message: '扣款输入错误',
+          type: 'warning'
+        })
+        return
+      }
+
       if (!this.deptBudgetList.agent) {
         this.$message({
           message: '经办人不能为空!',

+ 20 - 3
src/views/warehouse/warehouseManagementNoComplete.vue

@@ -228,8 +228,16 @@ export default {
             warehouseInOutDetail: row.warehouseInOutDetail,
             warehouseType: this.deptBudgetList.warehouseType,
             createType: this.createType,
-            temporaryOutType : row.temporaryOutType
-          
+            temporaryOutType : row.temporaryOutType,
+            cost:row.cost,
+            freight:row.freight,
+            type:row.type,
+            buckleWeightRatio:row.buckleWeightRatio,
+            tidalGrainWater:row.tidalGrainWater,
+            solidGrainWater:row.solidGrainWater,
+            pureWeight:row.pureWeight,
+            deductionAmount:row.deductionAmount,
+            deductionWeight:row.deductionWeight
           },
         })
       } else if (row.inOutFlag == 1) {
@@ -260,7 +268,16 @@ export default {
             warehouseName: row.warehouseName,
             warehouseInOutDetail: row.warehouseInOutDetail,
             warehouseType: this.deptBudgetList.warehouseType,
-             temporaryOutType : this.temporaryOutType
+            temporaryOutType : this.temporaryOutType,
+            cost:row.cost,
+            freight:row.freight,
+            type:row.type,
+            buckleWeightRatio:row.buckleWeightRatio,
+            tidalGrainWater:row.tidalGrainWater,
+            solidGrainWater:row.solidGrainWater,
+            pureWeight:row.pureWeight,
+            deductionAmount:row.deductionAmount,
+            deductionWeight:row.deductionWeight
           },
         })
       }

+ 191 - 27
src/views/warehouse/warehouseManagementPerfectDelivery.vue

@@ -34,11 +34,27 @@
         </h2>
         <div class="small-title">基本信息</div>
         <ws-info-table>
+         <ws-form-item label="合同编号" span="1" prop="contractNo">
+            <ws-select
+              v-model="dataList.contractNo"
+              placeholder="请选择合同编号或移库任务编号"
+              class="typeselect"
+              @change='contractNoChange'
+            >
+              <ws-option
+                v-for="item in outContractNo"
+                :key="item.constKey"
+                :label="item.contractNo"
+                :value="item.contractNo"
+              />
+            </ws-select>
+          </ws-form-item>
           <!-- 货名 -->
           <ws-form-item label="货名" span="1">
             <ws-select
+            disabled
               v-model="dataList.goodsName"
-              placeholder=""
+              placeholder
               class="typeselect"
               @change="selectgoodsName"
             >
@@ -50,6 +66,11 @@
               />
             </ws-select>
           </ws-form-item>
+          <ws-form-item label="类型" span="1" prop="type">
+              <ws-select v-model="dataList.type"  @change="typeChange">
+                <ws-option v-for="item in typeList" :key="item" :label="item" :value="item" />
+              </ws-select>
+            </ws-form-item>
           <!--毛重(吨)-->
           <ws-form-item label="毛重(吨)" span="1" prop="grossWeight">
             <ws-input
@@ -62,12 +83,7 @@
           </ws-form-item>
 
           <!--皮重(吨)-->
-          <ws-form-item
-            label="皮重(吨)"
-            span="1"
-            prop="tare"
-            class="readonly"
-          >
+          <ws-form-item label="皮重(吨)" span="1" prop="tare" class="readonly">
             <ws-input
               @input="tarechange"
               v-model="dataList.tare"
@@ -76,14 +92,57 @@
               size="small"
             />
           </ws-form-item>
-
           <!--净重(吨)-->
           <ws-form-item label="净重(吨)" span="1" prop="netWeight">
             <ws-input
-              :readonly="readonly"
-              v-model.number="dataList.netWeight"
+              readonly="readonly"
+              v-model="dataList.netWeight"
+              placeholder="不可编辑,自动计算"
+              maxlength="120"
+              size="small"
+            />
+          </ws-form-item>
+          <ws-form-item v-if='dataList.type=="潮粮"' label="扣重比" span="1" prop="buckleWeightRatio" class="readonly">
+            <ws-input
+              @input='pureweight'
+              v-model="dataList.buckleWeightRatio"
+              placeholder="请输入扣重比"
+              maxlength="100"
+              size="small"
+            />
+          </ws-form-item>
+          <ws-form-item v-if='dataList.type=="潮粮"' label="干粮水分占比" span="1" prop="solidGrainWater" class="readonly">
+            <ws-input
+            @input='pureweight'
+              v-model="dataList.solidGrainWater"
+              placeholder="请输入干粮水分占比"
+              maxlength="100"
+              size="small"
+            />
+          </ws-form-item>
+          <ws-form-item v-if='dataList.type=="潮粮"' label="潮粮水分占比" span="1" prop="tidalGrainWater" class="readonly">
+            <ws-input
+            @input='pureweight'
+              v-model="dataList.tidalGrainWater"
+              placeholder="请输入潮粮水分占比"
+              maxlength="100"
+              size="small"
+            />
+          </ws-form-item>
+          <ws-form-item v-if='dataList.type=="潮粮"' label="纯重" span="1" prop="pureWeight" class="readonly">
+            <ws-input
+              disabled
+              v-model="dataList.pureWeight"
               placeholder="不可编辑,自动计算"
-              type="number"
+              maxlength="100"
+              size="small"
+            />
+          </ws-form-item>
+          <!--净重(吨)-->
+          <ws-form-item label="扣款" span="1" prop="deductionAmount">
+            <ws-input
+              v-model="dataList.deductionAmount"
+              placeholder="请输入扣款金额"
               maxlength="120"
               size="small"
             />
@@ -161,21 +220,6 @@
               size="small"
             />
           </ws-form-item>
-
-          <ws-form-item label="合同编号" span="1">
-            <ws-select
-              v-model="dataList.contractNo"
-              placeholder="请选择合同编号"
-              class="typeselect"
-            >
-              <ws-option
-                v-for="item in outContractNo"
-                :key="item.constKey"
-                :label="item.contractNo"
-                :value="item.contractNo"
-              />
-            </ws-select>
-          </ws-form-item>
         </ws-info-table>
       </div>
       <div class="small-title">上传仓库照片</div>
@@ -321,6 +365,7 @@ export default {
       // 年
       year: '',
       readonly: true,
+      typeList:['干粮','潮粮'],
       deptBudgetTotal: 0,
       currentPage: 1,
       pageSize: 10,
@@ -330,9 +375,12 @@ export default {
       startDate: null,
       endDate: null,
       goodnameList: {},
-
+      tranCarInfoList:[],
       staffList: [],
       options: [],
+      options1: [],
+      options2: [],
+      carstatus:false,
       storageType: [],
       deliveryType: [],
       outContractNo: [],
@@ -376,6 +424,15 @@ export default {
         inOutType: '',
         goodsName: '',
         warehouseInOutDetail: {},
+        cost:'',
+        freight:0,
+        type:'',
+        buckleWeightRatio:'',
+        tidalGrainWater:'',
+        solidGrainWater:'',
+        pureWeight:'',
+        deductionAmount:'',
+        deductionWeigh:'',
       },
       historyList: [],
 
@@ -416,6 +473,12 @@ export default {
     console.log(this.dataList)
   },
   methods: {
+    pureweight(status){
+      console.log(this.deptBudgetList)
+      if(this.deptBudgetList.netWeight&&this.deptBudgetList.tidalGrainWater&&this.deptBudgetList.solidGrainWater&&this.deptBudgetList.buckleWeightRatio){
+        this.deptBudgetList.pureWeight=(this.deptBudgetList.netWeight*(100-(this.deptBudgetList.tidalGrainWater-this.deptBudgetList.solidGrainWater)*this.deptBudgetList.buckleWeightRatio))/100
+      }
+    },
     //返回按钮
     revert() {
       this.$router.go(-1)
@@ -438,6 +501,7 @@ export default {
         this.options = this.staffList
       }
     },
+
     selectstaff(e) {
       for (var i = 0; i < this.staffList.length; i++) {
         if (this.staffList[i].staffName == e) {
@@ -473,6 +537,22 @@ export default {
         .catch(() => {
           return false
         })
+    },
+    contractNoChange(e){
+      for (var i = 0; i < this.outContractNo.length; i++) {
+        if (this.outContractNo[i].contractNo == e) {
+          this.dataList.goodsName = this.outContractNo[i].goodsName
+          this.dataList.goodsNameKey = this.outContractNo[i].goodsNameKey
+          if(this.outContractNo[i].tranCarInfoList){
+            this.options2=this.outContractNo[i].tranCarInfoList
+            this.tranCarInfoList=this.outContractNo[i].tranCarInfoList
+            this.carstatus=true
+          }
+        }
+      }
+    },
+    typeChange(e){
+
     },
     //提交按钮
     submit() {
@@ -518,6 +598,90 @@ export default {
         })
         return
       }
+      if (this.dataList.type=='潮粮'&&!this.dataList.buckleWeightRatio) {
+        this.$message({
+          message: '扣重比不能为空',
+          type: 'warning'
+        })
+        return
+      }
+      if (
+        this.dataList.type=='潮粮'&&this.dataList.buckleWeightRatio < 0 ||
+        this.dataList.type=='潮粮'&&this.dataList.buckleWeightRatio > 3 ||
+        (this.dataList.type=='潮粮'&&String(this.dataList.buckleWeightRatio).indexOf('.') != -1 &&
+          String(this.dataList.buckleWeightRatio).length -
+            (String(this.dataList.buckleWeightRatio).indexOf('.') + 1) >
+            2)
+      ) {
+        this.$message({
+          message: '扣重比输入错误',
+          type: 'warning'
+        })
+        return
+      }
+      if (this.dataList.type=='潮粮'&&!this.dataList.tidalGrainWater) {
+        this.$message({
+          message: '潮粮水分不能为空',
+          type: 'warning'
+        })
+        return
+      }
+      if (
+        this.dataList.type=='潮粮'&&this.dataList.tidalGrainWater < 1 ||
+        this.dataList.type=='潮粮'&&this.dataList.tidalGrainWater > 40 ||
+        (this.dataList.type=='潮粮'&&String(this.dataList.tidalGrainWater).indexOf('.') != -1 &&
+          String(this.dataList.tidalGrainWater).length -
+            (String(this.dataList.tidalGrainWater).indexOf('.') + 1) >
+            2)
+      ) {
+        this.$message({
+          message: '潮粮水分输入错误',
+          type: 'warning'
+        })
+        return
+      }
+      if (this.dataList.type=='潮粮'&&!this.dataList.solidGrainWater) {
+        this.$message({
+          message: '干粮水分不能为空',
+          type: 'warning'
+        })
+        return
+      }
+      if (
+        this.dataList.type=='潮粮'&&this.dataList.solidGrainWater < 1 ||
+        this.dataList.type=='潮粮'&&this.dataList.solidGrainWater > 40 ||
+        (this.dataList.type=='潮粮'&&String(this.dataList.solidGrainWater).indexOf('.') != -1 &&
+          String(this.dataList.solidGrainWater).length -
+            (String(this.dataList.solidGrainWater).indexOf('.') + 1) >
+            1)
+      ) {
+        this.$message({
+          message: '干粮水分输入错误',
+          type: 'warning'
+        })
+        return
+      }
+      if (!this.dataList.deductionAmount) {
+        this.$message({
+          message: '扣款不能为空',
+          type: 'warning'
+        })
+        return
+      }
+      if (
+        this.dataList.deductionAmount < 0 ||
+        this.dataList.deductionAmount > 10000 ||
+        (String(this.dataList.deductionAmount).indexOf('.') != -1 &&
+          String(this.dataList.deductionAmount).length -
+            (String(this.dataList.deductionAmount).indexOf('.') + 1) >
+            2)
+      ) {
+        this.$message({
+          message: '扣款输入错误',
+          type: 'warning'
+        })
+        return
+      }
       if (!this.dataList.agent) {
         this.$message({
           message: '经办人不能为空',

+ 372 - 48
src/views/warehouse/warehouseManagementPerfectput.vue

@@ -33,11 +33,29 @@
         </h2>
         <div class="small-title">基本信息</div>
         <ws-info-table>
+          <ws-form-item label="合同编号" span="1" prop="contractNo">
+            <el-select
+            filterable
+            :filter-method="dataFilter1"
+              v-model="dataList.contractNo"
+              placeholder="请选择合同编号或移库任务编号"
+              class="typeselect"
+              @change='contractNoChange'
+            >
+              <el-option
+                v-for="item in options1"
+                :key="item.constKey"
+                :label="item.contractNo"
+                :value="item.contractNo"
+              />
+            </el-select>
+          </ws-form-item>
           <!-- 货名 -->
           <ws-form-item label="货名" span="1">
             <ws-select
+            disabled
               v-model="dataList.goodsName"
-              placeholder=""
+              placeholder
               class="typeselect"
               @change="selectgoodsName"
             >
@@ -49,6 +67,11 @@
               />
             </ws-select>
           </ws-form-item>
+          <ws-form-item label="类型" span="1" prop="type">
+              <ws-select v-model="dataList.type"  @change="typeChange">
+                <ws-option v-for="item in typeList" :key="item" :label="item" :value="item" />
+              </ws-select>
+            </ws-form-item>
           <!--毛重(吨)-->
           <ws-form-item label="毛重(吨)" span="1" prop="grossWeight">
             <ws-input
@@ -61,12 +84,7 @@
           </ws-form-item>
 
           <!--皮重(吨)-->
-          <ws-form-item
-            label="皮重(吨)"
-            span="1"
-            prop="tare"
-            class="readonly"
-          >
+          <ws-form-item label="皮重(吨)" span="1" prop="tare" class="readonly">
             <ws-input
               @input="tarechange"
               v-model="dataList.tare"
@@ -75,14 +93,66 @@
               size="small"
             />
           </ws-form-item>
-
+          <ws-form-item label="扣重(吨)" span="1" prop="deductionWeight" class="readonly">
+            <ws-input
+            @input="tarechange"
+              v-model="dataList.deductionWeight"
+              placeholder="请输入扣重"
+              maxlength="100"
+              size="small"
+            />
+          </ws-form-item>
           <!--净重(吨)-->
           <ws-form-item label="净重(吨)" span="1" prop="netWeight">
             <ws-input
-              :readonly="readonly"
-              v-model.number="dataList.netWeight"
+              readonly="readonly"
+              v-model="dataList.netWeight"
               placeholder="不可编辑,自动计算"
-              type="number"
+              maxlength="120"
+              size="small"
+            />
+          </ws-form-item>
+          <ws-form-item v-if='dataList.type=="潮粮"' label="扣重比" span="1" prop="buckleWeightRatio" class="readonly">
+            <ws-input
+              @input='pureweight'
+              v-model="dataList.buckleWeightRatio"
+              placeholder="请输入扣重比"
+              maxlength="100"
+              size="small"
+            />
+          </ws-form-item>
+          <ws-form-item v-if='dataList.type=="潮粮"' label="干粮水分占比" span="1" prop="solidGrainWater" class="readonly">
+            <ws-input
+            @input='pureweight'
+              v-model="dataList.solidGrainWater"
+              placeholder="请输入干粮水分占比"
+              maxlength="100"
+              size="small"
+            />
+          </ws-form-item>
+          <ws-form-item v-if='dataList.type=="潮粮"' label="潮粮水分占比" span="1" prop="tidalGrainWater" class="readonly">
+            <ws-input
+            @input='pureweight'
+              v-model="dataList.tidalGrainWater"
+              placeholder="请输入潮粮水分占比"
+              maxlength="100"
+              size="small"
+            />
+          </ws-form-item>
+          <ws-form-item v-if='dataList.type=="潮粮"' label="纯重" span="1" prop="pureWeight" class="readonly">
+            <ws-input
+              disabled
+              v-model="dataList.pureWeight"
+              placeholder="不可编辑,自动计算"
+              maxlength="100"
+              size="small"
+            />
+          </ws-form-item>
+          <!--净重(吨)-->
+          <ws-form-item label="扣款" span="1" prop="deductionAmount">
+            <ws-input
+              v-model="dataList.deductionAmount"
+              placeholder="请输入扣款金额"
               maxlength="120"
               size="small"
             />
@@ -91,7 +161,7 @@
           <ws-form-item label="品级" span="1" class="readonly">
             <ws-select
               v-model="dataList.grade"
-              placeholder=""
+              placeholder
               class="typeselect"
               @change="selectpackingMethod"
             >
@@ -121,25 +191,20 @@
               />
             </el-select>
           </ws-form-item>
-          <!--入库日期-->
-          <ws-form-item
-            label="入库日期"
-            span="1"
-            prop="inOutDate"
-            class="deliverydate"
-          >
-            <ws-date-picker
+          <!--出库日期-->
+          <ws-form-item label="入库日期" span="1" prop="inOutDate" class="deliverydate">
+            <el-date-picker
               v-model="dataList.inOutDate"
-              type="date"
               placeholder="请选择入库日期"
-              value-format="yyyy-MM-dd"
-            />
+              type="datetime"
+              value-format="yyyy-MM-dd HH:mm:ss"
+            ></el-date-picker>
           </ws-form-item>
           <!-- 入库类型 -->
           <ws-form-item label="入库类型" span="1">
             <ws-select
               v-model="dataList.inOutType"
-              placeholder=""
+              placeholder
               class="typeselect"
               @change="selectstorageType"
             >
@@ -152,38 +217,63 @@
             </ws-select>
           </ws-form-item>
 
-          <!--车牌号-->
-          <ws-form-item label="车牌号" span="1" prop="sourceGoods">
+          <!--车牌号  -->
+          <ws-form-item label="车牌号" span="1" prop="carNo">
             <ws-input
+            v-if='!carstatus'
               v-model="dataList.carNo"
               placeholder="请输入车牌号"
-              maxlength="20"
+              maxlength="7"
               size="small"
             />
-          </ws-form-item>
-
-          <!--合同编号-->
-          <!-- <ws-form-item label="合同编号" span="1" prop="contractNo">
-            <ws-input
-              v-model="dataList.contractNo"
-              placeholder="请输入合同编号"
-              maxlength="100"
-              size="small"
-            />
-          </ws-form-item> -->
-          <ws-form-item label="合同编号" span="1">
-            <ws-select
-              v-model="dataList.contractNo"
-              placeholder="请选择合同编号"
+            <el-select
+            v-if='carstatus'
+            filterable
+            :filter-method="dataFilter2"
+              v-model="dataList.carNo"
+              placeholder="请选择车牌号"
               class="typeselect"
+              @change='carChange'
             >
-              <ws-option
-                v-for="item in outContractNo"
+              <el-option
+                v-for="item in options2"
                 :key="item.constKey"
-                :label="item.contractNo"
-                :value="item.contractNo"
+                :label="item.carNo+'('+item.tranCarNo+')'"
+                :value="item.carNo"
               />
-            </ws-select>
+            </el-select>
+          </ws-form-item>
+          <ws-form-item label="成本" span="1" prop="cost">
+            <ws-input
+            :disabled='disabled1'
+              v-model="dataList.cost"
+              placeholder="请输入成本"
+              size="small"
+            />
+            <img
+            width="17"
+            height="18"
+            style="vertical-align: text-top; position: relative; top: -1px"
+            src="../../../public/img/edit.png"
+            @click="editClick(1)"
+            alt=""
+          />
+          </ws-form-item>
+          <ws-form-item label="运费" span="1" prop="freight">
+            <ws-input
+            :disabled='disabled2'
+              v-model="dataList.freight"
+              placeholder="请输入运费"
+              size="small"
+            />
+            <img
+            width="17"
+            height="18"
+            style="vertical-align: text-top; position: relative; top: -1px"
+            src="../../../public/img/edit.png"
+            @click="editClick(2)"
+            alt=""
+          />
           </ws-form-item>
         </ws-info-table>
         <div  v-show="this.$route.query.warehouseType == 2 && this.$route.query.createType == 2">
@@ -378,7 +468,8 @@ export default {
       endDate: null,
       goodnameList: {},
       checked: true,
-
+      disabled1:true,
+      disabled2:true,
       staffList: [],
       options: [],
       storageType: [],
@@ -386,6 +477,7 @@ export default {
       outContractNo: [],
       // 提交类型
       submitType: true,
+      typeList:['干粮','潮粮'],
       storageType: [],
       appendixIdsAdd: '',
       uploadSuccess: {},
@@ -411,6 +503,9 @@ export default {
         year: dayjs().format('YYYY'),
         month: dayjs().format('MM'),
       },
+      options1: [],
+      options2: [],
+      carstatus:false,
       contractList: [],
       dataList: {
         id: '',
@@ -422,9 +517,19 @@ export default {
         agent: '',
         carNo: '',
         inOutDate: '',
+        
         inOutType: '',
         goodsName: '',
         warehouseInOutDetail: {},
+        cost:'',
+        freight:0,
+        type:'',
+        buckleWeightRatio:'',
+        tidalGrainWater:'',
+        solidGrainWater:'',
+        pureWeight:'',
+        deductionAmount:'',
+        deductionWeigh:'',
       },
       historyList: [],
       pickerBeginDateBefore: {
@@ -464,12 +569,77 @@ export default {
     this.deptBudgetList.warehouseType = this.$route.query.warehouseType
     this.deptBudgetList.createType = this.$route.query.createType
       this.dataList.temporaryOutType = this.$route.query.temporaryOutType
+      this.dataList.cost=this.$route.query.cost
+      this.dataList.freight=this.$route.query.freight
+      this.dataList.type=this.$route.query.type
+      this.dataList.buckleWeightRatio=this.$route.query.buckleWeightRatio
+      this.dataList.tidalGrainWater=this.$route.query.tidalGrainWater
+      this.dataList.solidGrainWater=this.$route.query.solidGrainWater
+      this.dataList.pureWeight=this.$route.query.pureWeight
+      this.dataList.deductionAmount=this.$route.query.deductionAmount
+      this.dataList.deductionWeight=this.$route.query.deductionWeight
   },
   methods: {
+    pureweight(status){
+      console.log(this.deptBudgetList)
+      if(this.deptBudgetList.netWeight&&this.deptBudgetList.tidalGrainWater&&this.deptBudgetList.solidGrainWater&&this.deptBudgetList.buckleWeightRatio){
+        this.deptBudgetList.pureWeight=(this.deptBudgetList.netWeight*(100-(this.deptBudgetList.tidalGrainWater-this.deptBudgetList.solidGrainWater)*this.deptBudgetList.buckleWeightRatio))/100
+      }
+    },
     //返回按钮
     revert() {
       this.$router.go(-1)
     },
+    carChange(e){
+        for (let i = 0; i < this.tranCarInfoList.length; i++) {
+          if(this.tranCarInfoList[i].carNo==this.dataList.carNo){
+            this.dataList.freight=this.tranCarInfoList[i].tranPrice
+          }
+          
+        }
+    },
+    typeChange(e){
+
+    },
+    contractNoChange(e){
+      for (var i = 0; i < this.outContractNo.length; i++) {
+        if (this.outContractNo[i].contractNo == e) {
+          this.dataList.goodsName = this.outContractNo[i].goodsName
+          this.dataList.goodsNameKey = this.outContractNo[i].goodsNameKey
+          this.dataList.cost= this.outContractNo[i].contractPrice
+          if(this.outContractNo[i].tranCarInfoList){
+            this.options2=this.outContractNo[i].tranCarInfoList
+            this.tranCarInfoList=this.outContractNo[i].tranCarInfoList
+            this.carstatus=true
+          }
+        }
+      }
+    },
+    dataFilter1(val) {
+       console.log(val)
+        this.deptBudgetList.contractNo = val;
+        if (val) { //val存在
+          this.options1 = this.outContractNo1.filter((item) => {
+            if (!!~item.contractNo.indexOf(val) || !!~item.contractNo.toUpperCase().indexOf(val.toUpperCase())) {
+              return true
+            }
+          })
+        } else { //val为空时,还原数组
+          this.options1 = this.outContractNo;
+        }
+      },
+      dataFilter2(val) {
+        this.deptBudgetList.carNo = val;
+        if (val) { //val存在
+          this.options1 = this.outContractNo1.filter((item) => {
+            if (!!~item.carNo.indexOf(val) || !!~item.carNo.toUpperCase().indexOf(val.toUpperCase())) {
+              return true
+            }
+          })
+        } else { //val为空时,还原数组
+          this.options2 = this.tranCarInfoList;
+        }
+      },
     dataFilter(val) {
       // console.log(val,"名")
       this.deptBudgetList.staffList = val
@@ -488,6 +658,13 @@ export default {
         this.options = this.staffList
       }
     },
+    editClick(status){
+      if(status==1){
+        this.disabled1=!this.disabled1
+      }else{
+        this.disabled2=!this.disabled2
+      }
+    },
     selectstaff(e) {
       for (var i = 0; i < this.staffList.length; i++) {
         if (this.staffList[i].staffName == e) {
@@ -569,6 +746,153 @@ export default {
         })
         return
       }
+      if (!this.dataList.deductionWeight) {
+        this.$message({
+          message: '扣重不能为空',
+          type: 'warning'
+        })
+        return
+      }
+      if (
+        this.dataList.deductionWeight < 0 ||
+        this.dataList.deductionWeight > 10 ||
+        (String(this.dataList.deductionWeight).indexOf('.') != -1 &&
+          String(this.dataList.deductionWeight).length -
+            (String(this.dataList.deductionWeight).indexOf('.') + 1) >
+            3)
+      ) {
+        this.$message({
+          message: '扣重输入错误',
+          type: 'warning'
+        })
+        return
+      }
+      if (this.dataList.type=='潮粮'&&!this.dataList.buckleWeightRatio) {
+        this.$message({
+          message: '扣重比不能为空',
+          type: 'warning'
+        })
+        return
+      }
+      if (
+        this.dataList.type=='潮粮'&&this.dataList.buckleWeightRatio < 0 ||
+        this.dataList.type=='潮粮'&&this.dataList.buckleWeightRatio > 3 ||
+        (this.dataList.type=='潮粮'&&String(this.dataList.buckleWeightRatio).indexOf('.') != -1 &&
+          String(this.dataList.buckleWeightRatio).length -
+            (String(this.dataList.buckleWeightRatio).indexOf('.') + 1) >
+            2)
+      ) {
+        this.$message({
+          message: '扣重比输入错误',
+          type: 'warning'
+        })
+        return
+      }
+      if (this.dataList.type=='潮粮'&&!this.dataList.tidalGrainWater) {
+        this.$message({
+          message: '潮粮水分不能为空',
+          type: 'warning'
+        })
+        return
+      }
+      if (
+        this.dataList.type=='潮粮'&&this.dataList.tidalGrainWater < 1 ||
+        this.dataList.type=='潮粮'&&this.dataList.tidalGrainWater > 40 ||
+        (this.dataList.type=='潮粮'&&String(this.dataList.tidalGrainWater).indexOf('.') != -1 &&
+          String(this.dataList.tidalGrainWater).length -
+            (String(this.dataList.tidalGrainWater).indexOf('.') + 1) >
+            2)
+      ) {
+        this.$message({
+          message: '潮粮水分输入错误',
+          type: 'warning'
+        })
+        return
+      }
+      if (this.dataList.type=='潮粮'&&!this.dataList.solidGrainWater) {
+        this.$message({
+          message: '干粮水分不能为空',
+          type: 'warning'
+        })
+        return
+      }
+      if (
+        this.deptBudgetList.type=='潮粮'&&this.dataList.solidGrainWater < 1 ||
+        this.deptBudgetList.type=='潮粮'&&this.dataList.solidGrainWater > 40 ||
+        (this.dataList.type=='潮粮'&&String(this.dataList.solidGrainWater).indexOf('.') != -1 &&
+          String(this.dataList.solidGrainWater).length -
+            (String(this.dataList.solidGrainWater).indexOf('.') + 1) >
+            1)
+      ) {
+        this.$message({
+          message: '干粮水分输入错误',
+          type: 'warning'
+        })
+        return
+      }
+      if (!this.dataList.deductionAmount) {
+        this.$message({
+          message: '扣款不能为空',
+          type: 'warning'
+        })
+        return
+      }
+      if (
+        this.dataList.deductionAmount < 0 ||
+        this.dataList.deductionAmount > 10000 ||
+        (String(this.dataList.deductionAmount).indexOf('.') != -1 &&
+          String(this.dataList.deductionAmount).length -
+            (String(this.dataList.deductionAmount).indexOf('.') + 1) >
+            2)
+      ) {
+        this.$message({
+          message: '扣款输入错误',
+          type: 'warning'
+        })
+        return
+      }
+      if (!this.dataList.cost) {
+        this.$message({
+          message: '未获取到成本,请编辑后提交',
+          type: 'warning'
+        })
+        return
+      }
+      if (
+        this.dataList.cost < 0 ||
+        this.dataList.cost > 20000 ||
+        (String(this.dataList.cost).indexOf('.') != -1 &&
+          String(this.dataList.cost).length -
+            (String(this.dataList.cost).indexOf('.') + 1) >
+            2)
+      ) {
+        this.$message({
+          message: '成本输入错误',
+          type: 'warning'
+        })
+        return
+      }
+      if (!this.dataList.freight&&this.dataList.freight!=0) {
+        this.$message({
+          message: '运费不能为空',
+          type: 'warning'
+        })
+        return
+      }
+      if (
+        this.dataList.freight < 0 ||
+        this.dataList.freight > 100000 ||
+        (String(this.dataList.freight).indexOf('.') != -1 &&
+          String(this.dataList.freight).length -
+            (String(this.dataList.freight).indexOf('.') + 1) >
+            2)
+      ) {
+        this.$message({
+          message: '运费输入错误',
+          type: 'warning'
+        })
+        return
+      }
       if (!this.dataList.agent) {
         this.$message({
           message: '经办人不能为空',

+ 507 - 25
src/views/warehouse/warehouseManagementPut.vue

@@ -36,9 +36,28 @@
           <span v-show="this.$route.query.warehouseType == 2">(临)</span>
         </h2>
         <ws-info-table>
+           <!--合同编号-->
+          <ws-form-item label="合同编号" span="1" prop="contractNo">
+            <el-select
+            filterable
+            :filter-method="dataFilter1"
+              v-model="deptBudgetList.contractNo"
+              placeholder="请选择合同编号或移库任务编号"
+              class="typeselect"
+              @change='contractNoChange'
+            >
+              <el-option
+                v-for="item in options1"
+                :key="item.constKey"
+                :label="item.contractNo"
+                :value="item.contractNo"
+              />
+            </el-select>
+          </ws-form-item>
           <!-- 货名 -->
           <ws-form-item label="货名" span="1">
             <ws-select
+            disabled
               v-model="deptBudgetList.goodsName"
               placeholder
               class="typeselect"
@@ -52,6 +71,11 @@
               />
             </ws-select>
           </ws-form-item>
+          <ws-form-item label="类型" span="1" prop="type">
+              <ws-select v-model="deptBudgetList.type"  @change="typeChange">
+                <ws-option v-for="item in typeList" :key="item" :label="item" :value="item" />
+              </ws-select>
+            </ws-form-item>
           <!--毛重(吨)-->
           <ws-form-item label="毛重(吨)" span="1" prop="grossWeight">
             <ws-input
@@ -73,7 +97,15 @@
               size="small"
             />
           </ws-form-item>
-
+          <ws-form-item label="扣重(吨)" span="1" prop="deductionWeight" class="readonly">
+            <ws-input
+            @input="tarechange"
+              v-model="deptBudgetList.deductionWeight"
+              placeholder="请输入扣重"
+              maxlength="100"
+              size="small"
+            />
+          </ws-form-item>
           <!--净重(吨)-->
           <ws-form-item label="净重(吨)" span="1" prop="netWeight">
             <ws-input
@@ -84,6 +116,51 @@
               size="small"
             />
           </ws-form-item>
+          <ws-form-item v-if='deptBudgetList.type=="潮粮"' label="扣重比" span="1" prop="buckleWeightRatio" class="readonly">
+            <ws-input
+              @input='pureweight'
+              v-model="deptBudgetList.buckleWeightRatio"
+              placeholder="请输入扣重比"
+              maxlength="100"
+              size="small"
+            />
+          </ws-form-item>
+          <ws-form-item v-if='deptBudgetList.type=="潮粮"' label="干粮水分占比" span="1" prop="solidGrainWater" class="readonly">
+            <ws-input
+            @input='pureweight'
+              v-model="deptBudgetList.solidGrainWater"
+              placeholder="请输入干粮水分占比"
+              maxlength="100"
+              size="small"
+            />
+          </ws-form-item>
+          <ws-form-item v-if='deptBudgetList.type=="潮粮"' label="潮粮水分占比" span="1" prop="tidalGrainWater" class="readonly">
+            <ws-input
+            @input='pureweight(1)'
+              v-model="deptBudgetList.tidalGrainWater"
+              placeholder="请输入潮粮水分占比"
+              maxlength="100"
+              size="small"
+            />
+          </ws-form-item>
+          <ws-form-item v-if='deptBudgetList.type=="潮粮"' label="纯重" span="1" prop="pureWeight" class="readonly">
+            <ws-input
+              disabled
+              v-model="deptBudgetList.pureWeight"
+              placeholder="不可编辑,自动计算"
+              maxlength="100"
+              size="small"
+            />
+          </ws-form-item>
+          <!--净重(吨)-->
+          <ws-form-item label="扣款" span="1" prop="deductionAmount">
+            <ws-input
+              v-model="deptBudgetList.deductionAmount"
+              placeholder="请输入扣款金额"
+              maxlength="120"
+              size="small"
+            />
+          </ws-form-item>
           <!-- 品级 -->
           <ws-form-item label="品级" span="1" class="readonly">
             <ws-select
@@ -120,12 +197,12 @@
           </ws-form-item>
           <!--出库日期-->
           <ws-form-item label="入库日期" span="1" prop="inOutDate" class="deliverydate">
-            <ws-date-picker
+            <el-date-picker
               v-model="deptBudgetList.inOutDate"
-              type="date"
               placeholder="请选择入库日期"
+              type="date"
               value-format="yyyy-MM-dd"
-            />
+            ></el-date-picker>
           </ws-form-item>
           <!-- 入库类型 -->
           <ws-form-item label="入库类型" span="1">
@@ -147,28 +224,62 @@
           <!--车牌号  -->
           <ws-form-item label="车牌号" span="1" prop="carNo">
             <ws-input
+            v-if='!carstatus'
               v-model="deptBudgetList.carNo"
               placeholder="请输入车牌号"
               maxlength="7"
               size="small"
             />
-          </ws-form-item>
-              <!-- onkeyup="value=value.replace(/[^\A-\Z0-9\u4E00-\u9FA5\.]/g,'')" -->
-          <!--合同编号-->
-          <ws-form-item label="合同编号" span="1" prop="contractNo">
-            <ws-select
-              v-model="deptBudgetList.contractNo"
-              placeholder="请选择合同编号或移库任务编号"
+            <el-select
+            v-if='carstatus'
+            filterable
+            :filter-method="dataFilter2"
+              v-model="deptBudgetList.carNo"
+              placeholder="请选择车牌号"
               class="typeselect"
+              @change='carChange'
             >
-              <ws-option
-                v-for="item in outContractNo"
+              <el-option
+                v-for="item in options2"
                 :key="item.constKey"
-                :label="item.contractNo"
-                :value="item.contractNo"
+                :label="item.carNo+'('+item.tranCarNo+')'"
+                :value="item.carNo"
               />
-            </ws-select>
+            </el-select>
+          </ws-form-item>
+          <ws-form-item label="成本" span="1" prop="cost">
+            <ws-input
+            :disabled='disabled1'
+              v-model="deptBudgetList.cost"
+              placeholder="请输入成本"
+              size="small"
+            />
+            <img
+            width="17"
+            height="18"
+            style="vertical-align: text-top; position: relative; top: -1px"
+            src="../../../public/img/edit.png"
+            @click="editClick(1)"
+            alt=""
+          />
           </ws-form-item>
+          <ws-form-item label="运费" span="1" prop="freight">
+            <ws-input
+            :disabled='disabled2'
+              v-model="deptBudgetList.freight"
+              placeholder="请输入运费"
+              size="small"
+            />
+            <img
+            width="17"
+            height="18"
+            style="vertical-align: text-top; position: relative; top: -1px"
+            src="../../../public/img/edit.png"
+            @click="editClick(2)"
+            alt=""
+          />
+          </ws-form-item>
+              <!-- onkeyup="value=value.replace(/[^\A-\Z0-9\u4E00-\u9FA5\.]/g,'')" -->
         </ws-info-table>
         <div v-show="this.$route.query.warehouseType == 2 && this.deptBudgetList.createType == 2">
           <el-checkbox v-model="checked" checked>退库并出库</el-checkbox>
@@ -329,8 +440,10 @@ export default {
       tableDate: [],
       // 是否显示
       showType: true,
+      typeList:['干粮','潮粮'],
       // 年
       year: '',
+      carstatus:false,
       deptBudgetTotal: 0,
       currentPage: 1,
       pageSize: 10,
@@ -344,7 +457,9 @@ export default {
       agent: [],
       staffList: [],
       options: [],
-
+      options1:[],
+      options2:[],
+      outContractNo1:[],
       outContractNo: [],
 
       // 提交类型
@@ -367,6 +482,9 @@ export default {
         ]
       },
       size: 10,
+      disabled1:true,
+      disabled2:true,
+      tranCarInfoList:[],
       compId: sessionStorage.getItem('ws-pf_compId'),
       deptCircularPage: {},
       packtypeList: {},
@@ -376,6 +494,8 @@ export default {
       },
       contractList: [],
       deptBudgetList: {
+        type:'干粮',
+        freight:0,
         warehouseInOutDetail: {}
       },
       historyList: [],
@@ -395,10 +515,7 @@ export default {
     this.deptBudgetList.binNumber = this.$route.query.binNumber
     this.deptBudgetList.warehouseType = this.$route.query.warehouseType
     this.deptBudgetList.createType = this.$route.query.createType
-
     this.getList()
-    this.deptBudgetList.goodsName = '玉米'
-    this.deptBudgetList.goodsNameKey = '1'
     this.deptBudgetList.grade = '一等品'
     this.deptBudgetList.gradeKey = '1'
     if (this.deptBudgetList.warehouseType == 1) {
@@ -410,10 +527,50 @@ export default {
     }
   },
   methods: {
+     dataFilter1(val) {
+       console.log(val)
+        this.deptBudgetList.contractNo = val;
+        if (val) { //val存在
+          this.options1 = this.outContractNo1.filter((item) => {
+            if (!!~item.contractNo.indexOf(val) || !!~item.contractNo.toUpperCase().indexOf(val.toUpperCase())) {
+              return true
+            }
+          })
+        } else { //val为空时,还原数组
+          this.options1 = this.outContractNo;
+        }
+      },
+      dataFilter2(val) {
+        this.deptBudgetList.carNo = val;
+        if (val) { //val存在
+          this.options1 = this.outContractNo1.filter((item) => {
+            if (!!~item.carNo.indexOf(val) || !!~item.carNo.toUpperCase().indexOf(val.toUpperCase())) {
+              return true
+            }
+          })
+        } else { //val为空时,还原数组
+          this.options2 = this.tranCarInfoList;
+        }
+      },
+    editClick(status){
+      if(status==1){
+        this.disabled1=!this.disabled1
+      }else{
+        this.disabled2=!this.disabled2
+      }
+    },
     //返回按钮
     revert() {
       this.$router.push({ path: 'warehouseManagementList' })
     },
+    carChange(e){
+        for (let i = 0; i < this.tranCarInfoList.length; i++) {
+          if(this.tranCarInfoList[i].carNo==this.deptBudgetList.carNo){
+            this.deptBudgetList.freight=this.tranCarInfoList[i].tranPrice
+          }
+          
+        }
+    },
     dataFilter(val) {
       // console.log(val,"名")
       this.deptBudgetList.staffList = val
@@ -490,6 +647,153 @@ export default {
         })
         return
       }
+      if (!this.deptBudgetList.deductionWeight) {
+        this.$message({
+          message: '扣重不能为空',
+          type: 'warning'
+        })
+        return
+      }
+      if (
+        this.deptBudgetList.deductionWeight < 0 ||
+        this.deptBudgetList.deductionWeight > 10 ||
+        (String(this.deptBudgetList.deductionWeight).indexOf('.') != -1 &&
+          String(this.deptBudgetList.deductionWeight).length -
+            (String(this.deptBudgetList.deductionWeight).indexOf('.') + 1) >
+            3)
+      ) {
+        this.$message({
+          message: '扣重输入错误',
+          type: 'warning'
+        })
+        return
+      }
+      if (this.deptBudgetList.type=='潮粮'&&!this.deptBudgetList.buckleWeightRatio) {
+        this.$message({
+          message: '扣重比不能为空',
+          type: 'warning'
+        })
+        return
+      }
+      if (
+        this.deptBudgetList.type=='潮粮'&&this.deptBudgetList.buckleWeightRatio < 0 ||
+        this.deptBudgetList.type=='潮粮'&&this.deptBudgetList.buckleWeightRatio > 3 ||
+        (this.deptBudgetList.type=='潮粮'&&String(this.deptBudgetList.buckleWeightRatio).indexOf('.') != -1 &&
+          String(this.deptBudgetList.buckleWeightRatio).length -
+            (String(this.deptBudgetList.buckleWeightRatio).indexOf('.') + 1) >
+            2)
+      ) {
+        this.$message({
+          message: '扣重比输入错误',
+          type: 'warning'
+        })
+        return
+      }
+      if (this.deptBudgetList.type=='潮粮'&&!this.deptBudgetList.tidalGrainWater) {
+        this.$message({
+          message: '潮粮水分不能为空',
+          type: 'warning'
+        })
+        return
+      }
+      if (
+        this.deptBudgetList.type=='潮粮'&&this.deptBudgetList.tidalGrainWater < 1 ||
+        this.deptBudgetList.type=='潮粮'&&this.deptBudgetList.tidalGrainWater > 40 ||
+        (this.deptBudgetList.type=='潮粮'&&String(this.deptBudgetList.tidalGrainWater).indexOf('.') != -1 &&
+          String(this.deptBudgetList.tidalGrainWater).length -
+            (String(this.deptBudgetList.tidalGrainWater).indexOf('.') + 1) >
+            2)
+      ) {
+        this.$message({
+          message: '潮粮水分输入错误',
+          type: 'warning'
+        })
+        return
+      }
+      if (this.deptBudgetList.type=='潮粮'&&!this.deptBudgetList.solidGrainWater) {
+        this.$message({
+          message: '干粮水分不能为空',
+          type: 'warning'
+        })
+        return
+      }
+      if (
+        this.deptBudgetList.type=='潮粮'&&this.deptBudgetList.solidGrainWater < 1 ||
+        this.deptBudgetList.type=='潮粮'&&this.deptBudgetList.solidGrainWater > 40 ||
+        (this.deptBudgetList.type=='潮粮'&&String(this.deptBudgetList.solidGrainWater).indexOf('.') != -1 &&
+          String(this.deptBudgetList.solidGrainWater).length -
+            (String(this.deptBudgetList.solidGrainWater).indexOf('.') + 1) >
+            1)
+      ) {
+        this.$message({
+          message: '干粮水分输入错误',
+          type: 'warning'
+        })
+        return
+      }
+      if (!this.deptBudgetList.deductionAmount) {
+        this.$message({
+          message: '扣款不能为空',
+          type: 'warning'
+        })
+        return
+      }
+      if (
+        this.deptBudgetList.deductionAmount < 0 ||
+        this.deptBudgetList.deductionAmount > 10000 ||
+        (String(this.deptBudgetList.deductionAmount).indexOf('.') != -1 &&
+          String(this.deptBudgetList.deductionAmount).length -
+            (String(this.deptBudgetList.deductionAmount).indexOf('.') + 1) >
+            2)
+      ) {
+        this.$message({
+          message: '扣款输入错误',
+          type: 'warning'
+        })
+        return
+      }
+      if (!this.deptBudgetList.cost) {
+        this.$message({
+          message: '未获取到成本,请编辑后提交',
+          type: 'warning'
+        })
+        return
+      }
+      if (
+        this.deptBudgetList.cost < 0 ||
+        this.deptBudgetList.cost > 20000 ||
+        (String(this.deptBudgetList.cost).indexOf('.') != -1 &&
+          String(this.deptBudgetList.cost).length -
+            (String(this.deptBudgetList.cost).indexOf('.') + 1) >
+            2)
+      ) {
+        this.$message({
+          message: '成本输入错误',
+          type: 'warning'
+        })
+        return
+      }
+      if (!this.deptBudgetList.cost) {
+        this.$message({
+          message: '运费不能为空',
+          type: 'warning'
+        })
+        return
+      }
+      if (
+        this.deptBudgetList.cost < 0 ||
+        this.deptBudgetList.cost > 100000 ||
+        (String(this.deptBudgetList.cost).indexOf('.') != -1 &&
+          String(this.deptBudgetList.cost).length -
+            (String(this.deptBudgetList.cost).indexOf('.') + 1) >
+            2)
+      ) {
+        this.$message({
+          message: '运费输入错误',
+          type: 'warning'
+        })
+        return
+      }
       if (!this.deptBudgetList.agent) {
         this.$message({
           message: '经办人不能为空',
@@ -766,6 +1070,7 @@ export default {
                 'ws-pf_compId'
               )
               this.deptBudgetList.inOutFlag = 2
+              this.deptBudgetList.pcFlag = 1
               this.deptBudgetList.statusFlag = 3
               addstorageputList(this.deptBudgetList)
                 .toPromise()
@@ -833,6 +1138,153 @@ export default {
         })
         return
       }
+      if (!this.deptBudgetList.deductionWeight) {
+        this.$message({
+          message: '扣重不能为空',
+          type: 'warning'
+        })
+        return
+      }
+      if (
+        this.deptBudgetList.deductionWeight < 0 ||
+        this.deptBudgetList.deductionWeight > 10 ||
+        (String(this.deptBudgetList.deductionWeight).indexOf('.') != -1 &&
+          String(this.deptBudgetList.deductionWeight).length -
+            (String(this.deptBudgetList.deductionWeight).indexOf('.') + 1) >
+            3)
+      ) {
+        this.$message({
+          message: '扣重输入错误',
+          type: 'warning'
+        })
+        return
+      }
+      if (this.deptBudgetList.type=='潮粮'&&!this.deptBudgetList.buckleWeightRatio) {
+        this.$message({
+          message: '扣重比不能为空',
+          type: 'warning'
+        })
+        return
+      }
+      if (
+        this.deptBudgetList.type=='潮粮'&&this.deptBudgetList.buckleWeightRatio < 0 ||
+        this.deptBudgetList.type=='潮粮'&&this.deptBudgetList.buckleWeightRatio > 3 ||
+        (this.deptBudgetList.type=='潮粮'&&String(this.deptBudgetList.buckleWeightRatio).indexOf('.') != -1 &&
+          String(this.deptBudgetList.buckleWeightRatio).length -
+            (String(this.deptBudgetList.buckleWeightRatio).indexOf('.') + 1) >
+            2)
+      ) {
+        this.$message({
+          message: '扣重比输入错误',
+          type: 'warning'
+        })
+        return
+      }
+      if (this.deptBudgetList.type=='潮粮'&&!this.deptBudgetList.tidalGrainWater) {
+        this.$message({
+          message: '潮粮水分不能为空',
+          type: 'warning'
+        })
+        return
+      }
+      if (
+        this.deptBudgetList.type=='潮粮'&&this.deptBudgetList.tidalGrainWater < 1 ||
+        this.deptBudgetList.type=='潮粮'&&this.deptBudgetList.tidalGrainWater > 40 ||
+        (this.deptBudgetList.type=='潮粮'&&String(this.deptBudgetList.tidalGrainWater).indexOf('.') != -1 &&
+          String(this.deptBudgetList.tidalGrainWater).length -
+            (String(this.deptBudgetList.tidalGrainWater).indexOf('.') + 1) >
+            2)
+      ) {
+        this.$message({
+          message: '潮粮水分输入错误',
+          type: 'warning'
+        })
+        return
+      }
+      if (this.deptBudgetList.type=='潮粮'&&!this.deptBudgetList.solidGrainWater) {
+        this.$message({
+          message: '干粮水分不能为空',
+          type: 'warning'
+        })
+        return
+      }
+      if (
+        this.deptBudgetList.type=='潮粮'&&this.deptBudgetList.solidGrainWater < 1 ||
+        this.deptBudgetList.type=='潮粮'&&this.deptBudgetList.solidGrainWater > 40 ||
+        (this.deptBudgetList.type=='潮粮'&&String(this.deptBudgetList.solidGrainWater).indexOf('.') != -1 &&
+          String(this.deptBudgetList.solidGrainWater).length -
+            (String(this.deptBudgetList.solidGrainWater).indexOf('.') + 1) >
+            1)
+      ) {
+        this.$message({
+          message: '干粮水分输入错误',
+          type: 'warning'
+        })
+        return
+      }
+      if (!this.deptBudgetList.deductionAmount) {
+        this.$message({
+          message: '扣款不能为空',
+          type: 'warning'
+        })
+        return
+      }
+      if (
+        this.deptBudgetList.deductionAmount < 0 ||
+        this.deptBudgetList.deductionAmount > 10000 ||
+        (String(this.deptBudgetList.deductionAmount).indexOf('.') != -1 &&
+          String(this.deptBudgetList.deductionAmount).length -
+            (String(this.deptBudgetList.deductionAmount).indexOf('.') + 1) >
+            2)
+      ) {
+        this.$message({
+          message: '扣款输入错误',
+          type: 'warning'
+        })
+        return
+      }
+      if (!this.deptBudgetList.cost) {
+        this.$message({
+          message: '未获取到成本,请编辑后提交',
+          type: 'warning'
+        })
+        return
+      }
+      if (
+        this.deptBudgetList.cost < 0 ||
+        this.deptBudgetList.cost > 20000 ||
+        (String(this.deptBudgetList.cost).indexOf('.') != -1 &&
+          String(this.deptBudgetList.cost).length -
+            (String(this.deptBudgetList.cost).indexOf('.') + 1) >
+            2)
+      ) {
+        this.$message({
+          message: '成本输入错误',
+          type: 'warning'
+        })
+        return
+      }
+      if (!this.deptBudgetList.cost) {
+        this.$message({
+          message: '运费不能为空',
+          type: 'warning'
+        })
+        return
+      }
+      if (
+        this.deptBudgetList.cost < 0 ||
+        this.deptBudgetList.cost > 100000 ||
+        (String(this.deptBudgetList.cost).indexOf('.') != -1 &&
+          String(this.deptBudgetList.cost).length -
+            (String(this.deptBudgetList.cost).indexOf('.') + 1) >
+            2)
+      ) {
+        this.$message({
+          message: '运费输入错误',
+          type: 'warning'
+        })
+        return
+      }
       if (!this.deptBudgetList.agent) {
         this.$message({
           message: '经办人不能为空',
@@ -1112,19 +1564,42 @@ export default {
         })
     },
     tarechange(e) {
-      if (this.deptBudgetList.grossWeight && this.deptBudgetList.tare) {
+      if (this.deptBudgetList.grossWeight && this.deptBudgetList.tare&&this.deptBudgetList.deductionWeight) {
         this.deptBudgetList.netWeight = Number(
-          this.deptBudgetList.grossWeight - this.deptBudgetList.tare
+          this.deptBudgetList.grossWeight - this.deptBudgetList.tare-this.deptBudgetList.deductionWeight
         )
       }
     },
     grossWeightchange(e) {
-      if (this.deptBudgetList.grossWeight && this.deptBudgetList.tare) {
+      if (this.deptBudgetList.grossWeight && this.deptBudgetList.tare&&this.deptBudgetList.deductionWeight) {
         this.deptBudgetList.netWeight = Number(
-          this.deptBudgetList.grossWeight - this.deptBudgetList.tare
+          this.deptBudgetList.grossWeight - this.deptBudgetList.tare-this.deptBudgetList.deductionWeight
         )
       }
     },
+    contractNoChange(e){
+      for (var i = 0; i < this.outContractNo.length; i++) {
+        if (this.outContractNo[i].contractNo == e) {
+          this.deptBudgetList.goodsName = this.outContractNo[i].goodsName
+          this.deptBudgetList.goodsNameKey = this.outContractNo[i].goodsNameKey
+          this.deptBudgetList.cost= this.outContractNo[i].contractPrice
+          if(this.outContractNo[i].tranCarInfoList){
+            this.options2=this.outContractNo[i].tranCarInfoList
+            this.tranCarInfoList=this.outContractNo[i].tranCarInfoList
+            this.carstatus=true
+          }
+        }
+      }
+    },
+    typeChange(e){
+
+    },
+    pureweight(status){
+      console.log(this.deptBudgetList)
+      if(this.deptBudgetList.netWeight&&this.deptBudgetList.tidalGrainWater&&this.deptBudgetList.solidGrainWater&&this.deptBudgetList.buckleWeightRatio){
+        this.deptBudgetList.pureWeight=(this.deptBudgetList.netWeight*(100-(this.deptBudgetList.tidalGrainWater-this.deptBudgetList.solidGrainWater)*this.deptBudgetList.buckleWeightRatio))/100
+      }
+    },
     selectgoodsName(e) {
       for (var i = 0; i < this.goodnameList.length; i++) {
         if (this.goodnameList[i].constValue == e) {
@@ -1193,11 +1668,18 @@ export default {
           })
       }
       //合同编号
-      xialaNo({ compId: sessionStorage.getItem('ws-pf_compId') })
+      xialaNo({ compId: sessionStorage.getItem('ws-pf_compId'),flag:6 })
         .toPromise()
         .then(response => {
+          this.options1=response
           this.outContractNo = response
         })
+        //合同编号2
+      xialaNo({ compId: sessionStorage.getItem('ws-pf_compId'),flag:7 })
+        .toPromise()
+        .then(response => {
+          this.outContractNo1 = response
+        })
       //经办人
       getstaff({ compId: sessionStorage.getItem('ws-pf_compId') ,warehouseId:this.deptBudgetList.baseId })
         .toPromise()

+ 11 - 2
src/views/warehouse/warehouseManagementRecord.vue

@@ -137,6 +137,12 @@
                   <ws-form-item label="质检员" span="1" prop="qualityInspector">
                     {{ props.row.qualityInspector }}
                   </ws-form-item>
+                  <ws-form-item label="扣重比" span="1" prop="buckleWeightRatio">
+                    {{ props.row.buckleWeightRatio }}
+                  </ws-form-item>
+                  <ws-form-item label="干粮水分(%)" span="1" prop="solidGrainWater">
+                    {{ props.row.solidGrainWater }}
+                  </ws-form-item>
                 </ws-info-table>
               </ws-form>
             </template>
@@ -153,10 +159,13 @@
             label="毛重(吨)"
           ></el-table-column>
           <el-table-column prop="tare" label="皮重(吨)"> </el-table-column>
+          <el-table-column prop="deductionWeight" label="扣重(吨)"> </el-table-column>
           <el-table-column
             prop="netWeight"
             label="净重(吨)"
           ></el-table-column>
+          <el-table-column prop="pureWeight" label="纯重(吨)"> </el-table-column>
+          <el-table-column prop="deductionAmount" label="扣款(元/吨)"> </el-table-column>
           <el-table-column prop="grade" label="品级">
             <template slot-scope="scope">
               <span v-if="scope.row.grade == '一等品'" class="top-grade">{{
@@ -191,7 +200,7 @@
           </el-table-column>
           <el-table-column prop="agent" label="经办人">
           </el-table-column>
-          <el-table-column prop="buyer" label="内勤">
+          <el-table-column prop="buyer" label="操作人">
              </el-table-column>
           <el-table-column prop="addressUrl" label="附件">
             <template slot-scope="scope">
@@ -530,7 +539,7 @@ export default {
       })
         .toPromise()
         .then((response) => {
-          for (var i = 0; i < response.records.length; i++) {
+          for (var i = 0; i <  response.records.length; i++) {
             if (response.records[i].addressUrl != null) {
               response.records[i].addressUrlArray = response.records[
                 i

+ 1 - 1
vue.config.js

@@ -141,7 +141,7 @@ module.exports = {
         // target: 'https://product-server.winsea.com/', //目标地址
         // target: 'http://standard-dev.winsea.com/', //目标地址
         // target: 'http://localhost:8090/',
-        target: 'http://192.168.1.122:8090/',
+        target: 'http://192.168.1.120:8090/',
         // target: 'http://192.168.1.122:9100/',
         // target: 'http://192.168.1.112:8090/',
         // target: 'http://192.168.1.121:8090/',