代办编辑

This commit is contained in:
yerz
2021-10-29 22:54:34 +08:00
parent a3098e2577
commit f25a361f9a
5 changed files with 283 additions and 115 deletions
+214 -66
View File
@@ -41,8 +41,6 @@ Page({
colorArray:[],//车型颜色列表
levelArray:[],//车型级别列表
interiorArray:[],//内饰颜色
packArray:[],//代办包
packIndex:-1,//代办包索引
colorIndex:-1,//车型颜色索引
levelIndex:-1,//车型级别索引
interiorIndex:-1,//内饰颜色索引
@@ -50,7 +48,6 @@ Page({
financeIndex:-1,//金融机构索引
priceinfo:'',//车辆价格
delry_time:'',//期望交付时间
inten_money:'',//意向金
submitFlag:false,
paymentIndex:-1,//付款方式
@@ -62,9 +59,16 @@ Page({
isShowcheck:false,//是否显示预览核对弹框
checkCount: 2,
checktext: '3s',
isShowRemarks:false,//意向金备注
disc_money:'',//优惠金额
srv_total:0,//代办费用
srv_ids:[],//代办选择数组
agencyList:[],//代办数组
fine_total:0,//精品费用
fine_ids:[],//精品选择数组
fineList:[],//精品数组
},
//生命周期函数--监听页面加载
onLoad: function (options) {
@@ -89,6 +93,7 @@ Page({
this.setData({
info:res.data,
delry_time:res.data.delry_time?res.data.delry_time:'',
disc_money:res.data.disc_money?res.data.disc_money:'',
})
/*匹配车辆信息*/
@@ -267,30 +272,71 @@ Page({
});
}
//匹配代办
if(!!res.data.pack_id){
let packparams = {};
packparams['type'] = res.data.payway;
packparams['page'] = 1;
packparams['size'] = 100;
_.apiQuery.getAppServicesPackage(packparams).then(res7 => {
if(res7.data.list.length>0){
let packArray = []
res7.data.list.forEach((item,index) => {
if(item.id == res.data.pack_id){
this.setData({
packIndex:index,
})
//匹配代办
if(res.data.srv_ids.length>0){
let agencyparams = {};
agencyparams['payway'] = res.data.payway;
agencyparams['cus_id'] = res.data.cus_id;
agencyparams['car_id'] = res.data.car_id;
agencyparams['v_id'] = res.data.v_id;
agencyparams['page'] = 1;
agencyparams['size'] = 100;
_.apiQuery.getAppServices(agencyparams).then(res7 => {
let agencyList =res7.data.list
let values = res.data.srv_ids
let srv_total = 0
agencyList.forEach(item1 => {
item1.checked = false
values.forEach(item2 => {
if(item1.id == item2){
item1.checked = true
srv_total = srv_total + parseFloat(item1.price)
}
packArray.push(item.title)
})
this.setData({
pack_id:res.data.pack_id,
packArray:packArray,
packList:res7.data.list,
})
}
})
this.setData({
srv_ids:res.data.srv_ids,
agencyList,
srv_total,
})
});
}else{
this.getAppServices()
}
//匹配精品
if(res.data.fine_ids.length>0){
let fineparams = {};
fineparams['car_id'] = this.data.car_id;
_.apiQuery.getAppFine(fineparams).then(res8 => {
let fineList =res8.data.list
let values = res.data.srv_ids
let fine_total = 0
fineList.forEach(item1 => {
item1.checked = false
values.forEach(item2 => {
if(item1.id == item2){
item1.checked = true
fine_total = fine_total + parseFloat(item1.price)
}
})
})
this.setData({
fine_ids:res.data.fine_ids,
fineList,
fine_total,
})
});
}else{
this.getAppFine()
}
/*end匹配其他信息*/
@@ -379,9 +425,9 @@ Page({
icon: 'none'
})
}
else if(this.data.packIndex == -1 ){
else if(this.data.srv_ids.length == 0 && this.data.userInfo.biz_type != 3){
wx.showToast({
title: '请选择代办',
title: '请选择代办内容',
icon: 'none'
})
}
@@ -543,27 +589,6 @@ Page({
});
},
//获取代办包
getAppServicesPackage(){
let params = {};
params['page'] = 1;
params['type'] = this.data.paymentIndex==0?'1':'0';
params['size'] = 100;
_.apiQuery.getAppServicesPackage(params).then(res => {
if(res.data.list.length>0){
let packArray = []
res.data.list.forEach(item => {
packArray.push(item.title)
})
this.setData({
packArray:packArray,
packList:res.data.list,
packIndex:-1,
})
}
});
},
//选择品牌
changeBrand(e) {
if(this.data.brandIndex != e.detail.value && e.detail.value >= 0){
@@ -627,6 +652,8 @@ Page({
priceinfo:'',
})
this.getAppSeriesAttrscolor()
//代办列表
this.getAppServices()
}
},
@@ -656,25 +683,12 @@ Page({
}
},
//代办包
changePack(e) {
let pack_id = ''
if(e.detail.value >= 0){
pack_id = this.data.packList[e.detail.value].id
}
this.setData({
pack_id:pack_id,
packIndex:e.detail.value,
})
},
//付款方式
changePayment(e) {
if(this.data.paymentIndex != e.detail.value && e.detail.value >= 0){
this.setData({
paymentIndex:e.detail.value,
})
this.getAppServicesPackage()
if(e.detail.value==1){
this.getAppFinance()
}else{
@@ -685,6 +699,8 @@ Page({
financeIndex:-1,
})
}
//代办列表
this.getAppServices()
}
},
@@ -718,14 +734,50 @@ Page({
params['color_id'] = this.data.color_id;
params['incolor_id'] = this.data.incolor_id;
_.apiQuery.getAppSeriesInfo(params).then(res => {
let fineList = this.data.fineList
fineList.forEach(item => {
item.checked = false
})
this.setData({
inten_money:'',
priceinfo:res.data,
disc_money:'',
fineList:fineList,
fine_ids:[],
fine_total:0,
})
});
}
},
//获取代办服务列表
getAppServices(){
if(this.data.paymentIndex != -1&&this.data.customerIndex != -1&&this.data.car_id != ''&&this.data.v_id != ''){
let params = {};
params['payway'] = this.data.paymentIndex==0?'1':'0';
params['cus_id'] = this.data.info.cus_id;
params['car_id'] = this.data.car_id;
params['v_id'] = this.data.v_id;
params['page'] = 1;
params['size'] = 100;
_.apiQuery.getAppServices(params).then(res => {
this.setData({
agencyList:res.data.list,
})
});
}
},
//获取精品赠送列表
getAppFine(){
let params = {};
params['car_id'] = this.data.car_id;
_.apiQuery.getAppFine(params).then(res => {
this.setData({
fineList:res.data.list,
})
});
},
//建卡时间
delryTime(e){
this.setData({
@@ -769,14 +821,19 @@ Page({
params['price'] = that.data.priceinfo.price;
params['deposit'] = that.data.priceinfo.deposit;
params['payway'] = that.data.paymentIndex==0?'1':'0';
params['pack_id'] = that.data.pack_id;
params['delry_time'] = that.data.delry_time;
if(that.data.finance_id!= ''){
params['finance_id'] = that.data.finance_id;
}
// if(that.data.inten_money != ''){
// params['inten_money'] = that.data.inten_money;
// }
if(!!this.data.disc_money && this.data.disc_money != '' ){
params['disc_money'] = this.data.disc_money;
}
if(this.data.srv_ids.length>0){
params['srv_ids'] = this.data.srv_ids;
}
if(this.data.fine_ids.length>0){
params['fine_ids'] = this.data.fine_ids;
}
_.apiQuery.putAppCusorder2(params).then(res => {
//刷新列表页
@@ -865,4 +922,95 @@ Page({
})
},
//代办相关
changeAgency(e) {
let agencyList = this.data.agencyList
let values = e.detail.value
let srv_total = 0
agencyList.forEach(item1 => {
item1.checked = false
values.forEach(item2 => {
if(item1.id == item2){
item1.checked = true
srv_total = srv_total + parseFloat(item1.price)
}
})
})
this.setData({
srv_ids:e.detail.value,
agencyList,
srv_total,
})
},
//精品相关
changeFine(e) {
//判断是否选中
if(this.data.fineList[e.currentTarget.dataset.index].checked){
let fine_ids = this.data.fine_ids
let idsindex = fine_ids.indexOf(this.data.fineList[e.currentTarget.dataset.index].id);
fine_ids.splice(idsindex, 1)
this.setData({
['fineList['+e.currentTarget.dataset.index+'].checked']:false,
fine_ids,
})
let fine_total = 0
this.data.fineList.forEach(item => {
if(item.checked == true){
fine_total = fine_total + parseFloat(item.price)
}
})
this.setData({
fine_total,
})
}else{
//判断是否超过最大可优惠价格
if(parseFloat(this.data.disc_money!=''?this.data.disc_money:'0')+this.data.fine_total+parseFloat(this.data.fineList[e.currentTarget.dataset.index].price)>parseFloat(this.data.priceinfo.dis_money)){
wx.showToast({
title: '已超过最大可优惠价格',
icon: 'none'
})
this.setData({
['fineList['+e.currentTarget.dataset.index+'].checked']:false,
})
}else{
let fine_ids = this.data.fine_ids
fine_ids.push(this.data.fineList[e.currentTarget.dataset.index].id)
this.setData({
['fineList['+e.currentTarget.dataset.index+'].checked']:true,
fine_ids,
})
let fine_total = 0
this.data.fineList.forEach(item => {
if(item.checked == true){
fine_total = fine_total + parseFloat(item.price)
}
})
this.setData({
fine_total,
})
}
}
},
//输入车身优惠
inputDisc(e) {
if(parseFloat(e.detail.value)+this.data.fine_total>parseFloat(this.data.priceinfo.dis_money)){
wx.showToast({
title: '已超过最大可优惠价格',
icon: 'none'
})
this.setData({
[e.currentTarget.dataset.key]: ''
})
}else{
this.setData({
[e.currentTarget.dataset.key]: e.detail.value?parseFloat(e.detail.value):'',
})
}
},
})
+1 -1
View File
@@ -1,4 +1,4 @@
{
"navigationBarTitleText": "订单登记",
"navigationBarTitleText": "编辑订单",
"usingComponents": {}
}
+61 -28
View File
@@ -75,13 +75,6 @@
</view>
</view>
<view class="pt30 pb30 text-right font-24 color-666" wx:if="{{info.inten_money}}">已缴意向金<text class="pl5 pr5 color-f9394d">{{info.inten_money}}</text>元</view>
<!-- <view class="relative bbs-1-eb last-b-none pl320 font-28" wx:if="{{priceinfo.price}}">
<view class="absolute left-0 box-middle" bindtap="optShowRemarks">意向金(非必填)<i class="iconfont icon-shuoming font-30"></i></view>
<view class="relative pr40">
<input class="wp100 height-100 text-right font-28" placeholder-class="color-ccc" type="text" placeholder="意向金不超过定金" bindinput='inputTx' data-key="inten_money" name='inten_money' value='{{inten_money}}' />
<view class="absolute right-0 box-middle font-28 color-666">元</view>
</view>
</view> -->
</view>
<view wx:if="{{step == 3}}">
@@ -105,16 +98,6 @@
</picker>
</view>
</view>
<view class="relative bbs-1-eb pl190 last-b-none" wx:if="{{packArray.length>0}}">
<view class="absolute left-0 box-middle font-28 color-333">代办包<text class="color-f9394d">*</text></view>
<view class="pt30 pb30 text-right font-28 color-666">
<picker bindchange="changePack" value="{{packIndex}}" range="{{packArray}}">
<text class="color-ccc" wx:if="{{packIndex == -1}}">请选择</text>
<text wx:else>{{packArray[packIndex]}}</text>
<i class="iconfont ml5 icon-gengduo"></i>
</picker>
</view>
</view>
<view class="relative bbs-1-eb last-b-none pl180 font-28">
<view class="absolute left-0 box-middle">期望交付时间<text class="color-f9394d">*</text></view>
<view class="pt30 pb30 text-right font-28 color-666">
@@ -125,6 +108,47 @@
</picker>
</view>
</view>
<view class="relative bbs-1-eb last-b-none pl180 font-28" wx:if="{{priceinfo.dis_money}}">
<view class="absolute left-0 box-middle">车身优惠</view>
<view class="relative pr40">
<input class="wp100 height-100 text-right font-28" placeholder-class="color-ccc" type="text" placeholder="请输入车身优惠金额" bindinput='inputDisc' data-key="disc_money" name='disc_money' value="{{disc_money}}" />
<view class="absolute right-0 box-middle font-28 color-666">元</view>
</view>
</view>
<view class="bbs-1-eb last-b-none">
<view class="relative pl190">
<view class="absolute left-0 box-middle font-28 color-333">代办相关<text class="color-f9394d" wx:if="{{userInfo.biz_type != 3}}">*</text></view>
<view class="pt30 pb30 text-right font-28 color-666">
当前代办费用:<text class="color-f9394d">{{srv_total}}</text>元
</view>
</view>
<view class="pb10 fn-clear">
<checkbox-group bindchange="changeAgency">
<block wx:for="{{agencyList}}" wx:key='index'>
<label class="fn-fl block mb20 wp31 relative inner30 bg-f6 font-28 ulib-r10 {{(index+1)%3==0?'':'mr20'}}">
<text>{{item.title}}</text>
<checkbox class="absolute right-0 box-middle mr15" value="{{item.id}}" checked="{{item.checked}}"/>
</label>
</block>
</checkbox-group>
</view>
</view>
<view class="bbs-1-eb last-b-none" wx:if="{{priceinfo.dis_money}}">
<view class="relative pl190">
<view class="absolute left-0 box-middle font-28 color-333">精品赠送</view>
<view class="pt30 pb30 text-right font-28 color-666">
精品价值:<text class="color-f9394d">{{fine_total}}</text>元
</view>
</view>
<view class="pb10">
<block wx:for="{{fineList}}" wx:key='index'>
<view class="block mb20 relative inner30 bg-f6 font-28 ulib-r10" bindtap="changeFine" data-index="{{index}}">
<text>{{item.title}}</text>
<checkbox class="absolute right-0 box-middle mr15" value="{{item.id}}" checked="{{item.checked}}"/>
</view>
</block>
</view>
</view>
</view>
</view>
@@ -168,12 +192,6 @@
<text>{{priceinfo.deposit}}元</text>
</view>
</view>
<!-- <view class="relative bbs-1-eb last-b-none pl180 font-28" wx:if="{{inten_money}}">
<view class="absolute left-0 box-middle color-333">意向金</view>
<view class="pt30 pb30 text-right font-28 color-666" style="height:38rpx;">
<text>{{inten_money}}元</text>
</view>
</view> -->
<view class="mt40 font-32">其他信息</view>
<view class="relative bbs-1-eb pl190 last-b-none">
<view class="absolute left-0 box-middle font-28 color-333">付款方式</view>
@@ -183,15 +201,30 @@
<view class="absolute left-0 box-middle font-28 color-333">金融机构</view>
<view class="pt30 pb30 text-right font-28 color-666" style="min-height:38rpx;">{{financeArray[financeIndex]}}</view>
</view>
<view class="relative bbs-1-eb pl190 last-b-none">
<view class="absolute left-0 box-middle font-28 color-333">代办包</view>
<view class="pt30 pb30 text-right font-28 color-666">{{packArray[packIndex]}}</view>
</view>
<view class="relative bbs-1-eb pl190 last-b-none">
<view class="absolute left-0 box-middle font-28 color-333">期望交付时间</view>
<view class="pt30 pb30 text-right font-28 color-666">{{delry_time}}</view>
</view>
<view class="relative bbs-1-eb pl190 last-b-none">
<view class="absolute left-0 box-middle font-28 color-333">车身优惠</view>
<view class="pt30 pb30 text-right font-28 color-666" style="min-height:38rpx;">{{disc_money != ''?disc_money:'0'}}元</view>
</view>
<view class="relative bbs-1-eb pl190 last-b-none">
<view class="absolute left-0 box-middle font-28 color-333">代办相关</view>
<view class="pt30 pb30 text-right font-28 color-666" style="min-height:38rpx;">
<block wx:for="{{agencyList}}" wx:key='index'>
<text class="pl10" wx:if="{{item.checked}}">{{item.title}}</text>
</block>
</view>
</view>
<view class="relative bbs-1-eb pl190 last-b-none">
<view class="absolute left-0 box-middle font-28 color-333">精品赠送</view>
<view class="pt30 pb30 text-right font-28 color-666" style="min-height:38rpx;">
<block wx:for="{{fineList}}" wx:key='index'>
<text class="pl10" wx:if="{{item.checked}}">{{item.title}}</text>
</block>
</view>
</view>
<view class="fixed left-0 right-0 bottom-0 bg-fff-op90 inner40 fn-flex safe-pb">
<button class="wp100 bds-2-36afa2 bg-fff mr20 pt10 pb10 text-center font-32 color-36afa2 ulib-r750" hover-class="btn-36afa2-hover" bindtap="optPreview">重新编辑</button>
<button class="wp100 btn-36afa2 ml20 pt10 pb10 text-center font-32 color-fff ulib-r750" hover-class="btn-36afa2-hover" disabled="{{submitFlag}}" bindtap="putAppCusorder2">确认登记</button>
+6 -5
View File
@@ -466,6 +466,7 @@ Page({
priceinfo:'',
})
this.getAppSeriesAttrscolor()
//代办列表
this.getAppServices()
}
},
@@ -512,7 +513,7 @@ Page({
financeIndex:-1,
})
}
//代办
//代办列表
this.getAppServices()
}
},
@@ -576,7 +577,7 @@ Page({
getAppServices(){
if(this.data.paymentIndex != -1&&this.data.customerIndex != -1&&this.data.car_id != ''&&this.data.v_id != ''){
let params = {};
params['payway'] = this.data.car_id;
params['payway'] = this.data.paymentIndex==0?'1':'0';
params['cus_id'] = this.data.customer[this.data.customerIndex].id;
params['car_id'] = this.data.car_id;
params['v_id'] = this.data.v_id;
@@ -666,7 +667,7 @@ Page({
if(this.data.inten_money != ''){
params['inten_money'] = this.data.inten_money;
}
if(this.data.disc_money != ''){
if(!!this.data.disc_money && this.data.disc_money != '' ){
params['disc_money'] = this.data.disc_money;
}
if(this.data.srv_ids.length>0){
@@ -895,7 +896,6 @@ Page({
//代办相关
changeAgency(e) {
let agencyList = this.data.agencyList
let values = e.detail.value
let srv_total = 0
@@ -970,6 +970,7 @@ Page({
//输入车身优惠
inputDisc(e) {
console.log(e.detail.value)
if(parseFloat(e.detail.value)+this.data.fine_total>parseFloat(this.data.priceinfo.dis_money)){
wx.showToast({
title: '已超过最大可优惠价格',
@@ -980,7 +981,7 @@ Page({
})
}else{
this.setData({
[e.currentTarget.dataset.key]: parseFloat(e.detail.value)
[e.currentTarget.dataset.key]: e.detail.value?parseFloat(e.detail.value):'',
})
}
},
+1 -15
View File
@@ -170,16 +170,6 @@
</picker>
</view>
</view>
<!-- <view class="relative bbs-1-eb pl190 last-b-none" wx:if="{{packArray.length>0}}">
<view class="absolute left-0 box-middle font-28 color-333">代办包<text class="color-f9394d">*</text></view>
<view class="pt30 pb30 text-right font-28 color-666">
<picker bindchange="changePack" value="{{packIndex}}" range="{{packArray}}">
<text class="color-ccc" wx:if="{{packIndex == -1}}">请选择</text>
<text wx:else>{{packArray[packIndex]}}</text>
<i class="iconfont ml5 icon-gengduo"></i>
</picker>
</view>
</view> -->
<view class="relative bbs-1-eb last-b-none pl180 font-28">
<view class="absolute left-0 box-middle">期望交付时间<text class="color-f9394d">*</text></view>
<view class="pt30 pb30 text-right font-28 color-666">
@@ -334,17 +324,13 @@
<view class="absolute left-0 box-middle font-28 color-333">金融机构</view>
<view class="pt30 pb30 text-right font-28 color-666">{{financeArray[financeIndex]}}</view>
</view>
<!-- <view class="relative bbs-1-eb pl190 last-b-none">
<view class="absolute left-0 box-middle font-28 color-333">代办包</view>
<view class="pt30 pb30 text-right font-28 color-666">{{packArray[packIndex]}}</view>
</view> -->
<view class="relative bbs-1-eb pl190 last-b-none">
<view class="absolute left-0 box-middle font-28 color-333">期望交付时间</view>
<view class="pt30 pb30 text-right font-28 color-666">{{delry_time}}</view>
</view>
<view class="relative bbs-1-eb pl190 last-b-none">
<view class="absolute left-0 box-middle font-28 color-333">车身优惠</view>
<view class="pt30 pb30 text-right font-28 color-666" style="min-height:38rpx;">{{disc_money != ''?disc_money:'0'}}</view>
<view class="pt30 pb30 text-right font-28 color-666" style="min-height:38rpx;">{{disc_money != ''?disc_money:'0'}}</view>
</view>
<view class="relative bbs-1-eb pl190 last-b-none">
<view class="absolute left-0 box-middle font-28 color-333">代办相关</view>