379 lines
12 KiB
Vue
379 lines
12 KiB
Vue
<template>
|
|
<div >
|
|
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="80px">
|
|
<el-row :gutter="0" style="display: flex;flex-wrap: wrap; overflow: hidden;">
|
|
<el-col :span="7" style="border-right: 1px solid #f3f3f3;padding-right: 5px;">
|
|
<el-row :gutter="0" style="display: flex;flex-wrap: wrap;">
|
|
<!-- <el-col :span="24">
|
|
<el-form-item label="账单编号" prop="settleBillNo" label-width="60px">
|
|
<el-input v-model="form.settleBillNo" placeholder="" disabled/>
|
|
</el-form-item>
|
|
</el-col> -->
|
|
<el-col :span="24">
|
|
<el-form-item label="账单名称" prop="settleBillName" label-width="60px">
|
|
<el-input v-model="form.settleBillName" placeholder="" />
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="24">
|
|
<el-form-item label="账单月份" prop="billMonth" label-width="60px" >
|
|
<el-input v-model="form.billMonth" placeholder="" disabled />
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="24">
|
|
<el-form-item label="应收金额" prop="recMoney" label-width="60px">
|
|
<el-input v-model="form.recMoney" placeholder="" disabled />
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="24">
|
|
<el-form-item label="总票数" prop="sendPieceSum" label-width="60px">
|
|
<el-input v-model="form.sendPieceSum" placeholder="" disabled />
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="24">
|
|
<el-form-item label="总件数" prop="pieceNumber" label-width="60px">
|
|
<el-input v-model="form.pieceNumber" placeholder="" disabled />
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="24">
|
|
<el-form-item label="结算重量" prop="feeWeight" label-width="60px">
|
|
<el-input v-model="form.feeWeight" placeholder="" disabled />
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="24" v-if="form.settleType==2">
|
|
<el-form-item label="月结编号" prop="custNo" label-width="60px">
|
|
<el-input v-model="form.custNo" placeholder="" disabled />
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="24" v-if="form.settleType==2">
|
|
<el-form-item label="月结客户" prop="custNo" label-width="60px">
|
|
<el-input v-model="form.custName" placeholder="" disabled />
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="24">
|
|
<el-form-item label="账单类型" prop="settleType" label-width="60px">
|
|
<span v-if="form.settleType==1">现金账单</span>
|
|
<span v-if="form.settleType==2">月结账单</span>
|
|
</el-form-item>
|
|
</el-col>
|
|
|
|
|
|
</el-row>
|
|
</el-col>
|
|
<!-- min-height:400px -->
|
|
<el-col :span="17" style="padding: 10px;">
|
|
|
|
<el-form-item label="输入运单号" prop="billCode">
|
|
<XdTextareaInput
|
|
v-model="billCodeStr"
|
|
:placeholder="$t('多个流水号逗号或换行隔开')"
|
|
clearable
|
|
:rows="2"
|
|
/>
|
|
</el-form-item>
|
|
|
|
<XdTable
|
|
v-loading="loading"
|
|
border
|
|
size="mini"
|
|
ref="refTable"
|
|
row-key="id"
|
|
storageName="emisSettleSubBillList_upd_0123"
|
|
:data="emisSettleSubBillList"
|
|
:showSearch.sync="showSearch"
|
|
:queryParams="queryParams"
|
|
:total="total"
|
|
@queryTable="getSubBillList"
|
|
@selection-change="handleSelectionChange"
|
|
>
|
|
<!-- highlight-current-row -->
|
|
<!-- show-summary :summary-method="getSummaries" -->
|
|
|
|
<div slot="toolbar" >
|
|
<el-row :gutter="10" class="mb8">
|
|
<el-col :span="1.5" >
|
|
<el-button
|
|
type="primary"
|
|
plain
|
|
size="mini"
|
|
@click="handleAddBillCode"
|
|
>追加运单到此账单</el-button>
|
|
</el-col>
|
|
<el-col :span="1.5" >
|
|
<el-button
|
|
type="primary"
|
|
plain
|
|
size="mini"
|
|
@click="handleRemovceBillCode"
|
|
>从账单内删除运单</el-button>
|
|
</el-col>
|
|
|
|
</el-row>
|
|
</div>
|
|
<el-table-column label="序号" align="center" width="50">
|
|
<template slot-scope="scope">
|
|
<span v-text="getIndex(scope.$index)"> </span>
|
|
</template>
|
|
</el-table-column>
|
|
<!-- <el-table-column type="selection" width="55" align="center" /> -->
|
|
<el-table-column :label="$t('运单编号')" align="center" prop="billCode" width="130" :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="80" />
|
|
<el-table-column :label="$t('运费')" align="center" prop="waybillDetail.freight" width="80" />
|
|
|
|
|
|
</XdTable>
|
|
</el-col>
|
|
<el-col :span="24">
|
|
|
|
</el-col>
|
|
</el-row>
|
|
|
|
</el-form>
|
|
<div style="text-align: center;margin-bottom: 10px;">
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
<el-button @click="cancel">取 消</el-button>
|
|
</div>
|
|
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import { listEmisSettleBill, getEmisSettleBill, addSubBillToSettleBill,removeSubBillFromSettleBill ,updateEmisSettleBill} from "@/api/emis/emisSettleBill";
|
|
|
|
import { listEmisSettleSubBill} from "@/api/emis/emisSettleSubBill";
|
|
|
|
export default {
|
|
name: "emisSettleBillForm",
|
|
props:{
|
|
id:{
|
|
type:[Number,Array]
|
|
},
|
|
settleBillNo:{
|
|
type:String
|
|
}
|
|
},
|
|
components: { },
|
|
dicts: [
|
|
],
|
|
data() {
|
|
return {
|
|
|
|
// 选中数组
|
|
ids: [],
|
|
// 非单个禁用
|
|
single: true,
|
|
// 非多个禁用
|
|
multiple: true,
|
|
// 显示搜索条件
|
|
showSearch: true,
|
|
// 创建时间搜索
|
|
// 总条数
|
|
total: 0,
|
|
|
|
// 结算子账单表格数据
|
|
emisSettleSubBillList: [],
|
|
|
|
emisSettleBillOptions: [],
|
|
|
|
billCodeStr:null,
|
|
// 遮罩层
|
|
loading: true,
|
|
// 表单参数
|
|
form: {},
|
|
// 表单校验
|
|
rules: {
|
|
|
|
},
|
|
queryParams: {
|
|
pageNum: 1,
|
|
pageSize: 20,
|
|
settleBillNo: null,
|
|
},
|
|
};
|
|
},
|
|
watch: {
|
|
"id": {
|
|
handler (newValue, oldValue) {
|
|
this.initData();
|
|
},
|
|
deep: true
|
|
},
|
|
"settleBillNo": {
|
|
handler (newValue, oldValue) {
|
|
this.initData();
|
|
},
|
|
deep: true
|
|
},
|
|
|
|
|
|
},
|
|
created() {
|
|
this.initData();
|
|
},
|
|
|
|
methods: {
|
|
initData() {
|
|
this.reset();
|
|
if(this.id !=null) {
|
|
this.loading = true;
|
|
getEmisSettleBill(this.id).then(response => {
|
|
this.form = response.data;
|
|
this.loading = false;
|
|
this.getSubBillList();
|
|
});
|
|
}
|
|
else if(this.settleBillNo){
|
|
this.loading = true;
|
|
getEmisSettleBill(this.settleBillNo).then(response => {
|
|
this.form = response.data;
|
|
this.loading = false;
|
|
this.getSubBillList();
|
|
});
|
|
}else{
|
|
this.$modal.msgError("账单不存在");
|
|
this.$emit("on-cancel");
|
|
}
|
|
},
|
|
getSubBillList() {
|
|
this.loading = true;
|
|
this.queryParams.settleBillNo=this.form.settleBillNo;
|
|
listEmisSettleSubBill(this.queryParams).then(response => {
|
|
this.emisSettleSubBillList = response.rows;
|
|
this.total = response.total;
|
|
this.loading = false;
|
|
});
|
|
|
|
// 查询统计
|
|
// getQueryStatInfoMap(qParam).then(response => {
|
|
// this.queryStatInfoMap = response.data;
|
|
// });
|
|
|
|
},
|
|
|
|
// 多选框选中数据
|
|
handleSelectionChange(selection) {
|
|
this.ids = selection.map(item => item.id)
|
|
this.single = selection.length!==1
|
|
this.multiple = !selection.length
|
|
},
|
|
|
|
// 取消按钮
|
|
cancel() {
|
|
this.reset();
|
|
this.$emit("on-cancel");
|
|
},
|
|
// 表单重置
|
|
reset() {
|
|
this.form = {
|
|
id: null,
|
|
settleBillNo: null,
|
|
settleBillName: null,
|
|
settleType: null,
|
|
settleStartDate: null,
|
|
settleEndDate: null,
|
|
billMonth: null,
|
|
recMoney: null,
|
|
recedMoney: null,
|
|
custNo: null,
|
|
customerCode: null,
|
|
customerName: null,
|
|
siteCode: null,
|
|
siteName: null,
|
|
satisfyMoney: null,
|
|
allowanceMoney: null,
|
|
deductionMoney: null,
|
|
otherMoney: null,
|
|
satisfyReason: null,
|
|
allowanceReason: null,
|
|
deductionReason: null,
|
|
otherReason: null,
|
|
openBillStatus: null,
|
|
paymentStatus: null,
|
|
sendPieceSum: null,
|
|
pieceNumber: null,
|
|
feeWeight: null,
|
|
uncollectedAmount: null,
|
|
sendMoneySum: null,
|
|
refundAmount: null,
|
|
refundMoney: null,
|
|
blConfirm: null,
|
|
confirmDate: null,
|
|
confirmSite: null,
|
|
confirmManCode: null,
|
|
blSiteConfirm: null,
|
|
confirmNote: null,
|
|
siteConfirmDate: null,
|
|
siteConfirmManCode: null,
|
|
siteConfirmNote: 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.id != null) {
|
|
let postData={
|
|
settleBillName:this.form.settleBillName
|
|
}
|
|
updateEmisSettleBill(postData).then(response => {
|
|
this.$modal.msgSuccess("修改成功");
|
|
this.initData();
|
|
// this.$emit("on-changed");
|
|
});
|
|
}
|
|
}
|
|
});
|
|
},
|
|
handleRemovceBillCode(){
|
|
|
|
let postData={
|
|
settleBillNo: this.form.settleBillNo,
|
|
params:{
|
|
billCodeStr:this.billCodeStr
|
|
}
|
|
}
|
|
|
|
// 生成合账单号
|
|
removeSubBillFromSettleBill(postData).then(response => {
|
|
this.$modal.msgSuccess("操作成功");
|
|
// this.getSubBillList();
|
|
this.initData();
|
|
});
|
|
},
|
|
handleAddBillCode(){
|
|
if(!this.billCodeStr){
|
|
this.$modal.msgError("运单号必填");
|
|
return;
|
|
}
|
|
|
|
let postData={
|
|
settleBillNo: this.form.settleBillNo,
|
|
params:{
|
|
billCodeStr:this.billCodeStr
|
|
}
|
|
}
|
|
// 生成合账单号
|
|
addSubBillToSettleBill(postData).then(response => {
|
|
this.$modal.msgSuccess("操作成功");
|
|
// this.getSubBillList();
|
|
this.initData();
|
|
});
|
|
|
|
},
|
|
/** 列索引函数 */
|
|
getIndex($index) {
|
|
return (this.queryParams.pageNum - 1) * this.queryParams.pageSize + $index + 1
|
|
},
|
|
|
|
}
|
|
};
|
|
</script>
|