forked from xxhjsb/hbt-prevention-ui
feat:工作危害分析bug
parent
a39b7b7282
commit
81ce4e55ce
Binary file not shown.
After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
|
@ -109,6 +109,7 @@ import { L_COLUMN, L_VALUE, S_COLUMN, S_VALUE } from '@/mock/lsRisk';
|
||||||
import { L_LECCOLUMN, L_LECVALUE, E_COLUMN, E_VALUE, C_COLUMN, C_VALUE } from '@/mock/lecRisk';
|
import { L_LECCOLUMN, L_LECVALUE, E_COLUMN, E_VALUE, C_COLUMN, C_VALUE } from '@/mock/lecRisk';
|
||||||
import MeasureComponent from '@/components/measure.component.vue'
|
import MeasureComponent from '@/components/measure.component.vue'
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
|
import { Message } from 'element-ui';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
components: {
|
components: {
|
||||||
|
@ -1110,6 +1111,8 @@ export default class AnalEvaluationComponent extends Vue {
|
||||||
if (data.value === "cancel") {
|
if (data.value === "cancel") {
|
||||||
this.visible = false;
|
this.visible = false;
|
||||||
} else if (data.value === "store") {
|
} else if (data.value === "store") {
|
||||||
|
|
||||||
|
|
||||||
let vaildParams = true
|
let vaildParams = true
|
||||||
if ((this.$refs.basicForm as any).vaildParams() === false) {
|
if ((this.$refs.basicForm as any).vaildParams() === false) {
|
||||||
//基本信息
|
//基本信息
|
||||||
|
@ -1124,6 +1127,12 @@ export default class AnalEvaluationComponent extends Vue {
|
||||||
vaildParams = false
|
vaildParams = false
|
||||||
}
|
}
|
||||||
if (vaildParams === true) {
|
if (vaildParams === true) {
|
||||||
|
console.log('this.analysisUpdateParams', this.analysisUpdateParams);
|
||||||
|
if (this.analysisUpdateParams.measures.length === 0) {
|
||||||
|
this.$message.warning('请添加管控措施!')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const tmpUpdateParams = JSON.parse(JSON.stringify(this.updateParams))
|
const tmpUpdateParams = JSON.parse(JSON.stringify(this.updateParams))
|
||||||
// this.analysisUpdateParams.measures = this.currentMeasureData.datas
|
// this.analysisUpdateParams.measures = this.currentMeasureData.datas
|
||||||
//整理数据
|
//整理数据
|
||||||
|
|
|
@ -34,8 +34,8 @@
|
||||||
<el-dialog :close-on-click-modal="false" :title="taskIsReadonly ? '详情' : taskUpdataParams.index ? '编辑' : '新增'"
|
<el-dialog :close-on-click-modal="false" :title="taskIsReadonly ? '详情' : taskUpdataParams.index ? '编辑' : '新增'"
|
||||||
:visible.sync="showSubUpdate" width="952px" :before-close="handleCloseTask">
|
:visible.sync="showSubUpdate" width="952px" :before-close="handleCloseTask">
|
||||||
<FormComponent :options="taskUpdateOptions" :isReadonly="taskIsReadonly" labelWidth="110px" labelAlign="right"
|
<FormComponent :options="taskUpdateOptions" :isReadonly="taskIsReadonly" labelWidth="110px" labelAlign="right"
|
||||||
:data.sync="taskUpdataParams" :actions="subActions" :full-btn="true" btnPosition="center"
|
:data.sync="taskUpdataParams" :actions="taskIsReadonly ? [] : taskActions" :full-btn="true"
|
||||||
@actionCallback="taskCallback" @change="taskSelectChange">
|
btnPosition="center" @actionCallback="taskCallback" @change="taskSelectChange">
|
||||||
</FormComponent>
|
</FormComponent>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
|
@ -231,6 +231,7 @@ export default class MeasureComponent extends Vue {
|
||||||
width: "calc(50% - 20px)",
|
width: "calc(50% - 20px)",
|
||||||
require: true,
|
require: true,
|
||||||
showError: false,
|
showError: false,
|
||||||
|
min: 1,
|
||||||
// labelWidth:"130px"
|
// labelWidth:"130px"
|
||||||
}, {
|
}, {
|
||||||
key: "reviewCycleUnit",
|
key: "reviewCycleUnit",
|
||||||
|
@ -274,19 +275,26 @@ export default class MeasureComponent extends Vue {
|
||||||
showError: false,
|
showError: false,
|
||||||
},]
|
},]
|
||||||
}
|
}
|
||||||
|
public subActions = [] as any;
|
||||||
|
//排查任务按钮
|
||||||
|
public taskActions = [] as any;
|
||||||
|
|
||||||
public subActions = [{
|
public buildTaskAction(){
|
||||||
|
this.taskActions= [{
|
||||||
name: "取消",
|
name: "取消",
|
||||||
value: "cancel"
|
value: "cancel"
|
||||||
}, {
|
}, {
|
||||||
name: "保存并继续添加",
|
name: "保存并继续添加",
|
||||||
value: "saveAndContinue",
|
value: "saveAndContinue",
|
||||||
type: "primary"
|
type: "primary",
|
||||||
|
hide: this.taskUpdataParams.index
|
||||||
}, {
|
}, {
|
||||||
name: "保存",
|
name: "保存",
|
||||||
value: "save",
|
value: "save",
|
||||||
type: "primary"
|
type: "primary"
|
||||||
}];
|
}];
|
||||||
|
}
|
||||||
|
|
||||||
public tableActions = [{
|
public tableActions = [{
|
||||||
name: "添加",
|
name: "添加",
|
||||||
value: "fourSubAdd",
|
value: "fourSubAdd",
|
||||||
|
@ -328,6 +336,7 @@ export default class MeasureComponent extends Vue {
|
||||||
// }
|
// }
|
||||||
this.measuresUpdateForm()
|
this.measuresUpdateForm()
|
||||||
this.taskUpdateForm()
|
this.taskUpdateForm()
|
||||||
|
this.buildActions()
|
||||||
}
|
}
|
||||||
|
|
||||||
@PropSync("tabledata", {
|
@PropSync("tabledata", {
|
||||||
|
@ -335,9 +344,26 @@ export default class MeasureComponent extends Vue {
|
||||||
})
|
})
|
||||||
public measureData!: any;
|
public measureData!: any;
|
||||||
|
|
||||||
|
public buildActions() {
|
||||||
|
this.subActions = [{
|
||||||
|
name: "取消",
|
||||||
|
value: "cancel"
|
||||||
|
}, {
|
||||||
|
name: "保存并继续添加",
|
||||||
|
value: "saveAndContinue",
|
||||||
|
type: "primary",
|
||||||
|
hide: this.updataParams.index
|
||||||
|
}, {
|
||||||
|
name: "保存",
|
||||||
|
value: "save",
|
||||||
|
type: "primary"
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
|
||||||
created() {
|
created() {
|
||||||
this.buildTable();
|
this.buildTable();
|
||||||
console.log('measureData',this.measureData);
|
console.log('measureData', this.measureData);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -442,6 +468,7 @@ export default class MeasureComponent extends Vue {
|
||||||
}
|
}
|
||||||
this.showSubUpdate = true
|
this.showSubUpdate = true
|
||||||
this.taskUpdateForm()
|
this.taskUpdateForm()
|
||||||
|
this.buildTaskAction()
|
||||||
}
|
}
|
||||||
|
|
||||||
//排查任务 --- 包保对应项
|
//排查任务 --- 包保对应项
|
||||||
|
@ -501,6 +528,7 @@ export default class MeasureComponent extends Vue {
|
||||||
}
|
}
|
||||||
this.taskUpdateForm();
|
this.taskUpdateForm();
|
||||||
this.showSubUpdate = true;
|
this.showSubUpdate = true;
|
||||||
|
this.buildTaskAction()
|
||||||
}
|
}
|
||||||
|
|
||||||
public deleteTask(row) {
|
public deleteTask(row) {
|
||||||
|
|
|
@ -388,10 +388,9 @@ export default class AreaManagerComponent extends BaseRecordComponent<any> {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
} as any;
|
} as any;
|
||||||
|
this.getTableData()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public showUpdateModel(data?, isRead?) {
|
public showUpdateModel(data?, isRead?) {
|
||||||
if (!data) {
|
if (!data) {
|
||||||
this.currentId = -1;
|
this.currentId = -1;
|
||||||
|
@ -399,7 +398,6 @@ export default class AreaManagerComponent extends BaseRecordComponent<any> {
|
||||||
} else {
|
} else {
|
||||||
this.currentId = data.id;
|
this.currentId = data.id;
|
||||||
this.updateParams = Object.assign({ bottomHeight: 0, topHeight: 0, geoJson: "[]", majorHazardFlagName: this.$store.getters.common_yes_no_map[data.majorHazardFlag], majorHazardLevelName: this.levelName(data.majorHazardLevel) }, data);
|
this.updateParams = Object.assign({ bottomHeight: 0, topHeight: 0, geoJson: "[]", majorHazardFlagName: this.$store.getters.common_yes_no_map[data.majorHazardFlag], majorHazardLevelName: this.levelName(data.majorHazardLevel) }, data);
|
||||||
|
|
||||||
this.isReadonly = !!isRead;
|
this.isReadonly = !!isRead;
|
||||||
this.buildFormOptions();
|
this.buildFormOptions();
|
||||||
this.showUpdate = true
|
this.showUpdate = true
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<div class="common-content-box dis-flex flex-col flex-1">
|
<div class="common-content-box dis-flex flex-col flex-1">
|
||||||
<div class="search-box">
|
<div class="search-box">
|
||||||
<FormComponent :inline="true" :options="formOptions" :data.sync="params" @actionCallback="callback"
|
<FormComponent :inline="true" :options="formOptions" :data.sync="params" @actionCallback="callback"
|
||||||
:actions="formActions" :full-btn="false" @change="change" btn-position="end"></FormComponent>
|
:actions="formActions" :full-btn="false" @change="callback" btn-position="end"></FormComponent>
|
||||||
</div>
|
</div>
|
||||||
<div class="table-box flex-1">
|
<div class="table-box flex-1">
|
||||||
<TableComponent :tableData="tableData" :tableColumn="tableColumn" @actionCallback="callback($event)"
|
<TableComponent :tableData="tableData" :tableColumn="tableColumn" @actionCallback="callback($event)"
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-dialog :close-on-click-modal="false" :visible.sync="showUpdate" destroy-on-close>
|
<el-dialog :close-on-click-modal="false" :visible.sync="showUpdate" destroy-on-close>
|
||||||
<img style="width:100%" src="../../../../assets/images/4.jpg" alt="">
|
<img style="width:100%" src="../../../../assets/images/4.png" alt="">
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<!-- 选取LS值 -->
|
<!-- 选取LS值 -->
|
||||||
|
@ -104,44 +104,4 @@
|
||||||
<ButtonListComponent :actions="popBtns" @callback="popCallback" btn-position="center" :full-btn="true">
|
<ButtonListComponent :actions="popBtns" @callback="popCallback" btn-position="center" :full-btn="true">
|
||||||
</ButtonListComponent>
|
</ButtonListComponent>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<!-- 选取LS值 -->
|
|
||||||
<!-- <el-dialog :close-on-click-modal="false" :title="popTitle" :visible.sync="showPop" width="1000px" destroy-on-close>
|
|
||||||
<el-table :data="riskDatas" border style="width: 100%; margin-bottom: 20px;" :span-method="colSpan">
|
|
||||||
<el-table-column prop="index" label="序号"></el-table-column>
|
|
||||||
<el-table-column prop="name" label="项目"></el-table-column>
|
|
||||||
<el-table-column label="取值标准">
|
|
||||||
<el-table-column prop="noInvolved" label="是否涉及">
|
|
||||||
<div slot-scope="scope" class="cursor td-content" :class="{active:scope.row.value===0}"
|
|
||||||
@click="selectRow(scope.row,0)">
|
|
||||||
<span>不涉及</span>
|
|
||||||
</div>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="type1" label="1">
|
|
||||||
<div slot-scope="scope" class="cursor td-content" :class="{active:scope.row.value===1}"
|
|
||||||
@click="selectRow(scope.row,1)"><span>{{scope.row.type1}}</span></div>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="type2" label="2">
|
|
||||||
<div slot-scope="scope" class="cursor td-content" :class="{active:scope.row.value===2}"
|
|
||||||
@click="selectRow(scope.row,2)"><span>{{scope.row.type2}}</span></div>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="type3" label="3">
|
|
||||||
<div slot-scope="scope" class="cursor td-content" :class="{active:scope.row.value===3}"
|
|
||||||
@click="selectRow(scope.row,3)"><span>{{scope.row.type3}}</span></div>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="type4" label="4">
|
|
||||||
<div slot-scope="scope" class="cursor td-content" :class="{active:scope.row.value===4}"
|
|
||||||
@click="selectRow(scope.row,4)"><span>{{scope.row.type4}}</span></div>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="value" :label="popTitle==='L值取值'?'Ln':'Sn'">
|
|
||||||
<div slot-scope="scope">
|
|
||||||
<span v-if="scope.row.value">{{scope.row.value}}</span>
|
|
||||||
<span v-else></span>
|
|
||||||
</div>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="result" :label="popTitle==='L值取值'?'L':'S'"></el-table-column>
|
|
||||||
</el-table>
|
|
||||||
<ButtonListComponent :actions="popBtns" @callback="popCallback" btn-position="center" :full-btn="true">
|
|
||||||
</ButtonListComponent>
|
|
||||||
</el-dialog> -->
|
|
||||||
</div>
|
</div>
|
|
@ -236,7 +236,8 @@ export default class DeviceAnalManagerComponent extends BaseRecordComponent<any>
|
||||||
width: "calc(50% - 20px)",
|
width: "calc(50% - 20px)",
|
||||||
require: true,
|
require: true,
|
||||||
showError: false,
|
showError: false,
|
||||||
format: "yyyy-MM-dd"
|
format: "yyyy-MM-dd",
|
||||||
|
disable: true,
|
||||||
}, {
|
}, {
|
||||||
name: "区域固有风险等级",
|
name: "区域固有风险等级",
|
||||||
key: "analRiskLevel",
|
key: "analRiskLevel",
|
||||||
|
|
|
@ -131,7 +131,7 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent<any> {
|
||||||
name: "单元名称",
|
name: "单元名称",
|
||||||
key: "unitName",
|
key: "unitName",
|
||||||
type: "text",
|
type: "text",
|
||||||
},{
|
}, {
|
||||||
name: "作业活动",
|
name: "作业活动",
|
||||||
key: "jobInventoryName",
|
key: "jobInventoryName",
|
||||||
type: "text",
|
type: "text",
|
||||||
|
@ -244,7 +244,8 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent<any> {
|
||||||
width: "calc(50% - 20px)",
|
width: "calc(50% - 20px)",
|
||||||
require: true,
|
require: true,
|
||||||
showError: false,
|
showError: false,
|
||||||
format: "yyyy-MM-dd"
|
format: "yyyy-MM-dd",
|
||||||
|
disable:true,
|
||||||
}, {
|
}, {
|
||||||
name: "区域固有风险等级",
|
name: "区域固有风险等级",
|
||||||
key: "analRiskLevel",
|
key: "analRiskLevel",
|
||||||
|
@ -506,7 +507,7 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent<any> {
|
||||||
this.subTableColumn.push({ name: '步骤名称', key: "name" });
|
this.subTableColumn.push({ name: '步骤名称', key: "name" });
|
||||||
this.subTableColumn.push({ name: '作业步骤描述', key: "description", showTip: true, width: "200px" });
|
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: "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({
|
this.subTableColumn.push({
|
||||||
name: '最严重后果', key: "seriousResult", width: "100px", render: (data) => {
|
name: '最严重后果', key: "seriousResult", width: "100px", render: (data) => {
|
||||||
if (data.seriousResult) {
|
if (data.seriousResult) {
|
||||||
|
@ -651,6 +652,7 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent<any> {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
} as any;
|
} as any;
|
||||||
|
this.getTableData()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 分页数据
|
// 分页数据
|
||||||
|
|
|
@ -63,7 +63,7 @@ export default class RiskCard extends BaseRecordComponent<any> {
|
||||||
|
|
||||||
public showFileList = [] as any;
|
public showFileList = [] as any;
|
||||||
|
|
||||||
public labelWidth='130px'
|
public labelWidth = '130px'
|
||||||
|
|
||||||
public formActions = [{
|
public formActions = [{
|
||||||
name: "查询",
|
name: "查询",
|
||||||
|
@ -138,7 +138,7 @@ export default class RiskCard extends BaseRecordComponent<any> {
|
||||||
width: "calc(50% - 20px)",
|
width: "calc(50% - 20px)",
|
||||||
showError: false,
|
showError: false,
|
||||||
disable: true,
|
disable: true,
|
||||||
labelWidth:"130px"
|
labelWidth: "130px"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "区域名称",
|
name: "区域名称",
|
||||||
|
@ -185,7 +185,7 @@ export default class RiskCard extends BaseRecordComponent<any> {
|
||||||
require: true,
|
require: true,
|
||||||
width: "100%",
|
width: "100%",
|
||||||
showError: false,
|
showError: false,
|
||||||
labelWidth:'130px'
|
labelWidth: '130px'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "风险等级",
|
name: "风险等级",
|
||||||
|
@ -327,7 +327,7 @@ export default class RiskCard extends BaseRecordComponent<any> {
|
||||||
this.tableColumn.push({ name: '岗位名称', key: "postName", });
|
this.tableColumn.push({ name: '岗位名称', key: "postName", });
|
||||||
this.tableColumn.push({ name: '主要危险有害因素', key: "harmfulFactors", });
|
this.tableColumn.push({ name: '主要危险有害因素', key: "harmfulFactors", });
|
||||||
this.tableColumn.push({
|
this.tableColumn.push({
|
||||||
name: '风险等级', key: "riskLevel",width:"150px", render: (data) => {
|
name: '风险等级', key: "riskLevel", width: "150px", render: (data) => {
|
||||||
if (data.riskLevel) {
|
if (data.riskLevel) {
|
||||||
return "<span class='color_level_" + data.riskLevel + "'>" + (data.riskLevel ? (this.$store.getters.prevention_risk_level_map[data.riskLevel]) : '') + "</span>"
|
return "<span class='color_level_" + data.riskLevel + "'>" + (data.riskLevel ? (this.$store.getters.prevention_risk_level_map[data.riskLevel]) : '') + "</span>"
|
||||||
}
|
}
|
||||||
|
@ -398,6 +398,7 @@ export default class RiskCard extends BaseRecordComponent<any> {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
} as any;
|
} as any;
|
||||||
|
this.getTableData()
|
||||||
}
|
}
|
||||||
|
|
||||||
public showUpdateModel(id) {
|
public showUpdateModel(id) {
|
||||||
|
@ -498,13 +499,8 @@ export default class RiskCard extends BaseRecordComponent<any> {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
public showModal(row, isReadonly) {
|
public showModal(row, isReadonly = false) {
|
||||||
if (isReadonly) {
|
this.subIsReadonly = isReadonly
|
||||||
this.subIsReadonly = true
|
|
||||||
|
|
||||||
} else {
|
|
||||||
this.subIsReadonly = false
|
|
||||||
}
|
|
||||||
|
|
||||||
this.tableService.getListDetail({ id: row.id }).then((res: any) => {
|
this.tableService.getListDetail({ id: row.id }).then((res: any) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
|
@ -512,6 +508,7 @@ export default class RiskCard extends BaseRecordComponent<any> {
|
||||||
riskLevelName: this.$store.getters.prevention_risk_level_map[res.data.riskLevel],
|
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(",")
|
safetySignName: res.data.safetySign.split(",").map(item => this.$store.getters.prevention_security_identifier_map[item]).join(",")
|
||||||
}, res.data)
|
}, res.data)
|
||||||
|
this.subUpdateParams.postCode = +res.data.postCode
|
||||||
if (res.data.resourceId) {
|
if (res.data.resourceId) {
|
||||||
this.tableService.getFileUrls({ ids: res.data.resourceId.split(",") }).then((files: any) => {
|
this.tableService.getFileUrls({ ids: res.data.resourceId.split(",") }).then((files: any) => {
|
||||||
this.fileList = files.data.map(item => {
|
this.fileList = files.data.map(item => {
|
||||||
|
|
|
@ -83,7 +83,7 @@
|
||||||
:title="subIsReadonly?'详情':subUpdateParams.index||subUpdateParams.id ?'编辑': '新增'" :visible.sync="subShowUpdate"
|
:title="subIsReadonly?'详情':subUpdateParams.index||subUpdateParams.id ?'编辑': '新增'" :visible.sync="subShowUpdate"
|
||||||
width="952px">
|
width="952px">
|
||||||
<FormComponent :options="subUpdateOptions" :isReadonly="subIsReadonly" labelWidth="110px" labelAlign="right"
|
<FormComponent :options="subUpdateOptions" :isReadonly="subIsReadonly" labelWidth="110px" labelAlign="right"
|
||||||
:data.sync="subUpdateParams" @actionCallback="triCallback" @change="changes" :actions="updateActions"
|
:data.sync="subUpdateParams" @actionCallback="triCallback" @change="changes" :actions="subUpdateActions"
|
||||||
:full-btn="true" btnPosition="center">
|
:full-btn="true" btnPosition="center">
|
||||||
</FormComponent>
|
</FormComponent>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
|
@ -124,21 +124,9 @@ export default class TrainRecords extends BaseRecordComponent<any> {
|
||||||
value: "cancel"
|
value: "cancel"
|
||||||
}];
|
}];
|
||||||
|
|
||||||
|
public updateActions = [] as any;
|
||||||
|
|
||||||
|
public subUpdateActions = [] as any;
|
||||||
|
|
||||||
public updateActions = [{
|
|
||||||
name: "取消",
|
|
||||||
value: "cancel"
|
|
||||||
}, {
|
|
||||||
name: "保存并继续添加",
|
|
||||||
value: "saveAndContinue",
|
|
||||||
type: "primary"
|
|
||||||
}, {
|
|
||||||
name: "保存",
|
|
||||||
value: "save",
|
|
||||||
type: "primary"
|
|
||||||
}];
|
|
||||||
|
|
||||||
public updateOptions: FormOption<BtnOption>[] = [] as any;
|
public updateOptions: FormOption<BtnOption>[] = [] as any;
|
||||||
public buildUpdateForm() {
|
public buildUpdateForm() {
|
||||||
|
@ -217,7 +205,19 @@ export default class TrainRecords extends BaseRecordComponent<any> {
|
||||||
showError: false,
|
showError: false,
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
this.updateActions = [{
|
||||||
|
name: "取消",
|
||||||
|
value: "cancel"
|
||||||
|
}, {
|
||||||
|
name: "保存并继续添加",
|
||||||
|
value: "saveAndContinue",
|
||||||
|
type: "primary",
|
||||||
|
hide: this.updateParams.id
|
||||||
|
}, {
|
||||||
|
name: "保存",
|
||||||
|
value: "save",
|
||||||
|
type: "primary"
|
||||||
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
public subUpdateOptions: FormOption<BtnOption>[] = []
|
public subUpdateOptions: FormOption<BtnOption>[] = []
|
||||||
|
@ -272,13 +272,29 @@ export default class TrainRecords extends BaseRecordComponent<any> {
|
||||||
}]
|
}]
|
||||||
}, {
|
}, {
|
||||||
name: "得分",
|
name: "得分",
|
||||||
type: "text",
|
type: "number",
|
||||||
key: "score",
|
key: "score",
|
||||||
require: true,
|
require: true,
|
||||||
width: "calc(50% - 20px)",
|
width: "calc(50% - 20px)",
|
||||||
|
controls: false,
|
||||||
showError: false,
|
showError: false,
|
||||||
|
max: 100,
|
||||||
|
min: 0,
|
||||||
hide: !(this.subUpdateParams.examStatus === 1)
|
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<any> {
|
||||||
|
|
||||||
|
|
||||||
public buildTable() {
|
public buildTable() {
|
||||||
this.tableColumn.push({ name: '培训名称', key: "name"});
|
this.tableColumn.push({ name: '培训名称', key: "name" });
|
||||||
this.tableColumn.push({
|
this.tableColumn.push({
|
||||||
name: '培训类型', key: "type", render: (data) => {
|
name: '培训类型', key: "type", render: (data) => {
|
||||||
if (data.type === 1) {
|
if (data.type === 1) {
|
||||||
|
@ -355,6 +371,28 @@ export default class TrainRecords extends BaseRecordComponent<any> {
|
||||||
}
|
}
|
||||||
this.buildSubForm()
|
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) {
|
public callback(data, type) {
|
||||||
|
@ -398,6 +436,7 @@ export default class TrainRecords extends BaseRecordComponent<any> {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
} as any;
|
} as any;
|
||||||
|
this.getTableData()
|
||||||
}
|
}
|
||||||
|
|
||||||
public showUpdateModel(id) {
|
public showUpdateModel(id) {
|
||||||
|
@ -423,7 +462,7 @@ export default class TrainRecords extends BaseRecordComponent<any> {
|
||||||
this.toggleAll()
|
this.toggleAll()
|
||||||
} else {
|
} else {
|
||||||
this.tableData.datas.forEach((item, index) => {
|
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) {
|
if (!find) {
|
||||||
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
||||||
}
|
}
|
||||||
|
@ -472,9 +511,9 @@ export default class TrainRecords extends BaseRecordComponent<any> {
|
||||||
public subCallback(data) {
|
public subCallback(data) {
|
||||||
if (data.value === "add") {
|
if (data.value === "add") {
|
||||||
this.subIsReadonly = false
|
this.subIsReadonly = false
|
||||||
this.buildSubForm()
|
|
||||||
this.subUpdateParams = {} as any;
|
this.subUpdateParams = {} as any;
|
||||||
this.subShowUpdate = true
|
this.subShowUpdate = true
|
||||||
|
this.buildSubForm()
|
||||||
} else if (data.value === "cancel") {
|
} else if (data.value === "cancel") {
|
||||||
this.showUpdate = false
|
this.showUpdate = false
|
||||||
} else if (data && data.value.indexOf("save") >= 0) {
|
} else if (data && data.value.indexOf("save") >= 0) {
|
||||||
|
@ -531,11 +570,11 @@ export default class TrainRecords extends BaseRecordComponent<any> {
|
||||||
public showSubModal(row, isReadonly) {
|
public showSubModal(row, isReadonly) {
|
||||||
if (isReadonly) {
|
if (isReadonly) {
|
||||||
this.subIsReadonly = true
|
this.subIsReadonly = true
|
||||||
this.subUpdateParams = row
|
this.subUpdateParams = JSON.parse(JSON.stringify(row))
|
||||||
this.subUpdateParams.examStatusName = row.examStatus === 1 ? '已参加' : '未参加'
|
this.subUpdateParams.examStatusName = row.examStatus === 1 ? '已参加' : '未参加'
|
||||||
} else {
|
} else {
|
||||||
this.subIsReadonly = false
|
this.subIsReadonly = false
|
||||||
this.subUpdateParams = row
|
this.subUpdateParams = JSON.parse(JSON.stringify(row))
|
||||||
}
|
}
|
||||||
this.subShowUpdate = true
|
this.subShowUpdate = true
|
||||||
this.buildSubForm()
|
this.buildSubForm()
|
||||||
|
@ -543,7 +582,6 @@ export default class TrainRecords extends BaseRecordComponent<any> {
|
||||||
|
|
||||||
//删除成员
|
//删除成员
|
||||||
public deleteSubData(indexs) {
|
public deleteSubData(indexs) {
|
||||||
|
|
||||||
this.$confirm('确认删除所选数据', '确认数据', {
|
this.$confirm('确认删除所选数据', '确认数据', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
|
|
Loading…
Reference in New Issue