From 444cd8a26724d49414233ffa9b68d8d4c0d0f0bc Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Sat, 10 Jul 2021 14:16:18 +0800
Subject: [PATCH] 配置修改

---
 src/store/modules/common.js                |    2 
 src/views/unitPermission/accraditation.vue |  294 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 289 insertions(+), 7 deletions(-)

diff --git a/src/store/modules/common.js b/src/store/modules/common.js
index ec24a59..8ea5e50 100644
--- a/src/store/modules/common.js
+++ b/src/store/modules/common.js
@@ -25,7 +25,7 @@
     showMenu: true,
     showColor: true,
     colorName: getStore({name: 'colorName'}) || '#409EFF',
-    themeName: getStore({name: 'themeName'}) || 'theme-default',
+    themeName: getStore({name: 'themeName'}) || 'theme-bule',
     lockPasswd: getStore({name: 'lockPasswd'}) || '',
     website: website,
   },
diff --git a/src/views/unitPermission/accraditation.vue b/src/views/unitPermission/accraditation.vue
index b1c87be..f0a8b1b 100644
--- a/src/views/unitPermission/accraditation.vue
+++ b/src/views/unitPermission/accraditation.vue
@@ -6,17 +6,299 @@
  * menu-name 保安服务单位许可审批
  */
 <template>
-  <div>
-    保安服务单位许可审批
-  </div>
+    <basic-container>
+        <avue-crud :option="option"
+                   :table-loading="loading"
+                   :data="data"
+                   :page.sync="page"
+                   :permission="permissionList"
+                   :before-open="beforeOpen"
+                   v-model="form"
+                   ref="crud"
+                   @row-update="rowUpdate"
+                   @row-save="rowSave"
+                   @row-del="rowDel"
+                   @search-change="searchChange"
+                   @search-reset="searchReset"
+                   @selection-change="selectionChange"
+                   @current-change="currentChange"
+                   @size-change="sizeChange"
+                   @refresh-change="refreshChange"
+                   @row-click="handleRowClick"
+                   @on-load="onLoad">
+
+        </avue-crud>
+    </basic-container>
 </template>
 
 <script>
-export default {
+import { getList, getDetail, add, update, remove } from "@/api/securityCompany/security";
+import { mapGetters } from "vuex";
 
-}
+export default {
+    data () {
+        return {
+            form: {},
+            query: {},
+            loading: true,
+            page: {
+                pageSize: 10,
+                currentPage: 1,
+                total: 0
+            },
+            selectionList: [],
+            option: {
+                // 操作栏多余按钮去除
+                delBtn: false,
+                editBtn: false,
+                addBtn: false,
+                selection: false,
+                menu: false,
+
+                align: 'center',
+                height: 'auto',
+                calcHeight: 30,
+                tip: false,
+                searchShow: true,
+                searchMenuSpan: 6,
+                index: true,
+                viewBtn: true,
+                dialogClickModal: false,
+
+                column: [
+                    {
+                        label: "企业名称",
+                        prop: "enterprisename",
+                        search: true,
+                        searchSpan: 4,
+                        display: false,
+                    },
+                    {
+                        label: "法定代表人",
+                        prop: "representative",
+                        display: false,
+                        width: 120
+                    },
+                    {
+                        label: "成立日期",
+                        prop: "establishtime",
+                        type: "date",
+                        format: 'yyyy-MM-dd',
+                        valueFormat: 'yyyy-MM-dd',
+                        mock: {
+                            type: 'datetime',
+                            format: 'yyyy-MM-dd'
+                        },
+                        search: true,
+                        searchSpan: 4,
+                        display: false,
+                        width: 180
+                    },
+                    {
+                        label: "注册资金",
+                        prop: "registeredcapital",
+                        display: false,
+                        width: 200
+                    },
+                    {
+                        label: "实缴资金",
+                        prop: "capital",
+                        display: false,
+                        width: 200
+                    },
+                    {
+                        label: "企业类型",
+                        prop: "enterprises",
+                        display: false,
+                    },
+                    {
+                        label: "注册地址",
+                        prop: "address",
+                        display: false,
+                        width: 200
+                    },
+                    {
+                        label: "企业类别",
+                        prop: "stats",
+                        type: 'select',
+                        search: true,
+                        searchSpan: 5,
+                        dicData: [{
+                            label: '自招保安单位',
+                            value: '0'
+                        }, {
+                            label: '保安培训公司',
+                            value: '1',
+                        }, {
+                            label: '保安服务公司',
+                            value: '2',
+                        }, {
+                            label: '武装守押公司',
+                            value: '3',
+                        }],
+                        display: false,
+                        width: 200
+                    }
+                ]
+                ,
+                group: [
+                    {
+                        label: '详细信息',
+                        prop: 'baseInfo',
+                        icon: 'el-icon-user-solid',
+                        column: [
+                            {
+                                label: "企业名称",
+                                prop: "enterprisename",
+                                display: false,
+                            },
+
+                        ]
+                    },
+                    {
+                        label: '详细信息',
+                        prop: 'detailInfo',
+                        icon: 'el-icon-s-order',
+                        column: [
+
+                        ]
+                    },
+                    {
+                        label: '职责信息',
+                        prop: 'dutyInfo',
+                        icon: 'el-icon-s-custom',
+                        column: [
+
+
+                        ]
+                    },
+                ]
+            },
+            data: []
+        };
+    },
+    computed: {
+        ...mapGetters(["permission"]),
+        permissionList () {
+            return {
+                addBtn: this.vaildData(this.permission.post_add, false),
+                viewBtn: this.vaildData(this.permission.post_view, false),
+                delBtn: this.vaildData(this.permission.post_delete, false),
+                editBtn: this.vaildData(this.permission.post_edit, false)
+            };
+        },
+        ids () {
+            let ids = [];
+            this.selectionList.forEach(ele => {
+                ids.push(ele.id);
+            });
+            return ids.join(",");
+        }
+    },
+    methods: {
+        rowSave (row, done, loading) {
+            add(row).then(() => {
+                this.onLoad(this.page);
+                this.$message({
+                    type: "success",
+                    message: "操作成功!"
+                });
+                done();
+            }, error => {
+                window.console.log(error);
+                loading();
+            });
+        },
+        rowUpdate (row, index, done, loading) {
+            update(row).then(() => {
+                this.onLoad(this.page);
+                this.$message({
+                    type: "success",
+                    message: "操作成功!"
+                });
+                done();
+            }, error => {
+                window.console.log(error);
+                loading();
+            });
+        },
+        rowDel (row) {
+            this.$confirm("确定将选择数据删除?", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning"
+            })
+                .then(() => {
+                    return remove(row.id);
+                })
+                .then(() => {
+                    this.onLoad(this.page);
+                    this.$message({
+                        type: "success",
+                        message: "操作成功!"
+                    });
+                });
+        },
+        beforeOpen (done, type) {
+            if (["edit", "view"].includes(type)) {
+                getDetail(this.form.id).then(res => {
+                    this.form = res.data.data;
+                });
+            }
+            done();
+        },
+        searchReset () {
+            this.query = {};
+            this.onLoad(this.page);
+        },
+        searchChange (params, done) {
+            this.query = params;
+            this.page.currentPage = 1;
+            this.onLoad(this.page, params);
+            done();
+        },
+        selectionChange (list) {
+            this.selectionList = list;
+        },
+        selectionClear () {
+            this.selectionList = [];
+            this.$refs.crud.toggleSelection();
+        },
+        currentChange (currentPage) {
+            this.page.currentPage = currentPage;
+        },
+        sizeChange (pageSize) {
+            this.page.pageSize = pageSize;
+        },
+        refreshChange () {
+            this.onLoad(this.page, this.query);
+        },
+        onLoad (page, params = {}) {
+            this.loading = true;
+            getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
+                const data = res.data.data;
+                this.page.total = data.total;
+                this.data = data.records;
+                this.loading = false;
+                this.selectionClear();
+            });
+        },
+
+
+        // 行单击
+        handleRowClick (row) {
+            // delete (row["name"]);
+            var obj = row
+            obj["name"] = "保安公司详细资料"
+            this.$router.push({
+                path: `/securityCompany/index`,
+                query: obj,
+            });
+
+        },
+    }
+};
 </script>
 
 <style>
-
 </style>

--
Gitblit v1.9.3