Browse Source

销售订单

master
Zhao Qiqi 3 years ago
parent
commit
611da58a65
  1. 103
      anrui-buscenter/anrui-buscenter-ui/src/views/xiaoshouguanli/xiaoshoudingdan/xiaoshoudingdan.vue
  2. 223
      anrui-buscenter/anrui-buscenter-ui/src/views/xiaoshouguanli/xiaoshoudingdan/xiaoshoudingdanAdd.vue
  3. 9
      anrui-buscenter/anrui-buscenter-ui/src/views/xiaoshouguanli/xiaoshoudingdan/xiaoshoudingdanInfo.vue
  4. 2
      anrui-buscenter/anrui-buscenter-ui/src/views/xiaoshouguanli/xiaoshoudingdan/xiaoshoudingdanSubmit.vue

103
anrui-buscenter/anrui-buscenter-ui/src/views/xiaoshouguanli/xiaoshoudingdan/xiaoshoudingdan.vue

@ -70,10 +70,7 @@
:disabled="scope.row.nodeState == '待提交' ? false : scope.row.nodeState == '' ? false : true"
@click="changeNodeState(scope.row)">办理
</el-button>
<el-button size="small" type="primary"
:disabled="scope.row.nodeState == '' ? false : true"
@click="handleCheck(scope.row)">查看
</el-button>
<el-button size="small" type="primary" @click="handleCheck(scope.row)">查看</el-button>
<!-- <el-button size="small" type="primary" @click="printContract(scope.row)">打印合同</el-button>-->
</div>
</template>
@ -152,10 +149,10 @@
</template>
<script>
import { delBySids, dictType, getListOrg, getListPage } from '@/api/salesManagement/orderManagement'
import { submitSales, updateSales } from '@/api/portal/workFlow'
import { loginDetails } from '@/api/dictcommons/basemanufacturer'
import { getStorage } from '@/utils/auth'
import {delBySids, dictType, getListOrg, getListPage} from '@/api/salesManagement/orderManagement'
import {submitSales, updateSales} from '@/api/portal/workFlow'
import {loginDetails} from '@/api/dictcommons/basemanufacturer'
import {getStorage} from '@/utils/auth'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import divAdd from './xiaoshoudingdanAdd.vue'
@ -208,12 +205,13 @@ export default {
current: 1,
size: 20,
params: {
customerName: '',
modelName: '',
orgName: '',
payType: '',
saleType: '',
staffName: ''
createDateEnd: '', //
createDateStart: '', //
customerName: '', //
modelName: '', //
orgName: '', //
payTypeKey: '',
staffSid: window.sessionStorage.getItem('staffSid'), //sid
}
},
temp: {
@ -245,7 +243,6 @@ export default {
// ------------------
resetState() {
this.visible = true
this.getList()
},
xiaoshouhetong(row) {
console.log('9511', row)
@ -255,7 +252,7 @@ export default {
//
handleCheck(row) {
this.visible = false
this.$refs['dingdanxinxiinfo'].showInfo(row.billNo)
this.$refs['dingdanxinxiinfo'].showInfo(row.sid)
},
//
handleCreate(row) {
@ -412,78 +409,48 @@ export default {
submitSales(this.submitDto).then((response) => {
if (response.code === '200') {
this.updateDto.nodeState = response.data.nodeState
this.$notify({
title: '提示',
message: '添加成功',
type: 'success',
duration: 2000
})
//
this.updateDto.sid = this.sids[0]
updateSales(this.updateDto).then((response) => {
if (response.code === '200') {
this.$notify({
title: '提示',
message: '更新成功',
type: 'success',
duration: 2000
})
this.getList()
} else {
this.$notify({
title: '更新失败',
message: response.msg,
type: 'error'
})
}
})
} else {
this.$notify({
title: '添加失败',
message: response.msg,
this.$message({
showClose: true,
message: '提交失败!',
type: 'error'
})
});
}
})
})
} else if (this.sids.length == 0) {
this.$notify({
title: '您还未选择,请选择数据!!!',
this.$message({
showClose: true,
message: '您还未选择,请选择数据!',
type: 'error'
})
});
} else if (this.sids.length > 1) {
this.$notify({
title: '您选择的数据过多,请选择一条数据编辑!!',
this.$message({
showClose: true,
message: '您选择的数据过多,请选择一条数据编辑!',
type: 'error'
})
});
}
},
// sid
handleDelete() {
if (this.sids.length === 0) {
this.$notify({
title: '提示',
message: '没有选择!!',
type: 'warning',
duration: 2000
})
this.$message({
showClose: true,
message: '请选择数据!',
type: 'error'
});
return
}
delBySids(this.sids.join(',')).then((response) => {
delBySids(this.sids).then((response) => {
if (response.code === '200') {
this.$notify({
title: '提示',
message: '删除成功',
type: 'success',
duration: 2000
})
this.getList()
} else {
this.$notify({
title: '删除失败',
message: response.msg,
this.$message({
showClose: true,
message: '删除失败!',
type: 'error'
})
});
}
})
},

223
anrui-buscenter/anrui-buscenter-ui/src/views/xiaoshouguanli/xiaoshoudingdan/xiaoshoudingdanAdd.vue

@ -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) => {

9
anrui-buscenter/anrui-buscenter-ui/src/views/xiaoshouguanli/xiaoshoudingdan/xiaoshoudingdanInfo.vue

@ -424,8 +424,15 @@
}
},
methods: {
showInfo(billNo) {
showInfo(sid) {
this.relState = '2'
fetchDetailsBySid({
sid: sid,
}).then((response) => {
if (response.success) {
this.temp = response.data
}
})
},
handleReturn() {
this.relState = ''

2
anrui-buscenter/anrui-buscenter-ui/src/views/xiaoshouguanli/xiaoshoudingdan/xiaoshoudingdanSubmit.vue

@ -397,7 +397,7 @@ export default {
this.relState = '3'
},
handleReturn() {
this.$emit('doback')
this.$emit('handleReturn')
}
}
}

Loading…
Cancel
Save