ef2180e5 by lihua

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

1 parent 9aa44b3a
...@@ -64,3 +64,9 @@ export const isMyFirstNode = (params) => request({ ...@@ -64,3 +64,9 @@ export const isMyFirstNode = (params) => request({
64 method: 'post', 64 method: 'post',
65 data: params 65 data: params
66 }) 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',
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,17 +138,31 @@ const getTableData = () => { ...@@ -123,17 +138,31 @@ 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 }
150 if (needApprovePromise.value) {
151 return;
152 }
153 needApprovePromise.value = isNeedApprove({ funcCode: 'ZCZLPJ' }).then((res1: any) => {
154 needApprovePromise.value = null;
155 if (res1.code == proxy.$passCode) {
156 needApprove.value = res1.data;
131 formItems.value[0].visible = true; 157 formItems.value[0].visible = true;
132 formItems.value[0].default = ''; 158 formItems.value[0].default = '';
133 formItems.value[1].visible = true; 159 formItems.value[1].visible = !needApprove.value;
134 formItems.value[1].default = []; 160 formItems.value[1].default = '';
161 formItems.value[2].visible = true;
162 formItems.value[2].default = [];
135 dialogInfo.value.visible = true; 163 dialogInfo.value.visible = true;
136 dialogInfo.value.type = ''; 164 dialogInfo.value.type = '';
165 if (needApprove.value) {
137 getCamundaDeploymentId('10018', userData.tenantGuid, userData.staffGuid).then((res: any) => { 166 getCamundaDeploymentId('10018', userData.tenantGuid, userData.staffGuid).then((res: any) => {
138 if (res.code == proxy.$passCode) { 167 if (res.code == proxy.$passCode) {
139 deploymentId.value = res.data; 168 deploymentId.value = res.data;
...@@ -142,6 +171,11 @@ const handleCreate = () => { ...@@ -142,6 +171,11 @@ const handleCreate = () => {
142 proxy.$ElMessage.error(res.msg); 171 proxy.$ElMessage.error(res.msg);
143 } 172 }
144 }) 173 })
174 }
175 } else {
176 proxy.$ElMessage.error(res1.msg);
177 }
178 })
145 } 179 }
146 180
147 const page = ref({ 181 const page = ref({
...@@ -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") {
276 isNeedApprove({ funcCode: 'ZCZLPJ' }).then((res1: any) => {
277 if (res1.code == proxy.$passCode) {
278 needApprove.value = res1.data;
279 formItems.value[0].visible = false;
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;
236 dialogInfo.value.visible = true; 285 dialogInfo.value.visible = true;
237 dialogInfo.value.type = 'reSubmit'; 286 dialogInfo.value.type = 'reSubmit';
238 formItems.value[0].visible = false; 287 } else {
239 formItems.value[0].default = row.registerGuid; 288 proxy.$ElMessage.error(res1.msg);
240 formItems.value[1].default = row.qualityEvaluationFile || []; 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,6 +503,62 @@ const dialogInfo = ref({ ...@@ -439,6 +503,62 @@ 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') {
506 if (!needApprove.value) {
507 // 不需要走流程审批的提交
508 dialogInfo.value.footer.btns[1].loading = true;
509 if (dialogInfo.value.type == 'reSubmit') {
510 updatQuality({
511 guid: currTableData.value.guid,
512 tenantGuid: userData.tenantGuid,
513 damGuid: currTableData.value.damGuid,
514 daName: currTableData.value.daName,
515 immediateApprove: true,
516 evaluationAgencyGuid: info.evaluationAgencyGuid,
517 qualityEvaluationFile: info.qualityEvaluationFile?.map(file => {
518 return {
519 name: file.name,
520 url: file.url
521 }
522 }) || []
523 }).then((res: any) => {
524 dialogInfo.value.footer.btns[1].loading = false;
525 if (res?.code == proxy.$passCode) {
526 ElMessage.success('该资产质量评价重新提交成功');
527 dialogInfo.value.visible = false;
528 page.value.curr = 1;
529 getTableData();
530 } else {
531 ElMessage.error(res.msg);
532 }
533 })
534 } else {
535 let daInfo = assetListData.value.find(a => a.guid == info.damGuid);
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) => {
549 dialogInfo.value.footer.btns[1].loading = false;
550 if (res?.code == proxy.$passCode) {
551 ElMessage.success('质量评价发起成功');
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 // 需要走流程的审批功能。
442 dialogInfo.value.footer.btns[1].loading = true; 562 dialogInfo.value.footer.btns[1].loading = true;
443 let submitFunc = () => { 563 let submitFunc = () => {
444 getProcessNodesPromise({ 564 getProcessNodesPromise({
...@@ -523,6 +643,7 @@ const dialogBtnClick = (btn, info) => { ...@@ -523,6 +643,7 @@ const dialogBtnClick = (btn, info) => {
523 } 643 }
524 }) 644 })
525 } 645 }
646 }
526 } else if (btn.value == 'cancel') { 647 } else if (btn.value == 'cancel') {
527 dialogInfo.value.visible = false; 648 dialogInfo.value.visible = false;
528 } 649 }
......
...@@ -113,7 +113,7 @@ const getDetailInfo = () => { ...@@ -113,7 +113,7 @@ const getDetailInfo = () => {
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,27 +152,40 @@ const getTableData = () => { ...@@ -174,27 +152,40 @@ 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) {
165 return;
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完整性:`;
183 formItems.value[0].visible = true; 172 formItems.value[0].visible = true;
184 formItems.value[0].default = ''; 173 formItems.value[0].default = '';
185 formItems.value[1].visible = true; 174 formItems.value[1].visible = !needApprove.value;
186 formItems.value[1].default = []; 175 formItems.value[1].default = '';
187 formItems.value[2].visible = false; 176 formItems.value[2].visible = true;
188 formItems.value[2].default = ''; 177 formItems.value[2].default = [];
189 formItems.value[3].visible = false; 178 formItems.value[3].visible = false;
190 formItems.value[3].default = ''; 179 formItems.value[3].default = '';
191 formItems.value[4].visible = false; 180 formItems.value[4].visible = false;
192 formItems.value[4].default = ''; 181 formItems.value[4].default = '';
193 formItems.value[5].visible = false; 182 formItems.value[5].visible = false;
194 formItems.value[5].default = []; 183 formItems.value[5].default = '';
184 formItems.value[6].visible = false;
185 formItems.value[6].default = [];
195 dialogInfo.value.visible = true; 186 dialogInfo.value.visible = true;
196 dialogInfo.value.type = ''; 187 dialogInfo.value.type = '';
197 if (!deploymentId.value) { 188 if (needApprove.value) {
198 getCamundaDeploymentId('10019', userData.tenantGuid, userData.staffGuid).then((res: any) => { 189 getCamundaDeploymentId('10019', userData.tenantGuid, userData.staffGuid).then((res: any) => {
199 if (res.code == proxy.$passCode) { 190 if (res.code == proxy.$passCode) {
200 deploymentId.value = res.data; 191 deploymentId.value = res.data;
...@@ -204,6 +195,10 @@ const handleCreate = () => { ...@@ -204,6 +195,10 @@ const handleCreate = () => {
204 } 195 }
205 }) 196 })
206 } 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 // formItems.value[5].visible = true;
304 // formItems.value[0].visible = false;
305 // formItems.value[0].default = row.damGuid;
306 // formItems.value[1].default = row.costAssessmentFile || [];
307 // dialogInfo.value.type = 'reSubmit';
308 // dialogInfo.value.visible = true;
309 // } else {
310 // formItems.value[2].visible = false;
311 // formItems.value[3].visible = false;
312 // formItems.value[4].visible = false;
313 // formItems.value[5].visible = false;
314 // formItems.value[0].visible = false;
315 // formItems.value[0].default = row.damGuid;
316 // formItems.value[1].default = row.costAssessmentFile || [];
317 // formItems.value[2].default = row.qualityScore;
318 // formItems.value[3].default = row.evaluationRangeStart && row.evaluationRangeEnd ? [row.evaluationRangeStart, row.evaluationRangeEnd] : '';
319 // formItems.value[4].default = row.evaluationNote;
320 // formItems.value[5].default = row.evaluationFile || [];
321 // dialogInfo.value.type = 'reSubmit';
322 // dialogInfo.value.visible = true;
323 // }
324 if (row.qualityEvaluationGuid) { 303 if (row.qualityEvaluationGuid) {
325 formItems.value[2].visible = false;
326 formItems.value[3].visible = false; 304 formItems.value[3].visible = false;
327 formItems.value[4].visible = false; 305 formItems.value[4].visible = false;
328 formItems.value[5].visible = false; 306 formItems.value[5].visible = false;
307 formItems.value[6].visible = false;
329 formItems.value[0].visible = false; 308 formItems.value[0].visible = false;
330 formItems.value[0].default = row.damGuid; 309 formItems.value[0].default = row.damGuid;
331 formItems.value[1].default = row.costAssessmentFile || []; 310 formItems.value[1].visible = !needApprove.value;
311 formItems.value[1].default = row.evaluationAgencyGuid;
312 formItems.value[2].default = row.costAssessmentFile || [];
332 // formItems.value[2].default = row.qualityScore; 313 // formItems.value[2].default = row.qualityScore;
333 formItems.value[3].default = row.evaluationRangeStart && row.evaluationRangeEnd ? [row.evaluationRangeStart, row.evaluationRangeEnd] : ''; 314 formItems.value[5].default = row.evaluationRangeStart && row.evaluationRangeEnd ? [row.evaluationRangeStart, row.evaluationRangeEnd] : '';
334 // formItems.value[4].default = row.evaluationNote; 315 // formItems.value[4].default = row.evaluationNote;
335 // formItems.value[5].default = row.evaluationFile || []; 316 // formItems.value[5].default = row.evaluationFile || [];
336 dialogInfo.value.type = 'reSubmit'; 317 dialogInfo.value.type = 'reSubmit';
337 dialogInfo.value.visible = true; 318 dialogInfo.value.visible = true;
338 } 319 }
339 if (!row.qualityEvaluationGuid) { 320 if (!row.qualityEvaluationGuid) {
340 formItems.value[2].visible = true;
341 formItems.value[3].visible = true; 321 formItems.value[3].visible = true;
342 formItems.value[4].visible = true; 322 formItems.value[4].visible = true;
343 formItems.value[5].visible = true; 323 formItems.value[5].visible = true;
324 formItems.value[6].visible = true;
344 formItems.value[0].visible = false; 325 formItems.value[0].visible = false;
345 formItems.value[0].default = row.damGuid; 326 formItems.value[0].default = row.damGuid;
346 formItems.value[1].default = row.costAssessmentFile || []; 327 formItems.value[1].visible = !needApprove.value;
347 formItems.value[2].default = changeNum(row.qualityScore || 0, 2); 328 formItems.value[1].default = row.evaluationAgencyGuid;
348 formItems.value[3].default = row.evaluationRangeStart && row.evaluationRangeEnd ? [row.evaluationRangeStart, row.evaluationRangeEnd] : ''; 329 formItems.value[2].default = row.costAssessmentFile || [];
349 formItems.value[4].default = row.evaluationNote; 330 formItems.value[3].default = changeNum(row.qualityScore || 0, 2);
350 formItems.value[5].default = row.evaluationFile || []; 331 formItems.value[4].default = row.evaluationRangeStart && row.evaluationRangeEnd ? [row.evaluationRangeStart, row.evaluationRangeEnd] : '';
332 formItems.value[5].default = row.evaluationNote;
333 formItems.value[6].default = row.evaluationFile || [];
351 dialogInfo.value.type = 'reSubmit'; 334 dialogInfo.value.type = 'reSubmit';
352 dialogInfo.value.visible = true; 335 dialogInfo.value.visible = true;
353 } 336 }
354 337 } else {
338 proxy.$ElMessage.error(res1.msg);
339 }
340 });
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) {
698 qualityEvaluationGuid = item.qualityEvaluationGuid;
699 } 632 }
700 }); 633 let qualityEvaluationGuid = assetListData.value.find(item => item.guid == val)?.qualityEvaluationGuid;
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,6 +680,101 @@ const reSubmitPromise: any = ref(null); ...@@ -743,6 +680,101 @@ 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') {
683 if (!needApprove.value) {
684 dialogInfo.value.footer.btns[1].loading = true;
685 if (dialogInfo.value.type == 'reSubmit') {
686 updateCostAssess({
687 guid: currTableData.value.guid,
688 immediateApprove: true,
689 tenantGuid: userData.tenantGuid,
690 daName: currTableData.value.daName,
691 damGuid: currTableData.value.damGuid,
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
735 }
736 }) || [],
737 evaluationAgencyGuid: info.evaluationAgencyGuid,
738 }
739 } else {
740 //未通过质量评估发起资产申请
741 params = {
742 immediateApprove: true,
743 tenantGuid: userData.tenantGuid,
744 daName: daInfo.damName,
745 damGuid: daInfo.guid,
746 costAssessmentFile: info.costAssessmentFile?.map(file => {
747 return {
748 name: file.name,
749 url: file.url
750 }
751 }) || [],
752 evaluationFile: info.evaluationFile?.map(file => {
753 return {
754 name: file.name,
755 url: file.url
756 }
757 }) || [],
758 qualityScore: info.qualityScore,
759 evaluationRangeStart: info.evaluationRange ? info.evaluationRange[0] : null,
760 evaluationRangeEnd: info.evaluationRange ? info.evaluationRange[1] : null,
761 evaluationNote: info.evaluationNote,
762 evaluationAgencyGuid: info.evaluationAgencyGuid,
763 }
764 }
765 saveCostAssess(params).then((res: any) => {
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 {
746 let submitFunc = () => { 778 let submitFunc = () => {
747 getProcessNodesPromise({ 779 getProcessNodesPromise({
748 deploymentId: deploymentId.value, 780 deploymentId: deploymentId.value,
...@@ -867,6 +899,7 @@ const dialogBtnClick = (btn, info) => { ...@@ -867,6 +899,7 @@ const dialogBtnClick = (btn, info) => {
867 } 899 }
868 }) 900 })
869 } 901 }
902 }
870 } else if (btn.value == 'cancel') { 903 } else if (btn.value == 'cancel') {
871 dialogInfo.value.visible = false; 904 dialogInfo.value.visible = false;
872 } 905 }
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!