emis-frontend/src/views/emis/emisSettleInvoiceChRecord/index.vue
2024-09-18 11:12:47 +08:00

642 lines
25 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<XdPageContainer class="app-container">
<SearchForm slot="pageHeader" :model="queryParams" ref="queryForm" size="small" :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="">
<elDateAdvPicker placeholder="开票时间" v-model="dateTimeRange" style="z-index:9999;width:300px" ></elDateAdvPicker>
</el-form-item>
<el-form-item :label="$t('开票状态')" prop="openChStatus">
<el-select clearable v-model="queryParams.openChStatus" placeholder="开票状态">
<el-option key="0" label="未发送" value="0"></el-option>
<el-option key="1" label="已发送" value="1"></el-option>
<el-option key="2" label="开票成功" value="2"></el-option>
<el-option key="3" label="开票失败" value="3"></el-option>
<el-option key="-1" label="发送异常" value="-1"></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="invoiceNo">
<el-input
v-model="queryParams.invoiceNo"
:placeholder="$t('发票号')"
clearable
/>
</el-form-item>
<el-form-item label="主体名称" prop="salerCompanyName">
<el-input
v-model="queryParams.salerCompanyName"
:placeholder="$t('主体名称')"
clearable
/>
</el-form-item>
<el-form-item label="主体税号" prop="salerCompanyTaxNo">
<el-input
v-model="queryParams.salerCompanyTaxNo"
:placeholder="$t('主体税号')"
clearable
/>
</el-form-item>
<el-form-item :label="$t('收款状态')" prop="paymentStatus">
<el-select clearable v-model="queryParams.paymentStatus" placeholder="收款状态">
<el-option key="0" label="未收款" value="0"></el-option>
<el-option key="1" label="已收款" value="1"></el-option>
<el-option key="2" label="部分收款" value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item label="账单月份" prop="billMonth">
<el-date-picker size="mini" style="width:120px" v-model="queryParams.billMonth" type="month" placeholder="账单月份" value-format="yyyy-MM"></el-date-picker>
</el-form-item>
<el-form-item label="月结客户" prop="custNo">
<EmisMonthpayAccountPicker v-model="queryParams.custNo" ></EmisMonthpayAccountPicker>
</el-form-item>
<el-form-item :label="$t('回款联系人')" prop="payee" label-width="100px">
<PayeePicker :placeholder="$t('回款联系人')" v-model="queryParams.payee" ></PayeePicker>
</el-form-item>
<el-form-item :label="$t('销售联系人')" prop="salesmen" label-width="100px">
<SalemanPicker :placeholder="$t('销售联系人')" v-model="queryParams.salesmen" ></SalemanPicker>
</el-form-item>
</SearchForm>
<XdTable
slot="pageContent"
slot-scope="slotProps"
:height="(slotProps.contentHeight)+'px'"
highlight-current-row
ref="refTable"
:row-key="rowKey"
storageName="emisSettleInvoiceChRecordList_main_240702"
v-loading="loading"
border stripe
size="mini"
:data="emisSettleInvoiceChRecordList"
:showSearch.sync="showSearch"
:queryParams="queryParams"
:total="total"
@queryTable="getList"
@selection-change="handleSelectionChange"
@sort-change="handleSortChange"
>
<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:emisSettleInvoiceChRecord:add']"
>新增</el-button>
</el-col> -->
<!--
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['emis:emisSettleInvoiceChRecord:edit']"
>修改</el-button>
</el-col> -->
<!-- <el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['emis:emisSettleInvoiceChRecord:remove']"
>删除</el-button>
</el-col> -->
<!-- v-hasPermi="['emis:emisSettleBill:edit']" -->
<!-- <el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-money"
size="mini"
:disabled="single"
@click="handlePayRecord"
>收款</el-button>
</el-col> -->
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-money"
size="mini"
:disabled="single"
@click="handleInvalid"
>废弃</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:emisSettleInvoiceChRecord:export']"
>导出</el-button>
</el-col>
</el-row>
</div>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" align="center" width="60">
<template slot-scope="scope">
<span v-text="getIndex(scope.$index)"> </span>
</template>
</el-table-column>
<el-table-column :label="$t('流水号')" align="center" prop="reqNo" width="140" :show-overflow-tooltip="true" />
<!-- <el-table-column :label="$t('发票申请序号')" align="center" prop="applySeqNo" width="100" /> -->
<!-- <el-table-column :label="$t('是否电子发票')" align="center" prop="blEcinv" width="100" /> -->
<!-- <el-table-column :label="$t('申请开票类型')" align="center" prop="invoiceType" width="100" :show-overflow-tooltip="true" /> -->
<el-table-column :label="$t('开票类型')" align="center" prop="realInvoiceType" min-width="80" :show-overflow-tooltip="true" >
<template slot-scope="scope">
<dict-tag :options="dict.type.emis_invoice_ch_type" :value="scope.row.realInvoiceType" :show-overflow-tooltip="true" />
</template>
</el-table-column>
<el-table-column label="开票日期" align="center" prop="createTime" width="170"/>
<el-table-column :label="$t('开票状态')" align="center" prop="openChStatus" width="100" :show-overflow-tooltip="true" >
<template slot-scope="scope">
<el-tag v-if="scope.row.openChStatus==-1" type="error" >发送异常</el-tag>
<el-tag v-if="scope.row.openChStatus==0" type="info" >未发送</el-tag>
<el-tag v-if="scope.row.openChStatus==1" type="info" >已发送</el-tag>
<el-tag v-if="scope.row.openChStatus==2" type="success" >开票成功</el-tag>
<el-tag v-if="scope.row.openChStatus==3" type="error" >开票作废</el-tag>
</template>
</el-table-column>
<!-- <el-table-column :label="$t('账期')" align="center" prop="settleBill.billMonth" width="80" :show-overflow-tooltip="true" /> -->
<el-table-column :label="$t('账期')" align="center" prop="billMonth" width="80" :show-overflow-tooltip="true" />
<el-table-column :label="$t('代垫费用')" align="center" prop="ddfy" width="80" :show-overflow-tooltip="true" />
<el-table-column :label="$t('折让')" align="center" prop="zr" width="80" :show-overflow-tooltip="true" />
<el-table-column :label="$t('赔偿等杂费')" align="center" prop="pc" width="120" :show-overflow-tooltip="true" />
<el-table-column :label="$t('实际运费')" align="center" prop="sjyf" width="80" :show-overflow-tooltip="true" />
<el-table-column :label="$t('备注')" align="center" prop="dcbz" width="80" :show-overflow-tooltip="true" />
<el-table-column :label="$t('付款日期')" align="center" prop="fkrq" width="80" :show-overflow-tooltip="true" />
<el-table-column :label="$t('快递公司')" align="center" prop="kdgs" width="80" :show-overflow-tooltip="true" />
<el-table-column :label="$t('面单单号')" align="center" prop="mddh" width="80" :show-overflow-tooltip="true" />
<el-table-column :label="$t('快递单号')" align="center" prop="mddh" width="80" :show-overflow-tooltip="true" />
<el-table-column :label="$t('业务员')" align="center" prop="salemen" width="80" :show-overflow-tooltip="true" />
<el-table-column :label="$t('开票金额')" align="center" prop="openMoney" width="80" :show-overflow-tooltip="true" />
<el-table-column :label="$t('公司抬头')" align="center" prop="companyName" width="170" :show-overflow-tooltip="true" />
<el-table-column :label="$t('税号')" align="center" prop="companyTaxNo" width="170" :show-overflow-tooltip="true" />
<el-table-column :label="$t('开票电话')" align="center" prop="companyTel" width="100" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('开票地址')" align="center" prop="companyAddress" width="200" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('开户行')" align="center" prop="bankName" width="170" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('开户账号')" align="center" prop="bankAccNo" width="170" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('联系人')" align="center" prop="contact" width="100" />
<el-table-column :label="$t('联系电话')" align="center" prop="phone" width="100" />
<!-- <el-table-column :label="$t('发票投递邮箱')" align="center" prop="email" width="100" /> -->
<el-table-column :label="$t('开票主体')" align="center" prop="salerCompanyName" width="100" :show-overflow-tooltip="true" />
<el-table-column :label="$t('主体税号')" align="center" prop="salerCompanyTaxNo" width="100" :show-overflow-tooltip="true" />
<el-table-column :label="$t('主体电话')" align="center" prop="salerCompanyTel" width="100" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('主体地址')" align="center" prop="salerCompanyAddress" width="100" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('主体银行')" align="center" prop="salerBankName" width="100" :show-overflow-tooltip="true" />
<el-table-column :label="$t('主体账号')" align="center" prop="salerBankAccNo" width="100" :show-overflow-tooltip="true" />
<!-- <el-table-column :label="$t('销方联系人')" align="center" prop="salerContact" width="100" /> -->
<!-- <el-table-column :label="$t('销方联系电话')" align="center" prop="salerPhone" width="100" /> -->
<el-table-column :label="$t('发票号')" align="center" prop="invoiceNo" width="100" :show-overflow-tooltip="true" />
<!-- <el-table-column :label="$t('pdf下载路径')" align="center" prop="filePath" width="150" :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.openChStatus=='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('qr路径')" align="center" prop="qrPath" width="100" /> -->
<el-table-column :label="$t('操作人')" align="center" prop="opManName" width="100" />
<el-table-column :label="$t('操作时间')" align="center" prop="opDate" width="170" :show-overflow-tooltip="true"/>
<el-table-column :label="$t('操作站点')" align="center" prop="opSiteName" width="100" />
<!-- <el-table-column :label="$t('开票渠道编号')" align="center" prop="openChId" width="100" /> -->
<el-table-column :label="$t('状态描述')" align="center" prop="openChStatusDesc" width="100" :show-overflow-tooltip="true" />
<!-- <el-table-column :label="$t('使用的开票企业代码')" align="center" prop="openComCode" width="100" /> -->
<!-- <el-table-column :label="$t('扩展信息,货物名称')" align="center" prop="extData" width="100" :show-overflow-tooltip="true" /> -->
<el-table-column :label="$t('开票备注')" align="center" prop="remark" width="100" :show-overflow-tooltip="true" />
<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="70%" :destroy-on-close="true" v-dialogDrag append-to-body :close-on-click-modal="false">
<PayRecordInputByInvoice :reqId="currentId" @on-changed="handleFormChanged" @on-cancel="cancelForm"></PayRecordInputByInvoice>
</el-dialog>
</XdPageContainer>
</template>
<script>
import { listEmisSettleInvoiceChRecord, getEmisSettleInvoiceChRecord, delEmisSettleInvoiceChRecord, addEmisSettleInvoiceChRecord, updateEmisSettleInvoiceChRecord } from "@/api/emis/emisSettleInvoiceChRecord";
import emisSettleInvoiceChRecordForm from '@/views/emis/emisSettleInvoiceChRecord/emisSettleInvoiceChRecordForm';
import elDateAdvPicker from '@/components/DatePickerAdv/elDateAdvPicker';
import {timeDiffTime,timeFormat} from '@/utils/dateUtils'
import PayeePicker from '@/views/emis/EmisBaseTools/PayeePicker.vue';
import SalemanPicker from '@/views/emis/EmisBaseTools/SalemanPicker.vue';
import EmisMonthpayAccountPicker from '@/views/emis/EmisBaseTools/EmisMonthpayAccountPicker.vue';
import PayRecordInputByInvoice from '@/views/emis/emisSettlePayRecord/panel/PayRecordInputByInvoice.vue';
export default {
name: "EmisSettleInvoiceChRecord",
components: {
elDateAdvPicker,
emisSettleInvoiceChRecordForm,
PayeePicker,SalemanPicker,EmisMonthpayAccountPicker,
PayRecordInputByInvoice
},
dicts: ['emis_invoice_ch_type'
],
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 渠道开票记录表表格数据
emisSettleInvoiceChRecordList: [],
selectionList:[],
currentId:null,
openForm: false,
titleForm: "",
queryOrderType:null,
// 弹出展示层
id:null,
titleView:"",
openView: false,
dateTimeRange: [],
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 20,
reqNo: null,
queryCode:null,
applySeqNo: null,
blEcinv: null,
invoiceType: null,
realInvoiceType: null,
companyName: null,
companyTaxNo: null,
companyTel: null,
companyAddress: null,
bankName: null,
bankAccNo: null,
contact: null,
phone: null,
taxRate: null,
openMoney: null,
email: null,
salerCompanyName: null,
salerCompanyTaxNo: null,
salerCompanyTel: null,
salerCompanyAddress: null,
salerBankName: null,
salerBankAccNo: null,
salerContact: null,
salerPhone: null,
invoiceNo: null,
filePath: null,
qrPath: null,
opManCode: null,
opDate: null,
opSiteCode: null,
openChId: null,
openChStatus: null,
openChStatusDesc: null,
openComCode: null,
extData: null,
remark: null,
params:{
billCode:null,
settleBillNo:null,
}
},
};
},
created() {
this.queryOrderType="1";
const end = new Date()
const start = new Date()
start.setHours(0,0,0,0)
end.setHours(23,59,59,0)
this.dateTimeRange=[timeFormat(start), timeFormat(end)]
this.getList();
},
methods: {
rowKey (row) {
return row.id;
},
initQueryParams(){
this.queryParams=this.addDateRange(this.queryParams, this.dateTimeRange,"createTime");
// 按运单查询时的处理
if(this.queryOrderType=='1'){
this.queryParams.params.billCode=this.queryParams.queryCode;
this.queryParams.params.settleBillNo=null;
}
else if(this.queryOrderType=='2'){
this.queryParams.params.billCode=null;
this.queryParams.params.settleBillNo=this.queryParams.queryCode;
}
return this.queryParams;
},
/** 查询渠道开票记录表列表 */
getList() {
this.loading = true;
let qParam=this.initQueryParams();
listEmisSettleInvoiceChRecord(qParam).then(response => {
this.emisSettleInvoiceChRecordList = 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();
},
handlePayRecord(row){
this.currentId= row.id || this.ids;
this.openForm = true;
this.titleForm = "收款核销";
},
handleInvalid(row){
const ids = row.id || this.ids;
this.$modal.confirm('是否废弃').then(function() {
// return delEmisSettleInvoiceChRecord(ids);
let postForm={
id:ids[0],
openChStatus:'3'
}
return updateEmisSettleInvoiceChRecord(postForm);
}).then(() => {
this.getList();
this.$modal.msgSuccess("操作成功");
}).catch(() => {});
},
handleDownPDF(row) {
let downUrl=row.filePath;
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, '');
},
/** 新增按钮操作 */
handleAdd(row) {
this.currentId=null;
this.openForm= true;
this.titleForm = "新增";
},
handleShowMoreInput(){
this.moreInputVisible = !this.moreInputVisible;
},
/** 修改按钮操作 */
handleUpdate(row) {
this.currentId= row.id;
this.openForm = true;
this.titleForm = "修改";
},
handleView(row) {
this.id=row.id;
this.titleView="查看";
this.openView=true;
// this.router.push({ path: '/emis/emisSettleInvoiceChRecord/viewDetail', query: { id: row.id }})
},
handleFormChanged(){
this.openForm = false;
this.getList();
},
cancelForm(){
this.openForm = false;
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除').then(function() {
return delEmisSettleInvoiceChRecord(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
const loadingInstance = this.$loading({
text: '正在导出...'
})
if(this.selectionList&&this.selectionList.length>0){
this.exportData(this.selectionList,loadingInstance);
}
else{
let qExportParam=this.initQueryParams();
qExportParam.pageNum=1;
qExportParam.pageSize=5000;
listEmisSettleInvoiceChRecord(qExportParam).then(response => {
if (response.code === 200) {
this.exportData(response.rows,loadingInstance);
}
});
}
},
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 === 'realInvoiceType') {
return this.selectDictLabel(this.dict.type.emis_invoice_ch_type,v[j]);
}
if (j === 'openChStatus') {
if(v[j] == -1){
return '发送异常';
}
else if(v[j] == 0){
return '未发送';
}
else if(v[j] == 1){
return '已发送';
}
else if(v[j] == 2){
return '开票成功';
}
else if(v[j] == 3){
return '开票失败';
}
else{
return '其他';
}
}
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>