Merge remote-tracking branch 'origin/main'

main
zk 1 year ago
commit 166c42ef80

@ -0,0 +1,54 @@
import request from '@/utils/request'
// 创建会计报表
export function createAccountingReport(data) {
return request({
url: '/archives/accounting-report/create',
method: 'post',
data: data
})
}
// 更新会计报表
export function updateAccountingReport(data) {
return request({
url: '/archives/accounting-report/update',
method: 'put',
data: data
})
}
// 删除会计报表
export function deleteAccountingReport(id) {
return request({
url: '/archives/accounting-report/delete?id=' + id,
method: 'delete'
})
}
// 获得会计报表
export function getAccountingReport(id) {
return request({
url: '/archives/accounting-report/get?id=' + id,
method: 'get'
})
}
// 获得会计报表分页
export function getAccountingReportPage(query) {
return request({
url: '/archives/accounting-report/page',
method: 'get',
params: query
})
}
// 导出会计报表 Excel
export function exportAccountingReportExcel(query) {
return request({
url: '/archives/accounting-report/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

@ -16,4 +16,13 @@ export function uploadFileApi(data) {
method: 'post',
data: data
})
}
// 文件上传
export function uploadInvoiceApi(data) {
return request({
url: '/accounting/invoices/identify',
method: 'post',
data: data
})
}

@ -1,17 +1,48 @@
<!-- -->
<template>
<div class="out">
<el-upload :class="{ hide: hideUpload }" ref="imgListRef" :limit="1" :file-list="fileList" :on-change="onUploadChange" :before-upload="beforeFileUpload" action="#" :accept="imgType" list-type="picture-card" :auto-upload="false">
<el-upload
:class="{ hide: hideUpload }"
ref="imgListRef"
:limit="1"
:file-list="fileList"
:on-change="onUploadChange"
:before-upload="beforeFileUpload"
action="#"
:accept="imgType"
list-type="picture-card"
:auto-upload="false"
>
<i class="el-icon-plus"></i>
<div slot="file" slot-scope="{file}" style="position: relative;height: 100%;">
<img class="el-upload-list__item-thumbnail" v-if="!isPdf" :src="file.url" alt />
<img class="el-upload-list__item-thumbnail" v-else src="~@/assets/images/pdf.png" alt />
<div v-if="isPdf" class="pdf-name">{{pdfName}}</div>
<div
slot="file"
slot-scope="{ file }"
style="position: relative; height: 100%"
>
<img
class="el-upload-list__item-thumbnail"
v-if="!isPdf"
:src="file.url"
alt
/>
<img
class="el-upload-list__item-thumbnail"
v-else
src="~@/assets/images/pdf.png"
alt
/>
<div v-if="isPdf" class="pdf-name">{{ pdfName }}</div>
<span class="el-upload-list__item-actions">
<span class="el-upload-list__item-preview" @click="handlePictureCardPreview(file)">
<span
class="el-upload-list__item-preview"
@click="handlePictureCardPreview(file)"
>
<i class="el-icon-zoom-in"></i>
</span>
<span class="el-upload-list__item-delete" @click="handleRemove(file, fileList)">
<span
class="el-upload-list__item-delete"
@click="handleRemove(file, fileList)"
>
<i class="el-icon-delete"></i>
</span>
</span>
@ -19,40 +50,53 @@
</el-upload>
<div class="title">支持pngpdfjpg格式上传</div>
<div class="inside">
<el-button type="primary" @click="handleScan" size="small" plain>发票识别</el-button>
<el-button type="primary" @click="handleCheck" size="small" plain>发票验真</el-button>
<el-button type="primary" @click="handleScan" size="small" plain
>发票识别</el-button
>
<el-button type="primary" @click="handleCheck" size="small" plain
>发票验真</el-button
>
</div>
<el-image-viewer v-if="dialogVisible" :zIndex="9999" :on-close="closeImgViewer" :url-list="imgList" />
<el-image-viewer
v-if="dialogVisible"
:zIndex="9999"
:on-close="closeImgViewer"
:url-list="imgList"
/>
<!-- 文件在线预览 -->
<FilePreview :previewFile="previewFile" :fileUrl="fileUrl" @update="previewFile=false" />
<FilePreview
:previewFile="previewFile"
:fileUrl="fileUrl"
@update="previewFile = false"
/>
</div>
</template>
<script>
import ElImageViewer from "element-ui/packages/image/src/image-viewer";
import { uploadFileApi } from "@/api/common"
import { uploadFileApi } from "@/api/common";
export default {
name: '',
name: "",
props: {
files: Array,
},
watch: {
files: {
handler(list) {
this.fileList = list
this.fileList = list;
if (list.length >= 1) {
this.hideUpload = true
this.hideUpload = true;
} else {
this.hideUpload = false
this.hideUpload = false;
}
},
},
deep: true
deep: true,
},
data() {
return {
hideUpload: false,
imgType: '.jpeg, .jpg, .png, .pdf',
imgType: ".jpeg, .jpg, .png, .pdf",
fileList: [],
dialogVisible: false,
isPdf: false,
@ -60,81 +104,84 @@ export default {
imgList: null,
fileUrl: null,
previewFile: false,
}
};
},
components: {
ElImageViewer,
FilePreview: () => import('@/components/FilePreview'),
FilePreview: () => import("@/components/FilePreview"),
},
computed: {},
methods: {
//
handleRemove(file, files) {
this.fileList = files.filter(item => file.uid !== item.uid)
this.$emit('onConfirm', this.fileList)
return false
this.fileList = files.filter((item) => file.uid !== item.uid);
this.$emit("onConfirm", this.fileList);
return false;
},
//
onUploadChange(file, fileList) {
this.beforeFileUpload(file, fileList)
this.beforeFileUpload(file, fileList);
},
beforeFileUpload(file, fileList) {
//before-upload使
const isImage = file.raw.type == 'image/png' || file.raw.type == 'image/jpg' || file.raw.type == 'image/jpeg' || file.raw.type == 'application/pdf';
const isImage =
file.raw.type == "image/png" ||
file.raw.type == "image/jpg" ||
file.raw.type == "image/jpeg" ||
file.raw.type == "application/pdf";
// const isLt5M = file.size < 1024 * 1024 * 5;
if (!isImage) {
this.$message.warning('上传只能是png,jpg,jpeg,.pdf格式!');
this.$message.warning("上传只能是png,jpg,jpeg,.pdf格式!");
}
if (file.raw.type == 'application/pdf') {
this.isPdf = true
this.pdfName = file.raw.name
if (file.raw.type == "application/pdf") {
this.isPdf = true;
this.pdfName = file.raw.name;
} else {
this.isPdf = false
this.isPdf = false;
}
let FormDatas = new FormData()
FormDatas.append('file', file.raw);
FormDatas.append('path', file.raw.name);
let FormDatas = new FormData();
FormDatas.append("file", file.raw);
FormDatas.append("path", file.raw.name);
this.$modal.loading("正在上传,请稍候...");
uploadFileApi(FormDatas).then((res) => {
this.fileList.push({ name: file.name, url: res.data });//
this.$emit('onConfirm', this.fileList)
this.$modal.closeLoading()
})
this.fileList.push({ name: file.name, url: res.data }); //
this.$emit("onConfirm", this.fileList);
this.$modal.closeLoading();
});
},
closeImgViewer() {
this.dialogVisible = false;
},
handlePictureCardPreview(file) {
if (file.name.indexOf('.pdf') > -1) {
this.fileUrl = this.fileList[0].url
this.previewFile = true
if (file.name.indexOf(".pdf") > -1) {
this.fileUrl = this.fileList[0].url;
this.previewFile = true;
} else {
this.imgList = [file.url]
this.dialogVisible = true
this.imgList = [file.url];
this.dialogVisible = true;
}
},
//
handleScan() {
if (this.fileList.length) {
this.$emit('onScan')
this.$emit("onScan");
} else {
this.$fm('请先上传发票!')
this.$fm("请先上传发票!");
}
},
//
handleCheck() {
if (this.fileList.length) {
this.$emit('onCheck')
this.$emit("onCheck");
} else {
this.$fm('请先上传发票!')
this.$fm("请先上传发票!");
}
},
}
}
},
};
</script>
<style lang='scss' scoped>
@import '@/assets/styles/form/index.scss';
<style lang="scss" scoped>
@import "@/assets/styles/form/index.scss";
.pdf-name {
text-align: center;
position: absolute;
@ -148,4 +195,4 @@ export default {
// height: auto !important;
object-fit: cover;
}
</style>
</style>

@ -0,0 +1,221 @@
<!-- -->
<template>
<div class="out">
<el-upload
:class="{ hide: hideUpload }"
ref="imgListRef"
:limit="1"
:file-list="fileList"
:on-change="onUploadChange"
:before-upload="beforeFileUpload"
action="#"
:accept="imgType"
list-type="picture-card"
:auto-upload="false"
>
<i class="el-icon-plus"></i>
<div
slot="file"
slot-scope="{ file }"
style="position: relative; height: 100%"
>
<!-- pdf -->
<img
class="el-upload-list__item-thumbnail"
v-if="!isPdf"
:src="file.url"
alt
/>
<img
class="el-upload-list__item-thumbnail"
v-else
src="~@/assets/images/pdf.png"
alt
/>
<div v-if="isPdf" class="pdf-name">{{ pdfName }}</div>
<!-- ofd -->
<img
class="el-upload-list__item-thumbnail"
v-if="!isOfd"
:src="file.url"
alt
/>
<img class="el-upload-list__item-thumbnail" v-else alt />
<div v-if="isOfd" class="pdf-name">{{ ofdName }}</div>
<span class="el-upload-list__item-actions">
<span
class="el-upload-list__item-preview"
@click="handlePictureCardPreview(file)"
>
<i class="el-icon-zoom-in"></i>
</span>
<span
class="el-upload-list__item-delete"
@click="handleRemove(file, fileList)"
>
<i class="el-icon-delete"></i>
</span>
</span>
</div>
</el-upload>
<div class="title">支持图片pdfofd格式上传</div>
<div class="inside">
<el-button type="primary" @click="handleScan" size="small" plain
>发票识别</el-button
>
<el-button type="primary" @click="handleCheck" size="small" plain
>发票验真</el-button
>
</div>
<el-image-viewer
v-if="dialogVisible"
:zIndex="9999"
:on-close="closeImgViewer"
:url-list="imgList"
/>
<!-- 文件在线预览 -->
<FilePreview
:previewFile="previewFile"
:fileUrl="fileUrl"
@update="previewFile = false"
/>
</div>
</template>
<script>
import ElImageViewer from "element-ui/packages/image/src/image-viewer";
import { uploadInvoiceApi } from "@/api/common";
export default {
name: "",
props: {
files: Array,
},
watch: {
files: {
handler(list) {
this.fileList = list;
if (list.length >= 1) {
this.hideUpload = true;
} else {
this.hideUpload = false;
}
},
},
deep: true,
},
data() {
return {
hideUpload: false,
imgType: ".jpeg, .jpg, .png, .pdf ,.ofd",
fileList: [],
dialogVisible: false,
isPdf: false,
isOfd: false,
pdfName: null,
ofdName: null,
imgList: null,
fileUrl: null,
previewFile: false,
invoiceForm: {},
};
},
components: {
ElImageViewer,
FilePreview: () => import("@/components/FilePreview"),
},
computed: {},
methods: {
//
handleRemove(file, files) {
this.fileList = [];
this.$emit("onConfirm", this.fileList);
return false;
},
//
onUploadChange(file, fileList) {
this.beforeFileUpload(file, fileList);
},
beforeFileUpload(file, fileList) {
console.log(file);
//before-upload使
const isImage =
file.raw.type == "image/png" ||
file.raw.type == "image/jpg" ||
file.raw.type == "image/jpeg" ||
file.raw.type == "application/pdf" ||
file.raw.type == "application/ofd";
// const isLt5M = file.size < 1024 * 1024 * 5;
if (!isImage) {
this.$message.warning("上传只能是png,jpg,jpeg格式!");
}
if (file.raw.type == "application/pdf") {
this.isPdf = true;
this.pdfName = file.raw.name;
} else {
this.isPdf = false;
}
if (file.raw.type == "application/ofd") {
this.isOfd = true;
this.pdfName = file.raw.name;
} else {
this.isOfd = false;
}
let FormDatas = new FormData();
FormDatas.append("multipartFile", file.raw);
this.$modal.loading("正在上传,请稍候...");
uploadInvoiceApi(FormDatas).then((res) => {
this.invoiceForm = res.data;
this.fileList.push({ name: file.name, url: res.data.fileUrl }); //
this.$emit("onConfirm", this.fileList);
this.$modal.closeLoading();
});
},
closeImgViewer() {
this.dialogVisible = false;
},
//
handlePictureCardPreview(file) {
if (file.name.indexOf(".pdf") > -1) {
this.fileUrl = this.fileList[0].url;
this.previewFile = true;
} else {
this.imgList = [file.url];
this.dialogVisible = true;
}
},
//
handleScan() {
if (this.fileList.length) {
this.$emit("onScan", this.invoiceForm);
} else {
this.$fm("请先上传发票!");
}
},
//
handleCheck() {
if (this.fileList.length) {
this.$emit("onCheck");
} else {
this.$fm("请先上传发票!");
}
},
},
};
</script>
<style lang="scss" scoped>
@import "@/assets/styles/form/index.scss";
.pdf-name {
text-align: center;
position: absolute;
width: 100%;
top: 115px;
line-height: 15px;
font-size: smaller;
bottom: 0;
}
.el-upload-list--picture-card .el-upload-list__item-thumbnail {
// height: auto !important;
object-fit: cover;
}
</style>

@ -10,20 +10,25 @@
label-width="68px"
>
<el-form-item label="会计年度" prop="year">
<el-input
<el-date-picker
format="yyyy年"
v-model="queryParams.year"
placeholder="请输入会计年度"
clearable
@keyup.enter.native="handleQuery"
/>
value-format="yyyy"
type="year"
placeholder="请选择会计年度"
>
</el-date-picker>
</el-form-item>
<el-form-item label="会计期间" prop="period">
<el-input
<el-date-picker
popper-class="due_month"
v-model="queryParams.period"
placeholder="请输入会计期间"
clearable
@keyup.enter.native="handleQuery"
/>
format="M月"
value-format="M"
type="month"
placeholder="请选择会计期间"
>
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery"
@ -64,7 +69,13 @@
<!-- 列表 -->
<el-table v-loading="loading" :data="list">
<el-table-column label="账簿名称" align="center" prop="name" />
<el-table-column label="账簿名称" align="center" prop="name">
<!-- <template slot-scope="scope">
<el-button type="text" @click="openLink(scope.row.uri)">
{{ scope.row.name }}
</el-button>
</template> -->
</el-table-column>
<el-table-column label="业务实体" align="center" prop="company" />
<el-table-column label="细分类型" align="center" prop="type" />
<el-table-column label="会计年度" align="center" prop="year" />
@ -220,7 +231,6 @@
</tr>
</tbody>
</table>
<div></div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
@ -311,6 +321,16 @@ export default {
this.getOrganizationList();
},
methods: {
// /**
// *
// * @param fileUrl
// */
// openLink(fileUrl) {
// const url = `http://139.224.253.31:48012/onlinePreview?url=${encodeURIComponent(
// this.base64Encode(fileUrl)
// )}`;
// window.open(url);
// },
/** 查询列表 */
getList() {
this.loading = true;
@ -327,6 +347,7 @@ export default {
this.organizationList = response.data.list;
});
},
//
handleCompanyChange(val) {
var data = this.organizationList.find((item) => item.id == val);
console.log(data);

@ -256,7 +256,7 @@
width="1300px"
append-to-body
>
<el-upload
<!-- <el-upload
class="upload-demo"
drag
:action="uploadUrl"
@ -272,9 +272,19 @@
<div class="el-upload__tip" slot="tip" style="margin-bottom: 20px">
只能上传图片PDFOFD文件
</div>
</el-upload>
</el-upload> -->
<el-form ref="form" :model="form" :rules="rules" label-width="140px">
<el-row>
<el-col :span="8">
<UploadInvoice
:files="fileList"
@onConfirm="handleImg"
@onScan="handleScan"
/>
</el-col>
</el-row>
<el-divider>发票信息</el-divider>
<el-row>
<el-col :span="8">
<el-form-item label="发票代码" prop="invoiceCode">
@ -523,7 +533,7 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<!-- <el-col :span="8">
<el-form-item label="验真" prop="checkTrue">
<el-select v-model="form.checkTrue" placeholder="请选择">
<el-option
@ -535,7 +545,7 @@
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-col> -->
</el-row>
<el-form-item label="备注" prop="remark">
<el-input
@ -567,7 +577,7 @@ import { getAccessToken } from "@/utils/auth";
export default {
name: "Invoices",
components: {},
components: { UploadInvoice: () => import("@/components/UploadInvoice") },
data() {
return {
//
@ -585,6 +595,7 @@ export default {
//
open: false,
accountingType: "in",
fileList: [],
//
queryParams: {
pageNo: 1,
@ -678,6 +689,16 @@ export default {
},
methods: {
//
handleImg(list) {
this.fileList = list;
this.reset();
},
handleScan(form) {
const num = form.duplicateMark.toString();
this.form = form;
this.form.duplicateMark = num;
},
/**
* 文件预览
* @param fileUrl
@ -841,6 +862,7 @@ export default {
this.reset();
this.open = true;
this.title = "添加发票";
this.fileList = [];
},
/** 修改按钮操作 */
handleUpdate(row) {
@ -918,3 +940,10 @@ export default {
},
};
</script>
<style scoped>
.el-divider__text.is-center {
font-weight: bold;
font-size: large;
}
</style>

@ -0,0 +1,373 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="98px"
>
<el-form-item label="报表文件名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入报表文件名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="会计年度" prop="year">
<el-date-picker
format="yyyy年"
v-model="queryParams.year"
value-format="yyyy"
type="year"
placeholder="请选择会计年度"
>
</el-date-picker>
</el-form-item>
<el-form-item label="会计期间" prop="period">
<el-date-picker
popper-class="due_month"
v-model="queryParams.period"
format="M月"
value-format="M"
type="month"
placeholder="请选择会计期间"
>
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<!-- 操作工具栏 -->
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['archives:accounting-report:create']"
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['archives:accounting-report:export']"
>导出</el-button
>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<!-- 列表 -->
<el-table v-loading="loading" :data="list">
<el-table-column label="报表文件名称" align="center" prop="name" />
<el-table-column label="报表文件url" align="center" prop="url" />
<el-table-column label="业务实体" align="center" prop="company" />
<el-table-column label="细分类型" align="center" prop="type" />
<el-table-column label="账套编号" align="center" prop="bookCode" />
<el-table-column label="会计年度" align="center" prop="year" />
<el-table-column label="会计期间" align="center" prop="period" />
<el-table-column label="归档状态" align="center" prop="archiveState" />
<el-table-column
label="创建时间"
align="center"
prop="createTime"
width="180"
>
<template v-slot="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template v-slot="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['archives:accounting-report:update']"
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['archives:accounting-report:delete']"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 对话框(添加 / 修改) -->
<el-dialog
:title="title"
:visible.sync="open"
width="1000px"
v-dialogDrag
append-to-body
>
<el-form ref="form" :model="form" :rules="rules" label-width="90px">
<el-form-item label="业务实体" prop="company">
<!-- <el-input v-model="form.company" placeholder="请输入业务实体" /> -->
<el-select
v-model="form.company"
placeholder="请选择业务实体"
@change="handleCompanyChange"
>
<el-option
v-for="item in organizationList"
:key="item.id"
:value="item.id"
:label="item.organizationName"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="会计年度" prop="year">
<el-date-picker
format="yyyy年"
v-model="form.year"
value-format="yyyy"
type="year"
placeholder="请选择会计年度"
>
</el-date-picker>
</el-form-item>
<el-form-item label="会计期间" prop="period">
<el-date-picker
popper-class="due_month"
v-model="form.period"
format="M月"
value-format="M"
type="month"
placeholder="请选择会计期间"
>
</el-date-picker>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
createAccountingReport,
updateAccountingReport,
deleteAccountingReport,
getAccountingReport,
getAccountingReportPage,
exportAccountingReportExcel,
} from "@/api/accounting/report";
export default {
name: "AccountingReport",
components: {},
data() {
return {
//
loading: true,
//
exportLoading: false,
//
showSearch: true,
//
total: 0,
//
list: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNo: 1,
pageSize: 10,
name: null,
url: null,
companyId: null,
company: null,
type: null,
bookCode: null,
year: null,
period: null,
createTime: [],
encrypt: null,
archiveId: null,
archiveState: null,
deptId: null,
deptName: null,
},
//
form: {},
//
rules: {},
};
},
created() {
this.getList();
},
methods: {
/** 查询列表 */
getList() {
this.loading = true;
//
getAccountingReportPage(this.queryParams).then((response) => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
/** 取消按钮 */
cancel() {
this.open = false;
this.reset();
},
/** 表单重置 */
reset() {
this.form = {
id: undefined,
name: undefined,
url: undefined,
companyId: undefined,
company: undefined,
type: undefined,
bookCode: undefined,
year: undefined,
period: undefined,
encrypt: undefined,
archiveId: undefined,
archiveState: undefined,
deptId: undefined,
deptName: undefined,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加会计报表";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id;
getAccountingReport(id).then((response) => {
this.form = response.data;
this.open = true;
this.title = "修改会计报表";
});
},
//
handleCompanyChange(val) {
var data = this.organizationList.find((item) => item.id == val);
console.log(data);
this.form.companyId = data.companyId;
this.Fileform.company = data.company;
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (!valid) {
return;
}
//
if (this.form.id != null) {
updateAccountingReport(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
return;
}
//
createAccountingReport(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
});
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;
this.$modal
.confirm('是否确认删除会计报表编号为"' + id + '"的数据项?')
.then(function () {
return deleteAccountingReport(id);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
//
let params = { ...this.queryParams };
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal
.confirm("是否确认导出所有会计报表数据项?")
.then(() => {
this.exportLoading = true;
return exportAccountingReportExcel(params);
})
.then((response) => {
this.$download.excel(response, "会计报表.xls");
this.exportLoading = false;
})
.catch(() => {});
},
},
};
</script>

@ -1,22 +1,32 @@
<template>
<div class="app-container form-box" style="padding:20px">
<div class="app-container form-box" style="padding: 20px">
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-card class="top15 ">
<el-card class="top15">
<div class="table-card">
<el-row type="flex" class="mt10" justify="space-around">
<el-col :span="8"></el-col>
<el-col :span="8" class="formTitle"> {{title}}</el-col>
<el-col :span="8" style="text-align: right;padding-right: 20px;">
<el-col :span="8" class="formTitle"> {{ title }}</el-col>
<el-col :span="8" style="text-align: right; padding-right: 20px">
<!-- <el-button type="primary" icon="el-icon-printer" size="mini" @click="handlePrint"></el-button> -->
<el-button type="primary" plain icon="el-icon-check" size="mini" @click="submitForm" v-if="!isNewShow"></el-button>
<el-button type="primary" size="mini" @click="handleBack"></el-button>
<el-button
type="primary"
plain
icon="el-icon-check"
size="mini"
@click="submitForm"
v-if="!isNewShow"
>保存</el-button
>
<el-button type="primary" size="mini" @click="handleBack"
>返回</el-button
>
</el-col>
</el-row>
</div>
<div class="table-card table-card-content">
<el-row :gutter="20">
<el-col :span="8" class="line-rt pr-4">
<el-form-item label="上传发票" style="margin-left: -50px;">
<el-form-item label="上传发票" style="margin-left: -50px">
<UploadImgPdf :files="fileList" @onConfirm="handleImg" />
</el-form-item>
</el-col>
@ -24,48 +34,90 @@
<el-row>
<el-col :span="8">
<el-form-item label="发票类型" prop="invoiceType">
<el-select v-model="form.invoiceType" class="wd100" size="small" placeholder="请选择" filterable>
<el-option v-for="it of typeList" :key="it.value" :value="it.value" :label="it.label"></el-option>
<el-select
v-model="form.invoiceType"
class="wd100"
size="small"
placeholder="请选择"
filterable
>
<el-option
v-for="it of typeList"
:key="it.value"
:value="it.value"
:label="it.label"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票代码" prop="invoiceCode">
<el-input size="small" v-model="form.invoiceCode" placeholder="请输入发票代码" />
<el-input
size="small"
v-model="form.invoiceCode"
placeholder="请输入发票代码"
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票号码" prop="invoiceNum">
<el-input size="small" v-model="form.invoiceNum" placeholder="请输入发票号码" />
<el-input
size="small"
v-model="form.invoiceNum"
placeholder="请输入发票号码"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="开票日期" prop="invoiceDate">
<el-date-picker clearable v-model="form.invoiceDate" value-format="yyyy/MM/dd" class=" wd100" type="date" placeholder="选择开票日期" />
<el-date-picker
clearable
v-model="form.invoiceDate"
value-format="yyyy/MM/dd"
class="wd100"
type="date"
placeholder="选择开票日期"
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="税额" prop="taxAmount">
<el-input size="small" v-model="form.taxAmount" placeholder="请输入税额" />
<el-input
size="small"
v-model="form.taxAmount"
placeholder="请输入税额"
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="不含税金额" prop="excludingTaxAmount">
<el-input size="small" v-model="form.excludingTaxAmount" placeholder="请输入不含税金额" />
<el-input
size="small"
v-model="form.excludingTaxAmount"
placeholder="请输入不含税金额"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="价税合计" prop="totalAmount">
<el-input size="small" v-model="form.totalAmount" placeholder="请输入价税合计" />
<el-input
size="small"
v-model="form.totalAmount"
placeholder="请输入价税合计"
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="销售方" prop="seller">
<el-input size="small" v-model="form.seller" placeholder="请输入销售方" />
<el-input
size="small"
v-model="form.seller"
placeholder="请输入销售方"
/>
</el-form-item>
</el-col>
</el-row>
@ -128,25 +180,25 @@
<script>
import { createInvoice, updateInvoice, getInvoice } from "@/api/bs/invoice";
import { listData } from "@/api/system/dict/data";
import dayjs from 'dayjs';
import dayjs from "dayjs";
export default {
name: '',
name: "",
components: {
UploadImgPdf: () => import('@/components/UploadImgPdf'),
UploadImgPdf: () => import("@/components/UploadImgPdf"),
// printHtml: () => import('./printHtml'),
},
computed: {
title() {
return this.$route.query.id ? '修改我的发票' : '添加我的发票'
return this.$route.query.id ? "修改我的发票" : "添加我的发票";
},
isNewShow() {
return this.$route.query.isShow
}
return this.$route.query.isShow;
},
},
created() {
this.handleInitList()
this.handleInitList();
if (this.$route.query.id) {
this.handleInitForm(this.$route.query.id)
this.handleInitForm(this.$route.query.id);
}
},
data() {
@ -162,88 +214,97 @@ export default {
//
rules: {
files: [{ required: true, message: "附件不能为空", trigger: "blur" }],
invoiceType: [{ required: true, message: "发票类型不能为空", trigger: "change" }],
invoiceCode: [{ required: true, message: "发票代码不能为空", trigger: "blur" }],
invoiceNum: [{ required: true, message: " 发票号码不能为空", trigger: "blur" }],
invoiceDate: [{ required: true, message: "开票日期不能为空", trigger: "blur" }],
invoiceType: [
{ required: true, message: "发票类型不能为空", trigger: "change" },
],
invoiceCode: [
{ required: true, message: "发票代码不能为空", trigger: "blur" },
],
invoiceNum: [
{ required: true, message: " 发票号码不能为空", trigger: "blur" },
],
invoiceDate: [
{ required: true, message: "开票日期不能为空", trigger: "blur" },
],
},
typeList: [],
}
};
},
methods: {
handleImg(list) {
this.fileList = list
this.fileList = list;
},
handleTimeChange(val) {
console.log('266+6', val);
this.$set(this.form, 'invoiceDate', dayjs(val).format('YYYY/MM/DD'))
console.log("266+6", val);
this.$set(this.form, "invoiceDate", dayjs(val).format("YYYY/MM/DD"));
},
handleInitList() {
listData({
pageNo: 1,
pageSize: 50,
dictType: 'bs_invoice_type',
dictType: "bs_invoice_type",
}).then((res) => {
this.typeList = res.data.list || []
})
this.typeList = res.data.list || [];
});
},
handleBack() {
history.back()
history.back();
},
handleInitForm(id) {
getInvoice(id).then(res => {
getInvoice(id).then((res) => {
this.form = {
...res.data || {},
invoiceDate: new Date(res.data.invoiceDate)
}
this.fileList = this.form.files
console.log('form...', this.form);
...(res.data || {}),
invoiceDate: new Date(res.data.invoiceDate),
};
this.fileList = this.form.files;
console.log("form...", this.form);
});
},
submitForm() {
this.$refs["form"].validate(valid => {
this.$refs["form"].validate((valid) => {
if (!valid) {
return;
}
let form = {
...this.form,
files: this.fileList,
invoiceDate: dayjs(this.form.invoiceDate).valueOf()
}
invoiceDate: dayjs(this.form.invoiceDate).valueOf(),
};
//
if (this.form.id != null) {
updateInvoice(form).then(response => {
updateInvoice(form).then((response) => {
// this.form = {}
// this.fileList = []
// this.$refs.form.resetFields()
history.back()
history.back();
this.$modal.msgSuccess("修改成功!");
});
return;
}
//
createInvoice(form).then(response => {
createInvoice(form).then((response) => {
this.$nextTick(() => {
this.form = {}
this.fileList = []
this.$refs.form.resetFields()
this.$modal.msgSuccess("新增成功,本页面可以重复添加发票!如需退出,请点击返回按钮!");
})
this.form = {};
this.fileList = [];
this.$refs.form.resetFields();
this.$modal.msgSuccess(
"新增成功,本页面可以重复添加发票!如需退出,请点击返回按钮!"
);
});
// history.back()
});
});
},
cancel() {
this.$emit('onCancel')
this.$emit("onCancel");
},
}
}
},
};
</script>
<style lang="scss" scoped>
@import '@/assets/styles/form/index.scss';
@import "@/assets/styles/form/index.scss";
.my-process-designer {
background: #fff !important;
}
</style>
</style>

Loading…
Cancel
Save