调整业务办理
This commit is contained in:
@@ -10,8 +10,16 @@
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
<view class="from-block">
|
||||
<view class="from-block-item">
|
||||
<view class="from-block">
|
||||
<view class="from-block-item" v-if="pickertype == 'select'">
|
||||
<label>资费类型</label>
|
||||
<picker class="from-block-val" :range="selectP" :value="selectPIndex" range-key="name" @change="pickerSelectChange">
|
||||
<view class="from-block-picker nowrap">{{selectP[selectPIndex].name}}
|
||||
<u-icon class="from-block-picker-icon" name="arrow-down" color="#555" size="15"></u-icon>
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
<view class="from-block-item" v-if="needAmount > 0">
|
||||
<label>标的额</label>
|
||||
<input class="from-block-val from-block-input" type="number" placeholder="请输入标的额" @input="onKeyInput" />
|
||||
</view>
|
||||
@@ -50,13 +58,18 @@
|
||||
phone : '',
|
||||
price : '',
|
||||
priceValue : '',
|
||||
amount : ''
|
||||
amount : 0,
|
||||
needAmount : 0,
|
||||
selectP : [],
|
||||
selectPIndex: 0
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
const parentData = JSON.parse(decodeURIComponent(this.$Route.query.record))
|
||||
const parentData = JSON.parse(decodeURIComponent(this.$Route.query.record))
|
||||
this.needAmount = parentData.need_amount
|
||||
this.pickerArr = parentData.child.data
|
||||
this.pickertype = parentData.type
|
||||
this.pickertype = parentData.type
|
||||
this.selectP = parentData.select_p
|
||||
},
|
||||
methods: {
|
||||
// 获取标的额
|
||||
@@ -66,11 +79,15 @@
|
||||
},
|
||||
|
||||
// 标的额比例计算
|
||||
settleInfo() {
|
||||
settleAmount({amount: this.amount}, this.$Route.query.bigFiveId).then(res => {
|
||||
settleInfo() {
|
||||
let { pickerArr, pickerIndex } = this
|
||||
let id = pickerArr[pickerIndex].id
|
||||
settleAmount({
|
||||
amount: this.pickertype == 'select' ? this.selectP[this.selectPIndex].key : this.amount,
|
||||
}, id).then(res => {
|
||||
this.price = res.price
|
||||
}).catch(err => {
|
||||
this.price = 0
|
||||
this.price = 0
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon : 'none',
|
||||
@@ -78,20 +95,36 @@
|
||||
duration:3000
|
||||
})
|
||||
})
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
|
||||
// 选择办理业务
|
||||
pickerChange(e) {
|
||||
this.pickerIndex = e.detail.value
|
||||
|
||||
// 获取三级分类服务费类型
|
||||
this.amountTypeInfo();
|
||||
this.amountTypeInfo();
|
||||
},
|
||||
|
||||
// 选择资费信息
|
||||
pickerSelectChange(e){
|
||||
this.selectPIndex = e.detail.value
|
||||
this.settleInfo()
|
||||
},
|
||||
|
||||
// 三级分类服务费类型
|
||||
amountTypeInfo() {
|
||||
amountType(this.$Route.query.bigFiveId).then(res => {
|
||||
this.pickertype = res.type
|
||||
amountTypeInfo() {
|
||||
// this.$Route.query.bigFiveId
|
||||
let { pickerArr, pickerIndex } = this
|
||||
let id = pickerArr[pickerIndex].id
|
||||
amountType(id).then(res => {
|
||||
let { type, need_amount, select_p } = res;
|
||||
this.pickertype = type
|
||||
this.needAmount = need_amount
|
||||
this.selectP = select_p
|
||||
if(type == 'select'){
|
||||
this.settleInfo()
|
||||
}
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
@@ -104,7 +137,7 @@
|
||||
|
||||
// 提交表单
|
||||
onSubmit(){
|
||||
let { name, phone, pickerIndex, price, priceValue, amount, pickerArr, pickertype} = this
|
||||
let { name, phone, pickerIndex, price, priceValue, amount, pickerArr, pickertype, selectP, selectPIndex } = this
|
||||
if(pickertype != 'free') {
|
||||
if(amount === ''){
|
||||
uni.showToast({
|
||||
@@ -142,11 +175,12 @@
|
||||
})
|
||||
|
||||
let params = {
|
||||
big_id : pickerArr.length > 0 ? pickerArr[pickerIndex].id : this.$Route.query.bigFiveId,
|
||||
name : name,
|
||||
amount : amount || '',
|
||||
mobile : phone,
|
||||
price : pickertype == 'free' ? priceValue : price
|
||||
big_id : pickerArr.length > 0 ? pickerArr[pickerIndex].id : this.$Route.query.bigFiveId,
|
||||
name : name,
|
||||
amount : amount,
|
||||
mobile : phone,
|
||||
price : pickertype == 'free' ? priceValue : price,
|
||||
select_key : selectP[selectPIndex].key
|
||||
}
|
||||
bigfiveStore(params).then(res => {
|
||||
let { order_type, order_id, order_no } = res;
|
||||
|
||||
Reference in New Issue
Block a user