forked from liweijie/education
Compare commits
2 Commits
0877228043
...
87335c4c51
| Author | SHA1 | Date | |
|---|---|---|---|
| 87335c4c51 | |||
| 2c684c3dbf |
@@ -35,3 +35,12 @@ export function disableOffice(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-button type="info" plain icon="el-icon-upload2" size="mini" @click="openImport">导入</el-button>
|
||||
</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>
|
||||
</el-row>
|
||||
|
||||
@@ -149,8 +152,9 @@
|
||||
</template>
|
||||
|
||||
<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 { saveAs } from 'file-saver'
|
||||
|
||||
export default {
|
||||
name: "Office",
|
||||
@@ -339,6 +343,13 @@ export default {
|
||||
/** 导入失败 */
|
||||
handleImportError() {
|
||||
this.$modal.msgError('导入失败,请稍后重试')
|
||||
},
|
||||
/** 下载导入模板 */
|
||||
handleDownloadTemplate() {
|
||||
downloadOfficeTemplate().then(blob => {
|
||||
saveAs(blob, '教研室导入模板.xlsx')
|
||||
this.$modal.msgSuccess('模板下载成功')
|
||||
}).catch(() => {})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user