Browse Source

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

achao 1 year ago
parent
commit
3d7041b5ed

+ 3 - 1
src/views/home/index.vue

@@ -15,7 +15,8 @@
         <div class="guang"></div>
         <div class="guang"></div>
         <div class="d-flex jc-center">
         <div class="d-flex jc-center">
           <div class="title">
           <div class="title">
-            <span class="title-text">易粮易运大数据分析平台</span>
+            <span v-if="this.compId=='258fba198eea4cd1a5eddc71ba421b4a'" class="title-text">申融物流大数据分析平台</span>
+            <span v-else class="title-text">易粮易运大数据分析平台</span>
           </div>
           </div>
         </div>
         </div>
         <div class="btn">
         <div class="btn">
@@ -151,6 +152,7 @@ export default {
   },
   },
   data() {
   data() {
     return {
     return {
+      compId: localStorage.getItem('ws-pf_compId'),
       dataListTimer:null,
       dataListTimer:null,
       btnIndex:1,
       btnIndex:1,
       MapList:[],
       MapList:[],

+ 0 - 1
src/views/outboundManagement/weighingManagementNew.vue

@@ -1551,7 +1551,6 @@
             //   return
             //   return
             // }
             // }
           }
           }
-          
           if (
           if (
             this.weighingList.storageNumber&&this.weighingList.storageNumber.length < 1 ||
             this.weighingList.storageNumber&&this.weighingList.storageNumber.length < 1 ||
             this.weighingList.storageNumber&&this.weighingList.storageNumber.length > 10
             this.weighingList.storageNumber&&this.weighingList.storageNumber.length > 10

+ 16 - 0
src/views/tradeServicesManagement/component/routers/route.js

@@ -178,6 +178,22 @@ const tradeServicesManagementRouter = {
       },
       },
       hidden: true
       hidden: true
     },
     },
+    //修改仓单
+    {
+      path: 'warehouseReceiptgoods',
+      component: () =>
+        import( /* webpackChunkName: "applDetail" */ '@/views/tradeServicesManagement/editgoods'),
+      name: 'warehouseReceipteditgoods',
+      meta: {
+        title: 'warehouseReceiptgoods',
+        shortcutEntrance: 'warehouseReceiptRegulation',
+        module: 'tradeServicesManagement.tradeService.edit',
+        permissicon: [],
+        keepAlive: true,
+        _title:'修改仓单-选择货源'
+      },
+      hidden: true
+    },
     //查看仓单
     //查看仓单
     {
     {
       path: 'warehouseReceiptLook',
       path: 'warehouseReceiptLook',

+ 1010 - 0
src/views/tradeServicesManagement/editgoods.vue

@@ -0,0 +1,1010 @@
+<template>
+  <div class="container">
+    <el-row class="top">
+      <el-col :span="18">
+        <h2 class="bg-left title1">选择货源</h2>
+      </el-col>
+      <el-col :span="6" class="bg-right">
+        <el-button class="bg-bottom" type="primary" size="small" @click="returnWarehouse()">返回</el-button>
+      </el-col>
+    </el-row>
+    <el-row class="top-row">
+      <el-col :span="18">
+        <el-date-picker style="margin: 0 10px 0 0" class="dataClass" value-format='yyyy-MM-dd' v-model="value2"
+          @change='datechange' type="daterange" align="right" range-separator="至" start-placeholder="出入库日期起"
+          end-placeholder="出入库日期止">
+        </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 goodnameList" :key="item.constValue" :label="item.constValue"
+              :value="item.constValue" />
+          </el-select>
+      </el-col>
+      <el-col :span="6" class="bg-right">
+        <ws-input v-model="searchKeyWord" placeholder="可按货主或合同编号查找" clearable maxlength="250" type="input"
+          class="input">
+        </ws-input>
+        <!-- v-hasPermission="'procurement.sparepart.directShip'" -->
+        <ws-button class="find" type="primary" @click="find()">
+          <img width="16" height="16" style="vertical-align: text-top; position: relative; top: 0px"
+            src="../../../public/img/sousuo.png" alt />
+        </ws-button>
+      </el-col>
+    </el-row>
+    <el-row class="top-row">
+      <el-col :span="18">
+        <el-button @click="bindedChange('')" :type="binded==''?'primary':''" size="small">全部</el-button>
+        <el-button @click="bindedChange('0')" :type="binded=='0'?'primary':''" size="small">未绑定</el-button>
+        <el-button @click="bindedChange('1')" :type="binded=='1'?'primary':''" size="small">已绑定</el-button>
+        <span>库点:{{deptBudgetList.warehouseName}}</span>
+      </el-col>
+      <el-col :span="6" class="bg-right">
+        <el-button type="primary" @click="bindedselect">确定货源</el-button>
+      </el-col>
+    </el-row>
+    <div class="center">
+        <el-table ref="tableData" :data="warehouseList.records" height="570"
+          v-show="this.warehouseType== '1'" @selection-change="handleSelectionChange">
+          <el-table-column type="selection" width="55" :selectable="selectInit"></el-table-column>
+          <el-table-column prop="warehouseReceipt" label="所属仓单" width="180">
+          </el-table-column>
+          <el-table-column prop="inOutTaskNo" label="业务编号" width="180">
+          </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">
+              <span style="color: #8890b1">{{ scope.row.carNo }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column prop="goodsName" 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 label="水分(%)" span="1" prop="waterContent"></el-table-column>
+          <el-table-column label="容重(g/l)" span="1" prop="bulkDensity"></el-table-column>
+          <!-- <el-table-column prop="type" label="类型" width="60px"> </el-table-column> -->
+          <el-table-column prop="cost" label="单价(元/吨)">
+          </el-table-column>
+          <el-table-column prop="price" label="粮款(元)"> </el-table-column>
+         
+          <!-- <el-table-column prop="inOutDate" label="入库日期" width="100px">
+            <template slot-scope="scope">
+              <span style="color: #8890b1">{{ scope.row.inOutDate }}</span>
+            </template>
+          </el-table-column> -->
+          <el-table-column prop="createDate" label="入库日期">
+            <template slot-scope="scope">
+              <span style="color: #8890b1">{{ scope.row.createDate }}</span>
+            </template>
+          </el-table-column>
+
+        </el-table>
+        <el-table @selection-change="handleSelectionChange" :data="warehouseList.records" height="560"
+          v-show="this.warehouseType== '2'">
+          <el-table-column type="selection" width="55" :selectable="selectInit"></el-table-column>
+          <el-table-column prop="warehouseReceipt" label="所属仓单" width="180">
+          </el-table-column>
+          <el-table-column prop="inOutTaskNo" label="业务编号" width="180">
+          </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">
+              <span style="color: #8890b1">{{ scope.row.carNo }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column prop="goodsName" 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 label="水分(%)" span="1" prop="waterContent"></el-table-column>
+          <el-table-column label="容重(g/l)" span="1" prop="bulkDensity"></el-table-column>
+          <!-- <el-table-column prop="type" label="类型" width="60px"> </el-table-column> -->
+          <el-table-column prop="cost" label="单价(元/吨)">
+          </el-table-column>
+          <el-table-column prop="price" label="粮款(元)"> </el-table-column>
+         
+          <!-- <el-table-column prop="inOutDate" label="入库日期" width="100px">
+            <template slot-scope="scope">
+              <span style="color: #8890b1">{{ scope.row.inOutDate }}</span>
+            </template>
+          </el-table-column> -->
+          <el-table-column prop="createDate" label="入库日期">
+            <template slot-scope="scope">
+              <span style="color: #8890b1">{{ scope.row.createDate }}</span>
+            </template>
+          </el-table-column>
+
+        </el-table>
+
+
+        <div style="text-align: center; padding: 10px">
+          <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
+            :current-page="currentPage" :page-sizes="[10, 30, 50, 100,500,1000,9999]"
+            layout="total, sizes, prev, pager, next, jumper" :total="deptBudgetTotal"></el-pagination>
+        </div>
+      </ws-form>
+    </div>
+    <WinseaContentModal v-model="accessoryTFs" :title="$t('system.noticeCircular.information')"
+      @on-cancel="handleClose">
+      <p>查看附件</p>
+      <el-image style="width: 100px; height: 100px" :src="appendixIdss" :preview-src-list="srcList">
+      </el-image>
+    </WinseaContentModal>
+  </div>
+
+</template>
+
+
+<script>
+  import {
+    addselectinfoList,
+    recordss,
+    getPrintInfo,
+    getExpense,
+
+  } from '@/model/warehouse/index'
+  import {
+    packList,
+  } from '@/model/contarct/index'
+  import * as global from '@/global'
+  import Pagination from '@/components/Pagination'
+  import WsUpload from '@/components/WsUpload'
+  import {
+    dayjs,
+    fmoney,
+    EventBus
+  } from 'base-core-lib'
+  export default {
+    name: 'viewSpareMoney',
+    components: {
+      WsUpload,
+      Pagination,
+    },
+    watch: {
+      vesselId(val) {
+        this.getList()
+      },
+      isShow(val) {
+        this.showType = val
+      },
+    },
+    data() {
+      return {
+        //弹出框
+        dialogViewSpareMoney: false,
+        binnumberList: [],
+        // 船舶类型
+        monetaryKey: null,
+        // 是否显示
+        showType: true,
+        // 年
+        year: '',
+        form:{},
+        contractNo:{},
+        show:false,
+        srcList: [],
+        binded:'',
+        goodsName:'',
+        currectdata:{
+          compId: localStorage.getItem('ws-pf_compId'),
+        },
+        inOutType:'',
+        goodsList:[],
+        num:0,
+        deptBudgetTotal: 0,
+        currentPage: 1,
+        pageSize: 10,
+        capacity: '',
+        searchKeyWord: '',
+        contractType: 2,
+        startDate: null,
+        endDate: null,
+        remark: '',
+        binNumber: '全部仓位',
+        status: 1,
+        value2: [],
+        appendixIdss: '',
+        // 提交类型
+        submitType: true,
+        selectpackingMethod: {},
+        size: 10,
+        warehouseType: '1',
+        taskNolist1:[],
+        compId: localStorage.getItem('ws-pf_compId'),
+        deptCircularPage: {},
+        pcFlag: 1,
+        goodnameList:[],
+        date: {
+          year: dayjs().format('YYYY'),
+          month: dayjs().format('MM'),
+        },
+        warehouseList: [],
+        taskNolist:[],
+        taskNolist1:[],
+        arr2:[],
+        deptBudgetList: {},
+        historyList: [],
+        searchType: 3,
+        allurl: '../../../public/img/radio.png',
+        pickerBeginDateBefore: {
+          disabledDate: (time) => {
+            return time.getTime() > Date.now()
+          },
+        },
+        accessoryTFs: false,
+        modification: [],
+        printList: [], //批量打印数据
+        warehouseAllXiaLa:[]
+      }
+    },
+
+    activated() {
+      this.deptBudgetList.baseId = this.$route.query.baseId
+      // this.deptBudgetList.positionId = this.$route.query.positionId
+      this.deptBudgetList.warehouseName = this.$route.query.warehouseName
+      this.remark = this.$route.query.remark
+      // 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
+    },
+    updated() {
+      this.$nextTick(() => {
+        // this.$refs['tableData'].doLayout();
+      })
+    },
+    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()
+        var data=await global.default.getDataByKey(db,'signalChat',1)
+        if(data){
+          if(data.modification&&data.modification.length>0){
+            global.default.updateDB(db,'signalChat',{sequenceId:1,modification:this.modification})
+          }
+        }else{
+          global.default.addData(db,'signalChat',{sequenceId:1,modification:this.modification})
+        }
+        // localStorage.setItem('warehouseReceiptGood',this.modification)
+        this.$router.go(-1)
+      },
+      bindedChange(e){
+        this.binded=e
+        this.getList()
+      },
+      warehousechange(){
+        this.getList()
+      },
+      async salesTransfer(){
+        var arr=[]
+        if (this.modification.length == 0) {
+          this.$message.error("请勾选要转移的条目!")
+        } else {
+          this.num=0
+          for (var i = 0; i < this.modification.length; i++) {
+            if(this.modification[i].inOutType!='销售出库'){
+              this.$message.error("请勾选相同合同编号的销售出库记录!")
+              return
+            }
+            this.num+=Number(this.modification[i].netWeight)
+            if(arr.length==0){
+              arr.push(this.modification[i])
+            }
+            var arr1=arr.filter((item)=>{return item.contractNo==this.modification[i].contractNo})
+            if(arr1.length==0){
+              arr.push(this.modification[i])
+            }
+          }
+          if(arr.length>1){
+            this.$message.error("请勾选相同合同编号的销售出库记录!")
+            return
+          }
+          var contractNo=await getExpense({ contractNo: arr[0].contractNo, compId: this.compId }).toPromise()
+          if(contractNo.status=='已完成'||contractNo.status=='已结算'){
+            this.$message.error("已完成的合同记录不可转移!")
+            return
+          }
+          this.currectdata.warehouseInOutInfoList=this.modification
+          
+          let map = new Map();
+          for (let item of this.modification) {
+            map.set(item.inOutTaskNo, item.inOutTaskNo);
+          }
+          var arr = [...map.values()]
+          console.log(arr)
+          this.currectdata.taskNo=arr.toString()
+          this.currectdata.contractNo=this.modification[0].contractNo
+          this.currectdata.pointOut=contractNo.pointOut
+          this.taskNolist=this.taskNolist1
+          this.arr2=[]
+          for (let i = 0; i < this.taskNolist.length; i++) {
+            if(this.taskNolist[i].contractNo&&this.taskNolist[i].contractNo!=this.currectdata.contractNo||this.taskNolist[i].moveTaskNo&&this.taskNolist[i].moveTaskNo!=this.currectdata.contractNo){
+              this.arr2.push(this.taskNolist[i])
+            }
+          }
+          console.log(this.arr2)
+          this.show=true
+        }
+      },
+      handleSelectionChange(val) {
+        this.modification = val
+        console.log("sfasa", this.modification)
+      },
+      selectInit(row) {
+        if (row.binded ==0||!row.binded) {
+          return true
+        } else {
+          return false
+        }
+      },
+      binNumberChange(e) {
+        console.log(e)
+        if (e ) {
+         this.goodsName=e
+        } else {
+          this.goodsName=''
+        }
+        this.getList()
+      },
+		/* 获取现在时间,并接受过去时间的值 */
+        getNowFormatDate (formatDate) {
+			var date = new Date()
+			date.setTime(date.getTime()+24*60*60*1000)
+			var seperator1 = '-'
+			var year = date.getFullYear()
+			var month = date.getMonth() + 1
+			var strDate = date.getDate()
+			if (month >= 1 && month <= 9) {
+				month = '0' + month
+			}
+			if (strDate >= 0 && strDate <= 9) {
+				strDate = '0' + strDate
+			}
+			var nowData = year + seperator1 + month + seperator1 + strDate
+			this.value2= [formatDate, nowData]  // 默认赋值一年时间
+   		 },
+			print(row){
+				sessionStorage.removeItem('record_print')
+				getPrintInfo({
+                        id: row.id
+                      })
+                        .toPromise()
+                        .then((response) => {
+                                     localStorage.setItem('ck_bd_printData',JSON.stringify(response))
+                         window.open('../../../../static/weightCheckInOut.html?type=2')
+                         
+                        })
+			},
+			//返回按钮
+			returnWarehouse() {
+				this.$router.go(-1)
+			},
+			dateFormat(fmt, date) {
+				let ret
+				const opt = {
+					'Y+': date.getFullYear().toString(), // 年
+					'm+': (date.getMonth() + 1).toString(), // 月
+					'd+': date.getDate().toString(), // 日
+					'H+': date.getHours().toString(), // 时
+					// "M+": date.getMinutes().toString(),         // 分
+					// "S+": date.getSeconds().toString()          // 秒
+					// 有其他格式化字符需求可以继续添加,必须转化成字符串
+				}
+				for (let k in opt) {
+					ret = new RegExp('(' + k + ')').exec(fmt)
+					if (ret) {
+						fmt = fmt.replace(
+							ret[1],
+							ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, '0')
+						)
+					}
+				}
+				return fmt
+			},
+			datechange(){
+				this.getList()
+			},
+			find() {
+      			this.getList()
+    		},
+			handleClose() {
+				this.accessoryTFs = false
+        this.show=true
+			},
+			handleSizeChange(val) {
+				console.log(`每页 ${val} 条`)
+				this.pageSize = val
+				this.getList()
+			},
+			handleCurrentChange(val) {
+				this.currentPage = val
+				console.log(`当前页: ${val}`)
+				this.getList()
+			},
+			record(status, status1) {
+				this.status = status1
+				this.searchType = status
+				this.currentPage = '1'
+				this.getList()
+			},
+			// 上传附件
+			uploadSuccess(data, files, url) {
+				console.log(data, files, url)
+
+				// this.deptBudgetList.
+				// this.formData.append('files', files)
+				// this.feedbackObj.uploadNameAttachment = data.appendixName
+				// this.feedbackObj.pathUploadAttachment = data.appendixPath
+				// // this.newAppendixs = files
+				// this.onChangeFlag = true
+			},
+			getList() {
+        
+					var startDate=''
+					var endDate=''
+					if(this.value2){
+					startDate=this.value2[0]?this.value2[0]:''
+					endDate=this.value2[1]?this.value2[1]:''
+				}
+       
+				if (this.warehouseType == 1) {
+					
+					addselectinfoList({
+							compId: localStorage.getItem('ws-pf_compId'),
+							baseId: this.deptBudgetList.baseId,
+							positionId: this.deptBudgetList.positionId,
+							warehouseName: this.deptBudgetList.warehouseName,
+							startDate:startDate,
+       				endDate:endDate,
+							searchType: this.searchType,
+							searchKeyWord: this.searchKeyWord,
+							currentPage: this.currentPage,
+							pcFlag: this.pcFlag,
+							pageSize: this.pageSize,
+              binded:this.binded,
+              goodsName:this.goodsName
+						})
+						.toPromise()
+						.then((response) => {
+							for (var i = 0; i < response.records.length; i++) {
+								if (response.records[i].cost&&response.records[i].pureWeight) {
+									response.records[i].price=response.records[i].cost*response.records[i].pureWeight
+								} else {
+									response.records[i].price=0
+								}
+							}
+							this.deptCircularPage.currentPage = response.current
+							this.deptCircularPage.pageSize = response.size
+							this.deptBudgetTotal = response.total
+							this.warehouseList = response
+						})
+				} else if (this.warehouseType == 2) {
+					recordss({
+							compId: localStorage.getItem('ws-pf_compId'),
+							baseId: this.deptBudgetList.baseId,
+							positionId: this.deptBudgetList.positionId,
+							warehouseName: this.deptBudgetList.warehouseName,
+							startDate:startDate,
+       				endDate:endDate,
+							searchType: this.searchType,
+							searchKeyWord: this.searchKeyWord,
+							currentPage: this.currentPage,
+							pageSize: this.pageSize,
+              binded:this.binded,
+              goodsName:this.goodsName
+						})
+						.toPromise()
+						.then((response) => {
+							for (var i = 0; i < response.records.length; i++) {
+								if (response.records[i].cost&&response.records[i].pureWeight) {
+									response.records[i].price=response.records[i].cost*response.records[i].pureWeight
+								} else {
+									response.records[i].price=0
+								}
+							}
+							this.deptCircularPage.currentPage = response.current
+							this.deptCircularPage.pageSize = response.size
+							this.deptBudgetTotal = response.total
+							this.warehouseList = response
+						})
+            
+				}
+
+			},
+			selecttaskType(e) {
+				for (var i = 0; i < this.taskTypeList.length; i++) {
+					if (this.taskTypeList[i].value == e) {
+						this.searchType = this.taskTypeList[i].type
+					}
+				}
+			},
+			fujian(row) {
+				if (
+					row.addressUrl === null ||
+					row.addressUrl === ''
+				) {
+					EventBus.$emit(
+						'warning',
+						this.$t('system.noticeCircular.NoInformation')
+					)
+				} else {
+					this.accessoryTFs = true
+				}
+				this.appendixIdss = row.addressUrl
+				this.srcList=[row.addressUrl]
+			},
+			// 关闭 dialog时 处理文件url 初始化upload组件
+			handleCloe() {
+				this.dialogViewSpareMoney = false
+			},
+			history(row) {
+				console.log(row)
+				billoperatehis({
+						id: row.id
+					})
+					.toPromise()
+					.then((response) => {
+						this.historyList = response
+					})
+			},
+			// async exportlist() {
+			//   const { data } = await export1(
+			//     {
+			//       compId: localStorage.getItem('ws-pf_compId'),
+			//       contractType: this.contractType,
+			//       currentPage: this.currentPage,
+			//       pageSize: this.pageSize,
+			//       searchType: this.searchType,
+			//       searchKeyWord: this.searchKeyWord,
+			//       startDate: this.startDate,
+			//       endDate: this.endDate,
+			//     },
+			//     {},
+			//     { responseType: 'blob' }
+			//   ).toPromise()
+			//   downloadFile({
+			//     res: data,
+			//     fileName: `${
+			//       this.date.year + (this.date.month ? `-${this.date.month}` : '')
+			//     }_采购合同`,
+			//     type: 'xls',
+			//   })
+			// },
+			// deletecontract(){},
+			//删除
+
+			approve() {},
+			listQuery() {},
+			total() {},
+			clearfiltQuery() {},
+			selectCrtDuty() {},
+		},
+	}
+</script>
+<style lang="scss" scoped>
+  /deep/.totalStorage .el-input__inner {
+    color: #afb5cb;
+    background: #f5f7fa;
+  }
+
+  .small-title {
+    position: relative;
+    padding: 10px;
+    font-weight: 600;
+  }
+
+  .small-title::before {
+    position: absolute;
+    content: '';
+    display: block;
+    background: #5473e8;
+    width: 4px;
+    height: 14px;
+    left: 0px;
+    top: 13px;
+  }
+
+  .position {
+    position: relative;
+  }
+
+  .add,
+  .del {
+    position: absolute;
+    right: -38px;
+    top: 9px;
+    cursor: pointer;
+  }
+
+  .del {
+    right: -70px;
+  }
+
+  .amap-page-container {
+    width: 300px;
+    height: 300px;
+  }
+
+  .ware {
+    font-size: 12px;
+    color: rgb(255, 255, 255);
+    padding: 3px;
+    position: relative;
+    top: -1px;
+    border-radius: 3px;
+    display: inline-block;
+    text-align: center;
+  }
+
+  .title1 {
+    position: relative;
+  }
+
+  .title1::before {
+    content: '';
+    display: inline-block;
+    width: 5px;
+    height: 30px;
+    background: #5473e8;
+    position: absolute;
+    left: 0;
+  }
+
+  .ws-info-table {
+    border-left: 1px solid transparent;
+    border-top: 1px solid transparent;
+  }
+
+  .el-button--primary {
+    background-color: #5878e8;
+    border-color: #5878e8;
+  }
+
+  .adjustment.el-button--primary {
+    background-color: #51cdd9;
+    border-color: #51cdd9;
+  }
+
+  .top .el-col {
+    background: #f6f7fc;
+  }
+
+  .record {
+    background: #fff;
+    color: #8890b1;
+    border-color: #fff;
+    display: inline-block;
+    margin-bottom: 10px;
+    cursor: pointer;
+    margin-left: 5px;
+    margin-right: 5px;
+  }
+
+  .record img {
+    position: relative;
+    top: 2px;
+  }
+
+  .record.active img {
+    position: relative;
+    top: 4px;
+  }
+
+  .record.active {
+    color: #262626;
+  }
+
+  .button-container {
+    display: flex;
+    flex-wrap: nowrap;
+    justify-content: space-between;
+    align-items: center;
+    background-color: #fff;
+    width: 100%;
+    height: 50px;
+    padding: 0 10px;
+
+    &>div {
+      margin-left: 10px;
+      display: flex;
+      flex-wrap: nowrap;
+      flex-direction: row;
+
+      &>span {
+        line-height: 50px;
+      }
+    }
+
+    /deep/.auditFlow-box {
+      position: unset;
+      margin-left: 10px;
+
+      &/deep/.auditFlow-icon {
+        width: auto;
+        padding-right: 30px;
+      }
+
+      &/deep/.auditFlow-main {
+        position: absolute;
+      }
+    }
+  }
+
+  .box-app {
+    display: inline-block;
+    float: left;
+    margin-left: 30px;
+    line-height: 50px;
+  }
+
+  /deep/.el-dialog {
+    .el-form-item {
+      margin-bottom: 0 !important;
+
+      .el-input--medium {
+        textarea {
+          min-height: 100px !important;
+        }
+      }
+    }
+  }
+
+  .top-grade {
+    background: linear-gradient(90deg, #5678e9, #7993f6);
+    color: #fff;
+    padding: 3px;
+    border-radius: 2px;
+  }
+
+  .second-class {
+    background: linear-gradient(90deg, #50cdd9, #82e2ea);
+    color: #fff;
+    padding: 3px;
+    border-radius: 2px;
+  }
+
+  .third-class {
+    background: linear-gradient(90deg, #ffa735, #ffbf70);
+    color: #fff;
+    padding: 3px;
+    border-radius: 2px;
+  }
+
+  .substandard {
+    background: linear-gradient(90deg, #b2b4bb, #ced0d5);
+    color: #fff;
+    padding: 3px;
+    border-radius: 2px;
+  }
+
+  .collapse-bottom {
+    margin-bottom: 20px;
+  }
+
+  .input-main .textarea .el-textarea__inner {
+    width: 100%;
+    z-index: 1;
+  }
+
+  .bg-left {
+    padding-left: 30px;
+  }
+
+  .bg-right {
+    padding-right: 10px;
+    text-align: right;
+  }
+
+  .bg-bottom {
+    margin: 15px 0px;
+  }
+
+  .wenzi {
+    width: 900px;
+    margin: 0 auto;
+  }
+
+  .wenzi h3 {
+    display: inline-block;
+    left: 10px;
+  }
+
+  .wenzi p {
+    display: inline-block;
+  }
+
+  .center {
+    padding: 0 1%;
+  }
+
+  .el-form-item__label {
+    text-align: center;
+  }
+
+  .ce {
+    width: 900px;
+    margin: 0 auto;
+  }
+
+  /*.crt-main .textarea /deep/ .el-form-item__label {*/
+  /*  height: 82px;*/
+  /*}*/
+  // 控制select为只读的时候显示样式
+
+  .hide-sel {
+    .el-input__inner {
+      border: 0px;
+    }
+
+    .el-icon-arrow-up {
+      display: none;
+    }
+
+    .el-textarea__inner {
+      background-color: #fff !important;
+      border: 0;
+    }
+
+    .el-date-editor {
+      i {
+        display: none;
+      }
+    }
+
+    .is-disabled {
+      .el-input__inner:hover {
+        background-color: #fff !important;
+        border: 0;
+      }
+
+      color: #606266;
+
+      .el-input__inner {
+        background-color: #fff !important;
+        border: 0;
+        color: #606266;
+      }
+
+      .el-textarea__inner {
+        background-color: #fff !important;
+        border: 0;
+        color: #606266;
+      }
+    }
+  }
+
+  // 控制select为只读的时候显示样式
+  /deep/.ws-class-table-col {
+    height: auto;
+    padding: 0px 2px;
+
+    /deep/.el-input__inner {
+      padding: 0px 2px;
+    }
+  }
+
+  /deep/.is-disabled {
+    .el-input__prefix,
+    .el-input__suffix {
+      display: none;
+    }
+
+    .el-input__inner {
+      background-color: #fff;
+      border-color: #fff !important;
+      color: #000 !important;
+      font-size: 14px;
+      cursor: text;
+      padding: 0 !important;
+    }
+  }
+
+  .winseaview-view {
+    padding: 0 0 20px;
+  }
+
+  .container {
+    overflow: scroll;
+    height: 93vh;
+  }
+
+  .el-textarea__inner {
+    display: none;
+  }
+
+  .readonly {
+    width: 16%;
+  }
+
+  .ws-info-table .el-form-item {
+    width: 14.28%;
+  }
+
+  .dataClass {
+    width: 20% !important;
+  }
+
+  .input {
+    width: 50% !important;
+  }
+
+
+  /deep/.ws-info-table .el-form-item .el-form-item__label {
+    background-color: #f6f7fc;
+    font-size: 12px;
+    height: 45px;
+  }
+
+  //去边框
+  /deep/.el-form-item {
+    border-right: 0px;
+    border-bottom: 0px;
+  }
+
+  /deep/.ws-info-table {
+    border-left: 0px;
+    border-top: 0px;
+  }
+
+  .ws-info-table .el-form-item .el-form-item__content {
+    border-right: 0px;
+    border-bottom: 0px;
+    border-left: 0px;
+    border-top: 0px;
+  }
+
+  /deep/.ws-info-table .el-form-item {
+    border-right: 0px;
+    border-bottom: 0px;
+    border-left: 0px;
+    border-top: 0px;
+  }
+
+  /deep/.ws-info-table .el-form-item .el-form-item__content {
+    background: #f5f7fa;
+    border-radius: 4px;
+    border: 1px solid #d8dce6;
+    font-family: PingFangSC-Regular, PingFang SC;
+    margin-bottom: 5px;
+    background-color: #fff;
+    font-size: 14px;
+    font-weight: 400;
+    color: #8890b1;
+    line-height: 16px;
+  }
+
+  /deep/.ws-info-table .el-form-item .el-form-item__content {
+    border: 0px;
+  }
+
+  /deep/.el-table td,
+  /deep/.el-table .el-table__header .cell {
+    text-align: center;
+  }
+
+  .binNo {
+    color: #333;
+    font-size: 18px;
+    margin-left: 20px;
+  }
+  .top-row{
+    margin:10px 0;
+  }
+</style>

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

@@ -16,9 +16,9 @@
         </el-date-picker>
         </el-date-picker>
         <el-select filterable clearable v-model="inOutType" placeholder="请选择货名" class="typeselect"
         <el-select filterable clearable v-model="inOutType" placeholder="请选择货名" class="typeselect"
             @change="binNumberChange">
             @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-select>
       </el-col>
       </el-col>
       <el-col :span="6" class="bg-right">
       <el-col :span="6" class="bg-right">
@@ -51,7 +51,7 @@
           </el-table-column>
           </el-table-column>
           <el-table-column prop="inOutTaskNo" label="业务编号" width="180">
           <el-table-column prop="inOutTaskNo" label="业务编号" width="180">
           </el-table-column>
           </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="inOutType" label="入库类型" width="100"> </el-table-column>
           <el-table-column prop="carNo" label="车牌号">
           <el-table-column prop="carNo" label="车牌号">
             <template slot-scope="scope">
             <template slot-scope="scope">
@@ -87,7 +87,7 @@
           </el-table-column>
           </el-table-column>
           <el-table-column prop="inOutTaskNo" label="业务编号" width="180">
           <el-table-column prop="inOutTaskNo" label="业务编号" width="180">
           </el-table-column>
           </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="inOutType" label="入库类型" width="100"> </el-table-column>
           <el-table-column prop="carNo" label="车牌号">
           <el-table-column prop="carNo" label="车牌号">
             <template slot-scope="scope">
             <template slot-scope="scope">
@@ -146,7 +146,6 @@
   } from '@/model/warehouse/index'
   } from '@/model/warehouse/index'
   import {
   import {
     packList,
     packList,
-
   } from '@/model/contarct/index'
   } from '@/model/contarct/index'
   import * as global from '@/global'
   import * as global from '@/global'
   import Pagination from '@/components/Pagination'
   import Pagination from '@/components/Pagination'
@@ -186,6 +185,7 @@
         show:false,
         show:false,
         srcList: [],
         srcList: [],
         binded:'',
         binded:'',
+        goodsName:'',
         currectdata:{
         currectdata:{
           compId: localStorage.getItem('ws-pf_compId'),
           compId: localStorage.getItem('ws-pf_compId'),
         },
         },
@@ -214,6 +214,7 @@
         compId: localStorage.getItem('ws-pf_compId'),
         compId: localStorage.getItem('ws-pf_compId'),
         deptCircularPage: {},
         deptCircularPage: {},
         pcFlag: 1,
         pcFlag: 1,
+        goodnameList:[],
         date: {
         date: {
           year: dayjs().format('YYYY'),
           year: dayjs().format('YYYY'),
           month: dayjs().format('MM'),
           month: dayjs().format('MM'),
@@ -224,7 +225,7 @@
         arr2:[],
         arr2:[],
         deptBudgetList: {},
         deptBudgetList: {},
         historyList: [],
         historyList: [],
-        searchType: '',
+        searchType: 3,
         allurl: '../../../public/img/radio.png',
         allurl: '../../../public/img/radio.png',
         pickerBeginDateBefore: {
         pickerBeginDateBefore: {
           disabledDate: (time) => {
           disabledDate: (time) => {
@@ -246,6 +247,14 @@
       // this.binNumber = this.$route.query.binNumber
       // this.binNumber = this.$route.query.binNumber
       this.capacity = this.$route.query.capacity
       this.capacity = this.$route.query.capacity
       this.warehouseType = this.$route.query.warehouseType
       this.warehouseType = this.$route.query.warehouseType
+       // 货名
+       packList({
+            constId: 'CON2'
+          })
+          .toPromise()
+          .then((response) => {
+            this.goodnameList = response
+          })
       this.getList()
       this.getList()
       // this.getPassYearFormatDate()
       // this.getPassYearFormatDate()
       this.showType = this.isShow
       this.showType = this.isShow
@@ -257,6 +266,11 @@
     },
     },
     methods: {
     methods: {
       async bindedselect(){
       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')
         var db=await global.default.openDB('warehouseReceipt')
         console.log(this.modification)
         console.log(this.modification)
         console.log()
         console.log()
@@ -341,22 +355,13 @@
         }
         }
       },
       },
       binNumberChange(e) {
       binNumberChange(e) {
-        if (e == '全部仓位') {
-          this.deptBudgetList.positionId = ''
-          this.getList()
+        console.log(e)
+        if (e ) {
+         this.goodsName=e
         } else {
         } 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) {
         getNowFormatDate (formatDate) {
@@ -458,14 +463,7 @@
 					startDate=this.value2[0]?this.value2[0]:''
 					startDate=this.value2[0]?this.value2[0]:''
 					endDate=this.value2[1]?this.value2[1]:''
 					endDate=this.value2[1]?this.value2[1]:''
 				}
 				}
-        // 货名
-        packList({
-            constId: 'CON2'
-          })
-          .toPromise()
-          .then((response) => {
-            this.goodnameList = response
-          })
+       
 				if (this.warehouseType == 1) {
 				if (this.warehouseType == 1) {
 					
 					
 					addselectinfoList({
 					addselectinfoList({
@@ -475,13 +473,13 @@
 							warehouseName: this.deptBudgetList.warehouseName,
 							warehouseName: this.deptBudgetList.warehouseName,
 							startDate:startDate,
 							startDate:startDate,
        				endDate:endDate,
        				endDate:endDate,
-              inOutType:this.inOutType,
 							searchType: this.searchType,
 							searchType: this.searchType,
 							searchKeyWord: this.searchKeyWord,
 							searchKeyWord: this.searchKeyWord,
 							currentPage: this.currentPage,
 							currentPage: this.currentPage,
 							pcFlag: this.pcFlag,
 							pcFlag: this.pcFlag,
 							pageSize: this.pageSize,
 							pageSize: this.pageSize,
-              binded:this.binded
+              binded:this.binded,
+              goodsName:this.goodsName
 						})
 						})
 						.toPromise()
 						.toPromise()
 						.then((response) => {
 						.then((response) => {
@@ -509,7 +507,8 @@
 							searchKeyWord: this.searchKeyWord,
 							searchKeyWord: this.searchKeyWord,
 							currentPage: this.currentPage,
 							currentPage: this.currentPage,
 							pageSize: this.pageSize,
 							pageSize: this.pageSize,
-              binded:this.binded
+              binded:this.binded,
+              goodsName:this.goodsName
 						})
 						})
 						.toPromise()
 						.toPromise()
 						.then((response) => {
 						.then((response) => {

+ 8 - 4
src/views/tradeServicesManagement/reviewWarehouseReceipt.vue

@@ -31,12 +31,12 @@
           </el-option>
           </el-option>
         </el-select>
         </el-select>
       </el-form-item>
       </el-form-item>
-      <el-form-item label="仓位号" span="1" prop="warehouseNo" class="forlist">
+      <!-- <el-form-item label="仓位号" span="1" prop="warehouseNo" class="forlist">
         <el-select v-model="deptBudgetList.warehouseNo" placeholder="请选择仓位号" disabled filterable clearable>
         <el-select v-model="deptBudgetList.warehouseNo" placeholder="请选择仓位号" disabled filterable clearable>
           <el-option :label="item.binNumber" :value="item.id" v-for="(item, index) in cwNumberList" :key="index">
           <el-option :label="item.binNumber" :value="item.id" v-for="(item, index) in cwNumberList" :key="index">
           </el-option>
           </el-option>
         </el-select>
         </el-select>
-      </el-form-item>
+      </el-form-item> -->
       <el-form-item label="仓库地址" span="1" prop="warehouseAddress" class="forlist">
       <el-form-item label="仓库地址" span="1" prop="warehouseAddress" class="forlist">
         <el-input disabled v-model="deptBudgetList.warehouseAddress" placeholder="请输入仓库地址" size="small"></el-input>
         <el-input disabled v-model="deptBudgetList.warehouseAddress" placeholder="请输入仓库地址" size="small"></el-input>
       </el-form-item>
       </el-form-item>
@@ -54,15 +54,19 @@
           <el-option label="等外" value="等外"></el-option>
           <el-option label="等外" value="等外"></el-option>
         </el-select>
         </el-select>
       </el-form-item>
       </el-form-item>
-      <el-form-item label="现有储量" span="1" prop="nowWeight" class="forlist" disabled>
+      <!-- <el-form-item label="现有储量" span="1" prop="nowWeight" class="forlist" disabled>
         <el-input disabled v-model="deptBudgetList.nowWeight" placeholder="请输入现有储量" size="small"></el-input>
         <el-input disabled v-model="deptBudgetList.nowWeight" placeholder="请输入现有储量" size="small"></el-input>
       </el-form-item>
       </el-form-item>
       <el-form-item label="可用储量(吨)" span="1" prop="useWeight" class="forlist">
       <el-form-item label="可用储量(吨)" span="1" prop="useWeight" class="forlist">
         <el-input disabled v-model="deptBudgetList.useWeight" placeholder="请输入可用储量" size="small"></el-input>
         <el-input disabled v-model="deptBudgetList.useWeight" placeholder="请输入可用储量" size="small"></el-input>
-      </el-form-item>
+      </el-form-item> -->
       <el-form-item label="本单重量(吨)" span="1" prop="weight" class="forlist">
       <el-form-item label="本单重量(吨)" span="1" prop="weight" class="forlist">
         <el-input v-model="deptBudgetList.weight" placeholder="输入本次仓单申请所需的重量" size="small" disabled></el-input>
         <el-input v-model="deptBudgetList.weight" placeholder="输入本次仓单申请所需的重量" size="small" disabled></el-input>
       </el-form-item>
       </el-form-item>
+      <el-form-item label="折干重量(吨)" prop="weight" class="forlist">
+        <el-input v-model="deptBudgetList.dryOutWeight"   disabled placeholder="输入折干重量" size="small" >
+        </el-input>
+      </el-form-item>
       <el-form-item label="单价(元/吨)" span="1" prop="unitPrice" class="forlist" disabled>
       <el-form-item label="单价(元/吨)" span="1" prop="unitPrice" class="forlist" disabled>
         <el-input v-model="deptBudgetList.unitPrice" placeholder="输入粮食单价" size="small" disabled></el-input>
         <el-input v-model="deptBudgetList.unitPrice" placeholder="输入粮食单价" size="small" disabled></el-input>
       </el-form-item>
       </el-form-item>

+ 107 - 94
src/views/tradeServicesManagement/warehouseReceiptAdd.vue

@@ -35,17 +35,17 @@
           </el-option>
           </el-option>
         </el-select>
         </el-select>
       </el-form-item>
       </el-form-item>
-      <el-form-item label="仓位号" prop="warehouseNo" class="forlist">
+      <!-- <el-form-item label="仓位号" prop="warehouseNo" class="forlist">
         <el-select v-model="deptBudgetList.warehouseNo" placeholder="请选择仓位号" @change="changeWarehouseNo" filterable clearable>
         <el-select v-model="deptBudgetList.warehouseNo" placeholder="请选择仓位号" @change="changeWarehouseNo" filterable clearable>
           <el-option :label="item.binNumber" :value="item.binNumber" v-for="(item,index) in cwNumberList" :key='index'>
           <el-option :label="item.binNumber" :value="item.binNumber" v-for="(item,index) in cwNumberList" :key='index'>
           </el-option>
           </el-option>
         </el-select>
         </el-select>
-      </el-form-item>
+      </el-form-item> -->
       <el-form-item label="仓库地址" prop="warehouseAddress" class="forlist">
       <el-form-item label="仓库地址" prop="warehouseAddress" class="forlist">
         <el-input disabled v-model="deptBudgetList.warehouseAddress" placeholder="请输入仓库地址" size="small"></el-input>
         <el-input disabled v-model="deptBudgetList.warehouseAddress" placeholder="请输入仓库地址" size="small"></el-input>
       </el-form-item>
       </el-form-item>
       <el-form-item prop="goodsName" label="货名">
       <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"
           <el-option v-for="item in goodsList" :key="item.goodsName" :label="item.goodsName"
                   :value="item.goodsName" >
                   :value="item.goodsName" >
           </el-option>
           </el-option>
@@ -59,30 +59,31 @@
           <el-option label="等外" value="等外"></el-option>
           <el-option label="等外" value="等外"></el-option>
         </el-select>
         </el-select>
       </el-form-item> -->
       </el-form-item> -->
-      <el-form-item label="现有储量" prop="nowWeight" class="forlist">
+      <!-- <el-form-item label="现有储量" prop="nowWeight" class="forlist">
         <el-input disabled v-model="deptBudgetList.nowWeight" placeholder="请输入现有储量" size="small"></el-input>
         <el-input disabled v-model="deptBudgetList.nowWeight" placeholder="请输入现有储量" size="small"></el-input>
       </el-form-item>
       </el-form-item>
       <el-form-item label="可用储量(吨)" prop="useWeight" class="forlist">
       <el-form-item label="可用储量(吨)" prop="useWeight" class="forlist">
         <el-input disabled v-model="deptBudgetList.useWeight" placeholder="请输入可用储量" size="small"></el-input>
         <el-input disabled v-model="deptBudgetList.useWeight" placeholder="请输入可用储量" size="small"></el-input>
-      </el-form-item>
+      </el-form-item> -->
       <el-form-item label="货源" prop="weight" class="forlist supplyofgoods">
       <el-form-item label="货源" prop="weight" class="forlist supplyofgoods">
         <el-input disabled v-model="goodstext" placeholder="" size="small" @input='inputChange'>
         <el-input disabled v-model="goodstext" placeholder="" size="small" @input='inputChange'>
         </el-input>
         </el-input>
         <el-button @click='selectgoods' type="primary">选择货源</el-button>
         <el-button @click='selectgoods' type="primary">选择货源</el-button>
       </el-form-item>
       </el-form-item>
       <el-form-item label="本单重量(吨)" prop="weight" class="forlist">
       <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-input>
       </el-form-item>
       </el-form-item>
       <el-form-item label="单价(元/吨)" prop="unitPrice" class="forlist">
       <el-form-item label="单价(元/吨)" prop="unitPrice" class="forlist">
         <el-input v-model="deptBudgetList.unitPrice" placeholder="输入粮食单价" size="small" @input='inputChange'></el-input>
         <el-input v-model="deptBudgetList.unitPrice" placeholder="输入粮食单价" size="small" @input='inputChange'></el-input>
       </el-form-item>
       </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-input type='number' disabled v-model="deptBudgetList.totalValue" placeholder="自动计算,不可编辑" size="small"></el-input>
       </el-form-item>
       </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-form-item label="申请金额(元)" prop="interest" class="forlist">
         <el-input type='number' v-model="deptBudgetList.interest" placeholder="输入申请金额" size="small"></el-input>
         <el-input type='number' v-model="deptBudgetList.interest" placeholder="输入申请金额" size="small"></el-input>
       </el-form-item>
       </el-form-item>
@@ -121,8 +122,8 @@
   } from '@/model/tradeServicesManagement/index'
   } from '@/model/tradeServicesManagement/index'
 
 
   import {
   import {
-    getwarehouse
-  } from '@/model/houseSelfCollect/index'
+    xiala
+  } from '@/model/warehouse/index'
   import {
   import {
     getcomp
     getcomp
   } from '@/model/indexRx'
   } from '@/model/indexRx'
@@ -141,7 +142,9 @@
           nowWeight:'',
           nowWeight:'',
           warehouseNo:'',
           warehouseNo:'',
           warehouseName:'',
           warehouseName:'',
-          renown:''
+          renown:'',
+          weight:'',
+          interest:''
         },
         },
         size: 10,
         size: 10,
         compId: '',
         compId: '',
@@ -168,22 +171,38 @@
       this.deptBudgetList.renown=localStorage.getItem('ws-pf_compName')
       this.deptBudgetList.renown=localStorage.getItem('ws-pf_compName')
       // 
       // 
       let i = localStorage.getItem('pageUp')
       let i = localStorage.getItem('pageUp')
-      if(i != 1&&!localStorage.getItem('warehouseReceiptdata')){
-        this.getWarehouse()
-      // this.getcompList()
       this.getList()
       this.getList()
-      }
+      
       // getcomp({userMobilePhone:JSON.parse(localStorage.getItem('ws_login_getTenantInfoByUser')).loginInfo.userMobilePhone}).toPromise().then((res)=>{
       // getcomp({userMobilePhone:JSON.parse(localStorage.getItem('ws_login_getTenantInfoByUser')).loginInfo.userMobilePhone}).toPromise().then((res)=>{
         console.log(localStorage.getItem('ws-pf_compName'))
         console.log(localStorage.getItem('ws-pf_compName'))
         this.deptBudgetList.renown=localStorage.getItem('ws-pf_compName')
         this.deptBudgetList.renown=localStorage.getItem('ws-pf_compName')
       // })
       // })
+      this.db=await global.default.openDB('warehouseReceipt')
       if(localStorage.getItem('warehouseReceiptdata')){
       if(localStorage.getItem('warehouseReceiptdata')){
         this.deptBudgetList=JSON.parse(localStorage.getItem('warehouseReceiptdata'))
         this.deptBudgetList=JSON.parse(localStorage.getItem('warehouseReceiptdata'))
-        this.db=await global.default.openDB('warehouseReceipt')
         var data=await global.default.getDataByKey(this.db,'signalChat',1)
         var data=await global.default.getDataByKey(this.db,'signalChat',1)
         if(data){
         if(data){
+          this.deptBudgetList.weight=''
+          var weight = 0
+          var pureWeight = 0
           if(data.modification&&data.modification.length>0){
           if(data.modification&&data.modification.length>0){
+
             this.goodstext='已选'+data.modification.length+'辆车'
             this.goodstext='已选'+data.modification.length+'辆车'
+            for(let i=0;i<data.modification.length;i++){
+              weight+=data.modification[i].netWeight
+              pureWeight+=data.modification[i].pureWeight
+            }
+            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)
+            }
+            if( this.deptBudgetList.unitPrice){
+              this.inputChange()
+            }
           }
           }
         }
         }
       }
       }
@@ -206,8 +225,9 @@
         })
         })
       },
       },
       inputChange(e) {
       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 = Number(this.deptBudgetList.unitPrice * this.deptBudgetList.dryOutWeight).toFixed(2)
+          this.$set(this.deptBudgetList,'interest',this.deptBudgetList.totalValue)
         }
         }
       },
       },
       //银行改变
       //银行改变
@@ -229,9 +249,9 @@
 
 
         // 获取业务编号
         // 获取业务编号
         getbillno().toPromise().then((response) => {
         getbillno().toPromise().then((response) => {
-          this.deptBudgetList.billNo = response
+          this.deptBudgetList.billNo =  localStorage.getItem('ws-pf_compDomainName')+response
         })
         })
-        // this.getWarehouse()
+        this.getWarehouse()
       },
       },
       getcompList() {
       getcompList() {
         //获取公司名头
         //获取公司名头
@@ -246,58 +266,50 @@
       },
       },
       getWarehouse() {
       getWarehouse() {
         //获取仓库
         //获取仓库
-        getwarehouse({
-            compId: this.compId
+        xiala({
+            compId: this.compId,
+            warehouseType:1
           }).toPromise()
           }).toPromise()
           .then(response => {
           .then(response => {
+            console.log(response,76)
             this.warehouseList = response
             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])
+                    }
+                  }
                 }
                 }
-            
-              }
-              
-            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.renown) this.deptBudgetList.renown = this.compOptionList[0].compName
             if (!this.deptBudgetList.renownId) this.deptBudgetList.renownId = this.compOptionList[0].compId
             if (!this.deptBudgetList.renownId) this.deptBudgetList.renownId = this.compOptionList[0].compId
           })
           })
       },
       },
       //货名切换
       //货名切换
-      changeGoodsName(val) {
-        let _data = this.goodsList
-        for (let i = 0; i < _data.length; i++) {
-          if (_data[i].goodsName == val) {
-            this.deptBudgetList.goodsNameKey = _data[i].goodsNameKey
-            this.deptBudgetList.goodsName = _data[i].goodsName
-            this.deptBudgetList.nowWeight = _data[i].storage
-            this.deptBudgetList.useWeight =  _data[i].useStorage                                       
-          }
-        }
-      },
+      // changeGoodsName(val) {
+      //   let _data = this.goodsList
+      //   for (let i = 0; i < _data.length; i++) {
+      //     if (_data[i].goodsName == val) {
+      //       this.deptBudgetList.goodsNameKey = _data[i].goodsNameKey
+      //       this.deptBudgetList.goodsName = _data[i].goodsName
+      //       this.deptBudgetList.nowWeight = _data[i].storage
+      //       this.deptBudgetList.useWeight =  _data[i].useStorage                                       
+      //     }
+      //   }
+      // },
       dataFlush(){
       dataFlush(){
         for (let i = 0; i < this.warehouseList.length; i++) {
         for (let i = 0; i < this.warehouseList.length; i++) {
           if (this.warehouseList[i].warehouseName == this.deptBudgetList.warehouseName) {
           if (this.warehouseList[i].warehouseName == this.deptBudgetList.warehouseName) {
@@ -323,7 +335,7 @@
       },
       },
       //仓位号切换
       //仓位号切换
       changeWarehouseNo(val) {
       changeWarehouseNo(val) {
-        
+        debugger
         let _data = this.cwNumberList
         let _data = this.cwNumberList
         for (let i = 0; i < _data.length; i++) {
         for (let i = 0; i < _data.length; i++) {
           if (_data[i].binNumber == val) {
           if (_data[i].binNumber == val) {
@@ -342,12 +354,7 @@
             }
             }
           }
           }
         }
         }
-        if(this.goodsList.length == 0){
-          this.deptBudgetList.goodsName = ''
-        }else{
-           this.deptBudgetList.goodsName = this.goodsList[0].goodsName
-        }
-        this.dataFlush();
+       
       },
       },
       // 名头切换
       // 名头切换
       changeCompOptionList(val) {
       changeCompOptionList(val) {
@@ -362,28 +369,36 @@
         }
         }
       },
       },
       //仓库切换
       //仓库切换
-      changeWarehouse(val) {
-        console.log('切换后仓库数据', val)
+      async changeWarehouse(val) {
+        
         let _data = this.warehouseList
         let _data = this.warehouseList
+        
         for (let i = 0; i < _data.length; i++) {
         for (let i = 0; i < _data.length; i++) {
-          if (_data[i].warehouseName == val) {
-            global.default.deleteDB(this.db,'signalChat',1)
+          if (_data[i].warehouseName == val) {          
+            var data=await global.default.getDataByKey(this.db,'signalChat',1)
+            if(data){
+              if(data.modification&&data.modification.length>0){
+                global.default.deleteDB(this.db,'signalChat',1)
+                this.deptBudgetList.weight = ''
+                this.deptBudgetList.dryOutWeight = ''
+              }
+            }
+            
             this.goodstext='已选0辆车'
             this.goodstext='已选0辆车'
             this.deptBudgetList.warehouseName = _data[i].warehouseName
             this.deptBudgetList.warehouseName = _data[i].warehouseName
             this.cwNumberList = _data[i].positionInfos.length != 0 ? _data[i].positionInfos : []
             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.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.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.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.warehouseId = _data[i].id
             this.deptBudgetList.warehouseType = _data[i].warehouseType
             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.warehouseNoId = _data[i].positionInfos.length != 0 ? _data[i].positionInfos[0].id : ''
             this.deptBudgetList.baseId = _data[i].positionInfos.length != 0 ? _data[i].positionInfos[0].baseId : ''
             this.deptBudgetList.baseId = _data[i].positionInfos.length != 0 ? _data[i].positionInfos[0].baseId : ''
           }
           }
         }
         }
+        console.log('切换后仓库数据', this.deptBudgetList.warehouseId)
+        
         this.changeWarehouseNo(this.deptBudgetList.warehouseId)
         this.changeWarehouseNo(this.deptBudgetList.warehouseId)
       },
       },
       inoutput() {
       inoutput() {
@@ -409,13 +424,8 @@
           }
           }
           return true
           return true
         }
         }
-        if (!this.deptBudgetList.weight || _Validate(0, this.deptBudgetList.useWeight, 3, '', this.deptBudgetList
-            .weight)) {
-          if (!this.deptBudgetList.weight) {
+        if (!this.deptBudgetList.weight) {
             this.$message.error('本单重量不能为空!');
             this.$message.error('本单重量不能为空!');
-          } else {
-            this.$message.error('本单重量输入错误且本单重量不可超过可用重量!');
-          }
           return false
           return false
         }
         }
         if (!this.deptBudgetList.unitPrice || _Validate(1, 20000, 3, '', this.deptBudgetList
         if (!this.deptBudgetList.unitPrice || _Validate(1, 20000, 3, '', this.deptBudgetList
@@ -431,15 +441,15 @@
           this.$message.error('总价值不能为空!');
           this.$message.error('总价值不能为空!');
           return false
           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.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
         if (!this.deptBudgetList.interest || _Validate(1, 1000000000, 2, '', this.deptBudgetList
             .interest)) {
             .interest)) {
           if (!this.deptBudgetList.interest) {
           if (!this.deptBudgetList.interest) {
@@ -450,6 +460,7 @@
           return false
           return false
         }
         }
         if (!this.deptBudgetList.appendix) {
         if (!this.deptBudgetList.appendix) {
+          console.log(this.deptBudgetList.appendix)
           this.$message.error('附件不能为空!');
           this.$message.error('附件不能为空!');
           return false
           return false
         } else if (this.deptBudgetList.appendix.split(',').length > 30) {
         } else if (this.deptBudgetList.appendix.split(',').length > 30) {
@@ -475,7 +486,9 @@
         }
         }
         
         
         let isValidate = false
         let isValidate = false
+        console.log(this.validate())
         isValidate = this.validate()
         isValidate = this.validate()
+        console.log(isValidate)
         if (isValidate) {
         if (isValidate) {
           this.$confirm(`确定提交审核?`, {
           this.$confirm(`确定提交审核?`, {
             cancelButtonText: '取消',
             cancelButtonText: '取消',

+ 126 - 64
src/views/tradeServicesManagement/warehouseReceiptEdit.vue

@@ -20,11 +20,13 @@
         <el-input v-model="deptBudgetList.billNo" placeholder="请输入任务编号" maxlength="20" size="small" disabled></el-input>
         <el-input v-model="deptBudgetList.billNo" placeholder="请输入任务编号" maxlength="20" size="small" disabled></el-input>
       </el-form-item>
       </el-form-item>
       <el-form-item label="名头" span="1" prop="taskNo" class="renown">
       <el-form-item label="名头" span="1" prop="taskNo" class="renown">
-        <el-select v-model="deptBudgetList.renown" placeholder="请选择名头" @change="changeCompOptionList" filterable
+        <el-input v-model="deptBudgetList.renown" placeholder="请输入名头" maxlength="20" size="small" >
+          </el-input>
+        <!-- <el-select v-model="deptBudgetList.renown" placeholder="请选择名头" @change="changeCompOptionList" filterable
           clearable>
           clearable>
           <el-option :label="item.compName" :value="item.compId" v-for="(item,index) in compOptionList" :Key="index">
           <el-option :label="item.compName" :value="item.compId" v-for="(item,index) in compOptionList" :Key="index">
           </el-option>
           </el-option>
-        </el-select>
+        </el-select> -->
       </el-form-item>
       </el-form-item>
       <el-form-item label="仓库名称" span="1" prop="warehouseName" class="forlist">
       <el-form-item label="仓库名称" span="1" prop="warehouseName" class="forlist">
         <el-select v-model="deptBudgetList.warehouseName" placeholder="请选择仓库" @change="changeWarehouse" filterable
         <el-select v-model="deptBudgetList.warehouseName" placeholder="请选择仓库" @change="changeWarehouse" filterable
@@ -33,51 +35,60 @@
           </el-option>
           </el-option>
         </el-select>
         </el-select>
       </el-form-item>
       </el-form-item>
-      <el-form-item label="仓位号" span="1" prop="warehouseNo" class="forlist">
+      <!-- <el-form-item label="仓位号" span="1" prop="warehouseNo" class="forlist">
         <el-select v-model="deptBudgetList.warehouseNo" placeholder="请选择仓位号" @change="changeWarehouseNo" filterable
         <el-select v-model="deptBudgetList.warehouseNo" placeholder="请选择仓位号" @change="changeWarehouseNo" filterable
           clearable>
           clearable>
           <el-option :label="item.binNumber" :value="item.id" v-for="(item,index) in cwNumberList" :key='index'>
           <el-option :label="item.binNumber" :value="item.id" v-for="(item,index) in cwNumberList" :key='index'>
           </el-option>
           </el-option>
         </el-select>
         </el-select>
-      </el-form-item>
+      </el-form-item> -->
       <el-form-item label="仓库地址" span="1" prop="warehouseAddress" class="forlist">
       <el-form-item label="仓库地址" span="1" prop="warehouseAddress" class="forlist">
         <el-input disabled v-model="deptBudgetList.warehouseAddress" placeholder="请输入仓库地址" size="small"></el-input>
         <el-input disabled v-model="deptBudgetList.warehouseAddress" placeholder="请输入仓库地址" size="small"></el-input>
       </el-form-item>
       </el-form-item>
       <el-form-item prop="goodsName" label="货名" span="1">
       <el-form-item prop="goodsName" label="货名" span="1">
-        <el-select v-model="deptBudgetList.goodsName" placeholder="请选择货名" @change="changeGoodsName" filterable
+        <el-select v-model="deptBudgetList.goodsName" disabled placeholder="请选择货名" @change="changeGoodsName" filterable
           clearable>
           clearable>
           <el-option v-for="(item,index) in goodsList" :key='index' :label="item.goodsName" :value="item.id">
           <el-option v-for="(item,index) in goodsList" :key='index' :label="item.goodsName" :value="item.id">
           </el-option>
           </el-option>
         </el-select>
         </el-select>
       </el-form-item>
       </el-form-item>
-      <el-form-item prop="grade" label="品级" span="1">
+      <!-- <el-form-item prop="grade" label="品级" span="1">
         <el-select v-model="deptBudgetList.grade" placeholder="请选择品级" filterable clearable>
         <el-select v-model="deptBudgetList.grade" placeholder="请选择品级" filterable clearable>
           <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-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-select>
-      </el-form-item>
-      <el-form-item label="现有储量" span="1" prop="nowWeight" class="forlist">
+      </el-form-item> -->
+      <!-- <el-form-item label="现有储量" span="1" prop="nowWeight" class="forlist">
         <el-input disabled v-model="deptBudgetList.nowWeight" placeholder="请输入现有储量" size="small"></el-input>
         <el-input disabled v-model="deptBudgetList.nowWeight" placeholder="请输入现有储量" size="small"></el-input>
       </el-form-item>
       </el-form-item>
       <el-form-item label="可用储量(吨)" span="1" prop="useWeight" class="forlist">
       <el-form-item label="可用储量(吨)" span="1" prop="useWeight" class="forlist">
         <el-input disabled v-model="deptBudgetList.useWeight" placeholder="请输入可用储量" size="small"></el-input>
         <el-input disabled v-model="deptBudgetList.useWeight" placeholder="请输入可用储量" size="small"></el-input>
+      </el-form-item> -->
+      <el-form-item label="货源" prop="weight" class="forlist supplyofgoods">
+        <el-input disabled v-model="goodstext" placeholder="" size="small" >
+        </el-input>
+        <el-button @click='selectgoods' type="primary">选择货源</el-button>
       </el-form-item>
       </el-form-item>
       <el-form-item label="本单重量(吨)" span="1" prop="weight" class="forlist">
       <el-form-item label="本单重量(吨)" span="1" 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-input>
       </el-form-item>
       </el-form-item>
       <el-form-item label="单价(元/吨)" span="1" prop="unitPrice" class="forlist" @input='inputChange'>
       <el-form-item label="单价(元/吨)" span="1" prop="unitPrice" class="forlist" @input='inputChange'>
         <el-input v-model="deptBudgetList.unitPrice" placeholder="输入粮食单价" size="small"></el-input>
         <el-input v-model="deptBudgetList.unitPrice" placeholder="输入粮食单价" size="small"></el-input>
       </el-form-item>
       </el-form-item>
-      <el-form-item label="总价值(元)" span="1" prop="totalValue" class="forlist">
+      <el-form-item label="值(元)" span="1" prop="totalValue" class="forlist">
         <el-input type='number' v-model="deptBudgetList.totalValue" disabled placeholder="自动计算,不可编辑" size="small">
         <el-input type='number' v-model="deptBudgetList.totalValue" disabled placeholder="自动计算,不可编辑" size="small">
         </el-input>
         </el-input>
       </el-form-item>
       </el-form-item>
-      <el-form-item label="申请比例(%)" span="1" prop="applicationProportion" class="forlist">
+      <!-- <el-form-item label="申请比例(%)" span="1" prop="applicationProportion" class="forlist">
         <el-input v-model="deptBudgetList.applicationProportion" placeholder="输入申请比例" size="small"></el-input>
         <el-input v-model="deptBudgetList.applicationProportion" placeholder="输入申请比例" size="small"></el-input>
-      </el-form-item>
+      </el-form-item> -->
       <el-form-item label="申请金额(元)" span="1" prop="interest" class="forlist">
       <el-form-item label="申请金额(元)" span="1" prop="interest" class="forlist">
         <el-input type='number' v-model="deptBudgetList.interest" placeholder="输入申请金额" size="small"></el-input>
         <el-input type='number' v-model="deptBudgetList.interest" placeholder="输入申请金额" size="small"></el-input>
       </el-form-item>
       </el-form-item>
@@ -133,6 +144,10 @@
     getWarehouseReceiptExamine, //审核记录
     getWarehouseReceiptExamine, //审核记录
     WarehouseReceiptBankList,
     WarehouseReceiptBankList,
   } from '@/model/tradeServicesManagement/index'
   } from '@/model/tradeServicesManagement/index'
+  import {
+    xiala
+  } from '@/model/warehouse/index'
+  import * as global from '@/global'
   import {
   import {
     selectWarehouseSelf,
     selectWarehouseSelf,
   } from '@/model/houseSelfCollect/index'
   } from '@/model/houseSelfCollect/index'
@@ -146,7 +161,7 @@
     },
     },
     data() {
     data() {
       return {
       return {
-        deptBudgetList: {},
+        deptBudgetList: {billNo:''},
         size: 10,
         size: 10,
         compId: localStorage.getItem('ws-pf_compId'),
         compId: localStorage.getItem('ws-pf_compId'),
         rules: {
         rules: {
@@ -162,18 +177,63 @@
         goodsList: [],
         goodsList: [],
         bankList: [],
         bankList: [],
         threeList: [],
         threeList: [],
+        goodstext:'已选0辆车',
+        db:{},
       }
       }
     },
     },
-    activated() {
+    async activated() {
       localStorage.removeItem("pageUp") //删除出入库跳返回时数据刷新的问题
       localStorage.removeItem("pageUp") //删除出入库跳返回时数据刷新的问题
-      this.getList()
-      this.getcompList()
-      this.getWarehouse()
+      this.db=await global.default.openDB('warehouseReceipt')
+      await this.getList()
+      
+      if(localStorage.getItem('warehouseReceipteditdata')){
+        this.deptBudgetList=JSON.parse(localStorage.getItem('warehouseReceipteditdata'))
+        var data=await global.default.getDataByKey(this.db,'signalChat',1)
+        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].pureWeight
+            }
+            this.deptBudgetList.goodsName = data.modification[0].goodsName
+            this.changeGoodsName(this.deptBudgetList.goodsName)
+            this.$set(this.deptBudgetList,'weight',weight.toFixed(2))
+            if(this.deptBudgetList.goodsName.indexOf('潮粮')!=-1){
+               this.$set(this.deptBudgetList,'dryOutWeight',pureWeight.toFixed(2))
+            }else{
+              this.$set(this.deptBudgetList,'dryOutWeight',weight.toFixed(2))
+            }
+            if( this.deptBudgetList.unitPrice){
+              this.inputChange()
+            }
+          }
+        }
+      }
     },
     },
     methods: {
     methods: {
+      selectgoods(){
+        localStorage.setItem('warehouseReceipteditdata',JSON.stringify(this.deptBudgetList))
+        console.log(this.deptBudgetList)
+        this.$router.push({
+          name: 'warehouseReceipteditgoods',
+          query: {
+            baseId: this.deptBudgetList.baseId,
+            positionId: this.deptBudgetList.warehouseNoId,
+            warehouseName: this.deptBudgetList.warehouseName,
+            warehouseType: this.deptBudgetList.warehouseType,
+            warehouseNo:this.deptBudgetList.warehouseNo,
+          }
+        })
+      },
       inputChange(e) {
       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 = Number(this.deptBudgetList.unitPrice * this.deptBudgetList.dryOutWeight).toFixed(2)
+          this.$set(this.deptBudgetList,'interest',this.deptBudgetList.totalValue)
         }
         }
       },
       },
       //银行改变
       //银行改变
@@ -219,7 +279,7 @@
       changeGoodsName(val) {
       changeGoodsName(val) {
         let _data = this.goodsList
         let _data = this.goodsList
         for (let i = 0; i < _data.length; i++) {
         for (let i = 0; i < _data.length; i++) {
-          if (_data[i].id == val) {
+          if (_data[i].goodsName == val) {
             this.deptBudgetList.goodsNameKey = _data[i].goodsNameKey
             this.deptBudgetList.goodsNameKey = _data[i].goodsNameKey
             this.deptBudgetList.goodsName = _data[i].goodsName
             this.deptBudgetList.goodsName = _data[i].goodsName
             this.deptBudgetList.nowWeight = _data[i].storage
             this.deptBudgetList.nowWeight = _data[i].storage
@@ -229,11 +289,23 @@
         }
         }
       },
       },
       //仓库切换
       //仓库切换
-      changeWarehouse(val) {
+      async changeWarehouse(val) {
         let _data = this.warehouseList
         let _data = this.warehouseList
         for (let i = 0; i < _data.length; i++) {
         for (let i = 0; i < _data.length; i++) {
           if (_data[i].id == val) {
           if (_data[i].id == val) {
+            var data=await global.default.getDataByKey(this.db,'signalChat',1)
+            if(data){
+              if(data.modification&&data.modification.length>0){
+                global.default.deleteDB(this.db,'signalChat',1)
+                this.deptBudgetList.weight = ''
+                this.deptBudgetList.dryOutWeight = ''
+              }
+            }
+            
+            this.goodstext='已选0辆车'
+            
             this.deptBudgetList.warehouseName = _data[i].warehouseName
             this.deptBudgetList.warehouseName = _data[i].warehouseName
+            this.deptBudgetList.warehouseType =_data[i].warehouseType
             this.cwNumberList = _data[i].positionInfos.length != 0 ? _data[i].positionInfos : []
             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.warehouseNo = _data[i].positionInfos.length != 0 ? _data[i].positionInfos[0].binNumber :
               ''
               ''
@@ -244,8 +316,6 @@
               ''
               ''
             this.deptBudgetList.useWeight = _data[i].goodsNameInfos[0].useStorage
             this.deptBudgetList.useWeight = _data[i].goodsNameInfos[0].useStorage
             this.deptBudgetList.warehouseId = _data[i].id
             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.warehouseNoId = _data[i].positionInfos.length != 0 ? _data[i].positionInfos[0].id : ''
             this.deptBudgetList.baseId = _data[i].positionInfos.length != 0 ? _data[i].positionInfos[0].baseId : ''
             this.deptBudgetList.baseId = _data[i].positionInfos.length != 0 ? _data[i].positionInfos[0].baseId : ''
           }
           }
@@ -292,54 +362,57 @@
           })
           })
           .catch((err) => {})
           .catch((err) => {})
       },
       },
-      getWarehouse() {
+      async getWarehouse() {
         //获取仓库
         //获取仓库
-        selectWarehouseSelf({
-            compId: this.compId
+        this.warehouseList = await xiala({
+            compId: this.compId,
+            warehouseType:1
           }).toPromise()
           }).toPromise()
-          .then(response => {
-            this.warehouseList = response
-            this.changeWarehouse(this.deptBudgetList.warehouseId)
-          })
+            var data=await global.default.getDataByKey(this.db,'signalChat',1)
+            if(data){
+              if(!data.modification||data.modification.length==0){
+                this.changeWarehouse(this.deptBudgetList.warehouseId)
+              }
+            }else{
+              this.changeWarehouse(this.deptBudgetList.warehouseId)
+            }
       },
       },
-      getList() {
-        WarehouseReceiptBankList({
+      async getList() {
+        this.bankList = await WarehouseReceiptBankList({
           constId: "BANK1"
           constId: "BANK1"
-        }).toPromise().then((response) => {
-          this.bankList = response
-        })
-        WarehouseReceiptBankList({
+        }).toPromise()
+        this.threeList = await WarehouseReceiptBankList({
           constId: "THREE1"
           constId: "THREE1"
-        }).toPromise().then((response) => {
-          this.threeList = response
-        })
+        }).toPromise()
 
 
-        getWarehouseReceiptLook({
+        this.deptBudgetList = await getWarehouseReceiptLook({
             id: this.$route.query.id,
             id: this.$route.query.id,
             workflowId: this.$route.query.workflowId
             workflowId: this.$route.query.workflowId
           })
           })
           .toPromise()
           .toPromise()
-          .then((response) => {
-            this.deptBudgetList = response
-          })
-          .catch((req) => {})
         //审核记录
         //审核记录
-        getWarehouseReceiptExamine({
+        this.taskhistories = await  getWarehouseReceiptExamine({
             businessKey: this.$route.query.id,
             businessKey: this.$route.query.id,
             workflowId: this.$route.query.workflowId
             workflowId: this.$route.query.workflowId
           }).toPromise()
           }).toPromise()
-          .then((response) => {
-            this.taskhistories = response
-          })
+          this.getcompList()
       },
       },
-      submit() {
+      async submit() {
+        var data=await global.default.getDataByKey(this.db,'signalChat',1)
+        if(data){
+          if(data.modification){
+            this.deptBudgetList.warehouseInOutInfoList=data.modification
+          }
+        }
         let isValidate = false
         let isValidate = false
         isValidate = this.validate()
         isValidate = this.validate()
         if (isValidate) {
         if (isValidate) {
           WarehouseReceiptUpdate(this.deptBudgetList)
           WarehouseReceiptUpdate(this.deptBudgetList)
             .toPromise()
             .toPromise()
             .then((response) => {
             .then((response) => {
+              localStorage.removeItem('warehouseReceipteditdata')
               this.$message.success('提交成功')
               this.$message.success('提交成功')
+              global.default.deleteDB(this.db,'signalChat',1)
               this.$router.push({
               this.$router.push({
                 path: 'warehouseReceiptRegulation'
                 path: 'warehouseReceiptRegulation'
               })
               })
@@ -374,13 +447,8 @@
           }
           }
           return true
           return true
         }
         }
-        if (!this.deptBudgetList.weight || _Validate(0, this.deptBudgetList.useWeight, 3, '', this.deptBudgetList
-            .weight)) {
-          if (!this.deptBudgetList.weight) {
+        if (!this.deptBudgetList.weight ) {
             this.$message.error('本单重量不能为空!');
             this.$message.error('本单重量不能为空!');
-          } else {
-            this.$message.error('本单重量输入错误且本单重量不可超过可用重量!');
-          }
           return false
           return false
         }
         }
         if (!this.deptBudgetList.unitPrice || _Validate(1, 20000, 3, '', this.deptBudgetList
         if (!this.deptBudgetList.unitPrice || _Validate(1, 20000, 3, '', this.deptBudgetList
@@ -396,15 +464,6 @@
           this.$message.error('总价值不能为空!');
           this.$message.error('总价值不能为空!');
           return false
           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
         if (!this.deptBudgetList.interest || _Validate(1, 1000000000, 2, '', this.deptBudgetList
             .interest)) {
             .interest)) {
           if (!this.deptBudgetList.interest) {
           if (!this.deptBudgetList.interest) {
@@ -491,4 +550,7 @@
     font-weight: 600;
     font-weight: 600;
     margin: 20px 0;
     margin: 20px 0;
   }
   }
+  .supplyofgoods .el-input{
+    width:75%;
+  }
 </style>
 </style>

+ 11 - 7
src/views/tradeServicesManagement/warehouseReceiptLook.vue

@@ -37,12 +37,12 @@
           </el-option>
           </el-option>
         </el-select>
         </el-select>
       </el-form-item>
       </el-form-item>
-      <el-form-item label="仓位号" span="1" prop="warehouseNo" class="forlist">
+      <!-- <el-form-item label="仓位号" span="1" prop="warehouseNo" class="forlist">
         <el-select v-model="deptBudgetList.warehouseNo" placeholder="请选择仓位号" @change="changeWarehouseNo" disabled>
         <el-select v-model="deptBudgetList.warehouseNo" placeholder="请选择仓位号" @change="changeWarehouseNo" disabled>
           <el-option :label="item.binNumber" :value="item.id" v-for="(item,index) in cwNumberList" :key='index'>
           <el-option :label="item.binNumber" :value="item.id" v-for="(item,index) in cwNumberList" :key='index'>
           </el-option>
           </el-option>
         </el-select>
         </el-select>
-      </el-form-item>
+      </el-form-item> -->
       <el-form-item label="仓库地址" span="1" prop="warehouseAddress" class="forlist">
       <el-form-item label="仓库地址" span="1" prop="warehouseAddress" class="forlist">
         <el-input disabled v-model="deptBudgetList.warehouseAddress" placeholder="请输入仓库地址" size="small"></el-input>
         <el-input disabled v-model="deptBudgetList.warehouseAddress" placeholder="请输入仓库地址" size="small"></el-input>
       </el-form-item>
       </el-form-item>
@@ -60,27 +60,31 @@
           <el-option label="等外" value="等外"></el-option>
           <el-option label="等外" value="等外"></el-option>
         </el-select>
         </el-select>
       </el-form-item> -->
       </el-form-item> -->
-      <el-form-item label="现有储量" span="1" prop="nowWeight" class="forlist" disabled>
+      <!-- <el-form-item label="现有储量" span="1" prop="nowWeight" class="forlist" disabled>
         <el-input disabled v-model="deptBudgetList.nowWeight" placeholder="请输入现有储量" size="small" class="existing">
         <el-input disabled v-model="deptBudgetList.nowWeight" placeholder="请输入现有储量" size="small" class="existing">
         </el-input>
         </el-input>
         <el-button type="primary" @click="poundList">磅单</el-button>
         <el-button type="primary" @click="poundList">磅单</el-button>
       </el-form-item>
       </el-form-item>
       <el-form-item label="可用储量(吨)" span="1" prop="useWeight" class="forlist">
       <el-form-item label="可用储量(吨)" span="1" prop="useWeight" class="forlist">
         <el-input disabled v-model="deptBudgetList.useWeight" placeholder="请输入可用储量" size="small"></el-input>
         <el-input disabled v-model="deptBudgetList.useWeight" placeholder="请输入可用储量" size="small"></el-input>
-      </el-form-item>
+      </el-form-item> -->
       <el-form-item label="本单重量(吨)" span="1" prop="weight" class="forlist">
       <el-form-item label="本单重量(吨)" span="1" prop="weight" class="forlist">
         <el-input v-model="deptBudgetList.weight" placeholder="输入本次仓单申请所需的重量" size="small" disabled></el-input>
         <el-input v-model="deptBudgetList.weight" placeholder="输入本次仓单申请所需的重量" size="small" disabled></el-input>
       </el-form-item>
       </el-form-item>
+      <el-form-item label="折干重量(吨)" prop="weight" class="forlist">
+        <el-input v-model="deptBudgetList.dryOutWeight"   disabled placeholder="输入折干重量" size="small" >
+        </el-input>
+      </el-form-item>
       <el-form-item label="单价(元/吨)" span="1" prop="unitPrice" class="forlist" disabled>
       <el-form-item label="单价(元/吨)" span="1" prop="unitPrice" class="forlist" disabled>
         <el-input v-model="deptBudgetList.unitPrice" placeholder="输入粮食单价" size="small" disabled></el-input>
         <el-input v-model="deptBudgetList.unitPrice" placeholder="输入粮食单价" size="small" disabled></el-input>
       </el-form-item>
       </el-form-item>
-      <el-form-item label="总价值(元)" span="1" prop="totalValue" class="forlist">
+      <el-form-item label="值(元)" span="1" prop="totalValue" class="forlist">
         <el-input type='number' v-model="deptBudgetList.totalValue" disabled placeholder="自动计算,不可编辑" size="small">
         <el-input type='number' v-model="deptBudgetList.totalValue" disabled placeholder="自动计算,不可编辑" size="small">
         </el-input>
         </el-input>
       </el-form-item>
       </el-form-item>
-      <el-form-item label="申请比例(%)" span="1" prop="applicationProportion" class="forlist">
+      <!-- <el-form-item label="申请比例(%)" span="1" prop="applicationProportion" class="forlist">
         <el-input v-model="deptBudgetList.applicationProportion" placeholder="输入申请比例" size="small" disabled></el-input>
         <el-input v-model="deptBudgetList.applicationProportion" placeholder="输入申请比例" size="small" disabled></el-input>
-      </el-form-item>
+      </el-form-item> -->
       <el-form-item label="申请金额(元)" span="1" prop="interest" class="forlist">
       <el-form-item label="申请金额(元)" span="1" prop="interest" class="forlist">
         <el-input type='number' v-model="deptBudgetList.interest" placeholder="输入申请金额" size="small" disabled></el-input>
         <el-input type='number' v-model="deptBudgetList.interest" placeholder="输入申请金额" size="small" disabled></el-input>
       </el-form-item>
       </el-form-item>

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

@@ -37,10 +37,8 @@
           </template>
           </template>
         </el-table-column>
         </el-table-column>
         <el-table-column prop="billNo" label="业务编号"></el-table-column>
         <el-table-column prop="billNo" label="业务编号"></el-table-column>
-        <el-table-column prop="contractNo" label="合同编号"></el-table-column>
         <el-table-column prop="warehouseName" label="仓库名"></el-table-column>
         <el-table-column prop="warehouseName" label="仓库名"></el-table-column>
-        <el-table-column prop="warehouseNo" label="仓位号"></el-table-column>
-        <el-table-column prop="goodsName" label="货名"></el-table-column>
+        <el-table-column prop="goodsName" label="货名" width="130"></el-table-column>
         <el-table-column prop="weight" label="重量(吨)" width="100"></el-table-column>
         <el-table-column prop="weight" label="重量(吨)" width="100"></el-table-column>
         <el-table-column prop="unitPrice" label="单价(元/吨)" width="100"></el-table-column>
         <el-table-column prop="unitPrice" label="单价(元/吨)" width="100"></el-table-column>
         <el-table-column prop="totalValue" label="总价值(元)" width="100"></el-table-column>
         <el-table-column prop="totalValue" label="总价值(元)" width="100"></el-table-column>