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 @@
<uni-popup :class="popupClass" ref="publishPopup" :type="type" @change="change" :is-mask-click="isMaskClick" :safe-area="safeArea" :showClose="showClose">
<!-- 顶部标题栏插槽 -->
<slot name="header">
<view class="popup-top-box flex justify-between align-center">
<text></text>
<text>{{ title }}</text>
<view class="popup-top-box flex align-center">
<text class="popup-top-box-title">{{ title }}</text>
<uni-icons @click="closePopup" class="icon-close" type="closeempty"></uni-icons>
</view>
</slot>
......@@ -71,7 +70,13 @@ export default {
font-size: toRpx(36);
font-weight: 500;
text-align: center;
padding: toRpx(32) toRpx(52);
.popup-top-box-title {
flex: 1;
}
.icon-close {
text-align: end;
}
}
.justify-between {
-webkit-box-pack: justify;
......
let modalQueue = [],
eventRequest = []
export default {
data () {
return {
}
data() {
return {}
},
computed: {
userInfo () {
userInfo() {
return uni.$storage.get('userInfo') || {}
}
},
mounted () {
},
mounted() {},
methods: {
async checkDailyReport () {
async checkDailyReport() {
modalQueue = []
eventRequest = []
let { sceneType, isSuper, loginRole } = this.userInfo
......@@ -26,154 +24,133 @@ export default {
}
eventRequest.push(apiName[sceneType]())
}
return new Promise((resolve) => {
Promise.all(eventRequest).then((results) => {
return new Promise(resolve => {
Promise.all(eventRequest).then(results => {
results = results.slice(-2)
let resultFlag = results.some((item) => item);
let resultFlag = results.some(item => item)
this.showNextModal()
resolve(resultFlag)
})
})
},
showNextModal () {
showNextModal() {
if (modalQueue.length > 0) {
const modalInfo = modalQueue.pop();
const modalInfo = modalQueue.pop()
// if (wx.__HAS_SHOW_MODAL) return;
// wx.__HAS_SHOW_MODAL = true;
uni.showModal({
title: modalInfo.title,
content: modalInfo.content,
showCancel: modalInfo.showCancel,
cancelColor: "#292D33",
cancelColor: '#292D33',
confirmText: modalInfo.confirmText,
confirmColor: "#347BFF",
confirmColor: '#347BFF',
success: function (res) {
// wx.__HAS_SHOW_MODAL = false;
// if (res.cancel) _this.showNextModal();
if (res.cancel) showNextModal();
modalInfo.eventCallback(res);
},
});
if (res.cancel) showNextModal()
modalInfo.eventCallback(res)
}
})
}
},
staffDailyReport () {
staffDailyReport() {
let { userInfo } = this
return new Promise((resolve, reject) => {
uni.$api.interceptionApi.staffDailyReportMerchantValid({
merchantId: userInfo.shopMerchantId,
yqMerchantId: userInfo.merchantId,
staffUuid: userInfo.uuid,
sceneType: 1,
})
uni.$api.interceptionApi
.staffDailyReportMerchantValid({
merchantId: userInfo.shopMerchantId,
yqMerchantId: userInfo.merchantId,
staffUuid: userInfo.uuid,
sceneType: 1
})
.then(data => {
if (data) {
// 获取当前日期
let currentDate = new Date();
let currentDate = new Date()
// 获取上一天的日期
let previousDate = new Date(currentDate);
previousDate.setDate(currentDate.getDate() - 1);
let previousDate = new Date(currentDate)
previousDate.setDate(currentDate.getDate() - 1)
// toISOString 方法会丢失时区 导致与北京时间差八小时
let hour = previousDate.getHours() + 8;
previousDate.setHours(hour);
let hour = previousDate.getHours() + 8
previousDate.setHours(hour)
// 格式化日期为"yyyy-mm-dd"
let formattedDate = previousDate.toISOString().split("T")[0];
let formattedDate = previousDate.toISOString().split('T')[0]
// if (wx.__HAS_NOTLOGIN_MODAL) return false; //
this.addModalToQueue(
"日报提醒",
"您有未填写的日报,请点击前往。",
"前往填写",
false,
2,
(res) => {
if (res.confirm) {
uni.navigateTo({
url: `/pages/boutique/tool/index?componentName=DailyReport`
})
// wx.$router.go("tabWorkOrder.upgradeStaffDaily", {
// reportDate: formattedDate,
// });
}
this.addModalToQueue('日报提醒', '您有未填写的日报,请点击前往。', '前往填写', false, 2, res => {
if (res.confirm) {
uni.navigateTo({
url: `/pages/boutique/tool/index?componentName=DailyReport`
})
// wx.$router.go("tabWorkOrder.upgradeStaffDaily", {
// reportDate: formattedDate,
// });
}
);
resolve(true);
})
resolve(true)
} else {
resolve(false);
resolve(false)
}
})
.catch((err) => {
resolve();
});
});
.catch(err => {
resolve()
})
})
},
clockedIntoWork () {
clockedIntoWork() {
return new Promise((resolve, reject) => {
uni.$api.interceptionApi.clockInConfigPhone({})
.then((res) => {
let { need, clockIn } = res;
uni.$api.interceptionApi
.clockInConfigPhone({})
.then(res => {
let { need, clockIn } = res
// 已配置未打卡
if (need == 1 && clockIn == 0) {
// 有配置并且没有打卡就提示
this.addModalToQueue(
"打卡提醒",
"您当前企微未打卡,无法录单,请前往企微打卡后再试,如有异议请联系管理员。",
"知道了",
false,
4,
(res) => {
if (res.confirm) {
// wx.$router.go("tabWorkOrder.staffDaily", {
// // reportDate: formattedDate,
// });
}
this.addModalToQueue('打卡提醒', '您当前企微未打卡,无法录单,请前往企微打卡后再试,如有异议请联系管理员。', '知道了', false, 4, res => {
if (res.confirm) {
// wx.$router.go("tabWorkOrder.staffDaily", {
// // reportDate: formattedDate,
// });
}
);
resolve(true);
})
resolve(true)
} else {
resolve(false);
resolve(false)
}
})
.catch((err) => {
resolve(false);
});
});
},
equityStaffDailyReport () {
.catch(err => {
resolve(false)
})
})
},
addModalToQueue (
title,
content,
confirmText,
showCancel,
priority,
eventCallback
) {
if (modalQueue.findIndex((val) => val.content == content) < 0)
equityStaffDailyReport() {},
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);
eventCallback
})
modalQueue.sort((a, b) => a.priority - b.priority)
},
/**
* 查询当前员工处罚情况
*/
async inspectionOfProhibitionBill () {
* 查询当前员工处罚情况
*/
async inspectionOfProhibitionBill() {
const data = await uni.$api.interceptionApi.checkStaffStudyPunish()
if (data) uni.showModal({
title: '温馨提示',
content: '未完成学习任务,禁止提单!\n请在平板电脑上展业助手-学习中心完成学习。',
showCancel: false,
cancelColor: "#292D33",
confirmText: '确定',
confirmColor: "#347BFF",
})
if (data)
uni.showModal({
title: '温馨提示',
content: '未完成学习任务,禁止提单!\n请在平板电脑上展业助手-学习中心完成学习。',
showCancel: false,
cancelColor: '#292D33',
confirmText: '确定',
confirmColor: '#347BFF'
})
return Promise.resolve(data)
}
},
}
\ No newline at end of file
}
}
<!--工单信息卡片-->
<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">
<text>{{ orderCardDetail.customer.customerName }}</text>
<view class="status text-center" :style="{ color: orderCardDetail.statuscolor, 'background-color': orderCardDetail.statusbackground }">
......@@ -88,6 +88,34 @@
<view class="staff-label">施工技师</view>
<view class="staff-value">111</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>
</template>
<script>
......@@ -95,6 +123,7 @@ import order_mixins from '../order_mixins.js'
import { interceptionMixin } from '@/mixin/index'
import utils from '@/utils/utils'
import { checkDailyReport, showNextModal } from '@/utils/modalUtils'
import PublishPopup from '@/components/PublishPopup.vue'
export default {
mixins: [interceptionMixin],
name: 'OrderCard',
......@@ -104,6 +133,9 @@ export default {
default: () => ({})
}
},
components: {
PublishPopup
},
data() {
return {
...order_mixins.data,
......@@ -160,7 +192,7 @@ export default {
flag: !this.orderCardDetail.showAllGoodsListFlag
})
},
async jump(name, item) {
async jumpClick(name, item) {
// 订单状态 1 待跟进, 2 不升级, 3 待支付,4 已支付,6 已评价 ,9 已撤销 , 10 已关闭 , 11 已失效
// constructionFlag 施工标识(Y:已施工;N||null:未施工)
// failureFlag 订单失效状态(Y:已失效,N:未失效)
......@@ -179,21 +211,21 @@ export default {
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)
if (name == 'createOrder' || name == 'premiumUpgrade') {
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 (name == 'CreateOrder' && (await this.inspectionOfProhibitionBill())) return /**禁止提单 */
// 是微信支付直接跳转确认页面
if (userType == 2 && item?.selectPayType == 1) {
wx.$router.go('tabWorkOrder.confirmOrder', item)
this.$emit('jump', 'ConfirmOrder')
} else if (userType == 2) {
item
? this.showSelectType({
item
})
: wx.$router.go('tabWorkOrder.' + name, item)
: this.$emit('jump', name)
} else {
utils.showNoAccess()
}
......@@ -202,9 +234,10 @@ export default {
}
// 已支付加已施工
} 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 {
wx.$router.go('tabWorkOrder.' + name, item)
this.$emit('jump', name)
}
},
// 确定是否要显示
......@@ -214,29 +247,32 @@ export default {
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: () => {}
})
this.$refs.recordOrderPopup.open()
// this.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: () => {}
// })
},
// 获取轻改录单配置是否启用流量失效
......@@ -248,11 +284,99 @@ export default {
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>
<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 {
padding: toRpx(36) toRpx(32);
border-radius: toRpx(24);
......
......@@ -19,7 +19,7 @@
</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">
<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>
<PublishPopup ref="WaitinputorderPopup" popupClass="waitinputorderPopup" :showClose="true" title="选择交易参考号">
......@@ -443,6 +443,9 @@ export default {
cancelSelection() {
this.checkListObj = {}
this.$refs.WaitinputorderPopup.closePopup()
},
jump(name, val) {
this.$emit('jump', name, val)
}
}
}
......@@ -692,6 +695,9 @@ export default {
width: 100%;
height: 67vh;
background-color: #fff !important;
.popup-top-box {
padding: toRpx(32) toRpx(52);
}
}
::v-deep .abnormalTipsPopup .uni-popup__wrapper {
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!