mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-11 19:06:43 +08:00
卡单撤单需求
This commit is contained in:
@@ -108,3 +108,21 @@ export function saveOrUpdateDocument(data) {
|
|||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取验证码
|
||||||
|
export function getAuthCode(data) {
|
||||||
|
return request({
|
||||||
|
url: getUrl('/customer/authcode/loginedSend', 1),
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 卡单撤单
|
||||||
|
export function revokeOrder(data) {
|
||||||
|
return request({
|
||||||
|
url: getUrl('/sale/order/revokeOrder', 1),
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -59,6 +59,9 @@
|
|||||||
<div v-if="orderItem.isCanPay && (orderItem.orderStatus == '02' || orderItem.orderStatus == '19' || orderItem.orderStatus == '55')">
|
<div v-if="orderItem.isCanPay && (orderItem.orderStatus == '02' || orderItem.orderStatus == '19' || orderItem.orderStatus == '55')">
|
||||||
<van-button round @click="goPay(orderItem.orderNo)" size="small" class="mr5" type="danger" v-no-more-click="1000">去支付</van-button>
|
<van-button round @click="goPay(orderItem.orderNo)" size="small" class="mr5" type="danger" v-no-more-click="1000">去支付</van-button>
|
||||||
</div>
|
</div>
|
||||||
|
<div v-if="canRevoke[orderItem.orderStatus]">
|
||||||
|
<van-button round @click="revokeOrder(orderItem)" size="small" class="mr5" type="danger">撤单</van-button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<template v-if="NewItems.length === 0">
|
<template v-if="NewItems.length === 0">
|
||||||
@@ -67,6 +70,25 @@
|
|||||||
<p class="gray text-center pt20">暂无订单</p>
|
<p class="gray text-center pt20">暂无订单</p>
|
||||||
</li>
|
</li>
|
||||||
</template>
|
</template>
|
||||||
|
<van-dialog
|
||||||
|
class="dialog-delete"
|
||||||
|
@confirm="checkCaptchaCode"
|
||||||
|
@cancel="cancelCaptchaCode"
|
||||||
|
:before-close="beforeClose"
|
||||||
|
confirm-button-color="#fff"
|
||||||
|
v-model="revokePanelShow"
|
||||||
|
title="短信验证"
|
||||||
|
show-cancel-button
|
||||||
|
>
|
||||||
|
<p class="captchaReceiver">投保人手机号: {{ captchaReceiver | phoneNumFilter }}</p>
|
||||||
|
<van-field v-model="sms" center clearable placeholder="请输入短信验证码">
|
||||||
|
<template #button>
|
||||||
|
<van-button :disabled="sendTime !== 0" v-no-more-click="1000" @click="getCaptchaCode" size="small" type="danger">{{
|
||||||
|
sendTime ? `${sendTime}s后获取` : '获取验证码'
|
||||||
|
}}</van-button>
|
||||||
|
</template>
|
||||||
|
</van-field>
|
||||||
|
</van-dialog>
|
||||||
</div>
|
</div>
|
||||||
</van-list>
|
</van-list>
|
||||||
</div>
|
</div>
|
||||||
@@ -76,8 +98,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getCardList, getOrderList } from '@/api/ebiz/cardList/cardList.js'
|
import { getCardList, getOrderList, getAuthCode, revokeOrder } from '@/api/ebiz/cardList/cardList.js'
|
||||||
import { Tab, Tabs, List, Sticky } from 'vant'
|
import {Tab, Tabs, List, Sticky, Toast} from 'vant'
|
||||||
import dataDictionary from '@/assets/js/utils/data-dictionary' //根据数据字典找到订单状态
|
import dataDictionary from '@/assets/js/utils/data-dictionary' //根据数据字典找到订单状态
|
||||||
// import formatDate from '@/assets/js/utils/date-utils'
|
// import formatDate from '@/assets/js/utils/date-utils'
|
||||||
|
|
||||||
@@ -103,7 +125,27 @@ export default {
|
|||||||
list: [],
|
list: [],
|
||||||
// orderList: [{ text: '11111' }, { text: '11111' }], //我的订单
|
// orderList: [{ text: '11111' }, { text: '11111' }], //我的订单
|
||||||
orderList: [], //我的订单
|
orderList: [], //我的订单
|
||||||
iNow: 0
|
canRevoke: {
|
||||||
|
'19': true,
|
||||||
|
'02': true,
|
||||||
|
'48': true,
|
||||||
|
'49': true,
|
||||||
|
'55': true,
|
||||||
|
'58': true,
|
||||||
|
'46': true,
|
||||||
|
'50': true,
|
||||||
|
'51': true
|
||||||
|
},
|
||||||
|
iNow: 0,
|
||||||
|
sms: '',
|
||||||
|
smsId: '',
|
||||||
|
sendTime: 0,
|
||||||
|
revokePanelShow:false,
|
||||||
|
getCaptcha: false,
|
||||||
|
captchaTimer: null,
|
||||||
|
captchaReceiver: '',
|
||||||
|
revokeOrderNo: '',
|
||||||
|
captchaMaped: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@@ -260,7 +302,93 @@ export default {
|
|||||||
path: `/cardList/pay`
|
path: `/cardList/pay`
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
},
|
||||||
|
//撤单
|
||||||
|
revokeOrder(order) {
|
||||||
|
console.dir(order)
|
||||||
|
this.$dialog
|
||||||
|
.confirm({
|
||||||
|
className: 'dialog-delete',
|
||||||
|
title: '提示',
|
||||||
|
message: '撤单后,数据将不可恢复,您确定要撤单吗?',
|
||||||
|
cancelButtonColor: '#E9332E',
|
||||||
|
confirmButtonColor: '#FFFFFF'
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
this.revokePanelShow = true
|
||||||
|
this.captchaReceiver = order.appntMobile
|
||||||
|
this.revokeOrderNo = order.orderNo
|
||||||
|
})
|
||||||
|
},
|
||||||
|
beforeClose(action, done) {
|
||||||
|
this.captchaMaped ? done() : done(false)
|
||||||
|
},
|
||||||
|
async getCaptchaCode() {
|
||||||
|
if (this.sendTime !== 0) return
|
||||||
|
this.getCaptcha = true
|
||||||
|
this.sendTime = 60
|
||||||
|
let data = {
|
||||||
|
operateType: 'appntInfoEntry',
|
||||||
|
type: 'H5',
|
||||||
|
operateCode: this.captchaReceiver,
|
||||||
|
system: 'agentApp',
|
||||||
|
operateCodeType: '0'
|
||||||
|
}
|
||||||
|
let res = await getAuthCode(data)
|
||||||
|
if (res.result === '0') {
|
||||||
|
this.$toast('获取验证码成功')
|
||||||
|
}
|
||||||
|
this.smsId = res.sessionId
|
||||||
|
this.captchaTimer = setInterval(() => {
|
||||||
|
this.sendTime--
|
||||||
|
if (this.sendTime === 0) {
|
||||||
|
clearInterval(this.captchaTimer)
|
||||||
|
this.captchaTimer = null
|
||||||
|
}
|
||||||
|
}, 1000)
|
||||||
|
},
|
||||||
|
async checkCaptchaCode() {
|
||||||
|
if (!this.getCaptcha) {
|
||||||
|
return this.$toast('请先获取验证码')
|
||||||
|
}
|
||||||
|
if (!this.sms.trim()) {
|
||||||
|
return this.$toast('请输入验证码')
|
||||||
|
}
|
||||||
|
clearInterval(this.captchaTimer)
|
||||||
|
this.captchaTimer = null
|
||||||
|
let revokeResult = await revokeOrder({
|
||||||
|
id: this.revokeOrderNo,
|
||||||
|
smsId: this.smsId,
|
||||||
|
code: this.sms
|
||||||
|
})
|
||||||
|
if (revokeResult.result == 0) {
|
||||||
|
this.$toast('撤单成功!')
|
||||||
|
setTimeout(() => {
|
||||||
|
this.orderList = []
|
||||||
|
this.isSuccess = false
|
||||||
|
this.currentPage = 1
|
||||||
|
;[this.loading, this.finished] = [true, false]
|
||||||
|
let pageInfo = {
|
||||||
|
pageNum: this.currentPage,
|
||||||
|
pageSize: this.pageSize
|
||||||
|
}
|
||||||
|
this.loadMore(pageInfo)
|
||||||
|
}, 1000)
|
||||||
|
} else {
|
||||||
|
Toast.fail(revokeResult.resultMessage)
|
||||||
|
}
|
||||||
|
this.cancelCaptchaCode()
|
||||||
|
this.sms = ''
|
||||||
|
},
|
||||||
|
cancelCaptchaCode() {
|
||||||
|
this.sendTime = 0
|
||||||
|
this.revokePanelShow = false
|
||||||
|
clearInterval(this.captchaTimer)
|
||||||
|
this.captchaTimer = null
|
||||||
|
this.getCaptcha = false
|
||||||
|
this.captchaMaped = false
|
||||||
|
this.captchaReceiver = ''
|
||||||
|
},
|
||||||
},
|
},
|
||||||
filters: {
|
filters: {
|
||||||
statusFormat(val) {
|
statusFormat(val) {
|
||||||
@@ -271,6 +399,11 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
return text
|
return text
|
||||||
|
},
|
||||||
|
phoneNumFilter(phoneNum) {
|
||||||
|
let num = phoneNum.split('')
|
||||||
|
num.splice(3, 4, '****')
|
||||||
|
return num.join('')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -285,7 +418,8 @@ export default {
|
|||||||
prtNo: orderItem.orderInfoDTO.prtNo,
|
prtNo: orderItem.orderInfoDTO.prtNo,
|
||||||
appantName: orderItem.appntDTO.name,
|
appantName: orderItem.appntDTO.name,
|
||||||
insuredName: orderItem.insuredDTOs[0].name,
|
insuredName: orderItem.insuredDTOs[0].name,
|
||||||
orderStatus: orderItem.orderInfoDTO.orderStatus
|
orderStatus: orderItem.orderInfoDTO.orderStatus,
|
||||||
|
appntMobile: orderItem.appntDTO.mobile
|
||||||
}
|
}
|
||||||
let dateToday = new Date()
|
let dateToday = new Date()
|
||||||
dateToday.setHours(0)
|
dateToday.setHours(0)
|
||||||
@@ -448,4 +582,31 @@ export default {
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
/deep/ .dialog-delete{
|
||||||
|
padding-bottom: 15px;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/ .dialog-delete .van-dialog__header {
|
||||||
|
padding: 0.5em !important;
|
||||||
|
margin-bottom: 1em !important;
|
||||||
|
border-bottom: 1px solid #eaeaea;
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/ .van-cell {
|
||||||
|
padding: 0;
|
||||||
|
padding-bottom: 0.5em;
|
||||||
|
border-bottom: 1px solid #eaeaea;
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/ .van-dialog__content {
|
||||||
|
padding: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.captchaReceiver {
|
||||||
|
margin-bottom: 1em;
|
||||||
|
padding-bottom: 1em;
|
||||||
|
border-bottom: 1px solid #eaeaea;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user