emis-frontend/src/views/emis/emisSettleInvoiceRecord/panel/CenterInvoiceHasOpenPanel.vue

635 lines
25 KiB
Vue
Raw Normal View History

2024-09-18 10:52:20 +00:00
<template>
<XdPageContainer >
<SearchForm slot="pageHeader" :model="queryParams" ref="queryForm" size="mini" :maxShow="20" label-width="68px" v-show="showSearch" @search="handleQuery" @reset="resetQuery">
<el-form-item label="" prop="queryCode" label-width="80px">
<div slot="label">
<el-radio-group class="query-label" v-model="queryOrderType">
<el-radio :key="1" label="1">运单号</el-radio>
<el-radio :key="2" label="2">账单号</el-radio>
</el-radio-group>
</div>
<XdTextareaInput
v-model="queryParams.queryCode"
:placeholder="$t('多个流水号逗号或换行隔开')"
clearable
:rows="2"
/>
</el-form-item>
<el-form-item label="申请时间" prop="dateTimeRange" label-width="110px">
<elDateAdvPicker placeholder="申请时间" v-model="dateTimeRange" style="z-index:9999;width:300px" ></elDateAdvPicker>
</el-form-item>
<el-form-item label="账单名称" prop="settleBillName">
<el-input
v-model="queryParams.settleBillName"
:placeholder="$t('账单名称')"
clearable
/>
</el-form-item>
<el-form-item label="开票状态" prop="invoiceStatus">
<el-select clearable v-model="queryParams.invoiceStatus" placeholder="请选择" style="width:100%">
<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="blAudit">
<el-select v-model="queryParams.blAudit" placeholder="" clearable filterable style="width:100%">
<el-option label="未审核" :value="0"></el-option>
<el-option label="审核通过" :value="1"></el-option>
<el-option label="审核不通过" :value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item label="发票类型" prop="invoiceType">
<el-select clearable v-model="queryParams.invoiceType" placeholder="请选择" style="width:100%">
<el-option label="增值税电子普通发票" :value="1"></el-option>
2024-10-10 10:52:01 +00:00
<el-option label="增值税电子专用发票" :value="4"></el-option>
2024-09-18 10:52:20 +00:00
<el-option label="增值税普通发票(纸质发票)" :value="2"></el-option>
<el-option label="增值税专用发票(纸质发票)" :value="3"></el-option>
<el-option label="其它手工开票" :value="9"></el-option>
</el-select>
</el-form-item>
<el-form-item label="开票抬头" prop="companyName">
<el-input
v-model="queryParams.companyName"
:placeholder="$t('开票抬头')"
clearable
/>
</el-form-item>
<el-form-item label="开票税号" prop="companyTaxNo">
<el-input
v-model="queryParams.companyTaxNo"
:placeholder="$t('开票税号')"
clearable
/>
</el-form-item>
<el-form-item label="开票金额" prop="applyMoney">
<el-input
v-model="queryParams.applyMoney"
:placeholder="$t('开票金额')"
clearable
/>
</el-form-item>
</SearchForm>
<XdTable
slot="pageContent"
slot-scope="slotProps"
:height="(slotProps.contentHeight)+'px'"
v-loading="loading"
border
size="mini"
storageName="emisSettleInvoiceRecordList_deal_main"
:data="emisSettleInvoiceRecordList"
:showSearch.sync="showSearch"
:queryParams="queryParams"
:total="total"
@queryTable="getList"
@selection-change="handleSelectionChange"
@sort-change="handleSortChange"
@row-dblclick="handleSendDbClick"
>
<div slot="toolbar">
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
size="mini"
:disabled="single"
@click="handleOpenBill"
v-hasPermi="['emis:emisSettleInvoiceRecord:edit']"
>开票处理</el-button>
</el-col>
<!-- <el-col :span="1.5">
<el-button
type="primary"
plain
size="mini"
:disabled="single"
@click="handleOpenManualBill"
v-hasPermi="['emis:emisSettleInvoiceRecord:edit']"
>手工开票</el-button>
</el-col> -->
<el-col :span="1.5">
<el-button
type="primary"
plain
size="mini"
:disabled="single"
@click="handlePass"
v-hasPermi="['emis:emisSettleInvoiceRecord:pass']"
>审核通过</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="primary"
plain
size="mini"
:disabled="single"
@click="handleRefuse"
v-hasPermi="['emis:emisSettleInvoiceRecord:refuse']"
>开票拒绝</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:emisSettleInvoiceRecord: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="applyDate" min-width="170" />
<el-table-column :label="$t('账单名称')" align="center" prop="settleBillName" min-width="100" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('发票文件')" align="center" prop="filePath" min-width="170" :show-overflow-tooltip="true">
<template slot-scope="scope">
<el-button
v-if="scope.row.invoiceStatus=='2'"
type="primary"
plain
icon="el-icon-document-copy"
size="mini"
@click="handleDownPDF(scope.row,$event)"
>复制发票地址</el-button>
</template>
</el-table-column>
<el-table-column :label="$t('开票状态')" align="center" prop="invoiceStatus" width="100" >
<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="blAudit" width="100" >
<template slot-scope="scope">
<el-tag v-if="scope.row.blAudit=='0'" type="info">未审核</el-tag>
<el-tag v-if="scope.row.blAudit=='1'" type="success">审核通过</el-tag>
<el-tag v-if="scope.row.blAudit=='2'" type="error">审核不通过</el-tag>
</template>
</el-table-column>
2025-01-08 09:16:40 +00:00
<el-table-column :label="$t('驳回原因')" align="center" prop="auditNote" min-width="100" :show-overflow-tooltip="true"/>
2024-09-18 10:52:20 +00:00
<!-- <el-table-column :label="$t('状态描述')" align="center" prop="invoiceStatusDesc" min-width="100" :show-overflow-tooltip="true"/> -->
<!-- <el-table-column :label="$t('客户编码')" align="center" prop="customerCode" min-width="100" /> -->
<!-- <el-table-column :label="$t('客户名称')" align="center" prop="customerName" min-width="100" /> -->
<el-table-column :label="$t('账单编号')" align="center" prop="settleBillNo" min-width="170" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('申请金额')" align="center" prop="applyMoney" min-width="100" />
<el-table-column :label="$t('开票类型')" align="center" prop="invoiceType" min-width="100" >
<template slot-scope="scope">
<el-tag v-if="scope.row.invoiceType=='1'" type="info">增值税电子普通发票</el-tag>
2024-10-10 10:52:01 +00:00
<el-tag v-if="scope.row.invoiceType=='4'" type="info">增值税电子专用发票</el-tag>
2024-09-18 10:52:20 +00:00
<el-tag v-if="scope.row.invoiceType=='2'" type="info">增值税普通发票</el-tag>
<el-tag v-if="scope.row.invoiceType=='3'" type="info">增值税专用发票</el-tag>
<el-tag v-if="scope.row.invoiceType=='9'" type="info">其它手工发票</el-tag>
</template>
</el-table-column>
<el-table-column :label="$t('开票抬头')" align="center" prop="companyName" min-width="170" :show-overflow-tooltip="true" />
<el-table-column :label="$t('开票税号')" align="center" prop="companyTaxNo" min-width="170" :show-overflow-tooltip="true"/>
<!-- <el-table-column :label="$t('开票电话')" align="center" prop="companyTel" min-width="100" :show-overflow-tooltip="true"/> -->
<!-- <el-table-column :label="$t('开票地址')" align="center" prop="companyAddress" min-width="100" :show-overflow-tooltip="true"/> -->
<!-- <el-table-column :label="$t('联系人')" align="center" prop="contact" min-width="100" :show-overflow-tooltip="true"/> -->
<!-- <el-table-column :label="$t('联系电话')" align="center" prop="phone" min-width="100" :show-overflow-tooltip="true"/> -->
<!-- <el-table-column :label="$t('发票号')" align="center" prop="invoiceNo" min-width="170" :show-overflow-tooltip="true" /> -->
<el-table-column :label="$t('申请序号')" align="center" prop="applySeqNo" min-width="170" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('申请人')" align="center" prop="createByName" min-width="100" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('申请站点')" align="center" prop="createSiteName" min-width="100" :show-overflow-tooltip="true"/>
<!-- <el-table-column :label="$t('纸质发票邮寄地址')" align="center" prop="recieveAddress" min-width="100" /> -->
<el-table-column :label="$t('邮箱')" align="center" prop="email" min-width="100" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('备注')" align="center" prop="remark" min-width="100" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('审核日期')" align="center" prop="auditDate" min-width="170" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('审核人')" align="center" prop="auditManName" min-width="100" />
<el-table-column :label="$t('操作人')" align="center" prop="opManName" min-width="100" />
<el-table-column :label="$t('操作时间')" align="center" prop="opDate" min-width="170" />
<el-table-column :label="$t('操作站点')" align="center" prop="opSiteName" min-width="100" />
<!-- <el-table-column :label="$t('开票渠道编号')" align="center" prop="openChId" min-width="100" /> -->
<!-- <el-table-column :label="$t('开票渠道状态')" align="center" prop="openChStatus" min-width="100" /> -->
<!-- <el-table-column :label="$t('开票渠道描述')" align="center" prop="openChStatusDesc" min-width="100" /> -->
<!-- <el-table-column :label="$t('使用的开票企业代码')" align="center" prop="openComCode" min-width="100" /> -->
<el-table-column label="创建人" align="center" prop="createByName" width="80" :show-overflow-tooltip="true"/>
<el-table-column label="创建网点" align="center" prop="createSiteName" width="80" :show-overflow-tooltip="true"/>
<el-table-column label="创建时间" align="center" prop="createTime" width="170"/>
<el-table-column label="修改人" align="center" prop="updateByName" width="80" :show-overflow-tooltip="true"/>
<el-table-column label="修改网点" align="center" prop="updateSiteName" width="80" :show-overflow-tooltip="true"/>
<el-table-column label="修改时间" align="center" prop="updateTime" width="170"/>
</XdTable>
<el-dialog :title="titleForm" :visible.sync="openForm" width="90%" :close-on-click-modal="false" :destroy-on-close="true" v-dialogDrag append-to-body>
<OpenBillForm :id="currentId" :isManual="isManual" @on-changed="handleFormChanged" @on-cancel="cancelForm"></OpenBillForm>
</el-dialog>
</XdPageContainer>
</template>
<script>
import { auditCenterNoPass,auditCenterPass,listEmisSettleInvoiceRecord, getEmisSettleInvoiceRecord, delEmisSettleInvoiceRecord, addEmisSettleInvoiceRecord, updateEmisSettleInvoiceRecord } from "@/api/emis/emisSettleInvoiceRecord";
import OpenBillForm from '@/views/emis/emisSettleInvoiceRecord/OpenBillForm';
import { listEmisSettleInvoiceChRecord } from "@/api/emis/emisSettleInvoiceChRecord";
import elDateAdvPicker from '@/components/DatePickerAdv/elDateAdvPicker';
export default {
name: "CenterInvoiceHasOpenPanel",
components: { elDateAdvPicker,OpenBillForm },
props: {
invoiceStatus:{
type: [String,Number],
required: false
},
},
dicts: [
],
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 创建时间搜索
dateTimeRange:[],
// 总条数
total: 0,
// 开票记录表表格数据
emisSettleInvoiceRecordList: [],
currentId:null,
openForm: false,
titleForm: "",
isManual:false,
queryCode:null,
queryOrderType:null,
// 弹出展示层
id:null,
titleView:"",
openView: false,
dateTimeRange: [],
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 20,
applySeqNo: null,
applyDate: null,
applyManCode: null,
applySiteCode: null,
customerCode: null,
customerName: null,
settleBillNo: null,
settleBillName: null,
applyMoney: null,
invoiceType: null,
companyName: null,
companyTaxNo: null,
companyTel: null,
companyAddress: null,
contact: null,
phone: null,
realTaxType: null,
openMoneyMax: null,
openMoney: null,
invoiceNo: null,
invoiceStatus: null,
invoiceStatusDesc: null,
recieveAddress: null,
email: null,
filePath: null,
remark: null,
blAudit: null,
auditDate: null,
auditManCode: null,
auditSiteCode: null,
opManCode: null,
opDate: null,
opSiteCode: null,
openChId: null,
openChStatus: null,
openChStatusDesc: null,
openComCode: null,
delFlag: null,
params:{
billCode:null
}
},
};
},
watch: {
invoiceStatus(newVal,oldVal) {
this.queryParams.invoiceStatus=this.invoiceStatus;
this.getList();
},
},
created() {
this.queryParams.invoiceStatus=this.invoiceStatus;
this.queryOrderType="1";
this.getList();
},
methods: {
handleSendDbClick(row){
this.$emit("onSelect",row);
},
handleRefuse(row) {
const ids = row.id || this.ids;
this.$prompt('请输入驳回原因', "操作确认", {
confirmButtonText: "确定",
cancelButtonText: "取消",
closeOnClickModal: false,
inputPattern: /^.{5,30}$/,
inputErrorMessage: "驳回原因长度必须介于 5 和 30 之间"
}).then(({ value }) => {
auditCenterNoPass(ids,value).then(response => {
this.$modal.msgSuccess("操作成功" );
this.getList();
});
}).catch(() => {});
},
handlePass(row){
const ids = row.id || this.ids;
this.$modal.confirm('是否审核通过').then(function() {
return auditCenterPass(ids);
}).then(() => {
this.$modal.msgSuccess("操作成功" );
this.getList();
}).catch(() => {});
},
/** 查询开票记录表列表 */
getList() {
this.loading = true;
// 按运单查询时的处理
if(this.queryOrderType=="1"){
this.queryParams.params.billCode=this.queryParams.queryCode;
this.queryParams.settleBillNo=null;
}
else if(this.queryOrderType=="2"){
this.queryParams.params.billCode=null;
this.queryParams.settleBillNo=this.queryParams.queryCode;
}
listEmisSettleInvoiceRecord(this.addDateRange(this.queryParams, this.dateTimeRange,'createTime')).then(response => {
this.emisSettleInvoiceRecordList = response.rows;
this.total = response.total;
this.loading = false;
});
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
// 排序 查询字段是表格中字段名字 动态取值排序顺序
handleSortChange(column) {
this.queryParams.orderByColumn = column.prop;
this.queryParams.isAsc = column.order;
this.getList();
},
handleDownPDF(row) {
let qParam = {
pageNum:1,
pageSize:50,
applySeqNo: row.applySeqNo,
openChStatus:'2'
}
listEmisSettleInvoiceChRecord(qParam).then(response => {
let list = response.rows;
if(list&&list.length>0){
let downUrl="";
list.forEach(item=>{
downUrl=downUrl+item.filePath+",";
});
downUrl=this.removeEndChar(downUrl,',','');
if (navigator.clipboard && window.isSecureContext) {
// navigator clipboard 向剪贴板写文本
this.$modal.msgSuccess('复制成功')
return navigator.clipboard.writeText(downUrl)
} else {
// 创建text area
const textArea = document.createElement('textarea')
textArea.value = downUrl
// 使text area不在viewport,同时设置不可见
document.body.appendChild(textArea)
textArea.focus()
textArea.select()
this.$modal.msgSuccess('复制成功')
return new Promise((res, rej) => {
// 执行复制命令并移除文本框
document.execCommand('copy') ? res() : rej()
textArea.remove()
})
}
}
});
},
removeEndChar(str,char, type) {
if (char) {
if (type == 'left') {
return str.replace(new RegExp('^\\'+char+'+', 'g'), '');
} else if (type == 'right') {
return str.replace(new RegExp('\\'+char+'+$', 'g'), '');
}
return str.replace(new RegExp('^\\'+char+'+|\\'+char+'+$', 'g'), '');
}
return str.replace(/^\s+|\s+$/g, '');
},
handleDownPDFOld(row) {
let settleBillName=row.settleBillName;
let qParam = {
pageNum:1,
pageSize:50,
applySeqNo: row.applySeqNo,
openChStatus:'2'
}
listEmisSettleInvoiceChRecord(qParam).then(response => {
let list = response.rows;
if(list&&list.length>0){
list.forEach(item=>{
// this.downPdfFile(item.filePath);
let pdfUrl=item.filePath;
let fileName=settleBillName+"-"+item.invoiceNo+".pdf";
this.downloadUrlFile(pdfUrl,fileName);
});
}
});
},
// 下载含有url的文件
downloadUrlFile(url, fileName) {
const url2 = url.replace(/\\/g, '/');
const xhr = new XMLHttpRequest();
xhr.open('GET', url2, true);
xhr.responseType = 'blob';
//xhr.setRequestHeader('Authorization', 'Basic a2VybWl0Omtlcm1pdA==');
// 为了避免大文件影响用户体验,建议加loading
xhr.onload = () => {
if (xhr.status === 200) {
// 获取文件blob数据并保存
this.saveAs(xhr.response, fileName);
}
};
xhr.send();
},
saveAs(data, name) {
const urlObject = window.URL || window.webkitURL || window;
const export_blob = new Blob([data]);
//createElementNS() 方法可创建带有指定命名空间的元素节点。
//此方法可返回一个 Element 对象。
const save_link = document.createElementNS('http://www.w3.org/1999/xhtml', 'a');
save_link.href = urlObject.createObjectURL(export_blob);
save_link.download = name;
save_link.click();
},
/** 新增按钮操作 */
handleOpenBill(row) {
this.currentId= row.id || this.ids;
this.openForm = true;
this.titleForm = "开票处理";
},
handleOpenManualBill(row) {
this.currentId= row.id || this.ids;
this.isManual=true;
this.openForm = true;
this.titleForm = "手工开票处理";
},
handleShowMoreInput(){
this.moreInputVisible = !this.moreInputVisible;
},
handleFormChanged(){
this.openForm = false;
this.getList();
},
cancelForm(){
this.openForm = false;
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除').then(function() {
return delEmisSettleInvoiceRecord(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
// this.download('emis/emisSettleInvoiceRecord/export', {
// ...this.queryParams
// }, `emisSettleInvoiceRecord_${new Date().getTime()}.xlsx`)
const loadingInstance = this.$loading({
text: '正在导出...'
})
var qParam = {...this.queryParams};
qParam.pageNum=1;
qParam.pageSize=5000;
listEmisSettleInvoiceRecord(this.addDateRange(qParam, this.dateTimeRange)).then(response => {
this.downloadLoading = false
if (response.code === 200) {
const curList = response.rows
import('@/vendor/Export2Excel').then(excel => {
const tHeader = ['id','申请序号','申请时间','审核人','审核站点','客户编码','客户名称','账单号编号','账单名称','申请开票金额','开票类型','开票名称','开票税号','开票电话','开票地址','联系人','联系电话','税类型','开票上限','开票金额','发票号','开票状态','开票状态描述','纸质发票邮寄地址','发票投递邮箱','发票下载路径','备注','审核状态','审核日期','审核人','审核站点','操作人','操作时间','操作站点','开票渠道编号','开票渠道状态','开票渠道描述','使用的开票企业代码','删除标志(0代表存在','创建者','创建时间','更新者','更新时间','创建站点','更新站点',];
const filterVal = ['id','applySeqNo','applyDate','applyManCode','applySiteCode','customerCode','customerName','settleBillNo','settleBillName','applyMoney','invoiceType','companyName','companyTaxNo','companyTel','companyAddress','contact','phone','realTaxType','openMoneyMax','openMoney','invoiceNo','invoiceStatus','invoiceStatusDesc','recieveAddress','email','filePath','remark','blAudit','auditDate','auditManCode','auditSiteCode','opManCode','opDate','opSiteCode','openChId','openChStatus','openChStatusDesc','openComCode','delFlag','createBy','createTime','updateBy','updateTime','createSite','updateSite',];
const data = this.formatJson(filterVal, curList, response.rows)
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 === 'status') {
var statusStr='xxx'
if(v[j] == 10){
statusStr='xxx'
}
return statusStr;
}
return v[j]
}))
},
/** 列索引函数 */
getIndex($index) {
return (this.queryParams.pageNum - 1) * this.queryParams.pageSize + $index + 1
},
/** 时间搜索响应函数 */
dateTimeChange(value){
this.dateTimeRange=value;
},
}
};
</script>
<style scoped>
.el-divider{
margin-top: 0px;
background: 0 0;
border-top: 1px solid #E6EBF5;
}
.el-divider__text {
color: #0955ee;
cursor: pointer;
}
</style>