forked from xxhjsb/hbt-prevention-ui
faet:修复测试bug
parent
521b6b409a
commit
969e3d2127
|
@ -7,7 +7,9 @@
|
|||
<div class="sub-title">风险评估</div>
|
||||
<FormComponent :options="subRiskOptions" labelWidth="110px" labelAlign="right" :data.sync="analysisUpdateParams"
|
||||
@actionCallback="callback" @change="handleRiskChange" :isReadonly="analyIsReadonly" ref="riskForm">
|
||||
<span class="measure-tips">*注:当评估结果为最高级时,必须由公司级管控</span>
|
||||
</FormComponent>
|
||||
|
||||
<div class="sub-title">管控措施</div>
|
||||
<FormComponent labelWidth="110px" labelAlign="right" :data.sync="analysisUpdateParams"
|
||||
@actionCallback="measureCallback" :isReadonly="analyIsReadonly">
|
||||
|
@ -83,7 +85,7 @@
|
|||
</div>
|
||||
|
||||
<el-dialog :close-on-click-modal="false" :title="'管控措施制定'" :visible.sync="subUpdate" width="952px"
|
||||
:before-close="handleMeasureClose">
|
||||
:before-close="handleMeasureClose" destroy-on-close>
|
||||
<MeasureComponent @actionCallback="dataCallback" :data.sync="measuresData" :show.sync="subUpdate"
|
||||
:tabledata.sync="analysisUpdateParams" :isReadonly="measureIsReadonly" :outermostData="updateParams">
|
||||
</MeasureComponent>
|
||||
|
@ -298,7 +300,7 @@ export default class AnalEvaluationComponent extends Vue {
|
|||
type: "select",
|
||||
require: true,
|
||||
multiple: true,
|
||||
width: "calc(50% - 20px)",
|
||||
width: "100%",
|
||||
datas: this.$store.state.prevention_security_identifier,
|
||||
filterable: true,
|
||||
showError: false,
|
||||
|
@ -396,7 +398,7 @@ export default class AnalEvaluationComponent extends Vue {
|
|||
type: "select",
|
||||
require: true,
|
||||
multiple: true,
|
||||
width: "calc(50% - 20px)",
|
||||
width: "100%",
|
||||
datas: this.$store.state.prevention_security_identifier,
|
||||
filterable: true,
|
||||
showError: false,
|
||||
|
@ -516,6 +518,7 @@ export default class AnalEvaluationComponent extends Vue {
|
|||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
disable: true,
|
||||
showError: false,
|
||||
unit: {
|
||||
type: "btn",
|
||||
name: "选择",
|
||||
|
@ -530,6 +533,7 @@ export default class AnalEvaluationComponent extends Vue {
|
|||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
disable: true,
|
||||
showError: false,
|
||||
unit: {
|
||||
type: "btn",
|
||||
name: "选择",
|
||||
|
@ -544,6 +548,7 @@ export default class AnalEvaluationComponent extends Vue {
|
|||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
disable: true,
|
||||
showError: false,
|
||||
}, {
|
||||
name: "风险等级",
|
||||
key: "lsgrade",
|
||||
|
@ -551,6 +556,7 @@ export default class AnalEvaluationComponent extends Vue {
|
|||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
disable: true,
|
||||
showError: false,
|
||||
datas: this.$store.state.prevention_risk_level
|
||||
},];
|
||||
//LEC
|
||||
|
@ -561,6 +567,7 @@ export default class AnalEvaluationComponent extends Vue {
|
|||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
disable: true,
|
||||
showError: false,
|
||||
unit: {
|
||||
type: "btn",
|
||||
name: "选择",
|
||||
|
@ -575,6 +582,7 @@ export default class AnalEvaluationComponent extends Vue {
|
|||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
disable: true,
|
||||
showError: false,
|
||||
unit: {
|
||||
type: "btn",
|
||||
name: "选择",
|
||||
|
@ -589,6 +597,7 @@ export default class AnalEvaluationComponent extends Vue {
|
|||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
disable: true,
|
||||
showError: false,
|
||||
unit: {
|
||||
type: "btn",
|
||||
name: "选择",
|
||||
|
@ -603,6 +612,7 @@ export default class AnalEvaluationComponent extends Vue {
|
|||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
disable: true,
|
||||
showError: false,
|
||||
}, {
|
||||
name: "风险等级",
|
||||
key: "lecgrade",
|
||||
|
@ -610,6 +620,7 @@ export default class AnalEvaluationComponent extends Vue {
|
|||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
disable: true,
|
||||
showError: false,
|
||||
datas: this.$store.state.prevention_risk_level
|
||||
},];
|
||||
|
||||
|
@ -905,7 +916,7 @@ export default class AnalEvaluationComponent extends Vue {
|
|||
}
|
||||
this.analysisUpdateParams.deleteIds.push(row.id)
|
||||
}
|
||||
this.analysisUpdateParams.datas.forEach((item, i) => {
|
||||
this.analysisUpdateParams.measures.forEach((item, i) => {
|
||||
item.index = i + 1
|
||||
})
|
||||
}).catch(() => {
|
||||
|
@ -1029,6 +1040,8 @@ export default class AnalEvaluationComponent extends Vue {
|
|||
let lsdata = this.countLS(this.methodUpdateParams.lslvalue, this.methodUpdateParams.lssvalue)
|
||||
this.methodUpdateParams.lsrvalue = lsdata.rvalue
|
||||
this.methodUpdateParams.lsgrade = lsdata.lsgrade
|
||||
//清除必填提示
|
||||
this.clearShowError(this.methodUpdateParams, this.riskLSUpdateOptions)
|
||||
} else if (this.showRiskValueModal.indexOf('lec') !== -1) {
|
||||
//LEC 计算
|
||||
if (this.showRiskValueModal === 'leclvalue') {
|
||||
|
@ -1041,9 +1054,25 @@ export default class AnalEvaluationComponent extends Vue {
|
|||
let lecdata = this.contLEC(this.methodUpdateParams.leclvalue, this.methodUpdateParams.lecevalue, this.methodUpdateParams.leccvalue)
|
||||
this.methodUpdateParams.lecdvalue = lecdata.dvalue
|
||||
this.methodUpdateParams.lecgrade = lecdata.lecgrade
|
||||
//清除必填提示
|
||||
this.clearShowError(this.methodUpdateParams, this.riskLECUpdateOptions)
|
||||
}
|
||||
|
||||
this.showRiskValueUpdate = false
|
||||
this.showRiskValueUpdate = false;
|
||||
console.log('methodUpdateParams', this.methodUpdateParams);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 清除必填提示
|
||||
* @param methodUpdateParams 输入的数据
|
||||
* @param updateOPtion 需要清除的form
|
||||
*/
|
||||
public clearShowError(methodUpdateParams: any, updateOPtion: any) {
|
||||
for (let i in methodUpdateParams) {
|
||||
if (methodUpdateParams[i]) {
|
||||
const option = updateOPtion.find(item => item.key === i) as any;
|
||||
option.showError = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1227,4 +1256,14 @@ export default class AnalEvaluationComponent extends Vue {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
.measure-tips {
|
||||
width: 100%;
|
||||
color: #F56C6C;
|
||||
margin-left: -100px;
|
||||
margin-bottom: 20px;
|
||||
margin-top: -10px;
|
||||
font-size: 20px;
|
||||
scale: 0.5;
|
||||
}
|
||||
</style>
|
|
@ -100,6 +100,7 @@ export default class MeasureComponent extends Vue {
|
|||
type: "select",
|
||||
width: "100%",
|
||||
require: true,
|
||||
showError: false,
|
||||
datas: this.$store.state.prevention_measure_type
|
||||
}, {
|
||||
name: "管控措施分类",
|
||||
|
@ -133,7 +134,8 @@ export default class MeasureComponent extends Vue {
|
|||
key: "description",
|
||||
type: "textarea",
|
||||
require: true,
|
||||
width: "100%"
|
||||
width: "100%",
|
||||
showError: false,
|
||||
}];
|
||||
}
|
||||
|
||||
|
@ -273,14 +275,15 @@ export default class MeasureComponent extends Vue {
|
|||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
showError: false,
|
||||
pickerOptions: this.getPickerOptions()
|
||||
},]
|
||||
}
|
||||
public subActions = [] as any;
|
||||
//排查任务按钮
|
||||
public taskActions = [] as any;
|
||||
|
||||
public buildTaskAction(){
|
||||
this.taskActions= [{
|
||||
public buildTaskAction() {
|
||||
this.taskActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}, {
|
||||
|
@ -320,22 +323,6 @@ export default class MeasureComponent extends Vue {
|
|||
public updataParams!: any;
|
||||
@Watch("data", { immediate: true, deep: true })
|
||||
onParamsValueChange() {
|
||||
this.dictData.measuresSort = this.$store.state.prevention_measures_sort.map((item) => {
|
||||
this.measuresSelectData[item.value] = this.treeSelectData(item.children)
|
||||
return {
|
||||
label: item.name,
|
||||
id: item.value,
|
||||
}
|
||||
})
|
||||
this.secondTypeItem = this.measuresSelectData[this.updataParams.firstType]
|
||||
// if (this.updataParams.tasks && this.updataParams.tasks.length > 0) {
|
||||
// this.updataParams.tasks.forEach((item, index) => {
|
||||
// item.index = index + 1
|
||||
// return item
|
||||
// })
|
||||
// }
|
||||
this.measuresUpdateForm()
|
||||
this.taskUpdateForm()
|
||||
this.buildActions()
|
||||
}
|
||||
|
||||
|
@ -362,9 +349,15 @@ export default class MeasureComponent extends Vue {
|
|||
|
||||
created() {
|
||||
this.buildTable();
|
||||
console.log('measureData', this.measureData);
|
||||
|
||||
|
||||
this.dictData.measuresSort = this.$store.state.prevention_measures_sort.map((item) => {
|
||||
this.measuresSelectData[item.value] = this.treeSelectData(item.children)
|
||||
return {
|
||||
label: item.name,
|
||||
id: item.value,
|
||||
}
|
||||
})
|
||||
this.secondTypeItem = this.measuresSelectData[this.updataParams.firstType]
|
||||
this.measuresUpdateForm()
|
||||
}
|
||||
|
||||
|
||||
|
@ -388,14 +381,31 @@ export default class MeasureComponent extends Vue {
|
|||
}
|
||||
//措施一
|
||||
if (item && item.key === "firstType") {
|
||||
this.updataParams.firstTypeName = this.selectName(this.dictData.measuresSort, data)
|
||||
this.secondTypeItem = this.measuresSelectData[data]
|
||||
this.changeFirstTypeMethod(data);
|
||||
}
|
||||
//措施二
|
||||
if (item && item.key === 'secondType') {
|
||||
this.updataParams.secondTypeName = this.selectName(this.secondTypeItem, data)
|
||||
}
|
||||
this.measuresUpdateForm()
|
||||
//措施描述
|
||||
if (item && item.key === 'description') {
|
||||
const options = this.triUpdateOptions.find(item => item.key === "description") as any;
|
||||
options.showError = false
|
||||
}
|
||||
// this.measuresUpdateForm()
|
||||
}
|
||||
/**
|
||||
* 管控措施类型一
|
||||
* @param data 措施一数据
|
||||
*/
|
||||
public changeFirstTypeMethod(data: any) {
|
||||
this.updataParams.firstTypeName = this.selectName(this.dictData.measuresSort, data);
|
||||
this.secondTypeItem = this.measuresSelectData[data];
|
||||
const option = this.triUpdateOptions.find(item => item.key === "firstType") as any;
|
||||
option.showError = false;
|
||||
const suboption = this.triUpdateOptions.find(item => item.key === "secondType") as any;
|
||||
suboption.datas = this.secondTypeItem;
|
||||
this.updataParams.secondType = null;
|
||||
}
|
||||
|
||||
public selectName(selectGroup, data) {
|
||||
|
@ -556,20 +566,14 @@ export default class MeasureComponent extends Vue {
|
|||
public taskSelectChange(data, item) {
|
||||
if (data !== null && data !== undefined) {
|
||||
if (item && item.key === 'insuranceDutyFlag') {
|
||||
this.taskType = this.taskItemSelect()
|
||||
if (data === 0) {
|
||||
this.taskUpdataParams.taskType = 0
|
||||
this.taskUpdataParams.insuranceDutyFlagName = '否'
|
||||
this.taskUpdataParams.taskTypeName = '日常任务'
|
||||
} else if (data === 1) {
|
||||
this.taskType = this.taskType.filter(item => item.id !== 0)
|
||||
this.taskUpdataParams.taskType = null
|
||||
this.taskUpdataParams.insuranceDutyFlagName = "是"
|
||||
}
|
||||
//是否是包保责任制履职
|
||||
this.changeInsuranceDutyFlagMethod(data);
|
||||
}
|
||||
|
||||
if (item && item.key === "taskType") {
|
||||
this.taskItem = this.tasksSelectData[data]
|
||||
const suboptions = this.taskUpdateOptions.find(item => item.key === "taskItem") as any;
|
||||
suboptions.datas = this.taskItem;
|
||||
}
|
||||
// 岗位
|
||||
if (item && item.key === "executePostCode") {
|
||||
|
@ -599,12 +603,72 @@ export default class MeasureComponent extends Vue {
|
|||
if (item && item.key === 'executeStartTime') {
|
||||
const now = moment().format("YYYY-MM-DD HH:mm");
|
||||
if (now > data) {
|
||||
this.$message.error("开始执行时间不能早于当前时间")
|
||||
this.$message.warning("开始执行时间不能早于当前时间")
|
||||
this.taskUpdataParams.executeStartTime = null;
|
||||
return
|
||||
}
|
||||
}
|
||||
this.taskUpdateForm()
|
||||
//开始时间
|
||||
if (item && item.key === 'startTime') {
|
||||
if (data > this.taskUpdataParams.endTime) {
|
||||
this.$message.warning("结束时间不能早于开始时间!")
|
||||
this.taskUpdataParams.endTime = null;
|
||||
return
|
||||
}
|
||||
}
|
||||
//结束时间
|
||||
if (item && item.key === 'endTime') {
|
||||
if (data < this.taskUpdataParams.startTime) {
|
||||
this.$message.warning("结束时间不能早于开始时间!")
|
||||
this.taskUpdataParams.endTime = null;
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// this.taskUpdateForm()
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 是否是包保责任制履职情况改变
|
||||
* @param data
|
||||
*/
|
||||
public changeInsuranceDutyFlagMethod(data: any) {
|
||||
this.taskType = this.taskItemSelect();
|
||||
const options = this.taskUpdateOptions.find(item => item.key === "taskType") as any;
|
||||
const suboptions = this.taskUpdateOptions.find(item => item.key === "taskItem") as any;
|
||||
if (data === 0) {
|
||||
this.taskUpdataParams.taskType = 0;
|
||||
this.taskUpdataParams.insuranceDutyFlagName = '否';
|
||||
this.taskUpdataParams.taskTypeName = '日常任务';
|
||||
options.disable = true;
|
||||
options.datas = this.taskType;
|
||||
suboptions.hide = true;
|
||||
} else if (data === 1) {
|
||||
this.taskType = this.taskType.filter(item => item.id !== 0);
|
||||
this.taskUpdataParams.taskType = null;
|
||||
this.taskUpdataParams.insuranceDutyFlagName = "是";
|
||||
options.disable = false;
|
||||
options.datas = this.taskType;
|
||||
suboptions.hide = false;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 时间选择限制
|
||||
* @param start 开始时间
|
||||
* @param end 结束时间
|
||||
*/
|
||||
public getPickerOptions(start?, end?) {
|
||||
if (!start) {
|
||||
start = new Date();
|
||||
}
|
||||
return {
|
||||
disabledDate(time) {
|
||||
if (!end) {
|
||||
return time.getTime() < moment(start).subtract(1, 'day').toDate().getTime();
|
||||
} else {
|
||||
return time.getTime() < moment(start).subtract(1, 'day').toDate().getTime() || time.getTime() > moment(end).toDate().getTime();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<div class="common-content-box dis-flex flex-col flex-1">
|
||||
<div class="search-box">
|
||||
<FormComponent :options="formOptions" :data.sync="params" @actionCallback="callback" :actions="formActions"
|
||||
:full-btn="false" @change="callback($event)" btn-position="end"></FormComponent>
|
||||
:full-btn="false" @change="callback" btn-position="end"></FormComponent>
|
||||
</div>
|
||||
<div class="table-box flex-1">
|
||||
<TableComponent :tableData="tableData" :tableColumn="tableColumn" @tabCallback="callback($event)"
|
||||
|
|
|
@ -277,6 +277,7 @@ export default class SelfAssessment extends BaseRecordComponent<any> {
|
|||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
} as any;
|
||||
this.getTableData()
|
||||
}
|
||||
|
||||
public handleClose() {
|
||||
|
@ -294,7 +295,7 @@ export default class SelfAssessment extends BaseRecordComponent<any> {
|
|||
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);
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
width="952px" :before-close="handleClose" destroy-on-close>
|
||||
<FormComponent :options="updateOptions" :isReadonly="isReadonly" labelWidth="110px" labelAlign="right"
|
||||
:data.sync="updateParams" @change="changes" :actions="updateActions" @actionCallback="callback"
|
||||
:full-btn="true" btnPosition="center">
|
||||
:full-btn="true" btnPosition="center" ref="basicForm">
|
||||
<div class="sub-title">检查项目</div>
|
||||
<TableComponent :tableData="tableData" :tableColumn="subTableColumn"
|
||||
@actionCallback="projectCallback($event)" :actions="!isReadonly?tableActions:[]"
|
||||
|
@ -80,7 +80,7 @@
|
|||
<el-dialog :close-on-click-modal="false" :title="proIsReadonly?'详情':updateProParams.index ?'编辑' :'新增'"
|
||||
:visible.sync="showProject" width="952px" :before-close="handleProClose" destroy-on-close>
|
||||
<FormComponent :options="projectOptions" :isReadonly="proIsReadonly" labelWidth="110px" labelAlign="right"
|
||||
:data.sync="updateProParams" :actions="proIsReadonly ? [] :updateActions" @actionCallback="subCallback"
|
||||
:data.sync="updateProParams" :actions="proIsReadonly ? [] :subUpdateActions" @actionCallback="subCallback"
|
||||
:full-btn="true" btnPosition="center">
|
||||
</FormComponent>
|
||||
</el-dialog>
|
||||
|
@ -98,7 +98,5 @@
|
|||
</template>
|
||||
</el-table>
|
||||
</TableComponent>
|
||||
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
|
@ -151,6 +151,7 @@ export default class DeviceManagerComponent extends BaseRecordComponent<any> {
|
|||
type: "text",
|
||||
require: true,
|
||||
width: "calc(50% - 20px)",
|
||||
showError: false,
|
||||
}, {
|
||||
name: "设备类型",
|
||||
key: "type",
|
||||
|
@ -158,6 +159,7 @@ export default class DeviceManagerComponent extends BaseRecordComponent<any> {
|
|||
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<any> {
|
|||
format: "postName",
|
||||
multiple: true,
|
||||
require: true,
|
||||
showError: false,
|
||||
type: "select",
|
||||
width: "calc(50% - 20px)",
|
||||
width: "100%",
|
||||
datas: this.$store.state.postList
|
||||
}, {
|
||||
name: "安全因素",
|
||||
|
@ -217,14 +220,17 @@ export default class DeviceManagerComponent extends BaseRecordComponent<any> {
|
|||
type: "primary"
|
||||
}];
|
||||
}
|
||||
|
||||
public projectOptions: FormOption<BtnOption>[] = [
|
||||
public projectOptions: FormOption<BtnOption>[] = [];
|
||||
public subUpdateActions = [] as any;
|
||||
public buildSubActionsForm() {
|
||||
this.projectOptions = [
|
||||
{
|
||||
name: "检查项目",
|
||||
key: "name",
|
||||
type: "textarea",
|
||||
require: true,
|
||||
width: "100%",
|
||||
showError: false,
|
||||
},
|
||||
{
|
||||
name: "检查标准",
|
||||
|
@ -232,10 +238,23 @@ export default class DeviceManagerComponent extends BaseRecordComponent<any> {
|
|||
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<any> {
|
|||
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,6 +463,7 @@ export default class DeviceManagerComponent extends BaseRecordComponent<any> {
|
|||
}
|
||||
|
||||
public doSave(goOn?) {
|
||||
if ((this.$refs.basicForm as any).vaildParams()) {
|
||||
// 新增
|
||||
this.updateParams.itemNum = this.updateParams.items.length;
|
||||
this.updateParams.postCode = this.updateParams.postCode.join(",")
|
||||
|
@ -456,6 +477,7 @@ export default class DeviceManagerComponent extends BaseRecordComponent<any> {
|
|||
this.getTableData();
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
public handleClose() {
|
||||
this.showUpdate = false;
|
||||
|
@ -463,17 +485,17 @@ export default class DeviceManagerComponent extends BaseRecordComponent<any> {
|
|||
|
||||
|
||||
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<any> {
|
|||
//检查项目
|
||||
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<any> {
|
|||
} else {
|
||||
this.updateProParams = JSON.parse(JSON.stringify(row));
|
||||
}
|
||||
this.buildSubActionsForm()
|
||||
}
|
||||
//删除
|
||||
public deleteProData(indexs) {
|
||||
|
|
|
@ -96,7 +96,7 @@
|
|||
<el-dialog :close-on-click-modal="false" :title="!stepUpdateParams.id?'新增':'编辑'" :visible.sync="showSubUpdate"
|
||||
width="500" :before-close="handleClose" destroy-on-close>
|
||||
<FormComponent :options="subUpdateOptions" labelWidth="110px" @change="changes" labelAlign="right"
|
||||
:data.sync="stepUpdateParams" :full-btn="true" btnPosition="center" @actionCallback="callback"
|
||||
:data.sync="stepUpdateParams" :full-btn="true" btnPosition="center" @actionCallback="subCallback"
|
||||
:actions="subUpdateActions"></FormComponent>
|
||||
</el-dialog>
|
||||
|
||||
|
|
|
@ -332,7 +332,8 @@ export default class WorkManagerComponent extends BaseRecordComponent<any> {
|
|||
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<any> {
|
|||
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<any> {
|
|||
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<any> {
|
|||
}
|
||||
}
|
||||
|
||||
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<any> {
|
|||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 保存数据
|
||||
* @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<any> {
|
|||
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 = {
|
||||
|
|
|
@ -166,8 +166,6 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent<any> {
|
|||
public riskLevelMap = {} as any;
|
||||
|
||||
public buildUpdateForm() {
|
||||
console.log(this.updateParams.id && this.updateParams.status !== 1,);
|
||||
|
||||
this.updateOptions = [{
|
||||
name: "选择区域",
|
||||
key: "areaId",
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
<el-dialog :close-on-click-modal="false" :title="isReadonly?'详情':updateParams.id ?'编辑': '新增'"
|
||||
:visible.sync="showUpdate" width="952px" :before-close="handleClose" destroy-on-close>
|
||||
<FormComponent :options="updateOptions" labelWidth="110px" labelAlign="right" :data.sync="updateParams"
|
||||
:isReadonly="isReadonly">
|
||||
:isReadonly="isReadonly" ref="basicForm">
|
||||
</FormComponent>
|
||||
<div class="sub-title">处置步骤</div>
|
||||
<el-form class="step-form" v-if="!isReadonly" ref="setpsOptions" label-width="100px">
|
||||
|
@ -85,9 +85,11 @@
|
|||
</template>
|
||||
</div>
|
||||
<FormComponent :options="updateStepsOptions" labelWidth="110px" labelAlign="right" :data.sync="updateParams"
|
||||
:isReadonly="isReadonly" @actionCallback="subCallback" @change="changes" :actions="updateActions"
|
||||
:full-btn="true" btnPosition="center">
|
||||
:isReadonly="isReadonly" @actionCallback="subCallback" @change="changes" :actions="[]" :full-btn="true"
|
||||
btnPosition="center" ref="stepForm">
|
||||
</FormComponent>
|
||||
<ButtonListComponent :actions="updateActions" @callback="subCallback" btn-position="center" :full-btn="true">
|
||||
</ButtonListComponent>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :close-on-click-modal="false"
|
||||
|
|
|
@ -11,6 +11,7 @@ import BtnOption from "hbt-common/models/btnOptions";
|
|||
import AreaService from '@/service/area.service';
|
||||
import TinyEditor from "@/components/tinyEditor.component.vue";
|
||||
import { Base64 } from 'js-base64';
|
||||
import ButtonListComponent from "hbt-common/components/common/buttonList.component.vue"
|
||||
|
||||
@Component({
|
||||
template,
|
||||
|
@ -18,6 +19,7 @@ import { Base64 } from 'js-base64';
|
|||
FormComponent,
|
||||
TableComponent,
|
||||
TinyEditor,
|
||||
ButtonListComponent
|
||||
},
|
||||
})
|
||||
export default class EmergencyCard extends BaseRecordComponent<any> {
|
||||
|
@ -508,6 +510,16 @@ export default class EmergencyCard extends BaseRecordComponent<any> {
|
|||
|
||||
|
||||
public doSave(goOn?) {
|
||||
let vaildParams = true
|
||||
if (!((this.$refs.basicForm as any).vaildParams())) {
|
||||
vaildParams = false
|
||||
}
|
||||
if (!((this.$refs.stepForm as any).vaildParams())) {
|
||||
vaildParams = false
|
||||
}
|
||||
if (vaildParams === false) {
|
||||
return
|
||||
}
|
||||
// 新增清单
|
||||
if (this.fileList.length > 0) {
|
||||
let resourceId = this.fileList.map((item) => {
|
||||
|
@ -537,6 +549,7 @@ export default class EmergencyCard extends BaseRecordComponent<any> {
|
|||
this.getNumber()
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
public showModal(row, isReadonly) {
|
||||
|
|
|
@ -180,7 +180,6 @@ export default class SafeCard extends BaseRecordComponent<any> {
|
|||
showError: false,
|
||||
labelWidth: "130px",
|
||||
rules: [
|
||||
{ required: true, message: '请输入手机号' },
|
||||
{ pattern: /^1[3|5|7|8|9]\d{9}$/, message: '请输入正确的号码格式', }
|
||||
]
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue