修改修复,新增下载

main
mo 1 year ago
parent 9846455edb
commit 317a0794c3

@ -106,14 +106,21 @@
class-name="small-padding fixed-width" class-name="small-padding fixed-width"
> >
<template v-slot="scope"> <template v-slot="scope">
<!-- <el-button <el-button
size="mini"
type="text"
icon="el-icon-download"
@click="handleDownload(scope.row)"
>下载</el-button
>
<el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['archives:accounting-book:update']" v-hasPermi="['archives:accounting-book:update']"
>修改</el-button >修改</el-button
> --> >
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
@ -182,7 +189,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<table id="table_order"> <table id="table_order" v-if="optType != 'edit'">
<thead> <thead>
<tr> <tr>
<th>类型</th> <th>类型</th>
@ -285,7 +292,9 @@ import {
createAccountingBook, createAccountingBook,
deleteAccountingBook, deleteAccountingBook,
getAccountingBookPage, getAccountingBookPage,
getAccountingBook,
exportAccountingBookExcel, exportAccountingBookExcel,
updateAccountingBook,
downloadXml, downloadXml,
} from "@/api/accounting/book"; } from "@/api/accounting/book";
import { getAccessToken } from "@/utils/auth"; import { getAccessToken } from "@/utils/auth";
@ -296,6 +305,7 @@ export default {
components: {}, components: {},
data() { data() {
return { return {
optType: "",
// //
loading: true, loading: true,
// //
@ -423,16 +433,39 @@ export default {
handleAdd() { handleAdd() {
this.reset(); this.reset();
this.open = true; this.open = true;
this.optType = "add";
this.title = "添加会计账簿"; this.title = "添加会计账簿";
}, },
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id;
this.optType = "edit";
getAccountingBook(id).then((response) => {
this.form = response.data;
this.open = true;
this.title = "修改会计账簿";
});
},
//
handleDownload(row) {
window.open(row.uri);
},
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
// if (this.optType == "add") {
this.$refs.upload.submit(); //
this.$refs.upload1.submit(); this.$refs.upload.submit();
this.$refs.upload2.submit(); this.$refs.upload1.submit();
this.$refs.upload2.submit();
} else {
updateAccountingBook(this.form).then((response) => {
this.open = false;
this.getList();
});
}
} }
}); });
}, },

Loading…
Cancel
Save