fixed:修复测试提出的问题

dev
吴延福 2023-09-07 17:05:22 +08:00
parent 8d001ac056
commit 67e108e469
6 changed files with 34 additions and 31 deletions

View File

@ -532,6 +532,7 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
inspectUserId: this.account.userId, inspectUserId: this.account.userId,
inspectUserName: this.account.nickName, inspectUserName: this.account.nickName,
number: null, number: null,
photo: null,
inspectTime: moment().format("YYYY-MM-DD HH:mm") inspectTime: moment().format("YYYY-MM-DD HH:mm")
} }
if (!row) { if (!row) {
@ -542,9 +543,6 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
this.showUpdate = true; this.showUpdate = true;
}) })
} else { } else {
if (isRead) {
delete this.updateParams.photo;
}
this.tableService.selectById(row.id).then((res: any) => { this.tableService.selectById(row.id).then((res: any) => {
this.updateParams = Object.assign({ this.updateParams = Object.assign({
classifyName: this.$store.getters.prevention_dangrous_type_map[res.data.classify], 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, areaName: (this.areaList.find((item: any) => item.value === res.data.areaId) as any).name,
type: "随手拍", type: "随手拍",
}, res.data) }, res.data)
this.updateParams.majorHazard = parseInt(this.updateParams.majorHazard) this.updateParams.majorHazard = +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.center = [res.data.locationLng, res.data.locationLat]; this.center = [res.data.locationLng, res.data.locationLat];
@ -568,6 +566,7 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
// url // url
if (res.data.resourceId) { if (res.data.resourceId) {
this.updateParams.photo = 1;
this.tableService.getFileUrls({ ids: res.data.resourceId.split(",") }).then((photos: any) => { this.tableService.getFileUrls({ ids: res.data.resourceId.split(",") }).then((photos: any) => {
this.photoList = photos.data.map(item => { this.photoList = photos.data.map(item => {
return { return {
@ -627,7 +626,9 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
type: res.data.type, type: res.data.type,
id: res.data.id 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) { 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.resourceName = this.photoList.map(item => item.name).join(",")
this.updateParams.resourceOtherId = this.fileList.map(item => item.id).join(",") this.updateParams.resourceOtherId = this.fileList.map(item => item.id).join(",")
this.updateParams.resourceOtherName = this.fileList.map(item => item.name).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.tableService.addOrUpdate(this.updateParams, !this.updateParams.id).then(res => {
this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功"); this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功");

View File

@ -693,8 +693,7 @@ export default class HiddenDangerFilesComponent extends BaseRecordComponent<any>
professionClassifyName: this.$store.getters.prevention_major_type_map[row.professionClassify], professionClassifyName: this.$store.getters.prevention_major_type_map[row.professionClassify],
reformModeName: this.reformModeMap[row.reformMode], reformModeName: this.reformModeMap[row.reformMode],
}, row); }, row);
this.updateParams.majorHazard = parseInt(this.updateParams.majorHazard) this.updateParams.majorHazardName = !this.updateParams.majorHazard? '不涉及' : this.$store.getters.prevention_risk_source_map[this.updateParams.majorHazard]
this.updateParams.majorHazardName = !this.updateParams.majorHazard || this.updateParams.majorHazard === 0 ? '不涉及' : this.$store.getters.prevention_risk_source_map[this.updateParams.majorHazard]
this.getTableCallback() this.getTableCallback()
// url // url

View File

@ -891,7 +891,7 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
public showUpdateModel(row?, isRead?) { public showUpdateModel(row?, isRead?) {
this.initRiskSource() this.initRiskSource()
this.isReadonly = !!isRead 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) { if (!row) {
this.tableService.getNumber().then(res => { this.tableService.getNumber().then(res => {
this.updateParams.number = res.data 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], professionClassifyName: this.$store.getters.prevention_major_type_map[row.professionClassify],
reformModeName: this.reformModeMap[row.reformMode], reformModeName: this.reformModeMap[row.reformMode],
}, row); }, row);
this.updateParams.majorHazard = parseInt(this.updateParams.majorHazard) this.updateParams.majorHazardName = !this.updateParams.majorHazard ? '不涉及' : this.$store.getters.prevention_risk_source_map[this.updateParams.majorHazard]
this.updateParams.majorHazardName = !this.updateParams.majorHazard || this.updateParams.majorHazard === 0 ? '不涉及' : this.$store.getters.prevention_risk_source_map[this.updateParams.majorHazard]
this.getTableCallback() this.getTableCallback()
// url // url
@ -1033,9 +1032,6 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
this.updateParams.executeResourceName = this.fileList2.map(item => item.name).join(",") this.updateParams.executeResourceName = this.fileList2.map(item => item.name).join(",")
this.updateParams.verifyResourceId = this.photoList2.map(item => item.id).join(",") this.updateParams.verifyResourceId = this.photoList2.map(item => item.id).join(",")
this.updateParams.verifyResourceName = this.photoList2.map(item => item.name).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.tableService.addOrUpdate(this.updateParams, !this.updateParams.id).then(res => {
this.$message.success(!this.updateParams.id ? "新增成功" : "编辑成功"); this.$message.success(!this.updateParams.id ? "新增成功" : "编辑成功");
if (!preStatus) { if (!preStatus) {
@ -1114,7 +1110,9 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
type: res.data.type, type: res.data.type,
id: res.data.id 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) { public onSuccess2(res, file, fileList) {

View File

@ -1,7 +1,7 @@
<script lang="ts"> <script lang="ts">
import { Component } from 'vue-property-decorator'; 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 BaseRecordComponent from "hbt-common/components/common/baseRecord.component.vue"
import FormComponent from "hbt-common/components/common/form.component.vue" import FormComponent from "hbt-common/components/common/form.component.vue"
import TableComponent from "hbt-common/components/common/table.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", key: "description",
require: true, require: true,
showError: false, showError: false,
type: "text" type: "textarea"
}, { }, {
name: "隐患级别", name: "隐患级别",
key: "level", key: "level",
@ -601,7 +601,9 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
type: res.data.type, type: res.data.type,
id: res.data.id 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) { public onSuccess2(res, file, fileList) {
@ -643,6 +645,8 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
inspectUserId: this.account.userId, inspectUserId: this.account.userId,
inspectUserName: this.account.nickName, inspectUserName: this.account.nickName,
number: null, number: null,
photo: null,
dangerType: 4,
planId: this.recordParams.planId, planId: this.recordParams.planId,
inspectTime: moment().format("YYYY-MM-DD HH:mm") inspectTime: moment().format("YYYY-MM-DD HH:mm")
} }
@ -655,10 +659,6 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
}) })
} else { } else {
if (isRead) {
delete this.updateParams.photo;
}
this.updateParams = Object.assign({ this.updateParams = Object.assign({
classifyName: this.$store.getters.prevention_dangrous_type_map[row.classify], classifyName: this.$store.getters.prevention_dangrous_type_map[row.classify],
dangerTypeName: this.$store.getters.prevention_danger_type_map[row.dangerType], dangerTypeName: this.$store.getters.prevention_danger_type_map[row.dangerType],

View File

@ -177,7 +177,6 @@ export default class PlanComponent extends BaseRecordComponent<any> {
this.loadAreaData(); this.loadAreaData();
this.getCheckList(); this.getCheckList();
} }
public buildUpdateForm() { public buildUpdateForm() {
this.updateOptions = [{ this.updateOptions = [{
name: "计划类型", name: "计划类型",

View File

@ -31,13 +31,13 @@
</template> </template>
<el-table-column label="操作" fixed="right" :width="tableActionWidth"> <el-table-column label="操作" fixed="right" :width="tableActionWidth">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" <el-button type="text" v-if="isPlan"
@click="showUpdateModel(scope.row,true)">查看</el-button> @click="showUpdateModel(scope.row,true)">查看</el-button>
<el-button type="text" <el-button type="text" v-if="isPlan"
:disabled="isPlan && ( (scope.row.planType === 1 && scope.row.status===1) || (scope.row.planType === 2 && scope.row.state===1))" :disabled="(scope.row.planType === 1 && scope.row.status===1) || (scope.row.planType === 2 && scope.row.state===1)"
@click="showUpdateModel(scope.row)">修改</el-button> @click="showUpdateModel(scope.row)">修改</el-button>
<el-button type="text" <el-button type="text" v-if="isPlan"
:disabled="isPlan && ( (scope.row.planType === 1 && scope.row.status===1) || (scope.row.planType === 2 && scope.row.state===1))" :disabled="(scope.row.planType === 1 && scope.row.status===1) || (scope.row.planType === 2 && scope.row.state===1)"
@click="deleteData([scope.row.id])">删除</el-button> @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" <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> @click="openSendModel(scope.row)">下发</el-button>
@ -228,6 +228,15 @@
</FormComponent> </FormComponent>
</el-dialog> </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 <el-dialog v-if="showFile" :close-on-click-modal="false" title="查看图片" :visible.sync="showFile" destroy-on-close