+ :full-btn="false" @change="callback" btn-position="end">
{
pageNum: 1,
pageSize: 20,
} as any;
+ this.getTableData()
}
public handleClose() {
@@ -294,7 +295,7 @@ export default class SelfAssessment extends BaseRecordComponent {
this.toggleAll()
} else {
this.tableData.datas.forEach((item, index) => {
- const find = this.selectData.find((data: any) => data.userId === item.userId);
+ const find = this.selectData.find((data: any) => data.id === item.id);
if (!find) {
(this.$refs.multipleTable as any).toggleRowSelection(item);
}
diff --git a/src/views/risk/assessment/device/device.component.html b/src/views/risk/assessment/device/device.component.html
index c69ee7f..0c794a8 100644
--- a/src/views/risk/assessment/device/device.component.html
+++ b/src/views/risk/assessment/device/device.component.html
@@ -47,7 +47,7 @@
width="952px" :before-close="handleClose" destroy-on-close>
+ :full-btn="true" btnPosition="center" ref="basicForm">
检查项目
@@ -98,7 +98,5 @@
-
-
\ No newline at end of file
diff --git a/src/views/risk/assessment/device/device.component.vue b/src/views/risk/assessment/device/device.component.vue
index 86f1d26..bd3eca2 100644
--- a/src/views/risk/assessment/device/device.component.vue
+++ b/src/views/risk/assessment/device/device.component.vue
@@ -151,6 +151,7 @@ export default class DeviceManagerComponent extends BaseRecordComponent
{
type: "text",
require: true,
width: "calc(50% - 20px)",
+ showError: false,
}, {
name: "设备类型",
key: "type",
@@ -158,6 +159,7 @@ export default class DeviceManagerComponent extends BaseRecordComponent {
type: "select",
require: true,
width: "calc(50% - 20px)",
+ showError: false,
datas: this.$store.state.prevention_device_type
}, {
name: "涉及岗位",
@@ -165,8 +167,9 @@ export default class DeviceManagerComponent extends BaseRecordComponent {
format: "postName",
multiple: true,
require: true,
+ showError: false,
type: "select",
- width: "calc(50% - 20px)",
+ width: "100%",
datas: this.$store.state.postList
}, {
name: "安全因素",
@@ -217,25 +220,41 @@ export default class DeviceManagerComponent extends BaseRecordComponent {
type: "primary"
}];
}
-
- public projectOptions: FormOption[] = [
- {
- name: "检查项目",
- key: "name",
- type: "textarea",
- require: true,
- width: "100%",
- },
- {
- name: "检查标准",
- key: "standard",
- type: "textarea",
- require: true,
- width: "100%",
- },
- ];
-
-
+ public projectOptions: FormOption[] = [];
+ public subUpdateActions = [] as any;
+ public buildSubActionsForm() {
+ this.projectOptions = [
+ {
+ name: "检查项目",
+ key: "name",
+ type: "textarea",
+ require: true,
+ width: "100%",
+ showError: false,
+ },
+ {
+ name: "检查标准",
+ key: "standard",
+ type: "textarea",
+ require: true,
+ width: "100%",
+ showError: false,
+ },
+ ];
+ this.subUpdateActions = [{
+ name: "取消",
+ value: "cancel"
+ }, {
+ name: "保存并继续添加",
+ value: "saveAndContinue",
+ type: "primary",
+ hide: this.updateProParams.index
+ }, {
+ name: "保存",
+ value: "save",
+ type: "primary"
+ }];
+ }
@Watch("$store.state.deptList", { immediate: true, deep: true })
onChanges() {
@@ -392,7 +411,8 @@ export default class DeviceManagerComponent extends BaseRecordComponent {
items: [], identifyUserId: this.account.userId,
identifyTime: moment().format('YYYY-MM-DD'),
} as any;
- this.buildActionsForm()
+ this.buildActionsForm();
+ this.buildUpdateForm();
this.showUpdate = true
} else if (data && data.value.indexOf("save") >= 0) {
this.doSave(data.value !== "save")
@@ -443,18 +463,20 @@ export default class DeviceManagerComponent extends BaseRecordComponent {
}
public doSave(goOn?) {
- // 新增
- this.updateParams.itemNum = this.updateParams.items.length;
- this.updateParams.postCode = this.updateParams.postCode.join(",")
- this.updateParams.safetyFactor = this.updateParams.safetyFactor.join(",")
- this.tableService.addOrUpdate(this.updateParams, this.updateParams.id ? false : true).then((res) => {
- this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功!");
- this.updateParams = {
- items: [],
- } as any
- this.showUpdate = !!goOn;
- this.getTableData();
- })
+ if ((this.$refs.basicForm as any).vaildParams()) {
+ // 新增
+ this.updateParams.itemNum = this.updateParams.items.length;
+ this.updateParams.postCode = this.updateParams.postCode.join(",")
+ this.updateParams.safetyFactor = this.updateParams.safetyFactor.join(",")
+ this.tableService.addOrUpdate(this.updateParams, this.updateParams.id ? false : true).then((res) => {
+ this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功!");
+ this.updateParams = {
+ items: [],
+ } as any
+ this.showUpdate = !!goOn;
+ this.getTableData();
+ })
+ }
}
public handleClose() {
@@ -463,17 +485,17 @@ export default class DeviceManagerComponent extends BaseRecordComponent {
public toggleAll() {
-
this.tableData.datas.forEach((item, index) => {
(this.$refs.multipleTable as any).toggleRowSelection(item);
})
}
+
public selectAll() {
if (!this.selectData.length) {
this.toggleAll()
} else {
this.tableData.datas.forEach((item, index) => {
- const find = this.selectData.find((data: any) => data.userId === item.userId);
+ const find = this.selectData.find((data: any) => data.id === item.id);
if (!find) {
(this.$refs.multipleTable as any).toggleRowSelection(item);
}
@@ -488,7 +510,10 @@ export default class DeviceManagerComponent extends BaseRecordComponent {
//检查项目
public projectCallback(data) {
if (data && data.value === 'add') {
- this.showProject = true
+ this.proIsReadonly = false;
+ this.buildSubActionsForm()
+ this.showProject = true;
+
} else if (data && data.value === 'delete') {
// 批量删除步骤
this.deleteProData(this.selectData.map((itm: any) => itm.index - 1))
@@ -504,6 +529,7 @@ export default class DeviceManagerComponent extends BaseRecordComponent {
} else {
this.updateProParams = JSON.parse(JSON.stringify(row));
}
+ this.buildSubActionsForm()
}
//删除
public deleteProData(indexs) {
diff --git a/src/views/risk/assessment/work/work.component.html b/src/views/risk/assessment/work/work.component.html
index 712f323..4d917da 100644
--- a/src/views/risk/assessment/work/work.component.html
+++ b/src/views/risk/assessment/work/work.component.html
@@ -96,7 +96,7 @@
diff --git a/src/views/risk/assessment/work/work.component.vue b/src/views/risk/assessment/work/work.component.vue
index 7cf91bf..4a5188c 100644
--- a/src/views/risk/assessment/work/work.component.vue
+++ b/src/views/risk/assessment/work/work.component.vue
@@ -332,7 +332,8 @@ export default class WorkManagerComponent extends BaseRecordComponent {
userName: item.chargeUserName,
}
});
- this.buildUpdateForm()
+ const option = this.updateOptions.find(item => item.key === "unitId") as any;
+ option.datas = this.unitList
})
}
// 树点击
@@ -395,6 +396,8 @@ export default class WorkManagerComponent extends BaseRecordComponent {
this.updateParams.chargeUserId = unitData.userId;
this.updateParams.chargeUserName = unitData.userName;
this.updateParams.chargeDeptId = unitData.deptId;
+ const option = this.updateOptions.find(item => item.key === "chargeUserId") as any;
+ option.showError = false
}
// 部门
if (item && item.key === "chargeDeptId") {
@@ -428,8 +431,12 @@ export default class WorkManagerComponent extends BaseRecordComponent {
this.updateParams.postName = data.map(itm => this.$store.getters.post_map[itm]).join(",");
}
}
-
- public callback(data, type?) {
+ /**
+ * 按钮操作函数
+ * @param data
+ * @param type
+ */
+ public callback(data: any, type?) {
if (type) {
this.params[type] = data;
this.getTableData();
@@ -463,6 +470,14 @@ export default class WorkManagerComponent extends BaseRecordComponent {
}
}
+ public subCallback(data: any, type: any) {
+ if (data && data.value.indexOf("save") >= 0) {
+ this.doSubSave(data.value !== "save")
+ } else if (data && data.value === "cancel") {
+ this.handleClose()
+ }
+ }
+
public showSubUpdateModel(row?) {
this.stepUpdateParams = {} as any;
if (row) {
@@ -485,25 +500,15 @@ export default class WorkManagerComponent extends BaseRecordComponent {
}
-
+ /**
+ * 保存数据
+ * @param goOn
+ */
public doSave(goOn?) {
if (this.updateParams.steps.length === 0) {
this.$message.warning("请您至少添加一条作业步骤!");
return
}
- // 如果是新增步骤
- if (this.showSubUpdate) {
- // 新增
- if (!this.stepUpdateParams.index) {
- this.stepUpdateParams.index = this.updateParams.steps.length + 1;
- this.updateParams.steps.push(this.stepUpdateParams);
- } else {
- this.updateParams.steps.splice(this.updateParams.steps.findIndex(item => item.index === this.stepUpdateParams.index), 1, this.stepUpdateParams)
- }
- this.stepUpdateParams = {} as any;
- this.showSubUpdate = !!goOn;
- return
- }
// 新增清单
this.updateParams.safetyFactor = this.updateParams.safetyFactor.join(",");
this.updateParams.stepNum = this.updateParams.steps.length;
@@ -521,6 +526,20 @@ export default class WorkManagerComponent extends BaseRecordComponent {
this.getTableData();
})
}
+ /**
+ * 保存步骤数据
+ */
+ public doSubSave(goOn?) {
+ if (!this.stepUpdateParams.index) {
+ this.stepUpdateParams.index = this.updateParams.steps.length + 1;
+ this.updateParams.steps.push(this.stepUpdateParams);
+ } else {
+ this.updateParams.steps.splice(this.updateParams.steps.findIndex(item => item.index === this.stepUpdateParams.index), 1, this.stepUpdateParams)
+ }
+ this.stepUpdateParams = {} as any;
+ this.showSubUpdate = !!goOn;
+ return
+ }
// 重置数据
public reset() {
this.params = {
diff --git a/src/views/risk/assessment/work/workAnal.component.vue b/src/views/risk/assessment/work/workAnal.component.vue
index 9695d3c..fe8ef89 100644
--- a/src/views/risk/assessment/work/workAnal.component.vue
+++ b/src/views/risk/assessment/work/workAnal.component.vue
@@ -166,8 +166,6 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent {
public riskLevelMap = {} as any;
public buildUpdateForm() {
- console.log(this.updateParams.id && this.updateParams.status !== 1,);
-
this.updateOptions = [{
name: "选择区域",
key: "areaId",
diff --git a/src/views/threecards/common.component.html b/src/views/threecards/common.component.html
index 6ca0393..c1edcc1 100644
--- a/src/views/threecards/common.component.html
+++ b/src/views/threecards/common.component.html
@@ -47,7 +47,7 @@
+ :isReadonly="isReadonly" ref="basicForm">
处置步骤
@@ -85,9 +85,11 @@