feat: 初步添加双控页面
This commit is contained in:
parent
f392d49292
commit
f2ce1e31da
|
@ -0,0 +1,173 @@
|
||||||
|
import config from "@/config"
|
||||||
|
import http from "@/utils/request"
|
||||||
|
|
||||||
|
export default {
|
||||||
|
riskpoint: {
|
||||||
|
list: {
|
||||||
|
name: "列表",
|
||||||
|
req: async function(data){
|
||||||
|
return await http.get(
|
||||||
|
`${config.API_URL}/dpm/riskpoint/`,
|
||||||
|
data
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
item: {
|
||||||
|
name: "获取详情",
|
||||||
|
req: async function(id){
|
||||||
|
return await http.get(
|
||||||
|
`${config.API_URL}/dpm/riskpoint/${id}/`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
update: {
|
||||||
|
name: "更新",
|
||||||
|
req: async function(id, data){
|
||||||
|
return await http.put(
|
||||||
|
`${config.API_URL}/dpm/riskpoint/${id}/`,
|
||||||
|
data);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
create: {
|
||||||
|
name: "创建",
|
||||||
|
req: async function(data){
|
||||||
|
return await http.post(
|
||||||
|
`${config.API_URL}/dpm/riskpoint/`,
|
||||||
|
data);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
delete: {
|
||||||
|
name: "删除",
|
||||||
|
req: async function(id){
|
||||||
|
return await http.delete(
|
||||||
|
`${config.API_URL}/dpm/riskpoint/${id}/`);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
risk: {
|
||||||
|
list: {
|
||||||
|
name: "列表",
|
||||||
|
req: async function(data){
|
||||||
|
return await http.get(
|
||||||
|
`${config.API_URL}/dpm/risk/`,
|
||||||
|
data
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
item: {
|
||||||
|
name: "获取详情",
|
||||||
|
req: async function(id){
|
||||||
|
return await http.get(
|
||||||
|
`${config.API_URL}/dpm/risk/${id}/`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
update: {
|
||||||
|
name: "更新",
|
||||||
|
req: async function(id, data){
|
||||||
|
return await http.put(
|
||||||
|
`${config.API_URL}/dpm/risk/${id}/`,
|
||||||
|
data);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
create: {
|
||||||
|
name: "创建",
|
||||||
|
req: async function(data){
|
||||||
|
return await http.post(
|
||||||
|
`${config.API_URL}/dpm/risk/`,
|
||||||
|
data);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
delete: {
|
||||||
|
name: "删除",
|
||||||
|
req: async function(id){
|
||||||
|
return await http.delete(
|
||||||
|
`${config.API_URL}/dpm/risk/${id}/`);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
checkwork: {
|
||||||
|
list: {
|
||||||
|
name: "列表",
|
||||||
|
req: async function(data){
|
||||||
|
return await http.get(
|
||||||
|
`${config.API_URL}/dpm/checkwork/`,
|
||||||
|
data
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
item: {
|
||||||
|
name: "获取详情",
|
||||||
|
req: async function(id){
|
||||||
|
return await http.get(
|
||||||
|
`${config.API_URL}/dpm/checkwork/${id}/`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
update: {
|
||||||
|
name: "更新",
|
||||||
|
req: async function(id, data){
|
||||||
|
return await http.put(
|
||||||
|
`${config.API_URL}/dpm/checkwork/${id}/`,
|
||||||
|
data);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
create: {
|
||||||
|
name: "创建",
|
||||||
|
req: async function(data){
|
||||||
|
return await http.post(
|
||||||
|
`${config.API_URL}/dpm/checkwork/`,
|
||||||
|
data);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
delete: {
|
||||||
|
name: "删除",
|
||||||
|
req: async function(id){
|
||||||
|
return await http.delete(
|
||||||
|
`${config.API_URL}/dpm/checkwork/${id}/`);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
hazard: {
|
||||||
|
list: {
|
||||||
|
name: "列表",
|
||||||
|
req: async function(data){
|
||||||
|
return await http.get(
|
||||||
|
`${config.API_URL}/dpm/hazard/`,
|
||||||
|
data
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
item: {
|
||||||
|
name: "获取详情",
|
||||||
|
req: async function(id){
|
||||||
|
return await http.get(
|
||||||
|
`${config.API_URL}/dpm/hazard/${id}/`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
update: {
|
||||||
|
name: "更新",
|
||||||
|
req: async function(id, data){
|
||||||
|
return await http.put(
|
||||||
|
`${config.API_URL}/dpm/hazard/${id}/`,
|
||||||
|
data);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
create: {
|
||||||
|
name: "创建",
|
||||||
|
req: async function(data){
|
||||||
|
return await http.post(
|
||||||
|
`${config.API_URL}/dpm/hazard/`,
|
||||||
|
data);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
delete: {
|
||||||
|
name: "删除",
|
||||||
|
req: async function(id){
|
||||||
|
return await http.delete(
|
||||||
|
`${config.API_URL}/dpm/hazard/${id}/`);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
|
@ -2339,6 +2339,59 @@ const routes = [
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
// 风险管控
|
||||||
|
{
|
||||||
|
"name": "dpm",
|
||||||
|
"path": "/dpm",
|
||||||
|
"meta": {
|
||||||
|
"title": "风险管控",
|
||||||
|
"icon": "el-icon-aim",
|
||||||
|
"type": "menu",
|
||||||
|
"perms": ["dpm"]
|
||||||
|
},
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"name": "riskpoint",
|
||||||
|
"path": "/dpm/riskpoint",
|
||||||
|
"meta": {
|
||||||
|
"title": "风险管理",
|
||||||
|
"icon": "el-icon-aim",
|
||||||
|
"perms": ["riskpoint"]
|
||||||
|
},
|
||||||
|
"component": "dpm/riskpoint"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "checktaskset",
|
||||||
|
"path": "/dpm/checktaskset",
|
||||||
|
"meta": {
|
||||||
|
"title": "排查任务",
|
||||||
|
"icon": "el-icon-aim",
|
||||||
|
"perms": ["checktaskset"]
|
||||||
|
},
|
||||||
|
"component": "dpm/checktaskset"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "checkwork",
|
||||||
|
"path": "/dpm/checkwork",
|
||||||
|
"meta": {
|
||||||
|
"title": "排查工作",
|
||||||
|
"icon": "el-icon-aim",
|
||||||
|
"perms": ["checkwork"]
|
||||||
|
},
|
||||||
|
"component": "dpm/checkwork"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "隐患管理",
|
||||||
|
"path": "/dpm/hazard",
|
||||||
|
"meta": {
|
||||||
|
"title": "隐患管理",
|
||||||
|
"icon": "el-icon-aim",
|
||||||
|
"perms": ["hazard"]
|
||||||
|
},
|
||||||
|
"component": "dpm/hazard"
|
||||||
|
},
|
||||||
|
]
|
||||||
|
},
|
||||||
//考试
|
//考试
|
||||||
{
|
{
|
||||||
"name": "edu",
|
"name": "edu",
|
||||||
|
@ -2970,7 +3023,7 @@ const routes = [
|
||||||
"name": "menu",
|
"name": "menu",
|
||||||
"path": "/ops/menu",
|
"path": "/ops/menu",
|
||||||
"meta": {
|
"meta": {
|
||||||
"title": "菜单管理",
|
"title": "功能管理",
|
||||||
"icon": "el-icon-fold",
|
"icon": "el-icon-fold",
|
||||||
"perms": ["menu"]
|
"perms": ["menu"]
|
||||||
},
|
},
|
||||||
|
|
|
@ -152,4 +152,23 @@ export const enpfieldEnum = new EnumFactory({
|
||||||
'nox_zs': '氮氧化物折算(mg/m3)',
|
'nox_zs': '氮氧化物折算(mg/m3)',
|
||||||
'o2': '含氧量(%)',
|
'o2': '含氧量(%)',
|
||||||
'ammonia_e': '氨逃逸(mg/m3)'
|
'ammonia_e': '氨逃逸(mg/m3)'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
export const riskLevelEnum = new EnumFactory({
|
||||||
|
10: { text: '低风险', type: 'success' },
|
||||||
|
20: { text: '一般风险', type: 'primary' },
|
||||||
|
30: { text: '较大风险', type: 'warning' },
|
||||||
|
40: { text: '重大风险', type: 'danger' },
|
||||||
|
}, parseInt)
|
||||||
|
|
||||||
|
export const manageLevelEnum = new EnumFactory({
|
||||||
|
10: { text: '岗位级', type: 'primary' },
|
||||||
|
20: { text: '班组级', type: 'primary' },
|
||||||
|
30: { text: '部门级', type: 'primary' },
|
||||||
|
40: { text: '公司级', type: 'primary' },
|
||||||
|
}, parseInt)
|
||||||
|
|
||||||
|
export const riskTypeEnum = new EnumFactory({
|
||||||
|
10: { text: '作业活动类', type: 'primary' },
|
||||||
|
20: { text: '设备设施类', type: 'primary' },
|
||||||
|
}, parseInt)
|
|
@ -0,0 +1,17 @@
|
||||||
|
<template>
|
||||||
|
<el-container>
|
||||||
|
</el-container>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'checktaskset',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
|
@ -0,0 +1,4 @@
|
||||||
|
<template>
|
||||||
|
<el-container>
|
||||||
|
</el-container>
|
||||||
|
</template>
|
|
@ -0,0 +1,4 @@
|
||||||
|
<template>
|
||||||
|
<el-container>
|
||||||
|
</el-container>
|
||||||
|
</template>
|
|
@ -0,0 +1,70 @@
|
||||||
|
<template>
|
||||||
|
<el-card style="width: 100%" shadow="hover">
|
||||||
|
<el-descriptions :column="2">
|
||||||
|
<el-descriptions-item label="名称">{{
|
||||||
|
modelv.name
|
||||||
|
}}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="类型">{{
|
||||||
|
riskTypeEnum[modelv.type]?.text
|
||||||
|
}}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="等级"
|
||||||
|
><el-tag :type="riskLevelEnum[modelv.level]?.type">{{
|
||||||
|
riskLevelEnum[modelv.level]?.text
|
||||||
|
}}</el-tag></el-descriptions-item
|
||||||
|
>
|
||||||
|
<el-descriptions-item label="责任部门">{{
|
||||||
|
modelv.dept_res_name
|
||||||
|
}}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="责任人">{{
|
||||||
|
modelv.user_res_name
|
||||||
|
}}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="所在区域"> </el-descriptions-item>
|
||||||
|
<el-descriptions-item label="具体地点">
|
||||||
|
{{ modelv.place }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
</el-card>
|
||||||
|
<el-card header="风险列表" shadow="hover" style="margin-top: 8px">
|
||||||
|
<scTable
|
||||||
|
ref="table"
|
||||||
|
:apiObj="apiObj"
|
||||||
|
row-key="id"
|
||||||
|
:query="query"
|
||||||
|
hidePagination
|
||||||
|
hideDo
|
||||||
|
style="height: 400px"
|
||||||
|
>
|
||||||
|
<el-table-column
|
||||||
|
label="名称"
|
||||||
|
prop="name"
|
||||||
|
min-width="100"
|
||||||
|
></el-table-column>
|
||||||
|
</scTable>
|
||||||
|
</el-card>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { riskLevelEnum, manageLevelEnum, riskTypeEnum } from "@/utils/enum.js";
|
||||||
|
export default {
|
||||||
|
name: "risk",
|
||||||
|
props: {
|
||||||
|
modelv: { type: Object, default: () => {} },
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
riskLevelEnum,
|
||||||
|
manageLevelEnum,
|
||||||
|
riskTypeEnum,
|
||||||
|
apiObj: this.$API.dpm.risk.list,
|
||||||
|
query: {
|
||||||
|
search: "",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {},
|
||||||
|
created() {},
|
||||||
|
mounted() {},
|
||||||
|
computed: {},
|
||||||
|
watch: {},
|
||||||
|
components: {},
|
||||||
|
};
|
||||||
|
</script>
|
|
@ -0,0 +1,284 @@
|
||||||
|
<template>
|
||||||
|
<el-container>
|
||||||
|
<el-header>
|
||||||
|
<div class="left-panel">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-plus"
|
||||||
|
@click="table_add"
|
||||||
|
v-auth="'riskpoint.create'"
|
||||||
|
></el-button>
|
||||||
|
</div>
|
||||||
|
<div class="right-panel">
|
||||||
|
<el-input
|
||||||
|
style="margin-right: 5px"
|
||||||
|
v-model="query.search"
|
||||||
|
placeholder="名称"
|
||||||
|
clearable
|
||||||
|
></el-input>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-search"
|
||||||
|
@click="handleQuery"
|
||||||
|
></el-button>
|
||||||
|
</div>
|
||||||
|
</el-header>
|
||||||
|
<el-main class="nopadding">
|
||||||
|
<scTable ref="table" :apiObj="apiObj" row-key="id" :query="query">
|
||||||
|
<el-table-column label="类型" prop="type">
|
||||||
|
<template #default="scope"
|
||||||
|
>{{ riskTypeEnum[scope.row.type]?.text }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="等级" prop="level">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-tag :type="riskLevelEnum[scope.row.level]?.type">{{
|
||||||
|
riskLevelEnum[scope.row.level]?.text }}</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="名称"
|
||||||
|
prop="name"
|
||||||
|
min-width="100"
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="所在区域"
|
||||||
|
prop="area_name"
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="具体地点"
|
||||||
|
prop="area_name"
|
||||||
|
min-width="100"
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="责任部门"
|
||||||
|
prop="dept_res_name"
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="责任人"
|
||||||
|
prop="user_res_name"
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="操作"
|
||||||
|
fixed="right"
|
||||||
|
align="center"
|
||||||
|
width="150"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
size="small"
|
||||||
|
@click="table_edit(scope.row)"
|
||||||
|
v-auth="'riskpoint.update'"
|
||||||
|
type="primary"
|
||||||
|
>编辑</el-button>
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
size="small"
|
||||||
|
@click="risk_set(scope.row)"
|
||||||
|
v-auth="'riskpoint.update'"
|
||||||
|
type="warning"
|
||||||
|
>风险配置</el-button>
|
||||||
|
<el-popconfirm
|
||||||
|
title="确定删除吗?"
|
||||||
|
@confirm="table_del(scope.row, scope.$index)"
|
||||||
|
>
|
||||||
|
<template #reference>
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
size="small"
|
||||||
|
v-auth="'riskpoint.delete'"
|
||||||
|
type="danger"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-popconfirm>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</scTable>
|
||||||
|
</el-main>
|
||||||
|
<el-dialog v-model="saveDialog" title="新增/编辑">
|
||||||
|
<el-form :model="saveForm" label-width="100px" ref="saveForm">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="类型" prop="type" required>
|
||||||
|
<el-select
|
||||||
|
v-model="saveForm.type"
|
||||||
|
clearable
|
||||||
|
style="width: 100%"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="e in riskTypeEnum.values"
|
||||||
|
:key="e.key"
|
||||||
|
:value="e.key"
|
||||||
|
:label="e.text"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="等级" prop="level" required>
|
||||||
|
<el-select
|
||||||
|
v-model="saveForm.level"
|
||||||
|
clearable
|
||||||
|
style="width: 100%"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="e in riskLevelEnum.values"
|
||||||
|
:key="e.key"
|
||||||
|
:value="e.key"
|
||||||
|
:label="e.text"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="名称" prop="name" required>
|
||||||
|
<el-input v-model="saveForm.name" clearable></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="责任部门" prop="dept_res" required>
|
||||||
|
<el-select
|
||||||
|
v-model="saveForm.dept_res"
|
||||||
|
style="width: 100%"
|
||||||
|
filterable
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="e in deptOptions"
|
||||||
|
:key="e.id"
|
||||||
|
:value="e.id"
|
||||||
|
:label="e.name"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="责任人" prop="user_res" required>
|
||||||
|
<span style="display:flex">
|
||||||
|
<el-input readonly v-model="saveForm.user_res_name"></el-input>
|
||||||
|
<span style="width: 4px"></span>
|
||||||
|
<ehsUserSelect :multiple="false" @submit="getUserRes"/>
|
||||||
|
</span>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="所在区域" prop="area">
|
||||||
|
<el-select
|
||||||
|
v-model="saveForm.area"
|
||||||
|
style="width: 100%"
|
||||||
|
filterable
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="e in areaOptions"
|
||||||
|
:key="e.id"
|
||||||
|
:value="e.id"
|
||||||
|
:label="e.name"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="具体地点" prop="place">
|
||||||
|
<el-input v-model="saveForm.place" clearable></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
:loading="formSaving"
|
||||||
|
@click="formSubmit()"
|
||||||
|
>保 存</el-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
<el-drawer v-model="drawerVisible" title="风险点详情" size="40%">
|
||||||
|
<Risk :modelv="rowData"></Risk>
|
||||||
|
</el-drawer>
|
||||||
|
</el-container>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { riskLevelEnum, manageLevelEnum, riskTypeEnum } from "@/utils/enum.js";
|
||||||
|
import Risk from "./risk.vue"
|
||||||
|
const defaultForm = {};
|
||||||
|
export default {
|
||||||
|
components:{ Risk },
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
riskTypeEnum, riskLevelEnum, manageLevelEnum,
|
||||||
|
drawerVisible: false,
|
||||||
|
formSaving: false,
|
||||||
|
saveDialog: false,
|
||||||
|
query: {
|
||||||
|
search: "",
|
||||||
|
},
|
||||||
|
apiObj: this.$API.dpm.riskpoint.list,
|
||||||
|
saveForm: Object.assign({}, defaultForm),
|
||||||
|
deptOptions:[],
|
||||||
|
rowData: {}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.getDeptOptions();
|
||||||
|
this.getAreaOptions();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
risk_set(row) {
|
||||||
|
this.rowData = row;
|
||||||
|
this.drawerVisible = true;
|
||||||
|
},
|
||||||
|
getAreaOptions() {
|
||||||
|
this.$API.am.area.list.req({page: 0}).then(res=>{
|
||||||
|
this.areaOptions = res
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getDeptOptions() {
|
||||||
|
this.$API.system.dept.list.req({page: 0}).then(res=>{
|
||||||
|
this.deptOptions = res
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getUserRes(data) {
|
||||||
|
this.saveForm.user_res=data.id;
|
||||||
|
this.saveForm.user_res_name=data.name
|
||||||
|
},
|
||||||
|
handleQuery() {
|
||||||
|
this.$refs.table.queryData(this.query);
|
||||||
|
},
|
||||||
|
table_add() {
|
||||||
|
this.saveDialog = true;
|
||||||
|
},
|
||||||
|
table_edit(row) {
|
||||||
|
this.saveForm = Object.assign({}, row);
|
||||||
|
this.saveDialog = true;
|
||||||
|
},
|
||||||
|
table_del(row, index){
|
||||||
|
this.$API.dpm.riskpoint.delete.req(row.id).then(res=>{
|
||||||
|
this.$message.success("删除成功");
|
||||||
|
this.handleQuery();
|
||||||
|
})
|
||||||
|
},
|
||||||
|
formSubmit() {
|
||||||
|
this.formSaving = true;
|
||||||
|
if (this.saveForm.id){
|
||||||
|
this.$API.dpm.riskpoint.update.req(this.saveForm.id, this.saveForm).then(res=>{
|
||||||
|
this.$message.success("更新成功");
|
||||||
|
this.formSaving = false;
|
||||||
|
this.saveDialog = false;
|
||||||
|
this.handleQuery();
|
||||||
|
}).catch(e=>{this.formSaving=false})
|
||||||
|
}else{
|
||||||
|
this.$API.dpm.riskpoint.create.req(this.saveForm).then(res=>{
|
||||||
|
this.$message.success("创建成功");
|
||||||
|
this.formSaving = false;
|
||||||
|
this.saveDialog = false;
|
||||||
|
this.handleQuery();
|
||||||
|
}).catch(err=>{
|
||||||
|
this.formSaving = false;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
Loading…
Reference in New Issue