Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-boutique-work-wechat
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
1
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit bf5016f0
authored
Jul 16, 2026
by
张立顺
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat 异常审批接口对接
1 parent
5b5f6b56
Hide whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
515 additions
and
178 deletions
components/orderPromptPop/orderPromptPop.js
components/orderPromptPop/orderPromptPop.wxml
packageEquity/menu/jumpHandlers.js
packageEquity/menu/orderPromptHandler.js
packageEquity/pages/TabBar/equityPage.wxml
packageEquity/pages/TabBar/equityPage.wxss
packageEquity/pages/beforeCreate/beforeCreate.js
packageEquity/pages/beforeCreate/beforeCreate.wxml
packageEquity/pages/carQuotation/index/index.js
packageEquity/pages/carQuotation/index/index.wxml
packageEquity/pages/index/index.js
packageEquity/pages/index/index.wxml
pages/tabWorkOrder/pages/index/index.js
pages/tabWorkOrder/pages/index/index.wxml
tabDate/pages/detail/detail.js
tabDate/pages/detail/detail.wxml
tabIndex/menu/jumpHandlers.js
tabIndex/pages/index/index.js
tabIndex/pages/index/index.wxml
tabIndex/services/abnormalFlowTipService.js
tabIndex/services/newOrderAbnormalFlowRestrict.service.js
tabIndex/services/orderPromptConfirm.helpers.js
tabIndex/services/orderPromptConfirm.service.js
tabWorkOrder/pages/constructionOrderDetail/constructionOrderDetail.js
tabWorkOrder/pages/constructionOrderDetail/constructionOrderDetail.wxml
tests/abnormalFlowLock.helpers.test.mjs
tests/orderPromptConfirm.service.test.mjs
utils/abnormalFlowLock.helpers.js
components/orderPromptPop/orderPromptPop.js
View file @
bf5016f
// components/orderPromptPop/orderPromptPop.js
// components/orderPromptPop/orderPromptPop.js
const
FULL_PAY_TYPE_LIST
=
[
{
label
:
'收款方为门店收款'
,
value
:
'3'
},
{
label
:
'收款方为嘀加且属于对公转账收款'
,
value
:
'4'
},
{
label
:
'收款方为嘀加二维码收款'
,
value
:
'5'
,
tips
:
'适用于已有交易收款流水需补录订单时'
},
{
label
:
'特殊收款'
,
value
:
'6'
,
tips
:
'仅用于无法关联流水或混合支付场景,请谨慎选择。'
}
]
const
DJ_QR_ONLY_PAY_TYPE_LIST
=
FULL_PAY_TYPE_LIST
.
filter
(
item
=>
item
.
value
===
'5'
)
Component
({
Component
({
/**
/**
* 组件的属性列表
* 组件的属性列表
*/
*/
properties
:
{
properties
:
{
show
:
{
show
:
{
type
:
Boolean
type
:
Boolean
,
observer
(
n
)
{
if
(
n
)
{
this
.
applyDjQrOnlyPresentation
(
this
.
properties
.
djQrOnlyMode
)
}
}
},
/** 异常流水锁单态:仅允许嘀加二维码收款 */
djQrOnlyMode
:
{
type
:
Boolean
,
value
:
false
,
observer
(
n
)
{
if
(
this
.
data
.
show
)
{
this
.
applyDjQrOnlyPresentation
(
n
)
}
}
},
},
popupSlotStyle
:
{
popupSlotStyle
:
{
type
:
String
,
type
:
String
,
...
@@ -23,6 +61,7 @@ Component({
...
@@ -23,6 +61,7 @@ Component({
type
:
Object
,
type
:
Object
,
value
:
{},
value
:
{},
observer
:
function
(
v
)
{
observer
:
function
(
v
)
{
if
(
this
.
properties
.
djQrOnlyMode
)
return
// 是否是扫码核销或再次下单,是的话不显示补录入口
// 是否是扫码核销或再次下单,是的话不显示补录入口
if
(
Object
.
keys
(
v
)?.
length
)
{
if
(
Object
.
keys
(
v
)?.
length
)
{
let
{
payTypeList
}
=
this
.
data
let
{
payTypeList
}
=
this
.
data
...
@@ -47,33 +86,36 @@ Component({
...
@@ -47,33 +86,36 @@ Component({
*/
*/
data
:
{
data
:
{
infoData
:
{},
infoData
:
{},
payTypeList
:
[
payTypeList
:
FULL_PAY_TYPE_LIST
.
map
(
item
=>
({
...
item
}))
{
label
:
'收款方为门店收款'
,
value
:
'3'
},
{
label
:
'收款方为嘀加且属于对公转账收款'
,
value
:
'4'
},
{
label
:
'收款方为嘀加二维码收款'
,
value
:
'5'
,
tips
:
'适用于已有交易收款流水需补录订单时'
},
{
label
:
'特殊收款'
,
value
:
'6'
,
tips
:
'仅用于无法关联流水或混合支付场景,请谨慎选择。'
}
]
},
},
/**
/**
* 组件的方法列表
* 组件的方法列表
*/
*/
methods
:
{
methods
:
{
/**
* 锁单态仅展示嘀加二维码,并预选已支付 + 嘀加二维码
* @param {boolean} djQrOnlyMode
*/
applyDjQrOnlyPresentation
(
djQrOnlyMode
)
{
if
(
djQrOnlyMode
)
{
this
.
setData
({
payTypeList
:
DJ_QR_ONLY_PAY_TYPE_LIST
.
map
(
item
=>
({
...
item
})),
includesChildHeight
:
'var(--fontSize870)'
,
infoData
:
{
payFlag
:
'2'
,
payType
:
'5'
}
})
return
}
this
.
setData
({
payTypeList
:
FULL_PAY_TYPE_LIST
.
map
(
item
=>
({
...
item
})),
includesChildHeight
:
'var(--fontSize1020)'
,
infoData
:
{}
})
},
chooseParent
(
e
)
{
chooseParent
(
e
)
{
if
(
this
.
properties
.
djQrOnlyMode
)
{
return
wx
.
$util
.
showToast
(
'存在异常流水未处理,请选择嘀加二维码收款'
)
}
let
{
type
}
=
e
.
currentTarget
.
dataset
let
{
type
}
=
e
.
currentTarget
.
dataset
this
.
setData
({
this
.
setData
({
'infoData.payFlag'
:
type
'infoData.payFlag'
:
type
...
@@ -81,6 +123,9 @@ Component({
...
@@ -81,6 +123,9 @@ Component({
},
},
chooseChild
(
e
)
{
chooseChild
(
e
)
{
let
{
type
}
=
e
.
currentTarget
.
dataset
let
{
type
}
=
e
.
currentTarget
.
dataset
if
(
this
.
properties
.
djQrOnlyMode
&&
String
(
type
)
!==
'5'
)
{
return
wx
.
$util
.
showToast
(
'存在异常流水未处理,请选择嘀加二维码收款'
)
}
this
.
setData
({
this
.
setData
({
'infoData.payType'
:
type
'infoData.payType'
:
type
})
})
...
@@ -90,6 +135,10 @@ Component({
...
@@ -90,6 +135,10 @@ Component({
},
},
confirm
()
{
confirm
()
{
let
{
infoData
}
=
this
.
data
let
{
infoData
}
=
this
.
data
const
{
djQrOnlyMode
}
=
this
.
properties
if
(
djQrOnlyMode
&&
String
(
infoData
.
payType
)
!==
'5'
)
{
return
wx
.
$util
.
showToast
(
'存在异常流水未处理,请选择嘀加二维码收款'
)
}
if
(
!
infoData
.
payFlag
||
(
infoData
.
payFlag
==
2
&&
!
infoData
.
payType
))
{
if
(
!
infoData
.
payFlag
||
(
infoData
.
payFlag
==
2
&&
!
infoData
.
payType
))
{
return
wx
.
$util
.
showToast
(
'请选择订单收款方式'
)
return
wx
.
$util
.
showToast
(
'请选择订单收款方式'
)
}
}
...
...
components/orderPromptPop/orderPromptPop.wxml
View file @
bf5016f
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<view>确认订单收款方式</view>
<view>确认订单收款方式</view>
</view>
</view>
<view class="prompt_content">
<view class="prompt_content">
<view class="select_item">
<view class="select_item"
wx:if="{{ !djQrOnlyMode }}"
>
<block wx:if="{{infoData.payFlag == 1}}">
<block wx:if="{{infoData.payFlag == 1}}">
<image class="radio-icon" src="/components/images/radio.png" />
<image class="radio-icon" src="/components/images/radio.png" />
</block>
</block>
...
...
packageEquity/menu/jumpHandlers.js
View file @
bf5016f
...
@@ -19,6 +19,7 @@ import { trackDynamicFormMenuEntry } from '../../utils/dynamicFormMenus.js'
...
@@ -19,6 +19,7 @@ import { trackDynamicFormMenuEntry } from '../../utils/dynamicFormMenus.js'
import
{
SCENE_TYPE
}
from
'./constants.js'
import
{
SCENE_TYPE
}
from
'./constants.js'
import
{
resolveActionType
}
from
'./resolveActionType.js'
import
{
resolveActionType
}
from
'./resolveActionType.js'
import
{
openWorkReportTemp
}
from
'./workReportHandler.js'
import
{
openWorkReportTemp
}
from
'./workReportHandler.js'
import
{
openOrderPromptWithRestrictState
}
from
'../../tabIndex/services/newOrderAbnormalFlowRestrict.service.js'
export
{
resolveActionType
}
export
{
resolveActionType
}
...
@@ -86,7 +87,7 @@ export function createEquityMenuJumpHandler(page) {
...
@@ -86,7 +87,7 @@ export function createEquityMenuJumpHandler(page) {
)
{
)
{
return
return
}
}
page
.
setData
({
showPromptDialog
:
true
}
)
await
openOrderPromptWithRestrictState
(
page
)
},
},
defeatOrder
:
async
(
item
,
ctx
)
=>
{
defeatOrder
:
async
(
item
,
ctx
)
=>
{
const
{
merchantBrand
}
=
ctx
const
{
merchantBrand
}
=
ctx
...
...
packageEquity/menu/orderPromptHandler.js
View file @
bf5016f
/**
/**
* 新建工单弹窗确认/取消(与 jumpHandlers create_order 对称)
* 新建工单弹窗确认/取消(与 jumpHandlers create_order 对称)
*/
*/
import
{
c
heckAbnormalFlowLock
}
from
'../../store/ModalToQueueControl
.js'
import
{
c
onfirmOrderPrompt
}
from
'../../tabIndex/services/orderPromptConfirm.service
.js'
/**
/**
* @param {Object} pageCtx - index Component 实例
* @param {Object} pageCtx - index Component 实例
* @param {Object} detail - order-prompt-popup confirm 事件 detail
* @param {Object} detail - order-prompt-popup confirm 事件 detail
*/
*/
export
async
function
handleOrderPromptConfirm
(
pageCtx
,
detail
=
{})
{
export
async
function
handleOrderPromptConfirm
(
pageCtx
,
detail
=
{})
{
const
{
payFlag
,
payType
}
=
detail
const
{
mode
,
orderPromptDjQrOnlyMode
}
=
pageCtx
.
data
const
{
mode
}
=
pageCtx
.
data
const
thisPage
=
wx
.
$router
.
getPageInstance
()
const
thisPage
=
wx
.
$router
.
getPageInstance
()
const
paymentMethod
=
payFlag
!=
2
?
1
:
payType
await
confirmOrderPrompt
(
if
(
payFlag
==
1
||
payType
==
3
||
payType
==
4
||
payType
==
6
)
{
detail
,
const
flowLocked
=
await
checkAbnormalFlowLock
({
paymentMethod
})
{
if
(
flowLocked
)
return
onNavigateCreate
:
paymentMethod
=>
{
wx
.
$router
.
go
(
mode
?
'createOrderCarQuotationSimple'
:
'createOrderCarQuotation'
,
{
wx
.
$router
.
go
(
paymentMethod
mode
?
'createOrderCarQuotationSimple'
:
'createOrderCarQuotation'
,
})
{
paymentMethod
}
}
else
{
)
thisPage
.
tipsEvent
&&
thisPage
.
tipsEvent
()
},
}
onOpenRecordingPopup
:
()
=>
{
thisPage
.
tipsEvent
&&
thisPage
.
tipsEvent
()
}
},
orderPromptDjQrOnlyMode
)
const
paymentMethod
=
detail
.
payFlag
!=
2
?
1
:
detail
.
payType
thisPage
.
setData
({
paymentMethod
})
thisPage
.
setData
({
paymentMethod
})
}
}
...
...
packageEquity/pages/TabBar/equityPage.wxml
View file @
bf5016f
...
@@ -91,7 +91,7 @@
...
@@ -91,7 +91,7 @@
<tips-bottom style="width: 100%;box-sizing: border-box;" tipsProps="{{ tipsPropsConfig }}" beforeClick="inspectionOfProhibitionBill" />
<tips-bottom style="width: 100%;box-sizing: border-box;" tipsProps="{{ tipsPropsConfig }}" beforeClick="inspectionOfProhibitionBill" />
</view> -->
</view> -->
<!-- 异常流水吸底提醒(仅首页 Tab) -->
<!-- 异常流水吸底提醒(仅首页 Tab) -->
<view class="abnormal-flow-tip-wrap" wx:if="{{ abnormalFlowTips.show && tabIndex ==
=
0 }}">
<view class="abnormal-flow-tip-wrap" wx:if="{{ abnormalFlowTips.show && tabIndex == 0 }}">
<abnormal-flow-tips
<abnormal-flow-tips
show="{{ abnormalFlowTips.show }}"
show="{{ abnormalFlowTips.show }}"
count="{{ abnormalFlowTips.count }}"
count="{{ abnormalFlowTips.count }}"
...
...
packageEquity/pages/TabBar/equityPage.wxss
View file @
bf5016f
...
@@ -84,9 +84,9 @@
...
@@ -84,9 +84,9 @@
position: fixed;
position: fixed;
left: 0;
left: 0;
width: 100%;
width: 100%;
bottom: calc(var(--fontSize100) + env(safe-area-inset-bottom));
bottom: calc(var(--fontSize100) + constant(safe-area-inset-bottom));
bottom: calc(var(--fontSize100) + constant(safe-area-inset-bottom));
z-index: 10;
bottom: calc(var(--fontSize100) + env(safe-area-inset-bottom));
z-index: 100;
box-sizing: border-box;
box-sizing: border-box;
}
}
.waitOrderCon {
.waitOrderCon {
...
...
packageEquity/pages/beforeCreate/beforeCreate.js
View file @
bf5016f
// packageEquity/pages/beforeCreate/beforeCreate.js
// packageEquity/pages/beforeCreate/beforeCreate.js
import
{
getSystemInfo
as
fetchSystemInfo
}
from
'~/utils/systemInfo'
import
{
getSystemInfo
as
fetchSystemInfo
}
from
'~/utils/systemInfo'
import
{
openOrderPromptWithRestrictState
}
from
'~/tabIndex/services/newOrderAbnormalFlowRestrict.service.js'
import
{
confirmOrderPrompt
}
from
'~/tabIndex/services/orderPromptConfirm.service.js'
Page
({
Page
({
/**
/**
* 页面的初始数据
* 页面的初始数据
*/
*/
data
:
{
data
:
{
tipsProps
:
false
,
tipsProps
:
false
,
paymentMethod
:
null
paymentMethod
:
null
,
orderPromptDjQrOnlyMode
:
false
},
},
/**
/**
...
@@ -45,26 +49,28 @@ Page({
...
@@ -45,26 +49,28 @@ Page({
deviceOrientation
:
e
.
deviceOrientation
,
deviceOrientation
:
e
.
deviceOrientation
,
});
});
},
},
jump
()
{
async
jump
()
{
this
.
setData
({
await
openOrderPromptWithRestrictState
(
this
)
showPromptDialog
:
true
})
},
},
promptHandleConfirm
(
e
)
{
async
promptHandleConfirm
(
e
)
{
let
{
payFlag
,
payType
}
=
e
.
detail
const
{
mode
,
orderPromptDjQrOnlyMode
}
=
this
.
data
let
{
mode
}
=
this
.
data
await
confirmOrderPrompt
(
let
paymentMethod
=
payFlag
!=
2
?
1
:
payType
e
.
detail
,
if
(
payFlag
==
1
||
payType
==
3
||
payType
==
4
||
payType
==
6
)
{
{
wx
.
$router
.
go
(
onNavigateCreate
:
paymentMethod
=>
{
mode
?
"createOrderCarQuotationSimple"
:
"createOrderCarQuotation"
,
wx
.
$router
.
go
(
{
paymentMethod
}
mode
?
'createOrderCarQuotationSimple'
:
'createOrderCarQuotation'
,
);
{
paymentMethod
}
}
else
{
)
this
.
tipsEvent
()
},
}
onOpenRecordingPopup
:
()
=>
{
this
.
setData
({
this
.
tipsEvent
()
paymentMethod
}
})
},
orderPromptDjQrOnlyMode
)
const
paymentMethod
=
e
.
detail
.
payFlag
!=
2
?
1
:
e
.
detail
.
payType
this
.
setData
({
paymentMethod
})
},
},
promptCancel
()
{
promptCancel
()
{
this
.
setData
({
this
.
setData
({
...
...
packageEquity/pages/beforeCreate/beforeCreate.wxml
View file @
bf5016f
...
@@ -15,5 +15,5 @@
...
@@ -15,5 +15,5 @@
</view>
</view>
<record-list model:showPopup="{{showPopup}}" deviceOrientation="{{deviceOrientation}}" mode="{{mode}}"></record-list>
<record-list model:showPopup="{{showPopup}}" deviceOrientation="{{deviceOrientation}}" mode="{{mode}}"></record-list>
<order-prompt-popup wx:if="{{ showPromptDialog }}" show="{{ showPromptDialog }}" bindconfirm="promptHandleConfirm" bindcancel="promptCancel" popupSlotStyle="height: calc(100% - var(--fontSize160));" height="var(--fontSize540);" includesChildHeight="var(--fontSize1060);"></order-prompt-popup>
<order-prompt-popup wx:if="{{ showPromptDialog }}" show="{{ showPromptDialog }}" bindconfirm="promptHandleConfirm" bindcancel="promptCancel" popupSlotStyle="height: calc(100% - var(--fontSize160));" height="var(--fontSize540);" includesChildHeight="var(--fontSize1060);"
dj-qr-only-mode="{{ orderPromptDjQrOnlyMode }}"
></order-prompt-popup>
<order-no-popup wx:if="{{ tipsProps }}" show="{{ tipsProps }}" title="请选择交易参考号" bind:success="navigator" orderNoList="{{ orderNoList }}" />
<order-no-popup wx:if="{{ tipsProps }}" show="{{ tipsProps }}" title="请选择交易参考号" bind:success="navigator" orderNoList="{{ orderNoList }}" />
\ No newline at end of file
\ No newline at end of file
packageEquity/pages/carQuotation/index/index.js
View file @
bf5016f
...
@@ -26,6 +26,8 @@ const IMG_URL2 = ImgUrl + '/';
...
@@ -26,6 +26,8 @@ const IMG_URL2 = ImgUrl + '/';
import
carLifeApi
from
"../../../carEquityApi"
;
import
carLifeApi
from
"../../../carEquityApi"
;
import
commonApi
from
"~/api/api"
;
import
commonApi
from
"~/api/api"
;
import
{
withTabRefreshInFlight
}
from
"../../../services/tabRefreshService.js"
;
import
{
withTabRefreshInFlight
}
from
"../../../services/tabRefreshService.js"
;
import
{
openOrderPromptWithRestrictState
}
from
"~/tabIndex/services/newOrderAbnormalFlowRestrict.service.js"
;
import
{
confirmOrderPrompt
}
from
"~/tabIndex/services/orderPromptConfirm.service.js"
;
function
getSceneNameForQuotationItem
(
item
)
{
function
getSceneNameForQuotationItem
(
item
)
{
if
(
!
item
)
return
""
;
if
(
!
item
)
return
""
;
...
@@ -347,23 +349,28 @@ Component({
...
@@ -347,23 +349,28 @@ Component({
// showPromptDialog: true
// showPromptDialog: true
// })
// })
// }
// }
this
.
setData
({
await
openOrderPromptWithRestrictState
(
this
);
showPromptDialog
:
true
,
});
},
},
promptHandleConfirm
(
e
)
{
async
promptHandleConfirm
(
e
)
{
let
{
payFlag
,
payType
}
=
e
.
detail
;
const
{
mode
,
orderPromptDjQrOnlyMode
}
=
this
.
data
;
let
{
mode
}
=
this
.
data
;
const
thisPage
=
wx
.
$router
.
getPageInstance
();
let
thisPage
=
wx
.
$router
.
getPageInstance
();
await
confirmOrderPrompt
(
let
paymentMethod
=
payFlag
!=
2
?
1
:
payType
;
e
.
detail
,
if
(
payFlag
==
1
||
payType
==
3
||
payType
==
4
||
payType
==
6
)
{
{
wx
.
$router
.
go
(
mode
?
"createOrderCarQuotationSimple"
:
"createOrderCarQuotation"
,
{
paymentMethod
});
onNavigateCreate
:
paymentMethod
=>
{
}
else
{
wx
.
$router
.
go
(
thisPage
.
tipsEvent
&&
thisPage
.
tipsEvent
();
mode
?
"createOrderCarQuotationSimple"
:
"createOrderCarQuotation"
,
}
{
paymentMethod
}
thisPage
.
setData
({
);
paymentMethod
,
},
});
onOpenRecordingPopup
:
()
=>
{
thisPage
.
tipsEvent
&&
thisPage
.
tipsEvent
();
},
},
orderPromptDjQrOnlyMode
);
const
paymentMethod
=
e
.
detail
.
payFlag
!=
2
?
1
:
e
.
detail
.
payType
;
thisPage
.
setData
({
paymentMethod
});
},
},
promptCancel
()
{
promptCancel
()
{
this
.
setData
({
this
.
setData
({
...
...
packageEquity/pages/carQuotation/index/index.wxml
View file @
bf5016f
...
@@ -471,4 +471,5 @@
...
@@ -471,4 +471,5 @@
popupSlotStyle="height: calc(100% - var(--fontSize160));"
popupSlotStyle="height: calc(100% - var(--fontSize160));"
height="var(--fontSize540);"
height="var(--fontSize540);"
includesChildHeight="var(--fontSize1060);"
includesChildHeight="var(--fontSize1060);"
dj-qr-only-mode="{{ orderPromptDjQrOnlyMode }}"
></order-prompt-popup>
></order-prompt-popup>
\ No newline at end of file
\ No newline at end of file
packageEquity/pages/index/index.js
View file @
bf5016f
...
@@ -40,6 +40,7 @@ import {
...
@@ -40,6 +40,7 @@ import {
buildHomeRefreshFingerprint
,
buildHomeRefreshFingerprint
,
withHomeRefreshDedup
withHomeRefreshDedup
}
from
'../../services/homeRefreshService.js'
}
from
'../../services/homeRefreshService.js'
import
{
openOrderPromptWithRestrictState
}
from
'../../../tabIndex/services/newOrderAbnormalFlowRestrict.service.js'
import
{
import
{
buildEquityMenusAsync
,
buildEquityMenusAsync
,
createEquityMenuJumpHandler
,
createEquityMenuJumpHandler
,
...
@@ -434,7 +435,7 @@ Component({
...
@@ -434,7 +435,7 @@ Component({
}
}
})
})
},
},
onTodoGoto
(
e
)
{
async
onTodoGoto
(
e
)
{
const
action
=
resolveTodoGotoAction
(
e
.
detail
.
id
,
{
const
action
=
resolveTodoGotoAction
(
e
.
detail
.
id
,
{
mode
:
this
.
data
.
mode
,
mode
:
this
.
data
.
mode
,
merchantBrand
:
this
.
data
.
merchantBrand
merchantBrand
:
this
.
data
.
merchantBrand
...
@@ -446,7 +447,7 @@ Component({
...
@@ -446,7 +447,7 @@ Component({
}
}
wx
.
$router
.
go
(
action
.
route
,
action
.
params
)
wx
.
$router
.
go
(
action
.
route
,
action
.
params
)
}
else
if
(
action
.
type
===
'showPromptDialog'
)
{
}
else
if
(
action
.
type
===
'showPromptDialog'
)
{
this
.
setData
({
showPromptDialog
:
true
}
)
await
openOrderPromptWithRestrictState
(
this
)
}
}
},
},
onTodoPackup
()
{
onTodoPackup
()
{
...
...
packageEquity/pages/index/index.wxml
View file @
bf5016f
...
@@ -73,7 +73,8 @@
...
@@ -73,7 +73,8 @@
bindcancel="promptCancel"
bindcancel="promptCancel"
popupSlotStyle="height: calc(100% - var(--fontSize160));"
popupSlotStyle="height: calc(100% - var(--fontSize160));"
height="var(--fontSize540);"
height="var(--fontSize540);"
includesChildHeight="var(--fontSize1020);"></order-prompt-popup>
includesChildHeight="var(--fontSize1020);"
dj-qr-only-mode="{{ orderPromptDjQrOnlyMode }}"></order-prompt-popup>
<report-template-popup show="{{ showReportPopup }}"
<report-template-popup show="{{ showReportPopup }}"
templateList="{{ reportTemplateList }}"
templateList="{{ reportTemplateList }}"
bind:cancel="onReportPopupCancel"
bind:cancel="onReportPopupCancel"
...
...
pages/tabWorkOrder/pages/index/index.js
View file @
bf5016f
...
@@ -9,6 +9,8 @@ import {
...
@@ -9,6 +9,8 @@ import {
checkStudyTask
,
checkStudyTask
,
checkOrderLockGate
checkOrderLockGate
}
from
'~/store/ModalToQueueControl'
}
from
'~/store/ModalToQueueControl'
import
{
openOrderPromptWithRestrictState
}
from
'~/tabIndex/services/newOrderAbnormalFlowRestrict.service.js'
import
{
confirmOrderPrompt
}
from
'~/tabIndex/services/orderPromptConfirm.service.js'
import
commonApi
from
'~/api/api'
import
commonApi
from
'~/api/api'
import
{
normalizeMarketingFlagOnItem
}
from
'~/utils/marketingFlag'
import
{
normalizeMarketingFlagOnItem
}
from
'~/utils/marketingFlag'
Page
({
Page
({
...
@@ -164,8 +166,7 @@ Page({
...
@@ -164,8 +166,7 @@ Page({
if
(
await
wx
.
$globalDataFunction
.
inspectionOfProhibitionBill
())
if
(
await
wx
.
$globalDataFunction
.
inspectionOfProhibitionBill
())
return
return
if
(
scan
)
{
if
(
scan
)
{
this
.
setData
({
await
openOrderPromptWithRestrictState
(
this
,
{
showPromptDialog
:
true
,
sceneObj
:
scene
sceneObj
:
scene
})
})
}
else
{
}
else
{
...
@@ -287,10 +288,7 @@ Page({
...
@@ -287,10 +288,7 @@ Page({
return
/**禁止提单 */
return
/**禁止提单 */
// 点击的新增工单做下单引导
// 点击的新增工单做下单引导
if
(
flag
==
'new'
)
{
if
(
flag
==
'new'
)
{
this
.
setData
({
await
openOrderPromptWithRestrictState
(
this
,
{
sceneObj
:
{}
})
showPromptDialog
:
true
,
sceneObj
:
{}
})
return
return
}
}
// 是微信支付直接跳转确认页面
// 是微信支付直接跳转确认页面
...
@@ -315,22 +313,27 @@ Page({
...
@@ -315,22 +313,27 @@ Page({
wx
.
$router
.
go
(
'tabWorkOrder.'
+
name
,
item
)
wx
.
$router
.
go
(
'tabWorkOrder.'
+
name
,
item
)
}
}
},
},
promptHandleConfirm
(
e
)
{
async
promptHandleConfirm
(
e
)
{
let
{
payFlag
,
payType
}
=
e
.
detail
const
{
sceneObj
,
orderPromptDjQrOnlyMode
}
=
this
.
data
let
paymentMethod
=
payFlag
!=
2
?
1
:
payType
await
confirmOrderPrompt
(
let
{
sceneObj
}
=
this
.
data
e
.
detail
,
if
(
payFlag
==
1
||
payType
==
3
||
payType
==
4
||
payType
==
6
)
{
{
let
params
=
{
paymentMethod
}
onNavigateCreate
:
paymentMethod
=>
{
if
(
Object
.
keys
(
sceneObj
)?.
length
)
{
const
params
=
{
paymentMethod
}
params
.
scene
=
sceneObj
if
(
Object
.
keys
(
sceneObj
||
{})?.
length
)
{
}
params
.
scene
=
sceneObj
wx
.
$router
.
go
(
'tabWorkOrder.createOrder'
,
params
)
}
}
else
{
wx
.
$router
.
go
(
'tabWorkOrder.createOrder'
,
params
)
this
.
tipsEvent
()
},
}
onOpenRecordingPopup
:
()
=>
{
this
.
setData
({
this
.
tipsEvent
()
paymentMethod
}
})
},
orderPromptDjQrOnlyMode
)
const
paymentMethod
=
e
.
detail
.
payFlag
!=
2
?
1
:
e
.
detail
.
payType
this
.
setData
({
paymentMethod
})
},
},
promptCancel
()
{
promptCancel
()
{
this
.
setData
({
this
.
setData
({
...
...
pages/tabWorkOrder/pages/index/index.wxml
View file @
bf5016f
...
@@ -235,5 +235,5 @@
...
@@ -235,5 +235,5 @@
</view>
</view>
</modal>
</modal>
<recording-order-popup wx:if="{{ showOrderpop }}" show="{{ showOrderpop }}" bind:success="navigator" title="请选择交易参考号" />
<recording-order-popup wx:if="{{ showOrderpop }}" show="{{ showOrderpop }}" bind:success="navigator" title="请选择交易参考号" />
<order-prompt-popup wx:if="{{ showPromptDialog }}" show="{{ showPromptDialog }}" bindcancel="promptCancel" bindconfirm="promptHandleConfirm" sceneObj="{{ sceneObj }}"></order-prompt-popup>
<order-prompt-popup wx:if="{{ showPromptDialog }}" show="{{ showPromptDialog }}" bindcancel="promptCancel" bindconfirm="promptHandleConfirm" sceneObj="{{ sceneObj }}"
dj-qr-only-mode="{{ orderPromptDjQrOnlyMode }}"
></order-prompt-popup>
<study-permission-modal id="customModal" />
<study-permission-modal id="customModal" />
\ No newline at end of file
\ No newline at end of file
tabDate/pages/detail/detail.js
View file @
bf5016f
...
@@ -7,6 +7,8 @@ import {
...
@@ -7,6 +7,8 @@ import {
checkStudyTask
,
checkStudyTask
,
checkOrderLockGate
checkOrderLockGate
}
from
'~/store/ModalToQueueControl'
}
from
'~/store/ModalToQueueControl'
import
{
openOrderPromptWithRestrictState
}
from
'~/tabIndex/services/newOrderAbnormalFlowRestrict.service.js'
import
{
confirmOrderPrompt
}
from
'~/tabIndex/services/orderPromptConfirm.service.js'
const
app
=
getApp
()
const
app
=
getApp
()
const
IMG_URL
=
const
IMG_URL
=
'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/'
'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/'
...
@@ -110,18 +112,11 @@ Page({
...
@@ -110,18 +112,11 @@ Page({
show
:
true
,
show
:
true
,
title
:
'请选择录单入口'
,
title
:
'请选择录单入口'
,
tabTitleShow
:
false
,
tabTitleShow
:
false
,
success
:
res
=>
{
success
:
async
res
=>
{
// 跳转新增订单页面 并带特定参数
// 跳转新增订单页面 并带特定参数
let
{
selectType
}
=
this
.
data
let
{
selectType
}
=
this
.
data
if
(
selectType
==
1
)
{
if
(
selectType
==
1
)
{
// wx.$router.go("tabWorkOrder.createOrder", {
await
openOrderPromptWithRestrictState
(
this
,
{
sceneObj
:
item
})
// scene,
// ...item,
// });
this
.
setData
({
showPromptDialog
:
true
,
sceneObj
:
item
})
}
else
{
}
else
{
console
.
log
(
console
.
log
(
{
{
...
@@ -140,22 +135,25 @@ Page({
...
@@ -140,22 +135,25 @@ Page({
'#modal2'
'#modal2'
)
)
},
},
promptHandleConfirm
(
e
)
{
async
promptHandleConfirm
(
e
)
{
let
{
payFlag
,
payType
}
=
e
.
detail
const
{
sceneObj
,
orderPromptDjQrOnlyMode
}
=
this
.
data
let
{
sceneObj
}
=
this
.
data
await
confirmOrderPrompt
(
let
paymentMethod
=
payFlag
!=
2
?
1
:
payType
e
.
detail
,
if
(
payFlag
==
1
||
payType
==
3
||
payType
==
4
||
payType
==
6
)
{
{
let
params
=
{
onNavigateCreate
:
paymentMethod
=>
{
paymentMethod
,
wx
.
$router
.
go
(
'tabWorkOrder.createOrder'
,
{
...
sceneObj
paymentMethod
,
}
...
sceneObj
wx
.
$router
.
go
(
'tabWorkOrder.createOrder'
,
params
)
})
}
else
{
},
this
.
tipsEvent
()
onOpenRecordingPopup
:
()
=>
{
}
this
.
tipsEvent
()
this
.
setData
({
}
paymentMethod
},
})
orderPromptDjQrOnlyMode
)
const
paymentMethod
=
e
.
detail
.
payFlag
!=
2
?
1
:
e
.
detail
.
payType
this
.
setData
({
paymentMethod
})
},
},
promptCancel
()
{
promptCancel
()
{
this
.
setData
({
this
.
setData
({
...
...
tabDate/pages/detail/detail.wxml
View file @
bf5016f
...
@@ -159,5 +159,5 @@
...
@@ -159,5 +159,5 @@
</view>
</view>
</view>
</view>
</modal>
</modal>
<order-prompt-popup wx:if="{{ showPromptDialog }}" show="{{ showPromptDialog }}" bindcancel="promptCancel" bindconfirm="promptHandleConfirm" sceneObj="{{sceneObj}}" popupSlotStyle="height: calc(100% - var(--fontSize160));" height="var(--fontSize540);" includesChildHeight="var(--fontSize1060);"></order-prompt-popup>
<order-prompt-popup wx:if="{{ showPromptDialog }}" show="{{ showPromptDialog }}" bindcancel="promptCancel" bindconfirm="promptHandleConfirm" sceneObj="{{sceneObj}}" popupSlotStyle="height: calc(100% - var(--fontSize160));" height="var(--fontSize540);" includesChildHeight="var(--fontSize1060);"
dj-qr-only-mode="{{ orderPromptDjQrOnlyMode }}"
></order-prompt-popup>
<study-permission-modal id="customModal" />
<study-permission-modal id="customModal" />
\ No newline at end of file
\ No newline at end of file
tabIndex/menu/jumpHandlers.js
View file @
bf5016f
...
@@ -19,6 +19,7 @@ import {
...
@@ -19,6 +19,7 @@ import {
import
{
trackDynamicFormMenuEntry
}
from
'../../utils/dynamicFormMenus.js'
import
{
trackDynamicFormMenuEntry
}
from
'../../utils/dynamicFormMenus.js'
import
{
resolveActionType
}
from
'./resolveActionType.js'
import
{
resolveActionType
}
from
'./resolveActionType.js'
import
{
openWorkReportTemp
}
from
'./workReportHandler.js'
import
{
openWorkReportTemp
}
from
'./workReportHandler.js'
import
{
openOrderPromptWithRestrictState
}
from
'../services/newOrderAbnormalFlowRestrict.service.js'
export
{
resolveActionType
}
export
{
resolveActionType
}
...
@@ -165,7 +166,7 @@ export function createMenuJumpHandler(page) {
...
@@ -165,7 +166,7 @@ export function createMenuJumpHandler(page) {
return
return
}
}
if
(
target
===
'tabWorkOrder.createOrder'
)
{
if
(
target
===
'tabWorkOrder.createOrder'
)
{
page
.
setData
({
showPromptDialog
:
true
,
sceneObj
:
{}
})
await
openOrderPromptWithRestrictState
(
page
,
{
sceneObj
:
{}
})
}
else
{
}
else
{
wx
.
$router
.
go
(
target
,
{
params
:
routerParams
})
wx
.
$router
.
go
(
target
,
{
params
:
routerParams
})
}
}
...
...
tabIndex/pages/index/index.js
View file @
bf5016f
...
@@ -14,14 +14,15 @@ import {
...
@@ -14,14 +14,15 @@ import {
import
{
import
{
checkDailyReport
,
checkDailyReport
,
checkStudyTask
,
checkStudyTask
,
checkOrderLockGate
,
checkOrderLockGate
checkAbnormalFlowLock
}
from
'~/store/ModalToQueueControl'
}
from
'~/store/ModalToQueueControl'
import
{
navigateToStaffDailyReport
}
from
'~/utils/staffDailyReportNavigation.js'
import
{
navigateToStaffDailyReport
}
from
'~/utils/staffDailyReportNavigation.js'
import
{
import
{
loadAbnormalFlowTipState
,
loadAbnormalFlowTipState
,
dismissAbnormalFlowTip
dismissAbnormalFlowTip
}
from
'../../services/abnormalFlowTipService.js'
}
from
'../../services/abnormalFlowTipService.js'
import
{
openOrderPromptWithRestrictState
}
from
'../../services/newOrderAbnormalFlowRestrict.service.js'
import
{
confirmOrderPrompt
}
from
'../../services/orderPromptConfirm.service.js'
import
{
ABNORMAL_FLOW_LOCK_BYPASS
}
from
'~/utils/abnormalFlowLock.helpers.js'
import
{
ABNORMAL_FLOW_LOCK_BYPASS
}
from
'~/utils/abnormalFlowLock.helpers.js'
import
{
import
{
...
@@ -103,6 +104,7 @@ Page({
...
@@ -103,6 +104,7 @@ Page({
isPad
:
false
,
isPad
:
false
,
isWait
:
false
,
// 今日待办等:非 canSelectMultiStore 且非技师(loginRole 7)
isWait
:
false
,
// 今日待办等:非 canSelectMultiStore 且非技师(loginRole 7)
sceneObj
:
{},
sceneObj
:
{},
orderPromptDjQrOnlyMode
:
false
,
showReportPopup
:
false
,
showReportPopup
:
false
,
abnormalFlowTips
:
{
show
:
false
,
count
:
0
,
tipsText
:
''
},
abnormalFlowTips
:
{
show
:
false
,
count
:
0
,
tipsText
:
''
},
reportTemplateList
:
[],
reportTemplateList
:
[],
...
@@ -171,7 +173,7 @@ Page({
...
@@ -171,7 +173,7 @@ Page({
if
(
lockCheck
)
return
false
if
(
lockCheck
)
return
false
//开单提醒
//开单提醒
if
(
await
wx
.
$globalDataFunction
.
inspectionOfProhibitionBill
())
return
if
(
await
wx
.
$globalDataFunction
.
inspectionOfProhibitionBill
())
return
this
.
setData
({
showPromptDialog
:
true
,
sceneObj
:
{}
})
await
openOrderPromptWithRestrictState
(
this
,
{
sceneObj
:
{}
})
// wx.$router.go('tabWorkOrder.createOrder')
// wx.$router.go('tabWorkOrder.createOrder')
break
break
case
4
:
case
4
:
...
@@ -431,25 +433,26 @@ Page({
...
@@ -431,25 +433,26 @@ Page({
return
this
.
_menuJump
(
e
)
return
this
.
_menuJump
(
e
)
},
},
async
promptHandleConfirm
(
e
)
{
async
promptHandleConfirm
(
e
)
{
let
{
payFlag
,
payType
}
=
e
.
detail
const
{
sceneObj
,
orderPromptDjQrOnlyMode
}
=
this
.
data
let
{
sceneObj
}
=
this
.
data
await
confirmOrderPrompt
(
let
paymentMethod
=
payFlag
!=
2
?
1
:
payType
e
.
detail
,
if
(
payFlag
==
1
||
payType
==
3
||
payType
==
4
||
payType
==
6
)
{
{
const
flowLocked
=
await
checkAbnormalFlowLock
({
paymentMethod
})
onNavigateCreate
:
paymentMethod
=>
{
if
(
flowLocked
)
return
const
params
=
{
paymentMethod
}
let
params
=
{
if
(
Object
.
keys
(
sceneObj
||
{})?.
length
)
{
paymentMethod
params
.
scene
=
sceneObj
}
}
if
(
Object
.
keys
(
sceneObj
)?.
length
)
{
wx
.
$router
.
go
(
'tabWorkOrder.createOrder'
,
params
)
params
.
scene
=
sceneObj
},
}
onOpenRecordingPopup
:
()
=>
{
wx
.
$router
.
go
(
'tabWorkOrder.createOrder'
,
params
)
this
.
tipsEvent
()
}
else
{
}
this
.
tipsEvent
()
},
}
orderPromptDjQrOnlyMode
this
.
setData
({
)
paymentMethod
const
paymentMethod
=
})
e
.
detail
.
payFlag
!=
2
?
1
:
e
.
detail
.
payType
this
.
setData
({
paymentMethod
})
},
},
promptCancel
()
{
promptCancel
()
{
this
.
setData
({
this
.
setData
({
...
@@ -472,11 +475,11 @@ Page({
...
@@ -472,11 +475,11 @@ Page({
show
:
true
,
show
:
true
,
title
:
'请选择录单入口'
,
title
:
'请选择录单入口'
,
tabTitleShow
:
false
,
tabTitleShow
:
false
,
success
:
res
=>
{
success
:
async
res
=>
{
// 跳转新增订单页面 并带特定参数
// 跳转新增订单页面 并带特定参数
let
{
selectType
}
=
this
.
data
let
{
selectType
}
=
this
.
data
if
(
selectType
==
1
)
{
if
(
selectType
==
1
)
{
this
.
setData
({
showPromptDialog
:
true
,
sceneObj
:
scene
})
await
openOrderPromptWithRestrictState
(
this
,
{
sceneObj
:
scene
})
}
else
{
}
else
{
wx
.
$router
.
go
(
'tabWorkOrder.defeatOrder'
,
{
wx
.
$router
.
go
(
'tabWorkOrder.defeatOrder'
,
{
scene
,
scene
,
...
...
tabIndex/pages/index/index.wxml
View file @
bf5016f
...
@@ -494,6 +494,7 @@
...
@@ -494,6 +494,7 @@
bindcancel="promptCancel"
bindcancel="promptCancel"
bindconfirm="promptHandleConfirm"
bindconfirm="promptHandleConfirm"
sceneObj="{{ sceneObj }}"
sceneObj="{{ sceneObj }}"
dj-qr-only-mode="{{ orderPromptDjQrOnlyMode }}"
></order-prompt-popup>
></order-prompt-popup>
<study-permission-modal id="customModal" />
<study-permission-modal id="customModal" />
<report-template-popup
<report-template-popup
...
...
tabIndex/services/abnormalFlowTipService.js
View file @
bf5016f
/**
/**
* @file 异常流水首页吸底提醒编排(调 API + setData,供 tabIndex / equityPage 复用)
* @file 异常流水首页吸底提醒编排(调 API + setData,供 tabIndex / equityPage 复用)
*/
*/
import
commonApi
from
'~/api/api
'
import
{
waitInputOrderUnionCount
}
from
'~/api/abnormalFlowDeclaration.js
'
import
{
import
{
buildAbnormalFlowTipText
,
buildAbnormalFlowTipText
,
hasUnprocessedAbnormalFlow
,
hasUnprocessedAbnormalFlow
,
...
@@ -38,7 +38,7 @@ function resolveMerchantId(userInfo) {
...
@@ -38,7 +38,7 @@ function resolveMerchantId(userInfo) {
}
}
/**
/**
* onShow 拉取异常流水提醒
状态并写入页面(
union.count)
* onShow 拉取异常流水提醒
(dj.api.smartcarlife.weapp.waitinputorder.
union.count)
* @param {Object} page - Page / Component 实例
* @param {Object} page - Page / Component 实例
* @returns {Promise<{ show: boolean, count: number }>}
* @returns {Promise<{ show: boolean, count: number }>}
*/
*/
...
@@ -62,8 +62,7 @@ export function loadAbnormalFlowTipState(page) {
...
@@ -62,8 +62,7 @@ export function loadAbnormalFlowTipState(page) {
return
Promise
.
resolve
({
show
:
false
,
count
:
0
})
return
Promise
.
resolve
({
show
:
false
,
count
:
0
})
}
}
return
commonApi
return
waitInputOrderUnionCount
()
.
waitInputOrderUnionCount
()
.
then
(
res
=>
{
.
then
(
res
=>
{
const
data
=
res
?.
data
||
{}
const
data
=
res
?.
data
||
{}
const
count
=
resolveAbnormalFlowTipCount
(
data
)
const
count
=
resolveAbnormalFlowTipCount
(
data
)
...
...
tabIndex/services/newOrderAbnormalFlowRestrict.service.js
0 → 100644
View file @
bf5016f
/**
* @file 新建工单异常流水限制态拉取(调 API,不调 setData)
*/
import
{
checkAbnormalFlowShopLock
,
waitInputOrderUnionCount
}
from
'~/api/abnormalFlowDeclaration.js'
import
{
shouldRestrictNewOrderToDjQrOnly
}
from
'~/utils/abnormalFlowLock.helpers.js'
/**
* 解析门店 id(精品 / 权益字段略有差异)
* @param {Object} userInfo
* @returns {string|number}
*/
function
resolveMerchantId
(
userInfo
=
{})
{
return
(
userInfo
.
shopMerchantId
||
userInfo
.
default4SStoreInfo
?.
merchantId
||
''
)
}
/**
* 拉取新建工单是否仅允许嘀加二维码收款
* @returns {Promise<{ djQrOnlyMode: boolean }>}
*/
export
async
function
loadNewOrderRestrictState
()
{
const
userInfo
=
wx
.
$util
?.
getUserInfo
?.()
||
{}
const
merchantId
=
resolveMerchantId
(
userInfo
)
if
(
!
merchantId
)
{
return
{
djQrOnlyMode
:
false
}
}
try
{
const
[
lockRes
,
countRes
]
=
await
Promise
.
all
([
checkAbnormalFlowShopLock
({
merchantId
}),
waitInputOrderUnionCount
()
])
const
djQrOnlyMode
=
shouldRestrictNewOrderToDjQrOnly
(
lockRes
?.
data
,
countRes
?.
data
)
return
{
djQrOnlyMode
}
}
catch
{
return
{
djQrOnlyMode
:
false
}
}
}
/**
* 打开新建工单收款弹窗前拉取限制态并 setData
* @param {Object} page - Page / Component 实例
* @param {Object} [patch] - 合并进 setData(如 sceneObj)
* @returns {Promise<{ djQrOnlyMode: boolean }>}
*/
export
async
function
openOrderPromptWithRestrictState
(
page
,
patch
=
{})
{
const
{
djQrOnlyMode
}
=
await
loadNewOrderRestrictState
()
page
.
setData
({
showPromptDialog
:
true
,
orderPromptDjQrOnlyMode
:
djQrOnlyMode
,
...
patch
})
return
{
djQrOnlyMode
}
}
tabIndex/services/orderPromptConfirm.helpers.js
0 → 100644
View file @
bf5016f
/**
* @file 新建工单收款弹窗纯函数(无 wx / store 依赖,供单测)
*/
/**
* 从弹窗 detail 解析 paymentMethod(与现网各页一致)
* @param {{ payFlag?: string|number, payType?: string|number }} detail
* @returns {string|number}
*/
export
function
resolveOrderPromptPaymentMethod
(
detail
=
{})
{
const
{
payFlag
,
payType
}
=
detail
return
payFlag
!=
2
?
1
:
payType
}
/**
* 是否走嘀加二维码补录弹窗(recordingOrderPopup)
* @param {{ payFlag?: string|number, payType?: string|number }} detail
* @returns {boolean}
*/
export
function
shouldOpenRecordingOrderPopup
(
detail
=
{})
{
const
{
payFlag
,
payType
}
=
detail
if
(
payFlag
==
1
)
return
false
return
payType
==
5
}
/**
* djQrOnlyMode 下是否非法收款选择
* @param {{ payType?: string|number }} detail
* @param {boolean} [djQrOnlyMode]
* @returns {boolean}
*/
export
function
isInvalidDjQrOnlySelection
(
detail
=
{},
djQrOnlyMode
=
false
)
{
return
djQrOnlyMode
&&
String
(
detail
.
payType
)
!==
'5'
}
tabIndex/services/orderPromptConfirm.service.js
0 → 100644
View file @
bf5016f
/**
* @file 新建工单收款方式弹窗确认编排(flow lock + 嘀加二维码补录分支)
*/
import
{
checkAbnormalFlowLock
}
from
'~/store/ModalToQueueControl.js'
import
{
isInvalidDjQrOnlySelection
,
shouldOpenRecordingOrderPopup
}
from
'./orderPromptConfirm.helpers.js'
const
DJ_QR_RESTRICT_TOAST
=
'存在异常流水未处理,请选择嘀加二维码收款'
export
{
resolveOrderPromptPaymentMethod
,
shouldOpenRecordingOrderPopup
,
isInvalidDjQrOnlySelection
}
from
'./orderPromptConfirm.helpers.js'
/**
* order-prompt-popup 确认:锁单态仅允许嘀加二维码;其它路径双保险 flow lock
* @param {Object} detail - { payFlag, payType }
* @param {Object} handlers
* @param {Function} handlers.onNavigateCreate - (paymentMethod) => void | Promise<void>
* @param {Function} handlers.onOpenRecordingPopup - () => void | Promise<void>
* @param {boolean} [djQrOnlyMode=false]
* @returns {Promise<boolean>} false 表示被拦截
*/
export
async
function
confirmOrderPrompt
(
detail
,
handlers
,
djQrOnlyMode
=
false
)
{
const
paymentMethod
=
detail
.
payFlag
!=
2
?
1
:
detail
.
payType
if
(
isInvalidDjQrOnlySelection
(
detail
,
djQrOnlyMode
))
{
wx
.
$util
?.
showToast
?.(
DJ_QR_RESTRICT_TOAST
)
return
false
}
if
(
shouldOpenRecordingOrderPopup
(
detail
))
{
await
handlers
.
onOpenRecordingPopup
?.()
return
true
}
const
flowLocked
=
await
checkAbnormalFlowLock
({
paymentMethod
})
if
(
flowLocked
)
return
false
await
handlers
.
onNavigateCreate
?.(
paymentMethod
)
return
true
}
tabWorkOrder/pages/constructionOrderDetail/constructionOrderDetail.js
View file @
bf5016f
...
@@ -7,6 +7,8 @@ import {
...
@@ -7,6 +7,8 @@ import {
checkStudyTask
,
checkStudyTask
,
checkOrderLockGate
checkOrderLockGate
}
from
'~/store/ModalToQueueControl'
}
from
'~/store/ModalToQueueControl'
import
{
openOrderPromptWithRestrictState
}
from
'~/tabIndex/services/newOrderAbnormalFlowRestrict.service.js'
import
{
confirmOrderPrompt
}
from
'~/tabIndex/services/orderPromptConfirm.service.js'
import
commonApi
from
'~/api/api'
import
commonApi
from
'~/api/api'
const
IMG_URL
=
const
IMG_URL
=
'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/'
'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/'
...
@@ -135,7 +137,7 @@ Page({
...
@@ -135,7 +137,7 @@ Page({
show
:
true
,
show
:
true
,
title
:
'请选择录单入口'
,
title
:
'请选择录单入口'
,
tabTitleShow
:
false
,
tabTitleShow
:
false
,
success
:
res
=>
{
success
:
async
res
=>
{
// 跳转新增订单页面 并带特定参数
// 跳转新增订单页面 并带特定参数
let
{
selectTypeOrder
}
=
this
.
data
let
{
selectTypeOrder
}
=
this
.
data
console
.
log
(
item
,
'showSelectType'
)
console
.
log
(
item
,
'showSelectType'
)
...
@@ -143,7 +145,7 @@ Page({
...
@@ -143,7 +145,7 @@ Page({
// orderInfo.selectPayType = 2
// orderInfo.selectPayType = 2
// }
// }
if
(
selectTypeOrder
==
1
)
{
if
(
selectTypeOrder
==
1
)
{
this
.
setData
({
showPromptDialog
:
true
}
)
await
openOrderPromptWithRestrictState
(
this
)
}
else
{
}
else
{
let
orderInfo
=
this
.
deleteOrderInfo
()
let
orderInfo
=
this
.
deleteOrderInfo
()
wx
.
$router
.
go
(
'tabWorkOrder.defeatOrder'
,
{
wx
.
$router
.
go
(
'tabWorkOrder.defeatOrder'
,
{
...
@@ -185,19 +187,26 @@ Page({
...
@@ -185,19 +187,26 @@ Page({
copyOrderInfo
.
againOrder
=
true
copyOrderInfo
.
againOrder
=
true
return
copyOrderInfo
return
copyOrderInfo
},
},
promptHandleConfirm
(
e
)
{
async
promptHandleConfirm
(
e
)
{
// 处理页面跳转参数
const
orderInfo
=
this
.
deleteOrderInfo
()
let
orderInfo
=
this
.
deleteOrderInfo
()
const
{
orderPromptDjQrOnlyMode
}
=
this
.
data
let
{
payFlag
,
payType
}
=
e
.
detail
await
confirmOrderPrompt
(
let
paymentMethod
=
payFlag
!=
2
?
1
:
payType
e
.
detail
,
if
(
payFlag
==
1
||
payType
==
3
||
payType
==
4
||
payType
==
6
)
{
{
wx
.
$router
.
go
(
'tabWorkOrder.createOrder'
,
{
paymentMethod
,
...
orderInfo
})
onNavigateCreate
:
paymentMethod
=>
{
}
else
{
wx
.
$router
.
go
(
'tabWorkOrder.createOrder'
,
{
this
.
tipsEvent
()
paymentMethod
,
}
...
orderInfo
this
.
setData
({
})
paymentMethod
},
})
onOpenRecordingPopup
:
()
=>
{
this
.
tipsEvent
()
}
},
orderPromptDjQrOnlyMode
)
const
paymentMethod
=
e
.
detail
.
payFlag
!=
2
?
1
:
e
.
detail
.
payType
this
.
setData
({
paymentMethod
})
},
},
promptCancel
()
{
promptCancel
()
{
this
.
setData
({
this
.
setData
({
...
...
tabWorkOrder/pages/constructionOrderDetail/constructionOrderDetail.wxml
View file @
bf5016f
...
@@ -467,6 +467,7 @@
...
@@ -467,6 +467,7 @@
height="var(--fontSize540);"
height="var(--fontSize540);"
includesChildHeight="var(--fontSize1060);"
includesChildHeight="var(--fontSize1060);"
sceneObj="{{ orderInfo }}"
sceneObj="{{ orderInfo }}"
dj-qr-only-mode="{{ orderPromptDjQrOnlyMode }}"
></order-prompt-popup>
></order-prompt-popup>
<ConstructionDetailModal
<ConstructionDetailModal
visible="{{ constructionVisible }}"
visible="{{ constructionVisible }}"
...
...
tests/abnormalFlowLock.helpers.test.mjs
View file @
bf5016f
...
@@ -36,11 +36,26 @@ describe('abnormalFlowLock.helpers', async () => {
...
@@ -36,11 +36,26 @@ describe('abnormalFlowLock.helpers', async () => {
)
)
})
})
it('unprocessed prefers notDeclaredCount', () => {
it('unprocessed prefers totalCount for home tip', () => {
assert.equal(hasUnprocessedAbnormalFlow({ notDeclaredCount: 2 }), true)
assert.equal(
assert.equal(hasUnprocessedAbnormalFlow({ notDeclaredCount: 0 }), false)
hasUnprocessedAbnormalFlow({ totalCount: 3, notDeclaredCount: 0 }),
true
)
assert.equal(
hasUnprocessedAbnormalFlow({ totalCount: 0, notDeclaredCount: 2 }),
false
)
assert.equal(hasUnprocessedAbnormalFlow({ totalCount: 0 }), false)
assert.equal(hasUnprocessedAbnormalFlow({ abnormalFlowNum: 2 }), true)
assert.equal(hasUnprocessedAbnormalFlow({ abnormalFlowNum: 2 }), true)
assert.equal(
assert.equal(
resolveAbnormalFlowTipCount({
totalCount: 3,
notDeclaredCount: 9,
abnormalFlowNum: 1
}),
3
)
assert.equal(
resolveAbnormalFlowTipCount({ notDeclaredCount: 4, abnormalFlowNum: 9 }),
resolveAbnormalFlowTipCount({ notDeclaredCount: 4, abnormalFlowNum: 9 }),
4
4
)
)
...
@@ -68,6 +83,37 @@ describe('abnormalFlowLock.helpers', async () => {
...
@@ -68,6 +83,37 @@ describe('abnormalFlowLock.helpers', async () => {
assert.match(buildAbnormalFlowTipText(3), /3笔异常流水/)
assert.match(buildAbnormalFlowTipText(3), /3笔异常流水/)
})
})
it('shouldRestrictNewOrderToDjQrOnly when lock on and pending flows', async () => {
const { shouldRestrictNewOrderToDjQrOnly } = await import(
'../utils/abnormalFlowLock.helpers.js'
)
assert.equal(
shouldRestrictNewOrderToDjQrOnly(
{ lockControlEnabled: 'Y', lockFlowFlag: 'Y' },
{ totalCount: 2 }
),
true
)
assert.equal(
shouldRestrictNewOrderToDjQrOnly(
{ lockControlEnabled: 'Y', lockFlowFlag: 'Y' },
{ totalCount: 0 }
),
false
)
assert.equal(
shouldRestrictNewOrderToDjQrOnly(false, { totalCount: 5 }),
false
)
assert.equal(
shouldRestrictNewOrderToDjQrOnly(
{ lockControlEnabled: 'N', lockFlowFlag: 'Y' },
{ notDeclaredCount: 3 }
),
false
)
})
it('exports bypass constants', () => {
it('exports bypass constants', () => {
assert.equal(ABNORMAL_FLOW_LOCK_BYPASS.ADDITION_RECORD, 'additionRecord')
assert.equal(ABNORMAL_FLOW_LOCK_BYPASS.ADDITION_RECORD, 'additionRecord')
})
})
...
...
tests/orderPromptConfirm.service.test.mjs
0 → 100644
View file @
bf5016f
import { describe, it } from 'node:test'
import assert from 'node:assert/strict'
describe('orderPromptConfirm.helpers', async () => {
const {
resolveOrderPromptPaymentMethod,
shouldOpenRecordingOrderPopup,
isInvalidDjQrOnlySelection
} = await import('../tabIndex/services/orderPromptConfirm.helpers.js')
it('resolveOrderPromptPaymentMethod', () => {
assert.equal(resolveOrderPromptPaymentMethod({ payFlag: 1 }), 1)
assert.equal(
resolveOrderPromptPaymentMethod({ payFlag: 2, payType: '5' }),
'5'
)
assert.equal(
resolveOrderPromptPaymentMethod({ payFlag: 2, payType: 3 }),
3
)
})
it('shouldOpenRecordingOrderPopup only for dj qr', () => {
assert.equal(shouldOpenRecordingOrderPopup({ payFlag: 1 }), false)
assert.equal(
shouldOpenRecordingOrderPopup({ payFlag: 2, payType: 3 }),
false
)
assert.equal(
shouldOpenRecordingOrderPopup({ payFlag: 2, payType: '5' }),
true
)
})
it('isInvalidDjQrOnlySelection', () => {
assert.equal(isInvalidDjQrOnlySelection({ payType: 3 }, true), true)
assert.equal(isInvalidDjQrOnlySelection({ payType: '5' }, true), false)
assert.equal(isInvalidDjQrOnlySelection({ payType: 3 }, false), false)
})
})
utils/abnormalFlowLock.helpers.js
View file @
bf5016f
...
@@ -90,14 +90,16 @@ export function isAbnormalFlowLockActive(apiData) {
...
@@ -90,14 +90,16 @@ export function isAbnormalFlowLockActive(apiData) {
}
}
/**
/**
* 是否存在未处理异常流水(用于首页提醒)
* 是否存在未处理异常流水(用于首页
吸底
提醒)
* 优先
notDeclaredCount(union.count),兼容旧字段
* 优先
union.count 的 totalCount;清单 Tab 仍用 notDeclaredCount / declaredCount
* @param {Object} [apiData]
* @param {Object} [apiData]
* @returns {boolean}
* @returns {boolean}
*/
*/
export
function
hasUnprocessedAbnormalFlow
(
apiData
)
{
export
function
hasUnprocessedAbnormalFlow
(
apiData
)
{
if
(
!
apiData
)
return
false
if
(
!
apiData
)
return
false
if
(
apiData
.
hasUnprocessedFlow
===
true
)
return
true
if
(
apiData
.
hasUnprocessedFlow
===
true
)
return
true
const
total
=
Number
(
apiData
.
totalCount
)
if
(
Number
.
isFinite
(
total
))
return
total
>
0
const
notDeclared
=
Number
(
apiData
.
notDeclaredCount
)
const
notDeclared
=
Number
(
apiData
.
notDeclaredCount
)
if
(
Number
.
isFinite
(
notDeclared
))
return
notDeclared
>
0
if
(
Number
.
isFinite
(
notDeclared
))
return
notDeclared
>
0
const
num
=
Number
(
apiData
.
abnormalFlowNum
)
const
num
=
Number
(
apiData
.
abnormalFlowNum
)
...
@@ -105,11 +107,13 @@ export function hasUnprocessedAbnormalFlow(apiData) {
...
@@ -105,11 +107,13 @@ export function hasUnprocessedAbnormalFlow(apiData) {
}
}
/**
/**
* 从 union.count 解析
提醒条数
* 从 union.count 解析
首页吸底提醒条数(优先 totalCount)
* @param {Object} [apiData]
* @param {Object} [apiData]
* @returns {number}
* @returns {number}
*/
*/
export
function
resolveAbnormalFlowTipCount
(
apiData
=
{})
{
export
function
resolveAbnormalFlowTipCount
(
apiData
=
{})
{
const
total
=
Number
(
apiData
.
totalCount
)
if
(
Number
.
isFinite
(
total
))
return
total
const
notDeclared
=
Number
(
apiData
.
notDeclaredCount
)
const
notDeclared
=
Number
(
apiData
.
notDeclaredCount
)
if
(
Number
.
isFinite
(
notDeclared
))
return
notDeclared
if
(
Number
.
isFinite
(
notDeclared
))
return
notDeclared
const
num
=
Number
(
apiData
.
abnormalFlowNum
)
const
num
=
Number
(
apiData
.
abnormalFlowNum
)
...
@@ -153,6 +157,19 @@ export function shouldBypassAbnormalFlowLock(context = {}) {
...
@@ -153,6 +157,19 @@ export function shouldBypassAbnormalFlowLock(context = {}) {
}
}
/**
/**
* 新建工单收款弹窗是否仅允许嘀加二维码(锁单 ON + 有待报备)
* @param {boolean|Object|null|undefined} shopLockData - checkShopLock 返回值
* @param {Object} [countData] - union.count 返回值
* @returns {boolean}
*/
export
function
shouldRestrictNewOrderToDjQrOnly
(
shopLockData
,
countData
)
{
return
(
isAbnormalFlowLockActive
(
shopLockData
)
&&
hasUnprocessedAbnormalFlow
(
countData
)
)
}
/**
* 构建首页提醒文案
* 构建首页提醒文案
* @param {number} count
* @param {number} count
* @returns {string}
* @returns {string}
...
...
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