Commit 41c4220d by cen

feat: 工单确认

1 parent 62287744

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
<!--工单信息卡片-->
<template>
<view class="order-card">
<view class="order-card" @click="() => jump(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 }">
......@@ -92,6 +92,7 @@
</template>
<script>
import order_mixins from '../order_mixins.js'
import utils from '@/utils/utils'
export default {
name: 'OrderCard',
props: {
......@@ -153,20 +154,50 @@ export default {
item: this.orderCardDetail,
flag: !this.orderCardDetail.showAllGoodsListFlag
})
},
jump(name, item) {
// 订单状态 1 待跟进, 2 不升级, 3 待支付,4 已支付,6 已评价 ,9 已撤销 , 10 已关闭 , 11 已失效
// constructionFlag 施工标识(Y:已施工;N||null:未施工)
// failureFlag 订单失效状态(Y:已失效,N:未失效)
// console.log(e.currentTarget.dataset)
// return
const userInfo = uni.$storage.get('userInfo')
if (userInfo.merchantAccountList && userInfo.merchantAccountList.length) {
try {
userInfo.merchantAccountList.map(e => {
if (e == 6 || e == 8) throw true
})
} catch (error) {
userInfo.merchantType = error
}
}
let { userType, isSuper, merchantType } = userInfo
console.log(item)
if (name == 'createOrder') {
if (merchantType && !isSuper) {
// 是微信支付直接跳转确认页面
if (userType == 2 && item?.selectPayType == 1) {
wx.$router.go('confirmOrder', item)
} else if (userType == 2) {
wx.$router.go(name, item)
} else {
utils.showNoAccess()
}
} else {
utils.showNoAccess()
}
// 已支付加已施工
} else if (item.constructionFlag == 'Y' && item.status != 10) {
wx.$router.go('constructionOrderDetail', item)
} else {
// console.log(item)
wx.$router.go(name, item)
}
}
}
}
</script>
<style lang="scss" scoped>
.flex {
display: flex;
}
.justify-between {
justify-content: space-between;
}
.align-center {
align-items: center;
}
.order-card {
padding: toRpx(36) toRpx(32);
border-radius: toRpx(24);
......
......@@ -175,7 +175,6 @@ export default {
keyword: '',
searchObj: {},
dataList: [],
userInfo: JSON.parse(getApp().globalData.userInfo),
waitInputCount: 0, // 添加待补录计数
waitOrderTimer: null, // 定时器引用
tipsProps: {
......@@ -190,11 +189,13 @@ export default {
normalCurrentPage: 1,
abnormalPages: 1,
normalPages: 1,
userInfo: null,
checkListObj: {},
...order_mixins.data
}
},
mounted() {
this.userInfo = uni.$storage.get('userInfo') || {}
this.search()
this.startWaitOrderPolling()
},
......@@ -203,7 +204,7 @@ export default {
},
methods: {
search() {
// 判断是不是超管 && !userInfo.isSuper
// 判断是不是超管 && !this.userInfo.isSuper
// ,不是只能筛选当前4s店的
if (!this.searchObj.merchantId) {
this.searchObj.merchantId = this.userInfo?.shopMerchantId
......@@ -213,7 +214,9 @@ export default {
},
async waitinputorderClick() {
if (await this.inspectionOfProhibitionBill()) return
this.getTransactionSerialNumber()
if (!this.normalOrderNoList.length && !this.abnormalOrderNoList.length) {
this.getTransactionSerialNumber()
}
this.$refs.WaitinputorderPopup.open()
},
handleToggleGoodsList(data) {
......@@ -309,7 +312,7 @@ export default {
// let userType = true
list.map(e => {
if (e.orderTime) e.orderTime = dayjs(new Date(e.orderTime)).format('yyyy-MM-dd hh:mm:ss')
if (e.orderTime) e.orderTime = dayjs(new Date(e.orderTime)).format('YYYY-MM-DD HH:mm:ss')
e.subOrderList.map(i => {
i.totalPrice = Number(utils.decimal(i.totalPrice, 2)).toFixed(2)
})
......@@ -319,7 +322,7 @@ export default {
e.invoiceName = e.invoiceStatus == 2 ? '查看发票' : '申请开票'
// && e.status != 1 待跟进现在也能撤销
let orderType = (this.userInfo.userType == 1 || this.userInfo.userType == 2) && e.status != 9 && ![1, 3, 4].includes(e.selectPayType)
// let orderType = userInfo.userType !== 1 && e.status != 9 && e.status != 1 && e.selectPayType != 3 && e.selectPayType != 1
// let orderType = this.userInfo.userType !== 1 && e.status != 9 && e.status != 1 && e.selectPayType != 3 && e.selectPayType != 1
// console.log(userType);
// console.log(orderType);
e.repeal = userType && orderType
......
......@@ -231,6 +231,13 @@ const setPrice = price => {
if (!decimal) decimal = '00'
return (num || 0).toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + `.${decimal}`
}
const showNoAccess = () => {
// wx.showToast('您的账号无法完成此操作')
uni.showToast({
title: '您的账号无法完成此操作',
icon: 'error'
})
}
export default {
compareVersions,
convertDateTimeFormat,
......@@ -247,5 +254,6 @@ export default {
calcAdd,
getViewInfo,
setPrice,
decimal
decimal,
showNoAccess
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!