From 4ebc73199bcd4b23739a2e1d22c372e8081310c5 Mon Sep 17 00:00:00 2001 From: 王恒 <318726284@qq.com> Date: 星期五, 18 七月 2025 17:55:29 +0800 Subject: [PATCH] '完善筛选项' --- src/views/system/manage/index.vue | 99 ++++++++++++++++++++++++++++++++----------------- 1 files changed, 65 insertions(+), 34 deletions(-) diff --git a/src/views/system/manage/index.vue b/src/views/system/manage/index.vue index eed9aa5..95ef6f9 100644 --- a/src/views/system/manage/index.vue +++ b/src/views/system/manage/index.vue @@ -10,13 +10,13 @@ <el-input v-model="queryParams.planNo" placeholder="璇疯緭鍏ヨ鍒掔紪鍙�" clearable style="width: 200px" @keyup.enter="handleQuery" /> </el-form-item> - <el-form-item label="鎵ф硶鍗曚綅" prop="companyUser"> - <el-input v-model="queryParams.companyUser" placeholder="璇疯緭鍏ユ墽娉曞崟浣�" clearable style="width: 200px" + <el-form-item label="鎵ф硶鍗曚綅" prop="executiveSection"> + <el-input v-model="queryParams.executiveSection" placeholder="璇疯緭鍏ユ墽娉曞崟浣�" clearable style="width: 200px" @keyup.enter="handleQuery" /> </el-form-item> <el-form-item label="鎵ф硶鏃堕棿" style="width: 290px"> - <el-date-picker v-model="dateRange" value-format="YYYY-MM-DD" type="daterange" range-separator="-" - start-placeholder="寮�濮嬫棩鏈�" end-placeholder="缁撴潫鏃ユ湡"></el-date-picker> + <el-date-picker v-model="dateRange" value-format="YYYY-MM" type="monthrange" range-separator="-" + start-placeholder="寮�濮嬫棩鏈�" end-placeholder="缁撴潫鏃ユ湡" @change="changeDateHandler"></el-date-picker> </el-form-item> <el-form-item> <el-button type="primary" icon="Search" @click="handleQuery">鎼滅储</el-button> @@ -29,21 +29,21 @@ <el-button type="primary" plain icon="Plus" @click="handleAdd()" v-hasPermi="['system:dept:add']">鏂板</el-button> </el-col> <el-col :span="1.5"> - <el-button type="info" plain icon="Upload" @click="handleImport" + <el-button type="warning" plain icon="Upload" @click="handleImport" v-hasPermi="['system:user:import']">瀵煎叆</el-button> </el-col> <el-col :span="1.5"> - <el-button type="primary" plain icon="Download" @click="downLoadCode">瀵煎嚭</el-button> + <el-button type="success" plain icon="Download" @click="downLoadCode">瀵煎嚭</el-button> </el-col> <el-col :span="1.5"> - <el-button type="primary" plain icon="Download" @click="downLoadCode">鍙戣捣缁煎悎鏌ヤ竴娆�</el-button> + <el-button type="primary" plain icon="View" @click="downLoadCode">鍙戣捣缁煎悎鏌ヤ竴娆�</el-button> </el-col> </el-row> + <!-- @selection-change="handleSelectionChange" --> <el-table v-if="refreshTable" v-loading="loading" :data="deptList" row-key="companyId" - :default-expand-all="isExpandAll" :tree-props="{ children: 'children', hasChildren: 'hasChildren' }" - @selection-change="handleSelectionChange"> - <el-table-column type="selection" width="55" align="center" /> + :default-expand-all="isExpandAll" :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"> + <!-- <el-table-column type="selection" width="55" align="center" /> --> <el-table-column prop="planNo" label="搴忓彿" width="55"> <template #default="scope">{{ scope.$index + 1 }}</template> </el-table-column> @@ -59,7 +59,7 @@ <el-table-column prop="planFrequency" label="璁″垝棰戞" width="180"></el-table-column> <el-table-column prop="planMonth" label="璁″垝鏈堜唤" width="180"></el-table-column> <el-table-column prop="planStatus" label="鐘舵��" width="180"></el-table-column> - <el-table-column label="鎿嶄綔" align="center" fixed="right" class-name="small-padding fixed-width" width="240"> + <el-table-column label="鎿嶄綔" align="center" fixed="right" class-name="small-padding fixed-width" width="180"> <template #default="scope"> <el-link type="info" @click="handleView(scope.row)">鏌ョ湅</el-link> <el-divider direction="vertical" /> @@ -232,11 +232,12 @@ <script setup name="Dept"> import { getToken } from "@/utils/auth"; -import { listCompany, addCompany, updStatus, delCompany, updateCompany, getCompany } from "@/api/system/company/company"; -import { listManage, addManage, getManage, updateManage, delManage } from "@/api/system/manage"; +import { listManage, addManage, getManage, updateManage, delManage, exportTemplate, exportManage } from "@/api/system/manage"; + import { computed } from "vue"; import useSettingsStore from "@/store/modules/settings"; -import { download } from '@/utils/request'; // 涓嬭浇鏂囦欢 +// import { download } from '@/utils/request'; // 涓嬭浇鏂囦欢 +import { download as downloadHttp } from '@/utils/request' const { proxy } = getCurrentInstance(); const { sys_normal_disable } = proxy.useDict("sys_normal_disable"); const deptList = ref([]); @@ -248,11 +249,13 @@ const refreshTable = ref(true); const planOpen = ref(false); const planDetail = ref({}); +const dateRange = ref([]); const data = reactive({ form: {}, queryParams: { planNo: '', planName: '', + executiveSection: '', value1: '', pageNum: 1, pageSize: 10, @@ -274,6 +277,12 @@ }, }); +// 鏈堜唤閫夋嫨 +const changeDateHandler = (value) => { + data.queryParams.planMonthStart = value[0] + data.queryParams.planMonthEnd = value[1] +} + /*** 璁″垝瀵煎叆鍙傛暟 */ const upload = reactive({ // 鏄惁鏄剧ず寮瑰嚭灞傦紙鐢ㄦ埛瀵煎叆锛� @@ -287,9 +296,22 @@ // 璁剧疆涓婁紶鐨勮姹傚ご閮� headers: { Authorization: "Bearer " + getToken() }, // 涓婁紶鐨勫湴鍧� - url: import.meta.env.VITE_APP_BASE_API + "/system/user/importData", + url: import.meta.env.VITE_APP_BASE_API + "/system/manage/importData", }); - +/**鏂囦欢涓婁紶涓鐞� */ +const handleFileUploadProgress = (event, file, fileList) => { + upload.isUploading = true; +}; +/** 鏂囦欢涓婁紶鎴愬姛澶勭悊 */ +const handleFileSuccess = (response, file, fileList) => { + upload.open = false; + upload.isUploading = false; + proxy.$refs["uploadRef"].handleRemove(file); + proxy.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "瀵煎叆缁撴灉", { + dangerouslyUseHTMLString: true, + }); + getList(); +}; const { queryParams, form, rules } = toRefs(data); /** 鏌ヨ璁″垝鍒楄〃 */ function getList() { @@ -332,6 +354,14 @@ /** 閲嶇疆鎸夐挳鎿嶄綔 */ function resetQuery() { queryRef.value.resetFields(); + dateRange.value = []; + queryParams.value = { + planNo: '', // 璁″垝缂栧彿 + planName: '', // 璁″垝鍚嶇О + executiveSection: '', // 鎵ф硶鍗曚綅 + planMonthStart: '', // 璁″垝寮�濮嬫湀浠� + planMonthEnd: '', // 璁″垝缁撴潫鏈堜唤 + } handleQuery(); } function getDetails(id) { @@ -409,29 +439,30 @@ /** 涓嬭浇妯℃澘鎿嶄綔 */ function importTemplate() { - proxy.download("system/manage/exportTemplate", {}, `plan_template_${new Date().getTime()}.xlsx`); -} - -// 淇敼浼佷笟淇℃伅 -function changeCompanyNews(row, event) { - if (loading.value) { - return - } - updStatus(row).then(val => { - proxy.$modal.msgSuccess("淇敼鎴愬姛"); - getList(); + exportTemplate().then(val => { + downloadHttp('/tool/file/download', { + fileName: val.msg, + delete: true + }, "璁″垝淇℃伅妯℃澘.xlsx") }) } -let valueArr = [] + +// let valueArr = [] function downLoadCode() { - download('/system/manage/export', { - ids: valueArr.join() - }, `plan_${new Date().getTime()}.xlsx`) + exportManage().then(val => { + downloadHttp('/tool/file/download', { + fileName: val.msg, + delete: true + }, "璁″垝淇℃伅.xlsx") + }) } -function handleSelectionChange(e) { - valueArr = e.map(item => item.id) -} + + +// function handleSelectionChange(e) { +// valueArr = e.map(item => item.id) +// } + getList(); function selectableFun(e) { console.log(e) -- Gitblit v1.9.1