Browse Source

采购需求汇总搜索区参照

黄梓星 2 years ago
parent
commit
818e5bbdbf
1 changed files with 169 additions and 119 deletions
  1. 169 119
      src/views/purchase/DemandSummary/index.vue

+ 169 - 119
src/views/purchase/DemandSummary/index.vue

@@ -21,7 +21,7 @@
           <el-col :span="1.5">
             <el-form-item label="品类">
               <el-select
-              v-model="queryParams.manufacturer"
+              v-model="queryParams.materialName"
               size="small"
               clearable
               @focus="chooseTreeRefer('MATERIALCLASSIFY_PARAM', false, '选择品类')"
@@ -34,9 +34,8 @@
           <el-col :span="1.5">
             <el-form-item label="生产厂家">
               <el-input
-              v-model="queryParams.sccj"
+              v-model="queryParams.manufacturer"
               size="small"
-              placeholder=""
               clearable
               style="width: 200px"
               />
@@ -44,8 +43,8 @@
           </el-col>
           <el-col :span="1.5">
             <el-form-item label="" label-width="20px">
-              <el-button type="primary" size="small" icon="el-icon-search" plain>搜索</el-button>
-              <el-button size="small" icon="el-icon-refresh" plain>重置</el-button>
+              <el-button type="primary" size="small" icon="el-icon-search" plain @click="search">搜索</el-button>
+              <el-button size="small" icon="el-icon-refresh" plain @click="reset">重置</el-button>
             </el-form-item>
           </el-col>
         </el-row>
@@ -54,55 +53,41 @@
         <div v-show="expanded">
           <el-row :gutter="10">
             <el-col :span="1.5">
-              <el-form-item label="物料类别">
-                <el-select v-model="queryParams.wllb" size="small" style="width: 200px" clearable>
+              <el-form-item label="预测分类">
+                <el-select v-model="queryParams.forecastClassification" size="small" style="width: 200px" clearable>
                   <el-option
-                    v-for="item in options"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value">
+                    v-for="dict in dict.type.predictive_classify" :key="dict.value" :label="dict.label" :value="dict.value">
                   </el-option>
                 </el-select>
               </el-form-item>
             </el-col>
             <el-col :span="1.5">
               <el-form-item label="周期单位">
-                <el-select v-model="queryParams.zqdw" size="small" style="width: 200px" clearable>
+                <el-select v-model="queryParams.periodUnit" size="small" style="width: 200px" clearable>
                   <el-option
-                    v-for="item in options"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value">
+                    v-for="dict in dict.type.sys_period_unit" :key="dict.value" :label="dict.label" :value="dict.value">
                   </el-option>
                 </el-select>
               </el-form-item>
             </el-col>
             <el-col :span="1.5">
               <el-form-item label="业务部门">
-                <el-input
-                v-model="queryParams.ywbm"
-                size="small"
-                placeholder=""
-                clearable
-                style="width: 200px"
-                />
+                <el-select size="small" v-model="queryParams.departmentName" @focus="chooseRefer('DEPT_PARAM', true, '业务部门')" style="width: 200px">
+                  <el-option v-for="item in deptOptions" :key="item.id" :label="item.name" :value="item.id" />
+                </el-select>
               </el-form-item>
             </el-col>
             <el-col :span="1.5">
               <el-form-item label="审核人">
-                <el-input
-                v-model="queryParams.shr"
-                size="small"
-                placeholder=""
-                clearable
-                style="width: 200px"
-                />
+                <el-select size="small" v-model="queryParams.puManagerAuditor" @focus="chooseRefer('CONTACTS_PARAM', true, '审核人')" style="width: 200px">
+                  <el-option v-for="item in auditOptions" :key="item.id" :label="item.name" :value="item.id" />
+                </el-select>
               </el-form-item>
             </el-col>
           </el-row>
 
           <el-row :gutter="10">
-            <el-col :span="1.5">
+            <!-- <el-col :span="1.5">
               <el-form-item label="转请购单号">
                 <el-input
                 v-model="queryParams.zqgdh"
@@ -112,11 +97,11 @@
                 style="width: 200px"
                 />
               </el-form-item>
-            </el-col>
+            </el-col> -->
             <el-col :span="1.5">
               <el-form-item label="采购需求单号">
                 <el-input
-                v-model="queryParams.cgxqdh"
+                v-model="queryParams.code"
                 size="small"
                 placeholder=""
                 clearable
@@ -127,7 +112,7 @@
             <el-col :span="1.5">
               <el-form-item label="注册人">
                 <el-input
-                v-model="queryParams.zcr"
+                v-model="queryParams.registrant"
                 size="small"
                 placeholder=""
                 clearable
@@ -137,12 +122,9 @@
             </el-col>
             <el-col :span="1.5">
               <el-form-item label="业务类型">
-                <el-select v-model="queryParams.ywlx" size="small" style="width: 200px" clearable>
+                <el-select v-model="queryParams.businessType" size="small" style="width: 200px" clearable>
                   <el-option
-                    v-for="item in options"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value">
+                    v-for="dict in dict.type.sys_business" :key="dict.value" :label="dict.label" :value="dict.value">
                   </el-option>
                 </el-select>
               </el-form-item>
@@ -152,46 +134,31 @@
           <el-row :gutter="10">
             <el-col :span="1.5">
               <el-form-item label="单据来源">
-                <el-input
-                v-model="queryParams.zqgdh"
-                size="small"
-                placeholder=""
-                clearable
-                style="width: 200px"
-                />
+                <el-select v-model="queryParams.billSource" size="small" style="width: 200px" clearable>
+                  <el-option
+                    v-for="dict in dict.type.sys_bill_source" :key="dict.value" :label="dict.label" :value="dict.value">
+                  </el-option>
+                </el-select>
               </el-form-item>
             </el-col>
             <el-col :span="1.5">
               <el-form-item label="需求客户">
-                <el-input
-                v-model="queryParams.cgxqdh"
-                size="small"
-                placeholder=""
-                clearable
-                style="width: 200px"
-                />
+                <el-select size="small" v-model="queryParams.customer" @focus="chooseRefer('CUSTOMER_PARAM', true, '需求客户')" style="width: 200px">
+                  <el-option v-for="item in customerOptions" :key="item.id" :label="item.name" :value="item.id" />
+                </el-select>
               </el-form-item>
             </el-col>
             <el-col :span="1.5">
               <el-form-item label="末级供应仓库">
-                <el-input
-                v-model="queryParams.zcr"
-                size="small"
-                placeholder=""
-                clearable
-                style="width: 200px"
-                />
+                <el-select size="small" v-model="queryParams.lastWarehouse" @focus="chooseRefer('WAREHOUSE_PARAM', true, '末级供应仓库')" style="width: 200px">
+                  <el-option v-for="item in lastWarehouseOptions" :key="item.id" :label="item.name" :value="item.id" />
+                </el-select>
               </el-form-item>
             </el-col>
             <el-col :span="1.5">
               <el-form-item label="末级供应库位">
-                <el-select v-model="queryParams.ywlx" size="small" style="width: 200px" clearable>
-                  <el-option
-                    v-for="item in options"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value">
-                  </el-option>
+                <el-select size="small" v-model="queryParams.lastAllocation" @focus="chooseRefer('ALLOCATION_PARAM', true, '末级供应库位')" style="width: 200px">
+                  <el-option v-for="item in lastAllocationOptions" :key="item.id" :label="item.name" :value="item.id" />
                 </el-select>
               </el-form-item>
             </el-col>
@@ -200,38 +167,32 @@
           <el-row :gutter="10">
             <el-col :span="1.5">
               <el-form-item label="物料编码">
-                <el-input
-                v-model="queryParams.zqgdh"
-                size="small"
-                placeholder=""
-                clearable
-                style="width: 200px"
-                />
+                <el-input readonly size="small" v-model="queryParams.names" style="width: 200px">
+                  <el-button size="small" slot="append" icon="el-icon-more" @click="chooseMaterial"></el-button>
+                </el-input>
+                <el-input v-show="false" v-model="queryParams.materialCode"></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="1.5">
               <el-form-item label="默认采购组织">
-                <el-input
-                v-model="queryParams.cgxqdh"
-                size="small"
-                placeholder=""
-                clearable
-                style="width: 200px"
-                />
+                <el-select size="small" v-model="queryParams.purchaseOrg" @focus="chooseRefer('ORG_PARAM', true, '默认采购组织')" style="width: 200px">
+                  <el-option v-for="item in orgOptions" :key="item.id" :label="item.name" :value="item.id" />
+                </el-select>
               </el-form-item>
             </el-col>
             <el-col :span="1.5">
               <el-form-item label="需求日期">
-                <el-input
-                v-model="queryParams.zcr"
-                size="small"
-                placeholder=""
-                clearable
-                style="width: 200px"
-                />
+                <el-date-picker
+                  v-model="queryParams.demandDate"
+                  type="date"
+                  value-format="yyyy-MM-dd"
+                  size="small"
+                  style="width: 200px"
+                >
+                </el-date-picker>
               </el-form-item>
             </el-col>
-            <el-col :span="1.5">
+            <!-- <el-col :span="1.5">
               <el-form-item label="转请购时间">
                 <el-select v-model="queryParams.ywlx" size="small" style="width: 200px" clearable>
                   <el-option
@@ -242,30 +203,32 @@
                   </el-option>
                 </el-select>
               </el-form-item>
-            </el-col>
+            </el-col> -->
           </el-row>
 
           <el-row :gutter="10">
             <el-col :span="1.5">
               <el-form-item label="汇总审核时间">
-                <el-input
-                v-model="queryParams.zqgdh"
-                size="small"
-                placeholder=""
-                clearable
-                style="width: 200px"
-                />
+                <el-date-picker
+                  v-model="queryParams.auditTime"
+                  type="date"
+                  value-format="yyyy-MM-dd"
+                  size="small"
+                  style="width: 200px"
+                >
+                </el-date-picker>
               </el-form-item>
             </el-col>
             <el-col :span="1.5">
               <el-form-item label="汇总确认时间">
-                <el-input
-                v-model="queryParams.cgxqdh"
-                size="small"
-                placeholder=""
-                clearable
-                style="width: 200px"
-                />
+                <el-date-picker
+                  v-model="queryParams.yesTime"
+                  type="date"
+                  value-format="yyyy-MM-dd"
+                  size="small"
+                  style="width: 200px"
+                >
+                </el-date-picker>
               </el-form-item>
             </el-col>
           </el-row>
@@ -293,7 +256,7 @@
             </el-dropdown-menu>
           </el-dropdown>
 
-          <el-button type="primary" size="small">转请购</el-button>
+          <!-- <el-button type="primary" size="small">转请购</el-button> -->
         </div>
         <el-table 
           :data="tableList" 
@@ -399,6 +362,8 @@
     <Refers ref="refer" @doSubmit="selectionsToInput" :single="true"/>
 
     <TreeRefers ref="tree" @doSubmit="selectionsToInput2" :single="true"/>
+
+    <popDialog ref="materialRefer" @doSubmit="selectMaterial" :single="true" />
   </div>
 </template>
 
@@ -406,16 +371,18 @@
 import Add from './add.vue'
 import Refers from '@/components/Refers/refers.vue'
 import TreeRefers from '@/components/Refers/treeRefer.vue'
+import popDialog from '@/components/PopDialog/index.vue'
 import CollapseTransition from '@/components/MyCollapse/collapse.vue'
 import {getSummaryList, auditSummary, confirmSummary , cancelSummary , cancelAuditSummary, editSummaryList } from '@/api/purchase/DemandSummary.js'
 export default {
   name: 'demandSummary',
-  dicts: ['sys_row_status'],
+  dicts: ['sys_row_status', 'predictive_classify', 'sys_period_unit', 'sys_business', 'sys_bill_source'],
   components: {
     Add,
     CollapseTransition,
     Refers,
-    TreeRefers
+    TreeRefers,
+    popDialog
   },
   data() {
     return {
@@ -427,21 +394,37 @@ export default {
       queryParams: {
         rowStatus: [],
         buyerName: '',
+        materialName: '',
         manufacturer: '',
-        sccj: '',
-        wllb: '',
-        zqdw: '',
-        ywbm: '',
-        shr: '',
-        zqgdh: '',
-        cgxqdh: '',
-        zcr: '',
-        ywlx: '',
+        forecastClassification: '',
+        periodUnit: '',
+        departmentName: '',
+        puManagerAuditor: '',
+        // zqgdh: '',
+        code: '',
+        registrant: '',
+        businessType: '',
+        billSource: '',
+        customer: '',
+        lastWarehouse: '',
+        lastAllocation: '',
+        materialCode: '',
+        names: '',
+        purchaseOrg: '',
+        demandDate: '',
+        auditTime: '',
+        yesTime: '',
         pageNum: 1,
         pageSize: 10
       },
       personOptions: [],
       classOptions: [],
+      deptOptions: [],
+      auditOptions: [],
+      customerOptions: [],
+      lastWarehouseOptions: [],
+      lastAllocationOptions: [],
+      orgOptions: [],
       options: [{
         value: '0', label: '是',
       }, {
@@ -465,6 +448,39 @@ export default {
     this.getList(this.queryParams)
   },
   methods: {
+    // 搜索
+    search() {
+      this.getList(this.queryParams)
+    },
+    reset() {
+      this.queryParams = {
+        rowStatus: [],
+        buyerName: '',
+        materialName: '',
+        manufacturer: '',
+        forecastClassification: '',
+        periodUnit: '',
+        departmentName: '',
+        puManagerAuditor: '',
+        // zqgdh: '',
+        code: '',
+        registrant: '',
+        businessType: '',
+        billSource: '',
+        customer: '',
+        lastWarehouse: '',
+        lastAllocation: '',
+        materialCode: '',
+        names: '',
+        purchaseOrg: '',
+        demandDate: '',
+        auditTime: '',
+        yesTime: '',
+        pageNum: 1,
+        pageSize: 10
+      }
+      this.getList(this.queryParams)
+    },
     getList(params){
       getSummaryList(params).then(res => {
         if (res.code === 200) {
@@ -571,8 +587,34 @@ export default {
       this.$refs.refer.init(this.referCondition)
     },
     selectionsToInput(selection) {
-      this.personOptions = selection
-      this.queryParams.buyerName = selection[0].id
+      if (this.referCondition.title == '采购员') {
+        this.personOptions = selection
+        this.queryParams.buyerName = selection[0].id
+      }
+      if (this.referCondition.title == '业务部门') {
+        this.deptOptions = selection
+        this.queryParams.departmentName = selection[0].id
+      }
+      if (this.referCondition.title == '审核人') {
+        this.auditOptions = selection
+        this.queryParams.puManagerAuditor = selection[0].id
+      }
+      if (this.referCondition.title == '需求客户') {
+        this.customerOptions = selection
+        this.queryParams.customer = selection[0].id
+      }
+      if (this.referCondition.title == '末级供应仓库') {
+        this.lastWarehouseOptions = selection
+        this.queryParams.lastWarehouse = selection[0].id
+      }
+      if (this.referCondition.title == '末级供应库位') {
+        this.lastAllocationOptions = selection
+        this.queryParams.lastAllocation = selection[0].id
+      }
+      if (this.referCondition.title == '默认采购组织') {
+        this.orgOptions = selection
+        this.queryParams.purchaseOrg = selection[0].id
+      }
     },
     // 搜索区树形选择
     chooseTreeRefer(type, isPage, title) {
@@ -583,7 +625,15 @@ export default {
     },
     selectionsToInput2(selection) {
       this.classOptions.push(selection)
-      this.queryParams.manufacturer = selection.id
+      this.queryParams.materialName = selection.id
+    },
+    // 搜索区物料编码
+    chooseMaterial() {
+      this.$refs.materialRefer.init()
+    },
+    selectMaterial(selection) {
+      this.queryParams.materialCode = selection[0].id
+      this.queryParams.names = selection[0].name
     }
   }
 }