c8fc6251 by lihua

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

1 parent 20136652
...@@ -63,4 +63,10 @@ export const isMyFirstNode = (params) => request({ ...@@ -63,4 +63,10 @@ export const isMyFirstNode = (params) => request({
63 url: `${import.meta.env.VITE_APP_WORK_FLOW_URL}/work-flow/data/is-my-first-node`, 63 url: `${import.meta.env.VITE_APP_WORK_FLOW_URL}/work-flow/data/is-my-first-node`,
64 method: 'post', 64 method: 'post',
65 data: params 65 data: params
66 })
67
68 /** 功能流程配置-获取是否需要审批 */
69 export const isNeedApprove = (params) => request({
70 url: `${import.meta.env.VITE_APP_WORK_FLOW_URL}/func-flow-config/is-need-approve?funcCode=${params.funcCode}`,
71 method: 'get',
66 }) 72 })
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -1452,8 +1452,8 @@ const panelChange = (scope, row) => { ...@@ -1452,8 +1452,8 @@ const panelChange = (scope, row) => {
1452 :disabled="item.disabled || readonly" @change="(val) => cascaderChange(val, item)" /> 1452 :disabled="item.disabled || readonly" @change="(val) => cascaderChange(val, item)" />
1453 <template v-else-if="item.type && item.type.indexOf('date') > -1"> 1453 <template v-else-if="item.type && item.type.indexOf('date') > -1">
1454 <el-date-picker :class="[item.col, { is_block: item.block }]" v-if="item.type == 'date-picker'" 1454 <el-date-picker :class="[item.col, { is_block: item.block }]" v-if="item.type == 'date-picker'"
1455 v-model="formInline[item.field]" type="daterange" range-separator="至" start-placeholder="开始日期" :format="item.format ?? ''" 1455 v-model="formInline[item.field]" type="daterange" range-separator="至" start-placeholder="开始日期" :format="item.format ?? null"
1456 :value-format="item.valueFormat ?? ''" 1456 :value-format="item.valueFormat ?? null"
1457 end-placeholder="结束日期" :unlink-panels="item.unlink ?? false" :shortcuts="item.shortcuts ?? []" 1457 end-placeholder="结束日期" :unlink-panels="item.unlink ?? false" :shortcuts="item.shortcuts ?? []"
1458 :default-value="item.defaultDate" :disabled="item.disabled ?? false" /> 1458 :default-value="item.defaultDate" :disabled="item.disabled ?? false" />
1459 <el-date-picker :class="[item.col, { is_block: item.block }]" v-else-if="item.type == 'date-year'" 1459 <el-date-picker :class="[item.col, { is_block: item.block }]" v-else-if="item.type == 'date-year'"
......
...@@ -14,13 +14,14 @@ import { ...@@ -14,13 +14,14 @@ import {
14 qualityAllow, 14 qualityAllow,
15 deleteQuality, 15 deleteQuality,
16 updatQuality, 16 updatQuality,
17 getTenantList
17 } from "@/api/modules/dataAsset"; 18 } from "@/api/modules/dataAsset";
18 import useUserStore from "@/store/modules/user"; 19 import useUserStore from "@/store/modules/user";
19 import useDataAssetStore from "@/store/modules/dataAsset"; 20 import useDataAssetStore from "@/store/modules/dataAsset";
20 import { 21 import {
21 getStaffDetailInfo 22 getStaffDetailInfo
22 } from "@/api/modules/queryService"; 23 } from "@/api/modules/queryService";
23 import { rejectFlowData, revokeFlowData, getCamundaDeploymentId, getProcessNodesPromise, isMyFirstNode, passFlowData } from "@/api/modules/workFlowService"; 24 import { isNeedApprove, rejectFlowData, revokeFlowData, getCamundaDeploymentId, getProcessNodesPromise, isMyFirstNode, passFlowData } from "@/api/modules/workFlowService";
24 25
25 const assetStore = useDataAssetStore(); 26 const assetStore = useDataAssetStore();
26 27
...@@ -39,13 +40,27 @@ const tableFields = ref([ ...@@ -39,13 +40,27 @@ const tableFields = ref([
39 { label: "登记时间", field: "registerTime", width: 120 }, 40 { label: "登记时间", field: "registerTime", width: 120 },
40 // { label: "企业名称", field: "tenantName", width: 240, align: "left" }, 41 // { label: "企业名称", field: "tenantName", width: 240, align: "left" },
41 { label: "评估机构", field: "evaluationAgencyName", width: 250, align: "left" }, 42 { label: "评估机构", field: "evaluationAgencyName", width: 250, align: "left" },
42 { label: "审批状态", field: "approveVO", type: "approveTag", width: 96, align: 'center' }, 43 { label: "审批状态", field: "approveVO", type: "approveTag", enableNoApprove: true, width: 96, align: 'center' },
43 { label: "专区名称", field: "zqName", width: 160, align: "left" }, 44 { label: "专区名称", field: "zqName", width: 160, align: "left" },
44 ]); 45 ]);
45 46
46 const deploymentId = ref(''); 47 const deploymentId = ref('');
47 48
48 onMounted(() => { 49 const tenantList: any = ref([]);
50
51 onBeforeMount(() => {
52 getTenantList({
53 bizState: 'Y',
54 pageSize: -1
55 }).then((res: any) => {
56 tenantList.value = [];
57 if (res.code == proxy.$passCode) {
58 tenantList.value = res.data?.records || [];
59 formItems.value[1].options = tenantList.value;
60 } else {
61 proxy.$ElMessage.error(res.msg);
62 }
63 })
49 }); 64 });
50 65
51 onActivated(() => { 66 onActivated(() => {
...@@ -123,23 +138,42 @@ const getTableData = () => { ...@@ -123,23 +138,42 @@ const getTableData = () => {
123 }) 138 })
124 } 139 }
125 140
141 let needApprovePromise = ref();
142
143 const needApprove = ref(true);
144
126 const handleCreate = () => { 145 const handleCreate = () => {
127 if (!assetListData.value.length) { 146 if (!assetListData.value.length) {
128 ElMessage.warning('当前没有可发起质量评价的资产!'); 147 ElMessage.warning('当前没有可发起质量评价的资产!');
129 return; 148 return;
130 } 149 }
131 formItems.value[0].visible = true; 150 if (needApprovePromise.value) {
132 formItems.value[0].default = ''; 151 return;
133 formItems.value[1].visible = true; 152 }
134 formItems.value[1].default = []; 153 needApprovePromise.value = isNeedApprove({ funcCode: 'ZCZLPJ' }).then((res1: any) => {
135 dialogInfo.value.visible = true; 154 needApprovePromise.value = null;
136 dialogInfo.value.type = ''; 155 if (res1.code == proxy.$passCode) {
137 getCamundaDeploymentId('10018', userData.tenantGuid, userData.staffGuid).then((res: any) => { 156 needApprove.value = res1.data;
138 if (res.code == proxy.$passCode) { 157 formItems.value[0].visible = true;
139 deploymentId.value = res.data; 158 formItems.value[0].default = '';
159 formItems.value[1].visible = !needApprove.value;
160 formItems.value[1].default = '';
161 formItems.value[2].visible = true;
162 formItems.value[2].default = [];
163 dialogInfo.value.visible = true;
164 dialogInfo.value.type = '';
165 if (needApprove.value) {
166 getCamundaDeploymentId('10018', userData.tenantGuid, userData.staffGuid).then((res: any) => {
167 if (res.code == proxy.$passCode) {
168 deploymentId.value = res.data;
169 } else {
170 deploymentId.value = '';
171 proxy.$ElMessage.error(res.msg);
172 }
173 })
174 }
140 } else { 175 } else {
141 deploymentId.value = ''; 176 proxy.$ElMessage.error(res1.msg);
142 proxy.$ElMessage.error(res.msg);
143 } 177 }
144 }) 178 })
145 } 179 }
...@@ -182,7 +216,13 @@ const tableInfo = ref({ ...@@ -182,7 +216,13 @@ const tableInfo = ref({
182 216
183 const getTableBtns = (row) => { 217 const getTableBtns = (row) => {
184 let btnsArr: any[] = []; 218 let btnsArr: any[] = [];
185 const approveVO = row.approveVO || {}; 219 const approveVO = row.approveVO;
220 if (!approveVO && row.isApprove == 'N') {
221 btnsArr.push({ label: "编辑", value: "redit" });
222 btnsArr.push({ label: "删除", value: "del" });
223 btnsArr.push({ label: "详情", value: "detail" });
224 return btnsArr;
225 }
186 const approveState = row.approveVO.approveState || null; 226 const approveState = row.approveVO.approveState || null;
187 const approveStaffGuids = approveVO.approveStaffGuids || []; 227 const approveStaffGuids = approveVO.approveStaffGuids || [];
188 const staffGuid = approveVO.staffGuid || ''; 228 const staffGuid = approveVO.staffGuid || '';
...@@ -233,11 +273,21 @@ const tableBtnClick = (scope, btn) => { ...@@ -233,11 +273,21 @@ const tableBtnClick = (scope, btn) => {
233 currTableData.value = row; 273 currTableData.value = row;
234 console.log(row, '-------'); 274 console.log(row, '-------');
235 if (type == "redit") { 275 if (type == "redit") {
236 dialogInfo.value.visible = true; 276 isNeedApprove({ funcCode: 'ZCZLPJ' }).then((res1: any) => {
237 dialogInfo.value.type = 'reSubmit'; 277 if (res1.code == proxy.$passCode) {
238 formItems.value[0].visible = false; 278 needApprove.value = res1.data;
239 formItems.value[0].default = row.registerGuid; 279 formItems.value[0].visible = false;
240 formItems.value[1].default = row.qualityEvaluationFile || []; 280 formItems.value[0].default = row.damGuid;
281 formItems.value[1].visible = !needApprove.value;
282 formItems.value[1].default = row.evaluationAgencyGuid;
283 formItems.value[2].default = row.qualityEvaluationFile || [];
284 dialogInfo.value.contents[0].formInfo.items = formItems.value;
285 dialogInfo.value.visible = true;
286 dialogInfo.value.type = 'reSubmit';
287 } else {
288 proxy.$ElMessage.error(res1.msg);
289 }
290 })
241 } else if (type == "del") { 291 } else if (type == "del") {
242 delTableOpen("此操作将永久删除该资产质量评价,是否继续?", "warning"); 292 delTableOpen("此操作将永久删除该资产质量评价,是否继续?", "warning");
243 } else if (type === 'reject') { 293 } else if (type === 'reject') {
...@@ -373,6 +423,20 @@ const formItems = ref([{ ...@@ -373,6 +423,20 @@ const formItems = ref([{
373 visible: true, 423 visible: true,
374 required: true 424 required: true
375 }, { 425 }, {
426 label: '评估机构',
427 type: 'select',
428 placeholder: '请选择',
429 field: 'evaluationAgencyGuid',
430 default: '',
431 block: true,
432 options: tenantList.value,
433 props: {
434 value: 'guid',
435 label: 'tenantName'
436 },
437 visible: false,
438 required: true
439 }, {
376 label: '附件上传', 440 label: '附件上传',
377 tip: '支持格式:xls .xlsx .doc .docx .rar .zip', 441 tip: '支持格式:xls .xlsx .doc .docx .rar .zip',
378 type: 'upload-file', 442 type: 'upload-file',
...@@ -439,89 +503,146 @@ const dialogInfo = ref({ ...@@ -439,89 +503,146 @@ const dialogInfo = ref({
439 /** 编辑质量评价发起资产申请按钮处理。 */ 503 /** 编辑质量评价发起资产申请按钮处理。 */
440 const dialogBtnClick = (btn, info) => { 504 const dialogBtnClick = (btn, info) => {
441 if (btn.value == 'submit') { 505 if (btn.value == 'submit') {
442 dialogInfo.value.footer.btns[1].loading = true; 506 if (!needApprove.value) {
443 let submitFunc = () => { 507 // 不需要走流程审批的提交
444 getProcessNodesPromise({ 508 dialogInfo.value.footer.btns[1].loading = true;
445 deploymentId: deploymentId.value, 509 if (dialogInfo.value.type == 'reSubmit') {
446 processInstanceId: null, 510 updatQuality({
447 }).then((res: any) => { 511 guid: currTableData.value.guid,
448 if (res?.code == proxy.$passCode) { 512 tenantGuid: userData.tenantGuid,
449 getStaffDetailInfo(res.data?.[1]?.candidateUsers?.[0]?.staffGuid).then((resUser: any) => { 513 damGuid: currTableData.value.damGuid,
450 if (resUser?.code == proxy.$passCode) { 514 daName: currTableData.value.daName,
451 if (dialogInfo.value.type == 'reSubmit') { 515 immediateApprove: true,
452 updatQuality({ 516 evaluationAgencyGuid: info.evaluationAgencyGuid,
453 guid: currTableData.value.guid, 517 qualityEvaluationFile: info.qualityEvaluationFile?.map(file => {
454 tenantGuid: userData.tenantGuid, 518 return {
455 damGuid: currTableData.value.damGuid, 519 name: file.name,
456 daName: currTableData.value.daName, 520 url: file.url
457 immediateApprove: true,
458 evaluationAgencyGuid: resUser.data?.tenantGuid,
459 qualityEvaluationFile: info.qualityEvaluationFile?.map(file => {
460 return {
461 name: file.name,
462 url: file.url
463 }
464 }) || []
465 }).then((res: any) => {
466 dialogInfo.value.footer.btns[1].loading = false;
467 if (res?.code == proxy.$passCode) {
468 ElMessage.success('该资产质量评价重新提交成功');
469 dialogInfo.value.visible = false;
470 page.value.curr = 1;
471 getTableData();
472 } else {
473 ElMessage.error(res.msg);
474 }
475 })
476 } else {
477 let daInfo = assetListData.value.find(a => a.guid == info.damGuid);
478 saveQuality({
479 tenantGuid: userData.tenantGuid,
480 damGuid: info.damGuid,
481 daName: daInfo.damName,
482 immediateApprove: true,
483 evaluationAgencyGuid: resUser.data?.tenantGuid,
484 qualityEvaluationFile: info.qualityEvaluationFile?.map(file => {
485 return {
486 name: file.name,
487 url: file.url
488 }
489 }) || []
490 }).then((res: any) => {
491 dialogInfo.value.footer.btns[1].loading = false;
492 if (res?.code == proxy.$passCode) {
493 ElMessage.success('质量评价发起成功');
494 dialogInfo.value.visible = false;
495 page.value.curr = 1;
496 getTableData();
497 } else {
498 ElMessage.error(res.msg);
499 }
500 })
501 }
502 } else {
503 dialogInfo.value.footer.btns[1].loading = false;
504 ElMessage.error(res.msg);
505 } 521 }
506 }) 522 }) || []
507 } else { 523 }).then((res: any) => {
508 dialogInfo.value.footer.btns[1].loading = false; 524 dialogInfo.value.footer.btns[1].loading = false;
509 ElMessage.error(res.msg); 525 if (res?.code == proxy.$passCode) {
510 } 526 ElMessage.success('该资产质量评价重新提交成功');
511 }) 527 dialogInfo.value.visible = false;
512 } 528 page.value.curr = 1;
513 if (deploymentId.value) { 529 getTableData();
514 submitFunc(); 530 } else {
515 } else { 531 ElMessage.error(res.msg);
516 getCamundaDeploymentId('10018', userData.tenantGuid, userData.staffGuid).then((res: any) => { 532 }
517 if (res.code == proxy.$passCode) { 533 })
518 deploymentId.value = res.data; 534 } else {
519 submitFunc(); 535 let daInfo = assetListData.value.find(a => a.guid == info.damGuid);
520 } else { 536 saveQuality({
537 tenantGuid: userData.tenantGuid,
538 damGuid: info.damGuid,
539 daName: daInfo.damName,
540 immediateApprove: true,
541 evaluationAgencyGuid: info.evaluationAgencyGuid,
542 qualityEvaluationFile: info.qualityEvaluationFile?.map(file => {
543 return {
544 name: file.name,
545 url: file.url
546 }
547 }) || []
548 }).then((res: any) => {
521 dialogInfo.value.footer.btns[1].loading = false; 549 dialogInfo.value.footer.btns[1].loading = false;
522 proxy.$ElMessage.error(res.msg); 550 if (res?.code == proxy.$passCode) {
523 } 551 ElMessage.success('质量评价发起成功');
524 }) 552 dialogInfo.value.visible = false;
553 page.value.curr = 1;
554 getTableData();
555 } else {
556 ElMessage.error(res.msg);
557 }
558 })
559 }
560 } else {
561 // 需要走流程的审批功能。
562 dialogInfo.value.footer.btns[1].loading = true;
563 let submitFunc = () => {
564 getProcessNodesPromise({
565 deploymentId: deploymentId.value,
566 processInstanceId: null,
567 }).then((res: any) => {
568 if (res?.code == proxy.$passCode) {
569 getStaffDetailInfo(res.data?.[1]?.candidateUsers?.[0]?.staffGuid).then((resUser: any) => {
570 if (resUser?.code == proxy.$passCode) {
571 if (dialogInfo.value.type == 'reSubmit') {
572 updatQuality({
573 guid: currTableData.value.guid,
574 tenantGuid: userData.tenantGuid,
575 damGuid: currTableData.value.damGuid,
576 daName: currTableData.value.daName,
577 immediateApprove: true,
578 evaluationAgencyGuid: resUser.data?.tenantGuid,
579 qualityEvaluationFile: info.qualityEvaluationFile?.map(file => {
580 return {
581 name: file.name,
582 url: file.url
583 }
584 }) || []
585 }).then((res: any) => {
586 dialogInfo.value.footer.btns[1].loading = false;
587 if (res?.code == proxy.$passCode) {
588 ElMessage.success('该资产质量评价重新提交成功');
589 dialogInfo.value.visible = false;
590 page.value.curr = 1;
591 getTableData();
592 } else {
593 ElMessage.error(res.msg);
594 }
595 })
596 } else {
597 let daInfo = assetListData.value.find(a => a.guid == info.damGuid);
598 saveQuality({
599 tenantGuid: userData.tenantGuid,
600 damGuid: info.damGuid,
601 daName: daInfo.damName,
602 immediateApprove: true,
603 evaluationAgencyGuid: resUser.data?.tenantGuid,
604 qualityEvaluationFile: info.qualityEvaluationFile?.map(file => {
605 return {
606 name: file.name,
607 url: file.url
608 }
609 }) || []
610 }).then((res: any) => {
611 dialogInfo.value.footer.btns[1].loading = false;
612 if (res?.code == proxy.$passCode) {
613 ElMessage.success('质量评价发起成功');
614 dialogInfo.value.visible = false;
615 page.value.curr = 1;
616 getTableData();
617 } else {
618 ElMessage.error(res.msg);
619 }
620 })
621 }
622 } else {
623 dialogInfo.value.footer.btns[1].loading = false;
624 ElMessage.error(res.msg);
625 }
626 })
627 } else {
628 dialogInfo.value.footer.btns[1].loading = false;
629 ElMessage.error(res.msg);
630 }
631 })
632 }
633 if (deploymentId.value) {
634 submitFunc();
635 } else {
636 getCamundaDeploymentId('10018', userData.tenantGuid, userData.staffGuid).then((res: any) => {
637 if (res.code == proxy.$passCode) {
638 deploymentId.value = res.data;
639 submitFunc();
640 } else {
641 dialogInfo.value.footer.btns[1].loading = false;
642 proxy.$ElMessage.error(res.msg);
643 }
644 })
645 }
525 } 646 }
526 } else if (btn.value == 'cancel') { 647 } else if (btn.value == 'cancel') {
527 dialogInfo.value.visible = false; 648 dialogInfo.value.visible = false;
......
...@@ -112,8 +112,8 @@ const getDetailInfo = () => { ...@@ -112,8 +112,8 @@ const getDetailInfo = () => {
112 getEvaDetail({ guid: evaGuid, serviceTenantGuid: route.query.tenantGuid }).then((res: any) => { 112 getEvaDetail({ guid: evaGuid, serviceTenantGuid: route.query.tenantGuid }).then((res: any) => {
113 if (res.code == proxy.$passCode) { 113 if (res.code == proxy.$passCode) {
114 const data = res.data || {}; 114 const data = res.data || {};
115 evaDetailInfo.value = data; 115 evaDetailInfo.value = data;
116 deploymentId.value = data.approveVO.camundaDeploymentId; 116 deploymentId.value = data.approveVO?.camundaDeploymentId;
117 processInstanceId.value = data.approveVO?.camundaInstanceId; 117 processInstanceId.value = data.approveVO?.camundaInstanceId;
118 } else { 118 } else {
119 proxy.$ElMessage.error(res.msg); 119 proxy.$ElMessage.error(res.msg);
...@@ -126,7 +126,7 @@ const getDetailInfo = () => { ...@@ -126,7 +126,7 @@ const getDetailInfo = () => {
126 const data = res.data || {}; 126 const data = res.data || {};
127 costAssessDetail.value = data; 127 costAssessDetail.value = data;
128 evaDetailInfo.value = data; 128 evaDetailInfo.value = data;
129 deploymentId.value = data.approveVO.camundaDeploymentId; 129 deploymentId.value = data.approveVO?.camundaDeploymentId;
130 processInstanceId.value = data.approveVO?.camundaInstanceId; 130 processInstanceId.value = data.approveVO?.camundaInstanceId;
131 } else { 131 } else {
132 proxy.$ElMessage.error(res.msg); 132 proxy.$ElMessage.error(res.msg);
...@@ -208,6 +208,9 @@ const toolBtns: any = computed(() => { ...@@ -208,6 +208,9 @@ const toolBtns: any = computed(() => {
208 label: "关闭", value: "cancel", plain: true 208 label: "关闭", value: "cancel", plain: true
209 }]; 209 }];
210 let approveVO = evaDetailInfo.value.approveVO || costAssessDetail.value.approveVO; 210 let approveVO = evaDetailInfo.value.approveVO || costAssessDetail.value.approveVO;
211 if (!approveVO) {
212 return btnsArr;
213 }
211 let staffGuid = userData.staffGuid; 214 let staffGuid = userData.staffGuid;
212 if (approveVO && approveVO.approveState == 'A' && approveVO.approveStaffGuids && approveVO.approveStaffGuids.indexOf(staffGuid) > -1) { 215 if (approveVO && approveVO.approveState == 'A' && approveVO.approveStaffGuids && approveVO.approveStaffGuids.indexOf(staffGuid) > -1) {
213 btnsArr.push(...[{ label: "通过", value: "pass", type: 'primary' }, { label: "驳回", value: "reject", type: 'danger', plain: true }]); 216 btnsArr.push(...[{ label: "通过", value: "pass", type: 'primary' }, { label: "驳回", value: "reject", type: 'danger', plain: true }]);
...@@ -1157,7 +1160,7 @@ const handleClick = () => { ...@@ -1157,7 +1160,7 @@ const handleClick = () => {
1157 </div> 1160 </div>
1158 </ContentWrap> 1161 </ContentWrap>
1159 1162
1160 <ContentWrap v-if="route.query.type == 'qualityEvaluate' || route.query.type == 'costAssess'" id="id-approveInfo" 1163 <ContentWrap v-if="(route.query.type == 'qualityEvaluate' && evaDetailInfo.approveVO && evaDetailInfo.isApprove !='N') || (route.query.type == 'costAssess' && costAssessDetail.approveVO && costAssessDetail.isApprove !='N')" id="id-approveInfo"
1161 title="审批信息" description="" style="margin: 16px 16px 16px"> 1164 title="审批信息" description="" style="margin: 16px 16px 16px">
1162 <ApprovalProcess ref="approvalProcessRef" v-if="deploymentId" :deploymentId="deploymentId" :processInstanceId="processInstanceId"> 1165 <ApprovalProcess ref="approvalProcessRef" v-if="deploymentId" :deploymentId="deploymentId" :processInstanceId="processInstanceId">
1163 </ApprovalProcess> 1166 </ApprovalProcess>
......
...@@ -78,7 +78,7 @@ const getDetailInfo = () => { ...@@ -78,7 +78,7 @@ const getDetailInfo = () => {
78 const data = res.data || {}; 78 const data = res.data || {};
79 evaDetailInfo.value = data; 79 evaDetailInfo.value = data;
80 detailInfo.value = data; 80 detailInfo.value = data;
81 deploymentId.value = data.approveVO.camundaDeploymentId; 81 deploymentId.value = data.approveVO?.camundaDeploymentId;
82 processInstanceId.value = data.approveVO?.camundaInstanceId; 82 processInstanceId.value = data.approveVO?.camundaInstanceId;
83 //需要显示质量评价信息 83 //需要显示质量评价信息
84 if (data.qualityScore != null) { 84 if (data.qualityScore != null) {
...@@ -90,6 +90,9 @@ const getDetailInfo = () => { ...@@ -90,6 +90,9 @@ const getDetailInfo = () => {
90 tabsInfo.value.tabs.splice(3, 1); 90 tabsInfo.value.tabs.splice(3, 1);
91 } 91 }
92 } 92 }
93 if (evaDetailInfo.value.isApprove == 'N') {
94 tabsInfo.value.tabs.pop();
95 }
93 if (fullPath === route.fullPath) { 96 if (fullPath === route.fullPath) {
94 document.title = `详情-${data.daName}`; 97 document.title = `详情-${data.daName}`;
95 } 98 }
...@@ -124,7 +127,7 @@ const getDetailInfo = () => { ...@@ -124,7 +127,7 @@ const getDetailInfo = () => {
124 const data = res.data || {}; 127 const data = res.data || {};
125 costAssessDetailInfo.value = data; 128 costAssessDetailInfo.value = data;
126 detailInfo.value = data; 129 detailInfo.value = data;
127 deploymentId.value = data.approveVO.camundaDeploymentId; 130 deploymentId.value = data.approveVO?.camundaDeploymentId;
128 processInstanceId.value = data.approveVO?.camundaInstanceId; 131 processInstanceId.value = data.approveVO?.camundaInstanceId;
129 // 需要显示价值评估信息 132 // 需要显示价值评估信息
130 if (data.assessmentMoney != null) { 133 if (data.assessmentMoney != null) {
...@@ -136,7 +139,9 @@ const getDetailInfo = () => { ...@@ -136,7 +139,9 @@ const getDetailInfo = () => {
136 tabsInfo.value.tabs.splice(3, 1); 139 tabsInfo.value.tabs.splice(3, 1);
137 } 140 }
138 } 141 }
139 142 if (costAssessDetailInfo.value.isApprove == 'N') {
143 tabsInfo.value.tabs.pop();
144 }
140 if (data.qualityScore) { 145 if (data.qualityScore) {
141 // 确保"质量评价"标签存在于tabs中,并插入到"价值评估"前面 146 // 确保"质量评价"标签存在于tabs中,并插入到"价值评估"前面
142 const qualityTabIndex = tabsInfo.value.tabs.findIndex(tab => tab.name === "qualityEvaluate"); 147 const qualityTabIndex = tabsInfo.value.tabs.findIndex(tab => tab.name === "qualityEvaluate");
...@@ -285,8 +290,8 @@ const getDetailInfo = () => { ...@@ -285,8 +290,8 @@ const getDetailInfo = () => {
285 let { approveVO } = data; 290 let { approveVO } = data;
286 detailInfo.value = data; 291 detailInfo.value = data;
287 assetDetailInfo.value = data; 292 assetDetailInfo.value = data;
288 deploymentId.value = approveVO.camundaDeploymentId; 293 deploymentId.value = approveVO?.camundaDeploymentId;
289 processInstanceId.value = approveVO.camundaInstanceId; 294 processInstanceId.value = approveVO?.camundaInstanceId;
290 isTextTruncated(); 295 isTextTruncated();
291 } else { 296 } else {
292 ElMessage.error(res.msg); 297 ElMessage.error(res.msg);
...@@ -446,6 +451,9 @@ const toolBtns: any = computed(() => { ...@@ -446,6 +451,9 @@ const toolBtns: any = computed(() => {
446 return btnsArr; 451 return btnsArr;
447 } 452 }
448 let approveVO = detailInfo.value.approveVO; 453 let approveVO = detailInfo.value.approveVO;
454 if (!approveVO) {
455 return btnsArr;
456 }
449 let staffGuid = userData.staffGuid; 457 let staffGuid = userData.staffGuid;
450 if (approveVO && approveVO.approveState == 'A' && approveVO.approveStaffGuids && approveVO.approveStaffGuids.indexOf(staffGuid) > -1) { 458 if (approveVO && approveVO.approveState == 'A' && approveVO.approveStaffGuids && approveVO.approveStaffGuids.indexOf(staffGuid) > -1) {
451 btnsArr.push(...[{ label: "通过", value: "pass", type: 'primary' }, { label: "驳回", value: "reject", type: 'danger', plain: true }]); 459 btnsArr.push(...[{ label: "通过", value: "pass", type: 'primary' }, { label: "驳回", value: "reject", type: 'danger', plain: true }]);
...@@ -1725,7 +1733,7 @@ const passCommonDialogBtnClick = (btn, info) => { ...@@ -1725,7 +1733,7 @@ const passCommonDialogBtnClick = (btn, info) => {
1725 </div> 1733 </div>
1726 </ContentWrap> 1734 </ContentWrap>
1727 <ContentWrap id="id-approveInfo" title="审批信息" expandSwicth style="margin-top: 15px" 1735 <ContentWrap id="id-approveInfo" title="审批信息" expandSwicth style="margin-top: 15px"
1728 :isExpand="approveInfoExpand" @expand="(v) => approveInfoExpand = v" v-if="route.query.type != 'certificate'"> 1736 :isExpand="approveInfoExpand" @expand="(v) => approveInfoExpand = v" v-if="tabsInfo.tabs.find(t => t.name == 'approveInfo') && route.query.type != 'certificate'">
1729 <!-- <Table :tableInfo="approveTableInfo" /> --> 1737 <!-- <Table :tableInfo="approveTableInfo" /> -->
1730 <ApprovalProcess ref="approvalProcessRef" v-if="deploymentId" :deploymentId="deploymentId" 1738 <ApprovalProcess ref="approvalProcessRef" v-if="deploymentId" :deploymentId="deploymentId"
1731 :processInstanceId="processInstanceId"> 1739 :processInstanceId="processInstanceId">
......
...@@ -14,14 +14,15 @@ import { ...@@ -14,14 +14,15 @@ import {
14 deleteCostAssess, 14 deleteCostAssess,
15 registerApproveCancel, 15 registerApproveCancel,
16 registerApproveBackup, 16 registerApproveBackup,
17 costAssessAllow 17 costAssessAllow,
18 getTenantList
18 } from "@/api/modules/dataAsset"; 19 } from "@/api/modules/dataAsset";
19 import { 20 import {
20 getStaffDetailInfo 21 getStaffDetailInfo
21 } from "@/api/modules/queryService"; 22 } from "@/api/modules/queryService";
22 import useUserStore from "@/store/modules/user"; 23 import useUserStore from "@/store/modules/user";
23 import useDataAssetStore from "@/store/modules/dataAsset"; 24 import useDataAssetStore from "@/store/modules/dataAsset";
24 import { getCamundaDeploymentId, getProcessNodesPromise, passFlowData, rejectFlowData, revokeFlowData, isMyFirstNode } from '@/api/modules/workFlowService'; 25 import { isNeedApprove, getCamundaDeploymentId, getProcessNodesPromise, passFlowData, rejectFlowData, revokeFlowData, isMyFirstNode } from '@/api/modules/workFlowService';
25 import { changeNum } from '@/utils/common'; 26 import { changeNum } from '@/utils/common';
26 27
27 const assetStore = useDataAssetStore(); 28 const assetStore = useDataAssetStore();
...@@ -47,41 +48,14 @@ const tableFields = ref([ ...@@ -47,41 +48,14 @@ const tableFields = ref([
47 // { label: "企业名称", field: "tenantName", width: 240, align: "left" }, 48 // { label: "企业名称", field: "tenantName", width: 240, align: "left" },
48 { label: "评估机构", field: "evaluationAgencyName", width: 250, align: "left" }, 49 { label: "评估机构", field: "evaluationAgencyName", width: 250, align: "left" },
49 { 50 {
50 label: "审批状态", field: "approveState", type: "tag", width: 96, align: 'center', getName: (scope) => { 51 label: "审批状态", field: "approveVO", type: "approveTag", enableNoApprove: true, width: 96, align: 'center'
51 const approveVO = scope.row.approveVO || {}
52 switch (approveVO.approveState) {
53 case 'N':
54 return '草稿中';
55 case 'A':
56 return '审批中';
57 case 'Y':
58 return '已通过';
59 case 'R':
60 return '已驳回';
61 case 'C':
62 return '已撤销';
63 case 'I':
64 return '--';
65 default:
66 return '草稿中';
67 }
68 }, tagType: (scope) => {
69 const approveVO = scope.row.approveVO || {}
70 switch (approveVO.approveState) {
71 case 'A':
72 return 'warning';
73 case 'Y':
74 return 'success';
75 case 'R':
76 return 'danger';
77 default:
78 return 'info';
79 }
80 }
81 }, 52 },
82 ]); 53 ]);
83 54
84 const deploymentId = ref(''); 55 const deploymentId = ref('');
56
57 const tenantList: any = ref([]);
58
85 onBeforeMount(() => { 59 onBeforeMount(() => {
86 if (isCompanyPlatform.value) { 60 if (isCompanyPlatform.value) {
87 tableInfo.value.fields = tableFields.value; 61 tableInfo.value.fields = tableFields.value;
...@@ -89,14 +63,18 @@ onBeforeMount(() => { ...@@ -89,14 +63,18 @@ onBeforeMount(() => {
89 tableFields.value.splice(3, 0, { label: "企业名称", field: "tenantName", width: 250, align: "left" }) 63 tableFields.value.splice(3, 0, { label: "企业名称", field: "tenantName", width: 250, align: "left" })
90 tableInfo.value.fields = tableFields.value; 64 tableInfo.value.fields = tableFields.value;
91 } 65 }
92 // getTenantAttach(userData.tenantGuid).then((res: any) => { 66 getTenantList({
93 // if (res?.code == proxy.$passCode) { 67 bizState: 'Y',
94 // attachDataInfo.value = res.data || {}; 68 pageSize: -1
95 // formItems.value[1].templateUrl = attachDataInfo.value.quality_evaluation_file; 69 }).then((res: any) => {
96 // } else { 70 tenantList.value = [];
97 // ElMessage.error(res.msg); 71 if (res.code == proxy.$passCode) {
98 // } 72 tenantList.value = res.data?.records || [];
99 // }) 73 formItems.value[1].options = tenantList.value;
74 } else {
75 proxy.$ElMessage.error(res.msg);
76 }
77 })
100 }); 78 });
101 79
102 onActivated(() => { 80 onActivated(() => {
...@@ -174,36 +152,53 @@ const getTableData = () => { ...@@ -174,36 +152,53 @@ const getTableData = () => {
174 }) 152 })
175 } 153 }
176 154
155 let needApprovePromise = ref();
156
157 const needApprove = ref(true);
158
177 const handleCreate = () => { 159 const handleCreate = () => {
178 if (!assetListData.value.length) { 160 if (!assetListData.value.length) {
179 ElMessage.warning('当前没有可发起价值评估的资产!'); 161 ElMessage.warning('当前没有可发起价值评估的资产!');
180 return; 162 return;
181 } 163 }
182 formItems.value[4].placeholder = `本次评估数据资产总体质量得分为**分\n准确性:\n一致性:\n可访问性:\n规范性:\n完整性:`; 164 if (needApprovePromise.value) {
183 formItems.value[0].visible = true; 165 return;
184 formItems.value[0].default = '';
185 formItems.value[1].visible = true;
186 formItems.value[1].default = [];
187 formItems.value[2].visible = false;
188 formItems.value[2].default = '';
189 formItems.value[3].visible = false;
190 formItems.value[3].default = '';
191 formItems.value[4].visible = false;
192 formItems.value[4].default = '';
193 formItems.value[5].visible = false;
194 formItems.value[5].default = [];
195 dialogInfo.value.visible = true;
196 dialogInfo.value.type = '';
197 if (!deploymentId.value) {
198 getCamundaDeploymentId('10019', userData.tenantGuid, userData.staffGuid).then((res: any) => {
199 if (res.code == proxy.$passCode) {
200 deploymentId.value = res.data;
201 } else {
202 deploymentId.value = '';
203 proxy.$ElMessage.error(res.msg);
204 }
205 })
206 } 166 }
167 needApprovePromise.value = isNeedApprove({ funcCode: 'ZCJZPG' }).then((res1: any) => {
168 needApprovePromise.value = null;
169 if (res1.code == proxy.$passCode) {
170 needApprove.value = res1.data;
171 formItems.value[5].placeholder = `本次评估数据资产总体质量得分为**分\n准确性:\n一致性:\n可访问性:\n规范性:\n完整性:`;
172 formItems.value[0].visible = true;
173 formItems.value[0].default = '';
174 formItems.value[1].visible = !needApprove.value;
175 formItems.value[1].default = '';
176 formItems.value[2].visible = true;
177 formItems.value[2].default = [];
178 formItems.value[3].visible = false;
179 formItems.value[3].default = '';
180 formItems.value[4].visible = false;
181 formItems.value[4].default = '';
182 formItems.value[5].visible = false;
183 formItems.value[5].default = '';
184 formItems.value[6].visible = false;
185 formItems.value[6].default = [];
186 dialogInfo.value.visible = true;
187 dialogInfo.value.type = '';
188 if (needApprove.value) {
189 getCamundaDeploymentId('10019', userData.tenantGuid, userData.staffGuid).then((res: any) => {
190 if (res.code == proxy.$passCode) {
191 deploymentId.value = res.data;
192 } else {
193 deploymentId.value = '';
194 proxy.$ElMessage.error(res.msg);
195 }
196 })
197 }
198 } else {
199 proxy.$ElMessage.error(res1.msg);
200 }
201 });
207 } 202 }
208 203
209 const page = ref({ 204 const page = ref({
...@@ -244,7 +239,13 @@ const tableInfo = ref({ ...@@ -244,7 +239,13 @@ const tableInfo = ref({
244 239
245 const getTableBtns = (row) => { 240 const getTableBtns = (row) => {
246 let btnsArr: any[] = []; 241 let btnsArr: any[] = [];
247 const approveVO = row.approveVO || {}; 242 const approveVO = row.approveVO;
243 if (!approveVO && row.isApprove == 'N') {
244 btnsArr.push({ label: "编辑", value: "redit" });
245 btnsArr.push({ label: "删除", value: "del" });
246 btnsArr.push({ label: "详情", value: "detail" });
247 return btnsArr;
248 }
248 const approveState = row.approveVO.approveState || null; 249 const approveState = row.approveVO.approveState || null;
249 const approveStaffGuids = approveVO.approveStaffGuids || []; 250 const approveStaffGuids = approveVO.approveStaffGuids || [];
250 const staffGuid = approveVO.staffGuid || ''; 251 const staffGuid = approveVO.staffGuid || '';
...@@ -296,62 +297,47 @@ const tableBtnClick = (scope, btn) => { ...@@ -296,62 +297,47 @@ const tableBtnClick = (scope, btn) => {
296 console.log('row', row); 297 console.log('row', row);
297 currTableData.value = row; 298 currTableData.value = row;
298 if (type == "redit") { 299 if (type == "redit") {
299 // if (!row.registerGuid) { 300 isNeedApprove({ funcCode: 'ZCJZPG' }).then((res1: any) => {
300 // formItems.value[2].visible = true; 301 if (res1.code == proxy.$passCode) {
301 // formItems.value[3].visible = true; 302 needApprove.value = res1.data;
302 // formItems.value[4].visible = true; 303 if (row.qualityEvaluationGuid) {
303 // formItems.value[5].visible = true; 304 formItems.value[3].visible = false;
304 // formItems.value[0].visible = false; 305 formItems.value[4].visible = false;
305 // formItems.value[0].default = row.damGuid; 306 formItems.value[5].visible = false;
306 // formItems.value[1].default = row.costAssessmentFile || []; 307 formItems.value[6].visible = false;
307 // dialogInfo.value.type = 'reSubmit'; 308 formItems.value[0].visible = false;
308 // dialogInfo.value.visible = true; 309 formItems.value[0].default = row.damGuid;
309 // } else { 310 formItems.value[1].visible = !needApprove.value;
310 // formItems.value[2].visible = false; 311 formItems.value[1].default = row.evaluationAgencyGuid;
311 // formItems.value[3].visible = false; 312 formItems.value[2].default = row.costAssessmentFile || [];
312 // formItems.value[4].visible = false; 313 // formItems.value[2].default = row.qualityScore;
313 // formItems.value[5].visible = false; 314 formItems.value[5].default = row.evaluationRangeStart && row.evaluationRangeEnd ? [row.evaluationRangeStart, row.evaluationRangeEnd] : '';
314 // formItems.value[0].visible = false; 315 // formItems.value[4].default = row.evaluationNote;
315 // formItems.value[0].default = row.damGuid; 316 // formItems.value[5].default = row.evaluationFile || [];
316 // formItems.value[1].default = row.costAssessmentFile || []; 317 dialogInfo.value.type = 'reSubmit';
317 // formItems.value[2].default = row.qualityScore; 318 dialogInfo.value.visible = true;
318 // formItems.value[3].default = row.evaluationRangeStart && row.evaluationRangeEnd ? [row.evaluationRangeStart, row.evaluationRangeEnd] : ''; 319 }
319 // formItems.value[4].default = row.evaluationNote; 320 if (!row.qualityEvaluationGuid) {
320 // formItems.value[5].default = row.evaluationFile || []; 321 formItems.value[3].visible = true;
321 // dialogInfo.value.type = 'reSubmit'; 322 formItems.value[4].visible = true;
322 // dialogInfo.value.visible = true; 323 formItems.value[5].visible = true;
323 // } 324 formItems.value[6].visible = true;
324 if (row.qualityEvaluationGuid) { 325 formItems.value[0].visible = false;
325 formItems.value[2].visible = false; 326 formItems.value[0].default = row.damGuid;
326 formItems.value[3].visible = false; 327 formItems.value[1].visible = !needApprove.value;
327 formItems.value[4].visible = false; 328 formItems.value[1].default = row.evaluationAgencyGuid;
328 formItems.value[5].visible = false; 329 formItems.value[2].default = row.costAssessmentFile || [];
329 formItems.value[0].visible = false; 330 formItems.value[3].default = changeNum(row.qualityScore || 0, 2);
330 formItems.value[0].default = row.damGuid; 331 formItems.value[4].default = row.evaluationRangeStart && row.evaluationRangeEnd ? [row.evaluationRangeStart, row.evaluationRangeEnd] : '';
331 formItems.value[1].default = row.costAssessmentFile || []; 332 formItems.value[5].default = row.evaluationNote;
332 // formItems.value[2].default = row.qualityScore; 333 formItems.value[6].default = row.evaluationFile || [];
333 formItems.value[3].default = row.evaluationRangeStart && row.evaluationRangeEnd ? [row.evaluationRangeStart, row.evaluationRangeEnd] : ''; 334 dialogInfo.value.type = 'reSubmit';
334 // formItems.value[4].default = row.evaluationNote; 335 dialogInfo.value.visible = true;
335 // formItems.value[5].default = row.evaluationFile || []; 336 }
336 dialogInfo.value.type = 'reSubmit'; 337 } else {
337 dialogInfo.value.visible = true; 338 proxy.$ElMessage.error(res1.msg);
338 } 339 }
339 if (!row.qualityEvaluationGuid) { 340 });
340 formItems.value[2].visible = true;
341 formItems.value[3].visible = true;
342 formItems.value[4].visible = true;
343 formItems.value[5].visible = true;
344 formItems.value[0].visible = false;
345 formItems.value[0].default = row.damGuid;
346 formItems.value[1].default = row.costAssessmentFile || [];
347 formItems.value[2].default = changeNum(row.qualityScore || 0, 2);
348 formItems.value[3].default = row.evaluationRangeStart && row.evaluationRangeEnd ? [row.evaluationRangeStart, row.evaluationRangeEnd] : '';
349 formItems.value[4].default = row.evaluationNote;
350 formItems.value[5].default = row.evaluationFile || [];
351 dialogInfo.value.type = 'reSubmit';
352 dialogInfo.value.visible = true;
353 }
354
355 } else if (type == "delete") { 341 } else if (type == "delete") {
356 delTableOpen("此操作将永久删除该资产价值评估,是否继续?", "warning"); 342 delTableOpen("此操作将永久删除该资产价值评估,是否继续?", "warning");
357 } else if (type === 'backup') { 343 } else if (type === 'backup') {
...@@ -426,71 +412,6 @@ const tableBtnClick = (scope, btn) => { ...@@ -426,71 +412,6 @@ const tableBtnClick = (scope, btn) => {
426 } 412 }
427 }; 413 };
428 414
429 // const tableBtnClick = (scope, btn) => {
430 // const type = btn.value;
431 // const row = scope.row;
432 // currTableData.value = row;
433 // if (type === "edit") { //草稿中\已驳回\已撤销\已通过 状态,才可以编辑。
434 // localStorage.setItem('isRestart', btn.label == '重新提交' ? 'true' : '');
435 // // router.push({
436 // // name: 'registerStart',
437 // // query: { guid: row.guid, exchangeGuid: row.exchangeGuid, name: row.daName, type }
438 // // });
439 // router.push({
440 // name: 'registerValueDetail',
441 // query: { guid: row.registerGuid, costAssessGuid: row.guid, type: 'costAssess', daTenantGuid: row.tenantGuid, exchangeGuid: row.exchangeGuid }
442 // });
443 // } else if (type == "delete") {
444 // delTableOpen("此操作将永久删除该资产登记,是否继续?", "warning");
445 // } else if (type === 'revoke') { // 撤销,状态为审批中时可以撤销。
446 // ElMessageBox.confirm('确定撤销该资产登记审批流程吗?', "提示", {
447 // confirmButtonText: "确定",
448 // cancelButtonText: "取消",
449 // type: 'warning',
450 // }).then(() => {
451 // tableInfo.value.loading = true;
452 // let params = {
453 // guid: row.approveVO.approveGuid,
454 // flowType: row.approveVO.flowType,
455 // approveStaffGuid: userData.staffGuid,
456 // }
457 // revokeFlowData(params).then((res: any) => {
458 // tableInfo.value.loading = false;
459 // if (res?.code == proxy.$passCode) {
460 // if (res.data) {
461 // ElMessage.success('该审批流程撤销成功!');
462 // getTableData();
463 // } else {
464 // ElMessage.error('该审批流程撤销失败!');
465 // }
466 // } else {
467 // ElMessage.error(res.msg);
468 // }
469 // }).catch(() => {
470 // tableInfo.value.loading = false;
471 // });
472 // }).catch(() => {
473 // ElMessage({
474 // type: 'info',
475 // message: '已取消撤销'
476 // });
477 // });
478 // } else if (type === 'detail') { // 详情, 若是草稿中,详情就是编辑,
479 // // router.push({
480 // // name: 'registerInfoDetail',
481 // // query: { guid: row.guid, name: row.daName, type: 'asset' }
482 // // });
483 // router.push({
484 // name: 'registerValueDetail',
485 // query: { guid: row.registerGuid, costAssessGuid: row.guid, type: 'costAssess', daTenantGuid: row.tenantGuid }
486 // });
487 // } else if (type === 'pass') {
488 // passDialogInfo.value.visible = true;
489 // } else if (type == 'reject') {
490 // rejectDialogInfo.value.visible = true;
491 // }
492 // };
493
494 const delTableOpen = (msg, type, isBatch: boolean = false) => { 415 const delTableOpen = (msg, type, isBatch: boolean = false) => {
495 ElMessageBox.confirm(msg, "提示", { 416 ElMessageBox.confirm(msg, "提示", {
496 confirmButtonText: "确定", 417 confirmButtonText: "确定",
...@@ -543,6 +464,20 @@ const formItems = ref<any>([ ...@@ -543,6 +464,20 @@ const formItems = ref<any>([
543 }, 464 },
544 visible: true, 465 visible: true,
545 required: true 466 required: true
467 }, {
468 label: '评估机构',
469 type: 'select',
470 placeholder: '请选择',
471 field: 'evaluationAgencyGuid',
472 default: '',
473 block: true,
474 options: tenantList.value,
475 props: {
476 value: 'guid',
477 label: 'tenantName'
478 },
479 visible: false,
480 required: true
546 }, 481 },
547 { 482 {
548 label: '附件上传', 483 label: '附件上传',
...@@ -692,24 +627,26 @@ const dialogInfo = ref({ ...@@ -692,24 +627,26 @@ const dialogInfo = ref({
692 627
693 628
694 const handleSelectChange = (val, row, info) => { 629 const handleSelectChange = (val, row, info) => {
695 let qualityEvaluationGuid = ''; 630 if (row.field != 'registerGuid') {
696 assetListData.value.forEach((item) => { 631 return;
697 if (item.guid == val) { 632 }
698 qualityEvaluationGuid = item.qualityEvaluationGuid; 633 let qualityEvaluationGuid = assetListData.value.find(item => item.guid == val)?.qualityEvaluationGuid;
699 }
700 });
701 if (!qualityEvaluationGuid) { 634 if (!qualityEvaluationGuid) {
702 formItems.value[0].default = val; 635 formItems.value[0].default = val;
703 formItems.value[2].visible = true; 636 formItems.value[1].default = info.evaluationAgencyGuid;
637 formItems.value[2].default = info[formItems.value[2].field];
704 formItems.value[3].visible = true; 638 formItems.value[3].visible = true;
705 formItems.value[4].visible = true; 639 formItems.value[4].visible = true;
706 formItems.value[5].visible = true; 640 formItems.value[5].visible = true;
641 formItems.value[6].visible = true;
707 } else { 642 } else {
708 formItems.value[0].default = val; 643 formItems.value[0].default = val;
709 formItems.value[2].visible = false; 644 formItems.value[1].default = info.evaluationAgencyGuid;
645 formItems.value[2].default = info[formItems.value[2].field];
710 formItems.value[3].visible = false; 646 formItems.value[3].visible = false;
711 formItems.value[4].visible = false; 647 formItems.value[4].visible = false;
712 formItems.value[5].visible = false; 648 formItems.value[5].visible = false;
649 formItems.value[6].visible = false;
713 } 650 }
714 651
715 } 652 }
...@@ -743,80 +680,118 @@ const reSubmitPromise: any = ref(null); ...@@ -743,80 +680,118 @@ const reSubmitPromise: any = ref(null);
743 const dialogBtnClick = (btn, info) => { 680 const dialogBtnClick = (btn, info) => {
744 console.log('btn', btn, info); 681 console.log('btn', btn, info);
745 if (btn.value == 'submit') { 682 if (btn.value == 'submit') {
746 let submitFunc = () => { 683 if (!needApprove.value) {
747 getProcessNodesPromise({ 684 dialogInfo.value.footer.btns[1].loading = true;
748 deploymentId: deploymentId.value, 685 if (dialogInfo.value.type == 'reSubmit') {
749 processInstanceId: null, 686 updateCostAssess({
750 }).then((res: any) => { 687 guid: currTableData.value.guid,
751 getStaffDetailInfo(res.data?.[1]?.candidateUsers?.[0]?.staffGuid).then((resUser: any) => { 688 immediateApprove: true,
752 if (resUser?.code == proxy.$passCode) { 689 tenantGuid: userData.tenantGuid,
753 if (dialogInfo.value.type == 'reSubmit') { 690 daName: currTableData.value.daName,
754 if (reSubmitPromise.value) { 691 damGuid: currTableData.value.damGuid,
755 return; 692 costAssessmentFile: info.costAssessmentFile?.map(file => {
693 return {
694 name: file.name,
695 url: file.url
696 }
697 }) || [],
698 evaluationFile: info.evaluationFile?.map(file => {
699 return {
700 name: file.name,
701 url: file.url
702 }
703 }) || [],
704 qualityScore: info.qualityScore || null,
705 evaluationRangeStart: info.evaluationRange ? info.evaluationRange[0] : null,
706 evaluationRangeEnd: info.evaluationRange ? info.evaluationRange[1] : null,
707 evaluationNote: info.evaluationNote || null,
708 evaluationAgencyGuid: info.evaluationAgencyGuid,
709 }).then((res: any) => {
710 dialogInfo.value.footer.btns[1].loading = false;
711 if (res?.code == proxy.$passCode) {
712 ElMessage.success('该资产价值评估重新提交成功');
713 dialogInfo.value.visible = false;
714 page.value.curr = 1;
715 getTableData();
716 formItems.value[4].placeholder = `本次评估数据资产总体质量得分为**分\n准确性:\n一致性:\n可访问性:\n规范性:\n完整性:`;
717 } else {
718 ElMessage.error(res.msg);
719 }
720 })
721 } else {
722 let params: any = {};
723 let daInfo = assetListData.value.find(a => a.guid == info.registerGuid);
724 if (daInfo.qualityEvaluationGuid) {
725 //通过质量评估发起资产申请
726 params = {
727 immediateApprove: true,
728 tenantGuid: userData.tenantGuid,
729 daName: daInfo.damName,
730 damGuid: daInfo.guid,
731 costAssessmentFile: info.costAssessmentFile?.map(file => {
732 return {
733 name: file.name,
734 url: file.url
756 } 735 }
757 reSubmitPromise.value = updateCostAssess({ 736 }) || [],
758 guid: currTableData.value.guid, 737 evaluationAgencyGuid: info.evaluationAgencyGuid,
759 immediateApprove: true, 738 }
760 tenantGuid: userData.tenantGuid, 739 } else {
761 daName: currTableData.value.daName, 740 //未通过质量评估发起资产申请
762 damGuid: currTableData.value.damGuid, 741 params = {
763 costAssessmentFile: info.costAssessmentFile?.map(file => { 742 immediateApprove: true,
764 return { 743 tenantGuid: userData.tenantGuid,
765 name: file.name, 744 daName: daInfo.damName,
766 url: file.url 745 damGuid: daInfo.guid,
767 } 746 costAssessmentFile: info.costAssessmentFile?.map(file => {
768 }) || [], 747 return {
769 evaluationFile: info.evaluationFile?.map(file => { 748 name: file.name,
770 return { 749 url: file.url
771 name: file.name,
772 url: file.url
773 }
774 }) || [],
775 qualityScore: info.qualityScore || null,
776 evaluationRangeStart: info.evaluationRange ? info.evaluationRange[0] : null,
777 evaluationRangeEnd: info.evaluationRange ? info.evaluationRange[1] : null,
778 evaluationNote: info.evaluationNote || null,
779 evaluationAgencyGuid: resUser.data?.tenantGuid,
780 }).then((res: any) => {
781 reSubmitPromise.value = null;
782 if (res?.code == proxy.$passCode) {
783 ElMessage.success('该资产价值评估重新提交成功');
784 dialogInfo.value.visible = false;
785 page.value.curr = 1;
786 getTableData();
787 formItems.value[4].placeholder = `本次评估数据资产总体质量得分为**分\n准确性:\n一致性:\n可访问性:\n规范性:\n完整性:`;
788 } else {
789 ElMessage.error(res.msg);
790 }
791 })
792 } else {
793 if (savePromise.value) {
794 return;
795 } 750 }
796 let params: any = {}; 751 }) || [],
797 let daInfo = assetListData.value.find(a => a.guid == info.registerGuid); 752 evaluationFile: info.evaluationFile?.map(file => {
798 if (daInfo.qualityEvaluationGuid) { 753 return {
799 //通过质量评估发起资产申请 754 name: file.name,
800 params = { 755 url: file.url
801 immediateApprove: true, 756 }
802 tenantGuid: userData.tenantGuid, 757 }) || [],
803 daName: daInfo.damName, 758 qualityScore: info.qualityScore,
804 damGuid: daInfo.guid, 759 evaluationRangeStart: info.evaluationRange ? info.evaluationRange[0] : null,
805 costAssessmentFile: info.costAssessmentFile?.map(file => { 760 evaluationRangeEnd: info.evaluationRange ? info.evaluationRange[1] : null,
806 return { 761 evaluationNote: info.evaluationNote,
807 name: file.name, 762 evaluationAgencyGuid: info.evaluationAgencyGuid,
808 url: file.url 763 }
809 } 764 }
810 }) || [], 765 saveCostAssess(params).then((res: any) => {
811 evaluationAgencyGuid: resUser.data?.tenantGuid, 766 dialogInfo.value.footer.btns[1].loading = false;
767 if (res?.code == proxy.$passCode) {
768 ElMessage.success('价值评估发起成功');
769 dialogInfo.value.visible = false;
770 page.value.curr = 1;
771 getTableData();
772 } else {
773 ElMessage.error(res.msg);
774 }
775 })
776 }
777 } else {
778 let submitFunc = () => {
779 getProcessNodesPromise({
780 deploymentId: deploymentId.value,
781 processInstanceId: null,
782 }).then((res: any) => {
783 getStaffDetailInfo(res.data?.[1]?.candidateUsers?.[0]?.staffGuid).then((resUser: any) => {
784 if (resUser?.code == proxy.$passCode) {
785 if (dialogInfo.value.type == 'reSubmit') {
786 if (reSubmitPromise.value) {
787 return;
812 } 788 }
813 } else { 789 reSubmitPromise.value = updateCostAssess({
814 //未通过质量评估发起资产申请 790 guid: currTableData.value.guid,
815 params = {
816 immediateApprove: true, 791 immediateApprove: true,
817 tenantGuid: userData.tenantGuid, 792 tenantGuid: userData.tenantGuid,
818 daName: daInfo.damName, 793 daName: currTableData.value.daName,
819 damGuid: daInfo.guid, 794 damGuid: currTableData.value.damGuid,
820 costAssessmentFile: info.costAssessmentFile?.map(file => { 795 costAssessmentFile: info.costAssessmentFile?.map(file => {
821 return { 796 return {
822 name: file.name, 797 name: file.name,
...@@ -829,43 +804,101 @@ const dialogBtnClick = (btn, info) => { ...@@ -829,43 +804,101 @@ const dialogBtnClick = (btn, info) => {
829 url: file.url 804 url: file.url
830 } 805 }
831 }) || [], 806 }) || [],
832 qualityScore: info.qualityScore, 807 qualityScore: info.qualityScore || null,
833 evaluationRangeStart: info.evaluationRange ? info.evaluationRange[0] : null, 808 evaluationRangeStart: info.evaluationRange ? info.evaluationRange[0] : null,
834 evaluationRangeEnd: info.evaluationRange ? info.evaluationRange[1] : null, 809 evaluationRangeEnd: info.evaluationRange ? info.evaluationRange[1] : null,
835 evaluationNote: info.evaluationNote, 810 evaluationNote: info.evaluationNote || null,
836 evaluationAgencyGuid: resUser.data?.tenantGuid, 811 evaluationAgencyGuid: resUser.data?.tenantGuid,
812 }).then((res: any) => {
813 reSubmitPromise.value = null;
814 if (res?.code == proxy.$passCode) {
815 ElMessage.success('该资产价值评估重新提交成功');
816 dialogInfo.value.visible = false;
817 page.value.curr = 1;
818 getTableData();
819 formItems.value[4].placeholder = `本次评估数据资产总体质量得分为**分\n准确性:\n一致性:\n可访问性:\n规范性:\n完整性:`;
820 } else {
821 ElMessage.error(res.msg);
822 }
823 })
824 } else {
825 if (savePromise.value) {
826 return;
837 } 827 }
838 } 828 let params: any = {};
839 console.log('daInfo', daInfo, info); 829 let daInfo = assetListData.value.find(a => a.guid == info.registerGuid);
840 savePromise.value = saveCostAssess(params).then((res: any) => { 830 if (daInfo.qualityEvaluationGuid) {
841 savePromise.value = null; 831 //通过质量评估发起资产申请
842 if (res?.code == proxy.$passCode) { 832 params = {
843 ElMessage.success('价值评估发起成功'); 833 immediateApprove: true,
844 dialogInfo.value.visible = false; 834 tenantGuid: userData.tenantGuid,
845 page.value.curr = 1; 835 daName: daInfo.damName,
846 getTableData(); 836 damGuid: daInfo.guid,
837 costAssessmentFile: info.costAssessmentFile?.map(file => {
838 return {
839 name: file.name,
840 url: file.url
841 }
842 }) || [],
843 evaluationAgencyGuid: resUser.data?.tenantGuid,
844 }
847 } else { 845 } else {
848 ElMessage.error(res.msg); 846 //未通过质量评估发起资产申请
847 params = {
848 immediateApprove: true,
849 tenantGuid: userData.tenantGuid,
850 daName: daInfo.damName,
851 damGuid: daInfo.guid,
852 costAssessmentFile: info.costAssessmentFile?.map(file => {
853 return {
854 name: file.name,
855 url: file.url
856 }
857 }) || [],
858 evaluationFile: info.evaluationFile?.map(file => {
859 return {
860 name: file.name,
861 url: file.url
862 }
863 }) || [],
864 qualityScore: info.qualityScore,
865 evaluationRangeStart: info.evaluationRange ? info.evaluationRange[0] : null,
866 evaluationRangeEnd: info.evaluationRange ? info.evaluationRange[1] : null,
867 evaluationNote: info.evaluationNote,
868 evaluationAgencyGuid: resUser.data?.tenantGuid,
869 }
849 } 870 }
850 }) 871 console.log('daInfo', daInfo, info);
872 savePromise.value = saveCostAssess(params).then((res: any) => {
873 savePromise.value = null;
874 if (res?.code == proxy.$passCode) {
875 ElMessage.success('价值评估发起成功');
876 dialogInfo.value.visible = false;
877 page.value.curr = 1;
878 getTableData();
879 } else {
880 ElMessage.error(res.msg);
881 }
882 })
883 }
884 } else {
885 ElMessage.error(res.msg);
851 } 886 }
887 });
888 })
889 }
890 if (deploymentId.value) {
891 submitFunc();
892 } else {
893 getCamundaDeploymentId('10019', userData.tenantGuid, userData.staffGuid).then((res: any) => {
894 if (res.code == proxy.$passCode) {
895 deploymentId.value = res.data;
896 submitFunc();
852 } else { 897 } else {
853 ElMessage.error(res.msg); 898 proxy.$ElMessage.error(res.msg);
854 } 899 }
855 }); 900 })
856 }) 901 }
857 }
858 if (deploymentId.value) {
859 submitFunc();
860 } else {
861 getCamundaDeploymentId('10019', userData.tenantGuid, userData.staffGuid).then((res: any) => {
862 if (res.code == proxy.$passCode) {
863 deploymentId.value = res.data;
864 submitFunc();
865 } else {
866 proxy.$ElMessage.error(res.msg);
867 }
868 })
869 } 902 }
870 } else if (btn.value == 'cancel') { 903 } else if (btn.value == 'cancel') {
871 dialogInfo.value.visible = false; 904 dialogInfo.value.visible = false;
...@@ -1042,7 +1075,7 @@ const passCommonDialogInfo = ref({ ...@@ -1042,7 +1075,7 @@ const passCommonDialogInfo = ref({
1042 }, 1075 },
1043 type: '', 1076 type: '',
1044 contents: [ 1077 contents: [
1045 { 1078 {
1046 type: 'form', 1079 type: 'form',
1047 title: '', 1080 title: '',
1048 formInfo: { 1081 formInfo: {
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!