b68ea3d6 by lxs

数据资产登记更新

1 parent 3b9357a6
......@@ -35,7 +35,7 @@ const routes: RouteRecordRaw[] = [
reuse: true
},
beforeEnter: (to, from) => {
to.meta.title = to.query.type == 'edit' ? `编辑-${to.query.name}` : '新建资产登记';
to.meta.title = to.query.type == 'create' ? '新建资产登记' : `编辑-${to.query.name}`;
to.meta.editPage = true;
}
},
......
......@@ -4,7 +4,7 @@ import router from '@/router'
import { ElMessage } from 'element-plus'
import apiUser from '@/api/modules/user'
import { getCurrentTime } from '@/utils/common'
import { getSystemMenu, getUserInfo, getTokenByCode, loginOut, refreshToken, editPasswordInterface, getCurrentUserInfo, getCurrentUserInfo } from '@/api/modules/queryService'
import { getSystemMenu, getUserInfo, getTokenByCode, loginOut, refreshToken, editPasswordInterface, getCurrentUserInfo } from '@/api/modules/queryService'
const useUserStore = defineStore(
// 唯一ID
......
......@@ -692,4 +692,4 @@ const rejectDialogBtnClick = (btn, info) => {
.container_wrap {
padding: 0 16px;
}
</style>
\ No newline at end of file
</style>
......
......@@ -8,21 +8,8 @@ import TableTools from "@/components/Tools/table_tools.vue";
import { ElMessage, ElMessageBox } from 'element-plus';
import { useRouter, useRoute } from "vue-router";
import { MoreFilled } from "@element-plus/icons-vue";
import {
changeNum,
tagMethod,
tagType,
} from "@/utils/common";
import {
getRegisterList,
registerDelete,
registerApproveCancel,
registerApproveReSubmit,
registerApproveAllow,
registerApproveBackup,
getRegisterTenant,
getExchangeList
} from "@/api/modules/dataAsset";
import { changeNum, tagMethod, tagType, } from "@/utils/common";
import { getRegisterList, registerDelete, getExchangeList } from "@/api/modules/dataAsset";
import { passFlowData, rejectFlowData, revokeFlowData } from "@/api/modules/workFlowService";
import useDataAssetStore from "@/store/modules/dataAsset";
import useUserStore from "@/store/modules/user";
......@@ -108,7 +95,39 @@ const tableFields = ref([{ label: "序号", type: "index", width: 56, align: "ce
return scope.row['ownIndustryName']?.join(',')
}
},
{ label: "状态", field: "approveState", type: "tag", width: 96, align: 'center' },
{
label: "状态", field: "approveState", type: "tag", width: 96, align: 'center', getName: (scope) => {
const approveVO = scope.row.approveVO || {}
switch (approveVO.approveState) {
case 'N':
return '草稿中';
case 'A':
return '审批中';
case 'Y':
return '已通过';
case 'R':
return '已驳回';
case 'C':
return '已撤销';
case 'I':
return '--';
default:
return '草稿中';
}
}, tagType: (scope) => {
const approveVO = scope.row.approveVO || {}
switch (approveVO.approveState) {
case 'A':
return 'warning';
case 'Y':
return 'success';
case 'R':
return 'danger';
default:
return 'info';
}
}
},
{ label: "修改人", field: "updateUserName", width: 140 },
{ label: "修改时间", field: "updateTime", width: 180 }]);
......@@ -134,7 +153,7 @@ const tableInfo = ref({
actionInfo: {
label: "操作",
type: "btn",
width: 160,
width: 180,
btns: (scope) => {
let row = scope.row;
return getTableBtns(row);
......@@ -143,34 +162,45 @@ const tableInfo = ref({
});
const getTableBtns = (row, includeDetail = true) => {
console.log(userData)
let btnsArr: any[] = [];
if (row.approveState == 'N') {//只有草稿中的详情是可以编辑的
includeDetail && btnsArr.push({ label: "编辑", value: "edit" })
if (row.tenantGuid == userData.tenantGuid) {
btnsArr.push({ label: "删除", value: "delete" });
}
} else if (row.approveState == 'A') {//审批中
includeDetail && btnsArr.push({ label: "详情", value: "path_detail" })
if (row.tenantGuid == userData.tenantGuid) {
btnsArr.push({ label: "撤销", value: "revoke" });
}
if (row.approveTenantGuids?.includes(userData.tenantGuid)) {
btnsArr.push({ label: "通过", value: "pass" });
btnsArr.push({ label: "驳回", value: "backup" });
}
} else if (row.approveState == 'Y') {//已通过的不能删除。
includeDetail && btnsArr.push({ label: "详情", value: "path_detail" })
} else if (row.approveState == 'R' || row.approveState == 'C') {//已驳回或已撤销
includeDetail && btnsArr.push({ label: "编辑", value: "edit" });
if (row.tenantGuid == userData.tenantGuid) {
btnsArr.push({ label: "重新提交", value: "edit", disabled: false })
}
if (row.tenantGuid == userData.tenantGuid) {
btnsArr.push({ label: "删除", value: "delete" });
const approveVO = row.approveVO;
const currentStaffGuid = userData.staffGuid
const bizApproveState = row.approveState;
const approveState = approveVO?.approveState || 'N';
const approveStaffGuids = approveVO?.approveStaffGuids || [];
const staffGuid = approveVO?.staffGuid || '';
let isShowCancel = false;
let flowState;
if (approveState == 'N') {
flowState = 1;
}
if (approveState == 'A' && approveStaffGuids.indexOf(currentStaffGuid) > -1) {
flowState = 2;
}
if ((approveState == 'C' || approveState == 'R') && staffGuid == currentStaffGuid) {
flowState = 3;
}
if (approveVO && approveVO.approveState == 'A' && staffGuid == currentStaffGuid) {
isShowCancel = true;
}
if (flowState === 1) {
btnsArr = [{ label: "编辑", value: "edit" }, { label: "删除", value: "delete" }]
} else {
btnsArr.push({ label: "详情", value: "detail" })
if (flowState === 2) {
btnsArr.push(...[{ label: "通过", value: "pass" }, { label: "驳回", value: "reject" }])
if (isShowCancel) {
btnsArr.push({ label: "撤销", value: "revoke" })
}
} else if (flowState === 3) {
if (bizApproveState != 'D') {
btnsArr.push({ label: "重新提交", value: "edit" })
}
btnsArr.push({ label: "删除", value: "delete" })
}
}
return btnsArr;
return btnsArr
}
const currTableData: any = ref({});
......@@ -195,6 +225,7 @@ const tableBtnClick = (scope, btn) => {
const row = scope.row;
currTableData.value = row;
if (type === "edit") { //草稿中\已驳回\已撤销\已通过 状态,才可以编辑。
localStorage.setItem('isRestart', btn.label == '重新提交' ? 'true' : '');
router.push({
name: 'registerStart',
query: { guid: row.guid, damGuid: row.damGuid, name: row.daName, type }
......@@ -207,24 +238,26 @@ const tableBtnClick = (scope, btn) => {
cancelButtonText: "取消",
type: 'warning',
}).then(() => {
listDataLoading.value = true;
loading.value = true;
let params = {
guid: row.approveVO.approveGuid,
flowType: row.approveVO.flowType,
approveStaffGuid: userData.staffGuid,
}
revokeFlowData(params).then((res: any) => {
listDataLoading.value = false;
loading.value = false;
if (res?.code == proxy.$passCode) {
if (res.data) {
ElMessage.success('该审批流程撤销成功!');
row.approveState = "C";
getTableData();
} else {
ElMessage.error('该审批流程撤销失败!');
}
} else {
ElMessage.error(res.msg);
}
}).catch(() => {
loading.value = false;
});
}).catch(() => {
ElMessage({
......@@ -232,25 +265,14 @@ const tableBtnClick = (scope, btn) => {
message: '已取消撤销'
});
});
} else if (type === 'path_detail') { // 详情, 若是草稿中,详情就是编辑,
// if (row.approveState === 'N') {
// router.push({
// name: 'registerStart',
// query: { guid: row.guid, name: row.daName, type: 'detail' }
// });
// } else {
// router.push({
// name: 'registerInfoDetail',
// query: { guid: row.guid, type: 'asset', daTenantGuid: row.tenantGuid }
// });
// }
} else if (type === 'detail') { // 详情, 若是草稿中,详情就是编辑,
router.push({
name: 'registerInfoDetail',
query: { guid: row.guid, name: row.daName, type: 'asset' }
});
} else if (type === 'pass') {
passDialogInfo.value.visible = true;
} else if (type == 'backup') {
} else if (type == 'reject') {
rejectDialogInfo.value.visible = true;
}
};
......@@ -277,7 +299,9 @@ const delTableOpen = (msg, type, isBatch: boolean = false) => {
}).then(() => {
let guids: any = [];
guids = [currTableData.value.guid]
loading.value = true;
registerDelete(guids).then((res: any) => {
loading.value = false;
if (res.code == proxy.$passCode) {
pageInfo.value.curr = 1;
getTableData();
......@@ -291,7 +315,9 @@ const delTableOpen = (msg, type, isBatch: boolean = false) => {
message: res.msg,
});
}
})
}).catch(() => {
loading.value = false;
});
}).catch(() => {
ElMessage({
type: 'info',
......@@ -301,8 +327,7 @@ const delTableOpen = (msg, type, isBatch: boolean = false) => {
};
const getTableData = () => {
listDataLoading.value = true;
tableInfo.value.loading = true;
loading.value = true;
getRegisterList({
pageSize: pageInfo.value.limit,
pageIndex: pageInfo.value.curr,
......@@ -311,17 +336,19 @@ const getTableData = () => {
tenantGuid: pageInfo.value.tenantGuid,
exchangGuid: exchangGuid.value
}).then((res: any) => {
listDataLoading.value = false;
tableInfo.value.loading = false;
loading.value = false;
if (res.code == proxy.$passCode) {
const data = res.data || {}
listData.value = tableInfo.value.data = data.records || [];
// listData.value = tableInfo.value.data = data.records || [];
tableInfo.value.data = data.records || []
pageInfo.value.limit = data.pageSize
pageInfo.value.curr = data.pageIndex
pageInfo.value.rows = data.totalRows
} else {
ElMessage.error(res.msg);
}
}).catch(() => {
loading.value = false;
})
}
......@@ -423,7 +450,7 @@ const passDialogInfo = ref({
const passDialogBtnClick = (btn, info) => {
if (btn.value == 'submit') {
listDataLoading.value = true;
loading.value = true;
let params = {
guid: currTableData.value.approveVO.approveGuid,
flowType: currTableData.value.approveVO.flowType,
......@@ -431,7 +458,7 @@ const passDialogBtnClick = (btn, info) => {
approveStaffGuid: userData.staffGuid,
}
passFlowData(params).then((res: any) => {
listDataLoading.value = false;
loading.value = false;
if (res?.code == proxy.$passCode) {
if (res.data) {
ElMessage.success('审批成功');
......@@ -443,6 +470,8 @@ const passDialogBtnClick = (btn, info) => {
} else {
ElMessage.error(res.msg);
}
}).catch(() => {
loading.value = false;
});
} else if (btn.value == 'cancel') {
passDialogInfo.value.visible = false;
......@@ -491,7 +520,7 @@ const rejectDialogBtnClick = (btn, info) => {
ElMessage.error('请填写驳回理由');
return
}
listDataLoading.value = true;
loading.value = true;
let params = {
guid: currTableData.value.approveVO.approveGuid,
flowType: currTableData.value.approveVO.flowType,
......@@ -499,7 +528,7 @@ const rejectDialogBtnClick = (btn, info) => {
approveStaffGuid: userData.staffGuid,
}
rejectFlowData(params).then((res: any) => {
listDataLoading.value = false;
loading.value = false;
if (res?.code == proxy.$passCode) {
if (res.data) {
ElMessage.success('驳回成功');
......@@ -511,6 +540,8 @@ const rejectDialogBtnClick = (btn, info) => {
} else {
ElMessage.error(res.msg);
}
}).catch(() => {
loading.value = false;
});
} else if (btn.value == 'cancel') {
rejectDialogInfo.value.visible = false;
......
......@@ -407,8 +407,8 @@ onBeforeMount(() => {
const data = res.data || {}
let { approveVO } = data;
draftDetailInfo.value = data;
deploymentId.value = approveVO.camundaDeploymentId;
processInstanceId.value = approveVO.camundaInstanceId
deploymentId.value = approveVO?.camundaDeploymentId;
processInstanceId.value = approveVO?.camundaInstanceId
let coverageArea = '';
let coverageAreas = [];
let damTypeItem = baseFormItems.value.find(item => item.field == 'damType');
......@@ -609,7 +609,6 @@ onBeforeMount(() => {
})
getParamsList({ dictType: '数据资产目录主题名称' }).then((res: any) => {
if (res.code == proxy.$passCode) {
subjectDomainListData.value = replaceChildDictListKey(res.data) || [];
let item = baseFormItems.value.find(item => item.field == 'subjectDomain');
item && (item.options = subjectDomainListData.value);
} else {
......@@ -1326,8 +1325,11 @@ const baseFormRules = ref({
registeredExchangeGuid: [{
type: 'array', required: true, trigger: 'change', message: "请填写其他登记的交易所"
}],
isEvaluationAssessment: [
{ required: true, trigger: 'change', message: "请填写是否质量及价值评估" }
isQualityAssessment: [
{ required: true, trigger: 'change', message: "请填写是否完成质量评估" }
],
isCostAssessment: [
{ required: true, trigger: 'change', message: "请填写是否完成价值评估" }
],
applicationScenarios: [
{ required: true, trigger: 'blur', message: "请填写数据资产应用场景" }
......@@ -2023,6 +2025,8 @@ const save = () => {
qualityEvaluationFile: uploadFormInline['qualityEvaluationFile']?.map(u => u.url) || [],
costAssessmentFile: uploadFormInline['costAssessmentFile']?.map(u => u.url) || [],
commitmentLetter: uploadFormInline['commitmentLetter']?.map(u => u.url) || [],
qualityEvaluationInstitution: uploadFormInline.qualityEvaluationInstitution || '',
costAssessmentInstitution: uploadFormInline.costAssessmentInstitution || '',
},
immediateApprove: true,
isSubmit: true,
......@@ -2034,6 +2038,7 @@ const save = () => {
fullscreenLoading.value = true;
if (draftDetailInfo.value.guid) {
params.guid = draftDetailInfo.value.guid;
params.isRestart = localStorage.getItem('isRestart') ? true : false;
registerUpdate(params).then((res: any) => {
fullscreenLoading.value = false;
if (res.code == proxy.$passCode) {
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!