8454b49c by lxs

数据资产登记更新

1 parent 72a20f40
......@@ -122,7 +122,7 @@ export const getServiceTenants = (params) => request({
/** 获取会员的附件模板 */
export const getTenantAttach = (params) => request({
url: `${import.meta.env.VITE_APP_API_BASEURL}/attachment-template/list-attachment?tenantGuid=${params}`,
url: `${import.meta.env.VITE_APP_PERSONAL_URL}/attachment-template/list-attachment?tenantGuid=${params}`,
method: 'get'
})
......
......@@ -228,7 +228,7 @@ const tableBtnClick = (scope, btn) => {
localStorage.setItem('isRestart', btn.label == '重新提交' ? 'true' : '');
router.push({
name: 'registerStart',
query: { guid: row.guid, damGuid: row.damGuid, name: row.daName, type }
query: { guid: row.guid, exchangeGuid: row.exchangeGuid, name: row.daName, type }
});
} else if (type == "delete") {
delTableOpen("此操作将永久删除该资产登记,是否继续?", "warning");
......
......@@ -46,6 +46,7 @@ const route = useRoute();
const guid = route.query.guid;
const fullPath = route.fullPath;
const editType = route.query.type;
const exGuid = route.query.exchangeGuid;
/** 资产目录列表 */
const registerCatalogList: any = ref([]);
......@@ -157,28 +158,14 @@ const getArea = (node, resolve) => {
}
}
const serviceTenants: any = ref([
{
"exchangeGuid": "07c11603a8bc4d8f8bee2e3a34ab4d8a",
"exchangeName": "测试数交所",
"listingNum": 0,
"underReviewNum": 0
}
]);
const currTenantChanged: any = ref([
{
"exchangeGuid": "07c11603a8bc4d8f8bee2e3a34ab4d8a",
"exchangeName": "测试数交所",
"listingNum": 0,
"underReviewNum": 0
}
]);
const serviceTenants: any = ref([]);
const currTenantChanged: any = ref([]);
const tenantDetail: any = ref({});
/** 获取当前登录会员,服务商,企业等详情。 */
const getTenantDetail = () => {
getTenantDetailInfo({ guid: userData.tenantGuid }).then((res: any) => {
getTenantDetailInfo(userData.tenantGuid).then((res: any) => {
if (res.code == proxy.$passCode) {
const data = res.data ?? {};
tenantDetail.value = data;
......@@ -316,10 +303,10 @@ const setUploadFormItemsValue = (info) => {
} else if (item.field === 'commitmentLetter') {
item.default = attach.commitmentLetter || [];
item.templateUrl = attachDataInfo.value['commitment-letter'];
} else if (item.field === 'costAssessmentInstitution') {
item.default = attach.costAssessmentInstitution || '';
} else if (item.field === 'qualityEvaluationInstitution') {
item.default = attach.qualityEvaluationInstitution || '';
} else if (item.field === 'costAssessmentInstitutionGuid') {
item.default = attach.costAssessmentInstitutionGuid || '';
} else if (item.field === 'qualityEvaluationInstitutionGuid') {
item.default = attach.qualityEvaluationInstitutionGuid || '';
}
});
}
......@@ -358,10 +345,15 @@ const draftDetailInfo: any = ref({});
/** 会员附件模板 */
const attachDataInfo: any = ref({});
const getRegisterCatalogListData = () => {
const getRegisterCatalogListData = (dam: any={}) => {
getRegisterCatalogList().then((res: any) => {
if (res.code == proxy.$passCode) {
baseFormItems.value[0].options = registerCatalogList.value = res.data || []
const data = res.data || [];
baseFormItems.value[0].options = registerCatalogList.value = data;
if(guid){
const opt = data.find(item => item.guid == dam.damGuid)
baseFormItems.value[0].default = opt? opt.guid: dam.damName
}
let dataScaleItem = baseFormItems.value.find(item => item.field == 'dataScale');
if (draftDetailInfo.value.damGuid) {
let da = registerCatalogList.value.find(r => r.guid == draftDetailInfo.value.damGuid);
......@@ -394,12 +386,11 @@ const getRegisterCatalogListData = () => {
}
onActivated(() => {
getRegisterCatalogListData();
// getRegisterCatalogListData();
})
onBeforeMount(() => {
if (guid) {
baseFormItems.value[7].default = guid;
fullscreenLoading.value = true;
getRegiaterDetail({ guid: guid }).then((res: any) => {
fullscreenLoading.value = false;
......@@ -456,17 +447,17 @@ onBeforeMount(() => {
});
}
if (data.exchangeGuid) {
// getTenantAttach(data.exchangeGuid).then((res: any) => {
// if (res?.code == proxy.$passCode) {
// Object.assign(attachDataInfo.value, res.data || {});
// uploadFormItems.value[0].templateUrl = attachDataInfo.value.register_letter;
// uploadFormItems.value[1].templateUrl = attachDataInfo.value['commitment-letter'];
// setUploadFormItemsValue(draftDetailInfo.value);
// } else {
// ElMessage.error(res.msg);
// setUploadFormItemsValue(draftDetailInfo.value);
// }
// })
getTenantAttach(userData.tenantGuid).then((res: any) => {
if (res?.code == proxy.$passCode) {
Object.assign(attachDataInfo.value, res.data || {});
uploadFormItems.value[0].templateUrl = attachDataInfo.value.register_letter;
uploadFormItems.value[1].templateUrl = attachDataInfo.value['commitment-letter'];
setUploadFormItemsValue(draftDetailInfo.value);
} else {
ElMessage.error(res.msg);
setUploadFormItemsValue(draftDetailInfo.value);
}
})
setUploadFormItemsValue(draftDetailInfo.value);
} else {
setUploadFormItemsValue(draftDetailInfo.value);
......@@ -491,39 +482,7 @@ onBeforeMount(() => {
} else {
setPropertyFormItemsValue(draftDetailInfo.value);
}
// if (fullPath === route.fullPath) {
// document.title = editType ? `详情-${data.daName}` : `编辑-${data.daName}`;
// }
// let tab: any = userStore.tabbar.find((tab: any) => tab.fullPath === fullPath);
// if (tab) {
// tab.meta.title = editType ? `详情-${data.daName}` : `编辑-${data.daName}`;
// }
if (data.approveGuid != null) {
approveTableInfo.value.loading = true;
getApproveList(guid).then((res: any) => {
approveTableInfo.value.loading = false;
if (res.code == proxy.$passCode) {
console.log(res.data);
approveTableInfo.value.data = res.data || [];
} else {
ElMessage.error(res.msg);
}
});
} else {
approveTableInfo.value.loading = true;
getTenantApprove().then((res: any) => {
approveTableInfo.value.loading = false;
if (res.code == proxy.$passCode) {
approveTableInfo.value.data = res.data?.map(d => {
return {
tenantType: d.substring(4)
}
}) || [];
} else {
ElMessage.error(res.msg);
}
});
}
getRegisterCatalogListData({damName: data.daName, damGuid: data.damGuid});
} else {
ElMessage.error(res.msg);
}
......@@ -536,44 +495,10 @@ onBeforeMount(() => {
ElMessage.error(res.msg);
}
})
// //新建无guid的时候显示这个审批信息,有guid调用另一个接口。
// getTenantApprove().then((res: any) => {
// if (res.code == proxy.$passCode) {
// approveTableInfo.value.data = res.data?.map(d => {
// return {
// tenantType: d.substring(4)
// }
// }) || [];
// } else {
// ElMessage.error(res.msg);
// }
// });
}
let exchangeItem = baseFormItems.value.find(f => f.field === 'exchangeGuid');
exchangeItem.default = route.query.exchangeGuid;
// getTenantDetail();
// getServiceTenants({
// tenantType: 3
// }).then((res: any) => {
// if (res.code == proxy.$passCode) {
// const data = res.data ?? {};
// serviceTenants.value = data['3'] || [];
// let item2 = baseFormItems.value.find(f => f.field === 'rules');
// item2.children[1].options = serviceTenants.value;
// } else {
// ElMessage.error(res.msg);
// }
// });
// getServiceDetail(userData.tenantGuid).then((res: any) => {
// if (res.code == proxy.$passCode) {
// const data = res.data ?? {};
// currTenantChanged.value = data.filter(d => d.serviceType == 4);
// let formItem = baseFormItems.value.find(f => f.field === 'exchangeGuid');
// formItem.options = currTenantChanged.value;
// } else {
// ElMessage.error(res.msg);
// }
// });
getRegisterCatalogListData();
}
getTenantDetail();
getParentAreaPromise.value = getAreaData({ parentId: null }).then((res: any) => {
if (res?.code == proxy.$passCode) {
parentAreaData.value = res.data ?? [];
......@@ -590,6 +515,7 @@ onBeforeMount(() => {
// ElMessage.error(res.msg);
// }
// })
// 获取资产类型
getParamsList({ dictType: '资产类型' }).then((res: any) => {
if (res.code == proxy.$passCode) {
damTypes.value = res.data || [];
......@@ -607,6 +533,7 @@ onBeforeMount(() => {
proxy.$ElMessage.error(res.msg);
}
})
// 获取数据资产目录主题
getParamsList({ dictType: '数据资产目录主题名称' }).then((res: any) => {
if (res.code == proxy.$passCode) {
let item = baseFormItems.value.find(item => item.field == 'subjectDomain');
......@@ -615,11 +542,26 @@ onBeforeMount(() => {
proxy.$ElMessage.error(res.msg);
}
})
// 获取数交所数据
getSingleList({ pageIndex: -1, pageSize: -1, tenantType: "130" }).then((res: any) => {
if (res.code == proxy.$passCode) {
const data = res.data.records ?? [];
currTenantChanged.value = data;
let formItem = baseFormItems.value.find(f => f.field === 'exchangeGuid');
formItem.options = currTenantChanged.value;
formItem.default = exGuid;
serviceTenants.value = data.filter(d => d.guid !== exGuid);
let item2 = baseFormItems.value.find(f => f.field === 'rules');
item2.children[1].options = serviceTenants.value;
} else {
proxy.$ElMessage.error(res.msg);
}
})
// 获取质量评估机构
getSingleList({ pageIndex: -1, pageSize: -1, tenantType: "12505" }).then((res: any) => {
if (res.code == proxy.$passCode) {
qualityEvaluationData.value = res.data.records || [];
let item = uploadFormItems.value.find(item => item.field == 'qualityEvaluationInstitution');
let item = uploadFormItems.value.find(item => item.field == 'qualityEvaluationInstitutionGuid');
item && (item.options = qualityEvaluationData.value);
} else {
proxy.$ElMessage.error(res.msg);
......@@ -629,7 +571,7 @@ onBeforeMount(() => {
getSingleList({ pageIndex: -1, pageSize: -1, tenantType: "12504" }).then((res: any) => {
if (res.code == proxy.$passCode) {
costAssessmentData.value = res.data.records || [];
let item = uploadFormItems.value.find(item => item.field == 'costAssessmentInstitution');
let item = uploadFormItems.value.find(item => item.field == 'costAssessmentInstitutionGuid');
item && (item.options = costAssessmentData.value);
} else {
proxy.$ElMessage.error(res.msg);
......@@ -795,13 +737,10 @@ const baseFormItems: any = ref([
field: 'exchangeGuid',
default: '',
// col: 'mr8',
// col: 'mr8',
options: currTenantChanged.value,
props: {
// value: 'serviceTenantGuid',
// label: 'serviceTenantName'
value: "exchangeGuid",
label: "exchangeName",
value: 'guid',
label: 'tenantName'
},
required: true,
disabled: true,
......@@ -840,10 +779,8 @@ const baseFormItems: any = ref([
default: [],
// index: 0,
props: {
// value: "guid",
// label: "tenantName",
value: "exchangeGuid",
label: "exchangeName",
value: "guid",
label: "tenantName",
},
options: serviceTenants.value,
multiple: true,
......@@ -1819,12 +1756,17 @@ const uploadFormItems: any = ref([
label: '质量评估机构',
type: 'select',
placeholder: '请选择',
field: 'qualityEvaluationInstitution',
field: 'qualityEvaluationInstitutionGuid',
default: '',
options: [],
props: {
label: 'tenantName',
value: 'guid'
},
required: true,
filterable: true,
allowCreate: true,
clearable: true,
style: {
width: 'calc(33.33% - 6px)!important'
},
......@@ -1845,12 +1787,17 @@ const uploadFormItems: any = ref([
label: '价值评估机构',
type: 'select',
placeholder: '请选择',
field: 'costAssessmentInstitution',
field: 'costAssessmentInstitutionGuid',
default: '',
options: [],
props: {
label: 'tenantName',
value: 'guid'
},
required: true,
filterable: true,
allowCreate: true,
clearable: true,
style: {
width: 'calc(33.33% - 6px)!important'
},
......@@ -1868,10 +1815,10 @@ const uploadFormRules = ref({
}
}, trigger: 'change'
}],
qualityEvaluationInstitution: [
qualityEvaluationInstitutionGuid: [
{ required: true, trigger: 'change', message: "请选择质量评估机构" }
],
costAssessmentInstitution: [
costAssessmentInstitutionGuid: [
{ required: true, trigger: 'change', message: "请选择价值评估机构" }
],
qualityEvaluationFile: [{
......@@ -1919,6 +1866,16 @@ const cancel = () => {
});
}
const qualityEvaluationInstitution = ref('');
const costAssessmentInstitution = ref('');
const uploadSelectChange = (val, item, row) => {
if (item.field == 'qualityEvaluationInstitutionGuid') {
qualityEvaluationInstitution.value = val && item.options.find(o => o.guid == val) ? '' : (val || '');
} else {
costAssessmentInstitution.value = val && item.options.find(o => o.guid == val) ? '' : (val || '');
}
}
/** 保存草稿,不用校验。 */
const saveDraft = () => {
let params: any = {};
......@@ -1938,14 +1895,22 @@ const saveDraft = () => {
let propertyFormLine = porpertyInfoFormRef.value.formInline;
Object.assign(params, propertyFormLine);
let uploadFormInline = uploadFormRef.value.formInline;
const registerAttachment = {
let registerAttachment: any = {
// fileHash: uploadFormInline.fileHash,
registerLetter: uploadFormInline['registerLetter']?.map(u => u.url) || [],
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 || '',
}
if (qualityEvaluationInstitution.value) {
registerAttachment.qualityEvaluationInstitution = qualityEvaluationInstitution.value
} else {
registerAttachment.qualityEvaluationInstitutionGuid = uploadFormInline.qualityEvaluationInstitutionGuid || ''
}
if (costAssessmentInstitution.value) {
registerAttachment.costAssessmentInstitution = costAssessmentInstitution.value
} else {
registerAttachment.costAssessmentInstitutionGuid = uploadFormInline.costAssessmentInstitutionGuid || ''
}
Object.assign(params, {
registerAttachment: registerAttachment,
......@@ -2018,16 +1983,25 @@ const save = () => {
let propertyFormLine = porpertyInfoFormRef.value.formInline;
Object.assign(params, propertyFormLine);
let uploadFormInline = uploadFormRef.value.formInline;
Object.assign(params, {
registerAttachment: {
let registerAttachment: any = {
// fileHash: uploadFormInline.fileHash,
registerLetter: uploadFormInline['registerLetter']?.map(u => u.url) || [],
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 || '',
},
}
if (qualityEvaluationInstitution.value) {
registerAttachment.qualityEvaluationInstitution = qualityEvaluationInstitution.value
} else {
registerAttachment.qualityEvaluationInstitutionGuid = uploadFormInline.qualityEvaluationInstitutionGuid || ''
}
if (costAssessmentInstitution.value) {
registerAttachment.costAssessmentInstitution = costAssessmentInstitution.value
} else {
registerAttachment.costAssessmentInstitutionGuid = uploadFormInline.costAssessmentInstitutionGuid || ''
}
Object.assign(params, {
registerAttachment: registerAttachment,
immediateApprove: true,
isSubmit: true,
});
......@@ -2153,7 +2127,7 @@ const approveTableInfo: any = ref({
<ContentWrap id="id-assetContent" title="附件信息" description="" :isExpand="assetContentExpand" expandSwicth
style="margin-top: 15px" @expand="(v) => assetContentExpand = v">
<Form class='uploadForm' ref="uploadFormRef" :itemList="uploadFormItems" formId="upload-form"
:rules="uploadFormRules" col="col3" />
:rules="uploadFormRules" col="col3" @selectChange="uploadSelectChange" />
</ContentWrap>
<ContentWrap id="id-propertyInfo" title="权利信息" description="申报数据资产的权利信息" expandSwicth
:isExpand="propertyInfoExpand" style="margin-top: 15px" @expand="(v) => propertyInfoExpand = v">
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!