gjy 3 年之前
父節點
當前提交
3963d0c79a

+ 149 - 111
src/views/houseSelfCollect/inspectionManagementNew.vue

@@ -93,9 +93,15 @@
                 <ws-form-item v-if='statusTypetext!="复检"&&serviceManagementType==1' label="扣款" span="1" prop="deductionAmount">
                   <ws-input  @input="kkInput(deptBudgetList.deductionAmount)" v-model="deptBudgetList.deductionAmount" placeholder="选填,1-10个字符" maxlength="10" size="small" />
                 </ws-form-item>
-                <ws-form-item label="货名" span="1" prop="inOutTaskNo">
+                <ws-form-item v-if='serviceManagementType==1' label="货名" span="1" prop="inOutTaskNo">
                   <ws-input v-model="deptBudgetList.goodsName" placeholder="自动获取,不可编辑" maxlength="100" disabled size="small" />
                 </ws-form-item>
+                <ws-form-item v-if='serviceManagementType==3' label="货名" span="1" prop="inOutTaskNo">
+                  <el-select v-model="deptBudgetList.goodsName" clearable filterable placeholder="请选择" class="typeselect"
+                    @change="goodsNameChange" :disabled="goodsdisabled">
+                    <el-option v-for="item in goodnameList" :key="item.valueKey" :label="item.goodsName" :value="item.goodsName" />
+                  </el-select>
+                </ws-form-item>
                 <ws-form-item v-if='statusTypetext!="初检"&&serviceManagementType==1' label="经办人" span="1" prop="agent">
                   <ws-input v-model="deptBudgetList.agent" placeholder="自动获取,不可编辑" maxlength="100" disabled size="small" />
                 </ws-form-item>
@@ -129,9 +135,13 @@
                   <el-date-picker :disabled='recheck' v-model="deptBudgetList.inOutDate" placeholder="请选择入库日期" type="date" value-format="yyyy-MM-dd"></el-date-picker>
                 </ws-form-item>
                 <ws-form-item label="运输方式" span="1" prop="outType">
-                  <el-select :disabled='recheck' v-model="deptBudgetList.outType" placeholder="请选择运输方式">
+                  <el-select v-if='serviceManagementType==1' :disabled='recheck' v-model="deptBudgetList.outType" placeholder="请选择运输方式">
                     <el-option v-for="item in multiSelector" :key="item.value" :label="item.name" :value="item.name" />
                   </el-select>
+                  <el-select v-if='serviceManagementType==3' @change='outTypechange' :disabled='recheck' v-model="outType" placeholder="请选择运输方式">
+                    <el-option v-for="item in multiSelector1" :key="item.id" :label="item.type+'('+item.contractNo+' '+item.seller+')'" :value="item.id" />
+                    <el-option  key="tayun1" label="他运" value="他运" />
+                  </el-select>
                 </ws-form-item>
                 <ws-form-item  v-if='serviceManagementType==1||serviceManagementType==3&&deptBudgetList.outType=="自运"' label="车队" span="1" prop="fleetName">
                   <el-select  :disabled='recheck' v-model="deptBudgetList.fleet" placeholder="非车队车辆">
@@ -299,6 +309,10 @@
     inspectAdd,
     getinspectEdit,
     getinspectcontractno,
+    getinspectLookUnitPrice,
+    getcustomer,
+    getDryGrainPrice,
+    getinspectLookGoods,
   } from '@/model/houseSelfCollect/index'
   import {
     pullDown,
@@ -323,6 +337,7 @@
         isShowPrint:false,
         typeList: ['干粮', '潮粮'],
         disablednotarize:false,
+        goodsdisabled:false,
         deptBudgetList:{
           type: '潮粮',
           freight: 0,
@@ -378,13 +393,16 @@
           titleNoOther:'',
         },
         taskNolist:[],
+        outType:'',
+        purchasePriceList:[],
         disabled:false,
+        goodnameList:[],
         disabled2:false,
         disabled1:false,
         disabledfright:true,
         recheck:false,
         storageType:[],
-        multiSelector:[],
+        multiSelector1:[],
         isSelectType:false,
         warehouseName:'',
         warehouseCount:'',
@@ -445,6 +463,36 @@
     },
     
     methods: {
+      goodsNameChange(e){
+        for (let q = 0; q < this.goodnameList.length; q++) {
+            if(this.goodnameList[q].contractNo=e){
+              this.deptBudgetList.goodsName=this.goodnameList[q].goodsName
+              this.deptBudgetList.goodsNameKey=this.goodnameList[q].goodsNameKey
+            } 
+          }
+          this.waterContentChange()
+      },
+      outTypechange(e){
+        console.log(e)
+        if(e!='他运'){
+          for (let i = 0; i < this.multiSelector1.length; i++) {
+            this.deptBudgetList.contractNo=this.multiSelector1[i].contractNo
+            
+          }
+          for (let q = 0; q < this.outContractNo.length; q++) {
+            if(this.outContractNo[q].contractNo=this.deptBudgetList.contractNo){
+              this.deptBudgetList.goodsName=this.outContractNo[q].goodsName
+              this.deptBudgetList.goodsNameKey=this.outContractNo[q].goodsNameKey
+            } 
+          }
+          this.deptBudgetList.outType='自运'
+          this.goodsdisabled=true
+          this.waterContentChange()
+        }else{
+          this.deptBudgetList.outType='他运'
+          this.goodsdisabled=false
+        }
+      },
        printSmall() {
         window.open('../../../static/inspectionnew.html?type=1&dataList=' + JSON.stringify(this.deptBudgetList))
       },
@@ -543,76 +591,42 @@
         }
         //潮粮单价改变事件
         if (
-          this.inspect.goodsName &&
-          this.inspect.waterContent &&
-          this.inspect.grade
+          this.deptBudgetList.goodsName &&
+          this.deptBudgetList.waterContent &&
+          this.deptBudgetList.grade
         ) {
           getinspectLookUnitPrice({
               warehouseId: this.cangid,
-              goodsName: this.inspect.goodsName,
-              waterContent: this.inspect.waterContent,
-              grade: this.inspect.grade,
+              goodsName: this.deptBudgetList.goodsName,
+              waterContent: this.deptBudgetList.waterContent,
+              grade: this.deptBudgetList.grade,
             })
             .toPromise()
             .then((response) => {
-              if (this.inspect.paramType == '1') {
-                this.inspect.tidalGrainPrice = parseFloat(parseFloat(response) - parseFloat(this.inspect
-                  .buckleMiscellaneous) / 100 * parseFloat(this.inspect.dryGrainPrice)).toFixed(4)
+              if (this.deptBudgetList.paramType == '1') {
+                this.deptBudgetList.tidalGrainPrice = parseFloat(parseFloat(response) - parseFloat(this.deptBudgetList
+                  .buckleMiscellaneous) / 100 * parseFloat(this.deptBudgetList.dryGrainPrice)).toFixed(4)
               } else {
                 if (this.inspect.type == '干粮') {
                   if (response == 0) {
                     getDryGrainPrice({
                         warehouseId: this.cangid,
-                        goodsName: this.inspect.goodsName
+                        goodsName: this.deptBudgetList.goodsName
                       })
                       .toPromise()
                       .then((response) => {
-                        this.$set(this.inspect, 'dryGrainPrice', response)
+                        this.$set(this.deptBudgetList, 'dryGrainPrice', response)
                       })
                   } else {
-                    this.inspect.dryGrainPrice = response
+                    this.deptBudgetList.dryGrainPrice = response
                   }
                 } else {
-                  this.inspect.tidalGrainPrice = response
+                  this.deptBudgetList.tidalGrainPrice = response
                 }
               }
             })
         }
-        if (this.inspect.goodsName && this.inspect.customerName) {
-          // //查看当前用户对应货名有未结算状态的送货
-          // let count = 0
-          // if (
-          //   this.inspect.goodsName &&
-          //   this.inspect.customerName
-          // ) {
-          //   getCount({
-          //       compId: localStorage.getItem('ws-pf_compId'),
-          //       customerName: this.inspect.customerName,
-          //       goodsName: this.inspect.goodsName,
-          //       customerNumberCard: this.inspect.customerNumberCard
-          //     }).toPromise()
-          //     .then((response) => {
-          //       count = response
-          //     })
-          //   // //  货名下拉校验
-          //   // getamount({
-          //   //   compId: localStorage.getItem('ws-pf_compId'),
-          //   //   customerName: this.inspect.customerName,
-          //   //   goodsName: this.inspect.goodsName,
-          //   //   customerNumberCard:this.inspect.customerNumberCard
-          //   // })
-          //   //   .toPromise()
-          //   //   .then((response) => {
-          //   //     for (let i = 0; i < this.purchasePriceList.length; i++) {
-          //   //       if (this.inspect.goodsName == this.purchasePriceList[i].goodsName) {
-          //   //         if ((this.purchasePriceList[i].saleLimit - response/1000 < 50 || count > 0 )&&this.tipFlag) {
-          //   //           this.tipFlag = false
-          //   //           this.$message('当前客户已累计销售我司' +this.inspect.goodsName + (response/1000).toFixed(2) +'吨,最高可售' +this.purchasePriceList[i].saleLimit +'吨。');
-          //   //         }
-          //   //       }
-          //   //     }
-          //   //   })
-          // }
+        if (this.deptBudgetList.goodsName && this.deptBudgetList.customerName) {
         }
       },
        opendBtn(){
@@ -839,6 +853,7 @@
         this.getList()
       },
       add(){
+        this.outType=''
         this.deptBudgetList={
           type: '潮粮',
           freight: 0,
@@ -969,47 +984,64 @@
         //   })
         //   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 (!String(this.deptBudgetList.freight)) {
-          this.$message({
-            message: '运费不能为空',
-            type: 'warning',
-          })
-          return
+        console.log(this.serviceManagementType)
+        if(this.serviceManagementType==1){
+          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 (!String(this.deptBudgetList.freight)) {
+            this.$message({
+              message: '运费不能为空',
+              type: 'warning',
+            })
+            return
+          }
+          if (
+            this.deptBudgetList.freight < 0 ||
+            this.deptBudgetList.freight > 100000 ||
+            (String(this.deptBudgetList.freight).indexOf('.') != -1 &&
+              String(this.deptBudgetList.freight).length -
+              (String(this.deptBudgetList.freight).indexOf('.') + 1) >
+              2)
+          ) {
+            this.$message({
+              message: '运费输入错误',
+              type: 'warning',
+            })
+            return
+          }
+          if (!this.deptBudgetList.inOutDate) {
+            this.$message({
+              message: '入库日期不能为空!',
+              type: 'warning',
+            })
+            return
+          }
+          if (!this.deptBudgetList.inOutType) {
+            this.$message({
+              message: '入库类型不能为空!',
+              type: 'warning',
+            })
+            return
         }
-        if (
-          this.deptBudgetList.freight < 0 ||
-          this.deptBudgetList.freight > 100000 ||
-          (String(this.deptBudgetList.freight).indexOf('.') != -1 &&
-            String(this.deptBudgetList.freight).length -
-            (String(this.deptBudgetList.freight).indexOf('.') + 1) >
-            2)
-        ) {
-          this.$message({
-            message: '运费输入错误',
-            type: 'warning',
-          })
-          return
         }
         this.deptBudgetList.warehouseInOutDetail.grade=this.deptBudgetList.grade
         if (!this.deptBudgetList.grade) {
@@ -1027,20 +1059,7 @@
           })
           return
         }
-        if (!this.deptBudgetList.inOutDate) {
-          this.$message({
-            message: '入库日期不能为空!',
-            type: 'warning',
-          })
-          return
-        }
-        if (!this.deptBudgetList.inOutType) {
-          this.$message({
-            message: '入库类型不能为空!',
-            type: 'warning',
-          })
-          return
-        }
+        
         if (!this.deptBudgetList.carNo) {
           this.$message({
             message: '车牌号不能为空',
@@ -1122,13 +1141,16 @@
           })
           return
         }
-        if (!this.deptBudgetList.contractNo) {
-          this.$message({
-            message: '合同编号不能为空',
-            type: 'warning',
-          })
-          return
+        if(this.serviceManagementType==1||this.serviceManagementType==3&&this.deptBudgetList.outType=='自运'){
+          if (!this.deptBudgetList.contractNo) {
+            this.$message({
+              message: '合同编号不能为空',
+              type: 'warning',
+            })
+            return
+          }
         }
+        
 
         // if (
         //   this.deptBudgetList.contractNo.length < 6 ||
@@ -1838,6 +1860,7 @@
             this.deptBudgetList.gradeKey = this.gradeList[i].constKey
           }
         }
+        this.waterContentChange()
       },
       reselectpackingMethod(e) {
         for (var i = 0; i < this.gradeList.length; i++) {
@@ -1864,6 +1887,14 @@
                 }
               }
             })
+          getinspectLookGoods({
+            warehouseId: this.cangid
+          })
+          .toPromise()
+          .then((response) => {
+            this.goodnameList = response
+            this.purchasePriceList = response
+          })
         // 品级
         pullDown({
             constId: 'CON3',
@@ -1882,8 +1913,15 @@
               this.options1 = response
               this.outContractNo = response
             })
+            this.multiSelector1=[]
         getinspectcontractno({compId:localStorage.getItem('ws-pf_compId'),warehouseName:this.warehouseName}).toPromise()
             .then((response) => {
+              if(response.contractManagementInfoList){
+                for (let i = 0; i < response.contractManagementInfoList.length; i++) {
+                  response.contractManagementInfoList[i].type='自运'
+                }
+              }
+              this.multiSelector1=response.contractManagementInfoList
               // this.options1 = response
               // this.outContractNo = response
             })

+ 2 - 1
src/views/houseSelfCollect/inspectionManagementrecord.vue

@@ -338,7 +338,8 @@
             warehouseName: this.warehouseName,
             managementType: 1,
             statusType:this.statusType,
-            serviceManagementType:this.serviceManagementType
+            serviceManagementType:this.serviceManagementType,
+            searchKeyWord:this.searchKeyWord
           })
           .toPromise()
           .then((response) => {