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 = {
* 保存日报
*/
saveStaffDailyReport (data) {
data.dailyReportSource = 2
return http.post({
method: 'dj.api.smartcarlife.staff.daily.report.save',
projectName: 'boutique',
......@@ -391,9 +392,4 @@ module.exports = {
...data
})
},
// // 查询店铺配置
// getShopMerchantPointConfig(data) {
// return api.post('dj.api.smartcarlife.shopMerchantPointConfig.get', data)
// },
}
import http from '../request/http'
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
})
}
}
module.exports = {}
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'
import interceptionApi from './interceptionApi'
import popupApi from './popupApi'
import usedCarApi from './usedCar'
import equitApi from './equit'
import equityApi from './equity'
module.exports = {
commonApi,
......@@ -27,5 +27,5 @@ module.exports = {
evaluationApi,
usedCarApi,
activityApi,
equitApi
equityApi
}
......@@ -213,6 +213,9 @@
.px-20 {
padding: 0 toRpx(20);
}
.px-24 {
padding: 0 toRpx(20);
}
.px-32 {
padding: 0 toRpx(32);
}
......
......@@ -26,7 +26,7 @@
:class="[
{'sub-brand-name':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)"
>
......@@ -184,7 +184,14 @@ export default {
}
this.currentId = that.id
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>
......
......@@ -5,9 +5,9 @@
:class="['step flex',{'step-active':currentStep == 1}]"
@click="currentStep = 1"
>
{{currentIds[0] || '选择省份'}}
{{currentIds[0] || '选择省份'}}
</view>
<view :class="['step flex',{'step-active':currentStep == 2}]">{{currentIds[1]|| '选择城市'}}</view>
<view :class="['step flex',{'step-active':currentStep == 2}]">{{currentIds[1]||'选择城市'}}</view>
</view>
<scroll-view
class="scroll-view"
......@@ -152,8 +152,14 @@ export default {
})
this.updateParams(params, province)
},
initData (data) {
this.list = data
initData (listData) {
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')
},
choose (item) {
......@@ -169,7 +175,7 @@ export default {
} else {
this.currentIds = [name]
this.currentStep = 2
this.scrollTop = 10
this.scrollTop = 1
setTimeout(() => {
this.scrollTop = 0
}, 100)
......
......@@ -62,8 +62,7 @@ export default {
this.getList(searchValue, true)
},
choose (i) {
let { params: { idKey } } = this
this.currentId = i[idKey]
this.currentId = i.customerPhone
this.$emit('choose', i)
},
checkActive (i) {
......
......@@ -4,7 +4,7 @@
<view
:key="index"
@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>
{{ i.staffName }}
......@@ -23,6 +23,12 @@ export default {
return {
}
},
computed: {
idKey () {
let { params: { idKey }, sceneType } = this
return idKey[sceneType] || idKey
}
},
mounted () {
},
methods: {
......@@ -55,19 +61,28 @@ export default {
this.getList(searchValue, true)
},
choose (i) {
console.log('choose', i)
let { params: { idKey }, data } = this,
let { idKey, data } = this,
userId = data.deliveryUserId,
referrerId = data.deliveryId,
deliveryUserId = data.userId,
deliveryId = data.referrerId,
value = {
userId: data.deliveryUserId,
deliveryUserId: data.userId
userId,
deliveryUserId,
referrerId,
deliveryId
}[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: '销售顾问/录单员与交付专员不能选取同一人',
icon: 'none',
mask: true
})
this.currentId = i.uuid
this.$emit('choose', i)
},
checkActive (i) {
let { currentId, idKey, data } = this
return currentId ? i.uuid == currentId : i.uuid == data[idKey]
}
}
}
......
......@@ -6,9 +6,8 @@
<template v-if="params.loadComplete">
<template v-if="list.length">
<template v-for="(i, index) in list">
<!-- v-if="i.goodsFlag == 3" -->
<!-- v-if="i.goodsFlag == 3" -->
<view
:key="`${index}_${i.key}`"
@click.stop="choose(i, index)"
:class="['item', { hide: !i.show }, { active: checkActive(i) }, { single: i.goodsFlag == 1 }]"
......@@ -29,7 +28,7 @@
class="filled"
></uni-icons>
</view>
<text class="goods-name text-hide">
<text class="goods-name">
<template v-if="sceneType == 1">
{{ replaceItemText(i.goods, 'goodsAlias')
|| replaceItemText(i.goods, 'upgradeGoodsName')
......@@ -133,7 +132,9 @@
class="filled"
></uni-icons>
</view>
{{ i.packageGoods.packageAlias || i.packageGoods.packageName }}
<text class="goods-name">
{{ i.packageGoods.packageAlias || i.packageGoods.packageName }}
</text>
<text class="price">¥{{ i.packageGoods.sellPrice }}</text>
</view>
<view class="package-list">
......@@ -286,9 +287,8 @@ export default {
arr.push(val)
}
if (val.goodsFlag == 3) {
let item = val.packageGoods
val.packageGoods.goodsList = item.goodsList.map(item => {
;
let { goodsList } = val.packageGoods
val.packageGoods.goodsList = goodsList.map(item => {
(item.specificationNameSequence =
item.specificationTypeSequence && item.specificationNameSequence ?
item.specificationNameSequence.replace(/;~;/g, '/') :
......@@ -297,9 +297,11 @@ export default {
item.specificationTypeSequence && item.specificationData ?
item.specificationData.replace(/;~;/g, '/') :
'')
item.number = 1
item.price = item.sellPrice
return item
})
val.packageGoods.sellPrice = item.goodsList.reduce((pre, item) => {
val.packageGoods.sellPrice = goodsList.reduce((pre, item) => {
pre = NP.plus(pre, item.sellPrice)
return pre
}, 0)
......@@ -548,6 +550,9 @@ export default {
.title {
min-height: toRpx(88);
padding: toRpx(24) 0 toRpx(20);
.goods-name {
max-width: 80%;
}
}
.base-tips {
margin-bottom: 20rpx;
......
......@@ -27,7 +27,7 @@ const componentConfig = {
name: 'EmployeeList',
title: '销售顾问/录单员',
placeholder: '请输入姓名',
idKey: 'userId',
idKey: ['referrerId', 'userId'],
cacheData: [],
loadComplete: false,
searchValue: '',
......@@ -38,7 +38,7 @@ const componentConfig = {
title: '交付专员',
placeholder: '请输入姓名',
nullTips: '请选择交付专员',
idKey: 'deliveryUserId',
idKey: ['deliveryId', 'deliveryUserId'],
cacheData: [],
loadComplete: false,
searchValue: '',
......@@ -67,6 +67,7 @@ const componentConfig = {
title: '选择车型',
placeholder: '查找',
idKey: 'carSeriesId',
nullTips: '请选择车型',
cacheData: [],
loadComplete: false,
searchValue: '',
......@@ -201,21 +202,21 @@ const componentConfig = {
nullTips: '请选择所在城市',
cacheData: [],
noData: false,
idKeys: ['province','city']
idKeys: ['provinceText', 'cityText']
},
18:{
name:'Seat',
title:'座位数',
18: {
name: 'Seat',
title: '座位数',
idKey: 'seat',
hideSearch: true,
loadComplete: false,
},
19:{
name:'Customer',
title:'客户档案',
19: {
name: 'Customer',
title: '客户档案',
loadComplete: false,
placeholder: '查找',
idKey: 'customerPhone',
idKey: 'phone',
cacheData: [],
loadComplete: false,
searchValue: '',
......
......@@ -98,6 +98,7 @@ export default {
return {
userInfo: this.userInfo,
baseConfigData: this.baseConfigData,
sceneType: this.sceneType
}
},
data () {
......@@ -145,6 +146,10 @@ export default {
},
baseConfigData () {
return this.$store.state.boutique.baseConfigData
},
sceneType(){
const { sceneType } = uni.$storage.get('userInfo')
return sceneType
}
},
mounted () {
......
<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
<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>
<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="box-shell">
<view class="flex align-center justify-between box-flow">
......@@ -8,26 +20,52 @@
交易流水号
<text class="required">*</text>
</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 class="payment">
<view class="payment-label">
付款凭证
<text class="required">*</text>
</view>
<view class="upload-box flex flex-wrap">
<view class="upload-item" @click.stop="selectImg"></view>
<view v-for="(item, index) in payVoucherList" :key="index" class="previewImageList">
<view class="upload-box">
<template v-if="payVoucherList.length < 9">
<view
class="upload-item"
@click.stop="selectImg"
></view>
</template>
<view
v-for="(item, index) in payVoucherList"
:key="index"
class="previewImageList"
>
<image :src="item"></image>
<view class="close-box" @click="deleteImg(index)">
<uni-icons class="icon-close" type="closeempty" color="#ffffff"></uni-icons>
<view
class="close-box"
@click="deleteImg(index)"
>
<uni-icons
class="icon-close"
type="closeempty"
color="#ffffff"
></uni-icons>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="uploadBtn" @click.stop="confirm">确定提交</view>
<view
class="uploadBtn"
@click.stop="confirm"
>确定提交</view>
</view>
</template>
<script>
......@@ -36,22 +74,25 @@ import { debounce } from 'lodash'
export default {
name: 'UploadProofOfPayment',
props: {
transmissionOfData: {
type: Object,
default: () => null
}
},
data() {
data () {
return {
payVoucherList: [],
outTradeNo: ''
}
},
mounted() {
console.log(this.transmissionOfData, 'console.log(this.transmissionOfData)')
mounted () {
},
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
uni.chooseImage({
count: 1, //默认9
......@@ -63,15 +104,14 @@ export default {
}
})
},
outTradeNoInput(e) {
outTradeNoInput (e) {
const filteredValue = e.detail.value.replace(/[\u4E00-\u9FA5]/g, '')
this.$nextTick(() => {
this.$set(this, 'outTradeNo', filteredValue)
})
console.log(this.outTradeNo)
},
// 上传付款凭证
async upLoad(event) {
async upLoad (event) {
console.log(event)
let _this = this
const { tempFilePaths } = event
......@@ -79,39 +119,19 @@ export default {
this.payVoucherList.push(url)
},
confirm: debounce(function (e) {
console.log(this.transmissionOfData)
let { outTradeNo, payVoucherList } = this
if (payVoucherList.length && outTradeNo) {
this.createPayOrder()
this.$emit('confirm', {
payVoucherList,
outTradeNo
})
} else {
uni.showToast({ title: '交易流水号或付款凭证不能为空!', icon: 'none' })
}
}, 300),
deleteImg(index) {
deleteImg (index) {
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>
......@@ -119,6 +139,9 @@ export default {
.px-48 {
padding: 0 toRpx(48);
}
.back {
height: 40rpx;
}
.upload-proof-of-payment {
width: 100%;
height: 100%;
......@@ -143,6 +166,7 @@ export default {
}
.uni-input {
text-align: right;
width: 80%;
.uni-input-placeholder {
font-size: toRpx(28);
font-weight: 400;
......@@ -162,6 +186,8 @@ export default {
}
}
.upload-box {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: toRpx(20);
.upload-item {
width: toRpx(320) !important;
......@@ -172,17 +198,18 @@ export default {
}
.previewImageList {
position: relative;
height: toRpx(240) !important;
image {
width: toRpx(320) !important;
height: toRpx(240) !important;
width: 100% !important;
height: 100% !important;
border-radius: toRpx(12);
}
.close-box {
width: toRpx(36);
height: toRpx(36);
position: absolute;
top: - toRpx(12);
right: - toRpx(12);
top: toMinusRpx(12);
right: toMinusRpx(12);
background: rgba(0, 0, 0, 0.6);
border-radius: 50%;
text-align: center;
......
......@@ -2,26 +2,24 @@ const FORM_LIST = [
[
{
label: '销售顾问/录单员',
value: 'employeeName',
value: 'referrer',
type: 'select',
key: 'employeeName',
required: true,
showText: 'shopMerchantName'
required: true
},
{
label: '交付专员',
value: 'deliveryEmployeeName',
value: 'deliveryName',
type: 'select',
required: true,
key: 'deliveryEmployeeName',
showText: 'shopMerchantName'
},
key: 'deliveryEmployeeName'
}
],
[
{
label: '姓名',
value: 'owner',
maxlength: '16',
maxlength: '-1',
type: 'input',
required: true
},
......@@ -95,7 +93,7 @@ const FORM_LIST = [
value: 'companion',
maxlength: '200',
type: 'input'
},
}
],
[
{
......@@ -103,7 +101,7 @@ const FORM_LIST = [
value: 'carBrandText',
type: 'select',
key: 'carBrand',
required: true,
required: true
},
{
label: '车辆颜色',
......@@ -130,8 +128,8 @@ const FORM_LIST = [
value: 'price',
maxlength: '8',
type: 'input',
required: true,
},
required: true
}
],
[
{
......@@ -139,8 +137,10 @@ const FORM_LIST = [
value: 'skuGoods',
type: 'select',
key: 'skuGoods',
addHtml: 'skuGoods'
},
addHtml: 'skuGoods',
required: true,
isArray: true
}
],
[
{
......@@ -148,7 +148,7 @@ const FORM_LIST = [
value: 'payee',
type: 'radio',
key: 'name',
current: '1',
current: '0',
radioList: [
{
value: '0',
......@@ -167,7 +167,7 @@ const FORM_LIST = [
value: 'payType',
type: 'radio',
key: 'name',
current: '0',
current: '1',
radioList: [
// {
// value: '3',
......@@ -186,10 +186,11 @@ const FORM_LIST = [
},
{
label: '嘀加收款时间',
value: 'successDateTime',
value: 'pay2Time',
key: 'todayShow',
type: 'select',
required: true
required: true,
hidden: false
},
{
label: '备注',
......@@ -212,37 +213,12 @@ const DEFEAT_FORM_LIST = [
required: true
},
{
label: '销售顾问/录单员',
label: '推荐人员',
value: 'employeeName',
type: 'select',
// key: 'staffName',
required: true,
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 = [
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: '手机号',
value: 'customerPhone',
maxlength: '11',
......@@ -296,163 +238,23 @@ const DEFEAT_FORM_LIST = [
inputType: 'number'
},
{
label: '选择车型',
value: 'carBrand',
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',
label: '客户来源',
value: 'salesType',
type: 'radio',
key: 'name',
current: '1',
current: '0',
radioList: [
{
value: '0',
name: '嘀加收款',
disabled: false
name: '售前'
},
{
value: '1',
name: '4s店收款',
disabled: false
name: '售后'
}
],
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: '车主拒升理由',
value: 'refusalReason',
maxlength: '30',
......@@ -501,16 +303,16 @@ const popupTypeEnum = {
0: {
key: 'employeeName',
list: 'employeeList',
targetIdKey: 'userId',
targetNameKey: 'employeeName',
targetIdKey: 'referrerId',
targetNameKey: 'referrer',
sourceIdKey: 'uuid',
sourceNameKey: 'staffName'
},
1: {
key: 'deliveryEmployeeName',
list: 'employeeList',
targetIdKey: 'deliveryUserId',
targetNameKey: 'deliveryEmployeeName',
targetIdKey: 'deliveryId',
targetNameKey: 'deliveryName',
sourceIdKey: 'uuid',
sourceNameKey: 'staffName'
},
......@@ -583,11 +385,61 @@ const popupTypeEnum = {
key: 'customer'
}
}
const titleList = [
null,
{ addHtml: 'customer' },
{ name: '车辆信息' },
{ name: '增值车损险' },
{ name: '其他信息' },
const titleList = [null, { addHtml: 'customer' }, { name: '车辆信息' }, { name: '增值车损险' }, { name: '其他信息' }]
const UpdateOrderInfo = [
[
{
label: '车主姓名',
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>
<view class="detail-box">
<view class="nav-bar">
<view
class="back"
@click="backPage"
>
<uni-icons
type="left"
:size="20"
color="#000"
></uni-icons>
<view class="back" @click="backPage">
<uni-icons type="left" :size="20" color="#000"></uni-icons>
</view>
<view class="title">展业工具</view>
</view>
......@@ -17,46 +10,20 @@
<view class="detail-left">
<view class="common-title">展业</view>
<view class="content">
<image
class="banner"
src="../../../assets/images/common/tool_banner.png"
mode="scaleToFill"
/>
<image class="banner" src="../../../assets/images/common/tool_banner.png" mode="scaleToFill" />
<template v-if="toolComponentName !== 'DailyReport'">
<Entrance @entranceClick="entranceClick"></Entrance>
</template>
<template v-else>
<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"
/>
<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" />
</template>
</view>
</view>
<view class="detail-right">
<component
:is="toolComponentName"
@jump="jump"
:transmission-of-data="transmissionOfData"
:currentDate="currentDate"
:currentMonth="currentMonth"
@setCalendarSelected="selectedDays = $event"
/>
<component :is="toolComponentName" @jump="jump" :transmission-of-data="transmissionOfData" :currentDate="currentDate" :currentMonth="currentMonth" @setCalendarSelected="selectedDays = $event" />
</view>
</view>
<NoticePopup
ref="notice"
title="重要提示"
text="当前页面暂未保存,是否确认退出"
type="warning"
></NoticePopup>
<NoticePopup ref="notice" title="重要提示" text="当前页面暂未保存,是否确认退出" type="warning"></NoticePopup>
</view>
</template>
......@@ -66,12 +33,12 @@ import CreateOrder from './components/CreateOrder.vue'
import DailyReport from './components/DailyReport.vue'
import DefeatOrder from './components/DefeatOrder.vue'
import OrderManagement from './components/OrderManagement.vue'
import ConfirmOrder from './components/ConfirmOrder.vue'
import OrderDetail from './components/OrderDetail.vue'
import UploadProofOfPayment from './components/UploadProofOfPayment.vue'
import NoticePopup from '@/components/NoticePopup.vue'
import dayjs from 'dayjs'
import { interceptionMixin } from '@/mixin/index'
import UpdateOrderInfo from './components/UpdateOrderInfo.vue'
export default {
mixins: [interceptionMixin],
......@@ -81,12 +48,12 @@ export default {
DailyReport,
DefeatOrder,
OrderManagement,
ConfirmOrder,
NoticePopup,
UploadProofOfPayment,
OrderDetail
OrderDetail,
UpdateOrderInfo
},
data () {
data() {
return {
toolComponentName: '',
transmissionOfData: null,
......@@ -96,7 +63,7 @@ export default {
selectedDays: []
}
},
onLoad (options) {
onLoad(options) {
if (options.componentName) this.toolComponentName = options.componentName
if (options.currentDate) this.setCurrentDate(options.currentDate)
uni.$on('jumpToDailyReport', currentDate => {
......@@ -105,11 +72,11 @@ export default {
})
},
methods: {
setCurrentDate (currentDate) {
setCurrentDate(currentDate) {
this.currentDate = currentDate
this.currentMonth = dayjs(currentDate).format('YYYY-MM')
},
async entranceClick (item) {
async entranceClick(item) {
const noInterceptPage = ['DailyReport']
if (!noInterceptPage.includes(item.name) && ((await this.checkDailyReport()) || (await this.inspectionOfProhibitionBill()))) return
// 保存当前选择的组件信息,但不立即切换
......@@ -117,7 +84,7 @@ export default {
if (this.toolComponentName === selectedItem.name && (!this.transmissionOfData || this.transmissionOfData.type !== 'supplementOrder')) return
// 如果当前组件是OrderManagement,直接切换组件,不显示弹窗
// 只有从CreateOrder、DefeatOrder切换其他组件时需要二次确认
if (this.toolComponentName !== 'CreateOrder' && this.toolComponentName !== 'DefeatOrder') {
if (this.toolComponentName !== 'CreateOrder' && this.toolComponentName !== 'DefeatOrder' && this.toolComponentName !== 'UpdateOrderInfo') {
this.toolComponentName = selectedItem.name
this.transmissionOfData = null
return
......@@ -153,13 +120,12 @@ export default {
// 打开弹窗
this.$refs.notice.open()
},
backPage () {
backPage() {
uni.navigateBack()
},
// name:跳转组件名,val:跳转参数
jump (name, val) {
jump(name, val) {
this.toolComponentName = name
console.log(this.toolComponentName, val)
if (val) {
this.transmissionOfData = val
}
......@@ -192,7 +158,7 @@ export default {
}
}
.detail-right {
width: toRpx(1368);
width: calc(100% - #{toRpx(832)});
height: 100%;
border-radius: toRpx(48);
background: #ffffff59;
......
......@@ -231,7 +231,7 @@ export default {
flex-wrap: wrap;
padding: toRpx(16) toRpx(48);
box-sizing: border-box;
margin: 0 -toRpx(16);
margin: 0 toMinusRpx(16);
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!