9a7bc015 by xukangle

Merge branch 'develop' into dev_20241202_xukangle

2 parents e290eaa5 3344e345
This diff could not be displayed because it is too large.
No preview for this file type
No preview for this file type
......@@ -77,3 +77,15 @@ export const onUploadFilePreview = async (params) => {
}
});
}
// 设置显示的文件名
export const setFileName = (name) => {
if(name && name.indexOf('_') > -1){
const s = name.indexOf("_");
const e = name.indexOf(".");
const newName = name.slice(0, s) + name.slice(e);
return newName
} else {
return name || '--';
}
}
......
......@@ -108,7 +108,7 @@ export const updatQuality = (params) => request({
/** 获取可以发起资产质量评价的选项列表。 */
/** type: 1 质量评价;2 资产评估 */
export const getRegisteredList = (type) => request({
url: `${import.meta.env.VITE_API_NEW_PORTAL}/register-base/get-valid-list?type=${type}`,
url: `${import.meta.env.VITE_API_NEW_PORTAL}/dam-catalog-table/get-valid-list?type=${type}`,
method: 'get'
})
......
......@@ -400,7 +400,8 @@ const downloadTemplate = async (url) => {
}
const onUploadFileDownload = async (file, item) => {
let url = file.url;
let f = formInline.value[item.field].find(i => i.name == file.name);
let url = f.url;
const refSignInfo: any = await getDownFileSignByUrl(parseAndDecodeUrl(url).fileName);
if (!refSignInfo?.data) {
refSignInfo?.msg && ElMessage.error(refSignInfo?.msg);
......@@ -493,6 +494,7 @@ const uploadFile = (file, item) => {
actualSignedRequestHeaders: res.data.actualSignedRequestHeaders
}).then(() => {
if (res.code == '00000') {
file.file.url = res.data.signedUrl;
let fileItem = {
name: file.file.name,
url: res.data.signedUrl,
......@@ -1279,7 +1281,7 @@ const panelChange = (scope, row) => {
<template #trigger>
<el-button :disabled="child.disabled" :icon="Upload" class="mr8">上传文件</el-button>
</template>
<el-button :icon="Download" v-if="child.templateUrl" @click="downloadTemplate(child.templateUrl)">
<el-button :icon="Download" v-if="child.templateUrl" @click="(child.templateUrl == 'auto' && child.templateClick) ? child.templateClick() : downloadTemplate(child.templateUrl)">
下载模板
</el-button>
<template #tip>
......@@ -1360,7 +1362,7 @@ const panelChange = (scope, row) => {
<template #trigger>
<el-button :disabled="item.disabled" :icon="Upload" class="mr8">上传文件</el-button>
</template>
<el-button :icon="Download" v-if="item.templateUrl" @click="downloadTemplate(item.templateUrl)">
<el-button :icon="Download" v-if="item.templateUrl" @click="(item.templateUrl == 'auto' && item.templateClick) ? item.templateClick() : downloadTemplate(item.templateUrl)">
下载模板
</el-button>
<template #tip>
......
......@@ -18,10 +18,8 @@ import {
updatQuality
} from "@/api/modules/dataAsset";
import useUserStore from "@/store/modules/user";
import {
getTenantAttach
} from "@/api/modules/queryService";
import useDataAssetStore from "@/store/modules/dataAsset";
import { passFlowData, rejectFlowData, revokeFlowData, getCamundaDeploymentId, getProcessNodesPromise } from "@/api/modules/workFlowService";
const assetStore = useDataAssetStore();
......@@ -31,36 +29,26 @@ const { proxy } = getCurrentInstance() as any;
const userStore = useUserStore();
const userData = JSON.parse(userStore.userData)
/** 是否时企业端。不是企业端,则是服务端,需要显示企业名称。 */
const isCompanyPlatform = ref(userData.tenantType == 1);
/** 数据来源于该企业申请登记的数据资产已通过且剔除数据质量评价中已通过、审批中的资产。 */
const assetListData: any = ref([]);
/** 会员附件模板 */
const attachDataInfo: any = ref({});
const tableFields = ref([
{ label: "序号", type: "index", width: 56, align: "center" },
{ label: "资产名称", field: "daName", width: 160, align: "left" },
{ label: "资产名称", field: "daName", width: 160, align: "left", type: 'text_btn', value: 'productDetail', columClass: 'text_btn' },
{ label: "登记时间", field: "registerTime", width: 120 },
// { label: "企业名称", field: "tenantName", width: 240, align: "left" },
{ label: "评估机构", field: "issuingEntityName", width: 250, align: "left" },
{ label: "状态", field: "approveState", type: "tag", width: 96, align: 'center' },
]);
const deploymentId = ref('');
onBeforeMount(() => {
if (isCompanyPlatform.value) {
tableInfo.value.fields = tableFields.value;
} else {
tableFields.value.splice(3, 0, { label: "企业名称", field: "tenantName", width: 250, align: "left" })
tableInfo.value.fields = tableFields.value;
}
getTenantAttach(userData.tenantGuid).then((res: any) => {
if (res?.code == proxy.$passCode) {
attachDataInfo.value = res.data || {};
formItems.value[1].templateUrl = attachDataInfo.value.quality_evaluation_file;
getCamundaDeploymentId('10018').then((res: any) => {
if (res.code == proxy.$passCode) {
deploymentId.value = res.data;
} else {
ElMessage.error(res.msg);
proxy.$ElMessage.error(res.msg);
}
})
});
......@@ -240,29 +228,23 @@ const tableBtnClick = (scope, btn) => {
}
passFormItems.value[2].placeholder = `本次评估数据资产总体质量得分为**分\n准确性:\n一致性:\n可访问性:\n规范性:\n完整性:`;
} else if (type === 'revoke') { // 撤销,状态为审批中时可以撤销。
ElMessageBox.confirm('确定撤销该资产质量评价吗?', "提示", {
ElMessageBox.confirm(`撤销后,该流程将不再进行审核,确定这样操作吗?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: 'warning',
}).then(() => {
let params = {
bizGuid: row.guid,
funcCode: row.funcCode
}
tableInfo.value.loading = true;
registerApproveCancel(params).then((res: any) => {
tableInfo.value.loading = false;
if (res?.code == proxy.$passCode) {
if (res.data) {
ElMessage.success('该资产质量评价流程撤销成功!');
getTableData();
} else {
ElMessage.error('该资产质量评价流程撤销失败!');
}
revokeFlowData({
guid: row.approveVO.approveGuid,
flowType: row.approveVO.flowType,
approveStaffGuid: userData.staffGuid,
}).then((res: any) => {
if (res.code == '00000') {
ElMessage.success('撤销成功!')
getTableData();
} else {
ElMessage.error(res.msg);
ElMessage.error(res.msg)
}
});
})
}).catch(() => {
ElMessage({
type: 'info',
......@@ -270,9 +252,21 @@ const tableBtnClick = (scope, btn) => {
});
});
} else if (type === 'path_detail') { // 详情
if (row.registerApproveState == 'Y') {
router.push({
name: 'registerDetail',
query: { guid: row.registerGuid, evaGuid: row.guid, type: 'qualityEvaluate', daTenantGuid: row.tenantGuid }
});
} else {
router.push({
name: 'registerCatalogDetail',
query: { guid: row.damGuid, type: 'asset' }
});
}
} else if (type == 'productDetail') {
router.push({
name: 'registerDetail',
query: { guid: row.registerGuid, evaGuid: row.guid, type: 'qualityEvaluate', daTenantGuid: row.tenantGuid }
name: 'registerCatalogDetail',
query: { guid: row.damGuid, type: 'asset' }
});
}
};
......@@ -311,6 +305,8 @@ const delTableOpen = (msg, type, isBatch: boolean = false) => {
const tablePageChange = (info) => {
page.value.curr = Number(info.curr);
page.value.limit = Number(info.limit);
tableInfo.value.page.curr = page.value.curr;
tableInfo.value.page.limit = page.value.limit;
getTableData();
};
......@@ -318,13 +314,13 @@ const formItems = ref([{
label: '资产名称',
type: 'select',
placeholder: '请选择',
field: 'registerGuid',
field: 'damGuid',
default: '',
block: true,
options: assetListData.value,
props: {
value: 'guid',
label: 'daName'
label: 'damName'
},
visible: true,
required: true
......@@ -333,7 +329,15 @@ const formItems = ref([{
tip: '支持格式:xls .xlsx .doc .docx .rar .zip',
type: 'upload-file',
accept: '.xls, .xlsx, .doc, .docx, .rar, .zip',
templateUrl: null,
templateUrl: 'auto',
templateClick: () => {
const link = document.createElement('a');
link.href = "/files/数据质量评价.docx";
link.download = '数据质量评价.docx';
document.body.appendChild(link);
link.click();
link.remove();
},
required: true,
block: true,
visible: true,
......@@ -342,8 +346,8 @@ const formItems = ref([{
}]);
const formRules = ref({
registerGuid: [
{ required: true, trigger: 'change', message: "请填写资产名称" }
damGuid: [
{ required: true, trigger: 'change', message: "请选择资产名称" }
],
qualityEvaluationFile: [{
validator: (rule: any, value: any, callback: any) => {
......@@ -378,64 +382,64 @@ const dialogInfo = ref({
footer: {
btns: [
{ type: "default", label: "取消", value: "cancel" },
{ type: "primary", label: "确定", value: "submit" },
{ type: "primary", label: "确定", value: "submit", loading: false },
],
},
});
const savePromise: any = ref(null);
const reSubmitPromise: any = ref(null);
/** 编辑质量评价发起资产申请按钮处理。 */
const dialogBtnClick = (btn, info) => {
if (btn.value == 'submit') {
if (dialogInfo.value.type == 'reSubmit') {
if (reSubmitPromise.value) {
return;
}
reSubmitPromise.value = updatQuality({
guid: currTableData.value.guid,
tenantGuid: userData.tenantGuid,
registerGuid: currTableData.value.registerGuid,
daName: currTableData.value.daName,
registerTime: currTableData.value.registerTime,
issuingEntityGuid: currTableData.value.issuingEntityGuid,
qualityEvaluationFile: info.qualityEvaluationFile?.map(f => f.url) || []
}).then((res: any) => {
reSubmitPromise.value = null;
if (res?.code == proxy.$passCode) {
ElMessage.success('该资产质量评价重新提交成功');
dialogInfo.value.visible = false;
page.value.curr = 1;
getTableData();
dialogInfo.value.footer.btns[1].loading = true;
getProcessNodesPromise({
deploymentId: deploymentId.value,
processInstanceId: null,
}).then((res: any) => {
if (res?.code == proxy.$passCode) {
if (dialogInfo.value.type == 'reSubmit') {
updatQuality({
guid: currTableData.value.guid,
tenantGuid: userData.tenantGuid,
damGuid: currTableData.value.damGuid,
daName: currTableData.value.daName,
immediateApprove: true,
issuingEntityGuid: res.data?.[1]?.candidateUsers?.[0]?.staffGuid,
qualityEvaluationFile: info.qualityEvaluationFile?.map(f => f.url) || []
}).then((res: any) => {
if (res?.code == proxy.$passCode) {
ElMessage.success('该资产质量评价重新提交成功');
dialogInfo.value.visible = false;
page.value.curr = 1;
getTableData();
} else {
ElMessage.error(res.msg);
}
})
} else {
ElMessage.error(res.msg);
let daInfo = assetListData.value.find(a => a.guid == info.damGuid);
saveQuality({
tenantGuid: userData.tenantGuid,
damGuid: info.damGuid,
daName: daInfo.damName,
immediateApprove: true,
// registerTime: daInfo.registerTime,
issuingEntityGuid: res.data?.[1]?.candidateUsers?.[0]?.staffGuid,
qualityEvaluationFile: info.qualityEvaluationFile?.map(f => f.url) || []
}).then((res: any) => {
if (res?.code == proxy.$passCode) {
ElMessage.success('质量评价发起成功');
dialogInfo.value.visible = false;
page.value.curr = 1;
getTableData();
} else {
ElMessage.error(res.msg);
}
})
}
})
} else {
if (savePromise.value) {
return;
} else {
ElMessage.error(res.msg);
}
let daInfo = assetListData.value.find(a => a.guid == info.registerGuid);
savePromise.value = saveQuality({
tenantGuid: userData.tenantGuid,
registerGuid: info.registerGuid,
daName: daInfo.daName,
registerTime: daInfo.registerTime,
issuingEntityGuid: daInfo.exchangeGuid,
qualityEvaluationFile: info.qualityEvaluationFile?.map(f => f.url) || []
}).then((res: any) => {
savePromise.value = null;
if (res?.code == proxy.$passCode) {
ElMessage.success('质量评价发起成功');
dialogInfo.value.visible = false;
page.value.curr = 1;
getTableData();
} else {
ElMessage.error(res.msg);
}
})
}
})
} else if (btn.value == 'cancel') {
dialogInfo.value.visible = false;
}
......
......@@ -31,7 +31,7 @@ import {
import { passFlowData, rejectFlowData, revokeFlowData } from "@/api/modules/workFlowService";
import useDataAssetStore from "@/store/modules/dataAsset";
import { changeNum, getDownloadUrl, download } from '@/utils/common';
import { onUploadFilePreview, onUploadFileDownload } from '@/api/modules/common';
import { onUploadFilePreview, onUploadFileDownload, setFileName } from '@/api/modules/common';
const assetStore = useDataAssetStore();
......@@ -1375,7 +1375,7 @@ const formattedDate = (dateVal) => {
v-else-if="item.name.substring(item.name.lastIndexOf('.') + 1) == 'jpg' || item.name.substring(item.name.lastIndexOf('.') + 1) == 'jpeg'">
<img class="file-img" src="../../assets/images/jpg.png" />
</template>
<div class="file-name">{{ item.name }}</div>
<div class="file-name">{{ setFileName(item.name) }}</div>
<div :style="{ right: '36px' }"
v-if="item.name.substring(item.name.lastIndexOf('.') + 1) == 'pdf' || item.name.substring(item.name.lastIndexOf('.') + 1) == 'png' || item.name.substring(item.name.lastIndexOf('.') + 1) == 'jpg' || item.name.substring(item.name.lastIndexOf('.') + 1) == 'jpeg'"
class="file-preview" @click="onUploadFilePreview(item)">查看</div>
......@@ -1413,7 +1413,7 @@ const formattedDate = (dateVal) => {
v-else-if="item.name.substring(item.name.lastIndexOf('.') + 1) == 'jpg' || item.name.substring(item.name.lastIndexOf('.') + 1) == 'jpeg'">
<img class="file-img" src="../../assets/images/jpg.png" />
</template>
<div class="file-name">{{ item.name }}</div>
<div class="file-name">{{ setFileName(item.name) }}</div>
<div :style="{ right: '36px' }"
v-if="item.name.substring(item.name.lastIndexOf('.') + 1) == 'pdf' || item.name.substring(item.name.lastIndexOf('.') + 1) == 'png' || item.name.substring(item.name.lastIndexOf('.') + 1) == 'jpg' || item.name.substring(item.name.lastIndexOf('.') + 1) == 'jpeg'"
class="file-preview" @click="onUploadFilePreview(item)">查看</div>
......@@ -1451,7 +1451,7 @@ const formattedDate = (dateVal) => {
v-else-if="item.name.substring(item.name.lastIndexOf('.') + 1) == 'jpg' || item.name.substring(item.name.lastIndexOf('.') + 1) == 'jpeg'">
<img class="file-img" src="../../assets/images/jpg.png" />
</template>
<div class="file-name">{{ item.name }}</div>
<div class="file-name">{{ setFileName(item.name) }}</div>
<div :style="{ right: '36px' }"
v-if="item.name.substring(item.name.lastIndexOf('.') + 1) == 'pdf' || item.name.substring(item.name.lastIndexOf('.') + 1) == 'png' || item.name.substring(item.name.lastIndexOf('.') + 1) == 'jpg' || item.name.substring(item.name.lastIndexOf('.') + 1) == 'jpeg'"
class="file-preview" @click="onUploadFilePreview(item)">查看</div>
......@@ -1489,7 +1489,7 @@ const formattedDate = (dateVal) => {
v-else-if="item.name.substring(item.name.lastIndexOf('.') + 1) == 'jpg' || item.name.substring(item.name.lastIndexOf('.') + 1) == 'jpeg'">
<img class="file-img" src="../../assets/images/jpg.png" />
</template>
<div class="file-name">{{ item.name }}</div>
<div class="file-name">{{ setFileName(item.name) }}</div>
<div :style="{ right: '36px' }"
v-if="item.name.substring(item.name.lastIndexOf('.') + 1) == 'pdf' || item.name.substring(item.name.lastIndexOf('.') + 1) == 'png' || item.name.substring(item.name.lastIndexOf('.') + 1) == 'jpg' || item.name.substring(item.name.lastIndexOf('.') + 1) == 'jpeg'"
class="file-preview" @click="onUploadFilePreview(item)">查看</div>
......@@ -1531,7 +1531,7 @@ const formattedDate = (dateVal) => {
v-else-if="item.name.substring(item.name.lastIndexOf('.') + 1) == 'jpg' || item.name.substring(item.name.lastIndexOf('.') + 1) == 'jpeg'">
<img class="file-img" src="../../assets/images/jpg.png" />
</template>
<div class="file-name">{{ item.name }}</div>
<div class="file-name">{{ setFileName(item.name) }}</div>
<div :style="{ right: '36px' }"
v-if="item.name.substring(item.name.lastIndexOf('.') + 1) == 'pdf' || item.name.substring(item.name.lastIndexOf('.') + 1) == 'png' || item.name.substring(item.name.lastIndexOf('.') + 1) == 'jpg' || item.name.substring(item.name.lastIndexOf('.') + 1) == 'jpeg'"
class="file-preview" @click="onUploadFilePreview(item)">查看</div>
......@@ -1572,7 +1572,7 @@ const formattedDate = (dateVal) => {
v-else-if="item.name.substring(item.name.lastIndexOf('.') + 1) == 'jpg' || item.name.substring(item.name.lastIndexOf('.') + 1) == 'jpeg'">
<img class="file-img" src="../../assets/images/jpg.png" />
</template>
<div class="file-name">{{ item.name }}</div>
<div class="file-name">{{ setFileName(item.name) }}</div>
<div :style="{ right: '36px' }"
v-if="item.name.substring(item.name.lastIndexOf('.') + 1) == 'pdf' || item.name.substring(item.name.lastIndexOf('.') + 1) == 'png' || item.name.substring(item.name.lastIndexOf('.') + 1) == 'jpg' || item.name.substring(item.name.lastIndexOf('.') + 1) == 'jpeg'"
class="file-preview" @click="onUploadFilePreview(item)">查看</div>
......@@ -1610,7 +1610,7 @@ const formattedDate = (dateVal) => {
v-else-if="item.name.substring(item.name.lastIndexOf('.') + 1) == 'jpg' || item.name.substring(item.name.lastIndexOf('.') + 1) == 'jpeg'">
<img class="file-img" src="../../assets/images/jpg.png" />
</template>
<div class="file-name">{{ item.name }}</div>
<div class="file-name">{{ setFileName(item.name) }}</div>
<div :style="{ right: '36px' }"
v-if="item.name.substring(item.name.lastIndexOf('.') + 1) == 'pdf' || item.name.substring(item.name.lastIndexOf('.') + 1) == 'png' || item.name.substring(item.name.lastIndexOf('.') + 1) == 'jpg' || item.name.substring(item.name.lastIndexOf('.') + 1) == 'jpeg'"
class="file-preview" @click="onUploadFilePreview(item)">查看</div>
......@@ -1651,7 +1651,7 @@ const formattedDate = (dateVal) => {
v-else-if="item.name.substring(item.name.lastIndexOf('.') + 1) == 'jpg' || item.name.substring(item.name.lastIndexOf('.') + 1) == 'jpeg'">
<img class="file-img" src="../../assets/images/jpg.png" />
</template>
<div class="file-name">{{ item.name }}</div>
<div class="file-name">{{ setFileName(item.name) }}</div>
<div :style="{ right: '36px' }" class="file-preview"
v-if="item.name.substring(item.name.lastIndexOf('.') + 1) == 'pdf' || item.name.substring(item.name.lastIndexOf('.') + 1) == 'png' || item.name.substring(item.name.lastIndexOf('.') + 1) == 'jpg' || item.name.substring(item.name.lastIndexOf('.') + 1) == 'jpeg'"
@click="onUploadFilePreview(item)">查看</div>
......@@ -1689,7 +1689,7 @@ const formattedDate = (dateVal) => {
v-else-if="item.name.substring(item.name.lastIndexOf('.') + 1) == 'jpg' || item.name.substring(item.name.lastIndexOf('.') + 1) == 'jpeg'">
<img class="file-img" src="../../assets/images/jpg.png" />
</template>
<div class="file-name">{{ item.name }}</div>
<div class="file-name">{{ setFileName(item.name) }}</div>
<div :style="{ right: '36px' }"
v-if="item.name.substring(item.name.lastIndexOf('.') + 1) == 'pdf' || item.name.substring(item.name.lastIndexOf('.') + 1) == 'png' || item.name.substring(item.name.lastIndexOf('.') + 1) == 'jpg' || item.name.substring(item.name.lastIndexOf('.') + 1) == 'jpeg'"
class="file-preview" @click="onUploadFilePreview(item)">查看</div>
......
......@@ -29,6 +29,7 @@ import {
getRegisterCatalogList
} from '@/api/modules/dataAsset';
import { getCamundaDeploymentId } from "@/api/modules/workFlowService"
import { setFileName } from '@/api/modules/common';
import useDataAssetStore from "@/store/modules/dataAsset";
import { useValidator } from '@/hooks/useValidator';
......@@ -309,16 +310,32 @@ const setUploadFormItemsValue = (info) => {
let attach = info.registerAttachment || {}
uploadFormItems.value.forEach(item => {
if (item.field == 'registerLetter') {
item.default = attach.registerLetter || [];
let registerLetter = attach.registerLetter ? attach.registerLetter : [];
if(registerLetter.length){
registerLetter[0].name = setFileName(registerLetter[0].name)
}
item.default = registerLetter;
item.templateUrl = attachDataInfo.value.register_letter;
} else if (item.field == 'evaluationFile') {
item.default = attach.evaluationFile || [];
let evaluationFile = attach.evaluationFile ? attach.evaluationFile : [];
if(evaluationFile.length){
evaluationFile[0].name = setFileName(evaluationFile[0].name)
}
item.default = evaluationFile;
item.templateUrl = attachDataInfo.value.quality_evaluation_file;
} else if (item.field == 'assessmentFile') {
item.default = attach.assessmentFile || [];
let assessmentFile = attach.assessmentFile ? attach.assessmentFile : [];
if(assessmentFile.length){
assessmentFile[0].name = setFileName(assessmentFile[0].name)
}
item.default = assessmentFile;
item.templateUrl = attachDataInfo.value.cost_assessment_file;
} else if (item.field === 'commitmentLetter') {
item.default = attach.commitmentLetter || [];
let commitmentLetter = attach.commitmentLetter ? attach.commitmentLetter : [];
if(commitmentLetter.length){
commitmentLetter[0].name = setFileName(commitmentLetter[0].name)
}
item.default = commitmentLetter;
item.templateUrl = attachDataInfo.value['commitment-letter'];
} else if (item.field === 'costAssessmentInstitutionGuid') {
item.default = attach.costAssessmentInstitutionGuid ? attach.costAssessmentInstitutionGuid : attach.costAssessmentInstitution;
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!