From 2f0ade35ec9107f94c153057b207e4f21e9a29b0 Mon Sep 17 00:00:00 2001
From: zhy <luhan1008611>
Date: 星期三, 25 十月 2023 17:31:33 +0800
Subject: [PATCH] Merge branch 'master' of http://116.198.39.83:7111/r/xxjProject/low-consum-manage

---
 admin-web/src/views/systemSetting/department/index.vue |  405 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 405 insertions(+), 0 deletions(-)

diff --git a/admin-web/src/views/systemSetting/department/index.vue b/admin-web/src/views/systemSetting/department/index.vue
new file mode 100644
index 0000000..f4e556c
--- /dev/null
+++ b/admin-web/src/views/systemSetting/department/index.vue
@@ -0,0 +1,405 @@
+<template>
+  <div class="app-container">
+    <!--宸︿晶鏍戝舰寮�濮�-->
+    <el-col :span="5">
+        <el-card class="box-card" shadow="never">
+          <my-tree ref="searchTree" :tree-list="treeDataList" @setNode="nodeClick" @search="search"></my-tree>
+        </el-card>
+      </el-col>
+      <!--宸︿晶鏍戝舰缁撴潫-->
+      <!--鍙充晶鍒楄〃寮�濮�-->
+    <el-container>
+      <el-card class="box-card" style="width: 100%" shadow="never">
+<!--      <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">-->
+<!--        <el-form-item label="瀛楀吀鍚嶇О" prop="dictName">-->
+<!--          <el-input-->
+<!--            v-model="queryParams.dictName"-->
+<!--            placeholder="璇疯緭鍏�"-->
+<!--            clearable-->
+<!--            style="width: 150px"-->
+<!--            @keyup.enter.native="handleQuery"-->
+<!--          />-->
+<!--        </el-form-item>-->
+<!--        <el-form-item label="鐘舵��" prop="status">-->
+<!--          <el-select-->
+<!--            v-model="queryParams.status"-->
+<!--            placeholder="璇烽�夋嫨"-->
+<!--            clearable-->
+<!--            style="width: 150px"-->
+<!--          >-->
+<!--            <el-option-->
+<!--              v-for="item in constants.normalOrDisabled"-->
+<!--              :key="item.value"-->
+<!--              :label="item.label"-->
+<!--              :value="item.value"-->
+<!--            />-->
+<!--          </el-select>-->
+<!--        </el-form-item>-->
+<!--        <el-form-item>-->
+<!--          <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">鏌ヨ</el-button>-->
+<!--          <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">閲嶇疆</el-button>-->
+<!--        </el-form-item>-->
+<!--      </el-form>-->
+<!--      <el-table v-loading="loading" :data="typeList" @selection-change="handleSelectionChange">-->
+<!--        <el-table-column type="selection" width="55" align="center" />-->
+<!--        <el-table-column label="瀛楀吀缂栧彿" align="center" prop="dict_id" />-->
+<!--        <el-table-column label="瀛楀吀鍚嶇О" align="center" prop="dict_name" :show-overflow-tooltip="true" />-->
+<!--        <el-table-column label="瀛楀吀绫诲瀷" align="center" :show-overflow-tooltip="true">-->
+<!--          <template slot-scope="scope">-->
+<!--            <router-link :to="'/systemSetting/dictdata/data/' + scope.row.dict_id" class="link-type">-->
+<!--              <span>{{ scope.row.dict_type }}</span>-->
+<!--            </router-link>-->
+<!--          </template>-->
+<!--        </el-table-column>-->
+<!--        <el-table-column label="鐘舵��" align="center" prop="status">-->
+<!--          <template slot-scope="scope">-->
+<!--            <span>{{ scope.row.status == 0? '姝e父':'绂佺敤' }}</span>-->
+<!--          </template>-->
+<!--        </el-table-column>-->
+<!--        <el-table-column label="澶囨敞" align="center" prop="remark" :show-overflow-tooltip="true" />-->
+<!--        <el-table-column label="鍒涘缓鏃堕棿" align="center" prop="create_time" width="180">-->
+<!--          <template slot-scope="scope">-->
+<!--            <span>{{ dateTo(scope.row.create_time) }}</span>-->
+<!--          </template>-->
+<!--          &lt;!&ndash;        <template slot-scope="scope">&ndash;&gt;-->
+<!--          &lt;!&ndash;          <span>{{ parseTime(scope.row.create_time) }}</span>&ndash;&gt;-->
+<!--          &lt;!&ndash;        </template>&ndash;&gt;-->
+<!--        </el-table-column>-->
+<!--        <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width" width="180">-->
+<!--          <template slot-scope="scope">-->
+<!--            <el-button-->
+<!--              size="mini"-->
+<!--              type="text"-->
+<!--              icon="el-icon-edit"-->
+<!--              @click="handleUpdate(scope.row)"-->
+<!--              v-hasPermi="['system:dict:edit']"-->
+<!--            >淇敼</el-button>-->
+<!--  &lt;!&ndash;          <el-button-->
+<!--              size="mini"-->
+<!--              type="text"-->
+<!--              icon="el-icon-delete"-->
+<!--              @click="handleDelete(scope.row)"-->
+<!--              v-hasPermi="['system:dict:remove']"-->
+<!--            >鍒犻櫎</el-button>&ndash;&gt;-->
+<!--          </template>-->
+<!--        </el-table-column>-->
+<!--      </el-table>-->
+        <!--鎼滅储鏉′欢-->
+        <div class="filter-container">
+          <my-search ref="searchBar" :items="items" @search="fifterForm"></my-search>
+        </div>
+        <el-row style="margin-top: 8px">
+          <el-col>
+            <!--鍒楄〃-->
+            <my-table-v2 ref="myTable" :filter="queryParams" :table="table"/>
+          </el-col>
+        </el-row>
+      </el-card>
+    </el-container>
+    <!-- 娣诲姞鎴栦慨鏀瑰弬鏁伴厤缃璇濇 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="瀛楀吀鍚嶇О" prop="dictName">
+          <el-input v-model="form.dictName" placeholder="璇疯緭鍏ュ瓧鍏稿悕绉�" />
+        </el-form-item>
+        <el-form-item label="瀛楀吀绫诲瀷" prop="dictType">
+          <el-input v-model="form.dictType" placeholder="璇疯緭鍏ュ瓧鍏哥被鍨�" />
+        </el-form-item>
+        <el-form-item label="鐘舵��" prop="status">
+          <el-radio-group v-model="form.status">
+            <el-radio
+              v-for="item in constants.normalOrDisabled"
+              :key="item.value"
+              :label="item.value"
+            >{{item.label}}</el-radio>
+          </el-radio-group>
+        </el-form-item>
+        <el-form-item label="澶囨敞" prop="remark">
+          <el-input v-model="form.remark" type="textarea" placeholder="璇疯緭鍏ュ唴瀹�"></el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">纭� 瀹�</el-button>
+        <el-button @click="cancel">鍙� 娑�</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import myTree from '@/components/myTree/index';
+import { listType, getType, delType, addType, updateType, refreshCache } from "@/api/system/dict/type";
+import * as DateFormatter from "@/utils/DateFormatter";
+import MyTableV2 from "@/components/myTable/myTableV2";
+import SettingIplatform from '@/utils/settingIplatform';
+import items from './items'
+import * as finsystenant from '@/api/baseSetting/finsystenant';
+export default {
+  name: "Dict",
+  components: { MyTableV2, myTree },
+  data() {
+    return {
+      // 鏍戞暟鎹�
+      treeDataList: [],
+      constants: this.$constants,
+      // 閬僵灞�
+      loading: true,
+      // 閫変腑鏁扮粍
+      ids: [],
+      // 闈炲崟涓鐢�
+      single: true,
+      // 闈炲涓鐢�
+      multiple: true,
+      // 鏄剧ず鎼滅储鏉′欢
+      showSearch: true,
+      // 鎬绘潯鏁�
+      total: 0,
+      // 瀛楀吀琛ㄦ牸鏁版嵁
+      typeList: [],
+      // 寮瑰嚭灞傛爣棰�
+      title: "",
+      // 鏄惁鏄剧ず寮瑰嚭灞�
+      open: false,
+      // 鏃ユ湡鑼冨洿
+      dateRange: [],
+      // 鏌ヨ鍙傛暟
+      queryParams: {
+        dictName: undefined,
+        dictType: undefined,
+        status: 0
+      },
+      items:items,
+      table: {
+        showIndex: true, // 鏄惁鏄剧ず搴忓彿
+        expand: false, // 鏄惁鏄剧ず璇︽儏鏁版嵁
+        url: SettingIplatform.apiBaseURL + '/system/dict/type/list', // 璇锋眰鍦板潃
+        // 宸ュ叿鏉�
+        tools: {
+          columnsCtrl: {// 鍒楁帶鍒舵寜閽�
+            show: false
+          },
+          generalExport: {// 閫氱敤瀵煎嚭鎸夐挳
+            show: false
+          },
+          // 鑷畾涔夊伐鍏锋潯鎸夐挳
+          custom: [
+          {
+              name: '鏂板',
+              click: () => {
+                this.showAdd(null);
+              },
+            },
+          ]
+        },
+        // 鍒椾俊鎭�
+        columns: [
+          {title: '缂栧彿', field: 'dict_id', align: 'center', width: '100px'},
+          {title: '閮ㄩ棬', field: 'dict_name', align: 'left'},
+          {title: '椤哄簭鍙�', field: 'dict_name', align: 'left'},
+          {title: '澶囨敞', field: 'remark', align: 'left', width: '200px'},
+          {
+            title: '鐘舵��', field: 'status', align: 'center', width: '180px',
+            formatter: row => {
+              return { value: row.status=== 0? '鍚敤':'绂佺敤'  }
+            }
+          },
+        ],
+        // 鎿嶄綔淇℃伅
+        operation: {
+          // width: 150,
+          align: 'center',
+          show: false, // 鏄剧ず鎿嶄綔鍒�
+          attr: [
+            // 鍒嗙被涓嬫湁姝e湪杩涜涓殑椤圭洰鏃讹紝缁欏嚭鎻愮ず涓嶅厑璁哥鐢ㄥ拰鍒犻櫎銆備笖绂佺敤涓�绾у垎绫诲墠闇�瑕佸厛绂佺敤涓嬮潰鐨勬墍鏈変簩绾э紝鏈夊惎鐢ㄧ殑浜岀骇鏃朵笉鍏佽绂佺敤涓�绾�
+            {
+              // checkPermission:'system:role:edit',
+              title: '淇敼',
+              events: row => {
+                this.handleUpdate(row)
+              }
+            },
+            // {
+            //   // checkPermission: 'system:role:remove',
+            //   title: '鍒犻櫎',
+            //   events: row => {
+            //     this.handleDelete(row)
+            //   }
+            // },
+          ]
+        },
+        paging: {
+          show: true, // 鏄剧ず鍒嗛〉
+          // 鍒嗛〉淇℃伅
+          page: {
+            small: false,
+            pageNum: 1,
+            pageSize: 10,
+            total: 0
+          }
+        }
+      },
+      // 琛ㄥ崟鍙傛暟
+      form: {},
+      // 琛ㄥ崟鏍¢獙
+      rules: {
+        dictName: [
+          { required: true, message: "瀛楀吀鍚嶇О涓嶈兘涓虹┖", trigger: "blur" }
+        ],
+        dictType: [
+          { required: true, message: "瀛楀吀绫诲瀷涓嶈兘涓虹┖", trigger: "blur" }
+        ]
+      }
+    };
+  },
+  created() {
+    this.initTreeData()
+  },
+  methods: {
+    // 宸︿晶鏍戝垵濮嬪寲
+    initTreeData() {
+      finsystenant.getTree().then((res) => {
+        const content = res || [];
+        this.treeDataList.splice(0, this.treeDataList.length);
+        this.treeDataList = content;
+        if (this.treeDataList && this.treeDataList.length > 0) {
+          this.tenantId = this.treeDataList[0].id;
+          this.tenantName = this.treeDataList[0].label;
+          this.tenantCode = this.treeDataList[0].code;
+        }
+      });
+    },
+    nodeClick(param) {
+      console.log(param,'param');
+      this.search(1)
+    },
+    fifterForm(params) {
+      this.queryParams = Object.assign(this.queryParams, params)
+      this.search(1)
+    },
+    // 鏌ヨtable鍒楄〃
+    search(pageNum) {
+      if (pageNum != undefined) {
+        this.$refs.myTable.search(pageNum)
+      } else {
+        this.$refs.myTable.search()
+      }
+    },
+    dateTo(val) {
+      return DateFormatter.LongToDateTime(val);
+    },
+    changeSize(e){
+      this.queryParams.pageSize = e
+      this.getList()
+    },
+    changePage(e){
+      this.queryParams.pageNum = e
+      this.getList()
+    },
+    /** 鏌ヨ瀛楀吀绫诲瀷鍒楄〃 */
+    getList() {
+      this.loading = true;
+      listType(this.queryParams).then(response => {
+          // this.typeList = response.rows;
+          this.typeList = response.datas;
+          this.total = response.totalRows;
+          this.loading = false;
+        }
+      );
+    },
+    // 鍙栨秷鎸夐挳
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 琛ㄥ崟閲嶇疆
+    reset() {
+      this.form = {
+        dictId: undefined,
+        dictName: undefined,
+        dictType: undefined,
+        status: "0",
+        remark: undefined
+      };
+      this.resetForm("form");
+    },
+    /** 鎼滅储鎸夐挳鎿嶄綔 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 閲嶇疆鎸夐挳鎿嶄綔 */
+    resetQuery() {
+      this.dateRange = [];
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    /** 鏂板鎸夐挳鎿嶄綔 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "娣诲姞瀛楀吀绫诲瀷";
+    },
+    // 澶氶�夋閫変腑鏁版嵁
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.dictId)
+      this.single = selection.length!=1
+      this.multiple = !selection.length
+    },
+    /** 淇敼鎸夐挳鎿嶄綔 */
+    handleUpdate(row) {
+      this.reset();
+      const dictId = row.dict_id || this.ids
+      getType(dictId).then(response => {
+        this.form = response;
+        this.form.dictName = this.form.dict_name
+        this.form.dictType = this.form.dict_type
+        this.open = true;
+        this.title = "淇敼瀛楀吀绫诲瀷";
+      });
+    },
+    /** 鎻愪氦鎸夐挳 */
+    submitForm: function() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.dictId != undefined) {
+            updateType(this.form).then(response => {
+              this.$modal.msgSuccess("淇敼鎴愬姛");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addType(this.form).then(response => {
+              this.$modal.msgSuccess("鏂板鎴愬姛");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 鍒犻櫎鎸夐挳鎿嶄綔 */
+    handleDelete(row) {
+      const dictIds = row.dictId || this.ids;
+      this.$modal.confirm('鏄惁纭鍒犻櫎瀛楀吀缂栧彿涓�"' + dictIds + '"鐨勬暟鎹」锛�').then(function() {
+        return delType(dictIds);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+      }).catch(() => {});
+    },
+    /** 瀵煎嚭鎸夐挳鎿嶄綔 */
+    handleExport() {
+      this.download('system/dict/type/export', {
+        ...this.queryParams
+      }, `type_${new Date().getTime()}.xlsx`)
+    },
+    /** 鍒锋柊缂撳瓨鎸夐挳鎿嶄綔 */
+    handleRefreshCache() {
+      refreshCache().then(() => {
+        this.$modal.msgSuccess("鍒锋柊鎴愬姛");
+        this.$store.dispatch('dict/cleanDict');
+      });
+    }
+  }
+};
+</script>

--
Gitblit v1.9.1