|
@@ -565,7 +565,6 @@
|
|
|
v-model="closePositionList1.transactionPrice"
|
|
|
placeholder
|
|
|
class="deal"
|
|
|
- placeholder="请输入成交价"
|
|
|
@change='transaction'
|
|
|
>
|
|
|
<ws-option
|
|
@@ -585,6 +584,7 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item label="平仓数量(吨)" prop="closingQuantity">
|
|
|
<el-input
|
|
|
+ @input="closingPositionPayable"
|
|
|
v-model="closePositionList1.closingQuantity"
|
|
|
autocomplete="off"
|
|
|
placeholder="请输入平仓数量"
|
|
@@ -593,6 +593,7 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item label="平仓价格(元/吨)" prop="closeRate">
|
|
|
<el-input
|
|
|
+ @input="closingPositionPayable"
|
|
|
v-model="closePositionList1.closeRate"
|
|
|
autocomplete="off"
|
|
|
placeholder="请输入平仓价格"
|
|
@@ -712,7 +713,7 @@
|
|
|
class="deal"
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="基差(元/吨)" :label-width="formLabelWidth">
|
|
|
+ <el-form-item v-if='aduitlist.procurementPlanType=="期货"' label="基差(元/吨)" :label-width="formLabelWidth">
|
|
|
<el-input
|
|
|
v-model="aduitlist.basis"
|
|
|
autocomplete="off"
|
|
@@ -728,7 +729,7 @@
|
|
|
class="deal"
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="卸车费用(元/吨)" :label-width="formLabelWidth">
|
|
|
+ <el-form-item v-if='aduitlist.procurementPlanType=="期货"' label="卸车费用(元/吨)" :label-width="formLabelWidth">
|
|
|
<el-input
|
|
|
v-model="aduitlist.unloadingCharge"
|
|
|
autocomplete="off"
|
|
@@ -1012,6 +1013,7 @@ export default {
|
|
|
transactionRecordList: {},
|
|
|
closePositionList: [],
|
|
|
historyList: [],
|
|
|
+ openPositionTmp:0,
|
|
|
pickerBeginDateBefore: {
|
|
|
disabledDate: (time) => {
|
|
|
return time.getTime() > Date.now()
|
|
@@ -1039,9 +1041,12 @@ export default {
|
|
|
transaction(e){
|
|
|
for (let i = 0; i < this.transactionRecordList1.length; i++) {
|
|
|
if(this.transactionRecordList1[i].key==e){
|
|
|
- if(this.closePositionList1.openPosition>this.transactionRecordList1[i].value){
|
|
|
+ if(this.openPositionTmp>this.transactionRecordList1[i].value){
|
|
|
this.closePositionList1.openPosition=this.transactionRecordList1[i].value
|
|
|
}
|
|
|
+ else{
|
|
|
+ this.closePositionList1.openPosition = this.openPositionTmp
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -1299,14 +1304,19 @@ export default {
|
|
|
},
|
|
|
//计算平仓应付
|
|
|
closingPositionPayable() {
|
|
|
- this.closePositionList1.closingPositionPayable =
|
|
|
- (this.closePositionList1.closeRate -
|
|
|
- this.closePositionList1.transactionPrice -
|
|
|
- this.closePositionList1.closingBasis) *
|
|
|
- this.closePositionList1.closingQuantity
|
|
|
+ if(this.closePositionList1.transactionPrice
|
|
|
+ && this.closePositionList1.closeRate && this.closePositionList1.closingBasis && this.closePositionList1.closingQuantity)
|
|
|
+ {
|
|
|
+ this.closePositionList1.closingPositionPayable =
|
|
|
+ (this.closePositionList1.transactionPrice -
|
|
|
+ this.closePositionList1.closeRate-
|
|
|
+ Math.abs(this.closePositionList1.closingBasis)) *
|
|
|
+ this.closePositionList1.closingQuantity
|
|
|
+ }
|
|
|
},
|
|
|
cloaeposition1(item) {
|
|
|
this.dialogFormVisible2 = true
|
|
|
+ this.openPositionTmp = item.openPosition
|
|
|
this.$set(this.closePositionList1, 'id', item.id)
|
|
|
this.$set(this.closePositionList1, 'openPosition', item.openPosition)
|
|
|
this.$set(
|
|
@@ -1426,6 +1436,7 @@ export default {
|
|
|
this.$set(this.aduitlist, 'totalDeposit', item.customerInfo.totalDeposit)
|
|
|
},
|
|
|
aduitconfirm() {
|
|
|
+ debugger
|
|
|
if (!this.aduitlist.unitPrice) {
|
|
|
this.$message({
|
|
|
message: '单价不能为空!',
|
|
@@ -1475,8 +1486,9 @@ export default {
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
- if (
|
|
|
- (this.aduitlist.basis &&
|
|
|
+ if(this.aduitlist.procurementPlanType != '现货'){
|
|
|
+ if (
|
|
|
+ (!this.aduitlist.basis &&
|
|
|
String(this.aduitlist.basis).indexOf('.') != -1 &&
|
|
|
String(this.aduitlist.basis).length -
|
|
|
(String(this.aduitlist.basis).indexOf('.') + 1) >
|
|
@@ -1491,7 +1503,7 @@ export default {
|
|
|
return
|
|
|
}
|
|
|
if (
|
|
|
- (this.aduitlist.unloadingCharge &&
|
|
|
+ (!this.aduitlist.unloadingCharge &&
|
|
|
String(this.aduitlist.unloadingCharge).indexOf('.') != -1 &&
|
|
|
String(this.aduitlist.unloadingCharge).length -
|
|
|
(String(this.aduitlist.unloadingCharge).indexOf('.') + 1) >
|
|
@@ -1505,14 +1517,15 @@ export default {
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
- this.aduitlist.unloadingCharge = '-' + this.aduitlist.unloadingCharge
|
|
|
- this.aduitlist.basis = '-' + this.aduitlist.basis
|
|
|
+ }
|
|
|
this.aduitlist.procurementPlanType = this.aduitlist.procurementPlanType
|
|
|
if (this.aduitlist.procurementPlanType == '期货') {
|
|
|
this.aduitlist.freezingDeposit = this.aduitlist.transactionsNumber*this.aduitlist.depositRatio
|
|
|
if(this.aduitlist.invoiceFee){
|
|
|
this.aduitlist.invoiceFee=-Math.abs(this.aduitlist.invoiceFee)
|
|
|
}
|
|
|
+ this.aduitlist.unloadingCharge = '-' + this.aduitlist.unloadingCharge
|
|
|
+ this.aduitlist.basis = '-' + this.aduitlist.basis
|
|
|
}
|
|
|
this.dialogFormVisible4 = false
|
|
|
this.$confirm(`审核通过后,将通知客户订单生效,是否确定通过审核?`, {
|