Commit 4ab77fcb by 张立顺

feat 功能联调修改

1 parent 11c17b93
Showing 41 changed files with 565 additions and 289 deletions
......@@ -84,6 +84,13 @@ module.exports = {
);
// return api.post("dj.api.smartcarlife.employee.getByMerchantId", data);
},
/** 洽谈订单下拉 — goodsOrder.product.outputValue.list */
getGoodsOrderOutputValueList(data) {
return api.post(
"dj.api.smartcarlife.goodsOrder.product.outputValue.list",
data
);
},
/** 根据园区店商户号获取绑定4S店列表 */
getServiceMerchantList(data) {
return api.post("dj.api.smartcarlife.serviceMerchant.list", data);
......
......@@ -18,7 +18,7 @@ export const appId = "wx570d9331f9ace0bd";
* 4预发布
* 5cdptest
*/
let index = 0;
let index = 2;
const accountInfo = wx.getAccountInfoSync();
const systemInfo = wx.getSystemInfoSync();
const envName = accountInfo.miniProgram.envVersion;
......
......@@ -26,6 +26,16 @@
- **UI**:`form-group-repeater` 满行隐藏「新增」;门店/洽谈/驻店日报 `onGroupAdd` 触顶 Toast。
- **单测**:`IT-SUBFORM-MAX-001`~`004`(`tests/subform-max-rows.test.mjs`)。
## 2026-06-03 — 洽谈明细表汇总 UI 对齐详情(form-group-repeater)
- **数据**:`buildNegotiationSummaryTables` 输出 `recordRows`(按 subform 行),移除横向矩阵 `columns/rows`。
- **组件**:`negotiation-summary-section` 只读子表单(翻页、`第 N 行`、浅蓝区、白字段块);删除 `negotiation-summary-table`。
- **Tab**:选中实心蓝底白字;仅 1 名员工仍展示 Tab 条。
## 2026-06-03 — 洽谈明细表汇总 UI(Figma 814-7748)
- **周历**:`storeDailyReport` 汇总态 `wx:if` 隐藏 `weekCalendar`。
## 2026-06-03 — 洽谈明细表汇总迁至门店日报
- **入口**:`storeDailyReport` 底部「查看洽谈明细表汇总」;`negotiationDetail` 移除汇总按钮。
......@@ -66,12 +76,15 @@
- **修复**:`form-field-datetime` 分钟精度改为 **date + time 双 picker**;`maxDate: today` 时 date 设 `start`+`end`,选今天时 time `end` 为当前时分。
- **单测**:`IT-DATE-MINUTE-001`~`004` 更新。
## 2026-06-03 — 配置中心 type: date 选到分钟
## 2026-06-04 — 配置中心 type: date 仅选日期
- **schema**:`type: date` 保留为 `date`、`rules.format: 'date'`;`maxDate: new Date()` → `today`(日历上限,不启分钟双 picker)。
- **组件**:`resolveWithTime` 对 `type: date` 为 false,单 `picker mode=date`;`type: datetime` + `pickerPrecision: minute` 仍选到分钟。
- **单测**:`IT-NEG-010`、`IT-DATE-MINUTE-002` 更新。
## 2026-06-03 — 配置中心 type: date 选到分钟(已回退)
- **schema**:`type: date` 归一化后设 `pickerPrecision: 'minute'`、`rules.format: 'datetime'`,不再被 `childrenRules.format: date` 压成仅选日。
- **组件**:[`datetime-picker-mode.js`](../../packageDynamicForm/form-engine/datetime-picker-mode.js) + `form-field-datetime` 双 picker 选到分钟。
- **范围**:`type: datetime` + `rules.format: date`(如 F3-1-1 交车日期)仍为仅选日。
- **单测**:`IT-NEG-010` 更新、`IT-DATE-MINUTE-001`~`004`。
- ~~`type: date` 归一化为 datetime + 分钟双 picker~~ → 见上「仅选日期」。
## 2026-06-03 — 洽谈明细 F3-4(轻改)子表单校验误报修复
......@@ -82,7 +95,7 @@
## 2026-06-03 — 洽谈明细订单选项对齐 gl_tape
- **接口**:`orderList` → `goodsOrder.product.outputValue.list`;`saleDate` 优先 subform 行 `F3-*-12`,缓存 key 含 saleDate。
- **接口**:`orderList` → `goodsOrder.product.outputValue.list`;请求体补 `baseGoodsCodeList`(门店 sceneList)、`carBrandTypeFlag`(subform brandId);`saleDate` 优先 subform 行 `F3-*-12`,缓存 key 含 saleDate / sceneList / groupBrandIds。
- **UI**:`form-field-select` 未选成交日期 toast;选项展示 `orderCode`;`raw` 供选单联动。
- **联动**:`select-complete-fun.js` + `negotiationDetail.onGroupChange` 执行 schema `completeFun`;改成交日期/是否成交=否 时清空订单及衍生字段。
- **单测**:`IT-NEG-006`~`008`、`IT-NEG-006b`;`completeFun` 依赖配置中心 schema 下发。
......
......@@ -103,8 +103,9 @@
### 洽谈明细表汇总
- **入口**:底部「查看洽谈明细表汇总」(当天在「保存并提交」「保存」下方;历史/已提交日仍可查看)
- **交互**:页内 `negotiation-summary` 覆盖层;导航标题「洽谈明细表」;返回/切日期关闭
- **接口**(与 App 门店页逻辑一致):`discussion.staff.list`(`merchantId` + `reportDate`);`detail.get` templateType=3 → `buildNegotiationSummaryTables`
- **交互**:页内 `negotiation-summary` 覆盖层;导航标题「洽谈明细表」;汇总态隐藏顶部 `weekCalendar`;返回/切日期关闭
- **UI**:与洽谈明细 `form-group-repeater` 只读一致(员工 Tab 实心蓝、分节 `N/M` 翻页、浅蓝卡片、白字段块);仅 1 名员工仍显示 Tab;同节多条用翻页,非横向矩阵表;汇总区 `margin-top` 与周历一致,Tab 白底条;返回按钮为主按钮蓝样式(同「保存并提交」)
- **接口**(与 App 门店页逻辑一致):`discussion.staff.list`(`merchantId` + `reportDate`);`detail.get` templateType=3 → `buildNegotiationSummaryTables`(`recordRows`)
### 字段选项
......
......@@ -15,7 +15,7 @@
- 三页 brand 缓存:切日期不重复 merchant.info。
- 分包文档:README / ARCHITECTURE / PAGES / MAINTENANCE + 关键模块头注释。
当前联调:三页 detail/schema/fieldOptions/save/weekly/scene 为 real;Loader 主营品牌 brand 为 mock;表单 L3/L4 车型为 real。
当前联调:三页 detail/schema/fieldOptions/save/weekly/scene/brand 为 real;表单 L3/L4 车型(`CAR_MODEL_QUERY_SWITCH`)为 real。
关键文件:
- packageDynamicForm/README.md
......@@ -53,7 +53,7 @@
// 驻店 / 门店 / 洽谈 — 除 brand 外均为 real;saveEcho = 'off'
STAFF_DAILY_API_SWITCH / STORE_DAILY_API_SWITCH / NEGOTIATION_DAILY_API_SWITCH:
detail, schema, save, scene, weekly, fieldOptions = 'real'
brand = 'mock' // Loader 初始化 merchant.info;与表单 carBrandPick 无关
brand = 'real' // Loader 初始化 merchant.info;与表单 carBrandPick 无关
saveEcho = 'off'
// 洽谈另:discussionStaffList = 'real'
......@@ -147,7 +147,7 @@ flowchart LR
1. **配置中心字段值**:线上 radio 可能是中文值(如「在岗」),本地 fixture 若仅做结构转换可能仍是 `"1"`,显隐异常时可从 develop 拉配置覆盖 fixture。
2. **预发布 beta**:`staff-daily-template` 可能未配置,会报「配置中心未返回模版数据」。
3. **brand**:三页 Loader 默认 `brand=mock`(初始化);adapter 支持 real 且 brandCache。
3. **brand**:三页 Loader 默认 `brand=real`(初始化 merchant.info);adapter 支持 mock 且 brandCache。
4. **saveEcho**:三页默认 `off`;洽谈 `saveEcho=mock` 时提交仍可能写本地 mock 存储。
5. **select 单选**:`type: select` 存标量;`multipleSelect` 存数组;见 field-options-api.md。
......
......@@ -89,7 +89,7 @@ App 草稿 `saveReport` 仅做 childrenValue 序列化、**不产** fieldDataLis
| 读 subform 行 | [`getSectionRowFieldsList`](../../../packageDynamicForm/form-engine/app-subform-json.js) | 优先 **`childrenValue`** + `origin_children`;兼容旧 **`children`** / **`value`** |
| 合并 schema | [`mergeAppJsonIntoSchema`](../../../packageDynamicForm/form-engine/app-subform-json.js) | 写入 `schema.list[].value`(FormField[][]) |
| 页面 values | [`parseJsonContentDetailValues`](../../../packageDynamicForm/form-engine/submit-adapter.js) | 可与 `subformDataList` / `fieldDataList` 二次合并(见各页 Loader) |
| 洽谈汇总表 | [`buildNegotiationSummaryTables`](../../../packageDynamicForm/form-engine/negotiation-summary-transform.js) | 经 `getSectionRowFieldsList` 解码后建表 |
| 洽谈汇总表 | [`buildNegotiationSummaryTables`](../../../packageDynamicForm/form-engine/negotiation-summary-transform.js) | 经 `getSectionRowFieldsList` 解码为 `recordRows` |
App 回显模板:`childrenValue` + `origin_children` → 重建 `children`(见 gl_tape `index.vue`);小程序 `childrenValueToRowFieldsList` 与之对齐。
......
......@@ -79,7 +79,7 @@ const subformDataList = buildAppSubformDataListFromJsonContent(jsonContent)
|------------|------|------|
| `storeStaffList` | [`mock-field-options.js`](../../packageDynamicForm/fixtures/mock-field-options.js) | `dj.api.smartcarlife.employee.onTheJob.getByMerchantId`([`api.getEmployeeList`](../../api/api.js)) |
| `4sStaffList` | mock fixture | 同上(对齐精品新建工单交付专员 `Merchant-Seles type=3`) |
| `orderList` | mock fixture | `dj.api.smartcarlife.goodsOrder.product.outputValue.list`(sellerUserId=staffUuid;**saleDate 优先行内成交日期 F3-*-12**,否则周历 reportDate;选项 label 为 orderCode,option 含 `raw` 供 completeFun) |
| `orderList` | mock fixture | `api.getGoodsOrderOutputValueList` → `dj.api.smartcarlife.goodsOrder.product.outputValue.list`(sellerUserId=staffUuid;**baseGoodsCodeList** 来自 `pageContext.sceneList` 的 `baseSceneCode`;**carBrandTypeFlag** `1` 鸿蒙智行 / `2` 岚图 / `3` 其他,由当前 subform `group.brandId` 推导;**saleDate** 优先行内成交日期 F3-*-12,否则周历 reportDate;选项 label 为 orderCode,option 含 `raw` 供 completeFun) |
### storeStaffList / 4sStaffList(在职员工列表)
......
......@@ -54,7 +54,7 @@ packageDynamicForm/
[`config/apiSwitch.js`](config/apiSwitch.js):每页独立开关(`detail` / `schema` / `brand` / `scene` / `weekly` / `fieldOptions` / `save` / `saveEcho`),值为 `'mock'` 或 `'real'`。
当前默认:三页 `detail` / `schema` / `fieldOptions` / `save` / `weekly` / `scene` 为 `real`;Loader 初始化主营品牌 `brand` 为 `mock`;表单四级车型 `CAR_MODEL_QUERY_SWITCH` 为 `real`。
当前默认:三页 `detail` / `schema` / `fieldOptions` / `save` / `weekly` / `scene` / `brand` 为 `real`;表单四级车型 `CAR_MODEL_QUERY_SWITCH` 为 `real`。
## 测试
......
......@@ -5,6 +5,11 @@
* fetchStoreStaffListOptions:api.getEmployeeList,仅传 merchantId(不传 sceneList)
* 驻店由 adapter 传入 yqMerchantId;门店/洽谈 storeStaffList 同;4sStaffList 传 4S shopMerchantId
*/
const {
resolveBaseGoodsCodeList,
resolveCarBrandTypeFlag
} = require('../utils/order-list-params.js')
let employeeListApiModule = null
let orderListApiModule = null
......@@ -21,10 +26,10 @@ function __setEmployeeListApi(api) {
employeeListApiModule = api
}
/** 懒加载订单列表 API 模块 */
/** 懒加载订单列表 API 模块(与 getEmployeeList 同走 api/api.js) */
function getOrderListApi() {
if (!orderListApiModule) {
orderListApiModule = require('../../utils/request/request.js')
orderListApiModule = require('../../api/api.js')
}
return orderListApiModule
}
......@@ -132,9 +137,18 @@ function mapOrderListToOptions(list = []) {
* @param {string} [options.staffUuid] 当前员工 UUID(sellerUserId)
* @param {string} [options.reportDate] 周历日期 fallback
* @param {string} [options.saleDate] 行内成交日期,优先于 reportDate
* @param {Array} [options.sceneList] 门店 sceneList → baseGoodsCodeList
* @param {Array} [options.groupBrandIds] 当前 subform brandId → carBrandTypeFlag
* @returns {Promise<{code: number, message: string, data: Array}>}
*/
async function fetchOrderListOptions({ merchantId, staffUuid, reportDate, saleDate } = {}) {
async function fetchOrderListOptions({
merchantId,
staffUuid,
reportDate,
saleDate,
sceneList,
groupBrandIds
} = {}) {
if (!merchantId) {
return { code: -1, message: '缺少门店信息', data: [] }
}
......@@ -142,14 +156,12 @@ async function fetchOrderListOptions({ merchantId, staffUuid, reportDate, saleDa
const params = {
merchantId,
sellerUserId: staffUuid || '',
carBrandTypeFlag: '',
baseGoodsCodeList: resolveBaseGoodsCodeList(sceneList),
carBrandTypeFlag: resolveCarBrandTypeFlag(groupBrandIds),
saleDate: saleDate || reportDate || ''
}
const result = await getOrderListApi().post(
'dj.api.smartcarlife.goodsOrder.product.outputValue.list',
params
)
const result = await getOrderListApi().getGoodsOrderOutputValueList(params)
const code = result?.code ?? -1
if (code != 0) {
return {
......
......@@ -75,7 +75,9 @@ async function fetchFieldOptionsAdapter(params = {}) {
merchantId: params.merchantId,
staffUuid: params.staffUuid,
reportDate: params.reportDate,
saleDate: params.saleDate
saleDate: params.saleDate,
sceneList: params.sceneList,
groupBrandIds: params.groupBrandIds
})
}
......
......@@ -3,6 +3,9 @@ const { fetchFieldOptionsAdapter } = require('./fieldOptionsAdapters.js')
const optionsCache = new Map()
function buildCacheKey(params = {}) {
const brandKey = Array.isArray(params.groupBrandIds)
? params.groupBrandIds.join(',')
: ''
return [
params.optionsKey || '',
params.merchantId || '',
......@@ -10,7 +13,9 @@ function buildCacheKey(params = {}) {
params.staffUuid || '',
params.reportDate || '',
params.saleDate || '',
params.reportType || 'store'
params.reportType || 'store',
brandKey,
JSON.stringify(params.sceneList || [])
].join('|')
}
......
......@@ -4,15 +4,17 @@
<text class="form-info-row__required" wx:if="{{ field.required }}">*</text>
</view>
<view class="form-info-row__control">
<view
wx:for="{{ field.options }}"
wx:key="value"
class="form-info-row__option {{ value === item.value ? 'is-active' : '' }}"
data-value="{{ item.value }}"
bindtap="onSelect"
>
<view class="form-info-row__radio-dot"></view>
<text class="form-info-row__option-text">{{ item.label }}</text>
<view class="form-info-row__radio-group">
<view
wx:for="{{ field.options }}"
wx:key="value"
class="form-info-row__option {{ value === item.value ? 'is-active' : '' }}"
data-value="{{ item.value }}"
bindtap="onSelect"
>
<view class="form-info-row__radio-dot"></view>
<text class="form-info-row__option-text">{{ item.label }}</text>
</view>
</view>
</view>
</view>
......
......@@ -52,12 +52,22 @@
}
.form-info-row--radio .form-info-row__control {
flex-wrap: wrap;
align-content: flex-end;
flex-wrap: nowrap;
justify-content: flex-end;
row-gap: 16rpx;
column-gap: 28rpx;
align-items: flex-start;
min-width: 0;
gap: 0;
}
.form-info-row__radio-group {
display: inline-grid;
grid-template-columns: repeat(2, max-content);
column-gap: 28rpx;
row-gap: 16rpx;
margin-left: auto;
width: max-content;
max-width: 100%;
justify-items: start;
}
.form-info-row__option {
......
......@@ -21,6 +21,7 @@ Component({
error: { type: String, value: '' },
requestContext: { type: Object, value: {} },
rowValues: { type: Object, value: {} },
groupBrandIds: { type: Array, value: [] },
groupKey: { type: String, value: '' },
rowIndex: { type: Number, value: -1 }
},
......@@ -90,7 +91,9 @@ Component({
? resolveOrderListSaleDate(field, rowValues, ctx.reportDate)
: ''
const { optionId } = resolveSelectFieldState(field, value, [])
const syncKey = `${field.optionsKey}|${merchantKey}|${saleDate}|${optionId || value}`
const brandKey = (this.properties.groupBrandIds || []).join(',')
const sceneKey = JSON.stringify(ctx.sceneList || [])
const syncKey = `${field.optionsKey}|${merchantKey}|${saleDate}|${brandKey}|${sceneKey}|${optionId || value}`
if (syncKey === this._lastDisplaySyncKey && this.data.pickerOptions.length) {
this.refreshDisplayLabel(field, value)
return
......@@ -139,7 +142,9 @@ Component({
reportDate: ctx.reportDate,
saleDate,
reportType: ctx.reportType || 'store',
sceneType: ctx.sceneType
sceneType: ctx.sceneType,
sceneList: ctx.sceneList || [],
groupBrandIds: this.properties.groupBrandIds || []
}
},
......
......@@ -67,6 +67,7 @@
error="{{ errors[group.key + '__' + activeIndex + '__' + child.key] || '' }}"
request-context="{{ requestContext }}"
row-values="{{ rowValues }}"
group-brand-ids="{{ group.brandId }}"
group-key="{{ group.key }}"
row-index="{{ activeIndex }}"
bind:change="onFieldChange"
......
Component({
properties: {
label: {
type: String,
value: ''
},
recordRows: {
type: Array,
value: []
},
activeIndex: {
type: Number,
value: 0
}
},
data: {
visibleFields: []
},
observers: {
'recordRows, activeIndex'(recordRows, activeIndex) {
const rows = Array.isArray(recordRows) ? recordRows : []
const index = Number(activeIndex)
const safeIndex = Number.isFinite(index) && index >= 0 ? index : 0
const row = rows[safeIndex] || { fields: [] }
this.setData({
visibleFields: Array.isArray(row.fields) ? row.fields : []
})
}
},
methods: {
onNav(e) {
const direction = Number(e.currentTarget.dataset.direction)
if (!direction) return
this.triggerEvent('nav', { direction })
}
}
})
<view class="summary-repeater">
<view class="summary-repeater__title">{{ label }}</view>
<view wx:if="{{ recordRows.length }}" class="summary-repeater__nav">
<view
class="summary-repeater__nav-btn {{ recordRows.length <= 1 || activeIndex <= 0 ? 'is-disabled' : '' }}"
data-direction="-1"
bindtap="onNav"
>
<view class="summary-repeater__nav-arrow summary-repeater__nav-arrow--left"></view>
</view>
<view class="summary-repeater__nav-text">{{ activeIndex + 1 }}/{{ recordRows.length }}</view>
<view
class="summary-repeater__nav-btn {{ !recordRows.length || activeIndex + 1 >= recordRows.length ? 'is-disabled' : '' }}"
data-direction="1"
bindtap="onNav"
>
<view class="summary-repeater__nav-arrow summary-repeater__nav-arrow--right"></view>
</view>
</view>
<view wx:if="{{ recordRows.length }}" class="summary-repeater__card">
<view class="summary-repeater__card-hd">
<text class="summary-repeater__row-label">第{{ activeIndex + 1 }}行</text>
</view>
<view class="summary-repeater__fields">
<view
class="summary-repeater__field-item"
wx:for="{{ visibleFields }}"
wx:for-index="fieldIndex"
wx:key="fieldIndex"
>
<view class="form-info-row is-disabled">
<view class="form-info-row__label">{{ item.label }}</view>
<view class="form-info-row__value">{{ item.value }}</view>
</view>
</view>
</view>
</view>
</view>
@import '../form-field-radio/form-field-radio.wxss';
@import '../form-field-select/form-field-select.wxss';
/* Figma 229-8646 — 只读子表单,对齐 form-group-repeater */
.summary-repeater__title {
font-size: 32rpx;
font-weight: 600;
color: #292d33;
line-height: 44rpx;
}
.summary-repeater__nav {
display: flex;
align-items: center;
justify-content: center;
margin-top: 24rpx;
box-sizing: border-box;
}
.summary-repeater__nav-btn {
display: flex;
align-items: center;
justify-content: center;
width: 56rpx;
height: 56rpx;
}
.summary-repeater__nav-btn.is-disabled {
opacity: 0.35;
}
.summary-repeater__nav-text {
min-width: 88rpx;
margin: 0 32rpx;
font-size: 28rpx;
font-weight: 500;
color: #292d33;
text-align: center;
line-height: 40rpx;
}
.summary-repeater__nav-arrow {
width: 16rpx;
height: 16rpx;
border-top: 4rpx solid #347bff;
border-right: 4rpx solid #347bff;
box-sizing: border-box;
}
.summary-repeater__nav-arrow--left {
transform: rotate(-135deg);
}
.summary-repeater__nav-arrow--right {
transform: rotate(45deg);
}
.summary-repeater__nav-btn.is-disabled .summary-repeater__nav-arrow {
border-color: #bec1c7;
}
.summary-repeater__card {
margin-top: 24rpx;
padding: 32rpx;
background: rgba(148, 194, 255, 0.2);
border-radius: 24rpx;
box-sizing: border-box;
}
.summary-repeater__card-hd {
margin-bottom: 24rpx;
}
.summary-repeater__row-label {
font-size: 28rpx;
font-weight: 500;
color: #5a5e66;
line-height: 40rpx;
}
.summary-repeater__fields {
display: flex;
flex-direction: column;
}
.summary-repeater__field-item {
margin-bottom: 16rpx;
border-radius: 16rpx;
overflow: hidden;
background: #fff;
}
.summary-repeater__field-item:last-child {
margin-bottom: 0;
}
.summary-repeater__field-item .form-info-row {
min-height: 96rpx;
border-bottom: none;
border-radius: 16rpx;
background: #fff;
}
.summary-repeater__field-item .form-info-row__label {
max-width: 420rpx;
flex-wrap: wrap;
line-height: 40rpx;
}
.summary-repeater__field-item .form-info-row__value {
word-break: break-all;
white-space: normal;
}
Component({
properties: {
columns: {
type: Array,
value: []
},
rows: {
type: Array,
value: []
}
}
})
<view class="summary-table">
<scroll-view scroll-x enhanced show-scrollbar="{{ false }}" class="summary-table__scroll">
<view class="summary-table__inner">
<view class="summary-table__header">
<view class="summary-table__corner">
<text class="summary-table__corner-text">字段</text>
</view>
<view
class="summary-table__th"
wx:for="{{ columns }}"
wx:key="title"
>
<text class="summary-table__th-text">{{ item.title }}</text>
</view>
</view>
<view
class="summary-table__row"
wx:for="{{ rows }}"
wx:key="rowHeader"
wx:for-index="rowIndex"
>
<view class="summary-table__row-header">
<text class="summary-table__row-header-text">{{ item.rowHeader }}</text>
</view>
<view
class="summary-table__cell"
wx:for="{{ item.data }}"
wx:for-item="cell"
wx:key="*this"
>
<text class="summary-table__cell-text">{{ cell }}</text>
</view>
</view>
</view>
</scroll-view>
</view>
/* Figma 814-7748 / 小程序日报 225-8129 只读表格 */
.summary-table {
width: 100%;
}
.summary-table__scroll {
width: 100%;
white-space: nowrap;
}
.summary-table__inner {
display: inline-block;
min-width: 100%;
}
.summary-table__header,
.summary-table__row {
display: flex;
flex-direction: row;
align-items: stretch;
min-height: 96rpx;
border-bottom: 2rpx solid #eff0f2;
box-sizing: border-box;
}
.summary-table__corner,
.summary-table__row-header {
flex-shrink: 0;
width: 200rpx;
min-width: 200rpx;
padding: 24rpx 16rpx;
box-sizing: border-box;
background: #fff;
display: flex;
align-items: center;
}
.summary-table__corner-text,
.summary-table__row-header-text {
font-size: 28rpx;
color: #5a5e66;
line-height: 40rpx;
word-break: break-all;
white-space: normal;
}
.summary-table__th,
.summary-table__cell {
flex-shrink: 0;
width: 240rpx;
min-width: 240rpx;
padding: 24rpx 16rpx;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: flex-end;
background: #fff;
}
.summary-table__th-text,
.summary-table__cell-text {
font-size: 28rpx;
line-height: 40rpx;
word-break: break-all;
white-space: normal;
text-align: right;
}
.summary-table__th-text {
color: #5a5e66;
font-weight: 500;
}
.summary-table__cell-text {
color: #292d33;
}
......@@ -20,7 +20,8 @@ Component({
loadError: '',
staffList: [],
currentIndex: 0,
sections: []
sections: [],
sectionNavIndex: []
},
observers: {
......@@ -56,6 +57,22 @@ Component({
this.loadStaffDetail(this.data.staffList[index])
},
onSectionNav(e) {
const sectionIndex = Number(e.currentTarget.dataset.sectionIndex)
const direction = Number(e.detail?.direction)
if (Number.isNaN(sectionIndex) || !direction) return
const sections = this.data.sections || []
const section = sections[sectionIndex]
const rowTotal = section?.recordRows?.length || 0
if (!rowTotal) return
const nav = [...(this.data.sectionNavIndex || [])]
const current = nav[sectionIndex] ?? 0
const next = current + direction
if (next < 0 || next >= rowTotal) return
nav[sectionIndex] = next
this.setData({ sectionNavIndex: nav })
},
async loadStaffList() {
const { reportDate, merchantId } = this.properties
if (!reportDate || !merchantId) return
......@@ -65,6 +82,7 @@ Component({
loadError: '',
staffList: [],
sections: [],
sectionNavIndex: [],
currentIndex: 0
})
try {
......@@ -101,7 +119,7 @@ Component({
async loadStaffDetail(staff = {}) {
const { reportDate, merchantId } = this.properties
if (!staff.staffUuid || !reportDate || !merchantId) {
this.setData({ sections: [] })
this.setData({ sections: [], sectionNavIndex: [] })
return
}
this.setData({ detailLoading: true })
......@@ -112,15 +130,18 @@ Component({
reportDate
})
if (res.code !== 0 || !res.data) {
this.setData({ sections: [] })
this.setData({ sections: [], sectionNavIndex: [] })
return
}
const jsonContent = res.data.jsonContent || ''
const sections = buildNegotiationSummaryTables(jsonContent)
this.setData({ sections })
this.setData({
sections,
sectionNavIndex: sections.map(() => 0)
})
} catch (error) {
console.error(error)
this.setData({ sections: [] })
this.setData({ sections: [], sectionNavIndex: [] })
} finally {
this.setData({ detailLoading: false })
}
......
{
"component": true,
"usingComponents": {
"negotiation-summary-table": "../negotiation-summary-table/negotiation-summary-table",
"negotiation-summary-section": "../negotiation-summary-section/negotiation-summary-section",
"empty-data": "/components/EmptyData/EmptyData"
}
}
......@@ -34,8 +34,13 @@
wx:for="{{ sections }}"
wx:key="label"
>
<view class="negotiation-summary__section-title">{{ item.label }}</view>
<negotiation-summary-table columns="{{ item.columns }}" rows="{{ item.rows }}" />
<negotiation-summary-section
label="{{ item.label }}"
recordRows="{{ item.recordRows }}"
activeIndex="{{ sectionNavIndex[index] }}"
data-section-index="{{ index }}"
bind:nav="onSectionNav"
/>
</view>
<view class="negotiation-summary__empty-detail" wx:if="{{ !sections.length }}">
<empty-data />
......@@ -48,6 +53,8 @@
</view>
<view class="negotiation-summary__footer">
<view class="negotiation-summary__back text-center" bindtap="onBack">返回</view>
<view class="negotiation-summary__footer-con">
<view class="negotiation-summary__back" bindtap="onBack">返回</view>
</view>
</view>
</view>
......@@ -32,6 +32,8 @@
.negotiation-summary__tabs-scroll {
flex-shrink: 0;
width: 100%;
background: #fff;
box-shadow: 0 4rpx 8rpx 0 rgba(205, 205, 209, 0.35);
}
.negotiation-summary__tabs {
......@@ -47,20 +49,19 @@
flex-shrink: 0;
height: 64rpx;
padding: 0 32rpx;
border-radius: 32rpx;
background: #fff;
color: #5a5e66;
border-radius: 15rpx;
background: #eff0f2;
color: #292d33;
font-size: 28rpx;
line-height: 64rpx;
box-sizing: border-box;
border: 2rpx solid transparent;
border: none;
}
.negotiation-summary__tab.is-active {
color: #347bff;
color: #fff;
font-weight: 500;
background: rgba(44, 102, 247, 0.1);
border-color: rgba(44, 102, 247, 0.2);
background: #347BFF;
}
.negotiation-summary__content {
......@@ -79,14 +80,6 @@
overflow: hidden;
}
.negotiation-summary__section-title {
font-size: 32rpx;
font-weight: 600;
color: #292d33;
line-height: 44rpx;
margin-bottom: 24rpx;
}
.negotiation-summary__footer {
flex-shrink: 0;
padding: 16rpx 32rpx;
......@@ -95,15 +88,26 @@
box-sizing: border-box;
}
.negotiation-summary__footer-con {
width: 622rpx;
max-width: 100%;
margin: 0 auto;
box-sizing: border-box;
}
.negotiation-summary__back {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 80rpx;
line-height: 80rpx;
border-radius: 12rpx;
background: #fff;
color: #292d33;
font-size: 32rpx;
background: #347bff;
color: #fff;
font-size: 28rpx;
font-weight: 500;
border: 2rpx solid #eff0f2;
text-align: center;
border: 2rpx solid #347bff;
box-sizing: border-box;
}
......
......@@ -14,7 +14,7 @@ const STAFF_DAILY_API_SWITCH = {
save: 'real',
saveEcho: 'off',
scene: 'real',
brand: 'mock',
brand: 'real',
weekly: 'real',
fieldOptions: 'real'
}
......@@ -28,7 +28,7 @@ const STORE_DAILY_API_SWITCH = {
save: 'real',
saveEcho: 'off',
scene: 'real',
brand: 'mock',
brand: 'real',
weekly: 'real',
fieldOptions: 'real',
monthlyPendingCount: 'real'
......@@ -40,7 +40,7 @@ const NEGOTIATION_DAILY_API_SWITCH = {
save: 'real',
saveEcho: 'off',
scene: 'real',
brand: 'mock',
brand: 'real',
weekly: 'real',
fieldOptions: 'real',
discussionStaffList: 'real'
......
......@@ -48,7 +48,10 @@ export function resolveNotAfterNow(field = {}) {
/** 是否选到分钟(date + time 双 picker,与上限解耦) */
export function resolveWithTime(field = {}) {
if (field.pickerPrecision === 'minute' || field.type === 'date') {
if (field.type === 'date') {
return false
}
if (field.pickerPrecision === 'minute') {
return true
}
const rules = field.rules || {}
......
/**
* 洽谈明细表汇总 — jsonContent 转只读表格模型
* 数据规则对齐 gl_tape negotiationList.getReportDetail;UI 由 Figma 814-7748 组件消费
* 洽谈明细表汇总 — jsonContent 转只读区块模型(按行 recordRows)
* 数据规则对齐 gl_tape negotiationList.getReportDetail;UI 对齐 form-group-repeater 只读
*/
import { getSectionRowFieldsList } from './app-subform-json.js'
......@@ -35,9 +35,18 @@ function parseJsonContentList(jsonContent) {
}
}
function mapRowToFields(childRow) {
return (childRow || [])
.filter(field => field?.key)
.map(field => ({
label: field.label || field.key || '',
value: formatCellValue(field.value)
}))
}
/**
* @param {string|Array} jsonContent detail.get 返回的 jsonContent
* @returns {Array<{ label: string, columns: Array<{title: string}>, rows: Array<{rowHeader: string, data: string[]}> }>}
* @returns {Array<{ label: string, recordRows: Array<{ fields: Array<{ label: string, value: string }> }> }>}
*/
export function buildNegotiationSummaryTables(jsonContent) {
const list = parseJsonContentList(jsonContent)
......@@ -48,28 +57,12 @@ export function buildNegotiationSummaryTables(jsonContent) {
if (!children.length) {
return null
}
const columns = children.map((_, index) => ({
title: `数据${index + 1}`
}))
const values = {}
children.forEach(childRow => {
childRow.forEach(field => {
if (!field?.key) return
if (!values[field.key]) {
values[field.key] = []
}
values[field.key].push(formatCellValue(field.value))
})
})
const templateRow = children[0] || []
const rows = templateRow.map(field => ({
rowHeader: field.label || field.key || '',
data: values[field.key] || []
const recordRows = children.map(childRow => ({
fields: mapRowToFields(childRow)
}))
return {
label: item.label || '',
columns,
rows
recordRows
}
})
.filter(Boolean)
......
......@@ -34,14 +34,17 @@ function mergeFieldRules(field = {}, parentRules = {}) {
}
}
/** 配置中心 date → datetime(小程序仅渲染 datetime 组件) */
function normalizeFieldType(field = {}) {
if (field.type !== 'date') {
return field
/** 配置中心 date:保留 type=date,仅日期 picker(form-field-datetime mode=date) */
function applyConfigDateOnlyField(field = {}, childrenRules = {}) {
let next = mergeFieldRules(field, childrenRules[field.key] || {})
const rules = { ...(next.rules || {}), format: 'date' }
if (rules.maxDate === 'now') {
rules.maxDate = 'today'
}
return {
...field,
type: 'datetime'
...next,
type: 'date',
rules
}
}
......@@ -60,10 +63,14 @@ function applyConfigDateMinutePicker(field = {}) {
function normalizeSchemaField(field = {}, childrenRules = {}, optionsMap = {}) {
const fromConfigDate = field.type === 'date'
let next = normalizeFieldType(field)
next = mergeFieldRules(next, childrenRules[next.key] || {})
if (fromConfigDate || next.pickerPrecision === 'minute') {
next = applyConfigDateMinutePicker(next)
let next
if (fromConfigDate) {
next = applyConfigDateOnlyField(field, childrenRules)
} else {
next = mergeFieldRules(field, childrenRules[field.key] || {})
if (next.pickerPrecision === 'minute') {
next = applyConfigDateMinutePicker(next)
}
}
next = applyOptionsFromKey(next, optionsMap)
return next
......
......@@ -135,16 +135,18 @@ function validateField(field, value, options = {}) {
}
}
if (fieldType === 'datetime' && resolveNotAfterNow(field)) {
const dateOnly = field.type === 'date' || rules.format === 'date'
if (fieldType === 'datetime' && !dateOnly && resolveNotAfterNow(field)) {
const picked = parseDateTimeLocal(value)
const now = new Date()
if (picked && picked.getTime() > now.getTime()) {
errors.push(`${field.label}不能晚于当前时间`)
}
} else if (
fieldType === 'datetime' &&
(field.type === 'date' || fieldType === 'datetime') &&
rules.maxDate === 'today' &&
!resolveNotAfterNow(field)
(dateOnly || !resolveNotAfterNow(field))
) {
const picked = parseFieldDate(value)
const today = new Date()
......
......@@ -493,7 +493,9 @@ Page({
staffUuid: ctx.staffUuid || '',
reportDate: this.data.reportDate || '',
reportType: 'negotiation',
sceneType: userInfo.sceneType ?? ctx.sceneType ?? null
sceneType: userInfo.sceneType ?? ctx.sceneType ?? null,
sceneList: this.pageContext?.sceneList || [],
brandIds: this.pageContext?.brandIds || []
}
},
......
......@@ -30,6 +30,19 @@ page {
opacity: 1;
}
.summary-panel {
flex: 1;
min-height: 0;
display: flex;
flex-direction: column;
box-sizing: border-box;
}
.summary-panel__inner {
flex: 1;
min-height: 0;
}
.btns {
position: relative;
z-index: 10;
......
......@@ -6,7 +6,7 @@
</view>
</navigation-bar>
<view style="margin-top:{{ navBarHeight }}px">
<view wx:if="{{ !showNegotiationSummary }}" style="margin-top:{{ navBarHeight }}px">
<weekCalendar
timeBean="{{ timeBean }}"
bind:lastWeek="lastWeek"
......@@ -26,13 +26,18 @@
<view class="error-panel__btn" bindtap="loadFormData">重新加载</view>
</view>
<negotiation-summary
<view
wx:elif="{{ showNegotiationSummary }}"
class="main"
reportDate="{{ reportDate }}"
merchantId="{{ requestContext.merchantId }}"
bind:close="closeNegotiationSummary"
></negotiation-summary>
class="summary-panel"
style="margin-top:{{ navBarHeight }}px"
>
<negotiation-summary
class="summary-panel__inner"
reportDate="{{ reportDate }}"
merchantId="{{ requestContext.merchantId }}"
bind:close="closeNegotiationSummary"
></negotiation-summary>
</view>
<scroll-view
wx:else
......
/**
* 洽谈 orderList 请求参数 — 行内成交日期 saleDate(对齐 gl_tape DailyPopup.reqParams)
* 洽谈 orderList 请求参数 — saleDate / baseGoodsCodeList / carBrandTypeFlag
*/
/** 鸿蒙智行五界经营品牌 id */
const HONGMENG_BRAND_IDS = [3454, 3503, 3458, 3574, 3502]
const LANTU_BRAND_ID = 3067
function normalizeSaleDate(value) {
if (value == null || value === '') {
return ''
......@@ -91,12 +95,64 @@ function buildRowValuesFromFields(rowFields = []) {
return map
}
function normalizeSceneCodeList(codes) {
if (codes == null || codes === '') {
return []
}
const list = Array.isArray(codes) ? codes : [codes]
return list.map(code => Number(code)).filter(code => !Number.isNaN(code))
}
function normalizeBrandIdList(brandIds) {
if (brandIds == null || brandIds === '') {
return []
}
const list = Array.isArray(brandIds) ? brandIds : [brandIds]
return list.map(id => Number(id)).filter(id => !Number.isNaN(id))
}
/**
* 门店场景 baseSceneCode 列表(对应当前 sceneList)
* @param {Array} [sceneList=[]]
* @returns {number[]}
*/
function resolveBaseGoodsCodeList(sceneList = []) {
return normalizeSceneCodeList(
(sceneList || [])
.map(item => item?.baseSceneCode)
.filter(code => code != null && code !== '')
)
}
/**
* 品牌类型:1 鸿蒙智行,2 岚图,3 其他
* @param {Array} [groupBrandIds=[]] 当前 subform 区块 brandId
* @returns {'1'|'2'|'3'}
*/
function resolveCarBrandTypeFlag(groupBrandIds = []) {
const ids = normalizeBrandIdList(groupBrandIds)
if (!ids.length) {
return '3'
}
if (ids.some(id => HONGMENG_BRAND_IDS.includes(id))) {
return '1'
}
if (ids.includes(LANTU_BRAND_ID)) {
return '2'
}
return '3'
}
module.exports = {
resolveDealDateFieldKey,
resolveOrderListSaleDate,
resolveBaseGoodsCodeList,
resolveCarBrandTypeFlag,
isOrderListField,
requiresDealDateBeforeOrderList,
isDealDateMissingForOrderList,
buildRowValuesFromFields,
normalizeSaleDate
normalizeSaleDate,
HONGMENG_BRAND_IDS,
LANTU_BRAND_ID
}
......@@ -30,16 +30,18 @@ describe('datetime-picker-mode', async () => {
assert.equal(state.timeEnd, '23:59')
})
it('IT-DATE-MINUTE-002: uncached type date falls back to minute picker UI', () => {
assert.equal(resolveWithTime({ type: 'date' }), true)
it('IT-DATE-MINUTE-002: type date uses day-only picker without time', () => {
assert.equal(resolveWithTime({ type: 'date' }), false)
assert.equal(resolveNotAfterNow({ type: 'date' }), false)
const state = buildDatetimePickerState({ type: 'date', pickerPrecision: 'minute' }, '')
assert.equal(state.useMinutePicker, true)
const state = buildDatetimePickerState(
{ type: 'date', rules: { format: 'date', maxDate: 'today' } },
''
)
assert.equal(state.useMinutePicker, false)
assert.equal(state.pickerMode, 'date')
assert.equal(state.displayLabel, '')
assert.equal(state.dateValue, '')
assert.equal(state.timeValue, '')
assert.equal(state.dateEnd, '')
assert.equal(state.timeEnd, '')
assert.equal(state.pickerValue, '')
assert.equal(state.endDate, endOfToday())
})
it('IT-DATE-MINUTE-003: datetime with rules.format date stays day-only', () => {
......
......@@ -237,8 +237,8 @@ describe('fieldOptionsAdapters', () => {
NEGOTIATION_DAILY_API_SWITCH.fieldOptions = 'real'
let captured = null
__setOrderListApi({
post: async (method, params) => {
captured = { method, params }
getGoodsOrderOutputValueList: async params => {
captured = params
return {
code: 0,
message: 'ok',
......@@ -252,17 +252,16 @@ describe('fieldOptionsAdapters', () => {
reportType: 'negotiation',
merchantId: 'shop-neg',
staffUuid: 'staff-uuid-1',
reportDate: '2026-06-02'
reportDate: '2026-06-02',
sceneList: [{ baseSceneCode: 110201 }, { baseSceneCode: 110202 }],
groupBrandIds: [3067]
})
assert.equal(
captured.method,
'dj.api.smartcarlife.goodsOrder.product.outputValue.list'
)
assert.deepEqual(captured.params, {
assert.deepEqual(captured, {
merchantId: 'shop-neg',
sellerUserId: 'staff-uuid-1',
carBrandTypeFlag: '',
baseGoodsCodeList: [110201, 110202],
carBrandTypeFlag: '2',
saleDate: '2026-06-02'
})
assert.equal(res.code, 0)
......@@ -277,8 +276,8 @@ describe('fieldOptionsAdapters', () => {
NEGOTIATION_DAILY_API_SWITCH.fieldOptions = 'real'
let captured = null
__setOrderListApi({
post: async (method, params) => {
captured = { method, params }
getGoodsOrderOutputValueList: async params => {
captured = params
return { code: 0, message: 'ok', data: [] }
}
})
......@@ -289,9 +288,13 @@ describe('fieldOptionsAdapters', () => {
merchantId: 'shop-neg',
staffUuid: 'staff-uuid-1',
reportDate: '2026-06-02',
saleDate: '2026-06-15'
saleDate: '2026-06-15',
sceneList: [{ baseSceneCode: 110101 }],
groupBrandIds: [3454]
})
assert.equal(captured.params.saleDate, '2026-06-15')
assert.equal(captured.saleDate, '2026-06-15')
assert.deepEqual(captured.baseGoodsCodeList, [110101])
assert.equal(captured.carBrandTypeFlag, '1')
})
})
......@@ -1517,7 +1517,7 @@ describe('negotiation schema (F3)', async () => {
assert.ok(visible.some(item => item.key === 'F3-4'))
})
it('IT-NEG-010: normalizeSchemaRoot maps date → datetime and childrenRules', () => {
it('IT-NEG-010: normalizeSchemaRoot keeps date as day-only picker and childrenRules', () => {
const raw = {
list: [
{
......@@ -1542,17 +1542,17 @@ describe('negotiation schema (F3)', async () => {
}
const normalized = normalizeSchemaRoot(raw, {})
const child = normalized.list[0].children[0].find(item => item.key === 'F3-4-1')
assert.equal(child.type, 'datetime')
assert.equal(child.rules.format, 'datetime')
assert.equal(child.pickerPrecision, 'minute')
assert.equal(child.pickerMax, 'now')
assert.equal(child.rules.maxDate, 'now')
assert.equal(child.type, 'date')
assert.equal(child.rules.format, 'date')
assert.equal(child.pickerPrecision, undefined)
assert.equal(child.pickerMax, undefined)
assert.equal(child.rules.maxDate, 'today')
const originChild = normalized.list[0].origin_children.find(item => item.key === 'F3-4-1')
assert.equal(originChild.type, 'datetime')
assert.equal(originChild.pickerPrecision, 'minute')
assert.equal(originChild.pickerMax, 'now')
assert.equal(originChild.rules.format, 'datetime')
assert.equal(originChild.rules.maxDate, 'now')
assert.equal(originChild.type, 'date')
assert.equal(originChild.pickerPrecision, undefined)
assert.equal(originChild.pickerMax, undefined)
assert.equal(originChild.rules.format, 'date')
assert.equal(originChild.rules.maxDate, 'today')
})
it('IT-NEG-009: F3-4 row validates with dual-key select and carBrand', async () => {
......
......@@ -4,7 +4,7 @@ import { buildNegotiationSummaryTables } from '../packageDynamicForm/form-engine
import { serializeFormListForAppJsonStorage } from '../packageDynamicForm/form-engine/app-subform-json.js'
describe('negotiation summary transform', () => {
it('IT-SUMMARY-001: App jsonContent children dual-key → columns and rows', () => {
it('IT-SUMMARY-001: App jsonContent children dual-key → recordRows', () => {
const jsonContent = JSON.stringify([
{
key: 'F3-1',
......@@ -48,13 +48,17 @@ describe('negotiation summary transform', () => {
const sections = buildNegotiationSummaryTables(jsonContent)
assert.equal(sections.length, 1)
assert.equal(sections[0].label, '洽谈明细')
assert.deepEqual(sections[0].columns, [{ title: '数据1' }, { title: '数据2' }])
assert.equal(sections[0].recordRows.length, 2)
const staffRow = sections[0].rows.find(row => row.rowHeader === '推荐人')
assert.deepEqual(staffRow.data, ['张三', '李四'])
const row1Staff = sections[0].recordRows[0].fields.find(f => f.label === '推荐人')
assert.equal(row1Staff.value, '张三')
const row2Staff = sections[0].recordRows[1].fields.find(f => f.label === '推荐人')
assert.equal(row2Staff.value, '李四')
const carRow = sections[0].rows.find(row => row.rowHeader === '车型配置')
assert.deepEqual(carRow.data, ['问界-鸿蒙-M7-增程版', '理想-L9-Max'])
const row1Car = sections[0].recordRows[0].fields.find(f => f.label === '车型配置')
assert.equal(row1Car.value, '问界-鸿蒙-M7-增程版')
const row2Car = sections[0].recordRows[1].fields.find(f => f.label === '车型配置')
assert.equal(row2Car.value, '理想-L9-Max')
})
it('IT-SUMMARY-002: empty or invalid jsonContent → []', () => {
......
......@@ -3,7 +3,9 @@ import assert from 'node:assert/strict'
import {
resolveOrderListSaleDate,
isDealDateMissingForOrderList,
resolveDealDateFieldKey
resolveDealDateFieldKey,
resolveBaseGoodsCodeList,
resolveCarBrandTypeFlag
} from '../packageDynamicForm/utils/order-list-params.js'
import {
buildCompleteFunAssignments,
......@@ -63,4 +65,29 @@ describe('order list params', () => {
assert.ok(getOrderLinkageClearKeys(field).includes('F3-1-13'))
assert.ok(getOrderLinkageClearKeys(field).includes('F3-1-14'))
})
it('IT-NEG-009: resolveBaseGoodsCodeList from sceneList', () => {
assert.deepEqual(
resolveBaseGoodsCodeList([
{ baseSceneCode: 110201 },
{ baseSceneCode: '110202' },
{ baseSceneCode: null }
]),
[110201, 110202]
)
})
it('IT-NEG-010: resolveCarBrandTypeFlag by subform brandId', () => {
assert.equal(resolveCarBrandTypeFlag([3067]), '2')
assert.equal(resolveCarBrandTypeFlag([3454]), '1')
assert.equal(resolveCarBrandTypeFlag([3454, 3503, 3458, 3574, 3502]), '1')
assert.equal(resolveCarBrandTypeFlag([3067, 3454]), '1')
assert.equal(resolveCarBrandTypeFlag([]), '3')
assert.equal(resolveCarBrandTypeFlag([9999]), '3')
})
it('IT-NEG-011: empty sceneList → empty baseGoodsCodeList', () => {
assert.deepEqual(resolveBaseGoodsCodeList([]), [])
assert.deepEqual(resolveBaseGoodsCodeList(null), [])
})
})
......@@ -24,14 +24,14 @@ const { normalizeConfigToSchemaRoot } = require('../packageDynamicForm/config/co
const schemaTemplate = normalizeConfigToSchemaRoot(schemaIndexed)
describe('apiSwitch', () => {
it('IT-API-SWITCH-001: staff daily defaults to real APIs except brand init mock', () => {
it('IT-API-SWITCH-001: staff daily defaults to real APIs including brand init', () => {
assert.equal(STAFF_DAILY_API_SWITCH.detail, 'real')
assert.equal(STAFF_DAILY_API_SWITCH.schema, 'real')
assert.equal(STAFF_DAILY_API_SWITCH.brand, 'mock')
assert.equal(STAFF_DAILY_API_SWITCH.brand, 'real')
assert.equal(STAFF_DAILY_API_SWITCH.fieldOptions, 'real')
assert.equal(isStaffMockMode('detail'), false)
assert.equal(isStaffMockMode('schema'), false)
assert.equal(isStaffMockMode('brand'), true)
assert.equal(isStaffMockMode('brand'), false)
assert.equal(isStaffMockMode('fieldOptions'), false)
assert.equal(isStaffMockMode('save'), false)
})
......@@ -41,13 +41,13 @@ describe('apiSwitch', () => {
assert.equal(isStaffSaveEchoEnabled(), false)
})
it('IT-STORE-API-SWITCH-001: store daily detail real; brand init mock', () => {
it('IT-STORE-API-SWITCH-001: store daily detail and brand init real', () => {
assert.equal(STORE_DAILY_API_SWITCH.detail, 'real')
assert.equal(STORE_DAILY_API_SWITCH.schema, 'real')
assert.equal(STORE_DAILY_API_SWITCH.brand, 'mock')
assert.equal(STORE_DAILY_API_SWITCH.brand, 'real')
assert.equal(STORE_DAILY_API_SWITCH.saveEcho, 'off')
assert.equal(isStoreMockMode('detail'), false)
assert.equal(isStoreMockMode('brand'), true)
assert.equal(isStoreMockMode('brand'), false)
assert.equal(isStoreSaveEchoEnabled(), false)
})
})
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!