ccjgmwz 3 years ago
parent
commit
0fb9714de9
1 changed files with 39 additions and 4 deletions
  1. 39 4
      src/views/taskManagement/tranManagementWarehouseInOutTaskAdd.vue

+ 39 - 4
src/views/taskManagement/tranManagementWarehouseInOutTaskAdd.vue

@@ -281,12 +281,13 @@
               v-model="dataList1.warehouseName"
               placeholder="请选择仓库名"
               class="typeselect"
+              @change="selectwarehouseName1"
             >
               <el-option
                 v-for="item in warehouseNameList"
                 :key="item.constKey"
                 :label="item.warehouseName"
-                :value="item.warehouseName"
+                :value="item.id"
               />
             </el-select>
           </el-form-item>
@@ -458,11 +459,11 @@
               v-model="dataList1.agent"
               placeholder="请选择经办人"
               filterable
-              :filter-method="dataFilter"
+              :filter-method="dataFilter1"
               @change="selectstaff1"
             >
               <el-option
-                v-for="item in options"
+                v-for="item in options1"
                 :key="item.value"
                 :label="item.staffName"
                 :value="item.staffName"
@@ -786,9 +787,10 @@ export default {
       goodnameList: [],
       checked: true,
       form: {},
-
       staffList: [],
+      staffList1: [],
       options: [],
+      options1: [],
       storageType: [],
       storageType1: [],
       outContractNo: [],
@@ -918,6 +920,24 @@ return Num
         this.options = this.staffList
       }
     },
+    dataFilter1(val) {
+      // console.log(val,"名")
+      this.deptBudgetList.staffList1 = val
+      if (val) {
+        //val存在
+        this.options = this.staffList1.filter((item) => {
+          if (
+            !!~item.staffName.indexOf(val) ||
+            !!~item.staffName.toUpperCase().indexOf(val.toUpperCase())
+          ) {
+            return true
+          }
+        })
+      } else {
+        //val为空时,还原数组
+        this.options1 = this.staffList1
+      }
+    },
     weightchange(e) {
       if (this.dataList.taskTypeKey == 4) {
         this.$set(this.dataList, 'weight', e)
@@ -991,6 +1011,21 @@ return Num
         }
       }
     },
+    selectwarehouseName1(e) {
+      for(var i=0;i<this.warehouseNameList.length;i++){
+        if(this.warehouseNameList[i].id == e){
+          this.dataList1.warehouseName = this.warehouseNameList[i].warehouseName
+          //经办人
+          getstaff({ compId: sessionStorage.getItem('ws-pf_compId') ,warehouseId:e})
+            .toPromise()
+            .then((response) => {
+              this.options1 = response
+              this.staffList1 = response
+              //  this.agent = response
+            })
+        }
+      }
+    },
     changecontract1(e) {
       if (this.dataList1.taskTypeKey != 3) {
         for (let i = 0; i < this.contractNoList.length; i++) {