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 c4be7d8b
authored
Jul 01, 2026
by
张立顺
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix bug
1 parent
04d23d73
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
153 additions
and
49 deletions
.cursor/rules/wechat-change-standards.mdc
components/Confirm/form.js
components/CustomerInfo/CustomerInfo.js
components/CustomerInfo/customerInfo.pagination.js
packageDynamicForm/docs/PAGES.md
packageDynamicForm/docs/integration-test-plan.md
packageDynamicForm/services/today-plan-date.js
packageDynamicForm/tests/today-plan-date.test.mjs
project.config.json
tabWorkOrder/components/subShopMerchant/subShopMerchant.js
tabWorkOrder/components/subShopMerchant/subShopMerchant.wxml
tabWorkOrder/pages/createOrder/createOrder.js
tabWorkOrder/pages/createOrder/createOrder.wxml
tabWorkOrder/pages/createOrder/services/pagePopupLock.js
tabWorkOrder/pages/createOrder/tests/pagePopupLock.test.mjs
tabWorkOrder/pages/staffDaily/staffDaily.js
tabWorkOrder/pages/upgradeStaffDaily/services/dailyReportInconsistency.helpers.js
tabWorkOrder/pages/upgradeStaffDaily/tests/dailyReportInconsistency.helpers.test.mjs
tabWorkOrder/pages/upgradeStaffDaily/upgradeStaffDaily.js
tests/customerInfo.pagination.test.mjs
.cursor/rules/wechat-change-standards.mdc
View file @
c4be7d8
...
@@ -35,14 +35,22 @@ alwaysApply: true
...
@@ -35,14 +35,22 @@ alwaysApply: true
## C. 测试(改后必做)
## C. 测试(改后必做)
- **纯函数 / service**:在 `tests/` 下补 `*.test.mjs`(`node:test`
+ `createRequire`
),运行并报告结果
- **纯函数 / service**:在 `tests/` 下补 `*.test.mjs`(`node:test`
,优先 ES `import` 被测模块
),运行并报告结果
- **createOrder services**:`npm run test:createOrder`
- **createOrder services**:`npm run test:createOrder`
- **全量**:`npm test`
- **全量**:`npm test`
- 无测试的新纯函数应补最小覆盖
- 无测试的新纯函数应补最小覆盖
- 页面/UI 逻辑无法自动化时,列出手动回归路径
- 页面/UI 逻辑无法自动化时,列出手动回归路径
## D. 模块导出(页面 services / 组件 helper)
- 页面 `services/`、组件 `.helpers.js` / `.pagination.js` 等纯函数模块:**必须使用 ES `export`**,禁止 `module.exports`
- 页面/组件引用 helper:**优先 ES `import`**,避免 `import` 引用 `module.exports` 混用导致微信依赖分析误判
- 保持 `project.config.json` 中 `ignoreUploadUnusedFiles: true`(上传过滤无依赖文件以控制包体);新增页面 helper 须 ES export,必要时在 `packOptions.include` 登记兜底
- 开发/测试/元数据文件走 `packOptions.ignore`(如 `tests/`、`package-lock.json`、`.cursor/`)
## 改动自检清单
## 改动自检清单
- [ ] 新增/修改函数已补 JSDoc
- [ ] 新增/修改函数已补 JSDoc
- [ ] 新增/修改 helper 使用 ES export(见 D)
- [ ] 已检索跨页引用并说明影响面
- [ ] 已检索跨页引用并说明影响面
- [ ] 已运行相关测试(或说明手动回归项)
- [ ] 已运行相关测试(或说明手动回归项)
components/Confirm/form.js
View file @
c4be7d8
module
.
exports
=
{
export
const
form
=
{
form
:
{
merchantRange
:
{
merchantRange
:
{
data
:
[],
data
:
[],
key
:
'sellerMerchantId'
,
key
:
'sellerMerchantId'
,
...
@@ -53,5 +52,4 @@ module.exports = {
...
@@ -53,5 +52,4 @@ module.exports = {
key
:
'baseSceneCode'
,
key
:
'baseSceneCode'
,
type
:
'array'
type
:
'array'
},
},
},
}
}
\ No newline at end of file
\ No newline at end of file
components/CustomerInfo/CustomerInfo.js
View file @
c4be7d8
...
@@ -2,11 +2,11 @@
...
@@ -2,11 +2,11 @@
* @file 客户档案选择弹框:分页拉取工单客户列表,不调 setData 外的页面实例。
* @file 客户档案选择弹框:分页拉取工单客户列表,不调 setData 外的页面实例。
*/
*/
import
api
from
'../../api/api.js'
import
api
from
'../../api/api.js'
cons
t
{
impor
t
{
DEFAULT_PAGE_SIZE
,
DEFAULT_PAGE_SIZE
,
canLoadMorePage
,
canLoadMorePage
,
mapCustomerListWithCarType
mapCustomerListWithCarType
}
=
require
(
'./customerInfo.pagination.js'
)
}
from
'./customerInfo.pagination.js'
Component
({
Component
({
properties
:
{
properties
:
{
...
...
components/CustomerInfo/customerInfo.pagination.js
View file @
c4be7d8
...
@@ -32,7 +32,7 @@ function mapCustomerListWithCarType(list) {
...
@@ -32,7 +32,7 @@ function mapCustomerListWithCarType(list) {
})
})
}
}
module
.
exports
=
{
export
{
DEFAULT_PAGE_SIZE
,
DEFAULT_PAGE_SIZE
,
canLoadMorePage
,
canLoadMorePage
,
mapCustomerListWithCarType
mapCustomerListWithCarType
...
...
packageDynamicForm/docs/PAGES.md
View file @
c4be7d8
...
@@ -177,7 +177,7 @@
...
@@ -177,7 +177,7 @@
-
**展示条件**
:周历选中当天(
`isTodayReport`
)且表单加载成功;入口条在
`scroll-view`
内随表单滚动
-
**展示条件**
:周历选中当天(
`isTodayReport`
)且表单加载成功;入口条在
`scroll-view`
内随表单滚动
-
**入口条**
:展示
`todayPlanStore.count`
;只读态(
`formDisabled`
)隐藏「查看客户」按钮
-
**入口条**
:展示
`todayPlanStore.count`
;只读态(
`formDisabled`
)隐藏「查看客户」按钮
-
**弹层**
:组件
[
`today-plan-customer-popup`
](
../components/today-plan-customer-popup/
)
;日期
±7 天
切换;多选后「添加到洽谈明细」
-
**弹层**
:组件
[
`today-plan-customer-popup`
](
../components/today-plan-customer-popup/
)
;日期
前后各 6 天(含今天共 7 天)
切换;多选后「添加到洽谈明细」
-
**导入规则**
(
[
`negotiationCustomerImport.js`
](
../services/negotiationCustomerImport.js
)
):
-
**导入规则**
(
[
`negotiationCustomerImport.js`
](
../services/negotiationCustomerImport.js
)
):
-
仅写入
**当前可见**
F3 subform(F3-1~F3-4)
-
仅写入
**当前可见**
F3 subform(F3-1~F3-4)
-
全有或全无;任一可见 subform 超 20 行 →
`wx.showModal`
「添加失败」,文案为
**对应 F3 子表单 `label`**
(如「问界鸿蒙洽谈明细 (延保)一次最多添加20个客户」)
-
全有或全无;任一可见 subform 超 20 行 →
`wx.showModal`
「添加失败」,文案为
**对应 F3 子表单 `label`**
(如「问界鸿蒙洽谈明细 (延保)一次最多添加20个客户」)
...
@@ -216,7 +216,7 @@
...
@@ -216,7 +216,7 @@
-
`IT-DISC-STAFF-*`
/
`IT-SUMMARY-*`
— 汇总员工列表与 jsonContent 表格转换
-
`IT-DISC-STAFF-*`
/
`IT-SUMMARY-*`
— 汇总员工列表与 jsonContent 表格转换
-
`IT-NEG-DETAIL-GET-001`
— detail.get templateType=3
-
`IT-NEG-DETAIL-GET-001`
— detail.get templateType=3
-
`IT-NEG-BRAND-CACHE-001`
-
`IT-NEG-BRAND-CACHE-001`
-
`IT-PLAN-DATE-001`
~
`IT-PLAN-DATE-005`
— 弹层日期文案、
±7
边界、手机号脱敏(
`today-plan-date.test.mjs`
)
-
`IT-PLAN-DATE-001`
~
`IT-PLAN-DATE-005`
— 弹层日期文案、
前后各 6 天
边界、手机号脱敏(
`today-plan-date.test.mjs`
)
-
`IT-PLAN-ADAPTER-001`
~
`IT-PLAN-ADAPTER-004`
— todayPlanStore mock/real 归一(
`negotiationTodayPlanStoreAdapters.test.mjs`
)
-
`IT-PLAN-ADAPTER-001`
~
`IT-PLAN-ADAPTER-004`
— todayPlanStore mock/real 归一(
`negotiationTodayPlanStoreAdapters.test.mjs`
)
-
`IT-PLAN-IMPORT-001`
~
`IT-PLAN-IMPORT-003`
— F3 字段映射、20 行上限、engine 写入(
`negotiationCustomerImport.test.mjs`
)
-
`IT-PLAN-IMPORT-001`
~
`IT-PLAN-IMPORT-003`
— F3 字段映射、20 行上限、engine 写入(
`negotiationCustomerImport.test.mjs`
)
-
`upgrade-icon-url.test.mjs`
— CDN 图标 URL 拼接
-
`upgrade-icon-url.test.mjs`
— CDN 图标 URL 拼接
...
...
packageDynamicForm/docs/integration-test-plan.md
View file @
c4be7d8
...
@@ -44,7 +44,7 @@
...
@@ -44,7 +44,7 @@
| IT-APP-LISTS-
*
| app-save-lists-from-json.test.mjs |
`npm test`
| buildAppNormalizedListsFromJsonContent |
| IT-APP-LISTS-
*
| app-save-lists-from-json.test.mjs |
`npm test`
| buildAppNormalizedListsFromJsonContent |
| IT-SUBFORM-MAX-001 ~ 004 | subform-max-rows.test.mjs |
`npm test`
| subform 最多 20 行 |
| IT-SUBFORM-MAX-001 ~ 004 | subform-max-rows.test.mjs |
`npm test`
| subform 最多 20 行 |
| IT-STORE-APP-
* / IT-STORE-ECHO-*
| store-app-json-
*
.test.mjs |
`npm test`
| 门店保存/回显 jsonContent |
| IT-STORE-APP-
* / IT-STORE-ECHO-*
| store-app-json-
*
.test.mjs |
`npm test`
| 门店保存/回显 jsonContent |
| IT-PLAN-DATE-001 ~ 005 | today-plan-date.test.mjs |
`npm test`
| 弹层日期文案、
±7
边界、手机号脱敏 |
| IT-PLAN-DATE-001 ~ 005 | today-plan-date.test.mjs |
`npm test`
| 弹层日期文案、
前后各 6 天
边界、手机号脱敏 |
| IT-PLAN-ADAPTER-001 ~ 004 | negotiationTodayPlanStoreAdapters.test.mjs |
`npm test`
| todayPlanStore mock/real 与响应归一 |
| IT-PLAN-ADAPTER-001 ~ 004 | negotiationTodayPlanStoreAdapters.test.mjs |
`npm test`
| todayPlanStore mock/real 与响应归一 |
| IT-PLAN-IMPORT-001 ~ 003 | negotiationCustomerImport.test.mjs |
`npm test`
| F3 字段映射、20 行上限、engine 写入 |
| IT-PLAN-IMPORT-001 ~ 003 | negotiationCustomerImport.test.mjs |
`npm test`
| F3 字段映射、20 行上限、engine 写入 |
| upgrade-icon-url.test.mjs | upgrade-icon-url |
`npm test`
| CDN 图标 URL 三类路径拼接 |
| upgrade-icon-url.test.mjs | upgrade-icon-url |
`npm test`
| CDN 图标 URL 三类路径拼接 |
...
...
packageDynamicForm/services/today-plan-date.js
View file @
c4be7d8
...
@@ -73,7 +73,7 @@ function formatPlanStoreDateLabel(dateStr) {
...
@@ -73,7 +73,7 @@ function formatPlanStoreDateLabel(dateStr) {
}
}
/**
/**
* 是否可切换日期(
过去含今天共 7 天;未来最多 +7 天
)
* 是否可切换日期(
前后各含今天共 7 天,偏移 ±6
)
* @param {string} currentDateStr
* @param {string} currentDateStr
* @param {number} offset -1 前一天 / +1 后一天
* @param {number} offset -1 前一天 / +1 后一天
* @returns {boolean}
* @returns {boolean}
...
@@ -89,15 +89,15 @@ function canShiftPlanStoreDate(currentDateStr, offset) {
...
@@ -89,15 +89,15 @@ function canShiftPlanStoreDate(currentDateStr, offset) {
}
}
/**
/**
* 判断日期是否在可选范围内(
过去含今天共 PLAN_STORE_DATE_RANGE_DAYS 天;未来最多 +PLAN_STORE_DATE_RANGE_DAYS 天
)
* 判断日期是否在可选范围内(
前后各含今天共 PLAN_STORE_DATE_RANGE_DAYS 天,偏移 ±(N-1)
)
* @param {string} dateStr
* @param {string} dateStr
* @returns {boolean}
* @returns {boolean}
*/
*/
function
isPlanStoreDateInRange
(
dateStr
)
{
function
isPlanStoreDateInRange
(
dateStr
)
{
const
diff
=
diffPlanStoreDaysFromToday
(
dateStr
)
const
diff
=
diffPlanStoreDaysFromToday
(
dateStr
)
// 含当天共 N 天 →
最早偏移 -(N-1)
// 含当天共 N 天 →
前后各偏移 N-1
const
pastMinDiff
=
-
(
PLAN_STORE_DATE_RANGE_DAYS
-
1
)
const
maxOffset
=
PLAN_STORE_DATE_RANGE_DAYS
-
1
return
diff
>=
pastMinDiff
&&
diff
<=
PLAN_STORE_DATE_RANGE_DAYS
return
diff
>=
-
maxOffset
&&
diff
<=
maxOffset
}
}
/**
/**
...
...
packageDynamicForm/tests/today-plan-date.test.mjs
View file @
c4be7d8
...
@@ -22,11 +22,15 @@ describe('today-plan-date', () => {
...
@@ -22,11 +22,15 @@ describe('today-plan-date', () => {
assert.match(label, /月/)
assert.match(label, /月/)
})
})
it('IT-PLAN-DATE-002: isPlanStoreDateInRange past 7 days incl today, future +7', () => {
it('IT-PLAN-DATE-002: isPlanStoreDateInRange past/future 7 days incl today (offset ±6)', () => {
const dPlus = new Date()
const dPlus6 = new Date()
dPlus.setDate(dPlus.getDate() + 7)
dPlus6.setDate(dPlus6.getDate() + 6)
const plus7 = timeUtil.formatDateStr(dPlus)
const plus6 = timeUtil.formatDateStr(dPlus6)
assert.equal(isPlanStoreDateInRange(plus7), true)
assert.equal(isPlanStoreDateInRange(plus6), true)
const dPlus7 = new Date()
dPlus7.setDate(dPlus7.getDate() + 7)
const plus7 = timeUtil.formatDateStr(dPlus7)
assert.equal(isPlanStoreDateInRange(plus7), false)
const dMinus6 = new Date()
const dMinus6 = new Date()
dMinus6.setDate(dMinus6.getDate() - 6)
dMinus6.setDate(dMinus6.getDate() - 6)
const minus6 = timeUtil.formatDateStr(dMinus6)
const minus6 = timeUtil.formatDateStr(dMinus6)
...
@@ -45,6 +49,10 @@ describe('today-plan-date', () => {
...
@@ -45,6 +49,10 @@ describe('today-plan-date', () => {
const next = shiftPlanStoreDate(today, 1)
const next = shiftPlanStoreDate(today, 1)
assert.ok(next)
assert.ok(next)
assert.equal(canShiftPlanStoreDate(today, 1), true)
assert.equal(canShiftPlanStoreDate(today, 1), true)
const dPlus6 = new Date()
dPlus6.setDate(dPlus6.getDate() + 6)
const plus6 = timeUtil.formatDateStr(dPlus6)
assert.equal(canShiftPlanStoreDate(plus6, 1), false)
})
})
it('IT-PLAN-DATE-004: maskCustomerPhone masks 11-digit phone', () => {
it('IT-PLAN-DATE-004: maskCustomerPhone masks 11-digit phone', () => {
...
...
project.config.json
View file @
c4be7d8
...
@@ -49,15 +49,76 @@
...
@@ -49,15 +49,76 @@
"type"
:
"folder"
"type"
:
"folder"
},
},
{
{
"value"
:
"tabWorkOrder/pages/createOrder/tests"
,
"type"
:
"folder"
},
{
"value"
:
"tabWorkOrder/pages/refundApply/tests"
,
"type"
:
"folder"
},
{
"value"
:
"tabWorkOrder/pages/upgradeStaffDaily/tests"
,
"type"
:
"folder"
},
{
"value"
:
"tests"
,
"type"
:
"folder"
},
{
"value"
:
"packageEquity/docs"
,
"value"
:
"packageEquity/docs"
,
"type"
:
"folder"
"type"
:
"folder"
},
},
{
{
"value"
:
"cdn-upload"
,
"value"
:
"cdn-upload"
,
"type"
:
"folder"
"type"
:
"folder"
},
{
"value"
:
"package-lock.json"
,
"type"
:
"file"
},
{
"value"
:
"package.json"
,
"type"
:
"file"
},
{
"value"
:
"project.private.config.json"
,
"type"
:
"file"
},
{
"value"
:
"jsconfig.json"
,
"type"
:
"file"
},
{
"value"
:
".cursor"
,
"type"
:
"folder"
},
{
"value"
:
"scripts"
,
"type"
:
"folder"
},
{
"value"
:
".cloudbase"
,
"type"
:
"folder"
}
}
],
],
"include"
:
[]
"include"
:
[
{
"value"
:
"tabWorkOrder/pages/createOrder/services/pagePopupLock.js"
,
"type"
:
"file"
},
{
"value"
:
"tabWorkOrder/pages/upgradeStaffDaily/services/dailyReportInconsistency.helpers.js"
,
"type"
:
"file"
},
{
"value"
:
"components/CustomerInfo/customerInfo.pagination.js"
,
"type"
:
"file"
},
{
"value"
:
"components/Confirm/form.js"
,
"type"
:
"file"
}
]
},
},
"setting"
:
{
"setting"
:
{
"urlCheck"
:
false
,
"urlCheck"
:
false
,
...
@@ -103,6 +164,6 @@
...
@@ -103,6 +164,6 @@
"tabIndent"
:
"insertSpaces"
,
"tabIndent"
:
"insertSpaces"
,
"tabSize"
:
2
"tabSize"
:
2
},
},
"appid"
:
"wx
4e697bcf4954ceef
"
,
"appid"
:
"wx
570d9331f9ace0bd
"
,
"simulatorPluginLibVersion"
:
{}
"simulatorPluginLibVersion"
:
{}
}
}
\ No newline at end of file
\ No newline at end of file
tabWorkOrder/components/subShopMerchant/subShopMerchant.js
View file @
c4be7d8
...
@@ -133,6 +133,11 @@ Component({
...
@@ -133,6 +133,11 @@ Component({
orderObj
orderObj
})
})
},
},
/** 取消时通知父页面关闭弹框;内部 show 兼容未绑 cancel 的引用页 */
onPopupCancel
()
{
this
.
setData
({
show
:
false
})
this
.
triggerEvent
(
'cancel'
)
},
async
confirm
()
{
async
confirm
()
{
let
data
=
this
.
data
.
orderObj
let
data
=
this
.
data
.
orderObj
let
thisPage
=
wx
.
$router
.
getPageInstance
()
let
thisPage
=
wx
.
$router
.
getPageInstance
()
...
@@ -144,6 +149,7 @@ Component({
...
@@ -144,6 +149,7 @@ Component({
this
.
setData
({
this
.
setData
({
show
:
false
show
:
false
})
})
this
.
triggerEvent
(
'confirm'
,
data
)
},
},
}
}
})
})
tabWorkOrder/components/subShopMerchant/subShopMerchant.wxml
View file @
c4be7d8
<!--components/subShopMerchant/subShopMerchant.wxml-->
<!--components/subShopMerchant/subShopMerchant.wxml-->
<popup show="{{show}}" bindconfirm="confirm" title="{{title}}">
<popup show="{{show}}" bindconfirm="confirm"
bindcancel="onPopupCancel"
title="{{title}}">
<scroll-view class="sub-shop-merchant-box" scroll-y enhanced="{{true}}" show-scrollbar="{{false}}">
<scroll-view class="sub-shop-merchant-box" scroll-y enhanced="{{true}}" show-scrollbar="{{false}}">
<view class="box">
<view class="box">
<!-- <view class="sub-title text-center">{{title}}</view> -->
<!-- <view class="sub-title text-center">{{title}}</view> -->
...
...
tabWorkOrder/pages/createOrder/createOrder.js
View file @
c4be7d8
...
@@ -565,6 +565,14 @@ Page({
...
@@ -565,6 +565,14 @@ Page({
const
popupKey
=
e
.
currentTarget
.
dataset
.
popupKey
const
popupKey
=
e
.
currentTarget
.
dataset
.
popupKey
this
.
setData
(
closePagePopupPatch
(
popupKey
))
this
.
setData
(
closePagePopupPatch
(
popupKey
))
},
},
/** 二级流量方确认:组件已写入 orderObj,此处仅关弹框解锁 */
onSubShopMerchantConfirm
()
{
this
.
setData
(
closePagePopupPatch
(
'subShopMerchantBox'
))
},
/** 多规格商品确认:SkuGoods 已写入 goodsList,此处仅关弹框解锁 */
onSkuGoodsConfirm
()
{
this
.
setData
(
closePagePopupPatch
(
'skuGoodsBox'
))
},
closeTips
()
{
closeTips
()
{
this
.
setData
({
this
.
setData
({
showTips
:
false
showTips
:
false
...
...
tabWorkOrder/pages/createOrder/createOrder.wxml
View file @
c4be7d8
...
@@ -825,6 +825,9 @@ value="{{ orderObj.remark }}"
...
@@ -825,6 +825,9 @@ value="{{ orderObj.remark }}"
<sub-shop-merchant
<sub-shop-merchant
show="{{ subShopMerchantBox }}"
show="{{ subShopMerchantBox }}"
title="选择二级流量方"
title="选择二级流量方"
bindconfirm="onSubShopMerchantConfirm"
bindcancel="onPagePopupCancel"
data-popup-key="subShopMerchantBox"
selectedSelesMerchantId="{{ orderObj.merchantId || '' }}"
selectedSelesMerchantId="{{ orderObj.merchantId || '' }}"
selectedCustomerInfo="{{ orderObj.customer.customerId || '' }}"
selectedCustomerInfo="{{ orderObj.customer.customerId || '' }}"
selectedSubShopMerchantId="{{ orderObj.subShopMerchantId || '' }}"
selectedSubShopMerchantId="{{ orderObj.subShopMerchantId || '' }}"
...
@@ -872,7 +875,15 @@ value="{{ orderObj.remark }}"
...
@@ -872,7 +875,15 @@ value="{{ orderObj.remark }}"
isSolarFilm="{{ true }}"
isSolarFilm="{{ true }}"
baseConfigData="{{ baseConfigData }}"
baseConfigData="{{ baseConfigData }}"
/>
/>
<sku-goods show="{{ skuGoodsBox }}" sceneType="1" goodsData="{{ skuGoodsData }}" chooseGoodsList="{{ goodsList }}"></sku-goods>
<sku-goods
show="{{ skuGoodsBox }}"
sceneType="1"
goodsData="{{ skuGoodsData }}"
chooseGoodsList="{{ goodsList }}"
bindconfirm="onSkuGoodsConfirm"
bindcancel="onPagePopupCancel"
data-popup-key="skuGoodsBox"
></sku-goods>
<customerInfo show="{{ customerInfoBox }}" bindconfirm="chooseCustomerInfo" bindcancel="onCustomerInfoCancel" />
<customerInfo show="{{ customerInfoBox }}" bindconfirm="chooseCustomerInfo" bindcancel="onCustomerInfoCancel" />
<van-popup show="{{ showSource }}" position="bottom" bind:close="onCloseSource">
<van-popup show="{{ showSource }}" position="bottom" bind:close="onCloseSource">
<van-picker
<van-picker
...
...
tabWorkOrder/pages/createOrder/services/pagePopupLock.js
View file @
c4be7d8
...
@@ -113,7 +113,7 @@ function mergeSetDataForPopupLock(data, updates) {
...
@@ -113,7 +113,7 @@ function mergeSetDataForPopupLock(data, updates) {
return
merged
return
merged
}
}
module
.
exports
=
{
export
{
PAGE_POPUP_KEYS
,
PAGE_POPUP_KEYS
,
computePagePopupVisible
,
computePagePopupVisible
,
shouldSyncPagePopup
,
shouldSyncPagePopup
,
...
...
tabWorkOrder/pages/createOrder/tests/pagePopupLock.test.mjs
View file @
c4be7d8
import { describe, it } from 'node:test'
import { describe, it } from 'node:test'
import assert from 'node:assert/strict'
import assert from 'node:assert/strict'
import { createRequire } from 'node:module'
import {
const require = createRequire(import.meta.url)
const {
computePagePopupVisible,
computePagePopupVisible,
shouldSyncPagePopup,
shouldSyncPagePopup,
closePagePopupPatch,
closePagePopupPatch,
mergeSetDataForPopupLock
mergeSetDataForPopupLock
}
= require('../services/pagePopupLock.js')
}
from '../services/pagePopupLock.js'
describe('pagePopupLock', () => {
describe('pagePopupLock', () => {
it('computePagePopupVisible is false when no popup open', () => {
it('computePagePopupVisible is false when no popup open', () => {
...
@@ -58,4 +55,19 @@ describe('pagePopupLock', () => {
...
@@ -58,4 +55,19 @@ describe('pagePopupLock', () => {
const merged = mergeSetDataForPopupLock(data, updates)
const merged = mergeSetDataForPopupLock(data, updates)
assert.equal(computePagePopupVisible(merged), false)
assert.equal(computePagePopupVisible(merged), false)
})
})
it('closing subShopMerchantBox unlocks page when no other popup open', () => {
const data = { subShopMerchantBox: true, customerInfoBox: false }
const merged = mergeSetDataForPopupLock(
data,
closePagePopupPatch('subShopMerchantBox')
)
assert.equal(computePagePopupVisible(merged), false)
})
it('closing skuGoodsBox unlocks page when no other popup open', () => {
const data = { skuGoodsBox: true, goodsBox: false }
const merged = mergeSetDataForPopupLock(data, closePagePopupPatch('skuGoodsBox'))
assert.equal(computePagePopupVisible(merged), false)
})
})
})
tabWorkOrder/pages/staffDaily/staffDaily.js
View file @
c4be7d8
...
@@ -13,7 +13,7 @@ import {
...
@@ -13,7 +13,7 @@ import {
import
api
from
'../../api'
import
api
from
'../../api'
import
comApi
from
'~/api/api'
import
comApi
from
'~/api/api'
import
{
setConfigInfo
}
from
'~/store/index'
import
{
setConfigInfo
}
from
'~/store/index'
cons
t
{
impor
t
{
isStaffCountInconsistent
,
isStaffCountInconsistent
,
findInconsistentBrandField
,
findInconsistentBrandField
,
hasExistingInputErrors
,
hasExistingInputErrors
,
...
@@ -21,7 +21,7 @@ const {
...
@@ -21,7 +21,7 @@ const {
buildBrandFieldInconsistencyMessage
,
buildBrandFieldInconsistencyMessage
,
buildBrandCheckWarningLines
,
buildBrandCheckWarningLines
,
STAFF_DAILY_FIELD_KEYS
STAFF_DAILY_FIELD_KEYS
}
=
require
(
'../upgradeStaffDaily/services/dailyReportInconsistency.helpers.js'
)
}
from
'../upgradeStaffDaily/services/dailyReportInconsistency.helpers.js'
let
toastList
=
{
let
toastList
=
{
deliveryCount
:
'新车交付数不能为空'
,
deliveryCount
:
'新车交付数不能为空'
,
// filmToShopCount: '到店流量数(太阳膜)不能为空',
// filmToShopCount: '到店流量数(太阳膜)不能为空',
...
...
tabWorkOrder/pages/upgradeStaffDaily/services/dailyReportInconsistency.helpers.js
View file @
c4be7d8
...
@@ -185,7 +185,7 @@ function buildBrandCheckWarningLines(failedItems) {
...
@@ -185,7 +185,7 @@ function buildBrandCheckWarningLines(failedItems) {
)
)
}
}
module
.
exports
=
{
export
{
BRAND_INCONSISTENCY_FIELD_KEYS
,
BRAND_INCONSISTENCY_FIELD_KEYS
,
UPGRADE_STAFF_DAILY_FIELD_KEYS
,
UPGRADE_STAFF_DAILY_FIELD_KEYS
,
STAFF_DAILY_FIELD_KEYS
,
STAFF_DAILY_FIELD_KEYS
,
...
...
tabWorkOrder/pages/upgradeStaffDaily/tests/dailyReportInconsistency.helpers.test.mjs
View file @
c4be7d8
import { describe, it } from 'node:test'
import { describe, it } from 'node:test'
import assert from 'node:assert/strict'
import assert from 'node:assert/strict'
import { createRequire } from 'node:module'
import {
const require = createRequire(import.meta.url)
const {
isStaffCountInconsistent,
isStaffCountInconsistent,
findInconsistentBrandField,
findInconsistentBrandField,
hasExistingInputErrors,
hasExistingInputErrors,
buildBrandCheckWarningLines
buildBrandCheckWarningLines,
} = require('../services/dailyReportInconsistency.helpers.js')
STAFF_DAILY_FIELD_KEYS
} from '../services/dailyReportInconsistency.helpers.js'
const userInfo = { uuid: 'user-b' }
const userInfo = { uuid: 'user-b' }
const orderObjBase = {
const orderObjBase = {
...
@@ -91,9 +89,6 @@ describe('dailyReportInconsistency.helpers', () => {
...
@@ -91,9 +89,6 @@ describe('dailyReportInconsistency.helpers', () => {
})
})
it('findInconsistentBrandField uses staffDaily field keys', () => {
it('findInconsistentBrandField uses staffDaily field keys', () => {
const { STAFF_DAILY_FIELD_KEYS, findInconsistentBrandField } = require(
'../services/dailyReportInconsistency.helpers.js'
)
assert.ok(STAFF_DAILY_FIELD_KEYS.includes('extendedWarrantyToShopCount'))
assert.ok(STAFF_DAILY_FIELD_KEYS.includes('extendedWarrantyToShopCount'))
const result = findInconsistentBrandField({
const result = findInconsistentBrandField({
carBandList: [
carBandList: [
...
...
tabWorkOrder/pages/upgradeStaffDaily/upgradeStaffDaily.js
View file @
c4be7d8
...
@@ -12,14 +12,14 @@ import api from '../../api'
...
@@ -12,14 +12,14 @@ import api from '../../api'
import
apiCon
from
'~/api/api'
import
apiCon
from
'~/api/api'
import
{
getYQInfo
}
from
'~/store/index'
import
{
getYQInfo
}
from
'~/store/index'
import
comApi
from
'~/api/api'
import
comApi
from
'~/api/api'
cons
t
{
impor
t
{
isStaffCountInconsistent
,
isStaffCountInconsistent
,
findInconsistentBrandField
,
findInconsistentBrandField
,
hasExistingInputErrors
,
hasExistingInputErrors
,
buildStaffCountInconsistencyMessage
,
buildStaffCountInconsistencyMessage
,
buildBrandFieldInconsistencyMessage
,
buildBrandFieldInconsistencyMessage
,
buildBrandCheckWarningLines
buildBrandCheckWarningLines
}
=
require
(
'./services/dailyReportInconsistency.helpers.js'
)
}
from
'./services/dailyReportInconsistency.helpers.js'
let
toastList
=
{
let
toastList
=
{
deliveryCount
:
'新车交付数不能为空'
,
deliveryCount
:
'新车交付数不能为空'
,
// filmToShopCount: '到店流量数(太阳膜)不能为空',
// filmToShopCount: '到店流量数(太阳膜)不能为空',
...
...
tests/customerInfo.pagination.test.mjs
View file @
c4be7d8
import { describe, it } from 'node:test'
import { describe, it } from 'node:test'
import assert from 'node:assert/strict'
import assert from 'node:assert/strict'
import { createRequire } from 'node:module'
import {
const require = createRequire(import.meta.url)
const {
DEFAULT_PAGE_SIZE,
DEFAULT_PAGE_SIZE,
canLoadMorePage,
canLoadMorePage,
mapCustomerListWithCarType
mapCustomerListWithCarType
}
= require('../components/CustomerInfo/customerInfo.pagination.js')
}
from '../components/CustomerInfo/customerInfo.pagination.js'
describe('customerInfo.pagination', () => {
describe('customerInfo.pagination', () => {
it('DEFAULT_PAGE_SIZE is 20', () => {
it('DEFAULT_PAGE_SIZE is 20', () => {
...
...
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