高敬炎 1 tahun lalu
induk
melakukan
3e28a5f012

+ 31 - 32
src/views/tradeServicesManagement/goods.vue

@@ -16,9 +16,9 @@
         </el-date-picker>
         <el-select filterable clearable v-model="inOutType" placeholder="请选择货名" class="typeselect"
             @change="binNumberChange">
-            <el-option key="全部类型" label="全部类型" value="" />
-            <el-option v-for="item in inOutTypeList" :key="item.value" :label="item.value"
-              :value="item.value" />
+            <el-option key="全部货名" label="全部货名" value="" />
+            <el-option v-for="item in goodnameList" :key="item.constValue" :label="item.constValue"
+              :value="item.constValue" />
           </el-select>
       </el-col>
       <el-col :span="6" class="bg-right">
@@ -51,7 +51,7 @@
           </el-table-column>
           <el-table-column prop="inOutTaskNo" label="业务编号" width="180">
           </el-table-column>
-          <el-table-column prop="cargoRights" label="货源归属" width="60px"> </el-table-column>
+          <el-table-column prop="cargoRights" label="货源归属" width="130"> </el-table-column>
           <el-table-column prop="inOutType" label="入库类型" width="100"> </el-table-column>
           <el-table-column prop="carNo" label="车牌号">
             <template slot-scope="scope">
@@ -87,7 +87,7 @@
           </el-table-column>
           <el-table-column prop="inOutTaskNo" label="业务编号" width="180">
           </el-table-column>
-          <el-table-column prop="cargoRights" label="货源归属" width="60px"> </el-table-column>
+          <el-table-column prop="cargoRights" label="货源归属" width="180"> </el-table-column>
           <el-table-column prop="inOutType" label="入库类型" width="100"> </el-table-column>
           <el-table-column prop="carNo" label="车牌号">
             <template slot-scope="scope">
@@ -146,7 +146,6 @@
   } from '@/model/warehouse/index'
   import {
     packList,
-
   } from '@/model/contarct/index'
   import * as global from '@/global'
   import Pagination from '@/components/Pagination'
@@ -186,6 +185,7 @@
         show:false,
         srcList: [],
         binded:'',
+        goodsName:'',
         currectdata:{
           compId: localStorage.getItem('ws-pf_compId'),
         },
@@ -214,6 +214,7 @@
         compId: localStorage.getItem('ws-pf_compId'),
         deptCircularPage: {},
         pcFlag: 1,
+        goodnameList:[],
         date: {
           year: dayjs().format('YYYY'),
           month: dayjs().format('MM'),
@@ -224,7 +225,7 @@
         arr2:[],
         deptBudgetList: {},
         historyList: [],
-        searchType: '',
+        searchType: 3,
         allurl: '../../../public/img/radio.png',
         pickerBeginDateBefore: {
           disabledDate: (time) => {
@@ -246,6 +247,14 @@
       // this.binNumber = this.$route.query.binNumber
       this.capacity = this.$route.query.capacity
       this.warehouseType = this.$route.query.warehouseType
+       // 货名
+       packList({
+            constId: 'CON2'
+          })
+          .toPromise()
+          .then((response) => {
+            this.goodnameList = response
+          })
       this.getList()
       // this.getPassYearFormatDate()
       this.showType = this.isShow
@@ -257,6 +266,11 @@
     },
     methods: {
       async bindedselect(){
+        const newListLength = new Set(this.modification.map(item => item.goodsName)).size;
+        if ( newListLength>1) {
+          this.$message.error("请选择相同货名的条目!")
+          return
+        }
         var db=await global.default.openDB('warehouseReceipt')
         console.log(this.modification)
         console.log()
@@ -341,22 +355,13 @@
         }
       },
       binNumberChange(e) {
-        if (e == '全部仓位') {
-          this.deptBudgetList.positionId = ''
-          this.getList()
+        console.log(e)
+        if (e ) {
+         this.goodsName=e
         } else {
-          for (let i = 0; i < this.binnumberList.length; i++) {
-            if (this.binnumberList[i].binNumber == e) {
-              this.deptBudgetList.positionId = this.binnumberList[i].id
-            }
-          }
-          this.getList()
-          // var seperator1 = "-"
-          // var date = new Date()
-      
-          // var formatDate = date.getFullYear() + seperator1 + Number(date.getMonth() + 1) + seperator1 + date.getDate()
-          // this.getNowFormatDate(formatDate)
+          this.goodsName=''
         }
+        this.getList()
       },
 		/* 获取现在时间,并接受过去时间的值 */
         getNowFormatDate (formatDate) {
@@ -458,14 +463,7 @@
 					startDate=this.value2[0]?this.value2[0]:''
 					endDate=this.value2[1]?this.value2[1]:''
 				}
-        // 货名
-        packList({
-            constId: 'CON2'
-          })
-          .toPromise()
-          .then((response) => {
-            this.goodnameList = response
-          })
+       
 				if (this.warehouseType == 1) {
 					
 					addselectinfoList({
@@ -475,13 +473,13 @@
 							warehouseName: this.deptBudgetList.warehouseName,
 							startDate:startDate,
        				endDate:endDate,
-              inOutType:this.inOutType,
 							searchType: this.searchType,
 							searchKeyWord: this.searchKeyWord,
 							currentPage: this.currentPage,
 							pcFlag: this.pcFlag,
 							pageSize: this.pageSize,
-              binded:this.binded
+              binded:this.binded,
+              goodsName:this.goodsName
 						})
 						.toPromise()
 						.then((response) => {
@@ -509,7 +507,8 @@
 							searchKeyWord: this.searchKeyWord,
 							currentPage: this.currentPage,
 							pageSize: this.pageSize,
-              binded:this.binded
+              binded:this.binded,
+              goodsName:this.goodsName
 						})
 						.toPromise()
 						.then((response) => {

+ 58 - 53
src/views/tradeServicesManagement/warehouseReceiptAdd.vue

@@ -45,7 +45,7 @@
         <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="请选择货名" @change="dataFlush" filterable clearable>
+        <el-select disabled v-model="deptBudgetList.goodsName" placeholder="请选择货名" @change="dataFlush" filterable clearable>
           <el-option v-for="item in goodsList" :key="item.goodsName" :label="item.goodsName"
                   :value="item.goodsName" >
           </el-option>
@@ -71,18 +71,19 @@
         <el-button @click='selectgoods' type="primary">选择货源</el-button>
       </el-form-item>
       <el-form-item label="本单重量(吨)" prop="weight" class="forlist">
-        <el-input v-model="deptBudgetList.weight" placeholder="输入本次仓单申请所需的重量" size="small" @input='inputChange'>
+        <el-input v-model="deptBudgetList.weight" placeholder="输入本次仓单申请所需的重量" size="small" >
+        </el-input>
+      </el-form-item>
+      <el-form-item label="折干重量(吨)" prop="weight" class="forlist">
+        <el-input v-model="deptBudgetList.dryOutWeight" 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" @input='inputChange'></el-input>
       </el-form-item>
-      <el-form-item label="总价值(元)" prop="totalValue" class="forlist">
+      <el-form-item label="值(元)" prop="totalValue" class="forlist">
         <el-input type='number' 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>
-      </el-form-item>
       <el-form-item label="申请金额(元)" prop="interest" class="forlist">
         <el-input type='number' v-model="deptBudgetList.interest" placeholder="输入申请金额" size="small"></el-input>
       </el-form-item>
@@ -142,7 +143,8 @@
           warehouseNo:'',
           warehouseName:'',
           renown:'',
-          weight:''
+          weight:'',
+          interest:''
         },
         size: 10,
         compId: '',
@@ -169,11 +171,8 @@
       this.deptBudgetList.renown=localStorage.getItem('ws-pf_compName')
       // 
       let i = localStorage.getItem('pageUp')
-      if(i != 1&&!localStorage.getItem('warehouseReceiptdata')){
-        this.getWarehouse()
-      // this.getcompList()
       this.getList()
-      }
+      
       // getcomp({userMobilePhone:JSON.parse(localStorage.getItem('ws_login_getTenantInfoByUser')).loginInfo.userMobilePhone}).toPromise().then((res)=>{
         console.log(localStorage.getItem('ws-pf_compName'))
         this.deptBudgetList.renown=localStorage.getItem('ws-pf_compName')
@@ -185,13 +184,22 @@
         if(data){
           this.deptBudgetList.weight=''
           var weight = 0
+          var pureWeight = 0
           if(data.modification&&data.modification.length>0){
 
             this.goodstext='已选'+data.modification.length+'辆车'
             for(let i=0;i<data.modification.length;i++){
               weight+=data.modification[i].netWeight
+              pureWeight+=data.modification[i].netWeight
             }
+            this.deptBudgetList.goodsName = data.modification[0].goodsName
+            this.dataFlush()
             this.deptBudgetList.weight = weight.toFixed(2)
+            if(this.deptBudgetList.goodsName.indexOf('潮粮')!=-1){
+              this.deptBudgetList.dryOutWeight = pureWeight.toFixed(2)
+            }else{
+              this.deptBudgetList.dryOutWeight = weight.toFixed(2)
+            }
           }
         }
       }
@@ -214,8 +222,9 @@
         })
       },
       inputChange(e) {
-        if (this.deptBudgetList.unitPrice && this.deptBudgetList.weight) {
-          this.deptBudgetList.totalValue = this.deptBudgetList.unitPrice * this.deptBudgetList.weight
+        if (this.deptBudgetList.unitPrice && this.deptBudgetList.dryOutWeight) {
+          this.deptBudgetList.totalValue = this.deptBudgetList.unitPrice * this.deptBudgetList.dryOutWeight
+          this.$set(this.deptBudgetList,'interest',this.deptBudgetList.totalValue)
         }
       },
       //银行改变
@@ -239,7 +248,7 @@
         getbillno().toPromise().then((response) => {
           this.deptBudgetList.billNo = response
         })
-        // this.getWarehouse()
+        this.getWarehouse()
       },
       getcompList() {
         //获取公司名头
@@ -261,37 +270,40 @@
           .then(response => {
             console.log(response,76)
             this.warehouseList = response
-            this.deptBudgetList.warehouseName = response[0].warehouseName
-            this.deptBudgetList.warehouseType = response[0].warehouseType
-            this.deptBudgetList.warehouseAddress = response[0].warehousePrivate + response[0].warehouseCity + response[0].warehouseArea + response[0].detailedAddress
-              if(response[0].positionInfos){
-                 this.deptBudgetList.warehouseNoId = response[0].positionInfos.length != 0 ? response[0].positionInfos[0].id : ''
-                 this.cwNumberList = response[0].positionInfos
-                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 : ''
-              }
-              if(response[0].goodsNameInfos){
-                this.goodsList = []
-                for(let i = 0 ; i < response[0].goodsNameInfos.length ; i++){
-                  if(response[0].goodsNameInfos[i].binNumber ==  this.deptBudgetList.warehouseNo ){
-                    this.goodsList.push(response[0].goodsNameInfos[i])
-                  }
+            if(!this.deptBudgetList.warehouseName){
+              this.deptBudgetList.warehouseName = response[0].warehouseName
+              this.deptBudgetList.warehouseType = response[0].warehouseType
+              this.deptBudgetList.warehouseAddress = response[0].warehousePrivate + response[0].warehouseCity + response[0].warehouseArea + response[0].detailedAddress
+                if(response[0].positionInfos){
+                  this.deptBudgetList.warehouseNoId = response[0].positionInfos.length != 0 ? response[0].positionInfos[0].id : ''
+                  this.cwNumberList = response[0].positionInfos
+                  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 : ''
                 }
-                if(this.goodsList.length > 0 ){
-                  this.deptBudgetList.nowWeight = response[0].goodsNameInfos.length != 0 ? response[0].goodsNameInfos[0].storage : ''
-                  this.deptBudgetList.useWeight = response[0].goodsNameInfos[0].useStorage
-                  this.deptBudgetList.goodsName = this.goodsList[0].goodsName
-                  this.deptBudgetList.goodsNameKey = response[0].goodsNameInfos.length != 0 ? response[0].goodsNameInfos[0].goodsNameKey : ''
-                }else {
-                    this.deptBudgetList.nowWeight = ''
-                  this.deptBudgetList.useWeight = ''
-                  this.deptBudgetList.goodsName =''
-                  this.deptBudgetList.goodsNameKey = ''
-                }
-            
-              }
+                if(response[0].goodsNameInfos){
+                  this.goodsList = []
+                  for(let i = 0 ; i < response[0].goodsNameInfos.length ; i++){
+                    if(response[0].goodsNameInfos[i].binNumber ==  this.deptBudgetList.warehouseNo ){
+                      this.goodsList.push(response[0].goodsNameInfos[i])
+                    }
+                  }
+                  if(this.goodsList.length > 0 ){
+                    this.deptBudgetList.nowWeight = response[0].goodsNameInfos.length != 0 ? response[0].goodsNameInfos[0].storage : ''
+                    this.deptBudgetList.useWeight = response[0].goodsNameInfos[0].useStorage
+                    this.deptBudgetList.goodsName = this.goodsList[0].goodsName
+                    this.deptBudgetList.goodsNameKey = response[0].goodsNameInfos.length != 0 ? response[0].goodsNameInfos[0].goodsNameKey : ''
+                  }else {
+
+                      this.deptBudgetList.nowWeight = ''
+                    this.deptBudgetList.useWeight = ''
+                    this.deptBudgetList.goodsName =''
+                    this.deptBudgetList.goodsNameKey = ''
+                  }
               
-            this.deptBudgetList.warehouseId = response[0].id
+                }
+                
+              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
           })
@@ -352,12 +364,7 @@
             }
           }
         }
-        if(this.goodsList.length == 0){
-          this.deptBudgetList.goodsName = ''
-        }else{
-           this.deptBudgetList.goodsName = this.goodsList[0].goodsName
-        }
-        this.dataFlush();
+       
       },
       // 名头切换
       changeCompOptionList(val) {
@@ -383,6 +390,7 @@
               if(data.modification&&data.modification.length>0){
                 global.default.deleteDB(this.db,'signalChat',1)
                 this.deptBudgetList.weight = ''
+                this.deptBudgetList.dryOutWeight = ''
               }
             }
             
@@ -392,12 +400,9 @@
             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.deptBudgetList.useWeight =_data[i].goodsNameInfos.length!=0?_data[i].goodsNameInfos[0].useStorage:''
-            this.deptBudgetList.goodsName = _data[i].goodsNameInfos.length != 0 ? _data[i].goodsNameInfos[0].goodsName : ''
+            
             this.deptBudgetList.warehouseId = _data[i].id
             this.deptBudgetList.warehouseType = _data[i].warehouseType
-            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 : ''
           }