会计凭证元数据下载

main
JiilingLee 1 year ago
parent 7ded7a1f7e
commit abbd7c46f2

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

@ -80,6 +80,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"
@ -408,6 +418,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>
@ -420,6 +460,7 @@ import {
getVoucherPage, getVoucherPage,
exportVoucherExcel, exportVoucherExcel,
getVoucherDetailsPage, getVoucherDetailsPage,
downloadXml
} from "@/api/accounting/voucher"; } from "@/api/accounting/voucher";
import { listUser } from "@/api/system/user"; import { listUser } from "@/api/system/user";
import { getSiteTree } from "@/api/setting/organization"; import { getSiteTree } from "@/api/setting/organization";
@ -458,6 +499,7 @@ export default {
title: "", title: "",
// //
open: false, open: false,
open1: false,
activeName: "first", activeName: "first",
// //
queryParams: { queryParams: {
@ -493,6 +535,7 @@ export default {
organizationId: null, organizationId: null,
depotId: null, depotId: null,
cabinetId: null, cabinetId: null,
inputPassword: null,
}, },
fjList: [], fjList: [],
splcList: [], splcList: [],
@ -501,7 +544,11 @@ export default {
// //
form: {}, form: {},
// //
rules: {}, rules: {
inputPassword: [
{ required: true, message: "密码不能为空", trigger: "blur" },
],
},
userOptions: [], // userOptions: [], //
siteOptions: [], // siteOptions: [], //
siteArray: [], // siteArray: [], //
@ -521,6 +568,32 @@ export default {
this.handleInitList(); this.handleInitList();
}, },
methods: { methods: {
submitForm1() {
this.$refs["queryForm"].validate((valid) => {
if (!valid) {
return;
}
//
let params = { ...this.queryParams };
downloadXml(params)
.then((response) => {
console.log(response.size);
if (response.size == 39) {
this.$modal.msgError("密码错误");
return false;
} else {
this.$download.excel(response, "会计凭证元数据.xml");
this.open1 = false;
}
})
.catch(() => {});
});
},
//
handleDownloadData() {
this.open1 = true;
this.queryParams.inputPassword = null;
},
/** 查询列表 */ /** 查询列表 */
getList() { getList() {
this.loading = true; this.loading = true;
@ -639,6 +712,10 @@ export default {
this.open = false; this.open = false;
this.reset(); this.reset();
}, },
/** 取消按钮 */
cancel1() {
this.open1 = false;
},
/** 表单重置 */ /** 表单重置 */
reset() { reset() {
this.form = { this.form = {

Loading…
Cancel
Save