From 21c7375b7b38ebf2c8a2ca8fbf6fe9fb4f28250f Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Wed, 12 Jan 2022 10:59:40 +0800
Subject: [PATCH] 新增公司注册机公司注册审核
---
src/views/system/dict.vue | 404 +++++++++++++++++++++++++++++++++++++++++++++------------
1 files changed, 317 insertions(+), 87 deletions(-)
diff --git a/src/views/system/dict.vue b/src/views/system/dict.vue
index 1355028..1141204 100644
--- a/src/views/system/dict.vue
+++ b/src/views/system/dict.vue
@@ -1,5 +1,10 @@
<template>
- <basic-container>
+ <basic-container
+ :class="[
+ 'hasButTwo',
+ $store.state.control.windowWidth >= 1024 ? 'oneRowSearch' : '',
+ ]"
+ >
<avue-crud
:option="optionParent"
:table-loading="loading"
@@ -29,7 +34,7 @@
v-if="permission.dict_delete"
plain
@click="handleDelete"
- >删 除
+ >删 除
</el-button>
</template>
<template slot-scope="scope" slot="menu">
@@ -39,20 +44,24 @@
size="small"
@click.stop="handleRowClick(scope.row)"
v-if="userInfo.role_name.includes('admin')"
- >字典配置
+ >字典配置
</el-button>
</template>
- <template slot-scope="{row}" slot="code">
- <el-tag @click="handleRowClick(row)" style="cursor:pointer">{{ row.code }}</el-tag>
+ <template slot-scope="{ row }" slot="code">
+ <el-tag @click="handleRowClick(row)" style="cursor: pointer">{{
+ row.code
+ }}</el-tag>
</template>
- <template slot-scope="{row}" slot="isSealed">
- <el-tag>{{ row.isSealed === 0 ? '否' : '是' }}</el-tag>
+ <template slot-scope="{ row }" slot="isSealed">
+ <el-tag>{{ row.isSealed === 0 ? "否" : "是" }}</el-tag>
</template>
</avue-crud>
- <el-dialog :title="`[${dictValue}]字典配置`"
- append-to-body
- :visible.sync="box"
- width="1000px">
+ <el-dialog
+ :title="`[${dictValue}]字典配置`"
+ append-to-body
+ :visible.sync="box"
+ width="1000px"
+ >
<avue-crud
:option="optionChild"
:table-loading="loadingChild"
@@ -81,7 +90,7 @@
v-if="permission.dict_delete"
plain
@click="handleDelete"
- >删 除
+ >删 除
</el-button>
</template>
<template slot-scope="scope" slot="menu">
@@ -89,13 +98,13 @@
type="text"
icon="el-icon-circle-plus-outline"
size="small"
- @click.stop="handleAdd(scope.row,scope.index)"
+ @click.stop="handleAdd(scope.row, scope.index)"
v-if="userInfo.role_name.includes('admin')"
- >新增子项
+ >新增子项
</el-button>
</template>
- <template slot-scope="{row}" slot="isSealed">
- <el-tag>{{ row.isSealed === 0 ? '否' : '是' }}</el-tag>
+ <template slot-scope="{ row }" slot="isSealed">
+ <el-tag>{{ row.isSealed === 0 ? "否" : "是" }}</el-tag>
</template>
</avue-crud>
</el-dialog>
@@ -110,15 +119,15 @@
update,
add,
getDict,
- getDictTree
+ getDictTree,
} from "@/api/system/dict";
-import {optionParent, optionChild} from "@/option/system/dict";
-import {mapGetters} from "vuex";
+import { optionParent, optionChild } from "@/option/system/dict";
+import { mapGetters } from "vuex";
export default {
data() {
return {
- dictValue: '暂无',
+ dictValue: "暂无",
parentId: -1,
formParent: {},
formChild: {},
@@ -131,18 +140,227 @@
pageSize: 10,
pageSizes: [10, 30, 50, 100, 200],
currentPage: 1,
- total: 0
+ total: 0,
},
pageChild: {
pageSize: 10,
pageSizes: [10, 30, 50, 100, 200],
currentPage: 1,
- total: 0
+ total: 0,
},
dataParent: [],
dataChild: [],
- optionParent: optionParent,
- optionChild: optionChild,
+ optionParent: {
+ height: "auto",
+ calcHeight: 30,
+ tip: false,
+ searchShow: true,
+ searchMenuSpan: 10,
+ border: true,
+ index: true,
+ selection: true,
+ viewBtn: true,
+ menuWidth: 250,
+ dialogWidth: 880,
+ dialogClickModal: false,
+ ...this.$store.state.control.clearOtherBut,
+ column: [
+ {
+ label: "字典编号",
+ prop: "code",
+ search: true,
+ slot: true,
+ span: 24,
+ rules: [
+ {
+ required: true,
+ message: "请输入字典编号",
+ trigger: "blur",
+ },
+ ],
+ },
+ {
+ label: "字典名称",
+ prop: "dictValue",
+ search: true,
+ align: "center",
+ rules: [
+ {
+ required: true,
+ message: "请输入字典名称",
+ trigger: "blur",
+ },
+ ],
+ },
+ {
+ label: "字典排序",
+ prop: "sort",
+ type: "number",
+ align: "right",
+ width: 100,
+ rules: [
+ {
+ required: true,
+ message: "请输入字典排序",
+ trigger: "blur",
+ },
+ ],
+ },
+ {
+ label: "封存",
+ prop: "isSealed",
+ type: "switch",
+ align: "center",
+ width: 100,
+ dicData: [
+ {
+ label: "否",
+ value: 0,
+ },
+ {
+ label: "是",
+ value: 1,
+ },
+ ],
+ value: 0,
+ slot: true,
+ rules: [
+ {
+ required: true,
+ message: "请选择封存",
+ trigger: "blur",
+ },
+ ],
+ },
+ {
+ label: "字典备注",
+ prop: "remark",
+ hide: true,
+ },
+ ],
+ },
+ optionChild: {
+ height: "auto",
+ calcHeight: 95,
+ tip: false,
+ searchShow: true,
+ searchMenuSpan: 10,
+ tree: true,
+ border: true,
+ index: true,
+ selection: true,
+ viewBtn: true,
+ menuWidth: 300,
+ dialogWidth: 880,
+ dialogClickModal: false,
+ ...this.$store.state.control.clearOtherBut,
+ column: [
+ {
+ label: "字典编号",
+ prop: "code",
+ addDisabled: true,
+ editDisabled: true,
+ search: true,
+ span: 24,
+ rules: [
+ {
+ required: true,
+ message: "请输入字典编号",
+ trigger: "blur",
+ },
+ ],
+ },
+ {
+ label: "字典名称",
+ prop: "dictValue",
+ search: true,
+ align: "center",
+ rules: [
+ {
+ required: true,
+ message: "请输入字典名称",
+ trigger: "blur",
+ },
+ ],
+ },
+ {
+ label: "上级字典",
+ prop: "parentId",
+ type: "tree",
+ dicData: [],
+ hide: true,
+ props: {
+ label: "title",
+ },
+ addDisabled: true,
+ editDisabled: true,
+ rules: [
+ {
+ required: false,
+ message: "请选择上级字典",
+ trigger: "click",
+ },
+ ],
+ },
+ {
+ label: "字典键值",
+ prop: "dictKey",
+ width: 80,
+ rules: [
+ {
+ required: true,
+ message: "请输入字典键值",
+ trigger: "blur",
+ },
+ ],
+ },
+ {
+ label: "字典排序",
+ prop: "sort",
+ type: "number",
+ align: "right",
+ hide: true,
+ rules: [
+ {
+ required: true,
+ message: "请输入字典排序",
+ trigger: "blur",
+ },
+ ],
+ },
+ {
+ label: "封存",
+ prop: "isSealed",
+ type: "switch",
+ align: "center",
+ width: 80,
+ dicData: [
+ {
+ label: "否",
+ value: 0,
+ },
+ {
+ label: "是",
+ value: 1,
+ },
+ ],
+ value: 0,
+ slot: true,
+ rules: [
+ {
+ required: true,
+ message: "请选择封存",
+ trigger: "blur",
+ },
+ ],
+ },
+ {
+ label: "字典备注",
+ prop: "remark",
+ hide: true,
+ },
+ ],
+ },
};
},
computed: {
@@ -157,18 +375,18 @@
},
ids() {
let ids = [];
- this.selectionList.forEach(ele => {
+ this.selectionList.forEach((ele) => {
ids.push(ele.id);
});
return ids.join(",");
- }
+ },
},
mounted() {
this.initData();
},
methods: {
initData() {
- getDictTree().then(res => {
+ getDictTree().then((res) => {
const column = this.findObject(this.optionChild.column, "parentId");
column.dicData = res.data.data;
});
@@ -187,37 +405,43 @@
...row,
dictKey: -1,
};
- add(form).then(() => {
- this.onLoadParent(this.pageParent);
- this.$message({
- type: "success",
- message: "操作成功!"
- });
- done();
- }, error => {
- window.console.log(error);
- loading();
- });
+ add(form).then(
+ () => {
+ this.onLoadParent(this.pageParent);
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ });
+ done();
+ },
+ (error) => {
+ window.console.log(error);
+ loading();
+ }
+ );
},
rowUpdate(row, index, done, loading) {
- update(row).then(() => {
- this.onLoadParent(this.pageParent);
- this.$message({
- type: "success",
- message: "操作成功!"
- });
- this.onLoadChild(this.pageChild);
- done();
- }, error => {
- window.console.log(error);
- loading();
- });
+ update(row).then(
+ () => {
+ this.onLoadParent(this.pageParent);
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ });
+ this.onLoadChild(this.pageChild);
+ done();
+ },
+ (error) => {
+ window.console.log(error);
+ loading();
+ }
+ );
},
rowDel(row) {
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
- type: "warning"
+ type: "warning",
})
.then(() => {
return remove(row.id);
@@ -226,7 +450,7 @@
this.onLoadParent(this.pageParent);
this.$message({
type: "success",
- message: "操作成功!"
+ message: "操作成功!",
});
});
},
@@ -268,7 +492,7 @@
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
- type: "warning"
+ type: "warning",
})
.then(() => {
return remove(this.ids);
@@ -277,14 +501,14 @@
this.onLoadParent(this.pageParent);
this.$message({
type: "success",
- message: "操作成功!"
+ message: "操作成功!",
});
this.$refs.crud.toggleSelection();
});
},
beforeOpen(done, type) {
if (["edit", "view"].includes(type)) {
- getDict(this.formParent.id).then(res => {
+ getDict(this.formParent.id).then((res) => {
this.formParent = res.data.data;
});
}
@@ -300,36 +524,42 @@
this.onLoadParent(this.pageParent, this.query);
},
rowSaveChild(row, done, loading) {
- add(row).then(() => {
- this.onLoadChild(this.pageChild);
- this.$message({
- type: "success",
- message: "操作成功!"
- });
- done();
- }, error => {
- window.console.log(error);
- loading();
- });
+ add(row).then(
+ () => {
+ this.onLoadChild(this.pageChild);
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ });
+ done();
+ },
+ (error) => {
+ window.console.log(error);
+ loading();
+ }
+ );
},
rowUpdateChild(row, index, done, loading) {
- update(row).then(() => {
- this.onLoadChild(this.pageChild);
- this.$message({
- type: "success",
- message: "操作成功!"
- });
- done();
- }, error => {
- window.console.log(error);
- loading();
- });
+ update(row).then(
+ () => {
+ this.onLoadChild(this.pageChild);
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ });
+ done();
+ },
+ (error) => {
+ window.console.log(error);
+ loading();
+ }
+ );
},
rowDelChild(row) {
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
- type: "warning"
+ type: "warning",
})
.then(() => {
return remove(row.id);
@@ -338,7 +568,7 @@
this.onLoadChild(this.pageChild);
this.$message({
type: "success",
- message: "操作成功!"
+ message: "操作成功!",
});
});
},
@@ -367,7 +597,7 @@
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
- type: "warning"
+ type: "warning",
})
.then(() => {
return remove(this.ids);
@@ -376,7 +606,7 @@
this.onLoadChild(this.pageChild);
this.$message({
type: "success",
- message: "操作成功!"
+ message: "操作成功!",
});
this.$refs.crudChild.toggleSelection();
});
@@ -386,7 +616,7 @@
this.initData();
}
if (["edit", "view"].includes(type)) {
- getDict(this.formChild.id).then(res => {
+ getDict(this.formChild.id).then((res) => {
this.formChild = res.data.data;
});
}
@@ -394,7 +624,7 @@
},
beforeCloseChild(done) {
this.$refs.crudChild.value.parentId = this.parentId;
- this.$refs.crudChild.option.column.filter(item => {
+ this.$refs.crudChild.option.column.filter((item) => {
if (item.prop === "parentId") {
item.value = this.parentId;
}
@@ -416,7 +646,7 @@
page.currentPage,
page.pageSize,
Object.assign(params, this.query)
- ).then(res => {
+ ).then((res) => {
const data = res.data.data;
this.pageParent.total = data.total;
this.dataParent = data.records;
@@ -431,13 +661,13 @@
page.pageSize,
this.parentId,
Object.assign(params, this.query)
- ).then(res => {
+ ).then((res) => {
this.dataChild = res.data.data;
this.loadingChild = false;
this.selectionClear();
});
- }
- }
+ },
+ },
};
</script>
--
Gitblit v1.9.3