diff --git a/src/views/property/point/addModal.vue b/src/views/property/point/addModal.vue index 5694f06..ac512a2 100644 --- a/src/views/property/point/addModal.vue +++ b/src/views/property/point/addModal.vue @@ -37,7 +37,7 @@ - + @@ -75,7 +75,7 @@ import { reactive, ref ,toRefs} from 'vue'; import { message } from 'ant-design-vue'; import AMapLoader from '@amap/amap-jsapi-loader'; - import { getInfo, add, update, getProjectInfo, getOrganizationType } from './api'; + import { getInfo, add, update, getProjectInfo, getOrganizationType,getContractPartyBNameByProjectName } from './api'; export default { setup(props,{emit}) { const title = ref('新增'); @@ -102,15 +102,17 @@ const res = await getOrganizationType(); organizationNameOptions.value = res.rows; }; - const showModal = async (type, id, projectId,dataSource) => { - console.log(dataSource); + const showModal = async (type, id, projectId,selectInfo) => { + console.log(selectInfo); visible.value = true; if (type == 1) { title.value = '新增'; - form.projectName = dataSource[0].projectName - form.organizationName = dataSource[0].organizationName + form.projectName = selectInfo.node.ownerName + form.organizationName = selectInfo.node.projectName + const res = await getContractPartyBNameByProjectName({projectName:selectInfo.node.ownerName}) + form.maintenanceUnit = res initMap(); } else if (type == 2) { title.value = '编辑'; diff --git a/src/views/property/point/api.ts b/src/views/property/point/api.ts index 242f19c..bc6f1ad 100644 --- a/src/views/property/point/api.ts +++ b/src/views/property/point/api.ts @@ -12,6 +12,7 @@ enum Api { getOrganizationType = '/platform/organizationType/list', getContractNamesByProjectName = '/platform/contractInfo/getContractNamesByProjectName', getIoCompanyByName = '/platform/contractInfo/getIoCompany', + getContractPartyBNameByProjectName = '/platform/projectInfo/getContractPartyBNameByProjectName', } export function list(params: any) { @@ -59,4 +60,7 @@ export function getContractNamesByProjectName(data:any) { } export function getIoCompanyByName(name: any) { return defHttp.get({ url: `${Api.getIoCompanyByName}?name=${name}` }); +} +export function getContractPartyBNameByProjectName(params: any) { + return defHttp.get({ url: Api.getContractPartyBNameByProjectName, params }); } \ No newline at end of file diff --git a/src/views/property/point/index.vue b/src/views/property/point/index.vue index 4e49aee..77a07db 100644 --- a/src/views/property/point/index.vue +++ b/src/views/property/point/index.vue @@ -59,7 +59,7 @@ defineOptions({ name: 'Point' }); - const [registerTable, { reload,getDataSource}] = useTable({ + const [registerTable, { reload}] = useTable({ title: '点位信息', api: list, showIndexColumn: true, @@ -93,10 +93,10 @@ //新增编辑弹窗 const addModalRef = ref(); const handleAdd = () => { - addModalRef.value.showModal(1,null,checkedTree.value[0],getDataSource()); + addModalRef.value.showModal(1,null,checkedTree.value[0],selectInfo.value); }; const handleEdit = (id: any) => { - addModalRef.value.showModal(2, id,checkedTree.value[0],getDataSource()); + addModalRef.value.showModal(2, id,checkedTree.value[0],selectInfo.value); }; const handleDelete = async (id: any) => { await removeByIds([id]); @@ -119,8 +119,10 @@ }); console.log(res); }; + const selectInfo = ref({}) const onSelect = (selectedKeys: any, info: any) => { console.log('selected', selectedKeys, info); + selectInfo.value = info console.log(checkedTree.value); reload(); };