新增元数据下载

main
mo 1 year ago
parent bcec818e9e
commit b4bf2dfe69

@ -53,3 +53,13 @@ export function exportAccountingBookExcel(query) {
responseType: 'blob' responseType: 'blob'
}) })
} }
// 下载元数据
export function downloadXml(query) {
return request({
url: '/archives/accounting-book/downloadXml',
method: 'get',
params: query,
responseType: 'blob'
})
}

@ -52,3 +52,13 @@ export function exportAccountingReportExcel(query) {
responseType: 'blob' responseType: 'blob'
}) })
} }
// 下载元数据
export function downloadXml(query) {
return request({
url: '/archives/accounting-report/downloadXml',
method: 'get',
params: query,
responseType: 'blob'
})
}

@ -60,6 +60,16 @@
>导出</el-button >导出</el-button
> >
</el-col> </el-col>
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-download"
size="mini"
@click="handleDownloadData"
>下载元数据</el-button
>
</el-col>
<right-toolbar <right-toolbar
:showSearch.sync="showSearch" :showSearch.sync="showSearch"
@queryTable="getList" @queryTable="getList"
@ -236,6 +246,36 @@
<el-button @click="cancel"> </el-button> <el-button @click="cancel"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
<!-- 密码输入框-->
<el-dialog
:title="title"
:visible.sync="open1"
width="800px"
append-to-body
>
<el-form
ref="queryForm"
:model="queryParams"
:rules="rules"
label-width="140px"
>
<el-row>
<el-col :span="14">
<el-form-item label="密码" prop="inputPassword">
<el-input
v-model="queryParams.inputPassword"
placeholder="请输入密码"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm1"> </el-button>
<el-button @click="cancel1"> </el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
@ -245,6 +285,7 @@ import {
deleteAccountingBook, deleteAccountingBook,
getAccountingBookPage, getAccountingBookPage,
exportAccountingBookExcel, exportAccountingBookExcel,
downloadXml,
} from "@/api/accounting/book"; } from "@/api/accounting/book";
import { getAccessToken } from "@/utils/auth"; import { getAccessToken } from "@/utils/auth";
import { getOrganizationPage } from "@/api/setting/organization"; import { getOrganizationPage } from "@/api/setting/organization";
@ -271,6 +312,7 @@ export default {
fileList2: [], fileList2: [],
// //
open: false, open: false,
open1: false,
// //
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
@ -281,6 +323,7 @@ export default {
type: null, type: null,
year: null, year: null,
period: null, period: null,
inputPassword: null,
}, },
// //
form: {}, form: {},
@ -293,6 +336,9 @@ export default {
period: [ period: [
{ required: true, message: "请输入会计期间", trigger: "blur" }, { required: true, message: "请输入会计期间", trigger: "blur" },
], ],
inputPassword: [
{ required: true, message: "密码不能为空", trigger: "blur" },
],
}, },
uploadUrl: uploadUrl:
process.env.VUE_APP_BASE_API + process.env.VUE_APP_BASE_API +
@ -347,6 +393,10 @@ export default {
this.open = false; this.open = false;
this.reset(); this.reset();
}, },
/** 取消按钮 */
cancel1() {
this.open1 = false;
},
/** 表单重置 */ /** 表单重置 */
reset() { reset() {
this.form = { this.form = {
@ -387,6 +437,26 @@ export default {
} }
}); });
}, },
//
handleDownloadData() {
this.open1 = true;
this.queryParams.inputPassword = null;
},
submitForm1() {
this.$refs["queryForm"].validate((valid) => {
if (!valid) {
return;
}
//
let params = { ...this.queryParams };
downloadXml(params)
.then((response) => {
this.$download.excel(response, "会计账簿元数据.xml");
this.open1 = false;
})
.catch(() => {});
});
},
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const id = row.id; const id = row.id;

@ -69,6 +69,16 @@
>导出</el-button >导出</el-button
> >
</el-col> </el-col>
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-download"
size="mini"
@click="handleDownloadData"
>下载元数据</el-button
>
</el-col>
<right-toolbar <right-toolbar
:showSearch.sync="showSearch" :showSearch.sync="showSearch"
@queryTable="getList" @queryTable="getList"
@ -241,6 +251,36 @@
<el-button @click="cancel"> </el-button> <el-button @click="cancel"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
<!-- 密码输入框-->
<el-dialog
:title="title"
:visible.sync="open1"
width="800px"
append-to-body
>
<el-form
ref="queryForm"
:model="queryParams"
:rules="rules"
label-width="140px"
>
<el-row>
<el-col :span="14">
<el-form-item label="密码" prop="inputPassword">
<el-input
v-model="queryParams.inputPassword"
placeholder="请输入密码"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm1"> </el-button>
<el-button @click="cancel1"> </el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
@ -251,6 +291,7 @@ import {
getAccountingReport, getAccountingReport,
getAccountingReportPage, getAccountingReportPage,
exportAccountingReportExcel, exportAccountingReportExcel,
downloadXml,
} from "@/api/accounting/report"; } from "@/api/accounting/report";
import { getAccessToken } from "@/utils/auth"; import { getAccessToken } from "@/utils/auth";
import { getOrganizationPage } from "@/api/setting/organization"; import { getOrganizationPage } from "@/api/setting/organization";
@ -277,6 +318,7 @@ export default {
fileList2: [], fileList2: [],
// //
open: false, open: false,
open1: false,
// //
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
@ -295,6 +337,7 @@ export default {
archiveState: null, archiveState: null,
deptId: null, deptId: null,
deptName: null, deptName: null,
inputPassword: null,
}, },
// //
form: {}, form: {},
@ -307,6 +350,9 @@ export default {
period: [ period: [
{ required: true, message: "请输入会计期间", trigger: "blur" }, { required: true, message: "请输入会计期间", trigger: "blur" },
], ],
inputPassword: [
{ required: true, message: "密码不能为空", trigger: "blur" },
],
}, },
uploadUrl: uploadUrl:
process.env.VUE_APP_BASE_API + process.env.VUE_APP_BASE_API +
@ -338,6 +384,10 @@ export default {
this.open = false; this.open = false;
this.reset(); this.reset();
}, },
/** 取消按钮 */
cancel1() {
this.open1 = false;
},
/** 表单重置 */ /** 表单重置 */
reset() { reset() {
this.form = { this.form = {
@ -371,6 +421,26 @@ export default {
this.resetForm("queryForm"); this.resetForm("queryForm");
this.handleQuery(); this.handleQuery();
}, },
//
handleDownloadData() {
this.open1 = true;
this.queryParams.inputPassword = null;
},
submitForm1() {
this.$refs["queryForm"].validate((valid) => {
if (!valid) {
return;
}
//
let params = { ...this.queryParams };
downloadXml(params)
.then((response) => {
this.$download.excel(response, "会计账簿元数据.xml");
this.open1 = false;
})
.catch(() => {});
});
},
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.reset(); this.reset();

Loading…
Cancel
Save