Prechádzať zdrojové kódy

筛选,多选和时间区间查询实现

fangq 4 rokov pred
rodič
commit
a2ae5be605

+ 9 - 0
src/api/bank/keypwd.js

@@ -59,3 +59,12 @@ export const getByCategoryAndType = (category, orgNo) => {
   })
 }
 
+export const getKeyType = () => {
+  return request({
+    url: '/api/blade-system/dict/dictionary?code=key_type',
+    method: 'get',
+    params: {
+    }
+  })
+}
+

+ 0 - 11
src/api/bank/message.js

@@ -47,14 +47,3 @@ export const update = (row) => {
     data: row
   })
 }
-
-
-export const getDeptTree = (tenantId) => {
-  return request({
-    url: '/api/blade-system/expand/dept/tree',
-    method: 'get',
-    params: {
-      tenantId,
-    }
-  })
-}

+ 1 - 1
src/api/desk/notice.js

@@ -2,7 +2,7 @@ import request from '@/router/axios';
 
 export const getList = (current, size, params) => {
   return request({
-    url: '/api/blade-desk/notice/page',
+    url: '/api/blade-desk/notice/list',
     method: 'get',
     params: {
       ...params,

+ 10 - 0
src/api/system/dept.js

@@ -58,6 +58,7 @@ export const getDept = (id) => {
     }
   })
 }
+/*
 
 export const getDeptTree = (tenantId) => {
   return request({
@@ -68,6 +69,7 @@ export const getDeptTree = (tenantId) => {
     }
   })
 }
+*/
 
 export const getDeptLazyTree = (parentId) => {
   return request({
@@ -88,3 +90,11 @@ export const getCurrentDept = () => {
   })
 }
 
+export const getDeptTree = () => {
+  return request({
+    url: '/api/blade-system/expand/dept/tree',
+    method: 'get',
+    params: {
+    }
+  })
+}

+ 111 - 31
src/views/bank/keypwd.vue

@@ -11,6 +11,7 @@
                @row-update="rowUpdate"
                @row-save="rowSave"
                @row-del="rowDel"
+               :search.sync="search"
                @search-change="searchChange"
                @search-reset="searchReset"
                @selection-change="selectionChange"
@@ -33,21 +34,33 @@
       <template slot="handoverPersonNameForm">
         <select-dialog-user :name="form.handoverPersonName" :ehr="form.handoverPersonNo" :disabled="disabeldHandover" :callback="handoverSelectCallback"></select-dialog-user>
       </template>
+
+      <template slot-scope="{disabled,size}" slot="categorySearch">
+        <avue-input-tree :check-strictly="true" multiple v-model="search.category" placeholder="请选择内容" type="tree" :dic="typeList" :props="props"></avue-input-tree>
+      </template>
     </avue-crud>
   </basic-container>
 </template>
 
 <script>
-  import {getList, getDetail, add, update, remove, getByCategoryAndType} from "@/api/bank/keypwd";
+  import {getList, getDetail, add, update, remove, getByCategoryAndType, getKeyType} from "@/api/bank/keypwd";
   import {mapGetters} from "vuex";
   import {dateFormat} from "../../util/date";
   import SelectDialogUser from "../../components/select-dialog/select-dialog-user";
   import { getCurrentDept } from "@/api/system/dept";
+  import {getDeptTree} from "@/api/system/dept";
 
   export default {
     components: {SelectDialogUser},
     data() {
       return {
+        search: {},
+        typeList: [],
+        props:{
+          label: "dictValue",
+          value: "dictKey",
+        },
+
         form: {},
         query: {},
         loading: true,
@@ -79,6 +92,8 @@
               label: "銀行號",
               prop: "bankNo",
               disabled: true,
+              search: true,
+              searchSpan: 4,
               rules: [{
                 required: true,
                 message: "请输入銀行號",
@@ -98,41 +113,16 @@
             {
               label: "分類種類",
               prop: "category",
+              search: true,
+              checkStrictly: true,
               type: "tree",
-              dicUrl: "/api/blade-system/dict/dictionary?code=key_type",
+              // dicUrl: "/api/blade-system/dict/dictionary?code=key_type",
+              dicData: [],
               props:{
                 label: "dictValue",
                 value: "dictKey",
               },
-              dicFormatter: (res)=>{
-                let data = res.data;
-                let pid = new Set();
-                for (let i = 0; i < data.length; i++) {
-                  let item = data[i];
-                  pid.add(item.parentId);
-                }
-                let arr = [];
-                pid.forEach(id => {
-                  data.forEach(item => {
-                    if (id == item.id){
-                      arr.push(item)
-                    }
-                  })
-                })
-                arr.forEach(item => {
-                  data.forEach(it => {
-                    if (item.id == it.parentId){
-                      if (!item.children){
-                        item.children = [];
-                      }
-                      it.dictValue = item.dictValue + '-' + it.dictValue;
-                      item.children.push(it)
-                      item.hasChildren = true;
-                    }
-                  })
-                })
-                return arr;
-              },
+              searchslot: true,
               change: ({value, column}) => {
                 if (!value || this.type == 'view' || this.type == 'edit') return;
                 getByCategoryAndType(value, this.form.orgNo).then(res => {
@@ -156,6 +146,44 @@
                 trigger: "blur"
               }]
             },
+            {
+              label: "区域/支行",
+              prop: "orgNos",
+              hide: true,
+              display: false,
+              searchMultiple: true,
+              search: true,
+              type: "tree",
+              dicData: [],
+              props: {
+                label: "title",
+                value: "key"
+              },
+              checkStrictly: true,
+              rules: [{
+                required: true,
+                message: "请输入機構號",
+                trigger: "blur"
+              }]
+            },
+            {
+              label: "交接日期",
+              prop: "handoverDateRange",
+              type: "datetime",
+              format: "yyyy-MM-dd hh:mm",
+              valueFormat: "yyyy-MM-dd hh:mm",
+              searchRange:true,
+              hide: true,
+              addDisplay: false,
+              editDisplay: false,
+              viewDisplay: false,
+              search: true,
+              rules: [{
+                required: true,
+                message: "请输入通知时间",
+                trigger: "blur"
+              }]
+            },
             /*{
               label: "種類",
               prop: "type",
@@ -319,7 +347,48 @@
         return ids.join(",");
       }
     },
+    created() {
+      this.initTypeDict();
+      getDeptTree().then(res => {
+        const column = this.findObject(this.option.column, "orgNos");
+        column.dicData = res.data.data;
+      });
+    },
     methods: {
+      initTypeDict(){
+        getKeyType().then(res => {
+
+          let data = res.data.data;
+          let pid = new Set();
+          for (let i = 0; i < data.length; i++) {
+            let item = data[i];
+            pid.add(item.parentId);
+          }
+          let arr = [];
+          pid.forEach(id => {
+            data.forEach(item => {
+              if (id == item.id){
+                arr.push(item)
+              }
+            })
+          })
+          arr.forEach(item => {
+            data.forEach(it => {
+              if (item.id == it.parentId){
+                if (!item.children){
+                  item.children = [];
+                }
+                it.dictValue = item.dictValue + '-' + it.dictValue;
+                item.children.push(it)
+                item.hasChildren = true;
+              }
+            })
+          })
+          this.typeList = arr;
+          this.findObject(this.option.column, 'category').dicData = arr;
+          return arr;
+        })
+      },
       handoverSelectCallback(value){
         this.form.handoverPersonNo = value.ehr;
         this.form.handoverPersonName = value.name;
@@ -417,6 +486,17 @@
         this.onLoad(this.page);
       },
       searchChange(params, done) {
+        if (params.category){
+          params.category = params.category.join();
+        }
+        if (params.orgNos){
+          params.orgNos = params.orgNos.join();
+        }
+        if (params.handoverDateRange){
+          params.handoverDate_begin = params.handoverDateRange[0], params.handoverDate_end = params.handoverDateRange[1];
+          params.handoverDateRange = null;
+        }
+
         this.query = params;
         this.page.currentPage = 1;
         this.onLoad(this.page, params);

+ 4 - 3
src/views/bank/message.vue

@@ -63,10 +63,10 @@
 </template>
 
 <script>
-  import {getList, getDetail, add, update, remove, getDeptTree} from "@/api/bank/message";
+  import {getList, getDetail, add, update, remove} from "@/api/bank/message";
   import {mapGetters} from "vuex";
   import {downloadFileBase64} from "@/util/util";
-  import website from '@/config/website';
+  import {getDeptTree} from "@/api/system/dept";
 
   export default {
     data() {
@@ -151,6 +151,7 @@
               label: "查閱部門",
               prop: "deptId",
               type: "tree",
+              // multiple: true,
               dicData: [],
               props: {
                 label: "title"
@@ -223,7 +224,7 @@
       }
     },
     mounted() {
-      getDeptTree(website.tenantId).then(res => {
+      getDeptTree().then(res => {
         const column = this.findObject(this.option.column, "deptId");
         column.dicData = res.data.data;
       });