教研室模板

This commit is contained in:
2026-08-26 18:01:20 +08:00
parent f2aac5aa30
commit 2c684c3dbf
2 changed files with 21 additions and 1 deletions
+9
View File
@@ -35,3 +35,12 @@ export function disableOffice(jysdh) {
params: { jysdh: jysdh } params: { jysdh: jysdh }
}) })
} }
// 下载教研室导入模板
export function downloadOfficeTemplate() {
return request({
url: '/download/jys',
method: 'get',
responseType: 'blob'
})
}
@@ -49,6 +49,9 @@
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="info" plain icon="el-icon-upload2" size="mini" @click="openImport">导入</el-button> <el-button type="info" plain icon="el-icon-upload2" size="mini" @click="openImport">导入</el-button>
</el-col> </el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleDownloadTemplate">模板下载</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
@@ -149,8 +152,9 @@
</template> </template>
<script> <script>
import { listOffice, addOffice, updateOffice, disableOffice } from "@/api/teachOffice/office" import { listOffice, addOffice, updateOffice, disableOffice, downloadOfficeTemplate } from "@/api/teachOffice/office"
import { getToken } from '@/utils/auth' import { getToken } from '@/utils/auth'
import { saveAs } from 'file-saver'
export default { export default {
name: "Office", name: "Office",
@@ -339,6 +343,13 @@ export default {
/** 导入失败 */ /** 导入失败 */
handleImportError() { handleImportError() {
this.$modal.msgError('导入失败,请稍后重试') this.$modal.msgError('导入失败,请稍后重试')
},
/** 下载导入模板 */
handleDownloadTemplate() {
downloadOfficeTemplate().then(blob => {
saveAs(blob, '教研室导入模板.xlsx')
this.$modal.msgSuccess('模板下载成功')
}).catch(() => {})
} }
} }
} }