|
@@ -11,10 +11,6 @@
|
|
|
<div class="sub-title">{{ bookForm.color.name }}</div>
|
|
<div class="sub-title">{{ bookForm.color.name }}</div>
|
|
|
<div class="divider"></div>
|
|
<div class="divider"></div>
|
|
|
<div class="small-title">全部选择配置</div>
|
|
<div class="small-title">全部选择配置</div>
|
|
|
- <div class="param" style="margin-top: 14px;">
|
|
|
|
|
- <div class="name">动力:{{ bookForm.carDesc }}</div>
|
|
|
|
|
- <div class="value">¥0</div>
|
|
|
|
|
- </div>
|
|
|
|
|
<div class="param">
|
|
<div class="param">
|
|
|
<div class="name">座椅:{{ bookForm.seat.name }}</div>
|
|
<div class="name">座椅:{{ bookForm.seat.name }}</div>
|
|
|
<div class="value">¥{{ bookForm.seat.price }}</div>
|
|
<div class="value">¥{{ bookForm.seat.price }}</div>
|
|
@@ -23,10 +19,6 @@
|
|
|
<div class="name">颜色:{{ bookForm.color.name }}/{{ bookForm.color.material }}</div>
|
|
<div class="name">颜色:{{ bookForm.color.name }}/{{ bookForm.color.material }}</div>
|
|
|
<div class="value">¥{{ bookForm.color.price }}</div>
|
|
<div class="value">¥{{ bookForm.color.price }}</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <!-- <div class="param">
|
|
|
|
|
- <div class="name">材质:{{ bookForm.color.material }}</div>
|
|
|
|
|
- <div class="value">¥{{ bookForm.color.price }}</div>
|
|
|
|
|
- </div> -->
|
|
|
|
|
<div class="param">
|
|
<div class="param">
|
|
|
<div class="name">内饰:{{ bookForm.upholstery.name }}</div>
|
|
<div class="name">内饰:{{ bookForm.upholstery.name }}</div>
|
|
|
<div class="value">¥{{ bookForm.upholstery.price }}</div>
|
|
<div class="value">¥{{ bookForm.upholstery.price }}</div>
|
|
@@ -197,7 +189,10 @@
|
|
|
<van-action-sheet :show="showCityPicker">
|
|
<van-action-sheet :show="showCityPicker">
|
|
|
<!-- eslint-disable -->
|
|
<!-- eslint-disable -->
|
|
|
<van-picker
|
|
<van-picker
|
|
|
- :columns="[{ values: [], className: 'column1' }, { values: [], className: 'column2' }]"
|
|
|
|
|
|
|
+ :columns="[
|
|
|
|
|
+ { values: [], className: 'column1' },
|
|
|
|
|
+ { values: [], className: 'column2' }
|
|
|
|
|
+ ]"
|
|
|
value-key="name"
|
|
value-key="name"
|
|
|
show-toolbar
|
|
show-toolbar
|
|
|
title="选择城市"
|
|
title="选择城市"
|
|
@@ -211,7 +206,7 @@
|
|
|
|
|
|
|
|
<van-action-sheet :show="showDealerPicker">
|
|
<van-action-sheet :show="showDealerPicker">
|
|
|
<van-picker
|
|
<van-picker
|
|
|
- :columns="dealerList"
|
|
|
|
|
|
|
+ :columns="dealerListFiltered"
|
|
|
value-key="name"
|
|
value-key="name"
|
|
|
show-toolbar
|
|
show-toolbar
|
|
|
title="选择经销商"
|
|
title="选择经销商"
|
|
@@ -231,6 +226,7 @@ export default {
|
|
|
return {
|
|
return {
|
|
|
type: 1,
|
|
type: 1,
|
|
|
tab: 0,
|
|
tab: 0,
|
|
|
|
|
+ specs: [],
|
|
|
loanOptions: [
|
|
loanOptions: [
|
|
|
{
|
|
{
|
|
|
month: 12,
|
|
month: 12,
|
|
@@ -269,6 +265,7 @@ export default {
|
|
|
spNo: null,
|
|
spNo: null,
|
|
|
dealerList: [],
|
|
dealerList: [],
|
|
|
showDealerPicker: false,
|
|
showDealerPicker: false,
|
|
|
|
|
+ settlement: {},
|
|
|
bookForm: {
|
|
bookForm: {
|
|
|
carId: null,
|
|
carId: null,
|
|
|
carDesc: null,
|
|
carDesc: null,
|
|
@@ -306,6 +303,12 @@ export default {
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
onShow() {
|
|
onShow() {
|
|
|
|
|
+ if (process.env.NODE_ENV === 'development') {
|
|
|
|
|
+ this.name = '熊竹';
|
|
|
|
|
+ this.mobile = '15077886171';
|
|
|
|
|
+ this.idCard = '321002199408304614';
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
this.picker = this.$mp.page.selectComponent('#cityPicker');
|
|
this.picker = this.$mp.page.selectComponent('#cityPicker');
|
|
|
this.$http
|
|
this.$http
|
|
|
.get(
|
|
.get(
|
|
@@ -333,6 +336,18 @@ export default {
|
|
|
eventChannel.on('bookForm', data => {
|
|
eventChannel.on('bookForm', data => {
|
|
|
this.bookForm = data;
|
|
this.bookForm = data;
|
|
|
});
|
|
});
|
|
|
|
|
+ eventChannel.on('settlement', data => {
|
|
|
|
|
+ this.settlement = data;
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ watch: {
|
|
|
|
|
+ type(val) {
|
|
|
|
|
+ if (val === 2) {
|
|
|
|
|
+ if (!this.spNo) {
|
|
|
|
|
+ this.dealerId = null;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
@@ -356,6 +371,13 @@ export default {
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
return Math.ceil(monthly);
|
|
return Math.ceil(monthly);
|
|
|
|
|
+ },
|
|
|
|
|
+ dealerListFiltered() {
|
|
|
|
|
+ if (this.type === 1) {
|
|
|
|
|
+ return this.dealerList;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return this.dealerList.filter(i => !!i.spNo);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
@@ -513,65 +535,52 @@ export default {
|
|
|
carUpholsteryId: this.bookForm.upholstery.id,
|
|
carUpholsteryId: this.bookForm.upholstery.id,
|
|
|
carWheelHubId: this.bookForm.wheelHub.id,
|
|
carWheelHubId: this.bookForm.wheelHub.id,
|
|
|
carCaliperId: this.bookForm.caliper.id,
|
|
carCaliperId: this.bookForm.caliper.id,
|
|
|
- carPackageIdList: this.bookForm.optionalPackage.map(i => i.id)
|
|
|
|
|
|
|
+ carPackageIdList: this.bookForm.optionalPackage.map(i => i.id),
|
|
|
|
|
+ materielCode: this.settlement.materielCode
|
|
|
};
|
|
};
|
|
|
|
|
+ this.$loading();
|
|
|
this.$http
|
|
this.$http
|
|
|
- .post('/applets/checkValidMaterielCode', data, {
|
|
|
|
|
- header: {
|
|
|
|
|
- 'Content-Type': 'application/json'
|
|
|
|
|
|
|
+ .post(
|
|
|
|
|
+ '/applets/carsubmit/submitcarorder',
|
|
|
|
|
+ {
|
|
|
|
|
+ dealerCode: this.dealerCode,
|
|
|
|
|
+ dealerId: this.dealerId,
|
|
|
|
|
+ pickedCarIds: data,
|
|
|
|
|
+ payType: this.type,
|
|
|
|
|
+ loanInstalmentCount: this.loanOptions[this.tab].month,
|
|
|
|
|
+ incomingUrl: this.$http.parseUrl('/applets/'),
|
|
|
|
|
+ loanRate: this.loanOptions[this.tab].rate,
|
|
|
|
|
+ idCard: this.idCard,
|
|
|
|
|
+ name: this.name,
|
|
|
|
|
+ mobile: this.mobile,
|
|
|
|
|
+ pickCity: this.provinceName + ' ' + this.cityName,
|
|
|
|
|
+ carSupplier: this.dealerName,
|
|
|
|
|
+ carSupplierNo: this.type === 1 ? '100109999999' : this.spNo,
|
|
|
|
|
+ downPaymentRate: this.percent / 100,
|
|
|
|
|
+ materielCode: this.settlement.materielCode
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ header: {
|
|
|
|
|
+ 'Content-Type': 'application/json'
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- })
|
|
|
|
|
|
|
+ )
|
|
|
.then(res => {
|
|
.then(res => {
|
|
|
- console.log('checkValidMaterielCode::', res);
|
|
|
|
|
- if (res.code === 200 && res.data) {
|
|
|
|
|
- data.materielCode = res.data;
|
|
|
|
|
- // return this.$http.post('/applets/querycarsettlement', data, {
|
|
|
|
|
- // header: {
|
|
|
|
|
- // 'Content-Type': 'application/json'
|
|
|
|
|
- // }
|
|
|
|
|
- // });
|
|
|
|
|
- return Promise.resolve();
|
|
|
|
|
|
|
+ this.$loading.close();
|
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
|
+ wx.redirectTo({
|
|
|
|
|
+ url: '/pages/order/orderListCoupe'
|
|
|
|
|
+ });
|
|
|
} else {
|
|
} else {
|
|
|
return Promise.reject(res.message);
|
|
return Promise.reject(res.message);
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
- .then(res => {
|
|
|
|
|
- console.log('querycarsettlement::', res);
|
|
|
|
|
- return this.$http.post(
|
|
|
|
|
- '/applets/carsubmit/submitcarorder',
|
|
|
|
|
- {
|
|
|
|
|
- dealerCode: this.dealerCode,
|
|
|
|
|
- dealerId: this.dealerId,
|
|
|
|
|
- pickedCarIds: data,
|
|
|
|
|
- payType: this.type,
|
|
|
|
|
- loanInstalmentCount: this.loanOptions[this.tab].month,
|
|
|
|
|
- incomingUrl: this.$http.parseUrl('/applets/'),
|
|
|
|
|
- loanRate: this.loanOptions[this.tab].rate,
|
|
|
|
|
- idCard: this.idCard,
|
|
|
|
|
- name: this.name,
|
|
|
|
|
- mobile: this.mobile,
|
|
|
|
|
- pickCity: this.provinceName + ' ' + this.cityName,
|
|
|
|
|
- carSupplier: this.dealerName,
|
|
|
|
|
- carSupplierNo: this.type === 1 ? '100109999999' : this.spNo,
|
|
|
|
|
- downPaymentRate: this.percent / 100,
|
|
|
|
|
- materielCode: data.materielCode
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- header: {
|
|
|
|
|
- 'Content-Type': 'application/json'
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- );
|
|
|
|
|
- })
|
|
|
|
|
- .then(res => {
|
|
|
|
|
- if (res.data.code == 1) {
|
|
|
|
|
- Dialog.alert({
|
|
|
|
|
- title: '提交订单成功',
|
|
|
|
|
- confirmButtonText: '去支付',
|
|
|
|
|
- className: 'custom-class-name'
|
|
|
|
|
- }).then(() => {
|
|
|
|
|
- payOrder(res.data.carOrderId, res.data.carOrderCode);
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ .catch(e => {
|
|
|
|
|
+ this.$loading.close();
|
|
|
|
|
+ if (typeof e === 'string') {
|
|
|
|
|
+ this.$toast(e);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$toast('提交订单失败,请稍后再试');
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|