f9f531ce by lihua

评估只有一级审批弹信息输入框

1 parent ddeae135
......@@ -58,3 +58,9 @@ export const getProcessNodesPromise = (params)=>request({
method: 'post',
data: params
})
export const isMyFirstNode = (params) => request({
url: `${import.meta.env.VITE_APP_WORK_FLOW_URL}/work-flow/data/is-my-first-node`,
method: 'post',
data: params
})
\ No newline at end of file
......
......@@ -20,7 +20,7 @@ import useDataAssetStore from "@/store/modules/dataAsset";
import {
getStaffDetailInfo
} from "@/api/modules/queryService";
import { rejectFlowData, revokeFlowData, getCamundaDeploymentId, getProcessNodesPromise } from "@/api/modules/workFlowService";
import { rejectFlowData, revokeFlowData, getCamundaDeploymentId, getProcessNodesPromise, isMyFirstNode, passFlowData } from "@/api/modules/workFlowService";
const assetStore = useDataAssetStore();
......@@ -224,6 +224,8 @@ const getTableBtns = (row) => {
const currTableData: any = ref({});
let getFirstNodePromise: any = ref({});
const tableBtnClick = (scope, btn) => {
const type = btn.value;
const row = scope.row;
......@@ -240,6 +242,17 @@ const tableBtnClick = (scope, btn) => {
} else if (type === 'reject') {
rejectDialogInfo.value.visible = true;
} else if (type === 'pass') {
if (getFirstNodePromise.value[row.guid]) {
return;
}
getFirstNodePromise.value[row.guid] = isMyFirstNode({
deploymentId: row.approveVO.camundaDeploymentId,
processInstanceId: row.approveVO.camundaInstanceId,
staffGuid: userData.staffGuid
}).then((res: any) => {
getFirstNodePromise.value[row.guid] = null;
if (res?.code == proxy.$passCode) {
if (res.data) {
passDialogInfo.value.visible = true;
if (row.dataStartDate) {
passFormItems.value[1].disabled = true;
......@@ -249,6 +262,13 @@ const tableBtnClick = (scope, btn) => {
passFormItems.value[1].default = null;
}
passFormItems.value[2].placeholder = `本次评估数据资产总体质量得分为**分\n准确性:\n一致性:\n可访问性:\n规范性:\n完整性:`;
} else {
passCommonDialogInfo.value.visible = true;
}
} else {
proxy.$ElMessage.error(res.msg);
}
})
} else if (type === 'revoke') { // 撤销,状态为审批中时可以撤销。
ElMessageBox.confirm(`撤销后,该流程将不再进行审核,确定这样操作吗?`, "提示", {
confirmButtonText: "确定",
......@@ -743,6 +763,73 @@ const rejectDialogBtnClick = (btn, info) => {
}
};
const passCommonDialogInfo = ref({
visible: false,
size: 460,
direction: "column",
header: {
title: "通过",
},
type: '',
contents: [
{
type: 'form',
title: '',
formInfo: {
id: 'batch-pass-form',
items: [
{
label: '',
type: "textarea",
placeholder: "请填写通过备注(选填)",
field: "approveSuggest",
clearable: true,
maxlength: 400,
block: true,
col: 'margin_b_0',
}
]
}
}
],
footer: {
btns: [
{ type: "default", label: "取消", value: "cancel" },
{ type: "primary", label: "确定", value: "submit" },
],
},
});
const passCommonDialogBtnClick = (btn, info) => {
if (btn.value == 'submit') {
tableInfo.value.loading = true;
let params = {
guid: currTableData.value.approveVO.approveGuid,
flowType: currTableData.value.approveVO.flowType,
approveSuggest: info.approveSuggest,
approveStaffGuid: userData.staffGuid
}
passFlowData(params, currTableData.value.tenantGuid).then((res: any) => {
tableInfo.value.loading = false;
if (res?.code == proxy.$passCode) {
if (res.data) {
ElMessage.success('审批成功');
passCommonDialogInfo.value.visible = false;
getTableData();
} else {
ElMessage.error('审批失败');
}
} else {
ElMessage.error(res.msg);
}
}).catch(() => {
tableInfo.value.loading = false;
});
} else if (btn.value == 'cancel') {
passCommonDialogInfo.value.visible = false;
}
}
</script>
<template>
......@@ -759,6 +846,7 @@ const rejectDialogBtnClick = (btn, info) => {
<Dialog :dialogInfo="dialogInfo" @btnClick="dialogBtnClick" />
<Dialog :dialogInfo="passDialogInfo" @btnClick="passDialogBtnClick" @inputChange=passDialogInputChange />
<Dialog :dialogInfo="rejectDialogInfo" @btnClick="rejectDialogBtnClick" />
<Dialog :dialogInfo="passCommonDialogInfo" @btnClick="passCommonDialogBtnClick" />
</div>
</template>
......
......@@ -21,7 +21,7 @@ import {
} from "@/api/modules/queryService";
import useUserStore from "@/store/modules/user";
import useDataAssetStore from "@/store/modules/dataAsset";
import { getCamundaDeploymentId, getProcessNodesPromise, passFlowData, rejectFlowData, revokeFlowData } from '@/api/modules/workFlowService';
import { getCamundaDeploymentId, getProcessNodesPromise, passFlowData, rejectFlowData, revokeFlowData, isMyFirstNode } from '@/api/modules/workFlowService';
const assetStore = useDataAssetStore();
......@@ -287,6 +287,8 @@ const getTableBtns = (row) => {
const currTableData: any = ref({});
let getFirstNodePromise: any = ref({});
const tableBtnClick = (scope, btn) => {
const type = btn.value;
const row = scope.row;
......@@ -350,8 +352,26 @@ const tableBtnClick = (scope, btn) => {
} else if (type === 'backup') {
rejectDialogInfo.value.visible = true;
} else if (type === 'pass') {
if (getFirstNodePromise.value[row.guid]) {
return;
}
getFirstNodePromise.value[row.guid] = isMyFirstNode({
deploymentId: row.approveVO.camundaDeploymentId,
processInstanceId: row.approveVO.camundaInstanceId,
staffGuid: userData.staffGuid
}).then((res: any) => {
getFirstNodePromise.value[row.guid] = null;
if (res?.code == proxy.$passCode) {
if (res.data) {
passDialogInfo.value.visible = true;
passFormItems.value[2].placeholder = '按照本次评估目的及价值类型,该笔数据资产在评估基准日的评估值为人民币***元。本次评估结论在评估基准日后一年内有效,即自20*年*月*日至20*年*月*日止。超过一年,需重新举行资产评估。';
} else {
passCommonDialogInfo.value.visible = true;
}
} else {
proxy.$ElMessage.error(res.msg);
}
})
} else if (type === 'revoke') { // 撤销,状态为审批中时可以撤销。
ElMessageBox.confirm(`撤销后,该流程将不再进行审核,确定这样操作吗?`, "提示", {
confirmButtonText: "确定",
......@@ -808,7 +828,7 @@ const dialogBtnClick = (btn, info) => {
evaluationRangeStart: info.evaluationRange ? info.evaluationRange[0] : null,
evaluationRangeEnd: info.evaluationRange ? info.evaluationRange[1] : null,
evaluationNote: info.evaluationNote,
evaluationAgencyGuid: res.data?.[1]?.candidateUsers?.[0]?.staffGuid,
evaluationAgencyGuid: resUser.data?.tenantGuid,
}
}
console.log('daInfo', daInfo, info);
......@@ -1008,7 +1028,42 @@ const passDialogBtnClick = (btn, info) => {
}
};
const passCommonDialogInfo = ref({
visible: false,
size: 460,
direction: "column",
header: {
title: "通过",
},
type: '',
contents: [
{
type: 'form',
title: '',
formInfo: {
id: 'batch-pass-form',
items: [
{
label: '',
type: "textarea",
placeholder: "请填写通过备注(选填)",
field: "approveSuggest",
clearable: true,
maxlength: 400,
block: true,
col: 'margin_b_0',
}
]
}
}
],
footer: {
btns: [
{ type: "default", label: "取消", value: "cancel" },
{ type: "primary", label: "确定", value: "submit" },
],
},
});
const rejectDialogInfo = ref({
......@@ -1082,6 +1137,36 @@ const rejectDialogBtnClick = (btn, info) => {
}
};
const passCommonDialogBtnClick = (btn, info) => {
if (btn.value == 'submit') {
tableInfo.value.loading = true;
let params = {
guid: currTableData.value.approveVO.approveGuid,
flowType: currTableData.value.approveVO.flowType,
approveSuggest: info.approveSuggest,
approveStaffGuid: userData.staffGuid
}
passFlowData(params, currTableData.value.tenantGuid).then((res: any) => {
tableInfo.value.loading = false;
if (res?.code == proxy.$passCode) {
if (res.data) {
ElMessage.success('审批成功');
passCommonDialogInfo.value.visible = false;
getTableData();
} else {
ElMessage.error('审批失败');
}
} else {
ElMessage.error(res.msg);
}
}).catch(() => {
tableInfo.value.loading = false;
});
} else if (btn.value == 'cancel') {
passCommonDialogInfo.value.visible = false;
}
}
</script>
<template>
......@@ -1098,6 +1183,7 @@ const rejectDialogBtnClick = (btn, info) => {
<Dialog :dialogInfo="dialogInfo" @btnClick="dialogBtnClick" @selectChange="handleSelectChange" />
<Dialog :dialogInfo="passDialogInfo" @btnClick="passDialogBtnClick" @inputChange="passDialogInputChange" />
<Dialog :dialogInfo="rejectDialogInfo" @btnClick="rejectDialogBtnClick" />
<Dialog :dialogInfo="passCommonDialogInfo" @btnClick="passCommonDialogBtnClick" />
</div>
</template>
......@@ -1110,5 +1196,4 @@ const rejectDialogBtnClick = (btn, info) => {
// .el-upload__tip {
// margin-left: 0px;
// }
// }
</style>
// }</style>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!