diff --git a/src/api/fundAnalysis.js b/src/api/fundAnalysis.js index 22c97e6..c337084 100644 --- a/src/api/fundAnalysis.js +++ b/src/api/fundAnalysis.js @@ -25,4 +25,13 @@ method: 'put', data }) +} + +// 同步 +export function projectFundAnalysisSyncData(data) { + return request({ + url: '/business/projectFundAnalysis/syncData', + method: 'post', + data + }) } \ No newline at end of file diff --git a/src/api/fundAnalysis.js b/src/api/fundAnalysis.js index 22c97e6..c337084 100644 --- a/src/api/fundAnalysis.js +++ b/src/api/fundAnalysis.js @@ -25,4 +25,13 @@ method: 'put', data }) +} + +// 同步 +export function projectFundAnalysisSyncData(data) { + return request({ + url: '/business/projectFundAnalysis/syncData', + method: 'post', + data + }) } \ No newline at end of file diff --git a/src/views/project/projectConfiguration/fundAnalysis/index.vue b/src/views/project/projectConfiguration/fundAnalysis/index.vue index 705478d..f8937f9 100644 --- a/src/views/project/projectConfiguration/fundAnalysis/index.vue +++ b/src/views/project/projectConfiguration/fundAnalysis/index.vue @@ -41,12 +41,13 @@ - + > + @@ -100,7 +102,10 @@ import operate from './operate.vue' import { optTextMap } from '@/utils/map' import { projectTypeList } from '@/api/projectInformationNew' -import { getProjectFundAnalysisSelectFundPage } from '@/api/fundAnalysis' +import { + getProjectFundAnalysisSelectFundPage, + projectFundAnalysisSyncData +} from '@/api/fundAnalysis' const { proxy } = getCurrentInstance(); const { maxHeight, onResize } = useAdaption(proxy, 'table_box') const showSearch = ref(true) @@ -160,17 +165,21 @@ proxy.$refs.operateRef.submit() } -// const synchronizationHandle = () => { -// const list = proxy.$refs.multipleTableRef.getSelectionRows() -// if(!list.length) return proxy.$modal.msgError('请选择一条数据!') -// if(list.length > 1) return proxy.$modal.msgError('只能选择一条数据!') -// proxy.$modal -// .confirm("是否确认同步?") -// .then(async () => { - -// }) -// .catch(() => {}); -// } +const syncData = () => { + const list = proxy.$refs.multipleTableRef.getSelectionRows() + if(!list.length) return proxy.$modal.msgError('请选择一条数据!') + const projectNos = list.map(item => item.projectNo) + const formData = new FormData() + formData.append('projectNo', projectNos.join()) + proxy.$modal + .confirm("是否确认同步?") + .then(async () => { + const res = await projectFundAnalysisSyncData(formData) + if(res?.code !== 200) return + proxy.$modal.msgSuccess('操作成功') + }) + .catch(() => {}); +} watch(showSearch, onResize)