|
|
@@ -65,7 +65,7 @@
|
|
|
@click="onAddItem()"
|
|
|
:disabled="rule ? false : true"
|
|
|
v-hasPermi="['safetycheck:ruleManager:add']"
|
|
|
- v-if="rule && rule.orgId == orgId && rule.ruleStatus==0"
|
|
|
+ v-if="rule && rule.orgId == orgId && rule.ruleStatus == 0"
|
|
|
>新 增</el-button
|
|
|
>
|
|
|
<!-- <el-button
|
|
|
@@ -79,7 +79,7 @@
|
|
|
:disabled="rule ? false : true"
|
|
|
>{{ expandAll ? "收起所有行" : "展开所有行" }}</el-button
|
|
|
>
|
|
|
- </el-col>
|
|
|
+ </el-col>
|
|
|
<right-toolbar
|
|
|
:showSearch.sync="showSearch"
|
|
|
@queryTable="getList"
|
|
|
@@ -137,22 +137,33 @@
|
|
|
v-if="columns[2].visible"
|
|
|
>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="操作" width="140" v-if="rule && rule.orgId == orgId && rule.ruleStatus==0">
|
|
|
+ <el-table-column
|
|
|
+ label="操作"
|
|
|
+ width="140"
|
|
|
+ v-if="rule && rule.orgId == orgId && rule.ruleStatus == 0"
|
|
|
+ >
|
|
|
<template slot-scope="scope">
|
|
|
<el-button
|
|
|
type="text"
|
|
|
size="small"
|
|
|
icon="el-icon-edit"
|
|
|
@click="onEditItem(scope.row.id)"
|
|
|
- v-hasPermi="['safetycheck:ruleManager:edit']"
|
|
|
+ v-hasPermi="['safetycheck:ruleManager:edit']"
|
|
|
>编辑</el-button
|
|
|
- >
|
|
|
-
|
|
|
+ >
|
|
|
+
|
|
|
<el-popconfirm
|
|
|
title="将删除检查项及其下所有检查内容,确定删除?"
|
|
|
@confirm="deldata(scope.row.id)"
|
|
|
>
|
|
|
- <el-button type="text" size="small" slot="reference" icon="el-icon-delete" v-hasPermi="['safetycheck:ruleManager:remove']">删除</el-button>
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ slot="reference"
|
|
|
+ icon="el-icon-delete"
|
|
|
+ v-hasPermi="['safetycheck:ruleManager:remove']"
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
</el-popconfirm>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
@@ -173,7 +184,6 @@
|
|
|
@success="onSuccess"
|
|
|
></dialog-edit>
|
|
|
<SelectPoint ref="DialogSelect" @success="onSuccess" orgType="4">
|
|
|
-
|
|
|
</SelectPoint>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -182,7 +192,7 @@
|
|
|
import { mapGetters } from "vuex";
|
|
|
import { page, treeData, del } from "@/api/safetycheck/ruleManager.js";
|
|
|
import DialogEdit from "./dialog.editItem.vue";
|
|
|
-import SelectPoint from './dialog.select.point.vue';
|
|
|
+import SelectPoint from "./dialog.select.point.vue";
|
|
|
import OrgTree from "@/components/orgTree";
|
|
|
export default {
|
|
|
name: "safetycheckRuleManager",
|
|
|
@@ -228,14 +238,14 @@ export default {
|
|
|
{ key: 3, label: `检查内容`, visible: true },
|
|
|
{ key: 4, label: `检查区域`, visible: true },
|
|
|
],
|
|
|
- currentOrgId:null,
|
|
|
+ currentOrgId: null,
|
|
|
};
|
|
|
},
|
|
|
|
|
|
- components: { DialogEdit,SelectPoint,OrgTree },
|
|
|
+ components: { DialogEdit, SelectPoint, OrgTree },
|
|
|
|
|
|
computed: {
|
|
|
- ...mapGetters(["orgId"])
|
|
|
+ ...mapGetters(["orgId"]),
|
|
|
// ...mapState(["org", "loginUser"]),
|
|
|
},
|
|
|
|
|
|
@@ -243,7 +253,6 @@ export default {
|
|
|
filterText(val) {
|
|
|
this.$refs.tree.filter(val);
|
|
|
},
|
|
|
-
|
|
|
},
|
|
|
|
|
|
async created() {
|
|
|
@@ -253,9 +262,7 @@ export default {
|
|
|
// await this.getassetlist();
|
|
|
},
|
|
|
|
|
|
- mounted() {
|
|
|
-
|
|
|
- },
|
|
|
+ mounted() {},
|
|
|
|
|
|
methods: {
|
|
|
treeData,
|
|
|
@@ -276,18 +283,18 @@ export default {
|
|
|
this.getList();
|
|
|
},
|
|
|
async getList() {
|
|
|
- if (!this.rule) {
|
|
|
+ if (!this.queryParams.ruleId) {
|
|
|
this.$message.warning("请先选择一个检查内容库定义");
|
|
|
return;
|
|
|
}
|
|
|
this.loading = true;
|
|
|
const data = await page(this.queryParams);
|
|
|
this.tableData = data.rows;
|
|
|
- this.total =Number.parseInt(data.total);
|
|
|
+ this.total = Number.parseInt(data.total);
|
|
|
this.expandAll = false;
|
|
|
this.loading = false;
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
handleSizeChange(val) {
|
|
|
this.pagesize = val;
|
|
|
this.getList();
|
|
|
@@ -296,8 +303,10 @@ export default {
|
|
|
this.currentPage = val;
|
|
|
this.getList();
|
|
|
},
|
|
|
- clicktreenode(data,node) {
|
|
|
- this.tableData=[]
|
|
|
+ clicktreenode(data, node) {
|
|
|
+ this.tableData = [];
|
|
|
+ this.rule = null;
|
|
|
+ this.queryParams.ruleId = null;
|
|
|
if (!data.isRule) {
|
|
|
return;
|
|
|
}
|
|
|
@@ -307,12 +316,12 @@ export default {
|
|
|
this.$nextTick(() => {
|
|
|
this.fresh = true;
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
this.queryParams.ruleId = data.id;
|
|
|
this.rule = data;
|
|
|
- this.rule.orgId=node.parent.data.id
|
|
|
- if(this.rule.ruleStatus!=0){
|
|
|
- this.$message.info("履职内容库已禁用,无法编辑履职项、履职内容")
|
|
|
+ this.rule.orgId = node.parent.data.id;
|
|
|
+ if (this.rule.ruleStatus != 0) {
|
|
|
+ this.$message.info("履职内容库已禁用,无法编辑履职项、履职内容");
|
|
|
}
|
|
|
this.refresh();
|
|
|
},
|
|
|
@@ -325,9 +334,7 @@ export default {
|
|
|
if (data.isRule == 0) {
|
|
|
return (
|
|
|
<span class="custom-tree-node">
|
|
|
- <span class="show-ellipsis">
|
|
|
- {data.shortName}
|
|
|
- </span>
|
|
|
+ <span class="show-ellipsis">{data.shortName}</span>
|
|
|
</span>
|
|
|
);
|
|
|
} else {
|
|
|
@@ -361,12 +368,12 @@ export default {
|
|
|
onEditItem(itemId) {
|
|
|
this.$refs.dialogEdit.show(itemId);
|
|
|
},
|
|
|
- onSelect(){
|
|
|
+ onSelect() {
|
|
|
this.$refs.DialogSelect.show();
|
|
|
},
|
|
|
- onSuccess(){
|
|
|
+ onSuccess() {
|
|
|
this.refresh();
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|