feat:修复bug

dev
kongyeqing 2023-09-20 09:47:43 +08:00
parent 0fd8f2cb23
commit fb146e0eac
22 changed files with 225 additions and 137 deletions

View File

@ -449,8 +449,9 @@ export default class DrawComponent extends Vue {
this.map.remove();
this.map = null;
}
destoryed(){
this.removeMap()
destroyed(){
// console.log(123)
// this.removeMap()
}
}
</script>

View File

@ -50,8 +50,9 @@ export default class MapComponent extends Vue {
mounted() {
this.initMap()
}
beforeDestory(){
beforeDestroy() {
// this.map.remove();
// this.map = null;
}
}
</script>

View File

@ -143,7 +143,10 @@ export default class MeasureComponent extends Vue {
public taskUpdateOptions: FormOption<BtnOption>[] = [];
//
public taskUpdataParams = {} as any;
public taskUpdataParams = {
startTime: null,
endTime: null
} as any;
//
public taskType = [] as any;
@ -227,7 +230,7 @@ export default class MeasureComponent extends Vue {
datas: this.$store.state.userList,
showError: false,
}, {
name: "排查周期 每",
name: "排查周期 每",
key: "reviewCycleValue",
type: "number",
width: "calc(50% - 20px)",
@ -496,7 +499,10 @@ export default class MeasureComponent extends Vue {
this.showSubUpdate = false;
this.taskIsReadonly = false;
this.taskCurrentId = -1;
this.taskUpdataParams = {} as any;
this.taskUpdataParams = {
startTime: null,
endTime: null
};
}
public taskCallback(data) {
@ -529,7 +535,10 @@ export default class MeasureComponent extends Vue {
public taskAdd() {
this.taskType = this.taskItemSelect()
this.taskUpdataParams = {} as any;
this.taskUpdataParams = {
startTime: null,
endTime: null
};
if (this.outermostData.majorSign && this.outermostData.majorSign.includes(0)) {
this.taskUpdataParams.insuranceDutyFlag = 0;
this.taskUpdataParams.taskType = 0
@ -621,7 +630,7 @@ export default class MeasureComponent extends Vue {
}
//
if (item && item.key === 'startTime') {
if (data > this.taskUpdataParams.endTime) {
if (this.taskUpdataParams.endTime && data > this.taskUpdataParams.endTime) {
this.$message.warning("结束时间不能早于开始时间!")
this.taskUpdataParams.endTime = null;
return

View File

@ -343,7 +343,7 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
key: "photo",
ref: "photo",
type: "upload",
width: "calc(50% - 20px)",
width: "100%",
require: true,
onSucess: this.onSuccess,
onMove: this.onRemove,
@ -359,7 +359,7 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
key: "file",
ref: "file",
type: "upload",
width: "calc(50% - 20px)",
width: "100%",
showError: false,
onSucess: this.onSuccess2,
onMove: this.onRemove2,
@ -442,7 +442,7 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
}
public buildTable() {
this.tableColumn.push({ name: '整改单编号', width: "200px", key: "number" });
this.tableColumn.push({ name: '整改单编号', width: "220px", key: "number" });
this.tableColumn.push({ name: '隐患描述', key: "description", width: "300px" });
this.tableColumn.push({ name: '整改部门', width: "100px", key: "reformDeptName" });
this.tableColumn.push({
@ -618,7 +618,7 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
id: item.id
}
})
this.updateParams.photo = this.photoList.length || null;
this.updateParams.photo = this.isReadonly ? null : (this.photoList.length || null);
this.buildUpdateForm()
})
}

View File

@ -462,7 +462,7 @@ export default class HiddenDangerFilesComponent extends BaseRecordComponent<any>
hide: this.updateParams.reformConfirmFlag === 0,
showError: false,
rules: [
{ pattern: /^[1-9]\d{0,7}(\.\d{1,3})?$/, message: '不超过八位的整数', },
{ pattern: /^[1-9]\d{0,7}(\.\d{1,2})?$/, message: '不超过八位的整数,保留两位小数', },
],
unit: {
name: "元",

View File

@ -514,7 +514,7 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
hide: this.updateParams.reformConfirmFlag === 0,
showError: false,
rules: [
{ pattern: /^[1-9]\d{0,7}(\.\d{1,3})?$/, message: '不超过八位的整数', },
{ pattern: /^[1-9]\d{0,7}(\.\d{1,2})?$/, message: '不超过八位的整数,保留两位小数', },
],
unit: {
name: "元",
@ -775,12 +775,12 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
this.getTableCallback()
return
}
if (item && item.key === 'executeMoney') {
this.updateParams.executeMoney = null;
setTimeout(() => {
this.updateParams.executeMoney = +data.toFixed(2)
}, 0)
}
// if (item && item.key === 'executeMoney') {
// this.updateParams.executeMoney = null;
// setTimeout(() => {
// this.updateParams.executeMoney = +data.toFixed(2)
// }, 0)
// }
if (item && item.key === "reformDeadline") {
const now = moment().format("YYYY-MM-DD HH");
if (now > data) {

View File

@ -82,7 +82,7 @@
<el-dialog v-if="isManager" :close-on-click-modal="false" :title="!subUpdateParams.id?'新增':subIsReadonly?'详情':'编辑'"
:visible.sync="showSubUpdate" :before-close="handleClose" destroy-on-close>
<FormComponent :options="subUpdateOptions" :isReadonly="subIsReadonly" labelWidth="110px" labelAlign="right"
:data.sync="subUpdateParams" @actionCallback="subCallback" :actions="subUpdateActions" :full-btn="true"
:data.sync="subUpdateParams" @actionCallback="subCallback" :actions="checkUpdateActions" :full-btn="true"
@change="subChange" btn-position="center">
</FormComponent>
</el-dialog>

View File

@ -95,7 +95,10 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
public showUpdate = false;
public currentId = -1;
public updateParams = {} as any;
public updateParams = {
units: [],
tableItems: []
} as any;
public subUpdateParams = {} as any;
public updateOptions: FormOption<BtnOption>[] = [];
public updateTableData = { datas: [] };
@ -488,6 +491,7 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
this.isReadonly = !!isRead;
this.clearSelect()
if (!row) {
this.updateParams = { units: [], tableItems: [] } as any
this.currentId = -1;
this.getNumber();
this.buildUpdateForm();
@ -583,7 +587,7 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
item.index = i + 1
})
this.subUpdateParams = {} as any;
this.showSubUpdate = false;
this.showSubUpdate = !!goOn;
}
public doSubDelete(indexs) {

View File

@ -114,16 +114,17 @@ export default class PlanComponent extends BaseRecordComponent<any> {
public updateActions = [{
name: "取消",
value: "cancel"
}, {
name: "保存",
value: "save",
type: "primary"
}, {
},
{
name: "保存并继续添加",
hide: false,
value: "saveAndContinue",
type: "primary"
}];
}, {
name: "保存",
value: "save",
type: "primary"
},];
public selectData = [];
@ -205,7 +206,7 @@ export default class PlanComponent extends BaseRecordComponent<any> {
showError: false,
datas: this.$store.state.prevention_danger_check_type
}, {
name: "巡检周期 每",
name: "巡检周期 每",
key: "inspectCycleValue",
type: "number",
hide: this.updateParams.planType === 1,
@ -460,6 +461,10 @@ export default class PlanComponent extends BaseRecordComponent<any> {
this.buildUpdateForm();
}
if (item && item.key === "areaIds") {
if (!data) {
this.unitList = []
return
}
this.loadUnitData(data)
}
if (item && item.key === "chargeUserId") {
@ -577,7 +582,7 @@ export default class PlanComponent extends BaseRecordComponent<any> {
//
public async showUpdateModel(row?, isRead?) {
this.updateActions[2].hide = false;
this.updateActions[1].hide = false;
this.isReadonly = !!isRead;
if (row) {
if (isRead) {
@ -683,7 +688,7 @@ export default class PlanComponent extends BaseRecordComponent<any> {
//
let isDeleteUnit = this.judgeDeleteUnitMethod(JSON.parse(JSON.stringify(row)));
if (!isDeleteUnit) {
this.updateActions[2].hide = true;
this.updateActions[1].hide = true;
this.currentPlan = row;
this.showSend = true;
this.tableTabs = [];

View File

@ -397,7 +397,9 @@ export default class IntegralExchange extends BaseRecordComponent<any> {
}
}
});
this.tableColumn.push({ name: '发起时间', key: "applyTime", });
this.tableColumn.push({ name: '发起时间', key: "applyTime",render:(data)=>{
return moment(data.applyTime).format('YYYY-MM-DD HH:mm')
} });
this.tableColumn.push({
name: '兑换清单', key: "goodsNumber", render: (data) => {
return `<span class="link goodsNumber">${data.goodsNumber}</span>`

View File

@ -125,7 +125,6 @@ export default class IntegralMall extends BaseRecordComponent<any> {
rules: [
{ pattern: /^\d{1,5}$/, message: '在1~99999范围内', }
],
// max: 99999,
min: 1
},
{
@ -143,6 +142,10 @@ export default class IntegralMall extends BaseRecordComponent<any> {
require: true,
width: "calc(50% - 20px)",
showError: false,
rules: [
{ pattern: /^\d{1,8}$/, message: '在1~99999999范围内', }
],
min: 1,
},
{
name: "状态",

View File

@ -83,7 +83,7 @@
width="952px" destroy-on-close>
<FormComponent :options="subUpdateOptions" labelWidth="110px" labelAlign="right" :data.sync="subUpdateParams"
@actionCallback="triCallback" :isReadonly="subIsReadonly" :actions="subUpdateActions" :full-btn="true" @change="changes"
btnPosition="center">
btnPosition="center" ref="recordForm">
</FormComponent>
</el-dialog>
</div>

View File

@ -221,8 +221,8 @@ export default class RewardsRecord extends BaseRecordComponent<any> {
showError: false,
hide: !(this.subUpdateParams.type && this.subUpdateParams.type !== 1),
rules: [
{ pattern: /^[1-9]\d{0,7}(\.\d{1,3})?$/, message: '不超过八位的整数', },
]
{ pattern: /^[1-9]\d{0,7}(\.\d{1,2})?$/, message: '不超过八位的整数,保留两位小数', },
],
}, {
name: "奖惩事由",
type: "textarea",
@ -297,12 +297,12 @@ export default class RewardsRecord extends BaseRecordComponent<any> {
option.hide = false
}
}
if (item && item.key === 'money') {
this.subUpdateParams.money = null;
setTimeout(() => {
this.subUpdateParams.money = +data.toFixed(2)
}, 0)
}
// if (item && item.key === 'money') {
// this.subUpdateParams.money = null;
// setTimeout(() => {
// this.subUpdateParams.money = +data.toFixed(2)
// }, 0)
// }
}
public buildTable() {
@ -499,9 +499,11 @@ export default class RewardsRecord extends BaseRecordComponent<any> {
if (data.value === "cancel") {
this.subShowUpdate = false;
} else if (data && data.value.indexOf("save") >= 0) {
if ((this.$refs.recordForm as any).vaildParams()) {
this.doSubSave(data.value !== "save")
}
}
}
/**
* 新增奖惩记录
* @param goOn

View File

@ -362,6 +362,10 @@ export default class AreaManagerComponent extends BaseRecordComponent<any> {
if (item && item.key === "majorHazardFlag") {
this.updateOptions[5].hide = !data;
this.updateOptions[6].hide = !data;
if(!data){
this.updateParams.majorHazardName = '';
this.updateParams.majorHazardLevel = '';
}
}
}

View File

@ -241,11 +241,7 @@ export default class AreaAnalComponent extends BaseRecordComponent<any> {
let len: number = 0;
let tmpRiskDatas = []
if (this.popTitle === 'L') {
tmpRiskDatas = this.riskLDatas
}
if (this.popTitle === 'S') {
tmpRiskDatas = this.riskSDatas
}
tmpRiskDatas = this.riskLDatas;
tmpRiskDatas.forEach((item: any) => {
if (item.value && typeof (item.value) === 'number') {
len = len + 1
@ -253,9 +249,19 @@ export default class AreaAnalComponent extends BaseRecordComponent<any> {
}
})
tmpRiskDatas.forEach((item: any) => {
item.result = Math.round(value / len).toString()
item.result = Math.ceil(value / len).toString()
})
}
if (this.popTitle === 'S') {
tmpRiskDatas = this.riskSDatas;
let maxdata = Math.max.apply(Math, tmpRiskDatas.map((item: any) => {
return item.value && typeof (item.value) === 'number' ? item.value : 0
}))
tmpRiskDatas.forEach((item: any) => {
item.result = maxdata.toString()
})
}
}
public startEdit(row) {
row.edit = true;

View File

@ -156,6 +156,7 @@ export default class WorkManagerComponent extends BaseRecordComponent<any> {
public subUpdateOptions: FormOption<BtnOption>[] = [];
@Watch("$store.state.deptList", { immediate: true, deep: true })
@Watch("$store.state.userList", { immediate: true, deep: true })
onChanges() {
this.loadAreaData()
}
@ -618,6 +619,7 @@ export default class WorkManagerComponent extends BaseRecordComponent<any> {
} else {
this.updateParams.safetyFactor = this.updateParams.safetyFactor.split(",").map(item => +item);
this.updateParams.safetyFactorName = this.updateParams.safetyFactor.map(item => this.$store.getters.prevention_safe_reason_map[item]).join(",")
this.updateParams.identifyUserName = this.$store.getters.user_map[this.updateParams.identifyUserId];
}
this.updateActionsForm()
})

View File

@ -154,6 +154,7 @@ export default class IdentifyManagerComponent extends BaseRecordComponent<any> {
name: "LS法",
key: "riskLSValue",
type: "text",
hide: !this.subUpdateParams.riskLsValue
// width: "20px",
}, {
name: "L值",
@ -161,18 +162,21 @@ export default class IdentifyManagerComponent extends BaseRecordComponent<any> {
type: "text",
width: "10%",
labelWidth: "40px",
hide: !this.subUpdateParams.riskLsValue
}, {
name: "S值",
key: "lssvalue",
type: "text",
width: "10%",
labelWidth: "40px",
hide: !this.subUpdateParams.riskLsValue
}, {
name: "R值",
key: "lsrvalue",
type: "text",
width: "20%",
labelWidth: "40px",
hide: !this.subUpdateParams.riskLsValue
}, {
name: "风险等级:",
key: "lsgrade",
@ -180,10 +184,12 @@ export default class IdentifyManagerComponent extends BaseRecordComponent<any> {
type: "text",
width: "20%",
labelWidth: "60px",
hide: !this.subUpdateParams.riskLsValue
}, {
name: "LEC法",
key: "riskLECValue",
type: "text",
hide: !this.subUpdateParams.riskLecValue
// labelWidth: "30px",
}, {
name: "L值",
@ -191,24 +197,28 @@ export default class IdentifyManagerComponent extends BaseRecordComponent<any> {
type: "text",
width: "10%",
labelWidth: "40px",
hide: !this.subUpdateParams.riskLecValue
}, {
name: "E值",
key: "lecevalue",
type: "text",
width: "10%",
labelWidth: "40px",
hide: !this.subUpdateParams.riskLecValue
}, {
name: "C值",
key: "leccvalue",
type: "text",
width: "10%",
labelWidth: "40px",
hide: !this.subUpdateParams.riskLecValue
}, {
name: "D值",
key: "lecdvalue",
type: "text",
width: "15%",
labelWidth: "40px",
hide: !this.subUpdateParams.riskLecValue
}, {
name: "风险等级:",
key: "lecgrade",
@ -216,6 +226,7 @@ export default class IdentifyManagerComponent extends BaseRecordComponent<any> {
type: "text",
width: "20%",
labelWidth: "60px",
hide: !this.subUpdateParams.riskLecValue
}, {
name: "风险等级",
key: "riskLevel",
@ -236,6 +247,7 @@ export default class IdentifyManagerComponent extends BaseRecordComponent<any> {
name: "LS法",
key: "remainLSValue",
type: "text",
hide: !this.subUpdateParams.remainLsValue
// width: "30px",
}, {
name: "L值",
@ -243,18 +255,21 @@ export default class IdentifyManagerComponent extends BaseRecordComponent<any> {
type: "text",
width: "10%",
labelWidth: "40px",
hide: !this.subUpdateParams.remainLsValue
}, {
name: "S值",
key: "lssvalue",
type: "text",
width: "10%",
labelWidth: "40px",
hide: !this.subUpdateParams.remainLsValue
}, {
name: "R值",
key: "lsrvalue",
type: "text",
width: "20%",
labelWidth: "40px",
hide: !this.subUpdateParams.remainLsValue
}, {
name: "风险等级:",
key: "lsgrade",
@ -262,10 +277,12 @@ export default class IdentifyManagerComponent extends BaseRecordComponent<any> {
type: "text",
width: "20%",
labelWidth: "60px",
hide: !this.subUpdateParams.remainLsValue
}, {
name: "LEC法",
key: "remainLECValue",
type: "text",
hide: !this.subUpdateParams.remainLecValue
// width: "30px",
}, {
name: "L值",
@ -273,24 +290,28 @@ export default class IdentifyManagerComponent extends BaseRecordComponent<any> {
type: "text",
width: "10%",
labelWidth: "40px",
hide: !this.subUpdateParams.remainLecValue
}, {
name: "E值",
key: "lecevalue",
type: "text",
width: "10%",
labelWidth: "40px",
hide: !this.subUpdateParams.remainLecValue
}, {
name: "C值",
key: "leccvalue",
type: "text",
width: "10%",
labelWidth: "40px",
hide: !this.subUpdateParams.remainLecValue
}, {
name: "D值",
key: "lecdvalue",
type: "text",
width: "15%",
labelWidth: "40px",
hide: !this.subUpdateParams.remainLecValue
}, {
name: "风险等级:",
key: "lecgrade",
@ -298,6 +319,7 @@ export default class IdentifyManagerComponent extends BaseRecordComponent<any> {
type: "text",
width: "20%",
labelWidth: "60px",
hide: !this.subUpdateParams.remainLecValue
}, {
name: "风险等级",
key: "remainLevel",
@ -449,7 +471,7 @@ export default class IdentifyManagerComponent extends BaseRecordComponent<any> {
}
}
this.riskUpdateParams = { ...this.riskUpdateParams, ...tmpRiskLecValue };
this.riskUpdateParams.lecgradeName = this.$store.getters.prevention_risk_level_map[this.riskUpdateParams.lsgrade];
this.riskUpdateParams.lecgradeName = this.$store.getters.prevention_risk_level_map[this.riskUpdateParams.lecgrade];
}
// LS

View File

@ -224,7 +224,7 @@ export default class UnitManagerComponent extends BaseRecordComponent<any> {
public buildFormOptions() {
this.updateOptions = [{
name: "选择区域",
name: "区域名称",
key: "areaId",
placeholder: "请选择区域名称",
width: "calc(50% - 20px)",
@ -361,7 +361,8 @@ export default class UnitManagerComponent extends BaseRecordComponent<any> {
public buildTable() {
this.tableColumn.push({ name: '风险分析单元', key: "name" });
this.tableColumn.push({ name: '区域名称', key: "areaName" });
this.tableColumn.push({ name: '单元名称', key: "name" });
this.tableColumn.push({ name: '责任部门', key: "chargeDeptName" });
this.tableColumn.push({ name: '责任人', key: "chargeUserName" });
this.tableColumn.push({
@ -394,7 +395,7 @@ export default class UnitManagerComponent extends BaseRecordComponent<any> {
});
this.repairTableColumn.push({ name: "序号", key: "index" });
this.repairTableColumn.push({ name: "停用开始时间", key: "startTime" });
this.repairTableColumn.push({ name: "停用开始时间", key: "endTime" });
this.repairTableColumn.push({ name: "停用结束时间", key: "endTime" });
this.repairTableColumn.push({ name: "原因", key: "reason" });
this.repairTableColumn.push({ name: "登记人", key: "registerUserName" });
this.repairTableColumn.push({ name: "登记时间", key: "registerTime" });
@ -441,8 +442,6 @@ export default class UnitManagerComponent extends BaseRecordComponent<any> {
}
public change(data, item) {
console.log('data');
//
if (item && item.key === "chargeDeptId") {
this.updateParams.chargeDeptName = this.$store.getters.dept_map[data];
@ -471,6 +470,14 @@ export default class UnitManagerComponent extends BaseRecordComponent<any> {
this.turnOffParams.endTime = null
}
}
//
if (item && item.key === 'name') {
if (this.updateParams.geoJson !== '[]') {
let tmpGeoJson = JSON.parse(this.updateParams.geoJson);
tmpGeoJson[0]['properties']['name'] = this.updateParams.name;
this.$set(this.updateParams, 'geoJson', JSON.stringify(tmpGeoJson))
}
}
}
public callback(data, type) {
if (type) {

View File

@ -1,6 +1,6 @@
<script lang="ts">
import { Component } from 'vue-property-decorator';
import { Component, Watch } from 'vue-property-decorator';
import template from './common.component.html'
import BaseRecordComponent from "hbt-common/components/common/baseRecord.component.vue";
import FormComponent from "hbt-common/components/common/form.component.vue";
@ -95,7 +95,10 @@ export default class ManagementSystem extends BaseRecordComponent<any> {
value: "reverse"
}];
public formOptions: FormOption<BtnOption>[] = [{
public formOptions: FormOption<BtnOption>[] = [] as any;
public buildFormOptions() {
this.formOptions = [{
name: "制度名称",
key: "name",
type: "text",
@ -112,6 +115,7 @@ export default class ManagementSystem extends BaseRecordComponent<any> {
type: "date",
format: "yyyy-MM-dd"
}];
}
public subActions = [{
name: "取消",
@ -257,7 +261,13 @@ export default class ManagementSystem extends BaseRecordComponent<any> {
created() {
//
this.buildFormOptions();
}
@Watch("$store.state.deptTreeList", { immediate: true, deep: true })
onChanges() {
this.buildFormOptions();
}
public buildTable() {

View File

@ -1,7 +1,7 @@
<script lang="ts">
import { Component } from 'vue-property-decorator';
import { Component, Watch } from 'vue-property-decorator';
import template from './common.component.html'
import BaseRecordComponent from "hbt-common/components/common/baseRecord.component.vue";
import FormComponent from "hbt-common/components/common/form.component.vue";
@ -99,7 +99,10 @@ export default class Programme extends BaseRecordComponent<any> {
value: "reverse"
}];
public formOptions: FormOption<BtnOption>[] = [{
public formOptions: FormOption<BtnOption>[] = [] as any;
public buildFormOptions() {
this.formOptions = [{
name: "方案名称",
key: "name",
type: "text",
@ -107,8 +110,8 @@ export default class Programme extends BaseRecordComponent<any> {
name: "适用部门",
key: "suitDeptId",
type: "treeSelect",
datas: this.$store.state.deptTreeList,
expandLevel: Infinity,
datas: this.$store.state.deptTreeList,
width: "280px"
}, {
name: "适用年度",
@ -116,6 +119,7 @@ export default class Programme extends BaseRecordComponent<any> {
type: "select",
datas: this.suitList,
}];
}
public subActions = [{
name: "取消",
@ -260,10 +264,13 @@ export default class Programme extends BaseRecordComponent<any> {
}];
}
created() {
this.getSuitListData();
this.buildFormOptions();
}
@Watch("$store.state.deptTreeList", { immediate: true, deep: true })
onChanges() {
this.buildFormOptions();
}
//

View File

@ -175,6 +175,9 @@ export default class TrainRecords extends BaseRecordComponent<any> {
require: true,
width: "calc(50% - 20px)",
showError: false,
rules: [
{ pattern: /^(([1-9]?\d(\.\d{1,1})?)|99|99.0)$/, message: '支持输入两位整数,保留一位小数', }
],
},
{
name: "培训时间",
@ -375,9 +378,9 @@ export default class TrainRecords extends BaseRecordComponent<any> {
this.buildSubForm()
}
//
this.durationChange(data, item);
//
this.scoreFormat(data, item);
// this.durationChange(data, item);
// //
// this.scoreFormat(data, item);
}
/**
* 培训时长格式化保留一位小数