+ :actions="formActions" :full-btn="false" @change="callback" btn-position="end">
-
+
@@ -104,44 +104,4 @@
-
-
\ No newline at end of file
diff --git a/src/views/risk/assessment/device/deviceAnal.component.vue b/src/views/risk/assessment/device/deviceAnal.component.vue
index 97f4113..face15a 100644
--- a/src/views/risk/assessment/device/deviceAnal.component.vue
+++ b/src/views/risk/assessment/device/deviceAnal.component.vue
@@ -236,7 +236,8 @@ export default class DeviceAnalManagerComponent extends BaseRecordComponent
width: "calc(50% - 20px)",
require: true,
showError: false,
- format: "yyyy-MM-dd"
+ format: "yyyy-MM-dd",
+ disable: true,
}, {
name: "区域固有风险等级",
key: "analRiskLevel",
diff --git a/src/views/risk/assessment/work/workAnal.component.vue b/src/views/risk/assessment/work/workAnal.component.vue
index 685d19d..9695d3c 100644
--- a/src/views/risk/assessment/work/workAnal.component.vue
+++ b/src/views/risk/assessment/work/workAnal.component.vue
@@ -131,7 +131,7 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent {
name: "单元名称",
key: "unitName",
type: "text",
- },{
+ }, {
name: "作业活动",
key: "jobInventoryName",
type: "text",
@@ -244,7 +244,8 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent {
width: "calc(50% - 20px)",
require: true,
showError: false,
- format: "yyyy-MM-dd"
+ format: "yyyy-MM-dd",
+ disable:true,
}, {
name: "区域固有风险等级",
key: "analRiskLevel",
@@ -506,7 +507,7 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent {
this.subTableColumn.push({ name: '步骤名称', key: "name" });
this.subTableColumn.push({ name: '作业步骤描述', key: "description", showTip: true, width: "200px" });
this.subTableColumn.push({ name: '作业地点', key: "location" }); this.subTableColumn.push({ name: '风险源', key: "riskSource" });
- this.subTableColumn.push({ name: '危害分析', key: "hazardAnalysis", width: "200px" });
+ this.subTableColumn.push({ name: '危害分析', key: "hazardAnalysis", width: "200px", showTip: true, });
this.subTableColumn.push({
name: '最严重后果', key: "seriousResult", width: "100px", render: (data) => {
if (data.seriousResult) {
@@ -651,6 +652,7 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent {
pageNum: 1,
pageSize: 20,
} as any;
+ this.getTableData()
}
// 分页数据
diff --git a/src/views/threecards/riskCard.component.vue b/src/views/threecards/riskCard.component.vue
index 0f97a9c..891be6b 100644
--- a/src/views/threecards/riskCard.component.vue
+++ b/src/views/threecards/riskCard.component.vue
@@ -58,12 +58,12 @@ export default class RiskCard extends BaseRecordComponent {
public showUpdate = false;
public setpsOptions = [] as any;
-
+
public showFileModal = false;
public showFileList = [] as any;
- public labelWidth='130px'
+ public labelWidth = '130px'
public formActions = [{
name: "查询",
@@ -138,7 +138,7 @@ export default class RiskCard extends BaseRecordComponent {
width: "calc(50% - 20px)",
showError: false,
disable: true,
- labelWidth:"130px"
+ labelWidth: "130px"
},
{
name: "区域名称",
@@ -185,7 +185,7 @@ export default class RiskCard extends BaseRecordComponent {
require: true,
width: "100%",
showError: false,
- labelWidth:'130px'
+ labelWidth: '130px'
},
{
name: "风险等级",
@@ -327,7 +327,7 @@ export default class RiskCard extends BaseRecordComponent {
this.tableColumn.push({ name: '岗位名称', key: "postName", });
this.tableColumn.push({ name: '主要危险有害因素', key: "harmfulFactors", });
this.tableColumn.push({
- name: '风险等级', key: "riskLevel",width:"150px", render: (data) => {
+ name: '风险等级', key: "riskLevel", width: "150px", render: (data) => {
if (data.riskLevel) {
return "" + (data.riskLevel ? (this.$store.getters.prevention_risk_level_map[data.riskLevel]) : '') + ""
}
@@ -398,6 +398,7 @@ export default class RiskCard extends BaseRecordComponent {
pageNum: 1,
pageSize: 20,
} as any;
+ this.getTableData()
}
public showUpdateModel(id) {
@@ -498,13 +499,8 @@ export default class RiskCard extends BaseRecordComponent {
})
}
- public showModal(row, isReadonly) {
- if (isReadonly) {
- this.subIsReadonly = true
-
- } else {
- this.subIsReadonly = false
- }
+ public showModal(row, isReadonly = false) {
+ this.subIsReadonly = isReadonly
this.tableService.getListDetail({ id: row.id }).then((res: any) => {
if (res.code === 200) {
@@ -512,6 +508,7 @@ export default class RiskCard extends BaseRecordComponent {
riskLevelName: this.$store.getters.prevention_risk_level_map[res.data.riskLevel],
safetySignName: res.data.safetySign.split(",").map(item => this.$store.getters.prevention_security_identifier_map[item]).join(",")
}, res.data)
+ this.subUpdateParams.postCode = +res.data.postCode
if (res.data.resourceId) {
this.tableService.getFileUrls({ ids: res.data.resourceId.split(",") }).then((files: any) => {
this.fileList = files.data.map(item => {
diff --git a/src/views/workprogress/common.component.html b/src/views/workprogress/common.component.html
index dbbcd46..3bd6f16 100644
--- a/src/views/workprogress/common.component.html
+++ b/src/views/workprogress/common.component.html
@@ -83,7 +83,7 @@
:title="subIsReadonly?'详情':subUpdateParams.index||subUpdateParams.id ?'编辑': '新增'" :visible.sync="subShowUpdate"
width="952px">
diff --git a/src/views/workprogress/trainRecords.component.vue b/src/views/workprogress/trainRecords.component.vue
index 2246f02..272362c 100644
--- a/src/views/workprogress/trainRecords.component.vue
+++ b/src/views/workprogress/trainRecords.component.vue
@@ -124,21 +124,9 @@ export default class TrainRecords extends BaseRecordComponent {
value: "cancel"
}];
+ public updateActions = [] as any;
-
-
- public updateActions = [{
- name: "取消",
- value: "cancel"
- }, {
- name: "保存并继续添加",
- value: "saveAndContinue",
- type: "primary"
- }, {
- name: "保存",
- value: "save",
- type: "primary"
- }];
+ public subUpdateActions = [] as any;
public updateOptions: FormOption[] = [] as any;
public buildUpdateForm() {
@@ -217,7 +205,19 @@ export default class TrainRecords extends BaseRecordComponent {
showError: false,
},
]
-
+ this.updateActions = [{
+ name: "取消",
+ value: "cancel"
+ }, {
+ name: "保存并继续添加",
+ value: "saveAndContinue",
+ type: "primary",
+ hide: this.updateParams.id
+ }, {
+ name: "保存",
+ value: "save",
+ type: "primary"
+ }];
}
public subUpdateOptions: FormOption[] = []
@@ -272,13 +272,29 @@ export default class TrainRecords extends BaseRecordComponent {
}]
}, {
name: "得分",
- type: "text",
+ type: "number",
key: "score",
require: true,
width: "calc(50% - 20px)",
+ controls: false,
showError: false,
+ max: 100,
+ min: 0,
hide: !(this.subUpdateParams.examStatus === 1)
},]
+ this.subUpdateActions = [{
+ name: "取消",
+ value: "cancel"
+ }, {
+ name: "保存并继续添加",
+ value: "saveAndContinue",
+ type: "primary",
+ hide: this.subUpdateParams.index
+ }, {
+ name: "保存",
+ value: "save",
+ type: "primary"
+ }];
}
@@ -288,7 +304,7 @@ export default class TrainRecords extends BaseRecordComponent {
public buildTable() {
- this.tableColumn.push({ name: '培训名称', key: "name"});
+ this.tableColumn.push({ name: '培训名称', key: "name" });
this.tableColumn.push({
name: '培训类型', key: "type", render: (data) => {
if (data.type === 1) {
@@ -311,7 +327,7 @@ export default class TrainRecords extends BaseRecordComponent {
}
});
this.tableColumn.push({
- name: '培训层级', key: "level", render: (data) => {
+ name: '培训层级', key: "level", render: (data) => {
if (data.level) {
return this.$store.getters.prevention_training_level_map[data.level]
}
@@ -355,6 +371,28 @@ export default class TrainRecords extends BaseRecordComponent {
}
this.buildSubForm()
}
+ //培训时长格式化
+ this.durationChange(data, item);
+ //得分格式化
+ this.scoreFormat(data, item);
+ }
+ /**
+ * 培训时长格式化,保留一位小数
+ * @param data
+ * @param item
+ */
+ public durationChange(data: any, item: any) {
+ if (item && item.key === 'duration') {
+ this.updateParams.duration = null;
+ this.$set(this.updateParams, item.key, +data.toFixed(1))
+ }
+ }
+
+ public scoreFormat(data: any, item: any) {
+ if (item && item.key === 'score') {
+ this.updateParams.score = null;
+ this.$set(this.subUpdateParams, item.key, +data.toFixed(2))
+ }
}
public callback(data, type) {
@@ -398,6 +436,7 @@ export default class TrainRecords extends BaseRecordComponent {
pageNum: 1,
pageSize: 20,
} as any;
+ this.getTableData()
}
public showUpdateModel(id) {
@@ -423,7 +462,7 @@ export default class TrainRecords 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);
}
@@ -472,9 +511,9 @@ export default class TrainRecords extends BaseRecordComponent {
public subCallback(data) {
if (data.value === "add") {
this.subIsReadonly = false
- this.buildSubForm()
this.subUpdateParams = {} as any;
this.subShowUpdate = true
+ this.buildSubForm()
} else if (data.value === "cancel") {
this.showUpdate = false
} else if (data && data.value.indexOf("save") >= 0) {
@@ -531,11 +570,11 @@ export default class TrainRecords extends BaseRecordComponent {
public showSubModal(row, isReadonly) {
if (isReadonly) {
this.subIsReadonly = true
- this.subUpdateParams = row
+ this.subUpdateParams = JSON.parse(JSON.stringify(row))
this.subUpdateParams.examStatusName = row.examStatus === 1 ? '已参加' : '未参加'
} else {
this.subIsReadonly = false
- this.subUpdateParams = row
+ this.subUpdateParams = JSON.parse(JSON.stringify(row))
}
this.subShowUpdate = true
this.buildSubForm()
@@ -543,7 +582,6 @@ export default class TrainRecords extends BaseRecordComponent {
//删除成员
public deleteSubData(indexs) {
-
this.$confirm('确认删除所选数据', '确认数据', {
confirmButtonText: '确定',
cancelButtonText: '取消',