c8fc6251 by lihua

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

1 parent 20136652
...@@ -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">
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!