Merge pull request 'develop' (#193) from develop into master
Reviewed-on: http://git.xdadan.loc/tanex/emis-frontend/pulls/193
This commit is contained in:
commit
2b76a488e9
64
src/api/emis/emisInvoiceCancellation.js
Normal file
64
src/api/emis/emisInvoiceCancellation.js
Normal file
@ -0,0 +1,64 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询发票作废列表
|
||||
export function listEmisInvoiceCancellation(query) {
|
||||
return request({
|
||||
url: '/emis/emisInvoiceCancellation/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
//查询发票作废详情
|
||||
export function getEmisInvoiceCancellation(id) {
|
||||
return request({
|
||||
url: '/emis/emisInvoiceCancellation/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
//根据申请序号查询发票信息
|
||||
export function getInvoiceInfoByApplySeqNo(applySeqNo ) {
|
||||
return request({
|
||||
url: '/emis/emisInvoiceCancellation/invoiceInfo?applySeqNo='+applySeqNo,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
//发票作废申请POST请求
|
||||
export function addEmisInvoiceCancellation(data) {
|
||||
return request({
|
||||
url: '/emis/emisInvoiceCancellation',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
//发票作废删除
|
||||
export function delEmisInvoiceCancellation(id) {
|
||||
return request({
|
||||
url: '/emis/emisInvoiceCancellation/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
//撤销申请
|
||||
export function cancelEmisInvoiceCancellation(ids) {
|
||||
return request({
|
||||
url: '/emis/emisInvoiceCancellation/cancel/' + ids,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
// 审核通过
|
||||
export function passEmisInvoiceCancellation(ids) {
|
||||
return request({
|
||||
url: '/emis/emisInvoiceCancellation/audit/pass/' + ids,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
//审核驳回
|
||||
export function rejectEmisInvoiceCancellation(data) {
|
||||
return request({
|
||||
url: `/emis/emisInvoiceCancellation/audit/reject/${data.ids}`,
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
335
src/views/emis/emisSettleBill/InvoiceReversalList.vue
Normal file
335
src/views/emis/emisSettleBill/InvoiceReversalList.vue
Normal file
@ -0,0 +1,335 @@
|
||||
<template>
|
||||
<XdPageContainer class="app-container">
|
||||
<SearchForm slot="pageHeader" :model="queryParams" ref="queryForm" size="mini" :maxShow="10" label-width="100px"
|
||||
v-show="showSearch" @search="handleQuery" @reset="resetQuery">
|
||||
<el-row :gutter="0">
|
||||
<el-col :span="8">
|
||||
<el-row :gutter="0" style="display: flex;flex-wrap: wrap;">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="发票申请序号" prop="applySeqNo">
|
||||
<XdTextareaInput v-model="queryParams.params.applySeqNo"
|
||||
:placeholder="$t('多个流水号逗号或换行隔开')" clearable :rows="4" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="登记时间" prop="dateTimeRange">
|
||||
<elDateAdvPicker v-model="dateTimeRange"></elDateAdvPicker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="16">
|
||||
<el-form-item label="审核状态" prop="auditStatus">
|
||||
<el-select clearable v-model="queryParams.auditStatus" placeholder="请选择">
|
||||
<el-option label="待审核" :value="0"></el-option>
|
||||
<el-option label="已审核" :value="1"></el-option>
|
||||
<el-option label="已驳回" :value="2"></el-option>
|
||||
<el-option label="已撤销" :value="3"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="申请网点" prop="salesMen">
|
||||
<EmisSiteSimplePicker v-model="queryParams.applySiteCode" :placeholder="$t('请选择登记网点')" multiple
|
||||
clearable>
|
||||
</EmisSiteSimplePicker>
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
</el-row>
|
||||
</SearchForm>
|
||||
<XdTable ref="refTable" slot="pageContent" slot-scope="slotProps" :height="(slotProps.contentHeight) + 'px'"
|
||||
border stripe size="mini" storageName="invoiceReversalList_main" :data="invoiceCancellationList"
|
||||
:showSearch.sync="showSearch" :queryParams="queryParams" :total="total" @queryTable="getList"
|
||||
@selection-change="handleSelectionChange" @row-dblclick="handleView">
|
||||
|
||||
<div slot="toolbar">
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain size="mini" @click="handlePass"
|
||||
:disabled="multiple || !allAwait"
|
||||
v-hasPermi="['emis:emisInvoiceCancellation:auditPass']">审核通过</el-button>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain size="mini" :disabled="single || !allAwait"
|
||||
@click="handleReject"
|
||||
v-hasPermi="['emis:emisInvoiceCancellation:auditReject']">中心驳回</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
|
||||
v-hasPermi="['emis:emisInvoiceReversal:export']">导出</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain :disabled="single" size="mini" @click="handleView"
|
||||
v-hasPermi="['emis:emisInvoiceCancellation:view']">查看</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column :label="$t('申请原因')" align="center" prop="applyReason" min-width="150" />
|
||||
<el-table-column :label="$t('账单名称')" align="center" prop="emisSettleInvoiceRecord.settleBillName"
|
||||
min-width="150" />
|
||||
<el-table-column :label="$t('账单编号')" align="center" prop="emisSettleInvoiceRecord.settleBillNo"
|
||||
min-width="150" />
|
||||
<el-table-column :label="$t('账单月份')" align="center" prop="billMonth" min-width="150" />
|
||||
<el-table-column :label="$t('月结客户')" align="center" prop="customerName" min-width="150" />
|
||||
<el-table-column :label="$t('申请金额')" align="center" prop="emisSettleInvoiceRecord.applyMoney"
|
||||
min-width="150" />
|
||||
<el-table-column :label="$t('加开税点')" align="center" prop="emisSettleInvoiceRecord.addTaxRate"
|
||||
min-width="150" />
|
||||
<el-table-column :label="$t('加开金额')" align="center" prop="emisSettleInvoiceRecord.addOpenMoney"
|
||||
min-width="150" />
|
||||
<el-table-column :label="$t('已收金额')" align="center" prop="emisSettleInvoiceRecord.recedMoney"
|
||||
min-width="150" />
|
||||
<el-table-column :label="$t('发票申请序号')" align="center" prop="emisSettleInvoiceRecord.applySeqNo" min-width="150" />
|
||||
<el-table-column :label="$t('开票抬头')" align="center" prop="emisSettleInvoiceRecord.companyName"
|
||||
min-width="150" />
|
||||
<el-table-column :label="$t('开票税号')" align="center" prop="emisSettleInvoiceRecord.companyTaxNo"
|
||||
min-width="150" />
|
||||
<el-table-column :label="$t('申请序号')" align="center" prop="applySeqNo" min-width="150" />
|
||||
<el-table-column :label="$t('申请人')" align="center" prop="applyManName" min-width="150" />
|
||||
<el-table-column :label="$t('申请网点')" align="center" prop="applySiteName" min-width="150" />
|
||||
<el-table-column :label="$t('申请时间')" align="center" prop="applyDate" min-width="150" />
|
||||
<el-table-column :label="$t('审核人')" align="center" prop="auditManName" min-width="150" />
|
||||
<el-table-column :label="$t('审核时间')" align="center" prop="auditDate" min-width="150" />
|
||||
<el-table-column :label="$t('审核状态')" align="center" prop="auditStatus" min-width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.auditStatus === '0'">未审核</el-tag>
|
||||
<el-tag type="success" v-if="scope.row.auditStatus === '1'">已审核</el-tag>
|
||||
<el-tag type="danger" v-if="scope.row.auditStatus === '2'">已驳回</el-tag>
|
||||
<el-tag type="danger" v-if="scope.row.auditStatus === '3'">已撤销</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column :label="$t('登记网点')" align="center" prop="siteName" min-width="150" /> -->
|
||||
<el-table-column :label="$t('驳回原因')" align="center" prop="auditRejectReason" min-width="150" />
|
||||
<!-- <el-table-column :label="$t('修改人')" align="center" prop="updateByName" min-width="150" /> -->
|
||||
<!-- <el-table-column :label="$t('修改时间')" align="center" prop="updateTime" min-width="150" /> -->
|
||||
</XdTable>
|
||||
<!-- 作废申请 弹窗 -->
|
||||
<el-dialog :title="titleForm" :visible.sync="openForm" width="70%" :destroy-on-close="true" v-dialogDrag
|
||||
append-to-body>
|
||||
<InvoiceCancellationForm ref="invoiceCancellationForm" @on-cancel="handleCancel" :openType="openType"
|
||||
:id="currentId"></InvoiceCancellationForm>
|
||||
</el-dialog>
|
||||
</XdPageContainer>
|
||||
</template>
|
||||
<script>
|
||||
import elDateAdvPicker from '@/components/DatePickerAdv/elDateAdvPicker';
|
||||
import InvoiceCancellationForm from '@/views/emis/emisWaybillAjustApply/InvoiceCancellationForm.vue';
|
||||
import AllMonthpayAccountPicker from '@/views/emis/EmisBaseTools/AllMonthpayAccountPicker.vue';
|
||||
import EmisSiteSimplePicker from '@/views/emis/EmisBaseTools/EmisSiteSimplePicker2.vue';
|
||||
import { listEmisInvoiceCancellation, passEmisInvoiceCancellation, rejectEmisInvoiceCancellation } from '@/api/emis/emisInvoiceCancellation';
|
||||
export default {
|
||||
name: 'InvoiceReversalList',
|
||||
components: {
|
||||
elDateAdvPicker,
|
||||
AllMonthpayAccountPicker,
|
||||
InvoiceCancellationForm,
|
||||
EmisSiteSimplePicker
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
invoiceCancellationList: [],
|
||||
showSearch: true,
|
||||
openForm: false,
|
||||
openType: null,
|
||||
titleForm: null,
|
||||
dateTimeRange: [],
|
||||
currentId: null,
|
||||
selectedRows:[],
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
auditStatus: null,
|
||||
params: {
|
||||
applySeqNo: null,
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
allAwait() { //是否全是未审核
|
||||
return this.selectedRows.every(row => row.auditStatus === '0');
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.loading = true;
|
||||
let params = this.initQueryParams();
|
||||
listEmisInvoiceCancellation(params).then(response => {
|
||||
if (response.code == 200) {
|
||||
this.invoiceCancellationList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
handleView(row) {
|
||||
this.currentId = row.id || this.currentId;
|
||||
console.log('handleView', this.currentId);
|
||||
this.titleForm = "发票作废详情";
|
||||
this.openForm = true;
|
||||
this.openType = "view";
|
||||
},
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
this.currentId = selection.length ? selection[0].id : null;
|
||||
this.selectedRows = selection;
|
||||
},
|
||||
handlePass() {
|
||||
this.$confirm(this.$t('确定通过选中的申请吗?'), this.$t('提示'), {
|
||||
confirmButtonText: this.$t('确定'),
|
||||
cancelButtonText: this.$t('取消'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
passEmisInvoiceCancellation(this.ids).then(response => {
|
||||
if (response.code == 200) {
|
||||
this.$modal.msgSuccess("操作成功");
|
||||
this.getList();
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
handleReject() {
|
||||
// this.$confirm(this.$t('确定拒绝选中的申请吗?'), this.$t('提示'), {
|
||||
// confirmButtonText: this.$t('确定'),
|
||||
// cancelButtonText: this.$t('取消'),
|
||||
// type: 'warning'
|
||||
// }).then(() => {
|
||||
// rejectEmisInvoiceCancellation(this.ids);
|
||||
// }).then(() => {
|
||||
// this.getList();
|
||||
// this.$modal.msgSuccess(this.$t('操作成功'));
|
||||
// });
|
||||
|
||||
this.$prompt('请输入中心驳回原因', "操作确认", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
closeOnClickModal: false,
|
||||
inputPattern: /^.{5,30}$/,
|
||||
inputErrorMessage: "驳回原因长度必须介于 5 和 30 之间"
|
||||
}).then(({ value }) => {
|
||||
rejectEmisInvoiceCancellation({ ids: this.ids, auditRejectReason: value }).then(response => {
|
||||
if (response.code == 200) {
|
||||
this.$modal.msgSuccess("操作成功");
|
||||
this.getList();
|
||||
}
|
||||
});
|
||||
}).catch(() => { });
|
||||
},
|
||||
handleDelete() { },
|
||||
handleExport() {
|
||||
const loadingInstance = this.$loading({
|
||||
text: '正在导出...'
|
||||
})
|
||||
let params = this.initQueryParams();
|
||||
params.pageNum = 1;
|
||||
params.pageSize = 20000;
|
||||
listEmisInvoiceCancellation(params).then(response => {
|
||||
if (response.code == 200) {
|
||||
this.exportData(response.rows, loadingInstance);
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
handleCancel() {
|
||||
this.openForm = false;
|
||||
},
|
||||
initQueryParams() {
|
||||
let params = { ...this.queryParams };
|
||||
params = this.addDateRange(params, this.dateTimeRange, 'applyDate');
|
||||
return params;
|
||||
},
|
||||
exportData(selData, loadingInstance) {
|
||||
const curList = selData
|
||||
import('@/vendor/Export2Excel').then(excel => {
|
||||
const exportParam = this.$refs.refTable.getExportParam();
|
||||
const tHeader = exportParam.header;
|
||||
const filterVal = exportParam.filter;
|
||||
const data = this.formatJson(filterVal, curList, selData)
|
||||
excel.export_json_to_excel({
|
||||
header: tHeader,
|
||||
data,
|
||||
filename: '发票作废列表',
|
||||
autoWidth: true
|
||||
})
|
||||
loadingInstance.close()
|
||||
})
|
||||
},
|
||||
formatJson(filterVal, jsonData, resData) {
|
||||
let index = 0
|
||||
return jsonData.map(v => filterVal.map(j => {
|
||||
if (j === 'index') {
|
||||
return ++index
|
||||
}
|
||||
if (j === 'auditStatus') {
|
||||
if (v[j] === '0') {
|
||||
return '待审核'
|
||||
} else if (v[j] === '1') {
|
||||
return '审核通过'
|
||||
} else if (v[j] === '2') {
|
||||
return '已驳回'
|
||||
} else if (v[j] === '3') {
|
||||
return '已撤销'
|
||||
}
|
||||
}
|
||||
if (j === 'emisSettleInvoiceRecord.settleBillName') {
|
||||
return v['emisSettleInvoiceRecord']['settleBillName'];
|
||||
}
|
||||
if (j === 'emisSettleInvoiceRecord.settleBillNo') {
|
||||
return v['emisSettleInvoiceRecord']['settleBillNo'];
|
||||
}
|
||||
if (j === 'emisSettleInvoiceRecord.applyMoney') {
|
||||
return v['emisSettleInvoiceRecord']['applyMoney'];
|
||||
}
|
||||
if (j === 'emisSettleInvoiceRecord.addTaxRate') {
|
||||
return v['emisSettleInvoiceRecord']['addTaxRate'];
|
||||
}
|
||||
if (j === 'emisSettleInvoiceRecord.addTaxMoney') {
|
||||
return v['emisSettleInvoiceRecord']['addTaxMoney'];
|
||||
}
|
||||
if (j === 'emisSettleInvoiceRecord.addOpenMoney') {
|
||||
return v['emisSettleInvoiceRecord']['addOpenMoney'];
|
||||
}
|
||||
if (j === 'emisSettleInvoiceRecord.recedMoney') {
|
||||
return v['emisSettleInvoiceRecord']['recedMoney'];
|
||||
}
|
||||
if (j === 'emisSettleInvoiceRecord.companyName') {
|
||||
return v['emisSettleInvoiceRecord']['companyName'];
|
||||
}
|
||||
if (j === 'emisSettleInvoiceRecord.companyTaxNo') {
|
||||
return v['emisSettleInvoiceRecord']['companyTaxNo'];
|
||||
}
|
||||
if (j === 'emisSettleInvoiceRecord.applySeqNo') {
|
||||
return v['emisSettleInvoiceRecord']['applySeqNo'];
|
||||
}
|
||||
return v[j]
|
||||
}))
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
@ -20,11 +20,11 @@
|
||||
<el-form-item label="节点负责人" prop="manager" label-width="100px">
|
||||
<EmpNamePicker :placeholder="$t('节点负责人')" v-model="queryParams.manager" ></EmpNamePicker>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="生效时间" prop="startDate">
|
||||
<el-form-item label="生效时间" prop="startDate">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.startDate"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
value-format="yyyy-MM-dd"
|
||||
:placeholder="$t('生效时间')">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
@ -35,7 +35,7 @@
|
||||
value-format="yyyy-MM-dd"
|
||||
:placeholder="$t('失效时间')">
|
||||
</el-date-picker>
|
||||
</el-form-item> -->
|
||||
</el-form-item>
|
||||
|
||||
</SearchForm>
|
||||
|
||||
|
||||
224
src/views/emis/emisWaybillAjustApply/InvoiceCancellationForm.vue
Normal file
224
src/views/emis/emisWaybillAjustApply/InvoiceCancellationForm.vue
Normal file
@ -0,0 +1,224 @@
|
||||
<template>
|
||||
<XdPageContainer class="app-container">
|
||||
<!-- 查询输入框 -->
|
||||
<el-form :model="form" ref="form" :rules="rules" style="width: 100%;" label-position="left"
|
||||
@submit.native.prevent :disabled="isFormDisabled" class="custom-form">
|
||||
<el-form-item label="发票申请序号" prop="applySeqNo">
|
||||
<el-input placeholder="请输入发票申请序号" v-if="!isFormDisabled" v-model="form.applySeqNo"
|
||||
@keyup.enter.native="handleScanInput" @blur="handleScanInput" clearable style="width: 390px;">
|
||||
<i slot="suffix" class="iconfont"></i>
|
||||
</el-input>
|
||||
<span v-else>{{ form.applySeqNo }}</span>
|
||||
</el-form-item>
|
||||
<!-- </el-form> -->
|
||||
<!-- 数据表格 -->
|
||||
<el-table :data="invoiceList" style="width: 100%" border>
|
||||
<el-table-column :label="$t('账单名称')" align="center" prop="settleBillName" min-width="150" />
|
||||
<el-table-column :label="$t('账单号')" align="center" prop="settleBillNo" min-width="150" />
|
||||
<el-table-column :label="$t('金额')" align="center" prop="applyMoney" min-width="150" />
|
||||
<el-table-column :label="$t('状态')" align="center" prop="invoiceStatus" min-width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.invoiceStatus == '0'" type="info">未开票</el-tag>
|
||||
<el-tag v-if="scope.row.invoiceStatus == '1'" type="warning">开票中</el-tag>
|
||||
<el-tag v-if="scope.row.invoiceStatus == '2'" type="success">已开票</el-tag>
|
||||
<el-tag v-if="scope.row.invoiceStatus == '3'" type="error">开票异常</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('申请时间')" align="center" prop="applyDate" min-width="150" />
|
||||
</el-table>
|
||||
<!-- 输入框 -->
|
||||
<el-form-item label="申请原因" prop="applyReason" class="label-top-item">
|
||||
<el-input type="textarea" rows="3" v-model="form.applyReason" placeholder="请输入申请原因" clearable
|
||||
style="width: 500px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="附件上传" prop="applyTextUrl">
|
||||
<el-upload class="upload-demo" style="width: 500px;" drag v-if="!isFormDisabled"
|
||||
action="https://jsonplaceholder.typicode.com/posts/" multiple :on-preview="handlePreview"
|
||||
:before-upload="beforeUpload" :file-list="fileList" :limit="1" :action="uploadImgUrl"
|
||||
:on-success="handleUploadSuccess" :on-error="handleUploadError" :headers="headers" :on-remove="handleRemove">
|
||||
<i class="el-icon-upload"></i>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em> <br>支持 png/pdf/jpg,单文件≤5M</div>
|
||||
</el-upload>
|
||||
<div v-else>
|
||||
<el-link v-for="item in fileList" :key="item.url" :href="item.url" target="_blank">{{ item.name }}</el-link>
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
||||
<div style="text-align: right;margin-bottom: 10px;" v-show="!isFormDisabled">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-form>
|
||||
</XdPageContainer>
|
||||
</template>
|
||||
<script>
|
||||
import { getInvoiceInfoByApplySeqNo, getEmisInvoiceCancellation, addEmisInvoiceCancellation } from '@/api/emis/emisInvoiceCancellation';
|
||||
import { getToken } from "@/utils/auth";
|
||||
|
||||
export default {
|
||||
name: 'InvoiceCancellationForm',
|
||||
props: {
|
||||
id: {
|
||||
type: Number,
|
||||
default: null
|
||||
},
|
||||
openType: {
|
||||
type: String,
|
||||
default: null
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isFormDisabled: null,
|
||||
form: {},
|
||||
invoiceList: [],
|
||||
fileList: [],
|
||||
queryParams: {
|
||||
},
|
||||
uploadImgUrl: process.env.VUE_APP_BASE_API + "/common/ossUpload", // 上传的图片服务器地址
|
||||
headers: {
|
||||
"X-Token": getToken()
|
||||
},
|
||||
rules: {
|
||||
applySeqNo: [
|
||||
{ required: true, message: '请输入发票申请序号', trigger: 'blur' }
|
||||
],
|
||||
applyReason: [
|
||||
{ required: true, message: '请输入申请原因', trigger: 'blur' }
|
||||
],
|
||||
applyTextUrl: [
|
||||
{ required: true, message: '请上传文件', trigger: 'blur' }
|
||||
],
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
"id": {
|
||||
handler(newValue, oldValue) {
|
||||
this.id = newValue;
|
||||
this.initData();
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initData();
|
||||
},
|
||||
methods: {
|
||||
async initData() {
|
||||
this.isFormDisabled = (this.openType === "view"); // 查看详情时,表单禁用
|
||||
if (this.id) {
|
||||
let res = await getEmisInvoiceCancellation(this.id);
|
||||
let data= res.data || {};
|
||||
this.form ={
|
||||
// id:data.id,
|
||||
invoiceId:data.invoiceId,
|
||||
applyReason: data.applyReason,
|
||||
applyTextUrl: data.applyTextUrl,
|
||||
applySeqNo: data.emisSettleInvoiceRecord?.applySeqNo || ''
|
||||
}
|
||||
this.fileList = this.form.applyTextUrl ? [{
|
||||
name: this.form.applyTextUrl.split('/').pop(),
|
||||
url: this.form.applyTextUrl
|
||||
}] : [];
|
||||
this.invoiceList = [data.emisSettleInvoiceRecord ]|| [];
|
||||
} else {
|
||||
this.reset();
|
||||
}
|
||||
},
|
||||
handleScanInput() {
|
||||
if (!this.form.applySeqNo) {
|
||||
this.$message.error('请输入发票申请序号');
|
||||
return;
|
||||
}
|
||||
getInvoiceInfoByApplySeqNo(this.form.applySeqNo).then(res => {
|
||||
this.invoiceList = [res.data] || [];
|
||||
if (this.invoiceList.length > 0) {
|
||||
this.form.invoiceId = this.invoiceList[0].id;
|
||||
}
|
||||
});
|
||||
},
|
||||
async submitForm() {
|
||||
// const validSearch = await this.$refs.searchForm.validate();
|
||||
this.$refs.form.validate(validate => {
|
||||
if (validate) {
|
||||
const formData = {...this.form};
|
||||
formData.applySeqNo = null;
|
||||
addEmisInvoiceCancellation(formData).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.$modal.msgSuccess("提交成功");
|
||||
this.$emit("on-submit-success");
|
||||
} else {
|
||||
this.$modal.msgError(res.msg || "提交失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
cancel() {
|
||||
this.reset();
|
||||
this.$emit("on-cancel");
|
||||
},
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
invoiceId: null,
|
||||
applyReason: null,
|
||||
applyTextUrl: null,
|
||||
applySeqNo: null,
|
||||
};
|
||||
this.invoiceList = [];
|
||||
this.fileList = [];
|
||||
},
|
||||
handlePreview(file) {
|
||||
this.previewFile = file;
|
||||
//新窗口打开预览
|
||||
window.open(file.url, '_blank');
|
||||
},
|
||||
beforeUpload(file) {
|
||||
const isPDF = file.type === 'application/pdf';
|
||||
const isJPG = file.type === 'image/jpeg';
|
||||
const isPNG = file.type === 'image/png';
|
||||
const isLt5M = file.size / 1024 / 1024 < 5;
|
||||
if (!isPDF && !isJPG && !isPNG) {
|
||||
this.$message.error('上传文件格式必须为PDF、JPG或PNG!');
|
||||
return false;
|
||||
}
|
||||
if (!isLt5M) {
|
||||
this.$message.error('上传文件大小不能超过5MB!');
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
handleUploadSuccess(res, file) {
|
||||
if (res.code === 200) {
|
||||
this.$message.success('上传成功');
|
||||
file.url = res.url;
|
||||
this.fileList.push(file);
|
||||
this.form.applyTextUrl = res.url;
|
||||
} else {
|
||||
this.$message.error(res.msg || '上传失败');
|
||||
}
|
||||
},
|
||||
handleUploadError(res, file) {
|
||||
this.$message.error(res.msg || '上传失败');
|
||||
},
|
||||
handleRemove(file, fileList){
|
||||
this.fileList = fileList;
|
||||
this.form.applyTextUrl = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
:deep.upload-demo .el-upload-dragger {
|
||||
width: 500px;
|
||||
}
|
||||
|
||||
:deep.label-top-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
</style>
|
||||
344
src/views/emis/emisWaybillAjustApply/InvoiceCancellationList.vue
Normal file
344
src/views/emis/emisWaybillAjustApply/InvoiceCancellationList.vue
Normal file
@ -0,0 +1,344 @@
|
||||
<template>
|
||||
<XdPageContainer class="app-container">
|
||||
<SearchForm slot="pageHeader" :model="queryParams" ref="queryForm" size="mini" :maxShow="10" label-width="100px"
|
||||
v-show="showSearch" @search="handleQuery" @reset="resetQuery">
|
||||
<el-row :gutter="0">
|
||||
<el-col :span="8">
|
||||
<el-row :gutter="0" style="display: flex;flex-wrap: wrap;">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="发票申请序号" prop="applySeqNo">
|
||||
<XdTextareaInput v-model="queryParams.params.applySeqNo" :placeholder="$t('多个流水号逗号或换行隔开')"
|
||||
clearable :rows="4" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="登记时间" prop="dateTimeRange">
|
||||
<elDateAdvPicker v-model="dateTimeRange"></elDateAdvPicker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="16">
|
||||
<el-form-item label="审核状态" prop="auditStatus">
|
||||
<el-select clearable v-model="queryParams.auditStatus" placeholder="请选择">
|
||||
<el-option label="待审核" :value="0"></el-option>
|
||||
<el-option label="已审核" :value="1"></el-option>
|
||||
<el-option label="已驳回" :value="2"></el-option>
|
||||
<el-option label="已撤销" :value="3"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="销售联系人" prop="salesmen">
|
||||
<EmpNamePicker1 v-model="queryParams.params.salesmen" :placeholder="$t('请选择销售联系人')" multiple clearable>
|
||||
</EmpNamePicker1>
|
||||
</el-form-item>
|
||||
<el-form-item label="回款联系人" prop="payee">
|
||||
<EmpNamePicker2 v-model="queryParams.params.payee" :placeholder="$t('请选择回款联系人')" multiple clearable>
|
||||
</EmpNamePicker2>
|
||||
</el-form-item>
|
||||
<el-form-item label="月结客户" prop="custNo">
|
||||
<AllMonthpayAccountPicker v-model="queryParams.params.custNo" :placeholder="$t('请选择月结客户')"
|
||||
multiple clearable></AllMonthpayAccountPicker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</SearchForm>
|
||||
<XdTable ref="refTable" slot="pageContent" slot-scope="slotProps" :height="(slotProps.contentHeight) + 'px'" border stripe
|
||||
size="mini" storageName="invoiceCancellationList_main" :data="invoiceCancellationList"
|
||||
:showSearch.sync="showSearch" :queryParams="queryParams" :total="total" @queryTable="getList"
|
||||
@selection-change="handleSelectionChange" @row-dblclick="handleView">
|
||||
|
||||
<div slot="toolbar">
|
||||
<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="['emis:emisInvoiceCancellation:add']">新增申请</el-button>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" :disabled="single || (currentStatus ==0 || currentStatus ==1)"
|
||||
@click="handleReApply" v-hasPermi="['emis:emisInvoiceCancellation:add']">再次申请</el-button>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain :disabled="multiple || !allAwait" size="mini"
|
||||
@click="handleCancel" v-hasPermi="['emis:emisInvoiceCancellation:cancel']">撤销 </el-button>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple || !rejectAndCancel"
|
||||
@click="handleDelete" v-hasPermi="['emis:emisInvoiceCancellation:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini"
|
||||
@click="handleExport" v-hasPermi="['emis:emisInvoiceCancellation:export']">导出</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column :label="$t('申请原因')" align="center" prop="applyReason" min-width="150" />
|
||||
<el-table-column :label="$t('账单名称')" align="center" prop="emisSettleInvoiceRecord.settleBillName" min-width="150" />
|
||||
<el-table-column :label="$t('账单编号')" align="center" prop="emisSettleInvoiceRecord.settleBillNo" min-width="150" />
|
||||
<el-table-column :label="$t('账单月份')" align="center" prop="billMonth" min-width="150" />
|
||||
<el-table-column :label="$t('月结客户')" align="center" prop="customerName" min-width="150" />
|
||||
<el-table-column :label="$t('申请金额')" align="center" prop="emisSettleInvoiceRecord.applyMoney" min-width="150" />
|
||||
<el-table-column :label="$t('加开税点')" align="center" prop="emisSettleInvoiceRecord.addTaxRate" min-width="150" />
|
||||
<el-table-column :label="$t('加开金额')" align="center" prop="emisSettleInvoiceRecord.addOpenMoney" min-width="150" />
|
||||
<el-table-column :label="$t('已收金额')" align="center" prop="emisSettleInvoiceRecord.recedMoney" min-width="150" />
|
||||
<el-table-column :label="$t('发票申请序号')" align="center" prop="emisSettleInvoiceRecord.applySeqNo" min-width="150" />
|
||||
<el-table-column :label="$t('开票抬头')" align="center" prop="emisSettleInvoiceRecord.companyName" min-width="150" />
|
||||
<el-table-column :label="$t('开票税号')" align="center" prop="emisSettleInvoiceRecord.companyTaxNo" min-width="150" />
|
||||
<el-table-column :label="$t('申请序号')" align="center" prop="applySeqNo" min-width="150" />
|
||||
<el-table-column :label="$t('申请人')" align="center" prop="applyManName" min-width="150" />
|
||||
<el-table-column :label="$t('申请网点')" align="center" prop="applySiteName" min-width="150" />
|
||||
<el-table-column :label="$t('申请时间')" align="center" prop="applyDate" min-width="150" />
|
||||
<el-table-column :label="$t('审核人')" align="center" prop="auditManName" min-width="150" />
|
||||
<el-table-column :label="$t('审核时间')" align="center" prop="auditDate" min-width="150" />
|
||||
<el-table-column :label="$t('审核状态')" align="center" prop="auditStatus" min-width="150" >
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.auditStatus === '0'">未审核</el-tag>
|
||||
<el-tag type="success" v-if="scope.row.auditStatus === '1'">已审核</el-tag>
|
||||
<el-tag type="danger" v-if="scope.row.auditStatus === '2'">已驳回</el-tag>
|
||||
<el-tag type="danger" v-if="scope.row.auditStatus === '3'">已撤销</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('驳回原因')" align="center" prop="auditRejectReason" min-width="150" />
|
||||
<!-- <el-table-column :label="$t('修改人')" align="center" prop="updateByName" min-width="150" />
|
||||
<el-table-column :label="$t('修改时间')" align="center" prop="updateTime" min-width="150" /> -->
|
||||
</XdTable>
|
||||
<!-- 作废申请 弹窗 -->
|
||||
<el-dialog :title="titleForm" :visible.sync="openForm" width="70%" :destroy-on-close="true" v-dialogDrag append-to-body>
|
||||
<InvoiceCancellationForm ref="invoiceCancellationForm" @on-cancel="onCancel" :openType="openType" :id="currentId" @on-submit-success="handleSubmitSuccess"></InvoiceCancellationForm>
|
||||
</el-dialog>
|
||||
</XdPageContainer>
|
||||
</template>
|
||||
<script>
|
||||
import elDateAdvPicker from '@/components/DatePickerAdv/elDateAdvPicker';
|
||||
import InvoiceCancellationForm from '@/views/emis/emisWaybillAjustApply/InvoiceCancellationForm.vue';
|
||||
import EmpNamePicker1 from '@/views/emis/EmisBaseTools/EmpNamePicker.vue';
|
||||
import EmpNamePicker2 from '@/views/emis/EmisBaseTools/EmpNamePicker.vue';
|
||||
import AllMonthpayAccountPicker from '@/views/emis/EmisBaseTools/AllMonthpayAccountPicker.vue';
|
||||
import { listEmisInvoiceCancellation,cancelEmisInvoiceCancellation , delEmisInvoiceCancellation } from '@/api/emis/emisInvoiceCancellation';
|
||||
|
||||
export default {
|
||||
name: 'InvoiceCancellationList',
|
||||
components: {
|
||||
elDateAdvPicker,
|
||||
EmpNamePicker1,
|
||||
EmpNamePicker2,
|
||||
AllMonthpayAccountPicker,
|
||||
InvoiceCancellationForm
|
||||
},
|
||||
dicts:['sys_audit_status'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
invoiceCancellationList: [],
|
||||
showSearch: true,
|
||||
openForm: false,
|
||||
openType:null,
|
||||
titleForm:null,
|
||||
dateTimeRange: [],
|
||||
currentId:null,
|
||||
currentStatus:null,
|
||||
selectedRows:[],
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
auditStatus:null,
|
||||
params:{
|
||||
applySeqNo:null,
|
||||
invoiceNo:null,
|
||||
billCode:null,
|
||||
settleBillNo:null,
|
||||
beginApplyDate:null,
|
||||
endApplyDate:null,
|
||||
salesmen:null,
|
||||
payee:null,
|
||||
custNo:null,
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
computed: {
|
||||
allAwait() { //是否全是未审核
|
||||
return this.selectedRows.every(row => row.auditStatus === '0');
|
||||
},
|
||||
rejectAndCancel() { //是否全是已驳回或已撤销
|
||||
return this.selectedRows.every(row => row.auditStatus === '2' || row.auditStatus === '3');
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.loading = true;
|
||||
let params = this.initQueryParams();
|
||||
listEmisInvoiceCancellation(params).then(response => {
|
||||
this.invoiceCancellationList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
})
|
||||
},
|
||||
handleView(row) {
|
||||
this.currentId=row.id;
|
||||
this.titleForm="发票作废详情";
|
||||
this.openForm = true;
|
||||
this.openType="view";
|
||||
},
|
||||
handleCancel(row) {
|
||||
console.log('row--撤销')
|
||||
//确认撤销吗
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认撤销').then(function () {
|
||||
return cancelEmisInvoiceCancellation(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("撤销成功");
|
||||
}).catch(() => { });
|
||||
},
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
this.currentId = selection.length ? selection[0].id : null;
|
||||
this.currentStatus = selection.length ? selection[0].auditStatus : null;
|
||||
this.selectedRows = selection;
|
||||
},
|
||||
handleAdd() {
|
||||
this.currentId=null;
|
||||
this.titleForm="发票作废申请";
|
||||
this.openForm = true;
|
||||
this.openType="add";
|
||||
},
|
||||
handleReApply(row) {
|
||||
this.currentId= this.currentId;
|
||||
this.titleForm="发票作废再申请";
|
||||
this.openForm = true;
|
||||
this.openType="reApply";
|
||||
},
|
||||
handleDelete(row) {
|
||||
//确认删除吗
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除').then(function () {
|
||||
return delEmisInvoiceCancellation(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => { });
|
||||
},
|
||||
handleExport() {
|
||||
const loadingInstance = this.$loading({
|
||||
text: '正在导出...'
|
||||
})
|
||||
let params= this.initQueryParams();
|
||||
params.pageNum=1;
|
||||
params.pageSize=20000;
|
||||
listEmisInvoiceCancellation(params).then(response => {
|
||||
if(response.code==200){
|
||||
this.exportData(response.rows, loadingInstance);
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
initQueryParams(){
|
||||
let params={...this.queryParams};
|
||||
params = this.addDateRange(params, this.dateTimeRange,'applyDate');
|
||||
return params;
|
||||
},
|
||||
exportData(selData, loadingInstance) {
|
||||
const curList = selData
|
||||
import('@/vendor/Export2Excel').then(excel => {
|
||||
const exportParam = this.$refs.refTable.getExportParam();
|
||||
const tHeader = exportParam.header;
|
||||
const filterVal = exportParam.filter;
|
||||
const data = this.formatJson(filterVal, curList, selData)
|
||||
excel.export_json_to_excel({
|
||||
header: tHeader,
|
||||
data,
|
||||
filename: '发票作废列表',
|
||||
autoWidth: true
|
||||
})
|
||||
loadingInstance.close()
|
||||
})
|
||||
},
|
||||
formatJson(filterVal, jsonData, resData) {
|
||||
let index = 0
|
||||
return jsonData.map(v => filterVal.map(j => {
|
||||
if (j === 'index') {
|
||||
return ++index
|
||||
}
|
||||
if (j === 'auditStatus') {
|
||||
if (v[j] === '0') {
|
||||
return '待审核'
|
||||
} else if (v[j] === '1') {
|
||||
return '审核通过'
|
||||
} else if (v[j] === '2') {
|
||||
return '已驳回'
|
||||
} else if (v[j] === '3') {
|
||||
return '已撤销'
|
||||
}
|
||||
}
|
||||
if (j === 'emisSettleInvoiceRecord.settleBillName') {
|
||||
return v['emisSettleInvoiceRecord']['settleBillName'];
|
||||
}
|
||||
if (j === 'emisSettleInvoiceRecord.settleBillNo') {
|
||||
return v['emisSettleInvoiceRecord']['settleBillNo'];
|
||||
}
|
||||
if (j === 'emisSettleInvoiceRecord.applyMoney') {
|
||||
return v['emisSettleInvoiceRecord']['applyMoney'];
|
||||
}
|
||||
if (j === 'emisSettleInvoiceRecord.addTaxRate') {
|
||||
return v['emisSettleInvoiceRecord']['addTaxRate'];
|
||||
}
|
||||
if (j === 'emisSettleInvoiceRecord.addTaxMoney') {
|
||||
return v['emisSettleInvoiceRecord']['addTaxMoney'];
|
||||
}
|
||||
if (j === 'emisSettleInvoiceRecord.addOpenMoney') {
|
||||
return v['emisSettleInvoiceRecord']['addOpenMoney'];
|
||||
}
|
||||
if (j === 'emisSettleInvoiceRecord.recedMoney') {
|
||||
return v['emisSettleInvoiceRecord']['recedMoney'];
|
||||
}
|
||||
if (j === 'emisSettleInvoiceRecord.companyName') {
|
||||
return v['emisSettleInvoiceRecord']['companyName'];
|
||||
}
|
||||
if (j === 'emisSettleInvoiceRecord.companyTaxNo') {
|
||||
return v['emisSettleInvoiceRecord']['companyTaxNo'];
|
||||
}
|
||||
if (j === 'emisSettleInvoiceRecord.applySeqNo') {
|
||||
return v['emisSettleInvoiceRecord']['applySeqNo'];
|
||||
}
|
||||
return v[j]
|
||||
}))
|
||||
},
|
||||
onCancel(){
|
||||
this.openForm = false;
|
||||
},
|
||||
handleSubmitSuccess(){
|
||||
this.openForm = false;
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("提交成功");
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
Loading…
Reference in New Issue
Block a user