cb785158 by lihua

数据申请接口联调

1 parent 7a4867d3
...@@ -331,8 +331,8 @@ export const getRegisterCatalogDetailGuids = (params) => request({ ...@@ -331,8 +331,8 @@ export const getRegisterCatalogDetailGuids = (params) => request({
331 }) 331 })
332 332
333 /** 获取资产目录基本信息的详情 */ 333 /** 获取资产目录基本信息的详情 */
334 export const getRegisterCatalogDetail = (params) => request({ 334 export const getRegisterCatalogDetail = (params, isTds = false) => request({
335 url: `${import.meta.env.VITE_API_NEW_PORTAL}/dam-catalog-table/detail`, 335 url: isTds ? `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/connector-invoke/tds-dam-detail?damGuid=${params.guid}` : `${import.meta.env.VITE_API_NEW_PORTAL}/dam-catalog-table/detail`,
336 method: 'get', 336 method: 'get',
337 params 337 params
338 }); 338 });
...@@ -590,4 +590,47 @@ export const getProductCategoryList = (params) => request({ ...@@ -590,4 +590,47 @@ export const getProductCategoryList = (params) => request({
590 url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/connector-invoke/tds-grounding-page-list`, 590 url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/connector-invoke/tds-grounding-page-list`,
591 method: 'post', 591 method: 'post',
592 data: params 592 data: params
593 })
594
595 /** 获取产品目录中的产品基本信息的详情,包括其它连接器 */
596 export const getTdsRegisterCatalogDetail = (damGuid) => request({
597 url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/connector-invoke/tds-dam-detail?damGuid=${damGuid}`,
598 method: 'get'
599 });
600
601 /** ----------------------------- 提供方进行数据申请接口联调 ---------------------------------- */
602
603 export const getDataApplyPageList = (params) => request({
604 url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/data-application/page-list`,
605 method: 'post',
606 data: params
607 })
608
609 export const saveDataApply = (params) => request({
610 url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/data-application/save`,
611 method: 'post',
612 data: params
613 })
614
615 export const updateDataApply = (params) => request({
616 url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/data-application/update`,
617 method: 'put',
618 data: params
619 })
620
621 export const updateDataApplyState = (params) => request({
622 url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/data-application/update-state`,
623 method: 'post',
624 data: params
625 })
626
627 export const deleteDataApply = (params) => request({
628 url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/data-application/delete`,
629 method: 'delete',
630 data: params
631 })
632
633 export const getDataApplyDetail = (guid) => request({
634 url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/data-application/detail?guid=${guid}`,
635 method: 'get'
593 }) 636 })
...\ No newline at end of file ...\ No newline at end of file
......
1 <template> 1 <template>
2 <div class="container_wrap full" v-loading="fullscreenLoading"> 2 <div class="container_wrap full" v-loading="fullscreenLoading">
3 <div class="content_main"> 3 <div class="content_main">
4 <ContentWrap id="id-baseInfo" title="数据申请信息" description="" :isExpand="baseInfoExpand" :expand-swicth="true" 4 <div v-if="detailInfo.bizApproveState"
5 class="mb16" @expand="(v) => baseInfoExpand = v"> 5 :class="['panel_wrap', 'results_panel', detailInfo.bizApproveState == 'Y' ? 'success' : ((detailInfo.bizApproveState == 'R' || detailInfo.bizApproveState == 'E') ? 'reject' : (detailInfo.bizApproveState == 'C' ? 'revoke' : 'audit'))]">
6 <div class="panel_header">
7 <div class="header_title" v-if="detailInfo.bizApproveState == 'Y'">
8 <el-icon class="title-icon">
9 <svg-icon name="icon-success" />
10 </el-icon>
11 <span class="title_text">审批通过</span>
12 </div>
13 <div class="header_title" v-else-if="detailInfo.bizApproveState == 'R'">
14 <el-icon class="title-icon">
15 <CircleCloseFilled />
16 </el-icon>
17 <span class="title_text">审批被驳回</span>
18 </div>
19 <div class="header_title" v-else-if="detailInfo.bizApproveState == 'A'">
20 <el-icon class="title-icon">
21 <svg-icon name="icon-audit" />
22 </el-icon>
23 <span class="title_text">审批中</span>
24 </div>
25 <div class="header_title" v-else-if="detailInfo.bizApproveState == 'C'">
26 <el-icon class="title-icon">
27 <svg-icon name="icon-revoke" />
28 </el-icon>
29 <span class="title_text">已撤销</span>
30 </div>
31 </div>
32 <div class="panel_body" v-if="detailInfo.bizApproveState == 'R'" style="padding: 0px 16px 10px;">
33 <div class="results_list">
34 <div class="list_item">
35 <span class="item_label">审批意见:</span>
36 <span class="item_value">{{ detailInfo?.applicationApproveRSVO?.approveSuggest || '--' }}</span>
37 </div>
38 </div>
39 </div>
40 </div>
41 <ContentWrap id="id-baseInfo" title="数据申请信息" description="" :expand-swicth="false">
6 <div class="list_panel"> 42 <div class="list_panel">
43 <div v-if="!isDataUse" class="list_item is_block" style="font-weight: 600;">
44 <span class="item_label">数据申请方:</span>
45 <span class="item_value">{{ detailInfo.tenantName || '--' }}</span>
46 </div>
7 <div class="list_item"> 47 <div class="list_item">
8 <span class="item_label">产品名称:</span> 48 <span class="item_label">产品名称:</span>
9 <span class="item_value link" @click="viewProductDetail"> 49 <span class="item_value link" @click="viewProductDetail">
...@@ -13,7 +53,8 @@ ...@@ -13,7 +53,8 @@
13 </div> 53 </div>
14 <div class="list_item"> 54 <div class="list_item">
15 <span class="item_label">产品编号:</span> 55 <span class="item_label">产品编号:</span>
16 <span class="item_value">{{ detailInfo.productCode || '--' }}</span> 56 <span class="item_value"><ellipsis-tooltip :content="detailInfo.productCode || '--'"
57 class-name="w100f mr8-i" :refName="'tooltipOver' + 'productCode'"></ellipsis-tooltip></span>
17 </div> 58 </div>
18 <div class="list_item"> 59 <div class="list_item">
19 <span class="item_label">资产类型:</span> 60 <span class="item_label">资产类型:</span>
...@@ -21,32 +62,34 @@ ...@@ -21,32 +62,34 @@
21 </div> 62 </div>
22 <div class="list_item"> 63 <div class="list_item">
23 <span class="item_label">预计使用期限:</span> 64 <span class="item_label">预计使用期限:</span>
24 <span class="item_value">{{ detailInfo.damTypeName || '--' }}</span> 65 <span class="item_value">{{ detailInfo.expirationStartDate ?
66 (Moment(detailInfo.expirationStartDate).format('YYYY-MM-DD') + '至' +
67 Moment(detailInfo.expirationEndDate).format('YYYY-MM-DD')) : '--' }}</span>
25 </div> 68 </div>
26 <div class="list_item"> 69 <div class="list_item">
27 <span class="item_label">数据范围:</span> 70 <span class="item_label">数据范围:</span>
28 <span class="item_value">{{ detailInfo.damTypeName || '--' }}</span> 71 <span class="item_value">{{ detailInfo.startDataRange ?
72 (Moment(detailInfo.startDataRange).format('YYYY-MM-DD') + '至' +
73 Moment(detailInfo.endDataRange).format('YYYY-MM-DD')) : '--' }}</span>
29 </div> 74 </div>
30 <div class="list_item"> 75 <div class="list_item">
31 <span class="item_label">产品发布机构:</span> 76 <span class="item_label">产品发布机构:</span>
32 <span class="item_value">{{ detailInfo.productPublisherName || '--' }}</span> 77 <span class="item_value"><ellipsis-tooltip :content="detailInfo.issuingName || '--'"
78 class-name="w100f mr8-i" :refName="'tooltipOver' + 'issuingName'"></ellipsis-tooltip></span>
33 </div> 79 </div>
34 <div class="list_item is_block"> 80 <div class="list_item is_block">
35 <span class="item_label">数据粒度说明:</span> 81 <span class="item_label">数据粒度说明:</span>
36 <span class="item_value">{{ detailInfo.description || '--' }}</span> 82 <span class="item_value">{{ detailInfo.dataGranularityDescription || '--' }}</span>
37 </div> 83 </div>
38 <div class="list_item is_block"> 84 <div class="list_item is_block">
39 <span class="item_label">使用场景描述:</span> 85 <span class="item_label">使用场景描述:</span>
40 <span class="item_value">{{ detailInfo.description || '--' }}</span> 86 <span class="item_value">{{ detailInfo.useScenarioDescription || '--' }}</span>
41 </div> 87 </div>
42 </div> 88 </div>
43 </ContentWrap> 89 </ContentWrap>
44 <ContentWrap id="id-approveInfo" title="流程审批" expandSwicth style="margin-top: 15px" :isExpand="expandApprove" 90 <!-- <ContentWrap id="id-approveInfo" title="审批信息" :expandSwicth="false" style="margin-top: 15px" >
45 @expand="(v) => expandApprove = v"> 91 <Table :table-info="approveTableInfo"></Table>
46 <ApprovalProcess ref="approvalProcessRef" v-if="deploymentId" :deploymentId="deploymentId" 92 </ContentWrap> -->
47 :processInstanceId="processInstanceId">
48 </ApprovalProcess>
49 </ContentWrap>
50 </div> 93 </div>
51 <div class="tool_btns"> 94 <div class="tool_btns">
52 <div class="btns"> 95 <div class="btns">
...@@ -54,38 +97,73 @@ ...@@ -54,38 +97,73 @@
54 }}</el-button> 97 }}</el-button>
55 </div> 98 </div>
56 </div> 99 </div>
100 <Dialog :dialogInfo="passDialogInfo" @btnClick="passDialogBtnClick" />
101 <Dialog :dialogInfo="rejectDialogInfo" @btnClick="rejectDialogBtnClick" />
57 </div> 102 </div>
58 </template> 103 </template>
59 104
60 <script lang="ts" setup name="productApplicationEdit"> 105 <script lang="ts" setup name="productApplicationEdit">
61 import useUserStore from "@/store/modules/user"; 106 import useUserStore from "@/store/modules/user";
107 import { getDataApplyDetail, updateDataApplyState } from "@/api/modules/dataAsset";
108 import { CircleCloseFilled } from '@element-plus/icons-vue';
109 import Moment from 'moment';
110 import { USERROLE } from "@/utils/enum";
62 111
63 const { proxy } = getCurrentInstance() as any; 112 const { proxy } = getCurrentInstance() as any;
64 const userStore = useUserStore(); 113 const userStore = useUserStore();
65 const route = useRoute(); 114 const route = useRoute();
66 const router = useRouter(); 115 const router = useRouter();
67 const fullPath = route.fullPath; 116 const fullPath = route.fullPath;
117 const userData = JSON.parse(userStore.userData);
68 118
69 const fullscreenLoading = ref(false); 119 const fullscreenLoading = ref(false);
70 const baseInfoExpand = ref(true);
71 const expandApprove = ref(true);
72
73 const deploymentId = ref('');
74 const processInstanceId = ref('');
75 120
76 const detailInfo: any = ref({}); 121 const detailInfo: any = ref({});
77 122
78 const viewProductDetail = () => { 123 const viewProductDetail = () => {
79 // TODO 124 router.push({
125 name: 'productSortCatalogDetail',
126 query: {
127 guid: detailInfo.value.damGuid, // 产品GUID
128 type: 'detail', // 查看类型
129 foundMode: 'tdsUse', // 发现模式
130 name: detailInfo.value.damName, // 产品名称
131 }
132 });
80 } 133 }
81 134
135 /** 是否是数据提供方 */
136 const isDataUse = computed(() => {
137 return localStorage.getItem('userRole') == USERROLE.USE;
138 })
82 139
83 const toolBtns: any = computed(() => { 140 const toolBtns: any = computed(() => {
84 let btnsArr: any = [{ 141 if (isDataUse.value) {
85 label: "关闭", value: "cancel", plain: true 142 let btnsArr: any = [{
86 }]; 143 label: "关闭", value: "cancel", plain: true
87 // TODO,资产运营平台TODO 144 }];
88 return btnsArr; 145 return btnsArr;
146 } else {
147 let btnsArr: any = [{
148 label: "关闭", value: "cancel", plain: true
149 }];
150 // 获取审批人。
151 const approveVO = detailInfo.value.applicationApproveRSVO || {}
152 let approveState = approveVO.approveState || null;
153 let approveStaffGuid = approveVO?.approveInstanceRSVOS?.[1]?.operator || '';
154 if (approveState == 'A' && approveStaffGuid == userData.tenantGuid) {
155 btnsArr.push(...[{
156 label: "通过", value: "pass", click: () => {
157 passDialogInfo.value.visible = true;
158 }
159 }, {
160 label: "驳回", value: "reject", click: () => {
161 rejectDialogInfo.value.visible = true;
162 }
163 }])
164 }
165 return btnsArr;
166 }
89 }); 167 });
90 168
91 const btnClick = (btn: any) => { 169 const btnClick = (btn: any) => {
...@@ -105,14 +183,168 @@ const cancel = () => { ...@@ -105,14 +183,168 @@ const cancel = () => {
105 }); 183 });
106 } 184 }
107 185
186 onActivated(() => {
187 let tab: any = userStore.tabbar.find((tab: any) => tab.fullPath == fullPath);
188 if (tab) {
189 tab.meta.title = '数据申请详情-' + route.query.damName;
190 document.title = tab.meta.title;
191 };
192 })
193
194 const getDetail = () => {
195 fullscreenLoading.value = true;
196 getDataApplyDetail(route.query.guid).then((res: any) => {
197 fullscreenLoading.value = false;
198 if (res?.code == proxy.$passCode) {
199 detailInfo.value = res.data || {};
200 detailInfo.value.bizApproveState = detailInfo.value.applicationApproveRSVO?.approveState || detailInfo.value.approveState;
201 } else {
202 res?.msg && proxy.$ElMessage.error(res.msg);
203 }
204 })
205 }
206
108 onBeforeMount(() => { 207 onBeforeMount(() => {
109 208 getDetail();
110 }) 209 })
111 210
211 const passDialogInfo = ref({
212 visible: false,
213 size: 460,
214 direction: "column",
215 header: {
216 title: "通过",
217 },
218 type: '',
219 contents: [
220 {
221 type: 'form',
222 title: '',
223 formInfo: {
224 id: 'batch-pass-form',
225 items: [
226 {
227 label: '',
228 type: "textarea",
229 placeholder: "请填写通过理由(非必填)",
230 field: "approveSuggest",
231 clearable: true,
232 block: true,
233 col: 'margin_b_0',
234 }
235 ]
236 }
237 }
238 ],
239 footer: {
240 btns: [
241 { type: "default", label: "取消", value: "cancel" },
242 { type: "primary", label: "确定", value: "submit", loading: false },
243 ],
244 },
245 });
246
247 const passDialogBtnClick = (btn, info) => {
248 if (btn.value == 'submit') {
249 passDialogInfo.value.footer.btns[1].loading = true;
250 let params = {
251 guid: detailInfo.value.guid,
252 approveState: 'A',
253 approveSuggest: info.approveSuggest,
254 }
255 updateDataApplyState(params).then((res: any) => {
256 passDialogInfo.value.footer.btns[1].loading = false;
257 if (res?.code == proxy.$passCode) {
258 if (res.data) {
259 proxy.$ElMessage.success('审批成功');
260 passDialogInfo.value.visible = false;
261 getDetail();
262 } else {
263 proxy.$ElMessage.error('审批失败');
264 }
265 } else {
266 proxy.$ElMessage.error(res.msg);
267 }
268 }).catch(() => {
269 passDialogInfo.value.footer.btns[1].loading = false;
270 });
271 } else if (btn.value == 'cancel') {
272 passDialogInfo.value.visible = false;
273 }
274 };
275
276 const rejectDialogInfo = ref({
277 visible: false,
278 size: 460,
279 direction: "column",
280 header: {
281 title: "驳回",
282 },
283 type: '',
284 contents: [
285 {
286 type: 'form',
287 title: '',
288 formInfo: {
289 id: 'batch-reject-form',
290 items: [
291 {
292 label: '',
293 type: "textarea",
294 placeholder: "请填写驳回理由(必填)",
295 field: "approveSuggest",
296 clearable: true,
297 block: true,
298 col: 'margin_b_0',
299 }
300 ]
301 }
302 }
303 ],
304 footer: {
305 btns: [
306 { type: "default", label: "取消", value: "cancel" },
307 { type: "primary", label: "确定", value: "submit", loading: false },
308 ],
309 },
310 });
311
312 const rejectDialogBtnClick = (btn, info) => {
313 if (btn.value == 'submit') {
314 if (info.approveSuggest == '') {
315 proxy.$ElMessage.error('请填写驳回理由');
316 return
317 }
318 rejectDialogInfo.value.footer.btns[1].loading = true;
319 let params = {
320 guid: detailInfo.value.guid,
321 approveState: 'R',
322 approveSuggest: info.approveSuggest,
323 }
324 updateDataApplyState(params).then((res: any) => {
325 rejectDialogInfo.value.footer.btns[1].loading = false;
326 if (res?.code == proxy.$passCode) {
327 if (res.data) {
328 proxy.$ElMessage.success('驳回成功');
329 rejectDialogInfo.value.visible = false;
330 getDetail();
331 } else {
332 proxy.$ElMessage.error('驳回失败');
333 }
334 } else {
335 proxy.$ElMessage.error(res.msg);
336 }
337 }).catch(() => {
338 rejectDialogInfo.value.footer.btns[1].loading = false;
339 });
340 } else if (btn.value == 'cancel') {
341 rejectDialogInfo.value.visible = false;
342 }
343 };
344
112 </script> 345 </script>
113 346
114 <style lang="scss" scoped> 347 <style lang="scss" scoped>
115
116 .content_main { 348 .content_main {
117 height: calc(100% - 44px); 349 height: calc(100% - 44px);
118 padding: 16px; 350 padding: 16px;
...@@ -162,6 +394,138 @@ onBeforeMount(() => { ...@@ -162,6 +394,138 @@ onBeforeMount(() => {
162 } 394 }
163 } 395 }
164 396
397 .panel_wrap {
398
399 margin-bottom: 12px;
400
401 .panel_header {
402 .header_title {
403 height: 40px;
404 padding: 0 16px;
405 background-color: #fafafa;
406 box-shadow: 0 0 0 1px #e5e5e5;
407 display: flex;
408 align-items: center;
409 }
410
411 .title_text {
412 line-height: 22px;
413 font-size: 14px;
414 color: var(--el-color-regular);
415 font-weight: 600;
416 display: flex;
417 align-items: center;
418
419 .title_icon {
420 width: 26px;
421 height: 21px;
422 margin-right: 4px;
423 cursor: pointer;
424
425 &.active {
426 transform: rotate(90deg);
427 }
428 }
429 }
430 }
431
432 &.results_panel {
433 box-shadow: 0 0 0 1px #d9d9d9;
434
435 .panel_header {
436 .header_title {
437 background-color: transparent;
438 box-shadow: none;
439
440 .el-icon {
441 margin-right: 8px;
442 width: 20px;
443 height: 20px;
444
445 svg {
446 width: 100%;
447 height: 100%;
448 }
449 }
450 }
451 }
452
453 .panel_body {
454 padding-top: 0;
455 margin-top: 0;
456 box-shadow: none;
457
458 .results_list {
459 display: flex;
460
461 .list_item {
462 display: flex;
463 margin-bottom: 8px;
464 margin-right: 60px;
465 color: #666;
466
467 .item_value {
468 padding: 0 8px;
469 color: var(--el-color-regular);
470 }
471 }
472 }
473 }
474
475 &.success {
476 background-color: #F4FEF6;
477 box-shadow: 0 0 0 1px #4FA55D;
478
479 .panel_header {
480 .header_title {
481 .el-icon {
482 color: #4FA55D;
483 }
484 }
485 }
486 }
487
488 &.reject {
489 background-color: #FDF2F4;
490 box-shadow: 0 0 0 1px #E63E33;
491
492 .panel_header {
493 .header_title {
494 .el-icon {
495 color: #E63E33;
496 }
497 }
498 }
499 }
500
501 &.audit {
502 background-color: #FEFBF3;
503 box-shadow: 0 0 0 1px #F19E40;
504
505 .panel_header {
506 .header_title {
507 .el-icon {
508 color: #F19E40;
509 }
510 }
511 }
512 }
513
514 &.revoke {
515 background-color: #F5F5F5;
516 box-shadow: 0 0 0 1px #CCCCCC;
517
518 .panel_header {
519 .header_title {
520 .el-icon {
521 color: #666666;
522 }
523 }
524 }
525 }
526 }
527 }
528
165 .tool_btns { 529 .tool_btns {
166 display: flex; 530 display: flex;
167 justify-content: center; 531 justify-content: center;
......
1 <template> 1 <template>
2 <div class="container_wrap full" v-loading="fullscreenLoading"> 2 <div class="container_wrap full" v-loading="fullscreenLoading">
3 <div class="content_main"> 3 <div class="content_main">
4 <ContentWrap id="id-baseInfo" title="数据申请信息" description="" :isExpand="baseInfoExpand" :expand-swicth="true" 4 <ContentWrap id="id-baseInfo" title="数据申请信息" description="" :expand-swicth="false">
5 class="mb16" @expand="(v) => baseInfoExpand = v">
6 <Form ref="baseInfoFormRef" :itemList="baseInfoFormItems" formId="base-info-form" :rules="baseInfoFormRules" 5 <Form ref="baseInfoFormRef" :itemList="baseInfoFormItems" formId="base-info-form" :rules="baseInfoFormRules"
7 col="col3" /> 6 col="col3" />
8 </ContentWrap> 7 </ContentWrap>
9 <ContentWrap id="id-approveInfo" title="流程审批" expandSwicth style="margin-top: 15px" :isExpand="expandApprove" 8 <!-- 数据申请是数据使用方向提供方发起的申请,没有流程审批 -->
9 <!-- <ContentWrap id="id-approveInfo" title="流程审批" expandSwicth style="margin-top: 15px" :isExpand="expandApprove"
10 @expand="(v) => expandApprove = v"> 10 @expand="(v) => expandApprove = v">
11 <ApprovalProcess ref="approvalProcessRef" v-if="deploymentId" :deploymentId="deploymentId" 11 <ApprovalProcess ref="approvalProcessRef" v-if="deploymentId" :deploymentId="deploymentId"
12 :processInstanceId="processInstanceId"> 12 :processInstanceId="processInstanceId">
13 </ApprovalProcess> 13 </ApprovalProcess>
14 </ContentWrap> 14 </ContentWrap> -->
15 </div> 15 </div>
16 <div class="bottom_tool_wrap"> 16 <div class="bottom_tool_wrap">
17 <el-button @click="cancel">取消</el-button> 17 <el-button @click="cancel">取消</el-button>
...@@ -22,12 +22,13 @@ ...@@ -22,12 +22,13 @@
22 </template> 22 </template>
23 23
24 <script lang="ts" setup name="productApplicationEdit"> 24 <script lang="ts" setup name="productApplicationEdit">
25 import { getCamundaDeploymentId } from "@/api/modules/workFlowService";
26 import { 25 import {
27 getRegisterCatalogDetail 26 getTdsRegisterCatalogDetail,
27 updateDataApply
28 } from "@/api/modules/dataAsset"; 28 } from "@/api/modules/dataAsset";
29 import useUserStore from "@/store/modules/user"; 29 import useUserStore from "@/store/modules/user";
30 import useDataProductApplicationStore from "@/store/modules/productApplication"; 30 import useDataProductApplicationStore from "@/store/modules/productApplication";
31 import { saveDataApply, getDataApplyDetail } from "@/api/modules/dataAsset";
31 import { useValidator } from '@/hooks/useValidator'; 32 import { useValidator } from '@/hooks/useValidator';
32 const { required } = useValidator(); 33 const { required } = useValidator();
33 34
...@@ -41,11 +42,6 @@ const userData = JSON.parse(localStorage.userData); ...@@ -41,11 +42,6 @@ const userData = JSON.parse(localStorage.userData);
41 const fullPath = route.fullPath; 42 const fullPath = route.fullPath;
42 43
43 const fullscreenLoading = ref(false); 44 const fullscreenLoading = ref(false);
44 const baseInfoExpand = ref(true);
45 const expandApprove = ref(true);
46
47 const deploymentId = ref('');
48 const processInstanceId = ref('');
49 45
50 const baseInfoFormRef = ref(); 46 const baseInfoFormRef = ref();
51 47
...@@ -56,15 +52,15 @@ const baseInfoFormItems = ref([{ ...@@ -56,15 +52,15 @@ const baseInfoFormItems = ref([{
56 col: 'link', 52 col: 'link',
57 default: '-', 53 default: '-',
58 click: () => { 54 click: () => {
59 //TODO
60 debugger
61 router.push({ 55 router.push({
62 name: 'productDetail', 56 name: 'productSortCatalogDetail',
63 query: { 57 query: {
64 id: route.query.id, 58 guid: route.query.damGuid, // 产品GUID
65 type: 'view' 59 type: 'detail', // 查看类型
60 foundMode: 'tdsUse', // 发现模式
61 name: route.query.damName, // 产品名称
66 } 62 }
67 }) 63 });
68 } 64 }
69 }, 65 },
70 { 66 {
...@@ -86,7 +82,9 @@ const baseInfoFormItems = ref([{ ...@@ -86,7 +82,9 @@ const baseInfoFormItems = ref([{
86 { 82 {
87 label: "预计使用期限", 83 label: "预计使用期限",
88 type: "date-picker", 84 type: "date-picker",
89 field: "useDateRange", 85 format: 'YYYY-MM-DD',
86 valueFormat: 'YYYY-MM-DD',
87 field: "expirationRange",
90 default: null, 88 default: null,
91 placeholder: "开始时间~结束时间", 89 placeholder: "开始时间~结束时间",
92 clearable: true, 90 clearable: true,
...@@ -114,7 +112,9 @@ const baseInfoFormItems = ref([{ ...@@ -114,7 +112,9 @@ const baseInfoFormItems = ref([{
114 { 112 {
115 label: "数据范围", 113 label: "数据范围",
116 type: "date-picker", 114 type: "date-picker",
117 field: "useDataDateRange", 115 format: 'YYYY-MM-DD',
116 valueFormat: 'YYYY-MM-DD',
117 field: "dataRange",
118 default: null, 118 default: null,
119 placeholder: "开始时间~结束时间", 119 placeholder: "开始时间~结束时间",
120 clearable: true, 120 clearable: true,
...@@ -124,7 +124,7 @@ const baseInfoFormItems = ref([{ ...@@ -124,7 +124,7 @@ const baseInfoFormItems = ref([{
124 label: '产品发布机构', 124 label: '产品发布机构',
125 type: 'input', 125 type: 'input',
126 placeholder: '请输入', 126 placeholder: '请输入',
127 field: 'productPublisherName', 127 field: 'issuingName',
128 default: '', 128 default: '',
129 disabled: true 129 disabled: true
130 }, 130 },
...@@ -132,7 +132,7 @@ const baseInfoFormItems = ref([{ ...@@ -132,7 +132,7 @@ const baseInfoFormItems = ref([{
132 label: '数据粒度说明', 132 label: '数据粒度说明',
133 type: 'textarea', 133 type: 'textarea',
134 placeholder: '请输入需要的需求字段', 134 placeholder: '请输入需要的需求字段',
135 field: 'dataDescription', 135 field: 'dataGranularityDescription',
136 default: '', 136 default: '',
137 block: true, 137 block: true,
138 maxlength: 500, 138 maxlength: 500,
...@@ -143,7 +143,7 @@ const baseInfoFormItems = ref([{ ...@@ -143,7 +143,7 @@ const baseInfoFormItems = ref([{
143 label: '使用场景描述', 143 label: '使用场景描述',
144 type: 'textarea', 144 type: 'textarea',
145 placeholder: '请输入使用该数据产品的场景描述信息', 145 placeholder: '请输入使用该数据产品的场景描述信息',
146 field: 'useDescription', 146 field: 'useScenarioDescription',
147 default: '', 147 default: '',
148 block: true, 148 block: true,
149 maxlength: 500, 149 maxlength: 500,
...@@ -153,14 +153,14 @@ const baseInfoFormItems = ref([{ ...@@ -153,14 +153,14 @@ const baseInfoFormItems = ref([{
153 ]) 153 ])
154 154
155 const baseInfoFormRules = ref({ 155 const baseInfoFormRules = ref({
156 useDateRange: [{ 156 expirationRange: [{
157 type: 'array', required: true, message: '请选择预计使用期限', trigger: 'change', 157 type: 'array', required: true, message: '请选择预计使用期限', trigger: 'change',
158 }], 158 }],
159 useDataDateRange: [{ 159 dataRange: [{
160 type: 'array', required: true, message: '请选择数据范围', trigger: 'change', 160 type: 'array', required: true, message: '请选择数据范围', trigger: 'change',
161 }], 161 }],
162 dataDescription: [required('请输入数据粒度说明')], 162 dataGranularityDescription: [required('请输入数据粒度说明')],
163 useDescription: [required('请输入使用场景描述')] 163 useScenarioDescription: [required('请输入使用场景描述')]
164 }) 164 })
165 165
166 const cancel = () => { 166 const cancel = () => {
...@@ -174,30 +174,103 @@ const cancel = () => { ...@@ -174,30 +174,103 @@ const cancel = () => {
174 }); 174 });
175 } 175 }
176 176
177 const getSubmitParams = (isSubmit = false) => {
178 let formInline = baseInfoFormRef.value.formInline;
179 let params: any = {
180 ...formInline,
181 isSubmit: isSubmit ? 'Y' : 'N',
182 damGuid: route.query.damGuid || detailInfo.value.damGuid,
183 damName: route.query.damName || detailInfo.value.damName,
184 productCode: productDetail.value.productCode || detailInfo.value.productCode,
185 damType: productDetail.value.damType || detailInfo.value.damType,
186 issuingGuid: productDetail.value.rightMain || detailInfo.value.issuingGuid,
187 }
188 if (params.expirationRange?.length) {
189 params.expirationStartDate = params.expirationRange[0];
190 params.expirationEndDate = params.expirationRange[1];
191 }
192 delete params.expirationRange;
193 if (params.dataRange?.length) {
194 params.startDataRange = params.dataRange[0];
195 params.endDataRange = params.dataRange[1];
196 }
197 delete params.dataRange;
198 return params;
199 }
200
177 const save = () => { 201 const save = () => {
178 // 保存不检验。 202 // 保存不检验。
203 let submitParams = getSubmitParams(false);
204 if (route.query.guid) {
205 fullscreenLoading.value = true;
206 submitParams.guid = route.query.guid;
207 updateDataApply(submitParams).then((res: any) => {
208 fullscreenLoading.value = false;
209 if (res?.code == proxy.$passCode) {
210 proxy.$ElMessage.success('编辑保存成功');
211 userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath));
212 productApplicationStore.setIsRefresh(true);
213 router.push({
214 name: "productApplicationManage",
215 });
216 } else {
217 res?.msg && proxy.$ElMessage.error(res.msg);
218 }
219 })
220 } else {
221 fullscreenLoading.value = true;
222 saveDataApply(submitParams).then((res: any) => {
223 fullscreenLoading.value = false;
224 if (res?.code == proxy.$passCode) {
225 proxy.$ElMessage.success('保存成功');
226 userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath));
227 productApplicationStore.setIsRefresh(true);
228 router.push({
229 name: "productApplicationManage",
230 });
231 } else {
232 res?.msg && proxy.$ElMessage.error(res.msg);
233 }
234 })
235 }
179 } 236 }
180 237
181 const submit = () => { 238 const submit = () => {
182 baseInfoFormRef.value?.ruleFormRef?.validate().then((valid, errorItem) => { 239 baseInfoFormRef.value?.ruleFormRef?.validate().then((valid, errorItem) => {
183 if (valid) { 240 if (valid) {
184 let formInline = baseInfoFormRef.value.formInline; 241 let submitParams = getSubmitParams(true);
185 // fullscreenLoading.value = true; 242 if (route.query.guid) {
186 // listingSavePortal(params).then((res: any) => { 243 fullscreenLoading.value = true;
187 // fullscreenLoading.value = false; 244 submitParams.guid = route.query.guid;
188 // if (res?.code == proxy.$passCode) { 245 updateDataApply(submitParams).then((res: any) => {
189 // proxy.$ElMessage.success('提交审批成功'); 246 fullscreenLoading.value = false;
190 // userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath)); 247 if (res?.code == proxy.$passCode) {
191 // productApplicationStore.setIsRefresh(true); 248 proxy.$ElMessage.success('编辑提交审批成功');
192 // router.push({ 249 userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath));
193 // name: "productApplicationManage", 250 productApplicationStore.setIsRefresh(true);
194 // }); 251 router.push({
195 // } else { 252 name: "productApplicationManage",
196 // res?.msg && proxy.$ElMessage.error(res.msg); 253 });
197 // } 254 } else {
198 // }).catch((res) => { 255 res?.msg && proxy.$ElMessage.error(res.msg);
199 // fullscreenLoading.value = false; 256 }
200 // }); 257 })
258 } else {
259 fullscreenLoading.value = true;
260 saveDataApply(submitParams).then((res: any) => {
261 fullscreenLoading.value = false;
262 if (res?.code == proxy.$passCode) {
263 proxy.$ElMessage.success('提交审批成功');
264 userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath));
265 productApplicationStore.setIsRefresh(true);
266 router.push({
267 name: "productApplicationManage",
268 });
269 } else {
270 res?.msg && proxy.$ElMessage.error(res.msg);
271 }
272 })
273 }
201 } else { 274 } else {
202 var obj = Object.keys(errorItem); 275 var obj = Object.keys(errorItem);
203 baseInfoFormRef.value.ruleFormRef.scrollToField(obj[0]); 276 baseInfoFormRef.value.ruleFormRef.scrollToField(obj[0]);
...@@ -205,47 +278,70 @@ const submit = () => { ...@@ -205,47 +278,70 @@ const submit = () => {
205 }) 278 })
206 } 279 }
207 280
281 onMounted(() => {
282 })
283
208 onActivated(() => { 284 onActivated(() => {
209 let tab: any = userStore.tabbar.find((tab: any) => tab.fullPath == fullPath); 285 let tab: any = userStore.tabbar.find((tab: any) => tab.fullPath == fullPath);
210 let detailType = route.query.type; 286 let name = route.query.damName;
211 let name = route.query.name; 287 if (route.query.guid) {
212 if (tab) { 288 tab.meta.title = `数据申请编辑-${name}`;
213 switch (detailType) { 289 } else {
214 case 'edit': 290 tab.meta.title = `新增数据申请-${name}`;
215 tab.meta.title = `编辑-${name}`; 291 }
216 break; 292 document.title = tab.meta.title;
217 case 'redit':
218 tab.meta.title = `编辑-${name}`;
219 break;
220 default:
221 tab.meta.title = '新增数据申请';
222 }
223 document.title = tab.meta.title;
224 };
225 }) 293 })
226 294
295 /** 产品详情 */
296 const productDetail: any = ref({});
297
298 /** 数据申请详情 */
299 const detailInfo: any = ref({});
300
227 onBeforeMount(() => { 301 onBeforeMount(() => {
228 // getCamundaDeploymentId('10016', userData.tenantGuid, userData.staffGuid).then((res: any) => { 302 if (route.query.guid) {
229 // if (res.code == proxy.$passCode) { 303 fullscreenLoading.value = true;
230 // deploymentId.value = res.data; 304 getDataApplyDetail(route.query.guid).then((res: any) => {
231 // } else { 305 fullscreenLoading.value = false;
232 // proxy.$ElMessage.error(res.msg); 306 if (res?.code == proxy.$passCode) {
233 // } 307 detailInfo.value = res.data || {};
234 // }) 308 baseInfoFormItems.value.forEach((item: any) => {
235 fullscreenLoading.value = true; 309 item.default = detailInfo.value[item.field];
236 getRegisterCatalogDetail({ 310 if (item.field == 'expirationRange') {
237 guid: route.query.damGuid 311 item.default = detailInfo.value.expirationStartDate ? [detailInfo.value.expirationStartDate, detailInfo.value.expirationEndDate] : null;
238 }).then((res: any) => { 312 } else if (item.field == 'dataRange') {
239 fullscreenLoading.value = false; 313 item.default = detailInfo.value.startDataRange ? [detailInfo.value.startDataRange, detailInfo.value.endDataRange] : null;
240 if (res?.code == proxy.$passCode) { 314 }
241 let detail = res.data || {}; 315 })
242 baseInfoFormItems.value[0].default = <string>route.query.damName; 316 nextTick(() => {
243 baseInfoFormItems.value[1].default = detail.productCode; 317 const body = document.body;
244 baseInfoFormItems.value[2].default = detail.damTypeName; 318 const clickEvent = new MouseEvent('click', {
245 } else { 319 bubbles: true,
246 res?.msg && proxy.$ElMessage.error(res.msg); 320 cancelable: true,
247 } 321 view: window
248 }) 322 });
323 body.dispatchEvent(clickEvent);
324 })
325 } else {
326 res?.msg && proxy.$ElMessage.error(res.msg);
327 }
328 })
329 } else {
330 fullscreenLoading.value = true;
331 getTdsRegisterCatalogDetail(route.query.damGuid).then((res: any) => {
332 fullscreenLoading.value = false;
333 if (res?.code == proxy.$passCode) {
334 let detail = productDetail.value = res.data || {};
335 baseInfoFormItems.value[0].default = <string>route.query.damName;
336 baseInfoFormItems.value[1].default = detail.productCode;
337 baseInfoFormItems.value[2].default = detail.damTypeName;
338 let issuingNameItem = baseInfoFormItems.value.find(item => item.field == 'issuingName');
339 issuingNameItem && (issuingNameItem.default = detail.rightMainName || '--');
340 } else {
341 res?.msg && proxy.$ElMessage.error(res.msg);
342 }
343 })
344 }
249 }) 345 })
250 346
251 </script> 347 </script>
......
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
6 <div class="table_panel_wrap" :style="{ height: 'calc(100% - 48px)' }"> 6 <div class="table_panel_wrap" :style="{ height: 'calc(100% - 48px)' }">
7 <Table :tableInfo="tableInfo" @tablePageChange="tablePageChange" /> 7 <Table :tableInfo="tableInfo" @tablePageChange="tablePageChange" />
8 </div> 8 </div>
9 <Dialog :dialogInfo="passDialogInfo" @btnClick="passDialogBtnClick" />
10 <Dialog :dialogInfo="rejectDialogInfo" @btnClick="rejectDialogBtnClick" />
9 </div> 11 </div>
10 </template> 12 </template>
11 13
...@@ -13,14 +15,21 @@ ...@@ -13,14 +15,21 @@
13 import { commonPageConfig } from "@/components/PageNav"; 15 import { commonPageConfig } from "@/components/PageNav";
14 import TableTools from "@/components/Tools/table_tools.vue"; 16 import TableTools from "@/components/Tools/table_tools.vue";
15 import useUserStore from "@/store/modules/user"; 17 import useUserStore from "@/store/modules/user";
16 import { TableColumnWidth } from "@/utils/enum"; 18 import { TableColumnWidth, USERROLE } from "@/utils/enum";
17 import { getDamTypesList } from "@/api/modules/dataAsset"; 19 import { deleteDataApply, getDamTypesList, getDataApplyPageList, updateDataApplyState } from "@/api/modules/dataAsset";
20 import useDataProductApplicationStore from "@/store/modules/productApplication";
18 21
22 const productApplicationStore = useDataProductApplicationStore();
19 const { proxy } = getCurrentInstance() as any; 23 const { proxy } = getCurrentInstance() as any;
20 const router = useRouter(); 24 const router = useRouter();
21 const userStore = useUserStore(); 25 const userStore = useUserStore();
22 const userData = JSON.parse(userStore.userData); 26 const userData = JSON.parse(userStore.userData);
23 27
28 /** 是否是数据提供方 */
29 const isDataUse = computed(() => {
30 return localStorage.getItem('userRole') == USERROLE.USE;
31 })
32
24 const damTypes: any = ref([]); 33 const damTypes: any = ref([]);
25 const searchItemList: any = ref([ 34 const searchItemList: any = ref([
26 { 35 {
...@@ -78,11 +87,41 @@ const tableInfo = ref({ ...@@ -78,11 +87,41 @@ const tableInfo = ref({
78 label: "产品类型", field: "damTypeName", width: 100 87 label: "产品类型", field: "damTypeName", width: 100
79 }, 88 },
80 { 89 {
81 label: "审批状态", field: "approveState", type: "tag", width: TableColumnWidth.STATE, align: 'center' 90 label: "审批状态", field: "approveState", type: "tag", width: TableColumnWidth.STATE, align: 'center', getName: (scope) => {
91 const approveVO = scope.row.applicationApproveRSVO || {}
92 switch (approveVO.approveState) {
93 case 'N':
94 return '草稿中';
95 case 'A':
96 return '审批中';
97 case 'Y':
98 return '已通过';
99 case 'R':
100 return '已驳回';
101 case 'C':
102 return '已撤销';
103 case 'I':
104 return '--';
105 default:
106 return '草稿中';
107 }
108 }, tagType: (scope) => {
109 const approveVO = scope.row.applicationApproveRSVO || {}
110 switch (approveVO.approveState) {
111 case 'A':
112 return 'warning';
113 case 'Y':
114 return 'success';
115 case 'R':
116 return 'danger';
117 default:
118 return 'info';
119 }
120 }
82 }, 121 },
83 { label: "申请方", field: "tenantName", width: 240 }, 122 { label: "申请方", field: "tenantName", width: 180 },
84 { label: "数据提供方", field: "dataProviderName", width: 240 }, 123 { label: "数据提供方", field: "issuingName", width: 180 },
85 { label: "提交时间", field: "submitTime", width: 170 }, 124 { label: "提交时间", field: "createTime", width: 170 },
86 ], 125 ],
87 loading: false, 126 loading: false,
88 data: [], 127 data: [],
...@@ -98,75 +137,121 @@ const tableInfo = ref({ ...@@ -98,75 +137,121 @@ const tableInfo = ref({
98 btns: (scope) => { 137 btns: (scope) => {
99 const { row } = scope; 138 const { row } = scope;
100 const bizApproveState = row.approveState; 139 const bizApproveState = row.approveState;
140 const approveVO = scope.row.applicationApproveRSVO || {}
141 let approveState = approveVO.approveState || null;
101 let flowState; 142 let flowState;
102 if (bizApproveState == 'N') { 143 if (approveState == 'N') {
103 flowState = 1;
104 }
105
106 const currentStaffGuid = userData.userGuid
107 const staffGuid = row.createUserId || '';
108 let isShowCancel = false;
109 let list: any = [];
110 if (bizApproveState == 'N') {
111 flowState = 1; 144 flowState = 1;
112 } 145 }
113 if ((bizApproveState == 'D' || bizApproveState == 'C' || bizApproveState == 'R' || bizApproveState == 'E' || bizApproveState == 'R') && staffGuid == currentStaffGuid) { 146 if (isDataUse.value) {
114 flowState = 3; 147 let isShowCancel = false;
115 } 148 let list: any = [];
116 if (bizApproveState == 'A' && staffGuid == currentStaffGuid) { 149 const staffGuid = row.createUserId || '';
117 isShowCancel = true; 150 const currentStaffGuid = userData.userGuid
118 } 151 if ((bizApproveState == 'D' || approveState == 'C' || approveState == 'R' || approveState == 'E') && staffGuid == currentStaffGuid) {
119 if (flowState === 1) { 152 flowState = 3;
120 list = [{ label: "编辑", value: "edit", click: btnHandlers.edit }, { label: "删除", value: "del", click: btnHandlers.del }] 153 }
154 if (approveState == 'A' && staffGuid == currentStaffGuid) {
155 isShowCancel = true;
156 }
157 if (flowState === 1) {
158 list = [{ label: "编辑", value: "edit", click: btnHandlers.edit }, { label: "删除", value: "del", click: btnHandlers.del }]
159 }
160 if (flowState !== 1) {
161 list.push({ label: "详情", value: "detail", click: btnHandlers.detail })
162 }
163 if (flowState === 3 && bizApproveState !== 'D') { //重新提交过的不能再重新提交 && bizApproveState != 'D'
164 list.push({ label: "重新提交", value: "redit", click: btnHandlers.redit }) //已驳回
165 }
166 isShowCancel && list.push({ label: "撤销", value: "revoke", click: btnHandlers.revoke })
167 if (flowState === 3) {
168 list.push({ label: "删除", value: "del", click: btnHandlers.del })
169 }
170 return list
171 } else { //数据提供方需要进行审批驳回和通过。
172 let list: any = [];
173 list.push({ label: "详情", value: "detail", click: btnHandlers.detail });
174 // 获取审批人。
175 let approveStaffGuid = approveVO?.approveInstanceRSVOS?.[1]?.operator || '';
176 if (approveState == 'A' && approveStaffGuid == userData.tenantGuid) {
177 flowState = 2;
178 }
179 if (flowState === 2) {
180 list.push(...[{ label: "通过", value: "pass", click: btnHandlers.pass }, { label: "驳回", value: "reject", click: btnHandlers.reject }])
181 }
182 return list;
121 } 183 }
122 if (flowState === 3) {
123 list.push({ label: "删除", value: "del", click: btnHandlers.del })
124 }
125 if (flowState === 3) { //重新提交过的不能再重新提交 && bizApproveState != 'D'
126 list.push({ label: "重新提交", value: "redit", click: btnHandlers.redit }) //已驳回
127 }
128 if (flowState !== 1) {
129 list.push({ label: "详情", value: "detail", click: btnHandlers.detail })
130 }
131 return list
132 }, 184 },
133 } 185 }
134 }); 186 });
135 187
188 /** 当前操作的表格行数据 */
189 const currTableData: any = ref({});
190
136 const btnHandlers = { 191 const btnHandlers = {
137 edit: (scope) => { 192 edit: (scope) => {
193 let row = scope.row;
138 router.push({ 194 router.push({
139 // name: "data-product-edit", 195 name: 'productApplicationEdit',
140 // query: { 196 query: { guid: row.guid, damName: row.damName }
141 // id: scope.row.id,
142 // },
143 }); 197 });
144 }, 198 },
145 redit: (scope) => { 199 redit: (scope) => {
200 let row = scope.row;
201 router.push({
202 name: 'productApplicationEdit',
203 query: { guid: row.guid, damName: row.damName }
204 });
146 }, 205 },
147 detail: (scope) => { 206 detail: (scope) => {
207 let row = scope.row;
148 router.push({ 208 router.push({
149 // name: "data-product-detail", 209 name: 'productApplicationDetail',
150 // query: { 210 query: { guid: row.guid, damName: row.damName }
151 // id: scope.row.id, 211 });
152 // },
153 })
154 }, 212 },
155 del: (scope) => { 213 del: (scope) => {
156 proxy.$openMessageBox('数据申请删除后不可恢复,确定继续删除吗?', () => { 214 proxy.$openMessageBox('数据申请删除后不可恢复,确定继续删除吗?', () => {
157 // delCertificate([row.guid]).then((res: any) => { 215 deleteDataApply([scope.row.guid]).then((res: any) => {
158 // if (res?.code == proxy.$passCode) { 216 if (res?.code == proxy.$passCode) {
159 // proxy.$ElMessage.success('删除资产登记证件成功'); 217 proxy.$ElMessage.success('删除数据申请成功');
160 // page.value.curr = 1; 218 page.value.curr = 1;
161 // getTableData(); 219 getTableData();
162 // } else { 220 } else {
163 // proxy.$ElMessage.error(res.msg); 221 proxy.$ElMessage.error(res.msg);
164 // } 222 }
165 // }) 223 })
166 }, () => { 224 }, () => {
167 proxy.$ElMessage.info("已取消删除"); 225 proxy.$ElMessage.info("已取消删除");
168 }); 226 });
169 }, 227 },
228 revoke: (scope) => {
229 proxy.$openMessageBox('确定撤销该数据申请审批吗??', () => {
230 tableInfo.value.loading = true;
231 updateDataApplyState({
232 guid: scope.row.guid,
233 approveState: 'C'
234 }).then((res: any) => {
235 tableInfo.value.loading = false;
236 if (res?.code == proxy.$passCode) {
237 proxy.$ElMessage.success('该数据申请撤销成功');
238 getTableData();
239 } else {
240 res?.msg && proxy.$ElMessage.error(res.msg);
241 }
242 });
243 }, () => {
244 proxy.$ElMessage.info("已取消撤销");
245 });
246 },
247 pass: (scope) => {
248 passDialogInfo.value.visible = true;
249 currTableData.value = scope.row;
250 },
251 reject: (scope) => {
252 rejectDialogInfo.value.visible = true;
253 currTableData.value = scope.row;
254 }
170 } 255 }
171 const toSearch = (val: any, clear: boolean = false) => { 256 const toSearch = (val: any, clear: boolean = false) => {
172 if (clear) { 257 if (clear) {
...@@ -185,22 +270,26 @@ const toSearch = (val: any, clear: boolean = false) => { ...@@ -185,22 +270,26 @@ const toSearch = (val: any, clear: boolean = false) => {
185 }; 270 };
186 271
187 const getTableData = () => { 272 const getTableData = () => {
188 // tableInfo.value.loading = true; 273 tableInfo.value.loading = true;
189 // getListingList({ 274 getDataApplyPageList({
190 // pageIndex: page.value.curr, 275 pageIndex: page.value.curr,
191 // pageSize: page.value.limit, 276 pageSize: page.value.limit,
192 // damName: page.value.damName, 277 damName: page.value.damName,
193 // damType: page.value.damType, 278 damType: page.value.damType,
194 // approveState: page.value.approveState 279 approveState: page.value.approveState
195 // }).then((res: any) => { 280 }).then((res: any) => {
196 // tableInfo.value.loading = false; 281 tableInfo.value.loading = false;
197 // tableInfo.value.data = res.data.records || []; 282 if (res?.code == proxy.$passCode) {
198 // tableInfo.value.page.curr = res.data.pageIndex; 283 tableInfo.value.data = res.data.records || [];
199 // tableInfo.value.page.limit = res.data.pageSize; 284 tableInfo.value.page.curr = res.data.pageIndex;
200 // tableInfo.value.page.rows = res.data.totalRows; 285 tableInfo.value.page.limit = res.data.pageSize;
201 // }).catch((res) => { 286 tableInfo.value.page.rows = res.data.totalRows;
202 // tableInfo.value.loading = false; 287 } else {
203 // }); 288 proxy.$ElMessage.error(res.msg);
289 }
290 }).catch((res) => {
291 tableInfo.value.loading = false;
292 });
204 }; 293 };
205 294
206 const tablePageChange = (info) => { 295 const tablePageChange = (info) => {
...@@ -211,6 +300,14 @@ const tablePageChange = (info) => { ...@@ -211,6 +300,14 @@ const tablePageChange = (info) => {
211 getTableData(); 300 getTableData();
212 }; 301 };
213 302
303 onActivated(() => {
304 if (productApplicationStore.isRefresh) {
305 page.value.curr = 1;
306 getTableData();
307 productApplicationStore.setIsRefresh(false);
308 }
309 })
310
214 onBeforeMount(() => { 311 onBeforeMount(() => {
215 getDamTypesList({ 312 getDamTypesList({
216 dictType: "资产类型", 313 dictType: "资产类型",
...@@ -224,6 +321,140 @@ onBeforeMount(() => { ...@@ -224,6 +321,140 @@ onBeforeMount(() => {
224 }) 321 })
225 }) 322 })
226 323
324 const passDialogInfo = ref({
325 visible: false,
326 size: 460,
327 direction: "column",
328 header: {
329 title: "通过",
330 },
331 type: '',
332 contents: [
333 {
334 type: 'form',
335 title: '',
336 formInfo: {
337 id: 'batch-pass-form',
338 items: [
339 {
340 label: '',
341 type: "textarea",
342 placeholder: "请填写通过理由(非必填)",
343 field: "approveSuggest",
344 clearable: true,
345 block: true,
346 col: 'margin_b_0',
347 }
348 ]
349 }
350 }
351 ],
352 footer: {
353 btns: [
354 { type: "default", label: "取消", value: "cancel" },
355 { type: "primary", label: "确定", value: "submit", loading: false },
356 ],
357 },
358 });
359
360 const passDialogBtnClick = (btn, info) => {
361 if (btn.value == 'submit') {
362 passDialogInfo.value.footer.btns[1].loading = true;
363 let params = {
364 guid: currTableData.value.guid,
365 approveState: 'A',
366 approveSuggest: info.approveSuggest,
367 }
368 updateDataApplyState(params).then((res: any) => {
369 passDialogInfo.value.footer.btns[1].loading = false;
370 if (res?.code == proxy.$passCode) {
371 if (res.data) {
372 proxy.$ElMessage.success('审批成功');
373 passDialogInfo.value.visible = false;
374 getTableData();
375 } else {
376 proxy.$ElMessage.error('审批失败');
377 }
378 } else {
379 proxy.$ElMessage.error(res.msg);
380 }
381 }).catch(() => {
382 passDialogInfo.value.footer.btns[1].loading = false;
383 });
384 } else if (btn.value == 'cancel') {
385 passDialogInfo.value.visible = false;
386 }
387 };
388
389 const rejectDialogInfo = ref({
390 visible: false,
391 size: 460,
392 direction: "column",
393 header: {
394 title: "驳回",
395 },
396 type: '',
397 contents: [
398 {
399 type: 'form',
400 title: '',
401 formInfo: {
402 id: 'batch-reject-form',
403 items: [
404 {
405 label: '',
406 type: "textarea",
407 placeholder: "请填写驳回理由(必填)",
408 field: "approveSuggest",
409 clearable: true,
410 block: true,
411 col: 'margin_b_0',
412 }
413 ]
414 }
415 }
416 ],
417 footer: {
418 btns: [
419 { type: "default", label: "取消", value: "cancel" },
420 { type: "primary", label: "确定", value: "submit", loading: false },
421 ],
422 },
423 });
424
425 const rejectDialogBtnClick = (btn, info) => {
426 if (btn.value == 'submit') {
427 if (info.approveSuggest == '') {
428 proxy.$ElMessage.error('请填写驳回理由');
429 return
430 }
431 rejectDialogInfo.value.footer.btns[1].loading = true;
432 let params = {
433 guid: currTableData.value.guid,
434 approveState: 'R',
435 approveSuggest: info.approveSuggest,
436 }
437 updateDataApplyState(params).then((res: any) => {
438 rejectDialogInfo.value.footer.btns[1].loading = false;
439 if (res?.code == proxy.$passCode) {
440 if (res.data) {
441 proxy.$ElMessage.success('驳回成功');
442 rejectDialogInfo.value.visible = false;
443 getTableData();
444 } else {
445 proxy.$ElMessage.error('驳回失败');
446 }
447 } else {
448 proxy.$ElMessage.error(res.msg);
449 }
450 }).catch(() => {
451 rejectDialogInfo.value.footer.btns[1].loading = false;
452 });
453 } else if (btn.value == 'cancel') {
454 rejectDialogInfo.value.visible = false;
455 }
456 };
457
227 </script> 458 </script>
228 459
229 <style lang="scss" scoped> 460 <style lang="scss" scoped>
......
...@@ -29,6 +29,7 @@ import { USERROLE } from '@/utils/enum'; ...@@ -29,6 +29,7 @@ import { USERROLE } from '@/utils/enum';
29 const router = useRouter(); 29 const router = useRouter();
30 const route = useRoute(); 30 const route = useRoute();
31 const { proxy } = getCurrentInstance() as any; 31 const { proxy } = getCurrentInstance() as any;
32 const userData = JSON.parse(localStorage.userData);
32 33
33 /** 34 /**
34 * 数据源选项列表 35 * 数据源选项列表
...@@ -313,7 +314,7 @@ const tableInfo = ref({ ...@@ -313,7 +314,7 @@ const tableInfo = ref({
313 query: { 314 query: {
314 guid: scope.row.guid, // 产品GUID 315 guid: scope.row.guid, // 产品GUID
315 type: 'detail', // 查看类型 316 type: 'detail', // 查看类型
316 foundMode: 'use', // 发现模式 317 foundMode: 'tdsUse', // 发现模式
317 name: scope.row.damName, // 产品名称 318 name: scope.row.damName, // 产品名称
318 } 319 }
319 }); 320 });
...@@ -335,6 +336,7 @@ const tableInfo = ref({ ...@@ -335,6 +336,7 @@ const tableInfo = ref({
335 { label: "应用场景", field: "scenarioName", width: 120 }, 336 { label: "应用场景", field: "scenarioName", width: 120 },
336 { label: "所属科室", field: "medDepartmentCodeName", width: 110 }, 337 { label: "所属科室", field: "medDepartmentCodeName", width: 110 },
337 { label: "所属主题", field: "subjectDomainName", width: 120 }, 338 { label: "所属主题", field: "subjectDomainName", width: 120 },
339 { label: "发布机构", field: "rightMainName", width: 180 },
338 { label: "上架时间", field: "groundingTime", width: 170 }, 340 { label: "上架时间", field: "groundingTime", width: 170 },
339 ], 341 ],
340 data: [], // 表格数据 342 data: [], // 表格数据
...@@ -355,6 +357,7 @@ const tableInfo = ref({ ...@@ -355,6 +357,7 @@ const tableInfo = ref({
355 return [{ 357 return [{
356 value: 'approve', 358 value: 'approve',
357 label: "数据申请", 359 label: "数据申请",
360 disabled: scope.row.rightMain === userData.tenantGuid,
358 // 点击申请数据 361 // 点击申请数据
359 click: (scope) => { 362 click: (scope) => {
360 // TODO,是否申请过的不能再申请? 363 // TODO,是否申请过的不能再申请?
......
...@@ -200,8 +200,8 @@ const registerDetailTableInfo = ref({ ...@@ -200,8 +200,8 @@ const registerDetailTableInfo = ref({
200 200
201 const getDetailInfo = () => { 201 const getDetailInfo = () => {
202 fullscreenLoading.value = true; 202 fullscreenLoading.value = true;
203 getRegisterCatalogDetail({ guid: catalogGuid, serviceTenantGuid: route.query.tenantGuid }).then((res: any) => { 203 getRegisterCatalogDetail({ guid: catalogGuid, serviceTenantGuid: route.query.tenantGuid }, foundMode.value === 'tdsUse').then((res: any) => {
204 if (res.code == proxy.$passCode) { 204 if (res?.code == proxy.$passCode) {
205 const data = res.data || {}; 205 const data = res.data || {};
206 detailInfo.value = data; 206 detailInfo.value = data;
207 publicDataProductsMainRSVO.value = detailInfo.value.publicDataProductsMainRSVO || {}; 207 publicDataProductsMainRSVO.value = detailInfo.value.publicDataProductsMainRSVO || {};
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!