1e1353d7 by lihua

数据产品选择

1 parent 3036b430
......@@ -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'
})
......
......@@ -12,6 +12,7 @@ import { USERROLE } from '@/utils/enum';
import { ElMessage } from 'element-plus';
const userStore = useUserStore()
const userData = JSON.parse(userStore.userData);
const router = useRouter()
const route = useRoute()
......@@ -72,6 +73,7 @@ const beforeLogin = () => {
}
}
</script>
<template>
......@@ -93,7 +95,7 @@ const beforeLogin = () => {
<div class="title">数据提供方</div>
</div>
<!-- 只有专区才有 -->
<div class="per" :class="selectRole == USERROLE.OPERATION ? 'selected' : ''" @click="selectRole = USERROLE.OPERATION">
<div class="per" v-if="userData?.superTubeFlag == 'Y'" :class="selectRole == USERROLE.OPERATION ? 'selected' : ''" @click="selectRole = USERROLE.OPERATION">
<div class="img-operation"></div>
<div class="title">平台运营方</div>
</div>
......
......@@ -67,7 +67,7 @@ const baseInfoFormItems = ref([{
value: 'value',
label: 'label'
},
disabled: false,
disabled: true,
required: true,
visible: true
}, {
......@@ -304,16 +304,18 @@ 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 || '';
}
})
if (baseInfoFormRef.value?.formInline?.signModeCode == '02') {
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 || '';
}
})
}
}
}
......@@ -517,8 +519,8 @@ const submit = () => {
handleLeft('product-info');
return;
}
if (userData.superTubeFlag == 'Y') { //只有主平台模式下需判断
if (baseInfoFormRef.value.formInline.signModeCode == '02' && index > 0 && productData.value[index].dataProductEntityId != pd.dataProductEntityId) {
if (baseInfoFormRef.value.formInline.signModeCode == '02') { //只有主平台中介模式下需判断
if (index > 0 && productData.value[index].dataProductEntityId != pd.dataProductEntityId) {
proxy.$ElMessage.error('合约标的的数据产品不能来自不同的企业主体');
expandInfo.value = true;
handleLeft('product-info');
......@@ -626,13 +628,13 @@ const psLogon = ref();
onBeforeMount(() => {
let exec = () => {
let userRole = localStorage.getItem('userRole');
if (userRole == USERROLE.PROVIDER) {
baseInfoFormItems.value[1].disabled = true;
if (userRole == USERROLE.PROVIDER) { //数据使用方
// 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';
} else { //平台运营方可以选择中介参与
// baseInfoFormItems.value[1].disabled = !currTenantDetailInfo.value.trustedIdentityCredential;
baseInfoFormItems.value[1].default = '02';
productTableInfo.value.editInfo.dataProductId.props.label = 'productNameDesc';
}
if (route.query.guid) {
......@@ -687,11 +689,11 @@ onBeforeMount(() => {
nodeInfoFormItems.value[1].default = ''; //如果是中介的话,不能选择自己吧。
}
}
getContractDataProduct().then((res: any) => {
getContractDataProduct(userData.superTubeFlag == 'Y' && localStorage.getItem('userRole') == USERROLE.OPERATION ? null : 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; //点对点,只能选择自己公司所属产品
// d.disabled = userData.superTubeFlag == 'Y' && baseInfoFormItems.value[1].default == '01' && d.enterpriseName != userData.tenantName; //点对点,只能选择自己公司所属产品
return d;
}) || [];
productTableInfo.value.editInfo.dataProductId.options = productList.value;
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!