c8fc6251 by lihua

质量评估,价值评估支持不走流程配置

1 parent 20136652
......@@ -63,4 +63,10 @@ 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
})
/** 功能流程配置-获取是否需要审批 */
export const isNeedApprove = (params) => request({
url: `${import.meta.env.VITE_APP_WORK_FLOW_URL}/func-flow-config/is-need-approve?funcCode=${params.funcCode}`,
method: 'get',
})
\ No newline at end of file
......
......@@ -1452,8 +1452,8 @@ const panelChange = (scope, row) => {
:disabled="item.disabled || readonly" @change="(val) => cascaderChange(val, item)" />
<template v-else-if="item.type && item.type.indexOf('date') > -1">
<el-date-picker :class="[item.col, { is_block: item.block }]" v-if="item.type == 'date-picker'"
v-model="formInline[item.field]" type="daterange" range-separator="至" start-placeholder="开始日期" :format="item.format ?? ''"
:value-format="item.valueFormat ?? ''"
v-model="formInline[item.field]" type="daterange" range-separator="至" start-placeholder="开始日期" :format="item.format ?? null"
:value-format="item.valueFormat ?? null"
end-placeholder="结束日期" :unlink-panels="item.unlink ?? false" :shortcuts="item.shortcuts ?? []"
:default-value="item.defaultDate" :disabled="item.disabled ?? false" />
<el-date-picker :class="[item.col, { is_block: item.block }]" v-else-if="item.type == 'date-year'"
......
......@@ -14,13 +14,14 @@ import {
qualityAllow,
deleteQuality,
updatQuality,
getTenantList
} from "@/api/modules/dataAsset";
import useUserStore from "@/store/modules/user";
import useDataAssetStore from "@/store/modules/dataAsset";
import {
getStaffDetailInfo
} from "@/api/modules/queryService";
import { rejectFlowData, revokeFlowData, getCamundaDeploymentId, getProcessNodesPromise, isMyFirstNode, passFlowData } from "@/api/modules/workFlowService";
import { isNeedApprove, rejectFlowData, revokeFlowData, getCamundaDeploymentId, getProcessNodesPromise, isMyFirstNode, passFlowData } from "@/api/modules/workFlowService";
const assetStore = useDataAssetStore();
......@@ -39,13 +40,27 @@ const tableFields = ref([
{ label: "登记时间", field: "registerTime", width: 120 },
// { label: "企业名称", field: "tenantName", width: 240, align: "left" },
{ label: "评估机构", field: "evaluationAgencyName", width: 250, align: "left" },
{ label: "审批状态", field: "approveVO", type: "approveTag", width: 96, align: 'center' },
{ label: "审批状态", field: "approveVO", type: "approveTag", enableNoApprove: true, width: 96, align: 'center' },
{ label: "专区名称", field: "zqName", width: 160, align: "left" },
]);
const deploymentId = ref('');
onMounted(() => {
const tenantList: any = ref([]);
onBeforeMount(() => {
getTenantList({
bizState: 'Y',
pageSize: -1
}).then((res: any) => {
tenantList.value = [];
if (res.code == proxy.$passCode) {
tenantList.value = res.data?.records || [];
formItems.value[1].options = tenantList.value;
} else {
proxy.$ElMessage.error(res.msg);
}
})
});
onActivated(() => {
......@@ -123,23 +138,42 @@ const getTableData = () => {
})
}
let needApprovePromise = ref();
const needApprove = ref(true);
const handleCreate = () => {
if (!assetListData.value.length) {
ElMessage.warning('当前没有可发起质量评价的资产!');
return;
}
formItems.value[0].visible = true;
formItems.value[0].default = '';
formItems.value[1].visible = true;
formItems.value[1].default = [];
dialogInfo.value.visible = true;
dialogInfo.value.type = '';
getCamundaDeploymentId('10018', userData.tenantGuid, userData.staffGuid).then((res: any) => {
if (res.code == proxy.$passCode) {
deploymentId.value = res.data;
if (needApprovePromise.value) {
return;
}
needApprovePromise.value = isNeedApprove({ funcCode: 'ZCZLPJ' }).then((res1: any) => {
needApprovePromise.value = null;
if (res1.code == proxy.$passCode) {
needApprove.value = res1.data;
formItems.value[0].visible = true;
formItems.value[0].default = '';
formItems.value[1].visible = !needApprove.value;
formItems.value[1].default = '';
formItems.value[2].visible = true;
formItems.value[2].default = [];
dialogInfo.value.visible = true;
dialogInfo.value.type = '';
if (needApprove.value) {
getCamundaDeploymentId('10018', userData.tenantGuid, userData.staffGuid).then((res: any) => {
if (res.code == proxy.$passCode) {
deploymentId.value = res.data;
} else {
deploymentId.value = '';
proxy.$ElMessage.error(res.msg);
}
})
}
} else {
deploymentId.value = '';
proxy.$ElMessage.error(res.msg);
proxy.$ElMessage.error(res1.msg);
}
})
}
......@@ -182,7 +216,13 @@ const tableInfo = ref({
const getTableBtns = (row) => {
let btnsArr: any[] = [];
const approveVO = row.approveVO || {};
const approveVO = row.approveVO;
if (!approveVO && row.isApprove == 'N') {
btnsArr.push({ label: "编辑", value: "redit" });
btnsArr.push({ label: "删除", value: "del" });
btnsArr.push({ label: "详情", value: "detail" });
return btnsArr;
}
const approveState = row.approveVO.approveState || null;
const approveStaffGuids = approveVO.approveStaffGuids || [];
const staffGuid = approveVO.staffGuid || '';
......@@ -233,11 +273,21 @@ const tableBtnClick = (scope, btn) => {
currTableData.value = row;
console.log(row, '-------');
if (type == "redit") {
dialogInfo.value.visible = true;
dialogInfo.value.type = 'reSubmit';
formItems.value[0].visible = false;
formItems.value[0].default = row.registerGuid;
formItems.value[1].default = row.qualityEvaluationFile || [];
isNeedApprove({ funcCode: 'ZCZLPJ' }).then((res1: any) => {
if (res1.code == proxy.$passCode) {
needApprove.value = res1.data;
formItems.value[0].visible = false;
formItems.value[0].default = row.damGuid;
formItems.value[1].visible = !needApprove.value;
formItems.value[1].default = row.evaluationAgencyGuid;
formItems.value[2].default = row.qualityEvaluationFile || [];
dialogInfo.value.contents[0].formInfo.items = formItems.value;
dialogInfo.value.visible = true;
dialogInfo.value.type = 'reSubmit';
} else {
proxy.$ElMessage.error(res1.msg);
}
})
} else if (type == "del") {
delTableOpen("此操作将永久删除该资产质量评价,是否继续?", "warning");
} else if (type === 'reject') {
......@@ -373,6 +423,20 @@ const formItems = ref([{
visible: true,
required: true
}, {
label: '评估机构',
type: 'select',
placeholder: '请选择',
field: 'evaluationAgencyGuid',
default: '',
block: true,
options: tenantList.value,
props: {
value: 'guid',
label: 'tenantName'
},
visible: false,
required: true
}, {
label: '附件上传',
tip: '支持格式:xls .xlsx .doc .docx .rar .zip',
type: 'upload-file',
......@@ -439,89 +503,146 @@ const dialogInfo = ref({
/** 编辑质量评价发起资产申请按钮处理。 */
const dialogBtnClick = (btn, info) => {
if (btn.value == 'submit') {
dialogInfo.value.footer.btns[1].loading = true;
let submitFunc = () => {
getProcessNodesPromise({
deploymentId: deploymentId.value,
processInstanceId: null,
}).then((res: any) => {
if (res?.code == proxy.$passCode) {
getStaffDetailInfo(res.data?.[1]?.candidateUsers?.[0]?.staffGuid).then((resUser: any) => {
if (resUser?.code == proxy.$passCode) {
if (dialogInfo.value.type == 'reSubmit') {
updatQuality({
guid: currTableData.value.guid,
tenantGuid: userData.tenantGuid,
damGuid: currTableData.value.damGuid,
daName: currTableData.value.daName,
immediateApprove: true,
evaluationAgencyGuid: resUser.data?.tenantGuid,
qualityEvaluationFile: info.qualityEvaluationFile?.map(file => {
return {
name: file.name,
url: file.url
}
}) || []
}).then((res: any) => {
dialogInfo.value.footer.btns[1].loading = false;
if (res?.code == proxy.$passCode) {
ElMessage.success('该资产质量评价重新提交成功');
dialogInfo.value.visible = false;
page.value.curr = 1;
getTableData();
} else {
ElMessage.error(res.msg);
}
})
} else {
let daInfo = assetListData.value.find(a => a.guid == info.damGuid);
saveQuality({
tenantGuid: userData.tenantGuid,
damGuid: info.damGuid,
daName: daInfo.damName,
immediateApprove: true,
evaluationAgencyGuid: resUser.data?.tenantGuid,
qualityEvaluationFile: info.qualityEvaluationFile?.map(file => {
return {
name: file.name,
url: file.url
}
}) || []
}).then((res: any) => {
dialogInfo.value.footer.btns[1].loading = false;
if (res?.code == proxy.$passCode) {
ElMessage.success('质量评价发起成功');
dialogInfo.value.visible = false;
page.value.curr = 1;
getTableData();
} else {
ElMessage.error(res.msg);
}
})
}
} else {
dialogInfo.value.footer.btns[1].loading = false;
ElMessage.error(res.msg);
if (!needApprove.value) {
// 不需要走流程审批的提交
dialogInfo.value.footer.btns[1].loading = true;
if (dialogInfo.value.type == 'reSubmit') {
updatQuality({
guid: currTableData.value.guid,
tenantGuid: userData.tenantGuid,
damGuid: currTableData.value.damGuid,
daName: currTableData.value.daName,
immediateApprove: true,
evaluationAgencyGuid: info.evaluationAgencyGuid,
qualityEvaluationFile: info.qualityEvaluationFile?.map(file => {
return {
name: file.name,
url: file.url
}
})
} else {
}) || []
}).then((res: any) => {
dialogInfo.value.footer.btns[1].loading = false;
ElMessage.error(res.msg);
}
})
}
if (deploymentId.value) {
submitFunc();
} else {
getCamundaDeploymentId('10018', userData.tenantGuid, userData.staffGuid).then((res: any) => {
if (res.code == proxy.$passCode) {
deploymentId.value = res.data;
submitFunc();
} else {
if (res?.code == proxy.$passCode) {
ElMessage.success('该资产质量评价重新提交成功');
dialogInfo.value.visible = false;
page.value.curr = 1;
getTableData();
} else {
ElMessage.error(res.msg);
}
})
} else {
let daInfo = assetListData.value.find(a => a.guid == info.damGuid);
saveQuality({
tenantGuid: userData.tenantGuid,
damGuid: info.damGuid,
daName: daInfo.damName,
immediateApprove: true,
evaluationAgencyGuid: info.evaluationAgencyGuid,
qualityEvaluationFile: info.qualityEvaluationFile?.map(file => {
return {
name: file.name,
url: file.url
}
}) || []
}).then((res: any) => {
dialogInfo.value.footer.btns[1].loading = false;
proxy.$ElMessage.error(res.msg);
}
})
if (res?.code == proxy.$passCode) {
ElMessage.success('质量评价发起成功');
dialogInfo.value.visible = false;
page.value.curr = 1;
getTableData();
} else {
ElMessage.error(res.msg);
}
})
}
} else {
// 需要走流程的审批功能。
dialogInfo.value.footer.btns[1].loading = true;
let submitFunc = () => {
getProcessNodesPromise({
deploymentId: deploymentId.value,
processInstanceId: null,
}).then((res: any) => {
if (res?.code == proxy.$passCode) {
getStaffDetailInfo(res.data?.[1]?.candidateUsers?.[0]?.staffGuid).then((resUser: any) => {
if (resUser?.code == proxy.$passCode) {
if (dialogInfo.value.type == 'reSubmit') {
updatQuality({
guid: currTableData.value.guid,
tenantGuid: userData.tenantGuid,
damGuid: currTableData.value.damGuid,
daName: currTableData.value.daName,
immediateApprove: true,
evaluationAgencyGuid: resUser.data?.tenantGuid,
qualityEvaluationFile: info.qualityEvaluationFile?.map(file => {
return {
name: file.name,
url: file.url
}
}) || []
}).then((res: any) => {
dialogInfo.value.footer.btns[1].loading = false;
if (res?.code == proxy.$passCode) {
ElMessage.success('该资产质量评价重新提交成功');
dialogInfo.value.visible = false;
page.value.curr = 1;
getTableData();
} else {
ElMessage.error(res.msg);
}
})
} else {
let daInfo = assetListData.value.find(a => a.guid == info.damGuid);
saveQuality({
tenantGuid: userData.tenantGuid,
damGuid: info.damGuid,
daName: daInfo.damName,
immediateApprove: true,
evaluationAgencyGuid: resUser.data?.tenantGuid,
qualityEvaluationFile: info.qualityEvaluationFile?.map(file => {
return {
name: file.name,
url: file.url
}
}) || []
}).then((res: any) => {
dialogInfo.value.footer.btns[1].loading = false;
if (res?.code == proxy.$passCode) {
ElMessage.success('质量评价发起成功');
dialogInfo.value.visible = false;
page.value.curr = 1;
getTableData();
} else {
ElMessage.error(res.msg);
}
})
}
} else {
dialogInfo.value.footer.btns[1].loading = false;
ElMessage.error(res.msg);
}
})
} else {
dialogInfo.value.footer.btns[1].loading = false;
ElMessage.error(res.msg);
}
})
}
if (deploymentId.value) {
submitFunc();
} else {
getCamundaDeploymentId('10018', userData.tenantGuid, userData.staffGuid).then((res: any) => {
if (res.code == proxy.$passCode) {
deploymentId.value = res.data;
submitFunc();
} else {
dialogInfo.value.footer.btns[1].loading = false;
proxy.$ElMessage.error(res.msg);
}
})
}
}
} else if (btn.value == 'cancel') {
dialogInfo.value.visible = false;
......
......@@ -112,8 +112,8 @@ const getDetailInfo = () => {
getEvaDetail({ guid: evaGuid, serviceTenantGuid: route.query.tenantGuid }).then((res: any) => {
if (res.code == proxy.$passCode) {
const data = res.data || {};
evaDetailInfo.value = data;
deploymentId.value = data.approveVO.camundaDeploymentId;
evaDetailInfo.value = data;
deploymentId.value = data.approveVO?.camundaDeploymentId;
processInstanceId.value = data.approveVO?.camundaInstanceId;
} else {
proxy.$ElMessage.error(res.msg);
......@@ -126,7 +126,7 @@ const getDetailInfo = () => {
const data = res.data || {};
costAssessDetail.value = data;
evaDetailInfo.value = data;
deploymentId.value = data.approveVO.camundaDeploymentId;
deploymentId.value = data.approveVO?.camundaDeploymentId;
processInstanceId.value = data.approveVO?.camundaInstanceId;
} else {
proxy.$ElMessage.error(res.msg);
......@@ -208,6 +208,9 @@ const toolBtns: any = computed(() => {
label: "关闭", value: "cancel", plain: true
}];
let approveVO = evaDetailInfo.value.approveVO || costAssessDetail.value.approveVO;
if (!approveVO) {
return btnsArr;
}
let staffGuid = userData.staffGuid;
if (approveVO && approveVO.approveState == 'A' && approveVO.approveStaffGuids && approveVO.approveStaffGuids.indexOf(staffGuid) > -1) {
btnsArr.push(...[{ label: "通过", value: "pass", type: 'primary' }, { label: "驳回", value: "reject", type: 'danger', plain: true }]);
......@@ -1157,7 +1160,7 @@ const handleClick = () => {
</div>
</ContentWrap>
<ContentWrap v-if="route.query.type == 'qualityEvaluate' || route.query.type == 'costAssess'" id="id-approveInfo"
<ContentWrap v-if="(route.query.type == 'qualityEvaluate' && evaDetailInfo.approveVO && evaDetailInfo.isApprove !='N') || (route.query.type == 'costAssess' && costAssessDetail.approveVO && costAssessDetail.isApprove !='N')" id="id-approveInfo"
title="审批信息" description="" style="margin: 16px 16px 16px">
<ApprovalProcess ref="approvalProcessRef" v-if="deploymentId" :deploymentId="deploymentId" :processInstanceId="processInstanceId">
</ApprovalProcess>
......
......@@ -78,7 +78,7 @@ const getDetailInfo = () => {
const data = res.data || {};
evaDetailInfo.value = data;
detailInfo.value = data;
deploymentId.value = data.approveVO.camundaDeploymentId;
deploymentId.value = data.approveVO?.camundaDeploymentId;
processInstanceId.value = data.approveVO?.camundaInstanceId;
//需要显示质量评价信息
if (data.qualityScore != null) {
......@@ -90,6 +90,9 @@ const getDetailInfo = () => {
tabsInfo.value.tabs.splice(3, 1);
}
}
if (evaDetailInfo.value.isApprove == 'N') {
tabsInfo.value.tabs.pop();
}
if (fullPath === route.fullPath) {
document.title = `详情-${data.daName}`;
}
......@@ -124,7 +127,7 @@ const getDetailInfo = () => {
const data = res.data || {};
costAssessDetailInfo.value = data;
detailInfo.value = data;
deploymentId.value = data.approveVO.camundaDeploymentId;
deploymentId.value = data.approveVO?.camundaDeploymentId;
processInstanceId.value = data.approveVO?.camundaInstanceId;
// 需要显示价值评估信息
if (data.assessmentMoney != null) {
......@@ -136,7 +139,9 @@ const getDetailInfo = () => {
tabsInfo.value.tabs.splice(3, 1);
}
}
if (costAssessDetailInfo.value.isApprove == 'N') {
tabsInfo.value.tabs.pop();
}
if (data.qualityScore) {
// 确保"质量评价"标签存在于tabs中,并插入到"价值评估"前面
const qualityTabIndex = tabsInfo.value.tabs.findIndex(tab => tab.name === "qualityEvaluate");
......@@ -285,8 +290,8 @@ const getDetailInfo = () => {
let { approveVO } = data;
detailInfo.value = data;
assetDetailInfo.value = data;
deploymentId.value = approveVO.camundaDeploymentId;
processInstanceId.value = approveVO.camundaInstanceId;
deploymentId.value = approveVO?.camundaDeploymentId;
processInstanceId.value = approveVO?.camundaInstanceId;
isTextTruncated();
} else {
ElMessage.error(res.msg);
......@@ -446,6 +451,9 @@ const toolBtns: any = computed(() => {
return btnsArr;
}
let approveVO = detailInfo.value.approveVO;
if (!approveVO) {
return btnsArr;
}
let staffGuid = userData.staffGuid;
if (approveVO && approveVO.approveState == 'A' && approveVO.approveStaffGuids && approveVO.approveStaffGuids.indexOf(staffGuid) > -1) {
btnsArr.push(...[{ label: "通过", value: "pass", type: 'primary' }, { label: "驳回", value: "reject", type: 'danger', plain: true }]);
......@@ -1725,7 +1733,7 @@ const passCommonDialogBtnClick = (btn, info) => {
</div>
</ContentWrap>
<ContentWrap id="id-approveInfo" title="审批信息" expandSwicth style="margin-top: 15px"
:isExpand="approveInfoExpand" @expand="(v) => approveInfoExpand = v" v-if="route.query.type != 'certificate'">
:isExpand="approveInfoExpand" @expand="(v) => approveInfoExpand = v" v-if="tabsInfo.tabs.find(t => t.name == 'approveInfo') && route.query.type != 'certificate'">
<!-- <Table :tableInfo="approveTableInfo" /> -->
<ApprovalProcess ref="approvalProcessRef" v-if="deploymentId" :deploymentId="deploymentId"
:processInstanceId="processInstanceId">
......
......@@ -14,14 +14,15 @@ import {
deleteCostAssess,
registerApproveCancel,
registerApproveBackup,
costAssessAllow
costAssessAllow,
getTenantList
} from "@/api/modules/dataAsset";
import {
getStaffDetailInfo
} from "@/api/modules/queryService";
import useUserStore from "@/store/modules/user";
import useDataAssetStore from "@/store/modules/dataAsset";
import { getCamundaDeploymentId, getProcessNodesPromise, passFlowData, rejectFlowData, revokeFlowData, isMyFirstNode } from '@/api/modules/workFlowService';
import { isNeedApprove, getCamundaDeploymentId, getProcessNodesPromise, passFlowData, rejectFlowData, revokeFlowData, isMyFirstNode } from '@/api/modules/workFlowService';
import { changeNum } from '@/utils/common';
const assetStore = useDataAssetStore();
......@@ -47,41 +48,14 @@ const tableFields = ref([
// { label: "企业名称", field: "tenantName", width: 240, align: "left" },
{ label: "评估机构", field: "evaluationAgencyName", width: 250, align: "left" },
{
label: "审批状态", field: "approveState", type: "tag", width: 96, align: 'center', getName: (scope) => {
const approveVO = scope.row.approveVO || {}
switch (approveVO.approveState) {
case 'N':
return '草稿中';
case 'A':
return '审批中';
case 'Y':
return '已通过';
case 'R':
return '已驳回';
case 'C':
return '已撤销';
case 'I':
return '--';
default:
return '草稿中';
}
}, tagType: (scope) => {
const approveVO = scope.row.approveVO || {}
switch (approveVO.approveState) {
case 'A':
return 'warning';
case 'Y':
return 'success';
case 'R':
return 'danger';
default:
return 'info';
}
}
label: "审批状态", field: "approveVO", type: "approveTag", enableNoApprove: true, width: 96, align: 'center'
},
]);
const deploymentId = ref('');
const tenantList: any = ref([]);
onBeforeMount(() => {
if (isCompanyPlatform.value) {
tableInfo.value.fields = tableFields.value;
......@@ -89,14 +63,18 @@ onBeforeMount(() => {
tableFields.value.splice(3, 0, { label: "企业名称", field: "tenantName", width: 250, align: "left" })
tableInfo.value.fields = tableFields.value;
}
// getTenantAttach(userData.tenantGuid).then((res: any) => {
// if (res?.code == proxy.$passCode) {
// attachDataInfo.value = res.data || {};
// formItems.value[1].templateUrl = attachDataInfo.value.quality_evaluation_file;
// } else {
// ElMessage.error(res.msg);
// }
// })
getTenantList({
bizState: 'Y',
pageSize: -1
}).then((res: any) => {
tenantList.value = [];
if (res.code == proxy.$passCode) {
tenantList.value = res.data?.records || [];
formItems.value[1].options = tenantList.value;
} else {
proxy.$ElMessage.error(res.msg);
}
})
});
onActivated(() => {
......@@ -174,36 +152,53 @@ const getTableData = () => {
})
}
let needApprovePromise = ref();
const needApprove = ref(true);
const handleCreate = () => {
if (!assetListData.value.length) {
ElMessage.warning('当前没有可发起价值评估的资产!');
return;
}
formItems.value[4].placeholder = `本次评估数据资产总体质量得分为**分\n准确性:\n一致性:\n可访问性:\n规范性:\n完整性:`;
formItems.value[0].visible = true;
formItems.value[0].default = '';
formItems.value[1].visible = true;
formItems.value[1].default = [];
formItems.value[2].visible = false;
formItems.value[2].default = '';
formItems.value[3].visible = false;
formItems.value[3].default = '';
formItems.value[4].visible = false;
formItems.value[4].default = '';
formItems.value[5].visible = false;
formItems.value[5].default = [];
dialogInfo.value.visible = true;
dialogInfo.value.type = '';
if (!deploymentId.value) {
getCamundaDeploymentId('10019', userData.tenantGuid, userData.staffGuid).then((res: any) => {
if (res.code == proxy.$passCode) {
deploymentId.value = res.data;
} else {
deploymentId.value = '';
proxy.$ElMessage.error(res.msg);
}
})
if (needApprovePromise.value) {
return;
}
needApprovePromise.value = isNeedApprove({ funcCode: 'ZCJZPG' }).then((res1: any) => {
needApprovePromise.value = null;
if (res1.code == proxy.$passCode) {
needApprove.value = res1.data;
formItems.value[5].placeholder = `本次评估数据资产总体质量得分为**分\n准确性:\n一致性:\n可访问性:\n规范性:\n完整性:`;
formItems.value[0].visible = true;
formItems.value[0].default = '';
formItems.value[1].visible = !needApprove.value;
formItems.value[1].default = '';
formItems.value[2].visible = true;
formItems.value[2].default = [];
formItems.value[3].visible = false;
formItems.value[3].default = '';
formItems.value[4].visible = false;
formItems.value[4].default = '';
formItems.value[5].visible = false;
formItems.value[5].default = '';
formItems.value[6].visible = false;
formItems.value[6].default = [];
dialogInfo.value.visible = true;
dialogInfo.value.type = '';
if (needApprove.value) {
getCamundaDeploymentId('10019', userData.tenantGuid, userData.staffGuid).then((res: any) => {
if (res.code == proxy.$passCode) {
deploymentId.value = res.data;
} else {
deploymentId.value = '';
proxy.$ElMessage.error(res.msg);
}
})
}
} else {
proxy.$ElMessage.error(res1.msg);
}
});
}
const page = ref({
......@@ -244,7 +239,13 @@ const tableInfo = ref({
const getTableBtns = (row) => {
let btnsArr: any[] = [];
const approveVO = row.approveVO || {};
const approveVO = row.approveVO;
if (!approveVO && row.isApprove == 'N') {
btnsArr.push({ label: "编辑", value: "redit" });
btnsArr.push({ label: "删除", value: "del" });
btnsArr.push({ label: "详情", value: "detail" });
return btnsArr;
}
const approveState = row.approveVO.approveState || null;
const approveStaffGuids = approveVO.approveStaffGuids || [];
const staffGuid = approveVO.staffGuid || '';
......@@ -296,62 +297,47 @@ const tableBtnClick = (scope, btn) => {
console.log('row', row);
currTableData.value = row;
if (type == "redit") {
// if (!row.registerGuid) {
// formItems.value[2].visible = true;
// formItems.value[3].visible = true;
// formItems.value[4].visible = true;
// formItems.value[5].visible = true;
// formItems.value[0].visible = false;
// formItems.value[0].default = row.damGuid;
// formItems.value[1].default = row.costAssessmentFile || [];
// dialogInfo.value.type = 'reSubmit';
// dialogInfo.value.visible = true;
// } else {
// formItems.value[2].visible = false;
// formItems.value[3].visible = false;
// formItems.value[4].visible = false;
// formItems.value[5].visible = false;
// formItems.value[0].visible = false;
// formItems.value[0].default = row.damGuid;
// formItems.value[1].default = row.costAssessmentFile || [];
// formItems.value[2].default = row.qualityScore;
// formItems.value[3].default = row.evaluationRangeStart && row.evaluationRangeEnd ? [row.evaluationRangeStart, row.evaluationRangeEnd] : '';
// formItems.value[4].default = row.evaluationNote;
// formItems.value[5].default = row.evaluationFile || [];
// dialogInfo.value.type = 'reSubmit';
// dialogInfo.value.visible = true;
// }
if (row.qualityEvaluationGuid) {
formItems.value[2].visible = false;
formItems.value[3].visible = false;
formItems.value[4].visible = false;
formItems.value[5].visible = false;
formItems.value[0].visible = false;
formItems.value[0].default = row.damGuid;
formItems.value[1].default = row.costAssessmentFile || [];
// formItems.value[2].default = row.qualityScore;
formItems.value[3].default = row.evaluationRangeStart && row.evaluationRangeEnd ? [row.evaluationRangeStart, row.evaluationRangeEnd] : '';
// formItems.value[4].default = row.evaluationNote;
// formItems.value[5].default = row.evaluationFile || [];
dialogInfo.value.type = 'reSubmit';
dialogInfo.value.visible = true;
}
if (!row.qualityEvaluationGuid) {
formItems.value[2].visible = true;
formItems.value[3].visible = true;
formItems.value[4].visible = true;
formItems.value[5].visible = true;
formItems.value[0].visible = false;
formItems.value[0].default = row.damGuid;
formItems.value[1].default = row.costAssessmentFile || [];
formItems.value[2].default = changeNum(row.qualityScore || 0, 2);
formItems.value[3].default = row.evaluationRangeStart && row.evaluationRangeEnd ? [row.evaluationRangeStart, row.evaluationRangeEnd] : '';
formItems.value[4].default = row.evaluationNote;
formItems.value[5].default = row.evaluationFile || [];
dialogInfo.value.type = 'reSubmit';
dialogInfo.value.visible = true;
}
isNeedApprove({ funcCode: 'ZCJZPG' }).then((res1: any) => {
if (res1.code == proxy.$passCode) {
needApprove.value = res1.data;
if (row.qualityEvaluationGuid) {
formItems.value[3].visible = false;
formItems.value[4].visible = false;
formItems.value[5].visible = false;
formItems.value[6].visible = false;
formItems.value[0].visible = false;
formItems.value[0].default = row.damGuid;
formItems.value[1].visible = !needApprove.value;
formItems.value[1].default = row.evaluationAgencyGuid;
formItems.value[2].default = row.costAssessmentFile || [];
// formItems.value[2].default = row.qualityScore;
formItems.value[5].default = row.evaluationRangeStart && row.evaluationRangeEnd ? [row.evaluationRangeStart, row.evaluationRangeEnd] : '';
// formItems.value[4].default = row.evaluationNote;
// formItems.value[5].default = row.evaluationFile || [];
dialogInfo.value.type = 'reSubmit';
dialogInfo.value.visible = true;
}
if (!row.qualityEvaluationGuid) {
formItems.value[3].visible = true;
formItems.value[4].visible = true;
formItems.value[5].visible = true;
formItems.value[6].visible = true;
formItems.value[0].visible = false;
formItems.value[0].default = row.damGuid;
formItems.value[1].visible = !needApprove.value;
formItems.value[1].default = row.evaluationAgencyGuid;
formItems.value[2].default = row.costAssessmentFile || [];
formItems.value[3].default = changeNum(row.qualityScore || 0, 2);
formItems.value[4].default = row.evaluationRangeStart && row.evaluationRangeEnd ? [row.evaluationRangeStart, row.evaluationRangeEnd] : '';
formItems.value[5].default = row.evaluationNote;
formItems.value[6].default = row.evaluationFile || [];
dialogInfo.value.type = 'reSubmit';
dialogInfo.value.visible = true;
}
} else {
proxy.$ElMessage.error(res1.msg);
}
});
} else if (type == "delete") {
delTableOpen("此操作将永久删除该资产价值评估,是否继续?", "warning");
} else if (type === 'backup') {
......@@ -426,71 +412,6 @@ const tableBtnClick = (scope, btn) => {
}
};
// const tableBtnClick = (scope, btn) => {
// const type = btn.value;
// const row = scope.row;
// currTableData.value = row;
// if (type === "edit") { //草稿中\已驳回\已撤销\已通过 状态,才可以编辑。
// localStorage.setItem('isRestart', btn.label == '重新提交' ? 'true' : '');
// // router.push({
// // name: 'registerStart',
// // query: { guid: row.guid, exchangeGuid: row.exchangeGuid, name: row.daName, type }
// // });
// router.push({
// name: 'registerValueDetail',
// query: { guid: row.registerGuid, costAssessGuid: row.guid, type: 'costAssess', daTenantGuid: row.tenantGuid, exchangeGuid: row.exchangeGuid }
// });
// } else if (type == "delete") {
// delTableOpen("此操作将永久删除该资产登记,是否继续?", "warning");
// } else if (type === 'revoke') { // 撤销,状态为审批中时可以撤销。
// ElMessageBox.confirm('确定撤销该资产登记审批流程吗?', "提示", {
// confirmButtonText: "确定",
// cancelButtonText: "取消",
// type: 'warning',
// }).then(() => {
// tableInfo.value.loading = true;
// let params = {
// guid: row.approveVO.approveGuid,
// flowType: row.approveVO.flowType,
// approveStaffGuid: userData.staffGuid,
// }
// revokeFlowData(params).then((res: any) => {
// tableInfo.value.loading = false;
// if (res?.code == proxy.$passCode) {
// if (res.data) {
// ElMessage.success('该审批流程撤销成功!');
// getTableData();
// } else {
// ElMessage.error('该审批流程撤销失败!');
// }
// } else {
// ElMessage.error(res.msg);
// }
// }).catch(() => {
// tableInfo.value.loading = false;
// });
// }).catch(() => {
// ElMessage({
// type: 'info',
// message: '已取消撤销'
// });
// });
// } else if (type === 'detail') { // 详情, 若是草稿中,详情就是编辑,
// // router.push({
// // name: 'registerInfoDetail',
// // query: { guid: row.guid, name: row.daName, type: 'asset' }
// // });
// router.push({
// name: 'registerValueDetail',
// query: { guid: row.registerGuid, costAssessGuid: row.guid, type: 'costAssess', daTenantGuid: row.tenantGuid }
// });
// } else if (type === 'pass') {
// passDialogInfo.value.visible = true;
// } else if (type == 'reject') {
// rejectDialogInfo.value.visible = true;
// }
// };
const delTableOpen = (msg, type, isBatch: boolean = false) => {
ElMessageBox.confirm(msg, "提示", {
confirmButtonText: "确定",
......@@ -543,6 +464,20 @@ const formItems = ref<any>([
},
visible: true,
required: true
}, {
label: '评估机构',
type: 'select',
placeholder: '请选择',
field: 'evaluationAgencyGuid',
default: '',
block: true,
options: tenantList.value,
props: {
value: 'guid',
label: 'tenantName'
},
visible: false,
required: true
},
{
label: '附件上传',
......@@ -692,24 +627,26 @@ const dialogInfo = ref({
const handleSelectChange = (val, row, info) => {
let qualityEvaluationGuid = '';
assetListData.value.forEach((item) => {
if (item.guid == val) {
qualityEvaluationGuid = item.qualityEvaluationGuid;
}
});
if (row.field != 'registerGuid') {
return;
}
let qualityEvaluationGuid = assetListData.value.find(item => item.guid == val)?.qualityEvaluationGuid;
if (!qualityEvaluationGuid) {
formItems.value[0].default = val;
formItems.value[2].visible = true;
formItems.value[1].default = info.evaluationAgencyGuid;
formItems.value[2].default = info[formItems.value[2].field];
formItems.value[3].visible = true;
formItems.value[4].visible = true;
formItems.value[5].visible = true;
formItems.value[6].visible = true;
} else {
formItems.value[0].default = val;
formItems.value[2].visible = false;
formItems.value[1].default = info.evaluationAgencyGuid;
formItems.value[2].default = info[formItems.value[2].field];
formItems.value[3].visible = false;
formItems.value[4].visible = false;
formItems.value[5].visible = false;
formItems.value[6].visible = false;
}
}
......@@ -743,80 +680,118 @@ const reSubmitPromise: any = ref(null);
const dialogBtnClick = (btn, info) => {
console.log('btn', btn, info);
if (btn.value == 'submit') {
let submitFunc = () => {
getProcessNodesPromise({
deploymentId: deploymentId.value,
processInstanceId: null,
}).then((res: any) => {
getStaffDetailInfo(res.data?.[1]?.candidateUsers?.[0]?.staffGuid).then((resUser: any) => {
if (resUser?.code == proxy.$passCode) {
if (dialogInfo.value.type == 'reSubmit') {
if (reSubmitPromise.value) {
return;
if (!needApprove.value) {
dialogInfo.value.footer.btns[1].loading = true;
if (dialogInfo.value.type == 'reSubmit') {
updateCostAssess({
guid: currTableData.value.guid,
immediateApprove: true,
tenantGuid: userData.tenantGuid,
daName: currTableData.value.daName,
damGuid: currTableData.value.damGuid,
costAssessmentFile: info.costAssessmentFile?.map(file => {
return {
name: file.name,
url: file.url
}
}) || [],
evaluationFile: info.evaluationFile?.map(file => {
return {
name: file.name,
url: file.url
}
}) || [],
qualityScore: info.qualityScore || null,
evaluationRangeStart: info.evaluationRange ? info.evaluationRange[0] : null,
evaluationRangeEnd: info.evaluationRange ? info.evaluationRange[1] : null,
evaluationNote: info.evaluationNote || null,
evaluationAgencyGuid: info.evaluationAgencyGuid,
}).then((res: any) => {
dialogInfo.value.footer.btns[1].loading = false;
if (res?.code == proxy.$passCode) {
ElMessage.success('该资产价值评估重新提交成功');
dialogInfo.value.visible = false;
page.value.curr = 1;
getTableData();
formItems.value[4].placeholder = `本次评估数据资产总体质量得分为**分\n准确性:\n一致性:\n可访问性:\n规范性:\n完整性:`;
} else {
ElMessage.error(res.msg);
}
})
} else {
let params: any = {};
let daInfo = assetListData.value.find(a => a.guid == info.registerGuid);
if (daInfo.qualityEvaluationGuid) {
//通过质量评估发起资产申请
params = {
immediateApprove: true,
tenantGuid: userData.tenantGuid,
daName: daInfo.damName,
damGuid: daInfo.guid,
costAssessmentFile: info.costAssessmentFile?.map(file => {
return {
name: file.name,
url: file.url
}
reSubmitPromise.value = updateCostAssess({
guid: currTableData.value.guid,
immediateApprove: true,
tenantGuid: userData.tenantGuid,
daName: currTableData.value.daName,
damGuid: currTableData.value.damGuid,
costAssessmentFile: info.costAssessmentFile?.map(file => {
return {
name: file.name,
url: file.url
}
}) || [],
evaluationFile: info.evaluationFile?.map(file => {
return {
name: file.name,
url: file.url
}
}) || [],
qualityScore: info.qualityScore || null,
evaluationRangeStart: info.evaluationRange ? info.evaluationRange[0] : null,
evaluationRangeEnd: info.evaluationRange ? info.evaluationRange[1] : null,
evaluationNote: info.evaluationNote || null,
evaluationAgencyGuid: resUser.data?.tenantGuid,
}).then((res: any) => {
reSubmitPromise.value = null;
if (res?.code == proxy.$passCode) {
ElMessage.success('该资产价值评估重新提交成功');
dialogInfo.value.visible = false;
page.value.curr = 1;
getTableData();
formItems.value[4].placeholder = `本次评估数据资产总体质量得分为**分\n准确性:\n一致性:\n可访问性:\n规范性:\n完整性:`;
} else {
ElMessage.error(res.msg);
}
})
} else {
if (savePromise.value) {
return;
}) || [],
evaluationAgencyGuid: info.evaluationAgencyGuid,
}
} else {
//未通过质量评估发起资产申请
params = {
immediateApprove: true,
tenantGuid: userData.tenantGuid,
daName: daInfo.damName,
damGuid: daInfo.guid,
costAssessmentFile: info.costAssessmentFile?.map(file => {
return {
name: file.name,
url: file.url
}
let params: any = {};
let daInfo = assetListData.value.find(a => a.guid == info.registerGuid);
if (daInfo.qualityEvaluationGuid) {
//通过质量评估发起资产申请
params = {
immediateApprove: true,
tenantGuid: userData.tenantGuid,
daName: daInfo.damName,
damGuid: daInfo.guid,
costAssessmentFile: info.costAssessmentFile?.map(file => {
return {
name: file.name,
url: file.url
}
}) || [],
evaluationAgencyGuid: resUser.data?.tenantGuid,
}) || [],
evaluationFile: info.evaluationFile?.map(file => {
return {
name: file.name,
url: file.url
}
}) || [],
qualityScore: info.qualityScore,
evaluationRangeStart: info.evaluationRange ? info.evaluationRange[0] : null,
evaluationRangeEnd: info.evaluationRange ? info.evaluationRange[1] : null,
evaluationNote: info.evaluationNote,
evaluationAgencyGuid: info.evaluationAgencyGuid,
}
}
saveCostAssess(params).then((res: any) => {
dialogInfo.value.footer.btns[1].loading = false;
if (res?.code == proxy.$passCode) {
ElMessage.success('价值评估发起成功');
dialogInfo.value.visible = false;
page.value.curr = 1;
getTableData();
} else {
ElMessage.error(res.msg);
}
})
}
} else {
let submitFunc = () => {
getProcessNodesPromise({
deploymentId: deploymentId.value,
processInstanceId: null,
}).then((res: any) => {
getStaffDetailInfo(res.data?.[1]?.candidateUsers?.[0]?.staffGuid).then((resUser: any) => {
if (resUser?.code == proxy.$passCode) {
if (dialogInfo.value.type == 'reSubmit') {
if (reSubmitPromise.value) {
return;
}
} else {
//未通过质量评估发起资产申请
params = {
reSubmitPromise.value = updateCostAssess({
guid: currTableData.value.guid,
immediateApprove: true,
tenantGuid: userData.tenantGuid,
daName: daInfo.damName,
damGuid: daInfo.guid,
daName: currTableData.value.daName,
damGuid: currTableData.value.damGuid,
costAssessmentFile: info.costAssessmentFile?.map(file => {
return {
name: file.name,
......@@ -829,43 +804,101 @@ const dialogBtnClick = (btn, info) => {
url: file.url
}
}) || [],
qualityScore: info.qualityScore,
qualityScore: info.qualityScore || null,
evaluationRangeStart: info.evaluationRange ? info.evaluationRange[0] : null,
evaluationRangeEnd: info.evaluationRange ? info.evaluationRange[1] : null,
evaluationNote: info.evaluationNote,
evaluationNote: info.evaluationNote || null,
evaluationAgencyGuid: resUser.data?.tenantGuid,
}).then((res: any) => {
reSubmitPromise.value = null;
if (res?.code == proxy.$passCode) {
ElMessage.success('该资产价值评估重新提交成功');
dialogInfo.value.visible = false;
page.value.curr = 1;
getTableData();
formItems.value[4].placeholder = `本次评估数据资产总体质量得分为**分\n准确性:\n一致性:\n可访问性:\n规范性:\n完整性:`;
} else {
ElMessage.error(res.msg);
}
})
} else {
if (savePromise.value) {
return;
}
}
console.log('daInfo', daInfo, info);
savePromise.value = saveCostAssess(params).then((res: any) => {
savePromise.value = null;
if (res?.code == proxy.$passCode) {
ElMessage.success('价值评估发起成功');
dialogInfo.value.visible = false;
page.value.curr = 1;
getTableData();
let params: any = {};
let daInfo = assetListData.value.find(a => a.guid == info.registerGuid);
if (daInfo.qualityEvaluationGuid) {
//通过质量评估发起资产申请
params = {
immediateApprove: true,
tenantGuid: userData.tenantGuid,
daName: daInfo.damName,
damGuid: daInfo.guid,
costAssessmentFile: info.costAssessmentFile?.map(file => {
return {
name: file.name,
url: file.url
}
}) || [],
evaluationAgencyGuid: resUser.data?.tenantGuid,
}
} else {
ElMessage.error(res.msg);
//未通过质量评估发起资产申请
params = {
immediateApprove: true,
tenantGuid: userData.tenantGuid,
daName: daInfo.damName,
damGuid: daInfo.guid,
costAssessmentFile: info.costAssessmentFile?.map(file => {
return {
name: file.name,
url: file.url
}
}) || [],
evaluationFile: info.evaluationFile?.map(file => {
return {
name: file.name,
url: file.url
}
}) || [],
qualityScore: info.qualityScore,
evaluationRangeStart: info.evaluationRange ? info.evaluationRange[0] : null,
evaluationRangeEnd: info.evaluationRange ? info.evaluationRange[1] : null,
evaluationNote: info.evaluationNote,
evaluationAgencyGuid: resUser.data?.tenantGuid,
}
}
})
console.log('daInfo', daInfo, info);
savePromise.value = saveCostAssess(params).then((res: any) => {
savePromise.value = null;
if (res?.code == proxy.$passCode) {
ElMessage.success('价值评估发起成功');
dialogInfo.value.visible = false;
page.value.curr = 1;
getTableData();
} else {
ElMessage.error(res.msg);
}
})
}
} else {
ElMessage.error(res.msg);
}
});
})
}
if (deploymentId.value) {
submitFunc();
} else {
getCamundaDeploymentId('10019', userData.tenantGuid, userData.staffGuid).then((res: any) => {
if (res.code == proxy.$passCode) {
deploymentId.value = res.data;
submitFunc();
} else {
ElMessage.error(res.msg);
proxy.$ElMessage.error(res.msg);
}
});
})
}
if (deploymentId.value) {
submitFunc();
} else {
getCamundaDeploymentId('10019', userData.tenantGuid, userData.staffGuid).then((res: any) => {
if (res.code == proxy.$passCode) {
deploymentId.value = res.data;
submitFunc();
} else {
proxy.$ElMessage.error(res.msg);
}
})
})
}
}
} else if (btn.value == 'cancel') {
dialogInfo.value.visible = false;
......@@ -1042,7 +1075,7 @@ const passCommonDialogInfo = ref({
},
type: '',
contents: [
{
{
type: 'form',
title: '',
formInfo: {
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!