Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx
/
gl_tape
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
3
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 9f103350
authored
Jan 29, 2026
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'SAAS+V5.6.1' of
http://192.168.3.233:8090/glsx/gl_tape
into SAAS+V5.6.1
2 parents
88468d8c
18a4cd70
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
696 additions
and
93 deletions
components/ErrorOrderPopup.vue
components/HomeFrame/index.vue
mixin/interceptionMixin.js
pages/boutique/components/OrderCard.vue
pages/boutique/tool/components/CreateOrder.vue
pages/boutique/tool/components/Package.vue
pages/boutique/tool/components/Product.vue
pages/boutique/tool/components/SkuGoods.vue
pages/boutique/tool/index.vue
pages/equity/order_mixins.js
pages/equity/tool/components/CreateOrder.vue
pages/equity/tool/components/OrderCard.vue
pages/equity/tool/components/OrderPay.vue
pages/equity/tool/components/Package.vue
pages/equity/tool/components/SkuGoods.vue
pages/equity/tool/index.vue
components/ErrorOrderPopup.vue
View file @
9f10335
...
...
@@ -3,7 +3,7 @@
<view
v-if=
"show"
class=
"error-order-popup-mask"
@
click=
"handleMaskClick"
>
<view
class=
"error-order-popup-content"
:style=
"contentStyle"
@
click
.
stop
>
<!-- 顶部图片 -->
...
...
components/HomeFrame/index.vue
View file @
9f10335
...
...
@@ -124,6 +124,20 @@
<ErrorOrderPopup
:show
.
sync=
"showErrorOrderPopup"
title=
""
:width=
"848"
:height=
"870"
:topImage=
"require('@/assets/images/common/warning-notice.png')"
:topImageWidth=
"848"
:topImageHeight=
"248"
style=
"overflow: hidden"
>
<view>
<view
class=
"error-order-title"
>
异常订单提醒
</view>
<view
class=
"error-order-content"
>
存在{{ abnormalOrderCount }} 条异常订单未处理,请尽快处理!
</view>
</view>
<
template
#
footer
>
<view
class=
"flex justify-between error-order-footer"
>
<!--
<view
class=
"footer-btn cancel"
@
click=
"showErrorOrderPopup=false"
>
取消
</view>
-->
<view
class=
"footer-btn sure flex-1"
@
click=
"showErrorOrderPopup=false"
>
好的
</view>
</view>
</
template
>
</ErrorOrderPopup>
</view>
</template>
...
...
@@ -238,16 +252,16 @@ export default {
},
lockReason
:
0
,
errorMsg
:
''
,
showErrorOrderPopup
:
false
showErrorOrderPopup
:
false
,
abnormalOrderCount
:
0
,
}
},
beforeDestroy
()
{
// 组件销毁前移除监听
uni
.
$logger
.
local
.
info
(
'levelStudyPopup 移除监听'
)
uni
.
$off
(
'levelStudyPopup'
)
// uni.$off('showStudyPopup')
},
mounted
()
{
async
mounted
()
{
uni
.
$logger
.
local
.
info
(
'levelStudyPopup 开始监听mounted'
)
uni
.
$on
(
'levelStudyPopup'
,
obj
=>
{
uni
.
$logger
.
local
.
info
(
'接收到学习弹窗事件'
,
obj
)
...
...
@@ -256,6 +270,13 @@ export default {
const
userInfo
=
uni
.
$storage
.
get
(
'userInfo'
)
||
{}
this
.
userInfo
=
userInfo
if
(
this
.
checkRecordAudio
)
permision
.
requestAndroidPermission
(
'android.permission.RECORD_AUDIO'
)
// 进入界面时检查权限
// 检查是否锁单
const
{
abnormalOrderNum
}
=
await
this
.
getAbnormalOrderLock
()
if
(
abnormalOrderNum
>
0
)
{
this
.
showErrorOrderPopup
=
true
this
.
abnormalOrderCount
=
abnormalOrderNum
return
}
},
provide
()
{
return
{
...
...
@@ -629,13 +650,6 @@ export default {
this
.
lockReason
=
res
.
lockReason
return
}
// 检查是否锁单
const
abnormalOrderLock
=
await
this
.
getAbnormalOrderLock
()
if
(
abnormalOrderLock
)
{
this
.
showErrorOrderPopup
=
true
// this.lockReason = abnormalOrderLock.lockReason
return
}
}
if
(
await
this
.
checkDailyReport
(
sceneType
!=
7
))
return
}
...
...
@@ -697,6 +711,15 @@ export default {
this
.
$refs
.
errorRef
.
open
()
}
this
.
$refs
.
leftBox
.
handleActivityCenter
()
},
handleErrorOrderPopupSure
(){
let
pageName
=
{
0
:
'equity'
,
1
:
'boutique'
,
}[
this
.
sceneType
]
uni
.
navigateTo
({
url
:
`/pages/
${
pageName
}
/tool/index?componentName=OrderManagement`
})
}
}
}
...
...
@@ -968,4 +991,48 @@ export default {
z-index
:
999999
;
position
:
fixed
;
}
.error-order-title
{
text-align
:
center
;
color
:
#333333
;
font-size
:
toRpx
(
40
);
font-weight
:
500
;
}
.error-order-content
{
text-align
:
center
;
color
:
#666666
;
font-size
:
toRpx
(
32
);
font-weight
:
400
;
margin-top
:
toRpx
(
16
);
}
.error-order-footer
{
margin-top
:
toRpx
(
64
);
margin-bottom
:
toRpx
(
48
);
width
:
100%
;
.cancel{
height
:
toRpx
(
88
);
border-radius
:
toRpx
(
64
);
opacity
:
1
;
line-height
:
toRpx
(
88
);
background
:
#f0f1f5
;
width
:
toRpx
(
344
);
text-align
:
center
;
color
:
#1a1a1a
;
font-size
:
toRpx
(
32
);
font-weight
:
400
;
}
.sure
{
height
:
toRpx
(
88
);
border-radius
:
toRpx
(
64
);
opacity
:
1
;
line-height
:
toRpx
(
88
);
background
:
linear-gradient
(
0deg
,
#2c66f7
0%
,
#48a6ff
100%
);
color
:
#fff
;
font-size
:
toRpx
(
32
);
font-weight
:
500
;
width
:
100%
;
text-align
:
center
;
margin-left
:
toRpx
(
32
);
margin-right
:
toRpx
(
32
);
}
}
</
style
>
mixin/interceptionMixin.js
View file @
9f10335
...
...
@@ -260,8 +260,7 @@ export default {
const
data
=
await
uni
.
$api
.
commonApi
.
getAbnormalOrderLock
()
if
(
data
)
console
.
log
(
data
,
'异常订单锁单信息'
)
const
isLock
=
data
.
lockOrderFlag
==
"Y"
?
true
:
false
return
Promise
.
resolve
(
isLock
)
return
Promise
.
resolve
(
data
)
},
}
}
pages/boutique/components/OrderCard.vue
View file @
9f10335
...
...
@@ -39,14 +39,14 @@
</view>
</view>
</view>
<view
class=
"flex errorBox"
v-if=
"orderCardDetail.status == 11"
>
<view
class=
"flex errorBox"
v-if=
"orderCardDetail.status == 11
&&orderCardDetail.associatedOrderCode
"
>
<view
class=
"order-list align-center flex-1"
>
<text>
原错误订单编号
</text>
<text>
{{
orderCardDetail
.
associatedOrderCode
}}
</text>
<text
class=
"priceName"
>
{{
orderCardDetail
.
associatedOrderCode
}}
</text>
</view>
<view
class=
"order-list align-center flex-1"
>
<text>
原错误订单总价
</text>
<text
>
¥2560
</text>
<text
class=
"priceName"
>
¥
{{
orderCardDetail
.
associatedOrderCodeFinalPrice
}}
</text>
</view>
</view>
<!-- 支付方式 -->
...
...
@@ -487,7 +487,12 @@ export default {
font-weight
:
400
;
margin-left
:
toRpx
(
16
);
}
.priceName
{
color
:
#5a5e66
;
font-size
:
toRpx
(
24
);
font-weight
:
400
;
margin-left
:
toRpx
(
30
);
}
.info-box
{
display
:
flex
;
flex-wrap
:
wrap
;
...
...
pages/boutique/tool/components/CreateOrder.vue
View file @
9f10335
...
...
@@ -4,27 +4,41 @@
<view
class=
"box"
>
<scroll-view
class=
"scroll-view"
scroll-y=
"true"
>
<view
class=
"box-content"
>
<GlCell
:formList=
"formList"
:formData=
"orderObj"
@
radioChange=
"radioChange"
@
inputBlur=
"inputBlur"
@
handleCell=
"handleCell"
>
<GlCell
:formList=
"formList"
:formData=
"orderObj"
@
radioChange=
"radioChange"
@
inputBlur=
"inputBlur"
@
handleCell=
"handleCell"
>
<template
slot=
"frontGear"
>
<Product
v-if=
"orderObj.frontGear"
@
changeTotalPrice=
"changeTotalPrice"
:list=
"orderObj.frontGear"
:positionTypeList=
"positionTypeList"
:baseConfigData=
"baseConfigData"
:orderTypeCode=
"orderObj.orderTypeCode"
></Product>
<Product
v-if=
"orderObj.frontGear"
@
changeTotalPrice=
"changeTotalPrice"
:list=
"orderObj.frontGear"
:positionTypeList=
"positionTypeList"
:baseConfigData=
"baseConfigData"
:orderTypeCode=
"orderObj.orderTypeCode"
></Product>
</
template
>
<
template
slot=
"frontWindow"
>
<Product
v-if=
"orderObj.frontWindow"
@
changeTotalPrice=
"changeTotalPrice"
:list=
"orderObj.frontWindow"
:positionTypeList=
"positionTypeList"
:baseConfigData=
"baseConfigData"
:orderTypeCode=
"orderObj.orderTypeCode"
></Product>
<Product
v-if=
"orderObj.frontWindow"
@
changeTotalPrice=
"changeTotalPrice"
:list=
"orderObj.frontWindow"
:positionTypeList=
"positionTypeList"
:baseConfigData=
"baseConfigData"
:orderTypeCode=
"orderObj.orderTypeCode"
></Product>
</
template
>
<
template
slot=
"rearWindow"
>
<Product
v-if=
"orderObj.rearWindow"
@
changeTotalPrice=
"changeTotalPrice"
:list=
"orderObj.rearWindow"
:positionTypeList=
"positionTypeList"
:baseConfigData=
"baseConfigData"
:orderTypeCode=
"orderObj.orderTypeCode"
></Product>
<Product
v-if=
"orderObj.rearWindow"
@
changeTotalPrice=
"changeTotalPrice"
:list=
"orderObj.rearWindow"
:positionTypeList=
"positionTypeList"
:baseConfigData=
"baseConfigData"
:orderTypeCode=
"orderObj.orderTypeCode"
></Product>
</
template
>
<
template
slot=
"rearGear"
>
<Product
v-if=
"orderObj.rearGear"
@
changeTotalPrice=
"changeTotalPrice"
:list=
"orderObj.rearGear"
:positionTypeList=
"positionTypeList"
:baseConfigData=
"baseConfigData"
:orderTypeCode=
"orderObj.orderTypeCode"
></Product>
<Product
v-if=
"orderObj.rearGear"
@
changeTotalPrice=
"changeTotalPrice"
:list=
"orderObj.rearGear"
:positionTypeList=
"positionTypeList"
:baseConfigData=
"baseConfigData"
:orderTypeCode=
"orderObj.orderTypeCode"
></Product>
</
template
>
<
template
slot=
"sunRoof"
>
<Product
v-if=
"orderObj.sunRoof"
@
changeTotalPrice=
"changeTotalPrice"
:list=
"orderObj.sunRoof"
:positionTypeList=
"positionTypeList"
:baseConfigData=
"baseConfigData"
:orderTypeCode=
"orderObj.orderTypeCode"
></Product>
<Product
v-if=
"orderObj.sunRoof"
@
changeTotalPrice=
"changeTotalPrice"
:list=
"orderObj.sunRoof"
:positionTypeList=
"positionTypeList"
:baseConfigData=
"baseConfigData"
:orderTypeCode=
"orderObj.orderTypeCode"
></Product>
</
template
>
<
template
slot=
"package"
>
<Package
v-if=
"orderObj.package"
@
changeTotalPrice=
"changeTotalPrice"
:list=
"orderObj.package"
:positionTypeList=
"positionTypeList"
:orderTypeCode=
"orderObj.orderTypeCode"
></Package>
<Package
v-if=
"orderObj.package"
@
changeTotalPrice=
"changeTotalPrice"
:list=
"orderObj.package"
:positionTypeList=
"positionTypeList"
:orderTypeCode=
"orderObj.orderTypeCode"
></Package>
</
template
>
<
template
slot=
"skuGoods"
>
<SkuGoods
v-if=
"orderObj.skuGoods"
:list=
"orderObj.skuGoods"
@
changeTotalPrice=
"changeTotalPrice"
:positionTypeList=
"positionTypeList"
:baseConfigData=
"baseConfigData"
:orderTypeCode=
"orderObj.orderTypeCode"
></SkuGoods>
<SkuGoods
v-if=
"orderObj.skuGoods"
:list=
"orderObj.skuGoods"
@
changeTotalPrice=
"changeTotalPrice"
:positionTypeList=
"positionTypeList"
:baseConfigData=
"baseConfigData"
:orderTypeCode=
"orderObj.orderTypeCode"
></SkuGoods>
<view
class=
"total"
v-if=
"totalPrice > 0"
>
<view
class=
"total-left"
>
总价
</view>
<view
class=
"total-right"
>
¥
{{
totalPrice
}}
</view>
...
...
@@ -39,7 +53,8 @@
</scroll-view>
</view>
<!-- 弹窗 -->
<order-popup
ref=
"orderPopup"
:data=
"orderObj"
:dataKey=
"valueKey"
@
onConfirm=
"onConfirm"
:externalData=
"externalData"
:popupType=
"popupType"
/>
<order-popup
ref=
"orderPopup"
:data=
"orderObj"
:dataKey=
"valueKey"
@
onConfirm=
"onConfirm"
:externalData=
"externalData"
:popupType=
"popupType"
/>
</view>
</template>
...
...
@@ -493,7 +508,7 @@ export default {
}
this
.
getShopMerchantPointConfig
(
this
.
orderObj
.
merchantId
)
this
.
getSubShopMerchantList
(
this
.
orderObj
.
merchantId
)
this
.
getSetting
()
// 补录订单默认为嘀加收款,不需要获取园区店支付方式
if
(
this
.
orderCreateType
==
'supplementOrder'
)
{
...
...
@@ -522,8 +537,11 @@ export default {
}
cell
.
radioList
[
1
].
disabled
=
false
}
// 兼容:如果方法不存在则不调用,避免运行时报错
if
(
typeof
this
.
getConfig
===
'function'
)
{
this
.
getConfig
()
}
}
// this.getEmployeeList()
this
.
getSelectOrderGoodsList
()
this
.
getPositionList
()
...
...
@@ -898,7 +916,17 @@ export default {
return
}
if
(
!
(
await
this
.
checkDailyReport
())
&&!
(
await
this
.
getAbnormalOrderLock
()))
{
// 日报 / 异常订单锁单校验
const
hasInterception
=
await
this
.
checkDailyReport
()
if
(
hasInterception
)
{
return
}
const
{
abnormalOrderNum
,
lockOrderFlag
}
=
await
this
.
getAbnormalOrderLock
()
if
(
abnormalOrderNum
>
0
&&
lockOrderFlag
===
'Y'
)
{
uni
.
$emit
(
'showErrorOrderPopup'
,
{
abnormalOrderNum
})
return
}
const
{
orderCreateType
}
=
this
const
obj
=
utils
.
deepClone
(
this
.
orderObj
)
const
otherCustomer
=
[
'standNo'
,
'plateNumber'
,
'customerSex'
,
'experienceFlag'
,
'salesType'
]
...
...
@@ -1014,7 +1042,6 @@ export default {
}
this
.
$emit
(
'jump'
,
orderCreateType
==
'supplementOrder'
?
'OrderDetail'
:
'ConfirmOrder'
,
res
)
}
}
},
// 计算所有产品的总价
changeTotalPrice
()
{
...
...
@@ -1125,7 +1152,7 @@ export default {
notUpgradeExperience
:
'foEfRequiredFlag'
,
notUpgradeRejectionReason
:
'foRrRequiredFlag'
}
;
(
data
.
orderFieldSettingList
||
[]).
forEach
(
e
=>
{
;
(
data
.
orderFieldSettingList
||
[]).
forEach
(
e
=>
{
const
key
=
keyMap
[
e
.
fieldKey
]
||
e
.
fieldKey
YQorderSetting
[
key
]
=
e
.
isRequired
?
'Y'
:
'N'
})
...
...
pages/boutique/tool/components/Package.vue
View file @
9f10335
...
...
@@ -80,6 +80,45 @@ export default {
}
},
methods
:
{
// 验证价格输入(修改套餐内单个商品单价)
validatePrice
(
event
,
goods
,
goodsIndex
,
packageIndex
)
{
let
value
=
event
.
detail
.
value
// 如果为空则设置为0
if
(
!
value
||
value
.
trim
()
===
''
)
{
value
=
'0'
}
// 限制只能输入数字和小数点
value
=
value
.
replace
(
/
[^\d
.
]
/g
,
''
)
// 限制只能有一个小数点
if
(
value
.
split
(
'.'
).
length
>
2
)
{
value
=
value
.
slice
(
0
,
value
.
lastIndexOf
(
'.'
))
+
value
.
slice
(
value
.
lastIndexOf
(
'.'
)
+
1
)
}
// 限制最多两位小数
if
(
value
.
includes
(
'.'
))
{
const
parts
=
value
.
split
(
'.'
)
if
(
parts
[
1
].
length
>
2
)
{
parts
[
1
]
=
parts
[
1
].
substring
(
0
,
2
)
value
=
parts
.
join
(
'.'
)
}
}
// 限制最大值为100000
if
(
parseFloat
(
value
)
>
100000
)
{
value
=
'100000'
}
// 限制最小值为0
if
(
parseFloat
(
value
)
<
0
||
parseFloat
(
value
)
==
0
)
{
value
=
'0'
}
// 更新商品单价
this
.
$set
(
this
.
list
[
packageIndex
].
packageGoods
.
goodsList
[
goodsIndex
],
'sellPrice'
,
value
)
// 价格变动时,清空该商品的折扣/抵扣配置,并按原价重算 finalPrice
this
.
resetStrategyWhenPriceChange
(
this
.
list
[
packageIndex
].
packageGoods
.
goodsList
[
goodsIndex
],
this
.
list
[
packageIndex
])
// 重新计算套餐总价
this
.
$emit
(
'changeTotalPrice'
)
},
// 初始化商品数量方法
initProductNumbers
()
{
if
(
this
.
list
&&
this
.
list
.
length
>
0
)
{
...
...
@@ -184,6 +223,10 @@ export default {
}
// 更新值
this
.
$set
(
this
.
list
[
index
].
packageGoods
.
goodsList
[
ind
],
'sellPrice'
,
value
)
// 价格变动时,清空该商品的折扣/买赠/抵扣配置,并按原价重算 finalPrice
this
.
resetStrategyWhenPriceChange
(
this
.
list
[
index
].
packageGoods
.
goodsList
[
ind
],
this
.
list
[
index
])
this
.
$emit
(
'changeTotalPrice'
)
},
// 删除商品
...
...
@@ -339,6 +382,31 @@ export default {
}
this
.
$emit
(
'changeTotalPrice'
)
},
// 商品价格变动时,清空当前套餐内单个商品的折扣/抵扣配置,并重算 finalPrice
resetStrategyWhenPriceChange
(
goods
,
item
)
{
if
(
!
goods
)
return
const
strategyConfig
=
goods
.
strategyConfig
||
{}
// 重置策略为无优惠,买赠强制为非赠品
this
.
$set
(
goods
,
'strategyConfig'
,
{
mode
:
'none'
,
discountRatio
:
''
,
discountAmount
:
''
,
isGift
:
'0'
,
deductAmount
:
''
})
this
.
$set
(
goods
,
'discountType'
,
null
)
this
.
$set
(
goods
,
'discountValue'
,
null
)
this
.
$set
(
goods
,
'discountAmount'
,
null
)
// 按当前单价和套餐数量,重新计算无优惠时的 finalPrice
const
unitPrice
=
parseFloat
(
goods
.
sellPrice
||
0
)
const
number
=
parseInt
(
item
?.
packageGoods
?.
number
||
1
)
const
totalFinalPrice
=
Math
.
round
(
unitPrice
*
number
*
100
)
/
100
this
.
$set
(
goods
,
'finalPricePerUnit'
,
unitPrice
)
this
.
$set
(
goods
,
'finalPrice'
,
totalFinalPrice
)
},
// 重新计算套餐内所有商品的 finalPrice(当数量改变时调用)
recalculateFinalPriceForPackage
(
item
)
{
const
number
=
parseInt
(
item
.
packageGoods
.
number
||
1
)
...
...
pages/boutique/tool/components/Product.vue
View file @
9f10335
...
...
@@ -290,8 +290,11 @@ export default {
value
=
item
.
goods
.
minSellPrice
.
toString
()
}
// 更新值
// this.$set(item.goods, 'sellPrice', value)
this
.
$set
(
this
.
list
[
index
].
goods
,
'sellPrice'
,
value
)
// 商品价格修改时,清空折扣 / 抵扣配置,避免旧的优惠继续生效
this
.
resetStrategyWhenPriceChange
(
this
.
list
[
index
])
// 价格变化时,如果已选择订单类型,触发策略组件重新计算价格
this
.
$forceUpdate
()
this
.
$emit
(
'changeTotalPrice'
)
...
...
@@ -327,6 +330,33 @@ export default {
this
.
recalculateFinalPrice
(
item
)
this
.
$emit
(
'changeTotalPrice'
)
},
// 商品价格变动时,清空当前商品的折扣/抵扣配置,并重算 finalPrice
resetStrategyWhenPriceChange
(
item
)
{
if
(
!
item
||
!
item
.
goods
)
return
const
goods
=
item
.
goods
// 重置内部 strategyConfig
const
strategyConfig
=
goods
.
strategyConfig
||
{}
this
.
$set
(
goods
,
'strategyConfig'
,
{
mode
:
'none'
,
discountRatio
:
''
,
discountAmount
:
''
,
// 买赠:强制恢复为非赠品
isGift
:
'0'
,
deductAmount
:
''
})
// 同时清空用于提交/回显的折扣字段
this
.
$set
(
goods
,
'discountType'
,
null
)
this
.
$set
(
goods
,
'discountValue'
,
null
)
this
.
$set
(
goods
,
'discountAmount'
,
null
)
// 按当前单价和数量,重新计算无优惠时的 finalPrice
const
unitPrice
=
parseFloat
(
goods
.
sellPrice
||
0
)
const
number
=
parseInt
(
goods
.
number
||
1
)
const
totalFinalPrice
=
Math
.
round
(
unitPrice
*
number
*
100
)
/
100
this
.
$set
(
goods
,
'finalPricePerUnit'
,
unitPrice
)
this
.
$set
(
goods
,
'finalPrice'
,
totalFinalPrice
)
},
// 减少数量
decreaseNumber
(
item
)
{
// 如果商品数量不存在或小于等于1,设置为1
...
...
pages/boutique/tool/components/SkuGoods.vue
View file @
9f10335
...
...
@@ -202,6 +202,48 @@ export default {
}
this
.
$emit
(
'changeTotalPrice'
)
},
// 验证价格输入
validatePrice
(
event
,
item
,
index
)
{
let
value
=
event
.
detail
.
value
// 如果为空则设置为0
if
(
!
value
||
value
.
trim
()
===
''
)
{
value
=
'0'
}
// 限制只能输入数字和小数点
value
=
value
.
replace
(
/
[^\d
.
]
/g
,
''
)
// 限制只能有一个小数点
if
(
value
.
split
(
'.'
).
length
>
2
)
{
value
=
value
.
slice
(
0
,
value
.
lastIndexOf
(
'.'
))
+
value
.
slice
(
value
.
lastIndexOf
(
'.'
)
+
1
)
}
// 限制最多两位小数
if
(
value
.
includes
(
'.'
))
{
const
parts
=
value
.
split
(
'.'
)
if
(
parts
[
1
].
length
>
2
)
{
parts
[
1
]
=
parts
[
1
].
substring
(
0
,
2
)
value
=
parts
.
join
(
'.'
)
}
}
// 限制最大值为100000
if
(
parseFloat
(
value
)
>
100000
)
{
value
=
'100000'
}
// 限制最小值为0
if
(
parseFloat
(
value
)
<
0
||
parseFloat
(
value
)
==
0
)
{
value
=
'0'
}
// 更新价格到对应商品
if
(
item
.
multipleSpecificationsGoods
&&
item
.
multipleSpecificationsGoods
.
goods
)
{
this
.
$set
(
this
.
list
[
index
].
multipleSpecificationsGoods
.
goods
,
'sellPrice'
,
value
)
}
else
if
(
item
.
goods
)
{
this
.
$set
(
this
.
list
[
index
].
goods
,
'sellPrice'
,
value
)
}
// 商品价格修改时,清空折扣 / 抵扣配置
this
.
resetStrategyWhenPriceChange
(
this
.
list
[
index
])
this
.
$emit
(
'changeTotalPrice'
)
},
// 验证数量输入
validateNumber
(
event
,
item
)
{
let
value
=
event
.
detail
.
value
...
...
@@ -285,6 +327,42 @@ export default {
this
.
list
.
splice
(
index
,
1
)
this
.
$emit
(
'changeTotalPrice'
)
},
// 商品价格变动时,清空当前商品的折扣/抵扣配置,并重算 finalPrice
resetStrategyWhenPriceChange
(
item
)
{
if
(
!
item
)
return
let
goods
=
null
if
(
item
.
multipleSpecificationsGoods
&&
item
.
multipleSpecificationsGoods
.
goods
)
{
goods
=
item
.
multipleSpecificationsGoods
.
goods
}
else
if
(
item
.
goods
)
{
goods
=
item
.
goods
}
if
(
!
goods
)
return
const
strategyConfig
=
goods
.
strategyConfig
||
{}
this
.
$set
(
goods
,
'strategyConfig'
,
{
mode
:
'none'
,
discountRatio
:
''
,
discountAmount
:
''
,
// 买赠:强制恢复为非赠品
isGift
:
'0'
,
deductAmount
:
''
})
this
.
$set
(
goods
,
'discountType'
,
null
)
this
.
$set
(
goods
,
'discountValue'
,
null
)
this
.
$set
(
goods
,
'discountAmount'
,
null
)
// 按当前单价和数量,重新计算无优惠时的 finalPrice
const
unitPrice
=
parseFloat
(
goods
.
sellPrice
||
0
)
let
number
=
1
if
(
item
.
multipleSpecificationsGoods
&&
item
.
multipleSpecificationsGoods
.
number
)
{
number
=
parseInt
(
item
.
multipleSpecificationsGoods
.
number
||
1
)
}
else
if
(
item
.
goods
&&
item
.
goods
.
number
)
{
number
=
parseInt
(
item
.
goods
.
number
||
1
)
}
const
totalFinalPrice
=
Math
.
round
(
unitPrice
*
number
*
100
)
/
100
this
.
$set
(
goods
,
'finalPricePerUnit'
,
unitPrice
)
this
.
$set
(
goods
,
'finalPrice'
,
totalFinalPrice
)
},
// 根据订单类型获取策略类型
getStrategyType
(
item
)
{
const
orderType
=
String
(
this
.
orderTypeCode
||
''
)
...
...
pages/boutique/tool/index.vue
View file @
9f10335
...
...
@@ -66,6 +66,30 @@
<StudyPopup
:show
.
sync=
"showStudyPermissionPopup"
title=
""
:width=
"848"
:height=
"870"
:topImage=
"require('@/assets/images/common/warning-notice.png')"
:topImageWidth=
"848"
:topImageHeight=
"248"
style=
"overflow: hidden"
>
<StudyCenterPermissionPopup
:lockReason=
"lockReason"
@
confirm=
"handleStudyPermissionConfirm"
/>
</StudyPopup>
<!-- 异常订单锁单弹窗,样式与车险工具页保持一致 -->
<ErrorOrderPopup
:show
.
sync=
"showErrorOrderPopup"
title=
""
:width=
"848"
:height=
"870"
:topImage=
"require('@/assets/images/common/warning-notice.png')"
:topImageWidth=
"848"
:topImageHeight=
"248"
style=
"overflow: hidden"
>
<view>
<view
class=
"error-order-title"
>
异常订单提醒
</view>
<view
class=
"error-order-content"
>
存在{{ abnormalOrderCount }} 条异常订单未处理,请尽快处理!
</view>
</view>
<
template
#
footer
>
<view
class=
"flex justify-between error-order-footer"
>
<view
class=
"footer-btn sure flex-1"
@
click=
"showErrorOrderPopup = false"
>
好的
</view>
</view>
</
template
>
</ErrorOrderPopup>
</view>
</template>
...
...
@@ -85,6 +109,7 @@ import StudyPopup from '@/components/StudyPopup.vue'
import
StudyCenterPermissionPopup
from
'@/components/StudyCenterPermissionPopup.vue'
import
WageAppeal
from
'../../common/wageAppeal/index.vue'
import
MonthCalendar
from
'../../common/components/MonthCalendar.vue'
import
ErrorOrderPopup
from
'@/components/ErrorOrderPopup.vue'
export
default
{
mixins
:
[
interceptionMixin
],
...
...
@@ -101,7 +126,8 @@ export default {
StudyPopup
,
StudyCenterPermissionPopup
,
WageAppeal
,
MonthCalendar
MonthCalendar
,
ErrorOrderPopup
},
data
()
{
return
{
...
...
@@ -114,6 +140,9 @@ export default {
lockReason
:
''
,
showStudyPermissionPopup
:
false
,
lastMonth
:
dayjs
().
subtract
(
1
,
'month'
).
format
(
'YYYY-MM'
),
// 异常订单锁单弹窗
showErrorOrderPopup
:
false
,
abnormalOrderCount
:
0
,
enterType
:
''
,
}
},
...
...
@@ -125,6 +154,21 @@ export default {
this
.
toolComponentName
=
'DailyReport'
if
(
currentDate
)
this
.
setCurrentDate
(
currentDate
)
})
// 监听异常订单锁单事件(来自 CreateOrder.vue)
uni
.
$on
(
'showErrorOrderPopup'
,
payload
=>
{
try
{
const
abnormalOrderNum
=
payload
&&
typeof
payload
===
'object'
?
payload
.
abnormalOrderNum
:
payload
if
(
abnormalOrderNum
>
0
)
{
this
.
showErrorOrderPopup
=
true
this
.
abnormalOrderCount
=
abnormalOrderNum
}
}
catch
(
e
)
{
console
.
error
(
'showErrorOrderPopup 事件处理异常:'
,
e
)
}
})
},
onUnload
()
{
uni
.
$off
(
'showErrorOrderPopup'
)
},
methods
:
{
setCurrentDate
(
currentDate
)
{
...
...
@@ -258,4 +302,48 @@ export default {
font-size
:
toRpx
(
34
);
}
}
.error-order-title
{
text-align
:
center
;
color
:
#333333
;
font-size
:
toRpx
(
40
);
font-weight
:
500
;
}
.error-order-content
{
text-align
:
center
;
color
:
#666666
;
font-size
:
toRpx
(
32
);
font-weight
:
400
;
margin-top
:
toRpx
(
16
);
}
.error-order-footer
{
margin-top
:
toRpx
(
64
);
margin-bottom
:
toRpx
(
48
);
width
:
100%
;
.cancel{
height
:
toRpx
(
88
);
border-radius
:
toRpx
(
64
);
opacity
:
1
;
line-height
:
toRpx
(
88
);
background
:
#f0f1f5
;
width
:
toRpx
(
344
);
text-align
:
center
;
color
:
#1a1a1a
;
font-size
:
toRpx
(
32
);
font-weight
:
400
;
}
.sure
{
height
:
toRpx
(
88
);
border-radius
:
toRpx
(
64
);
opacity
:
1
;
line-height
:
toRpx
(
88
);
background
:
linear-gradient
(
0deg
,
#2c66f7
0%
,
#48a6ff
100%
);
color
:
#fff
;
font-size
:
toRpx
(
32
);
font-weight
:
500
;
width
:
100%
;
text-align
:
center
;
margin-left
:
toRpx
(
32
);
margin-right
:
toRpx
(
32
);
}
}
</
style
>
pages/equity/order_mixins.js
View file @
9f10335
...
...
@@ -213,7 +213,7 @@ module.exports = {
5
:
{
text
:
'已完成'
,
color
:
'#2CCA74'
,
background
:
'#EAF9F1'
},
'-1'
:
{
text
:
'战败'
,
color
:
'#F24724'
,
background
:
'#FDECE9'
},
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'
},
14
:
{
text
:
'审批中'
,
color
:
'#FF9D0A'
,
background
:
'#FFF5E6'
}
},
...
...
pages/equity/tool/components/CreateOrder.vue
View file @
9f10335
...
...
@@ -417,7 +417,9 @@ export default {
const
{
paramsData
}
=
this
this
.
getSelectOrderGoodsList
()
if
(
!
paramsData
.
id
)
this
.
getConfig
()
this
.
getShopMerchantPointConfig
()
this
.
orderSettingList
()
},
async
orderSettingList
()
{
...
...
@@ -793,6 +795,14 @@ export default {
},
async
submit
()
{
if
(
!
this
.
checkRequired
()
||
(
await
this
.
checkDailyReport
()))
return
// 检查是否锁单:如果有异常订单锁单,触发 HomeFrame 的错误订单弹窗
const
{
abnormalOrderNum
,
lockOrderFlag
}
=
await
this
.
getAbnormalOrderLock
()
if
(
abnormalOrderNum
>
0
&&
lockOrderFlag
==
'Y'
)
{
uni
.
$emit
(
'showErrorOrderPopup'
,
{
abnormalOrderNum
})
return
}
if
(
!
this
.
checkOrderStrategyAndTotal
())
return
this
.
handleSecondConfirmCheck
(
true
)
},
...
...
@@ -972,10 +982,10 @@ export default {
item
=
item
.
goods
const
sellPrice
=
parseFloat
(
item
.
sellPrice
||
0
)
const
number
=
parseInt
(
item
.
number
||
1
)
// finalPrice 存在时为“
分”,但可能为 null(表示无优惠)
// finalPrice 存在时为“
元”,表示该 SKU 按当前策略计算后的总价
// 仅当 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
finalPrice
=
hasValidFinalPrice
?
parseFloat
(
item
.
finalPrice
)
:
this
.
calculateFinalPrice
(
item
,
sellPrice
,
number
,
orderInfo
.
orderTypeCode
)
const
discountFields
=
this
.
calculateDiscountFields
(
item
,
sellPrice
,
number
,
orderInfo
.
orderTypeCode
)
const
obj
=
{
goodsId
:
item
.
merchantGoodsId
,
...
...
@@ -984,6 +994,7 @@ export default {
specificationsName
:
item
.
specificationNameSequence
,
specificationsValue
:
item
.
specificationData
?
item
.
specificationData
.
replace
(
/;~;/g
,
'/'
)
:
''
,
goodsPrice
:
this
.
multipliedByHundred
(
item
.
sellPrice
),
// 后端使用“分”单位,这里将元转为分
finalPrice
:
this
.
multipliedByHundred
(
finalPrice
),
discountType
:
discountFields
.
discountType
,
discountValue
:
discountFields
.
discountValue
...
...
@@ -997,7 +1008,7 @@ export default {
const
sellPrice
=
parseFloat
(
ele
.
sellPrice
||
0
)
const
number
=
parseInt
(
item
.
number
||
1
)
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
finalPrice
=
hasValidFinalPrice
?
parseFloat
(
ele
.
finalPrice
)
:
this
.
calculateFinalPrice
(
ele
,
sellPrice
,
number
,
orderInfo
.
orderTypeCode
)
const
discountFields
=
this
.
calculateDiscountFields
(
ele
,
sellPrice
,
number
,
orderInfo
.
orderTypeCode
)
let
obj
=
{
packageId
:
item
.
packageCode
,
...
...
@@ -1023,7 +1034,7 @@ export default {
const
sellPrice
=
parseFloat
(
goods
.
sellPrice
||
0
)
const
number
=
parseInt
(
multipleSpecGoods
.
number
||
1
)
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
finalPrice
=
hasValidFinalPrice
?
parseFloat
(
goods
.
finalPrice
)
:
this
.
calculateFinalPrice
(
goods
,
sellPrice
,
number
,
orderInfo
.
orderTypeCode
)
const
discountFields
=
this
.
calculateDiscountFields
(
goods
,
sellPrice
,
number
,
orderInfo
.
orderTypeCode
)
const
obj
=
{
goodsId
:
goods
.
merchantGoodsId
,
...
...
@@ -1074,7 +1085,7 @@ export default {
changeTotalPrice
()
{
let
total
=
0
const
orderType
=
String
(
this
.
orderObj
.
orderTypeCode
||
''
)
// 判断是否使用优惠后的价格:'2' 打折策略、'3' 买赠策略、'5' 组合付款使用优惠后的价格
// 打折(2)/ 买赠(3)/ 组合付款(5)使用优惠后的价格,否则使用原价
const
useFinalPrice
=
orderType
===
'2'
||
orderType
===
'3'
||
orderType
===
'5'
// 遍历所有商品
...
...
@@ -1086,26 +1097,26 @@ export default {
productList
.
forEach
(
item
=>
{
// 单个商品(goodsFlag == 1)
if
(
item
.
goods
&&
item
.
goods
.
sellPrice
&&
item
.
goods
.
number
)
{
console
.
log
(
item
.
goods
,
'---单商品'
)
if
(
useFinalPrice
&&
item
.
goods
.
finalPrice
!==
undefined
&&
item
.
goods
.
finalPrice
!==
null
)
{
// 使用优惠后的价格(单位是分,需要转换为元)
total
=
NP
.
plus
(
total
,
item
.
goods
.
finalPrice
/
100
)
const
goods
=
item
.
goods
console
.
log
(
goods
,
'---单商品'
)
if
(
useFinalPrice
&&
goods
.
finalPrice
!==
undefined
&&
goods
.
finalPrice
!==
null
)
{
// 使用优惠后的总价(单位:元)
total
=
NP
.
plus
(
total
,
parseFloat
(
goods
.
finalPrice
||
0
))
}
else
{
// 使用原始价格
total
=
NP
.
plus
(
total
,
NP
.
times
(
item
.
goods
.
sellPrice
,
item
.
goods
.
number
))
// 使用原始价格(单价 * 数量,单位:元)
total
=
NP
.
plus
(
total
,
NP
.
times
(
goods
.
sellPrice
,
goods
.
number
))
}
}
// 套
餐商品(goodsFlag == 3)
// 奷
餐商品(goodsFlag == 3)
else
if
(
item
.
packageGoods
&&
item
.
packageGoods
.
goodsList
)
{
console
.
log
(
item
.
packageGoods
,
'套餐'
)
const
packageNumber
=
parseInt
(
item
.
packageGoods
.
number
||
1
)
item
.
packageGoods
.
goodsList
.
forEach
(
goods
=>
{
if
(
useFinalPrice
&&
goods
.
finalPrice
!==
undefined
&&
goods
.
finalPrice
!==
null
)
{
// 使用优惠后的价格(单位是分,需要转换为元)
// finalPrice 已经是单价优惠后 × 套餐数量,所以直接使用
total
=
NP
.
plus
(
total
,
goods
.
finalPrice
/
100
)
// 使用优惠后的总价(finalPrice 已经是按数量计算后的总价,单位:元)
total
=
NP
.
plus
(
total
,
parseFloat
(
goods
.
finalPrice
||
0
))
}
else
{
// 使用原始价格
// 使用原始价格(单价 * 套餐数量)
total
=
NP
.
plus
(
total
,
NP
.
times
(
goods
.
sellPrice
,
packageNumber
))
}
})
...
...
@@ -1114,20 +1125,21 @@ export default {
else
if
(
item
.
multipleSpecificationsGoods
&&
item
.
multipleSpecificationsGoods
.
goods
&&
item
.
multipleSpecificationsGoods
.
goods
.
sellPrice
)
{
console
.
log
(
item
.
multipleSpecificationsGoods
,
'多规格'
)
const
goods
=
item
.
multipleSpecificationsGoods
.
goods
const
number
=
parseInt
(
item
.
multipleSpecificationsGoods
.
number
||
1
)
if
(
useFinalPrice
&&
goods
.
finalPrice
!==
undefined
&&
goods
.
finalPrice
!==
null
)
{
// 使用优惠后的价格(单位是分,需要转换为
元)
total
=
NP
.
plus
(
total
,
goods
.
finalPrice
/
100
)
// 使用优惠后的总价(单位:
元)
total
=
NP
.
plus
(
total
,
parseFloat
(
goods
.
finalPrice
||
0
)
)
}
else
{
// 使用原始价格
total
=
NP
.
plus
(
total
,
NP
.
times
(
goods
.
sellPrice
,
item
.
multipleSpecificationsGoods
.
number
||
1
))
// 使用原始价格(单价 * 数量)
total
=
NP
.
plus
(
total
,
NP
.
times
(
goods
.
sellPrice
,
number
))
}
}
})
}
})
console
.
log
(
total
,
'total'
)
// 更新总价
this
.
orderObj
.
total
=
total
.
toFixed
(
2
)
// 更新总价(单位:元,保留两位小数)
this
.
orderObj
.
total
=
(
Math
.
round
(
total
*
100
)
/
100
)
.
toFixed
(
2
)
},
// 获取园区店支付方式
...
...
pages/equity/tool/components/OrderCard.vue
View file @
9f10335
...
...
@@ -18,14 +18,14 @@
{{
currentStatusConfig
.
text
}}
</view>
</view>
<view
class=
"flex errorBox"
>
<view
class=
"flex errorBox"
v-if=
"orderCardDetail.oldOrderCode"
>
<view
class=
"order-list align-center flex-1"
>
<text>
原错误订单编号
</text>
<text
>
898495495393839459
</text>
<text
class=
"priceName"
>
{{
orderCardDetail
.
oldOrderCode
}}
</text>
</view>
<view
class=
"order-list align-center flex-1"
>
<text>
原错误订单总价
</text>
<text
>
¥2560
</text>
<text
class=
"priceName"
>
¥
{{
orderCardDetail
.
oldOrderFinalPrice
}}
</text>
</view>
</view>
<view
class=
"order-card-bottom-box"
>
...
...
@@ -1045,7 +1045,12 @@ export default {
font-size
:
toRpx
(
24
);
margin-bottom
:
toRpx
(
20
);
}
.priceName
{
color
:
#5a5e66
;
font-size
:
toRpx
(
24
);
font-weight
:
400
;
margin-left
:
toRpx
(
30
);
}
.info-box
{
display
:
flex
;
flex-wrap
:
wrap
;
...
...
pages/equity/tool/components/OrderPay.vue
View file @
9f10335
...
...
@@ -102,7 +102,7 @@ export default {
if
(
payId
)
{
const
data
=
await
uni
.
$api
.
equityApi
.
getOrderDetail
({
orderCode
:
payId
})
console
.
log
(
data
,
'----'
)
this
.
orderInfo
.
total_price
=
data
.
tot
alPrice
this
.
orderInfo
.
total_price
=
data
.
fin
alPrice
let
{
payOrder
,
status
}
=
data
if
(
payOrder
?.
payStatus
==
2
||
status
==
4
)
{
this
.
closePopup
()
...
...
pages/equity/tool/components/Package.vue
View file @
9f10335
...
...
@@ -157,6 +157,10 @@ export default {
}
// 更新值
this
.
$set
(
this
.
list
[
index
].
packageGoods
.
goodsList
[
ind
],
'sellPrice'
,
value
)
// 价格变动时,清空该商品的折扣/买赠/抵扣配置,并按原价重算 finalPrice
this
.
resetStrategyWhenPriceChange
(
this
.
list
[
index
].
packageGoods
.
goodsList
[
ind
],
this
.
list
[
index
])
this
.
$emit
(
'changeTotalPrice'
)
},
// 删除商品
...
...
@@ -173,6 +177,31 @@ export default {
})
item
.
packageGoods
.
upgradePrice
=
total
return
total
.
toFixed
(
2
)
},
// 商品价格变动时,清空当前套餐内单个商品的折扣/抵扣配置,并重算 finalPrice
resetStrategyWhenPriceChange
(
goods
,
item
)
{
if
(
!
goods
)
return
const
strategyConfig
=
goods
.
strategyConfig
||
{}
// 重置策略为无优惠,买赠强制为非赠品
this
.
$set
(
goods
,
'strategyConfig'
,
{
mode
:
'none'
,
discountRatio
:
''
,
discountAmount
:
''
,
isGift
:
'0'
,
deductAmount
:
''
})
this
.
$set
(
goods
,
'discountType'
,
null
)
this
.
$set
(
goods
,
'discountValue'
,
null
)
this
.
$set
(
goods
,
'discountAmount'
,
null
)
// 按当前单价和套餐数量,重新计算无优惠时的 finalPrice
const
unitPrice
=
parseFloat
(
goods
.
sellPrice
||
0
)
const
number
=
parseInt
(
item
?.
packageGoods
?.
number
||
1
)
const
totalFinalPrice
=
Math
.
round
(
unitPrice
*
number
*
100
)
/
100
this
.
$set
(
goods
,
'finalPricePerUnit'
,
unitPrice
)
this
.
$set
(
goods
,
'finalPrice'
,
totalFinalPrice
)
}
}
}
...
...
pages/equity/tool/components/SkuGoods.vue
View file @
9f10335
...
...
@@ -238,6 +238,52 @@ export default {
}
this
.
$emit
(
'changeTotalPrice'
)
},
// 验证价格输入
validatePrice
(
event
,
item
,
index
,
cindex
)
{
let
value
=
event
.
detail
.
value
// 如果为空则设置为0
if
(
!
value
||
value
.
trim
()
===
''
)
{
value
=
'0'
}
// 限制只能输入数字和小数点
value
=
value
.
replace
(
/
[^\d
.
]
/g
,
''
)
// 限制只能有一个小数点
if
(
value
.
split
(
'.'
).
length
>
2
)
{
value
=
value
.
slice
(
0
,
value
.
lastIndexOf
(
'.'
))
+
value
.
slice
(
value
.
lastIndexOf
(
'.'
)
+
1
)
}
// 限制最多两位小数
if
(
value
.
includes
(
'.'
))
{
const
parts
=
value
.
split
(
'.'
)
if
(
parts
[
1
].
length
>
2
)
{
parts
[
1
]
=
parts
[
1
].
substring
(
0
,
2
)
value
=
parts
.
join
(
'.'
)
}
}
// 限制最大值为100000
if
(
parseFloat
(
value
)
>
100000
)
{
value
=
'100000'
}
// 限制最小值为0
if
(
parseFloat
(
value
)
<
0
||
parseFloat
(
value
)
==
0
)
{
value
=
'0'
}
// 更新价格到对应商品
if
(
!
item
.
multipleSpecificationsGoods
)
{
if
(
item
.
goodsFlag
==
1
)
{
this
.
$set
(
this
.
list
[
index
].
goods
,
'sellPrice'
,
value
)
}
else
{
this
.
$set
(
this
.
list
[
index
].
packageGoods
.
goodsList
[
cindex
],
'sellPrice'
,
value
)
}
}
else
if
(
item
.
multipleSpecificationsGoods
&&
item
.
multipleSpecificationsGoods
.
goods
)
{
this
.
$set
(
this
.
list
[
index
].
multipleSpecificationsGoods
.
goods
,
'sellPrice'
,
value
)
}
// 商品价格修改时,清空折扣 / 抵扣配置
this
.
resetStrategyWhenPriceChange
(
item
,
index
,
cindex
)
this
.
$emit
(
'changeTotalPrice'
)
},
// 验证数量输入
validateNumber
(
event
,
item
)
{
let
value
=
event
.
detail
.
value
...
...
@@ -313,6 +359,65 @@ export default {
this
.
list
.
splice
(
index
,
1
)
this
.
$emit
(
'changeTotalPrice'
)
},
// 商品价格变动时,清空当前商品(含套餐内单个商品)的折扣 / 抵扣配置,并重算 finalPrice
resetStrategyWhenPriceChange
(
item
,
index
,
cindex
)
{
if
(
!
item
)
return
let
goods
=
null
// 1)套餐内单个商品(通过 goodsFlag === 3 + cindex 定位)
if
(
item
.
goodsFlag
===
3
&&
item
.
packageGoods
&&
item
.
packageGoods
.
goodsList
&&
typeof
cindex
===
'number'
)
{
goods
=
item
.
packageGoods
.
goodsList
[
cindex
]
}
// 2)直接传进来的就是 goods 对象(无 goodsFlag)
else
if
(
item
&&
item
.
sellPrice
!==
undefined
&&
item
.
goodsFlag
===
undefined
)
{
goods
=
item
}
// 3)多规格商品
else
if
(
item
.
multipleSpecificationsGoods
&&
item
.
multipleSpecificationsGoods
.
goods
)
{
goods
=
item
.
multipleSpecificationsGoods
.
goods
}
// 4)普通商品
else
if
(
item
.
goods
)
{
goods
=
item
.
goods
}
if
(
!
goods
)
return
// 重置策略配置
this
.
$set
(
goods
,
'strategyConfig'
,
{
mode
:
'none'
,
discountRatio
:
''
,
discountAmount
:
''
,
// 买赠:强制恢复为非赠品
isGift
:
'0'
,
deductAmount
:
''
})
// 同步清空老字段,避免 OrderStrategy 里看到旧的折扣金额 / 比例
this
.
$set
(
goods
,
'discountType'
,
null
)
this
.
$set
(
goods
,
'discountValue'
,
null
)
this
.
$set
(
goods
,
'discountAmount'
,
null
)
// 按当前单价和数量,重新计算无优惠时的 finalPrice
const
unitPrice
=
parseFloat
(
goods
.
sellPrice
||
0
)
let
number
=
1
if
(
item
.
goodsFlag
===
3
&&
item
.
packageGoods
&&
item
.
packageGoods
.
number
)
{
// 套餐:用套餐数量
number
=
parseInt
(
item
.
packageGoods
.
number
||
1
)
}
else
if
(
item
.
multipleSpecificationsGoods
&&
item
.
multipleSpecificationsGoods
.
number
)
{
// 多规格商品
number
=
parseInt
(
item
.
multipleSpecificationsGoods
.
number
||
1
)
}
else
if
(
item
.
goods
&&
item
.
goods
.
number
)
{
// 普通商品
number
=
parseInt
(
item
.
goods
.
number
||
1
)
}
const
totalFinalPrice
=
Math
.
round
(
unitPrice
*
number
*
100
)
/
100
this
.
$set
(
goods
,
'finalPricePerUnit'
,
unitPrice
)
this
.
$set
(
goods
,
'finalPrice'
,
totalFinalPrice
)
},
replaceItemText
(
value
)
{
let
reg
=
getRegExp
(
';~;'
,
'g'
)
return
value
?
value
.
replace
(
reg
,
'/'
)
:
''
...
...
@@ -501,59 +606,61 @@ export default {
return
'¥'
+
basePrice
.
toFixed
(
2
)
},
// 价格变化回调(finalPrice
是单件商品优惠后的价格,需要乘以数量得到总价,并转换为分
)
// 价格变化回调(finalPrice
PerUnit 为单件优惠价,需要乘以数量得到总价,单位:元
)
onPriceChange
(
item
,
finalPricePerUnit
,
packageItem
)
{
// 计算总价:单件优惠价 * 数量 * 100(转换为分)
// 如果是套餐内的商品,数量是套餐的数量;否则数量固定为 1
// 计算总价:单件优惠价 * 数量(单位:元)
let
number
=
1
// 套餐内商品:用套餐数量
if
(
packageItem
&&
packageItem
.
packageGoods
&&
packageItem
.
packageGoods
.
number
)
{
number
=
parseInt
(
packageItem
.
packageGoods
.
number
||
1
)
}
else
if
(
item
.
multipleSpecificationsGoods
&&
item
.
multipleSpecificationsGoods
.
number
)
{
// 多规格商品
number
=
parseInt
(
item
.
multipleSpecificationsGoods
.
number
||
1
)
}
else
if
(
item
.
goods
&&
item
.
goods
.
number
)
{
// 普通商品
number
=
parseInt
(
item
.
goods
.
number
||
1
)
}
const
totalFinalPrice
=
Math
.
round
(
finalPricePerUnit
*
number
*
100
)
/
100
const
finalPriceInCents
=
Math
.
round
(
totalFinalPrice
*
100
)
// 转换为分
const
totalFinalPrice
=
Math
.
round
(
finalPricePerUnit
*
number
*
100
)
/
100
// 元
// 如果是套餐内的商品(直接是商品对象,有 sellPrice 等属性)
if
(
item
&&
item
.
sellPrice
!==
undefined
&&
!
item
.
goodsFlag
)
{
// 赠品传 0,无优惠传 null 或原价(单位分)
if
(
finalPriceInCents
===
0
)
{
if
(
totalFinalPrice
===
0
)
{
// 赠品
this
.
$set
(
item
,
'finalPrice'
,
0
)
}
else
{
const
original
PriceInCents
=
Math
.
round
(
parseFloat
(
item
.
sellPrice
||
0
)
*
100
)
//
如果有优惠且不等于原价,传优惠后的价格;否则传
null
if
(
finalPriceInCents
<
originalPriceInCents
)
{
this
.
$set
(
item
,
'finalPrice'
,
finalPriceInCents
)
const
original
Total
=
Math
.
round
(
parseFloat
(
item
.
sellPrice
||
0
)
*
number
*
100
)
/
100
//
有优惠且不等于原价,保存优惠后的总价;否则置为
null
if
(
totalFinalPrice
<
originalTotal
)
{
this
.
$set
(
item
,
'finalPrice'
,
totalFinalPrice
)
}
else
{
this
.
$set
(
item
,
'finalPrice'
,
null
)
}
}
this
.
$set
(
item
,
'finalPricePerUnit'
,
finalPricePerUnit
)
}
//
如果是
多规格商品
// 多规格商品
else
if
(
item
.
multipleSpecificationsGoods
&&
item
.
multipleSpecificationsGoods
.
goods
)
{
// 赠品传 0,无优惠传 null 或原价(单位分)
if
(
finalPriceInCents
===
0
)
{
if
(
totalFinalPrice
===
0
)
{
this
.
$set
(
item
.
multipleSpecificationsGoods
.
goods
,
'finalPrice'
,
0
)
}
else
{
const
originalPriceInCents
=
Math
.
round
(
parseFloat
(
item
.
multipleSpecificationsGoods
.
goods
.
sellPrice
||
0
)
*
100
)
// 如果有优惠且不等于原价,传优惠后的价格;否则传 null
if
(
finalPriceInCents
<
originalPriceInCents
)
{
this
.
$set
(
item
.
multipleSpecificationsGoods
.
goods
,
'finalPrice'
,
finalPriceInCents
)
const
originalTotal
=
Math
.
round
(
parseFloat
(
item
.
multipleSpecificationsGoods
.
goods
.
sellPrice
||
0
)
*
number
*
100
)
/
100
if
(
totalFinalPrice
<
originalTotal
)
{
this
.
$set
(
item
.
multipleSpecificationsGoods
.
goods
,
'finalPrice'
,
totalFinalPrice
)
}
else
{
this
.
$set
(
item
.
multipleSpecificationsGoods
.
goods
,
'finalPrice'
,
null
)
}
}
this
.
$set
(
item
.
multipleSpecificationsGoods
.
goods
,
'finalPricePerUnit'
,
finalPricePerUnit
)
}
//
如果是
普通商品
// 普通商品
else
if
(
item
.
goods
)
{
// 赠品传 0,无优惠传 null 或原价(单位分)
if
(
finalPriceInCents
===
0
)
{
if
(
totalFinalPrice
===
0
)
{
this
.
$set
(
item
.
goods
,
'finalPrice'
,
0
)
}
else
{
const
originalPriceInCents
=
Math
.
round
(
parseFloat
(
item
.
goods
.
sellPrice
||
0
)
*
100
)
// 如果有优惠且不等于原价,传优惠后的价格;否则传 null
if
(
finalPriceInCents
<
originalPriceInCents
)
{
this
.
$set
(
item
.
goods
,
'finalPrice'
,
finalPriceInCents
)
const
originalTotal
=
Math
.
round
(
parseFloat
(
item
.
goods
.
sellPrice
||
0
)
*
number
*
100
)
/
100
if
(
totalFinalPrice
<
originalTotal
)
{
this
.
$set
(
item
.
goods
,
'finalPrice'
,
totalFinalPrice
)
}
else
{
this
.
$set
(
item
.
goods
,
'finalPrice'
,
null
)
}
...
...
pages/equity/tool/index.vue
View file @
9f10335
...
...
@@ -32,6 +32,30 @@
<StudyPopup
:show
.
sync=
"showStudyPermissionPopup"
title=
""
:width=
"848"
:height=
"870"
:topImage=
"require('@/assets/images/common/warning-notice.png')"
:topImageWidth=
"848"
:topImageHeight=
"248"
style=
"overflow: hidden"
>
<StudyCenterPermissionPopup
:lockReason=
"lockReason"
@
confirm=
"handleStudyPermissionConfirm"
/>
</StudyPopup>
<!-- 异常订单锁单弹窗(与 HomeFrame 逻辑保持一致) -->
<ErrorOrderPopup
:show
.
sync=
"showErrorOrderPopup"
title=
""
:width=
"848"
:height=
"870"
:topImage=
"require('@/assets/images/common/warning-notice.png')"
:topImageWidth=
"848"
:topImageHeight=
"248"
style=
"overflow: hidden"
>
<view>
<view
class=
"error-order-title"
>
异常订单提醒
</view>
<view
class=
"error-order-content"
>
存在{{ abnormalOrderCount }} 条异常订单未处理,请尽快处理!
</view>
</view>
<
template
#
footer
>
<view
class=
"flex justify-between error-order-footer"
>
<view
class=
"footer-btn sure flex-1"
@
click=
"showErrorOrderPopup = false"
>
好的
</view>
</view>
</
template
>
</ErrorOrderPopup>
</view>
</template>
...
...
@@ -50,12 +74,12 @@ import UpdateOrderInfo from './components/UpdateOrderInfo.vue'
import
StudyPopup
from
'@/components/StudyPopup.vue'
import
StudyCenterPermissionPopup
from
'@/components/StudyCenterPermissionPopup.vue'
import
EquityManagement
from
'./components/EquityManagement.vue'
import
CreateEquity
from
'./components/CreateEquity.vue'
import
SignName
from
'./components/SignName.vue'
import
PreviewList
from
'./components/PreviewList.vue'
import
WageAppeal
from
'../../common/wageAppeal/index.vue'
import
MonthCalendar
from
'../../common/components/MonthCalendar.vue'
import
ErrorOrderPopup
from
'@/components/ErrorOrderPopup.vue'
export
default
{
mixins
:
[
interceptionMixin
],
components
:
{
...
...
@@ -75,7 +99,8 @@ export default {
SignName
,
PreviewList
,
WageAppeal
,
MonthCalendar
MonthCalendar
,
ErrorOrderPopup
},
data
()
{
return
{
...
...
@@ -88,6 +113,9 @@ export default {
lockReason
:
''
,
showStudyPermissionPopup
:
false
,
lastMonth
:
dayjs
().
subtract
(
1
,
'month'
).
format
(
'YYYY-MM'
),
// 异常订单锁单弹窗
showErrorOrderPopup
:
false
,
abnormalOrderCount
:
0
,
enterType
:
''
}
},
...
...
@@ -99,6 +127,21 @@ export default {
this
.
toolComponentName
=
'DailyReport'
if
(
currentDate
)
this
.
setCurrentDate
(
currentDate
)
})
// 监听异常订单锁单事件(来自 CreateOrder.vue)
uni
.
$on
(
'showErrorOrderPopup'
,
payload
=>
{
try
{
const
abnormalOrderNum
=
payload
&&
typeof
payload
===
'object'
?
payload
.
abnormalOrderNum
:
payload
if
(
abnormalOrderNum
>
0
)
{
this
.
showErrorOrderPopup
=
true
this
.
abnormalOrderCount
=
abnormalOrderNum
}
}
catch
(
e
)
{
console
.
error
(
'showErrorOrderPopup 事件处理异常:'
,
e
)
}
})
},
onUnload
()
{
uni
.
$off
(
'showErrorOrderPopup'
)
},
methods
:
{
setCurrentDate
(
currentDate
)
{
...
...
@@ -118,12 +161,12 @@ export default {
return
}
// 提示锁单
const
abnormalOrderLock
=
await
this
.
getAbnormalOrderLock
()
if
(
abnormalOrderLock
)
{
this
.
showErrorOrderPopup
=
true
// this.lockReason = abnormalOrderLock.lockReason
return
}
// const { lockOrderFlag, abnormalOrderNum }
= await this.getAbnormalOrderLock()
// if (lockOrderFlag == "Y" && abnormalOrderNum > 0
) {
//
this.showErrorOrderPopup = true
// this.abnormalOrderCount = abnormalOrderNum
//
return
//
}
// 保存当前选择的组件信息,但不立即切换
const
selectedItem
=
item
if
(
this
.
toolComponentName
===
selectedItem
.
name
&&
(
!
this
.
transmissionOfData
||
this
.
transmissionOfData
.
type
!==
'supplementOrder'
))
return
...
...
@@ -235,5 +278,50 @@ export default {
justify-content
:
space-between
;
font-size
:
toRpx
(
34
);
}
}
.error-order-title
{
text-align
:
center
;
color
:
#333333
;
font-size
:
toRpx
(
40
);
font-weight
:
500
;
}
.error-order-content
{
text-align
:
center
;
color
:
#666666
;
font-size
:
toRpx
(
32
);
font-weight
:
400
;
margin-top
:
toRpx
(
16
);
}
.error-order-footer
{
margin-top
:
toRpx
(
64
);
margin-bottom
:
toRpx
(
48
);
width
:
100%
;
.cancel{
height
:
toRpx
(
88
);
border-radius
:
toRpx
(
64
);
opacity
:
1
;
line-height
:
toRpx
(
88
);
background
:
#f0f1f5
;
width
:
toRpx
(
344
);
text-align
:
center
;
color
:
#1a1a1a
;
font-size
:
toRpx
(
32
);
font-weight
:
400
;
}
.sure
{
height
:
toRpx
(
88
);
border-radius
:
toRpx
(
64
);
opacity
:
1
;
line-height
:
toRpx
(
88
);
background
:
linear-gradient
(
0deg
,
#2c66f7
0%
,
#48a6ff
100%
);
color
:
#fff
;
font-size
:
toRpx
(
32
);
font-weight
:
500
;
width
:
100%
;
text-align
:
center
;
margin-left
:
toRpx
(
32
);
margin-right
:
toRpx
(
32
);
}
}
</
style
>
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment