md
This commit is contained in:
parent
98874d947a
commit
a582133923
@ -151,9 +151,19 @@
|
||||
plain
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleBatchGenBill"
|
||||
@click="handleBatchGenBill(1)"
|
||||
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 :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 { parseTime,genJsSeqNo } from "@/utils/custom";
|
||||
import moment from 'moment';
|
||||
|
||||
export default {
|
||||
name: "SubBillMergeMgnt",
|
||||
@ -872,6 +883,29 @@ export default {
|
||||
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("确定合账吗?", "提示", {
|
||||
cancelButtonText: "否",
|
||||
confirmButtonText: "确定",
|
||||
@ -909,20 +943,40 @@ export default {
|
||||
},
|
||||
|
||||
// 批量生成
|
||||
handleBatchGenBill(){
|
||||
// if(!this.billMonth){
|
||||
// this.$modal.msgError("账单月不能为空!");
|
||||
// return;
|
||||
// }
|
||||
handleBatchGenBill(settleType){
|
||||
if(settleType==2 && !this.billMonth){
|
||||
this.$modal.msgError("账单月不能为空!");
|
||||
return;
|
||||
}
|
||||
|
||||
if(!this.selectBillList){
|
||||
this.$modal.msgError("请先选择单号 !");
|
||||
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: "否",
|
||||
confirmButtonText: "确定",
|
||||
type: "warning",
|
||||
@ -930,11 +984,22 @@ export default {
|
||||
closeOnClickModal: false
|
||||
}).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;
|
||||
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 newSettleBillNo=genJsSeqNo();
|
||||
@ -943,7 +1008,7 @@ export default {
|
||||
let postData={
|
||||
settleBillNo: newSettleBillNo,
|
||||
settleBillName: settleBillName,
|
||||
billMonth: this.billMonth,
|
||||
billMonth: billMonth,
|
||||
settleStartDate:parseTime(startDate),
|
||||
settleEndDate:parseTime(endDate),
|
||||
subBillList:billList,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user