70ab5602 by lxs

Merge branch 'develop' of http://117.78.60.236:8000/csbr-daop/fe-data-asset-management into develop

2 parents a4dc63c9 3344e345
This diff could not be displayed because it is too large.
No preview for this file type
No preview for this file type
...@@ -108,7 +108,7 @@ export const updatQuality = (params) => request({ ...@@ -108,7 +108,7 @@ export const updatQuality = (params) => request({
108 /** 获取可以发起资产质量评价的选项列表。 */ 108 /** 获取可以发起资产质量评价的选项列表。 */
109 /** type: 1 质量评价;2 资产评估 */ 109 /** type: 1 质量评价;2 资产评估 */
110 export const getRegisteredList = (type) => request({ 110 export const getRegisteredList = (type) => request({
111 url: `${import.meta.env.VITE_API_NEW_PORTAL}/register-base/get-valid-list?type=${type}`, 111 url: `${import.meta.env.VITE_API_NEW_PORTAL}/dam-catalog-table/get-valid-list?type=${type}`,
112 method: 'get' 112 method: 'get'
113 }) 113 })
114 114
......
...@@ -400,7 +400,8 @@ const downloadTemplate = async (url) => { ...@@ -400,7 +400,8 @@ const downloadTemplate = async (url) => {
400 } 400 }
401 401
402 const onUploadFileDownload = async (file, item) => { 402 const onUploadFileDownload = async (file, item) => {
403 let url = file.url; 403 let f = formInline.value[item.field].find(i => i.name == file.name);
404 let url = f.url;
404 const refSignInfo: any = await getDownFileSignByUrl(parseAndDecodeUrl(url).fileName); 405 const refSignInfo: any = await getDownFileSignByUrl(parseAndDecodeUrl(url).fileName);
405 if (!refSignInfo?.data) { 406 if (!refSignInfo?.data) {
406 refSignInfo?.msg && ElMessage.error(refSignInfo?.msg); 407 refSignInfo?.msg && ElMessage.error(refSignInfo?.msg);
...@@ -493,6 +494,7 @@ const uploadFile = (file, item) => { ...@@ -493,6 +494,7 @@ const uploadFile = (file, item) => {
493 actualSignedRequestHeaders: res.data.actualSignedRequestHeaders 494 actualSignedRequestHeaders: res.data.actualSignedRequestHeaders
494 }).then(() => { 495 }).then(() => {
495 if (res.code == '00000') { 496 if (res.code == '00000') {
497 file.file.url = res.data.signedUrl;
496 let fileItem = { 498 let fileItem = {
497 name: file.file.name, 499 name: file.file.name,
498 url: res.data.signedUrl, 500 url: res.data.signedUrl,
...@@ -1279,7 +1281,7 @@ const panelChange = (scope, row) => { ...@@ -1279,7 +1281,7 @@ const panelChange = (scope, row) => {
1279 <template #trigger> 1281 <template #trigger>
1280 <el-button :disabled="child.disabled" :icon="Upload" class="mr8">上传文件</el-button> 1282 <el-button :disabled="child.disabled" :icon="Upload" class="mr8">上传文件</el-button>
1281 </template> 1283 </template>
1282 <el-button :icon="Download" v-if="child.templateUrl" @click="downloadTemplate(child.templateUrl)"> 1284 <el-button :icon="Download" v-if="child.templateUrl" @click="(child.templateUrl == 'auto' && child.templateClick) ? child.templateClick() : downloadTemplate(child.templateUrl)">
1283 下载模板 1285 下载模板
1284 </el-button> 1286 </el-button>
1285 <template #tip> 1287 <template #tip>
...@@ -1360,7 +1362,7 @@ const panelChange = (scope, row) => { ...@@ -1360,7 +1362,7 @@ const panelChange = (scope, row) => {
1360 <template #trigger> 1362 <template #trigger>
1361 <el-button :disabled="item.disabled" :icon="Upload" class="mr8">上传文件</el-button> 1363 <el-button :disabled="item.disabled" :icon="Upload" class="mr8">上传文件</el-button>
1362 </template> 1364 </template>
1363 <el-button :icon="Download" v-if="item.templateUrl" @click="downloadTemplate(item.templateUrl)"> 1365 <el-button :icon="Download" v-if="item.templateUrl" @click="(item.templateUrl == 'auto' && item.templateClick) ? item.templateClick() : downloadTemplate(item.templateUrl)">
1364 下载模板 1366 下载模板
1365 </el-button> 1367 </el-button>
1366 <template #tip> 1368 <template #tip>
......
...@@ -18,10 +18,8 @@ import { ...@@ -18,10 +18,8 @@ import {
18 updatQuality 18 updatQuality
19 } from "@/api/modules/dataAsset"; 19 } from "@/api/modules/dataAsset";
20 import useUserStore from "@/store/modules/user"; 20 import useUserStore from "@/store/modules/user";
21 import {
22 getTenantAttach
23 } from "@/api/modules/queryService";
24 import useDataAssetStore from "@/store/modules/dataAsset"; 21 import useDataAssetStore from "@/store/modules/dataAsset";
22 import { passFlowData, rejectFlowData, revokeFlowData, getCamundaDeploymentId, getProcessNodesPromise } from "@/api/modules/workFlowService";
25 23
26 const assetStore = useDataAssetStore(); 24 const assetStore = useDataAssetStore();
27 25
...@@ -31,36 +29,26 @@ const { proxy } = getCurrentInstance() as any; ...@@ -31,36 +29,26 @@ const { proxy } = getCurrentInstance() as any;
31 const userStore = useUserStore(); 29 const userStore = useUserStore();
32 const userData = JSON.parse(userStore.userData) 30 const userData = JSON.parse(userStore.userData)
33 31
34 /** 是否时企业端。不是企业端,则是服务端,需要显示企业名称。 */
35 const isCompanyPlatform = ref(userData.tenantType == 1);
36
37 /** 数据来源于该企业申请登记的数据资产已通过且剔除数据质量评价中已通过、审批中的资产。 */ 32 /** 数据来源于该企业申请登记的数据资产已通过且剔除数据质量评价中已通过、审批中的资产。 */
38 const assetListData: any = ref([]); 33 const assetListData: any = ref([]);
39 /** 会员附件模板 */
40 const attachDataInfo: any = ref({});
41 34
42 const tableFields = ref([ 35 const tableFields = ref([
43 { label: "序号", type: "index", width: 56, align: "center" }, 36 { label: "序号", type: "index", width: 56, align: "center" },
44 { label: "资产名称", field: "daName", width: 160, align: "left" }, 37 { label: "资产名称", field: "daName", width: 160, align: "left", type: 'text_btn', value: 'productDetail', columClass: 'text_btn' },
45 { label: "登记时间", field: "registerTime", width: 120 }, 38 { label: "登记时间", field: "registerTime", width: 120 },
46 // { label: "企业名称", field: "tenantName", width: 240, align: "left" }, 39 // { label: "企业名称", field: "tenantName", width: 240, align: "left" },
47 { label: "评估机构", field: "issuingEntityName", width: 250, align: "left" }, 40 { label: "评估机构", field: "issuingEntityName", width: 250, align: "left" },
48 { label: "状态", field: "approveState", type: "tag", width: 96, align: 'center' }, 41 { label: "状态", field: "approveState", type: "tag", width: 96, align: 'center' },
49 ]); 42 ]);
50 43
44 const deploymentId = ref('');
45
51 onBeforeMount(() => { 46 onBeforeMount(() => {
52 if (isCompanyPlatform.value) { 47 getCamundaDeploymentId('10018').then((res: any) => {
53 tableInfo.value.fields = tableFields.value; 48 if (res.code == proxy.$passCode) {
54 } else { 49 deploymentId.value = res.data;
55 tableFields.value.splice(3, 0, { label: "企业名称", field: "tenantName", width: 250, align: "left" })
56 tableInfo.value.fields = tableFields.value;
57 }
58 getTenantAttach(userData.tenantGuid).then((res: any) => {
59 if (res?.code == proxy.$passCode) {
60 attachDataInfo.value = res.data || {};
61 formItems.value[1].templateUrl = attachDataInfo.value.quality_evaluation_file;
62 } else { 50 } else {
63 ElMessage.error(res.msg); 51 proxy.$ElMessage.error(res.msg);
64 } 52 }
65 }) 53 })
66 }); 54 });
...@@ -240,29 +228,23 @@ const tableBtnClick = (scope, btn) => { ...@@ -240,29 +228,23 @@ const tableBtnClick = (scope, btn) => {
240 } 228 }
241 passFormItems.value[2].placeholder = `本次评估数据资产总体质量得分为**分\n准确性:\n一致性:\n可访问性:\n规范性:\n完整性:`; 229 passFormItems.value[2].placeholder = `本次评估数据资产总体质量得分为**分\n准确性:\n一致性:\n可访问性:\n规范性:\n完整性:`;
242 } else if (type === 'revoke') { // 撤销,状态为审批中时可以撤销。 230 } else if (type === 'revoke') { // 撤销,状态为审批中时可以撤销。
243 ElMessageBox.confirm('确定撤销该资产质量评价吗?', "提示", { 231 ElMessageBox.confirm(`撤销后,该流程将不再进行审核,确定这样操作吗?`, "提示", {
244 confirmButtonText: "确定", 232 confirmButtonText: "确定",
245 cancelButtonText: "取消", 233 cancelButtonText: "取消",
246 type: 'warning', 234 type: 'warning',
247 }).then(() => { 235 }).then(() => {
248 let params = { 236 revokeFlowData({
249 bizGuid: row.guid, 237 guid: row.approveVO.approveGuid,
250 funcCode: row.funcCode 238 flowType: row.approveVO.flowType,
251 } 239 approveStaffGuid: userData.staffGuid,
252 tableInfo.value.loading = true; 240 }).then((res: any) => {
253 registerApproveCancel(params).then((res: any) => { 241 if (res.code == '00000') {
254 tableInfo.value.loading = false; 242 ElMessage.success('撤销成功!')
255 if (res?.code == proxy.$passCode) { 243 getTableData();
256 if (res.data) {
257 ElMessage.success('该资产质量评价流程撤销成功!');
258 getTableData();
259 } else {
260 ElMessage.error('该资产质量评价流程撤销失败!');
261 }
262 } else { 244 } else {
263 ElMessage.error(res.msg); 245 ElMessage.error(res.msg)
264 } 246 }
265 }); 247 })
266 }).catch(() => { 248 }).catch(() => {
267 ElMessage({ 249 ElMessage({
268 type: 'info', 250 type: 'info',
...@@ -270,9 +252,21 @@ const tableBtnClick = (scope, btn) => { ...@@ -270,9 +252,21 @@ const tableBtnClick = (scope, btn) => {
270 }); 252 });
271 }); 253 });
272 } else if (type === 'path_detail') { // 详情 254 } else if (type === 'path_detail') { // 详情
255 if (row.registerApproveState == 'Y') {
256 router.push({
257 name: 'registerDetail',
258 query: { guid: row.registerGuid, evaGuid: row.guid, type: 'qualityEvaluate', daTenantGuid: row.tenantGuid }
259 });
260 } else {
261 router.push({
262 name: 'registerCatalogDetail',
263 query: { guid: row.damGuid, type: 'asset' }
264 });
265 }
266 } else if (type == 'productDetail') {
273 router.push({ 267 router.push({
274 name: 'registerDetail', 268 name: 'registerCatalogDetail',
275 query: { guid: row.registerGuid, evaGuid: row.guid, type: 'qualityEvaluate', daTenantGuid: row.tenantGuid } 269 query: { guid: row.damGuid, type: 'asset' }
276 }); 270 });
277 } 271 }
278 }; 272 };
...@@ -311,6 +305,8 @@ const delTableOpen = (msg, type, isBatch: boolean = false) => { ...@@ -311,6 +305,8 @@ const delTableOpen = (msg, type, isBatch: boolean = false) => {
311 const tablePageChange = (info) => { 305 const tablePageChange = (info) => {
312 page.value.curr = Number(info.curr); 306 page.value.curr = Number(info.curr);
313 page.value.limit = Number(info.limit); 307 page.value.limit = Number(info.limit);
308 tableInfo.value.page.curr = page.value.curr;
309 tableInfo.value.page.limit = page.value.limit;
314 getTableData(); 310 getTableData();
315 }; 311 };
316 312
...@@ -318,13 +314,13 @@ const formItems = ref([{ ...@@ -318,13 +314,13 @@ const formItems = ref([{
318 label: '资产名称', 314 label: '资产名称',
319 type: 'select', 315 type: 'select',
320 placeholder: '请选择', 316 placeholder: '请选择',
321 field: 'registerGuid', 317 field: 'damGuid',
322 default: '', 318 default: '',
323 block: true, 319 block: true,
324 options: assetListData.value, 320 options: assetListData.value,
325 props: { 321 props: {
326 value: 'guid', 322 value: 'guid',
327 label: 'daName' 323 label: 'damName'
328 }, 324 },
329 visible: true, 325 visible: true,
330 required: true 326 required: true
...@@ -333,7 +329,15 @@ const formItems = ref([{ ...@@ -333,7 +329,15 @@ const formItems = ref([{
333 tip: '支持格式:xls .xlsx .doc .docx .rar .zip', 329 tip: '支持格式:xls .xlsx .doc .docx .rar .zip',
334 type: 'upload-file', 330 type: 'upload-file',
335 accept: '.xls, .xlsx, .doc, .docx, .rar, .zip', 331 accept: '.xls, .xlsx, .doc, .docx, .rar, .zip',
336 templateUrl: null, 332 templateUrl: 'auto',
333 templateClick: () => {
334 const link = document.createElement('a');
335 link.href = "/files/数据质量评价.docx";
336 link.download = '数据质量评价.docx';
337 document.body.appendChild(link);
338 link.click();
339 link.remove();
340 },
337 required: true, 341 required: true,
338 block: true, 342 block: true,
339 visible: true, 343 visible: true,
...@@ -342,8 +346,8 @@ const formItems = ref([{ ...@@ -342,8 +346,8 @@ const formItems = ref([{
342 }]); 346 }]);
343 347
344 const formRules = ref({ 348 const formRules = ref({
345 registerGuid: [ 349 damGuid: [
346 { required: true, trigger: 'change', message: "请填写资产名称" } 350 { required: true, trigger: 'change', message: "请选择资产名称" }
347 ], 351 ],
348 qualityEvaluationFile: [{ 352 qualityEvaluationFile: [{
349 validator: (rule: any, value: any, callback: any) => { 353 validator: (rule: any, value: any, callback: any) => {
...@@ -378,64 +382,64 @@ const dialogInfo = ref({ ...@@ -378,64 +382,64 @@ const dialogInfo = ref({
378 footer: { 382 footer: {
379 btns: [ 383 btns: [
380 { type: "default", label: "取消", value: "cancel" }, 384 { type: "default", label: "取消", value: "cancel" },
381 { type: "primary", label: "确定", value: "submit" }, 385 { type: "primary", label: "确定", value: "submit", loading: false },
382 ], 386 ],
383 }, 387 },
384 }); 388 });
385 389
386 const savePromise: any = ref(null);
387 const reSubmitPromise: any = ref(null);
388
389 /** 编辑质量评价发起资产申请按钮处理。 */ 390 /** 编辑质量评价发起资产申请按钮处理。 */
390 const dialogBtnClick = (btn, info) => { 391 const dialogBtnClick = (btn, info) => {
391 if (btn.value == 'submit') { 392 if (btn.value == 'submit') {
392 if (dialogInfo.value.type == 'reSubmit') { 393 dialogInfo.value.footer.btns[1].loading = true;
393 if (reSubmitPromise.value) { 394 getProcessNodesPromise({
394 return; 395 deploymentId: deploymentId.value,
395 } 396 processInstanceId: null,
396 reSubmitPromise.value = updatQuality({ 397 }).then((res: any) => {
397 guid: currTableData.value.guid, 398 if (res?.code == proxy.$passCode) {
398 tenantGuid: userData.tenantGuid, 399 if (dialogInfo.value.type == 'reSubmit') {
399 registerGuid: currTableData.value.registerGuid, 400 updatQuality({
400 daName: currTableData.value.daName, 401 guid: currTableData.value.guid,
401 registerTime: currTableData.value.registerTime, 402 tenantGuid: userData.tenantGuid,
402 issuingEntityGuid: currTableData.value.issuingEntityGuid, 403 damGuid: currTableData.value.damGuid,
403 qualityEvaluationFile: info.qualityEvaluationFile?.map(f => f.url) || [] 404 daName: currTableData.value.daName,
404 }).then((res: any) => { 405 immediateApprove: true,
405 reSubmitPromise.value = null; 406 issuingEntityGuid: res.data?.[1]?.candidateUsers?.[0]?.staffGuid,
406 if (res?.code == proxy.$passCode) { 407 qualityEvaluationFile: info.qualityEvaluationFile?.map(f => f.url) || []
407 ElMessage.success('该资产质量评价重新提交成功'); 408 }).then((res: any) => {
408 dialogInfo.value.visible = false; 409 if (res?.code == proxy.$passCode) {
409 page.value.curr = 1; 410 ElMessage.success('该资产质量评价重新提交成功');
410 getTableData(); 411 dialogInfo.value.visible = false;
412 page.value.curr = 1;
413 getTableData();
414 } else {
415 ElMessage.error(res.msg);
416 }
417 })
411 } else { 418 } else {
412 ElMessage.error(res.msg); 419 let daInfo = assetListData.value.find(a => a.guid == info.damGuid);
420 saveQuality({
421 tenantGuid: userData.tenantGuid,
422 damGuid: info.damGuid,
423 daName: daInfo.damName,
424 immediateApprove: true,
425 // registerTime: daInfo.registerTime,
426 issuingEntityGuid: res.data?.[1]?.candidateUsers?.[0]?.staffGuid,
427 qualityEvaluationFile: info.qualityEvaluationFile?.map(f => f.url) || []
428 }).then((res: any) => {
429 if (res?.code == proxy.$passCode) {
430 ElMessage.success('质量评价发起成功');
431 dialogInfo.value.visible = false;
432 page.value.curr = 1;
433 getTableData();
434 } else {
435 ElMessage.error(res.msg);
436 }
437 })
413 } 438 }
414 }) 439 } else {
415 } else { 440 ElMessage.error(res.msg);
416 if (savePromise.value) {
417 return;
418 } 441 }
419 let daInfo = assetListData.value.find(a => a.guid == info.registerGuid); 442 })
420 savePromise.value = saveQuality({
421 tenantGuid: userData.tenantGuid,
422 registerGuid: info.registerGuid,
423 daName: daInfo.daName,
424 registerTime: daInfo.registerTime,
425 issuingEntityGuid: daInfo.exchangeGuid,
426 qualityEvaluationFile: info.qualityEvaluationFile?.map(f => f.url) || []
427 }).then((res: any) => {
428 savePromise.value = null;
429 if (res?.code == proxy.$passCode) {
430 ElMessage.success('质量评价发起成功');
431 dialogInfo.value.visible = false;
432 page.value.curr = 1;
433 getTableData();
434 } else {
435 ElMessage.error(res.msg);
436 }
437 })
438 }
439 } else if (btn.value == 'cancel') { 443 } else if (btn.value == 'cancel') {
440 dialogInfo.value.visible = false; 444 dialogInfo.value.visible = false;
441 } 445 }
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!