Commit 51758c19 by 胡悦

Merge branch 'SAAS+V5.5.0' of http://192.168.3.233:8090/glsx/gl_tape into SAAS+V5.5.0

2 parents 30883c2c 4dfd218f
...@@ -336,6 +336,7 @@ module.exports = { ...@@ -336,6 +336,7 @@ module.exports = {
* 保存日报 * 保存日报
*/ */
saveStaffDailyReport (data) { saveStaffDailyReport (data) {
data.dailyReportSource = 2
return http.post({ return http.post({
method: 'dj.api.smartcarlife.staff.daily.report.save', method: 'dj.api.smartcarlife.staff.daily.report.save',
projectName: 'boutique', projectName: 'boutique',
...@@ -391,9 +392,4 @@ module.exports = { ...@@ -391,9 +392,4 @@ module.exports = {
...data ...data
}) })
}, },
// // 查询店铺配置
// getShopMerchantPointConfig(data) {
// return api.post('dj.api.smartcarlife.shopMerchantPointConfig.get', data)
// },
} }
import http from '../request/http' import http from '../request/http'
module.exports = { module.exports = {}
/** 报价单分页列表 */
quotationPage(data) {
return http.post({
method: 'dj.api.smartcarlife.vehicle.damage.upgrade.quotation.page',
projectName: 'boutique',
...data
})
},
/** 根据id查询报价单数据 */
getQuotationInfo(data) {
return http.post({
method: 'dj.api.smartcarlife.vehicle.damage.upgrade.quotation.generate',
projectName: 'boutique',
...data
})
},
/** 查询报价单信息 */
getQuotationInfoById(data) {
return http.post({
method: 'dj.api.smartcarlife.vehicle.damage.upgrade.quotation.find.by.id',
projectName: 'boutique',
...data
})
},
/** 修改车损报价单客户基本信息信息 */
updateCustomerInfo(data) {
return http.post({
method: 'dj.api.smartcarlife.vehicle.damage.upgrade.quotation.customer.base.info.update',
projectName: 'boutique',
...data
})
},
/** 报价单订单分状态统计信息 */
orderStatistics(data) {
return http.post({
method: 'dj.api.smartcarlife.vehicle.damage.upgrade.quotation.order.status.statistics',
projectName: 'boutique',
...data
})
}
}
import http from '../request/http'
module.exports = {
/**新建车损报价单 */
quotationAdd(data) {
return http.post({
method: 'dj.api.smartcarlife.vehicle.damage.upgrade.quotation.add',
projectName: 'boutique',
...data
})
},
/** 报价单支付订单生成(带上签名)返回订单号(商户地址) */
quotationUpgrade(data) {
return http.post({
method: 'dj.api.smartcarlife.vehicle.damage.upgrade.quotation.pay.order.generate',
projectName: 'boutique',
...data
})
},
// 校验订单是否需要上传合同协议
checkZyPayFlag(data) {
return http.post({
method: 'dj.api.smartcarlife.vehicle.damage.upgrade.quotation.zyPayUrl.check',
projectName: 'boutique',
...data
})
},
// 查询店铺配置
getShopMerchantPointConfig(data) {
return http.post({
method: 'dj.api.smartcarlife.shopMerchantPointConfig.get',
projectName: 'boutique',
...data
})
},
/** 查询报价单信息 */
getQuotationInfoById(data) {
return http.post({
method: 'dj.api.smartcarlife.vehicle.damage.upgrade.quotation.find.by.id',
projectName: 'boutique',
...data
})
},
/**
* 订单详情
*/
getOrderDetail(data) {
return http.post({
method: 'dj.api.smartcarlife.order.detail',
projectName: 'boutique',
...data
})
},
/**pos支付 */
getPosQr(data) {
return http.post({
method: 'dj.api.smartcarlife.payOrder.create',
projectName: 'boutique',
...data
})
},
/** 报价单分页列表 */
quotationPage(data) {
return http.post({
method: 'dj.api.smartcarlife.vehicle.damage.upgrade.quotation.page',
projectName: 'boutique',
...data
})
},
/** 根据id查询报价单数据 */
getQuotationInfo(data) {
return http.post({
method: 'dj.api.smartcarlife.vehicle.damage.upgrade.quotation.generate',
projectName: 'boutique',
...data
})
},
/** 修改车损报价单客户基本信息信息 */
updateCustomerInfo(data) {
return http.post({
method: 'dj.api.smartcarlife.vehicle.damage.upgrade.quotation.customer.base.info.update',
projectName: 'boutique',
...data
})
},
/** 报价单订单分状态统计信息 */
orderStatistics(data) {
return http.post({
method: 'dj.api.smartcarlife.vehicle.damage.upgrade.quotation.order.status.statistics',
projectName: 'boutique',
...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
})
}
}
...@@ -11,7 +11,7 @@ import sceneMarketApi from './sceneMarketApi' ...@@ -11,7 +11,7 @@ import sceneMarketApi from './sceneMarketApi'
import interceptionApi from './interceptionApi' import interceptionApi from './interceptionApi'
import popupApi from './popupApi' import popupApi from './popupApi'
import usedCarApi from './usedCar' import usedCarApi from './usedCar'
import equitApi from './equit' import equityApi from './equity'
module.exports = { module.exports = {
commonApi, commonApi,
...@@ -27,5 +27,5 @@ module.exports = { ...@@ -27,5 +27,5 @@ module.exports = {
evaluationApi, evaluationApi,
usedCarApi, usedCarApi,
activityApi, activityApi,
equitApi equityApi
} }
...@@ -213,6 +213,9 @@ ...@@ -213,6 +213,9 @@
.px-20 { .px-20 {
padding: 0 toRpx(20); padding: 0 toRpx(20);
} }
.px-24 {
padding: 0 toRpx(20);
}
.px-32 { .px-32 {
padding: 0 toRpx(32); padding: 0 toRpx(32);
} }
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
:class="[ :class="[
{'sub-brand-name':j.isTitle}, {'sub-brand-name':j.isTitle},
{'item flex':!j.isTitle}, {'item flex':!j.isTitle},
{active: (currentId ? j.id == currentId : (j.id == (data.customer ? data.customer[params.idKey] : '') || j.id == data[params.idKey])) && !j.isTitle} {active:checkActive(j) && !j.isTitle}
]" ]"
@click="choose(j,c)" @click="choose(j,c)"
> >
...@@ -184,7 +184,14 @@ export default { ...@@ -184,7 +184,14 @@ export default {
} }
this.currentId = that.id this.currentId = that.id
this.$emit('choose', chooseItem) this.$emit('choose', chooseItem)
} },
checkActive (j) {
let { currentId, data, params, sceneType } = this
return (currentId ?
j.id == currentId :
sceneType == 0 ? j.id == data.carInfo[params.idKey] || '' :
(j.id == (data.customer ? data.customer[params.idKey] : '') || j.id == data[params.idKey]))
},
} }
} }
</script> </script>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
> >
{{currentIds[0] || '选择省份'}} {{currentIds[0] || '选择省份'}}
</view> </view>
<view :class="['step flex',{'step-active':currentStep == 2}]">{{currentIds[1]|| '选择城市'}}</view> <view :class="['step flex',{'step-active':currentStep == 2}]">{{currentIds[1]||'选择城市'}}</view>
</view> </view>
<scroll-view <scroll-view
class="scroll-view" class="scroll-view"
...@@ -152,8 +152,14 @@ export default { ...@@ -152,8 +152,14 @@ export default {
}) })
this.updateParams(params, province) this.updateParams(params, province)
}, },
initData (data) { initData (listData) {
this.list = data let {data, params:{idKeys}} = this,
[provinceKey, cityKey] = idKeys
if(data[cityKey]){
this.currentIds = [data[provinceKey], data[cityKey]]
this.currentStep = 2
}
this.list = listData
this.$emit('onComplete') this.$emit('onComplete')
}, },
choose (item) { choose (item) {
...@@ -169,7 +175,7 @@ export default { ...@@ -169,7 +175,7 @@ export default {
} else { } else {
this.currentIds = [name] this.currentIds = [name]
this.currentStep = 2 this.currentStep = 2
this.scrollTop = 10 this.scrollTop = 1
setTimeout(() => { setTimeout(() => {
this.scrollTop = 0 this.scrollTop = 0
}, 100) }, 100)
......
...@@ -62,8 +62,7 @@ export default { ...@@ -62,8 +62,7 @@ export default {
this.getList(searchValue, true) this.getList(searchValue, true)
}, },
choose (i) { choose (i) {
let { params: { idKey } } = this this.currentId = i.customerPhone
this.currentId = i[idKey]
this.$emit('choose', i) this.$emit('choose', i)
}, },
checkActive (i) { checkActive (i) {
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<view <view
:key="index" :key="index"
@click="choose(i)" @click="choose(i)"
:class="['item flex', { active: currentId ? i.uuid == currentId : i.uuid == data[params.idKey] }]" :class="['item flex', { active: checkActive(i) }]"
> >
<view class="sprite-icon icon-tag-checked"></view> <view class="sprite-icon icon-tag-checked"></view>
{{ i.staffName }} {{ i.staffName }}
...@@ -23,6 +23,12 @@ export default { ...@@ -23,6 +23,12 @@ export default {
return { return {
} }
}, },
computed: {
idKey () {
let { params: { idKey }, sceneType } = this
return idKey[sceneType] || idKey
}
},
mounted () { mounted () {
}, },
methods: { methods: {
...@@ -55,19 +61,28 @@ export default { ...@@ -55,19 +61,28 @@ export default {
this.getList(searchValue, true) this.getList(searchValue, true)
}, },
choose (i) { choose (i) {
console.log('choose', i) let { idKey, data } = this,
let { params: { idKey }, data } = this, userId = data.deliveryUserId,
referrerId = data.deliveryId,
deliveryUserId = data.userId,
deliveryId = data.referrerId,
value = { value = {
userId: data.deliveryUserId, userId,
deliveryUserId: data.userId deliveryUserId,
referrerId,
deliveryId
}[idKey] }[idKey]
if ((idKey == 'userId' || idKey == 'deliveryUserId') && value == i.uuid) return uni.showToast({ if (['referrerId', 'userId', 'deliveryId', 'deliveryUserId'].includes(idKey) && value == i.uuid) return uni.showToast({
title: '销售顾问/录单员与交付专员不能选取同一人', title: '销售顾问/录单员与交付专员不能选取同一人',
icon: 'none', icon: 'none',
mask: true mask: true
}) })
this.currentId = i.uuid this.currentId = i.uuid
this.$emit('choose', i) this.$emit('choose', i)
},
checkActive (i) {
let { currentId, idKey, data } = this
return currentId ? i.uuid == currentId : i.uuid == data[idKey]
} }
} }
} }
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
<template v-for="(i, index) in list"> <template v-for="(i, index) in list">
<!-- v-if="i.goodsFlag == 3" --> <!-- v-if="i.goodsFlag == 3" -->
<view <view
:key="`${index}_${i.key}`" :key="`${index}_${i.key}`"
@click.stop="choose(i, index)" @click.stop="choose(i, index)"
:class="['item', { hide: !i.show }, { active: checkActive(i) }, { single: i.goodsFlag == 1 }]" :class="['item', { hide: !i.show }, { active: checkActive(i) }, { single: i.goodsFlag == 1 }]"
...@@ -29,7 +28,7 @@ ...@@ -29,7 +28,7 @@
class="filled" class="filled"
></uni-icons> ></uni-icons>
</view> </view>
<text class="goods-name text-hide"> <text class="goods-name">
<template v-if="sceneType == 1"> <template v-if="sceneType == 1">
{{ replaceItemText(i.goods, 'goodsAlias') {{ replaceItemText(i.goods, 'goodsAlias')
|| replaceItemText(i.goods, 'upgradeGoodsName') || replaceItemText(i.goods, 'upgradeGoodsName')
...@@ -133,7 +132,9 @@ ...@@ -133,7 +132,9 @@
class="filled" class="filled"
></uni-icons> ></uni-icons>
</view> </view>
<text class="goods-name">
{{ i.packageGoods.packageAlias || i.packageGoods.packageName }} {{ i.packageGoods.packageAlias || i.packageGoods.packageName }}
</text>
<text class="price">¥{{ i.packageGoods.sellPrice }}</text> <text class="price">¥{{ i.packageGoods.sellPrice }}</text>
</view> </view>
<view class="package-list"> <view class="package-list">
...@@ -286,9 +287,8 @@ export default { ...@@ -286,9 +287,8 @@ export default {
arr.push(val) arr.push(val)
} }
if (val.goodsFlag == 3) { if (val.goodsFlag == 3) {
let item = val.packageGoods let { goodsList } = val.packageGoods
val.packageGoods.goodsList = item.goodsList.map(item => { val.packageGoods.goodsList = goodsList.map(item => {
;
(item.specificationNameSequence = (item.specificationNameSequence =
item.specificationTypeSequence && item.specificationNameSequence ? item.specificationTypeSequence && item.specificationNameSequence ?
item.specificationNameSequence.replace(/;~;/g, '/') : item.specificationNameSequence.replace(/;~;/g, '/') :
...@@ -297,9 +297,11 @@ export default { ...@@ -297,9 +297,11 @@ export default {
item.specificationTypeSequence && item.specificationData ? item.specificationTypeSequence && item.specificationData ?
item.specificationData.replace(/;~;/g, '/') : item.specificationData.replace(/;~;/g, '/') :
'') '')
item.number = 1
item.price = item.sellPrice
return item return item
}) })
val.packageGoods.sellPrice = item.goodsList.reduce((pre, item) => { val.packageGoods.sellPrice = goodsList.reduce((pre, item) => {
pre = NP.plus(pre, item.sellPrice) pre = NP.plus(pre, item.sellPrice)
return pre return pre
}, 0) }, 0)
...@@ -548,6 +550,9 @@ export default { ...@@ -548,6 +550,9 @@ export default {
.title { .title {
min-height: toRpx(88); min-height: toRpx(88);
padding: toRpx(24) 0 toRpx(20); padding: toRpx(24) 0 toRpx(20);
.goods-name {
max-width: 80%;
}
} }
.base-tips { .base-tips {
margin-bottom: 20rpx; margin-bottom: 20rpx;
......
...@@ -27,7 +27,7 @@ const componentConfig = { ...@@ -27,7 +27,7 @@ const componentConfig = {
name: 'EmployeeList', name: 'EmployeeList',
title: '销售顾问/录单员', title: '销售顾问/录单员',
placeholder: '请输入姓名', placeholder: '请输入姓名',
idKey: 'userId', idKey: ['referrerId', 'userId'],
cacheData: [], cacheData: [],
loadComplete: false, loadComplete: false,
searchValue: '', searchValue: '',
...@@ -38,7 +38,7 @@ const componentConfig = { ...@@ -38,7 +38,7 @@ const componentConfig = {
title: '交付专员', title: '交付专员',
placeholder: '请输入姓名', placeholder: '请输入姓名',
nullTips: '请选择交付专员', nullTips: '请选择交付专员',
idKey: 'deliveryUserId', idKey: ['deliveryId', 'deliveryUserId'],
cacheData: [], cacheData: [],
loadComplete: false, loadComplete: false,
searchValue: '', searchValue: '',
...@@ -67,6 +67,7 @@ const componentConfig = { ...@@ -67,6 +67,7 @@ const componentConfig = {
title: '选择车型', title: '选择车型',
placeholder: '查找', placeholder: '查找',
idKey: 'carSeriesId', idKey: 'carSeriesId',
nullTips: '请选择车型',
cacheData: [], cacheData: [],
loadComplete: false, loadComplete: false,
searchValue: '', searchValue: '',
...@@ -201,21 +202,21 @@ const componentConfig = { ...@@ -201,21 +202,21 @@ const componentConfig = {
nullTips: '请选择所在城市', nullTips: '请选择所在城市',
cacheData: [], cacheData: [],
noData: false, noData: false,
idKeys: ['province','city'] idKeys: ['provinceText', 'cityText']
}, },
18:{ 18: {
name:'Seat', name: 'Seat',
title:'座位数', title: '座位数',
idKey: 'seat', idKey: 'seat',
hideSearch: true, hideSearch: true,
loadComplete: false, loadComplete: false,
}, },
19:{ 19: {
name:'Customer', name: 'Customer',
title:'客户档案', title: '客户档案',
loadComplete: false, loadComplete: false,
placeholder: '查找', placeholder: '查找',
idKey: 'customerPhone', idKey: 'phone',
cacheData: [], cacheData: [],
loadComplete: false, loadComplete: false,
searchValue: '', searchValue: '',
......
...@@ -98,6 +98,7 @@ export default { ...@@ -98,6 +98,7 @@ export default {
return { return {
userInfo: this.userInfo, userInfo: this.userInfo,
baseConfigData: this.baseConfigData, baseConfigData: this.baseConfigData,
sceneType: this.sceneType
} }
}, },
data () { data () {
...@@ -145,6 +146,10 @@ export default { ...@@ -145,6 +146,10 @@ export default {
}, },
baseConfigData () { baseConfigData () {
return this.$store.state.boutique.baseConfigData return this.$store.state.boutique.baseConfigData
},
sceneType(){
const { sceneType } = uni.$storage.get('userInfo')
return sceneType
} }
}, },
mounted () { mounted () {
......
<template>
<view class="order-confirm">
<view class="common-title">工单确认</view>
<view class="px-48 scroll-y" v-if="orderInfo">
<view class="top-tips flex align-center" v-if="orderInfo.selectPayType == 3 || orderInfo.selectPayType == 1">
<text class="fs-32 fw-7">等待客户付款</text>
<text class="fs-26 ml-12">点击下一步,锁定并生成工单码。</text>
</view>
<view class="top-tips flex align-center" v-if="orderInfo.selectPayType == 2 || orderInfo.selectPayType == 5 || orderInfo.selectPayType == 6 || orderInfo.selectPayType == 7">
<view class="fs-32 fw-7">请上传付款凭证结束工单</view>
<view class="fs-26 ml-12">点击确认工单,提交付款凭证。</view>
</view>
<view class="top-tips flex align-center" v-if="orderInfo.selectPayType == 0 || orderInfo.selectPayType == null">
<view class="fs-32 fw-7">请提交客户拒绝升级原因</view>
<view class="fs-26 ml-12">点击确认工单,根据操作结束工单。</view>
</view>
<view v-if="!isErrorOrder && (orderInfo.selectPayType == 2 || orderInfo.selectPayType == 5 || orderInfo.selectPayType == 6 || orderInfo.selectPayType == 7)" class="box date-box box-shell flex justify-between align-center">
<view class="date-box-label">
收款时间
<text class="required">*</text>
</view>
<view class="flex justify-between align-center">
<view class="date-box-value">{{ successDate }}</view>
<view class="handlerBtn" @click.stop="openDate">编辑</view>
</view>
</view>
<!-- 商品信息 -->
<view class="box-shell">
<view class="box-shell-title">商品信息</view>
<!-- 套餐 -->
<view class="meal-box" v-for="(item, index) in orderInfo.packageGoodsList">
<view class="meal-hd flex justify-between align-center">
<view>{{ item.packageAlias || item.packageName }}</view>
<view class="price">¥{{ item.totalPrice }}</view>
</view>
<view class="meal-bd">
<view class="meal-bd-box" v-for="g in item.packageGoodsOrderList">
<view class="meal-bd-head flex justify-between align-center">
<view class="flex align-center">
<view class="name">{{ g.upgradeGoodsAlias || g.upgradeGoodsName }}</view>
<view class="meal-bd-bottom flex align-center">
{{ g.upgradeGoodsType === 1 ? g.positionStr : g.upgradeGoodsTypeName }}
<view class="count">x{{ g.number }}</view>
</view>
</view>
<view class="price">¥{{ g.price }}</view>
</view>
</view>
</view>
</view>
<view class="good-list">
<view class="good mt-16" v-for="(item, index) in orderInfo.subOrderList">
<view class="flex justify-between align-center">
<text class="good-name">商品名称:{{ replaceItemText(item.upgradeGoodsName) || '' }}</text>
<text class="good-price">¥{{ item.price }}</text>
</view>
<view class="flex justify-between align-center pt-12">
<text class="good-alias">商品别名:{{ replaceItemText(item.upgradeGoodsAlias) || '' }}</text>
</view>
<view class="flex align-center pt-24">
<text class="good-sku">{{ item.positionStr || item.upgradeGoodsTypeName }}</text>
<text class="good-count">x{{ item.number }}</text>
</view>
</view>
</view>
<view class="flex align-center py-16 coupon" v-if="orderInfo">
<view class="sprite-icon icon-coupon"></view>
<text class="fs-28 coupon-name">{{ orderInfo.couponName || '' }}{{ orderInfo.customerCoupon.customerCouponCode || '' }}({{ orderInfo.customerCoupon.employeeName || '' }})</text>
</view>
<view class="flex justify-end align-center mt-24" v-if="orderInfo">
<text class="good-total-lable">商品总金额:</text>
<text class="good-total-value">
<text class="unit">¥</text>
{{ orderInfo.total_price }}
</text>
</view>
</view>
<!-- 工单信息 -->
<view class="box-shell">
<view class="box-shell-title">工单信息</view>
<view class="order-info pt-16">
<view v-for="(item, index) in orderObj" :key="index" class="flex align-center pt-16">
<view class="label">{{ item.label }}</view>
<view v-if="item.key == 'status'">
<view class="value" :style="{ color: status[orderInfo.status].color || '' }">
{{ status[orderInfo.status].text }}
</view>
</view>
<view v-else>
<view class="value">
<view v-if="item.key == 'payType'">
{{ payType[orderInfo.selectPayType] || '' }}
</view>
<view v-else>{{ orderInfo[item.key] || '' }}</view>
</view>
</view>
<view v-if="item.copy" class="copy-btn" @click="setCopyData(orderInfo[item.key])">
<view class="sprite-icon icon-icon-copy copy"></view>
</view>
<view class="customize-btn" v-if="item.dateChange" @click.stop="customizeDate">自定义</view>
</view>
<view v-if="(orderInfo.selectPayType == 2 || orderInfo.selectPayType == 5 || orderInfo.selectPayType == 6 || orderInfo.selectPayType == 7) && orderInfo.payVoucherList.length">
<view class="flex align-center pt-8">
<view class="label">付款凭证</view>
<view class="image-box">
<view class="value" @click.stop="previewImage" v-for="(item, index) in orderInfo.payVoucherList" :key="index">
<view class="image">
<!-- <image src="{{item.payVoucher}}" /> -->
</view>
</view>
</view>
</view>
</view>
<view v-if="orderInfo.status == 5 || orderInfo.status == 12">
<view class="flex align-center pt-8">
<view class="label">退款明细</view>
<view class="value">{{ orderInfo.refundType == 1 ? '退全款' : '退部分款' }}¥{{ orderInfo.refundAmount }}</view>
</view>
</view>
<view class="paid" v-if="orderInfo.payOrder && orderInfo.payOrder.payStatus == 2">
<!-- <image src="../../images/paid.png" /> -->
</view>
</view>
</view>
<!-- 客户信息 -->
<view class="box-shell">
<view class="box-shell-title">客户信息</view>
<view class="order-info pt-16">
<view class="flex align-center pt-16" v-for="(item, index) in customerObj" :key="index">
<view class="label">{{ item.label }}</view>
<view class="flex flex-1">
<view class="value" :style="{ color: item.color || '#333' }">
<view v-if="item.arr">
<view v-if="orderInfo[item.arr[1]]" class="flex">
<view v-for="(i, ind) in item.arr" :key="ind">
<view class="value-item text-hide">
<text v-if="ind == 1" class="lineText">|</text>
{{ orderInfo[i] }}
</view>
</view>
</view>
</view>
<view v-else>
{{ item.enum ? item.enum[orderInfo[item.key]] : orderInfo[item.key] || '' }}
</view>
</view>
<view v-if="item.copy" class="copy-btn" @click="setCopyData(orderInfo[item.key])">
<view class="sprite-icon icon-icon-copy copy"></view>
</view>
</view>
</view>
</view>
<view v-if="orderInfo.selectPayType == 0">
<view class="flex align-center pt-8">
<view class="label">拒升理由</view>
<view class="value">
{{ orderInfo.customer.refusalReason ? orderInfo.customer.refusalReason : '' }}
</view>
</view>
</view>
</view>
<view class="flex align-center footer-box justify-center">
<view class="edit btn" @click.stop="edit">修改</view>
<view class="confirm btn" @click.stop="confirm">确认</view>
</view>
</view>
<PublishPopup ref="tipsPopup" popupClass="tipsPopup" type="center" :showClose="true" :showTitle="false" @confirm="confirmTips">
<template #content>
<view>
<image class="tipsPopupBg" :src="popupBg" />
<view class="title">重要提示</view>
<view class="tipsConent">
<view>请检查店内是否配备POS机,确认信息后该工单将无法撤销或修改!</view>
<view>若4S店已向车主收款,请返回修改支付方式为</view>
<text>"门店收款"</text>
</view>
</view>
</template>
</PublishPopup>
<PublishPopup ref="calendarPopup" popupClass="calendarPopup" :showClose="false" :showTitle="false" @confirm="confirmCalendar">
<template #content>
<uni-calendar class="calendar" :showMonth="false" :endDate="endDate" @change="calendarChange" />
</template>
</PublishPopup>
<order-popup ref="openDate" popupType="13" @onConfirm="confirmDate" />
<PublishPopup ref="payPopup" popupClass="payPopup" type="center" :isShowFooter="false">
<template #header>
<view class="popup-top">
<view class="popup-top-box flex align-center">
<text class="popup-top-box-title">工单确认码</text>
<view @click.stop="closePopup">
<uni-icons @click.stop="closePopup" class="icon-close" type="closeempty"></uni-icons>
</view>
</view>
</view>
</template>
<template #content>
<view class="pos-popup" v-if="orderInfo">
<view class="price">¥{{ orderInfo.total_price }}</view>
<image class="qrcode" :src="orderInfo.selectPayType == 1 ? wxqrcode : posQrCode"></image>
<view class="level-1-tips">{{ orderInfo.selectPayType == 1 ? '请让客户打开微信扫描上方付款码进行支付' : '请使用POS机扫描此码,再向客户收款' }}</view>
<view class="level-2-tips">超过24小时未支付将关闭此订单</view>
</view>
</template>
</PublishPopup>
</view>
</template>
<script>
import utils from '@/utils/utils'
import qrcode from '@/utils/qrcode'
import order_mixins from '../../order_mixins.js'
import dayjs from 'dayjs'
import PublishPopup from '@/components/PublishPopup.vue'
import OrderPopup from '@/components/OrderPopup/index.vue'
import { debounce } from 'lodash'
export default {
name: 'OrderConfirm',
props: {
transmissionOfData: {
type: Object,
default: () => ({})
}
},
components: {
PublishPopup,
OrderPopup
},
watch: {
transmissionOfData: {
handler(newVal) {
if (newVal) {
console.log('接收到的交易数据:', newVal)
this.getPositionList()
// "this.transmissionOfData.orderCode"
this.getDetail(this.transmissionOfData.orderCode)
this.successDate = dayjs().format('YYYY-MM-DD HH:mm:00')
}
},
immediate: true
}
},
data() {
return {
...order_mixins.data,
popupBg: require('@/assets/images/boutique/tipsPopupBg.png'),
positionTypeList: [],
isErrorOrder: false,
orderInfo: null,
successDate: null,
selectDate: null,
time: null,
wxqrcode: '',
posQrCode: '',
endDate: dayjs().format('YYYY-MM-DD')
}
},
mounted() {
// this.getPositionList()
// // "this.transmissionOfData.orderCode"
// this.getDetail('250826172036851')
// this.successDate = dayjs().format('YYYY-MM-DD HH:mm:ss')
},
methods: {
replaceItemText(item) {
var reg = getRegExp(';~;', 'g')
return item ? item.replace(reg, ' ') : ''
},
async getDetail(orderCode) {
console.log(orderCode)
let _this = this
uni.$api.boutiqueApi
.getPackageGoodsDetail({
orderCode
})
.then(data => {
if (data.payOrder && data.payOrder.payStatus == 2) {
if (this.time) clearInterval(this.time)
this.$emit('jump', 'OrderDetail', data)
return
}
let couponName = data.customerCoupon ? data.customerCoupon.couponName : ''
let total_price = 0
let warrantyCardList = []
for (var i = 0; i < data?.subOrderList?.length; i++) {
let e = data?.subOrderList[i]
total_price += e.totalPrice
e.price = Number(utils.decimal(Number(e.totalPrice / e.number), 2)).toFixed(2)
e.positionStr = this.positionTypeList.filter(v => v.positionValue == e.upgradeGoodsPosition)[0]?.positionName || ''
if (e.upgradeWarrantyPeriod || e.upgradeWarrantyPeriod > 0) {
warrantyCardList.push({
warrantyPeriod: e.upgradeWarrantyPeriod,
goodsName: e.upgradeGoodsAlias || e.upgradeGoodsName
})
}
}
data.packageGoodsList?.forEach(item => {
item.packageGoodsOrderList.forEach(g => {
g.price = g.totalPrice ? Number(g.totalPrice) / Number(g.number) : g.upgradePrice
})
item.goodsList = item.packageGoodsOrderList
item.price = item.goodsList.reduce((prev, cur) => {
return prev + Number(cur.totalPrice) / Number(cur.number)
}, 0)
item.count = item.goodsList.length ? item.goodsList[0].number : 1
let total = item.price * item.count
item.totalPrice = utils.decimal(total, 2)
item.packageGoodsOrderList.forEach(g => {
g.positionStr = this.positionTypeList.filter(v => v.positionValue == g.upgradeGoodsPosition)[0]?.positionName || ''
})
total_price += item.totalPrice
})
data = {
...data.customer,
...data.payOrder,
...data,
packageGoodsList: data.packageGoodsList,
couponName,
total_price: Number(utils.decimal(total_price, 2)).toFixed(2)
}
if (data.orderTime) data.time = dayjs(new Date(data.orderTime)).format('YYYY-MM-DD HH:mm:ss')
if (data.customerCoupon) {
data.customerCoupon.customerCouponCode = data.customerCoupon.customerCouponCode.split('-')[0]
}
if (data.customer.carSeriesName) {
data.carType = `${data.customer.carBrand || ''}-${data.customer.carChildsBrandName || ''}-${data.customer.carSeriesName || ''}`
}
_this.orderInfo = data
console.log('data', _this.orderInfo)
_this.flag = true
_this.warrantyCardList = warrantyCardList
// 校验是否显示二级流量方
if (data.subShopMerchantName) {
if (_this.customerObj.findIndex(val => val?.key && val.key == 'subShopMerchantName') < 0) {
_this.customerObj[_this.customerObj.length - 2] = {
label: '二级流量方',
key: 'subShopMerchantName'
}
}
}
// 是2:门店收款 5:嘀加收款 6:对公转账 7:其它收款并且不是错误订单 自动打开门店收款弹窗
// if (!_this.isErrorOrder && [2, 5, 6, 7].includes(Number(data.selectPayType))) {
// _this.toshowDateModal()
// }
// 获取园区店技师配置信息
uni.$api.boutiqueApi
.getQYTechnicianList({
yqMerchantId: uni.$storage.get('userInfo')?.merchantId
})
.then(respone => {
if (respone?.code == 0) {
if (respone?.data.length > 0) this.isArtificer(respone.data)
}
})
// } else {
// wx.showModal({
// title: '温馨提示',
// content: message,
// showCancel: false,
// confirmText: '刷新',
// confirmColor: '#347BFF',
// success(res) {
// if (res.confirm) {
// _this.getDetail(orderCode)
// }
// }
// })
// }
})
},
async getPositionList() {
const res = await uni.$api.boutiqueApi.getPositionList({})
this.positionTypeList = res
},
setCopyData(e) {
utils.setCopyData(`${e}`)
},
confirm() {
this.checkPayType()
},
edit() {
const data = { ...this.orderInfo }
// 处理subOrderList 商品为空的情况
console.log(this.orderInfo, '跳转')
data.subOrderList = data.subOrderList.filter(item => item.merchantGoodsId)
if (data.packageGoodsList && data.packageGoodsList.length) {
data.subOrderList = data.subOrderList.concat(data.packageGoodsList)
}
// 商品是否包含太阳膜
data.isFilmOrder = data.subOrderList?.findIndex(subE => subE?.upgradeGoodsType == 1) > -1
this.$emit('jump', 'CreateOrder', { paramsData: data, type: 'createWithPay' })
},
confirmDate(date) {
const { chooseContent } = date
this.successDate = dayjs(chooseContent).format('YYYY-MM-DD HH:mm:00')
console.log(this.successDate)
},
calendarChange(date) {
console.log(date)
this.selectDate = date.year + '-' + date.month + '-' + date.date
},
confirmCalendar() {
this.rangeSelect(this.selectDate)
},
// 生成小程序码
createWxQrcode() {
let _this = this
let oParams = {}
let { sessionId } = uni.$storage.get()
oParams.appId = this.orderInfo.paymentChannel.wechatAppId
oParams.qrcodeType = 'QR_WXA_UNLIMIT'
oParams.path = 'packagesPayment/pages/payment/index'
// oParams.path = 'packagesPayment/pages/QRPayment/QRPayment'
// oParams.scene = `merchantId=111`
oParams.scene = `orderCode=${this.orderInfo.orderCode}&workWxSessionId=${sessionId}`
oParams.channelType = 1
// B端小程序调用接口生成领券码时,传参userId用uuid,类型由int变string
uni.$api.boutiqueApi.createQrcodeImage(oParams).then(data => {
_this.wxqrcode = data
})
},
// 修改订单时间
rangeSelect(date) {
let { orderInfo } = this
let params = {
orderCode: orderInfo.orderCode,
orderTime: date + ' 00:00:00'
}
uni.$api.boutiqueApi
.updateOrderTime(params)
.then(result => {
if (result) {
uni.showToast({ title: '修改日期成功' })
this.orderInfo.time = params.orderTime
} else {
uni.showToast({ title: '修改日期失败' })
}
})
.catch(err => {
console.log(err)
})
this.$refs.calendarPopup.closePopup()
},
closePopup() {
console.log('关闭')
this.$refs.payPopup.closePopup()
},
async checkPayType() {
console.log(this.orderInfo.selectPayType, 'this.orderInfo.selectPayType')
let _this = this
// 微信支付
if (this.orderInfo.selectPayType == 1) {
await this.createWxQrcode()
this.$refs.payPopup.open()
_this.getDetail(this.orderInfo.orderCode)
if (!this.time) {
this.time = setInterval(() => {
_this.getDetail(_this.orderInfo.orderCode)
}, 5 * 1000)
}
return false
}
// pos机支付
if (this.orderInfo.selectPayType == 3) {
if (this.orderInfo.status == 1) {
this.$refs.tipsPopup.open()
} else {
_this.createPayOrder()
}
} else {
if (!this.successDate && !this.isErrorOrder && this.orderInfo.selectPayType != 0) return uni.showToast({ title: this.orderInfo.selectPayType == 2 ? '请选择4S店收款时间' : '请选择嘀加收款时间' })
this.$emit('jump', 'UploadProofOfPayment', { orderCode: this.orderInfo.orderCode, payType: this.orderInfo.selectPayType, payeeType: this.orderInfo.payeeType, successDate: this.successDate })
}
},
confirmTips() {
this.createPayOrder()
},
openDate() {
this.$refs.openDate.open()
},
customizeDate() {
console.log(this.$refs.calendarPopup, 'this.$refs.calendarPopup')
this.$refs.calendarPopup.open()
},
createPayOrder() {
let {
orderInfo: { selectPayType, orderCode, payeeType },
outTradeNo,
payVoucherList,
successDate,
isErrorOrder
} = this
let obj = {
orderCode,
payType: selectPayType,
payeeType: payeeType
}
// 支付方式 2:门店收款 5:嘀加收款 6:对公转账 7:其它收款
if ([2, 5, 6, 7].includes(Number(selectPayType)) && !isErrorOrder) {
obj.successDate = successDate
}
if (payVoucherList?.length && outTradeNo) {
obj.payVoucherList = payVoucherList.map(v => {
return v?.url
})
obj.outTradeNo = outTradeNo
}
console.log(obj)
uni.showLoading({
title: '提交中...',
mask: true
})
// 状态更新 需刷新工单列表和预约管理列表
utils.refreshPageData()
uni.$api.boutiqueApi.createPayOrder(obj).then(data => {
if (data) {
console.log(`类型为:${selectPayType}`)
console.log(this.orderInfo)
if (selectPayType == 3 || selectPayType == 1) {
this.orderInfo.payOrder.outTradeNo = data.outTradeNo
let size = 0
try {
const info = uni.getSystemInfoSync()
let scale = info.windowWidth / 750 //不同屏幕下QRcode的适配比例;设计稿是750宽
let width = 300 * scale
size = width
} catch (e) {
size = 150
}
this.posQrCode = qrcode.createQrCodeImg(data.outTradeNo, {
size: parseInt(size)
})
uni.hideLoading()
console.log(this.posQrCode)
this.$refs.payPopup.open()
this.getDetail(orderCode)
if (!this.time) {
this.time = setInterval(() => {
// console.log('6666666666')
this.getDetail(orderCode)
}, 5 * 1000)
}
} else {
this.$emit('jump', 'OrderDetail', data)
}
} else {
uni.showToast({ title: message, icon: null })
}
})
}
},
beforeDestroy() {
if (this.time) {
clearInterval(this.time)
this.time = null
}
}
}
</script>
<style scoped lang="scss">
// Popup样式
::v-deep .tipsPopup .uni-popup__wrapper {
width: toRpx(848);
height: toRpx(744);
border-radius: toRpx(42);
background: rgb(255, 255, 255) !important;
.tipsPopupBg {
border-radius: toRpx(42) toRpx(42) 0 0;
width: 100%;
height: toRpx(244);
}
.title {
color: #333333;
font-size: toRpx(40);
font-weight: 500;
text-align: center;
margin-top: toRpx(48);
}
.tipsConent {
color: #666666;
font-size: toRpx(32);
font-weight: 400;
padding: toRpx(16) toRpx(64);
line-height: toRpx(48);
text {
color: #347bff;
}
}
}
::v-deep .calendarPopup .uni-popup__wrapper {
width: 100%;
height: 62vh;
.calendar {
width: 100%;
height: calc(100% - #{toRpx(164)});
}
}
::v-deep .payPopup .uni-popup__wrapper {
width: 60%;
border-radius: toRpx(48);
background: #ffffff !important;
.popup-top {
border-radius: toRpx(48) toRpx(48) 0 0;
background: url('@/assets/images/boutique/payTipsBc.png') no-repeat;
background-size: 100% 100%;
margin-bottom: toRpx(16);
.popup-top-box {
color: #333333;
font-size: toRpx(36);
font-weight: 500;
text-align: center;
padding: toRpx(32);
.popup-top-box-title {
flex: 1;
}
.icon-close {
text-align: end;
}
}
}
.pos-popup {
text-align: center;
box-shadow: 0 toRpx(12) toRpx(24) 0 #2c66f726;
width: 90%;
border-radius: toRpx(48);
background: #ffffff;
margin: 0 auto toRpx(63) auto;
padding: toRpx(63) 0;
.qrcode {
width: toRpx(320);
height: toRpx(320);
margin-bottom: toRpx(32);
}
.price {
color: #4673ff;
font-size: toRpx(56);
font-weight: 700;
margin-bottom: toRpx(32);
}
.level-1-tips {
color: #1a1a1a;
font-size: toRpx(40);
font-weight: 500;
margin-bottom: toRpx(16);
}
.level-2-tips {
color: #808291;
font-size: toRpx(32);
font-weight: 400;
}
}
}
.order-confirm {
position: relative;
height: 100%;
.scroll-y {
border-radius: toRpx(16);
height: calc(100% - #{toRpx(296)});
overflow-y: scroll;
&::-webkit-scrollbar {
width: 0;
height: 0;
background: transparent;
}
}
.px-48 {
padding: 0 toRpx(48);
}
.pt-6 {
padding-top: toRpx(6);
}
.pt-8 {
padding-top: toRpx(8);
}
.pt-16 {
padding-top: toRpx(16);
}
.pt-12 {
padding-top: toRpx(12);
}
.pt-24 {
padding-top: toRpx(24);
}
.fs-14 {
font-size: toRpx(14);
}
.fs-32 {
font-size: toRpx(32);
}
.fs-28 {
font-size: toRpx(28);
}
.fs-26 {
font-size: toRpx(26);
}
.fw-7 {
font-weight: 700;
}
.fs-13 {
font-size: toRpx(13);
}
.ml-12 {
margin-left: toRpx(12);
}
.mt-16 {
margin-top: toRpx(16);
}
.mt-24 {
margin-top: toRpx(24);
}
.py-16 {
padding: toRpx(16) 0;
}
.flex-1 {
flex: 1;
}
.date-box {
display: flex;
align-items: center;
position: relative;
}
.date-box-label {
font-weight: 400;
font-size: toRpx(28);
color: #333333;
}
.date-box-value {
font-weight: 500;
font-size: toRpx(40);
color: #333333;
}
.required {
color: #f00;
margin-left: toRpx(8);
}
.handlerBtn {
color: #4673ff;
font-size: toRpx(26);
font-weight: 400;
margin-left: toRpx(8);
}
.customize-btn {
color: #4673ff;
font-size: toRpx(26);
font-weight: 400;
margin-left: toRpx(16);
}
.copy-btn {
display: flex;
align-items: center;
color: #808291;
.copy {
margin-right: toRpx(8);
margin-left: toRpx(20);
}
}
.top-tips {
width: 100%;
height: toRpx(86);
border-radius: toRpx(16);
background: linear-gradient(-90deg, #61c0ff 0%, #2c66f7 100%);
box-shadow: inset 0 0 toRpx(20) 0 #ffffff99;
color: #fff;
padding: toRpx(48) toRpx(32);
}
.box-shell {
width: 100%;
border-radius: toRpx(16);
background: #ffffff;
padding: toRpx(24) toRpx(32);
margin-top: toRpx(16);
&-title {
font-size: toRpx(28);
color: #333333;
font-weight: 400;
}
.meal-box {
border-radius: toRpx(24);
border: toRpx(2) solid #dce0e6;
padding: toRpx(24) toRpx(32);
box-sizing: border-box;
margin-top: toRpx(16);
.meal-hd {
color: #333333;
font-size: toRpx(32);
font-weight: 400;
margin-bottom: toRpx(20);
.price {
font-weight: 500;
}
}
.meal-bd {
background: #f6f7fa;
border-radius: toRpx(16);
padding: 0 toRpx(32);
box-sizing: border-box;
.meal-bd-head {
border-bottom: toRpx(2) solid #dce0e6;
padding: toRpx(24) 0;
.name {
color: #333333;
font-size: toRpx(28);
font-weight: 400;
}
.meal-bd-bottom {
color: #999999;
font-size: toRpx(24);
font-weight: 400;
margin-left: toRpx(8);
}
.price {
color: #333333;
font-size: toRpx(28);
font-weight: 400;
}
}
.meal-bd-box:last-child .meal-bd-head {
border-bottom: none;
}
}
}
.good-list {
margin-top: toRpx(16);
.good {
color: #333333;
font-size: toRpx(28);
border-radius: toRpx(24);
background: #f5f7fa;
padding: toRpx(24);
.good-name {
font-weight: 400;
flex: 4;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.good-price {
font-weight: 500;
flex: 1;
text-align: right;
}
.good-alias {
font-size: toRpx(24);
font-weight: 400;
}
.good-sku {
color: #999999;
font-size: toRpx(24);
font-weight: 400;
margin-right: toRpx(24);
}
.good-count {
color: #999999;
font-size: toRpx(24);
font-weight: 400;
}
}
}
.coupon {
border-bottom: 1px solid #f7f7f6;
.coupon-name {
color: #292d33;
font-size: toRpx(28);
font-weight: 400;
margin-left: toRpx(8);
}
}
.good-total-lable {
color: #757980;
font-size: toRpx(28);
font-weight: 400;
}
.good-total-value {
color: #4673ff;
font-size: toRpx(40);
font-weight: 700;
}
.order-info {
.value .value-item text {
margin: 0 toRpx(6);
}
.label {
width: toRpx(156);
color: #999999;
font-size: toRpx(26);
font-weight: 400;
}
.value {
color: #222222;
font-size: toRpx(26);
font-weight: 400;
white-space: wrap;
}
}
}
.footer-box {
position: absolute;
bottom: toRpx(24);
width: 100%;
left: 0;
.btn {
width: 42%;
height: toRpx(80);
border-radius: toRpx(48);
font-size: toRpx(28);
font-weight: 500;
line-height: toRpx(80);
text-align: center;
}
.confirm {
background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
color: #ffffff;
margin-left: toRpx(32);
}
.edit {
background: #3b73ff1a;
color: #4673ff;
}
}
}
</style>
<template> <template>
<view class="order"> <view class="order">
<view
:class="['order-box',{hide:showUpload}]"
:key="formKey"
>
<view class="common-title">车险信息</view> <view class="common-title">车险信息</view>
<view class="box"> <view class="box">
<scroll-view <scroll-view
...@@ -30,21 +34,21 @@ ...@@ -30,21 +34,21 @@
</view> </view>
</template> </template>
<template slot="skuGoods"> <template slot="skuGoods">
<template v-if="orderObj.skuGoods.length">
<SkuGoods <SkuGoods
v-if="orderObj.vdQuotationGoodsList.length" :list="orderObj.skuGoods"
:list="orderObj.vdQuotationGoodsList"
@changeTotalPrice="changeTotalPrice" @changeTotalPrice="changeTotalPrice"
:positionTypeList="positionTypeList" :positionTypeList="positionTypeList"
:baseConfigData="baseConfigData" :baseConfigData="baseConfigData"
></SkuGoods> ></SkuGoods>
<view </template>
class="total" <template v-if="orderObj.total > 0">
v-if="orderObj.total > 0" <view class="total">
>
<view class="total-left">总价</view> <view class="total-left">总价</view>
<view class="total-right">¥{{ orderObj.total }}</view> <view class="total-right">¥{{ orderObj.total }}</view>
</view> </view>
</template> </template>
</template>
<template slot="otherPay"> <template slot="otherPay">
<view <view
v-if="showPayTips" v-if="showPayTips"
...@@ -58,10 +62,11 @@ ...@@ -58,10 +62,11 @@
<view <view
@click="submit" @click="submit"
class="btn" class="btn"
>下一步·去支付</view> >{{confirmText}}</view>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
</view>
<!-- 弹窗 --> <!-- 弹窗 -->
<order-popup <order-popup
ref="orderPopup" ref="orderPopup"
...@@ -72,6 +77,19 @@ ...@@ -72,6 +77,19 @@
:popupType="popupType" :popupType="popupType"
:popupTitle="popupTitle" :popupTitle="popupTitle"
/> />
<template v-if="showUpload">
<view class="upload-box">
<upload-proof-of-payment
@back="showUpload = false"
@confirm="uploadConfirm"
/>
</view>
</template>
<!-- 支付弹框 -->
<OrderPay
ref="OrderPay"
@jumpSuccess="jumpSuccess"
/>
</view> </view>
</template> </template>
...@@ -84,6 +102,11 @@ import Package from './Package.vue' ...@@ -84,6 +102,11 @@ import Package from './Package.vue'
import SkuGoods from './SkuGoods.vue' import SkuGoods from './SkuGoods.vue'
import { FORM_LIST, popupTypeEnum, payTypeList, titleList } from '../contant' import { FORM_LIST, popupTypeEnum, payTypeList, titleList } from '../contant'
import { interceptionMixin } from '@/mixin/index' import { interceptionMixin } from '@/mixin/index'
import UploadProofOfPayment from './UploadProofOfPayment.vue'
import dayjs from 'dayjs'
import OrderPay from './OrderPay.vue'
import NP from 'number-precision'
export default { export default {
name: 'CreateOrder', name: 'CreateOrder',
mixins: [interceptionMixin], mixins: [interceptionMixin],
...@@ -92,7 +115,9 @@ export default { ...@@ -92,7 +115,9 @@ export default {
OrderPopup, OrderPopup,
Product, Product,
Package, Package,
SkuGoods SkuGoods,
UploadProofOfPayment,
OrderPay
}, },
props: { props: {
transmissionOfData: { transmissionOfData: {
...@@ -101,12 +126,37 @@ export default { ...@@ -101,12 +126,37 @@ export default {
} }
}, },
watch: { watch: {
'orderObj.payee': {
handler (val) {
this.formList[4].map(e => {
if (e.value == 'pay2Time') e.label = {
0: '嘀加收款时间',
1: '4S店收款时间'
}[val]
})
},
immediate: true,
deep: true
},
// (orderInfo.payType == 2 ||orderInfo.payType ==5 || orderInfo.payType == 6 || orderInfo.payType == 7 )
// &&!orderInfo.resetOrder&&!orderInfo.selectOutTradeNoArr
'orderObj.payType': {
handler (val) {
this.formList[4].map(e => {
if (e.value == 'notes') e.required = val == 7
if (e.value == 'pay2Time') e.hidden = ![2, 5, 6, 7].includes(+val)
})
},
immediate: true,
deep: true
}
}, },
data () { data () {
return { return {
showUpload: false,
titleList, titleList,
formList: utils.deepClone(FORM_LIST), formList: utils.deepClone(FORM_LIST),
userInfo: {},
baseConfigData: {}, baseConfigData: {},
requiredList: [], // 录单设置的必填项 requiredList: [], // 录单设置的必填项
orderObj: { orderObj: {
...@@ -114,7 +164,7 @@ export default { ...@@ -114,7 +164,7 @@ export default {
payee: 0, // 收款方式 payee: 0, // 收款方式
payType: 1, // 支付方式 payType: 1, // 支付方式
insurancePrice: '', insurancePrice: '',
vdQuotationGoodsList: [], //商品列表 skuGoods: [], //商品列表
referrerId: '', //销售顾问id referrerId: '', //销售顾问id
referrer: '',//销售顾问名称 referrer: '',//销售顾问名称
deliveryId: '',//交付专员id deliveryId: '',//交付专员id
...@@ -122,8 +172,10 @@ export default { ...@@ -122,8 +172,10 @@ export default {
total: '',//总价 total: '',//总价
notes: '',//备注 notes: '',//备注
carSeriesId: '', //车系id carSeriesId: '', //车系id
seat: 5,//座位数 seat: '5',//座位数
ownerGender: '男', ownerGender: '男',
salesType: '0',
carInfo: {}
}, // 弹窗传入的数据}, }, // 弹窗传入的数据},
popupType: 0, popupType: 0,
popupTypeEnum, popupTypeEnum,
...@@ -137,17 +189,25 @@ export default { ...@@ -137,17 +189,25 @@ export default {
otherProduct: [], otherProduct: [],
positionTypeList: [], positionTypeList: [],
valueKey: '', valueKey: '',
popupTitle: '' popupTitle: '',
pointsMultiRole: 'Y',
formKey: Date.now()
} }
}, },
computed: { computed: {
showPayTips () { showPayTips () {
if (this.orderObj.payee == 0 && this.orderObj.payType == 7) return true return this.orderObj.payee == 0 && this.orderObj.payType == 7
else return false },
confirmText () {
return [1, 3].includes(+this.orderObj.payType) ? '下一步·去支付' : '下一步·上传凭证'
},
userInfo () {
return uni.$storage.get('userInfo') || {}
} }
}, },
mounted () { mounted () {
this.userInfo = uni.$storage.get('userInfo') || {}
this.baseConfigData = uni.$storage.get('mock_data') || {} this.baseConfigData = uni.$storage.get('mock_data') || {}
this.initData() this.initData()
}, },
...@@ -156,19 +216,26 @@ export default { ...@@ -156,19 +216,26 @@ export default {
console.log('initData', this.orderObj.id) console.log('initData', this.orderObj.id)
// 埋点 // 埋点
// uni.$track.add({ eventCode: 'app_create_order' }) // uni.$track.add({ eventCode: 'app_create_order' })
const { userInfo } = this
if (!this.orderObj.id) {
// 在原有的 orderObj 对象上新增这些属性
Object.assign(this.orderObj, {
merchantId4s: userInfo.shopMerchantId,
merchantName4s: userInfo.shopMerchantName
})
}
this.getConfig() this.getConfig()
this.getSelectOrderGoodsList() this.getSelectOrderGoodsList()
this.getShopMerchantPointConfig()
},
async getShopMerchantPointConfig () {
const { shopMerchantId: merchantId } = this.userInfo,
{ pointsMultiRole } = await uni.$api.equityApi.getShopMerchantPointConfig({
merchantId
})
this.pointsMultiRole = pointsMultiRole
if (pointsMultiRole != 'Y') this.formList[0].map(e => {
if (e.value == 'deliveryName') e.hidden = true
if (e.value == 'referrer') e.label = '推荐人'
})
}, },
// 选择行事件 // 选择行事件
handleCell (val) { handleCell (val) {
let { payType } = this.orderObj,
{ pointsMultiRole } = this
this.popupTitle = '' this.popupTitle = ''
// 获取当前选中的popupType // 获取当前选中的popupType
this.popupType = Object.keys(this.popupTypeEnum).find(key => this.popupTypeEnum[key].key === val.key) * 1 this.popupType = Object.keys(this.popupTypeEnum).find(key => this.popupTypeEnum[key].key === val.key) * 1
...@@ -186,8 +253,9 @@ export default { ...@@ -186,8 +253,9 @@ export default {
this.externalData = utils.deepClone(this.goodsList) this.externalData = utils.deepClone(this.goodsList)
} }
this.popupTitle = { this.popupTitle = {
0: pointsMultiRole == 'Y' ? '销售顾问/录单员' : '推荐人',
4: '车型', 4: '车型',
13: '4S店收款时间' 13: payType == 2 ? '4S店收款时间' : '嘀加收款时间'
}[this.popupType] }[this.popupType]
this.$refs.orderPopup.open() this.$refs.orderPopup.open()
}, },
...@@ -206,20 +274,23 @@ export default { ...@@ -206,20 +274,23 @@ export default {
const _typeValue = this.popupTypeEnum[this.popupType] const _typeValue = this.popupTypeEnum[this.popupType]
console.log(_typeValue) console.log(_typeValue)
// 定义产品相关字段数组 // 定义产品相关字段数组
if (val.popupType == 19) return this.setCustomerInfo(chooseContent)
const productFields = ['skuGoods'] const productFields = ['skuGoods']
if (_typeValue.key == 'carBrand') { if (_typeValue.key == 'carBrand') {
// 车型 // 车型
this.$set(this.orderObj, 'carBrandText', `${chooseContent.carBrand}-${chooseContent.carChildsBrandName}-${chooseContent.carSeriesName}`) this.$set(this.orderObj, 'carBrandText', `${chooseContent.carBrand}-${chooseContent.carChildsBrandName}-${chooseContent.carSeriesName}`)
Object.assign(this.orderObj, chooseContent) Object.assign(this.orderObj, {
carInfo: chooseContent
})
} }
else if (productFields.includes(_typeValue.key)) { else if (productFields.includes(_typeValue.key)) {
if (_typeValue.key == 'skuGoods') { if (_typeValue.key == 'skuGoods') {
if (!this.orderObj.vdQuotationGoodsList) { if (!this.orderObj.skuGoods) {
// 其他精品第一次赋值 // 其他精品第一次赋值
this.$set(this.orderObj, 'vdQuotationGoodsList', chooseContent) this.$set(this.orderObj, 'skuGoods', chooseContent)
} else { } else {
// 过滤出已选的goodFlag为2的对象 // 过滤出已选的goodFlag为2的对象
const selectedGoods = this.orderObj.vdQuotationGoodsList.filter(item => item.goodsFlag === 2) const selectedGoods = this.orderObj.skuGoods.filter(item => item.goodsFlag === 2)
const singleGoods = chooseContent.filter(item => item.goodsFlag != 2) const singleGoods = chooseContent.filter(item => item.goodsFlag != 2)
const moreGoods = chooseContent const moreGoods = chooseContent
.filter(item => item.goodsFlag === 2) .filter(item => item.goodsFlag === 2)
...@@ -229,23 +300,26 @@ export default { ...@@ -229,23 +300,26 @@ export default {
console.log(singleGoods, '===') console.log(singleGoods, '===')
// 合并已选的goodFlag为2的对象 // 合并已选的goodFlag为2的对象
this.orderObj.vdQuotationGoodsList = [...singleGoods, ...moreGoods, ...selectedGoods] this.orderObj.skuGoods = [...singleGoods, ...moreGoods, ...selectedGoods]
} }
} }
setTimeout(() => {
this.changeTotalPrice()
}, 0)
} }
else { else {
this.$set(this.orderObj, _typeValue.key, chooseContent) if (_typeValue.key == 'city') {
this.$set(this.orderObj, 'provinceText', chooseContent.province)
this.$set(this.orderObj, 'cityText', chooseContent.city)
this.$set(this.orderObj, 'city', chooseContent.city == chooseContent.province ? chooseContent.city : `${chooseContent.province}-${chooseContent.city}`)
} else if (_typeValue.key == 'todayShow') {
this.$set(this.orderObj, 'pay2Time', chooseContent)
} else if (_typeValue.list == 'employeeList') {
this.$set(this.orderObj, _typeValue.targetIdKey, chooseContent[_typeValue.sourceIdKey])
this.$set(this.orderObj, _typeValue.targetNameKey, chooseContent[_typeValue.sourceNameKey])
} else this.$set(this.orderObj, _typeValue.key, chooseContent)
console.log(this.orderObj, 'this.orderObj') console.log(this.orderObj, 'this.orderObj')
} }
// // 商品类,需计算总价
// setTimeout(() => {
// this.changeTotalPrice()
// }, 0)
// } else if (_typeValue.key) {
// this.orderObj[_typeValue.targetIdKey] = chooseContent[_typeValue.sourceIdKey]
// this.$set(this.orderObj, _typeValue.targetNameKey, chooseContent[_typeValue.sourceNameKey])
// }
console.log(this.orderObj) console.log(this.orderObj)
}, },
// 输入框失去焦点事件 // 输入框失去焦点事件
...@@ -256,19 +330,16 @@ export default { ...@@ -256,19 +330,16 @@ export default {
// 校验必填等规则 // 校验必填等规则
checkRequired () { checkRequired () {
try { try {
const phoneRex = /^[1]([3-9])[0-9]{9}$/ const phoneRex = /^[1]([3-9])[0-9]{9}$/,
// 把formList中所有required为true的对象放到一个数组中 requiredArr = [],
const requiredArr = [] onlyLabelItem = [],
const onlyLabelItem = [] { orderObj } = this
this.formList.forEach(group => { this.formList.forEach(group => {
group.forEach(item => { group.forEach(item => {
if (item.required === true && item.hidden !== true) { if (item.required === true && item.hidden !== true) {
if (item.onlyLabel === true) { if (item.isArray) onlyLabelItem.push(item)
onlyLabelItem.push(item) else requiredArr.push(item)
} else {
requiredArr.push(item)
}
} }
}) })
}) })
...@@ -276,31 +347,25 @@ export default { ...@@ -276,31 +347,25 @@ export default {
for (let i = 0; i < requiredArr.length; i++) { for (let i = 0; i < requiredArr.length; i++) {
const item = requiredArr[i] const item = requiredArr[i]
// 兼容嵌套customer对象的情况 // 兼容嵌套customer对象的情况
let value = this.orderObj[item.value] let value = orderObj[item.value]
if (value === undefined || value === null || value === '') throw `${item.label}不能为空` if (value === undefined || value === null || value === '') throw `${item.label}不能为空`
// 如果是customerPhone,添加phoneRex校验 // 如果是customerPhone,添加phoneRex校验
if (item.value === 'phone' && !phoneRex.test(value)) throw `请输入正确的${item.label}` if (item.value === 'phone' && !phoneRex.test(value)) throw `请输入正确的${item.label}`
} }
if (orderObj.carVin) {
if (this.orderObj.carVin) {
const vinRex = /^(?=.*[A-Za-z])[A-Za-z0-9]{17}$/ const vinRex = /^(?=.*[A-Za-z])[A-Za-z0-9]{17}$/
console.log(this.orderObj.carVin, vinRex.test(this.orderObj.carVin)) if (!vinRex.test(orderObj.carVin)) throw '请输入正确的车架号'
if (!vinRex.test(this.orderObj.carVin)) throw '请输入正确的车架号'
} }
// 处理onlyLabel为true的特殊校验 if (onlyLabelItem.length) {
if (onlyLabelItem.length > 0) {
// 检查frontGear、frontWindow、rearGear、rearWindow、sunRoof和couponInfo字段中是否至少有一个不为空
const labelFields = ['skuGoods'] const labelFields = ['skuGoods']
const hasValue = labelFields.some(field => { const hasValue = labelFields.some(field => {
console.log(field, this.orderObj[field]) const value = orderObj[field]
const value = this.orderObj[field]
return value !== undefined && value !== null && (Array.isArray(value) ? value.length > 0 : value !== '') return value !== undefined && value !== null && (Array.isArray(value) ? value.length > 0 : value !== '')
}) })
console.log(hasValue, hasValue) if (!hasValue) throw '请选择增值车损险商品'
if (!hasValue) throw '商品不能为空'
} }
if (orderObj.certificateNo && orderObj.certificateNo.length != 18) throw '请输入正确的18位证件号'
return true return true
} catch (error) { } catch (error) {
if (error) uni.showToast({ if (error) uni.showToast({
...@@ -313,31 +378,173 @@ export default { ...@@ -313,31 +378,173 @@ export default {
// 提交 // 提交
async submit () { async submit () {
console.log(this.orderObj) if (!this.checkRequired() || await this.checkDailyReport()) return
if (!this.checkRequired()) return this.handleSecondConfirmCheck()
if (!(await this.checkDailyReport())) { },
// uni.showLoading({ async handleSecondConfirmCheck () {
// title: '提交中...', try {
// mask: true let orderInfo = this.getInsurance(),
// }) { payType } = orderInfo
// const res = await uni.$api.boutiqueApi[orderCreateType](obj).finally(() => { if (
// uni.hideLoading() ([2, 5, 6, 7].includes(+payType)) &&
// }) !(orderInfo.transactionNo && orderInfo.paymentDocList.length)
// if (res) { ) return this.showUpload = true
// uni.showToast({ if (orderInfo.pay2Time) orderInfo.pay2Time = dayjs(orderInfo.pay2Time).format('YYYY-MM-DD HH:mm:ss')
// title: '保存成功', uni.showLoading({
// icon: 'success' title: '报价中...',
// }) mask: true
// uni.$track.add({ eventCode: 'app_submit_create_order' }) })
// this.$emit('jump', 'ConfirmOrder', res) const data = await uni.$api.equityApi.quotationAdd(orderInfo)
// } if (data) {
if ([2, 5, 6, 7].includes(+payType)) return this.$emit('jump', 'OrderManagement')
let status = await this.createWithPay(data)
wx.hideLoading()
if (status) this.$refs.OrderPay.open(data)
else throw false
} else throw false
} catch (error) {
uni.hideLoading()
uni.showToast({
title: '报价失败',
icon: 'none'
})
} }
}, },
createWithPay (id) {
return new Promise((resolve, reject) => {
let para = {
id,
customerNameUrl: '',
orderStatus: 2
}
uni.$api.equityApi.quotationUpgrade(para).then(res => {
resolve(res)
})
})
},
getInsurance () {
let {
orderObj,
userInfo
} = this,
orderInfo = utils.deepClone(orderObj),
{
default4SStoreInfo
} = userInfo,
params = {
owner: {
...orderInfo.carInfo
}
}
params.merchantId4s = default4SStoreInfo?.merchantId
params.merchantName4s = default4SStoreInfo?.merchantName
params.insurancePrice = this.multipliedByHundred(
orderInfo.insurancePrice
)
params.quotedPriceUpdate = this.multipliedByHundred(
orderInfo.quotedPriceUpdate
)
params.minEquityPrice = this.multipliedByHundred(
orderInfo.minEquityPrice
)
params.vdQuotationGoodsList = orderInfo.skuGoods.reduce(
(pre, item) => {
if (item.goods) {
item = item.goods
const obj = {
goodsId: item.merchantGoodsId,
goodsName: item.goodsName,
goodsNameAlias: item.goodsAlias || item.goodsNameAlias,
specificationsName: item.specificationNameSequence,
specificationsValue: item.specificationData ?
item.specificationData.replace(/;~;/g, '/') : '',
goodsPrice: this.multipliedByHundred(item.sellPrice)
}
pre.push(obj)
}
if (item.packageGoods) {
item = item.packageGoods
item.goodsList.map(ele => {
// console.log(ele, '2222');
let obj = {
packageId: item.packageCode,
packageName: item.packageName,
packageNameAlias: item.packageAlias || item.packageNameAlias,
goodsId: ele.merchantGoodsId || ele.upgradeGoodsId,
goodsName: ele.upgradeGoodsName || ele.goodsName,
goodsNameAlias: ele.goodsAlias || ele.goodsNameAlias,
specificationsName: ele.specificationNameSequence,
specificationsValue: ele.specificationData ?
ele.specificationData.replace(/;~;/g, '/') : '',
// specificationsValue: item.specificationData ? item.specificationData.replace(reg, ' ') : '',
goodsPrice: this.multipliedByHundred(ele.sellPrice)
}
pre.push(obj)
})
}
if (item.multipleSpecificationsGoods) {
if (item.multipleSpecificationsGoods.goods) {
item = item.multipleSpecificationsGoods.goods
const obj = {
goodsId: item.merchantGoodsId,
goodsName: item.upgradeGoodsName || item.goodsName,
goodsNameAlias: item.goodsAlias || item.goodsNameAlias,
specificationsName: item.specificationNameSequence,
specificationsValue: item.specificationData ?
item.specificationData.replace(/;~;/g, '/') : '',
goodsPrice: this.multipliedByHundred(item.sellPrice)
}
pre.push(obj)
}
}
return pre
},
[]
)
let keyList = ['mode', 'payee', 'payType', 'referrerId', 'referrer',
'deliveryId', 'deliveryName', 'total', 'notes', 'tradeNo', 'transactionNo', 'paymentDocList', 'pay2Time'
],
customerKeyList = [
'owner', 'phone', 'certificateNo', 'carVin', 'seat', 'price',
'ownerGender', 'city', 'ageRange', 'hobby', 'companion', 'carColor', 'salesType'
]
keyList.map(key => {
if (orderInfo[key] != null) params[key] = orderInfo[key]
})
customerKeyList.map(key => {
if (orderInfo[key] != null) params.owner[key] = orderInfo[key]
})
return params
},
// 乘以100保留两位小数点
multipliedByHundred (str) {
let floatVal = parseFloat(str)
if (isNaN(floatVal)) {
return 0
}
floatVal = Math.round(str * 10000) / 100
let strVal = floatVal.toString()
let searchVal = strVal.indexOf('.')
if (searchVal < 0) {
searchVal = strVal.length
strVal += '.'
}
while (strVal.length <= searchVal + 2) {
strVal += '0'
}
return parseFloat(strVal)
},
// 计算所有产品的总价 // 计算所有产品的总价
changeTotalPrice () { changeTotalPrice () {
let total = 0 let total = 0
// 遍历所有商品 // 遍历所有商品
const productFields = ['frontGear', 'frontWindow', 'rearGear', 'rearWindow', 'sunRoof', 'package', 'skuGoods'] const productFields = ['skuGoods']
productFields.forEach(slotName => { productFields.forEach(slotName => {
const productList = this.orderObj[slotName] const productList = this.orderObj[slotName]
if (Array.isArray(productList) && productList.length > 0) { if (Array.isArray(productList) && productList.length > 0) {
...@@ -345,20 +552,13 @@ export default { ...@@ -345,20 +552,13 @@ export default {
productList.forEach(item => { productList.forEach(item => {
if (item.goods && item.goods.sellPrice && item.goods.number) { if (item.goods && item.goods.sellPrice && item.goods.number) {
console.log(item.goods, '---单商品') console.log(item.goods, '---单商品')
total += parseFloat(item.goods.sellPrice) * parseInt(item.goods.number) total = NP.plus(total, NP.times(item.goods.sellPrice, item.goods.number))
} else if (item.packageGoods && item.packageGoods.upgradePrice && item.packageGoods.number) { } else if (item.packageGoods && item.packageGoods.totalPrice) {
console.log(item.packageGoods, '套餐') console.log(item.packageGoods, '套餐')
// if (item.packageGoods.price) { total = NP.plus(total, item.packageGoods.totalPrice)
// total += parseFloat(item.packageGoods.price) * parseInt(item.packageGoods.number)
// } else {
// total += parseFloat(item.packageGoods.upgradePrice) * parseInt(item.packageGoods.number)
// }
item.packageGoods.goodsList.forEach(i => {
total += parseFloat(i.sellPrice) * parseInt(item.packageGoods.number)
})
} else if (item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods && item.multipleSpecificationsGoods.goods.sellPrice) { } else if (item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods && item.multipleSpecificationsGoods.goods.sellPrice) {
console.log(item.multipleSpecificationsGoods, '多规格') console.log(item.multipleSpecificationsGoods, '多规格')
total += parseFloat(item.multipleSpecificationsGoods.goods.sellPrice) * parseInt(item.multipleSpecificationsGoods.number || 1) total = NP.plus(total, NP.times(item.multipleSpecificationsGoods.goods.sellPrice, item.multipleSpecificationsGoods.number || 1))
} }
}) })
} }
...@@ -368,20 +568,6 @@ export default { ...@@ -368,20 +568,6 @@ export default {
this.orderObj.total = total.toFixed(2) this.orderObj.total = total.toFixed(2)
}, },
// 获取上一个订单的销售顾问信息 并且不是再次下单
async getLastUserOrderInfo () {
const res = await uni.$api.boutiqueApi.getLastUserOrderInfo({
sellerUserId: this.userInfo.subLoginUser.uuid
})
console.log(this.orderObj.merchantId)
if (this.orderObj.merchantId == res.merchantId) {
this.$set(this.orderObj, 'employeeName', res.employeeName)
this.orderObj.userId = res.userId
console.log(res, '上一个订单的销售顾问信息')
} else {
this.getEmployeeList()
}
},
// 获取园区店支付方式 // 获取园区店支付方式
async getConfig () { async getConfig () {
const { merchantId } = this.userInfo, const { merchantId } = this.userInfo,
...@@ -394,7 +580,6 @@ export default { ...@@ -394,7 +580,6 @@ export default {
let idx = m.find(j => j == k.value) let idx = m.find(j => j == k.value)
return idx >= 0 return idx >= 0
}) })
// this.configPayTypeList = list
this.djPayList = [ this.djPayList = [
...list?.filter(v => ![2, 5].includes(Number(v.value))), ...list?.filter(v => ![2, 5].includes(Number(v.value))),
{ {
...@@ -404,11 +589,10 @@ export default { ...@@ -404,11 +589,10 @@ export default {
{ {
name: '其它收款', name: '其它收款',
value: '7' value: '7'
} },
] ]
this.merchantPayList = [...list?.filter(v => v.value == 2)] this.merchantPayList = [...list?.filter(v => v.value == 2)]
this.changePayee() this.changePayee()
console.log(this.djPayList, this.merchantPayList, 'list')
}, },
changePayee () { changePayee () {
const cell = this.formList[4].find(item => item.value === 'payType') const cell = this.formList[4].find(item => item.value === 'payType')
...@@ -421,10 +605,6 @@ export default { ...@@ -421,10 +605,6 @@ export default {
} }
} }
}, },
async getPositionList () {
const res = await uni.$api.boutiqueApi.getPositionList({})
this.positionTypeList = res
},
// 商品列表 // 商品列表
async getSelectOrderGoodsList () { async getSelectOrderGoodsList () {
const { userInfo } = this const { userInfo } = this
...@@ -500,7 +680,6 @@ export default { ...@@ -500,7 +680,6 @@ export default {
e.count = e.number e.count = e.number
e.merchantGoodsId = e.merchantGoodsId || e.id e.merchantGoodsId = e.merchantGoodsId || e.id
let specificdata = this.handleSpecificationsEcho(e) let specificdata = this.handleSpecificationsEcho(e)
console.log(specificdata, 'specificdata')
chooseList = chooseList.concat(specificdata) chooseList = chooseList.concat(specificdata)
} }
} }
...@@ -533,7 +712,6 @@ export default { ...@@ -533,7 +712,6 @@ export default {
}) })
} }
}) })
console.log(chooseList, 'chooseList')
const _singleGoods = chooseList.filter(item => item.goodsFlag == 1) const _singleGoods = chooseList.filter(item => item.goodsFlag == 1)
const _packageGoods = chooseList.filter(item => item.goodsFlag == 3) const _packageGoods = chooseList.filter(item => item.goodsFlag == 3)
const _skuGoods = chooseList.filter(item => item.goodsFlag == 2) || [] const _skuGoods = chooseList.filter(item => item.goodsFlag == 2) || []
...@@ -547,11 +725,9 @@ export default { ...@@ -547,11 +725,9 @@ export default {
if (_packageGoods) { if (_packageGoods) {
this.$set(this.orderObj, 'package', _packageGoods) this.$set(this.orderObj, 'package', _packageGoods)
} }
console.log(_skuGoods, '_skuGoods')
if (_skuGoods && _skuGoods.length) { if (_skuGoods && _skuGoods.length) {
this.$set(this.orderObj, 'skuGoods', _skuGoods) this.$set(this.orderObj, 'skuGoods', _skuGoods)
} }
console.log(this.orderObj, 'this.orderObj')
this.changeTotalPrice() this.changeTotalPrice()
}, },
handleSpecificationsEcho (item) { handleSpecificationsEcho (item) {
...@@ -591,6 +767,78 @@ export default { ...@@ -591,6 +767,78 @@ export default {
}) })
console.log(skuArr) console.log(skuArr)
return skuArr return skuArr
},
uploadConfirm ({
payVoucherList,
outTradeNo
}) {
let paymentDocList = []
payVoucherList.map(e => {
paymentDocList.push({
paymentDocUrl: e,
type: 1
})
})
this.orderObj.transactionNo = outTradeNo
this.orderObj.tradeNo = outTradeNo
this.orderObj.paymentDocList = paymentDocList
this.showUpload = false
this.submit()
},
setCustomerInfo (customerInfo) {
const { orderObj } = this,
ownerGender = customerInfo.customerSex != 2 ? '男' : '女',
salesType = customerInfo.salesType || '0',
city = customerInfo.customerCity
Object.assign(orderObj, {
owner: customerInfo.customerName,
phone: customerInfo.customerPhone,
ownerGender,
seat: customerInfo.carSeat || 5,
ageRange: customerInfo.customerAgeRange,
hobby: customerInfo.customerHobby,
companion: customerInfo.customerCompanion,
certificateNo: customerInfo.customerCertificateNo || '',
salesType
})
this.formList[1].map(e => {
if (e.value == 'salesType') e.current = salesType
if (e.value == 'ownerGender') e.current = ownerGender
})
if (city) {
let [provinceText, cityText] = city.split('-')
if (cityText) {
orderObj.provinceText = provinceText
orderObj.cityText = cityText
} else {
orderObj.provinceText = city
orderObj.cityText = city
}
orderObj.city = city
}
if (orderObj.carPrice) owner.price = NP.times(customerInfo.carPrice, 0.01)
if (customerInfo.salesUuid) {
orderObj.referrerId = customerInfo.salesUuid
orderObj.referrer = customerInfo.salesName
}
if (customerInfo.carSeriesName) {
orderObj.carInfo = {
carBrand: customerInfo.carBrand,
carBrandId: customerInfo.carBrandId,
carChildsBrandId: customerInfo.carChildsBrandId,
carChildsBrandName: customerInfo.carChildsBrandName,
carSeriesId: customerInfo.carSeriesId,
carSeriesName: customerInfo.carSeriesName,
}
orderObj.carBrandText = `${customerInfo.carBrand}-${customerInfo.carChildsBrandName}-${customerInfo.carSeriesName}`
}
this.orderObj = orderObj
this.formKey = Date.now()
console.log(this.orderObj)
},
jumpSuccess (params) {
this.$emit('jump', 'OrderDetail', params)
} }
} }
} }
...@@ -599,6 +847,22 @@ export default { ...@@ -599,6 +847,22 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
.order { .order {
height: 100%; height: 100%;
position: relative;
&-box {
visibility: visible;
height: 100%;
}
.hide {
opacity: 0;
visibility: hidden;
}
.upload-box {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
} }
.box { .box {
...@@ -628,7 +892,7 @@ export default { ...@@ -628,7 +892,7 @@ export default {
} }
&-right { &-right {
color: #f45001; color: #f24724;
font-weight: 500; font-weight: 500;
} }
} }
......
<!--工单信息卡片--> <!--工单信息卡片-->
<template> <template>
<view class="order-card" @click.stop="cardClick"> <view class="order-card">
<view class="order-card-top-box flex justify-between"> <view class="order-card-top-box flex justify-between">
<view class="flex item-center"> <view class="flex item-center">
<text class="mr-20">{{ orderCardDetail.customerName }}</text> <text class="mr-20">{{ orderCardDetail.customerName }}</text>
...@@ -15,20 +15,10 @@ ...@@ -15,20 +15,10 @@
<!-- 待上传合同协议且是已支付的订单 --> <!-- 待上传合同协议且是已支付的订单 -->
<view class="status text-center" :style="{ color: status[0].color, 'background-color': status[0].background }" v-if="orderCardDetail.zyPayStatus == 1 && (orderCardDetail.orderStatus == 3 || orderCardDetail.orderStatus == 4 || orderCardDetail.orderStatus == 7)">待上传</view> <view class="status text-center" :style="{ color: status[0].color, 'background-color': status[0].background }" v-if="orderCardDetail.zyPayStatus == 1 && (orderCardDetail.orderStatus == 3 || orderCardDetail.orderStatus == 4 || orderCardDetail.orderStatus == 7)">待上传</view>
<view v-else class="status text-center" :style="{ color: status[orderCardDetail.orderStatus].color, 'background-color': status[orderCardDetail.orderStatus].background }"> <view v-else class="status text-center" :style="{ color: status[orderCardDetail.orderStatus].color, 'background-color': status[orderCardDetail.orderStatus].background }">
<!-- <view v-if="orderCardDetail.orderStatus == 1 || orderCardDetail.orderStatus == 3">
<view v-if="status[orderCardDetail.orderStatus].background">
<view class="arc y-center">
<view class="outside box-center" :style="{ 'background-color': status[orderCardDetail.orderStatus].background }" />
<view class="inside box-center" :style="{ 'background-color': status[orderCardDetail.orderStatus].color }" />
</view>
</view>
</view> -->
<!-- 优先显示已撤销的 然后是已施工的 最后是其他的 -->
<!-- {{li.status==9?status[li.status].text: (li.constructionFlag == 'Y'?'已施工':status[li.status].text) }} -->
{{ status[orderCardDetail.orderStatus].text }} {{ status[orderCardDetail.orderStatus].text }}
</view> </view>
</view> </view>
<view> <view class="order-card-bottom-box">
<view class="info-box"> <view class="info-box">
<view class="order-list align-center" v-for="(item, sindex) in orderCardDetail.deliveryUserId ? pointsMultiObj : orderObj" :key="sindex"> <view class="order-list align-center" v-for="(item, sindex) in orderCardDetail.deliveryUserId ? pointsMultiObj : orderObj" :key="sindex">
<view class="order flex align-center"> <view class="order flex align-center">
...@@ -41,36 +31,46 @@ ...@@ -41,36 +31,46 @@
<view v-if="arr_index == 1"> <view v-if="arr_index == 1">
<text class="split">|</text> <text class="split">|</text>
</view> </view>
{{ orderCardDetail[k] }} <text class="value-text">{{ orderCardDetail[k] }}</text>
</view> </view>
</view> </view>
</view> </view>
<view v-else>{{ orderCardDetail[item.key] || '' }}</view> <view v-else class="order-value-single">
<text class="value-text">{{ orderCardDetail[item.key] || '' }}</text>
</view> </view>
<view v-else>{{ orderCardDetail[item.key] || '' }}</view>
</view> </view>
<view v-else class="order-value-single flex">
<text class="value-text" v-if="item.mapValue">{{ item.mapValue[orderCardDetail[item.key]] || '' }}</text>
<text v-else class="value-text">{{ orderCardDetail[item.key] || '' }}</text>
<view v-if="item.canCopy" class="copy-btn" @click.stop="copyText(orderCardDetail[item.key])">
<view class="sprite-icon icon-icon-copy copy"></view>
</view> </view>
</view> </view>
</view> </view>
<!-- 支付方式 -->
<view class="order-payType flex" v-if="orderCardDetail.selectPayType !== undefined && orderCardDetail.selectPayType !== null">
<view class="payType flex align-center">
<view class="payType-label">支付方式</view>
<view class="payType-value flex align-center">
{{ payType[orderCardDetail['selectPayType']] }}
<image v-if="orderCardDetail.selectPayType == 1" class="payType-image" :src="IMG_URL + 'miniProgram/wxPay.png'" mode="" />
<image v-if="orderCardDetail.selectPayType == 2" class="payType-image" :src="IMG_URL + 'miniProgram/store_pay.png'" mode="" />
<image v-if="orderCardDetail.selectPayType == 3" class="payType-image" :src="IMG_URL + 'miniProgram/posPay.png'" mode="" />
</view> </view>
</view> </view>
</view>
<view v-if="orderCardDetail.status != 1 && orderCardDetail.selectPayType != 0 && orderCardDetail.total_price != 0" class="order-price flex align-center"> <view class="order flex align-center" v-if="orderCardDetail.orderStatus != '-1' && orderCardDetail.quotedPriceUpdate">
<view class="order-price-label">实付金额</view> <view class="order-label">支付金额</view>
<view class="price"> <view class="price flex">
<text class="unit">¥</text> <text class="unit">¥</text>
{{ orderCardDetail.totalPrice }} {{ orderCardDetail.quotedPriceUpdate || '' }}
</view> </view>
<view class="refund-box" v-if="orderCardDetail.refundAmount">
部分退款
<text class="unit">¥</text>
{{ orderCardDetail.refundAmount }}
</view> </view>
<!-- 已录单未签名 -->
<!-- <view wx:if="{{(item.orderStatus == '3' && item.equityOrderStatus == '0') || (item.orderStatus == '5' && item.equityOrderStatus == '0')}}" class="orange-txt">
<image class="icon-info" src="/packageEquity/images/icon-info.png"></image>
订单已支付,未录入权益合同
</view>
<view wx:elif="{{item.orderStatus == '3' && item.equityOrderStatus == '2'}}" class="orange-txt">
<image class="icon-info" src="/packageEquity/images/icon-info.png"></image>
订单已支付,尚未签名确认
</view> -->
<!-- <view wx:else>创建时间:{{item.createdTime}}</view> -->
</view> </view>
</view> </view>
<!-- 施工技师 --> <!-- 施工技师 -->
...@@ -78,34 +78,45 @@ ...@@ -78,34 +78,45 @@
<view class="staff-label">施工技师</view> <view class="staff-label">施工技师</view>
<view class="staff-value">{{ orderCardDetail.technicianName }}</view> <view class="staff-value">{{ orderCardDetail.technicianName }}</view>
</view> </view>
<PublishPopup ref="recordOrderPopup" popupClass="recordOrderPopup" type="center" :showClose="true" :isMaskClick="false" title="请选择录单入口"> <view v-if="orderCardDetail.zyPayStatus != 1" class="">
<template #content> <view class="flex px-24 tips" v-if="(orderCardDetail.orderStatus == 3 && orderCardDetail.equityOrderStatus == 0 && orderCardDetail.equityGoodsFlag == 1) || (orderCardDetail.orderStatus == 5 && orderCardDetail.equityOrderStatus == 0)">
<view class="modatcontent"> <view class="sprite-icon icon-study-tips"></view>
<view class="modalbox com" :class="selectType == 1 ? 'act' : ''" @click="changeType(1)"> 订单已支付,未录入权益合同
<view class="sprite-icon icon-createOrder"></view>
新增工单
</view> </view>
<view class="modalbox cancle" :class="selectType == 2 ? 'act' : ''" @click="changeType(2)"> <!-- 已录单未签名 -->
<view class="sprite-icon icon-defeatOrder"></view> <view class="flex px-24 tips" v-else-if="orderCardDetail.orderStatus == 3 && orderCardDetail.equityOrderStatus == 2">
战败下单 <view class="sprite-icon icon-study-tips"></view>
订单已支付,尚未签名确认
</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>
<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="item-footer">
<view class="sprite-icon icon-revokeOrder"></view> <view class="btn_class">
撤销工单 <!-- 更多按钮 -->
<!-- <view v-if="buttonConfig.showMoreBtn">
<view class="order-btn default-btn padding_20" @click="handleMoreBtn">更多</view>
</view> -->
<!-- 接待记录按钮 -->
<!-- <view v-if="buttonConfig.showReceptionBtn">
<view class="order-btn default-btn padding_20" @click="jumpReception">接待记录</view>
</view> -->
<!-- 次要按钮 -->
<view v-for="(btn, index) in buttonConfig.secondaryButtons" :key="index">
<view class="order-btn default-btn" @click="() => handleClickBtn(btn.dataType)">
{{ btn.text }}
</view> </view>
</view> </view>
</template>
<template #footer> <!-- 主要按钮 -->
<view class="footer-box flex justify-center"> <view v-if="buttonConfig.primaryButton">
<view class="cancle-btn btn" @click.stop="cancelSelection">取消</view> <view class="order-btn" @click="() => handleClickBtn(buttonConfig.primaryButton.dataType)">
<view class="sure-btn btn" @click.stop="confirmSelection">确认</view> {{ buttonConfig.primaryButton.text }}
</view> </view>
</template> </view>
</PublishPopup> </view>
</view>
<NoticePopup ref="notice" title="提示" text="是否撤销该笔客户工单,撤销后客户工单为「已撤销」状态,不再统计订单数和订单金额。" type="warning"></NoticePopup>
</view> </view>
</template> </template>
<script> <script>
...@@ -114,7 +125,7 @@ import { interceptionMixin } from '@/mixin/index' ...@@ -114,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',
...@@ -125,7 +136,8 @@ export default { ...@@ -125,7 +136,8 @@ export default {
} }
}, },
components: { components: {
PublishPopup PublishPopup,
NoticePopup
}, },
computed: { computed: {
payType() { payType() {
...@@ -133,6 +145,113 @@ export default { ...@@ -133,6 +145,113 @@ export default {
}, },
status() { status() {
return order_mixins.data.orderStatusObj || {} return order_mixins.data.orderStatusObj || {}
},
buttonConfig() {
const config = {
showMoreBtn: false,
showReceptionBtn: false,
primaryButton: null,
secondaryButtons: []
}
const order = this.orderCardDetail
const localUser = this.localUserInfo
// 超管或商户类型1不可操作
if (localUser?.isSuper || localUser?.userType !== 2) {
config.showMoreBtn = order.showInvoiceEntrance || ((order.orderStatus == 3 || order.orderStatus == 5 || (order.orderStatus == 6 && order.refundAmount)) && this.isOrder)
return config
}
// 待上传合同协议且是已支付的订单 (zyPayStatus == 1 且 orderStatus 为 3/4/7)
if (order.zyPayStatus == 1 && (order.orderStatus == 3 || order.orderStatus == 4 || order.orderStatus == 7)) {
config.showMoreBtn = order.showInvoiceEntrance || order.invoicing == 2
config.showReceptionBtn = order.orderStatus != '0'
config.primaryButton = { text: '上传协议', type: 'primary', dataType: 'upload' }
if (order.equityOrderStatus == 0 && order.equityGoodsFlag == 1) {
config.secondaryButtons.push({ text: '去处理', type: 'secondary', dataType: 'handle' })
}
return config
}
// 其他情况 - 订单状态不是4,11,9
if (order.orderStatus != '4' && order.orderStatus != 11 && order.orderStatus != 9) {
config.showMoreBtn = order.showInvoiceEntrance || ((order.orderStatus == 3 || order.orderStatus == 5 || order.orderStatus == 6) && this.isOrder)
config.showReceptionBtn = order.orderStatus != '0'
// 修改协议按钮
if (order.canUpdateZyPayUrl == 1 && order.zyPayStatus == 2) {
config.secondaryButtons.push({ text: '修改协议', type: 'secondary', dataType: 'upload' })
}
if (this.isOrder) {
// 待跟进或待支付状态
if (order.orderStatus == '-1' || order.orderStatus == '0') {
config.primaryButton = {
text: this.btnTxt[order.orderStatus] || (order.orderStatus == '-1' ? '去报价' : '去报价'),
type: 'primary',
dataType: 'price'
}
}
// 非已完成状态
else if (order.orderStatus != 6) {
// 战败状态
if (order.orderStatus == '2') {
config.secondaryButtons.push({ text: '战败', type: 'secondary', dataType: 'defeat' })
config.primaryButton = {
text: this.btnTxt[order.orderStatus] || '去支付',
type: 'primary',
dataType: 'pay'
}
}
// 已支付状态
else if (order.orderStatus == '3') {
if (order.equityGoodsFlag == '1') {
// config.secondaryButtons.push({ text: '客户签名', type: 'secondary', dataType: 'signature' })
}
// 已支付未录单
if (order.equityOrderStatus == '0' && order.equityGoodsFlag == '1') {
config.primaryButton = {
text: this.btnTxt[order.orderStatus] || '去处理',
type: 'primary',
dataType: 'handle'
}
}
}
// 已完成状态
else if (order.orderStatus == '5') {
// 已完成未录单
if (order.equityOrderStatus == '0' && order.equityGoodsFlag == '1') {
config.primaryButton = {
text: this.btnTxt[order.orderStatus] || '去处理',
type: 'primary',
dataType: 'handle'
}
}
}
// 其他状态
else {
config.primaryButton = {
text: this.btnTxt[order.orderStatus] || '处理',
type: 'primary',
dataType: 'default'
}
}
}
// 除待跟进工单,支付方式为门店收款的订单可以在工单详情页面展示撤销按钮
if (!(order.orderStatus == '-1' && order.selectPayType == 2)) {
config.secondaryButtons.push({ text: '撤销', type: 'secondary', dataType: 'revoke' })
}
}
} else {
// 订单状态为4,11,9的情况
config.showMoreBtn = order.showInvoiceEntrance || ((order.orderStatus == 3 || order.orderStatus == 5 || order.orderStatus == 6) && this.isOrder)
}
return config
} }
}, },
data() { data() {
...@@ -250,7 +369,15 @@ export default { ...@@ -250,7 +369,15 @@ export default {
} }
], ],
localUserInfo: null, localUserInfo: null,
isOrder: null isOrder: null,
btnTxt: {
0: '去报价',
1: '确认方案',
2: '去支付',
3: '去处理',
'-1': '去报价',
5: '去处理'
}
} }
}, },
mounted() { mounted() {
...@@ -258,119 +385,121 @@ export default { ...@@ -258,119 +385,121 @@ export default {
this.isOrder = !(this.localUserInfo?.isSuper || this.localUserInfo?.loginRole == 3 || this.localUserInfo.loginRole == 5 || this.localUserInfo?.loginRole == 6) this.isOrder = !(this.localUserInfo?.isSuper || this.localUserInfo?.loginRole == 3 || this.localUserInfo.loginRole == 5 || this.localUserInfo?.loginRole == 6)
}, },
methods: { methods: {
// 查看全部商品 copyText(e) {
showAllGoodsList: debounce(function (e) { console.log(e)
this.$emit('toggle-goods-list', { uni.setClipboardData({
item: this.orderCardDetail, data: e,
flag: !this.orderCardDetail.showAllGoodsListFlag success: () => {
}) uni.showToast({
}, 300), title: '复制成功',
async jumpClick(name, item) { icon: 'success',
// 订单状态 1 待跟进, 2 不升级, 3 待支付,4 已支付,6 已评价 ,9 已撤销 , 10 已关闭 , 11 已失效 duration: 2000
// constructionFlag 施工标识(Y:已施工;N||null:未施工)
// failureFlag 订单失效状态(Y:已失效,N:未失效)
// console.log(e.currentTarget.dataset)
// return
if (this.localUserInfo.merchantAccountList && this.localUserInfo.merchantAccountList.length) {
try {
this.localUserInfo.merchantAccountList.map(e => {
if (e == 6 || e == 8) throw true
})
} catch (error) {
this.localUserInfo.merchantType = error
}
}
this.localUserInfo.isMake = !(this.localUserInfo?.isSuper || this.localUserInfo?.loginRole == 3 || this.localUserInfo?.loginRole == 5 || this.localUserInfo?.loginRole == 6 || this.localUserInfo?.loginRole == 7)
let { userType, isSuper, merchantType, isMake } = this.localUserInfo
console.log(item)
if (name == 'CreateOrder' || name == 'PremiumUpgrade') {
if (merchantType && !isSuper && isMake) {
// 校验是否填写昨日日报
let staffCheck = await checkDailyReport()
if (staffCheck) return false
if (name == 'CreateOrder' && (await this.inspectionOfProhibitionBill())) return /**禁止提单 */
// 是微信支付直接跳转确认页面
if (userType == 2 && item?.selectPayType == 1) {
this.$emit('jump', 'ConfirmOrder', this.orderCardDetail)
} else if (userType == 2) {
item
? this.showSelectType({
item
}) })
: this.$emit('jump', name, { paramsData: this.orderCardDetail, type: 'createWithPay' })
} else {
utils.showNoAccess()
}
} else {
utils.showNoAccess()
}
// 已支付加已施工
} else if (item.constructionFlag == 'Y' && item.status != 10) {
this.$emit('jump', name, this.orderCardDetail)
} else {
this.$emit('jump', name, this.orderCardDetail)
} }
})
}, },
// 确定是否要显示 handleClickBtn(type) {
showSelectType({ scene = '', item = {} }, scan = false) { switch (type) {
this.isScan = scan case 'upload':
// 当切换门店后,不支持录入失效客户工单,将selectType置为1录入工单 // 处理上传协议
if ((!this.isSettingExpiredTraffic || scan) && this.selectType == 3) { break
this.selectType = 1 case 'handle':
// 处理去处理
this.createorder()
break
case 'price':
// 处理去报价
break
case 'pay':
// 处理去支付
break
case 'defeat':
// 处理战败
break
case 'revoke':
// 处理撤销
this.revokeOrder()
break
case 'default':
// 处理默认情况
break
default:
// 其他情况
break
} }
this.getCreateOrderSetting() },
this.$nextTick(() => { // 撤销工单方法
if (this.$refs.recordOrderPopup) { revokeOrder() {
this.$refs.recordOrderPopup.open() // 配置弹窗按钮
} else { this.$refs.notice.buttonsList = [
console.error('recordOrderPopup ref is not available') {
text: '取消',
type: 'default',
callback: () => {
this.transmissionOfData = null
this.$refs.notice.close()
} }
})
}, },
{
// 获取轻改录单配置是否启用流量失效 text: '撤销',
getCreateOrderSetting() { type: 'primary',
let merchantType = this.localUserInfo?.merchantAccountList.includes('6') || this.localUserInfo?.merchantAccountList.includes('8') callback: async () => {
if (merchantType && !this.localUserInfo?.isSuper && this.localUserInfo?.loginRole != 3 && this.localUserInfo?.userType == 2 && this.localUserInfo?.shopMerchantId) { // 校验订单是否可撤销(在退款流程中无法撤销)
uni.$api.boutiqueApi.getServiceBaseInfo({ merchantId: this.localUserInfo?.shopMerchantId }).then(res => { let refundStep = await uni.$api.equityApi.getOrderRefundStep({ orderCode: this.orderCardDetail.payId })
this.isSettingExpiredTraffic = res?.trafficExpireFlag == 'Y' if (refundStep?.data == 'Y') return _this.showRefundAlert()
this.repeal(this.orderCardDetail.id)
}
}
]
// 打开弹窗
this.$refs.notice.open()
},
//修改客户信息
jumpUpdate() {
this.$emit('jump', 'UpdateOrderInfo', { paramsData: this.orderCardDetail, type: 'UpdateOrderInfo' })
},
//去处理
createorder() {
this.$emit('jump', 'CreateOrder', { paramsData: this.orderCardDetail, type: 'CreateOrder' })
},
showRefundAlert(type) {
const text = type == 'error' ? '订单已发起退款,禁止标记为错误工单!如需标记错误请联系总部运营。' : '订单已发起退款,禁止撤销!如需撤销请联系总部运营。'
uni.showModal({
title: '提示',
content: text,
showCancel: false,
confirmText: '好的'
}) })
}
}, },
changeType: debounce(function (type) { repeal(id, revokeReason) {
this.selectType = type uni.showLoading({
}, 300), mask: true
confirmSelection: debounce(async function () {
this.$refs.recordOrderPopup.closePopup()
console.log('this.selectType', this.selectType)
if (this.selectType == 1) {
console.log(await this.inspectionOfProhibitionBill())
if (await this.inspectionOfProhibitionBill()) return
this.$emit('jump', 'CreateOrder', { paramsData: this.orderCardDetail, type: 'createWithPay' })
} else if (this.selectType == 2 || this.selectType == 3) {
this.$emit('jump', 'DefeatOrder', { paramsData: this.orderCardDetail, type: 'createWithPay', isExpiredTraffic: this.selectType == 3 })
} else if (this.selectType == 4) {
let _this = this
uni.$api.boutiqueApi
.revokeOrder({
orderCode: this.orderCardDetail.orderCode
}) })
.then(data => { let _this = this
let params = {
id
}
if (revokeReason) {
params.revokeReason = revokeReason
}
uni.$api.equityApi.cancelOrderById(params).then(_res_ => {
if (_res_) {
uni.hideLoading()
uni.showToast({ uni.showToast({
title: '操作成功', title: '操作成功',
icon: 'success' icon: 'success'
}) })
this.transmissionOfData = null
this.$refs.notice.close()
setTimeout(() => {
this.$emit('refresh') this.$emit('refresh')
// _this.getList();
}, 500)
} else {
uni.hideLoading()
}
}) })
} }
}, 300),
cancelSelection() {
this.$refs.recordOrderPopup.closePopup()
},
cardClick: debounce(function () {
this.jumpClick(this.orderCardDetail.status == 3 ? 'ConfirmOrder' : this.orderCardDetail.status == 1 ? 'CreateOrder' : 'OrderDetail', this.orderCardDetail)
}, 300)
} }
} }
</script> </script>
...@@ -493,71 +622,47 @@ export default { ...@@ -493,71 +622,47 @@ export default {
font-size: toRpx(24); font-size: toRpx(24);
color: #999ea8; color: #999ea8;
font-weight: 400; font-weight: 400;
flex-shrink: 0;
} }
.order-value { .order-value {
font-size: toRpx(24); font-size: toRpx(24);
color: #666666; color: #666666;
font-weight: 400; font-weight: 400;
.split { min-width: 0;
margin: 0 toRpx(6);
}
}
}
/* 支付方式相关样式 */
.payType {
width: 50%;
padding: toRpx(10) toRpx(20) toRpx(10) 0;
box-sizing: border-box;
.payType-label {
width: toRpx(120);
margin-right: toRpx(24);
font-size: toRpx(24);
color: #999ea8;
font-weight: 400;
} }
.payType-value { .order-value-single,
font-size: toRpx(24); .order-value-item {
color: #666666; overflow: hidden;
font-weight: 400; text-overflow: ellipsis;
white-space: nowrap;
min-width: 0;
} }
}
.order-price { .value-text {
padding: toRpx(10) toRpx(20) toRpx(10) 0; overflow: hidden;
box-sizing: border-box; text-overflow: ellipsis;
padding-right: 0; white-space: nowrap;
padding-left: toRpx(20);
.order-price-label {
width: toRpx(120);
margin-right: toRpx(24);
font-size: toRpx(24);
font-weight: 400;
color: #999ea8;
} }
.price { .split {
display: flex; margin: 0 toRpx(6);
align-items: center; flex-shrink: 0;
color: #4673ff;
font-size: toRpx(36);
font-weight: 700;
} }
} }
.payType-image {
width: toRpx(32);
height: toRpx(32);
margin-left: toRpx(10);
}
.unit { .unit {
margin-right: toRpx(8); margin-right: toRpx(8);
color: #347bff;
font-size: toRpx(28); font-size: toRpx(28);
font-weight: 700; font-weight: 700;
} }
.price {
color: #347bff;
font-size: toRpx(36);
font-weight: 700;
}
.construction-staff { .construction-staff {
width: 50%; width: 50%;
...@@ -613,4 +718,168 @@ export default { ...@@ -613,4 +718,168 @@ export default {
margin-top: toRpx(12); margin-top: toRpx(12);
} }
} }
.item-footer {
display: flex;
justify-content: end;
align-items: center;
font-size: toRpx(24);
color: #9b9b9e;
border-top: 1 solid #ededed;
padding: toRpx(20) toRpx(32) 0;
}
.btn_class {
display: flex;
gap: toRpx(8);
margin-left: auto;
}
.order-btn {
box-sizing: border-box;
height: toRpx(56);
display: flex;
align-items: center;
justify-content: center;
font-size: toRpx(28);
color: #ffffff;
background: #347bff;
border-radius: toRpx(32);
padding: toRpx(8) toRpx(20);
flex-shrink: 0;
}
.order-btn.default-btn {
background: #ffffff;
border: toRpx(2) solid #347bff;
border-radius: toRpx(32);
color: #347bff;
}
.padding_20 {
padding: 0 toRpx(14);
}
.list .item .order {
font-size: toRpx(24);
color: #333333;
margin-bottom: toRpx(20);
display: flex;
align-items: center;
}
.list .item .order:last-of-type {
margin-bottom: 0;
}
.list .item .order .order-label {
width: toRpx(36);
color: #9b9b9e;
}
.list .item .order .order-value {
width: calc(100% - toRpx(136));
display: flex;
align-items: center;
}
.list .item .order .order-value .order-value-item:first-of-type {
max-width: 70%;
}
.list .item .order .order-value .order-value-item .split {
margin: 0 toRpx(6);
}
.list .item .order-price {
display: flex;
justify-content: flex-end;
/* align-items: center; */
align-items: flex-end;
font-size: toRpx(24);
color: #666666;
/* padding-top: var(--fontSize8); */
}
.list .item .order-price .price {
box-sizing: border-box;
color: #f24724;
font-size: toRpx(40);
margin-left: toRpx(20);
margin-bottom: calc(-1 * toRpx(8));
/* margin-top: var(--fontSize8); */
}
.list .item.gray .order-price .price {
color: #666 !important;
}
.list .item .order-price .price .unit {
font-size: toRpx(28);
}
.list .item .order-payType {
font-size: toRpx(24);
color: #333333;
/* margin-top: var(--fontSize50); */
display: flex;
justify-content: space-between;
align-items: flex-end;
}
.list .item .btn {
border: toRpx(2) solid #666666;
border-radius: toRpx(12);
box-sizing: border-box;
font-size: toRpx(28);
color: #666666;
position: absolute;
right: toRpx(40);
bottom: toRpx(30);
width: toRpx(192);
height: toRpx(64);
}
.tips {
display: flex;
align-items: center;
font-size: toRpx(24);
width: 100%;
height: toRpx(56);
border-radius: 12px;
opacity: 1;
background: #fef5ea;
margin: toRpx(16) 0;
color: #ff9d0a;
&-text {
margin-top: toRpx(4);
}
.icon-study-tips {
margin-right: toRpx(8);
}
}
.copy-btn {
display: flex;
align-items: center;
margin-left: auto;
color: #808291;
.copy {
margin-right: toRpx(8);
margin-left: toRpx(20);
}
}
.order-card-bottom-box {
border-bottom: toRpx(2) solid #f7f7f6;
padding-bottom: toRpx(20);
}
.updateInfo {
color: #347bff;
font-size: var(--fontSize28);
margin-left: var(--fontSize16);
font-weight: normal;
margin-right: auto;
}
.updateInfo.isHide {
display: none;
}
</style> </style>
<template> <template>
<view class="order-detail"> <view class="order-detail">
<view class="common-title">{{ orderInfo.constructionFlag == 'Y' && orderInfo.status != 10 ? '完成施工' : '工单详情' }}</view> <view class="common-title">订单详情</view>
<view v-if="isShow" class="px-48 scroll-y" :class="{ 'construction-flag-y': !isMake }"> <view
<view class="top-tips flex align-center" v-if="orderInfo.status != 10 && orderInfo.status != 9 && orderInfo.constructionFlag !== 'Y'"> v-if="orderInfo.orderCode"
class="px-48 scroll-y"
:key="viewKey"
>
<view class="top-tips flex align-center">
<view class="sprite-icon icon-successIcon checkbox-filled"></view> <view class="sprite-icon icon-successIcon checkbox-filled"></view>
<view> <view>
<view class="fs-34 fw-5">客户已付款</view> <view class="fs-34 fw-5">支付成功</view>
<view class="fs-26 mt-12 cl-gray">技师施工完毕后可通知车主前来取车</view> <view class="fs-26 mt-12 cl-gray">订单支付成功,实付{{orderInfo.totalPrice}}元</view>
</view> </view>
<view class="sprite-icon icon-topTipsRightIcon topTipsRightIcon"></view> <view class="sprite-icon icon-topTipsRightIcon topTipsRightIcon"></view>
</view> </view>
<view class="top-tips flex align-center" v-if="orderInfo.status == 10"> <view class="order-tips">
<view class="fs-34 fw-7">订单关闭</view> <view class="order-tips-title">温馨提示</view>
<view class="fs-26 ml-12">客户支付超过24小时,系统自动关闭订单</view> <view class="order-tips-item">1. 客户服务合同:手机端支持ocr快速出单,点下一步去提单或权益订单补录;</view>
</view> <view class="order-tips-item">2. 合同出单失败:若页面提示出单失败,请根据页面提示修改信息点重新提交即可。</view>
<view class="top-tips flex align-center" v-if="orderInfo.status == 9">
<view class="fs-34 fw-7">订单已撤销</view>
<!-- <view class="tips">客户支付超过24小时,系统自动关闭订单</view> -->
</view>
<view class="top-tips flex align-center" v-if="orderInfo.constructionFlag == 'Y'">
<view class="sprite-icon icon-successIcon checkbox-filled"></view>
<view>
<view class="fs-34 fw-5">客户{{ orderInfo.customer.customerName }}</view>
<view class="fs-26">完成施工,如客户有新的需要,可点击再次下单。</view>
</view>
</view>
<!-- 商品信息 -->
<view class="box-shell">
<view class="box-shell-title">商品信息</view>
<!-- 套餐 -->
<view class="meal-box" v-for="(item, index) in orderInfo.packageGoodsList">
<view class="meal-hd flex justify-between align-center">
<view>{{ item.packageAlias || item.packageName }}</view>
<view class="price">¥{{ item.totalPrice }}</view>
</view>
<view class="meal-bd">
<view class="meal-bd-box" v-for="g in item.packageGoodsOrderList">
<view class="meal-bd-head flex justify-between align-center">
<view class="flex align-center">
<view class="name">{{ g.upgradeGoodsAlias || g.upgradeGoodsName }}</view>
<view class="meal-bd-bottom flex align-center">
{{ g.upgradeGoodsType === 1 ? g.positionStr : g.upgradeGoodsTypeName }}
<view class="count">x{{ g.number }}</view>
</view>
</view>
<view class="price">¥{{ g.price }}</view>
</view>
</view>
</view>
</view>
<view class="good-list">
<view class="good" v-for="(item, index) in orderInfo.subOrderList" :key="index">
<view class="flex justify-between align-center mb-20">
<text class="good-name">商品名称:{{ replaceItemText(item.upgradeGoodsName) || '' }}</text>
<text class="good-price">¥{{ item.price }}</text>
</view>
<view class="flex justify-between align-center mb-12" v-if="item.upgradeGoodsAlias">
<text class="good-alias">商品别名:{{ replaceItemText(item.upgradeGoodsAlias) || '' }}</text>
</view>
<view class="flex align-center">
<text class="good-sku">{{ item.positionStr || item.upgradeGoodsTypeName }}</text>
<text class="good-count">x{{ item.number }}</text>
</view>
</view>
</view>
<view class="flex align-center my-16">
<view class="sprite-icon icon-coupon fs-14"></view>
<text class="fs-14 coupon-name">{{ orderInfo.couponName || '' }}{{ orderInfo.customerCoupon.customerCouponCode || '' }}({{ orderInfo.customerCoupon.employeeName || '' }})</text>
</view>
<view class="flex justify-end align-center">
<text class="good-total-lable">商品总金额:</text>
<text class="good-total-value">
<text class="unit">¥</text>
{{ orderInfo.total_price }}
</text>
</view>
</view> </view>
<!-- 工单信息 --> <!-- 工单信息 -->
<view class="box-shell pt-32"> <view class="box-shell pt-32">
<view class="box-shell-title">工单信息</view> <view class="box-shell-title">订单信息</view>
<view class="order-info pt-16">
<view v-for="(item, index) in orderObj" :key="index" class="flex align-center pt-16">
<view class="label">{{ item.label }}</view>
<view v-if="item.key == 'status'">
<view class="value" :style="{ color: status[orderInfo.status].color || '' }">
{{ status[orderInfo.status].text }}
</view>
</view>
<view v-else>
<view class="value">
<view v-if="item.key == 'payType'">
{{ payType[orderInfo.selectPayType] || '' }}
</view>
<view v-else>{{ orderInfo[item.key] || '' }}</view>
</view>
</view>
<view v-if="item.copy" class="copy-btn" @click="setCopyData(orderInfo[item.key])">
<view class="sprite-icon icon-icon-copy copy"></view>
</view>
<!-- <view class="customize-btn" v-if="item.dateChange" @click.stop="customizeDate">自定义</view> -->
</view>
<view v-if="(orderInfo.selectPayType == 2 || orderInfo.selectPayType == 5 || orderInfo.selectPayType == 6 || orderInfo.selectPayType == 7) && orderInfo.payVoucherList.length">
<view class="flex align-start pt-16">
<view class="label">付款凭证</view>
<view class="image-box flex">
<view class="value" @click="previewImage" v-for="(item, index) in orderInfo.payVoucherList" :key="index">
<view class="image">
<image :src="item.payVoucher" />
</view>
</view>
</view>
</view>
</view>
<view v-if="orderInfo.status == 5 || orderInfo.status == 12">
<view class="flex align-center pt-16">
<view class="label">退款明细</view>
<view class="value">{{ orderInfo.refundType == 1 ? '退全款' : '退部分款' }}¥{{ orderInfo.refundAmount }}</view>
</view>
</view>
<view class="paid" v-if="orderInfo.payOrder && orderInfo.payOrder.payStatus == 2">
<!-- <image src="../../images/paid.png" /> -->
</view>
</view>
</view>
<!-- 客户信息 -->
<view class="box-shell">
<view class="box-shell-title">客户信息</view>
<view class="order-info pt-16"> <view class="order-info pt-16">
<view class="flex align-center pt-20" v-for="(item, index) in customerObj" :key="index"> <view
v-for="(item, index) in orderObj"
:key="index"
class="flex align-center pt-16"
>
<view class="label">{{ item.label }}</view> <view class="label">{{ item.label }}</view>
<view class="flex flex-1">
<view class="value" :style="{ color: item.color || '#333' }">
<view v-if="item.arr">
<view v-if="orderInfo[item.arr[1]]" class="flex">
<view v-for="(i, ind) in item.arr" :key="ind">
<view class="value-item text-hide">
<text v-if="ind == 1" class="lineText">|</text>
{{ orderInfo[i] }}
</view>
</view>
</view>
</view>
<view v-else>
{{ item.enum ? item.enum[orderInfo[item.key]] : orderInfo[item.key] || '' }}
</view>
</view>
<view v-if="item.copy" class="copy-btn" @click="setCopyData(orderInfo[item.key])">
<view class="sprite-icon icon-icon-copy copy"></view>
</view>
</view>
</view>
</view>
<view v-if="orderInfo.selectPayType == 0" class="order-info">
<view class="flex align-center pt-16">
<view class="label">拒升理由</view>
<view class="value">
{{ orderInfo.customer.refusalReason ? orderInfo.customer.refusalReason : '' }}
</view>
</view>
</view>
</view>
<view v-if="warrantyCardList.length || warrantyCardVisible" class="box-shell">
<view class="box">
<view class="box-shell-title">{{ orderInfo.selectPayType == 0 ? '客服' : '质保信息' }}</view>
<view class="warranty-list" v-for="(item, index) in warrantyCardList" :key="index">
<view class="warranty flex align-center justify-between pt-20">
<view class="flex align-center">
<view class="label">质保产品</view>
<view class="value">{{ replaceItemText(item.goodsName) }}</view>
</view>
<view class="flex align-center edit-warranty" @click="warrantyEdit(item)" v-if="orderInfo.constructionFlag == 'Y'">
<view class="sprite-icon icon-edit mr-8"></view>
质保价格
</view>
</view>
<view class="warranty flex align-center pt-20">
<view class="label">质保期</view>
<view class="value">{{ item.warrantyPeriod }}</view>
</view>
<view class="warranty flex align-start pt-20">
<view class="label">质保编码</view>
<view class="codeImg-box">
<image v-if="item.barCodeUrl" :src="item.barCodeUrl" class="barCodeImg" />
<!-- <view class="barCode">{{ item.cardCode }}</view> -->
</view>
</view>
</view>
<view class="warranty-list">
<view class="warranty flex align-start pt-20">
<view class="label">{{ orderInfo.selectPayType == 0 ? '客服号' : '质保查询' }}</view>
<view class="value"> <view class="value">
<view class="warranty-tips" v-if="warrantyCardVisible"> <template v-if="item.type == 'project'">
{{ orderInfo.selectPayType == 0 ? '建议让客户扫码关注客服号领取礼包' : '建议让客户扫码关注客服查询质保' }} <template v-for="(subItem,ind) in (orderInfo.quotationGoodsInfoList || orderInfo.subOrderList)">
</view> <view
<image v-if="warrantyCardVisible" :src="customerService" class="customerService" /> class="goodsName"
</view> :key="ind"
</view> >{{subItem.goodsNameAlias||subItem.upgradeGoodsName||subItem.goodsName}} <text
</view> class="goodsItem"
</view> v-if="subItem.serviceItems||subItem.position"
</view> >(包含{{subItem.serviceItems||subItem.position}})</text></view>
</template>
<view class="flex align-center footer-box justify-center" v-if="isMake && orderInfo.status !== 12"> </template>
<view class="edit btn flex-1" @click="repeal">撤销工单</view> <template v-else-if="item.type =='status'">
</view> <view class="status">已支付</view>
<!-- <view class="flex align-center footer-box justify-center" v-if="orderInfo.constructionFlag == 'Y'"> </template>
<view class="edit btn flex-1" @click="repeal">再来一单</view> <template v-else>
</view> --> <template v-if="item.format">
<!-- 已支付4 战败2 已评价6 三种状态才展示 并且不是通过失效客户录入的战败单 --> {{ item.format(orderInfo) }}
<view v-if="!userInfo.isSuper && userInfo.loginRole != 3 && userInfo.loginRole != 6 && userInfo.userType == 2 && (orderInfo.status == 4 || orderInfo.status == 2 || orderInfo.status == 6) && ((orderInfo.subOrderList && orderInfo.subOrderList.length) || (orderInfo.packageGoodsList && orderInfo.packageGoodsList.length))"> </template>
<!-- 不需要走签名逻辑 --> <template v-else>
<view v-if="signatureSwitch && orderInfo.selectPayType != 0" class="btn-box" :class="isFullSucreen ? 'isFullSucreen-btn' : ''"> {{orderInfo[item.key] || '--'}}
<view class="btn text-center" bindtap="navOrderSignature">客户签名确认</view> </template>
</view>
<view v-else class="btn-box" :class="isFullSucreen ? 'isFullSucreen-btn' : ''">
<!-- <tips-bottom style="width: 100%;box-sizing: border-box;" tipsProps="{{ tipsProps }}" /> -->
<!-- <view class="btn text-center" bindtap="showAgain">继续下单</view> -->
<view class="btn text-center" @click="confirmConstruction">确认完成施工</view>
</view>
</view>
</view>
<PublishPopup ref="calendarPopup" popupClass="calendarPopup" :showClose="false" :showTitle="false" @confirm="confirmCalendar">
<template #content>
<uni-calendar class="calendar" :showMonth="false" @change="calendarChange" />
</template> </template>
</PublishPopup>
<PublishPopup ref="tipsPopup" popupClass="tipsPopup" type="center" :showClose="true" :showTitle="false">
<template #content>
<view>
<image class="tipsPopupBg" :src="bg" />
<view class="title">重要提示</view>
<view class="tipsConent">
<view>是否确认撤销工单?</view>
</view> </view>
</view> </view>
</template>
</PublishPopup>
<PublishPopup ref="IsExistTipsPopup" popupClass="tipsPopup" type="center" :showClose="true" :showTitle="false">
<template #content>
<view>
<image class="tipsPopupBg" :src="bg" />
<view class="title">重要提示</view>
<view class="tipsConent">
<view>订单已发起退款,禁止撤销!</view>
<view>如需撤销请联系总部运营。</view>
</view> </view>
</view> </view>
</template>
<template #footer> <view class="flex align-center footer-box justify-center">
<view class="isExistTips-btn-box"> <view
<view class="sure-btn btn flex-1" @click="closeIsExistTipsPopup">好的</view> class="edit btn"
@click="$emit('jump','OrderManagement')"
>返回列表</view>
</view> </view>
</template>
</PublishPopup>
<PublishPopup :key="popupKey" ref="warrantyPopup" popupClass="warrantyPopup" type="center" title="质保价格" :showClose="true" @confirm="confirmEdit">
<template #content>
<view class="warranty-content">
<view class="name">产品:{{ replaceItemText(warrantyEditObj.goodsName) }}</view>
<view class="label">质保价格</view>
<textarea class="warranty-input" v-model="warrantyEditObj.warrantyPrice" maxlength="50" placeholder="请输入(最多50字)" />
<view class="tips">质保价格输入的内容会在车主查询质保卡时显示</view>
</view> </view>
</template>
</PublishPopup>
</view> </view>
</template> </template>
<script> <script>
import utils from '@/utils/utils' import utils from '@/utils/utils'
import order_mixins from '../../order_mixins.js'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { index } from '@/env' import { index } from '@/env'
import PublishPopup from '@/components/PublishPopup.vue'
export default { export default {
name: 'OrderDetail', name: 'OrderDetail',
components: { components: {
PublishPopup
}, },
props: { props: {
transmissionOfData: { transmissionOfData: {
...@@ -288,418 +82,80 @@ export default { ...@@ -288,418 +82,80 @@ export default {
}, },
watch: { watch: {
transmissionOfData: { transmissionOfData: {
async handler(newVal) { async handler (newVal) {
if (newVal) { console.log(newVal)
console.log('接收到的交易数据:', newVal) if (newVal) this.getOrderDetail(newVal.payId)
console.log('this.orderObjData', this.transmissionOfData)
let baseConfigData = await this.setConfigInfo(getApp().globalData)
this.baseConfigData = baseConfigData
this.getDetail(this.transmissionOfData.orderCode)
const userInfo = uni.$storage.get('userInfo')
}
}, },
immediate: true immediate: true
} }
}, },
data() { data () {
return { return {
...order_mixins.data,
orderInfo: {}, orderInfo: {},
baseConfigData: {}, viewKey: Date.now(),
customerService: '', orderObj: Object.freeze([
defaultCustomerService: 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/kf.png', {
failCustomerService: '../images/kfrefresh.png', label: '订单编号',
warrantyCardVisible: true, key: 'orderCode'
signatureSwitch: false, //不需要走签名逻辑 没有开启签名功能或则是战败订单
warrantyCardList: [],
isMake: true,
selectDate: null,
warrantyEditObj: {},
isShow: false,
bg: require('@/assets/images/boutique/tipsPopupBg.png'),
popupKey: 0
}
},
async mounted() {},
methods: {
replaceItemText(item) {
var reg = getRegExp(';~;', 'g')
return item ? item.replace(reg, ' ') : ''
}, },
async getPositionList() { {
const res = await uni.$api.boutiqueApi.getPositionList({}) label: '订单时间',
return res format: (val) => {
}, return val.orderTime ? dayjs(val.orderTime).format('YYYY年MM月DD日 HH:mm:ss') : '--'
async getDetail(orderCode) {
this.isShow = false
uni.showLoading({
title: '加载中...',
mask: true
})
const userInfo = uni.$storage.get('userInfo')
const positionTypeList = (await this.getPositionList()) || []
let _this = this
uni.$api.boutiqueApi
.getPackageGoodsDetail({
orderCode
})
.then(async data => {
await this.getServiceBaseInfo(data.merchantId)
await this.getSignatureSwitch(data.merchantId)
if (data.selectPayType != 2 && (data.status == 4 || data.status == 6 || data.status == 12)) {
// 查询订单可展示按钮
// commonApi.getMoreBtnAPI({ orderCode: data.orderCode }).then(res => {
// let { code, data } = res
// if (code == 0) {
// this.showMoreBtn = data.refundApplyButton == 'Y' || data.refundApplyDetailButton == 'Y'
// }
// })
}
console.log('3255555666')
// 服务商是否使用膜卷号配置
if (!userInfo?.isSuper && userInfo.userType == 2 && data.status != 10 && data.status != 9) {
let isUseFilmRoll = await this.getServiceFilmRollSetting(data?.sellerMerchantId)
this.isUseFilmRoll = isUseFilmRoll
}
console.log('32555556669999')
let couponName = data.customerCoupon ? data.customerCoupon.couponName : ''
let total_price = 0
for (var i = 0; i < data?.subOrderList?.length; i++) {
let e = data?.subOrderList[i]
total_price += e.totalPrice
e.price = Number(utils.decimal(Number(e.totalPrice / e.number), 2)).toFixed(2)
e.positionStr = positionTypeList.filter(v => v.positionValue == e.upgradeGoodsPosition)[0]?.positionName || ''
if ((e.upgradeWarrantyPeriod || e.upgradeWarrantyPeriod > 0) && data.selectPayType != 0) {
const warrantyItem = {
warrantyPeriod: e.upgradeWarrantyPeriod || '',
goodsName: e.upgradeGoodsAlias || e.upgradeGoodsName || '',
cardCode: e.cardCode || '',
warrantyPrice: e.warrantyPrice || '',
barCodeUrl: ''
}
Object.keys(warrantyItem).forEach(key => {
if (typeof warrantyItem[key] === 'function') {
warrantyItem[key] = ''
} else if (typeof warrantyItem[key] === 'object' && warrantyItem[key] !== null) {
warrantyItem[key] = JSON.stringify(warrantyItem[key])
}
})
this.warrantyCardList.push(warrantyItem)
}
// 膜类商品 并且服务商开通了使用膜卷号配置 不走签名流程
if (this.baseConfigData?.membraneTypeList?.includes(e?.upgradeGoodsType) && this.isUseFilmRoll && !this.signatureSwitch) {
let result = await api.getfilmRollNoByGoods({
upgradeGoodsId: e.upgradeGoodsId,
yqMerchantId: data?.sellerMerchantId,
merchantId: data?.merchantId
})
e.filmNumberData = result?.data || []
// 仅配置一个膜卷号 自动选中
if (!e.filmRollNo && e.filmNumberData?.length == 1) e.filmRollNo = e.filmNumberData[0]
} }
}
if (data.packageGoodsList) {
data.packageGoodsList.forEach(item => {
item.packageGoodsOrderList.forEach(g => {
g.price = g.totalPrice ? Number(g.totalPrice) / Number(g.number) : g.upgradePrice
})
item.goodsList = item.packageGoodsOrderList
item.price = item.goodsList.reduce((prev, cur) => {
return prev + Number(cur.totalPrice) / Number(cur.number)
}, 0)
item.count = item.goodsList.length ? item.goodsList[0].number : 1
let total = item.price * item.count
item.totalPrice = utils.decimal(total, 2)
item.packageGoodsOrderList.forEach(g => {
g.positionStr = positionTypeList.filter(v => v.positionValue == g.upgradeGoodsPosition)[0]?.positionName || ''
})
total_price += item.totalPrice
})
}
data = {
...data.customer,
...data.payOrder,
...data,
packageGoodsList: data.packageGoodsList,
couponName,
total_price: data.selectPayType == 0 ? 0 : Number(utils.decimal(total_price, 2)).toFixed(2)
}
if (data.customerCoupon) {
data.customerCoupon.customerCouponCode = data.customerCoupon.customerCouponCode.split('-')[0]
}
if (data.orderTime) data.time = dayjs(data.orderTime).format('YYYY-MM-DD HH:mm:ss')
if (data.customer && data.customer.carSeriesName) {
data.carType = `${data.customer.carBrand || ''}-${data.customer.carChildsBrandName || ''}-${data.customer.carSeriesName || ''}`
}
this.isShow = true
uni.hideLoading()
this.orderInfo = data
console.log(this.orderInfo, 'this.orderInfo')
console.log(this.orderInfo.selectPayType, this.orderInfo.constructionFlag)
this.isMake = this.orderInfo.constructionFlag !== 'Y' && this.orderInfo.selectPayType !== 1 && this.orderInfo.selectPayType !== 3 && this.orderInfo.selectPayType !== 4 && this.orderInfo.status !== 9
this.invoiceName = data.invoiceStatus == 2 ? '查看发票' : '申请开票'
// 去掉车主评价功能
// this.setQrBoxHeight()
// if (data.status == 6) return
// this.getQrCode(data)
this.getWorkWechatLiveQRCode()
// 条形码
this.warrantyCardList.length && this.getBarCode()
// 校验是否显示二级流量方
if (data.subShopMerchantName) {
if (_this.customerObj.findIndex(val => val?.key && val.key == 'subShopMerchantName') < 0) {
_this.customerObj[_this.customerObj.length - 2] = {
label: '二级流量方',
key: 'subShopMerchantName'
}
}
}
// 获取园区店技师配置信息
// uni.$api.boutiqueApi
// .getQYTechnicianList({
// yqMerchantId: uni.$storage.get('userInfo')?.merchantId
// })
// .then(respone => {
// if (respone?.code == 0) {
// if (respone?.data.length > 0) this.isArtificer(respone.data)
// }
// })
// } else {
// wx.showModal({
// title: '温馨提示',
// content: message,
// showCancel: false,
// confirmText: '刷新',
// confirmColor: '#347BFF',
// success(res) {
// if (res.confirm) {
// _this.getDetail(orderCode)
// }
// }
// })
// }
})
.catch(error => {
console.log(error)
uni.hideLoading()
})
},
getServiceBaseInfo(merchantId) {
uni.$api.boutiqueApi
.getServiceBaseInfo({
merchantId
})
.then(data => {
const warrantyCardVisible = data.cardCodeFlag && data.cardCodeFlag == 1
this.warrantyCardVisible = !warrantyCardVisible
})
},
getSignatureSwitch(merchantId) {
uni.$api.boutiqueApi
.getSignatureSwitch({
merchantId
})
.then(data => {
// const warrantyCardVisible = data.cardCodeFlag && data.cardCodeFlag == 1
const signatureSwitchValue = data?.signatureSwitch && data?.signatureSwitch == 1
this.signatureSwitch = signatureSwitchValue
})
}, },
getWorkWechatLiveQRCode() { {
this.customerService = '' label: '应付金额',
let { failCustomerService, defaultCustomerService } = this format: (val) => {
let { orderCode, customerPhone: phoneNumber, selectPayType } = this.orderInfo return val.totalPrice ? `${val.totalPrice}元` : '--'
// console.log(orderCode, phoneNumber, selectPayType)
// 订单状态 1-升级订单 2-战败订单
let orderType = selectPayType == 0 ? 2 : 1
uni.$api.boutiqueApi
.getWorkWechatLiveQRCode({
orderCode,
phoneNumber,
orderType
})
.then(data => {
if (data) {
this.customerService = data
} else {
this.customerService = defaultCustomerService
}
})
// }, 3000)
},
/** 获取服务商是否使用膜卷号 */
getServiceFilmRollSetting(yqMerchantId) {
console.log('getServiceFilmRollSetting')
const app = getApp()
return new Promise((resolve, reject) => {
uni.$api.boutiqueApi
.getServiceFilmRollSetting({
merchantId: yqMerchantId
})
.then(data => {
app.globalData.serviceFilmRollSetting = data
resolve(app.globalData.serviceFilmRollSetting)
})
.catch(error => {
console.log(error)
})
})
},
setConfigInfo(globalData) {
const app = getApp()
return new Promise((resolve, reject) => {
// 如果有 直接返回
// console.log(app.globalData.YQorderSetting, 'app.globalData.YQorderSetting')
// console.log('app.globalData.YQorderSetting', app.globalData.YQorderSetting)
let { configInfo } = globalData
const target = ['develop', 'develop', 'test', 'production', 'beta']
if (configInfo) {
return resolve(configInfo)
} else {
uni.request({
// url: `${domain}${path}?method=${method}`,
url: `https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=dj-car-boutique-work-wechat-miniapp&env=${target[index]}`,
// data,
method: 'GET',
// header,
dataType: 'json',
responseType: 'text',
success(response) {
app.globalData.configInfo = response.data
resolve(response.data)
},
fail(error) {
console.log(error, 'error')
},
complete() {
// wx.stopPullDownRefresh()
// wx.hideNavigationBarLoading()
} }
})
}
})
}, },
getBarCode() { {
// warrantyCardList label: '实付金额',
let that = this format: (val) => {
let { warrantyCardList } = this return val.totalPrice ? `${val.totalPrice}元` : '--'
console.log(warrantyCardList, 'warrantyCardList') }
warrantyCardList.forEach((element, index) => {
setTimeout(() => {
element.cardCode &&
uni.$api.boutiqueApi
.createBarCode({
content: element.cardCode
})
.then(data => {
// 待优化 应该都有之后再一次性更新
// warrantyCardList[index].barCodeUrl = 'http://qcimg01.glsx.com.cn:7060/group1/M00/02/96/wKgD3mNXkD-ALMu3AAABmn9Id4c794.png'
this.$set(this.warrantyCardList[index], 'barCodeUrl', data)
console.log(this.warrantyCardList, 'getBarCode')
})
.catch(err => {})
}, 1000 * index)
})
}, },
// 撤销该工单 {
async repeal() { label: '订单状态',
const that = this type: 'status'
uni.$api.boutiqueApi
.refundApplyRecordIsExist({
orderCode: this.transmissionOfData.orderCode
})
.then(data => {
console.log(data)
if (data === 'Y') {
that.$refs.IsExistTipsPopup.open()
} else {
that.$refs.tipsPopup
.open()
.then(() => {
uni.$api.boutiqueApi
.revokeOrder({
orderCode: that.transmissionOfData.orderCode
})
.then(data => {
uni.showToast({
title: '操作成功',
icon: 'success'
})
that.getDetail(that.transmissionOfData.orderCode)
})
})
.catch(() => {
console.log('用户点击了取消或关闭')
})
}
})
}, },
closeIsExistTipsPopup() { {
this.$refs.IsExistTipsPopup.closePopup() label: '客户姓名',
key: 'customerName',
format: (val) => {
return val.customer.customerName || '--'
}
}, },
customizeDate() { {
console.log(this.$refs.calendarPopup, 'this.$refs.calendarPopup') label: '车架号',
this.$refs.calendarPopup.open() key: 'standNo',
format: (val) => {
return val.customer.standNo || '--'
}
}, },
confirmCalendar() { {
this.rangeSelect(this.selectDate) label: '支付时间',
key: 'paySuccessDate',
format: (val) => {
return dayjs(val.paySuccessDate || new Date()).format('YYYY年MM月DD日 HH:mm:ss')
}
}, },
setCopyData(e) { {
utils.setCopyData(`${e}`) label: '增值车损',
type: 'project'
}, },
// 修改订单时间 ])
rangeSelect(date) {
let { orderInfo } = this
let params = {
orderCode: orderInfo.orderCode,
orderTime: date + ' 00:00:00'
} }
uni.$api.boutiqueApi
.updateOrderTime(params)
.then(result => {
if (result) {
uni.showToast({ title: '修改日期成功' })
this.orderInfo.time = params.orderTime
} else {
uni.showToast({ title: '修改日期失败' })
}
})
.catch(err => {
console.log(err)
})
this.$refs.calendarPopup.closePopup()
}, },
calendarChange(date) { async mounted () { },
this.selectDate = date.year + '-' + date.month + '-' + date.date methods: {
}, async getOrderDetail (payId) {
warrantyEdit(item) { const data = await uni.$api.equityApi.getOrderDetail({ orderCode: payId })
console.log(item) // this.orderInfo.total_price = data.totalPrice
// 不添加前出现Property or method "toJSON" is not defined this.orderInfo = data
//this.warrantyEditOb.warrantyPrice一直不回显 this.viewKey = Date.now()
//添加 popupKey 强制组件重新渲染
this.popupKey++
this.warrantyEditObj = item
this.$nextTick(() => {
this.$refs.warrantyPopup.open()
})
}, },
confirmEdit() {
uni.$api.boutiqueApi
.modifyWarrantyPrice({ ...this.warrantyEditObj })
.then(result => {
uni.showToast({ title: '更新成功', icon: 'success' })
this.$refs.warrantyPopup.closePopup()
this.getOrderDetail(this.orderInfo.orderCode)
})
.catch(err => {})
}
} }
} }
</script> </script>
...@@ -707,6 +163,20 @@ export default { ...@@ -707,6 +163,20 @@ export default {
.order-detail { .order-detail {
position: relative; position: relative;
height: 100%; height: 100%;
.order-tips {
padding: 24rpx 32rpx;
font-size: 26rpx;
border-radius: 0 0 toRpx(16) toRpx(16);
background: #fff;
&-title {
color: #999999;
line-height: 36rpx;
}
&-item {
margin-top: 12rpx;
color: #666666;
}
}
// Popup样式 // Popup样式
::v-deep .tipsPopup .uni-popup__wrapper { ::v-deep .tipsPopup .uni-popup__wrapper {
width: toRpx(848); width: toRpx(848);
...@@ -949,7 +419,7 @@ export default { ...@@ -949,7 +419,7 @@ export default {
.top-tips { .top-tips {
width: 100%; width: 100%;
height: toRpx(152); height: toRpx(152);
border-radius: toRpx(16); border-radius: toRpx(16) toRpx(16) 0 0;
background: linear-gradient(136.3deg, #fdffff 0%, #ebfff6 46%, #f4fffc 100%); background: linear-gradient(136.3deg, #fdffff 0%, #ebfff6 46%, #f4fffc 100%);
color: #333333; color: #333333;
padding: 0 toRpx(32); padding: 0 toRpx(32);
...@@ -1087,6 +557,13 @@ export default { ...@@ -1087,6 +557,13 @@ export default {
color: #222222; color: #222222;
font-size: toRpx(26); font-size: toRpx(26);
font-weight: 400; font-weight: 400;
.goodsItem {
color: #999999;
font-size: 26rpx;
}
.status {
color: #2cca74;
}
} }
.image-box { .image-box {
.value { .value {
......
<template> <template>
<view class="order-management"> <view class="order-management">
<view class="search-box"> <view class="search-box">
<input class="search-input" placeholder-class="placeholder" v-model="customerName" confirm-type="search" @confirm="search" placeholder="输入客户姓名/商品名称/订单编号/手机号搜索" /> <input class="search-input" placeholder-class="placeholder" v-model="customerName" confirm-type="search" @confirm="search" placeholder="输入客户姓名搜索" />
<view class="clear flex" @click="clear"> <view class="clear flex" @click="clear">
<uni-icons type="closeempty" size="16" v-if="customerName"></uni-icons> <uni-icons type="closeempty" size="16" v-if="customerName"></uni-icons>
</view> </view>
...@@ -20,123 +20,10 @@ ...@@ -20,123 +20,10 @@
<view class="sprite-icon icon-filter"></view> <view class="sprite-icon icon-filter"></view>
</view> </view>
</view> </view>
<view class="px-48">
<view class="tips" v-if="waitInputCount">
<view class="sprite-icon icon-study-tips"></view>
{{ tipsProps.tipsText }}
<view @click.stop="waitinputorderClick" class="waitinputorder-btn">补录订单</view>
</view>
</view>
<z-paging ref="paging" :fixed="false" paging-class="paging-class px-48" :loading-full-fixed="false" :auto-show-system-loading="true" :show-scrollbar="false" v-model="dataList" @query="queryList" :default-page-size="10"> <z-paging ref="paging" :fixed="false" paging-class="paging-class px-48" :loading-full-fixed="false" :auto-show-system-loading="true" :show-scrollbar="false" v-model="dataList" @query="queryList" :default-page-size="10">
<OrderCard v-for="(item, index) in dataList" :key="index" :orderCardDetail="item" @toggle-goods-list="handleToggleGoodsList" @jump="jump" @refresh="search()"></OrderCard> <OrderCard v-for="(item, index) in dataList" :key="index" :orderCardDetail="item" @toggle-goods-list="handleToggleGoodsList" @jump="jump" @refresh="search()"></OrderCard>
</z-paging> </z-paging>
<PublishPopup ref="WaitinputorderPopup" popupClass="waitinputorderPopup" :showClose="true" title="选择交易参考号">
<template #content>
<view class="popup-content px-48">
<view class="waitinputorder-tab-container">
<view class="waitinputorder-tab-buttons">
<view v-for="(item, index) in waitinputorderTabList" :key="index" class="waitinputorder-tab-button" :class="{ active: activeIndex === index }" @click="tabChange(index)">
<text>{{ item.name }}</text>
<view v-if="item.showQuestion" class="question-icon" @click.self="showQuestionPopup()">
<uni-icons type="help" size="16" color="#999"></uni-icons>
</view>
</view>
</view>
</view>
<scroll-view class="order_no_box" scroll-y enable-back-to-top refresher-enabled="true" :refresher-triggered="triggered" @refresherrefresh="onRefresh" v-show="activeIndex === 0" @scrolltolower="pageonReachBottom">
<view v-if="normalOrderNoList.length > 0" class="order-gap">
<view v-for="(item, index) in normalOrderNoList" :key="index" class="order_no_item" :class="{ checkActive: checkListObj[item.tradeNo] }" @click="activeClick(item)">
<view class="message">
<view v-for="(subItem, idx) in itemFormObj" :key="idx" class="item flex align-center">
<view class="label">{{ subItem.label }}</view>
<view v-if="subItem.type === 'price'" class="value price_value">¥{{ priceFilter(item[subItem.prop]) }}</view>
<view v-else-if="subItem.type === 'select'" class="select_value" @click="selectTap(index)" :data-index="index">
<text class="text-hide">{{ filmOrderData[item.filmOrder] }}</text>
<image src="/components/images/arrow-x.png" mode="" />
</view>
<view v-else class="value flex align-center">
{{ subItem.type === 'time' ? formatDate(item[subItem.prop]) : item[subItem.prop] }}
<view v-if="subItem.type === 'copy'" class="copy-btn" @click.stop="copyText(item[subItem.prop])">
<view class="sprite-icon icon-icon-copy copy"></view>
复制
</view>
</view>
</view>
</view>
<view class="sprite-icon icon-tag-checked checked" v-if="checkListObj[item.tradeNo]"></view>
</view>
</view>
<view class="nothing flex" v-else>
<image class="icon" src="../../../../assets/images/home/nothing.webp" />
暂无数据
</view>
</scroll-view>
<scroll-view class="order_no_box" scroll-y enable-back-to-top refresher-enabled="true" :refresher-triggered="triggered1" @refresherrefresh="onRefresh1" v-show="activeIndex === 1" @scrolltolower="pageonReachBottom">
<view v-if="abnormalOrderNoList.length > 0" class="order-gap">
<view v-for="(item, index) in abnormalOrderNoList" :key="index" class="order_no_item" :class="{ checkActive: checkListObj[item.tradeNo] }" @click="activeClick(item)">
<view class="message">
<view v-for="(subItem, idx) in itemFormObj" :key="idx" class="item flex align-center">
<view class="label">{{ subItem.label }}</view>
<view v-if="subItem.type === 'price'" class="value price_value">¥{{ priceFilter(item[subItem.prop]) }}</view>
<view v-else-if="subItem.type === 'select'" class="select_value" @click="selectTap(index)" :data-index="index">
<text class="text-hide">{{ filmOrderData[item.filmOrder] }}</text>
<image src="/components/images/arrow-x.png" mode="" />
</view>
<view v-else class="value flex align-center">
{{ subItem.type === 'time' ? formatDate(item[subItem.prop]) : item[subItem.prop] }}
<view v-if="subItem.type === 'copy'" class="copy-btn" @click.stop="copyText(item[subItem.prop])">
<view class="sprite-icon icon-icon-copy copy"></view>
复制
</view>
</view>
</view>
</view>
<view class="sprite-icon icon-tag-checked checked" v-if="checkListObj[item.tradeNo]"></view>
</view>
</view>
<view class="nothing flex" v-else>
<image class="icon" src="../../../../assets/images/home/nothing.webp" />
暂无数据
</view>
</scroll-view>
</view>
</template>
<template #footer>
<view class="footer-box flex justify-center">
<view class="cancle-btn btn" @click="cancelSelection">取消</view>
<view class="sure-btn btn" @click="confirmSelection">确认</view>
</view>
</template>
</PublishPopup>
<PublishPopup ref="abnormalTipsPopup" popupClass="abnormalTipsPopup" :showClose="true" title="超分账期" @confirm="confirmTips">
<template #content>
<scroll-view scroll-y class="ul px-48">
<view class="title">字段定义</view>
<view class="li">○ 正常分账期:指客户付款后,未超过分账期 (一般指支付时间≤20日),驻店未在系统补录或特殊情况下需运营在后台关联订单的交易流水号。</view>
<view class="li last">○ 超分账期:指客户付款后,超过分账期 (一般指支付时间>20日),驻店未在系统补录或特殊情况下需运营在后台关联订单的交易流水号。</view>
<view class="title">操作指导</view>
<view class="li">① 补录订单:支持正常分账期或超分账期单笔或多笔流水补录1个订单</view>
<view class="li">情况一:单笔支付直接补录创建工单</view>
<view class="li last">情况二:客户多笔支付,补录工单时勾选多笔交易流水</view>
<view class="li">② 特殊情况:需通知运营在后台关联工单</view>
<view class="li">情况一:客户支付定金时间与尾款时间间隔20天以上</view>
<view class="li">情况二:客户购买车辆2台及以上的费用,一笔支付</view>
<view class="li last">情况三:支付费用时误操作(多付了)需部分退款</view>
<view class="li last">操作流程:驻店在小程序点击新建工单,收款方选择嘀加收款,收款方式选择其它收款,复制交易流水号(填写时流水号末尾加逗号,多笔交易流水号中间用逗号隔开),工单录完后通知线上运营在后台关联。</view>
</scroll-view>
</template>
</PublishPopup>
<OrderScreenContract ref="openFilter" @onConfirm="openFilterConfirm" /> <OrderScreenContract ref="openFilter" @onConfirm="openFilterConfirm" />
</view> </view>
</template> </template>
...@@ -199,7 +86,7 @@ export default { ...@@ -199,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: [
...@@ -212,7 +99,6 @@ export default { ...@@ -212,7 +99,6 @@ export default {
dataList: [], dataList: [],
triggered: false, triggered: false,
triggered1: false, triggered1: false,
waitInputCount: 0, // 添加待补录计数
waitOrderTimer: null, // 定时器引用 waitOrderTimer: null, // 定时器引用
tipsProps: { tipsProps: {
tipsText: '该门店产生异常订单,请点击补录!', tipsText: '该门店产生异常订单,请点击补录!',
...@@ -234,10 +120,6 @@ export default { ...@@ -234,10 +120,6 @@ export default {
uni.$track.add({ eventCode: 'app_order_management' }) uni.$track.add({ eventCode: 'app_order_management' })
this.localUserInfo = uni.$storage.get('userInfo') || {} this.localUserInfo = uni.$storage.get('userInfo') || {}
this.search() this.search()
this.startWaitOrderPolling()
},
beforeDestroy() {
this.clearWaitOrderPolling()
}, },
methods: { methods: {
clear() { clear() {
...@@ -253,13 +135,6 @@ export default { ...@@ -253,13 +135,6 @@ export default {
this.$refs.paging.reload() this.$refs.paging.reload()
this.getStatByStatus() this.getStatByStatus()
}, },
async waitinputorderClick() {
if (await this.inspectionOfProhibitionBill()) return
if (!this.normalOrderNoList.length && !this.abnormalOrderNoList.length) {
this.getTransactionSerialNumber()
}
this.$refs.WaitinputorderPopup.open()
},
handleToggleGoodsList(data) { handleToggleGoodsList(data) {
this.$set(data.item, 'showAllGoodsListFlag', data.flag) this.$set(data.item, 'showAllGoodsListFlag', data.flag)
}, },
...@@ -312,7 +187,7 @@ export default { ...@@ -312,7 +187,7 @@ export default {
params.transferIds = [localUserInfo.uuid] params.transferIds = [localUserInfo.uuid]
} }
if (params?.zyPayStatus == '1') params.orderStatus = 7 if (params?.zyPayStatus == '1') params.orderStatus = 7
uni.$api.equitApi uni.$api.equityApi
.orderStatistics(params) .orderStatistics(params)
.then(result => { .then(result => {
const labelList = ['total', 'waitQuotation', 'waitPay', 'paySuccess', 'completed', 'defeat'] const labelList = ['total', 'waitQuotation', 'waitPay', 'paySuccess', 'completed', 'defeat']
...@@ -385,7 +260,7 @@ export default { ...@@ -385,7 +260,7 @@ export default {
// } else { // } else {
// params.merchantId = storeInfo?.merchantId // params.merchantId = storeInfo?.merchantId
// } // }
uni.$api.equitApi uni.$api.equityApi
.quotationPage(params) .quotationPage(params)
.then(result => { .then(result => {
console.log(result) console.log(result)
...@@ -396,32 +271,6 @@ export default { ...@@ -396,32 +271,6 @@ export default {
console.log(err) console.log(err)
}) })
}, },
// 10s轮询一次待补录
getWaitOrder() {
uni.$api.boutiqueApi
.waitinputorder()
.then(result => {
let { waitInputCount } = result
this.waitInputCount = waitInputCount
})
.catch(err => {})
},
// 启动轮询
startWaitOrderPolling() {
// 立即执行一次
this.getWaitOrder()
// 设置定时器,每10秒执行一次
this.waitOrderTimer = setInterval(() => {
this.getWaitOrder()
}, 10000)
},
// 清除轮询定时器
clearWaitOrderPolling() {
if (this.waitOrderTimer) {
clearInterval(this.waitOrderTimer)
this.waitOrderTimer = null
}
},
// 价格过滤器 // 价格过滤器
priceFilter(num) { priceFilter(num) {
var pow = Math.pow(10, 2) var pow = Math.pow(10, 2)
...@@ -441,12 +290,6 @@ export default { ...@@ -441,12 +290,6 @@ export default {
copyOutTradeNo(item) { copyOutTradeNo(item) {
this.$emit('copy-out-trade-no', item) this.$emit('copy-out-trade-no', item)
}, },
showQuestionPopup() {
this.$refs.abnormalTipsPopup.open()
},
confirmTips() {
this.$refs.abnormalTipsPopup.closePopup()
},
activeClick(item) { activeClick(item) {
if (this.checkListObj[item.tradeNo]) { if (this.checkListObj[item.tradeNo]) {
this.$delete(this.checkListObj, item.tradeNo) this.$delete(this.checkListObj, item.tradeNo)
...@@ -454,21 +297,6 @@ export default { ...@@ -454,21 +297,6 @@ export default {
this.$set(this.checkListObj, item.tradeNo, item) this.$set(this.checkListObj, item.tradeNo, item)
} }
}, },
confirmSelection() {
const selectedItems = Object.values(this.checkListObj)
if (selectedItems.length === 0) {
uni.showToast({
title: '请选择交易参考号',
icon: 'none'
})
return
}
this.$refs.WaitinputorderPopup.closePopup()
this.$emit('jump', 'CreateOrder', {
selectedItems: selectedItems,
type: 'supplementOrder'
})
},
cancelSelection() { cancelSelection() {
this.checkListObj = {} this.checkListObj = {}
this.$refs.WaitinputorderPopup.closePopup() this.$refs.WaitinputorderPopup.closePopup()
......
<template>
<PublishPopup
ref="payPopup"
popupClass="payPopup"
type="center"
:isShowFooter="false"
>
<template #header>
<view class="popup-top">
<view class="popup-top-box flex align-center">
<text class="popup-top-box-title">工单确认码</text>
<view @click.stop="closePopup">
<uni-icons
@click.stop="closePopup"
class="icon-close"
type="closeempty"
></uni-icons>
</view>
</view>
</view>
</template>
<template #content>
<view class="pos-popup">
<template v-if="orderInfo.payId">
<view class="price">¥{{ orderInfo.total_price }}</view>
<image
class="qrcode"
:src="orderInfo.payType == 1 ? wxqrcode : posQrCode"
></image>
<view class="level-1-tips">{{ orderInfo.payType == 1 ? '请让客户打开微信扫描上方付款码进行支付' : '请使用POS机扫描此码,再向客户收款' }}</view>
<view class="level-2-tips">超过24小时未支付将关闭此订单</view>
</template>
</view>
</template>
</PublishPopup>
</template>
<script type='text/ecmascript-6'>
import PublishPopup from '@/components/PublishPopup.vue'
import qrcode from '@/utils/qrcode'
export default {
components: {
PublishPopup
},
name: '',
data () {
return {
orderInfo: {},
wxqrcode: '',
posQrCode: '',
zyVoucherStatus: 0,
time: null,
show: true
}
},
computed: {
},
mounted () {
},
methods: {
open (id) {
uni.showLoading({
mask: true
})
this.show = true
this.orderInfo = {}
this.wxqrcode = ''
this.posQrCode = ''
this.getQuotationInfoById(id)
},
async getQuotationInfoById (id) {
const data = await uni.$api.equityApi.getQuotationInfoById({ id })
this.orderInfo = data
this.zyVoucherStatus = data.zyVoucherStatus
if (data.payType == 1) this.createWxQrcode()
if (data.payType == 3) this.createQrCodeImg()
this.getOrderDetail()
this.$refs.payPopup.open()
},
async getOrderDetail () {
uni.hideLoading()
if (!this.show) return
const { payId, id } = this.orderInfo,
data = await uni.$api.equityApi.getOrderDetail({ orderCode: payId })
this.orderInfo.total_price = data.totalPrice
let { payOrder, status } = data
if (payOrder?.payStatus == 2 || status == 4) {
uni.showToas({
title: '支付成功',
icon: 'none',
mask: true
})
setTimeout(() => {
this.$emit('jumpSuccess', { payId })
}, 1.5e3)
}
setTimeout(() => this.getOrderDetail(), 5e3)
},
clearTimer () {
if (this.time) clearInterval(this.time)
this.time = null
},
// 生成小程序码
createWxQrcode () {
let { zyVoucherStatus, orderInfo } = this,
{ sessionId } = uni.$storage.get()
let oParams = {}
oParams.appId = orderInfo.paymentChannel.wechatAppId
oParams.qrcodeType = 'QR_WXA_UNLIMIT'
oParams.path = 'packagesPayment/pages/payment/index'
oParams.scene = `orderCode=${orderInfo.payId}&workWxSessionId=${sessionId}&zyVoucherStatus=${zyVoucherStatus}`
oParams.channelType = 1
// B端小程序调用接口生成领券码时,传参userId用uuid,类型由int变string
uni.$api.boutiqueApi.createQrcodeImage(oParams).then(data => {
this.wxqrcode = data
})
},
async createQrCodeImg () {
const { payId } = this.orderInfo,
data = await uni.$api.equityApi.getPosQr({
orderCode: payId,
payType: 3,
payeeType: 0
})
let size = 0
try {
const info = uni.getSystemInfoSync()
let scale = info.windowWidth / 750 //不同屏幕下QRcode的适配比例;设计稿是750宽
let width = 300 * scale
size = width
} catch (e) {
size = 150
}
this.posQrCode = qrcode.createQrCodeImg(data.outTradeNo, {
size: parseInt(size)
})
},
closePopup () {
this.show = false
this.$refs.payPopup.closePopup()
}
}
}
</script>
<style scoped lang='scss'>
::v-deep .payPopup .uni-popup__wrapper {
width: 60%;
border-radius: toRpx(48);
background: #ffffff !important;
.popup-top {
border-radius: toRpx(48) toRpx(48) 0 0;
background: url('@/assets/images/boutique/payTipsBc.png') no-repeat;
background-size: 100% 100%;
margin-bottom: toRpx(16);
.popup-top-box {
color: #333333;
font-size: toRpx(36);
font-weight: 500;
text-align: center;
padding: toRpx(32);
.popup-top-box-title {
flex: 1;
}
.icon-close {
text-align: end;
}
}
}
.pos-popup {
text-align: center;
box-shadow: 0 toRpx(12) toRpx(24) 0 #2c66f726;
width: 90%;
border-radius: toRpx(48);
background: #ffffff;
margin: 0 auto toRpx(63) auto;
padding: toRpx(63) 0;
.qrcode {
width: toRpx(320);
height: toRpx(320);
margin-bottom: toRpx(32);
}
.price {
color: #4673ff;
font-size: toRpx(56);
font-weight: 700;
margin-bottom: toRpx(32);
}
.level-1-tips {
color: #1a1a1a;
font-size: toRpx(40);
font-weight: 500;
margin-bottom: toRpx(16);
}
.level-2-tips {
color: #808291;
font-size: toRpx(32);
font-weight: 400;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -6,11 +6,56 @@ ...@@ -6,11 +6,56 @@
v-for="(item, index) in list" v-for="(item, index) in list"
:key="index" :key="index"
> >
<template v-if="item.goodsFlag == 3">
<view class="package-box">
<view class="shop-name flex">
<view <view
class="sprite-icon icon-blue-delete" class="sprite-icon icon-blue-delete"
@click="deleteGoods(index)" @click="deleteGoods(index)"
></view> ></view>
<view class="right"> <view class="name">{{ goodsName(item) }}</view>
<view class="total-price">{{packageTotal(item)}}</view>
</view>
<view class="line"></view>
<view class="package-goods-list">
<template v-for="(i,ind) in item.packageGoods.goodsList">
<view
class="package-item flex"
:key="`package_${index}_${ind}`"
>
<view class="package-icon"></view>
<view class="package-label">{{packageName(i,item)}}</view>
<view class="package-value flex">
<template v-if="i.goodsPriceModify">
<view class="package-price">¥{{i.sellPrice}}</view>
</template>
<template v-else>
<view class="front-gear-input flex">
<view class="unit">¥</view>
<input
class="uni-input"
type="digit"
maxlength="9"
placeholder="请输入价格"
placeholder-style="font-size: 14px"
v-model="i.sellPrice"
@blur="validatePrice($event, item, index, ind)"
/>
</view>
</template>
<view class="number">x1</view>
</view>
</view>
</template>
</view>
</view>
</template>
<template v-else>
<view
class="sprite-icon icon-blue-delete"
@click="deleteGoods(index)"
></view>
<view :class="['right',{'one-line':item.goodsFlag == 1}]">
<view class="shop-name">{{ goodsName(item) }}</view> <view class="shop-name">{{ goodsName(item) }}</view>
<view <view
class="alias" class="alias"
...@@ -24,84 +69,59 @@ ...@@ -24,84 +69,59 @@
{{item.multipleSpecificationsGoods.goods.specificationStr}} {{item.multipleSpecificationsGoods.goods.specificationStr}}
</view> </view>
</template> </template>
<template v-if="item.goods"> <template v-if="item.goodsFlag == 1">
<template v-if="(item.goods.merchantGoodsPosition || item.goods.upgradeGoodsPosition) && (item.goods.goodsInfo.goodsType == 1 || item.goods.upgradeGoodsType == 1 || item.goods.goodsInfo.goodsType == baseConfigData.selfBuildFilmType || item.goods.upgradeGoodsType == baseConfigData.selfBuildFilmType)"> <template v-if="item.goods.goodsPriceModify">
<view class="front-gear-label"> ¥{{item.goods.sellPrice}}
{{ formatPosition((item.goods.merchantGoodsPosition || item.goods.upgradeGoodsPosition),
positionTypeList)}}
</view>
</template>
<template v-if="(item.goods.goodsInfo.goodsType == 1 || item.goods.upgradeGoodsType == 1) && !item.goods.merchantGoodsPosition && !item.goods.upgradeGoodsPosition">无部位属性</template>
</template> </template>
<template v-else>
<view class="front-gear-input"> <view class="front-gear-input">
<view class="unit">¥</view> <view class="unit">¥</view>
<template v-if="item.multipleSpecificationsGoods">
<input <input
class="uni-input" class="uni-input"
type="digit" type="digit"
maxlength="9" maxlength="9"
placeholder="请输入价格" placeholder="请输入价格"
placeholder-style="font-size: 14px" placeholder-style="font-size: 14px"
v-model="item.multipleSpecificationsGoods.goods.sellPrice" v-model="item.goods.sellPrice"
@blur="validatePrice($event, item, index)" @blur="validatePrice($event, item, index)"
/> />
</view>
</template>
</template> </template>
<template v-else> <template v-else>
<template v-if="item.multipleSpecificationsGoods.goods.goodsPriceModify">
¥{{item.multipleSpecificationsGoods.goods.sellPrice}}
</template>
<template v-else>
<view class="front-gear-input">
<view class="unit">¥</view>
<input <input
class="uni-input" class="uni-input"
type="digit" type="digit"
maxlength="9" maxlength="9"
placeholder="请输入价格" placeholder="请输入价格"
placeholder-style="font-size: 14px" placeholder-style="font-size: 14px"
v-model="item.goods.sellPrice" v-model="item.multipleSpecificationsGoods.goods.sellPrice"
@blur="validatePrice($event, item, index)" @blur="validatePrice($event, item, index)"
/> />
</template>
<!-- <input class="uni-input" type="digit" maxlength="9" placeholder="请输入价格"
placeholder-style="font-size: 14px"
:value="item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods ? item.multipleSpecificationsGoods.goods.sellPrice : item.goods.sellPrice"
@blur="validatePrice($event, item, index)" /> -->
</view> </view>
</view>
<view class="control">
<view
class="minus"
@click="decreaseNumber(item)"
>-</view>
<template v-if="item.multipleSpecificationsGoods">
<input
class="uni-input control-input"
type="number"
maxlength="3"
v-model="item.multipleSpecificationsGoods.number"
@blur="validateNumber($event, item)"
/>
</template> </template>
<template v-else>
<input
class="uni-input control-input"
type="number"
maxlength="3"
v-model="item.goods.number"
@blur="validateNumber($event, item)"
/>
</template> </template>
<!-- <input class="uni-input control-input" type="number" maxlength="3" <view class="number">
:value="item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods ? item.multipleSpecificationsGoods.goods.number : item.goods.number" x1
@blur="validateNumber($event, item)" /> -->
<view
class="add"
@click="increaseNumber(item)"
>+</view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</template>
</view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import NP from 'number-precision'
export default { export default {
name: 'SkuGoods', name: 'SkuGoods',
props: { props: {
...@@ -130,11 +150,14 @@ export default { ...@@ -130,11 +150,14 @@ export default {
// 当组件数据更新时也检查number属性 // 当组件数据更新时也检查number属性
this.initProductNumbers() this.initProductNumbers()
}, },
computed: {
},
methods: { methods: {
goodsName (item) { goodsName (item) {
let { goodsFlag } = item, let { goodsFlag } = item,
str = '' str = ''
if (goodsFlag == 3) str = '' if (goodsFlag == 3) str = item.packageGoods.packageAlias || item.packageGoods.packageName
else str = item.multipleSpecificationsGoods ? else str = item.multipleSpecificationsGoods ?
item.multipleSpecificationsGoods.baseGoodsName : item.goods.goodsAlias || item.goods.upgradeGoodsName || item.multipleSpecificationsGoods.baseGoodsName : item.goods.goodsAlias || item.goods.upgradeGoodsName ||
item.goods.goodsInfo.goodsName item.goods.goodsInfo.goodsName
...@@ -146,7 +169,7 @@ export default { ...@@ -146,7 +169,7 @@ export default {
this.list.forEach(item => { this.list.forEach(item => {
if (!item.multipleSpecificationsGoods) { if (!item.multipleSpecificationsGoods) {
// 如果没有多规格商品,直接设置goods的number // 如果没有多规格商品,直接设置goods的number
if (!item.goods.number) { if (item.goodsFlag == 1 && !item.goods.number) {
this.$set(item.goods, 'number', '1') this.$set(item.goods, 'number', '1')
} }
} else if (item.multipleSpecificationsGoods) { } else if (item.multipleSpecificationsGoods) {
...@@ -154,8 +177,6 @@ export default { ...@@ -154,8 +177,6 @@ export default {
if (!item.multipleSpecificationsGoods.number) { if (!item.multipleSpecificationsGoods.number) {
this.$set(item.multipleSpecificationsGoods, 'number', '1') this.$set(item.multipleSpecificationsGoods, 'number', '1')
} }
} else {
} }
}) })
} }
...@@ -169,7 +190,7 @@ export default { ...@@ -169,7 +190,7 @@ export default {
return (filterData.length && filterData[0] && filterData[0].positionName) || '' return (filterData.length && filterData[0] && filterData[0].positionName) || ''
}, },
// 验证价格输入 // 验证价格输入
validatePrice (event, item, index) { validatePrice (event, item, index, cindex) {
let value = event.detail.value let value = event.detail.value
console.log('value', value) console.log('value', value)
// 如果为空则设置为0 // 如果为空则设置为0
...@@ -199,33 +220,35 @@ export default { ...@@ -199,33 +220,35 @@ export default {
value = '0' value = '0'
} }
// 检查最小价格 // 检查最小价格
// if (!item.multipleSpecificationsGoods) {
// // 普通商品的最小价格检查
// if (item.goods.validMinSellPrice === 'Y' && item.goods.minSellPrice && parseFloat(value) < parseFloat(item.goods.minSellPrice)) {
// console.log('最小值', item.goods.minSellPrice)
// uni.showToast({
// title: '单价不可低于商品最低价',
// icon: 'none'
// })
// value = item.goods.minSellPrice.toString()
// }
// } else if (item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods) {
// // 多规格商品的最小价格检查
// if (item.multipleSpecificationsGoods.goods.validMinSellPrice === 'Y' && item.multipleSpecificationsGoods.goods.minSellPrice && parseFloat(value) < parseFloat(item.multipleSpecificationsGoods.goods.minSellPrice)) {
// console.log('最小值', item.multipleSpecificationsGoods.goods.minSellPrice)
// uni.showToast({
// title: '单价不可低于商品最低价',
// icon: 'none'
// })
// value = item.multipleSpecificationsGoods.goods.minSellPrice.toString()
// }
// }
if (!item.multipleSpecificationsGoods) { if (!item.multipleSpecificationsGoods) {
// 普通商品的最小价格检查 if (item.goodsFlag == 1) {
if (item.goods.validMinSellPrice === 'Y' && item.goods.minSellPrice && parseFloat(value) < parseFloat(item.goods.minSellPrice)) { //如果没有多规格商品,更新普通商品的价格
console.log('最小值', item.goods.minSellPrice)
uni.showToast({
title: '单价不可低于商品最低价',
icon: 'none'
})
value = item.goods.minSellPrice.toString()
}
} else if (item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods) {
// 多规格商品的最小价格检查
if (item.multipleSpecificationsGoods.goods.validMinSellPrice === 'Y' &&
item.multipleSpecificationsGoods.goods.minSellPrice &&
parseFloat(value) < parseFloat(item.multipleSpecificationsGoods.goods.minSellPrice)) {
console.log('最小值', item.multipleSpecificationsGoods.goods.minSellPrice)
uni.showToast({
title: '单价不可低于商品最低价',
icon: 'none'
})
value = item.multipleSpecificationsGoods.goods.minSellPrice.toString()
}
}
// 更新值
if (!item.multipleSpecificationsGoods) {
// 如果没有多规格商品,更新普通商品的价格
this.$set(this.list[index].goods, 'sellPrice', value) this.$set(this.list[index].goods, 'sellPrice', value)
} else {
console.log(123)
this.$set(this.list[index].packageGoods.goodsList[cindex], 'sellPrice', value)
}
} else if (item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods) { } else if (item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods) {
// 如果有多规格商品,更新多规格商品的价格 // 如果有多规格商品,更新多规格商品的价格
this.$set(this.list[index].multipleSpecificationsGoods.goods, 'sellPrice', value) this.$set(this.list[index].multipleSpecificationsGoods.goods, 'sellPrice', value)
...@@ -308,30 +331,57 @@ export default { ...@@ -308,30 +331,57 @@ export default {
deleteGoods (index) { deleteGoods (index) {
this.list.splice(index, 1) this.list.splice(index, 1)
this.$emit('changeTotalPrice') this.$emit('changeTotalPrice')
} },
replaceItemText (value) {
let reg = getRegExp(';~;', 'g')
return value ? value.replace(reg, '/') : ''
},
packageName (item, parent) {
return item.goodsAlias
|| item.goodsNameAlias
|| this.replaceItemText(item.upgradeGoodsName, (parent.specificationData ? '/' + item.specificationData : ''))
|| this.replaceItemText(item.goodsName, (parent.specificationData ? '/' + item.specificationData : ''))
},
packageTotal (item) {
let total = 0
item.packageGoods.goodsList.map(i => {
total = NP.plus(total, i.sellPrice * i.number)
})
item.packageGoods.totalPrice = total
return total.toFixed(2)
},
} }
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.shop-list { .shop-list {
padding: toRpx(12) toRpx(32) toRpx(12) 0; padding-right: toRpx(32);
.shop-item { .shop-item {
display: flex; display: flex;
align-items: center; align-items: center;
background-color: #f5f7fa; background-color: #f5f7fa;
border-radius: toRpx(16); border-radius: toRpx(16);
margin-bottom: toRpx(16); margin-top: toRpx(16);
padding: toRpx(24); padding: toRpx(24);
.right { .right {
flex: 1; flex: 1;
font-size: toRpx(28); font-size: toRpx(28);
margin-left: toRpx(24); margin-left: toRpx(24);
}
.one-line {
display: flex;
align-items: center;
.front-gear-box {
margin-left: auto;
}
}
.shop-name { .shop-name {
color: #ff781f; color: #ff781f;
max-width: 70%;
word-break: break-all;
} }
.alias { .alias {
...@@ -339,26 +389,70 @@ export default { ...@@ -339,26 +389,70 @@ export default {
font-size: toRpx(24); font-size: toRpx(24);
color: #666; color: #666;
} }
.package-box {
width: 100%;
.shop-name {
width: 100%;
max-width: 100%;
.name {
max-width: 70%;
}
.total-price {
margin-left: auto;
color: #292d33;
font-size: 28rpx;
font-weight: 400;
}
}
.line {
width: calc(100% + 48rpx);
margin-left: -24rpx;
height: 2rpx;
background-color: #dce1e6;
margin-top: 24rpx;
}
.package-item {
margin-top: 16rpx;
}
.sprite-icon {
margin-right: 24rpx;
flex-shrink: 0;
}
.package-icon {
width: 12rpx;
height: 12rpx;
border-radius: 50%;
background: #4673ff;
margin-right: 16rpx;
}
.package-label {
color: #292d33;
font-size: 28rpx;
flex-shrink: 0;
max-width: 80%;
}
.package-value {
flex-shrink: 0;
margin-left: auto;
}
}
.number {
margin-left: 16rpx;
} }
} }
} }
.front-gear-input-box {
.front-gear-box {
display: flex;
justify-content: space-between;
margin-top: toRpx(24);
.front-gear-input-box {
display: flex; display: flex;
align-items: center; align-items: center;
width: 100%;
.front-gear-label { .front-gear-label {
font-size: toRpx(24); font-size: toRpx(24);
margin-right: toRpx(24); margin-right: toRpx(24);
color: #999999; color: #999999;
} }
}
.front-gear-input { .front-gear-input {
margin-left: auto;
position: relative; position: relative;
display: flex; display: flex;
border: toRpx(2) solid #eff0f2; border: toRpx(2) solid #eff0f2;
...@@ -381,9 +475,10 @@ export default { ...@@ -381,9 +475,10 @@ export default {
left: toRpx(32); left: toRpx(32);
transform: translateY(-50%); transform: translateY(-50%);
} }
} }
} .front-gear-box {
display: flex;
justify-content: space-between;
.control { .control {
display: flex; display: flex;
align-items: center; align-items: center;
......
<template>
<view class="order">
<view :class="['order-box', { hide: showUpload }]" :key="formKey">
<view class="common-title">修改客户信息</view>
<view class="box">
<scroll-view class="scroll-view" scroll-y="true">
<view class="box-content">
<GlCell :formList="formList" :formData="orderObj" @radioChange="radioChange" @inputBlur="inputBlur" @handleCell="handleCell" :titleList="titleList"></GlCell>
</view>
<view class="btns flex">
<view class="btn save" @click="back">放弃</view>
<view @click="submit" class="btn">提交修改</view>
</view>
</scroll-view>
</view>
</view>
<!-- 弹窗 -->
<order-popup ref="orderPopup" :data="orderObj" :dataKey="valueKey" @onConfirm="onConfirm" :externalData="externalData" :popupType="popupType" :popupTitle="popupTitle" />
<template v-if="showUpload">
<view class="upload-box">
<upload-proof-of-payment @back="showUpload = false" @confirm="uploadConfirm" />
</view>
</template>
<!-- 支付弹框 -->
<OrderPay ref="OrderPay" @jumpSuccess="jumpSuccess" />
<NoticePopup ref="notice" title="重要提示" text="当前页面暂未保存,是否确认退出" type="warning"></NoticePopup>
</view>
</template>
<script>
import utils from '@/utils/utils'
import OrderPopup from '@/components/OrderPopup/index.vue'
import GlCell from '../../../../components/Form/GlCell.vue'
import { UpdateOrderInfo, popupTypeEnum, payTypeList, titleList } from '../contant'
import { interceptionMixin } from '@/mixin/index'
import UploadProofOfPayment from './UploadProofOfPayment.vue'
import NoticePopup from '@/components/NoticePopup.vue'
import dayjs from 'dayjs'
import OrderPay from './OrderPay.vue'
import NP from 'number-precision'
export default {
name: 'CreateOrder',
mixins: [interceptionMixin],
components: {
GlCell,
OrderPopup,
UploadProofOfPayment,
OrderPay,
NoticePopup
},
props: {
transmissionOfData: {
type: Object,
default: () => null
}
},
data() {
return {
showUpload: false,
titleList,
formList: utils.deepClone(UpdateOrderInfo),
baseConfigData: {},
requiredList: [], // 录单设置的必填项
orderObj: {
owner: '',
phone: '',
salesType: 0,
carVin: '',
certificateNo: '',
notes: ''
}
}
},
computed: {
showPayTips() {
return this.orderObj.payee == 0 && this.orderObj.payType == 7
},
userInfo() {
return uni.$storage.get('userInfo') || {}
}
},
watch: {
transmissionOfData: {
handler(newVal, oldVal) {
if (newVal) {
console.log(newVal, 'newVal')
} else {
console.log(oldVal, 'oldVal')
}
}
}
},
mounted() {
this.baseConfigData = uni.$storage.get('mock_data') || {}
this.initData()
},
methods: {
initData() {
console.log('initData', this.transmissionOfData)
const { paramsData } = this.transmissionOfData
this.getQuotationInfoById(paramsData.id)
// 埋点
// uni.$track.add({ eventCode: 'app_create_order' })
},
async getQuotationInfoById(id) {
const data = await uni.$api.equityApi.getQuotationInfoById({ id })
console.log(data, 'data')
// this.orderInfo = data
this.orderObj.id = id
this.orderObj.ownerId = data.owner.id
this.orderObj.carVin = data.owner.carVin
this.orderObj.owner = data.owner.owner
this.orderObj.phone = data.owner.phone
this.orderObj.salesType = data.owner.salesType
this.orderObj.certificateNo = data.owner.certificateNo
this.orderObj.notes = data.notes
},
// 输入框失去焦点事件
inputBlur(e, val) {
console.log(e, val)
this.orderObj[val.value] = this.orderObj[val.value]
},
// 校验必填等规则
checkRequired() {
try {
const phoneRex = /^[1]([3-9])[0-9]{9}$/,
requiredArr = [],
onlyLabelItem = [],
{ orderObj } = this
this.formList.forEach(group => {
group.forEach(item => {
if (item.required === true && item.hidden !== true) {
if (item.isArray) onlyLabelItem.push(item)
else requiredArr.push(item)
}
})
})
// 遍历requiredArr,检查orderObj中是否有对应的值
for (let i = 0; i < requiredArr.length; i++) {
const item = requiredArr[i]
// 兼容嵌套customer对象的情况
let value = orderObj[item.value]
if (value === undefined || value === null || value === '') throw `${item.label}不能为空`
// 如果是customerPhone,添加phoneRex校验
if (item.value === 'phone' && !phoneRex.test(value)) throw `请输入正确的${item.label}`
}
if (orderObj.carVin) {
const vinRex = /^(?=.*[A-Za-z])[A-Za-z0-9]{17}$/
if (!vinRex.test(orderObj.carVin)) throw '请输入正确的车架号'
}
if (orderObj.certificateNo && orderObj.certificateNo.length != 18) throw '请输入正确的18位证件号'
return true
} catch (error) {
if (error)
uni.showToast({
title: error,
icon: 'none'
})
return false
}
},
// 提交
async submit() {
if (!this.checkRequired() || (await this.checkDailyReport())) return
let params = {
id: this.orderObj.id,
notes: this.orderObj.notes || '',
owner: {
id: this.orderObj.ownerId,
owner: this.orderObj.owner,
phone: this.orderObj.phone,
carVin: this.orderObj.carVin || '',
certificateNo: this.orderObj.certificateNo || '',
salesType: this.orderObj.salesType || 0
}
}
console.log(params, 'params')
uni.showLoading({
title: '提交中...',
mask: true
})
uni.$api.equityApi
.updateCustomerInfo(params)
.then(result => {
uni.hideLoading()
console.log(result)
this.$emit('jump', 'OrderManagement', {})
})
.catch(err => {
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()
}
}
}
</script>
<style scoped lang="scss">
.order {
height: 100%;
position: relative;
&-box {
visibility: visible;
height: 100%;
}
.hide {
opacity: 0;
visibility: hidden;
}
.upload-box {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
}
.box {
height: calc(100% - #{toRpx(120)});
padding-bottom: toRpx(24);
.scroll-view {
height: 100%;
}
}
.box-content {
padding: 0 toRpx(48);
}
.total {
display: flex;
justify-content: space-between;
align-items: center;
padding: toRpx(24) toRpx(32) toRpx(24) 0;
font-size: toRpx(28);
border-bottom: toRpx(2) solid #f7f7f6;
&-left {
color: #333;
font-weight: 500;
}
&-right {
color: #f24724;
font-weight: 500;
}
}
.pay-tips {
padding: toRpx(24) toRpx(24) toRpx(24) 0;
font-size: toRpx(24);
color: #999;
}
.btns {
position: absolute;
width: 100%;
bottom: 0;
padding: 24rpx 128rpx;
gap: 32rpx;
.save {
background: #3b73ff1a;
color: #4673ff;
font-size: 28rpx;
font-weight: 500;
}
}
.btn {
display: flex;
align-items: center;
justify-content: center;
width: toRpx(1130);
height: toRpx(80);
color: #fff;
border-radius: toRpx(48);
background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
}
.customer-title {
.customer-file {
margin-left: 20rpx;
color: #347bff;
font-size: 24rpx;
.sprite-icon {
margin-right: 4rpx;
}
}
}
</style>
<template> <template>
<view class="upload-proof-of-payment"> <view class="upload-proof-of-payment">
<view class="common-title">上传付款凭证</view> <view class="common-title flex">
<view
class="back"
@click="$emit('back')"
>
<uni-icons
type="left"
size="20"
color="#000"
></uni-icons>
</view>
上传付款凭证
</view>
<view class="px-48"> <view class="px-48">
<view class="box-shell"> <view class="box-shell">
<view class="flex align-center justify-between box-flow"> <view class="flex align-center justify-between box-flow">
...@@ -8,26 +20,52 @@ ...@@ -8,26 +20,52 @@
交易流水号 交易流水号
<text class="required">*</text> <text class="required">*</text>
</view> </view>
<input v-model="outTradeNo" type="text" @input="outTradeNoInput" class="uni-input" maxlength="150" placeholder="请输入" /> <input
v-model="outTradeNo"
type="text"
@input="outTradeNoInput"
class="uni-input"
maxlength="150"
placeholder="请输入"
/>
</view> </view>
<view class="payment"> <view class="payment">
<view class="payment-label"> <view class="payment-label">
付款凭证 付款凭证
<text class="required">*</text> <text class="required">*</text>
</view> </view>
<view class="upload-box flex flex-wrap"> <view class="upload-box">
<view class="upload-item" @click.stop="selectImg"></view> <template v-if="payVoucherList.length < 9">
<view v-for="(item, index) in payVoucherList" :key="index" class="previewImageList"> <view
class="upload-item"
@click.stop="selectImg"
></view>
</template>
<view
v-for="(item, index) in payVoucherList"
:key="index"
class="previewImageList"
>
<image :src="item"></image> <image :src="item"></image>
<view class="close-box" @click="deleteImg(index)"> <view
<uni-icons class="icon-close" type="closeempty" color="#ffffff"></uni-icons> class="close-box"
@click="deleteImg(index)"
>
<uni-icons
class="icon-close"
type="closeempty"
color="#ffffff"
></uni-icons>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view class="uploadBtn" @click.stop="confirm">确定提交</view> <view
class="uploadBtn"
@click.stop="confirm"
>确定提交</view>
</view> </view>
</template> </template>
<script> <script>
...@@ -36,22 +74,25 @@ import { debounce } from 'lodash' ...@@ -36,22 +74,25 @@ import { debounce } from 'lodash'
export default { export default {
name: 'UploadProofOfPayment', name: 'UploadProofOfPayment',
props: { props: {
transmissionOfData: {
type: Object,
default: () => null
}
}, },
data() { data () {
return { return {
payVoucherList: [], payVoucherList: [],
outTradeNo: '' outTradeNo: ''
} }
}, },
mounted() { mounted () {
console.log(this.transmissionOfData, 'console.log(this.transmissionOfData)')
}, },
methods: { methods: {
selectImg() { async selectImg () {
// #ifdef APP-PLUS
const photoLibrary = await permision.requestAndroidPermission('android.permission.READ_EXTERNAL_STORAGE')
const camera = await permision.requestAndroidPermission('android.permission.CAMERA')
const isOnline = await uni.$isNetWork()
if (photoLibrary != 1) throw '您的设备不支持相册功能或未授权访问,请前往设置中开启相册权限'
if (camera != 1) throw '您的设备不支持摄像头功能或未授权访问,请前往设置中开启摄像头权限'
if (!isOnline) throw '当前无网络连接,请连接网络后重试'
// #endif
let _this = this let _this = this
uni.chooseImage({ uni.chooseImage({
count: 1, //默认9 count: 1, //默认9
...@@ -63,15 +104,14 @@ export default { ...@@ -63,15 +104,14 @@ export default {
} }
}) })
}, },
outTradeNoInput(e) { outTradeNoInput (e) {
const filteredValue = e.detail.value.replace(/[\u4E00-\u9FA5]/g, '') const filteredValue = e.detail.value.replace(/[\u4E00-\u9FA5]/g, '')
this.$nextTick(() => { this.$nextTick(() => {
this.$set(this, 'outTradeNo', filteredValue) this.$set(this, 'outTradeNo', filteredValue)
}) })
console.log(this.outTradeNo)
}, },
// 上传付款凭证 // 上传付款凭证
async upLoad(event) { async upLoad (event) {
console.log(event) console.log(event)
let _this = this let _this = this
const { tempFilePaths } = event const { tempFilePaths } = event
...@@ -79,39 +119,19 @@ export default { ...@@ -79,39 +119,19 @@ export default {
this.payVoucherList.push(url) this.payVoucherList.push(url)
}, },
confirm: debounce(function (e) { confirm: debounce(function (e) {
console.log(this.transmissionOfData)
let { outTradeNo, payVoucherList } = this let { outTradeNo, payVoucherList } = this
if (payVoucherList.length && outTradeNo) { if (payVoucherList.length && outTradeNo) {
this.createPayOrder() this.$emit('confirm', {
payVoucherList,
outTradeNo
})
} else { } else {
uni.showToast({ title: '交易流水号或付款凭证不能为空!', icon: 'none' }) uni.showToast({ title: '交易流水号或付款凭证不能为空!', icon: 'none' })
} }
}, 300), }, 300),
deleteImg(index) { deleteImg (index) {
this.payVoucherList.splice(index, 1) this.payVoucherList.splice(index, 1)
}, },
createPayOrder() {
const { orderCode, payType, payeeType, successDate } = this.transmissionOfData
let obj = {
orderCode,
payType: payType,
payeeType: payeeType,
successDate
}
if (this.payVoucherList?.length && this.outTradeNo) {
obj.payVoucherList = this.payVoucherList
obj.outTradeNo = this.outTradeNo
}
uni.showLoading({
title: '提交中...',
mask: true
})
uni.$api.boutiqueApi.createPayOrder(obj).then(data => {
uni.hideLoading()
uni.showToast({ title: '提交成功', icon: 'success' })
this.$emit('jump', 'OrderDetail', data)
})
}
} }
} }
</script> </script>
...@@ -119,6 +139,9 @@ export default { ...@@ -119,6 +139,9 @@ export default {
.px-48 { .px-48 {
padding: 0 toRpx(48); padding: 0 toRpx(48);
} }
.back {
height: 40rpx;
}
.upload-proof-of-payment { .upload-proof-of-payment {
width: 100%; width: 100%;
height: 100%; height: 100%;
...@@ -143,6 +166,7 @@ export default { ...@@ -143,6 +166,7 @@ export default {
} }
.uni-input { .uni-input {
text-align: right; text-align: right;
width: 80%;
.uni-input-placeholder { .uni-input-placeholder {
font-size: toRpx(28); font-size: toRpx(28);
font-weight: 400; font-weight: 400;
...@@ -162,6 +186,8 @@ export default { ...@@ -162,6 +186,8 @@ export default {
} }
} }
.upload-box { .upload-box {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: toRpx(20); gap: toRpx(20);
.upload-item { .upload-item {
width: toRpx(320) !important; width: toRpx(320) !important;
...@@ -172,17 +198,18 @@ export default { ...@@ -172,17 +198,18 @@ export default {
} }
.previewImageList { .previewImageList {
position: relative; position: relative;
image {
width: toRpx(320) !important;
height: toRpx(240) !important; height: toRpx(240) !important;
image {
width: 100% !important;
height: 100% !important;
border-radius: toRpx(12); border-radius: toRpx(12);
} }
.close-box { .close-box {
width: toRpx(36); width: toRpx(36);
height: toRpx(36); height: toRpx(36);
position: absolute; position: absolute;
top: - toRpx(12); top: toMinusRpx(12);
right: - toRpx(12); right: toMinusRpx(12);
background: rgba(0, 0, 0, 0.6); background: rgba(0, 0, 0, 0.6);
border-radius: 50%; border-radius: 50%;
text-align: center; text-align: center;
......
...@@ -2,26 +2,24 @@ const FORM_LIST = [ ...@@ -2,26 +2,24 @@ const FORM_LIST = [
[ [
{ {
label: '销售顾问/录单员', label: '销售顾问/录单员',
value: 'employeeName', value: 'referrer',
type: 'select', type: 'select',
key: 'employeeName', key: 'employeeName',
required: true, required: true
showText: 'shopMerchantName'
}, },
{ {
label: '交付专员', label: '交付专员',
value: 'deliveryEmployeeName', value: 'deliveryName',
type: 'select', type: 'select',
required: true, required: true,
key: 'deliveryEmployeeName', key: 'deliveryEmployeeName'
showText: 'shopMerchantName' }
},
], ],
[ [
{ {
label: '姓名', label: '姓名',
value: 'owner', value: 'owner',
maxlength: '16', maxlength: '-1',
type: 'input', type: 'input',
required: true required: true
}, },
...@@ -95,7 +93,7 @@ const FORM_LIST = [ ...@@ -95,7 +93,7 @@ const FORM_LIST = [
value: 'companion', value: 'companion',
maxlength: '200', maxlength: '200',
type: 'input' type: 'input'
}, }
], ],
[ [
{ {
...@@ -103,7 +101,7 @@ const FORM_LIST = [ ...@@ -103,7 +101,7 @@ const FORM_LIST = [
value: 'carBrandText', value: 'carBrandText',
type: 'select', type: 'select',
key: 'carBrand', key: 'carBrand',
required: true, required: true
}, },
{ {
label: '车辆颜色', label: '车辆颜色',
...@@ -130,8 +128,8 @@ const FORM_LIST = [ ...@@ -130,8 +128,8 @@ const FORM_LIST = [
value: 'price', value: 'price',
maxlength: '8', maxlength: '8',
type: 'input', type: 'input',
required: true, required: true
}, }
], ],
[ [
{ {
...@@ -139,8 +137,10 @@ const FORM_LIST = [ ...@@ -139,8 +137,10 @@ const FORM_LIST = [
value: 'skuGoods', value: 'skuGoods',
type: 'select', type: 'select',
key: 'skuGoods', key: 'skuGoods',
addHtml: 'skuGoods' addHtml: 'skuGoods',
}, required: true,
isArray: true
}
], ],
[ [
{ {
...@@ -148,7 +148,7 @@ const FORM_LIST = [ ...@@ -148,7 +148,7 @@ const FORM_LIST = [
value: 'payee', value: 'payee',
type: 'radio', type: 'radio',
key: 'name', key: 'name',
current: '1', current: '0',
radioList: [ radioList: [
{ {
value: '0', value: '0',
...@@ -167,7 +167,7 @@ const FORM_LIST = [ ...@@ -167,7 +167,7 @@ const FORM_LIST = [
value: 'payType', value: 'payType',
type: 'radio', type: 'radio',
key: 'name', key: 'name',
current: '0', current: '1',
radioList: [ radioList: [
// { // {
// value: '3', // value: '3',
...@@ -186,10 +186,11 @@ const FORM_LIST = [ ...@@ -186,10 +186,11 @@ const FORM_LIST = [
}, },
{ {
label: '嘀加收款时间', label: '嘀加收款时间',
value: 'successDateTime', value: 'pay2Time',
key: 'todayShow', key: 'todayShow',
type: 'select', type: 'select',
required: true required: true,
hidden: false
}, },
{ {
label: '备注', label: '备注',
...@@ -212,37 +213,12 @@ const DEFEAT_FORM_LIST = [ ...@@ -212,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'
} }
], ],
[ [
...@@ -254,40 +230,6 @@ const DEFEAT_FORM_LIST = [ ...@@ -254,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',
...@@ -296,163 +238,23 @@ const DEFEAT_FORM_LIST = [ ...@@ -296,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',
...@@ -501,16 +303,16 @@ const popupTypeEnum = { ...@@ -501,16 +303,16 @@ const popupTypeEnum = {
0: { 0: {
key: 'employeeName', key: 'employeeName',
list: 'employeeList', list: 'employeeList',
targetIdKey: 'userId', targetIdKey: 'referrerId',
targetNameKey: 'employeeName', targetNameKey: 'referrer',
sourceIdKey: 'uuid', sourceIdKey: 'uuid',
sourceNameKey: 'staffName' sourceNameKey: 'staffName'
}, },
1: { 1: {
key: 'deliveryEmployeeName', key: 'deliveryEmployeeName',
list: 'employeeList', list: 'employeeList',
targetIdKey: 'deliveryUserId', targetIdKey: 'deliveryId',
targetNameKey: 'deliveryEmployeeName', targetNameKey: 'deliveryName',
sourceIdKey: 'uuid', sourceIdKey: 'uuid',
sourceNameKey: 'staffName' sourceNameKey: 'staffName'
}, },
...@@ -583,11 +385,61 @@ const popupTypeEnum = { ...@@ -583,11 +385,61 @@ const popupTypeEnum = {
key: 'customer' key: 'customer'
} }
} }
const titleList = [ const titleList = [null, { addHtml: 'customer' }, { name: '车辆信息' }, { name: '增值车损险' }, { name: '其他信息' }]
null, const UpdateOrderInfo = [
{ addHtml: 'customer' }, [
{ name: '车辆信息' }, {
{ name: '增值车损险' }, label: '车主姓名',
{ name: '其他信息' }, value: 'owner',
maxlength: '10',
type: 'input',
required: true
},
{
label: '手机号',
value: 'phone',
maxlength: '11',
inputType: 'number',
type: 'input',
required: true
},
{
label: '客户类型',
value: 'salesType',
type: 'radio',
current: 0,
radioList: [
{
value: 0,
name: '售前'
},
{
value: 1,
name: '售后'
}
]
},
{
label: '车架号(VIN码)',
value: 'carVin',
maxlength: '17',
type: 'input'
},
{
label: '身份证号',
value: 'certificateNo',
maxlength: '18',
type: 'input'
},
{
label: '订单备注',
value: 'notes',
maxlength: '100',
type: 'textarea',
placeholder: '请输入 (100字以内)',
class: 'cell-break'
}
]
] ]
export { FORM_LIST, popupTypeEnum, payTypeList, DEFEAT_FORM_LIST, titleList } export { FORM_LIST, popupTypeEnum, payTypeList, DEFEAT_FORM_LIST, titleList, UpdateOrderInfo }
<template> <template>
<view class="detail-box"> <view class="detail-box">
<view class="nav-bar"> <view class="nav-bar">
<view <view class="back" @click="backPage">
class="back" <uni-icons type="left" :size="20" color="#000"></uni-icons>
@click="backPage"
>
<uni-icons
type="left"
:size="20"
color="#000"
></uni-icons>
</view> </view>
<view class="title">展业工具</view> <view class="title">展业工具</view>
</view> </view>
...@@ -17,46 +10,20 @@ ...@@ -17,46 +10,20 @@
<view class="detail-left"> <view class="detail-left">
<view class="common-title">展业</view> <view class="common-title">展业</view>
<view class="content"> <view class="content">
<image <image class="banner" src="../../../assets/images/common/tool_banner.png" mode="scaleToFill" />
class="banner"
src="../../../assets/images/common/tool_banner.png"
mode="scaleToFill"
/>
<template v-if="toolComponentName !== 'DailyReport'"> <template v-if="toolComponentName !== 'DailyReport'">
<Entrance @entranceClick="entranceClick"></Entrance> <Entrance @entranceClick="entranceClick"></Entrance>
</template> </template>
<template v-else> <template v-else>
<uni-calendar <uni-calendar ref="calendar" :clearDate="false" :endDate="endDate" :showMonth="false" @monthSwitch="currentMonth = `${$event.year}-${$event.month}`" @change="currentDate = $event.fulldate" backgroundColor="transparent" :selected="selectedDays" :date="currentDate" />
ref="calendar"
:clearDate="false"
:endDate="endDate"
:showMonth="false"
@monthSwitch="currentMonth = `${$event.year}-${$event.month}`"
@change="currentDate = $event.fulldate"
backgroundColor="transparent"
:selected="selectedDays"
:date="currentDate"
/>
</template> </template>
</view> </view>
</view> </view>
<view class="detail-right"> <view class="detail-right">
<component <component :is="toolComponentName" @jump="jump" :transmission-of-data="transmissionOfData" :currentDate="currentDate" :currentMonth="currentMonth" @setCalendarSelected="selectedDays = $event" />
:is="toolComponentName"
@jump="jump"
:transmission-of-data="transmissionOfData"
:currentDate="currentDate"
:currentMonth="currentMonth"
@setCalendarSelected="selectedDays = $event"
/>
</view> </view>
</view> </view>
<NoticePopup <NoticePopup ref="notice" title="重要提示" text="当前页面暂未保存,是否确认退出" type="warning"></NoticePopup>
ref="notice"
title="重要提示"
text="当前页面暂未保存,是否确认退出"
type="warning"
></NoticePopup>
</view> </view>
</template> </template>
...@@ -66,12 +33,12 @@ import CreateOrder from './components/CreateOrder.vue' ...@@ -66,12 +33,12 @@ import CreateOrder from './components/CreateOrder.vue'
import DailyReport from './components/DailyReport.vue' import DailyReport from './components/DailyReport.vue'
import DefeatOrder from './components/DefeatOrder.vue' import DefeatOrder from './components/DefeatOrder.vue'
import OrderManagement from './components/OrderManagement.vue' import OrderManagement from './components/OrderManagement.vue'
import ConfirmOrder from './components/ConfirmOrder.vue'
import OrderDetail from './components/OrderDetail.vue' import OrderDetail from './components/OrderDetail.vue'
import UploadProofOfPayment from './components/UploadProofOfPayment.vue' import UploadProofOfPayment from './components/UploadProofOfPayment.vue'
import NoticePopup from '@/components/NoticePopup.vue' import NoticePopup from '@/components/NoticePopup.vue'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { interceptionMixin } from '@/mixin/index' import { interceptionMixin } from '@/mixin/index'
import UpdateOrderInfo from './components/UpdateOrderInfo.vue'
export default { export default {
mixins: [interceptionMixin], mixins: [interceptionMixin],
...@@ -81,12 +48,12 @@ export default { ...@@ -81,12 +48,12 @@ export default {
DailyReport, DailyReport,
DefeatOrder, DefeatOrder,
OrderManagement, OrderManagement,
ConfirmOrder,
NoticePopup, NoticePopup,
UploadProofOfPayment, UploadProofOfPayment,
OrderDetail OrderDetail,
UpdateOrderInfo
}, },
data () { data() {
return { return {
toolComponentName: '', toolComponentName: '',
transmissionOfData: null, transmissionOfData: null,
...@@ -96,7 +63,7 @@ export default { ...@@ -96,7 +63,7 @@ export default {
selectedDays: [] selectedDays: []
} }
}, },
onLoad (options) { onLoad(options) {
if (options.componentName) this.toolComponentName = options.componentName if (options.componentName) this.toolComponentName = options.componentName
if (options.currentDate) this.setCurrentDate(options.currentDate) if (options.currentDate) this.setCurrentDate(options.currentDate)
uni.$on('jumpToDailyReport', currentDate => { uni.$on('jumpToDailyReport', currentDate => {
...@@ -105,11 +72,11 @@ export default { ...@@ -105,11 +72,11 @@ export default {
}) })
}, },
methods: { methods: {
setCurrentDate (currentDate) { setCurrentDate(currentDate) {
this.currentDate = currentDate this.currentDate = currentDate
this.currentMonth = dayjs(currentDate).format('YYYY-MM') this.currentMonth = dayjs(currentDate).format('YYYY-MM')
}, },
async entranceClick (item) { async entranceClick(item) {
const noInterceptPage = ['DailyReport'] const noInterceptPage = ['DailyReport']
if (!noInterceptPage.includes(item.name) && ((await this.checkDailyReport()) || (await this.inspectionOfProhibitionBill()))) return if (!noInterceptPage.includes(item.name) && ((await this.checkDailyReport()) || (await this.inspectionOfProhibitionBill()))) return
// 保存当前选择的组件信息,但不立即切换 // 保存当前选择的组件信息,但不立即切换
...@@ -117,7 +84,7 @@ export default { ...@@ -117,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
...@@ -153,13 +120,12 @@ export default { ...@@ -153,13 +120,12 @@ export default {
// 打开弹窗 // 打开弹窗
this.$refs.notice.open() this.$refs.notice.open()
}, },
backPage () { backPage() {
uni.navigateBack() uni.navigateBack()
}, },
// name:跳转组件名,val:跳转参数 // name:跳转组件名,val:跳转参数
jump (name, val) { jump(name, val) {
this.toolComponentName = name this.toolComponentName = name
console.log(this.toolComponentName, val)
if (val) { if (val) {
this.transmissionOfData = val this.transmissionOfData = val
} }
...@@ -192,7 +158,7 @@ export default { ...@@ -192,7 +158,7 @@ export default {
} }
} }
.detail-right { .detail-right {
width: toRpx(1368); width: calc(100% - #{toRpx(832)});
height: 100%; height: 100%;
border-radius: toRpx(48); border-radius: toRpx(48);
background: #ffffff59; background: #ffffff59;
......
...@@ -231,7 +231,7 @@ export default { ...@@ -231,7 +231,7 @@ export default {
flex-wrap: wrap; flex-wrap: wrap;
padding: toRpx(16) toRpx(48); padding: toRpx(16) toRpx(48);
box-sizing: border-box; box-sizing: border-box;
margin: 0 -toRpx(16); margin: 0 toMinusRpx(16);
border-bottom: toRpx(1) solid #f0f2f5; border-bottom: toRpx(1) solid #f0f2f5;
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!