Quellcode durchsuchen

Merge branch 'master' of http://47.100.3.209:3000/gdc/yiliangyiyun-pc

ccj vor 2 Jahren
Ursprung
Commit
ad6d5bdeda

+ 3 - 1
src/api/V2/taskspost/index.js

@@ -58,4 +58,6 @@ export const API_GET_SOURCEOFGOODS = '/warehousingOrder/getSourceOfGoodsList'
 // 矫正
 export const API_SET_CORRECT= '/inOutWarehouseTask/api/correct'
 // 出库货源列表
-export const API_GET_GOODSOURCEINFO= '/warehousingOrder/selectGoodSourceInfo'
+export const API_GET_GOODSOURCEINFO= '/warehousingOrder/selectGoodSourceInfo'
+// 退库选择任务
+export const API_GET_TASKNO= '/inOutWarehouseTask/getOutTaskNo'

+ 4 - 0
src/api/V2/warehouse/index.js

@@ -123,3 +123,7 @@ export const API_SET_PAYMONEY = 'warehousingOrder/api/payMoney'
 export const API_WORKFLOWHANDLE ='/newWorkflow/api/handle'
 //查看可分配金额
 export const API_GET_EXPENSE='/contractManagementInfo/getContractInfo'
+//入库单仓位
+export const API_GET_WAREHOUSEPOSITIONINFO='/warehousePositionInfo/selectPositionList'
+//入库单折干
+export const API_DRYOUT='/warehousingOrder/dryOut'

+ 5 - 2
src/model/tasksport/index.js

@@ -30,7 +30,8 @@ import {
     API_GET_SOURCEGOOD,
     API_SET_CORRECT,
     API_GET_SOURCEOFGOODS,
-    API_GET_GOODSOURCEINFO
+    API_GET_GOODSOURCEINFO,
+    API_GET_TASKNO
 } from '@/api/V2/taskspost'
 //运输任务列表
 export const gain = appRx.get(API_GET_TRAN_LIST, errorCatcher, errorHandle, filter)
@@ -89,4 +90,6 @@ export const getSourceOfGoodslist = appRx.get(API_GET_SOURCEOFGOODS, errorCatche
 //矫正
 export const setcorrect = appRx.post(API_SET_CORRECT, errorCatcher, errorHandle, filter)
 //出库货源列表
-export const getSourceOfGoodsinfo = appRx.get(API_GET_GOODSOURCEINFO, errorCatcher, errorHandle, filter)
+export const getSourceOfGoodsinfo = appRx.get(API_GET_GOODSOURCEINFO, errorCatcher, errorHandle, filter)
+//退库选择的任务编号
+export const gettaskNo = appRx.get(API_GET_TASKNO, errorCatcher, errorHandle, filter)

+ 7 - 2
src/model/warehouse/index.js

@@ -60,7 +60,8 @@ import {
     API_SET_PAYMONEY,
     API_WORKFLOWHANDLE,
     API_GET_EXPENSE,
-    API_SET_EXPENSE
+    API_GET_WAREHOUSEPOSITIONINFO,
+    API_DRYOUT
     // API_GET_EXPENSEINFO
 } from '@/api/V2/warehouse'
 // import { app } from 'electron'
@@ -184,4 +185,8 @@ export const workflowhandle = appRx.post(API_WORKFLOWHANDLE,errorCatcher, errorH
 // //费用详情
 // export const getexenseinfo = appRx.get(API_GET_EXPENSEINFO,errorCatcher, errorHandle, filter)
 //查看可分配金额
-export const getExpense = appRx.get(API_GET_EXPENSE,errorCatcher, errorHandle, filter)
+export const getExpense = appRx.get(API_GET_EXPENSE,errorCatcher, errorHandle, filter)
+//入库单仓位
+export const getposition = appRx.get(API_GET_WAREHOUSEPOSITIONINFO,errorCatcher, errorHandle, filter)
+//入库单折干
+export const dryout = appRx.post(API_DRYOUT,errorCatcher, errorHandle, filter)

+ 2 - 2
src/views/contractManagement/acquisitionContractAdd.vue

@@ -590,7 +590,7 @@ import { isUndefined } from 'xe-utils/methods'
       },
       returnsales() {
         this.deptBudgetList =  {
-          deliverType: '1',
+          deliverType: '2',
           sourceGoods:'',
           placeDelivery:'',
           addressUrl: '',
@@ -1278,7 +1278,7 @@ import { isUndefined } from 'xe-utils/methods'
                 localStorage.setItem('deptBudgetList_data4', JSON.stringify(this.restaurants4));
                 this.$message.success('添加成功')
                 this.deptBudgetList = {
-                  deliverType: '1',
+                  deliverType: '2',
                   sourceGoods:'',
                   placeDelivery:'',
                   addressUrl: '',

+ 20 - 4
src/views/houseSelfCollect/inspectionManagementNew.vue

@@ -91,7 +91,11 @@
                 </ws-form-item>
                 <ws-form-item label="货名" span="1"
                   prop="inOutTaskNo">
-                  <el-select :disabled='disablednotarize || goodsdisabled' v-model="deptBudgetList.goodsName" clearable
+                  <!-- <el-select :disabled='disablednotarize || goodsdisabled' v-model="deptBudgetList.goodsName" clearable
+                    filterable placeholder="请选择" class="typeselect" @change="goodsNameChange">
+                    <el-option v-for="item in goodnameList" :key="'huoming' + item.id" :label="item.goodsName" :value="item.goodsName" />
+                  </el-select> -->
+                  <el-select disabled v-model="deptBudgetList.goodsName" clearable
                     filterable placeholder="请选择" class="typeselect" @change="goodsNameChange">
                     <el-option v-for="item in goodnameList" :key="'huoming' + item.id" :label="item.goodsName" :value="item.goodsName" />
                   </el-select>
@@ -560,6 +564,7 @@ export default {
       goodsdisabled: false,
       customerName: '',
       customerPhone: '',
+      contractFlag:7,
       deptBudgetList: {
         type: '干粮',
         freight: 0,
@@ -2609,6 +2614,8 @@ export default {
       }
       this.deptBudgetList.warehouseNo = this.warehouseNo
       console.log(this.deptBudgetList, '入库对象')
+      this.deptBudgetList.agent =
+                localStorage.getItem('ws-pf_staffName')
       // return
       this.$confirm(`确定提交入库信息`, {
         cancelButtonText: '取消',
@@ -2632,14 +2639,18 @@ export default {
               if(this.deptBudgetList.id){
                   var zjid=JSON.parse(JSON.stringify(this.deptBudgetList.id))
                   var kid=JSON.parse(JSON.stringify(this.deptBudgetList.warehouseInOutId))
+                  // delete this.deptBudgetList.status
+                  this.$delete(this.deptBudgetList,'status')
+                  // var status=JSON.parse(JSON.stringify(this.deptBudgetList.warehouseInOutId))
                 }
+                // console.log(delete this.deptBudgetList.status)
               if (this.statusTypetext == '初检') {
-                this.deptBudgetList.agent =
-                localStorage.getItem('ws-pf_staffName')
+                
                 
                 if(this.deptBudgetList.id){
                   this.deptBudgetList.id=kid
                 }
+                
                 addstorageputList(this.deptBudgetList)
                   .toPromise()
                   .then((response) => {
@@ -3064,9 +3075,11 @@ export default {
               
             }
             if(this.serviceManagementType==3){
+              this.contractFlag=10
               this.taskflag=3
             }else{
               this.taskflag=2
+              this.contractFlag=7
             }
           getReceiptTaskNo({
             flag: this.taskflag,
@@ -3091,9 +3104,11 @@ export default {
         //   //解决冲突别解决没了(注意)
         this.taskflag=3
         this.outType = '他运'
+        this.contractFlag=10
       } else {
         this.taskflag=2
         this.outType = ''
+        this.contractFlag=7
       }
       console.log(this.taskflag,22222222)
       getReceiptTaskNo({
@@ -3155,6 +3170,7 @@ export default {
           console.log(this.outContractNo[i])
           this.deptBudgetList.goodsName = this.outContractNo[i].goodsName
           this.deptBudgetList.goodsNameKey = this.outContractNo[i].goodsNameKey
+          this.goodsNameChange(this.deptBudgetList.goodsName)
           this.deptBudgetList.grade = this.outContractNo[i].grade
           if (this.outContractNo[i].inOutType == '采购入库') {
             this.customerName = this.outContractNo[i].buyer
@@ -3373,7 +3389,7 @@ export default {
       //合同编号
       xialaNo({
         compId: localStorage.getItem('ws-pf_compId'),
-        flag: 7,
+        flag: this.contractFlag,
       })
         .toPromise()
         .then((response) => {

+ 6 - 3
src/views/houseSelfCollect/newWeighingManagement.vue

@@ -1449,13 +1449,15 @@
             type: 'warning',
           })
           .then(() => {
+            this.deptBudgetList.secretaryWeigher =
+                localStorage.getItem('ws-pf_staffName')
             var that = this
             var warehousing = {}
             //贸易入库保存需要再走入库接口
             if (this.inWarehouseType == 1) {
               warehousing = JSON.parse(JSON.stringify(this.weighingList))
               // warehousing = this.weighingList
-              warehousing.secretaryWeigher = localStorage.getItem('ws-pf_staffName')
+              warehousing.secretaryWeigher = this.deptBudgetList.secretaryWeigher
               warehousing.compId = localStorage.getItem('ws-pf_compId')
               warehousing.inOutFlag = 2
               let _data = JSON.parse(
@@ -1474,8 +1476,7 @@
             }
             // 毛重
             if (this.tpyeNo == 1) {
-              this.deptBudgetList.secretaryWeigher =
-                localStorage.getItem('ws-pf_staffName')
+              
               // console.log(this.weighingList)
               if (this.weighingList.customerNumberCard) {
                 //毛检保存前进行校验
@@ -1527,6 +1528,7 @@
                             warehousing.deductionWeight /= 1000
                             warehousing.statusFlag = 1
                             warehousing.inOutFlag = 2
+                            warehousing.secretaryWeigher = this.deptBudgetList.secretaryWeigher
                             warehousing.id = warehousing.warehouseInOutId
                             warehousing.warehouseInOutDetail.id = warehousing.inOutDetailId
                             warehousing.weighingManagement = this.weighingList
@@ -1607,6 +1609,7 @@
                   warehousing.inOutFlag = 2
                   delete warehousing.status
                   warehousing.id = warehousing.warehouseInOutId
+                  warehousing.secretaryWeigher = this.deptBudgetList.secretaryWeigher
                   warehousing.warehouseInOutDetail.id = warehousing.inOutDetailId
                   warehousing.weighingManagement = this.weighingList
 

+ 1 - 0
src/views/houseSelfCollect/settlement.vue

@@ -557,6 +557,7 @@
       },
       print() {
         delete this.paymentList.status
+        delete this.paymentList.statusFlag
         if (this.paymentList.type == '潮粮' && this.paymentList.qualityInspectionManagement.paramType != 1) {
           if (!this.paymentList.buckleWeightRatio) {
             this.$message({

+ 2 - 2
src/views/houseSelfCollect/weightCheckRecord.vue

@@ -14,13 +14,13 @@
     </el-row>
     <div class="center">
       <el-row>
-        <el-col :span="12">
+        <el-col :span="6">
           <el-button :type="warehousingType == 1?'primary':''" size="small" @click="changeType(1)"
             class="btn_css btn_topcss">贸易入库</el-button>
           <el-button :type="warehousingType == 3?'primary':''" size="small" @click="changeType(3)"
             class="btn_css btn_topcss">收购入库</el-button>
         </el-col>
-        <el-col :span="12" class="bg-right">
+        <el-col :span="18" class="bg-right">
           <div style="display:flex">
             <el-select style='margin-right:5px;width:40%' v-model="warehouseName" placeholder="请选择仓库名" @change="warehouseNameChange">
               <el-option v-for="item in warehouseList" :key="item.id" :label="item.warehouseName"

+ 2 - 2
src/views/outboundManagement/weighingManagementNew.vue

@@ -1302,8 +1302,8 @@
               (String(this.weighingList.grossWeight).indexOf('.') + 1) >
               1) ||
             this.weighingList.grossWeight < 1 ||
-            this.weighingList.grossWeight > 100000
-          ) {
+            this.weighingList.grossWeight > 120000
+          ) {3
             this.$message({
               message: '毛重输入错误!',
               type: 'warning',

+ 5 - 2
src/views/taskManagement/inOutWarehouseTaskEdit.vue

@@ -195,10 +195,13 @@
             {{dataList.goodsName}}
             <!-- </el-select> -->
           </el-form-item>
-          <el-form-item v-else label="货源" class="huom">
+          <el-form-item v-else-if='dataList1.inOutType=="退库"&&dataList1.taskTypeKey == 4' label="货源" class="huom">
             {{goods}}
             <el-button style='margin-left:5px;' class="bg-bottom" type="primary" size="small" @click="supplygoods()">查看货源</el-button>
           </el-form-item>
+          <el-form-item v-else label="货源" class="huom">
+            {{dataList.inOutTaskNo}}
+          </el-form-item>
           <!--重量(吨)-->
           <el-form-item label="重量(吨)" span="1" >
             {{dataList1.weight}}
@@ -687,7 +690,7 @@ export default {
           }
           if(this.dataList.sourceRelationInfoList){
             if(this.dataList.taskTypeKey==2&&this.dataList.inOutType=="退库"||this.dataList.taskTypeKey==4){
-                  this.goods=this.dataList.sourceId
+                  this.goods=this.dataList1.sourceId
                 }else 
               for (let i = 0; i < this.dataList.sourceRelationInfoList.length; i++) {
                 if(this.dataList.taskTypeKey==1||this.dataList.taskTypeKey==3){

+ 1 - 1
src/views/taskManagement/tranManagementWarehouseInOutTask.vue

@@ -303,7 +303,7 @@
           // console.log(response)
         })
         getstafffind({
-          roles: 'd6a5c8a52da544309259f91f75de1ec6'
+          roles: '499413401da1471fa2e26f2e35d4f018'
         })
         .toPromise()
         .then((response) => {

+ 32 - 7
src/views/taskManagement/tranManagementWarehouseInOutTaskAdd.vue

@@ -193,11 +193,19 @@
 							:value="item.constValue"></el-option>
 						</el-select>
 					</el-form-item>
-					<el-form-item v-else label="货源" class="huom">
+					<el-form-item v-else-if='dataList1.inOutType=="退库"&&dataList1.taskTypeKey == 4' label="货源" class="huom">
 						<el-input disabled v-model="goods" placeholder="请选择货源"
 							maxlength="120" size="small" class="huom" />
 						<el-button v-if='dataList.taskTypeKey!=3' class="bg-bottom" type="primary" size="small" @click="supplygoods()">选择货源</el-button>
 					</el-form-item>
+					<el-form-item v-else label="货源" class="huom">
+						
+						<el-select v-model="dataList1.inOutTaskNo" placeholder="请选择出库任务编号" class="huom" @change="selectinOutTaskNo"
+						filterable clearable>
+						<el-option v-for="item in taskNolist" :key="item.id" :label="item.inOutTaskNo"
+							:value="item.inOutTaskNo"></el-option>
+						</el-select>
+					</el-form-item>
 					<!--重量(吨)-->
 					<el-form-item label="重量(吨)">
 						<el-input :disabled='dataList1.inOutType=="收购入库"' @input="weightchange" v-model="dataList1.weight" placeholder="请输入重量(吨)"
@@ -371,9 +379,9 @@
 		getwarehousename,
 		xialaNo,
 		addoreditoutput,
-		getGoodsName
+		getGoodsName,
+		gettaskNo
 	} from '@/model/tasksport/index'
-
 	import {
 		mapGetters
 	} from 'vuex'
@@ -447,6 +455,7 @@
 				deptBudgetTotal: 0,
 				readonly: true,
 				currentPage: 1,
+				taskNolist:[],
 				pageSize: 10,
 				searchType: 1,
 				searchKeyWord: '',
@@ -893,8 +902,14 @@
 									this.$set(this.dataList1, 'waterContent', response.waterContent)
 									this.$set(this.dataList1, 'bulkDensity', response.bulkDensity)
 									if(this.dataList1.taskTypeKey==2&&this.dataList1.inOutType=='退库'){
-										this.goods=''
 										this.dataList1.weight=0
+										gettaskNo({
+											contractNo: this.dataList1.contractNo,
+										})
+										.toPromise()
+										.then((response) => {
+											this.taskNolist = response
+										})
 									}else{
 										this.$set(this.dataList1, 'weight', response.weight)
 									}
@@ -1536,8 +1551,10 @@
 					
 				}
 				var supplygoods=data
-				this.dataList.sourceId=this.goods
-				this.dataList1.sourceId=this.goods
+				if(this.dataList.taskTypeKey != 2){
+					this.dataList.sourceId=this.goods
+					this.dataList1.sourceId=this.goods
+				}
 				if (this.dataList.taskTypeKey == 1) {
 					this.dataList.inOutTaskNo = this.inOutTaskNo
 					this.dataList.sourceRelationInfoList=supplygoods
@@ -1598,6 +1615,14 @@
 					}
 				}
 			},
+			selectinOutTaskNo(e) {
+				for (var i = 0; i < this.taskNolist.length; i++) {
+					if (this.taskNolist[i].inOutTaskNo == e) {
+						this.dataList1.sourceId = this.taskNolist[i].id
+						// this.dataList1.weight = this.taskNolist[i].weight
+					}
+				}
+			},
 			selectpackingMethod(e) {
 				for (var i = 0; i < this.gradeList.length; i++) {
 					if (this.gradeList[i].constValue == e) {
@@ -1650,7 +1675,7 @@
 						this.flag = 0
 						break
 					case '退库':
-						this.flag = 2
+						this.flag = 5
 						break
 				}
 				for (var i = 0; i < this.storageType1.length; i++) {

+ 9 - 1
src/views/taskManagement/tranManagementWarehouseInOutTaskAudit.vue

@@ -226,11 +226,18 @@
 							:value="item.constValue"></el-option>
 						</el-select>
 					</el-form-item>
-					<el-form-item v-else label="货源" class="huom">
+					<el-form-item v-else-if='dataList1.inOutType=="退库"&&dataList1.taskTypeKey == 4' label="货源" class="huom">
 						<el-input disabled v-model="goods" placeholder="请选择货源"
 							maxlength="120" size="small" class="huom" />
 						<el-button v-if='dataList.taskTypeKey!=3' class="bg-bottom" type="primary" size="small" @click="supplygoods()">查看货源</el-button>
 					</el-form-item>
+          <el-form-item v-else label="货源" class="huom">
+            <el-select disabled v-model="dataList1.inOutTaskNo" placeholder="请选择出库任务编号" class="huom"
+						filterable clearable>
+						<el-option v-for="item in taskNolist" :key="item.id" :label="item.inOutTaskNo"
+							:value="item.inOutTaskNo"></el-option>
+						</el-select>
+          </el-form-item>
           <!--重量(吨)-->
           <el-form-item label="重量(吨)">
             <el-input @input="weightchange" v-model="dataList1.weight" placeholder="请输入重量(吨)" maxlength="120"
@@ -487,6 +494,7 @@
         // 是否显示
         showType: true,
         disabled: false,
+        taskNolist:[],
         // 年
         year: '',
         disableReason: '',

+ 14 - 6
src/views/taskManagement/tranManagementWarehouseInOutTaskEdit.vue

@@ -167,7 +167,7 @@
           <el-form-item label="货源" class="huom">
             <el-input disabled v-model="goods" placeholder="请选择货源"
 							maxlength="120" size="small" class="huom" />
-            <el-button class="bg-bottom" type="primary" size="small" @click="supplygoods()">选择货源</el-button>
+            <!-- <el-button class="bg-bottom" type="primary" size="small" @click="supplygoods()">选择货源</el-button> -->
           </el-form-item>
           <!--重量(吨)-->
           <el-form-item
@@ -349,7 +349,7 @@
           <!-- 入库类型 -->
           <el-form-item label="入库类型">
             <el-select
-              :disabled="dataList.taskTypeKey == 3 || dataList.taskTypeKey == 4||dataList1.inOutType=='收购入库'"
+              disabled
               v-model="dataList1.inOutType"
               placeholder="请选择入库类型"
               class="typeselect"
@@ -375,7 +375,7 @@
           <!-- 合同编号 -->
           <el-form-item v-if="dataList1.taskTypeKey != 3" label="合同编号">
             <el-select
-            :disabled="dataList1.inOutType=='收购入库'"
+              disabled
               @change="changecontract1"
               v-model="dataList1.contractNo"
               placeholder="请输入合同编号"
@@ -407,10 +407,18 @@
 							:value="item.constValue"></el-option>
 						</el-select>
 					</el-form-item>
-					<el-form-item v-else label="货源" class="huom">
+					<el-form-item v-else-if='dataList1.inOutType=="退库"&&dataList1.taskTypeKey == 4' label="货源" class="huom">
 						<el-input disabled v-model="goods" placeholder="请选择货源"
 							maxlength="120" size="small" class="huom" />
-						<el-button v-if='dataList.taskTypeKey!=3' class="bg-bottom" type="primary" size="small" @click="supplygoods()">选择货源</el-button>
+						<!-- <el-button v-if='dataList.taskTypeKey!=3' class="bg-bottom" type="primary" size="small" @click="supplygoods()">选择货源</el-button> -->
+					</el-form-item>
+          <el-form-item v-else label="出库任务编号" class="huom">
+						<el-select disabled v-model="dataList1.inOutTaskNo" placeholder="请选择出库任务编号"
+						filterable clearable>
+						<el-option v-for="item in taskNolist" :key="item.id" :label="item.inOutTaskNo"
+							:value="item.inOutTaskNo"></el-option>
+						</el-select>
+						<!-- <el-button v-if='dataList.taskTypeKey!=3' class="bg-bottom" type="primary" size="small" @click="supplygoods()">选择货源</el-button> -->
 					</el-form-item>
           <!--重量(吨)-->
           <el-form-item
@@ -624,7 +632,7 @@
           <el-form-item label="货源" class="huom">
             <el-input disabled v-model="goods" placeholder="请选择货源"
 							maxlength="120" size="small" class="huom" />
-            <el-button class="bg-bottom" v-if='dataList.taskTypeKey!=4' type="primary" size="small" @click="supplygoods()">选择货源</el-button>
+            <!-- <el-button class="bg-bottom" v-if='dataList.taskTypeKey!=4' type="primary" size="small" @click="supplygoods()">选择货源</el-button> -->
           </el-form-item>
           <!--重量(吨)-->
           <el-form-item

+ 275 - 25
src/views/warehousenew/warehousingOrder.vue

@@ -34,6 +34,8 @@
         </ws-button>
         </el-col>
         <el-col style='text-align:right;' :span="12">
+          <ws-button v-hasPermission="
+            `warehouseManagement.warehousingOrder.yufu`" type="primary" @click="fieldrations()" >折干</ws-button>
            <ws-button v-hasPermission="
             `warehouseManagement.warehousingOrder.yufu`" type="primary" @click="distribution()" >预付款分配</ws-button>
         <ws-button v-hasPermission="
@@ -44,16 +46,14 @@
         </el-button> -->
         </el-col>
     </el-row>
-    <div v-for="item in gainList" style='margin:10px;border:1px solid #ccc;padding:10px;'>
+    <div v-for="(item,index) in gainList" style='margin:10px;border:1px solid #ccc;padding:10px;'>
       <div style='width:100%;justify-content:space-between;align-items:center;margin-bottom:10px;' class="flex">
         <div>{{item.issuingTime}}</div>
         <div>{{item.warehouseName}}入库单<span v-if='item.warehouseType==2'>(临)</span></div>
         <div>
           <!-- <ws-button  type="primary" @click="distribution(item)" >预付款分配</ws-button>
         <ws-button type="primary" @click="marginAllocation(item)">保证金分配</ws-button> -->
-            <ws-button v-if='item.payshow' type="primary" @click="payout(item)" v-hasPermission="
-            `warehouseManagement.warehousingOrder.appl`
-          ">请款
+            <ws-button v-if='item.payshow' type="primary" @click="payout(item)" v-hasPermission="`warehouseManagement.warehousingOrder.appl`">请款
         </ws-button>
          <ws-button v-if='!item.payshow' type="primary" @click="cancel(item)" v-hasPermission="
             `warehouseManagement.warehousingOrder.appl`
@@ -73,7 +73,7 @@
         </ws-button>
         </div>
       </div>
-      <el-table class="wenzi" :data="item.warehousingOrderList" style="width: 100%"  @selection-change="handleSelectionChange($event,item)" >
+      <el-table class="wenzi" :ref="'multipleTable'+index" :data="item.warehousingOrderList" style="width: 100%"  @selection-change="handleSelectionChange($event,item,index)" >
           <el-table-column
           :selectable='selectInit'
       type="selection"
@@ -266,7 +266,7 @@
           <el-button type="primary" @click="distributionsubmit">提交</el-button>
         </span>
       </el-dialog>
-                  <el-dialog
+        <el-dialog
         title="保证金分配"
         :visible.sync="marginshow"
         width="50%"
@@ -318,6 +318,56 @@
           <el-button type="primary" @click="marginsubmit">提交</el-button>
         </span>
       </el-dialog>
+      <el-dialog
+        title="折干"
+        :visible.sync="fieldrationsshow"
+        width="50%"
+        :before-close="handleClose4">
+        <div>
+           <!--插槽会替换title显示的内容 -->
+         <div slot="title" class="header-title">
+            <span v-show="dialogTitle" class="title-name">{{ dialogTitle }}</span>
+        </div>
+          <el-form ref="form" :model="form" label-width="140px">
+            <el-form-item label="折干前重量(吨)">
+              <el-input v-model="fieldrationsList.beforeWeight"></el-input>
+            </el-form-item>
+             <el-form-item label="折干前成本(元/吨)">
+              <el-input disabled placeholder="自动计算,不可编辑" v-model="fieldrationsList.beforeCost"></el-input>
+            </el-form-item>
+            <el-form-item label="折干前仓位">
+              <el-select @focus="warehousefocus" @change="warehousechange" v-model="fieldrationsList.beforeBinNo" filterable placeholder="请选择">
+                <el-option
+                  v-for="item in options"
+                  :key="item.id"
+                  :label="item.binNumber"
+                  :value="item.binNumber">
+                </el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item label="折干后重量(吨)">
+              <el-input @input="afterWeightchange" v-model="fieldrationsList.afterWeight"></el-input>
+            </el-form-item>
+             <el-form-item label="折干后成本(元/吨)">
+              <el-input disabled  placeholder="自动计算,不可编辑" v-model="fieldrationsList.afterCost"></el-input>
+            </el-form-item>
+            <el-form-item label="折干后仓位">
+              <el-select @focus="warehousefocus1" @change="warehousechange1" v-model="fieldrationsList.afterBinNo" filterable placeholder="请选择">
+                <el-option
+                  v-for="item in options1"
+                  :key="item.id"
+                  :label="item.binNumber"
+                  :value="item.binNumber">
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-form>
+        </div>
+        <span slot="footer" class="dialog-footer">
+          <el-button @click="handleClose4">取消</el-button>
+          <el-button type="primary" @click="fieldrationssubmit">提交</el-button>
+        </span>
+      </el-dialog>
       <!-- <el-dialog
       title="提示"
       :visible.sync="dialogVisible"
@@ -381,7 +431,8 @@
   editwarehousingorder,
   getExpense,
   workflowhandle,
-  setExpense
+  getposition,
+  dryout
 } from '@/model/warehouse/index'
   import {getpayeeinfo,getbuypayeeinfo} from '@/model/profitable/index'
   import {
@@ -418,6 +469,7 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
         dialogApproveFormVisible: false,
         dataList:[],
         payeeinfo:{},
+        options:[],
         // 船舶类型
         monetaryKey: null,
         form:{
@@ -431,7 +483,12 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
         },
         // 表格显示数据
         tableDate: [],
-
+        fieldrationsList:{
+          beforeWeight:'',
+          beforeCost:'',
+          afterWeight:'',
+          afterCost:'',
+        },
         // 是否显示
         showType: true,
         dialogVisible:false,
@@ -495,11 +552,13 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
         searchKeyWord: '',
         inOutType:'',
         contractType: 2,
+        fieldrationsshow:false,
         // 提交类型
         submitType: true,
         multipleSelection:[],
         size: 10,
         spanArr: [],
+        options1:[],
         id:'',
         customerInfo:{},
         appendixIdss:[],
@@ -539,6 +598,36 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
       this.showType = this.isShow
     },
     methods: {
+      warehousefocus(){
+        getposition({baseId:this.fieldrationsList.baseId,flag:1}).toPromise()
+              .then((response) => {
+                // row.weightedit=false
+                this.options=response
+              })
+      },
+      warehousechange(e){
+        for (let i = 0; i < this.options.length; i++) {
+          if(this.options[i].binNumber==e){
+            this.fieldrationsList.beforePositionId=this.options[i].id
+          }
+          
+        }
+      },
+      warehousefocus1(){
+        getposition({baseId:this.fieldrationsList.baseId}).toPromise()
+              .then((response) => {
+                // row.weightedit=false
+                this.options1=response
+              })
+      },
+      warehousechange1(e){
+        for (let i = 0; i < this.options1.length; i++) {
+          if(this.options1[i].binNumber==e){
+            this.fieldrationsList.afterPositionId=this.options1[i].id
+          }
+          
+        }
+      },
       fujian(row) {
         this.id = row.id
         this.accessoryTFs = true
@@ -573,13 +662,34 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
       selectinOutType(){
         this.getList()
       },
-       handleSelectionChange(val,item) {
+       handleSelectionChange(val,item,index) {
          console.log(val,item)
+         for(let i = 0;i < this.gainList.length; i++){
+          if(this.gainList[i].warehouseName==item.warehouseName){
+            for (let q = 0; q < this.gainList[i].warehousingOrderList.length; q++) {
+              if(!item.payshow){
+                this.gainList[i].warehousingOrderList[q].select=false
+              }
+            }
+          }
+         }
          for (let i = 0; i < val.length; i++) {
            if(!item.payshow){
+            if(val[i].amountNotPayable<=0){
+              this.$message({
+                message: '请选择未付大于零的条目!',
+                type: 'warning'
+              });
+              var that =this
+              setTimeout(()=>{
+                that.$refs[`multipleTable${index}`][0].toggleRowSelection(val[i],false);
+            },1000)
+            }else{
               val[i].select=true
+            }
            }
           }
+          console.log(val)
           this.multipleSelection1[item.id]=val
         //  this.multipleSelection=this.noRepeat(this.multipleSelection.concat(val))
         //  console.log(this.multipleSelection)
@@ -619,6 +729,32 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
         console.log(item)
         if(localStorage.getItem('ws-pf_roleName')=='销售内勤'||localStorage.getItem('ws-pf_roleName')=='采购内勤'){
           if(Object.keys(this.multipleSelection1).length!=0&&this.multipleSelection1[item.id].length>0){
+            for (let i = 0; i < this.multipleSelection1[item.id].length; i++) {
+              if(item.warehouseName==this.multipleSelection1[item.id][i].warehouseName){
+                
+                if(this.multipleSelection1[item.id][i].inType=='移库入库'||this.multipleSelection1[item.id][i].inType=='退库入库'){
+                  this.$message({
+                    message: '请选择收购入库或采购入库的条目!',
+                    type: 'warning'
+                  });
+                  return 
+                }
+                if(this.multipleSelection1[item.id][i].amountNotPayable<=0){
+                  this.$message({
+                    message: '请选择未付大于零的条目!',
+                    type: 'warning'
+                  });
+                  return 
+                }
+                if(this.multipleSelection1[item.id][i].amountNotPayable>0&&this.multipleSelection1[item.id][i].approveStatus){
+                  this.$message({
+                    message: '请选择未请款的条目!',
+                    type: 'warning'
+                  });
+                  return 
+                }
+              }
+            }
             item.payshow=false
             for (let i = 0; i < this.multipleSelection1[item.id].length; i++) {
               if(item.warehouseName==this.multipleSelection1[item.id][i].warehouseName){
@@ -706,6 +842,55 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
         }
         
       },
+      fieldrations(){
+        let _this= this
+        console.log(this.multipleSelection1)
+        var arr=[]
+        var currectData=[]
+        for (const key in this.multipleSelection1) {
+          var array=this.multipleSelection1[key]
+          for (let i = 0; i < array.length; i++) {
+            arr.push(array[i])
+          }
+          if(array.length>0){
+            currectData=array
+          }
+        }
+        if(arr.length>1){
+          this.$message({
+              message: '一次只可折干一条数据',
+              type: 'warning'
+            });
+            return
+        }
+        
+        if(currectData.length==0){
+          this.$message({
+              message: '请选择一条数据!',
+              type: 'warning'
+            });
+            return
+        }
+        // console.log(currectData)
+        var arr1=currectData
+        for (let i = 0; i < arr1.length; i++) {
+          if(arr1[i].goodsName.indexOf('潮粮')==-1){
+            this.$message({
+              message: '只有潮粮可以折干!',
+              type: 'warning'
+            });
+            return
+          }
+          // _this.dialogTitle=arr1[i].contractNo
+        }
+        // this.currectdata=item
+        this.currectdata=arr1
+        this.fieldrationsList.id=this.currectdata[0].id
+        this.fieldrationsList.baseId=this.currectdata[0].baseId
+        this.fieldrationsList.beforeWeight=this.currectdata[0].surplusWeight
+        this.fieldrationsList.beforeCost=this.currectdata[0].avgCost
+        this.fieldrationsshow=true
+      },
       distribution(){
         let _this= this
         console.log(this.multipleSelection1)
@@ -745,7 +930,7 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
             });
             return
           }
-          if(!arr1[i].contractNo){
+          if(arr1[i].inType!='采购入库'){
             this.$message({
               message: '请选择货源是采购合同的条目',
               type: 'warning'
@@ -790,7 +975,7 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
     },
       cancel(item){
         item.payshow=true
-        console.log(this.multipleSelection1[item.id])
+
         for (let i = 0; i < this.multipleSelection1[item.id].length; i++) {
             if(item.warehouseName==this.multipleSelection1[item.id][i].warehouseName){
               this.multipleSelection1[item.id][i].select=false
@@ -807,19 +992,7 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
       },
       selectInit(row,index){
         if(localStorage.getItem('ws-pf_roleName')=='销售内勤'||localStorage.getItem('ws-pf_roleName')=='采购内勤'){
-          if(row.inType=='移库入库'||row.inType=='退库入库'){
-            return false
-          }else{
-            if(row.amountNotPayable>0){
-              if(!row.approveStatus){
-                return true
-              }else{
-                return false
-              }
-            }else{
-              return false
-            }
-          }
+          return true
           
         }else if(localStorage.getItem('ws-pf_staffName')=='杜大光'){
           return true
@@ -936,6 +1109,80 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
             });
           })
       },
+      afterWeightchange(e){
+        this.fieldrationsList.afterCost=(Number(this.fieldrationsList.beforeWeight)*Number(this.fieldrationsList.beforeCost))/Number(e)
+      },
+      fieldrationssubmit(){
+        var arr2=this.currectdata
+          if(!this.fieldrationsList.beforeWeight){
+            this.$message({
+              message: '折干前重量不能为空',
+              type: 'warning'
+            });
+            return
+          }
+          if(this.fieldrationsList.beforeWeight<=0){
+            this.$message({
+              message: '折干前重量输入错误',
+              type: 'warning'
+            });
+            return
+          }
+          if(!this.fieldrationsList.beforeBinNo){
+            this.$message({
+              message: '折干前仓位不能为空',
+              type: 'warning'
+            });
+            return
+          }
+          if(!this.fieldrationsList.afterWeight){
+            this.$message({
+              message: '折干后重量不能为空',
+              type: 'warning'
+            });
+            return
+          }
+          if(this.fieldrationsList.afterWeight<=0){
+            this.$message({
+              message: '折干后重量输入错误',
+              type: 'warning'
+            });
+            return
+          }
+          if(!this.fieldrationsList.afterBinNo){
+            this.$message({
+              message: '折干后仓位不能为空',
+              type: 'warning'
+            });
+            return
+          }
+          this.$confirm('确定提交折干?', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          }).then(() => {
+            dryout(this.fieldrationsList).toPromise()
+          .then((response) => {
+            this.$message({
+              message: '折干成功',
+              type: 'success'
+            });
+            this.form.distributionIng=''
+            this.fieldrationsshow=false
+            this.getList()
+          }).catch(() => {
+           this.$message({
+              message: '折干失败',
+              type: 'warning'
+            });
+          })
+          }).catch(() => {
+            // this.$message({
+            //   type: 'info',
+            //   message: '已取消删除'
+            // });          
+          });
+      },
       marginsubmit(item){
         var arr2=this.currectdata
           if(this.form.distributionIng>this.form.distributionCan){
@@ -1363,6 +1610,9 @@ multiFilter(array, filters) {
         this.form.distributionIng=''
         this.marginshow = false
       },
+      handleClose4() {
+        this.fieldrationsshow = false
+      },
       handleSizeChange(val) {
         console.log(`每页 ${val} 条`)
         this.pageSize = val
@@ -1449,7 +1699,7 @@ multiFilter(array, filters) {
     width: 92%;
 }
   .el-select {
-    width: 30%;
+    width: 100%;
     margin-right: 10px;
   }
   .col1 {