浏览代码

前端sdy

zhongtianhaoyuan 4 年之前
父节点
当前提交
51e47787bc

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

@@ -42,4 +42,7 @@ export const API_POST_WAREHOUSE_ADD = '/warehouseBaseInfo/api/addTemporaryWareho
 export const API_GET_WAREHOUSE_NO = '/warehouseBaseInfo/selectContractNoList'
 // 获取负责人
 export const API_GET_STAFF = '/staff/query/getStaffListByCompId'
-
+//临时出库货名下拉
+export const API_GET_GOODSNAME_XIALA = '/warehouseInOutInfo/selectTemporaryGoodsNameList'
+//临时库待完成
+export const API_GET_WAREHOUSE_LIST = '/warehouseInOutInfo/selectWarehouseInOutInfoTemporary'

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

@@ -21,7 +21,9 @@ import {
     API_POST_WAREHOUSE_DEL_INOUTINFO,
     API_POST_WAREHOUSE_ADD,
     API_GET_WAREHOUSE_NO,
-    API_GET_STAFF
+    API_GET_STAFF,
+    API_GET_GOODSNAME_XIALA,
+    API_GET_WAREHOUSE_LIST
 } from '@/api/V2/warehouse'
 // 列表
 export const getList = appRx.get(API_GET_WAREHOUSE_BASEINFO, errorCatcher, errorHandle, filter)
@@ -66,7 +68,8 @@ export const increase = appRx.post(API_POST_WAREHOUSE_ADD, errorCatcher, errorHa
 export const xialaNo = appRx.get(API_GET_WAREHOUSE_NO, errorCatcher, errorHandle, filter)
 // 获取负责人 
 export const getstaff = appRx.get(API_GET_STAFF, errorCatcher, errorHandle, filter)
-
-
-
+//临时出库货名下拉
+export const goodsnameXiala = appRx.get(API_GET_GOODSNAME_XIALA, errorCatcher, errorHandle, filter)
+//临时库待完成
+export const completeList = appRx.get(API_GET_WAREHOUSE_LIST, errorCatcher, errorHandle, filter)
 

+ 55 - 24
src/views/warehouse/warehouseManagementDelivery.vue

@@ -105,18 +105,20 @@
           </ws-form-item>
           <!--经办人-->
           <ws-form-item label="经办人" span="1" prop="agent">
-            <ws-select
+           <el-select
               v-model="deptBudgetList.agent"
-              placeholder=""
-              class="typeselect"
+              placeholder="请选择经办人"
+              filterable
+              :filter-method="dataFilter"
+              @change="selectstaff"
             >
-              <ws-option
-                v-for="item in agent"
-                :key="item.constKey"
+              <el-option
+                v-for="item in options"
+                :key="item.value"
                 :label="item.staffName"
                 :value="item.staffName"
               />
-            </ws-select>
+            </el-select>
           </ws-form-item>
           <!--出库日期-->
           <ws-form-item
@@ -279,6 +281,7 @@ import {
   goodsname,
   xialaNo,
   getstaff,
+  goodsnameXiala,
 } from '@/model/warehouse/index'
 import Pagination from '@/components/Pagination'
 import WsUpload from '@/components/WsUpload'
@@ -291,9 +294,6 @@ export default {
     Pagination,
   },
   watch: {
-    // vesselId(val) {
-    //   this.getList()
-    // },
     isShow(val) {
       this.showType = val
     },
@@ -330,6 +330,9 @@ export default {
       onChange: {},
       gradeList: [],
       agent: [],
+       staffList: [],
+      options: [],
+      value:"",
       rules: {
         netWeight: [
           {
@@ -363,12 +366,12 @@ export default {
     }
   },
   mounted() {
-    console.log(this.$route.query)
     this.deptBudgetList.baseId = this.$route.query.baseId
     this.deptBudgetList.positionId = this.$route.query.positionId
     this.deptBudgetList.warehouseName = this.$route.query.warehouseName
     this.deptBudgetList.binNumber = this.$route.query.binNumber
     this.deptBudgetList.warehouseType = this.$route.query.warehouseType
+    this.deptBudgetList.warehouseId = this.$route.query.warehouseId
     this.getList()
   },
   methods: {
@@ -376,6 +379,31 @@ export default {
     revert() {
       this.$router.push({ path: 'warehouseManagementList' })
     },
+    dataFilter(val) {
+      // console.log(val,"名")
+      this.deptBudgetList.staffList = val
+      if (val) {
+        //val存在
+        this.options = this.staffList.filter((item) => {
+          if (
+            !!~item.staffName.indexOf(val) ||
+            !!~item.staffName.toUpperCase().indexOf(val.toUpperCase())
+          ) {
+            return true
+          }
+        })
+      } else {
+        //val为空时,还原数组
+        this.options = this.staffList
+      }
+    },
+    selectstaff(e) {
+      for (var i = 0; i < this.staffList.length; i++) {
+        if (this.staffList[i].staffName == e) {
+          this.deptBudgetList.personChargeKey = this.staffList[i].staffId
+        }
+      }
+    },
     temporaryStorage() {
       if (!this.deptBudgetList.goodsName) {
         this.$message({
@@ -795,7 +823,7 @@ export default {
         })
         return
       }
-      if (!this.deptBudgetList.inOutType) {
+      if (!this.deptBudgetList.deliveryType) {
         this.$message({
           message: '出库类型不能为空!',
           type: 'warning',
@@ -1102,12 +1130,6 @@ export default {
       this.getList()
     },
     getList() {
-      // 货名
-      goodsname({ positionId: this.$route.query.positionId })
-        .toPromise()
-        .then((response) => {
-          this.goodnameList = response
-        })
       // 品级
       pullDown({ constId: 'CON3' })
         .toPromise()
@@ -1122,17 +1144,24 @@ export default {
       //   })
       // 类型
       if (this.deptBudgetList.warehouseType == 1) {
+        // 货名
+        goodsname({ positionId: this.$route.query.positionId })
+          .toPromise()
+          .then((response) => {
+            this.goodnameList = response
+          })
+        //类型
         pullDown({ constId: 'CON6' })
           .toPromise()
           .then((response) => {
             this.deliveryType = response
           })
       } else if (this.deptBudgetList.warehouseType == 2) {
-        // pullDown({ constId: 'WARE1' })
-        //   .toPromise()
-        //   .then((response) => {
-        //     this.storageType = response
-        //   })
+        goodsnameXiala({ baseId: this.deptBudgetList.warehouseId })
+          .toPromise()
+          .then((response) => {
+            this.goodnameList = response
+          })
         pullDown({ constId: 'WARE2' })
           .toPromise()
           .then((response) => {
@@ -1149,7 +1178,9 @@ export default {
       getstaff({ compId: sessionStorage.getItem('ws-pf_compId') })
         .toPromise()
         .then((response) => {
-          this.agent = response
+          // this.agent = response
+          this.options = response
+           this.staffList = response
         })
     },
     selecttaskType(e) {

+ 0 - 3
src/views/warehouse/warehouseManagementEdit.vue

@@ -281,7 +281,6 @@ export default {
           return time.getTime() > Date.now()
         },
       },
-
       options: [],
       value: '',
       accessoryTFs: false,
@@ -316,7 +315,6 @@ export default {
   },
   methods: {
     dataFilter(val) {
-      console.log(val)
       this.deptBudgetList.personCharge = val
       if (val) {
         //val存在
@@ -328,7 +326,6 @@ export default {
             return true
           }
         })
-        console.log(this.options)
       } else {
         //val为空时,还原数组
         this.options = this.staffList

+ 5 - 1
src/views/warehouse/warehouseManagementList.vue

@@ -308,8 +308,10 @@ export default {
     this.showType = this.isShow
   },
   methods: {
+
     //出库
     delivery(item) {
+
       this.$router.push({
         path: 'warehouseManagementDelivery',
         query: {
@@ -318,7 +320,8 @@ export default {
           warehouseName: item.warehouseName,
           binNumber: item.binNumber,
           capacity: item.capacity,
-          warehouseType: this.warehouseType
+          warehouseType: this.warehouseType,
+          warehouseId: item.warehouseId
         },
       })
     },
@@ -383,6 +386,7 @@ export default {
             positionId: row.binNumberId,
             warehouseName: row.warehouseName,
             binNumber: row.binNumber,
+             warehouseType: this.warehouseType,
           },
         })
       }

+ 21 - 5
src/views/warehouse/warehouseManagementNoComplete.vue

@@ -121,6 +121,7 @@
 import {
   complete,
   delInOut,
+  completeList,
   // deletewarehouse,
   // warehouseName,
   // addstorageputList,
@@ -197,8 +198,9 @@ export default {
     // this.getVesselData();
     this.deptBudgetList1.warehouseName = this.$route.query.warehouseName
     this.binNumber = this.$route.params.binNumber
+    this.deptBudgetList.warehouseType = this.$route.query.warehouseType
     //接参
-    this.getList(this.$route.query.baseId, this.$route.query.positionId)
+    this.getList(this.$route.query.baseId, this.$route.query.positionId , this.$route.query.warehouseType)
     this.showType = this.isShow
   },
   methods: {
@@ -233,7 +235,8 @@ export default {
              statusFlag:row.statusFlag,
              tare:row.tare,
              warehouseName: row.warehouseName,  
-             warehouseInOutDetail:row.warehouseInOutDetail
+             warehouseInOutDetail:row.warehouseInOutDetail,
+             warehouseType: this.deptBudgetList.warehouseType
           },
         })
       } else if(row.inOutFlag==1){
@@ -262,8 +265,8 @@ export default {
              statusFlag:row.statusFlag,
              tare:row.tare,
              warehouseName: row.warehouseName,  
-             warehouseInOutDetail:row.warehouseInOutDetail
-
+             warehouseInOutDetail:row.warehouseInOutDetail,
+             warehouseType: this.deptBudgetList.warehouseType,
           }
           })
       }
@@ -304,7 +307,8 @@ export default {
       this.getList()
     },
     //收
-    getList(id, id1) {
+    getList(id, id1,id2) { 
+      if(id2==1){
       complete({
         // compId: sessionStorage.getItem('ws-pf_compId'),
         baseId: id,
@@ -317,6 +321,18 @@ export default {
         .then((response) => {
           this.improved = response
         })
+      }else if(id2==2){   
+      completeList({
+        baseId: id,
+        positionId: id1,
+        pageSize: this.pageSize,
+        currentPage: this.currentPage,
+      })
+        .toPromise()
+        .then((response) => {
+          this.improved = response
+        })
+      }
     },
     handleExamine(row) {
       this.$router.push({

+ 143 - 82
src/views/warehouse/warehouseManagementPerfectDelivery.vue

@@ -79,7 +79,7 @@
           <!--净重(吨)-->
           <ws-form-item label="净重(吨)" span="1" prop="netWeight">
             <ws-input
-            :readonly="readonly"
+              :readonly="readonly"
               v-model.number="dataList.netWeight"
               placeholder="不可编辑,自动计算"
               type="number"
@@ -103,15 +103,22 @@
               />
             </ws-select>
           </ws-form-item>
-
           <!--经办人-->
           <ws-form-item label="经办人" span="1" prop="agent">
-            <ws-input
+            <el-select
               v-model="dataList.agent"
-              placeholder="请输入出库经办人姓名"
-              maxlength="100"
-              size="small"
-            />
+              placeholder="请选择经办人"
+              filterable
+              :filter-method="dataFilter"
+              @change="selectstaff"
+            >
+              <el-option
+                v-for="item in options"
+                :key="item.value"
+                :label="item.staffName"
+                :value="item.staffName"
+              />
+            </el-select>
           </ws-form-item>
           <!--出库日期-->
           <ws-form-item
@@ -154,14 +161,19 @@
             />
           </ws-form-item>
 
-          <!--合同编号-->
-          <ws-form-item label="合同编号" span="1" prop="contractNo">
-            <ws-input
+          <ws-form-item label="合同编号" span="1">
+            <ws-select
               v-model="dataList.contractNo"
-              placeholder="请输入合同编号"
-              maxlength="100"
-              size="small"
-            />
+              placeholder="请选择合同编号"
+              class="typeselect"
+            >
+              <ws-option
+                v-for="item in outContractNo"
+                :key="item.constKey"
+                :label="item.contractNo"
+                :value="item.contractNo"
+              />
+            </ws-select>
           </ws-form-item>
         </ws-info-table>
       </div>
@@ -268,11 +280,11 @@
   </div>
 </template>
 <script>
-import { pullDown, addstorageputList } from '@/model/warehouse/index'
+import { pullDown, addstorageputList ,xialaNo,getstaff,} from '@/model/warehouse/index'
 import { downloadFile } from '@/utils/batchDown'
 import Pagination from '@/components/Pagination'
 import WsUpload from '@/components/WsUpload'
-import { mapActions, mapGetters, mapState } from 'vuex'
+import { mapActions, mapGetters, mapState } from 'vuex'
 // import { dayjs, fmoney, EventBus } from 'base-core-lib'
 import { dayjs, EventBus } from 'base-core-lib'
 export default {
@@ -286,10 +298,8 @@ export default {
       this.showType = val
     },
   },
-  computed:{
-    ...mapGetters([
-      'deptBudgetList',
-    ]),
+  computed: {
+    ...mapGetters(['deptBudgetList']),
   },
   data() {
     return {
@@ -304,7 +314,7 @@ export default {
       showType: true,
       // 年
       year: '',
-      readonly:true,
+      readonly: true,
       deptBudgetTotal: 0,
       currentPage: 1,
       pageSize: 10,
@@ -314,6 +324,12 @@ export default {
       startDate: null,
       endDate: null,
       goodnameList: {},
+
+      staffList: [],
+      options: [],
+      storageType: [],
+      deliveryType: [],
+      outContractNo: [],
       // 提交类型
       submitType: true,
       storageType: [],
@@ -342,17 +358,17 @@ export default {
       },
       contractList: [],
       dataList: {
-        id:'',
-        grossWeight:'',
-        contractNo:'',
-        tare:'',
-        netWeight:'',
-        grade:'',
-        agent:'',
-        carNo:'',
-        inOutDate:'',
-        inOutType:'',
-        goodsName:'',
+        id: '',
+        grossWeight: '',
+        contractNo: '',
+        tare: '',
+        netWeight: '',
+        grade: '',
+        agent: '',
+        carNo: '',
+        inOutDate: '',
+        inOutType: '',
+        goodsName: '',
         warehouseInOutDetail: {},
       },
       historyList: [],
@@ -369,8 +385,8 @@ export default {
     this.deptBudgetList1.warehouseName = this.$route.query.warehouseName
     this.deptBudgetList1.binNumber = this.$route.query.binNumber
     this.getList()
-    this.dataList.id=this.$route.query.id
-    this.dataList.grossWeight=this.$route.query.grossWeight
+    this.dataList.id = this.$route.query.id
+    this.dataList.grossWeight = this.$route.query.grossWeight
     this.dataList.contractNo = this.$route.query.contractNo
     this.dataList.baseId = this.$route.query.baseId
     this.dataList.positionId = this.$route.query.positionId
@@ -398,6 +414,31 @@ export default {
     revert() {
       this.$router.go(-1)
     },
+    dataFilter(val) {
+      // console.log(val,"名")
+      this.deptBudgetList.staffList = val
+      if (val) {
+        //val存在
+        this.options = this.staffList.filter((item) => {
+          if (
+            !!~item.staffName.indexOf(val) ||
+            !!~item.staffName.toUpperCase().indexOf(val.toUpperCase())
+          ) {
+            return true
+          }
+        })
+      } else {
+        //val为空时,还原数组
+        this.options = this.staffList
+      }
+    },
+    selectstaff(e) {
+      for (var i = 0; i < this.staffList.length; i++) {
+        if (this.staffList[i].staffName == e) {
+          this.deptBudgetList.personChargeKey = this.staffList[i].staffId
+        }
+      }
+    },
     //暂存按钮
     temporaryStorage() {
       this.$confirm(`暂存后可在待完成页面查看,确定暂存`, {
@@ -408,9 +449,7 @@ export default {
         .then(() => {
           this.$refs.dataList.validate((valid) => {
             if (valid) {
-              this.dataList.compId = sessionStorage.getItem(
-                'ws-pf_compId'
-              )
+              this.dataList.compId = sessionStorage.getItem('ws-pf_compId')
               this.dataList.inOutFlag = 1
               this.dataList.statusFlag = 1
               addstorageputList(this.dataList)
@@ -431,7 +470,7 @@ export default {
     },
     //提交按钮
     submit() {
-        if (!this.dataList.goodsName) {
+      if (!this.dataList.goodsName) {
         this.$message({
           message: '货名不能为空',
           type: 'warning',
@@ -480,17 +519,14 @@ export default {
         })
         return
       }
-      if (
-        this.dataList.agent.length < 2 ||
-        this.dataList.agent.length > 10
-      ) {
+      if (this.dataList.agent.length < 2 || this.dataList.agent.length > 10) {
         this.$message({
           message: '经办人输入有误',
           type: 'warning',
         })
         return
       }
-       if (!this.dataList.grade) {
+      if (!this.dataList.grade) {
         this.$message({
           message: '品级不能为空!',
           type: 'warning',
@@ -550,11 +586,10 @@ export default {
         })
         return
       }
-       //自检员
+      //自检员
       if (this.dataList.warehouseInOutDetail.qualityInspector) {
         if (
-          this.dataList.warehouseInOutDetail.qualityInspector.length <
-            2 ||
+          this.dataList.warehouseInOutDetail.qualityInspector.length < 2 ||
           this.dataList.warehouseInOutDetail.qualityInspector.length > 10
         ) {
           this.$message({
@@ -575,14 +610,13 @@ export default {
         if (
           this.dataList.warehouseInOutDetail.waterContent < 1 ||
           this.dataList.warehouseInOutDetail.waterContent > 40 ||
-          (String(
-            this.dataList.warehouseInOutDetail.waterContent
-          ).indexOf('.') != -1 &&
-            String(this.dataList.warehouseInOutDetail.waterContent)
-              .length -
-              (String(
-                this.dataList.warehouseInOutDetail.waterContent
-              ).indexOf('.') +
+          (String(this.dataList.warehouseInOutDetail.waterContent).indexOf(
+            '.'
+          ) != -1 &&
+            String(this.dataList.warehouseInOutDetail.waterContent).length -
+              (String(this.dataList.warehouseInOutDetail.waterContent).indexOf(
+                '.'
+              ) +
                 1) >
               2)
         ) {
@@ -606,13 +640,12 @@ export default {
         if (
           this.dataList.warehouseInOutDetail.impurity < 1 ||
           this.dataList.warehouseInOutDetail.impurity > 40 ||
-          (String(this.dataList.warehouseInOutDetail.impurity).indexOf(
-            '.'
-          ) != -1 &&
+          (String(this.dataList.warehouseInOutDetail.impurity).indexOf('.') !=
+            -1 &&
             String(this.dataList.warehouseInOutDetail.impurity).length -
-              (String(
-                this.dataList.warehouseInOutDetail.impurity
-              ).indexOf('.') +
+              (String(this.dataList.warehouseInOutDetail.impurity).indexOf(
+                '.'
+              ) +
                 1) >
               2)
         ) {
@@ -623,7 +656,7 @@ export default {
           return
         }
       }
-       //霉变
+      //霉变
       if (this.dataList.warehouseInOutDetail.mildewGrain) {
         if (isNaN(this.dataList.warehouseInOutDetail.mildewGrain)) {
           this.$message({
@@ -639,9 +672,9 @@ export default {
             '.'
           ) != -1 &&
             String(this.dataList.warehouseInOutDetail.mildewGrain).length -
-              (String(
-                this.dataList.warehouseInOutDetail.mildewGrain
-              ).indexOf('.') +
+              (String(this.dataList.warehouseInOutDetail.mildewGrain).indexOf(
+                '.'
+              ) +
                 1) >
               2)
         ) {
@@ -653,7 +686,7 @@ export default {
         }
       }
 
-       //热损伤
+      //热损伤
       if (this.dataList.warehouseInOutDetail.jiaorenli) {
         if (isNaN(this.dataList.warehouseInOutDetail.jiaorenli)) {
           this.$message({
@@ -665,13 +698,12 @@ export default {
         if (
           this.dataList.warehouseInOutDetail.jiaorenli < 1 ||
           this.dataList.warehouseInOutDetail.jiaorenli > 40 ||
-          (String(this.dataList.warehouseInOutDetail.jiaorenli).indexOf(
-            '.'
-          ) != -1 &&
+          (String(this.dataList.warehouseInOutDetail.jiaorenli).indexOf('.') !=
+            -1 &&
             String(this.dataList.warehouseInOutDetail.jiaorenli).length -
-              (String(
-                this.dataList.warehouseInOutDetail.jiaorenli
-              ).indexOf('.') +
+              (String(this.dataList.warehouseInOutDetail.jiaorenli).indexOf(
+                '.'
+              ) +
                 1) >
               2)
         ) {
@@ -683,7 +715,7 @@ export default {
         }
       }
 
-        //不完整粒(%)
+      //不完整粒(%)
       if (this.dataList.warehouseInOutDetail.imperfectGrain) {
         if (isNaN(this.dataList.warehouseInOutDetail.imperfectGrain)) {
           this.$message({
@@ -713,7 +745,7 @@ export default {
         }
       }
       //容重
-       if (this.dataList.warehouseInOutDetail.bulkDensity) {
+      if (this.dataList.warehouseInOutDetail.bulkDensity) {
         if (isNaN(this.dataList.warehouseInOutDetail.bulkDensity)) {
           this.$message({
             message: '容重(克/升)非数字!',
@@ -728,9 +760,9 @@ export default {
             '.'
           ) != -1 &&
             String(this.dataList.warehouseInOutDetail.bulkDensity).length -
-              (String(
-                this.dataList.warehouseInOutDetail.bulkDensity
-              ).indexOf('.') +
+              (String(this.dataList.warehouseInOutDetail.bulkDensity).indexOf(
+                '.'
+              ) +
                 1) >
               0)
         ) {
@@ -753,7 +785,7 @@ export default {
               this.$router.push({ path: 'warehouseManagementList' })
             })
         } else {
-         EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
+          EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
           return false
         }
       })
@@ -820,10 +852,39 @@ export default {
           this.gradeList = response
         })
       // 类型
-      pullDown({ constId: 'CON6' })
+      if (this.$route.query.warehouseType == '1') {
+        pullDown({ constId: 'CON5' })
+          .toPromise()
+          .then((response) => {
+            this.storageType = response
+          })
+      } else if (this.$route.query.warehouseType == '2') {
+        //临时库入库类型
+        pullDown({ constId: 'WARE1' })
+          .toPromise()
+          .then((response) => {
+            this.storageType = response
+          })
+        //临时库出库类型
+        pullDown({ constId: 'WARE2' })
+          .toPromise()
+          .then((response) => {
+            this.deliveryType = response
+          })
+      }
+      //合同编号
+      xialaNo({ compId: sessionStorage.getItem('ws-pf_compId') })
+        .toPromise()
+        .then((response) => {
+          this.outContractNo = response
+        })
+      //经办人
+      getstaff({ compId: sessionStorage.getItem('ws-pf_compId') })
         .toPromise()
         .then((response) => {
-          this.storageType = response
+          this.options = response
+          this.staffList = response
+          //  this.agent = response
         })
     },
     selecttaskType(e) {
@@ -968,16 +1029,16 @@ export default {
   color: #8890b1;
   line-height: 16px;
 }
-.inspector{
+.inspector {
   width: 50%;
-} 
+}
 //质检员
 .inspector .el-form-item__content {
   text-align: left;
   margin-left: 0px;
 }
 /deep/[data-v-d228e17e] .el-form-item__label {
-    width: 60px;
+  width: 60px;
 }
 .small-title {
   position: relative;

+ 197 - 84
src/views/warehouse/warehouseManagementPerfectput.vue

@@ -76,7 +76,7 @@
           <!--净重(吨)-->
           <ws-form-item label="净重(吨)" span="1" prop="netWeight">
             <ws-input
-            :readonly="readonly"
+              :readonly="readonly"
               v-model.number="dataList.netWeight"
               placeholder="不可编辑,自动计算"
               type="number"
@@ -101,14 +101,22 @@
             </ws-select>
           </ws-form-item>
 
-          <!--经办人-->
+         <!--经办人-->
           <ws-form-item label="经办人" span="1" prop="agent">
-            <ws-input
+            <el-select
               v-model="dataList.agent"
-              placeholder="请输入出库经办人姓名"
-              maxlength="100"
-              size="small"
-            />
+              placeholder="请选择经办人"
+              filterable
+              :filter-method="dataFilter"
+              @change="selectstaff"
+            >
+              <el-option
+                v-for="item in options"
+                :key="item.value"
+                :label="item.staffName"
+                :value="item.staffName"
+              />
+            </el-select>
           </ws-form-item>
           <!--入库日期-->
           <ws-form-item
@@ -152,15 +160,65 @@
           </ws-form-item>
 
           <!--合同编号-->
-          <ws-form-item label="合同编号" span="1" prop="contractNo">
+          <!-- <ws-form-item label="合同编号" span="1" prop="contractNo">
             <ws-input
               v-model="dataList.contractNo"
               placeholder="请输入合同编号"
               maxlength="100"
               size="small"
             />
-          </ws-form-item>
+          </ws-form-item> -->
+           <ws-form-item label="合同编号" span="1">
+              <ws-select
+                v-model="dataList.contractNo"
+                placeholder="请选择合同编号"
+                class="typeselect"
+              >
+                <ws-option
+                  v-for="item in outContractNo"
+                  :key="item.constKey"
+                  :label="item.contractNo"
+                  :value="item.contractNo"
+                />
+              </ws-select>
+           </ws-form-item>
         </ws-info-table>
+        <div warehouseType>
+          <el-checkbox v-model="checked" checked>退库并出库</el-checkbox>
+          <ws-info-table
+            v-show="checked == true">
+            <!-- 出库类型 -->
+            <ws-form-item label="出库类型" span="1">
+              <ws-select
+                v-model="deptBudgetList.deliveryType"
+                placeholder=""
+                class="typeselect"
+              >
+                <ws-option
+                  v-for="item in deliveryType"
+                  :key="item.constKey"
+                  :label="item.constValue"
+                  :value="item.constValue"
+                />
+              </ws-select>
+            </ws-form-item>
+            <!-- 出库合同编号 -->
+            <ws-form-item label="出库合同编号" span="1">
+              <ws-select
+                v-model="dataList.contractNo"
+                placeholder="请选择合同编号或移库任务编号"
+                class="typeselect"
+              >
+                <ws-option
+                  v-for="item in outContractNo"
+                  :key="item.constKey"
+                  :label="item.contractNo"
+                  :value="item.contractNo"
+                />
+              </ws-select>
+            </ws-form-item>
+          </ws-info-table>
+        </div>
       </div>
       <div class="small-title">上传仓库照片</div>
       <ws-upload
@@ -185,7 +243,6 @@
             maxlength="120"
             size="small"
           />
-         
         </ws-form-item>
       </div>
       <div class="neifor">
@@ -266,10 +323,15 @@
   </div>
 </template>
 <script>
-import { pullDown, addstorageputList } from '@/model/warehouse/index'
+import {
+  pullDown,
+  addstorageputList,
+  xialaNo,
+  getstaff,
+} from '@/model/warehouse/index'
 import { downloadFile } from '@/utils/batchDown'
 import Pagination from '@/components/Pagination'
-import { mapActions, mapGetters, mapState } from 'vuex'
+import { mapActions, mapGetters, mapState } from 'vuex'
 import WsUpload from '@/components/WsUpload'
 // import { dayjs, fmoney, EventBus } from 'base-core-lib'
 import { dayjs, EventBus } from 'base-core-lib'
@@ -287,10 +349,8 @@ export default {
       this.showType = val
     },
   },
-  computed:{
-    ...mapGetters([
-      'deptBudgetList',
-    ]),
+  computed: {
+    ...mapGetters(['deptBudgetList']),
   },
   data() {
     return {
@@ -306,7 +366,7 @@ export default {
       // 年
       year: '',
       deptBudgetTotal: 0,
-      readonly:true,
+      readonly: true,
       currentPage: 1,
       pageSize: 10,
       searchType: 1,
@@ -315,12 +375,19 @@ export default {
       startDate: null,
       endDate: null,
       goodnameList: {},
+      checked: true,
+
+      staffList: [],
+      options: [],
+      storageType: [],
+      deliveryType: [],
+      outContractNo: [],
       // 提交类型
       submitType: true,
       storageType: [],
       appendixIdsAdd: '',
       uploadSuccess: {},
-      warehouseInOutDetail:{},
+      warehouseInOutDetail: {},
       onChange: {},
       deptBudgetList1: [],
       gradeList: [],
@@ -344,17 +411,17 @@ export default {
       },
       contractList: [],
       dataList: {
-        id:'',
-        grossWeight:'',
-        contractNo:'',
-        tare:'',
-        netWeight:'',
-        grade:'',
-        agent:'',
-        carNo:'',
-        inOutDate:'',
-        inOutType:'',
-        goodsName:'',
+        id: '',
+        grossWeight: '',
+        contractNo: '',
+        tare: '',
+        netWeight: '',
+        grade: '',
+        agent: '',
+        carNo: '',
+        inOutDate: '',
+        inOutType: '',
+        goodsName: '',
         warehouseInOutDetail: {},
       },
       historyList: [],
@@ -366,12 +433,12 @@ export default {
       accessoryTFs: false,
     }
   },
-   activated() {
+  activated() {
     this.deptBudgetList1.warehouseName = this.$route.query.warehouseName
     this.deptBudgetList1.binNumber = this.$route.query.binNumber
     this.getList()
-    this.dataList.id=this.$route.query.id
-    this.dataList.grossWeight=this.$route.query.grossWeight
+    this.dataList.id = this.$route.query.id
+    this.dataList.grossWeight = this.$route.query.grossWeight
     this.dataList.contractNo = this.$route.query.contractNo
     this.dataList.baseId = this.$route.query.baseId
     this.dataList.positionId = this.$route.query.positionId
@@ -392,12 +459,38 @@ export default {
     this.dataList.inOutTypeKey = Number(this.$route.query.inOutTypeKey)
     this.dataList.statusFlag = this.$route.statusFlag
     this.dataList.warehouseInOutDetail = this.$route.query.warehouseInOutDetail
+    this.deptBudgetList.warehouseType = this.$route.query.warehouseType
   },
   methods: {
     //返回按钮
     revert() {
       this.$router.go(-1)
     },
+    dataFilter(val) {
+      // console.log(val,"名")
+      this.deptBudgetList.staffList = val
+      if (val) {
+        //val存在
+        this.options = this.staffList.filter((item) => {
+          if (
+            !!~item.staffName.indexOf(val) ||
+            !!~item.staffName.toUpperCase().indexOf(val.toUpperCase())
+          ) {
+            return true
+          }
+        })
+      } else {
+        //val为空时,还原数组
+        this.options = this.staffList
+      }
+    },
+    selectstaff(e) {
+      for (var i = 0; i < this.staffList.length; i++) {
+        if (this.staffList[i].staffName == e) {
+          this.deptBudgetList.personChargeKey = this.staffList[i].staffId
+        }
+      }
+    },
     //暂存按钮
     temporaryStorage() {
       this.$confirm(`暂存后可在待完成页面查看,确定暂存`, {
@@ -408,9 +501,7 @@ export default {
         .then(() => {
           this.$refs.dataList.validate((valid) => {
             if (valid) {
-              this.dataList.compId = sessionStorage.getItem(
-                'ws-pf_compId'
-              )
+              this.dataList.compId = sessionStorage.getItem('ws-pf_compId')
               this.dataList.inOutFlag = 2
               this.dataList.statusFlag = 1
               addstorageputList(this.dataList)
@@ -431,7 +522,7 @@ export default {
     },
     //提交按钮
     submit() {
-       if (!this.dataList.goodsName) {
+      if (!this.dataList.goodsName) {
         this.$message({
           message: '货名不能为空',
           type: 'warning',
@@ -459,7 +550,7 @@ export default {
         })
         return
       }
-    
+
       if (
         this.dataList.tare < 0 ||
         this.dataList.tare > 10000 ||
@@ -481,17 +572,14 @@ export default {
         })
         return
       }
-      if (
-        this.dataList.agent.length < 2 ||
-        this.dataList.agent.length > 10
-      ) {
+      if (this.dataList.agent.length < 2 || this.dataList.agent.length > 10) {
         this.$message({
           message: '经办人输入有误',
           type: 'warning',
         })
         return
       }
-       if (!this.dataList.grade) {
+      if (!this.dataList.grade) {
         this.$message({
           message: '品级不能为空!',
           type: 'warning',
@@ -551,11 +639,10 @@ export default {
         })
         return
       }
-       //自检员
+      //自检员
       if (this.dataList.warehouseInOutDetail.qualityInspector) {
         if (
-          this.dataList.warehouseInOutDetail.qualityInspector.length <
-            2 ||
+          this.dataList.warehouseInOutDetail.qualityInspector.length < 2 ||
           this.dataList.warehouseInOutDetail.qualityInspector.length > 10
         ) {
           this.$message({
@@ -576,14 +663,13 @@ export default {
         if (
           this.dataList.warehouseInOutDetail.waterContent < 1 ||
           this.dataList.warehouseInOutDetail.waterContent > 40 ||
-          (String(
-            this.dataList.warehouseInOutDetail.waterContent
-          ).indexOf('.') != -1 &&
-            String(this.dataList.warehouseInOutDetail.waterContent)
-              .length -
-              (String(
-                this.dataList.warehouseInOutDetail.waterContent
-              ).indexOf('.') +
+          (String(this.dataList.warehouseInOutDetail.waterContent).indexOf(
+            '.'
+          ) != -1 &&
+            String(this.dataList.warehouseInOutDetail.waterContent).length -
+              (String(this.dataList.warehouseInOutDetail.waterContent).indexOf(
+                '.'
+              ) +
                 1) >
               2)
         ) {
@@ -607,13 +693,12 @@ export default {
         if (
           this.dataList.warehouseInOutDetail.impurity < 1 ||
           this.dataList.warehouseInOutDetail.impurity > 40 ||
-          (String(this.dataList.warehouseInOutDetail.impurity).indexOf(
-            '.'
-          ) != -1 &&
+          (String(this.dataList.warehouseInOutDetail.impurity).indexOf('.') !=
+            -1 &&
             String(this.dataList.warehouseInOutDetail.impurity).length -
-              (String(
-                this.dataList.warehouseInOutDetail.impurity
-              ).indexOf('.') +
+              (String(this.dataList.warehouseInOutDetail.impurity).indexOf(
+                '.'
+              ) +
                 1) >
               2)
         ) {
@@ -624,7 +709,7 @@ export default {
           return
         }
       }
-       //霉变
+      //霉变
       if (this.dataList.warehouseInOutDetail.mildewGrain) {
         if (isNaN(this.dataList.warehouseInOutDetail.mildewGrain)) {
           this.$message({
@@ -640,9 +725,9 @@ export default {
             '.'
           ) != -1 &&
             String(this.dataList.warehouseInOutDetail.mildewGrain).length -
-              (String(
-                this.dataList.warehouseInOutDetail.mildewGrain
-              ).indexOf('.') +
+              (String(this.dataList.warehouseInOutDetail.mildewGrain).indexOf(
+                '.'
+              ) +
                 1) >
               2)
         ) {
@@ -654,7 +739,7 @@ export default {
         }
       }
 
-       //热损伤
+      //热损伤
       if (this.dataList.warehouseInOutDetail.jiaorenli) {
         if (isNaN(this.dataList.warehouseInOutDetail.jiaorenli)) {
           this.$message({
@@ -666,13 +751,12 @@ export default {
         if (
           this.dataList.warehouseInOutDetail.jiaorenli < 1 ||
           this.dataList.warehouseInOutDetail.jiaorenli > 40 ||
-          (String(this.dataList.warehouseInOutDetail.jiaorenli).indexOf(
-            '.'
-          ) != -1 &&
+          (String(this.dataList.warehouseInOutDetail.jiaorenli).indexOf('.') !=
+            -1 &&
             String(this.dataList.warehouseInOutDetail.jiaorenli).length -
-              (String(
-                this.dataList.warehouseInOutDetail.jiaorenli
-              ).indexOf('.') +
+              (String(this.dataList.warehouseInOutDetail.jiaorenli).indexOf(
+                '.'
+              ) +
                 1) >
               2)
         ) {
@@ -684,7 +768,7 @@ export default {
         }
       }
 
-        //不完整粒(%)
+      //不完整粒(%)
       if (this.dataList.warehouseInOutDetail.imperfectGrain) {
         if (isNaN(this.dataList.warehouseInOutDetail.imperfectGrain)) {
           this.$message({
@@ -714,7 +798,7 @@ export default {
         }
       }
       //容重
-       if (this.dataList.warehouseInOutDetail.bulkDensity) {
+      if (this.dataList.warehouseInOutDetail.bulkDensity) {
         if (isNaN(this.dataList.warehouseInOutDetail.bulkDensity)) {
           this.$message({
             message: '容重(克/升)非数字!',
@@ -729,9 +813,9 @@ export default {
             '.'
           ) != -1 &&
             String(this.dataList.warehouseInOutDetail.bulkDensity).length -
-              (String(
-                this.dataList.warehouseInOutDetail.bulkDensity
-              ).indexOf('.') +
+              (String(this.dataList.warehouseInOutDetail.bulkDensity).indexOf(
+                '.'
+              ) +
                 1) >
               0)
         ) {
@@ -750,9 +834,7 @@ export default {
         .then(() => {
           this.$refs.dataList.validate((valid) => {
             if (valid) {
-              this.dataList.compId = sessionStorage.getItem(
-                'ws-pf_compId'
-              )
+              this.dataList.compId = sessionStorage.getItem('ws-pf_compId')
               this.dataList.inOutFlag = 2
               this.dataList.statusFlag = 3
               addstorageputList(this.dataList)
@@ -851,10 +933,40 @@ export default {
           this.gradeList = response
         })
       // 类型
-      pullDown({ constId: 'CON5' })
+      if (this.$route.query.warehouseType == '1') {
+        pullDown({ constId: 'CON5' })
+          .toPromise()
+          .then((response) => {
+            this.storageType = response
+          })
+      } else if (this.$route.query.warehouseType == '2') {
+    
+        //临时库入库类型
+        pullDown({ constId: 'WARE1' })
+          .toPromise()
+          .then((response) => {
+            this.storageType = response
+          })
+        //临时库出库类型
+        pullDown({ constId: 'WARE2' })
+          .toPromise()
+          .then((response) => {
+            this.deliveryType = response
+          })
+      }
+      //合同编号
+      xialaNo({ compId: sessionStorage.getItem('ws-pf_compId') })
         .toPromise()
         .then((response) => {
-          this.storageType = response
+          this.outContractNo = response
+        })
+      //经办人
+      getstaff({ compId: sessionStorage.getItem('ws-pf_compId') })
+        .toPromise()
+        .then((response) => {
+          this.options = response
+          this.staffList = response
+          //  this.agent = response
         })
     },
     selecttaskType(e) {
@@ -921,6 +1033,7 @@ export default {
         type: 'xls',
       })
     },
+
     // deletecontract(){},
     //删除
     approve() {},
@@ -985,15 +1098,15 @@ export default {
 /deep/.el-form-item__label {
   width: 160px;
 }
-.inspector{
+.inspector {
   width: 50%;
-} 
+}
 //质检员
 /deep/[data-v-58803672] .el-form-item__label {
-    width: 60px;
+  width: 60px;
 }
 [data-v-58803672] .el-form-item__label {
-    width: 60px;
+  width: 60px;
 }
 //选填
 /deep/.el-form-item {

+ 40 - 9
src/views/warehouse/warehouseManagementPut.vue

@@ -111,18 +111,20 @@
 
           <!--经办人-->
           <ws-form-item label="经办人" span="1" prop="agent">
-            <ws-select
+            <el-select
               v-model="deptBudgetList.agent"
-              placeholder=""
-              class="typeselect"
+              placeholder="请选择经办人"
+              filterable
+              :filter-method="dataFilter"
+              @change="selectstaff"
             >
-              <ws-option
-                v-for="item in agent"
-                :key="item.constKey"
+              <el-option
+                v-for="item in options"
+                :key="item.value"
                 :label="item.staffName"
                 :value="item.staffName"
               />
-            </ws-select>
+            </el-select>
           </ws-form-item>
           <!--出库日期-->
           <ws-form-item
@@ -369,7 +371,9 @@ export default {
       endDate: null,
       goodnameList: {},
       checked: true,
-      agent:[],
+      agent: [],
+      staffList: [],
+      options: [],
 
       outContractNo: [],
 
@@ -439,6 +443,31 @@ export default {
     revert() {
       this.$router.push({ path: 'warehouseManagementList' })
     },
+    dataFilter(val) {
+      // console.log(val,"名")
+      this.deptBudgetList.staffList = val
+      if (val) {
+        //val存在
+        this.options = this.staffList.filter((item) => {
+          if (
+            !!~item.staffName.indexOf(val) ||
+            !!~item.staffName.toUpperCase().indexOf(val.toUpperCase())
+          ) {
+            return true
+          }
+        })
+      } else {
+        //val为空时,还原数组
+        this.options = this.staffList
+      }
+    },
+    selectstaff(e) {
+      for (var i = 0; i < this.staffList.length; i++) {
+        if (this.staffList[i].staffName == e) {
+          this.deptBudgetList.personChargeKey = this.staffList[i].staffId
+        }
+      }
+    },
     //提交按钮
     submit() {
       if (!this.deptBudgetList.goodsName) {
@@ -1208,7 +1237,9 @@ export default {
       getstaff({ compId: sessionStorage.getItem('ws-pf_compId') })
         .toPromise()
         .then((response) => {
-          this.agent = response
+          this.options = response
+           this.staffList = response
+          //  this.agent = response
         })
     },
     selecttaskType(e) {