Commit f62f1224 by cen

feat: 添加异常订单处理功能及相关组件

- 更新 env.js 中的 IP 地址和默认环境索引
- 新增 ErrorOrderPopup 组件用于展示异常订单信息
- 添加 ErrorOrderList 组件以支持异常订单的选择和状态管理
- 在 OrderScreen 和 OrderScreenContract 中集成异常订单列表
- 更新相关样式以改善用户体验
- 在 mixin 中添加获取异常订单锁单信息的逻辑
- 修改订单相关逻辑以支持异常订单的处理
1 parent df03b5e1
......@@ -602,4 +602,12 @@ module.exports = {
...data,
})
},
// 异常订单锁单信息查询
getAbnormalOrderLock(data = {}) {
return http.post({
method: 'dj.api.smartcarlife.goodsOrder.abnormalOrder.lock.select',
projectName: 'boutique',
...data
})
},
}

3 MB | W: | H:

3 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 v-if="show" class="error-order-popup-mask" @click="handleMaskClick">
<view
class="error-order-popup-content"
:style="contentStyle"
@click.stop
>
<!-- 顶部图片 -->
<image
v-if="topImage"
class="top-image"
:src="topImage"
:style="topImageStyle"
/>
<view v-if="closeButton" @click.stop="closePopup">
<view class="sprite-icon icon-evaluationClose"></view>
</view>
<!-- 标题 -->
<view v-if="title" class="popup-title">{{ title }}</view>
<!-- 内容区域 - 默认插槽 -->
<view class="popup-body">
<slot></slot>
</view>
<!-- 底部按钮插槽 -->
<slot name="footer"></slot>
</view>
</view>
</template>
<script>
export default {
name: 'ErrorOrderPopup',
props: {
show: {
type: Boolean,
default: false
},
width: {
type: [Number, String],
default: 848
},
height: {
type: [Number, String],
default: 1054
},
title: {
type: String,
default: ''
},
topImage: {
type: String,
default: ''
},
topImageWidth: {
type: [Number, String],
default: 848
},
topImageHeight: {
type: [Number, String],
default: 248
},
maskClosable: {
type: Boolean,
default: false
},
closeButton: {
type: Boolean,
default: false
}
},
computed: {
contentStyle() {
return {
width: this.formatSize(this.width),
minHeight: this.formatSize(this.height)
}
},
topImageStyle() {
return {
width: this.formatSize(this.topImageWidth),
height: this.formatSize(this.topImageHeight)
}
}
},
methods: {
formatSize(size) {
return typeof size === 'number' ? `${size}rpx` : size
},
handleMaskClick() {
if (this.maskClosable) {
this.close()
}
},
close() {
this.$emit('update:show', false)
this.$emit('close')
},
closePopup() {
this.close()
}
}
}
</script>
<style lang="scss" scoped>
.error-order-popup-mask {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
display: flex;
justify-content: center;
align-items: center;
z-index: 9999;
}
.error-order-popup-content {
background: #FFFFFF;
border-radius: toRpx(48);
display: flex;
flex-direction: column;
align-items: center;
position: relative;
max-height: toRpx(740);
overflow-y: auto;
}
.sprite-icon {
top: toRpx(48);
right: toRpx(48);
position: absolute;
}
.top-image {
width: 100%;
display: block;
margin-bottom: toRpx(48);
flex-shrink: 0;
border-radius: toRpx(20) toRpx(20) 0 0;
}
.popup-title {
font-size: toRpx(40);
font-weight: 500;
letter-spacing: 0;
line-height: toRpx(46.88);
color: rgba(51, 51, 51, 1);
text-align: center;
margin-bottom: toRpx(48);
padding: 0 toRpx(32);
}
.popup-body {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
padding: 0 toRpx(32);
}
</style>
\ No newline at end of file
<template>
<view class="list">
<view
@click="currentId = ''"
:class="['item flex',{active:!currentId}]"
>
<view class="sprite-icon icon-tag-checked"></view>
全部
</view>
<template v-for="(i, index) in list">
<view
:key="index"
@click="currentId = i.value"
:class="['item flex',{active:currentId == i.value}]"
>
<view class="sprite-icon icon-tag-checked"></view>
{{i.name}}
</view>
</template>
</view>
</template>
<script type='text/ecmascript-6'>
const errorOrderList = [{
name: '无异常',
value: "N"
},
{
name: '异常',
value: 'Y'
}
]
export default {
name: 'PayList',
inject: ['userInfo'],
data () {
return {
list: [],
currentId: '',
}
},
props: {
params: Object,
data: [Object, Array],
},
watch: {
currentId: {
handler (value) {
let { params: { idKey } } = this
this.$emit('choose', {
key: idKey,
value
})
},
deep: true
}
},
mounted () {
this.getList()
},
methods: {
async getList () {
const { userInfo, params } = this,
{ cacheData } = params
if (cacheData && cacheData.length) {
this.initList(cacheData)
return
}
this.initList(errorOrderList)
params.cacheData = errorOrderList
this.$emit('update:params', params)
},
initList (list) {
this.list = list
let { data, params: { idKey } } = this
this.currentId = data[idKey]
this.$emit('onComplete')
},
}
}
</script>
<style scoped lang='scss'>
.list {
display: grid;
grid-template-columns: repeat(6, 1fr);
gap: toRpx(32);
margin: 0 toRpx(48);
.item {
justify-content: center;
height: toRpx(72);
border-radius: toRpx(8);
border: toRpx(2) solid #dce0e6;
box-sizing: border-box;
position: relative;
color: #333333;
font-size: toRpx(32);
.sprite-icon {
display: none;
position: absolute;
top: 0;
right: 0;
}
}
.splice {
color: #333333;
font-size: toRpx(32);
margin: 0 toRpx(8);
}
.active {
border-color: #2c66f7;
background: #ecf1ff;
color: #2c66f7;
.sprite-icon {
display: block;
}
}
}
</style>
\ No newline at end of file
......@@ -56,7 +56,7 @@ export default {
id: 7
},
{
name: '已失效',
name: '错误订单',
value: [11],
id: 8
},
......
......@@ -46,9 +46,9 @@ const screenList = [
},
{
title: '异常标记',
componentName: 'OrderStatusList',
componentName: 'ErrorOrderList',
params: {
idKey: 'statusList'
idKey: 'abnormalFlag'
}
},
{
......
......@@ -73,6 +73,7 @@ import TimeList from './components/TimeList.vue'
import OrderStatusList from './components/OrderStatusList.vue'
import PayList from './components/PayList.vue'
import CourseOptionList from './components/CourseOptionList.vue'
import ErrorOrderList from './components/ErrorOrderList.vue'
export default {
components: {
Popup,
......@@ -80,7 +81,8 @@ export default {
TimeList,
OrderStatusList,
PayList,
CourseOptionList
CourseOptionList,
ErrorOrderList
},
name: 'OrderScreen',
props: {
......
<template>
<view class="list">
<view
@click="currentId = ''"
:class="['item flex',{active:!currentId}]"
>
<view class="sprite-icon icon-tag-checked"></view>
全部
</view>
<template v-for="(i, index) in list">
<view
:key="index"
@click="currentId = i.value"
:class="['item flex',{active:currentId == i.value}]"
>
<view class="sprite-icon icon-tag-checked"></view>
{{i.name}}
</view>
</template>
</view>
</template>
<script type='text/ecmascript-6'>
const errorOrderList = [{
name: '无异常',
value: "N"
},
{
name: '异常',
value: 'Y'
}
]
export default {
name: 'PayList',
inject: ['userInfo'],
data () {
return {
list: [],
currentId: '',
}
},
props: {
params: Object,
data: [Object, Array],
},
watch: {
currentId: {
handler (value) {
let { params: { idKey } } = this
this.$emit('choose', {
key: idKey,
value
})
},
deep: true
}
},
mounted () {
this.getList()
},
methods: {
async getList () {
const { userInfo, params } = this,
{ cacheData } = params
if (cacheData && cacheData.length) {
this.initList(cacheData)
return
}
this.initList(errorOrderList)
params.cacheData = errorOrderList
this.$emit('update:params', params)
},
initList (list) {
this.list = list
let { data, params: { idKey } } = this
this.currentId = data[idKey]
this.$emit('onComplete')
},
}
}
</script>
<style scoped lang='scss'>
.list {
display: grid;
grid-template-columns: repeat(6, 1fr);
gap: toRpx(32);
margin: 0 toRpx(48);
.item {
justify-content: center;
height: toRpx(72);
border-radius: toRpx(8);
border: toRpx(2) solid #dce0e6;
box-sizing: border-box;
position: relative;
color: #333333;
font-size: toRpx(32);
.sprite-icon {
display: none;
position: absolute;
top: 0;
right: 0;
}
}
.splice {
color: #333333;
font-size: toRpx(32);
margin: 0 toRpx(8);
}
.active {
border-color: #2c66f7;
background: #ecf1ff;
color: #2c66f7;
.sprite-icon {
display: block;
}
}
}
</style>
\ No newline at end of file
......@@ -65,7 +65,12 @@ export default {
name: '战败',
value: -1,
id: 11
}
},
{
name: '审批中',
value: [14],
id: 12
},
]),
currentId: '',
}
......
......@@ -45,6 +45,13 @@ const screenList = [
}
},
{
title: '异常标记',
componentName: 'ErrorOrderList',
params: {
idKey: 'abnormalFlag'
}
},
{
title: '支付方式',
componentName: 'PayList',
params: {
......
......@@ -37,6 +37,7 @@ import OrderStatusList from './components/OrderStatusList.vue'
import PayList from './components/PayList.vue'
import CourseOptionList from './components/CourseOptionList.vue'
import ContractList from './components/ContractList.vue'
import ErrorOrderList from './components/ErrorOrderList.vue'
export default {
components: {
Popup,
......@@ -45,7 +46,8 @@ export default {
OrderStatusList,
PayList,
CourseOptionList,
ContractList
ContractList,
ErrorOrderList
},
name: 'OrderScreen',
props: {
......
const target = ['ip', 'dev', 'uat', 'prod', 'beta']
const index = 0
const index = 1
/**
*
0本地
......@@ -50,7 +50,7 @@ const domain = {
const djDomain = {
// ip: 'http://dj.dev.glsx.com.cn',
ip: 'http://192.168.1.76:8292',
ip: 'http://192.168.1.122:8292',
dev: 'http://dj.dev.glsx.com.cn',
beta: 'https://dj.beta.glsx.com.cn', //预发布 appid: wx9f91c1ec493eb425
uat: 'https://dj.test.glsx.com.cn', //测试 appid: wxe10067a63c1856ac
......
......@@ -256,5 +256,12 @@ export default {
console.log(data, '限制录单')
return Promise.resolve(data)
},
async getAbnormalOrderLock () {
const data = await uni.$api.commonApi.getAbnormalOrderLock()
if (data)
console.log(data, '异常订单锁单信息')
const isLock = data.lockOrderFlag == "Y" ? true:false
return Promise.resolve(isLock)
},
}
}
......@@ -39,12 +39,23 @@
</view>
</view>
</view>
<view class="flex errorBox" v-if="orderCardDetail.status == 11">
<view class="order-list align-center flex-1">
<text>原错误订单编号</text>
<text>{{ orderCardDetail.associatedOrderCode }}</text>
</view>
<view class="order-list align-center flex-1">
<text>原错误订单总价</text>
<text>¥2560</text>
</view>
</view>
<!-- 支付方式 -->
<view class="order-payType flex">
<view class="payType flex align-center">
<view class="payType-label">订单类型</view>
<view class="payType-value flex align-center">
{{ payType[orderCardDetail['selectPayType']] }}
<view class="flex align-center errorTips" v-if="orderCardDetail.abnormalFlag == 'Y'"><view class="sprite-icon icon-errortips"></view>异常</view>
</view>
</view>
......@@ -462,6 +473,20 @@ export default {
border-radius: toRpx(4);
border: toRpx(1) solid transparent;
}
.errorBox {
background: #f7f8fa;
border-radius: toRpx(16);
padding: toRpx(16) toRpx(24);
color: #999ea8;
font-size: toRpx(24);
margin-bottom: toRpx(20);
}
.errorTips {
color: #eb4e4e;
font-size: toRpx(24);
font-weight: 400;
margin-left: toRpx(16);
}
.info-box {
display: flex;
......
......@@ -113,9 +113,9 @@ module.exports = {
background: '#FFF5E6'
},
11: {
text: '已失效',
color: '#8F959E',
background: ' #F3F4F5'
text: '错误订单',
color: '#F59619',
background: ' #FFF6EB'
},
10: {
text: '已关闭',
......@@ -183,7 +183,7 @@ module.exports = {
value: [10]
},
{
name: '已失效',
name: '错误订单',
value: [11]
}
],
......@@ -194,7 +194,14 @@ module.exports = {
1: '审批中', //区域运营待审核
2: '审批中', //线上运营待审核
3: '审核通过',
4: '驳回'
4: '审批驳回'
},
orderType: {
1: '正常订单',
2: '打折策略',
3: '买赠策略',
4: '冲量活动',
5: '组合付款'
}
}
}
......@@ -584,8 +584,16 @@ export default {
if (data) {
console.log(`类型为:${selectPayType}`)
console.log(this.orderInfo)
console.log(data,'data')
if (selectPayType == 3 || selectPayType == 1) {
this.orderInfo.payOrder.outTradeNo = data.outTradeNo
// 确保 orderInfo 和 payOrder 对象存在,避免空指针错误
if (!this.orderInfo) {
this.orderInfo = {}
}
if (!this.orderInfo.payOrder) {
this.$set(this.orderInfo, 'payOrder', {})
}
this.$set(this.orderInfo.payOrder, 'outTradeNo', data.outTradeNo)
let size = 0
try {
const info = uni.getSystemInfoSync()
......
......@@ -898,7 +898,7 @@ export default {
return
}
if (!(await this.checkDailyReport())) {
if (!(await this.checkDailyReport()) &&!(await this.getAbnormalOrderLock())) {
const { orderCreateType } = this
const obj = utils.deepClone(this.orderObj)
const otherCustomer = ['standNo', 'plateNumber', 'customerSex', 'experienceFlag', 'salesType']
......
......@@ -214,7 +214,20 @@ module.exports = {
'-1': { text: '战败', color: '#F24724', background: '#FDECE9' },
9: { text: '已撤销', color: '#999999', background: 'rgba(153, 153, 153, 0.1)' },
11: { text: '已失效', color: '#F7A431', background: '#FFF5E6' },
6: { text: '已退款', color: '#F7A431', background: '#FFF5E6' }
6: { text: '已退款', color: '#F7A431', background: '#FFF5E6' },
14: { text: '审批中', color: '#FF9D0A', background: '#FFF5E6' }
},
goodsOrderApplyStatus: {
0: '审批中', //区域运营待审核
1: '审批通过', //线上运营待审核
2: '审批驳回',
},
orderType: {
1: '正常订单',
2: '打折策略',
3: '买赠策略',
4: '冲量活动',
5: '组合付款'
}
}
}
......@@ -192,6 +192,26 @@ export default {
orderObj.price = this.divideByHundred(owner.price)
orderObj.insurancePrice = this.divideByHundred(insurancePrice)
orderObj.quotedPriceUpdate = this.divideByHundred(quotedPriceUpdate)
// 回显订单类型(orderType:1 正常订单,2 打折策略,3 买赠策略,4 冲量活动,5 组合付款)
const orderTypeCode = data.orderType ? String(data.orderType) : this.orderObj.orderTypeCode || ''
if (orderTypeCode) {
const orderTypeMap = {
'1': '正常订单',
'2': '打折策略',
'3': '买赠策略',
'4': '冲量活动',
'5': '组合付款'
}
orderObj.orderTypeCode = orderTypeCode
orderObj.djOrderType = orderTypeMap[orderTypeCode] || ''
// 回显表单中“订单类型”这一行的展示文案
const orderTypeCell = this.formList[3]?.find(item => item.value === 'djOrderType')
if (orderTypeCell) {
orderTypeCell.current = orderObj.djOrderType
}
}
if (!data.vdQuotationGoodsList) data.vdQuotationGoodsList = []
orderObj.vdQuotationGoodsList = data.vdQuotationGoodsList.map(item => {
item.price = this.divideByHundred(item.goodsPrice)
......@@ -223,6 +243,63 @@ export default {
if (e.value == 'salesType') e.current = owner.salesType
if (e.value == 'ownerGender') e.current = owner.ownerGender
})
// 根据 discountType / discountValue / finalPrice 回显策略配置
const buildStrategyConfigFromDiscountFields = (item, orderTypeCode) => {
const orderType = String(orderTypeCode || '')
const discountType = item.discountType !== undefined && item.discountType !== null ? Number(item.discountType) : null
const discountValue = item.discountValue
// 打折策略
if (orderType === '2') {
if (discountType === 1 && discountValue !== undefined && discountValue !== null && discountValue !== '') {
return {
mode: 'ratio',
discountRatio: discountValue,
discountAmount: ''
}
}
if (discountType === 2 && discountValue !== undefined && discountValue !== null && discountValue !== '') {
return {
mode: 'amount',
discountRatio: '',
discountAmount: discountValue
}
}
// 无折扣
return {
mode: 'none',
discountRatio: '',
discountAmount: ''
}
}
// 买赠策略
if (orderType === '3') {
// 4:赠品,5:非赠品
const isGift = discountType === 4 ? '1' : '0'
return {
isGift
}
}
// 组合付款
if (orderType === '5') {
if (discountValue !== undefined && discountValue !== null && discountValue !== '') {
return {
mode: 'deduct',
deductAmount: discountValue
}
}
return {
mode: 'none',
deductAmount: ''
}
}
return {}
}
orderObj.skuGoods = data.vdQuotationGoodsList.reduce((pre, item) => {
// 是普通商品
if (!item.packageName && !item.specificationsValue) {
......@@ -233,6 +310,14 @@ export default {
upgradeGoodsId: item.goodsId,
merchantGoodsId: item.goodsId,
sellPrice: this.divideByHundred(item.goodsPrice),
// 数量回显(默认 1)
number: item.number || 1,
// 回显优惠相关字段
discountType: item.discountType,
discountValue: item.discountValue,
finalPrice: item.finalPrice,
// 根据折扣字段还原策略配置
strategyConfig: buildStrategyConfigFromDiscountFields(item, orderObj.orderTypeCode),
minSellPrice: quotationGoodsList?.find(val => val?.goods?.merchantGoodsId == item.goodsId)?.goods?.minSellPrice, // 按商品数据对比补充详情商品最低价
validMinSellPrice: quotationGoodsList?.find(val => val?.goods?.merchantGoodsId == item.goodsId)?.goods?.validMinSellPrice // 按商品数据对比补充详情商品校验最低价字段
}
......@@ -249,7 +334,12 @@ export default {
merchantGoodsId: item.goodsId,
upgradeGoodsId: item.goodsId,
sellPrice: this.divideByHundred(item.goodsPrice),
number: 1,
number: item.number || 1,
// 回显优惠相关字段
discountType: item.discountType,
discountValue: item.discountValue,
finalPrice: item.finalPrice,
strategyConfig: buildStrategyConfigFromDiscountFields(item, orderObj.orderTypeCode),
minSellPrice: quotationGoodsList?.find(val => val.packageGoods?.goodsList?.length && val.packageGoods?.packageCode == item?.packageId)?.packageGoods?.goodsList?.find(subV => subV.merchantGoodsId == item.goodsId)?.minSellPrice, // 按商品数据对比补充详情商品最低价
validMinSellPrice: quotationGoodsList?.find(val => val.packageGoods?.goodsList?.length && val.packageGoods?.packageCode == item?.packageId)?.packageGoods?.goodsList?.find(subV => subV.merchantGoodsId == item.goodsId)?.validMinSellPrice // 按商品数据对比补充详情商品校验最低价字段
}
......@@ -280,7 +370,14 @@ export default {
}
//多规格商品
if (!item.packageName && item.specificationsValue) {
let specificdata = this.handleSpecificationsEcho(item)
// 将折扣相关字段传递给多规格处理
let specificdata = this.handleSpecificationsEcho({
...item,
discountType: item.discountType,
discountValue: item.discountValue,
finalPrice: item.finalPrice,
orderTypeCode: orderObj.orderTypeCode
})
pre = pre.concat(specificdata)
}
......@@ -875,7 +972,10 @@ export default {
item = item.goods
const sellPrice = parseFloat(item.sellPrice || 0)
const number = parseInt(item.number || 1)
const finalPrice = item.finalPrice !== undefined ? parseFloat(item.finalPrice) / 100 : this.calculateFinalPrice(item, sellPrice, number, orderInfo.orderTypeCode)
// finalPrice 存在时为“分”,但可能为 null(表示无优惠)
// 仅当 finalPrice 不为 null 且是有效数字时才使用它,否则重新根据策略计算
const hasValidFinalPrice = item.finalPrice !== undefined && item.finalPrice !== null && !isNaN(parseFloat(item.finalPrice))
const finalPrice = hasValidFinalPrice ? parseFloat(item.finalPrice) / 100 : this.calculateFinalPrice(item, sellPrice, number, orderInfo.orderTypeCode)
const discountFields = this.calculateDiscountFields(item, sellPrice, number, orderInfo.orderTypeCode)
const obj = {
goodsId: item.merchantGoodsId,
......@@ -896,7 +996,8 @@ export default {
item.goodsList.map(ele => {
const sellPrice = parseFloat(ele.sellPrice || 0)
const number = parseInt(item.number || 1)
const finalPrice = ele.finalPrice !== undefined ? parseFloat(ele.finalPrice) / 100 : this.calculateFinalPrice(ele, sellPrice, number, orderInfo.orderTypeCode)
const hasValidFinalPrice = ele.finalPrice !== undefined && ele.finalPrice !== null && !isNaN(parseFloat(ele.finalPrice))
const finalPrice = hasValidFinalPrice ? parseFloat(ele.finalPrice) / 100 : this.calculateFinalPrice(ele, sellPrice, number, orderInfo.orderTypeCode)
const discountFields = this.calculateDiscountFields(ele, sellPrice, number, orderInfo.orderTypeCode)
let obj = {
packageId: item.packageCode,
......@@ -921,7 +1022,8 @@ export default {
const goods = multipleSpecGoods.goods
const sellPrice = parseFloat(goods.sellPrice || 0)
const number = parseInt(multipleSpecGoods.number || 1)
const finalPrice = goods.finalPrice !== undefined ? parseFloat(goods.finalPrice) / 100 : this.calculateFinalPrice(goods, sellPrice, number, orderInfo.orderTypeCode)
const hasValidFinalPrice = goods.finalPrice !== undefined && goods.finalPrice !== null && !isNaN(parseFloat(goods.finalPrice))
const finalPrice = hasValidFinalPrice ? parseFloat(goods.finalPrice) / 100 : this.calculateFinalPrice(goods, sellPrice, number, orderInfo.orderTypeCode)
const discountFields = this.calculateDiscountFields(goods, sellPrice, number, orderInfo.orderTypeCode)
const obj = {
goodsId: goods.merchantGoodsId,
......
......@@ -13,13 +13,35 @@
</view>
</view>
<!-- 待上传合同协议且是已支付的订单 -->
<view class="status text-center" :style="{ color: status[0].color, 'background-color': status[0].background }" v-if="orderCardDetail.zyPayStatus == 1 && (orderCardDetail.orderStatus == 3 || orderCardDetail.orderStatus == 4 || orderCardDetail.orderStatus == 7)">待上传</view>
<view v-else class="status text-center" :style="{ color: status[orderCardDetail.orderStatus].color, 'background-color': status[orderCardDetail.orderStatus].background }">
{{ status[orderCardDetail.orderStatus].text }}
<view class="status text-center" :style="{ color: (status[0] && status[0].color) || '#FF9D0A', 'background-color': (status[0] && status[0].background) || '#FFF5E6' }" v-if="orderCardDetail.zyPayStatus == 1 && (orderCardDetail.orderStatus == 3 || orderCardDetail.orderStatus == 4 || orderCardDetail.orderStatus == 7)">待上传</view>
<view v-else class="status text-center" :style="{ color: currentStatusConfig.color, 'background-color': currentStatusConfig.background }">
{{ currentStatusConfig.text }}
</view>
</view>
<view class="flex errorBox">
<view class="order-list align-center flex-1">
<text>原错误订单编号</text>
<text>898495495393839459</text>
</view>
<view class="order-list align-center flex-1">
<text>原错误订单总价</text>
<text>¥2560</text>
</view>
</view>
<view class="order-card-bottom-box">
<view class="info-box">
<view class="order-list align-center">
<view class="order flex align-center">
<view class="order-label">订单类型 </view>
<view class="order-value flex">{{ orderTypeText[orderCardDetail.orderType] }}</view>
</view>
</view>
<view class="order-list align-center">
<view class="order flex align-center">
<view class="order-label">审批状态 </view>
<view class="order-value flex">{{ goodsOrderApplyStatus[orderCardDetail.approveStatus] }}</view>
</view>
</view>
<view class="order-list align-center" v-for="(item, sindex) in orderCardDetail.deliveryId ? pointsMultiObj : orderObj" :key="sindex">
<view v-if="item.key == 'remark' || item.key == 'payTime' || item.key == 'createdTime'">
<view class="order flex align-center" v-if="item.key == 'remark' && orderCardDetail.orderStatus == '-1'">
......@@ -71,11 +93,11 @@
</view>
</view>
</view>
<view class="order flex align-center" v-if="orderCardDetail.orderStatus != '-1' && orderCardDetail.quotedPriceUpdate">
<view class="order flex align-center" v-if="orderCardDetail.orderStatus != '-1' && orderCardDetail.finalPrice">
<view class="order-label">支付金额</view>
<view class="price flex">
<text class="unit">¥</text>
{{ orderCardDetail.quotedPriceUpdate || '' }}
{{ orderCardDetail.finalPrice || '' }}
</view>
<view class="refund-box" v-if="orderCardDetail.refundAmount">
部分退款
......@@ -200,6 +222,26 @@ export default {
status() {
return order_mixins.data.orderStatusObj || {}
},
goodsOrderApplyStatus() {
return order_mixins.data.goodsOrderApplyStatus || {}
},
orderTypeText() {
return order_mixins.data.orderType || {}
},
// 安全获取当前订单状态配置,如果状态不存在则返回默认配置
currentStatusConfig() {
const statusKey = this.orderCardDetail.orderStatus
const statusObj = this.status[statusKey]
if (statusObj && statusObj.color && statusObj.background) {
return statusObj
}
// 返回默认状态配置
return {
text: '未知状态',
color: '#8F959E',
background: '#F3F4F5'
}
},
buttonConfig() {
const config = {
showMoreBtn: false,
......@@ -211,6 +253,11 @@ export default {
const order = this.orderCardDetail
const localUser = this.localUserInfo
// 如果是审批中状态(approveStatus === 0),不显示任何操作按钮
if (order.approveStatus === 0 || order.approveStatus === '0') {
return config
}
// 超管或商户类型1不可操作
if (localUser?.isSuper || localUser?.userType !== 2) {
config.showMoreBtn = order.showInvoiceEntrance || ((order.orderStatus == 3 || order.orderStatus == 5 || (order.orderStatus == 6 && order.refundAmount)) && this.isOrder)
......@@ -990,6 +1037,14 @@ export default {
border-radius: toRpx(4);
border: toRpx(1) solid transparent;
}
.errorBox {
background: #f7f8fa;
border-radius: toRpx(16);
padding: toRpx(16) toRpx(24);
color: #999ea8;
font-size: toRpx(24);
margin-bottom: toRpx(20);
}
.info-box {
display: flex;
......
......@@ -327,7 +327,7 @@ export default {
if (!arr) {
return arr
}
var attrList = ['equityPrice', 'quotedPrice', 'quotedPriceUpdate', 'refundAmount']
var attrList = ['equityPrice', 'quotedPrice', 'quotedPriceUpdate', 'refundAmount','finalPrice']
arr.forEach(item => {
attrList.forEach(k => {
if (item[k]) {
......
......@@ -562,14 +562,15 @@ export default {
}
this.$emit('changeTotalPrice')
},
// 初始化策略配置
// 初始化策略配置(支持编辑回显)
initStrategyConfig() {
if (!this.list || this.list.length === 0) return
const strategyType = this.getStrategyType({})
// 没有策略类型时,清空所有优惠配置
if (!strategyType) {
// 订单类型切换时,重置所有商品的策略配置
this.list.forEach(item => {
// 如果是套餐商品,需要重置套餐内所有商品的策略配置
// 套餐商品:重置套餐内所有商品
if (item.goodsFlag == 3 && item.packageGoods && item.packageGoods.goodsList) {
item.packageGoods.goodsList.forEach(goods => {
if (goods.strategyConfig) {
......@@ -591,7 +592,6 @@ export default {
}
if (goods) {
// 重置策略配置和优惠相关字段
if (goods.strategyConfig) {
goods.strategyConfig = {}
}
......@@ -604,10 +604,15 @@ export default {
}
this.list.forEach(item => {
// 如果是套餐商品,需要初始化套餐内所有商品的策略配置
// 套餐商品:初始化套餐内所有商品的策略配置
if (item.goodsFlag == 3 && item.packageGoods && item.packageGoods.goodsList) {
item.packageGoods.goodsList.forEach(goods => {
// 无论 strategyConfig 是否存在,都根据新的策略类型重新初始化
// 如果是编辑回显,并且已经有 discountType 和非空的 strategyConfig,则不重置
const hasDiscountData = goods.discountType !== undefined && goods.discountType !== null
if (hasDiscountData && goods.strategyConfig && Object.keys(goods.strategyConfig).length > 0) {
return
}
if (strategyType === 'discount') {
this.$set(goods, 'strategyConfig', {
mode: 'none',
......@@ -638,7 +643,12 @@ export default {
if (!goods) return
// 无论 strategyConfig 是否存在,都根据新的策略类型重新初始化
// 如果是编辑回显,并且已经有 discountType 和非空的 strategyConfig,则不重置
const hasDiscountData = goods.discountType !== undefined && goods.discountType !== null
if (hasDiscountData && goods.strategyConfig && Object.keys(goods.strategyConfig).length > 0) {
return
}
if (strategyType === 'discount') {
this.$set(goods, 'strategyConfig', {
mode: 'none',
......
......@@ -115,6 +115,13 @@ export default {
this.lockReason = res.lockReason
return
}
// 提示锁单
const abnormalOrderLock = await this.getAbnormalOrderLock()
if (abnormalOrderLock) {
this.showErrorOrderPopup = true
// this.lockReason = abnormalOrderLock.lockReason
return
}
// 保存当前选择的组件信息,但不立即切换
const selectedItem = item
if (this.toolComponentName === selectedItem.name && (!this.transmissionOfData || this.transmissionOfData.type !== 'supplementOrder')) return
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!