diff --git a/src/api/progress/progressCategory/index.ts b/src/api/progress/progressCategory/index.ts index d525264..ed4bb07 100644 --- a/src/api/progress/progressCategory/index.ts +++ b/src/api/progress/progressCategory/index.ts @@ -61,3 +61,12 @@ export const delProgressCategory = (id: string | number | Array method: 'delete' }); }; + +//下载 +export const downloadProgressCategory = (data) => { + return request({ + url: '/progress/progressCategory/export', + method: 'post', + data + }); +}; diff --git a/src/utils/request.ts b/src/utils/request.ts index 288b711..266d4be 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -176,7 +176,7 @@ service.interceptors.response.use( } ); // 通用下载方法 -export function download(url: string, params: any, fileName: string) { +export function download(url: string, params: any, fileName: string, isHeader) { downloadLoadingInstance = ElLoading.service({ text: '正在下载数据,请稍候', background: 'rgba(0, 0, 0, 0.7)' }); // prettier-ignore return service.post(url, params, { @@ -186,7 +186,7 @@ export function download(url: string, params: any, fileName: string) { return tansParams(params); } ], - headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + headers: isHeader?{}:{ 'Content-Type': 'application/x-www-form-urlencoded' }, responseType: 'blob' }).then(async (resp: any) => { const isLogin = blobValidate(resp); diff --git a/src/views/progress/progressCategory/index.vue b/src/views/progress/progressCategory/index.vue index 8537361..b867db0 100644 --- a/src/views/progress/progressCategory/index.vue +++ b/src/views/progress/progressCategory/index.vue @@ -8,6 +8,7 @@ 新增 + + 导出 + 展开/折叠 @@ -144,10 +148,12 @@ import { getProgressCategory, delProgressCategory, addProgressCategory, - updateProgressCategory + updateProgressCategory, + downloadProgressCategory } from '@/api/progress/progressCategory'; import { ProgressCategoryVO, ProgressCategoryQuery, ProgressCategoryForm } from '@/api/progress/progressCategory/types'; import { useUserStoreHook } from '@/store/modules/user'; +import { download } from '@/utils/request'; const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { progress_unit_type, progress_work_type } = toRefs(proxy?.useDict('progress_unit_type', 'progress_work_type')); @@ -161,7 +167,7 @@ type ProgressCategoryOption = { name: string; children?: ProgressCategoryOption[]; }; - +const treeRef = ref(); const matrixOptions = ref([]); const progressCategoryList = ref([]); @@ -236,6 +242,7 @@ const data = reactive>({ }); const { queryParams, form, rules } = toRefs(data); +const matrixIdList = ref([]); /** 查询分项工程单价列表 */ const getList = async () => { @@ -252,7 +259,6 @@ const getList = async () => { }); if (!matrixValue.value) matrixValue.value = matrixList[0].id; matrixOptions.value = matrixList; - console.log('🚀 ~ getList ~ matrixList:', matrixList); queryParams.value.matrixId = matrixList[0].children[0].matrixId; form.value.projectId = matrixList[0].projectId; form.value.matrixId = matrixList[0].children[0].matrixId; @@ -300,9 +306,7 @@ const reset = () => { const handleChange = (value: number) => { form.value.matrixId = value[1]; form.value.projectId = value[0]; - queryParams.value.matrixId = value[1]; - getList(); }; @@ -361,6 +365,13 @@ const handleUpdate = async (row: ProgressCategoryVO) => { dialog.title = '修改分项工程单价'; }; +const handleExport = async () => { + const ids = treeRef.value.getCheckedNodes()[0].pathNodes[0].childrenData.map((item) => item.matrixId); + const res = await downloadProgressCategory({ ids }); + download('/progress/progressCategory/export', { ids }, '方阵.xlsx', true); + // window.open(res.data); +}; + /** 提交按钮 */ const submitForm = () => { progressCategoryFormRef.value?.validate(async (valid: boolean) => { diff --git a/src/views/tender/bidd/index.vue b/src/views/tender/bidd/index.vue index 8df76ed..e476fe7 100644 --- a/src/views/tender/bidd/index.vue +++ b/src/views/tender/bidd/index.vue @@ -37,6 +37,9 @@ 导出excel + + 审核 + @@ -104,6 +107,8 @@ const queryForm = ref({ sheet: '' }); +const versionsData = ref({}); + const activeTab = ref('2'); const sheets = ref([]); const options = ref([]); @@ -118,7 +123,8 @@ const handleTabChange = (tab: string) => { getVersionNums(); }; //切换版本 -const changeVersions = () => { +const changeVersions = (value) => { + versionsData.value = options.value.find((item) => item.versions == value); getSheetName(); }; //切换表格 @@ -148,6 +154,8 @@ const getVersionNums = async () => { options.value = res.data; if (res.data.length > 0) { queryForm.value.versions = res.data[0].versions; + versionsData.value = options.value.find((item) => item.versions == queryForm.value.versions); + console.log('🚀 ~ changeVersions ~ versionsData.value:', versionsData.value); getSheetName(); } else { queryForm.value.versions = ''; @@ -261,6 +269,15 @@ const handleSave = (row: any) => { loading.value = false; } }; + +/** 审核按钮操作 */ +const handleAudit = async () => { + proxy?.$tab.openPage('/approval/tenderPlan/indexEdit', '审核招标一览', { + id: queryForm.value.versions, + type: 'update' + }); +}; + //监听项目id刷新数据 const listeningProject = watch( () => currentProject.value?.id, diff --git a/src/views/tender/bidd/indexEdit.vue b/src/views/tender/bidd/indexEdit.vue new file mode 100644 index 0000000..e92d56a --- /dev/null +++ b/src/views/tender/bidd/indexEdit.vue @@ -0,0 +1,358 @@ + + + + diff --git a/src/views/tender/plan/index.vue b/src/views/tender/plan/index.vue index 315b1a1..7d65d45 100644 --- a/src/views/tender/plan/index.vue +++ b/src/views/tender/plan/index.vue @@ -25,6 +25,26 @@ + + + + + + + @@ -161,7 +185,7 @@ import { getTenderPlanDetail, obtainAllVersionNumbers } from '@/api/tender/index'; - +const { proxy } = getCurrentInstance(); const userStore = useUserStoreHook(); const currentProject = computed(() => userStore.selectedProject); const tabList = ref([]);