chenrui hai 1 ano
pai
achega
22593cb21c
Modificáronse 1 ficheiros con 41 adicións e 2 borrados
  1. 41 2
      src/views/purchasingManagement/purchaseOutOfStock/list.vue

+ 41 - 2
src/views/purchasingManagement/purchaseOutOfStock/list.vue

@@ -17,7 +17,17 @@
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="供应商名称">
-                <a-input id="outOfStockList-purchaseTargetName" v-model.trim="queryParam.purchaseTargetName" placeholder="请输入客户名称" allowClear />
+                <a-select
+                  id="outOfStockList-purchaseTargetSn"
+                  placeholder="请选择供应商"
+                  allowClear
+                  v-model="queryParam.purchaseTargetSn"
+                  :showSearch="true"
+                  option-filter-prop="children"
+                  :filter-option="filterOption"
+                  @change="tragetTypeChange">
+                  <a-select-option v-for="item in supplierList" :pyCode="item.pyCode" :key="item.purchaseTargetSn" :value="item.purchaseTargetSn">{{ item.purchaseTargetName }}</a-select-option>
+                </a-select>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
@@ -83,6 +93,7 @@ import { outOfStockList, outOfStockExportDetail, outOfStockQueryCount } from '@/
 import custList from '@/views/common/custList.vue'
 import detailModal from './detailModal.vue'
 import { downloadExcel } from '@/libs/JGPrint.js'
+import { queryReturnSupplierList } from '@/api/purchaseReturn'
 export default {
   name: 'PurchaseOutOfStock',
   components: { STable, VSelect, rangeDate, custList, detailModal },
@@ -93,9 +104,11 @@ export default {
       queryParam: { //  查询条件
         beginDate: undefined,
         endDate: undefined,
-        purchaseTargetName: '',
+        purchaseTargetSn: undefined,
+        purchaseTargetType: undefined,
         purchaseBillNo: ''
       },
+      supplierList: [],
       detailObj: undefined, // 详情统计内容
       openModal: false,
       disabled: false, //  查询、重置按钮是否可操作
@@ -142,6 +155,31 @@ export default {
     }
   },
   methods: {
+    // 获取供应商数据
+    getSupperList () {
+      queryReturnSupplierList({}).then(res => {
+        if (res.status == 200) {
+          this.supplierList = res.data
+        } else {
+          this.supplierList = []
+        }
+      })
+    },
+    // 供应商change
+    tragetTypeChange (val) {
+      const ind = this.supplierList.findIndex(item => item.purchaseTargetSn == val)
+      if (ind != -1) {
+        this.queryParam.purchaseTargetType = this.supplierList[ind].purchaseTargetType
+      } else {
+        this.queryParam.purchaseTargetSn = undefined
+        this.queryParam.purchaseTargetType = undefined
+      }
+    },
+    filterOption (input, option) {
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
+    },
     // 统计
     getCount (params) {
       outOfStockQueryCount(params).then(res => {
@@ -195,6 +233,7 @@ export default {
         _this.setTableH()
       })
       _this.resetSearchForm()
+      _this.getSupperList()
     },
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight