Commit a6c88d67 by 张立顺

feat 功能优化

1 parent bcc04720
......@@ -17,8 +17,9 @@ function dailyReportDetailGet(data) {
}
function dailyReportMonthlyPendingCountGet(data) {
return api.get(
'dj.api.smartcarlife.dailyReport.monthly.pending.count',
return api.post(
// 'dj.api.smartcarlife.dailyReport.monthly.pending.count',
'dj.api.smartcarlife.dailyReport.monthly.pending.get',
data,
[],
undefined,
......
......@@ -245,7 +245,7 @@ async function saveDraftAdapter(params = {}) {
const MOCK_MONTHLY_PENDING_COUNT = 12
/**
* 拉取门店本月待邀约数(mock 或 monthly.pending.count GET)
* 拉取门店本月待邀约数(mock 或 monthly.pending.count POST)
* @param {Object} [params={}] merchantId、reportDate
* @returns {Promise<{code: number, message: string, data: { pendingCount: number }|null}>}
*/
......
......@@ -215,7 +215,7 @@
## 2026-06-03 — 门店日报 F2-24 本月待邀约数自动填充
- **范围**:仅 `storeDailyReport`;schema 含 `F2-24` 且 **当天 + 字段无值** 时 GET `dailyReport.monthly.pending.count`(4S `merchantId` + `reportDate`)写入 `pendingCount`;历史日或有值不请求。
- **范围**:仅 `storeDailyReport`;schema 含 `F2-24` 且 **当天 + 字段无值** 时 POST `dailyReport.monthly.pending.count`(4S `merchantId` + `reportDate`)写入 `pendingCount`;历史日或有值不请求。
- **实现**:`dynamicDailyReport.dailyReportMonthlyPendingCountGet`、`storeDailyReportAdapters.fetchMonthlyPendingCountAdapter`、`storeDailyReport.fetchMonthlyPendingCount`、`utils/store-monthly-pending.js`、`applyMonthlyPendingCountIfNeeded`;`STORE_DAILY_API_SWITCH.monthlyPendingCount`。
- **单测**:`storeMonthlyPendingCount.test.mjs`、`IT-STORE-PENDING-001`。
......
......@@ -104,6 +104,7 @@ node "c:/Users/admin/Desktop/工作/dj-car-boutique-work-wechat/scripts/patch-nu
| 新字段 type | `form-engine/field-types/registry.js` + 单测 `tests/field-type-registry.test.mjs` |
| 显隐规则 | `form-engine/visibility/specs/` + `tests/visibility-specs.test.mjs` |
| 三页 Loader / Page | `services/dailyReportBootstrap.js`、`pages/behaviors/dailyReportPage.js` |
| Page Behavior 注册 | **必须在** 各 `*DailyReport.js` 的 `Page({ behaviors: [dailyReportPage] })` 中 require 并注册;**不要**只写在 page.json(与全项目 `reportPageTrackMixin` 一致,否则 `isStaleLoad` 等方法未合并) |
| 详情回显 | `form-engine/detail-echo.js`;`fetchSchema` 返回 `initialValues`;`engine.init(ctx.initialValues)` |
| 子表写入 | 仅 `engine.mutateSubform`(勿直接改 cache) |
......
......@@ -88,7 +88,7 @@
与驻店相同结构,使用 `loadStoreDailyForm` + `storeDailyReport.js`。
`buildFormRequestContext` 额外透传 `sceneType` 给字段选项接口。
`loadFormData` 在 `engine.init` + `applyEngineView` 之后,若 **当天**(`isTodayReport`)、schema 可见 **`F2-24`**(本月待邀约)且该字段 **无值**,则调用 `fetchMonthlyPendingCount`(`dj.api.smartcarlife.dailyReport.monthly.pending.count` GET,`merchantId` 为 4S 店、`reportDate` 为选中日),将 `data.pendingCount` 写入 `F2-24`;历史日期或已有回显/填写不请求、不覆盖。开关:`STORE_DAILY_API_SWITCH.monthlyPendingCount`。
`loadFormData` 在 `engine.init` + `applyEngineView` 之后,若 **当天**(`isTodayReport`)、schema 可见 **`F2-24`**(本月待邀约)且该字段 **无值**,则调用 `fetchMonthlyPendingCount`(`dj.api.smartcarlife.dailyReport.monthly.pending.count` POST,`merchantId` 为 4S 店、`reportDate` 为选中日),将 `data.pendingCount` 写入 `F2-24`;历史日期或已有回显/填写不请求、不覆盖。开关:`STORE_DAILY_API_SWITCH.monthlyPendingCount`。
若当天可编辑且 **`F2-1` 今日驻店人员**可见(如经营品牌含岚图),加载后及每次改选 F2-1 时,**`F2-2` 今日驻店人数**自动同步为选中人员数量(等价于 schema `completeFun.result: "(list.length)"`,不 eval 表达式);F2-1 不可见时不改动 F2-2。见 [`store-staff-count.js`](../utils/store-staff-count.js)、[store-template-features.md](./store-template-features.md)。
......
......@@ -36,8 +36,10 @@ const {
shouldRunVinApiValidate,
runVinApiValidate
} = require('../../form-engine/vin-api-valid-tracker.js')
const dailyReportPage = require('../behaviors/dailyReportPage.js')
Page({
behaviors: [dailyReportPage],
data: {
navBarHeight: 0,
pageTitle: '洽谈明细',
......
{
"navigationStyle": "custom",
"behaviors": ["../behaviors/dailyReportPage"],
"usingComponents": {
"weekCalendar": "../../components/weekCalendar/weekCalendar",
"dynamic-form": "../../components/dynamic-form/dynamic-form"
......
......@@ -14,8 +14,10 @@ var timeUtil = require('~/utils/timeFormat/time-utils.js')
const { parseGroupErrorKey } = require('../../form-engine/group-values.js')
const staffDailyApi = require('../../api/staffDailyReport.js')
const { loadStaffDailyForm } = require('../../services/staffDailyFormLoader.js')
const dailyReportPage = require('../behaviors/dailyReportPage.js')
Page({
behaviors: [dailyReportPage],
data: {
navBarHeight: 0,
pageTitle: '驻店日报-新',
......
{
"navigationStyle": "custom",
"behaviors": ["../behaviors/dailyReportPage"],
"usingComponents": {
"weekCalendar": "../../components/weekCalendar/weekCalendar",
"dynamic-form": "../../components/dynamic-form/dynamic-form"
......
......@@ -27,8 +27,10 @@ const {
resolveStoreStaffCount,
isStoreStaffCountEqual
} = require('../../utils/store-staff-count.js')
const dailyReportPage = require('../behaviors/dailyReportPage.js')
Page({
behaviors: [dailyReportPage],
data: {
navBarHeight: 0,
pageTitle: '门店日报',
......
{
"navigationStyle": "custom",
"behaviors": ["../behaviors/dailyReportPage"],
"usingComponents": {
"weekCalendar": "../../components/weekCalendar/weekCalendar",
"dynamic-form": "../../components/dynamic-form/dynamic-form",
......
......@@ -95,7 +95,7 @@ describe('fetchMonthlyPendingCount', () => {
}
})
it('IT-STORE-PENDING-ADAPTER-002: real adapter calls monthly.pending.count GET', async () => {
it('IT-STORE-PENDING-ADAPTER-002: real adapter calls monthly.pending.count POST', async () => {
const original = STORE_DAILY_API_SWITCH.monthlyPendingCount
STORE_DAILY_API_SWITCH.monthlyPendingCount = 'real'
let captured = null
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!