Ver código fonte

更新搜索条件

002390 2 anos atrás
pai
commit
409070b8de

+ 1 - 0
src/components/popover-select/index.vue

@@ -81,6 +81,7 @@ export default {
   },
   components: {},
   data() {
+    console.log(this.$props.queryParams,'queryParams----------');
     return {
       width: "50%",
       page: { pageNum: 1, pageSize: 25, total: 0 },

+ 2 - 1
src/views/purchase/purchase-order/add/index.vue

@@ -80,6 +80,7 @@ export default {
   },
   methods: {
     beforeOpen() {
+      this.$refs['orderAddForm'].clearValidate();
       const { deptName, deptId, name, nickName, orgName, orgId } = this.$store.state.user;
       this.params.puOrg = orgId;
       this.params.puOrgName = orgName;
@@ -285,7 +286,7 @@ export default {
       }
     },
 
-    // 下框选择改变
+    // 下框选择改变
     handleChangeSelect(val,typeName){
       if(val === 'billType'){
        this.params['billTypeName'] = this.dict.type[typeName].find(item => item.value == this.params[val]).label;

+ 142 - 5
src/views/purchase/purchase-order/column.js

@@ -8,14 +8,14 @@ import {
 export const TableColumns = [
   // { key: "id", title: "主键" },
   // { key: "puOrg", title: "采购组织" },
-  { key: "puOrgName", title: "采购组织名称", search: true, inputType: "Input" },
+  { key: "puOrgName", title: "采购组织", inputType: "Input" },
   {
     key: "billType",
     title: "订单类型",
     inputType: "Select",
     referName: "sys_order_type",
   },
-  { key: "code", title: "订单编号", search: true, inputType: "Input" },
+  { key: "code", title: "订单编号",  inputType: "Input" },
   {
     key: "status",
     title: "单据状态",
@@ -25,7 +25,7 @@ export const TableColumns = [
   },
   { key: "billDate", title: "订单日期" },
   // { key: "supplier", title: "供应商" },
-  { key: "supplierName", title: "供应商", search: true, inputType: "Input" },
+  { key: "supplierName", title: "供应商", inputType: "Input" },
   { key: "paymentAgreementName", title: "付款协议" },
   // { key: "paymentAgreement", title: "付款协议" },
   // { key: "currency", title: "币种" },
@@ -295,9 +295,144 @@ export const TabColumns = [
   },
 ];
 
-export const SearchColumns = TableColumns.filter((element) => element.search);
+// export const SearchColumns = TableColumns.filter((element) => element.search);
+export const SearchColumns = [
+  {
+    key: "source",
+    title: "订单来源",  
+    inputType: "Select",
+    referName: "order_source", // 字典名
+    clearable:true,
+  },
+  {
+    key: "code",
+    title: "订单编号",  
+    inputType: "Input",
+    clearable:true,
+  },
+  {
+    key: "date",
+    title: "订单日期",  
+    type: "daterange",
+    inputType: "DatePicker",
+    unlinkPanels: true,
+    rangeSeparator: "至",
+    valueFormat: "yyyy-MM-dd",
+    endPlaceholder: "结束日期",
+    startPlaceholder: "开始日期",
+    clearable:true,
+  },
+  {
+    key: "status",
+    title: "单据状态",
+    inputType: "Select",
+    referName: "documents_status", // 字典名
+    clearable:true,
+  },
+  { 
+    key: "supplierName", 
+    title: "供应商", 
+    inputType: "PopoverSelect",
+    valueKey: "id",
+    referName: "SUPPLIER_PARAM",
+    dataMapping: {
+      // supplier: "id",
+      supplierName: "name",
+    },
+    queryParams: () => ({}),
+    clearable:true,
+  },
+  {
+    key: "puOrgIds",
+    title: "采购组织",
+    inputType: "PopoverSelect",
+    multiple:true,
+    valueKey: "id",
+    referName: "ORG_PARAM",
+    dataMapping: {},
+    queryParams: () => ({}),
+    clearable:true,
+  },
+  {
+    key: "materialCode",
+    title: "物料编码",
+    inputType: "PopoverSelect",
+    valueKey: "code",
+    referName: "MATERIAL_PARAM",
+    dataMapping: {},
+    queryParams: () => ({}),
+    clearable:true,
+  },
+  {
+    key: "materialName",
+    title: "物料名称",
+    inputType: "PopoverSelect",
+    valueKey: "name",
+    referName: "MATERIAL_PARAM",
+    dataMapping: {},
+    queryParams: () => ({}),
+    clearable:true,
+  },
+  { 
+    key: "deliveryStatus",
+    title: "erp发送状态", 
+    inputType: "Select",
+    referName: "order_delivery_status", // 字典名
+    clearable:true,
+  },
+  { 
+    key: "contractNo",
+    title: "合同号", 
+    inputType: "Input",
+    clearable:true,
+  },
+  {
+    key: "projectNowName",
+    title: "在建工程项目",
+    inputType: "PopoverSelect",
+    require: true,
+    valueKey: "name",
+    referName: "PROJECT_PARAM",
+    dataMapping: {},
+    queryParams: () => ({}),
+    clearable:true,
+  },
+  {
+    key: "buyers",
+    title: "采购员",
+    inputType: "PopoverSelect",
+    multiple:true,
+    valueKey: "code",
+    referName: "CONTACTS_PARAM",
+    dataMapping: {},
+    queryParams: () => ({}),
+    clearable:true,
+  },
+  {
+    key: "billTypes",
+    title: "订单类型",
+    inputType: "Select",
+    referName: "sys_order_type", // 字典名
+    multiple:true,
+    tags:true,
+    clearable:true,
+  },
+  { 
+    key: "demandCode",
+    title: "采购需求单号", 
+    inputType: "Input",
+    clearable:true,
+  },
+  { 
+    key: "isDrug",
+    title: "物料药品属性", 
+    inputType: "SelectCheck",
+    clearable:true,
+  },
+];
 
 const NewColumns = initColumns(TableColumns);
+const NewSearchColumns = initColumns(SearchColumns);
 const NewTabColumns = TabColumns.map((element) => ({
   ...element,
   tableColumns: initColumns(element.tableColumns),
@@ -307,4 +442,6 @@ export const SelectColumns = NewColumns.filter(column => column.inputType === 'S
 
 NewTabColumns.forEach(column => {
   SelectColumns.push(...column.tableColumns.filter(cColumn => cColumn.inputType === 'Select'))
-});
+});
+
+SelectColumns.push(...NewSearchColumns.filter(column => column.inputType === 'Select'))

+ 0 - 1
src/views/purchase/purchase-order/components/FileUploadCenter/index.vue

@@ -73,7 +73,6 @@ export default {
     }
   },
   data() {
-    console.log(process.env, 'process.env');
     return {
       number: 0,
       uploadList: [],

+ 7 - 0
src/views/purchase/purchase-order/edit/index.vue

@@ -220,6 +220,12 @@ export default {
     handleIsRevise(status) {
       return status == '2';
     },
+     // 下拉框选择改变
+     handleChangeSelect(val,typeName){
+      if(val === 'billType'){
+       this.params['billTypeName'] = this.dict.type[typeName].find(item => item.value == this.params[val]).label;
+      }
+    },
   },
   created() {
     console.log("EDIT CREATED");
@@ -316,6 +322,7 @@ export default {
                 :clearable="column.clearable" 
                 :placeholder="column.placeholder" 
                 style="width: 100%"
+                @change="handleChangeSelect(column.key,column.referName)"
                 >
                 <el-option 
                   v-for="item in dict.type[column.referName]" 

+ 72 - 6
src/views/purchase/purchase-order/index.vue

@@ -86,6 +86,12 @@ export default {
     },
     // 查询操作
     handleQueryList() {
+      console.log(this.params,'this.params---------------------');
+      let {date} = this.params;
+      if(date){
+        this.params.startDate = date[0];
+        this.params.endDate = date[1];
+      }
       this.fetchList(this.params, this.page);
     },
     // 重置操作
@@ -317,16 +323,76 @@ export default {
       :model="params" 
       style="padding: 20px 0 0 0"
     >
-      <el-row :gutter="24" style="display:flex; flex-wrap: wrap;">
+      <el-row :gutter="24" >
         <el-col :span="20">
-          <el-row :gutter="20">
+          <el-row :gutter="20" style="display:flex; flex-wrap: wrap;">
             <el-col 
               v-for="column in showSearchColumns" 
               :key="column.title" 
               :xl="6" :lg="6" :md="8" :sm="12" :xs="24"
             >
               <el-form-item :prop="column.key" :label="column.title">
-                <el-input v-model="params[column.key]" :placeholder="column.placeholder"></el-input>
+
+                <el-input v-if="column.inputType === 'Input'" 
+                  v-model="params[column.key]" 
+                  :placeholder="column.placeholder"
+                ></el-input>
+                <dr-popover-select v-if="column.inputType === 'PopoverSelect'"
+                  v-model="params[column.key]"
+                  :source.sync="params"
+                  :title="column.title"
+                  :type="column.referName"
+                  :multiple="column.multiple"
+                  :readonly="column.readonly"
+                  :value-key="column.valueKey"
+                  :placeholder="column.placeholder"
+                  :data-mapping="column.dataMapping"
+                  :query-params="column.queryParams(params)"
+                ></dr-popover-select>
+                <!-- @keyup.enter.native="useQuery(params, page)" -->
+
+                <el-select v-if="column.inputType === 'Select'" 
+                v-model="params[column.key]" 
+                :disabled="column.disabled"
+                :clearable="column.clearable" 
+                :placeholder="column.placeholder" 
+                :multiple="column.multiple"
+                :collapse-tags="column.tags"
+                style="width: 100%"
+                >
+                <el-option 
+                  v-for="item in dict.type[column.referName]" 
+                  :key="item.value" 
+                  :label="item.label"
+                  :value="item.value"
+                  ></el-option>
+              </el-select>
+              <!-- 只有是否 -->
+              <el-select v-if="column.inputType === 'SelectCheck'" 
+                v-model="params[column.key]" 
+                :disabled="column.disabled"
+                :clearable="column.clearable" 
+                :placeholder="column.placeholder" 
+                style="width: 100%"
+                >
+                <el-option key="N" label="否" value="N"></el-option>
+                <el-option key="Y" label="是" value="Y"></el-option>
+              </el-select>
+
+              <el-date-picker v-if="column.inputType === 'DatePicker'" 
+                v-model="params[column.key]"
+                size="mini"
+                type="daterange"
+                :value-format="column.valueFormat"
+                :unlink-panels="column.unlinkPanels"
+                :picker-options="column.pickerOptions"
+                :range-separator="column.rangeSeparator"
+                :end-placeholder="column.endPlaceholder"
+                :start-placeholder="column.startPlaceholder"
+                :clearable="column.clearable"
+                style="width: 100%"
+              >
+              </el-date-picker>
               </el-form-item>
             </el-col>
           </el-row>
@@ -339,10 +405,10 @@ export default {
       </el-row>
     </el-form>
 
-    <!-- <el-divider>
+    <el-divider>
       <i :class="isSimpleSearch ? 'el-icon-arrow-down' : 'el-icon-arrow-up'" style="cursor: pointer"
         @click="handleSearchChange"></i>
-    </el-divider> -->
+    </el-divider>
 
     <!-- 操作 -->
     <el-row :gutter="24" style="padding: 0 20px">
@@ -395,7 +461,7 @@ export default {
       >
 
         <template slot-scope="scope">
-          <dict-tag v-if="column.referName" 
+          <dict-tag v-if="column.inputType === 'Select'" 
             size="small" 
             :value="scope.row[column.key]"
             :options="dict.type[column.referName]"