|
|
@ -185,7 +185,7 @@ |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item> |
|
|
|
<el-input v-model="temp.busSalesOrderModel.finalPrice" class="addinputw" clearable |
|
|
|
<el-input oninput="value = value.replace(/[^\d.]/g,'')" v-model.number="temp.busSalesOrderModel.finalPrice" class="addinputw" clearable |
|
|
|
maxlength="125" placeholder="请输入单台成交价"/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
@ -311,7 +311,8 @@ |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item> |
|
|
|
<el-input v-model="temp.busSalesOrderMakeup.topPrice" class="addinputw" clearable |
|
|
|
<el-input oninput="value = value.replace(/[^0-9.]/g, '')" v-model.number="temp.busSalesOrderMakeup.topPrice" class="addinputw" |
|
|
|
clearable |
|
|
|
placeholder="请输入上装价格"/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
@ -387,7 +388,7 @@ |
|
|
|
</el-col> |
|
|
|
<el-col v-show="isXuanzeShow == '3'" :span="4"> |
|
|
|
<el-form-item> |
|
|
|
<el-input v-model="quantity" class="addinputw" |
|
|
|
<el-input oninput="value = value.replace(/[^0-9.]/g, '')" v-model.number="quantity" class="addinputw" |
|
|
|
placeholder="请输入台数" |
|
|
|
clearable/> |
|
|
|
</el-form-item> |
|
|
@ -493,7 +494,8 @@ |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" class="baoxianInput"> |
|
|
|
<el-form-item> |
|
|
|
<el-input v-model="temp.busSalesOrderInsurance.insuranceCarMoney" class="addinputw" |
|
|
|
<el-input oninput="value = value.replace(/[^0-9.]/g, '')" v-model.number="temp.busSalesOrderInsurance.insuranceCarMoney" |
|
|
|
class="addinputw" |
|
|
|
clearable placeholder="请输入单台车保费预估金额"/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
@ -537,7 +539,8 @@ |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item> |
|
|
|
<el-input v-model="temp.busSalesOrderDeposit.deposit" class="addinputw" clearable |
|
|
|
<el-input oninput="value = value.replace(/[^0-9.]/g, '')" v-model.number="temp.busSalesOrderDeposit.deposit" class="addinputw" |
|
|
|
clearable |
|
|
|
placeholder="请输入单台订金"/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
@ -560,11 +563,11 @@ |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="2"> |
|
|
|
<span>需补交定金</span> |
|
|
|
<span>需补交订金</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item> |
|
|
|
<span>{{ temp.busSalesOrderDeposit.makeUpDeposit }}</span> |
|
|
|
<span>{{ NumberMakeUpDeposit() }}</span> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
@ -602,7 +605,8 @@ |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="本次结转金额" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input @blur="handleJiezhuan(scope.row,scope.row.price)" v-model="scope.row.price" |
|
|
|
<el-input oninput="value = value.replace(/[^0-9.]/g, '')" @blur="handleJiezhuan(scope.row,scope.row.price)" |
|
|
|
v-model.number="scope.row.price" |
|
|
|
placeholder="请输入本次结转金额" |
|
|
|
class="addinputw" |
|
|
|
clearable/> |
|
|
@ -621,12 +625,13 @@ |
|
|
|
<span>补充说明</span> |
|
|
|
</div> |
|
|
|
<el-row> |
|
|
|
<el-input v-model="temp.remarks" type="textarea" placeholder="补充说明" class="addinputw"/> |
|
|
|
<el-input v-model="temp.notes" type="textarea" placeholder="补充说明" class="addinputw"/> |
|
|
|
</el-row> |
|
|
|
|
|
|
|
</el-form> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<!-- 打开新增客户 --> |
|
|
|
<el-dialog :visible.sync="customerVisible" title="客户登记-类型" top="13%" width="28%"> |
|
|
|
<el-form :model="customerTypeList"> |
|
|
@ -790,7 +795,8 @@ import { |
|
|
|
getPdfByOrderSid, |
|
|
|
getXianList, |
|
|
|
saveOrderForm, |
|
|
|
selectCount |
|
|
|
selectCount, |
|
|
|
fetchDetailsBySid |
|
|
|
} from '@/api/salesManagement/orderManagement' |
|
|
|
import {getNamesDown,} from '@/api/dictcommons/basemanufacturer' |
|
|
|
import Pagination from '@/components/pagination' |
|
|
@ -1234,28 +1240,21 @@ export default { |
|
|
|
this.relState = '1' |
|
|
|
this.dialogStatus = 'add' |
|
|
|
}, |
|
|
|
showEdit(data) { |
|
|
|
showEdit(sid) { |
|
|
|
this.relState = '1' |
|
|
|
this.dialogStatus = 'edit' |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs['dataForm'].clearValidate() |
|
|
|
this.resetTemp() |
|
|
|
}) |
|
|
|
// this.getpayTypeList() |
|
|
|
// this.getManufacturerList() |
|
|
|
this.getCustomerInfo() |
|
|
|
getOneOrder({ |
|
|
|
busOrderSid: data, |
|
|
|
fetchDetailsBySid({ |
|
|
|
sid: sid, |
|
|
|
}).then((response) => { |
|
|
|
if (response.code === '200') { |
|
|
|
// this.$refs['dataForm'].clearValidate() |
|
|
|
this.nodeState = response.data.busOrderDto.nodeState |
|
|
|
this.getBrand(response.data.modelDto.manufacturerSid) |
|
|
|
this.getCarModel(response.data.modelDto.brandSid) |
|
|
|
if (response.success) { |
|
|
|
this.temp = response.data |
|
|
|
this.orderSid = data |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
// ---------------- 计算属性 ---------------- |
|
|
|
// 单台指导价 |
|
|
@ -1296,16 +1295,29 @@ export default { |
|
|
|
}, |
|
|
|
// 台数 |
|
|
|
NumberMulThree() { |
|
|
|
const taishu = [] |
|
|
|
this.temp.busSalesVehicleOrderList.forEach((element) => { |
|
|
|
taishu.push(element.usingNum) |
|
|
|
}) |
|
|
|
if (taishu.length > 0) { |
|
|
|
this.temp.busSalesOrderPrice.quantity = taishu.reduce(this.getSum); |
|
|
|
} else { |
|
|
|
this.temp.busSalesOrderPrice.quantity = 0 |
|
|
|
return this.temp.busSalesOrderPrice.quantity |
|
|
|
// 选择现车时 |
|
|
|
if (this.isXuanzeShow == '1') { |
|
|
|
if (this.temp.busSalesOrderVehicleList.length > 0) { |
|
|
|
this.temp.busSalesOrderPrice.quantity = this.temp.busSalesOrderVehicleList.length |
|
|
|
return this.temp.busSalesOrderPrice.quantity.toString() |
|
|
|
} |
|
|
|
} |
|
|
|
// 选择采购订单时 |
|
|
|
if (this.isXuanzeShow == '2') { |
|
|
|
if (this.temp.busSalesVehicleOrderList.length > 0) { |
|
|
|
const taishu = [] |
|
|
|
this.temp.busSalesVehicleOrderList.forEach((element) => { |
|
|
|
taishu.push(element.usingNum) |
|
|
|
}) |
|
|
|
if (taishu.length > 0) { |
|
|
|
this.temp.busSalesOrderPrice.quantity = taishu.reduce(this.getSum); |
|
|
|
} else { |
|
|
|
this.temp.busSalesOrderPrice.quantity = 0 |
|
|
|
return this.temp.busSalesOrderPrice.quantity |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
// 车架合计 |
|
|
|
NumberMulFour() { |
|
|
@ -1336,8 +1348,8 @@ export default { |
|
|
|
const value = Number(chejia1.replace(',', '')) * Number(chejia2.replace(',', '')) |
|
|
|
this.temp.busSalesOrderPrice.priceSum = value.toString() |
|
|
|
console.log('33333', value) |
|
|
|
if (this.temp.busSalesOrderPrice.priceSum == 0) { |
|
|
|
this.temp.busSalesOrderPrice.priceSum = 0 |
|
|
|
if (this.temp.busSalesOrderPrice.priceSum == '0') { |
|
|
|
this.temp.busSalesOrderPrice.priceSum = '0' |
|
|
|
return this.temp.busSalesOrderPrice.priceSum |
|
|
|
} |
|
|
|
return this.temp.busSalesOrderPrice.priceSum |
|
|
@ -1349,22 +1361,39 @@ export default { |
|
|
|
return 0 |
|
|
|
} |
|
|
|
// 台数 |
|
|
|
if (this.temp.busSalesOrderPrice.quantity == '') { |
|
|
|
if (this.temp.busSalesOrderPrice.quantity == '' && this.quantity == '') { |
|
|
|
return 0 |
|
|
|
} |
|
|
|
var deposit = 0 |
|
|
|
var quantity = 0 |
|
|
|
deposit = parseFloat(this.temp.busSalesOrderDeposit.deposit) |
|
|
|
quantity = parseFloat(this.temp.busSalesOrderPrice.quantity) |
|
|
|
const s1 = deposit.toString() |
|
|
|
const s2 = quantity.toString() |
|
|
|
const value = Number(s1.replace(',', '')) * Number(s2.replace(',', '')) |
|
|
|
this.temp.busSalesOrderDeposit.depositAll = value.toString() |
|
|
|
if (this.temp.busSalesOrderDeposit.depositAl == '') { |
|
|
|
this.temp.busSalesOrderDeposit.depositAl = 0 |
|
|
|
return this.temp.busSalesOrderDeposit.depositAl |
|
|
|
if (this.quantity !== '') { |
|
|
|
var deposit = 0 |
|
|
|
var quantity = 0 |
|
|
|
deposit = parseFloat(this.temp.busSalesOrderDeposit.deposit) |
|
|
|
quantity = parseFloat(this.quantity) |
|
|
|
const s1 = deposit.toString() |
|
|
|
const s2 = quantity.toString() |
|
|
|
const value = Number(s1.replace(',', '')) * Number(s2.replace(',', '')) |
|
|
|
this.temp.busSalesOrderDeposit.depositAll = value.toString() |
|
|
|
if (this.temp.busSalesOrderDeposit.depositAl == '') { |
|
|
|
this.temp.busSalesOrderDeposit.depositAl = 0 |
|
|
|
return this.temp.busSalesOrderDeposit.depositAl |
|
|
|
} |
|
|
|
return this.temp.busSalesOrderDeposit.depositAll |
|
|
|
} else if (this.temp.busSalesOrderPrice.quantity !== '') { |
|
|
|
var deposit = 0 |
|
|
|
var quantity = 0 |
|
|
|
deposit = parseFloat(this.temp.busSalesOrderDeposit.deposit) |
|
|
|
quantity = parseFloat(this.temp.busSalesOrderPrice.quantity) |
|
|
|
const s1 = deposit.toString() |
|
|
|
const s2 = quantity.toString() |
|
|
|
const value = Number(s1.replace(',', '')) * Number(s2.replace(',', '')) |
|
|
|
this.temp.busSalesOrderDeposit.depositAll = value.toString() |
|
|
|
if (this.temp.busSalesOrderDeposit.depositAl == '') { |
|
|
|
this.temp.busSalesOrderDeposit.depositAl = 0 |
|
|
|
return this.temp.busSalesOrderDeposit.depositAl |
|
|
|
} |
|
|
|
return this.temp.busSalesOrderDeposit.depositAll |
|
|
|
} |
|
|
|
return this.temp.busSalesOrderDeposit.depositAll |
|
|
|
|
|
|
|
}, |
|
|
|
// 主车优惠数量变化 |
|
|
|
handleChangeNum(num, row) { |
|
|
@ -1397,6 +1426,41 @@ export default { |
|
|
|
return usingNum |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
//需补交订金 |
|
|
|
NumberMakeUpDeposit() { |
|
|
|
var depositAll = 0 |
|
|
|
var jiezhuan = 0 |
|
|
|
if (this.temp.busSalesOrderDeposit.depositAll !== '') { |
|
|
|
depositAll = parseFloat(this.temp.busSalesOrderDeposit.depositAll) |
|
|
|
} else { |
|
|
|
depositAll = 0 |
|
|
|
} |
|
|
|
console.log('aaaaaaaa', depositAll) |
|
|
|
if (this.temp.busDepositFictitiousList.length > 0) { |
|
|
|
const jiezhuanAll = [] |
|
|
|
this.temp.busDepositFictitiousList.forEach((element) => { |
|
|
|
jiezhuanAll.push(element.price) |
|
|
|
}) |
|
|
|
console.log('bbbbbbbb020202', jiezhuanAll) |
|
|
|
if (jiezhuanAll[0] == '') { |
|
|
|
jiezhuan = 0 |
|
|
|
} else { |
|
|
|
jiezhuan = parseFloat(jiezhuanAll.reduce(this.getSum)) |
|
|
|
} |
|
|
|
// jiezhuan = parseFloat(this.temp.busSalesOrderMakeup.topPrice) |
|
|
|
} else { |
|
|
|
jiezhuan = 0 |
|
|
|
} |
|
|
|
console.log('bbbbbbbb', jiezhuan) |
|
|
|
const s1 = depositAll.toString() |
|
|
|
const s2 = jiezhuan.toString() |
|
|
|
console.log('cccccccc', s1, s2) |
|
|
|
const value = Number(s1.replace(',', '')) - Number(s2.replace(',', '')) |
|
|
|
this.temp.busSalesOrderDeposit.makeUpDeposit = value.toString() |
|
|
|
return this.temp.busSalesOrderDeposit.makeUpDeposit |
|
|
|
}, |
|
|
|
|
|
|
|
// ---------------- 主功能实现 ---------------- |
|
|
|
// 添加数据 |
|
|
|
handleCreate() { |
|
|
@ -1410,21 +1474,22 @@ export default { |
|
|
|
} else { |
|
|
|
this.temp.isInsurance = '0' |
|
|
|
} |
|
|
|
// 订金交纳方式 |
|
|
|
if (this.temp.busSalesOrderDeposit.depositTypeKey == '01') { |
|
|
|
this.temp.busSalesOrderDeposit.depositType = '现交订金' |
|
|
|
} else { |
|
|
|
this.temp.busSalesOrderDeposit.depositType = '订金结转' |
|
|
|
} |
|
|
|
if (this.isXuanzeShow == '3') { |
|
|
|
this.busSalesOrderPrice.quantity = Number(this.quantity) |
|
|
|
this.temp.busSalesOrderPrice.quantity = Number(this.quantity) |
|
|
|
} else { |
|
|
|
this.busSalesOrderPrice.quantity = Number(this.busSalesOrderPrice.quantity) |
|
|
|
this.temp.busSalesOrderPrice.quantity = Number(this.temp.busSalesOrderPrice.quantity) |
|
|
|
} |
|
|
|
console.log('type', this.isXuanzeShow) |
|
|
|
this.temp.type = this.isXuanzeShow |
|
|
|
const priceList = [] |
|
|
|
this.temp.busSalesOrderDiscountList.forEach((element) => { |
|
|
|
priceList.push(toString(element.totalValue)) |
|
|
|
priceList.push(element.totalValue) |
|
|
|
}) |
|
|
|
this.temp.priceList = priceList |
|
|
|
console.log(this.temp) |
|
|
@ -1436,39 +1501,26 @@ export default { |
|
|
|
this.FormLoading = false |
|
|
|
if (response.code === '200') { |
|
|
|
this.orderSid = response.data |
|
|
|
this.$notify({ |
|
|
|
title: '提示', |
|
|
|
message: '添加成功', |
|
|
|
type: 'success', |
|
|
|
duration: 2000, |
|
|
|
}) |
|
|
|
this.handleReturn('true') |
|
|
|
} else { |
|
|
|
this.$notify({ |
|
|
|
title: '提示', |
|
|
|
message: '添加失败', |
|
|
|
type: 'error', |
|
|
|
duration: 2000, |
|
|
|
}) |
|
|
|
this.$message({ |
|
|
|
showClose: true, |
|
|
|
message: '添加失败!', |
|
|
|
type: 'error' |
|
|
|
}); |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
saveOrderForm(this.temp).then((response) => { |
|
|
|
this.FormLoading = false |
|
|
|
if (response.code === '200') { |
|
|
|
this.$notify({ |
|
|
|
title: '提示', |
|
|
|
message: '修改成功', |
|
|
|
type: 'success', |
|
|
|
duration: 2000, |
|
|
|
}) |
|
|
|
this.handleReturn('true') |
|
|
|
} else { |
|
|
|
this.$notify({ |
|
|
|
title: '失败', |
|
|
|
message: '修改失败', |
|
|
|
type: 'error', |
|
|
|
}) |
|
|
|
this.$message({ |
|
|
|
showClose: true, |
|
|
|
message: '修改失败!', |
|
|
|
type: 'error' |
|
|
|
}); |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
@ -1619,7 +1671,6 @@ export default { |
|
|
|
message: '请选择一个客户!', |
|
|
|
type: 'error' |
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
// 打开现车 |
|
|
@ -1701,7 +1752,11 @@ export default { |
|
|
|
this.xiancheList.params.customerSid = this.temp.customerSid |
|
|
|
this.xiancheList.params.modelConfigSid = this.temp.busSalesOrderModel.modelConfigSid |
|
|
|
this.xiancheList.params.modelSid = this.temp.busSalesOrderModel.modelSid |
|
|
|
this.xiancheList.params.sidList = this.temp.busSalesOrderVehicleList |
|
|
|
const aa = [] |
|
|
|
this.temp.busSalesOrderVehicleList.forEach((element) => { |
|
|
|
aa.push(element.linkSid) |
|
|
|
}) |
|
|
|
this.xiancheList.params.sidList = aa |
|
|
|
getXianList(this.xiancheList).then((response) => { |
|
|
|
this.xiancheLoading = false |
|
|
|
if ( |
|
|
@ -1711,6 +1766,11 @@ export default { |
|
|
|
) { |
|
|
|
this.listXianche = response.data.records |
|
|
|
this.xianchetotal = response.data.total |
|
|
|
if (this.listXianche.isFictitious == '1') { |
|
|
|
this.listXianche.isFictitious = '是' |
|
|
|
} else if (this.listXianche.isFictitious == '0') { |
|
|
|
this.listXianche.isFictitious = '否' |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.listXianche = [] |
|
|
|
this.xianchetotal = 0 |
|
|
@ -1732,7 +1792,11 @@ export default { |
|
|
|
this.caigouLoading = true |
|
|
|
this.caigouList.params.configSid = this.temp.busSalesOrderModel.modelConfigSid |
|
|
|
this.caigouList.params.modelSid = this.temp.busSalesOrderModel.modelSid |
|
|
|
this.caigouList.params.sidList = this.temp.busSalesVehicleOrderList |
|
|
|
const aa = [] |
|
|
|
this.temp.busSalesVehicleOrderList.forEach((element) => { |
|
|
|
aa.push(element.linkSid) |
|
|
|
}) |
|
|
|
this.caigouList.params.sidList = aa |
|
|
|
getXianList(this.caigouList).then((response) => { |
|
|
|
this.caigouLoading = false |
|
|
|
if ( |
|
|
@ -1770,7 +1834,6 @@ export default { |
|
|
|
this.xiancheList.params.sidList = xincheSids |
|
|
|
this.vehicleList = xincheSids |
|
|
|
this.xiancheVisible = false |
|
|
|
console.log('确认选择现车:', this.temp.busSalesOrderVehicleList, this.vehicleList) |
|
|
|
} else { |
|
|
|
this.$message({ |
|
|
|
showClose: true, |
|
|
@ -1812,6 +1875,7 @@ export default { |
|
|
|
this.temp.customerClassKey = row.customerTypeKey |
|
|
|
this.temp.customerPhoto = row.customerPhoto |
|
|
|
this.customerList = row |
|
|
|
console.log('选择客户',this.temp) |
|
|
|
}, |
|
|
|
// 新增客户 |
|
|
|
addCustomer() { |
|
|
@ -1832,6 +1896,8 @@ export default { |
|
|
|
modelName: modelData.modelAlias, //车型名称 |
|
|
|
modelSid: modelData.modelSid, //车型sid |
|
|
|
moreConfig: modelData.otherConfig, //更多配置 |
|
|
|
specialConfig: '', |
|
|
|
finalPrice: '', |
|
|
|
} |
|
|
|
const countList = { |
|
|
|
customerSid: this.temp.customerSid, //客户sid |
|
|
@ -1862,6 +1928,8 @@ export default { |
|
|
|
modelName: modelData.modelAlias, //车型名称 |
|
|
|
modelSid: modelData.modelSid, //车型sid |
|
|
|
moreConfig: modelData.otherConfig, //更多配置 |
|
|
|
specialConfig: '', |
|
|
|
finalPrice: '', |
|
|
|
} |
|
|
|
const countList = { |
|
|
|
customerSid: this.temp.customerSid, //客户sid |
|
|
@ -1892,6 +1960,8 @@ export default { |
|
|
|
modelName: modelData.modelName, //车型名称 |
|
|
|
modelSid: modelData.modelSid, //车型sid |
|
|
|
moreConfig: modelData.moreConfig, //更多配置 |
|
|
|
specialConfig: '', |
|
|
|
finalPrice: '', |
|
|
|
} |
|
|
|
const countList = { |
|
|
|
customerSid: this.temp.customerSid, //客户sid |
|
|
@ -1908,6 +1978,7 @@ export default { |
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
selectYouhui(row) { |
|
|
|
console.log('所选优惠包', row) |
|
|
|
row.forEach((element) => { |
|
|
|