Commit 36019b4c by cen

feat: 新增工单确认,新增录单入口

1 parent b5d0eb4b
...@@ -179,5 +179,21 @@ module.exports = { ...@@ -179,5 +179,21 @@ module.exports = {
projectName: 'boutique', projectName: 'boutique',
...data ...data
}) })
},
/** 查询该店员工日报是否开启 */
staffDailyReportMerchantValid(data) {
// return api.post('dj.api.smartcarlife.staff.daily.report.merchant.valid', data)
return http.post({ method: 'dj.api.smartcarlife.staff.daily.report.popup.need', projectName: 'boutique', ...data })
},
/** 校验手机号是否配置打卡和是否打卡 */
clockInConfigPhone(data) {
// return api.post('dj.api.smartcarlife.staff.daily.report.merchant.valid', data)
return http.post({ method: 'dj.api.smartcarlife.clock.in.config.phone', projectName: 'boutique', ...data })
},
/** 获取商户基本信息 */
getServiceBaseInfo(data) {
return http.post({ method: 'dj.api.smartcarlife.serviceMerchant.getServiceBaseInfo', projectName: 'boutique', ...data })
} }
} }
...@@ -55,6 +55,12 @@ ...@@ -55,6 +55,12 @@
-webkit-justify-content: center; -webkit-justify-content: center;
justify-content: center; justify-content: center;
} }
.justify-end {
-webkit-box-pack: end;
-ms-flex-pack: end;
-webkit-justify-content: flex-end;
justify-content: flex-end;
}
.flex-wrap { .flex-wrap {
-ms-flex-wrap: wrap; -ms-flex-wrap: wrap;
......

2.54 MB | W: | H:

2.54 MB | W: | H:

assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -92,8 +92,11 @@ ...@@ -92,8 +92,11 @@
</template> </template>
<script> <script>
import order_mixins from '../order_mixins.js' import order_mixins from '../order_mixins.js'
import { interceptionMixin } from '@/mixin/index'
import utils from '@/utils/utils' import utils from '@/utils/utils'
import { checkDailyReport, showNextModal } from '@/utils/modalUtils'
export default { export default {
mixins: [interceptionMixin],
name: 'OrderCard', name: 'OrderCard',
props: { props: {
orderCardDetail: { orderCardDetail: {
...@@ -105,6 +108,8 @@ export default { ...@@ -105,6 +108,8 @@ export default {
return { return {
...order_mixins.data, ...order_mixins.data,
IMG_URL: 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/', IMG_URL: 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/',
isSettingExpiredTraffic: false, // 是否启用流量失效
selectType: 1,
pointsMultiObj: [ pointsMultiObj: [
{ {
label: '销售顾问 /录单员', label: '销售顾问 /录单员',
...@@ -155,7 +160,7 @@ export default { ...@@ -155,7 +160,7 @@ export default {
flag: !this.orderCardDetail.showAllGoodsListFlag flag: !this.orderCardDetail.showAllGoodsListFlag
}) })
}, },
jump(name, item) { async jump(name, item) {
// 订单状态 1 待跟进, 2 不升级, 3 待支付,4 已支付,6 已评价 ,9 已撤销 , 10 已关闭 , 11 已失效 // 订单状态 1 待跟进, 2 不升级, 3 待支付,4 已支付,6 已评价 ,9 已撤销 , 10 已关闭 , 11 已失效
// constructionFlag 施工标识(Y:已施工;N||null:未施工) // constructionFlag 施工标识(Y:已施工;N||null:未施工)
// failureFlag 订单失效状态(Y:已失效,N:未失效) // failureFlag 订单失效状态(Y:已失效,N:未失效)
...@@ -171,15 +176,24 @@ export default { ...@@ -171,15 +176,24 @@ export default {
userInfo.merchantType = error userInfo.merchantType = error
} }
} }
let { userType, isSuper, merchantType } = userInfo userInfo.isMake = !(userInfo?.isSuper || userInfo?.loginRole == 3 || userInfo?.loginRole == 5 || userInfo?.loginRole == 6 || userInfo?.loginRole == 7)
let { userType, isSuper, merchantType, isMake } = userInfo
console.log(item) console.log(item)
if (name == 'createOrder') { if (name == 'createOrder' || name == 'premiumUpgrade') {
if (merchantType && !isSuper) { 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) { if (userType == 2 && item?.selectPayType == 1) {
wx.$router.go('confirmOrder', item) wx.$router.go('tabWorkOrder.confirmOrder', item)
} else if (userType == 2) { } else if (userType == 2) {
wx.$router.go(name, item) item
? this.showSelectType({
item
})
: wx.$router.go('tabWorkOrder.' + name, item)
} else { } else {
utils.showNoAccess() utils.showNoAccess()
} }
...@@ -188,10 +202,51 @@ export default { ...@@ -188,10 +202,51 @@ export default {
} }
// 已支付加已施工 // 已支付加已施工
} else if (item.constructionFlag == 'Y' && item.status != 10) { } else if (item.constructionFlag == 'Y' && item.status != 10) {
wx.$router.go('constructionOrderDetail', item) wx.$router.go('tabWorkOrder.constructionOrderDetail', item)
} else { } else {
// console.log(item) wx.$router.go('tabWorkOrder.' + name, item)
wx.$router.go(name, item) }
},
// 确定是否要显示
showSelectType({ scene = '', item = {} }, scan = false) {
this.isScan = scan
// 当切换门店后,不支持录入失效客户工单,将selectType置为1录入工单
if ((!this.isSettingExpiredTraffic || scan) && this.selectType == 3) {
this.selectType = 1
}
uni.showModal({
show: true,
title: '请选择录单入口',
tabTitleShow: false,
success: async res => {
// 跳转新增订单页面 并带特定参数
console.log(item, 'showSelectType')
if (this.selectType == 1) {
if (await this.inspectionOfProhibitionBill()) return
wx.$router.go('tabWorkOrder.createOrder', {
scene,
...item
})
} else {
wx.$router.go('tabWorkOrder.defeatOrder', {
scene,
...item,
isExpiredTraffic: this.selectType == 3
})
}
},
error: () => {}
})
},
// 获取轻改录单配置是否启用流量失效
getCreateOrderSetting() {
let userInfo = uni.$storage.get('userInfo')
let merchantType = userInfo?.merchantAccountList.includes('6') || userInfo?.merchantAccountList.includes('8')
if (merchantType && !userInfo?.isSuper && userInfo?.loginRole != 3 && userInfo?.userType == 2 && userInfo?.shopMerchantId) {
uni.$api.boutiqueApi.getServiceBaseInfo({ merchantId: userInfo?.shopMerchantId }).then(res => {
this.isSettingExpiredTraffic = res?.data?.trafficExpireFlag == 'Y'
})
} }
} }
} }
......
<template>
<view class="order-confirm">
<view class="common-title">工单确认</view>
<view class="px-48 scroll-y">
<view class="top-tips flex align-center">
<text class="fs-16 fw-7">等待客户付款</text>
<text class="fs-13 ml-12">点击下一步,锁定并生成工单码。</text>
</view>
<!-- 商品信息 -->
<view class="box-shell">
<view class="box-shell-title">商品信息</view>
<view class="good-list">
<view class="good">
<view class="flex justify-between align-center">
<text class="good-name">商品名称:</text>
<text class="good-price">¥1000</text>
</view>
<view class="flex justify-between align-center pt-6">
<text class="good-alias">商品别名:</text>
</view>
<view class="flex align-center pt-12">
<text class="good-sku">天窗玻璃</text>
<text class="good-count">x2</text>
</view>
</view>
</view>
<view class="flex align-center py-8">
<view class="sprite-icon icon-coupon fs-14"></view>
<text class="fs-14 coupon-name">贴膜抵用券GH647-039(系统)</text>
</view>
<view class="flex justify-end align-center">
<text class="good-total-lable">商品总金额:</text>
<text class="good-total-value">
<text class="unit">¥</text>
{{ toPrice(218.98887, 2) }}
</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-8">
<view class="label">{{ item.label }}</view>
<view v-if="item.key == 'status'">
<view class="value" :style="{ color: item.constructionFlag == 'Y' ? status[orderInfo.status].color : '' }">
<!-- {{ item.constructionFlag == 'Y'? status[orderInfo.status].text: '待施工'}} -->
<!-- {{ 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">
<view class="copy" @click="setCopyData">
<!-- 复制 -->
</view>
</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="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-8" v-for="(item, index) in customerObj" :key="index">
<view class="label">{{ item.label }}</view>
<view class="value" :style="{ color: item.color || '#333' }">
<view v-if="item.arr">
<view v-if="orderInfo[item.arr[1]]">
<view v-for="(i, ind) in item.arr" :key="ind">
<view class="value-item text-hide">
<text v-if="ind == 1">|</text>
{{ orderInfo[i] }}
</view>
</view>
</view>
</view>
<view v-else>
{{ item.enum ? item.enum[orderInfo[item.key]] : orderInfo[item.key] || '' }}
</view>
<view v-if="item.copy">
<view class="copy" @click="setCopyData">
<!-- 复制 -->
<!-- <image src="{{IMG_URL}}copy_icon_gapy.png" class="copyImage" binderror="" bindload=""></image> -->
</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">修改</view>
<view class="confirm btn">确认</view>
</view>
</view>
</view>
</template>
<script>
import utils from '@/utils/utils'
import order_mixins from '../../order_mixins.js'
export default {
name: 'OrderConfirm',
props: {
orderInfo: {
type: Object,
default: () => ({})
}
},
data() {
return {
...order_mixins.data
}
},
methods: {
toPrice(val, num) {
return Number(utils.decimal(val, num)).toFixed(2)
}
}
}
</script>
<style scoped lang="scss">
.order-confirm {
position: relative;
height: 100%;
.scroll-y {
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);
}
.fs-14 {
font-size: toRpx(14);
}
.fs-16 {
font-size: toRpx(16);
}
.fw-7 {
font-weight: 700;
}
.fs-13 {
font-size: toRpx(13);
}
.ml-12 {
margin-left: toRpx(12);
}
.py-8 {
padding: toRpx(8) 0;
}
.top-tips {
width: 100%;
height: toRpx(48);
border-radius: toRpx(8);
background: linear-gradient(-90deg, #61c0ff 0%, #2c66f7 100%);
box-shadow: inset 0 0 toRpx(20) 0 #ffffff99;
color: #fff;
padding: 0 toRpx(16);
}
.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;
}
.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;
}
.good-count {
color: #999999;
font-size: toRpx(24);
font-weight: 400;
}
}
}
.coupon-name {
color: #292d33;
font-size: toRpx(24);
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 {
.label {
width: toRpx(156);
color: #999999;
font-size: toRpx(26);
font-weight: 400;
}
.value {
color: #222222;
font-size: toRpx(26);
font-weight: 400;
}
}
}
.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>
...@@ -30,13 +30,15 @@ import CreateOrder from './components/CreateOrder.vue' ...@@ -30,13 +30,15 @@ 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'
export default { export default {
components: { components: {
Entrance, Entrance,
CreateOrder, CreateOrder,
DailyReport, DailyReport,
DefeatOrder, DefeatOrder,
OrderManagement OrderManagement,
ConfirmOrder
}, },
data() { data() {
return { return {
......
let modalQueue = []
import api from '@/api/index.js'
let eventRequest = []
export const checkDailyReport = async sceneType => {
let userInfo = uni.$storage.get('userInfo')
// debugger
// 判读是否要填写日报
if (!(userInfo?.isSuper || userInfo?.loginRole == 3 || userInfo.loginRole == 5 || userInfo?.loginRole == 6)) {
// 判断员工是否已打卡上班
eventRequest.push(clockedIntoWork())
eventRequest.push(sceneType ? equityStaffDailyReport(userInfo) : staffDailyReport(userInfo))
}
return new Promise(resolve => {
Promise.all(eventRequest).then(results => {
// const [reportStatus] = results;
results = results.slice(-2)
// console.log(reportStatus, results, results.length, results[results.length - 1], 'reportStatus');
let resultFlag = results.some(item => item)
showNextModal()
console.log(resultFlag, 'resultFlag')
resolve(resultFlag)
})
})
}
export const showNextModal = () => {
let _this = this
if (modalQueue.length > 0) {
const modalInfo = modalQueue.pop()
if (uni.__HAS_SHOW_MODAL) return
uni.__HAS_SHOW_MODAL = true
uni.showModal({
title: modalInfo.title,
content: modalInfo.content,
showCancel: modalInfo.showCancel,
cancelColor: '#292D33',
confirmText: modalInfo.confirmText,
confirmColor: '#347BFF',
success: function (res) {
uni.__HAS_SHOW_MODAL = false
// if (res.cancel) _this.showNextModal();
if (res.cancel) showNextModal()
modalInfo.eventCallback(res)
}
})
}
}
const staffDailyReport = userInfo => {
return new Promise((resolve, reject) => {
api.boutiqueApi
.staffDailyReportMerchantValid({
merchantId: userInfo.shopMerchantId,
yqMerchantId: userInfo.merchantId,
staffUuid: userInfo.uuid,
sceneType: 1
})
.then(res => {
if (res.data) {
// 获取当前日期
let currentDate = new Date()
// 获取上一天的日期
let previousDate = new Date(currentDate)
previousDate.setDate(currentDate.getDate() - 1)
// toISOString 方法会丢失时区 导致与北京时间差八小时
let hour = previousDate.getHours() + 8
previousDate.setHours(hour)
// 格式化日期为"yyyy-mm-dd"
let formattedDate = previousDate.toISOString().split('T')[0]
if (wx.__HAS_NOTLOGIN_MODAL) return false
addModalToQueue('日报提醒', '您有未填写的日报,请点击前往。', '前往填写', false, 2, res => {
if (res.confirm) {
wx.$router.go('tabWorkOrder.upgradeStaffDaily', {
reportDate: formattedDate
})
}
})
resolve(true)
} else {
resolve(false)
}
})
.catch(err => {
resolve()
console.log(err)
})
})
}
const equityStaffDailyReport = userInfo => {
return new Promise((resolve, reject) => {
api.boutiqueApi
.staffDailyReportMerchantValid({
merchantId: userInfo?.shopMerchantId,
yqMerchantId: userInfo?.merchantId,
staffUuid: userInfo?.uuid,
sceneType: 0
})
.then(res => {
if (res.data) {
// 获取当前日期
let currentDate = new Date()
// 获取上一天的日期
let previousDate = new Date(currentDate)
previousDate.setDate(currentDate.getDate() - 1)
console.log(previousDate, 'previousDate')
// toISOString 方法会丢失时区 导致与北京时间差八小时
let hour = previousDate.getHours() + 8
previousDate.setHours(hour)
// 格式化日期为"yyyy-mm-dd"
let formattedDate = previousDate.toISOString().split('T')[0]
console.log('formattedDate', formattedDate)
if (wx.__HAS_NOTLOGIN_MODAL || userInfo?.isSuper || userInfo?.loginRole == 3 || userInfo.loginRole == 5 || userInfo?.loginRole == 6) return false
addModalToQueue('日报提醒', '您有未填写的日报,请点击前往。', '前往填写', false, 4, res => {
if (res.confirm) {
wx.$router.go('tabWorkOrder.staffDaily', {
reportDate: formattedDate
})
}
})
resolve(true)
} else {
resolve(false)
}
})
.catch(err => {
resolve(false)
})
})
}
export const clockedIntoWork = userInfo => {
return new Promise((resolve, reject) => {
api.boutiqueApi
.clockInConfigPhone({})
.then(res => {
let { need, clockIn } = res.data
// console.log(res, need == 0 && clockIn == 0, "clockInConfigPhone");
// 已配置未打卡
if (need == 1 && clockIn == 0) {
// 有配置并且没有打卡就提示
addModalToQueue('打卡提醒', '您当前企微未打卡,无法录单,请前往企微打卡后再试,如有异议请联系管理员。', '知道了', false, 4, res => {
if (res.confirm) {
// wx.$router.go("tabWorkOrder.staffDaily", {
// // reportDate: formattedDate,
// });
}
})
resolve(true)
} else {
resolve(false)
}
})
.catch(err => {
resolve(false)
})
})
}
const addModalToQueue = (title, content, confirmText, showCancel, priority, eventCallback) => {
if (modalQueue.findIndex(val => val.content == content) < 0)
modalQueue.push({
title,
content,
confirmText,
showCancel,
priority,
eventCallback
})
modalQueue.sort((a, b) => a.priority - b.priority)
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!