fix bug
This commit is contained in:
+14
-60
@@ -21,12 +21,6 @@
|
||||
@on-load="onLoad"
|
||||
>
|
||||
<template #menu-left>
|
||||
<el-button type="primary" plain v-if="permission.fee_item_import" @click="handleImport">
|
||||
<el-icon class="el-icon--left"><Upload /></el-icon>批量导入
|
||||
</el-button>
|
||||
<el-button type="primary" plain v-if="permission.fee_item_template" @click="handleTemplate">
|
||||
<el-icon class="el-icon--left"><Download /></el-icon>下载模板
|
||||
</el-button>
|
||||
<el-button type="primary" plain v-if="permission.fee_item_export" @click="handleExport">
|
||||
<el-icon class="el-icon--left"><Download /></el-icon>批量导出
|
||||
</el-button>
|
||||
@@ -80,16 +74,6 @@
|
||||
</el-link>
|
||||
</template>
|
||||
</avue-crud>
|
||||
|
||||
<el-dialog title="费用项导入" append-to-body v-model="excelBox" width="555px">
|
||||
<avue-form :option="excelOption" v-model="excelForm">
|
||||
<template #excelTemplate>
|
||||
<el-button type="primary" @click="handleTemplate">
|
||||
点击下载<i class="el-icon-download el-icon--right"></i>
|
||||
</el-button>
|
||||
</template>
|
||||
</avue-form>
|
||||
</el-dialog>
|
||||
</basic-container>
|
||||
</template>
|
||||
|
||||
@@ -99,24 +83,20 @@ import { exportBlob } from '@/api/common';
|
||||
import { getDictionary } from '@/api/system/dictbiz';
|
||||
import { getDeptTree } from '@/api/system/dept';
|
||||
import { downloadXls } from '@/utils/util';
|
||||
import { openImportDialog } from '@/utils/import-excel';
|
||||
import { getToken } from '@/utils/auth';
|
||||
import { getUploadHeaders } from '@/utils/upload';
|
||||
import { Upload, Download } from '@element-plus/icons-vue';
|
||||
import { Download } from '@element-plus/icons-vue';
|
||||
import { mapGetters } from 'vuex';
|
||||
import NProgress from 'nprogress';
|
||||
import 'nprogress/nprogress.css';
|
||||
|
||||
export default {
|
||||
components: { Upload, Download },
|
||||
components: { Download },
|
||||
data() {
|
||||
return {
|
||||
form: {},
|
||||
query: {},
|
||||
loading: true,
|
||||
data: [],
|
||||
excelBox: false,
|
||||
excelForm: {},
|
||||
dialogType: 'add',
|
||||
feeCategoryOptions: [],
|
||||
page: {
|
||||
@@ -184,6 +164,17 @@ export default {
|
||||
maxlength: 50,
|
||||
rules: [{ required: true, message: '请输入费用项', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '备注',
|
||||
prop: 'remark',
|
||||
type: 'textarea',
|
||||
minRows: 2,
|
||||
span: 24,
|
||||
hide: true,
|
||||
maxlength: 200,
|
||||
showWordLimit: true,
|
||||
rules: [{ max: 200, message: '备注不能超过200个字', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '组织',
|
||||
prop: 'createDeptName',
|
||||
@@ -259,32 +250,6 @@ export default {
|
||||
},
|
||||
],
|
||||
},
|
||||
excelOption: {
|
||||
submitBtn: false,
|
||||
emptyBtn: false,
|
||||
column: [
|
||||
{
|
||||
label: '模板上传',
|
||||
prop: 'excelFile',
|
||||
type: 'upload',
|
||||
drag: true,
|
||||
loadText: '模板上传中,请稍等',
|
||||
span: 24,
|
||||
propsHttp: {
|
||||
res: 'data',
|
||||
},
|
||||
headers: getUploadHeaders(),
|
||||
tip: '请上传 .xls,.xlsx 标准格式文件',
|
||||
action: '/blade-system/fee-item/import-fee-item',
|
||||
},
|
||||
{
|
||||
label: '模板下载',
|
||||
prop: 'excelTemplate',
|
||||
formslot: true,
|
||||
span: 24,
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
@@ -364,6 +329,7 @@ export default {
|
||||
values.feeCategory = String(values.feeCategory || '').trim();
|
||||
values.name = String(values.name || '').trim();
|
||||
values.englishName = prefix ? `${prefix}${code}` : code;
|
||||
values.remark = String(values.remark || '').trim() || undefined;
|
||||
if (!values.status) values.status = 1;
|
||||
return values;
|
||||
},
|
||||
@@ -464,9 +430,6 @@ export default {
|
||||
refreshChange() {
|
||||
this.onLoad(this.page, this.query);
|
||||
},
|
||||
handleImport() {
|
||||
openImportDialog(this, '费用项');
|
||||
},
|
||||
buildExportParams() {
|
||||
return {
|
||||
...this.query,
|
||||
@@ -492,15 +455,6 @@ export default {
|
||||
});
|
||||
});
|
||||
},
|
||||
handleTemplate() {
|
||||
exportBlob(
|
||||
`/blade-system/fee-item/export-template?${this.website.tokenHeader}=${getToken()}`,
|
||||
undefined,
|
||||
{ feedback: true }
|
||||
).then(res => {
|
||||
downloadXls(res.data, '费用项模板.xlsx');
|
||||
});
|
||||
},
|
||||
onLoad(page, params = {}) {
|
||||
this.loading = true;
|
||||
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
|
||||
|
||||
Reference in New Issue
Block a user