|
|
@@ -64,6 +64,33 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item prop="startDate" label="开始时间:" v-if="formData.planCycle==6">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="formData.startDate"
|
|
|
+ style="width: 240px"
|
|
|
+ value-format="yyyy-MM-dd hh:mm:ss"
|
|
|
+ placeholder="请选择开始时间"
|
|
|
+ type="date"
|
|
|
+ :clearable="false"
|
|
|
+ ></el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item prop="endDate" label="结束时间:" v-if="formData.planCycle==6">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="formData.endDate"
|
|
|
+ style="width: 240px"
|
|
|
+ value-format="yyyy-MM-dd hh:mm:ss"
|
|
|
+ placeholder="请选择结束时间"
|
|
|
+ type="date"
|
|
|
+ :clearable="false"
|
|
|
+ ></el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
<el-col :span="6">
|
|
|
<el-form-item prop="execOrgType" label="检查机构类型:">
|
|
|
<el-select
|
|
|
@@ -84,8 +111,8 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
+ <!-- </el-row> -->
|
|
|
+ <!-- <el-row> -->
|
|
|
<el-col :span="6">
|
|
|
<el-form-item prop="roleIds" label="检查角色:">
|
|
|
<el-select
|
|
|
@@ -142,7 +169,7 @@
|
|
|
<el-col :span="6">
|
|
|
<el-form-item prop="buildTaskNow" label="立即生效:">
|
|
|
<el-checkbox
|
|
|
- :disabled="id ?true:false"
|
|
|
+ :disabled="id ? true : false"
|
|
|
v-model="formData.buildTaskNow"
|
|
|
size="medium"
|
|
|
@change="handleCheckboxChange"
|
|
|
@@ -152,25 +179,7 @@
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
- <el-col :span="6">
|
|
|
- <el-form-item prop="planStatus" label="计划状态">
|
|
|
- <!-- <el-select
|
|
|
- label="计划状态"
|
|
|
- v-model="formData.planStatus"
|
|
|
- placeholder="请选择计划状态"
|
|
|
- clearable
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in dict.type.check_status"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
- >
|
|
|
- </el-option>
|
|
|
- </el-select> -->
|
|
|
- <el-switch v-model="formData.planStatus" active-value="1" inactive-value="2"></el-switch>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
+
|
|
|
<el-col :span="6">
|
|
|
<el-form-item :span="6" prop="execOrgIds" label="检查机构">
|
|
|
<org-tree-select
|
|
|
@@ -195,6 +204,29 @@
|
|
|
</org-tree-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item prop="planStatus" label="计划状态">
|
|
|
+ <!-- <el-select
|
|
|
+ label="计划状态"
|
|
|
+ v-model="formData.planStatus"
|
|
|
+ placeholder="请选择计划状态"
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in dict.type.check_status"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select> -->
|
|
|
+ <el-switch
|
|
|
+ v-model="formData.planStatus"
|
|
|
+ active-value="1"
|
|
|
+ inactive-value="2"
|
|
|
+ ></el-switch>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
|
<el-form-item :span="6" prop="description" label="备注">
|
|
|
<el-input
|
|
|
@@ -203,6 +235,7 @@
|
|
|
clearable
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
+
|
|
|
</el-form>
|
|
|
<el-button @click="openSelect">新增检查内容</el-button>
|
|
|
|
|
|
@@ -232,7 +265,7 @@
|
|
|
<el-table-column prop="itemName" label="检查项"> </el-table-column>
|
|
|
<el-table-column prop="pointName" label="检查内容"> </el-table-column>
|
|
|
<el-table-column prop="areaName" label="检查区域"> </el-table-column>
|
|
|
- <el-table-column prop="businessType" label="数据来源">
|
|
|
+ <el-table-column prop="businessType" label="数据来源">
|
|
|
<template slot-scope="r">
|
|
|
{{
|
|
|
getLabel(dict.type.point_data_source, `${r.row.businessType}`)
|
|
|
@@ -270,10 +303,16 @@ import korgTree from "@/components/k-orgTree";
|
|
|
import * as api from "@/api/safetycheck/plan";
|
|
|
import { statusOptions } from "@/views/commonOption";
|
|
|
import { findAllRole } from "@/api/system/role";
|
|
|
-import { getLabel } from "@/views/commonOption";
|
|
|
+import { getLabel } from "@/views/commonOption";
|
|
|
import DialogSelect from "@/views/safetycheck/ruleManager/dialog.select.point.vue";
|
|
|
export default {
|
|
|
- dicts: ["sys_org_type", "check_type", "check_cycle", "check_status","point_data_source"],
|
|
|
+ dicts: [
|
|
|
+ "sys_org_type",
|
|
|
+ "check_type",
|
|
|
+ "check_cycle",
|
|
|
+ "check_status",
|
|
|
+ "point_data_source",
|
|
|
+ ],
|
|
|
data() {
|
|
|
return {
|
|
|
defaultSelect: [],
|
|
|
@@ -344,8 +383,7 @@ export default {
|
|
|
children: node.children,
|
|
|
};
|
|
|
},
|
|
|
- handleCheckboxChange() {
|
|
|
- },
|
|
|
+ handleCheckboxChange() {},
|
|
|
reset() {
|
|
|
return {
|
|
|
planName: null,
|
|
|
@@ -374,8 +412,8 @@ export default {
|
|
|
checkOrgIds: null,
|
|
|
execOrgIds: null,
|
|
|
rulePointIds: null,
|
|
|
- checkOrgType:null,
|
|
|
- checkType:null,
|
|
|
+ checkOrgType: null,
|
|
|
+ checkType: null,
|
|
|
};
|
|
|
},
|
|
|
getRolesByOrg() {
|
|
|
@@ -390,56 +428,58 @@ export default {
|
|
|
this.count = value;
|
|
|
},
|
|
|
async refresh(id, other) {
|
|
|
- if(id!=null&&id!=undefined){
|
|
|
- await api.get(id).then(res=>{
|
|
|
- this.formData =res.data;
|
|
|
- this.formData.buildTaskNow
|
|
|
+ if (id != null && id != undefined) {
|
|
|
+ await api.get(id).then((res) => {
|
|
|
+ this.formData = res.data;
|
|
|
+ this.formData.buildTaskNow;
|
|
|
this.tableData = res.data.rulePointList;
|
|
|
if (this.formData.execOrgType) {
|
|
|
- this.formData.roleIds = this.formData.roleList.map((role) => role.id);
|
|
|
- this.formData.execOrgIds = this.formData.execOrgList.map(
|
|
|
- (org) => org.id
|
|
|
- );
|
|
|
- this.formData.checkOrgIds = this.formData.checkOrgList.map(
|
|
|
- (org) => org.id
|
|
|
- );
|
|
|
- this.getRolesByOrg();
|
|
|
- }
|
|
|
- })
|
|
|
-
|
|
|
- }else{
|
|
|
- this.formData.id=null;
|
|
|
- this.formData.planName= null;
|
|
|
- this.formData.planType= null;
|
|
|
- this.formData.planCycle= null;
|
|
|
- this.formData.planStatus= null;
|
|
|
- this.formData.execOrgType= null;
|
|
|
- this.formData.checkOrgType= null;
|
|
|
- this.formData.checkType= null;
|
|
|
- this.formData.roleNames= null;
|
|
|
- this.formData.count= null;
|
|
|
- this.formData.description= null;
|
|
|
- this.formData.tableData= null;
|
|
|
- this.formData.itemList= null;
|
|
|
- this.formData.planExec= null;
|
|
|
- this.formData.count= 0;
|
|
|
- this.formData.note= null;
|
|
|
- this.formData.planCreateOrgId= null;
|
|
|
- this.formData.planCreateOrgName= null;
|
|
|
- this.formData.roleList= null;
|
|
|
- this.formData.roleIds= null;
|
|
|
- this.formData.execOrg= null;
|
|
|
- this.formData.checkOrg= null;
|
|
|
- this.formData.buildTaskNow= false;
|
|
|
- this.formData.checkOrgList= [];
|
|
|
- this.formData.execOrgList= [];
|
|
|
- this.formData.rulePointList= null;
|
|
|
- this.formData.checkOrgIds= null;
|
|
|
- this.formData.execOrgIds= null;
|
|
|
- this.formData.rulePointIds= null;
|
|
|
+ this.formData.roleIds = this.formData.roleList.map(
|
|
|
+ (role) => role.id
|
|
|
+ );
|
|
|
+ this.formData.execOrgIds = this.formData.execOrgList.map(
|
|
|
+ (org) => org.id
|
|
|
+ );
|
|
|
+ this.formData.checkOrgIds = this.formData.checkOrgList.map(
|
|
|
+ (org) => org.id
|
|
|
+ );
|
|
|
+ this.getRolesByOrg();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.formData.id = null;
|
|
|
+ this.formData.planName = null;
|
|
|
+ this.formData.planType = null;
|
|
|
+ this.formData.planCycle = null;
|
|
|
+ this.formData.planStatus = null;
|
|
|
+ this.formData.execOrgType = null;
|
|
|
+ this.formData.checkOrgType = null;
|
|
|
+ this.formData.checkType = null;
|
|
|
+ this.formData.roleNames = null;
|
|
|
+ this.formData.count = null;
|
|
|
+ this.formData.description = null;
|
|
|
+ this.formData.tableData = null;
|
|
|
+ this.formData.itemList = null;
|
|
|
+ this.formData.planExec = null;
|
|
|
+ this.formData.count = 0;
|
|
|
+ this.formData.note = null;
|
|
|
+ this.formData.planCreateOrgId = null;
|
|
|
+ this.formData.planCreateOrgName = null;
|
|
|
+ this.formData.roleList = null;
|
|
|
+ this.formData.roleIds = null;
|
|
|
+ this.formData.execOrg = null;
|
|
|
+ this.formData.checkOrg = null;
|
|
|
+ this.formData.buildTaskNow = false;
|
|
|
+ this.formData.checkOrgList = [];
|
|
|
+ this.formData.execOrgList = [];
|
|
|
+ this.formData.rulePointList = null;
|
|
|
+ this.formData.checkOrgIds = null;
|
|
|
+ this.formData.execOrgIds = null;
|
|
|
+ this.formData.rulePointIds = null;
|
|
|
}
|
|
|
},
|
|
|
onSelect(selectList) {
|
|
|
+ // console.log(selectList,"selectList");
|
|
|
for (let i = 0; i < selectList.length; i++) {
|
|
|
let tem = {
|
|
|
pointScan: selectList[i].pointScan,
|
|
|
@@ -450,7 +490,7 @@ export default {
|
|
|
areaName: selectList[i].areaName,
|
|
|
itemId: selectList[i].itemId,
|
|
|
id: selectList[i].id,
|
|
|
- businessType:selectList[i].businessType,
|
|
|
+ businessType: selectList[i].businessType,
|
|
|
};
|
|
|
if (this.tableData == null) {
|
|
|
this.tableData = [];
|
|
|
@@ -497,11 +537,12 @@ export default {
|
|
|
this.formData.planCreateOrgId = this.orgId;
|
|
|
this.formData.planCreateOrgName = this.orgName;
|
|
|
if (!isValidate) return;
|
|
|
- this.formData.rulePointList = this.tableData == null ? [] : this.tableData;
|
|
|
+ this.formData.rulePointList =
|
|
|
+ this.tableData == null ? [] : this.tableData;
|
|
|
this.formData.roleList = null;
|
|
|
this.formData.roleIds =
|
|
|
this.selectedValues.length == 0 ? null : this.selectedValues;
|
|
|
-
|
|
|
+
|
|
|
await api.add(this.formData);
|
|
|
this.$emit("success");
|
|
|
this.onHide();
|