Commit 22dd5d1a by 李伟康

Merge branch 'SAAS+V5.6.1' of http://192.168.3.233:8090/glsx/gl_tape into SAAS+V5.6.1

2 parents acd1b9e8 c84b5941
...@@ -602,6 +602,14 @@ module.exports = { ...@@ -602,6 +602,14 @@ module.exports = {
...data, ...data,
}) })
}, },
// 异常订单锁单信息查询
getAbnormalOrderLock(data = {}) {
return http.post({
method: 'dj.api.smartcarlife.goodsOrder.abnormalOrder.lock.select',
projectName: 'boutique',
...data
})
},
/** /**
* 检查今天是否在T1-T5之间 * 检查今天是否在T1-T5之间
*/ */
...@@ -613,4 +621,12 @@ module.exports = { ...@@ -613,4 +621,12 @@ module.exports = {
...data, ...data,
}) })
}, },
// 工资申诉入口判断
getWageAppealEntrance(data={}) {
return http.post({
method: 'dj.staff.api.has.performance.config.formerchant',
projectName: 'staffMiniprogram',
...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
...@@ -30,11 +30,20 @@ export default { ...@@ -30,11 +30,20 @@ export default {
} }
}, },
data() { data() {
return {} return {
// 工资申诉入口是否允许显示
wageAppealAllowed: false,
// 工资申诉入口加载中,加载完成前不展示避免误显示
loadingEntrance: true
}
},
created() {
// 组件创建时请求工资申诉入口权限
this.fetchWageAppealEntrance()
}, },
computed: { computed: {
entranceList() { entranceList() {
let { sceneType } = uni.$storage.get('userInfo'), let { sceneType } = uni.$storage.get('userInfo') || {},
entranceList = [ entranceList = [
{ {
icon: 'daily-report', icon: 'daily-report',
...@@ -93,10 +102,45 @@ export default { ...@@ -93,10 +102,45 @@ export default {
sceneType: [7] sceneType: [7]
} }
] ]
return entranceList.filter(e => e.sceneType.includes(sceneType)) // 先根据场景过滤
let list = entranceList.filter(e => e.sceneType.includes(sceneType))
// 加载阶段或不允许显示时,移除工资申诉入口
if (this.loadingEntrance || !this.wageAppealAllowed) {
list = list.filter(e => e.name !== 'WageAppeal')
}
return list
} }
}, },
methods: { methods: {
// 请求工资申诉入口权限,并设置显示开关
async fetchWageAppealEntrance() {
try {
this.loadingEntrance = true
const userInfo = uni.$storage.get('userInfo') || {}
const { shopMerchantId } = userInfo
// 缺少商户ID时降级为不展示
if (!shopMerchantId) {
this.wageAppealAllowed = false
return
}
const res = await uni.$api.commonApi.getWageAppealEntrance({
merchantId: shopMerchantId
})
// 兼容不同返回结构,解析是否允许显示
this.wageAppealAllowed = !!res
} catch (error) {
// 接口异常降级:不展示工资申诉入口,并提示(非打断式)
this.wageAppealAllowed = false
if (error) {
uni.showToast({
title: '工资申诉入口获取失败',
icon: 'none'
})
}
} finally {
this.loadingEntrance = false
}
},
handleClick(item) { handleClick(item) {
// 这里可以根据实际需求进行跳转或功能处理 // 这里可以根据实际需求进行跳转或功能处理
this.$emit('entranceClick', item) this.$emit('entranceClick', item)
......
<!-- 异常订单 -->
<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 \ 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 \ No newline at end of file
...@@ -56,7 +56,7 @@ export default { ...@@ -56,7 +56,7 @@ export default {
id: 7 id: 7
}, },
{ {
name: '已失效', name: '错误订单',
value: [11], value: [11],
id: 8 id: 8
}, },
......
...@@ -46,9 +46,9 @@ const screenList = [ ...@@ -46,9 +46,9 @@ const screenList = [
}, },
{ {
title: '异常标记', title: '异常标记',
componentName: 'OrderStatusList', componentName: 'ErrorOrderList',
params: { params: {
idKey: 'statusList' idKey: 'abnormalFlag'
} }
}, },
{ {
......
...@@ -73,6 +73,7 @@ import TimeList from './components/TimeList.vue' ...@@ -73,6 +73,7 @@ import TimeList from './components/TimeList.vue'
import OrderStatusList from './components/OrderStatusList.vue' import OrderStatusList from './components/OrderStatusList.vue'
import PayList from './components/PayList.vue' import PayList from './components/PayList.vue'
import CourseOptionList from './components/CourseOptionList.vue' import CourseOptionList from './components/CourseOptionList.vue'
import ErrorOrderList from './components/ErrorOrderList.vue'
export default { export default {
components: { components: {
Popup, Popup,
...@@ -80,7 +81,8 @@ export default { ...@@ -80,7 +81,8 @@ export default {
TimeList, TimeList,
OrderStatusList, OrderStatusList,
PayList, PayList,
CourseOptionList CourseOptionList,
ErrorOrderList
}, },
name: 'OrderScreen', name: 'OrderScreen',
props: { 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 \ No newline at end of file
...@@ -65,7 +65,12 @@ export default { ...@@ -65,7 +65,12 @@ export default {
name: '战败', name: '战败',
value: -1, value: -1,
id: 11 id: 11
} },
{
name: '审批中',
value: [14],
id: 12
},
]), ]),
currentId: '', currentId: '',
} }
......
...@@ -45,6 +45,13 @@ const screenList = [ ...@@ -45,6 +45,13 @@ const screenList = [
} }
}, },
{ {
title: '异常标记',
componentName: 'ErrorOrderList',
params: {
idKey: 'abnormalFlag'
}
},
{
title: '支付方式', title: '支付方式',
componentName: 'PayList', componentName: 'PayList',
params: { params: {
......
...@@ -37,6 +37,7 @@ import OrderStatusList from './components/OrderStatusList.vue' ...@@ -37,6 +37,7 @@ import OrderStatusList from './components/OrderStatusList.vue'
import PayList from './components/PayList.vue' import PayList from './components/PayList.vue'
import CourseOptionList from './components/CourseOptionList.vue' import CourseOptionList from './components/CourseOptionList.vue'
import ContractList from './components/ContractList.vue' import ContractList from './components/ContractList.vue'
import ErrorOrderList from './components/ErrorOrderList.vue'
export default { export default {
components: { components: {
Popup, Popup,
...@@ -45,7 +46,8 @@ export default { ...@@ -45,7 +46,8 @@ export default {
OrderStatusList, OrderStatusList,
PayList, PayList,
CourseOptionList, CourseOptionList,
ContractList ContractList,
ErrorOrderList
}, },
name: 'OrderScreen', name: 'OrderScreen',
props: { props: {
......
...@@ -39,7 +39,7 @@ const secretKey = { ...@@ -39,7 +39,7 @@ const secretKey = {
const domain = { const domain = {
// ip: 'http://192.168.2.94:8558', // ip: 'http://192.168.2.94:8558',
// ip: 'http://192.168.2.3:8315', // ip: 'http://192.168.2.3:8315',
ip: 'http://192.168.1.170:8315', ip: 'http://192.168.1.122:8292',
/**登录: 192.168.2.3:8315 /**登录: 192.168.2.3:8315
商城: 192.168.2.3:8558 */ 商城: 192.168.2.3:8558 */
dev: 'https://scrm.dev.glsx.com.cn', dev: 'https://scrm.dev.glsx.com.cn',
...@@ -50,7 +50,7 @@ const domain = { ...@@ -50,7 +50,7 @@ const domain = {
const djDomain = { const djDomain = {
// ip: 'http://dj.dev.glsx.com.cn', // 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', 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
......
...@@ -164,11 +164,11 @@ function requestAndroidPermission (permissionID) { ...@@ -164,11 +164,11 @@ function requestAndroidPermission (permissionID) {
}, },
['android.permission.CAMERA']: { ['android.permission.CAMERA']: {
title: '相机', title: '相机',
content: '为了拍摄活动现场照片及客户购车凭证,展业助手需要申请您的相机权限。' content: '展业助手需要申请相机权限,用于上传相关图片资料以完成业务办理。'
}, },
['android.permission.READ_EXTERNAL_STORAGE']: { ['android.permission.READ_EXTERNAL_STORAGE']: {
title: '相册', title: '相册',
content: '为了上传活动现场照片及客户购车凭证,展业助手需要申请您的相册权限。' content: '展业助手需要申请相册权限,用于上传相关图片资料以完成业务办理。'
} }
}[permissionID] || { }[permissionID] || {
title: permissionID, title: permissionID,
......
...@@ -256,5 +256,12 @@ export default { ...@@ -256,5 +256,12 @@ export default {
console.log(data, '限制录单') console.log(data, '限制录单')
return Promise.resolve(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 @@ ...@@ -39,12 +39,23 @@
</view> </view>
</view> </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="order-payType flex">
<view class="payType flex align-center"> <view class="payType flex align-center">
<view class="payType-label">订单类型</view> <view class="payType-label">订单类型</view>
<view class="payType-value flex align-center"> <view class="payType-value flex align-center">
{{ payType[orderCardDetail['selectPayType']] }} {{ payType[orderCardDetail['selectPayType']] }}
<view class="flex align-center errorTips" v-if="orderCardDetail.abnormalFlag == 'Y'"><view class="sprite-icon icon-errortips"></view>异常</view>
</view> </view>
</view> </view>
...@@ -462,6 +473,20 @@ export default { ...@@ -462,6 +473,20 @@ export default {
border-radius: toRpx(4); border-radius: toRpx(4);
border: toRpx(1) solid transparent; 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 { .info-box {
display: flex; display: flex;
......
...@@ -113,9 +113,9 @@ module.exports = { ...@@ -113,9 +113,9 @@ module.exports = {
background: '#FFF5E6' background: '#FFF5E6'
}, },
11: { 11: {
text: '已失效', text: '错误订单',
color: '#8F959E', color: '#F59619',
background: ' #F3F4F5' background: ' #FFF6EB'
}, },
10: { 10: {
text: '已关闭', text: '已关闭',
...@@ -183,7 +183,7 @@ module.exports = { ...@@ -183,7 +183,7 @@ module.exports = {
value: [10] value: [10]
}, },
{ {
name: '已失效', name: '错误订单',
value: [11] value: [11]
} }
], ],
...@@ -194,7 +194,14 @@ module.exports = { ...@@ -194,7 +194,14 @@ module.exports = {
1: '审批中', //区域运营待审核 1: '审批中', //区域运营待审核
2: '审批中', //线上运营待审核 2: '审批中', //线上运营待审核
3: '审核通过', 3: '审核通过',
4: '驳回' 4: '审批驳回'
},
orderType: {
1: '正常订单',
2: '打折策略',
3: '买赠策略',
4: '冲量活动',
5: '组合付款'
} }
} }
} }
...@@ -287,7 +287,33 @@ export default { ...@@ -287,7 +287,33 @@ export default {
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.finalPrice total_price += e.finalPrice
e.price = Number(utils.decimal(Number(e.finalPrice / e.number), 2)).toFixed(2) // 根据订单类型决定使用哪个价格:
// - 正常订单(1)和冲量活动(4):使用 totalPrice(原价)
// - 打折策略(2)、买赠策略(3)、组合付款(5):使用 finalPrice(优惠后价格)
const orderType = e.djOrderType || data.djOrderType
if (orderType === 1 || orderType === 4) {
// 正常订单或冲量活动,使用原价
if (e.totalPrice !== undefined && e.totalPrice !== null) {
e.price = Number(
utils.decimal(Number(e.totalPrice) / Number(e.number || 1), 2)
).toFixed(2)
} else if (e.finalPrice !== undefined && e.finalPrice !== null) {
e.price = Number(
utils.decimal(Number(e.finalPrice) / Number(e.number || 1), 2)
).toFixed(2)
}
} else {
// 优惠类型订单,使用优惠后价格
if (e.finalPrice !== undefined && e.finalPrice !== null) {
e.price = Number(
utils.decimal(Number(e.finalPrice) / Number(e.number || 1), 2)
).toFixed(2)
} else if (e.totalPrice !== undefined && e.totalPrice !== null) {
e.price = Number(
utils.decimal(Number(e.totalPrice) / Number(e.number || 1), 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({
...@@ -297,12 +323,46 @@ export default { ...@@ -297,12 +323,46 @@ export default {
} }
} }
data.packageGoodsList?.forEach(item => { data.packageGoodsList?.forEach(item => {
// 获取订单类型(优先使用套餐内商品的订单类型,否则使用订单级别的)
const orderType = item.packageGoodsOrderList?.[0]?.djOrderType || data.djOrderType
item.packageGoodsOrderList.forEach(g => { item.packageGoodsOrderList.forEach(g => {
g.price = g.finalPrice ? Number(g.finalPrice) / Number(g.number) : g.upgradePrice // 根据订单类型决定使用哪个价格
if (orderType === 1 || orderType === 4) {
// 正常订单或冲量活动,使用原价
if (g.totalPrice !== undefined && g.totalPrice !== null) {
g.price = Number(g.totalPrice) / Number(g.number || 1)
} else if (g.finalPrice !== undefined && g.finalPrice !== null) {
g.price = Number(g.finalPrice) / Number(g.number || 1)
} else {
g.price = g.upgradePrice || 0
}
} else {
// 优惠类型订单,使用优惠后价格
if (g.finalPrice !== undefined && g.finalPrice !== null) {
g.price = Number(g.finalPrice) / Number(g.number || 1)
} else if (g.totalPrice !== undefined && g.totalPrice !== null) {
g.price = Number(g.totalPrice) / Number(g.number || 1)
} else {
g.price = g.upgradePrice || 0
}
}
}) })
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.finalPrice) / Number(cur.number) // 根据订单类型决定使用哪个价格
const unitPrice = (orderType === 1 || orderType === 4)
? (cur.totalPrice !== undefined && cur.totalPrice !== null
? Number(cur.totalPrice) / Number(cur.number || 1)
: (cur.finalPrice !== undefined && cur.finalPrice !== null
? Number(cur.finalPrice) / Number(cur.number || 1)
: cur.price || 0))
: (cur.finalPrice !== undefined && cur.finalPrice !== null
? Number(cur.finalPrice) / Number(cur.number || 1)
: (cur.totalPrice !== undefined && cur.totalPrice !== null
? Number(cur.totalPrice) / Number(cur.number || 1)
: cur.price || 0))
return prev + unitPrice
}, 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
...@@ -524,8 +584,16 @@ export default { ...@@ -524,8 +584,16 @@ export default {
if (data) { if (data) {
console.log(`类型为:${selectPayType}`) console.log(`类型为:${selectPayType}`)
console.log(this.orderInfo) console.log(this.orderInfo)
console.log(data,'data')
if (selectPayType == 3 || selectPayType == 1) { 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 let size = 0
try { try {
const info = uni.getSystemInfoSync() const info = uni.getSystemInfoSync()
......
...@@ -416,15 +416,15 @@ export default { ...@@ -416,15 +416,15 @@ export default {
e.packageGoodsList?.forEach(item => { e.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)
}) })
if (e.packageGoodsList && e.packageGoodsList.length) { if (e.packageGoodsList && e.packageGoodsList.length) {
e.subOrderList = e.subOrderList.concat(e.packageGoodsList) e.subOrderList = e.subOrderList.concat(e.packageGoodsList)
......
...@@ -374,6 +374,12 @@ export default { ...@@ -374,6 +374,12 @@ export default {
this.list.forEach(item => { this.list.forEach(item => {
if (!item.packageGoods || !item.packageGoods.goodsList) return if (!item.packageGoods || !item.packageGoods.goodsList) return
item.packageGoods.goodsList.forEach(goods => { item.packageGoods.goodsList.forEach(goods => {
// 如果商品已经有 discountType 和 discountValue(回显数据),则跳过初始化
const hasDiscountData = goods.discountType !== undefined && goods.discountType !== null
if (hasDiscountData && goods.strategyConfig && Object.keys(goods.strategyConfig).length > 0) {
// 回显时已经有正确的 strategyConfig,不重置
return
}
// 无论 strategyConfig 是否存在,都根据新的策略类型重新初始化 // 无论 strategyConfig 是否存在,都根据新的策略类型重新初始化
if (strategyType === 'discount') { if (strategyType === 'discount') {
this.$set(goods, 'strategyConfig', { this.$set(goods, 'strategyConfig', {
......
...@@ -202,6 +202,12 @@ export default { ...@@ -202,6 +202,12 @@ export default {
this.list.forEach(item => { this.list.forEach(item => {
if (!item.goods) return if (!item.goods) return
// 如果商品已经有 discountType 和 discountValue(回显数据),则跳过初始化
const hasDiscountData = item.goods.discountType !== undefined && item.goods.discountType !== null
if (hasDiscountData && item.goods.strategyConfig && Object.keys(item.goods.strategyConfig).length > 0) {
// 回显时已经有正确的 strategyConfig,不重置
return
}
// 无论 strategyConfig 是否存在,都根据新的策略类型重新初始化 // 无论 strategyConfig 是否存在,都根据新的策略类型重新初始化
if (strategyType === 'discount') { if (strategyType === 'discount') {
this.$set(item.goods, 'strategyConfig', { this.$set(item.goods, 'strategyConfig', {
......
...@@ -118,12 +118,14 @@ export default { ...@@ -118,12 +118,14 @@ export default {
this.list.forEach(item => { this.list.forEach(item => {
if (!item.multipleSpecificationsGoods) { if (!item.multipleSpecificationsGoods) {
// 如果没有多规格商品,直接设置goods的number // 如果没有多规格商品,直接设置goods的number
if (!item.goods.number) { // 只有当 number 字段完全不存在(undefined/null)时才设置默认值,避免覆盖回显的数量
if (item.goods && (item.goods.number === undefined || item.goods.number === null)) {
this.$set(item.goods, 'number', '1') this.$set(item.goods, 'number', '1')
} }
} else if (item.multipleSpecificationsGoods) { } else if (item.multipleSpecificationsGoods) {
// 如果有多规格商品,给multipleSpecificationsGoods中的goods添加number // 如果有多规格商品,给multipleSpecificationsGoods中的goods添加number
if (!item.multipleSpecificationsGoods.number) { // 只有当 number 字段完全不存在(undefined/null)时才设置默认值,避免覆盖回显的数量
if (item.multipleSpecificationsGoods.number === undefined || item.multipleSpecificationsGoods.number === null) {
this.$set(item.multipleSpecificationsGoods, 'number', '1') this.$set(item.multipleSpecificationsGoods, 'number', '1')
} }
} }
...@@ -450,6 +452,13 @@ export default { ...@@ -450,6 +452,13 @@ export default {
if (!goods) return if (!goods) return
// 如果商品已经有 discountType 和 discountValue(回显数据),则跳过初始化
const hasDiscountData = goods.discountType !== undefined && goods.discountType !== null
if (hasDiscountData && goods.strategyConfig && Object.keys(goods.strategyConfig).length > 0) {
// 回显时已经有正确的 strategyConfig,不重置
return
}
// 无论 strategyConfig 是否存在,都根据新的策略类型重新初始化 // 无论 strategyConfig 是否存在,都根据新的策略类型重新初始化
if (strategyType === 'discount') { if (strategyType === 'discount') {
this.$set(goods, 'strategyConfig', { this.$set(goods, 'strategyConfig', {
......
...@@ -159,10 +159,10 @@ export default { ...@@ -159,10 +159,10 @@ export default {
methods: { methods: {
onInput: debounce(function(e) { onInput: debounce(function(e) {
let value = e.detail.value let value = e.detail.value
if (this.type === 'record') { if (this.popType === 'record') {
// Integer only // Integer only
value = value.replace(/[^\d]/g, '') value = value.replace(/[^\d]/g, '')
} else if (this.type === 'attendance') { } else if (this.popType === 'attendance') {
// Decimal with 2 places // Decimal with 2 places
value = value.replace(/[^\d.]/g, '') // Remove non-digits/dots value = value.replace(/[^\d.]/g, '') // Remove non-digits/dots
.replace(/^\./g, '') // No starting dot .replace(/^\./g, '') // No starting dot
...@@ -270,9 +270,9 @@ export default { ...@@ -270,9 +270,9 @@ export default {
}) })
}, },
async confirm() { async confirm() {
const { modifyCount, remark, images, otherAbnormalMessage, shopCount} = this.formData, {currentCount} = this const { modifyCount, remark, images, otherAbnormalMessage, shopCount} = this.formData, {count} = this
// 校验申诉天数是否在上个月自然日天数内 // 校验申诉天数是否在上个月自然日天数内
if (this.type == 'attendance' && modifyCount && !this.checkLastNaturalDay(modifyCount)) return if (this.popType == 'attendance' && modifyCount && !this.checkLastNaturalDay(modifyCount)) return
const { sceneType, shopMerchantId } = uni.$storage.get('userInfo') const { sceneType, shopMerchantId } = uni.$storage.get('userInfo')
const params = { const params = {
appealMonth: this.month, appealMonth: this.month,
...@@ -282,14 +282,14 @@ export default { ...@@ -282,14 +282,14 @@ export default {
if (remark) params.remark = remark if (remark) params.remark = remark
if (images.length > 0) params.attachmentList = images if (images.length > 0) params.attachmentList = images
if (otherAbnormalMessage) params.otherAbnormalMessage = otherAbnormalMessage if (otherAbnormalMessage) params.otherAbnormalMessage = otherAbnormalMessage
if (this.type == 'record') { if (this.popType == 'record') {
params.appealType = 2 params.appealType = 2
params.padRecordNum = currentCount params.padRecordNum = count
params.shopCount = shopCount params.shopCount = shopCount
if (modifyCount) params.applyPadRecordNum = modifyCount if (modifyCount) params.applyPadRecordNum = modifyCount
} else if (this.type == 'attendance') { } else if (this.popType == 'attendance') {
params.appealType = 1 params.appealType = 1
params.actualAttendanceDays = currentCount params.actualAttendanceDays = count
if (modifyCount) params.applyActualAttendanceDays = modifyCount if (modifyCount) params.applyActualAttendanceDays = modifyCount
} }
console.log(params, 'params') console.log(params, 'params')
......
<template> <template>
<view class="wage-appeal"> <view class="wage-appeal">
<view class="common-title">工资申诉{{ month }}</view> <view class="common-title">工资申诉</view>
<scroll-view scroll-y class="section"> <scroll-view scroll-y class="section">
<!-- 考勤/日报/平板录音卡片区 --> <!-- 考勤/日报/平板录音卡片区 -->
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
</view> </view>
</view> </view>
<view class="card-desc">填写驻店日报天数</view> <view class="card-desc">填写驻店日报天数</view>
<view class="deduction">扣款 <text class="amount">-{{ appealData.dailyReportDeductionAmount != null ? appealData.dailyReportDeductionAmount + '元' : '-' }}</text></view> <view class="deduction">扣款 <text :class="{'amount': appealData.dailyReportDeductionAmount != null}">{{appealData.dailyReportDeductionAmount ? '-' : ''}}{{ appealData.dailyReportDeductionAmount != null ? appealData.dailyReportDeductionAmount + '元' : '-' }}</text></view>
<view class="missing-days" v-if="appealData.missingDailyReportDates && appealData.missingDailyReportDates.length"> <view class="missing-days" v-if="appealData.missingDailyReportDates && appealData.missingDailyReportDates.length">
<text class="warning-text">缺失天数为</text> <text class="warning-content"><text v-for="(day, idx) in appealData.missingDailyReportDates" :key="idx">{{ day }}{{ idx < appealData.missingDailyReportDates.length - 1 ? '、' : '' }}</text>号</text> <text class="warning-text">缺失天数为</text> <text class="warning-content"><text v-for="(day, idx) in appealData.missingDailyReportDates" :key="idx">{{ day }}{{ idx < appealData.missingDailyReportDates.length - 1 ? '、' : '' }}</text>号</text>
</view> </view>
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
</view> </view>
</view> </view>
<view class="card-desc">触客总数为 <text :class="{'blue-text': appealData.touchCustomerTotal != null}">{{ appealData.touchCustomerTotal != null ? appealData.touchCustomerTotal + '条' : '-' }}</text></view> <view class="card-desc">触客总数为 <text :class="{'blue-text': appealData.touchCustomerTotal != null}">{{ appealData.touchCustomerTotal != null ? appealData.touchCustomerTotal + '条' : '-' }}</text></view>
<view class="deduction">扣款 <text :class="{'amount': appealData.padDeductionAmount != null}">{{ appealData.padDeductionAmount != null ? '-' + appealData.padDeductionAmount + '元' : '-' }}</text></view> <view class="deduction">扣款 <text :class="{'amount': appealData.padDeductionAmount != null}">{{ appealData.padDeductionAmount ? '-' : '' }}{{ appealData.padDeductionAmount != null ? appealData.padDeductionAmount + '元' : '-' }}</text></view>
<view v-if="appealData.padAppealable" class="action-btn" @click="handleAppeal('record')">申诉平板</view> <view v-if="appealData.padAppealable" class="action-btn" @click="handleAppeal('record')">申诉平板</view>
</view> </view>
</view> </view>
...@@ -132,9 +132,6 @@ export default { ...@@ -132,9 +132,6 @@ export default {
} }
} }
}, },
mounted() {
this.loadData(this.lastMonth)
},
methods: { methods: {
// 格式化时间 // 格式化时间
formatTime(time, formatStr) { formatTime(time, formatStr) {
...@@ -297,7 +294,6 @@ export default { ...@@ -297,7 +294,6 @@ export default {
border-radius: toRpx(32); border-radius: toRpx(32);
color: #3B73FF; color: #3B73FF;
font-size: toRpx(28); font-size: toRpx(28);
font-weight: 500;
} }
} }
......
...@@ -214,7 +214,20 @@ module.exports = { ...@@ -214,7 +214,20 @@ module.exports = {
'-1': { text: '战败', color: '#F24724', background: '#FDECE9' }, '-1': { text: '战败', color: '#F24724', background: '#FDECE9' },
9: { text: '已撤销', color: '#999999', background: 'rgba(153, 153, 153, 0.1)' }, 9: { text: '已撤销', color: '#999999', background: 'rgba(153, 153, 153, 0.1)' },
11: { text: '已失效', color: '#F7A431', background: '#FFF5E6' }, 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 { ...@@ -192,6 +192,26 @@ export default {
orderObj.price = this.divideByHundred(owner.price) orderObj.price = this.divideByHundred(owner.price)
orderObj.insurancePrice = this.divideByHundred(insurancePrice) orderObj.insurancePrice = this.divideByHundred(insurancePrice)
orderObj.quotedPriceUpdate = this.divideByHundred(quotedPriceUpdate) 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 = [] if (!data.vdQuotationGoodsList) data.vdQuotationGoodsList = []
orderObj.vdQuotationGoodsList = data.vdQuotationGoodsList.map(item => { orderObj.vdQuotationGoodsList = data.vdQuotationGoodsList.map(item => {
item.price = this.divideByHundred(item.goodsPrice) item.price = this.divideByHundred(item.goodsPrice)
...@@ -223,6 +243,63 @@ export default { ...@@ -223,6 +243,63 @@ export default {
if (e.value == 'salesType') e.current = owner.salesType if (e.value == 'salesType') e.current = owner.salesType
if (e.value == 'ownerGender') e.current = owner.ownerGender 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) => { orderObj.skuGoods = data.vdQuotationGoodsList.reduce((pre, item) => {
// 是普通商品 // 是普通商品
if (!item.packageName && !item.specificationsValue) { if (!item.packageName && !item.specificationsValue) {
...@@ -233,6 +310,14 @@ export default { ...@@ -233,6 +310,14 @@ export default {
upgradeGoodsId: item.goodsId, upgradeGoodsId: item.goodsId,
merchantGoodsId: item.goodsId, merchantGoodsId: item.goodsId,
sellPrice: this.divideByHundred(item.goodsPrice), 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, // 按商品数据对比补充详情商品最低价 minSellPrice: quotationGoodsList?.find(val => val?.goods?.merchantGoodsId == item.goodsId)?.goods?.minSellPrice, // 按商品数据对比补充详情商品最低价
validMinSellPrice: quotationGoodsList?.find(val => val?.goods?.merchantGoodsId == item.goodsId)?.goods?.validMinSellPrice // 按商品数据对比补充详情商品校验最低价字段 validMinSellPrice: quotationGoodsList?.find(val => val?.goods?.merchantGoodsId == item.goodsId)?.goods?.validMinSellPrice // 按商品数据对比补充详情商品校验最低价字段
} }
...@@ -249,7 +334,12 @@ export default { ...@@ -249,7 +334,12 @@ export default {
merchantGoodsId: item.goodsId, merchantGoodsId: item.goodsId,
upgradeGoodsId: item.goodsId, upgradeGoodsId: item.goodsId,
sellPrice: this.divideByHundred(item.goodsPrice), 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, // 按商品数据对比补充详情商品最低价 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 // 按商品数据对比补充详情商品校验最低价字段 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 { ...@@ -280,7 +370,14 @@ export default {
} }
//多规格商品 //多规格商品
if (!item.packageName && item.specificationsValue) { 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) pre = pre.concat(specificdata)
} }
...@@ -875,7 +972,10 @@ export default { ...@@ -875,7 +972,10 @@ export default {
item = item.goods item = item.goods
const sellPrice = parseFloat(item.sellPrice || 0) const sellPrice = parseFloat(item.sellPrice || 0)
const number = parseInt(item.number || 1) 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 discountFields = this.calculateDiscountFields(item, sellPrice, number, orderInfo.orderTypeCode)
const obj = { const obj = {
goodsId: item.merchantGoodsId, goodsId: item.merchantGoodsId,
...@@ -896,7 +996,8 @@ export default { ...@@ -896,7 +996,8 @@ export default {
item.goodsList.map(ele => { item.goodsList.map(ele => {
const sellPrice = parseFloat(ele.sellPrice || 0) const sellPrice = parseFloat(ele.sellPrice || 0)
const number = parseInt(item.number || 1) 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) const discountFields = this.calculateDiscountFields(ele, sellPrice, number, orderInfo.orderTypeCode)
let obj = { let obj = {
packageId: item.packageCode, packageId: item.packageCode,
...@@ -921,7 +1022,8 @@ export default { ...@@ -921,7 +1022,8 @@ export default {
const goods = multipleSpecGoods.goods const goods = multipleSpecGoods.goods
const sellPrice = parseFloat(goods.sellPrice || 0) const sellPrice = parseFloat(goods.sellPrice || 0)
const number = parseInt(multipleSpecGoods.number || 1) 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 discountFields = this.calculateDiscountFields(goods, sellPrice, number, orderInfo.orderTypeCode)
const obj = { const obj = {
goodsId: goods.merchantGoodsId, goodsId: goods.merchantGoodsId,
......
...@@ -13,13 +13,35 @@ ...@@ -13,13 +13,35 @@
</view> </view>
</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 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: status[orderCardDetail.orderStatus].color, 'background-color': status[orderCardDetail.orderStatus].background }"> <view v-else class="status text-center" :style="{ color: currentStatusConfig.color, 'background-color': currentStatusConfig.background }">
{{ status[orderCardDetail.orderStatus].text }} {{ 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> </view>
<view class="order-card-bottom-box"> <view class="order-card-bottom-box">
<view class="info-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 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 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'"> <view class="order flex align-center" v-if="item.key == 'remark' && orderCardDetail.orderStatus == '-1'">
...@@ -71,11 +93,11 @@ ...@@ -71,11 +93,11 @@
</view> </view>
</view> </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="order-label">支付金额</view>
<view class="price flex"> <view class="price flex">
<text class="unit">¥</text> <text class="unit">¥</text>
{{ orderCardDetail.quotedPriceUpdate || '' }} {{ orderCardDetail.finalPrice || '' }}
</view> </view>
<view class="refund-box" v-if="orderCardDetail.refundAmount"> <view class="refund-box" v-if="orderCardDetail.refundAmount">
部分退款 部分退款
...@@ -200,6 +222,26 @@ export default { ...@@ -200,6 +222,26 @@ export default {
status() { status() {
return order_mixins.data.orderStatusObj || {} 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() { buttonConfig() {
const config = { const config = {
showMoreBtn: false, showMoreBtn: false,
...@@ -211,6 +253,11 @@ export default { ...@@ -211,6 +253,11 @@ export default {
const order = this.orderCardDetail const order = this.orderCardDetail
const localUser = this.localUserInfo const localUser = this.localUserInfo
// 如果是审批中状态(approveStatus === 0),不显示任何操作按钮
if (order.approveStatus === 0 || order.approveStatus === '0') {
return config
}
// 超管或商户类型1不可操作 // 超管或商户类型1不可操作
if (localUser?.isSuper || localUser?.userType !== 2) { if (localUser?.isSuper || localUser?.userType !== 2) {
config.showMoreBtn = order.showInvoiceEntrance || ((order.orderStatus == 3 || order.orderStatus == 5 || (order.orderStatus == 6 && order.refundAmount)) && this.isOrder) config.showMoreBtn = order.showInvoiceEntrance || ((order.orderStatus == 3 || order.orderStatus == 5 || (order.orderStatus == 6 && order.refundAmount)) && this.isOrder)
...@@ -990,6 +1037,14 @@ export default { ...@@ -990,6 +1037,14 @@ export default {
border-radius: toRpx(4); border-radius: toRpx(4);
border: toRpx(1) solid transparent; 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 { .info-box {
display: flex; display: flex;
......
...@@ -327,7 +327,7 @@ export default { ...@@ -327,7 +327,7 @@ export default {
if (!arr) { if (!arr) {
return arr return arr
} }
var attrList = ['equityPrice', 'quotedPrice', 'quotedPriceUpdate', 'refundAmount'] var attrList = ['equityPrice', 'quotedPrice', 'quotedPriceUpdate', 'refundAmount','finalPrice']
arr.forEach(item => { arr.forEach(item => {
attrList.forEach(k => { attrList.forEach(k => {
if (item[k]) { if (item[k]) {
......
...@@ -562,14 +562,15 @@ export default { ...@@ -562,14 +562,15 @@ export default {
} }
this.$emit('changeTotalPrice') this.$emit('changeTotalPrice')
}, },
// 初始化策略配置 // 初始化策略配置(支持编辑回显)
initStrategyConfig() { initStrategyConfig() {
if (!this.list || this.list.length === 0) return if (!this.list || this.list.length === 0) return
const strategyType = this.getStrategyType({}) const strategyType = this.getStrategyType({})
// 没有策略类型时,清空所有优惠配置
if (!strategyType) { if (!strategyType) {
// 订单类型切换时,重置所有商品的策略配置
this.list.forEach(item => { this.list.forEach(item => {
// 如果是套餐商品,需要重置套餐内所有商品的策略配置 // 套餐商品:重置套餐内所有商品
if (item.goodsFlag == 3 && item.packageGoods && item.packageGoods.goodsList) { if (item.goodsFlag == 3 && item.packageGoods && item.packageGoods.goodsList) {
item.packageGoods.goodsList.forEach(goods => { item.packageGoods.goodsList.forEach(goods => {
if (goods.strategyConfig) { if (goods.strategyConfig) {
...@@ -591,7 +592,6 @@ export default { ...@@ -591,7 +592,6 @@ export default {
} }
if (goods) { if (goods) {
// 重置策略配置和优惠相关字段
if (goods.strategyConfig) { if (goods.strategyConfig) {
goods.strategyConfig = {} goods.strategyConfig = {}
} }
...@@ -604,10 +604,15 @@ export default { ...@@ -604,10 +604,15 @@ export default {
} }
this.list.forEach(item => { this.list.forEach(item => {
// 如果是套餐商品,需要初始化套餐内所有商品的策略配置 // 套餐商品:初始化套餐内所有商品的策略配置
if (item.goodsFlag == 3 && item.packageGoods && item.packageGoods.goodsList) { if (item.goodsFlag == 3 && item.packageGoods && item.packageGoods.goodsList) {
item.packageGoods.goodsList.forEach(goods => { 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') { if (strategyType === 'discount') {
this.$set(goods, 'strategyConfig', { this.$set(goods, 'strategyConfig', {
mode: 'none', mode: 'none',
...@@ -638,7 +643,12 @@ export default { ...@@ -638,7 +643,12 @@ export default {
if (!goods) return 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') { if (strategyType === 'discount') {
this.$set(goods, 'strategyConfig', { this.$set(goods, 'strategyConfig', {
mode: 'none', mode: 'none',
......
...@@ -115,6 +115,13 @@ export default { ...@@ -115,6 +115,13 @@ export default {
this.lockReason = res.lockReason this.lockReason = res.lockReason
return return
} }
// 提示锁单
const abnormalOrderLock = await this.getAbnormalOrderLock()
if (abnormalOrderLock) {
this.showErrorOrderPopup = true
// this.lockReason = abnormalOrderLock.lockReason
return
}
// 保存当前选择的组件信息,但不立即切换 // 保存当前选择的组件信息,但不立即切换
const selectedItem = item const selectedItem = item
if (this.toolComponentName === selectedItem.name && (!this.transmissionOfData || this.transmissionOfData.type !== 'supplementOrder')) return 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!