3b595223 by lihua

逻辑空间审批接口联调

1 parent e3e635a4
...@@ -456,7 +456,7 @@ const routes: RouteRecordRaw[] = [ ...@@ -456,7 +456,7 @@ const routes: RouteRecordRaw[] = [
456 { 456 {
457 path: '', 457 path: '',
458 name: 'productSpaceManage', 458 name: 'productSpaceManage',
459 component: () => import('@/views/data_asset/productSpaceManage.vue'), 459 component: () => import('@/views/data_asset/productSpaceManageList.vue'),
460 meta: { 460 meta: {
461 title: '', 461 title: '',
462 sidebar: false, 462 sidebar: false,
......
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 <div v-if="detailInfo.bizApproveState"
5 :class="['panel_wrap', 'mb16', '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 == 'E'">
20 <el-icon class="title-icon">
21 <CircleCloseFilled />
22 </el-icon>
23 <span class="title_text">审批发起失败</span>
24 </div>
25 <div class="header_title" v-else-if="detailInfo.bizApproveState == 'A'">
26 <el-icon class="title-icon">
27 <svg-icon name="icon-audit" />
28 </el-icon>
29 <span class="title_text">审批中</span>
30 </div>
31 <div class="header_title" v-else-if="detailInfo.bizApproveState == 'C'">
32 <el-icon class="title-icon">
33 <svg-icon name="icon-revoke" />
34 </el-icon>
35 <span class="title_text">已撤销</span>
36 </div>
37 </div>
38 <div class="panel_body" v-if="detailInfo.bizApproveState == 'R'" style="padding: 0px 16px 10px;">
39 <div class="results_list">
40 <div class="list_item">
41 <span class="item_label">平台审批意见:</span>
42 <span class="item_value">{{ detailInfo?.tdsApproveSuggest || '--' }}</span>
43 </div>
44 </div>
45 </div>
46 <div class="panel_body" v-if="detailInfo.bizApproveState == 'E'" style="padding: 0px 16px 10px;">
47 <div class="results_list">
48 <div class="list_item">
49 <span class="item_label">失败原因:</span>
50 <span class="item_value">{{ detailInfo?.tdsApproveErrorMsg || '--' }}</span>
51 </div>
52 </div>
53 </div>
54 </div>
55 <ContentWrap id="id-baseInfo" title="逻辑空间信息" description="" :isExpand="baseInfoExpand" :expand-swicth="true" 4 <ContentWrap id="id-baseInfo" title="逻辑空间信息" description="" :isExpand="baseInfoExpand" :expand-swicth="true"
56 class="mb16" @expand="(v) => baseInfoExpand = v"> 5 class="mb16" @expand="(v) => baseInfoExpand = v">
57 <div class="list_panel"> 6 <div class="list_panel">
...@@ -92,12 +41,12 @@ ...@@ -92,12 +41,12 @@
92 </el-tabs> 41 </el-tabs>
93 </ContentWrap> 42 </ContentWrap>
94 <!-- 只有可信空间才有流程审批,连接器是提交给可信空间审批的 --> 43 <!-- 只有可信空间才有流程审批,连接器是提交给可信空间审批的 -->
95 <!-- <ContentWrap id="id-approveInfo" title="流程审批" expandSwicth style="margin-top: 15px" :isExpand="expandApprove" 44 <ContentWrap id="id-approveInfo" title="流程审批" expandSwicth style="margin-top: 15px" :isExpand="expandApprove"
96 @expand="(v) => expandApprove = v"> 45 @expand="(v) => expandApprove = v">
97 <ApprovalProcess ref="approvalProcessRef" v-if="deploymentId" :deploymentId="deploymentId" 46 <ApprovalProcess ref="approvalProcessRef" v-if="deploymentId" :deploymentId="deploymentId"
98 :processInstanceId="processInstanceId"> 47 :processInstanceId="processInstanceId">
99 </ApprovalProcess> 48 </ApprovalProcess>
100 </ContentWrap> --> 49 </ContentWrap>
101 </div> 50 </div>
102 <div class="tool_btns"> 51 <div class="tool_btns">
103 <div class="btns"> 52 <div class="btns">
...@@ -105,6 +54,8 @@ ...@@ -105,6 +54,8 @@
105 }}</el-button> 54 }}</el-button>
106 </div> 55 </div>
107 </div> 56 </div>
57 <Dialog :dialogInfo="passDialogInfo" @btnClick="passDialogBtnClick" />
58 <Dialog :dialogInfo="rejectDialogInfo" @btnClick="rejectDialogBtnClick" />
108 </div> 59 </div>
109 </template> 60 </template>
110 61
...@@ -114,13 +65,17 @@ import StrategyTable from "../data_smart_contract/components/strategyTable.vue"; ...@@ -114,13 +65,17 @@ import StrategyTable from "../data_smart_contract/components/strategyTable.vue";
114 import { TableColumnWidth } from "@/utils/enum"; 65 import { TableColumnWidth } from "@/utils/enum";
115 import { CircleCloseFilled } from "@element-plus/icons-vue"; 66 import { CircleCloseFilled } from "@element-plus/icons-vue";
116 import { getLogicSpaceDetail } from "@/api/modules/dataAsset"; 67 import { getLogicSpaceDetail } from "@/api/modules/dataAsset";
68 import { ElMessage, ElMessageBox } from "element-plus";
69 import useDataProductSpaceStore from "@/store/modules/productSpace";
70 import { passFlowData, rejectFlowData, revokeFlowData } from "@/api/modules/workFlowService";
117 71
118 72 const productSpaceStore = useDataProductSpaceStore();
119 const { proxy } = getCurrentInstance() as any; 73 const { proxy } = getCurrentInstance() as any;
120 const userStore = useUserStore(); 74 const userStore = useUserStore();
121 const route = useRoute(); 75 const route = useRoute();
122 const router = useRouter(); 76 const router = useRouter();
123 const fullPath = route.fullPath; 77 const fullPath = route.fullPath;
78 const userData = JSON.parse(localStorage.userData)
124 79
125 const fullscreenLoading = ref(false); 80 const fullscreenLoading = ref(false);
126 const baseInfoExpand = ref(true); 81 const baseInfoExpand = ref(true);
...@@ -133,22 +88,202 @@ const detailInfo: any = ref({}); ...@@ -133,22 +88,202 @@ const detailInfo: any = ref({});
133 88
134 /** 页签当前活跃的有成员权限和策略配置 */ 89 /** 页签当前活跃的有成员权限和策略配置 */
135 const activeTabName = ref('member'); 90 const activeTabName = ref('member');
91 const approvalProcessRef = ref();
92 /** 调用更新详情状态,关闭之后,需要重新刷新列表 */
93 const updateDetailStatus = ref(false);
94
95 const passDialogInfo = ref({
96 visible: false,
97 size: 460,
98 direction: "column",
99 header: {
100 title: "通过",
101 },
102 type: '',
103 contents: [
104 {
105 type: 'form',
106 title: '',
107 formInfo: {
108 id: 'batch-pass-form',
109 items: [
110 {
111 label: '',
112 type: "textarea",
113 placeholder: "请填写通过理由(非必填)",
114 field: "approveSuggest",
115 clearable: true,
116 block: true,
117 col: 'margin_b_0',
118 }
119 ]
120 }
121 }
122 ],
123 footer: {
124 btns: [
125 { type: "default", label: "取消", value: "cancel" },
126 { type: "primary", label: "确定", value: "submit", loading: false },
127 ],
128 },
129 });
130
131 const passDialogBtnClick = (btn, info) => {
132 if (btn.value == 'submit') {
133 passDialogInfo.value.footer.btns[1].loading = true;
134 let params = {
135 guid: detailInfo.value.approveVO.approveGuid,
136 flowType: detailInfo.value.approveVO.flowType,
137 approveSuggest: info.approveSuggest,
138 approveStaffGuid: userData.staffGuid,
139 }
140 passFlowData(params).then((res: any) => {
141 passDialogInfo.value.footer.btns[1].loading = false;
142 if (res?.code == proxy.$passCode) {
143 if (res.data) {
144 passDialogInfo.value.visible = false;
145 getDetail();
146 updateDetailStatus.value = true;
147 approvalProcessRef.value?.renderProcessNodes();
148 } else {
149 proxy.$ElMessage.error('审批失败');
150 }
151 } else {
152 proxy.$ElMessage.error(res.msg);
153 }
154 }).catch(() => {
155 passDialogInfo.value.footer.btns[1].loading = false;
156 });
157 } else if (btn.value == 'cancel') {
158 passDialogInfo.value.visible = false;
159 }
160 };
161
162 const rejectDialogInfo = ref({
163 visible: false,
164 size: 460,
165 direction: "column",
166 header: {
167 title: "驳回",
168 },
169 type: '',
170 contents: [
171 {
172 type: 'form',
173 title: '',
174 formInfo: {
175 id: 'batch-reject-form',
176 items: [
177 {
178 label: '',
179 type: "textarea",
180 placeholder: "请填写驳回理由(必填)",
181 field: "approveSuggest",
182 clearable: true,
183 block: true,
184 col: 'margin_b_0',
185 }
186 ],
187 }
188 }
189 ],
190 footer: {
191 btns: [
192 { type: "default", label: "取消", value: "cancel" },
193 { type: "primary", label: "确定", value: "submit", loading: false },
194 ],
195 },
196 });
197
198 const rejectDialogBtnClick = (btn, info) => {
199 if (btn.value == 'submit') {
200 if (info.approveSuggest == '') {
201 proxy.$ElMessage.error('请填写驳回理由');
202 return
203 }
204 rejectDialogInfo.value.footer.btns[1].loading = true;
205 let params = {
206 guid: detailInfo.value.approveVO.approveGuid,
207 flowType: detailInfo.value.approveVO.flowType,
208 approveSuggest: info.approveSuggest,
209 approveStaffGuid: userData.staffGuid,
210 }
211 rejectFlowData(params).then((res: any) => {
212 rejectDialogInfo.value.footer.btns[1].loading = false;
213 if (res?.code == proxy.$passCode) {
214 if (res.data) {
215 proxy.$ElMessage.success('驳回成功');
216 rejectDialogInfo.value.visible = false;
217 getDetail();
218 updateDetailStatus.value = true;
219 approvalProcessRef.value?.renderProcessNodes();
220 } else {
221 proxy.$ElMessage.error('驳回失败');
222 }
223 } else {
224 proxy.$ElMessage.error(res.msg);
225 }
226 }).catch(() => {
227 rejectDialogInfo.value.footer.btns[1].loading = false;
228 });
229 } else if (btn.value == 'cancel') {
230 rejectDialogInfo.value.visible = false;
231 }
232 };
136 233
137 const toolBtns: any = computed(() => { 234 const toolBtns: any = computed(() => {
138 let btnsArr: any = [{ 235 let btnsArr: any = [{
139 label: "关闭", value: "cancel", plain: true 236 label: "关闭", value: "cancel", plain: true
140 }]; 237 }];
141 // TODO,资产运营平台TODO 238 let approveVO = detailInfo.value.approveVO;
239 let staffGuid = userData.staffGuid;
240 if (approveVO && approveVO.approveState == 'A' && approveVO.approveStaffGuids && approveVO.approveStaffGuids.indexOf(staffGuid) > -1) {
241 btnsArr.push(...[{ label: "通过", value: "pass", type: 'primary' }, { label: "驳回", value: "reject", type: 'danger', plain: true }]);
242 }
243 if (approveVO && approveVO.approveState == 'A' && approveVO.staffGuid == staffGuid && !detailInfo.value.nodeId) {
244 btnsArr.push({ label: "撤销", value: "revoke" });
245 }
142 return btnsArr; 246 return btnsArr;
143 }); 247 });
144 248
145 const btnClick = (btn: any) => { 249 const btnClick = (btn: any) => {
146 switch (btn.value) { 250 const type = btn.value;
147 case 'cancel': 251 if (type === 'pass') {
148 cancel(); 252 passDialogInfo.value.visible = true;
149 break; 253 } else if (type == 'reject') {
150 default: 254 rejectDialogInfo.value.visible = true;
151 break; 255 } else if (type == 'cancel') {
256 cancel();
257 updateDetailStatus.value && productSpaceStore.setIsRefresh(true);
258 } else if (type == 'revoke') {
259 ElMessageBox.confirm('确定撤销该连接器审批流程吗?', "提示", {
260 confirmButtonText: "确定",
261 cancelButtonText: "取消",
262 type: 'warning',
263 }).then(() => {
264 let params = {
265 guid: detailInfo.value.approveVO.approveGuid,
266 flowType: detailInfo.value.approveVO.flowType,
267 approveStaffGuid: userData.staffGuid,
268 }
269 revokeFlowData(params, detailInfo.value.tenantGuid).then((res: any) => {
270 if (res?.code == proxy.$passCode) {
271 if (res.data) {
272 ElMessage.success('该审批流程撤销成功!');
273 getDetail();
274 updateDetailStatus.value = true;
275 approvalProcessRef.value?.renderProcessNodes();
276 } else {
277 ElMessage.error('该审批流程撤销失败!');
278 }
279 } else {
280 ElMessage.error(res.msg);
281 }
282 }).catch(() => {
283 });
284 }).catch(() => {
285 ElMessage.info('已取消撤销');
286 });
152 } 287 }
153 } 288 }
154 289
...@@ -159,17 +294,23 @@ const cancel = () => { ...@@ -159,17 +294,23 @@ const cancel = () => {
159 }); 294 });
160 } 295 }
161 296
162 onBeforeMount(() => { 297 const getDetail = () => {
163 fullscreenLoading.value = true; 298 fullscreenLoading.value = true;
164 getLogicSpaceDetail({ guid: route.query.guid }).then((res: any) => { 299 getLogicSpaceDetail({ guid: route.query.guid }).then((res: any) => {
165 fullscreenLoading.value = false; 300 fullscreenLoading.value = false;
166 if (res?.code == proxy.$passCode) { 301 if (res?.code == proxy.$passCode) {
167 detailInfo.value = res.data || {}; 302 detailInfo.value = res.data || {};
303 deploymentId.value = res.data?.approveVO?.camundaDeploymentId
304 processInstanceId.value = res.data?.approveVO?.camundaInstanceId
168 memberTableInfo.value.data = detailInfo.value.permissionRSVOS || []; 305 memberTableInfo.value.data = detailInfo.value.permissionRSVOS || [];
169 } else { 306 } else {
170 res?.msg && proxy.$ElMessage.error(res.msg); 307 res?.msg && proxy.$ElMessage.error(res.msg);
171 } 308 }
172 }) 309 })
310 }
311
312 onBeforeMount(() => {
313 getDetail();
173 }) 314 })
174 315
175 const memberTableInfo = ref({ 316 const memberTableInfo = ref({
...@@ -178,9 +319,11 @@ const memberTableInfo = ref({ ...@@ -178,9 +319,11 @@ const memberTableInfo = ref({
178 fields: [ 319 fields: [
179 { label: "序号", type: "index", width: TableColumnWidth.INDEX, align: "center" }, 320 { label: "序号", type: "index", width: TableColumnWidth.INDEX, align: "center" },
180 { label: "成员名称", field: "memberName", width: 200 }, 321 { label: "成员名称", field: "memberName", width: 200 },
181 { label: "角色类型", field: "characterType", width: 160, getName: (scope) => { 322 {
182 return !scope.row.characterType ? '--' : (scope.row.characterType == '1' ? '数据使用方' : '数据提供方') 323 label: "角色类型", field: "characterType", width: 160, getName: (scope) => {
183 } }, 324 return !scope.row.characterType ? '--' : (scope.row.characterType == '1' ? '数据使用方' : '数据提供方')
325 }
326 },
184 { label: "描述", field: "description", width: 300 }, 327 { label: "描述", field: "description", width: 300 },
185 ], 328 ],
186 data: [], 329 data: [],
...@@ -267,134 +410,4 @@ const memberTableInfo = ref({ ...@@ -267,134 +410,4 @@ const memberTableInfo = ref({
267 410
268 } 411 }
269 } 412 }
270
271 .panel_wrap {
272
273 .panel_header {
274 .header_title {
275 height: 40px;
276 padding: 0 16px;
277 background-color: #fafafa;
278 box-shadow: 0 0 0 1px #e5e5e5;
279 display: flex;
280 align-items: center;
281 }
282
283 .title_text {
284 line-height: 22px;
285 font-size: 14px;
286 color: var(--el-color-regular);
287 font-weight: 600;
288 display: flex;
289 align-items: center;
290
291 .title_icon {
292 width: 26px;
293 height: 21px;
294 margin-right: 4px;
295 cursor: pointer;
296
297 &.active {
298 transform: rotate(90deg);
299 }
300 }
301 }
302 }
303
304 &.results_panel {
305 box-shadow: 0 0 0 1px #d9d9d9;
306
307 .panel_header {
308 .header_title {
309 background-color: transparent;
310 box-shadow: none;
311
312 .el-icon {
313 margin-right: 8px;
314 width: 20px;
315 height: 20px;
316
317 svg {
318 width: 100%;
319 height: 100%;
320 }
321 }
322 }
323 }
324
325 .panel_body {
326 padding-top: 0;
327 margin-top: 0;
328 box-shadow: none;
329
330 .results_list {
331 display: flex;
332
333 .list_item {
334 display: flex;
335 margin-bottom: 8px;
336 margin-right: 60px;
337 color: #666;
338
339 .item_value {
340 padding: 0 8px;
341 color: var(--el-color-regular);
342 }
343 }
344 }
345 }
346
347 &.success {
348 background-color: #F4FEF6;
349 box-shadow: 0 0 0 1px #4FA55D;
350
351 .panel_header {
352 .header_title {
353 .el-icon {
354 color: #4FA55D;
355 }
356 }
357 }
358 }
359
360 &.reject {
361 background-color: #FDF2F4;
362 box-shadow: 0 0 0 1px #E63E33;
363
364 .panel_header {
365 .header_title {
366 .el-icon {
367 color: #E63E33;
368 }
369 }
370 }
371 }
372
373 &.audit {
374 background-color: #FEFBF3;
375 box-shadow: 0 0 0 1px #F19E40;
376
377 .panel_header {
378 .header_title {
379 .el-icon {
380 color: #F19E40;
381 }
382 }
383 }
384 }
385
386 &.revoke {
387 background-color: #F5F5F5;
388 box-shadow: 0 0 0 1px #CCCCCC;
389
390 .panel_header {
391 .header_title {
392 .el-icon {
393 color: #666666;
394 }
395 }
396 }
397 }
398 }
399 }
400 </style> 413 </style>
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -20,12 +20,12 @@ ...@@ -20,12 +20,12 @@
20 </el-tabs> 20 </el-tabs>
21 </ContentWrap> 21 </ContentWrap>
22 <!-- 可信空间需要显示 --> 22 <!-- 可信空间需要显示 -->
23 <!-- <ContentWrap id="id-approveInfo" title="流程审批" expandSwicth style="margin-top: 15px" :isExpand="expandApprove" 23 <ContentWrap id="id-approveInfo" title="流程审批" expandSwicth style="margin-top: 15px" :isExpand="expandApprove"
24 @expand="(v) => expandApprove = v"> 24 @expand="(v) => expandApprove = v">
25 <ApprovalProcess ref="approvalProcessRef" v-if="deploymentId" :deploymentId="deploymentId" 25 <ApprovalProcess ref="approvalProcessRef" v-if="deploymentId" :deploymentId="deploymentId"
26 :processInstanceId="processInstanceId"> 26 :processInstanceId="processInstanceId">
27 </ApprovalProcess> 27 </ApprovalProcess>
28 </ContentWrap> --> 28 </ContentWrap>
29 </div> 29 </div>
30 <div class="bottom_tool_wrap"> 30 <div class="bottom_tool_wrap">
31 <el-button @click="cancel">取消</el-button> 31 <el-button @click="cancel">取消</el-button>
...@@ -397,13 +397,13 @@ onActivated(() => { ...@@ -397,13 +397,13 @@ onActivated(() => {
397 397
398 onBeforeMount(() => { 398 onBeforeMount(() => {
399 // 可信空间需要 399 // 可信空间需要
400 // getCamundaDeploymentId('10034', userData.tenantGuid, userData.staffGuid).then((res: any) => { 400 getCamundaDeploymentId('10034', userData.tenantGuid, userData.staffGuid).then((res: any) => {
401 // if (res.code == proxy.$passCode) { 401 if (res.code == proxy.$passCode) {
402 // deploymentId.value = res.data; 402 deploymentId.value = res.data;
403 // } else { 403 } else {
404 // proxy.$ElMessage.error(res.msg); 404 proxy.$ElMessage.error(res.msg);
405 // } 405 }
406 // }) 406 })
407 if (route.query.guid) { 407 if (route.query.guid) {
408 fullscreenLoading.value = true; 408 fullscreenLoading.value = true;
409 getLogicSpaceDetail({ guid: route.query.guid }).then((res: any) => { 409 getLogicSpaceDetail({ guid: route.query.guid }).then((res: any) => {
......
1 <route lang="yaml">
2 name: settleManagement
3 </route>
4
5 <script lang="ts" setup name="productSpaceManage">
6 import { ref } from 'vue';
7 import TableTools from "@/components/Tools/table_tools.vue";
8 import { getLogicSpacePageList, deleteLogicSpace } from '@/api/modules/dataAsset';
9 import { ElMessage, ElMessageBox } from 'element-plus';
10 import { passFlowData, rejectFlowData, revokeFlowData } from "@/api/modules/workFlowService";
11 import useDataProductSpaceStore from "@/store/modules/productSpace";
12
13 const productSpaceStore = useDataProductSpaceStore();
14 const router = useRouter();
15 const route = useRoute();
16 const userData = JSON.parse(localStorage.userData)
17 const { proxy } = getCurrentInstance() as any;
18
19 const searchItemList = ref([
20 {
21 type: "input",
22 label: "",
23 field: "spaceName",
24 default: "",
25 placeholder: "空间名称",
26 maxlength: 50,
27 clearable: true,
28 },
29 {
30 type: 'select',
31 label: '',
32 field: 'approveState',
33 default: '',
34 placeholder: '审核状态',
35 options: [
36 { label: '草稿中', value: 'N' },
37 { label: '审批中', value: 'A' },
38 { label: '已通过', value: 'Y' },
39 { label: '已驳回', value: 'R' },
40 { label: '已撤销', value: 'C' },
41 ],
42 filterable: true,
43 clearable: true
44 }
45 ]);
46
47 const tableFields = ref([
48 { label: "序号", type: "index", width: 56, align: "center" },
49 { label: "空间名称", field: "spaceName", width: 160, },
50 { label: "产品数量", field: "damCount", width: 120, align: 'right', type: 'chnum' },
51 { label: "成员数量", field: "memberCount", width: 120, align: 'right', type: 'chnum' },
52 {
53 label: "审批状态", field: "approveVO", type: "tag", width: 96, align: 'center', getName: (scope) => {
54 const approveVO = scope.row.approveVO || {}
55 switch (approveVO.approveState) {
56 case 'N':
57 return '草稿中';
58 case 'A':
59 return '审批中';
60 case 'Y':
61 return '已通过';
62 case 'R':
63 return '已驳回';
64 case 'C':
65 return '已撤销';
66 case 'I':
67 return '--';
68 default:
69 return '草稿中';
70 }
71 }, tagType: (scope) => {
72 const approveVO = scope.row.approveVO || {}
73 switch (approveVO.approveState) {
74 case 'A':
75 return 'warning';
76 case 'Y':
77 return 'success';
78 case 'R':
79 return 'danger';
80 default:
81 return 'info';
82 }
83 }
84 },
85 { label: "创建企业", field: "tenantName", width: 200 },
86 { label: "修改人", field: "updateUserName", width: 130 },
87 { label: "修改时间", field: "updateTime", width: 170 },
88 ]);
89
90 const page = ref({
91 limit: 50,
92 curr: 1,
93 sizes: [
94 { label: "10", value: 10 },
95 { label: "50", value: 50 },
96 { label: "100", value: 100 },
97 { label: "150", value: 150 },
98 { label: "200", value: 200 },
99 ],
100 spaceName: '',
101 approveState: ''
102 });
103 const currTableData: any = ref({});
104 const tableInfo = ref({
105 id: 'value-asset-table',
106 rowKey: 'guid',
107 loading: false,
108 fields: tableFields.value,
109 data: [],
110 page: {
111 type: "normal",
112 rows: 0,
113 ...page.value,
114 },
115 actionInfo: {
116 label: "操作",
117 type: "btn",
118 width: 180,
119 btns: (scope) => {
120 let row = scope.row;
121 return getTableBtns(row);
122 }
123 }
124 });
125
126 const getTableBtns = (row) => {
127 let btnsArr: any[] = [];
128 const approveVO = row.approveVO;
129 const currentStaffGuid = userData.staffGuid
130 const bizApproveState = row.bizApproveState;
131 const approveState = approveVO?.approveState || 'N';
132 const approveStaffGuids = approveVO?.approveStaffGuids || [];
133 const staffGuid = approveVO?.staffGuid || '';
134 let isShowCancel = false;
135 let flowState;
136 if (approveState == 'N') {
137 flowState = 1;
138 }
139 if (approveState == 'A' && approveStaffGuids.indexOf(currentStaffGuid) > -1) {
140 flowState = 2;
141 }
142 if ((approveState == 'C' || approveState == 'R') && staffGuid == currentStaffGuid && !row.nodeId) {
143 flowState = 3;
144 }
145 if (approveVO && approveVO.approveState == 'A' && staffGuid == currentStaffGuid && !row.nodeId) {
146 isShowCancel = true;
147 }
148
149 if (flowState === 1) {
150 btnsArr = [{ label: "编辑", value: "edit" }, { label: "删除", value: "delete" }]
151 } else {
152 btnsArr.push({ label: "详情", value: "detail" })
153 if (flowState === 2) {
154 btnsArr.push(...[{ label: "通过", value: "pass" }, { label: "驳回", value: "reject" }])
155 } else if (flowState === 3) {
156 if (bizApproveState != 'D') {
157 btnsArr.push({ label: "重新提交", value: "edit" })
158 }
159 }
160 isShowCancel && btnsArr.push({ label: "撤销", value: "revoke" })
161 flowState === 3 && btnsArr.push({ label: "删除", value: "delete" })
162 }
163 return btnsArr
164 }
165
166
167 const toSearch = (val: any, clear: boolean = false) => {
168 if (clear) {
169 searchItemList.value.map((item) => (item.default = ""));
170 page.value.spaceName = '';
171 page.value.approveState = "";
172 } else {
173 page.value.spaceName = val.spaceName;
174 page.value.approveState = val.approveState;
175 }
176 getTableData();
177 };
178
179 const getTableData = () => {
180 tableInfo.value.loading = true
181 getLogicSpacePageList({
182 pageIndex: page.value.curr,
183 pageSize: page.value.limit,
184 spaceName: page.value.spaceName,
185 approveState: page.value.approveState,
186 currentStaffGuid: userData.staffGuid
187 }).then((res: any) => {
188 if (res?.code == proxy.$passCode) {
189 const data = res.data || {}
190 tableInfo.value.data = data.records || []
191 tableInfo.value.page.limit = data.pageSize
192 tableInfo.value.page.curr = data.pageIndex
193 tableInfo.value.page.rows = data.totalRows
194 } else {
195 proxy.$ElMessage({
196 type: 'error',
197 message: res.msg,
198 })
199 }
200 tableInfo.value.loading = false
201 }).catch(() => {
202 tableInfo.value.loading = false
203 })
204 };
205
206 const tableBtnClick = (scope, btn) => {
207 const type = btn.value;
208 const row = scope.row;
209 currTableData.value = row;
210 if (type === "edit") { //草稿中\已驳回\已撤销\已通过 状态,才可以编辑。
211 router.push({
212 name: 'productSpaceEdit',
213 query: {
214 guid: row.guid,
215 name: row.spaceName
216 }
217 })
218 } else if (type == "delete") {
219 proxy.$openMessageBox("此操作将永久删除, 是否继续?", () => {
220 let guids = [scope.row.guid];
221 deleteLogicSpace(guids).then((res: any) => {
222 if (res?.code == proxy.$passCode) {
223 page.value.curr = 1;
224 getTableData();
225 proxy.$ElMessage.success('删除成功');
226 } else {
227 proxy.$ElMessage.error(res.msg);
228 }
229 });
230 })
231 } else if (type === 'revoke') { // 撤销,状态为审批中时可以撤销。
232 ElMessageBox.confirm('确定撤销该连接器审批流程吗?', "提示", {
233 confirmButtonText: "确定",
234 cancelButtonText: "取消",
235 type: 'warning',
236 }).then(() => {
237 let params = {
238 guid: row.approveVO.approveGuid,
239 flowType: row.approveVO.flowType,
240 approveStaffGuid: userData.staffGuid,
241 }
242 revokeFlowData(params, currTableData.value.tenantGuid).then((res: any) => {
243 if (res?.code == proxy.$passCode) {
244 if (res.data) {
245 ElMessage.success('该审批流程撤销成功!');
246 getTableData();
247 } else {
248 ElMessage.error('该审批流程撤销失败!');
249 }
250 } else {
251 ElMessage.error(res.msg);
252 }
253 });
254 }).catch(() => {
255 ElMessage.info('已取消撤销');
256 });
257 } else if (type === 'detail') { // 详情, 若是草稿中,详情就是编辑,
258 router.push({
259 name: 'productSpaceDetail',
260 query: {
261 guid: row.guid,
262 name: row.connectorName
263 }
264 });
265 } else if (type === 'pass') {
266 passDialogInfo.value.visible = true;
267 } else if (type == 'reject') {
268 rejectDialogInfo.value.visible = true;
269 }
270 };
271 const tablePageChange = (info) => {
272 page.value.curr = Number(info.curr);
273 page.value.limit = Number(info.limit);
274 tableInfo.value.page.curr = page.value.curr;
275 tableInfo.value.page.limit = page.value.limit;
276 getTableData();
277 };
278
279 const newCreate = () => {
280 router.push({
281 name: 'productSpaceEdit'
282 })
283 }
284
285 onActivated(() => {
286 if (productSpaceStore.isRefresh) {//如果是首次加载,则不需要调用
287 page.value.curr = 1;
288 getTableData();
289 productSpaceStore.setIsRefresh(false);
290 }
291 })
292
293 const fullscreenloading = ref(false);
294
295 onBeforeMount(() => {
296 toSearch({});
297 })
298
299 const passDialogInfo = ref({
300 visible: false,
301 size: 460,
302 direction: "column",
303 header: {
304 title: "通过",
305 },
306 type: '',
307 contents: [
308 {
309 type: 'form',
310 title: '',
311 formInfo: {
312 id: 'batch-pass-form',
313 items: [
314 {
315 label: '',
316 type: "textarea",
317 placeholder: "请填写通过理由(非必填)",
318 field: "approveSuggest",
319 clearable: true,
320 block: true,
321 col: 'margin_b_0',
322 }
323 ]
324 }
325 }
326 ],
327 footer: {
328 btns: [
329 { type: "default", label: "取消", value: "cancel" },
330 { type: "primary", label: "确定", value: "submit", loading: false },
331 ],
332 },
333 });
334
335 const passDialogBtnClick = (btn, info) => {
336 if (btn.value == 'submit') {
337 passDialogInfo.value.footer.btns[1].loading = true;
338 let params = {
339 guid: currTableData.value.approveVO.approveGuid,
340 flowType: currTableData.value.approveVO.flowType,
341 approveSuggest: info.approveSuggest,
342 approveStaffGuid: userData.staffGuid,
343 }
344 passFlowData(params, currTableData.value.tenantGuid).then((res: any) => {
345 passDialogInfo.value.footer.btns[1].loading = false;
346 if (res?.code == proxy.$passCode) {
347 if (res.data) {
348 ElMessage.success('审批成功');
349 passDialogInfo.value.visible = false;
350 getTableData();
351 } else {
352 ElMessage.error('审批失败');
353 }
354 } else {
355 ElMessage.error(res.msg);
356 }
357 }).catch(() => {
358 passDialogInfo.value.footer.btns[1].loading = false;
359 });
360 } else if (btn.value == 'cancel') {
361 passDialogInfo.value.visible = false;
362 }
363 };
364
365 const rejectDialogInfo = ref({
366 visible: false,
367 size: 460,
368 direction: "column",
369 header: {
370 title: "驳回",
371 },
372 type: '',
373 contents: [
374 {
375 type: 'form',
376 title: '',
377 formInfo: {
378 id: 'batch-reject-form',
379 items: [
380 {
381 label: '',
382 type: "textarea",
383 placeholder: "请填写驳回理由(必填)",
384 field: "approveSuggest",
385 clearable: true,
386 block: true,
387 col: 'margin_b_0',
388 }
389 ],
390 }
391 }
392 ],
393 footer: {
394 btns: [
395 { type: "default", label: "取消", value: "cancel" },
396 { type: "primary", label: "确定", value: "submit", loading: false },
397 ],
398 },
399 });
400
401 const rejectDialogBtnClick = (btn, info) => {
402 if (btn.value == 'submit') {
403 if (info.approveSuggest == '') {
404 ElMessage.error('请填写驳回理由');
405 return
406 }
407 rejectDialogInfo.value.footer.btns[1].loading = true;
408 let params = {
409 guid: currTableData.value.approveVO.approveGuid,
410 flowType: currTableData.value.approveVO.flowType,
411 approveSuggest: info.approveSuggest,
412 approveStaffGuid: userData.staffGuid,
413 }
414 rejectFlowData(params, currTableData.value.tenantGuid).then((res: any) => {
415 rejectDialogInfo.value.footer.btns[1].loading = false;
416 if (res?.code == proxy.$passCode) {
417 if (res.data) {
418 ElMessage.success('驳回成功');
419 rejectDialogInfo.value.visible = false;
420 getTableData();
421 } else {
422 ElMessage.error('驳回失败');
423 }
424 } else {
425 ElMessage.error(res.msg);
426 }
427 }).catch(() => {
428 rejectDialogInfo.value.footer.btns[1].loading = false;
429 });
430 } else if (btn.value == 'cancel') {
431 rejectDialogInfo.value.visible = false;
432 }
433 };
434
435 </script>
436
437 <template>
438 <div class="container_wrap" v-loading="fullscreenloading">
439 <div class="table_tool_wrap">
440 <TableTools :searchItems="searchItemList" :searchId="'settle-asset-search'" @search="toSearch" :init="false" />
441 </div>
442 <div class="tools_btns">
443 <el-button type="primary" @click="newCreate()" v-preReClick>新增</el-button>
444 </div>
445 <div class="table_panel_wrap" :style="{ height: 'calc(100% - 88px)' }">
446 <Table :tableInfo="tableInfo" @tableBtnClick="tableBtnClick" @tablePageChange="tablePageChange" />
447 </div>
448 <Dialog :dialogInfo="passDialogInfo" @btnClick="passDialogBtnClick" />
449 <Dialog :dialogInfo="rejectDialogInfo" @btnClick="rejectDialogBtnClick" />
450 </div>
451 </template>
452
453 <style lang="scss" scoped>
454 .container_wrap {
455 padding: 0px 16px;
456 }
457 </style>
...\ No newline at end of file ...\ No newline at end of file
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!