会计附件上传

main
mo 1 year ago
parent 25c8971d31
commit 7b07067b7a

@ -7,7 +7,7 @@
size="small" size="small"
:inline="true" :inline="true"
v-show="showSearch" v-show="showSearch"
label-width="98px" label-width="148px"
> >
<el-form-item label="凭证号" prop="voucherNum"> <el-form-item label="凭证号" prop="voucherNum">
<el-input <el-input
@ -17,14 +17,6 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="文件地址" prop="fileUrl">
<el-input
v-model="queryParams.fileUrl"
placeholder="请输入文件地址"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="OA/ERP流程编号" prop="flowCode"> <el-form-item label="OA/ERP流程编号" prop="flowCode">
<el-input <el-input
v-model="queryParams.flowCode" v-model="queryParams.flowCode"
@ -33,14 +25,6 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="文件名" prop="fileName">
<el-input
v-model="queryParams.fileName"
placeholder="请输入文件名"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery" <el-button type="primary" icon="el-icon-search" @click="handleQuery"
>搜索</el-button >搜索</el-button
@ -89,7 +73,7 @@
prop="voucherId" prop="voucherId"
/> --> /> -->
<el-table-column label="凭证号" align="center" prop="voucherNum" /> <el-table-column label="凭证号" align="center" prop="voucherNum" />
<el-table-column label="业务实体" align="center" prop="company" /> <!-- <el-table-column label="业务实体" align="center" prop="company" /> -->
<el-table-column label="文件地址" align="center" prop="fileUrl"> <el-table-column label="文件地址" align="center" prop="fileUrl">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="openLink(scope.row.fileUrl)"> <el-button type="text" @click="openLink(scope.row.fileUrl)">
@ -99,9 +83,9 @@
</el-table-column> </el-table-column>
<el-table-column label="流程号" align="center" prop="flowId" /> <el-table-column label="流程号" align="center" prop="flowId" />
<el-table-column label="OA/ERP流程编号" align="center" prop="flowCode" /> <el-table-column label="OA/ERP流程编号" align="center" prop="flowCode" />
<el-table-column label="制单人" align="center" prop="createBy" />
<el-table-column label="文件名" align="center" prop="fileName" /> <el-table-column label="文件名" align="center" prop="fileName" />
<el-table-column label="文件大小" align="center" prop="fileSize" /> <el-table-column label="文件大小" align="center" prop="fileSize" />
<el-table-column label="制单人" align="center" prop="createBy" />
<el-table-column <el-table-column
label="创建时间" label="创建时间"
align="center" align="center"
@ -154,28 +138,58 @@
width="1000px" width="1000px"
append-to-body append-to-body
> >
<el-form ref="form" :model="form" :rules="rules" label-width="100px"> <el-upload
<el-form-item label="凭证号" prop="voucherNum"> class="upload-demo"
drag
:limit="1"
:action="uploadUrl"
:file-list="fileList"
:headers="headers"
:on-success="handleSuccess"
name="multipartFile"
:multiple="false"
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
</el-upload>
<el-form
ref="form"
:model="form"
:rules="rules"
label-width="140px"
style="margin-top: 20px"
>
<el-row>
<el-col :span="8">
<!-- <el-form-item label="凭证号" prop="voucherNum">
<el-input v-model="form.voucherNum" placeholder="请输入凭证号" /> <el-input v-model="form.voucherNum" placeholder="请输入凭证号" />
</el-form-item> -->
<el-form-item label="会计凭证" prop="voucherId">
<el-select v-model="form.voucherId" placeholder="请选择会计凭证">
<el-option
v-for="item in kjpzOptions"
:key="item.id"
:label="item.voucherNum"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="业务实体" prop="company"> </el-col>
<el-input v-model="form.company" placeholder="请输入业务实体" /> <el-col :span="8">
</el-form-item>
<el-form-item label="文件地址" prop="fileUrl">
<el-input v-model="form.fileUrl" placeholder="请输入文件地址" />
</el-form-item>
<el-form-item label="流程号" prop="flowId">
<el-input v-model="form.flowId" placeholder="请输入流程号" />
</el-form-item>
<el-form-item label="OA/ERP流程编号" prop="flowCode"> <el-form-item label="OA/ERP流程编号" prop="flowCode">
<el-input <el-input
v-model="form.flowCode" v-model="form.flowCode"
placeholder="请输入OA/ERP流程编号" placeholder="请输入OA/ERP流程编号"
/> />
</el-form-item> </el-form-item>
<el-form-item label="文件名" prop="fileName"> </el-col>
<el-input v-model="form.fileName" placeholder="请输入文件名" /> <el-col :span="8">
<el-form-item label="流程号" prop="flowId">
<el-input v-model="form.flowId" placeholder="请输入流程号" />
</el-form-item> </el-form-item>
</el-col>
</el-row>
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input <el-input
v-model="form.remark" v-model="form.remark"
@ -201,6 +215,8 @@ import {
getAttachmentPage, getAttachmentPage,
exportAttachmentExcel, exportAttachmentExcel,
} from "@/api/accounting/attachment"; } from "@/api/accounting/attachment";
import { getAccessToken, getTenantId } from "@/utils/auth";
import { getVoucherPage } from "@/api/accounting/voucher";
export default { export default {
name: "Attachment", name: "Attachment",
@ -221,6 +237,7 @@ export default {
title: "", title: "",
// //
open: false, open: false,
fileList: [],
// //
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
@ -253,10 +270,20 @@ export default {
}, },
], ],
}, },
fileList: [], //
uploadUrl:
process.env.VUE_APP_BASE_API +
"/admin-api/accounting/attachment/upload", //
headers: {
Authorization: "Bearer " + getAccessToken(),
"tenant-id": getTenantId(),
}, //
kjpzOptions: [], //
}; };
}, },
created() { created() {
this.getList(); this.getList();
this.getKJPZ();
}, },
methods: { methods: {
/** 查询列表 */ /** 查询列表 */
@ -269,6 +296,12 @@ export default {
this.loading = false; this.loading = false;
}); });
}, },
//
getKJPZ() {
getVoucherPage().then((res) => {
this.kjpzOptions = res.data.list || [];
});
},
/** /**
* 文件预览 * 文件预览
* @param fileUrl * @param fileUrl
@ -318,6 +351,7 @@ export default {
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.reset(); this.reset();
this.fileList = [];
this.open = true; this.open = true;
this.title = "添加会计附件"; this.title = "添加会计附件";
}, },
@ -331,6 +365,13 @@ export default {
this.title = "修改会计附件"; this.title = "修改会计附件";
}); });
}, },
//
handleSuccess(res) {
console.log(res);
this.form.fileUrl = res.data.url;
this.form.fileName = res.data.name;
this.form.fileSize = res.data.size;
},
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {

@ -323,7 +323,7 @@ export default {
rules: {}, rules: {},
fileList: [], // fileList: [], //
uploadUrl: uploadUrl:
process.env.VUE_APP_BASE_API + "/admin-api//archives/flow/upload", // process.env.VUE_APP_BASE_API + "/admin-api/archives/flow/upload", //
headers: { headers: {
Authorization: "Bearer " + getAccessToken(), Authorization: "Bearer " + getAccessToken(),
"tenant-id": getTenantId(), "tenant-id": getTenantId(),

@ -429,6 +429,7 @@ import { listData } from "@/api/system/dict/data";
import { getAttachmentPage } from "@/api/accounting/attachment"; import { getAttachmentPage } from "@/api/accounting/attachment";
import { getFlowPage } from "@/api/accounting/flow"; import { getFlowPage } from "@/api/accounting/flow";
import { getInvoicesPage } from "@/api/accounting/invoices"; import { getInvoicesPage } from "@/api/accounting/invoices";
import { getBankSlipPage } from "@/api/accounting/bankSlip";
import { getAccessToken, getTenantId } from "@/utils/auth"; import { getAccessToken, getTenantId } from "@/utils/auth";
export default { export default {
@ -607,6 +608,17 @@ export default {
}); });
}); });
}, },
/** 查询银行回单 */
getYHHD(val) {
//
getBankSlipPage({ voucherId: val }).then((response) => {
if (response.data.total == 0) {
this.showNul4 = true;
} else {
this.showNul4 = false;
}
});
},
handleClickOfd() {}, handleClickOfd() {},
handleSuccess3() {}, handleSuccess3() {},
// //
@ -741,6 +753,7 @@ export default {
this.getFJ(row.voucherNum); this.getFJ(row.voucherNum);
this.getSPLC(row.id); this.getSPLC(row.id);
this.getDZFP(row.id); this.getDZFP(row.id);
this.getYHHD(row.id);
}, },
handleClick(tab) {}, handleClick(tab) {},
/** 提交按钮 */ /** 提交按钮 */

Loading…
Cancel
Save