|
@@ -6,7 +6,7 @@
|
|
|
<el-form-item>
|
|
|
<el-input v-model="shipName" placeholder="请输入船名"></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item>
|
|
|
+ <!-- <el-form-item>
|
|
|
<span class="demonstration">离港日期</span>
|
|
|
<el-date-picker
|
|
|
v-model="startTime"
|
|
@@ -23,7 +23,7 @@
|
|
|
style="width:200px"
|
|
|
>
|
|
|
</el-date-picker>
|
|
|
- </el-form-item>
|
|
|
+ </el-form-item> -->
|
|
|
<el-form-item>
|
|
|
<el-button @click="onClick" type="primary" icon="el-icon-search">查询</el-button>
|
|
|
</el-form-item>
|
|
@@ -74,7 +74,6 @@
|
|
|
ref="tableRef"
|
|
|
border
|
|
|
style="width: 100%; margin-top: 0px"
|
|
|
- fit
|
|
|
max-height="500px"
|
|
|
:row-style="{ height: '30px' }"
|
|
|
:cell-style="{ fontWeight: '700' }"
|
|
@@ -93,61 +92,77 @@
|
|
|
<el-table-column
|
|
|
prop="materialName"
|
|
|
label="品种"
|
|
|
- width="150px"
|
|
|
+ width="120px"
|
|
|
align="center"
|
|
|
>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="resultForeignShipName"
|
|
|
label="船名"
|
|
|
- width="150px"
|
|
|
+ width="100px"
|
|
|
align="center"
|
|
|
>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="portName"
|
|
|
label="放货港口"
|
|
|
- width="150px"
|
|
|
+ width="120px"
|
|
|
align="center"
|
|
|
>
|
|
|
</el-table-column>
|
|
|
- <el-table-column
|
|
|
+ <!-- <el-table-column
|
|
|
prop="carrierName"
|
|
|
label="承运单位"
|
|
|
width="100px"
|
|
|
align="center"
|
|
|
>
|
|
|
- </el-table-column>
|
|
|
+ </el-table-column> -->
|
|
|
<el-table-column
|
|
|
prop="resultOutPortTime"
|
|
|
label="离港日期"
|
|
|
- width="200px"
|
|
|
+ width="100px"
|
|
|
align="center"
|
|
|
>
|
|
|
</el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="loadTonnage"
|
|
|
- label="装船吨位"
|
|
|
+ <el-table-column
|
|
|
+ prop="monthLoadTonnage"
|
|
|
+ label="月份装船吨位"
|
|
|
width="100px"
|
|
|
align="center"
|
|
|
>
|
|
|
+ <template slot-scope="scope" v-if="scope.row.unitPriceId">
|
|
|
+ {{(scope.row.monthLoadTonnage).toFixed(2)}}
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="loadingProportion"
|
|
|
- label="装船比例"
|
|
|
+ prop="monthLoadingProportion"
|
|
|
+ label="月份装船比例"
|
|
|
width="70px"
|
|
|
align="center"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope" v-if="scope.row.unitPriceId">
|
|
|
+ {{(scope.row.monthLoadingProportion*100).toFixed(2)}}%
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="monthRealTonnage"
|
|
|
+ label="月份结算吨位"
|
|
|
+ width="100px"
|
|
|
+ align="center"
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
- {{(scope.row.loadingProportion*100).toFixed(2)}}%
|
|
|
+ {{(scope.row.monthRealTonnage).toFixed(2)}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="realTonnage"
|
|
|
- label="结算吨位"
|
|
|
+ prop="monthMakeTonnage"
|
|
|
+ label="月份开票吨位"
|
|
|
width="100px"
|
|
|
align="center"
|
|
|
>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{(scope.row.monthMakeTonnage).toFixed(2)}}
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="totalEnTonnage"
|
|
@@ -175,6 +190,26 @@
|
|
|
<template slot-scope="scope">
|
|
|
<el-input type="number" v-model="scope.row.inspectionFees"></el-input>
|
|
|
</template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="totalPreviewTonnage"
|
|
|
+ label="已预开总吨位"
|
|
|
+ width="120px"
|
|
|
+ align="center"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input type="number" v-model="scope.row.totalPreviewTonnage"></el-input>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="totalPreviewFee"
|
|
|
+ label="已预开总金额"
|
|
|
+ width="120px"
|
|
|
+ align="center"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope" v-if="scope.row.totalPreviewFee">
|
|
|
+ {{(scope.row.totalPreviewFee).toFixed(2)}}
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="statementTotalAmount"
|
|
@@ -182,6 +217,40 @@
|
|
|
width="100px"
|
|
|
align="center"
|
|
|
>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="capacityNumber"
|
|
|
+ label="江船"
|
|
|
+ width="100px"
|
|
|
+ align="center"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="loadTonnage"
|
|
|
+ label="装船吨位"
|
|
|
+ width="100px"
|
|
|
+ align="center"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="loadingProportion"
|
|
|
+ label="装船比例"
|
|
|
+ width="70px"
|
|
|
+ align="center"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{(scope.row.loadingProportion*100).toFixed(2)}}%
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="realTonnage"
|
|
|
+ label="结算吨位"
|
|
|
+ width="100px"
|
|
|
+ align="center"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope" v-if="scope.row.realTonnage">
|
|
|
+ {{(scope.row.realTonnage).toFixed(2)}}
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="fee"
|
|
@@ -189,6 +258,9 @@
|
|
|
width="100px"
|
|
|
align="center"
|
|
|
>
|
|
|
+ <template slot-scope="scope" v-if="scope.row.fee">
|
|
|
+ {{(scope.row.fee).toFixed(2)}}
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="previewTonnage"
|
|
@@ -196,8 +268,8 @@
|
|
|
width="120px"
|
|
|
align="center"
|
|
|
>
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-input type="number" v-model="scope.row.previewTonnage"></el-input>
|
|
|
+ <template slot-scope="scope" v-if="scope.row.previewTonnage">
|
|
|
+ {{(scope.row.previewTonnage).toFixed(2)}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
@@ -206,6 +278,9 @@
|
|
|
width="100px"
|
|
|
align="center"
|
|
|
>
|
|
|
+ <template slot-scope="scope" v-if="scope.row.previewFee">
|
|
|
+ {{(scope.row.previewFee).toFixed(2)}}
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="makeTonnage"
|
|
@@ -213,6 +288,9 @@
|
|
|
width="100px"
|
|
|
align="center"
|
|
|
>
|
|
|
+ <template slot-scope="scope" v-if="scope.row.makeTonnage">
|
|
|
+ {{(scope.row.makeTonnage).toFixed(2)}}
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="actuallyMoney"
|
|
@@ -220,6 +298,9 @@
|
|
|
width="100px"
|
|
|
align="center"
|
|
|
>
|
|
|
+ <template slot-scope="scope" v-if="scope.row.actuallyMoney">
|
|
|
+ {{(scope.row.actuallyMoney).toFixed(2)}}
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
<!-- <el-table-column
|
|
|
prop="feeMake"
|
|
@@ -237,7 +318,7 @@
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
<el-button type="text" @click="operate(scope.row)"
|
|
|
- >保存</el-button
|
|
|
+ >预开票</el-button
|
|
|
>
|
|
|
<el-button type="text" @click="settlement(scope.row)"
|
|
|
>结算</el-button
|
|
@@ -288,26 +369,39 @@
|
|
|
>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="carrierName"
|
|
|
- label="承运单位"
|
|
|
- width="100px"
|
|
|
+ prop="totalPreviewTonnage"
|
|
|
+ label="已预开总吨位"
|
|
|
+ width="120px"
|
|
|
align="center"
|
|
|
>
|
|
|
+ <template slot-scope="scope" v-if="scope.row.totalPreviewTonnage">
|
|
|
+ {{(scope.row.totalPreviewTonnage).toFixed(2)}}
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="statementTotalAmount"
|
|
|
- label="开票总金额"
|
|
|
- width="100px"
|
|
|
+ <el-table-column
|
|
|
+ prop="totalPreviewFee"
|
|
|
+ label="已预开总金额"
|
|
|
+ width="120px"
|
|
|
align="center"
|
|
|
>
|
|
|
+ <template slot-scope="scope" v-if="scope.row.totalPreviewFee">
|
|
|
+ {{(scope.row.totalPreviewFee).toFixed(2)}}
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column
|
|
|
+ <el-table-column
|
|
|
prop="makeTonnageTotal"
|
|
|
label="开票总吨位"
|
|
|
width="100px"
|
|
|
align="center"
|
|
|
>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="statementTotalAmount"
|
|
|
+ label="开票总金额"
|
|
|
+ width="100px"
|
|
|
+ align="center"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
<el-table-column
|
|
|
prop="resultOutPortTime"
|
|
|
label="离港日期"
|
|
@@ -346,13 +440,6 @@
|
|
|
align="center"
|
|
|
>
|
|
|
</el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="totalEnTonnage"
|
|
|
- label="到厂湿吨"
|
|
|
- width="100px"
|
|
|
- align="center"
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
<el-table-column
|
|
|
prop="unitPrice"
|
|
|
label="合同单价"
|
|
@@ -427,7 +514,13 @@ export default {
|
|
|
"totalEnTonnage",
|
|
|
"operate",
|
|
|
"statementTotalAmount",
|
|
|
- "makeTonnageTotal"
|
|
|
+ "makeTonnageTotal",
|
|
|
+ "monthLoadTonnage",
|
|
|
+ "monthLoadingProportion",
|
|
|
+ "monthRealTonnage",
|
|
|
+ "totalPreviewTonnage",
|
|
|
+ "monthMakeTonnage",
|
|
|
+ "totalPreviewFee"
|
|
|
],
|
|
|
activeName: "first",
|
|
|
tableTitle: "结算账单报表",
|
|
@@ -459,13 +552,15 @@ export default {
|
|
|
console.log("row:",row);
|
|
|
//遍历tableData,找出相同批次的行数
|
|
|
let arr = this.tableData.filter(e => {
|
|
|
- return e.batchId == row.batchId && e.noticeTime==row.noticeTime;
|
|
|
+ return e.batchId == row.batchId && e.noticeTime==row.noticeTime && row.unitPriceId == e.unitPriceId;
|
|
|
});
|
|
|
let map = {
|
|
|
list: arr,
|
|
|
statementType: 3,
|
|
|
- totalEnTonnage: row.totalEnTonnage,
|
|
|
+ totalEnTonnage: row.monthMakeTonnage,
|
|
|
statementTotalAmount: row.statementTotalAmount,
|
|
|
+ totalPreviewFee:row.totalPreviewFee,
|
|
|
+ totalPreviewTonnage:row.totalPreviewTonnage,
|
|
|
userID: getCookie("userId"),
|
|
|
statementStatus:1
|
|
|
};
|
|
@@ -475,26 +570,29 @@ export default {
|
|
|
.then(res => {
|
|
|
if (res.data.code == "200") {
|
|
|
this.getNoDetailsStament();
|
|
|
- this.$message.success("保存成功");
|
|
|
+ this.$message.success("结算成功");
|
|
|
}
|
|
|
})
|
|
|
.catch(() => {
|
|
|
- this.$message.error("保存失败");
|
|
|
+ this.$message.error("结算失败");
|
|
|
});
|
|
|
},
|
|
|
- //保存
|
|
|
+ //预开保存
|
|
|
operate(row) {
|
|
|
console.log("row:",row);
|
|
|
//遍历tableData,找出相同批次的行数
|
|
|
let arr = this.tableData.filter(e => {
|
|
|
- return e.batchId == row.batchId && e.noticeTime==row.noticeTime;
|
|
|
+ return e.batchId == row.batchId && e.noticeTime==row.noticeTime && row.unitPriceId == e.unitPriceId;
|
|
|
});
|
|
|
let map = {
|
|
|
list: arr,
|
|
|
statementType: 3,
|
|
|
- totalEnTonnage: row.totalEnTonnage,
|
|
|
+ totalEnTonnage: row.monthMakeTonnage,
|
|
|
statementTotalAmount: row.statementTotalAmount,
|
|
|
- userID: getCookie("userId")
|
|
|
+ totalPreviewFee:row.totalPreviewFee,
|
|
|
+ totalPreviewTonnage:row.totalPreviewTonnage,
|
|
|
+ userID: getCookie("userId"),
|
|
|
+ statementStatus:0
|
|
|
};
|
|
|
console.log("map:",map);
|
|
|
this.axios
|
|
@@ -502,32 +600,41 @@ export default {
|
|
|
.then(res => {
|
|
|
if (res.data.code == "200") {
|
|
|
this.getNoDetailsStament();
|
|
|
- this.$message.success("保存成功");
|
|
|
+ this.$message.success("预开成功");
|
|
|
}
|
|
|
})
|
|
|
.catch(() => {
|
|
|
- this.$message.error("保存失败");
|
|
|
+ this.$message.error("预开失败");
|
|
|
});
|
|
|
},
|
|
|
//处理表格数据
|
|
|
computedTableData(data) {
|
|
|
data.forEach((item, index) => {
|
|
|
if (index == 0) {
|
|
|
- } else if (item.batchId == data[index - 1].batchId && item.noticeTime == data[index - 1].noticeTime) {
|
|
|
+ } else if (item.batchId == data[index - 1].batchId && item.noticeTime == data[index - 1].noticeTime && item.unitPriceId == data[index - 1].unitPriceId) {
|
|
|
item.totalEnTonnage = data[index - 1].totalEnTonnage;
|
|
|
+ item.totalPreviewTonnage= data[index - 1].totalPreviewTonnage;
|
|
|
}
|
|
|
+ //总计预开票金额
|
|
|
+ item.totalPreviewFee=item.totalPreviewTonnage*item.unitPrice;
|
|
|
+ //预开吨位
|
|
|
+ item.previewTonnage=item.totalPreviewTonnage*(item.loadTonnage/item.monthLoadTonnage);
|
|
|
//预开金额
|
|
|
- item.previewFee = (item.unitPrice * item.previewTonnage).toFixed(2);
|
|
|
+ item.previewFee = (item.unitPrice * item.previewTonnage);
|
|
|
//结算吨位
|
|
|
item.realTonnage = (
|
|
|
item.totalEnTonnage * item.loadingProportion
|
|
|
- ).toFixed(2);
|
|
|
+ );
|
|
|
//金额
|
|
|
- item.fee = (item.realTonnage * item.unitPrice).toFixed(2);
|
|
|
+ item.fee = (item.realTonnage * item.unitPrice);
|
|
|
//开票吨位
|
|
|
- item.makeTonnage = (item.realTonnage - item.previewTonnage).toFixed(2);
|
|
|
+ item.makeTonnage = (item.realTonnage - item.previewTonnage);
|
|
|
//实际开票金额
|
|
|
- item.actuallyMoney = (item.makeTonnage * item.unitPrice-item.inspectionFees).toFixed(2);
|
|
|
+ item.actuallyMoney = (item.makeTonnage * item.unitPrice-item.inspectionFees);
|
|
|
+ //月份结算吨位/
|
|
|
+ item.monthRealTonnage = item.totalEnTonnage*item.monthLoadingProportion;
|
|
|
+ //月份开票吨位
|
|
|
+ item.monthMakeTonnage = item.monthRealTonnage-item.totalPreviewTonnage;
|
|
|
});
|
|
|
this.computedTotal(data);
|
|
|
this.getSpanArr(this.tableData);
|
|
@@ -536,17 +643,18 @@ export default {
|
|
|
computedTotal(data){
|
|
|
data.forEach((item, index) => {
|
|
|
let arr = data.filter(e => {
|
|
|
- return e.batchId == item.batchId && e.noticeTime==item.noticeTime;
|
|
|
+ return e.batchId == item.batchId && e.noticeTime==item.noticeTime && e.unitPriceId==item.unitPriceId;
|
|
|
});
|
|
|
let inspectionFees=arr.reduce((pre, item1) => {
|
|
|
- console.log("parseFloat(item1.inspectionFees).toFixed(2)",parseFloat(item1.inspectionFees).toFixed(2));
|
|
|
if(item1.inspectionFees)
|
|
|
return pre.plus(new BigNumber(item1.inspectionFees));
|
|
|
else
|
|
|
return pre.plus(0.0);
|
|
|
}, new BigNumber(0.0));
|
|
|
console.log("inspectionFees:",inspectionFees.toNumber());
|
|
|
- item.statementTotalAmount=((item.totalEnTonnage-item.previewTonnage)*item.unitPrice-inspectionFees.toNumber()).toFixed(2);
|
|
|
+ if(item.monthMakeTonnage){
|
|
|
+ item.statementTotalAmount=(item.monthMakeTonnage.toFixed(2)*item.unitPrice-inspectionFees.toNumber()).toFixed(2);
|
|
|
+ }
|
|
|
});
|
|
|
},
|
|
|
//根据表格据汇总顶部展示
|
|
@@ -579,16 +687,16 @@ export default {
|
|
|
let startTime = null;
|
|
|
let endTime = null;
|
|
|
let map={con:this.shipName};
|
|
|
- if (this.startTime) {
|
|
|
- startTime = sjTime(this.startTime);
|
|
|
- }
|
|
|
- if (this.endTime) {
|
|
|
- endTime = sjTime(this.endTime);
|
|
|
- }
|
|
|
- if(startTime && endTime && startTime < endTime){
|
|
|
- map.startTime=startTime;
|
|
|
- map.endTime=endTime;
|
|
|
- }
|
|
|
+ // if (this.startTime) {
|
|
|
+ // startTime = sjTime(this.startTime);
|
|
|
+ // }
|
|
|
+ // if (this.endTime) {
|
|
|
+ // endTime = sjTime(this.endTime);
|
|
|
+ // }
|
|
|
+ // if(startTime && endTime && startTime < endTime){
|
|
|
+ // map.startTime=startTime;
|
|
|
+ // map.endTime=endTime;
|
|
|
+ // }
|
|
|
this.axios.post("/api/v1/bms/getShipFeeStatement",map).then(res => {
|
|
|
console.log(res.data.data);
|
|
|
this.tableData = res.data.data;
|
|
@@ -627,7 +735,7 @@ export default {
|
|
|
this.pos = 0;
|
|
|
} else {
|
|
|
// 判断当前元素与上一个元素是否相同
|
|
|
- if (data[i].batchId === data[i - 1].batchId) {
|
|
|
+ if (data[i].batchId === data[i - 1].batchId && data[i].unitPriceId==data[i-1].unitPriceId) {
|
|
|
this.spanArr[this.pos] += 1;
|
|
|
data[i].group = data[i - 1].group;
|
|
|
this.spanArr.push(0);
|
|
@@ -722,7 +830,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
- //this.getNoDetailsStament();
|
|
|
+ this.getNoDetailsStament();
|
|
|
this.getDetailsStamented();
|
|
|
}
|
|
|
};
|
|
@@ -731,11 +839,10 @@ export default {
|
|
|
#detailsStatement {
|
|
|
.top {
|
|
|
margin-left: 10px;
|
|
|
- margin-top: 30px;
|
|
|
+ margin-top: 10px;
|
|
|
}
|
|
|
.main {
|
|
|
margin-left: 10px;
|
|
|
- margin-top: 30px;
|
|
|
::-webkit-scrollbar {
|
|
|
// width: 20px;
|
|
|
height: 20px;
|