4b6216c9 by xukangle

fix

1 parent 9fbd7335
......@@ -10,6 +10,15 @@ export const getProductList = (params) => request({
method: 'get',
params
})
/** 获取数交所产品
* @param {Object} params
* path: /dam-catalog-table/data-exchange/get-table-select
*/
export const getDataExchangeProductList = (params) => request({
url: `${import.meta.env.VITE_API_NEW_PORTAL}/dam-catalog-table/data-exchange/get-table-select`,
method: 'get',
params
})
/** 获取已添加的数据产品列表 */
export const getAddedProductList = (params) => request({
......
......@@ -500,8 +500,17 @@ const demandListData: any = ref([
{ companyName: '深数所', listedNum: 16, processNum: 1235 },
{ companyName: '苏数所', listedNum: 16, processNum: 1235 },
]);
const btnClick = (btn) => {
console.log(btn)
const btnClick = (item) => {
console.log(item)
router.push({
name: "productListingDetail",
query: {
exchangeGuid: item.exchangeGuid,
exchangeName: item.exchangeName,
type: 'add',
groundingPick: '登记得数交所',
},
});
}
......@@ -578,15 +587,16 @@ const btnClick = (btn) => {
.list-content {
display: flex;
justify-content: space-between;
justify-content: flex-start;
flex-wrap: wrap;
margin-bottom: 8px;
padding: 0 8px;
.card-content {
width: calc(33.33% - 10px);
width: 300px;
padding: 16px;
box-shadow: 0 0 0 1px #d9d9d9;
margin-right: 12px;
.header {
display: flex;
......
......@@ -15,7 +15,7 @@ import { changeNum } from '@/utils/common';
import { onUploadFilePreview, onUploadFileDownload } from '@/api/modules/common';
import { getAreaData, getServiceTenants, getSingleList } from "@/api/modules/queryService";
import { getApproveList, getTenantApprove, registerApproveAllow, registerApproveBackup, getParamsList, getServiceDetail } from "@/api/modules/dataAsset";
import { getProductList, getAddedProductList, getListingDetail, listingSave, listingUpdate, listingSavePortal, getParamsDataList, listingUpdateGateway } from "@/api/modules/dataProduct";
import { getProductList, getAddedProductList, getListingDetail, listingSave, listingUpdate, listingSavePortal, getParamsDataList, listingUpdateGateway, getDataExchangeProductList } from "@/api/modules/dataProduct";
import { getMatchDetail } from "@/api/modules/dataFinance";
import { useValidator } from '@/hooks/useValidator';
import { getCamundaDeploymentId } from "@/api/modules/workFlowService";
......@@ -95,7 +95,7 @@ const getArea = (node, resolve) => {
})
}
}
const processInstanceId = ref('');
const collapseIcon = ref(false);
const collapseIcon1 = ref(false);
const collapseIcon2 = ref(false);
......@@ -133,6 +133,10 @@ const approveTableInfo: any = ref({
}
});
const exchangeName = computed(() => {
return route.query.exchangeName;
})
const listingFormRef = ref();
const subForm = ref({});
const formInfo = ref({
......@@ -182,7 +186,7 @@ const formInfo = ref({
label: "数据时间范围",
type: "date-picker",
field: "dateRange",
default: null,
default: '',
placeholder: "开始时间~结束时间",
clearable: true,
required: true,
......@@ -366,21 +370,12 @@ const formInfo = ref({
// },
{
label: "登记数交所",
type: "inputinput",
placeholder: "请选择",
field: "exchangeGuids",
default: [],
options: exchangeList.value,
props: {
value: "guid",
label: "tenantName",
},
filterable: true,
type: "input",
placeholder: "请输入",
field: "exchangeName",
default: exchangeName,
clearable: true,
multiple: true,
tagsTooltip: true,
collapse: true,
disabled: false,
disabled: true,
required: true,
visible: true
},
......@@ -442,7 +437,7 @@ const formInfo = ref({
accept: '.png, .pdf',
type: 'upload-file',
placeholder: '请选择',
field: 'qualityReport',
field: 'qualityEvaluationFile',
default: [],
limit: 1,
block: false,
......@@ -453,13 +448,14 @@ const formInfo = ref({
label: "质量评估机构",
type: "select",
placeholder: "请选择",
field: "qualityOrg",
field: "qualityEvaluationInstitutionGuid",
default: '',
options: [],
props: {
value: 'value',
label: 'label'
},
allowCreate: true,
filterable: true,
clearable: true,
disabled: false,
......@@ -470,78 +466,79 @@ const formInfo = ref({
width: 'calc(33.33% - 20px)!important'
},
},
// {
// label: '价值评估报告',
// tip: '支持扩展名:.png .pdf',
// accept: '.png, .pdf',
// type: 'upload-file',
// placeholder: '请选择',
// field: 'valueReport',
// default: [],
// limit: 1,
// block: false,
// required: false,
// visible: true
// },
// {
// label: "价值评估机构",
// type: "select",
// placeholder: "请选择",
// field: "valueOrg",
// default: '',
// options: [],
// props: {
// value: 'value',
// label: 'label'
// },
// filterable: true,
// clearable: true,
// disabled: false,
// required: false,
// visible: true
// },
// {
// label: '承诺函',
// tip: '支持扩展名:.png .pdf',
// accept: '.png, .pdf',
// type: 'upload-file',
// placeholder: '请选择',
// field: 'commitment',
// templateUrl: 'http://www.baidu.com',
// default: [],
// limit: 1,
// block: true,
// required: false,
// visible: true
// },
// {
// label: '授权文件',
// tip: '支持扩展名:.png .pdf',
// accept: '.png, .pdf',
// type: 'upload-file',
// placeholder: '请选择',
// field: 'authorization',
// templateUrl: 'http://www.baidu.com',
// default: [],
// limit: 1,
// block: true,
// required: false,
// visible: true
// },
// {
// label: '商品详细介绍(签章版)',
// tip: '支持扩展名:.png .pdf',
// accept: '.png, .pdf',
// type: 'upload-file',
// placeholder: '请选择',
// field: 'productDetail',
// templateUrl: 'http://www.baidu.com',
// default: [],
// limit: 1,
// block: true,
// required: false,
// visible: true
// },
{
label: '价值评估报告',
tip: '支持扩展名:.png .pdf',
accept: '.png, .pdf',
type: 'upload-file',
placeholder: '请选择',
field: 'costAssessmentFile',
default: [],
limit: 1,
block: false,
required: false,
visible: true
},
{
label: "价值评估机构",
type: "select",
placeholder: "请选择",
field: "costAssessmentInstitutionGuid",
default: '',
options: [],
props: {
value: 'guid',
label: 'tenantName'
},
allowCreate: true,
filterable: true,
clearable: true,
disabled: false,
required: false,
visible: true
},
{
label: '承诺函',
tip: '支持扩展名:.png .pdf',
accept: '.png, .pdf',
type: 'upload-file',
placeholder: '请选择',
field: 'commitmentLetter',
templateUrl: 'http://www.baidu.com',
default: [],
limit: 1,
block: true,
required: false,
visible: true
},
{
label: '授权文件',
tip: '支持扩展名:.png .pdf',
accept: '.png, .pdf',
type: 'upload-file',
placeholder: '请选择',
field: 'accreditFile',
templateUrl: 'http://www.baidu.com',
default: [],
limit: 1,
block: true,
required: false,
visible: true
},
{
label: '商品详细介绍(签章版)',
tip: '支持扩展名:.png .pdf',
accept: '.png, .pdf',
type: 'upload-file',
placeholder: '请选择',
field: 'productDetail',
templateUrl: 'http://www.baidu.com',
default: [],
limit: 1,
block: true,
required: false,
visible: true
},
{
label: "",
type: "input",
......@@ -689,6 +686,15 @@ const getProducts = () => {
})
}
const getTableInfo = () => {
getDataExchangeProductList({}).then((res: any) => {
if (res.code == proxy.$passCode) {
let data = res.data || [];
formInfo.value.items[0].options = data;
}
})
}
const getProductDetail = () => {
flowDetailLoading.value = true;
getListingDetail({ guid }).then((res: any) => {
......@@ -696,6 +702,8 @@ const getProductDetail = () => {
if (res.code == proxy.$passCode) {
const data = res.data || {}
flowDetail.value = data;
deploymentId.value = data.approveVO.camundaDeploymentId
processInstanceId.value = data.approveVO.camundaInstanceId
console.log(data, '-----------------');
let coverageArea = data.coverageArea || [];
if (data.coverageArea?.[0]?.[0] == 'all') {
......@@ -804,71 +812,112 @@ const submitForm = (btn, formEl, tosub = false) => {
params.caseNumber = formInfo.value.items.at(5).defaultValue || formInfo.value.items.at(4).default;
params.timeAreaStart = params.dateRange ? params.dateRange[0] : '';
params.timeAreaEnd = params.dateRange ? params.dateRange[1] : '';
params.groundingPick = [route.query.groundingPick];
// 删除dateRange字段
delete params.dateRange;
flowDetailLoading.value = true;
if (detailType == 'add') {
params.immediateApprove = btn.value == 'submit' ? true : false;
listingSavePortal(params).then((res: any) => {
if (res.code == proxy.$passCode) {
ElMessage({
type: "success",
message: '提交成功',
});
flowDetailLoading.value = false;
userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath));
assetStore.set(true);
router.push({
name: "productListing",
query: {},
});
} else {
if (!route.query.exchangeGuid) {
if (detailType == 'add') {
params.immediateApprove = btn.value == 'submit' ? true : false;
listingSavePortal(params).then((res: any) => {
if (res.code == proxy.$passCode) {
ElMessage({
type: "success",
message: '提交成功',
});
flowDetailLoading.value = false;
userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath));
assetStore.set(true);
router.push({
name: "productListing",
query: {},
});
} else {
ElMessage({
type: "error",
message: res.msg,
});
flowDetailLoading.value = false;
}
}).catch((res) => {
ElMessage({
type: "error",
message: res.msg,
message: '提交失败',
});
flowDetailLoading.value = false;
}
}).catch((res) => {
ElMessage({
type: "error",
message: '提交失败',
});
flowDetailLoading.value = false;
});
} else {
params.guid = guid;
params.immediateApprove = btn.value == 'submit' ? true : false;
listingUpdateGateway(params).then((res: any) => {
if (res.code == proxy.$passCode) {
ElMessage({
type: "success",
message: '提交成功',
});
flowDetailLoading.value = false;
userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath));
assetStore.set(true);
router.push({
name: "productListing",
query: {},
});
} else {
} else {
params.guid = guid;
params.immediateApprove = btn.value == 'submit' ? true : false;
listingUpdateGateway(params).then((res: any) => {
if (res.code == proxy.$passCode) {
ElMessage({
type: "success",
message: '提交成功',
});
flowDetailLoading.value = false;
userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath));
assetStore.set(true);
router.push({
name: "productListing",
query: {},
});
} else {
ElMessage({
type: "error",
message: res.msg,
});
flowDetailLoading.value = false;
}
}).catch((res) => {
ElMessage({
type: "error",
message: res.msg,
message: '提交失败',
});
flowDetailLoading.value = false;
}
}).catch((res) => {
ElMessage({
type: "error",
message: '提交失败',
});
flowDetailLoading.value = false;
});
}
} else {
if (detailType == 'add') {
// 上架交易所
params.immediateApprove = btn.value == 'submit' ? true : false;
params.accreditFile = params.accreditFile.length ? { name: params.accreditFile[0].name, url: params.accreditFile[0].url } : {};
params.commitmentLetter = params.commitmentLetter.length ? { name: params.commitmentLetter[0].name, url: params.commitmentLetter[0].url } : {};
params.costAssessmentFile = params.costAssessmentFile.length ? { name: params.costAssessmentFile[0].name, url: params.costAssessmentFile[0].url } : {};
params.productDetail = params.productDetail.length ? { name: params.productDetail[0].name, url: params.productDetail[0].url } : {};
params.qualityEvaluationFile = params.qualityEvaluationFile.length ? { name: params.qualityEvaluationFile[0].name, url: params.qualityEvaluationFile[0].url } : {};
params.registrationCertificate = params.registrationCertificate.length ? { name: params.registrationCertificate[0].name, url: params.registrationCertificate[0].url } : {};
params.exchangeGuid = route.query.exchangeGuid;
console.log(params, '-----------------');
// listingSave(params).then((res: any) => {
// if (res.code == proxy.$passCode) {
// ElMessage({
// type: "success",
// message: '提交成功',
// });
// flowDetailLoading.value = false;
// userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath));
// assetStore.set(true);
// router.push({
// name: "productListing",
// query: {},
// });
// } else {
// ElMessage({
// type: "error",
// message: res.msg,
// });
// flowDetailLoading.value = false;
// }
// }).catch((res) => {
// ElMessage({
// type: "error",
// message: '提交失败',
// });
// flowDetailLoading.value = false;
// });
}
}
} else {
nextTick(() => {
const isError = document.getElementsByClassName('is-error');
......@@ -929,6 +978,7 @@ const btnClick = (btn) => {
}
const setFormItems = (row: any = null, isDetail = false) => {
console.log(row, '--------1---------');
formInfo.value.items.map((item: any) => {
if (item.field == 'productImg') {
item.default = row ? (row.productPic ? [row.productPic] : row[item.field] || []) : []
......@@ -978,18 +1028,25 @@ const setFormItems = (row: any = null, isDetail = false) => {
} else {
item.default = row ? row[item.field] : (item.default || '')
}
} else if (item.field == 'dateRange') {
}
else if (item.field == 'dateRange') {
item.default = row ? [row.timeAreaStart, row.timeAreaEnd] : null;
} else {
item.default = row ? row[item.field] : (item.default || '')
}
// else {
// if (item && item.hasOwnProperty('default')) {
// item.default = row ? row[item.field] : (item.default || '');
// } else {
// console.warn(`Item does not have the 'default' property`);
// }
// }
})
}
const selectChange = async (val, row, info) => {
if (row.field == 'damName') {
const data = row.options.filter(o => o.damName == val);
let coverageArea = data.length ? (data[0].coverageArea || []) : [];
console.log(data, '-----------------');
let coverageArea = (data.length && data[0].coverageArea) ? data[0].coverageArea : [];
await setFormItems({ ...info, coverageArea: coverageArea });
formInfo.value.items.at(0).default = val;
formInfo.value.items.at(1).default = data.length ? data[0].damType : '';
......@@ -1002,7 +1059,7 @@ const selectChange = async (val, row, info) => {
formInfo.value.items.at(-1).default = data.length ? data[0].damGuid : '';
formInfo.value.items.at(-3).required = data[0].damType != '1' && data[0].damType != '2';
formInfo.value.items.at(-4).required = data[0].damType != '1' && data[0].damType != '2';
if (data.length && data[0].coverageArea?.[0]?.[0] != 'all') {
if (data.length && data[0].coverageArea?.[0]?.[0] != 'all' && data[0].coverageArea) {
let p: any = [];
data[0].coverageArea.forEach(area => {
if (p.includes(area[0])) {
......@@ -1132,9 +1189,9 @@ onActivated(() => {
break;
}
};
if (detailType == 'add' || detailType == 'edit') {
getProducts();
};
// if ((detailType == 'add' || detailType == 'edit') && !route.query.exchangeGuids) {
// getProducts();
// };
})
const deploymentId = ref('');
......@@ -1144,7 +1201,7 @@ onBeforeMount(() => {
// case 1: 数交易所 case 2: 门户
if (route.query.case == '2') {
formInfo.value.items.forEach(item => {
if (item.field == 'damCode' || item.field == 'exchangeGuids' || item.field == 'registrationCertificate' || item.field == 'qualityReport' || item.field == 'qualityOrg' || item.field == 'valueReport' || item.field == 'valueOrg' || item.field == 'commitment' || item.field == 'authorization' || item.field == 'productDetail') {
if (item.field == 'damCode' || item.field == 'exchangeGuids' || item.field == 'registrationCertificate' || item.field == 'qualityEvaluationFile' || item.field == 'qualityEvaluationInstitutionGuid' || item.field == 'costAssessmentFile' || item.field == 'costAssessmentInstitutionGuid' || item.field == 'commitmentLetter' || item.field == 'accreditFile' || item.field == 'productDetail') {
item.visible = false;
}
})
......@@ -1234,7 +1291,7 @@ onBeforeMount(() => {
getSingleList({ pageIndex: -1, pageSize: -1, tenantType: "12505" }).then((res: any) => {
if (res.code == proxy.$passCode) {
qualityEvaluationData.value = res.data.records || [];
let item = formInfo.value.items.find(item => item.field == 'qualityOrg');
let item = formInfo.value.items.find(item => item.field == 'qualityEvaluationInstitutionGuid');
item && (item.options = qualityEvaluationData.value);
} else {
proxy.$ElMessage.error(res.msg);
......@@ -1244,12 +1301,17 @@ onBeforeMount(() => {
getSingleList({ pageIndex: -1, pageSize: -1, tenantType: "12504" }).then((res: any) => {
if (res.code == proxy.$passCode) {
costAssessmentData.value = res.data.records || [];
let item = formInfo.value.items.find(item => item.field == 'valueOrg');
let item = formInfo.value.items.find(item => item.field == 'costAssessmentInstitutionGuid');
item && (item.options = costAssessmentData.value);
} else {
proxy.$ElMessage.error(res.msg);
}
})
if (route.query.exchangeGuid) {
getTableInfo();
} else {
getProducts();
}
})
</script>
......@@ -1471,7 +1533,7 @@ onBeforeMount(() => {
<div class="list_panel">
<div class="table_panel_wrap">
<!-- <Table :tableInfo="approveTableInfo" /> -->
<ApprovalProcess v-if="deploymentId" :deploymentId="deploymentId" :definitionId="''">
<ApprovalProcess v-if="deploymentId" :deploymentId="deploymentId" :processInstanceId="processInstanceId">
</ApprovalProcess>
</div>
</div>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!