Forráskód Böngészése

Merge branch 'master' of http://git.zthymaoyi.com:3000/gdc/yiliangyiyun-pc

gjy 3 éve
szülő
commit
453dbf4bf7

+ 14 - 13
src/views/houseSelfCollect/acquisitionManagementAdd.vue

@@ -684,7 +684,7 @@
           if (typeof(_pointVal1) == 'string') _pointVal1 = _pointVal1.length
           let _tobeVal1 = _val1 % point
           if (type == 'waterBase') {
-            if (_val1 <= max && _val1 >= min && _pointVal1 <= saveNum && _tobeVal1 == 0) {
+            if (_val1 <= max && _val1 >= min && _pointVal1 <= saveNum ) {
               return false
             }
           }
@@ -701,10 +701,10 @@
           }
           return true
         }
-        if (this.baseInfoForm.waterBase == '' || _baseWaterValidate(1, 100, 1, 0.5, 'waterBase', parseFloat(this
+        if (this.baseInfoForm.waterBase == '' || _baseWaterValidate(1, 100, 1, 0.1, 'waterBase', parseFloat(this
             .baseInfoForm.waterBase))) {
-          if (_baseWaterValidate(1, 100, 1, 0.5, 'waterBase', parseFloat(this.baseInfoForm.waterBase))) {
-            that.$message.error('水分基准输入错误,最多保留1位小数,基准水分须可被0.5整除!');
+          if (_baseWaterValidate(1, 100, 1, 0.1, 'waterBase', parseFloat(this.baseInfoForm.waterBase))) {
+            that.$message.error('水分基准输入错误,最多保留1位小数,基准水分须可被0.1整除!');
           } else {
             this.$message.error('基准水分不能为空!');
           }
@@ -731,13 +731,13 @@
           return false
         }
 
-        if (this.baseInfoForm.waterMin == '' || _baseWaterValidate(1, 100, 1, 0.5, 'waterBase', parseFloat(this
+        if (this.baseInfoForm.waterMin == '' || _baseWaterValidate(1, 100, 1, 0.1, 'waterBase', parseFloat(this
             .baseInfoForm.waterMin))) {
           if (this.baseInfoForm.waterMin == '') {
             this.$message.error('干粮水分不能为空!')
           }
-          if (_baseWaterValidate(1, 100, 1, 0.5, 'waterBase', parseFloat(this.baseInfoForm.waterMin))) {
-            that.$message.error('干粮水分输入错误,最多保留1位小数,干粮水分须可被0.5整除!')
+          if (_baseWaterValidate(1, 100, 1, 0.1, 'waterBase', parseFloat(this.baseInfoForm.waterMin))) {
+            that.$message.error('干粮水分输入错误,最多保留1位小数,干粮水分须可被0.1整除!')
           }
           return false
         }
@@ -751,10 +751,10 @@
           return false
         }
 
-        if (this.baseInfoForm.waterMax == '' || _baseWaterValidate(1, 100, 1, 0.5, 'waterBase', parseFloat(this
+        if (this.baseInfoForm.waterMax == '' || _baseWaterValidate(1, 100, 1, 0.1, 'waterBase', parseFloat(this
             .baseInfoForm.waterMax))) {
-          if (_baseWaterValidate(1, 100, 1, 0.5, 'waterBase', parseFloat(this.baseInfoForm.waterMax))) {
-            that.$message.error('水分上限输入错误,最多保留1位小数,干粮水分须可被0.5整除!');
+          if (_baseWaterValidate(1, 100, 1, 0.1, 'waterBase', parseFloat(this.baseInfoForm.waterMax))) {
+            that.$message.error('水分上限输入错误,最多保留1位小数,干粮水分须可被0.1整除!');
           } else {
             this.$message.error('水分上限不能为空!');
           }
@@ -812,7 +812,7 @@
                 return false
               }
             } else {
-              if (_item1.water == '' || _baseWaterValidate(0, 100, 1, 0.5, 'waterBase', parseFloat(_item1.water))) {
+              if (_item1.water == '' || _baseWaterValidate(0, 100, 1, 0.1, 'waterBase', parseFloat(_item1.water))) {
                 if (_item1.water == '') {
                   that.$message.error('分界水分不能为空!')
                 } else {
@@ -853,6 +853,7 @@
           isValidate = this.validate()
          
         if (isValidate) {
+          debugger
           this.makeTableList()
           this.baseInfoForm.details = []
           this.makePriceDataList()
@@ -936,7 +937,7 @@
         let _obj = {}
         let _waterMin = parseFloat(this.baseInfoForm.waterMin)
         let _waterMax = parseFloat(this.baseInfoForm.waterBase)
-        let _count = (_waterMax - _waterMin) / 0.1 
+        let _count = Number(((_waterMax - _waterMin) / 0.1).toFixed(0)) 
         if(this.baseInfoForm.paramType == '2'){
           for (let i = 0; i < _count; i++) {
             // if (i == 0) {
@@ -961,7 +962,7 @@
           _obj = {}
           _waterMin = parseFloat(this.baseInfoForm.waterBase)
           _waterMax = parseFloat(this.baseInfoForm.waterMax)
-          _count = (_waterMax - _waterMin) / 0.1
+          _count = Number(((_waterMax - _waterMin) / 0.1).toFixed(0))
           for (let i = 0; i < _count; i++) {
             // if (i == 0) {
             //   _waterMin += 0.4

+ 33 - 3
src/views/houseSelfCollect/inspectInfo.vue

@@ -74,7 +74,7 @@
               <ws-input type="number" @mousewheel.native.prevent v-model="inspect.tidalGrainPrice" placeholder="请输入净重单价" maxlength="10" size="small" :disabled="disabled2" />
             </ws-form-item>
             <ws-form-item label="干粮单价(元/公斤)" span="1" prop="dryGrainPrice" v-if="inspect.type == '干粮'">
-              <ws-input type="number" @mousewheel.native.prevent v-model="inspect.dryGrainPrice" placeholder="请输入干粮单价" maxlength="10" size="small"  :disabled="disabled" />
+              <ws-input type="number" @mousewheel.native.prevent v-model="inspect.dryGrainPrice" placeholder="请输入干粮单价" maxlength="10" size="small"  :disabled="disabled2" />
             </ws-form-item>
           </ws-info-table>
 
@@ -423,7 +423,7 @@
             })
             return
           }
-           if(this.inspect.dryGrainPrice < 0 || this.inspect.dryGrainPrice > 1000){
+           if(this.inspect.dryGrainPrice <= 0 || this.inspect.dryGrainPrice > 1000){
             this.$message({
               message:'干粮价格输入错误',
               type:'warning'
@@ -440,6 +440,22 @@
           return
         }
         }
+        else{
+          if(!this.inspect.tidalGrainPrice){
+            this.$message({
+              message:'净重单价不能为空',
+              type:'warning'
+            })
+            return
+          }
+           if(this.inspect.tidalGrainPrice <= 0 || this.inspect.tidalGrainPrice > 1000){
+            this.$message({
+              message:'净重单价输入错误',
+              type:'warning'
+            })
+            return
+          }
+        }
         if (!this.inspect.grade) {
           this.$message({
             message: '等级不能为空',
@@ -769,7 +785,21 @@
               if(this.inspect.paramType == '1'){
                 this.inspect.tidalGrainPrice = parseFloat(parseFloat(response) - parseFloat(this.inspect.buckleMiscellaneous)/100*parseFloat(this.inspect.dryGrainPrice)).toFixed(4)
               }else{
-                this.inspect.tidalGrainPrice = response
+                if(this.inspect.type=='干粮'){
+                  if(response == 0){
+                    getDryGrainPrice({warehouseId:this.cangid,goodsName:this.inspect.goodsName})
+                      .toPromise()
+                      .then((response) => { 
+                        this.$set(this.inspect,'dryGrainPrice',response)
+                      })
+                  }
+                  else{
+                    this.inspect.dryGrainPrice = response
+                  }
+                }
+                else{
+                  this.inspect.tidalGrainPrice = response
+                }
               }
             })
         }

+ 12 - 4
src/views/houseSelfCollect/inspectionManagement.vue

@@ -158,7 +158,8 @@
 				isShowPrint: false,
 				printData: {},
 				deductWeight: '', //扣重比
-				saleLimit: ''
+				saleLimit: '',
+				allowEdit:'0'
 			}
 		},
 		activated() {
@@ -195,7 +196,8 @@
 						id: row.id,
 						warehouseName: this.warehouseName,
 						count: this.warehouseCount,
-						warehouseNo: this.warehouseNo
+						warehouseNo: this.warehouseNo,
+						allowEdit:this.allowEdit
 					},
 				})
 			},
@@ -207,6 +209,7 @@
 						this.warehouseCount = this.warehouseList[i].count
 						this.warehouseNo = this.warehouseList[i].No
 						this.cangid = this.warehouseList[i].id
+						this.allowEdit = this.warehouseList[i].allowEdit
 						this.WAREHOUSE[1].payname = this.warehouseList[i].value
 					}
 				}
@@ -269,28 +272,33 @@
 								this.warehouseName = _wareHouse.value
 								this.warehouseNo = _wareHouse.No
 								this.warehouseCount = _wareHouse.count
+								this.allowEdit = _wareHouse.allowEdit
 							} 
 						for (let i = 0; i < response.length; i++) {
 							if(_wareHouse && response[i].warehouseName==_wareHouse.value){
 								this.warehouseCount = response[i].count
+								this.allowEdit = response[i].allowEdit
 							}
 							this.warehouseList.push({
 								value: response[i].warehouseName,
 								id: response[i].id,
 								count: response[i].count,
-								No: response[i].commonWarehouseNo
+								No: response[i].commonWarehouseNo,
+								allowEdit:response[i].allowEdit
 							})
 							if (!_wareHouse) {
-									if (this.cangid && this.cangid == response[i].id) {
+								if (this.cangid && this.cangid == response[i].id) {
 									this.warehouseName = response[i].warehouseName
 									this.warehouseCount = response[i].count
 									this.warehouseNo = response[i].commonWarehouseNo
+									this.allowEdit =  response[i].allowEdit
 								}
 								if (this.warehouseList.length > 0 && !this.cangid) {
 									this.warehouseName = this.warehouseList[0].value
 									this.warehouseCount = this.warehouseList[0].count
 									this.warehouseNo = this.warehouseList[0].No
 									this.cangid = this.warehouseList[0].id
+									this.allowEdit = this.warehouseList[0].allowEdit
 									this.WAREHOUSE[1].payname = this.warehouseList[0].value
 								}
 							}

+ 17 - 9
src/views/houseSelfCollect/paymentManagement.vue

@@ -60,7 +60,7 @@
         </ws-button>
       </template>
     </BaseHeaderLayout>
-    <el-table :data="paymentList" style="width: 100%; margin-top: 20px" ref="paymentList" border height="600"
+    <el-table :data="paymentList" style="width: 100%; margin-top: 20px" ref="paymentList" border height="600" 
       @row-click="handleRowClick" @selection-change="handleSelectionChange" :summary-method="getSummaries" show-summary>
       <el-table-column :selectable="selectInit" type="selection" width="55"></el-table-column>
       <el-table-column type="index" label="序号" width="50">
@@ -169,7 +169,7 @@
     </el-dialog>
     <div style="text-align: center">
       <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
-        :page-size="deptCircularPage.pageSize" layout="total, sizes, prev, pager, next, jumper"
+        :page-sizes="[10, 30, 50, 100,500,1000,9999]" layout="total, sizes, prev, pager, next, jumper"
         :total="deptBudgetTotal"></el-pagination>
       <el-dialog width="70%" class="table-content" center :visible.sync="isShowPrint"
         :title="printData.compName + '结算凭证'">
@@ -496,11 +496,19 @@ import download from '../../components/WsDownload/download'
           .catch(() => {})
       },
       customer(row) {
-        this. customerInfo = true
-        this.customerlist = row.identityAuthenticationInfo
-        this.customerlist.cardAddressUrl1 = this.customerlist.cardAddressUrl.split(',')[0]
-        this.customerlist.cardAddressUrl2 = this.customerlist.cardAddressUrl.split(',')[1]
-        this.customerlist.payeeAddressUrls = this.customerlist.payeeAddressUrl.split(',')
+        getCustomerLook({
+                id: row.identityId,
+                authenticationStatusKey: 7
+              })
+        .toPromise()
+        .then(response => {
+          this. customerInfo = true
+          this.customerlist = response
+          this.customerlist.cardAddressUrl1 = this.customerlist.cardAddressUrl.split(',')[0]
+          this.customerlist.cardAddressUrl2 = this.customerlist.cardAddressUrl.split(',')[1]
+          this.customerlist.payeeAddressUrls = this.customerlist.payeeAddressUrl.split(',')
+        })
+        
       },
       customerclose(e) {
         console.log(e)
@@ -575,7 +583,7 @@ import download from '../../components/WsDownload/download'
           let index2 = 0;
           for (let i = 0; i < this.modification.length; i++) {
             getCustomerLook({
-                id: this.modification[i].identityAuthenticationInfo.id,
+                id: this.modification[i].identityId,
                 authenticationStatusKey: 7
               })
               .toPromise()
@@ -615,7 +623,7 @@ import download from '../../components/WsDownload/download'
           // console.log('批量打印凭证list',this.selectPrintList)
         } else {
           getCustomerLook({
-              id: this.rowData.identityAuthenticationInfo.id,
+              id: this.rowData.identityId,
               authenticationStatusKey: 7
             })
             .toPromise()

+ 13 - 13
src/views/houseSelfCollect/weightCheck.vue

@@ -111,7 +111,7 @@
             </el-table>
             <div style="text-align: center">
               <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
-                :current-page="currentPage" :page-size="deptCircularPage.pageSize"
+                :current-page="currentPage" page-size="100"
                 layout="total, sizes, prev, pager, next, jumper" :total="deptBudgetTotal">
               </el-pagination>
             </div>
@@ -296,18 +296,18 @@
           })
           .toPromise()
           .then((response) => {
-            for (let i = 0; i < response.records.length; i++) {
-              if (response.records[i].paymentManagement) {
-                if (response.records[i].paymentManagement.status == '待结算' && !response.records[i].paymentManagement
-                  .approveStatus) {
-                  response.records[i].allow = 1
-                } else {
-                  response.records[i].allow = 2
-                }
-              } else {
-                response.records[i].allow = 1
-              }
-            }
+            // for (let i = 0; i < response.records.length; i++) {
+            //   if (response.records[i].paymentManagement) {
+            //     if (response.records[i].paymentManagement.status == '待结算' && !response.records[i].paymentManagement
+            //       .approveStatus) {
+            //       response.records[i].allow = 1
+            //     } else {
+            //       response.records[i].allow = 2
+            //     }
+            //   } else {
+            //     response.records[i].allow = 1
+            //   }
+            // }
             this.weighingList = response.records
             this.common.commonWeighingList = response.records
             this.makeData();

+ 218 - 55
src/views/tradeServicesManagement/warehouseReceiptAdd.vue

@@ -20,22 +20,21 @@
           <el-input v-model="deptBudgetList.billNo" placeholder="请输入任务编号" maxlength="20" size="small" disabled>
           </el-input>
         </el-col>
-
       </el-form-item>
       <el-form-item label="名头" prop="renown" class="forlist">
-        <el-select v-model="deptBudgetList.renown" placeholder="请选择名头">
-          <el-option :label="item.compName" :key="item.compId" :value="item.compId"
-            v-for="(item,index) in compOptionList"></el-option>
+        <el-select v-model="deptBudgetList.renown" placeholder="请选择名头" @change="changeCompOptionList">
+          <el-option :label="item.compName" :key="index" :value="item.compId" v-for="(item,index) in compOptionList">
+          </el-option>
         </el-select>
       </el-form-item>
       <el-form-item label="仓库名称" prop="warehouseName" class="forlist">
         <el-select v-model="deptBudgetList.warehouseName" filterable placeholder="请选择仓库" @change="changeWarehouse">
-          <el-option v-for="item in warehouseList" :key='item.id' :label="item.warehouseName" :value="item.id">
+          <el-option v-for="(item,index) in warehouseList" :key='index' :label="item.warehouseName" :value="item.id">
           </el-option>
         </el-select>
       </el-form-item>
       <el-form-item label="仓位号" prop="warehouseNo" class="forlist">
-        <el-select v-model="deptBudgetList.warehouseNo" placeholder="请选择仓位号">
+        <el-select v-model="deptBudgetList.warehouseNo" placeholder="请选择仓位号" @change="changeWarehouseNo">
           <el-option :label="item.binNumber" :value="item.id" v-for="(item,index) in cwNumberList" :key='index'>
           </el-option>
         </el-select>
@@ -44,16 +43,17 @@
         <el-input disabled v-model="deptBudgetList.warehouseAddress" placeholder="请输入仓库地址" size="small"></el-input>
       </el-form-item>
       <el-form-item prop="goodsName" label="货名">
-        <el-select v-model="deptBudgetList.goodsName" placeholder="请选择货名">
-          <el-option v-for="item in goodsList" :key='item.id' :label="item.goodsName" :value="item.id"></el-option>
+        <el-select v-model="deptBudgetList.goodsName" placeholder="请选择货名" @change="changeGoodsName">
+          <el-option v-for="(item,index) in goodsList" :key='index' :label="item.goodsName" :value="item.id">
+          </el-option>
         </el-select>
       </el-form-item>
       <el-form-item prop="goodsName" label="品级">
         <el-select v-model="deptBudgetList.grade" placeholder="请选择品级">
-          <el-option label="一等" value="one"></el-option>
-          <el-option label="二等" value="two"></el-option>
-          <el-option label="三等" value="three"></el-option>
-          <el-option label="等外" value="out"></el-option>
+          <el-option label="一等" value="一等"></el-option>
+          <el-option label="二等" value="二等"></el-option>
+          <el-option label="三等" value="三等"></el-option>
+          <el-option label="等外" value="等外"></el-option>
         </el-select>
       </el-form-item>
       <el-form-item label="现有储量" prop="nowWeight" class="forlist">
@@ -63,13 +63,14 @@
         <el-input disabled v-model="deptBudgetList.useWeight" placeholder="请输入可用储量" size="small"></el-input>
       </el-form-item>
       <el-form-item label="本单重量(吨)" prop="weight" class="forlist">
-        <el-input v-model="deptBudgetList.weight" placeholder="输入本次仓单申请所需的重量" size="small"></el-input>
+        <el-input v-model="deptBudgetList.weight" placeholder="输入本次仓单申请所需的重量" size="small" @input='inputChange'>
+        </el-input>
       </el-form-item>
       <el-form-item label="单价(元/吨)" prop="unitPrice" class="forlist">
-        <el-input v-model="deptBudgetList.unitPrice" placeholder="输入粮食单价" size="small"></el-input>
+        <el-input v-model="deptBudgetList.unitPrice" placeholder="输入粮食单价" size="small" @input='inputChange'></el-input>
       </el-form-item>
       <el-form-item label="总价值(元)" prop="totalValue" class="forlist">
-        <el-input v-model="deptBudgetList.totalValue" placeholder="自动计算,不可编辑" size="small"></el-input>
+        <el-input disabled v-model="deptBudgetList.totalValue" placeholder="自动计算,不可编辑" size="small"></el-input>
       </el-form-item>
       <el-form-item label="申请比例(%)" prop="applicationProportion" class="forlist">
         <el-input v-model="deptBudgetList.applicationProportion" placeholder="输入申请比例" size="small"></el-input>
@@ -83,14 +84,14 @@
       <div>外审部门</div>
       <el-form-item prop="bank" label="银行">
         <el-select v-model="deptBudgetList.bank" placeholder="请选择银行">
-          <el-option label="中国银行" value="bank"></el-option>
-          <el-option label="营口银行" value="bank"></el-option>
+          <el-option label="中国银行" value="bank1"></el-option>
+          <el-option label="营口银行" value="bank2"></el-option>
         </el-select>
       </el-form-item>
       <el-form-item label="第三方" span="1" prop="three" class="forlist">
         <el-select v-model="deptBudgetList.three" placeholder="请选择银行">
-          <el-option label="第三方1" value="bank"></el-option>
-          <el-option label="第三方2" value="bank"></el-option>
+          <el-option label="第三方1" value="three1"></el-option>
+          <el-option label="第三方2" value="three2"></el-option>
         </el-select>
       </el-form-item>
       <div>
@@ -123,32 +124,59 @@
         deptBudgetList: {
           warehouseName: '',
           warehouseNo: '',
-          compId:sessionStorage.getItem('ws-pf_compId')
+          compId: '',
+          renown: '',
+          grade: '',
+          bank: '',
+          three: ''
         },
         size: 10,
-        compId: sessionStorage.getItem('ws-pf_compId'),
+        compId: '',
         warehouseList: [],
         compOptionList: [],
         cwNumberList: [],
         goodsList: [],
         rules: {
-          // name: [
-          //   { required: true, message: '请输入活动名称', trigger: 'blur' },
+          // unitPrice: [
+          //   { required: true, message: '单价不能为空!', trigger: 'blur' },
           //   { min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur' }
           // ],
         }
       }
     },
     activated() {
+      this.compId = sessionStorage.getItem('ws-pf_compId')
+      this.deptBudgetList.compId = this.compId
+      this.getcompList()
       this.getList()
     },
     methods: {
+      inputChange(e) {
+        if (this.deptBudgetList.unitPrice && this.deptBudgetList.weight) {
+          this.deptBudgetList.totalValue = this.deptBudgetList.unitPrice * this.deptBudgetList.weight
+        }
+        console.log(e)
+      },
       getList() {
         this.deptBudgetList.grade = '二等'
         // 获取业务编号
         getbillno().toPromise().then((response) => {
           this.deptBudgetList.billNo = response
         })
+        this.getWarehouse()
+      },
+      getcompList() {
+        //获取公司名头
+        getcompList()
+          .toPromise()
+          .then((res) => {
+            console.log('公司下拉列表数据', res)
+            this.compOptionList = res
+            this.deptBudgetList.renown = res[0].compName
+          })
+          .catch((err) => {})
+      },
+      getWarehouse() {
         //获取仓库
         selectWarehouseSelf({
             compId: this.compId
@@ -158,63 +186,198 @@
             this.warehouseList = response
             this.deptBudgetList.warehouseName = response[0].warehouseName
             this.cwNumberList = response[0].positionInfos
-            this.deptBudgetList.warehouseNo = response[0].positionInfos[0].binNumber
+            this.deptBudgetList.warehouseNo = response[0].positionInfos.length != 0 ? response[0].positionInfos[0]
+              .binNumber : ''
+            this.deptBudgetList.baseId = response[0].positionInfos.length != 0 ? response[0].positionInfos[0]
+              .baseId : ''
             this.deptBudgetList.warehouseAddress = response[0].warehousePrivate + response[0].warehouseCity +
               response[0].warehouseArea + response[0].detailedAddress
             this.goodsList = response[0].goodsNameInfos
-            this.deptBudgetList.nowWeight = response[0].goodsNameInfos[0].storage
+            this.deptBudgetList.nowWeight = response[0].goodsNameInfos.length != 0 ? response[0].goodsNameInfos[0]
+              .storage : ''
             // this.deptBudgetList.useWeight = response[0].goodsNameInfos[0].useWeight
             this.deptBudgetList.useWeight = '10'
-            this.deptBudgetList.goodsName = response[0].goodsNameInfos[0].goodsName
+            this.deptBudgetList.goodsName = response[0].goodsNameInfos.length != 0 ? response[0].goodsNameInfos[0]
+              .goodsName : ''
+            this.deptBudgetList.warehouseId = response[0].id
+            if (!this.deptBudgetList.renown) this.deptBudgetList.renown = this.compOptionList[0].compName
+            if (!this.deptBudgetList.renownId) this.deptBudgetList.renownId = this.compOptionList[0].compId
+            this.deptBudgetList.bankId = 'bankId'
+            this.deptBudgetList.threeId = 'threeId'
+            this.deptBudgetList.warehouseNoId = response[0].positionInfos.length != 0 ? response[0].positionInfos[0]
+              .id : ''
+            this.deptBudgetList.goodsNameKey = response[0].goodsNameInfos.length != 0 ? response[0].goodsNameInfos[0]
+              .goodsNameKey : ''
           })
-        //获取公司名头
-        getcompList()
-          .toPromise()
-          .then((res) => {
-            console.log('公司下拉列表数据', res)
-            this.compOptionList = res
-            this.deptBudgetList.renown = res[0].compName
-          })
-          .catch((err) => {})
+      },
+      //货名切换
+      changeGoodsName(val) {
+        let _data = this.goodsList
+        for (let i = 0; i < _data.length; i++) {
+          if (_data[i].id == val) {
+            this.deptBudgetList.goodsNameKey = _data[i].goodsNameKey
+            this.deptBudgetList.goodsName = _data[i].goodsName
+          }
+        }
+      },
+      //银行切换
+      changeBank(val) {
+        this.deptBudgetList.bankId = 'changebankId'
+      },
+      //第三方切换
+      changeThree(val) {
+        this.deptBudgetList.threeId = 'changethreeId'
+      },
+      //仓位号切换
+      changeWarehouseNo(val) {
+        let _data = this.cwNumberList
+        for (let i = 0; i < _data.length; i++) {
+          if (_data[i].id == val) {
+            this.deptBudgetList.warehouseNoId = _data[i].id
+            this.deptBudgetList.warehouseNo = _data[i].binNumber
+            this.deptBudgetList.baseId = _data.baseId
+          }
+        }
+      },
+      // 名头切换
+      changeCompOptionList(val) {
+        let _data = this.compOptionList
+        for (let i = 0; i < _data.length; i++) {
+          if (_data[i].compId == val) {
+            this.deptBudgetList.renownId = _data[i].compId
+            this.deptBudgetList.renown = _data[i].compName
+            this.compId = val
+            this.getWarehouse()
+          }
+        }
       },
       //仓库切换
-      changeWarehouse(val) {debugger
+      changeWarehouse(val) {
         console.log('切换后仓库数据', val)
         let _data = this.warehouseList
         for (let i = 0; i < _data.length; i++) {
           if (_data[i].id == val) {
             this.deptBudgetList.warehouseName = _data[i].warehouseName
-            this.cwNumberList =_data[i].positionInfos.length!=0?_data[i].positionInfos:[]
-            this.deptBudgetList.warehouseNo = _data[i].positionInfos.length!=0?_data[i].positionInfos[0].binNumber:''
+            this.cwNumberList = _data[i].positionInfos.length != 0 ? _data[i].positionInfos : []
+            this.deptBudgetList.warehouseNo = _data[i].positionInfos.length != 0 ? _data[i].positionInfos[0].binNumber :
+              ''
             this.deptBudgetList.warehouseAddress = _data[i].warehousePrivate + _data[i].warehouseCity +
               _data[i].warehouseArea + _data[i].detailedAddress
-            this.goodsList =_data[i].goodsNameInfos.length!=0?_data[i].goodsNameInfos:[]
-            this.deptBudgetList.nowWeight =_data[i].goodsNameInfos.length!=0?_data[i].goodsNameInfos[0].storage:''
+            this.goodsList = _data[i].goodsNameInfos.length != 0 ? _data[i].goodsNameInfos : []
+            this.deptBudgetList.nowWeight = _data[i].goodsNameInfos.length != 0 ? _data[i].goodsNameInfos[0].storage :
+              ''
             // this.deptBudgetList.useWeight =_data[i].goodsNameInfos.length!=0?_data[i].goodsNameInfos[0].useWeight:''
-            this.deptBudgetList.useWeight ='10'
-            this.deptBudgetList.goodsName = _data[i].goodsNameInfos.length!=0?_data[i].goodsNameInfos[0].goodsName:''
+            this.deptBudgetList.useWeight = '10'
+            this.deptBudgetList.goodsName = _data[i].goodsNameInfos.length != 0 ? _data[i].goodsNameInfos[0].goodsName :
+              ''
+            this.deptBudgetList.warehouseId = _data[i].id
+            this.deptBudgetList.goodsNameKey = _data[i].goodsNameInfos.length != 0 ? _data[i].goodsNameInfos[0]
+              .goodsNameKey : ''
+              this.deptBudgetList.warehouseNoId = _data[i].positionInfos.length != 0 ? _data[i].positionInfos[0]
+                .id : ''
+                this.deptBudgetList.baseId = _data[i].positionInfos.length != 0 ? _data[i].positionInfos[0]
+                  .baseId : ''
           }
         }
       },
       inoutput() {
         this.$router.push({
-          name: 'inOutRecord'
+          name: 'inOutRecord',
+          query: {
+            baseId: this.deptBudgetList.baseId,
+            positionId: this.deptBudgetList.warehouseNoId,
+            warehouseName: this.deptBudgetList.warehouseName,
+          }
         })
       },
+      validate() {
+        function _Validate(min, max, saveNum, type, inputVal) {
+          let _val1 = inputVal
+          let _pointVal1 = _val1.toString().split('.')[1]
+          if (_pointVal1 == undefined) _pointVal1 = 0
+          if (typeof(_pointVal1) == 'string') _pointVal1 = _pointVal1.length
+          if (_val1 <= max && _val1 >= min && _pointVal1 <= saveNum) {
+            return false
+          }
+          return true
+        }
+        if (!this.deptBudgetList.weight || _Validate(0, this.deptBudgetList.useWeight, 3, '', this.deptBudgetList
+            .weight)) {
+          if (!this.deptBudgetList.weight) {
+            this.$message.error('本单重量不能为空!');
+          } else {
+            this.$message.error('本单重量输入错误且本单重量不可超过可用重量!');
+          }
+          return false
+        }
+        if (!this.deptBudgetList.unitPrice || _Validate(1, 20000, 3, '', this.deptBudgetList
+            .unitPrice)) {
+          if (!this.deptBudgetList.unitPrice) {
+            this.$message.error('单价不能为空!');
+          } else {
+            this.$message.error('单价输入错误,1-20000之间,最多保留3位小数!');
+          }
+          return false
+        }
+        if (!this.deptBudgetList.totalValue) {
+          this.$message.error('总价值不能为空!');
+          return false
+        }
+        if (!this.deptBudgetList.applicationProportion || _Validate(10, 100, 2, '', this.deptBudgetList
+            .applicationProportion)) {
+          if (!this.deptBudgetList.applicationProportion) {
+            this.$message.error('申请比例不能为空!');
+          } else {
+            this.$message.error('申请比例输入错误,10-100之间,最多保留2位小数!');
+          }
+          return false
+        }
+        if (!this.deptBudgetList.interest || _Validate(1, 1000000000, 2, '', this.deptBudgetList
+            .interest)) {
+          if (!this.deptBudgetList.interest) {
+            this.$message.error('申请金额不能为空!');
+          } else {
+            this.$message.error('申请金额输入错误,1-10亿之间,最多保留2位小数!');
+          }
+          return false
+        }
+        if (!this.deptBudgetList.appendix) {
+          this.$message.error('附件不能为空!');
+          return false
+        } else if (this.deptBudgetList.appendix.split(',').length > 30) {
+          this.$message.error('附件数量需小于30!');
+          return false
+        }
+        if (!this.deptBudgetList.bank) {
+          this.$message.error('银行不能为空!');
+          return false
+        }
+        if (!this.deptBudgetList.three) {
+          this.$message.error('第三方不能为空!')
+          return false
+        }
+      },
       submit() {
-        this.$confirm(`确定提交审核?`, {
-          cancelButtonText: '取消',
-          confirmButtonText: '确定',
-          type: 'warning',
-        }).then(() => {debugger
-          addList(this.deptBudgetList).toPromise().then((response) => {
-            // this.tableData = response.records
-            this.$message.success('提交成功')
-          }).catch((req) => {
-            // this.tableData = response.records
-            this.$message.success('提交失败')
+        let isValidate = false
+        isValidate = this.validate()
+        if (isValidate) {
+          this.$confirm(`确定提交审核?`, {
+            cancelButtonText: '取消',
+            confirmButtonText: '确定',
+            type: 'warning',
+          }).then(() => {
+            addList(this.deptBudgetList).toPromise().then((response) => {
+              // this.tableData = response.records
+              this.$message.success('提交成功')
+              this.$router.push({
+                path: 'warehouseReceiptRegulation'
+              })
+            }).catch((req) => {
+              // this.tableData = response.records
+              this.$message.success('提交失败')
+            })
           })
-        })
+        }
       },
       onChange() {
         this.$refs.upload

+ 1 - 1
src/views/tradeServicesManagement/warehouseReceiptRegulation.vue

@@ -221,7 +221,7 @@
           .toPromise()
           .then((response) => {
             console.log('列表数据', response)
-            this.tradeServicesList = response.data.records
+            this.tradeServicesList = response.records
           })
       },
       selectShowType(e) {