|
@@ -12,43 +12,75 @@
|
|
>浏览</el-button
|
|
>浏览</el-button
|
|
>
|
|
>
|
|
</div>
|
|
</div>
|
|
- <div
|
|
|
|
- class="material"
|
|
|
|
- v-for="(item, index) in form.Array"
|
|
|
|
- :key="index"
|
|
|
|
- style="margin-left:30px"
|
|
|
|
- >
|
|
|
|
- <el-form :inline="true">
|
|
|
|
- <el-form-item label="装船时间">
|
|
|
|
|
|
+ <div class="searchSelect">
|
|
|
|
+ <span class="text">发运港</span>
|
|
|
|
+ <el-input class="input" v-model="form.portName" disabled> </el-input>
|
|
|
|
+ <el-button class="button" type="primary" @click="ondrawer(7)"
|
|
|
|
+ >浏览</el-button
|
|
|
|
+ >
|
|
|
|
+ </div>
|
|
|
|
+ <div class="searchSelect">
|
|
|
|
+ <span class="text">单价</span>
|
|
|
|
+ <el-input class="input" v-model="form.unitPrice" disabled @change="calculate"> </el-input>
|
|
|
|
+ <el-button class="button" type="primary" @click="ondrawer(6)">浏览</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="preview-group">
|
|
|
|
+ <el-form-item label="装船时间">
|
|
<el-input
|
|
<el-input
|
|
- v-model="item.resultLoadShipDate"
|
|
|
|
|
|
+ v-model="form.resultLoadShipDate"
|
|
placeholder="装船时间"
|
|
placeholder="装船时间"
|
|
disabled
|
|
disabled
|
|
></el-input>
|
|
></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="离港时间">
|
|
<el-form-item label="离港时间">
|
|
<el-input
|
|
<el-input
|
|
- v-model="item.resultOutPortTime"
|
|
|
|
|
|
+ v-model="form.resultOutPortTime"
|
|
placeholder="离港时间"
|
|
placeholder="离港时间"
|
|
disabled
|
|
disabled
|
|
></el-input>
|
|
></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="实装吨位">
|
|
|
|
|
|
+ <el-form-item label="吨位">
|
|
<el-input
|
|
<el-input
|
|
- v-model="item.resultActualInstallations"
|
|
|
|
- placeholder="实装吨位"
|
|
|
|
|
|
+ v-model="form.realTonnage"
|
|
|
|
+ placeholder="吨位"
|
|
disabled
|
|
disabled
|
|
></el-input>
|
|
></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="水运费用">
|
|
<el-form-item label="水运费用">
|
|
- <el-input v-model="item.fee" type="number" disabled></el-input>
|
|
|
|
- <el-button type="primary" @click="ondrawer(6, index)"
|
|
|
|
- >浏览单价</el-button
|
|
|
|
- >
|
|
|
|
|
|
+ <el-input v-model="form.fee" type="number" disabled></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="预开吨位">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="form.previewTonnage"
|
|
|
|
+ placeholder="预开吨位"
|
|
|
|
+ @change="calculate"
|
|
|
|
+ ></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="预开金额">
|
|
|
|
+ <el-input v-model="form.previewFee" type="number" disabled></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="装船含水吨位">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="form.loadWater"
|
|
|
|
+ placeholder="装船含水吨位"
|
|
|
|
+ ></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="进厂含水吨位">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="form.enFacotoryWater"
|
|
|
|
+ placeholder="进厂含水吨位"
|
|
|
|
+ ></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="开票吨位">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="form.makeTonnage"
|
|
|
|
+ placeholder="开票吨位"
|
|
|
|
+ @change="calculate"
|
|
|
|
+ ></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="开票金额">
|
|
|
|
+ <el-input v-model="form.makeFee" type="number"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- </el-form>
|
|
|
|
- </div>
|
|
|
|
- <div class="preview-group">
|
|
|
|
<el-form-item label="开票日期">
|
|
<el-form-item label="开票日期">
|
|
<el-date-picker
|
|
<el-date-picker
|
|
v-model="form.makeTime"
|
|
v-model="form.makeTime"
|
|
@@ -132,6 +164,12 @@
|
|
@radio-change="priceChange"
|
|
@radio-change="priceChange"
|
|
></dilTable>
|
|
></dilTable>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div v-show="a == 7">
|
|
|
|
+ <dilTable
|
|
|
|
+ v-bind.sync="loadShipOption"
|
|
|
|
+ @radio-change="loadShipChange"
|
|
|
|
+ ></dilTable>
|
|
|
|
+ </div>
|
|
</el-drawer>
|
|
</el-drawer>
|
|
<!-- 底部按钮 -->
|
|
<!-- 底部按钮 -->
|
|
<div class="button-box">
|
|
<div class="button-box">
|
|
@@ -157,6 +195,8 @@ export default {
|
|
portId: null,
|
|
portId: null,
|
|
ports: [],
|
|
ports: [],
|
|
isLoading: false,
|
|
isLoading: false,
|
|
|
|
+ loadShips:null,
|
|
|
|
+ totalResultId:null,
|
|
drawer: false,
|
|
drawer: false,
|
|
direction: "rtl",
|
|
direction: "rtl",
|
|
a: 0,
|
|
a: 0,
|
|
@@ -165,6 +205,9 @@ export default {
|
|
purchaseOrderId: null,
|
|
purchaseOrderId: null,
|
|
batchName: null,
|
|
batchName: null,
|
|
cargoPictureUrl: "",
|
|
cargoPictureUrl: "",
|
|
|
|
+ resultLoadShipDate:null,
|
|
|
|
+ resultOutDate:null,
|
|
|
|
+ resultActualInstallations:null,
|
|
batchOption: {
|
|
batchOption: {
|
|
requestUrl: "/api/v1/uc/findBatchHavingLoad?apiId=502",
|
|
requestUrl: "/api/v1/uc/findBatchHavingLoad?apiId=502",
|
|
selectionType: "radio",
|
|
selectionType: "radio",
|
|
@@ -174,6 +217,11 @@ export default {
|
|
requestUrl: "/api/v1/rms/selectbmsshipContractPriceList?apiId=500",
|
|
requestUrl: "/api/v1/rms/selectbmsshipContractPriceList?apiId=500",
|
|
selectionType: "radio",
|
|
selectionType: "radio",
|
|
map: []
|
|
map: []
|
|
|
|
+ },
|
|
|
|
+ loadShipOption: {
|
|
|
|
+ requestUrl: "/api/v1/bms/findLoadByBatch?apiId=505",
|
|
|
|
+ selectionType: "radio",
|
|
|
|
+ map: []
|
|
}
|
|
}
|
|
};
|
|
};
|
|
},
|
|
},
|
|
@@ -194,13 +242,8 @@ export default {
|
|
methods: {
|
|
methods: {
|
|
findLoadByBatch() {
|
|
findLoadByBatch() {
|
|
if (this.batchId != null) {
|
|
if (this.batchId != null) {
|
|
- this.axios
|
|
|
|
- .post("/api/v1/bms/findLoadByBatch/" + this.batchId)
|
|
|
|
- .then(res => {
|
|
|
|
- console.log(res.data.data);
|
|
|
|
- this.$set(this.form, "Array", res.data.data);
|
|
|
|
- // this.form.Array = res.data.data;
|
|
|
|
- });
|
|
|
|
|
|
+ this.loadShipOption.requestUrl="/api/v1/bms/findLoadByBatch?apiId=505&batchId="+this.batchId+
|
|
|
|
+ "&i="+new Date();
|
|
}
|
|
}
|
|
},
|
|
},
|
|
//右侧选中框
|
|
//右侧选中框
|
|
@@ -238,7 +281,8 @@ export default {
|
|
},
|
|
},
|
|
//修改选中
|
|
//修改选中
|
|
batchChange(selection) {
|
|
batchChange(selection) {
|
|
- console.log(JSON.stringify(selection).length);
|
|
|
|
|
|
+ console.log("SELECTION:",selection);
|
|
|
|
+ this.totalResultId=selection.totalResultId;
|
|
if (JSON.stringify(selection).length > 2) {
|
|
if (JSON.stringify(selection).length > 2) {
|
|
this.batchId = selection.batchId;
|
|
this.batchId = selection.batchId;
|
|
this.purchaseOrderId = selection.purchaseOrderId;
|
|
this.purchaseOrderId = selection.purchaseOrderId;
|
|
@@ -257,58 +301,85 @@ export default {
|
|
// this.form.unitPrice = selection.unitPrice;
|
|
// this.form.unitPrice = selection.unitPrice;
|
|
this.calculate();
|
|
this.calculate();
|
|
},
|
|
},
|
|
|
|
+ loadShipChange(selection){
|
|
|
|
+ console.log(selection);
|
|
|
|
+ this.form=selection;
|
|
|
|
+ this.calculate();
|
|
|
|
+ },
|
|
//计算水运费
|
|
//计算水运费
|
|
calculate() {
|
|
calculate() {
|
|
- if (
|
|
|
|
- this.form.Array[this.indexNum].resultActualInstallations &&
|
|
|
|
- this.form.Array[this.indexNum].unitPrice
|
|
|
|
- ) {
|
|
|
|
|
|
+ if (this.form.realTonnage &&this.form.unitPrice) {
|
|
let fee = new BigNumber(
|
|
let fee = new BigNumber(
|
|
- this.form.Array[this.indexNum].resultActualInstallations
|
|
|
|
|
|
+ this.form.realTonnage
|
|
);
|
|
);
|
|
this.$set(
|
|
this.$set(
|
|
- this.form.Array[this.indexNum],
|
|
|
|
|
|
+ this.form,
|
|
"fee",
|
|
"fee",
|
|
- fee.multipliedBy(this.form.Array[this.indexNum].unitPrice).toNumber()
|
|
|
|
|
|
+ fee.multipliedBy(this.form.unitPrice).toNumber()
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+ if (this.form.previewTonnage &&this.form.unitPrice) {
|
|
|
|
+ let previewFee = new BigNumber(
|
|
|
|
+ this.form.previewTonnage
|
|
|
|
+ );
|
|
|
|
+ this.$set(
|
|
|
|
+ this.form,
|
|
|
|
+ "previewFee",
|
|
|
|
+ previewFee.multipliedBy(this.form.unitPrice).toNumber()
|
|
);
|
|
);
|
|
}
|
|
}
|
|
|
|
+ if(this.form.makeTonnage &&this.form.unitPrice){
|
|
|
|
+ let makeFee = new BigNumber(
|
|
|
|
+ this.form.makeTonnage
|
|
|
|
+ );
|
|
|
|
+ this.$set(
|
|
|
|
+ this.form,
|
|
|
|
+ "makeFee",
|
|
|
|
+ makeFee.multipliedBy(this.form.unitPrice).toNumber()
|
|
|
|
+ );
|
|
|
|
+ }
|
|
},
|
|
},
|
|
makeSure() {
|
|
makeSure() {
|
|
- let totalFee = this.form.Array.reduce(function(prev, item) {
|
|
|
|
- return prev + item.fee;
|
|
|
|
- }, 0);
|
|
|
|
- let realTonnage = this.form.Array.reduce(function(prev, item) {
|
|
|
|
- return prev + item.resultActualInstallations;
|
|
|
|
- }, 0);
|
|
|
|
this.isLoading=true;
|
|
this.isLoading=true;
|
|
let map = {
|
|
let map = {
|
|
- batchId: this.batchId,
|
|
|
|
|
|
+ batchId: this.form.batchId,
|
|
purchaseOrderId: this.purchaseOrderId,
|
|
purchaseOrderId: this.purchaseOrderId,
|
|
unitPrice: this.form.unitPrice,
|
|
unitPrice: this.form.unitPrice,
|
|
unitPriceId: this.form.unitPriceId,
|
|
unitPriceId: this.form.unitPriceId,
|
|
- realTonnage: realTonnage,
|
|
|
|
- mapList: this.form.Array,
|
|
|
|
- fee: totalFee,
|
|
|
|
|
|
+ realTonnage: this.form.realTonnage,
|
|
|
|
+ fee: this.form.fee,
|
|
|
|
+ previewTonnage:this.form.previewTonnage,
|
|
|
|
+ previewFee:this.form.previewFee,
|
|
makeTime: sjTime(this.form.makeTime),
|
|
makeTime: sjTime(this.form.makeTime),
|
|
image: this.form.image,
|
|
image: this.form.image,
|
|
|
|
+ loadWater:this.form.loadWater,
|
|
|
|
+ enFacotoryWater:this.form.enFacotoryWater,
|
|
|
|
+ makeTonnage:this.form.makeTonnage,
|
|
|
|
+ makeFee:this.form.makeFee,
|
|
|
|
+ totalResultId:this.form.totalResultId,
|
|
feeType: 3,
|
|
feeType: 3,
|
|
|
|
+ portId:this.form.portId,
|
|
userId: getCookie("userId")
|
|
userId: getCookie("userId")
|
|
};
|
|
};
|
|
console.log(map);
|
|
console.log(map);
|
|
- // if (
|
|
|
|
- // map.batchId == null ||
|
|
|
|
- // map.purchaseOrderId == null ||
|
|
|
|
- // map.unitPrice == null ||
|
|
|
|
- // map.unitPriceId == null ||
|
|
|
|
- // map.realTonnage == null ||
|
|
|
|
- // map.fee == null ||
|
|
|
|
- // map.makeTime == null ||
|
|
|
|
- // map.image == null ||
|
|
|
|
- // map.image == ""
|
|
|
|
- // ) {
|
|
|
|
- // this.$message.error("存在空值!");
|
|
|
|
- // this.isLoading = false;
|
|
|
|
- // } else {
|
|
|
|
|
|
+ if (
|
|
|
|
+ !map.batchId ||
|
|
|
|
+ !map.purchaseOrderId ||
|
|
|
|
+ !map.unitPrice ||
|
|
|
|
+ !map.unitPriceId ||
|
|
|
|
+ !map.realTonnage ||
|
|
|
|
+ !map.fee ||
|
|
|
|
+ !map.makeTime ||
|
|
|
|
+ !map.loadWater ||
|
|
|
|
+ !map.enFacotoryWater ||
|
|
|
|
+ !map.makeTonnage ||
|
|
|
|
+ !map.makeFee ||
|
|
|
|
+ !map.previewFee ||
|
|
|
|
+ !map.previewTonnage
|
|
|
|
+ ) {
|
|
|
|
+ this.$message.error("存在空值!");
|
|
|
|
+ this.isLoading = false;
|
|
|
|
+ } else {
|
|
this.axios
|
|
this.axios
|
|
.post("/api/v1/bms/addPortHandlingFeeSecond", map)
|
|
.post("/api/v1/bms/addPortHandlingFeeSecond", map)
|
|
.then(res => {
|
|
.then(res => {
|
|
@@ -325,7 +396,7 @@ export default {
|
|
.then(() => {
|
|
.then(() => {
|
|
this.isLoading = false;
|
|
this.isLoading = false;
|
|
});
|
|
});
|
|
- // }
|
|
|
|
|
|
+ }
|
|
},
|
|
},
|
|
// 取消
|
|
// 取消
|
|
cancel() {
|
|
cancel() {
|