Commit 7f8426e2 by cen

fix: 更新订单相关组件以支持新价格逻辑和状态显示

- 修改 env.js 中的 index 值以确保正确的默认环境
- 更新 OrderCard 和 ConfirmOrder 组件,使用 finalPrice 替代 totalPrice 显示价格
- 在 OrderDetail 和 OrderManagement 组件中增强审批状态的显示逻辑
- 添加审批中状态的配置到 order_mixins.js
- 更新 CreateOrder 组件以支持订单类型的回显和策略配置
- 优化 SkuGoods 组件的价格输入逻辑
1 parent bb53d099

2.99 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
...@@ -33,7 +33,7 @@ export default { ...@@ -33,7 +33,7 @@ export default {
this.currentId = data.orderTypeCode this.currentId = data.orderTypeCode
let item = list.find(i => i.value == this.currentId) let item = list.find(i => i.value == this.currentId)
if (item) { if (item) {
this.$emit('choose', item) this.$emit('choose', item)
} }
} }
this.list = list this.list = list
......
const target = ['ip', 'dev', 'uat', 'prod', 'beta'] const target = ['ip', 'dev', 'uat', 'prod', 'beta']
const index = 1 const index = 0
/** /**
* *
0本地 0本地
...@@ -49,8 +49,8 @@ const domain = { ...@@ -49,8 +49,8 @@ const domain = {
}[target[index]] }[target[index]]
const djDomain = { const djDomain = {
ip: 'http://dj.dev.glsx.com.cn', // ip: 'http://dj.dev.glsx.com.cn',
// ip: 'http://192.168.1.125:8080', ip: 'http://192.168.1.76:8292',
dev: 'http://dj.dev.glsx.com.cn', dev: 'http://dj.dev.glsx.com.cn',
beta: 'https://dj.beta.glsx.com.cn', //预发布 appid: wx9f91c1ec493eb425 beta: 'https://dj.beta.glsx.com.cn', //预发布 appid: wx9f91c1ec493eb425
uat: 'https://dj.test.glsx.com.cn', //测试 appid: wxe10067a63c1856ac uat: 'https://dj.test.glsx.com.cn', //测试 appid: wxe10067a63c1856ac
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
</view> </view>
<view class="goods-price"> <view class="goods-price">
¥ ¥
<text>{{ i.totalPrice || 0 }}</text> <text>{{ i.finalPrice || 0 }}</text>
</view> </view>
</view> </view>
...@@ -48,11 +48,10 @@ ...@@ -48,11 +48,10 @@
</view> </view>
</view> </view>
<view class="order-price flex align-center"> <view class="payType flex align-center">
<view class="order-price-label">审批状态</view> <view class="payType-label">审批状态</view>
<view class="price"> <view class="payType-value flex align-center">
<text class="unit">¥</text> {{ goodsOrderApplyStatus[orderCardDetail.goodsOrderApplyStatus] }}
{{ orderCardDetail.totalPrice }}
</view> </view>
</view> </view>
</view> </view>
...@@ -95,7 +94,7 @@ ...@@ -95,7 +94,7 @@
<view class="order-price-label">实付金额</view> <view class="order-price-label">实付金额</view>
<view class="price"> <view class="price">
<text class="unit">¥</text> <text class="unit">¥</text>
{{ orderCardDetail.totalPrice }} {{ orderCardDetail.finalPrice }}
</view> </view>
</view> </view>
</view> </view>
...@@ -168,6 +167,9 @@ export default { ...@@ -168,6 +167,9 @@ export default {
}, },
status() { status() {
return order_mixins.data.status || {} return order_mixins.data.status || {}
},
goodsOrderApplyStatus() {
return order_mixins.data.goodsOrderApplyStatus || {}
} }
}, },
data() { data() {
...@@ -473,7 +475,7 @@ export default { ...@@ -473,7 +475,7 @@ export default {
&:nth-child(2n) { &:nth-child(2n) {
padding-right: 0; padding-right: 0;
padding-left: toRpx(20); // padding-left: toRpx(20);
} }
} }
} }
......
...@@ -102,6 +102,11 @@ module.exports = { ...@@ -102,6 +102,11 @@ module.exports = {
} }
], ],
status: { status: {
14: {
text: '审批中',
color: '#FF9D0A',
background: '#FFF5E6'
},
12: { 12: {
text: '已退款', text: '已退款',
color: '#F7A431', color: '#F7A431',
...@@ -184,6 +189,12 @@ module.exports = { ...@@ -184,6 +189,12 @@ module.exports = {
], ],
grassInfo: {}, grassInfo: {},
orderCode: '', orderCode: '',
userInfo: {} userInfo: {},
goodsOrderApplyStatus: {
1: '审批中', //区域运营待审核
2: '审批中', //线上运营待审核
3: '审核通过',
4: '驳回'
}
} }
} }
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<view class="meal-box" v-for="(item, index) in orderInfo.packageGoodsList"> <view class="meal-box" v-for="(item, index) in orderInfo.packageGoodsList">
<view class="meal-hd flex justify-between align-center"> <view class="meal-hd flex justify-between align-center">
<view>{{ item.packageAlias || item.packageName }}</view> <view>{{ item.packageAlias || item.packageName }}</view>
<view class="price">¥{{ item.totalPrice }}</view> <view class="price">¥{{ item.finalPrice }}</view>
</view> </view>
<view class="meal-bd"> <view class="meal-bd">
<view class="meal-bd-box" v-for="g in item.packageGoodsOrderList"> <view class="meal-bd-box" v-for="g in item.packageGoodsOrderList">
...@@ -286,8 +286,8 @@ export default { ...@@ -286,8 +286,8 @@ export default {
let warrantyCardList = [] let warrantyCardList = []
for (var i = 0; i < data?.subOrderList?.length; i++) { for (var i = 0; i < data?.subOrderList?.length; i++) {
let e = data?.subOrderList[i] let e = data?.subOrderList[i]
total_price += e.totalPrice total_price += e.finalPrice
e.price = Number(utils.decimal(Number(e.totalPrice / e.number), 2)).toFixed(2) e.price = Number(utils.decimal(Number(e.finalPrice / e.number), 2)).toFixed(2)
e.positionStr = this.positionTypeList.filter(v => v.positionValue == e.upgradeGoodsPosition)[0]?.positionName || '' e.positionStr = this.positionTypeList.filter(v => v.positionValue == e.upgradeGoodsPosition)[0]?.positionName || ''
if (e.upgradeWarrantyPeriod || e.upgradeWarrantyPeriod > 0) { if (e.upgradeWarrantyPeriod || e.upgradeWarrantyPeriod > 0) {
warrantyCardList.push({ warrantyCardList.push({
...@@ -298,19 +298,19 @@ export default { ...@@ -298,19 +298,19 @@ export default {
} }
data.packageGoodsList?.forEach(item => { data.packageGoodsList?.forEach(item => {
item.packageGoodsOrderList.forEach(g => { item.packageGoodsOrderList.forEach(g => {
g.price = g.totalPrice ? Number(g.totalPrice) / Number(g.number) : g.upgradePrice g.price = g.finalPrice ? Number(g.finalPrice) / Number(g.number) : g.upgradePrice
}) })
item.goodsList = item.packageGoodsOrderList item.goodsList = item.packageGoodsOrderList
item.price = item.goodsList.reduce((prev, cur) => { item.price = item.goodsList.reduce((prev, cur) => {
return prev + Number(cur.totalPrice) / Number(cur.number) return prev + Number(cur.finalPrice) / Number(cur.number)
}, 0) }, 0)
item.count = item.goodsList.length ? item.goodsList[0].number : 1 item.count = item.goodsList.length ? item.goodsList[0].number : 1
let total = item.price * item.count let total = item.price * item.count
item.totalPrice = utils.decimal(total, 2) item.finalPrice = utils.decimal(total, 2)
item.packageGoodsOrderList.forEach(g => { item.packageGoodsOrderList.forEach(g => {
g.positionStr = this.positionTypeList.filter(v => v.positionValue == g.upgradeGoodsPosition)[0]?.positionName || '' g.positionStr = this.positionTypeList.filter(v => v.positionValue == g.upgradeGoodsPosition)[0]?.positionName || ''
}) })
total_price += item.totalPrice total_price += item.finalPrice
}) })
data = { data = {
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<view class="meal-box" v-for="(item, index) in orderInfo.packageGoodsList"> <view class="meal-box" v-for="(item, index) in orderInfo.packageGoodsList">
<view class="meal-hd flex justify-between align-center"> <view class="meal-hd flex justify-between align-center">
<view>{{ item.packageAlias || item.packageName }}</view> <view>{{ item.packageAlias || item.packageName }}</view>
<view class="price">¥{{ item.totalPrice }}</view> <view class="price">¥{{ item.finalPrice }}</view>
</view> </view>
<view class="meal-bd"> <view class="meal-bd">
<view class="meal-bd-box" v-for="g in item.packageGoodsOrderList"> <view class="meal-bd-box" v-for="g in item.packageGoodsOrderList">
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
</view> </view>
</view> </view>
<view class="price">¥{{ g.price }}</view> <view class="price">¥{{ g.finalPrice }}</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
<view class="good" v-for="(item, index) in orderInfo.subOrderList" :key="index"> <view class="good" v-for="(item, index) in orderInfo.subOrderList" :key="index">
<view class="flex justify-between align-center mb-20"> <view class="flex justify-between align-center mb-20">
<text class="good-name">商品名称:{{ replaceItemText(item.upgradeGoodsName) || '' }}</text> <text class="good-name">商品名称:{{ replaceItemText(item.upgradeGoodsName) || '' }}</text>
<text class="good-price">¥{{ item.price }}</text> <text class="good-price">¥{{ item.finalPrice }}</text>
</view> </view>
<view class="flex justify-between align-center mb-12" v-if="item.upgradeGoodsAlias"> <view class="flex justify-between align-center mb-12" v-if="item.upgradeGoodsAlias">
<text class="good-alias">商品别名:{{ replaceItemText(item.upgradeGoodsAlias) || '' }}</text> <text class="good-alias">商品别名:{{ replaceItemText(item.upgradeGoodsAlias) || '' }}</text>
...@@ -367,8 +367,8 @@ export default { ...@@ -367,8 +367,8 @@ export default {
let total_price = 0 let total_price = 0
for (var i = 0; i < data?.subOrderList?.length; i++) { for (var i = 0; i < data?.subOrderList?.length; i++) {
let e = data?.subOrderList[i] let e = data?.subOrderList[i]
total_price += e.totalPrice total_price += e.finalPrice
e.price = Number(utils.decimal(Number(e.totalPrice / e.number), 2)).toFixed(2) e.price = Number(utils.decimal(Number(e.finalPrice / e.number), 2)).toFixed(2)
e.positionStr = positionTypeList.filter(v => v.positionValue == e.upgradeGoodsPosition)[0]?.positionName || '' e.positionStr = positionTypeList.filter(v => v.positionValue == e.upgradeGoodsPosition)[0]?.positionName || ''
if ((e.upgradeWarrantyPeriod || e.upgradeWarrantyPeriod > 0) && data.selectPayType != 0) { if ((e.upgradeWarrantyPeriod || e.upgradeWarrantyPeriod > 0) && data.selectPayType != 0) {
const warrantyItem = { const warrantyItem = {
...@@ -404,19 +404,19 @@ export default { ...@@ -404,19 +404,19 @@ export default {
if (data.packageGoodsList) { if (data.packageGoodsList) {
data.packageGoodsList.forEach(item => { data.packageGoodsList.forEach(item => {
item.packageGoodsOrderList.forEach(g => { item.packageGoodsOrderList.forEach(g => {
g.price = g.totalPrice ? Number(g.totalPrice) / Number(g.number) : g.upgradePrice g.price = g.finalPrice ? Number(g.finalPrice) / Number(g.number) : g.upgradePrice
}) })
item.goodsList = item.packageGoodsOrderList item.goodsList = item.packageGoodsOrderList
item.price = item.goodsList.reduce((prev, cur) => { item.price = item.goodsList.reduce((prev, cur) => {
return prev + Number(cur.totalPrice) / Number(cur.number) return prev + Number(cur.finalPrice) / Number(cur.number)
}, 0) }, 0)
item.count = item.goodsList.length ? item.goodsList[0].number : 1 item.count = item.goodsList.length ? item.goodsList[0].number : 1
let total = item.price * item.count let total = item.price * item.count
item.totalPrice = utils.decimal(total, 2) item.finalPrice = utils.decimal(total, 2)
item.packageGoodsOrderList.forEach(g => { item.packageGoodsOrderList.forEach(g => {
g.positionStr = positionTypeList.filter(v => v.positionValue == g.upgradeGoodsPosition)[0]?.positionName || '' g.positionStr = positionTypeList.filter(v => v.positionValue == g.upgradeGoodsPosition)[0]?.positionName || ''
}) })
total_price += item.totalPrice total_price += item.finalPrice
}) })
} }
......
...@@ -433,11 +433,17 @@ export default { ...@@ -433,11 +433,17 @@ export default {
// e.subOrderList = e.subOrderList.filter(item => item.id) // e.subOrderList = e.subOrderList.filter(item => item.id)
// 处理显示订单右上角文字 // 处理显示订单右上角文字
let text = this.status[e.status].text // 安全检查:如果状态不存在,使用默认值
let color = this.status[e.status].color const statusConfig = this.status[e.status] || {
let background = this.status[e.status].background text: '未知状态',
color: '#8F959E',
background: '#F3F4F5'
}
let text = statusConfig.text
let color = statusConfig.color
let background = statusConfig.background
// 不是订单失效状态优先显示已施工 // 不是订单失效状态优先显示已施工
if (![9, 11, 12].includes(e.status) && e.constructionFlag == 'Y') { if (![9, 11, 12, 14].includes(e.status) && e.constructionFlag == 'Y') {
text = '已施工' text = '已施工'
color = '#347BFF' color = '#347BFF'
background = '#F3F7FC' background = '#F3F7FC'
......
...@@ -73,8 +73,6 @@ export default { ...@@ -73,8 +73,6 @@ export default {
updated() { updated() {
// 当组件数据更新时也检查number属性 // 当组件数据更新时也检查number属性
this.initProductNumbers() this.initProductNumbers()
// 根据订单类型初始化策略配置
this.initStrategyConfig()
}, },
watch: { watch: {
orderTypeCode: { orderTypeCode: {
......
...@@ -3,55 +3,55 @@ ...@@ -3,55 +3,55 @@
<view class="shop-list"> <view class="shop-list">
<view class="shop-item" v-for="(item, index) in list" :key="index"> <view class="shop-item" v-for="(item, index) in list" :key="index">
<view class="flex flex-1 pb-24"> <view class="flex flex-1 pb-24">
<view class="sprite-icon icon-blue-delete" @click="deleteGoods(index)"></view> <view class="sprite-icon icon-blue-delete" @click="deleteGoods(index)"></view>
<view class="right"> <view class="right">
<view class="shop-name">商品名称:{{ item.multipleSpecificationsGoods ? item.multipleSpecificationsGoods.baseGoodsName : item.goods.goodsAlias || item.goods.upgradeGoodsName || item.goods.goodsInfo.goodsName }}</view> <view class="shop-name">商品名称:{{ item.multipleSpecificationsGoods ? item.multipleSpecificationsGoods.baseGoodsName : item.goods.goodsAlias || item.goods.upgradeGoodsName || item.goods.goodsInfo.goodsName }}</view>
<view class="alias" v-if="item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods.goodsAlias">商品别名:{{ item.multipleSpecificationsGoods.goods.goodsAlias }}</view> <view class="alias" v-if="item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods.goodsAlias">商品别名:{{ item.multipleSpecificationsGoods.goods.goodsAlias }}</view>
<view class="front-gear-box"> <view class="front-gear-box">
<view class="front-gear-input-box"> <view class="front-gear-input-box">
<template v-if="item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods.specificationStr"> <template v-if="item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods.specificationStr">
<view class="front-gear-label">
{{ item.multipleSpecificationsGoods.goods.specificationStr }}
</view>
</template>
<template v-if="item.goods">
<template v-if="(item.goods.merchantGoodsPosition || item.goods.upgradeGoodsPosition) && (item.goods.goodsInfo.goodsType == 1 || item.goods.upgradeGoodsType == 1 || item.goods.goodsInfo.goodsType == baseConfigData.selfBuildFilmType || item.goods.upgradeGoodsType == baseConfigData.selfBuildFilmType)">
<view class="front-gear-label"> <view class="front-gear-label">
{{ item.multipleSpecificationsGoods.goods.specificationStr }} {{ formatPosition(item.goods.merchantGoodsPosition || item.goods.upgradeGoodsPosition, positionTypeList) }}
</view> </view>
</template> </template>
<template v-if="item.goods"> <template v-if="(item.goods.goodsInfo.goodsType == 1 || item.goods.upgradeGoodsType == 1) && !item.goods.merchantGoodsPosition && !item.goods.upgradeGoodsPosition">无部位属性</template>
<template v-if="(item.goods.merchantGoodsPosition || item.goods.upgradeGoodsPosition) && (item.goods.goodsInfo.goodsType == 1 || item.goods.upgradeGoodsType == 1 || item.goods.goodsInfo.goodsType == baseConfigData.selfBuildFilmType || item.goods.upgradeGoodsType == baseConfigData.selfBuildFilmType)"> </template>
<view class="front-gear-label"> <view class="front-gear-input">
{{ formatPosition(item.goods.merchantGoodsPosition || item.goods.upgradeGoodsPosition, positionTypeList) }} <view class="unit">¥</view>
</view> <template v-if="item.multipleSpecificationsGoods">
</template> <input class="uni-input" type="digit" maxlength="9" :disabled="isDisabled" placeholder="请输入价格" placeholder-style="font-size: 14px" v-model="item.multipleSpecificationsGoods.goods.sellPrice" @blur="validatePrice($event, item, index)" />
<template v-if="(item.goods.goodsInfo.goodsType == 1 || item.goods.upgradeGoodsType == 1) && !item.goods.merchantGoodsPosition && !item.goods.upgradeGoodsPosition">无部位属性</template> </template>
<template v-else>
<input class="uni-input" type="digit" :disabled="isDisabled" maxlength="9" placeholder="请输入价格" placeholder-style="font-size: 14px" v-model="item.goods.sellPrice" @blur="validatePrice($event, item, index)" />
</template> </template>
<view class="front-gear-input"> <!-- <input class="uni-input" type="digit" maxlength="9" placeholder="请输入价格"
<view class="unit">¥</view>
<template v-if="item.multipleSpecificationsGoods">
<input class="uni-input" type="digit" maxlength="9" :disabled="isDisabled" placeholder="请输入价格" placeholder-style="font-size: 14px" v-model="item.multipleSpecificationsGoods.goods.sellPrice" @blur="validatePrice($event, item, index)" />
</template>
<template v-else>
<input class="uni-input" type="digit" :disabled="isDisabled" maxlength="9" placeholder="请输入价格" placeholder-style="font-size: 14px" v-model="item.goods.sellPrice" @blur="validatePrice($event, item, index)" />
</template>
<!-- <input class="uni-input" type="digit" maxlength="9" placeholder="请输入价格"
placeholder-style="font-size: 14px" placeholder-style="font-size: 14px"
:value="item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods ? item.multipleSpecificationsGoods.goods.sellPrice : item.goods.sellPrice" :value="item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods ? item.multipleSpecificationsGoods.goods.sellPrice : item.goods.sellPrice"
@blur="validatePrice($event, item, index)" /> --> @blur="validatePrice($event, item, index)" /> -->
</view>
</view> </view>
<view class="control"> </view>
<view class="minus" @click="decreaseNumber(item)">-</view> <view class="control">
<template v-if="item.multipleSpecificationsGoods"> <view class="minus" @click="decreaseNumber(item)">-</view>
<input class="uni-input control-input" type="number" maxlength="3" v-model="item.multipleSpecificationsGoods.number" @blur="validateNumber($event, item)" /> <template v-if="item.multipleSpecificationsGoods">
</template> <input class="uni-input control-input" type="number" maxlength="3" v-model="item.multipleSpecificationsGoods.number" @blur="validateNumber($event, item)" />
<template v-else> </template>
<input class="uni-input control-input" type="number" maxlength="3" v-model="item.goods.number" @blur="validateNumber($event, item)" /> <template v-else>
</template> <input class="uni-input control-input" type="number" maxlength="3" v-model="item.goods.number" @blur="validateNumber($event, item)" />
<!-- <input class="uni-input control-input" type="number" maxlength="3" </template>
<!-- <input class="uni-input control-input" type="number" maxlength="3"
:value="item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods ? item.multipleSpecificationsGoods.goods.number : item.goods.number" :value="item.multipleSpecificationsGoods && item.multipleSpecificationsGoods.goods ? item.multipleSpecificationsGoods.goods.number : item.goods.number"
@blur="validateNumber($event, item)" /> --> @blur="validateNumber($event, item)" /> -->
<view class="add" @click="increaseNumber(item)">+</view> <view class="add" @click="increaseNumber(item)">+</view>
</view>
</view> </view>
</view> </view>
</view> </view>
</view>
<!-- 折扣 / 买赠 / 组合付款策略组件 --> <!-- 折扣 / 买赠 / 组合付款策略组件 -->
<OrderStrategy v-if="getStrategyType(item)" :strategyType="getStrategyType(item)" :value="getStrategyConfig(item)" :basePrice="getBasePrice(item)" :displayPrice="getDisplayPrice(item)" @input="onStrategyConfigChange(item, $event)" @priceChange="onPriceChange(item, $event)" /> <OrderStrategy v-if="getStrategyType(item)" :strategyType="getStrategyType(item)" :value="getStrategyConfig(item)" :basePrice="getBasePrice(item)" :displayPrice="getDisplayPrice(item)" @input="onStrategyConfigChange(item, $event)" @priceChange="onPriceChange(item, $event)" />
</view> </view>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!