47db0e59 by lihua

添加合约创建时选择数据产品

1 parent 32b085d5
......@@ -149,8 +149,8 @@ export const getContractOverviewTenantList = () => request({
});
/** 获取下拉数据产品列表 */
export const getContractDataProduct = () => request({
url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/contract/get-data-product`,
export const getContractDataProduct = (tenantGuid) => request({
url: `${import.meta.env.VITE_API_NEW_PORTAL}/dam-catalog-table/get-data-product?tenantGuid=${tenantGuid}`,
method: 'post'
})
......
......@@ -92,7 +92,7 @@ const beforeLogin = () => {
<div class="img-provider"></div>
<div class="title">数据提供方</div>
</div>
<!-- 只有专区才有 -->
<!-- 只有专区的超级管理员才有 -->
<!-- <div class="per" :class="selectRole == USERROLE.OPERATION ? 'selected' : ''" @click="selectRole = USERROLE.OPERATION">
<div class="img-operation"></div>
<div class="title">平台运营方</div>
......
......@@ -67,7 +67,7 @@ const baseInfoFormItems = ref([{
value: 'value',
label: 'label'
},
disabled: false,
disabled: true,
required: true,
visible: true
}, {
......@@ -250,7 +250,7 @@ const productTableInfo = ref({
default: '',
options: productList.value,
props: {
label: 'productNameDesc',
label: 'productName',
value: 'productId',
disabled: 'disabled'
},
......@@ -304,17 +304,16 @@ const hanldeTableSelectChange = (val, scope, item) => {
scope.row.dataProductEntityId = productItem?.enterpriseCode;
scope.row.dataProductAbstract = productItem?.description;
scope.row.dataProductEntityName = productItem?.enterpriseName;
let nodeInfo = nodeInfoFormRef.value.formInline;
if (scope.$index == 0) {
nodeInfoFormItems.value.forEach((item, index) => {
item.default = nodeInfo[item.field];
if (index == 1) {
item.default = tenantList.value.find(t => t.socialCreditCode == scope.row.dataProductEntityId)?.guid || scope.row.dataProductEntityName;
} else if (index == 2) {
item.default = scope.row.dataProductEntityId || '';
}
})
}
// 连接器只能选择数据提供方的产品,不需要切换了
// let nodeInfo = nodeInfoFormRef.value.formInline;
// nodeInfoFormItems.value.forEach((item, index) => {
// item.default = nodeInfo[item.field];
// if (index == 1) {
// item.default = tenantList.value.find(t => t.socialCreditCode == scope.row.dataProductEntityId)?.guid || scope.row.dataProductEntityName;
// } else if (index == 2) {
// item.default = scope.row.dataProductEntityId || '';
// }
// })
}
/** ---------------- 合约策略执行者相关表单信息 ----------------------------------- */
......@@ -627,14 +626,15 @@ onBeforeMount(() => {
let exec = () => {
let userRole = localStorage.getItem('userRole');
if (userRole == USERROLE.PROVIDER) {
baseInfoFormItems.value[1].disabled = true;
// baseInfoFormItems.value[1].disabled = true;
baseInfoFormItems.value[1].default = '01';
productTableInfo.value.editInfo.dataProductId.props.label = 'productName';
} else { //可以选点对点。未认证时只能选择中介参与
baseInfoFormItems.value[1].disabled = !currTenantDetailInfo.value.trustedIdentityCredential;
baseInfoFormItems.value[1].default = !currTenantDetailInfo.value.trustedIdentityCredential ? '02' : '01';
productTableInfo.value.editInfo.dataProductId.props.label = 'productNameDesc';
}
// else { //可以选点对点。未认证时只能选择中介参与
// baseInfoFormItems.value[1].disabled = !currTenantDetailInfo.value.trustedIdentityCredential;
// baseInfoFormItems.value[1].default = !currTenantDetailInfo.value.trustedIdentityCredential ? '02' : '01';
// productTableInfo.value.editInfo.dataProductId.props.label = 'productNameDesc';
// }
if (route.query.guid) {
fullscreenLoading.value = true;
getContractDetail(route.query.guid).then((res: any) => {
......@@ -659,10 +659,7 @@ onBeforeMount(() => {
nodeInfoFormItems.value[4].default = user.executionerGuid;
nodeInfoFormItems.value[5].default = user.executionerId;
if (baseInfoFormItems.value[1].default == '01' && userData.superTubeFlag == 'Y') {
productList.value = res.data?.map(d => {
d.disabled = d.enterpriseName != userData.tenantName; //点对点,只能选择自己公司所属产品
return d;
}) || [];
productList.value = res.data || [];
}
productTableInfo.value.editInfo.dataProductId.options = productList.value;
extendData.value = detailInfo.value.contractExpansions || [];
......@@ -687,13 +684,9 @@ onBeforeMount(() => {
nodeInfoFormItems.value[1].default = ''; //如果是中介的话,不能选择自己吧。
}
}
getContractDataProduct().then((res: any) => {
getContractDataProduct(userData.tenantGuid).then((res: any) => {
if (res?.code == proxy.$passCode) {
productList.value = res.data?.map(d => {
d.productNameDesc = d.productName + '(' + d.enterpriseName + ')';
d.disabled = userData.superTubeFlag == 'Y' && baseInfoFormItems.value[1].default == '01' && d.enterpriseName != userData.tenantName; //点对点,只能选择自己公司所属产品
return d;
}) || [];
productList.value = res.data || [];
productTableInfo.value.editInfo.dataProductId.options = productList.value;
} else {
res?.msg && proxy.$ElMessage.error(res?.msg);
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!