forked from xxhjsb/hbt-prevention-ui
fixed:修复测试提出的问题
parent
8d001ac056
commit
67e108e469
|
@ -532,6 +532,7 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
|
|||
inspectUserId: this.account.userId,
|
||||
inspectUserName: this.account.nickName,
|
||||
number: null,
|
||||
photo: null,
|
||||
inspectTime: moment().format("YYYY-MM-DD HH:mm")
|
||||
}
|
||||
if (!row) {
|
||||
|
@ -542,9 +543,6 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
|
|||
this.showUpdate = true;
|
||||
})
|
||||
} else {
|
||||
if (isRead) {
|
||||
delete this.updateParams.photo;
|
||||
}
|
||||
this.tableService.selectById(row.id).then((res: any) => {
|
||||
this.updateParams = Object.assign({
|
||||
classifyName: this.$store.getters.prevention_dangrous_type_map[res.data.classify],
|
||||
|
@ -559,8 +557,8 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
|
|||
areaName: (this.areaList.find((item: any) => item.value === res.data.areaId) as any).name,
|
||||
type: "随手拍",
|
||||
}, res.data)
|
||||
this.updateParams.majorHazard = parseInt(this.updateParams.majorHazard)
|
||||
this.updateParams.majorHazardName = !this.updateParams.majorHazard || this.updateParams.majorHazard === 0 ? '不涉及' : this.$store.getters.prevention_risk_source_map[this.updateParams.majorHazard]
|
||||
this.updateParams.majorHazard = +this.updateParams.majorHazard
|
||||
this.updateParams.majorHazardName = !this.updateParams.majorHazard? '不涉及' : this.$store.getters.prevention_risk_source_map[this.updateParams.majorHazard]
|
||||
|
||||
// 地图定位
|
||||
this.center = [res.data.locationLng, res.data.locationLat];
|
||||
|
@ -568,6 +566,7 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
|
|||
|
||||
// 获取url
|
||||
if (res.data.resourceId) {
|
||||
this.updateParams.photo = 1;
|
||||
this.tableService.getFileUrls({ ids: res.data.resourceId.split(",") }).then((photos: any) => {
|
||||
this.photoList = photos.data.map(item => {
|
||||
return {
|
||||
|
@ -627,7 +626,9 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
|
|||
type: res.data.type,
|
||||
id: res.data.id
|
||||
});
|
||||
this.updateParams.photo = this.photoList.length || null;
|
||||
this.updateParams.photo = this.photoList.length;
|
||||
const option = this.updateOptions.find(item => item.key === "photo") as any;
|
||||
option.showError = false
|
||||
}
|
||||
}
|
||||
public onSuccess2(res, file, fileList) {
|
||||
|
@ -668,9 +669,6 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
|
|||
this.updateParams.resourceName = this.photoList.map(item => item.name).join(",")
|
||||
this.updateParams.resourceOtherId = this.fileList.map(item => item.id).join(",")
|
||||
this.updateParams.resourceOtherName = this.fileList.map(item => item.name).join(",")
|
||||
if (this.updateParams.majorHazard && this.updateParams.majorHazard !== 0) {
|
||||
this.updateParams.majorHazard = this.updateParams.majorHazard.toString()
|
||||
}
|
||||
|
||||
this.tableService.addOrUpdate(this.updateParams, !this.updateParams.id).then(res => {
|
||||
this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功");
|
||||
|
|
|
@ -693,8 +693,7 @@ export default class HiddenDangerFilesComponent extends BaseRecordComponent<any>
|
|||
professionClassifyName: this.$store.getters.prevention_major_type_map[row.professionClassify],
|
||||
reformModeName: this.reformModeMap[row.reformMode],
|
||||
}, row);
|
||||
this.updateParams.majorHazard = parseInt(this.updateParams.majorHazard)
|
||||
this.updateParams.majorHazardName = !this.updateParams.majorHazard || this.updateParams.majorHazard === 0 ? '不涉及' : this.$store.getters.prevention_risk_source_map[this.updateParams.majorHazard]
|
||||
this.updateParams.majorHazardName = !this.updateParams.majorHazard? '不涉及' : this.$store.getters.prevention_risk_source_map[this.updateParams.majorHazard]
|
||||
|
||||
this.getTableCallback()
|
||||
// 获取url
|
||||
|
|
|
@ -891,7 +891,7 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
|
|||
public showUpdateModel(row?, isRead?) {
|
||||
this.initRiskSource()
|
||||
this.isReadonly = !!isRead
|
||||
this.updateParams = { status: 0, source: 9 } as any;
|
||||
this.updateParams = { status: 0, source: 9, dangerType:4 ,photo:null} as any;
|
||||
if (!row) {
|
||||
this.tableService.getNumber().then(res => {
|
||||
this.updateParams.number = res.data
|
||||
|
@ -914,8 +914,7 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
|
|||
professionClassifyName: this.$store.getters.prevention_major_type_map[row.professionClassify],
|
||||
reformModeName: this.reformModeMap[row.reformMode],
|
||||
}, row);
|
||||
this.updateParams.majorHazard = parseInt(this.updateParams.majorHazard)
|
||||
this.updateParams.majorHazardName = !this.updateParams.majorHazard || this.updateParams.majorHazard === 0 ? '不涉及' : this.$store.getters.prevention_risk_source_map[this.updateParams.majorHazard]
|
||||
this.updateParams.majorHazardName = !this.updateParams.majorHazard ? '不涉及' : this.$store.getters.prevention_risk_source_map[this.updateParams.majorHazard]
|
||||
|
||||
this.getTableCallback()
|
||||
// 获取url
|
||||
|
@ -1033,9 +1032,6 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
|
|||
this.updateParams.executeResourceName = this.fileList2.map(item => item.name).join(",")
|
||||
this.updateParams.verifyResourceId = this.photoList2.map(item => item.id).join(",")
|
||||
this.updateParams.verifyResourceName = this.photoList2.map(item => item.name).join(",")
|
||||
if (this.updateParams.majorHazard && this.updateParams.majorHazard !== 0) {
|
||||
this.updateParams.majorHazard = this.updateParams.majorHazard.toString()
|
||||
}
|
||||
this.tableService.addOrUpdate(this.updateParams, !this.updateParams.id).then(res => {
|
||||
this.$message.success(!this.updateParams.id ? "新增成功" : "编辑成功");
|
||||
if (!preStatus) {
|
||||
|
@ -1114,7 +1110,9 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
|
|||
type: res.data.type,
|
||||
id: res.data.id
|
||||
});
|
||||
this.updateParams.photo = this.photoList.length || null
|
||||
this.updateParams.photo = this.photoList.length;
|
||||
const option = this.updateOptions.find(item => item.key === "photo") as any;
|
||||
option.showError = false
|
||||
}
|
||||
}
|
||||
public onSuccess2(res, file, fileList) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
<script lang="ts">
|
||||
import { Component } from 'vue-property-decorator';
|
||||
import template from "../common.component.html"
|
||||
import template from "./safe.component.html"
|
||||
import BaseRecordComponent from "hbt-common/components/common/baseRecord.component.vue"
|
||||
import FormComponent from "hbt-common/components/common/form.component.vue"
|
||||
import TableComponent from "hbt-common/components/common/table.component.vue"
|
||||
|
@ -218,7 +218,7 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
|
|||
key: "description",
|
||||
require: true,
|
||||
showError: false,
|
||||
type: "text"
|
||||
type: "textarea"
|
||||
}, {
|
||||
name: "隐患级别",
|
||||
key: "level",
|
||||
|
@ -601,7 +601,9 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
|
|||
type: res.data.type,
|
||||
id: res.data.id
|
||||
});
|
||||
this.updateParams.photo = this.photoList.length || null
|
||||
this.updateParams.photo = this.photoList.length;
|
||||
const option = this.updateOptions.find(item => item.key === "photo") as any;
|
||||
option.showError = false
|
||||
}
|
||||
}
|
||||
public onSuccess2(res, file, fileList) {
|
||||
|
@ -643,6 +645,8 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
|
|||
inspectUserId: this.account.userId,
|
||||
inspectUserName: this.account.nickName,
|
||||
number: null,
|
||||
photo: null,
|
||||
dangerType: 4,
|
||||
planId: this.recordParams.planId,
|
||||
inspectTime: moment().format("YYYY-MM-DD HH:mm")
|
||||
}
|
||||
|
@ -655,10 +659,6 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
|
|||
})
|
||||
} else {
|
||||
|
||||
if (isRead) {
|
||||
delete this.updateParams.photo;
|
||||
}
|
||||
|
||||
this.updateParams = Object.assign({
|
||||
classifyName: this.$store.getters.prevention_dangrous_type_map[row.classify],
|
||||
dangerTypeName: this.$store.getters.prevention_danger_type_map[row.dangerType],
|
||||
|
|
|
@ -177,7 +177,6 @@ export default class PlanComponent extends BaseRecordComponent<any> {
|
|||
this.loadAreaData();
|
||||
this.getCheckList();
|
||||
}
|
||||
|
||||
public buildUpdateForm() {
|
||||
this.updateOptions = [{
|
||||
name: "计划类型",
|
||||
|
|
|
@ -31,13 +31,13 @@
|
|||
</template>
|
||||
<el-table-column label="操作" fixed="right" :width="tableActionWidth">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text"
|
||||
<el-button type="text" v-if="isPlan"
|
||||
@click="showUpdateModel(scope.row,true)">查看</el-button>
|
||||
<el-button type="text"
|
||||
:disabled="isPlan && ( (scope.row.planType === 1 && scope.row.status===1) || (scope.row.planType === 2 && scope.row.state===1))"
|
||||
<el-button type="text" v-if="isPlan"
|
||||
:disabled="(scope.row.planType === 1 && scope.row.status===1) || (scope.row.planType === 2 && scope.row.state===1)"
|
||||
@click="showUpdateModel(scope.row)">修改</el-button>
|
||||
<el-button type="text"
|
||||
:disabled="isPlan && ( (scope.row.planType === 1 && scope.row.status===1) || (scope.row.planType === 2 && scope.row.state===1))"
|
||||
<el-button type="text" v-if="isPlan"
|
||||
:disabled="(scope.row.planType === 1 && scope.row.status===1) || (scope.row.planType === 2 && scope.row.state===1)"
|
||||
@click="deleteData([scope.row.id])">删除</el-button>
|
||||
<el-button type="text" v-if="isPlan && !scope.row.status" :disabled="scope.row.planType===2 && scope.row.state===0"
|
||||
@click="openSendModel(scope.row)">下发</el-button>
|
||||
|
@ -228,6 +228,15 @@
|
|||
</FormComponent>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog v-if="showMap" :close-on-click-modal="false" destroy-on-close title="地图定位" :visible.sync="showMap"
|
||||
width="980px" :before-close="handleClose" destroy-on-close>
|
||||
<MapComponent @onLoad="getMap"></MapComponent>
|
||||
<div class="full" style="margin-top: 20px; text-align: center;">
|
||||
<el-button @click="handleClose">取消</el-button>
|
||||
<el-button type="primary" @click="onDragEnd">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
|
||||
<el-dialog v-if="showFile" :close-on-click-modal="false" title="查看图片" :visible.sync="showFile" destroy-on-close
|
||||
|
|
Loading…
Reference in New Issue