From 0336178b32f63a45ec530072a91d70826124e75f Mon Sep 17 00:00:00 2001 From: kongyeqing <2697454777@qq.com> Date: Fri, 15 Sep 2023 16:55:21 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../exchangeFlow/exchange.component.vue | 62 +++++++++++++------ src/views/risk/area/area.component.vue | 41 +++++++++++- .../device/deviceAnal.component.vue | 7 ++- .../risk/assessment/work/work.component.vue | 27 ++++++-- .../workprogress/trainRecords.component.vue | 10 +-- 5 files changed, 112 insertions(+), 35 deletions(-) diff --git a/src/views/integral/exchange/exchangeFlow/exchange.component.vue b/src/views/integral/exchange/exchangeFlow/exchange.component.vue index 971b491..4cab273 100644 --- a/src/views/integral/exchange/exchangeFlow/exchange.component.vue +++ b/src/views/integral/exchange/exchangeFlow/exchange.component.vue @@ -31,7 +31,7 @@ export default class IntegralExchange extends BaseRecordComponent { public params = { applicantId: null, - type: 2, + type: 1, bpmSchemeCode: "prevention-jfdh" } as any; @@ -373,9 +373,9 @@ export default class IntegralExchange extends BaseRecordComponent { name: '当前节点', width: "100", render: (data) => { if (data.taskInfo.processStatus === 2) { return `中断` - } else if(data.taskInfo.processStatus === 3){ + } else if (data.taskInfo.processStatus === 3) { return `作废` - } else if(data.taskInfo.processStatus === 4){ + } else if (data.taskInfo.processStatus === 4) { return `结束` } else { if (data.status === 1) { @@ -388,13 +388,15 @@ export default class IntegralExchange extends BaseRecordComponent { }); this.tableColumn.push({ name: '当前执行人', width: "100", key: "executor", render: (data) => data.taskInfo.executors || "--" }); this.tableColumn.push({ name: '最新提交时间', width: "180", key: "updateTime", sortable: 'custom' }); - this.tableColumn.push({ name: '发起人', width: "100", key: "startUser", render: (data) => { - if (this.params.type === 1) { - return `${data.applicantName}` - } else { - return data.applicantName + this.tableColumn.push({ + name: '发起人', width: "100", key: "startUser", render: (data) => { + if (this.params.type === 1) { + return `${data.applicantName}` + } else { + return data.applicantName + } } - }}); + }); this.tableColumn.push({ name: '发起时间', key: "applyTime", }); this.tableColumn.push({ name: '兑换清单', key: "goodsNumber", render: (data) => { @@ -568,17 +570,21 @@ export default class IntegralExchange extends BaseRecordComponent { public doSave() { //添加 处理更新 + let tmpParam = {} as any; if (this.updateParams.id) { + this.updateParams.oldstatus = this.updateParams.status if (this.updateParams.status === 1) { + tmpParam.type = 'agree' this.updateParams.status = 2 } else { if (this.updateParams.approvalResult === 0) { this.updateParams.status = 1 + tmpParam.type = 'reject' } else if (this.updateParams.approvalResult === 1) { this.updateParams.status = 3 + tmpParam.type = 'agree' } } - } else { this.updateParams.status = 2 } @@ -607,22 +613,28 @@ export default class IntegralExchange extends BaseRecordComponent { } }) } else if (this.updateParams.id) { - let tmpParam = { - "taskId": this.updateParams.taskInfo?.taskId ?? "", - "type": this.updateParams.approvalResult === 0 ? "reject" : 'agree', - "bizData": [{ - "bizId": this.updateParams.id, - "data": JSON.stringify(this.updateParams) - }] - } + tmpParam.taskId = this.updateParams.taskInfo?.taskId ?? ""; + tmpParam.bizData = [{ + "bizId": this.updateParams.id, + "data": JSON.stringify(this.updateParams) + }] this.integralFlowService.taskHandle(tmpParam).then((res: any) => { if (res.code === 200) { this.$message.success("处理成功!"); + + if (tmpParam.type === 'agree') { + if (res.data.code === 1) { + this.doAgain(res.data, [this.updateParams.approvalUserId]) + } else { + this.getTableData() + } + } else { + this.getTableData() + } this.updateParams = { pointExchangeDetails: [], } as any this.showUpdate = false; - this.getTableData(); } }) } @@ -631,6 +643,16 @@ export default class IntegralExchange extends BaseRecordComponent { } + public doAgain(data, userlist) { + let candidateInfos = data.candidateInfos[0] + candidateInfos.userList = [...candidateInfos.userList, ...userlist] + this.integralFlowService.taskCandidateSet({ candidateInfos: [candidateInfos] }).then(() => { + this.getTableData() + // 发起工作流成功 + }) + + } + public triCallback(data) { if (data.value === "cancel") { this.subShowUpdate = false @@ -887,7 +909,7 @@ export default class IntegralExchange extends BaseRecordComponent { this.getTableData(); } }) - }).catch(() => { + }).catch(() => { // }); } diff --git a/src/views/risk/area/area.component.vue b/src/views/risk/area/area.component.vue index 8c21e7b..2a2f8d9 100644 --- a/src/views/risk/area/area.component.vue +++ b/src/views/risk/area/area.component.vue @@ -114,10 +114,10 @@ export default class AreaManagerComponent extends BaseRecordComponent { // } - public getTableData(){ - this.tableService.selectByPageList(this.params).then((res:any)=>{ + public getTableData() { + this.tableService.selectByPageList(this.params).then((res: any) => { this.tableData = res.data - if(this.getTableCallback){ + if (this.getTableCallback) { this.getTableCallback(res.data) } }) @@ -473,6 +473,41 @@ export default class AreaManagerComponent extends BaseRecordComponent { this.selectData = data; } + //删除 + public deleteData(ids: any) { + if (!ids.length) { + return + } else { + this.$confirm("确认删除所选数据?", "确认数据", { + type: 'warning' + }).then(() => { + this.tableService.deleteByIds(ids).then((res: any) => { + if (res.data.type === 0) { + this.$message.success("删除成功!"); + this.getTableData() + } else { + let title = ''; + if (res.data.names.length > 3) { + title = '“' + res.data.names.slice(0, 3).join('”,“') + '” 等' + } else { + title = '“' + res.data.names.join('”,“') + '”' + } + this.$confirm(`${title}区域下存在单元划分数据,请先删除对应单元`, "", { + type: 'warning', + showConfirmButton: false + }).then(() => { + // + }).catch(() => { + // + }) + } + }) + }).catch(() => { + // + }) + } + } + } diff --git a/src/views/risk/assessment/device/deviceAnal.component.vue b/src/views/risk/assessment/device/deviceAnal.component.vue index 69c85ff..19c6fdf 100644 --- a/src/views/risk/assessment/device/deviceAnal.component.vue +++ b/src/views/risk/assessment/device/deviceAnal.component.vue @@ -133,8 +133,8 @@ export default class DeviceAnalManagerComponent extends BaseRecordComponent name: "设备类别", key: "type", type: "select", - datas:this.$store.state.prevention_device_type, - clearable:true, + datas: this.$store.state.prevention_device_type, + clearable: true, },]; public showUpdate = false; @@ -568,7 +568,7 @@ export default class DeviceAnalManagerComponent extends BaseRecordComponent public callback(data, type) { if (type) { - if (type === 'pageSize' || type === 'pageNum') { + if (type === 'pageSize' || type === 'pageNum') { this.params[type] = data; } this.getTableData(); @@ -641,6 +641,7 @@ export default class DeviceAnalManagerComponent extends BaseRecordComponent pageNum: 1, pageSize: 20, } as any; + this.getTableData() } // 分页数据 diff --git a/src/views/risk/assessment/work/work.component.vue b/src/views/risk/assessment/work/work.component.vue index 01847b6..71a82e2 100644 --- a/src/views/risk/assessment/work/work.component.vue +++ b/src/views/risk/assessment/work/work.component.vue @@ -31,6 +31,8 @@ export default class WorkManagerComponent extends BaseRecordComponent { public params = { areaName: "", unitName: "", + areaId: '', + unitId: '', name: "" } as any; @@ -222,7 +224,7 @@ export default class WorkManagerComponent extends BaseRecordComponent { multiple: true, width: "calc(50% - 20px)", require: true, - clearable:true, + clearable: true, datas: this.$store.state.postList }, { name: "安全因素", @@ -230,7 +232,7 @@ export default class WorkManagerComponent extends BaseRecordComponent { format: "safetyFactorName", type: "select", multiple: true, - clearable:true, + clearable: true, width: "calc(50% - 20px)", require: true, showError: false, @@ -340,12 +342,19 @@ export default class WorkManagerComponent extends BaseRecordComponent { } // 树点击 public handleNodeClick(data) { - this.params.unitName = ""; this.params.areaName = ""; + this.params.areaId = ""; + this.params.unitName = ""; + this.params.unitId = ""; + + console.log('data', data); + if (data.areaId) { - this.params.unitName = data.name + this.params.unitName = data.name; + this.params.unitId = data.id; } else { - this.params.areaName = data.name === "全部" ? "" : data.name + this.params.areaName = data.name === "全部" ? "" : data.name; + this.params.areaId = data.name === "全部" ? "" : data.id; } this.getTableData() } @@ -549,10 +558,13 @@ export default class WorkManagerComponent extends BaseRecordComponent { this.params = { areaName: "", unitName: "", + areaId: '', + unitId: '', name: "", pageNum: 1, pageSize: 20, } as any; + this.getTableData() } // 分页数据 @@ -570,6 +582,11 @@ export default class WorkManagerComponent extends BaseRecordComponent { identifyTime: moment().format('YYYY-MM-DD'), identifyUserId: this.account.userId, } as any; + //树点击 + if (this.params.areaId) { + this.updateParams.areaId = this.params.areaId; + this.loadUnitData(this.params.areaId) + } this.updateActionsForm() } else { this.tableService.getListDetail({ id: row.id }).then((res) => { diff --git a/src/views/workprogress/trainRecords.component.vue b/src/views/workprogress/trainRecords.component.vue index 96cc7c1..8e9dc2d 100644 --- a/src/views/workprogress/trainRecords.component.vue +++ b/src/views/workprogress/trainRecords.component.vue @@ -278,8 +278,11 @@ export default class TrainRecords extends BaseRecordComponent { width: "calc(50% - 20px)", controls: false, showError: false, - max: 100, - min: 0, + // max: 100, + // min: 0, + rules: [ + { pattern: /^(([1-9]?\d(\.\d{1,2})?)|100|100.00)$/, message: '在0~100之间,保留两位小数', } + ], hide: !(this.subUpdateParams.examStatus === 1) },] this.subUpdateActions = [{ @@ -389,7 +392,6 @@ export default class TrainRecords extends BaseRecordComponent { }, 0) } } - public scoreFormat(data: any, item: any) { if (item && item.key === 'score') { this.updateParams.score = null; @@ -401,7 +403,7 @@ export default class TrainRecords extends BaseRecordComponent { public callback(data, type) { if (type) { - if (type === 'pageSize' || type === 'pageNum') { + if (type === 'pageSize' || type === 'pageNum') { this.params[type] = data; } this.getTableData();