md
This commit is contained in:
parent
cc0f331a93
commit
72be338464
@ -0,0 +1,482 @@
|
|||||||
|
<template>
|
||||||
|
<div >
|
||||||
|
|
||||||
|
<el-table
|
||||||
|
border
|
||||||
|
:data="billList"
|
||||||
|
size="mini"
|
||||||
|
style="width: 100%"
|
||||||
|
>
|
||||||
|
<el-table-column :label="$t('账单编号')" align="center" prop="settleBillNo" width="170" :show-overflow-tooltip="true"/>
|
||||||
|
<el-table-column :label="$t('账单名称')" align="left" prop="settleBillName" width="200" :show-overflow-tooltip="true"/>
|
||||||
|
<el-table-column :label="$t('账单月份')" align="center" prop="billMonth" width="80" />
|
||||||
|
<el-table-column :label="$t('收款状态')" align="center" prop="paymentStatus" width="100" >
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag v-if="scope.row.paymentStatus=='0'" type="error">未收款</el-tag>
|
||||||
|
<el-tag v-if="scope.row.paymentStatus=='1'" type="success">已收款</el-tag>
|
||||||
|
<el-tag v-if="scope.row.paymentStatus=='2'" type="warning">部分收款</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column :label="$t('开票状态')" align="center" prop="openBillStatus" width="100" >
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag v-if="scope.row.openBillStatus=='0'" type="error">未开票</el-tag>
|
||||||
|
<el-tag v-if="scope.row.openBillStatus=='1'" type="success">已开票</el-tag>
|
||||||
|
<el-tag v-if="scope.row.openBillStatus=='2'" type="warning">部分开票</el-tag>
|
||||||
|
<el-tag v-if="scope.row.openBillStatus=='3'" type="warning">不开票</el-tag>
|
||||||
|
<el-tag v-if="scope.row.openBillStatus=='4'" type="success">已完成</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column :label="$t('应收金额')" align="center" prop="recMoney" width="150" />
|
||||||
|
<el-table-column :label="$t('已收金额')" align="center" prop="recedMoney" width="150" />
|
||||||
|
<el-table-column :label="$t('回款联系人')" align="center" prop="payee" width="100" />
|
||||||
|
<el-table-column :label="$t('销售联系人')" align="center" prop="salesmen" width="100" />
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<el-form ref="form" :model="form" size="mini" :rules="rules" label-width="80px" style="margin-top: 20px;">
|
||||||
|
<el-row :gutter="0" style="display: flex;flex-wrap: wrap;">
|
||||||
|
|
||||||
|
<el-col :span="6" >
|
||||||
|
<el-form-item label="收款方式" prop="payType">
|
||||||
|
<span slot="label">
|
||||||
|
<span style="color: red">收款方式</span>
|
||||||
|
</span>
|
||||||
|
<el-select v-model="form.payType" placeholder="收款方式" clearable filterable style="width:100%">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in dict.type.emis_settlebill_pay_type"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6" >
|
||||||
|
<el-form-item :label="$t('缴款人')" prop="customerCode" >
|
||||||
|
<span slot="label">
|
||||||
|
<span style="color: red">缴款人</span>
|
||||||
|
</span>
|
||||||
|
<PayeePicker v-model="form.payManCode" @onChange="onPayeeSelect"></PayeePicker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6" >
|
||||||
|
<el-form-item label="交易时间" prop="tradeDate">
|
||||||
|
<span slot="label">
|
||||||
|
<span style="color: red">交易时间</span>
|
||||||
|
</span>
|
||||||
|
<el-date-picker clearable
|
||||||
|
v-model="form.tradeDate"
|
||||||
|
type="date"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
placeholder="请选择交易时间"
|
||||||
|
style="width:100%"
|
||||||
|
>
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6" >
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="6" >
|
||||||
|
<el-form-item label="收款金额" prop="payMoney">
|
||||||
|
<span slot="label">
|
||||||
|
<span style="color: red">收款金额</span>
|
||||||
|
</span>
|
||||||
|
<el-input-number v-model="form.payMoney" size="mini" placeholder="开票金额" :min="0.00" :controls="false" :precision="2" disabled></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="18" >
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="24" >
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input v-model="form.remark" type="textarea" placeholder="" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<!-- <el-col :span="24">
|
||||||
|
<el-form-item label="收款单号" prop="payScope" >
|
||||||
|
<el-radio-group v-model="form.payScope" @change="changePayScope">
|
||||||
|
<el-radio :key="'1'" label="1">全部运单</el-radio>
|
||||||
|
<el-radio :key="'0'" label="0">部分运单</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col> -->
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="运单列表" prop="billCode" >
|
||||||
|
<span slot="label">
|
||||||
|
<span style="color: red">运单列表</span>
|
||||||
|
</span>
|
||||||
|
<div style="display:inline-flex; width: 50%;" v-if="form.payScope==0">
|
||||||
|
<el-input v-model="form.params.billCodeStr" rows="2" type="textarea" placeholder="部分收款请填写单号,多单请使用逗号隔开" />
|
||||||
|
<el-button type="primary" @click="addBillToApply">加入单号</el-button>
|
||||||
|
</div>
|
||||||
|
<el-table
|
||||||
|
class="cargoList"
|
||||||
|
:cell-style="{
|
||||||
|
'padding': '0px!important',
|
||||||
|
'padding-left': '0px!important',
|
||||||
|
'padding-right': '0px!important',
|
||||||
|
'font-size':'11px'
|
||||||
|
}"
|
||||||
|
:header-cell-style="{
|
||||||
|
'font-size':'11px'
|
||||||
|
}"
|
||||||
|
border
|
||||||
|
:data="form.payRelList"
|
||||||
|
size="mini"
|
||||||
|
style="width: 100%"
|
||||||
|
|
||||||
|
>
|
||||||
|
|
||||||
|
<!-- max-height="500px" -->
|
||||||
|
<el-table-column :label="$t('序号')" align="center" width="60">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span > {{scope.$index+1}}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="billNo" :label="$t('运单号')" align="center" width="170">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.billNo }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="billFee" :label="$t('运费')" align="center" width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{scope.row.billFee}}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="canApplyFee" :label="$t('已收金额')" align="center" width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{scope.row.hasApplyFee}}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="openBillMoney" :label="$t('收款金额')" align="center" width="120">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{scope.row.payMoney}}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column :label="$t('寄件日期')" align="center" prop="waybillDetail.sendDate" min-width="170" :show-overflow-tooltip="true"/>
|
||||||
|
<el-table-column :label="$t('快件类型')" align="center" prop="kjlx" width="180" :show-overflow-tooltip="true">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.waybillDetail.sendSiteName }}--{{ scope.row.waybillDetail.dispatchUnderlingSiteName }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column :label="$t('发件人')" align="center" prop="waybillDetail.sendName" width="100" :show-overflow-tooltip="true"/>
|
||||||
|
<el-table-column :label="$t('寄件公司')" align="center" prop="waybillDetail.sendCompany" width="150" :show-overflow-tooltip="true"/>
|
||||||
|
<el-table-column :label="$t('支付方式')" align="center" prop="waybillDetail.paymentType" min-width="80" :show-overflow-tooltip="true" >
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<dict-tag :options="dict.type.emis_payment_type" :value="scope.row.waybillDetail.paymentType" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column :label="$t('产品类型')" align="center" prop="waybillDetail.productTypeName" width="120" :show-overflow-tooltip="true"/>
|
||||||
|
<el-table-column :label="$t('件数')" align="center" prop="waybillDetail.parcelQty" width="80" />
|
||||||
|
<el-table-column :label="$t('结算重量')" align="center" prop="waybillDetail.settlementWeight" width="120" />
|
||||||
|
<el-table-column :label="$t('结算体积')" align="center" prop="waybillDetail.totalVolume" min-width="80" />
|
||||||
|
|
||||||
|
<el-table-column :label="$t('操作')" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span class="icon iconfont"
|
||||||
|
style="cursor: pointer;font-size: 21px;color: #6e6e6e;"
|
||||||
|
@click="()=>deleteFeeItem(scope.row)"></span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
</el-table>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<div style="text-align: center;margin-bottom: 10px;">
|
||||||
|
<el-button type="primary" :loading="isDoing" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { getInfoBySettleBillNo} from "@/api/emis/emisSettleBill";
|
||||||
|
import {listEmisSettleSubBill,listHasPayMap} from "@/api/emis/emisSettleSubBill";
|
||||||
|
import { listEmisSettlePayRecord, getEmisSettlePayRecord, delEmisSettlePayRecord, addEmisSettlePayRecord, updateEmisSettlePayRecord } from "@/api/emis/emisSettlePayRecord";
|
||||||
|
import AllMonthpayAccountPicker from '@/views/emis/EmisBaseTools/AllMonthpayAccountPicker.vue';
|
||||||
|
import PayeePicker from '@/views/emis/EmisBaseTools/PayeePicker.vue';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "PayRecordInputByMerge",
|
||||||
|
props:{
|
||||||
|
billList:{
|
||||||
|
type:Array
|
||||||
|
}
|
||||||
|
},
|
||||||
|
components: { AllMonthpayAccountPicker,PayeePicker },
|
||||||
|
dicts: ['emis_settlebill_pay_type'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
emisSettlePayRecordOptions: [],
|
||||||
|
settleBillItem:this.settleBillObj,
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
isDoing:false,
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
id: [
|
||||||
|
{ required: true, message: "id不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
payType: [
|
||||||
|
{ required: true, message: "支付类型不能为空", trigger: ["blur","change"] }
|
||||||
|
],
|
||||||
|
recType: [
|
||||||
|
{ required: true, message: "收付类型不能为空", trigger: ["blur","change"] }
|
||||||
|
],
|
||||||
|
payManCode: [
|
||||||
|
{ required: true, message: "缴款人不能为空", trigger: ["blur","change"] }
|
||||||
|
],
|
||||||
|
payMoney: [
|
||||||
|
{ required: true, message: "金额不能为空", trigger: ["blur","change"] }
|
||||||
|
],
|
||||||
|
refundMoney: [
|
||||||
|
{ required: true, message: "退款金额不能为空", trigger: ["blur","change"] }
|
||||||
|
],
|
||||||
|
tradeDate: [
|
||||||
|
{ required: true, message: "交易时间不能为空", trigger: ["blur","change"] }
|
||||||
|
],
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
// getBillCode(){
|
||||||
|
// this.form.settleBillNo = this.settleBillNo;
|
||||||
|
// this.initData();
|
||||||
|
// return this.form.settleBillNo ;
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
"billList": {
|
||||||
|
handler (newValue, oldValue) {
|
||||||
|
// this.form.settleBillNo = this.settleBillNo;
|
||||||
|
this.initData();
|
||||||
|
},
|
||||||
|
deep: true
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.initData();
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
initData() {
|
||||||
|
|
||||||
|
this.reset();
|
||||||
|
this.form.recType=1;
|
||||||
|
this.form.payScope='1';
|
||||||
|
this.form.payRelList=[];
|
||||||
|
|
||||||
|
console.log("===>initData2222===>",this.billList)
|
||||||
|
if(this.billList&& this.billList.length>0){
|
||||||
|
// this.loading = true;
|
||||||
|
// getInfoBySettleBillNo(this.settleBillNo).then(response => {
|
||||||
|
// this.settleBillItem = response.data;
|
||||||
|
// this.form.payManCode = this.settleBillItem.custNo;
|
||||||
|
// this.form.payMan=this.settleBillItem.custName;
|
||||||
|
// console.log("===>settleBillItem3333===>",this.settleBillItem)
|
||||||
|
// this.loading = false;
|
||||||
|
// });
|
||||||
|
this.changePayScope();
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
async handleCalcFeeItem(row){
|
||||||
|
let totalFee=Number(0);
|
||||||
|
let origFee=Number(0);
|
||||||
|
if(this.form.payRelList&&this.form.payRelList.length>0){
|
||||||
|
let len=this.form.payRelList.length;
|
||||||
|
for(let i=0;i<len;i++){
|
||||||
|
let item=this.form.payRelList[i];
|
||||||
|
let newFee=Number(item.payMoney);
|
||||||
|
newFee=newFee.toFixed(2);
|
||||||
|
origFee=Number(origFee)+Number(newFee);
|
||||||
|
}
|
||||||
|
totalFee=origFee
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if(this.form.recType==1){
|
||||||
|
this.form.payMoney = totalFee.toFixed(2);
|
||||||
|
}
|
||||||
|
else if(this.form.recType==2){
|
||||||
|
this.form.refundMoney = totalFee.toFixed(2);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
async changePayScope(){
|
||||||
|
// 收/ 退款
|
||||||
|
if(this.form.payScope==1){
|
||||||
|
|
||||||
|
let settleBillNoListStr="";
|
||||||
|
for(let i=0;i<this.billList.length;i++){
|
||||||
|
let itemBill = this.billList[i];
|
||||||
|
settleBillNoListStr=settleBillNoListStr+itemBill.settleBillNo+",";
|
||||||
|
}
|
||||||
|
|
||||||
|
this.form.settleBillNo=settleBillNoListStr;
|
||||||
|
|
||||||
|
this.form.payRelList=[];
|
||||||
|
let hasPayMap = {}
|
||||||
|
let resMap=await listHasPayMap({settleBillNo:settleBillNoListStr});
|
||||||
|
if(resMap.rows&&resMap.rows.length>0){
|
||||||
|
for(let i=0;i<resMap.rows.length;i++){
|
||||||
|
let item=resMap.rows[i];
|
||||||
|
hasPayMap[item.billNo] = item.sumMoney
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log("===>hasPayMap==>",hasPayMap);
|
||||||
|
|
||||||
|
let qParam={
|
||||||
|
settleBillNo:settleBillNoListStr,
|
||||||
|
pageNum:1,
|
||||||
|
pageSize:2000
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询子账单
|
||||||
|
let res=await listEmisSettleSubBill(qParam);
|
||||||
|
console.log("===>=res==>",res)
|
||||||
|
if(res.code==200){
|
||||||
|
res.rows.forEach(itemSubBill=>{
|
||||||
|
let relItem={...itemSubBill};
|
||||||
|
relItem.payMoney=itemSubBill.billFee;
|
||||||
|
relItem.hasApplyFee=0;
|
||||||
|
|
||||||
|
console.log("===>=hasPayMap1111==>",hasPayMap[itemSubBill.billNo])
|
||||||
|
if(itemSubBill.billNo in hasPayMap){
|
||||||
|
if(this.form.recType==1){
|
||||||
|
relItem.hasApplyFee=hasPayMap[itemSubBill.billNo];
|
||||||
|
relItem.payMoney=itemSubBill.billFee-hasPayMap[itemSubBill.billNo];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(relItem.payMoney>0){
|
||||||
|
this.form.payRelList.push(relItem);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
this.handleCalcFeeItem();
|
||||||
|
|
||||||
|
}else{
|
||||||
|
this.form.payRelList=[];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
onRecTypeChange(){
|
||||||
|
this.changePayScope();
|
||||||
|
},
|
||||||
|
onPayeeSelect(item){
|
||||||
|
this.form.payMan=item;
|
||||||
|
},
|
||||||
|
onMonthpayAccountSelect(item){
|
||||||
|
console.log("onMonthpayAccountSelect==>",item);
|
||||||
|
if(item==null){
|
||||||
|
this.form.payMan=null;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.form.payMan=item.custName;
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.reset();
|
||||||
|
this.$emit("on-cancel");
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
payScope:null,
|
||||||
|
params:{
|
||||||
|
billCodeStr:null,
|
||||||
|
},
|
||||||
|
payRelList:[],
|
||||||
|
|
||||||
|
id: null,
|
||||||
|
payId: null,
|
||||||
|
payType: null,
|
||||||
|
recType: null,
|
||||||
|
payMan: null,
|
||||||
|
payManCode: null,
|
||||||
|
settleBillNo: this.settleBillNo,
|
||||||
|
blAudit: null,
|
||||||
|
auditDate: null,
|
||||||
|
auditManCode: null,
|
||||||
|
auditSiteCode: null,
|
||||||
|
customerCode: null,
|
||||||
|
customerName: null,
|
||||||
|
payMoney: null,
|
||||||
|
payStatus: null,
|
||||||
|
payStatusDesc: null,
|
||||||
|
breakType: null,
|
||||||
|
breakReason: null,
|
||||||
|
breakEmpCode: null,
|
||||||
|
recManCode: null,
|
||||||
|
settleType: this.settleType,
|
||||||
|
refundDate: null,
|
||||||
|
refundManCode: null,
|
||||||
|
refundSeq: null,
|
||||||
|
refundMode: null,
|
||||||
|
refundMoney: null,
|
||||||
|
refundReason: null,
|
||||||
|
refundRemark: null,
|
||||||
|
refundOpManCode: null,
|
||||||
|
refundRegisterSiteCode: null,
|
||||||
|
refundRegisterManCode: null,
|
||||||
|
satisfyMoney: null,
|
||||||
|
satisfyReason: null,
|
||||||
|
allowanceMoney: null,
|
||||||
|
allowanceReason: null,
|
||||||
|
deductionMoney: null,
|
||||||
|
deductionReason: null,
|
||||||
|
otherMoney: null,
|
||||||
|
otherReason: null,
|
||||||
|
tradeDate: null,
|
||||||
|
remark: null,
|
||||||
|
delFlag: null,
|
||||||
|
createBy: null,
|
||||||
|
createTime: null,
|
||||||
|
updateBy: null,
|
||||||
|
updateTime: null,
|
||||||
|
createSite: null,
|
||||||
|
updateSite: null
|
||||||
|
};
|
||||||
|
this.resetForm("form");
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm() {
|
||||||
|
|
||||||
|
// 必须要有金额才能保存
|
||||||
|
|
||||||
|
this.$refs["form"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if(this.form.tradeDate){
|
||||||
|
this.form.tradeDate = this.form.tradeDate + " 00:00:00";
|
||||||
|
}
|
||||||
|
|
||||||
|
if(this.form.refundDate){
|
||||||
|
this.form.refundDate = this.form.refundDate + " 00:00:00";
|
||||||
|
}
|
||||||
|
|
||||||
|
this.isDoing=true;
|
||||||
|
addEmisSettlePayRecord(this.form).then(response => {
|
||||||
|
this.isDoing=false;
|
||||||
|
this.$modal.msgSuccess("新增成功");
|
||||||
|
this.$emit("on-changed");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
Loading…
Reference in New Issue
Block a user