Commit c04652a9 by cen

feat: 补充工单支付方式

1 parent 70cd0bf7

2.54 MB | W: | H:

2.56 MB | W: | H:

assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -4,9 +4,8 @@ ...@@ -4,9 +4,8 @@
<uni-popup :class="popupClass" ref="publishPopup" :type="type" @change="change" :is-mask-click="isMaskClick" :safe-area="safeArea" :showClose="showClose"> <uni-popup :class="popupClass" ref="publishPopup" :type="type" @change="change" :is-mask-click="isMaskClick" :safe-area="safeArea" :showClose="showClose">
<!-- 顶部标题栏插槽 --> <!-- 顶部标题栏插槽 -->
<slot name="header"> <slot name="header">
<view class="popup-top-box flex justify-between align-center"> <view class="popup-top-box flex align-center">
<text></text> <text class="popup-top-box-title">{{ title }}</text>
<text>{{ title }}</text>
<uni-icons @click="closePopup" class="icon-close" type="closeempty"></uni-icons> <uni-icons @click="closePopup" class="icon-close" type="closeempty"></uni-icons>
</view> </view>
</slot> </slot>
...@@ -71,7 +70,13 @@ export default { ...@@ -71,7 +70,13 @@ export default {
font-size: toRpx(36); font-size: toRpx(36);
font-weight: 500; font-weight: 500;
text-align: center; text-align: center;
padding: toRpx(32) toRpx(52);
.popup-top-box-title {
flex: 1;
}
.icon-close {
text-align: end;
}
} }
.justify-between { .justify-between {
-webkit-box-pack: justify; -webkit-box-pack: justify;
......
let modalQueue = [], let modalQueue = [],
eventRequest = [] eventRequest = []
export default { export default {
data () { data() {
return { return {}
}
}, },
computed: { computed: {
userInfo () { userInfo() {
return uni.$storage.get('userInfo') || {} return uni.$storage.get('userInfo') || {}
} }
}, },
mounted () { mounted() {},
},
methods: { methods: {
async checkDailyReport () { async checkDailyReport() {
modalQueue = [] modalQueue = []
eventRequest = [] eventRequest = []
let { sceneType, isSuper, loginRole } = this.userInfo let { sceneType, isSuper, loginRole } = this.userInfo
...@@ -26,65 +24,60 @@ export default { ...@@ -26,65 +24,60 @@ export default {
} }
eventRequest.push(apiName[sceneType]()) eventRequest.push(apiName[sceneType]())
} }
return new Promise((resolve) => { return new Promise(resolve => {
Promise.all(eventRequest).then((results) => { Promise.all(eventRequest).then(results => {
results = results.slice(-2) results = results.slice(-2)
let resultFlag = results.some((item) => item); let resultFlag = results.some(item => item)
this.showNextModal() this.showNextModal()
resolve(resultFlag) resolve(resultFlag)
}) })
}) })
}, },
showNextModal () { showNextModal() {
if (modalQueue.length > 0) { if (modalQueue.length > 0) {
const modalInfo = modalQueue.pop(); const modalInfo = modalQueue.pop()
// if (wx.__HAS_SHOW_MODAL) return; // if (wx.__HAS_SHOW_MODAL) return;
// wx.__HAS_SHOW_MODAL = true; // wx.__HAS_SHOW_MODAL = true;
uni.showModal({ uni.showModal({
title: modalInfo.title, title: modalInfo.title,
content: modalInfo.content, content: modalInfo.content,
showCancel: modalInfo.showCancel, showCancel: modalInfo.showCancel,
cancelColor: "#292D33", cancelColor: '#292D33',
confirmText: modalInfo.confirmText, confirmText: modalInfo.confirmText,
confirmColor: "#347BFF", confirmColor: '#347BFF',
success: function (res) { success: function (res) {
// wx.__HAS_SHOW_MODAL = false; // wx.__HAS_SHOW_MODAL = false;
// if (res.cancel) _this.showNextModal(); // if (res.cancel) _this.showNextModal();
if (res.cancel) showNextModal(); if (res.cancel) showNextModal()
modalInfo.eventCallback(res); modalInfo.eventCallback(res)
}, }
}); })
} }
}, },
staffDailyReport () { staffDailyReport() {
let { userInfo } = this let { userInfo } = this
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
uni.$api.interceptionApi.staffDailyReportMerchantValid({ uni.$api.interceptionApi
.staffDailyReportMerchantValid({
merchantId: userInfo.shopMerchantId, merchantId: userInfo.shopMerchantId,
yqMerchantId: userInfo.merchantId, yqMerchantId: userInfo.merchantId,
staffUuid: userInfo.uuid, staffUuid: userInfo.uuid,
sceneType: 1, sceneType: 1
}) })
.then(data => { .then(data => {
if (data) { if (data) {
// 获取当前日期 // 获取当前日期
let currentDate = new Date(); let currentDate = new Date()
// 获取上一天的日期 // 获取上一天的日期
let previousDate = new Date(currentDate); let previousDate = new Date(currentDate)
previousDate.setDate(currentDate.getDate() - 1); previousDate.setDate(currentDate.getDate() - 1)
// toISOString 方法会丢失时区 导致与北京时间差八小时 // toISOString 方法会丢失时区 导致与北京时间差八小时
let hour = previousDate.getHours() + 8; let hour = previousDate.getHours() + 8
previousDate.setHours(hour); previousDate.setHours(hour)
// 格式化日期为"yyyy-mm-dd" // 格式化日期为"yyyy-mm-dd"
let formattedDate = previousDate.toISOString().split("T")[0]; let formattedDate = previousDate.toISOString().split('T')[0]
// if (wx.__HAS_NOTLOGIN_MODAL) return false; // // if (wx.__HAS_NOTLOGIN_MODAL) return false; //
this.addModalToQueue( this.addModalToQueue('日报提醒', '您有未填写的日报,请点击前往。', '前往填写', false, 2, res => {
"日报提醒",
"您有未填写的日报,请点击前往。",
"前往填写",
false,
2,
(res) => {
if (res.confirm) { if (res.confirm) {
uni.navigateTo({ uni.navigateTo({
url: `/pages/boutique/tool/index?componentName=DailyReport` url: `/pages/boutique/tool/index?componentName=DailyReport`
...@@ -93,87 +86,71 @@ export default { ...@@ -93,87 +86,71 @@ export default {
// reportDate: formattedDate, // reportDate: formattedDate,
// }); // });
} }
} })
); resolve(true)
resolve(true);
} else { } else {
resolve(false); resolve(false)
} }
}) })
.catch((err) => { .catch(err => {
resolve(); resolve()
}); })
}); })
}, },
clockedIntoWork () { clockedIntoWork() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
uni.$api.interceptionApi.clockInConfigPhone({}) uni.$api.interceptionApi
.then((res) => { .clockInConfigPhone({})
let { need, clockIn } = res; .then(res => {
let { need, clockIn } = res
// 已配置未打卡 // 已配置未打卡
if (need == 1 && clockIn == 0) { if (need == 1 && clockIn == 0) {
// 有配置并且没有打卡就提示 // 有配置并且没有打卡就提示
this.addModalToQueue( this.addModalToQueue('打卡提醒', '您当前企微未打卡,无法录单,请前往企微打卡后再试,如有异议请联系管理员。', '知道了', false, 4, res => {
"打卡提醒",
"您当前企微未打卡,无法录单,请前往企微打卡后再试,如有异议请联系管理员。",
"知道了",
false,
4,
(res) => {
if (res.confirm) { if (res.confirm) {
// wx.$router.go("tabWorkOrder.staffDaily", { // wx.$router.go("tabWorkOrder.staffDaily", {
// // reportDate: formattedDate, // // reportDate: formattedDate,
// }); // });
} }
} })
); resolve(true)
resolve(true);
} else { } else {
resolve(false); resolve(false)
} }
}) })
.catch((err) => { .catch(err => {
resolve(false); resolve(false)
}); })
}); })
},
equityStaffDailyReport () {
}, },
addModalToQueue ( equityStaffDailyReport() {},
title, addModalToQueue(title, content, confirmText, showCancel, priority, eventCallback) {
content, if (modalQueue.findIndex(val => val.content == content) < 0)
confirmText,
showCancel,
priority,
eventCallback
) {
if (modalQueue.findIndex((val) => val.content == content) < 0)
modalQueue.push({ modalQueue.push({
title, title,
content, content,
confirmText, confirmText,
showCancel, showCancel,
priority, priority,
eventCallback, eventCallback
}); })
modalQueue.sort((a, b) => a.priority - b.priority); modalQueue.sort((a, b) => a.priority - b.priority)
}, },
/** /**
* 查询当前员工处罚情况 * 查询当前员工处罚情况
*/ */
async inspectionOfProhibitionBill () { async inspectionOfProhibitionBill() {
const data = await uni.$api.interceptionApi.checkStaffStudyPunish() const data = await uni.$api.interceptionApi.checkStaffStudyPunish()
if (data) uni.showModal({ if (data)
uni.showModal({
title: '温馨提示', title: '温馨提示',
content: '未完成学习任务,禁止提单!\n请在平板电脑上展业助手-学习中心完成学习。', content: '未完成学习任务,禁止提单!\n请在平板电脑上展业助手-学习中心完成学习。',
showCancel: false, showCancel: false,
cancelColor: "#292D33", cancelColor: '#292D33',
confirmText: '确定', confirmText: '确定',
confirmColor: "#347BFF", confirmColor: '#347BFF'
}) })
return Promise.resolve(data) return Promise.resolve(data)
} }
}, }
} }
<!--工单信息卡片--> <!--工单信息卡片-->
<template> <template>
<view class="order-card" @click="() => jump(orderCardDetail.status == 3 ? 'confirmOrder' : orderCardDetail.status == 1 ? 'createOrder' : 'orderDetail', orderCardDetail)"> <view class="order-card" @click="() => jumpClick(orderCardDetail.status == 3 ? 'ConfirmOrder' : orderCardDetail.status == 1 ? 'CreateOrder' : 'OrderDetail', orderCardDetail)">
<view class="order-card-top-box flex justify-between"> <view class="order-card-top-box flex justify-between">
<text>{{ orderCardDetail.customer.customerName }}</text> <text>{{ orderCardDetail.customer.customerName }}</text>
<view class="status text-center" :style="{ color: orderCardDetail.statuscolor, 'background-color': orderCardDetail.statusbackground }"> <view class="status text-center" :style="{ color: orderCardDetail.statuscolor, 'background-color': orderCardDetail.statusbackground }">
...@@ -88,6 +88,34 @@ ...@@ -88,6 +88,34 @@
<view class="staff-label">施工技师</view> <view class="staff-label">施工技师</view>
<view class="staff-value">111</view> <view class="staff-value">111</view>
</view> </view>
<PublishPopup ref="recordOrderPopup" popupClass="recordOrderPopup" type="center" :showClose="true" title="请选择录单入口">
<template #content>
<view class="modatcontent">
<view class="modalbox com" :class="selectType == 1 ? 'act' : ''" @click.stop="changeType(1)">
<view class="sprite-icon icon-create-order"></view>
新增工单
</view>
<view class="modalbox cancle" :class="selectType == 2 ? 'act' : ''" @click.stop="changeType(2)">
<view class="sprite-icon icon-defeat-order"></view>
战败下单
</view>
<view v-if="isSettingExpiredTraffic && !isScan" class="modalbox cancle" :class="selectType == 3 ? 'act' : ''" @click.stop="changeType(3)">
<view class="sprite-icon icon-expiration"></view>
失效客户
</view>
<view class="modalbox cancle" :class="selectType == 4 ? 'act' : ''" @click.stop="changeType(4)">
<view class="sprite-icon icon-revoke"></view>
撤销工单
</view>
</view>
</template>
<template #footer>
<view class="footer-box flex justify-center">
<view class="cancle-btn btn" @click.stop="cancelSelection">取消</view>
<view class="sure-btn btn" @click.stop="confirmSelection">确认</view>
</view>
</template>
</PublishPopup>
</view> </view>
</template> </template>
<script> <script>
...@@ -95,6 +123,7 @@ import order_mixins from '../order_mixins.js' ...@@ -95,6 +123,7 @@ import order_mixins from '../order_mixins.js'
import { interceptionMixin } from '@/mixin/index' 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'
export default { export default {
mixins: [interceptionMixin], mixins: [interceptionMixin],
name: 'OrderCard', name: 'OrderCard',
...@@ -104,6 +133,9 @@ export default { ...@@ -104,6 +133,9 @@ export default {
default: () => ({}) default: () => ({})
} }
}, },
components: {
PublishPopup
},
data() { data() {
return { return {
...order_mixins.data, ...order_mixins.data,
...@@ -160,7 +192,7 @@ export default { ...@@ -160,7 +192,7 @@ export default {
flag: !this.orderCardDetail.showAllGoodsListFlag flag: !this.orderCardDetail.showAllGoodsListFlag
}) })
}, },
async jump(name, item) { async jumpClick(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:未失效)
...@@ -179,21 +211,21 @@ export default { ...@@ -179,21 +211,21 @@ export default {
userInfo.isMake = !(userInfo?.isSuper || userInfo?.loginRole == 3 || userInfo?.loginRole == 5 || userInfo?.loginRole == 6 || userInfo?.loginRole == 7) userInfo.isMake = !(userInfo?.isSuper || userInfo?.loginRole == 3 || userInfo?.loginRole == 5 || userInfo?.loginRole == 6 || userInfo?.loginRole == 7)
let { userType, isSuper, merchantType, isMake } = userInfo let { userType, isSuper, merchantType, isMake } = userInfo
console.log(item) console.log(item)
if (name == 'createOrder' || name == 'premiumUpgrade') { if (name == 'CreateOrder' || name == 'PremiumUpgrade') {
if (merchantType && !isSuper && isMake) { if (merchantType && !isSuper && isMake) {
// 校验是否填写昨日日报 // 校验是否填写昨日日报
let staffCheck = await checkDailyReport() let staffCheck = await checkDailyReport()
if (staffCheck) return false if (staffCheck) return false
if (name == 'createOrder' && (await this.inspectionOfProhibitionBill())) return /**禁止提单 */ if (name == 'CreateOrder' && (await this.inspectionOfProhibitionBill())) return /**禁止提单 */
// 是微信支付直接跳转确认页面 // 是微信支付直接跳转确认页面
if (userType == 2 && item?.selectPayType == 1) { if (userType == 2 && item?.selectPayType == 1) {
wx.$router.go('tabWorkOrder.confirmOrder', item) this.$emit('jump', 'ConfirmOrder')
} else if (userType == 2) { } else if (userType == 2) {
item item
? this.showSelectType({ ? this.showSelectType({
item item
}) })
: wx.$router.go('tabWorkOrder.' + name, item) : this.$emit('jump', name)
} else { } else {
utils.showNoAccess() utils.showNoAccess()
} }
...@@ -202,9 +234,10 @@ export default { ...@@ -202,9 +234,10 @@ export default {
} }
// 已支付加已施工 // 已支付加已施工
} else if (item.constructionFlag == 'Y' && item.status != 10) { } else if (item.constructionFlag == 'Y' && item.status != 10) {
wx.$router.go('tabWorkOrder.constructionOrderDetail', item) // wx.$router.go('tabWorkOrder.constructionOrderDetail', item)
// this.$emit('jump', name, item)
} else { } else {
wx.$router.go('tabWorkOrder.' + name, item) this.$emit('jump', name)
} }
}, },
// 确定是否要显示 // 确定是否要显示
...@@ -214,29 +247,32 @@ export default { ...@@ -214,29 +247,32 @@ export default {
if ((!this.isSettingExpiredTraffic || scan) && this.selectType == 3) { if ((!this.isSettingExpiredTraffic || scan) && this.selectType == 3) {
this.selectType = 1 this.selectType = 1
} }
uni.showModal({
show: true, this.$refs.recordOrderPopup.open()
title: '请选择录单入口',
tabTitleShow: false, // this.uni.showModal({
success: async res => { // show: true,
// 跳转新增订单页面 并带特定参数 // title: '请选择录单入口',
console.log(item, 'showSelectType') // tabTitleShow: false,
if (this.selectType == 1) { // success: async res => {
if (await this.inspectionOfProhibitionBill()) return // // 跳转新增订单页面 并带特定参数
wx.$router.go('tabWorkOrder.createOrder', { // console.log(item, 'showSelectType')
scene, // if (this.selectType == 1) {
...item // if (await this.inspectionOfProhibitionBill()) return
}) // wx.$router.go('tabWorkOrder.createOrder', {
} else { // scene,
wx.$router.go('tabWorkOrder.defeatOrder', { // ...item
scene, // })
...item, // } else {
isExpiredTraffic: this.selectType == 3 // wx.$router.go('tabWorkOrder.defeatOrder', {
}) // scene,
} // ...item,
}, // isExpiredTraffic: this.selectType == 3
error: () => {} // })
}) // }
// },
// error: () => {}
// })
}, },
// 获取轻改录单配置是否启用流量失效 // 获取轻改录单配置是否启用流量失效
...@@ -248,11 +284,99 @@ export default { ...@@ -248,11 +284,99 @@ export default {
this.isSettingExpiredTraffic = res?.data?.trafficExpireFlag == 'Y' this.isSettingExpiredTraffic = res?.data?.trafficExpireFlag == 'Y'
}) })
} }
},
changeType(type) {
this.selectType = type
},
async confirmSelection() {
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')
} else {
this.$emit('jump', 'DefeatOrder')
}
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
// Popup样式
::v-deep .recordOrderPopup .uni-popup__wrapper {
position: relative;
border-radius: toRpx(32);
opacity: 1;
width: toRpx(848);
height: toRpx(968);
background: linear-gradient(180deg, #e6f0ff 0%, #ffffff 100%);
.popup-top-box {
text-align: left;
padding: toRpx(48) toRpx(64);
&-title {
color: #1a1a1a;
font-size: toRpx(40);
font-weight: 500;
}
.icon-close {
font-size: toRpx(40) !important;
color: rgba(26, 26, 26, 0.6) !important;
}
}
.modatcontent {
box-sizing: border-box;
padding: 0 toRpx(64);
.modalbox {
display: flex;
align-items: center;
box-sizing: border-box;
border-radius: toRpx(16);
background: #f7f8fa;
height: toRpx(136);
border-radius: toRpx(8);
margin: 0 auto;
color: #292d33;
font-size: toRpx(28);
font-weight: 500;
& + .modalbox {
margin-top: toRpx(16);
}
}
.act {
border: toRpx(2) solid #347bff;
background: #347bff1a;
}
}
.footer-box {
width: 100%;
height: toRpx(164);
background-color: #fff;
position: absolute;
bottom: 0;
.btn {
width: 40%;
height: toRpx(80);
border-radius: toRpx(48);
opacity: 1;
line-height: toRpx(80);
text-align: center;
color: rgba(26, 26, 26, 0.6);
font-size: toRpx(32);
font-weight: 500;
}
.cancle-btn {
background: #f0f1f5;
}
.sure-btn {
color: #fff;
background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
margin-left: toRpx(32);
}
}
}
.order-card { .order-card {
padding: toRpx(36) toRpx(32); padding: toRpx(36) toRpx(32);
border-radius: toRpx(24); border-radius: toRpx(24);
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
</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"></OrderCard> <OrderCard v-for="(item, index) in dataList" :key="index" :orderCardDetail="item" @toggle-goods-list="handleToggleGoodsList" @jump="jump"></OrderCard>
</z-paging> </z-paging>
<PublishPopup ref="WaitinputorderPopup" popupClass="waitinputorderPopup" :showClose="true" title="选择交易参考号"> <PublishPopup ref="WaitinputorderPopup" popupClass="waitinputorderPopup" :showClose="true" title="选择交易参考号">
...@@ -443,6 +443,9 @@ export default { ...@@ -443,6 +443,9 @@ export default {
cancelSelection() { cancelSelection() {
this.checkListObj = {} this.checkListObj = {}
this.$refs.WaitinputorderPopup.closePopup() this.$refs.WaitinputorderPopup.closePopup()
},
jump(name, val) {
this.$emit('jump', name, val)
} }
} }
} }
...@@ -692,6 +695,9 @@ export default { ...@@ -692,6 +695,9 @@ export default {
width: 100%; width: 100%;
height: 67vh; height: 67vh;
background-color: #fff !important; background-color: #fff !important;
.popup-top-box {
padding: toRpx(32) toRpx(52);
}
} }
::v-deep .abnormalTipsPopup .uni-popup__wrapper { ::v-deep .abnormalTipsPopup .uni-popup__wrapper {
border-radius: toRpx(32) toRpx(32) 0 0; border-radius: toRpx(32) toRpx(32) 0 0;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!