zhuangyunsheng 1 år sedan
förälder
incheckning
d4152bf844
1 ändrade filer med 34 tillägg och 0 borttagningar
  1. 34 0
      src/views/policyShare/index.vue

+ 34 - 0
src/views/policyShare/index.vue

@@ -3,6 +3,9 @@
         <div class="tjm_card_title">查询表格</div>
         <div class="tjm_card_select">
             <el-form class="tjm_card_select_left" :model="params" inline label-width="80px" label-position="left">
+                <!-- <el-form-item label="所属部门">
+		            <el-tree-select v-model="deptQuery.modelValue" :data="deptQuery.data" :props="deptQuery.props" check-strictly filterable clearable placeholder="请选择所属部门" @node-click="nodeClick"></el-tree-select>
+                </el-form-item> -->
                 <el-form-item label="政策编号">
                     <el-input v-model="params.businessNo" clearable placeholder="请输入政策编号"></el-input>
                 </el-form-item>
@@ -106,6 +109,8 @@
 <script>
 import Folder from "@/api/folder";
 import Temp from "@/api/system/template";
+import { getMainList } from "@/api/system/depart";
+
 import API from "@/api/policy/share";
 import { useUserStore } from "@/store/user";
 import { exportExcel } from "@/utils/exportExcel";
@@ -132,6 +137,19 @@ export default {
         return {
             columns, levelDic, typeDic, storageTypeDic, whetherDic, statusDic,
 
+            deptQuery: {
+                modelValue: null,
+                data: [],
+                props: { 
+                    label: "name",
+                    value: "id"
+                },
+                paramsFormat: {
+                    0: "companyId",
+                    1: "deptId"
+                }
+            },
+
             loading: false,
             createTime: [],
             params: {
@@ -154,6 +172,7 @@ export default {
     },
 
     mounted() {
+        this.getDeptTree();
         this.reloadTable();
     },
 
@@ -164,6 +183,13 @@ export default {
             return row[props];
         },
 
+        getDeptTree() {
+            getMainList().then(res => {
+                if (res.code === 200) this.deptQuery.data = res.data;
+                else ElMessage.error(res.msg);
+            });
+        },
+
         reloadTable(mode = "add") {
             if (mode == "add") this.params.page = 1;
             this.params.beginCreateTime = this.createTime && this.createTime.length && this.createTime[0] + " 00:00:00" || null;
@@ -191,6 +217,14 @@ export default {
             this.reloadTable();
         },
 
+        nodeClick({ deptType, id }) {
+            for (const key in this.deptQuery.paramsFormat) {
+                this.params[this.deptQuery.paramsFormat[key]] = null;
+            }
+
+            this.params[this.deptQuery.paramsFormat[deptType]] = id;
+        },
+
         table_export() {
             const header = columns.map(c => c.label);
             const data = this.tableData.map(v => columns.map(c => c.props).map(j => this.columnFormat(v, j)));