md
This commit is contained in:
parent
98874d947a
commit
a582133923
@ -151,9 +151,19 @@
|
|||||||
plain
|
plain
|
||||||
size="mini"
|
size="mini"
|
||||||
:disabled="multiple"
|
:disabled="multiple"
|
||||||
@click="handleBatchGenBill"
|
@click="handleBatchGenBill(1)"
|
||||||
v-hasPermi="['emis:emisSettleBill:add']"
|
v-hasPermi="['emis:emisSettleBill:add']"
|
||||||
>批量生成现金账单</el-button>
|
>批量生成(现金)</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5" >
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
size="mini"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleBatchGenBill(2)"
|
||||||
|
v-hasPermi="['emis:emisSettleBill:add']"
|
||||||
|
>批量生成(月结)</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="1.5" >
|
<el-col :span="1.5" >
|
||||||
@ -430,6 +440,7 @@ import MergeBillForm from '@/views/emis/emisSettleBill/MergeBillForm.vue';
|
|||||||
import BillFeeListPanel from '@/views/emis/emisSettleSubBill/panel/BillFeeListPanel.vue';
|
import BillFeeListPanel from '@/views/emis/emisSettleSubBill/panel/BillFeeListPanel.vue';
|
||||||
|
|
||||||
import { parseTime,genJsSeqNo } from "@/utils/custom";
|
import { parseTime,genJsSeqNo } from "@/utils/custom";
|
||||||
|
import moment from 'moment';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "SubBillMergeMgnt",
|
name: "SubBillMergeMgnt",
|
||||||
@ -872,6 +883,29 @@ export default {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 检查是否有混杂单子
|
||||||
|
let lastSettleType=null;
|
||||||
|
for(let i=0;i<this.selectBillList.length;i++){
|
||||||
|
let item=this.selectBillList[i];
|
||||||
|
let paymentType=item.waybillDetail.paymentType;
|
||||||
|
let billCode=item.billCode;
|
||||||
|
|
||||||
|
let thisSettleType=null;
|
||||||
|
if(paymentType==2||paymentType==4||paymentType==5){
|
||||||
|
thisSettleType=2;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
thisSettleType=1;
|
||||||
|
}
|
||||||
|
if(lastSettleType==null){
|
||||||
|
lastSettleType=thisSettleType;
|
||||||
|
}
|
||||||
|
else if(lastSettleType!=thisSettleType){
|
||||||
|
this.$modal.msgError("不同结算方式单号不允许合账["+billCode+"]!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.$confirm("确定合账吗?", "提示", {
|
this.$confirm("确定合账吗?", "提示", {
|
||||||
cancelButtonText: "否",
|
cancelButtonText: "否",
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
@ -909,20 +943,40 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
// 批量生成
|
// 批量生成
|
||||||
handleBatchGenBill(){
|
handleBatchGenBill(settleType){
|
||||||
// if(!this.billMonth){
|
if(settleType==2 && !this.billMonth){
|
||||||
// this.$modal.msgError("账单月不能为空!");
|
this.$modal.msgError("账单月不能为空!");
|
||||||
// return;
|
return;
|
||||||
// }
|
}
|
||||||
|
|
||||||
if(!this.selectBillList){
|
if(!this.selectBillList){
|
||||||
this.$modal.msgError("请先选择单号 !");
|
this.$modal.msgError("请先选择单号 !");
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// 检查单号是否包含月结账单
|
// 检查是否有混杂单子
|
||||||
|
let lastSettleType=null;
|
||||||
|
for(let i=0;i<this.selectBillList.length;i++){
|
||||||
|
let item=this.selectBillList[i];
|
||||||
|
let paymentType=item.waybillDetail.paymentType;
|
||||||
|
let billCode=item.billCode;
|
||||||
|
|
||||||
this.$confirm("注意:现金账单账期是根据寄件日期月生成,确定批量生成吗?", "提示", {
|
let thisSettleType=null;
|
||||||
|
if(paymentType==2||paymentType==4||paymentType==5){
|
||||||
|
thisSettleType=2;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
thisSettleType=1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(thisSettleType!=settleType){
|
||||||
|
this.$modal.msgError("批量生成类型不一致,单号["+billCode+"]!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查单号是否包含月结账单
|
||||||
|
this.$confirm("确定批量生成吗?", "提示", {
|
||||||
cancelButtonText: "否",
|
cancelButtonText: "否",
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
type: "warning",
|
type: "warning",
|
||||||
@ -930,11 +984,22 @@ export default {
|
|||||||
closeOnClickModal: false
|
closeOnClickModal: false
|
||||||
}).then(async () => {
|
}).then(async () => {
|
||||||
|
|
||||||
let startDate = new Date(this.billMonth+"-01 00:00:00");
|
|
||||||
let endDate= this.getMonthLast(startDate);
|
|
||||||
endDate.setHours(23,59,59,0)
|
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
for(let i=0;i<this.selectBillList.length;i++){
|
for(let i=0;i<this.selectBillList.length;i++){
|
||||||
|
let item=this.selectBillList[i];
|
||||||
|
let sendDate=item.waybillDetail.sendDate;
|
||||||
|
let billMonth=null;
|
||||||
|
if(settleType==1){
|
||||||
|
billMonth = moment(sendDate).format(YYYY-MM);
|
||||||
|
}else{
|
||||||
|
billMonth=this.billMonth;
|
||||||
|
}
|
||||||
|
|
||||||
|
let startDate = new Date(billMonth+"-01 00:00:00");
|
||||||
|
let endDate= this.getMonthLast(startDate);
|
||||||
|
endDate.setHours(23,59,59,0)
|
||||||
|
|
||||||
let settleBillName=this.selectBillList[i].billCode;
|
let settleBillName=this.selectBillList[i].billCode;
|
||||||
let newSettleBillNo=genJsSeqNo();
|
let newSettleBillNo=genJsSeqNo();
|
||||||
@ -943,7 +1008,7 @@ export default {
|
|||||||
let postData={
|
let postData={
|
||||||
settleBillNo: newSettleBillNo,
|
settleBillNo: newSettleBillNo,
|
||||||
settleBillName: settleBillName,
|
settleBillName: settleBillName,
|
||||||
billMonth: this.billMonth,
|
billMonth: billMonth,
|
||||||
settleStartDate:parseTime(startDate),
|
settleStartDate:parseTime(startDate),
|
||||||
settleEndDate:parseTime(endDate),
|
settleEndDate:parseTime(endDate),
|
||||||
subBillList:billList,
|
subBillList:billList,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user