发票关联凭证修改为多选

main
mo 1 year ago
parent e799663759
commit c55a7e629a

@ -18,6 +18,15 @@ export function updateInvoices(data) {
})
}
// 关联会计凭证
export function updateArrayInvoices(data) {
return request({
url: '/accounting/invoices/update/array',
method: 'put',
data: data
})
}
// 删除发票
export function deleteInvoices(id) {
return request({

@ -106,7 +106,7 @@
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple1"
:disabled="multiple"
@click="handleDelete"
>删除</el-button
>
@ -746,12 +746,12 @@
width="800px"
append-to-body
>
<el-form ref="form" :model="form" :rules="rules" label-width="140px">
<el-form ref="PZform" :model="PZform" :rules="rules" label-width="140px">
<el-row>
<el-col :span="14">
<el-form-item label="会计凭证" prop="voucherId">
<el-form-item label="会计凭证">
<el-input
v-model="form.voucherId"
v-model="PZform.voucherNum"
placeholder="请选择凭证"
readonly
>
@ -793,6 +793,7 @@ import {
outTemplate,
downloadXml,
getInvoicesPageTime,
updateArrayInvoices,
} from "@/api/accounting/invoices";
import { getVoucherPage } from "@/api/accounting/voucher";
import { listData } from "@/api/system/dict/data";
@ -810,10 +811,8 @@ export default {
optType: undefined,
//
loading: true,
//
multiple: true,
//
multiple1: true,
multiple: true,
//
exportLoading: false,
downloadLoading: false,
@ -901,6 +900,10 @@ export default {
},
//
form: {},
PZform: {
voucherId: undefined,
voucherNum: undefined,
},
uploadUrl:
process.env.VUE_APP_BASE_API +
"/admin-api/accounting/invoices/identify", //
@ -1178,13 +1181,7 @@ export default {
handleSelectionChange(selection) {
console.log(selection);
this.ids = selection.map((item) => item.id);
if (selection.length == 1) {
this.multiple = false;
this.form = selection[0];
} else {
this.multiple = true;
}
this.multiple1 = !selection.length;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
@ -1287,16 +1284,19 @@ export default {
},
//
handleGLPZ() {
this.form.voucherId = null;
this.open2 = true;
console.log(this.form);
this.PZform = {
voucherId: undefined,
voucherNum: undefined,
};
},
submitForm2() {
this.$refs["form"].validate((valid) => {
this.$refs["PZform"].validate((valid) => {
if (!valid) {
return;
}
updateInvoices(this.form).then((response) => {
const data = { id: this.ids, voucherId: this.PZform.voucherId };
updateArrayInvoices(data).then((response) => {
this.$modal.msgSuccess("关联成功");
this.open2 = false;
this.multiple = true;
@ -1387,7 +1387,8 @@ export default {
onVoucherSelected(obj) {
console.log(obj);
if (obj != undefined && obj != null) {
this.form.voucherId = obj.id;
this.PZform.voucherId = obj.id;
this.PZform.voucherNum = obj.voucherNum;
}
},
},

Loading…
Cancel
Save