Commit 4dfd218f by cen

fix: 战败下单

1 parent 4d77ad19
import http from '../request/http'
module.exports = {}
...@@ -94,5 +94,21 @@ module.exports = { ...@@ -94,5 +94,21 @@ module.exports = {
projectName: 'boutique', projectName: 'boutique',
...data ...data
}) })
},
// 查询订单是否支持状态变更
getOrderRefundStep(data) {
return http.post({
method: 'dj.api.smartcarlife.refundApplyRecord.isExist',
projectName: 'boutique',
...data
})
},
/**报价单-撤销工单 */
cancelOrderById(data) {
return http.post({
method: 'dj.api.smartcarlife.quotation.cancel',
projectName: 'boutique',
...data
})
} }
} }
...@@ -116,35 +116,7 @@ ...@@ -116,35 +116,7 @@
</view> </view>
</view> </view>
</view> </view>
<NoticePopup ref="notice" title="提示" text="是否撤销该笔客户工单,撤销后客户工单为「已撤销」状态,不再统计订单数和订单金额。" type="warning"></NoticePopup>
<PublishPopup ref="recordOrderPopup" popupClass="recordOrderPopup" type="center" :showClose="true" :isMaskClick="false" title="请选择录单入口">
<template #content>
<view class="modatcontent">
<view class="modalbox com" :class="selectType == 1 ? 'act' : ''" @click="changeType(1)">
<view class="sprite-icon icon-createOrder"></view>
新增工单
</view>
<view class="modalbox cancle" :class="selectType == 2 ? 'act' : ''" @click="changeType(2)">
<view class="sprite-icon icon-defeatOrder"></view>
战败下单
</view>
<view v-if="isSettingExpiredTraffic && !isScan" class="modalbox cancle" :class="selectType == 3 ? 'act' : ''" @click="changeType(3)">
<view class="sprite-icon icon-isExpiredTrafficIcon"></view>
失效客户
</view>
<view class="modalbox cancle" v-if="orderCardDetail.constructionFlag !== 'Y' && orderCardDetail.selectPayType !== 1 && orderCardDetail.selectPayType !== 3 && orderCardDetail.selectPayType !== 4 && orderCardDetail.status !== 9" :class="selectType == 4 ? 'act' : ''" @click="changeType(4)">
<view class="sprite-icon icon-revokeOrder"></view>
撤销工单
</view>
</view>
</template>
<template #footer>
<view class="footer-box flex justify-center">
<view class="cancle-btn btn" @click.stop="cancelSelection">取消</view>
<view class="sure-btn btn" @click.stop="confirmSelection">确认</view>
</view>
</template>
</PublishPopup>
</view> </view>
</template> </template>
<script> <script>
...@@ -153,7 +125,7 @@ import { interceptionMixin } from '@/mixin/index' ...@@ -153,7 +125,7 @@ import { interceptionMixin } from '@/mixin/index'
import utils from '@/utils/utils' import utils from '@/utils/utils'
import { checkDailyReport, showNextModal } from '@/utils/modalUtils' import { checkDailyReport, showNextModal } from '@/utils/modalUtils'
import PublishPopup from '@/components/PublishPopup.vue' import PublishPopup from '@/components/PublishPopup.vue'
import { debounce } from 'lodash' import NoticePopup from '@/components/NoticePopup.vue'
export default { export default {
mixins: [interceptionMixin], mixins: [interceptionMixin],
name: 'OrderCard', name: 'OrderCard',
...@@ -164,7 +136,8 @@ export default { ...@@ -164,7 +136,8 @@ export default {
} }
}, },
components: { components: {
PublishPopup PublishPopup,
NoticePopup
}, },
computed: { computed: {
payType() { payType() {
...@@ -457,31 +430,29 @@ export default { ...@@ -457,31 +430,29 @@ export default {
}, },
// 撤销工单方法 // 撤销工单方法
revokeOrder() { revokeOrder() {
uni.showModal({ // 配置弹窗按钮
title: '提示', this.$refs.notice.buttonsList = [
content: '确定要撤销该工单吗?', {
success: res => { text: '取消',
if (res.confirm) { type: 'default',
uni.$api.boutiqueApi callback: () => {
.revokeOrder({ this.transmissionOfData = null
orderCode: this.orderCardDetail.orderCode this.$refs.notice.close()
})
.then(data => {
uni.showToast({
title: '操作成功',
icon: 'success'
})
this.$emit('refresh')
})
.catch(err => {
uni.showToast({
title: '操作失败',
icon: 'none'
})
})
} }
},
{
text: '撤销',
type: 'primary',
callback: async () => {
// 校验订单是否可撤销(在退款流程中无法撤销)
let refundStep = await uni.$api.equityApi.getOrderRefundStep({ orderCode: this.orderCardDetail.payId })
if (refundStep?.data == 'Y') return _this.showRefundAlert()
this.repeal(this.orderCardDetail.id)
} }
}) }
]
// 打开弹窗
this.$refs.notice.open()
}, },
//修改客户信息 //修改客户信息
jumpUpdate() { jumpUpdate() {
...@@ -490,6 +461,44 @@ export default { ...@@ -490,6 +461,44 @@ export default {
//去处理 //去处理
createorder() { createorder() {
this.$emit('jump', 'CreateOrder', { paramsData: this.orderCardDetail, type: 'CreateOrder' }) this.$emit('jump', 'CreateOrder', { paramsData: this.orderCardDetail, type: 'CreateOrder' })
},
showRefundAlert(type) {
const text = type == 'error' ? '订单已发起退款,禁止标记为错误工单!如需标记错误请联系总部运营。' : '订单已发起退款,禁止撤销!如需撤销请联系总部运营。'
uni.showModal({
title: '提示',
content: text,
showCancel: false,
confirmText: '好的'
})
},
repeal(id, revokeReason) {
uni.showLoading({
mask: true
})
let _this = this
let params = {
id
}
if (revokeReason) {
params.revokeReason = revokeReason
}
uni.$api.equityApi.cancelOrderById(params).then(_res_ => {
if (_res_) {
uni.hideLoading()
uni.showToast({
title: '操作成功',
icon: 'success'
})
this.transmissionOfData = null
this.$refs.notice.close()
setTimeout(() => {
this.$emit('refresh')
// _this.getList();
}, 500)
} else {
uni.hideLoading()
}
})
} }
} }
} }
......
...@@ -86,7 +86,7 @@ export default { ...@@ -86,7 +86,7 @@ export default {
{ tabName: '已支付', num: 0, value: 3 }, { tabName: '已支付', num: 0, value: 3 },
{ tabName: '已完成', num: 0, value: 5 }, { tabName: '已完成', num: 0, value: 5 },
{ tabName: '战败', num: 0, value: -1 }, { tabName: '战败', num: 0, value: -1 },
{ tabName: '待上传协议', num: 0, value: 7 } { tabName: '待上传协议', value: 7 }
], ],
tabIndex: 0, tabIndex: 0,
waitinputorderTabList: [ waitinputorderTabList: [
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<GlCell :formList="formList" :formData="orderObj" @radioChange="radioChange" @inputBlur="inputBlur" @handleCell="handleCell" :titleList="titleList"></GlCell> <GlCell :formList="formList" :formData="orderObj" @radioChange="radioChange" @inputBlur="inputBlur" @handleCell="handleCell" :titleList="titleList"></GlCell>
</view> </view>
<view class="btns flex"> <view class="btns flex">
<view class="btn save">放弃</view> <view class="btn save" @click="back">放弃</view>
<view @click="submit" class="btn">提交修改</view> <view @click="submit" class="btn">提交修改</view>
</view> </view>
</scroll-view> </scroll-view>
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
</template> </template>
<!-- 支付弹框 --> <!-- 支付弹框 -->
<OrderPay ref="OrderPay" @jumpSuccess="jumpSuccess" /> <OrderPay ref="OrderPay" @jumpSuccess="jumpSuccess" />
<NoticePopup ref="notice" title="重要提示" text="当前页面暂未保存,是否确认退出" type="warning"></NoticePopup>
</view> </view>
</template> </template>
...@@ -30,12 +31,10 @@ ...@@ -30,12 +31,10 @@
import utils from '@/utils/utils' import utils from '@/utils/utils'
import OrderPopup from '@/components/OrderPopup/index.vue' import OrderPopup from '@/components/OrderPopup/index.vue'
import GlCell from '../../../../components/Form/GlCell.vue' import GlCell from '../../../../components/Form/GlCell.vue'
import Product from './Product.vue'
import Package from './Package.vue'
import SkuGoods from './SkuGoods.vue'
import { UpdateOrderInfo, popupTypeEnum, payTypeList, titleList } from '../contant' import { UpdateOrderInfo, popupTypeEnum, payTypeList, titleList } from '../contant'
import { interceptionMixin } from '@/mixin/index' import { interceptionMixin } from '@/mixin/index'
import UploadProofOfPayment from './UploadProofOfPayment.vue' import UploadProofOfPayment from './UploadProofOfPayment.vue'
import NoticePopup from '@/components/NoticePopup.vue'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import OrderPay from './OrderPay.vue' import OrderPay from './OrderPay.vue'
import NP from 'number-precision' import NP from 'number-precision'
...@@ -46,11 +45,9 @@ export default { ...@@ -46,11 +45,9 @@ export default {
components: { components: {
GlCell, GlCell,
OrderPopup, OrderPopup,
Product,
Package,
SkuGoods,
UploadProofOfPayment, UploadProofOfPayment,
OrderPay OrderPay,
NoticePopup
}, },
props: { props: {
transmissionOfData: { transmissionOfData: {
...@@ -112,10 +109,11 @@ export default { ...@@ -112,10 +109,11 @@ export default {
console.log(data, 'data') console.log(data, 'data')
// this.orderInfo = data // this.orderInfo = data
this.orderObj.id = id this.orderObj.id = id
this.orderObj.ownerId = data.owner.id
this.orderObj.carVin = data.owner.carVin this.orderObj.carVin = data.owner.carVin
this.orderObj.owner = data.owner.owner this.orderObj.owner = data.owner.owner
this.orderObj.phone = data.owner.phone this.orderObj.phone = data.owner.phone
this.orderObj.salesType = data.owner.carVin this.orderObj.salesType = data.owner.salesType
this.orderObj.certificateNo = data.owner.certificateNo this.orderObj.certificateNo = data.owner.certificateNo
this.orderObj.notes = data.notes this.orderObj.notes = data.notes
}, },
...@@ -172,12 +170,12 @@ export default { ...@@ -172,12 +170,12 @@ export default {
id: this.orderObj.id, id: this.orderObj.id,
notes: this.orderObj.notes || '', notes: this.orderObj.notes || '',
owner: { owner: {
id: this.orderObj.owner.id, id: this.orderObj.ownerId,
owner: this.owner.owner, owner: this.orderObj.owner,
phone: this.owner.phone, phone: this.orderObj.phone,
carVin: this.owner.carVin || '', carVin: this.orderObj.carVin || '',
certificateNo: this.owner.certificateNo || '', certificateNo: this.orderObj.certificateNo || '',
salesType: this.owner.salesType || 0 salesType: this.orderObj.salesType || 0
} }
} }
console.log(params, 'params') console.log(params, 'params')
...@@ -190,10 +188,34 @@ export default { ...@@ -190,10 +188,34 @@ export default {
.then(result => { .then(result => {
uni.hideLoading() uni.hideLoading()
console.log(result) console.log(result)
this.$emit('jump', 'OrderManagement', {})
}) })
.catch(err => { .catch(err => {
uni.hideLoading() uni.hideLoading()
}) })
},
back() {
// 配置弹窗按钮
this.$refs.notice.buttonsList = [
{
text: '确认退出',
type: 'default',
callback: () => {
this.transmissionOfData = null
this.$refs.notice.close()
this.$emit('jump', 'OrderManagement', {})
}
},
{
text: '继续编辑',
type: 'primary',
callback: () => {
this.$refs.notice.close()
}
}
]
// 打开弹窗
this.$refs.notice.open()
} }
} }
} }
......
...@@ -213,37 +213,12 @@ const DEFEAT_FORM_LIST = [ ...@@ -213,37 +213,12 @@ const DEFEAT_FORM_LIST = [
required: true required: true
}, },
{ {
label: '销售顾问/录单员', label: '推荐人员',
value: 'employeeName', value: 'employeeName',
type: 'select', type: 'select',
// key: 'staffName', // key: 'staffName',
required: true, required: true,
showText: 'shopMerchantName' showText: 'shopMerchantName'
},
{
label: '交付专员',
value: 'deliveryEmployeeName',
type: 'select',
required: true,
// key: 'staffName',
hidden: true,
showText: 'shopMerchantName'
},
{
label: '二级流量方',
value: 'subShopMerchantName',
type: 'select',
required: true,
// key: 'subMerchantName',
hidden: true
},
{
label: '转化人员',
value: 'sellerName',
type: 'select',
// key: 'staffName',
required: true,
showText: 'merchantName'
} }
], ],
[ [
...@@ -255,40 +230,6 @@ const DEFEAT_FORM_LIST = [ ...@@ -255,40 +230,6 @@ const DEFEAT_FORM_LIST = [
required: true required: true
}, },
{ {
label: '客户来源',
value: 'salesType',
type: 'radio',
current: '0',
radioList: [
{
value: '0',
name: '售前'
},
{
value: '1',
name: '售后'
}
],
required: true,
hidden: true
},
{
label: '性别',
value: 'customerSex',
type: 'radio',
current: '1',
radioList: [
{
value: '1',
name: '男'
},
{
value: '2',
name: '女'
}
]
},
{
label: '手机号', label: '手机号',
value: 'customerPhone', value: 'customerPhone',
maxlength: '11', maxlength: '11',
...@@ -297,163 +238,23 @@ const DEFEAT_FORM_LIST = [ ...@@ -297,163 +238,23 @@ const DEFEAT_FORM_LIST = [
inputType: 'number' inputType: 'number'
}, },
{ {
label: '选择车型', label: '客户来源',
value: 'carBrand', value: 'salesType',
type: 'select',
key: 'carInfo'
},
{
label: '车架号(VIN)',
value: 'standNo',
maxlength: '17',
type: 'input'
},
{
label: '车牌号',
value: 'plateNumber',
maxlength: '8',
type: 'input'
},
{
label: '是否体验',
value: 'experienceFlag',
type: 'radio',
current: 'Y',
required: true,
radioList: [
{
value: 'Y',
name: '是'
},
{
value: 'N',
name: '否'
}
]
}
],
[
{
label: '精品礼券',
value: 'couponInfo',
type: 'select',
key: 'name',
required: true,
hidden: true
},
{
label: '请选择产品',
onlyLabel: true,
required: true,
noBorder: true
},
{
label: '前挡',
value: 'frontGear',
type: 'select',
key: 'name',
labellIcon: 'front-gear',
addHtml: 'frontGear',
hidden: true
},
{
label: '前侧窗玻璃',
value: 'frontWindow',
type: 'select',
key: 'name',
labellIcon: 'front-window',
addHtml: 'frontWindow',
hidden: true
},
{
label: '后侧窗玻璃',
value: 'rearGear',
type: 'select',
key: 'name',
labellIcon: 'rear-gear',
addHtml: 'rearGear',
hidden: true
},
{
label: '后档',
value: 'rearWindow',
type: 'select',
key: 'name',
labellIcon: 'rear-window',
addHtml: 'rearWindow',
hidden: true
},
{
label: '天窗',
value: 'sunRoof',
type: 'select',
key: 'name',
labellIcon: 'sun-roof',
addHtml: 'sunRoof',
hidden: true
},
{
label: '套餐',
value: 'package',
type: 'select',
key: 'name',
addHtml: 'package',
hidden: true
},
{
label: '其他精品',
value: 'skuGoods',
type: 'select',
key: 'name',
addHtml: 'skuGoods',
hidden: true
},
{
label: '收款方式',
value: 'payee',
type: 'radio', type: 'radio',
key: 'name', current: '0',
current: '1',
radioList: [ radioList: [
{ {
value: '0', value: '0',
name: '嘀加收款', name: '售前'
disabled: false
}, },
{ {
value: '1', value: '1',
name: '4s店收款', name: '售后'
disabled: false
} }
], ],
hidden: true required: true
}, },
{ {
label: '支付方式',
value: 'payType',
type: 'radio',
key: 'name',
current: '0',
radioList: [
// {
// value: '3',
// name: 'POS机'
// },
// {
// value: '6',
// name: '对公转账'
// },
// {
// value: '7',
// name: '其他收款'
// }
],
addHtml: 'otherPay',
hidden: true
}
],
[
{
label: '车主拒升理由', label: '车主拒升理由',
value: 'refusalReason', value: 'refusalReason',
maxlength: '30', maxlength: '30',
...@@ -622,7 +423,7 @@ const UpdateOrderInfo = [ ...@@ -622,7 +423,7 @@ const UpdateOrderInfo = [
{ {
label: '车架号(VIN码)', label: '车架号(VIN码)',
value: 'carVin', value: 'carVin',
maxlength: '10', maxlength: '17',
type: 'input' type: 'input'
}, },
{ {
......
...@@ -84,7 +84,7 @@ export default { ...@@ -84,7 +84,7 @@ export default {
if (this.toolComponentName === selectedItem.name && (!this.transmissionOfData || this.transmissionOfData.type !== 'supplementOrder')) return if (this.toolComponentName === selectedItem.name && (!this.transmissionOfData || this.transmissionOfData.type !== 'supplementOrder')) return
// 如果当前组件是OrderManagement,直接切换组件,不显示弹窗 // 如果当前组件是OrderManagement,直接切换组件,不显示弹窗
// 只有从CreateOrder、DefeatOrder切换其他组件时需要二次确认 // 只有从CreateOrder、DefeatOrder切换其他组件时需要二次确认
if (this.toolComponentName !== 'CreateOrder' && this.toolComponentName !== 'DefeatOrder') { if (this.toolComponentName !== 'CreateOrder' && this.toolComponentName !== 'DefeatOrder' && this.toolComponentName !== 'UpdateOrderInfo') {
this.toolComponentName = selectedItem.name this.toolComponentName = selectedItem.name
this.transmissionOfData = null this.transmissionOfData = null
return return
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!