|
|
@@ -29,8 +29,8 @@
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
<el-form-item prop="planType" label="计划类型:">
|
|
|
- <el-select
|
|
|
- @change="changeData"
|
|
|
+ <el-select :disabled="isChildren()"
|
|
|
+ @change="changeData"
|
|
|
label="计划类型"
|
|
|
v-model="formData.planType"
|
|
|
placeholder="请选择计划类型"
|
|
|
@@ -48,7 +48,7 @@
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
<el-form-item prop="planCycle" label="履职周期:">
|
|
|
- <el-select
|
|
|
+ <el-select :disabled="isChildren()"
|
|
|
prop="planCycle"
|
|
|
label="履职周期"
|
|
|
v-model="formData.planCycle"
|
|
|
@@ -67,7 +67,7 @@
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
<el-form-item prop="planStatus" label="计划状态:">
|
|
|
- <el-select
|
|
|
+ <el-select
|
|
|
:disabled="getDistributePlanStatus()"
|
|
|
prop="planStatus"
|
|
|
label="计划状态"
|
|
|
@@ -75,7 +75,7 @@
|
|
|
placeholder="请选择计划状态"
|
|
|
clearable
|
|
|
>
|
|
|
- <el-option
|
|
|
+ <el-option
|
|
|
v-for="item in dict.type.resumption_plan_status"
|
|
|
:key="item.value"
|
|
|
:label="item.label"
|
|
|
@@ -89,7 +89,7 @@
|
|
|
<el-row>
|
|
|
<el-col :span="6">
|
|
|
<el-form-item prop="execOrgType" label="履职机构类型:">
|
|
|
- <el-select
|
|
|
+ <el-select :disabled="isChildren()"
|
|
|
label="履职机构类型"
|
|
|
v-model="formData.execOrgType"
|
|
|
placeholder="请选择履职机构类型"
|
|
|
@@ -108,8 +108,9 @@
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
<el-form-item prop="roleList" label="履职角色:">
|
|
|
- <el-select
|
|
|
- :disabled="isSubmitting"
|
|
|
+ <el-select
|
|
|
+ @visible-change="onOrgTypeChanged"
|
|
|
+ :disabled="isChildren()"
|
|
|
label="履职角色"
|
|
|
v-model="formData.roleList"
|
|
|
placeholder="请选择履职角色"
|
|
|
@@ -129,7 +130,7 @@
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
<el-form-item prop="planExec" label="履职时间:">
|
|
|
- <el-select
|
|
|
+ <el-select :disabled="isChildren()"
|
|
|
label="履职时间"
|
|
|
v-model="formData.planExec"
|
|
|
placeholder="请选择履职时间"
|
|
|
@@ -146,8 +147,9 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
- <el-form-item prop="count" label="履职次数:">
|
|
|
- <el-input-number :disabled="getPlanExec()"
|
|
|
+ <el-form-item prop="count" label="履职次数:" v-if="false">
|
|
|
+ <el-input-number
|
|
|
+ :disabled="getPlanExec()"
|
|
|
style="margin-left: 10px"
|
|
|
v-model="formData.count"
|
|
|
controls-position="right"
|
|
|
@@ -159,7 +161,12 @@
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-form-item prop="note" label="备注">
|
|
|
- <el-input v-model="formData.note" :maxlength="255" clearable placeholder="请输入备注"/>
|
|
|
+ <el-input :disabled="isChildren()"
|
|
|
+ v-model="formData.note"
|
|
|
+ :maxlength="255"
|
|
|
+ clearable
|
|
|
+ placeholder="请输入备注"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<el-button @click="openSelect">新增履职内容</el-button>
|
|
|
@@ -193,7 +200,12 @@
|
|
|
<el-table-column prop="areaName" label="履职区域"> </el-table-column>
|
|
|
<el-table-column prop="areaName" label="操作">
|
|
|
<template v-slot="{ row }">
|
|
|
- <el-button v-if="getshenglianshe()" type="text" @click="removeRow(row)">删除</el-button>
|
|
|
+ <el-button
|
|
|
+ v-if="getshenglianshe()"
|
|
|
+ type="text"
|
|
|
+ @click="removeRow(row)"
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
@@ -233,7 +245,7 @@ export default {
|
|
|
// let o=statusOptions;
|
|
|
// debugger
|
|
|
return {
|
|
|
- isSubmitting:false,
|
|
|
+ isSubmitting: false,
|
|
|
defaultSelect: [],
|
|
|
selectedValues: [],
|
|
|
resumptionRoles: [],
|
|
|
@@ -313,33 +325,156 @@ export default {
|
|
|
...mapGetters(["orgId", "orgName"]),
|
|
|
},
|
|
|
methods: {
|
|
|
- //省联社履职内容不能删除
|
|
|
- getshenglianshe(){
|
|
|
- if(this.formData.planCreateOrgType!=null&&this.formData.planCreateOrgType==1&&this.formData.distributePlanStatus!=null){
|
|
|
+ //是否子计划判断
|
|
|
+ isChildren(){
|
|
|
+ if (
|
|
|
+ this.formData.distributePlanStatus != null||this.id==null ||this.formData.children==null
|
|
|
+ ) {
|
|
|
return false;
|
|
|
- }else
|
|
|
- return true;
|
|
|
+ } else return true;
|
|
|
|
|
|
},
|
|
|
+ //省联社履职内容不能删除
|
|
|
+ getshenglianshe() {
|
|
|
+ if (
|
|
|
+ this.formData.planCreateOrgType != null &&
|
|
|
+ this.formData.planCreateOrgType == 1 &&
|
|
|
+ this.formData.distributePlanStatus != null
|
|
|
+ ) {
|
|
|
+ return false;
|
|
|
+ } else return true;
|
|
|
+ },
|
|
|
//选择计划类型修改联动框
|
|
|
- changeData(){
|
|
|
- this.formData.planCycle=null;
|
|
|
- this.formData.execOrgType=null;
|
|
|
- this.formData.roleList=null;
|
|
|
- this.formData.planExec=null;
|
|
|
- this.formData.count=null;
|
|
|
- this.tableData=null;
|
|
|
+ changeData() {
|
|
|
+ //判断计划类型
|
|
|
+ switch (this.formData.planType) {
|
|
|
+ //如果是 营业前安全检查
|
|
|
+ case "1":
|
|
|
+ //周期
|
|
|
+ this.formData.planCycle = "2";
|
|
|
+ //机构类型
|
|
|
+ this.formData.execOrgType = "4";
|
|
|
+ this.getRolesByOrg();
|
|
|
+ //角色
|
|
|
+ this.formData.roleList = ["122"];
|
|
|
+ //履职时间
|
|
|
+ this.formData.planExec = "2";
|
|
|
+ //履职次数
|
|
|
+ this.formData.count = 1;
|
|
|
+ //履职内容
|
|
|
+ this.tableData = null;
|
|
|
+ break;
|
|
|
+ //如果是 营业期间安全管理
|
|
|
+ case "2":
|
|
|
+ //周期
|
|
|
+ this.formData.planCycle = "2";
|
|
|
+ //机构类型
|
|
|
+ this.formData.execOrgType = "4";
|
|
|
+ this.getRolesByOrg();
|
|
|
+ //角色
|
|
|
+ this.formData.roleList = ["122"];
|
|
|
+ //履职时间
|
|
|
+ this.formData.planExec = "3";
|
|
|
+ //履职次数
|
|
|
+ this.formData.count = 1;
|
|
|
+ //履职内容
|
|
|
+ this.tableData = null;
|
|
|
+ break;
|
|
|
+ //如果是 营业终了安全管理
|
|
|
+ case "3":
|
|
|
+ //周期
|
|
|
+ this.formData.planCycle = "2";
|
|
|
+ //机构类型
|
|
|
+ this.formData.execOrgType = "4";
|
|
|
+ this.getRolesByOrg();
|
|
|
+ //角色
|
|
|
+ this.formData.roleList = ["122"];
|
|
|
+ //履职时间
|
|
|
+ this.formData.planExec = "4";
|
|
|
+ //履职次数
|
|
|
+ this.formData.count = 1;
|
|
|
+ //履职内容
|
|
|
+ this.tableData = null;
|
|
|
+ break;
|
|
|
+ //如果是 “110”入侵报警系统测试
|
|
|
+ case "4":
|
|
|
+ //周期
|
|
|
+ this.formData.planCycle = "4";
|
|
|
+ //机构类型
|
|
|
+ this.formData.execOrgType = "4";
|
|
|
+ this.getRolesByOrg();
|
|
|
+ //角色
|
|
|
+ this.formData.roleList = ["122"];
|
|
|
+ //履职时间
|
|
|
+ this.formData.planExec = "1";
|
|
|
+ //履职次数
|
|
|
+ this.formData.count = 1;
|
|
|
+ //履职内容
|
|
|
+ this.tableData = null;
|
|
|
+ break;
|
|
|
+ //如果是 备用电源维护
|
|
|
+ case "5":
|
|
|
+ //周期
|
|
|
+ this.formData.planCycle = "4";
|
|
|
+ //机构类型
|
|
|
+ this.formData.execOrgType = "4";
|
|
|
+ this.getRolesByOrg();
|
|
|
+ //角色
|
|
|
+ this.formData.roleList = ["122"];
|
|
|
+ //履职时间
|
|
|
+ this.formData.planExec = "1";
|
|
|
+ //履职次数
|
|
|
+ this.formData.count = 1;
|
|
|
+ //履职内容
|
|
|
+ this.tableData = null;
|
|
|
+ break;
|
|
|
+ //如果是 离行式自助银行巡检
|
|
|
+ case "6":
|
|
|
+ //周期
|
|
|
+ this.formData.planCycle = "2";
|
|
|
+ //机构类型
|
|
|
+ this.formData.execOrgType = "5";
|
|
|
+ this.getRolesByOrg();
|
|
|
+ //角色
|
|
|
+ this.formData.roleList = ["129"];
|
|
|
+ //履职时间
|
|
|
+ this.formData.planExec = "1";
|
|
|
+ //履职次数
|
|
|
+ this.formData.count = 1;
|
|
|
+ //履职内容
|
|
|
+ this.tableData = null;
|
|
|
+ break;
|
|
|
+ //如果是 非营业时间安全管理
|
|
|
+ case "7":
|
|
|
+ //周期
|
|
|
+ this.formData.planCycle = "2";
|
|
|
+ //机构类型
|
|
|
+ this.formData.execOrgType = "4";
|
|
|
+ this.getRolesByOrg();
|
|
|
+ //角色
|
|
|
+ this.formData.roleList = ["143"];
|
|
|
+ //履职时间
|
|
|
+ this.formData.planExec = "5";
|
|
|
+ //履职次数
|
|
|
+ this.formData.count = 1;
|
|
|
+ //履职内容
|
|
|
+ this.tableData = null;
|
|
|
+ break;
|
|
|
+ }
|
|
|
},
|
|
|
//当时间为全天或者营业中才显示
|
|
|
- getPlanExec(){
|
|
|
- if(this.formData.planExec==null||this.formData.planExec==2||this.formData.planExec==4){
|
|
|
+ getPlanExec() {
|
|
|
+ if (
|
|
|
+ this.formData.planExec == null ||
|
|
|
+ this.formData.planExec == 2 ||
|
|
|
+ this.formData.planExec == 4
|
|
|
+ ) {
|
|
|
return true;
|
|
|
- }else
|
|
|
- return false;
|
|
|
+ } else return false;
|
|
|
},
|
|
|
getDistributePlanStatus() {
|
|
|
// console.log(this.formData.distributePlanStatus, "distributePlanStatus");
|
|
|
- if (this.formData.distributePlanStatus==1) {
|
|
|
+ if (this.formData.distributePlanStatus == 1) {
|
|
|
return true;
|
|
|
} else return false;
|
|
|
},
|
|
|
@@ -362,18 +497,20 @@ export default {
|
|
|
planCreateOrgName: null,
|
|
|
roleList: null,
|
|
|
distributePlanStatus: null,
|
|
|
- planCreateOrgType:null,
|
|
|
+ planCreateOrgType: null,
|
|
|
};
|
|
|
},
|
|
|
getRolesByOrg() {
|
|
|
+ if(this.formData.execOrgType!=null){
|
|
|
let params = {
|
|
|
orgType: this.formData.execOrgType,
|
|
|
};
|
|
|
+
|
|
|
findAllRole(params).then((res) => {
|
|
|
// console.info(res);
|
|
|
this.resumptionRoles = res.data;
|
|
|
});
|
|
|
- },
|
|
|
+ }},
|
|
|
handleChange(value) {
|
|
|
console.log(value);
|
|
|
this.count = value;
|
|
|
@@ -389,8 +526,8 @@ export default {
|
|
|
if (this.tableData == null) {
|
|
|
this.tableData = [];
|
|
|
}
|
|
|
- let selectedIds= selectList.map(i=>i.id);
|
|
|
- this.tableData=this.tableData.filter(d=>selectedIds.includes(d.id))
|
|
|
+ let selectedIds = selectList.map((i) => i.id);
|
|
|
+ this.tableData = this.tableData.filter((d) => selectedIds.includes(d.id));
|
|
|
for (let i = 0; i < selectList.length; i++) {
|
|
|
let item = selectList[i];
|
|
|
let exist = this.tableData.find((d) => d.id == item.id);
|
|
|
@@ -411,7 +548,8 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
onOrgTypeChanged() {
|
|
|
- this.formData.roleList=null;
|
|
|
+
|
|
|
+
|
|
|
this.getRolesByOrg();
|
|
|
},
|
|
|
async show(id, other = {}) {
|
|
|
@@ -431,15 +569,13 @@ export default {
|
|
|
},
|
|
|
removeRow(row) {
|
|
|
this.$modal
|
|
|
- .confirm('是否确认删除?')
|
|
|
- .then(function () {
|
|
|
-
|
|
|
- })
|
|
|
+ .confirm("是否确认删除?")
|
|
|
+ .then(function () {})
|
|
|
.then(() => {
|
|
|
this.tableData = this.tableData.filter((item) => item !== row);
|
|
|
this.$modal.msgSuccess("删除成功");
|
|
|
- })
|
|
|
-
|
|
|
+ });
|
|
|
+
|
|
|
// this.tableData.splice(index, 1);
|
|
|
},
|
|
|
// 事件
|
|
|
@@ -466,16 +602,26 @@ export default {
|
|
|
},
|
|
|
onSubmit() {
|
|
|
this.$refs.form.validate(async (isValidate) => {
|
|
|
- this.isSubmitting=true;
|
|
|
+ this.isSubmitting = true;
|
|
|
// this.formData.note = this.formData.description;
|
|
|
this.formData.planCreateOrgId = this.orgId;
|
|
|
this.formData.planCreateOrgName = this.orgName;
|
|
|
if (!isValidate) return;
|
|
|
this.formData.itemList = this.tableData == null ? [] : this.tableData;
|
|
|
+ //新需求,自动填充角色
|
|
|
+ if (
|
|
|
+ this.formData.roleList != null &&
|
|
|
+ this.formData.roleList.length > 0&&
|
|
|
+ this.selectedValues.length == 0
|
|
|
+ ) {
|
|
|
+ this.formData.roleList.forEach((item) => {
|
|
|
+ this.selectedValues.push(item);
|
|
|
+ });
|
|
|
+ }
|
|
|
this.formData.roleList =
|
|
|
this.selectedValues.length == 0 ? null : this.selectedValues;
|
|
|
await api.update(this.formData);
|
|
|
- this.isSubmitting=false;
|
|
|
+ this.isSubmitting = false;
|
|
|
this.$emit("success");
|
|
|
this.onHide();
|
|
|
});
|