Commit ff20e7c2 by 张立顺

Merge branch 'saas+v5.8.2' of http://192.168.3.233:8090/saas_plus/dj-car-boutiqu…

…e-work-wechat into SAAS+V5.8.2.1
2 parents 4d38008c a5f65720
Showing 743 changed files with 3297 additions and 1176 deletions
name: tabIndex tests
on:
push:
paths:
- 'tabIndex/**'
- 'utils/**'
- 'package.json'
- '.github/workflows/tabindex-tests.yml'
pull_request:
paths:
- 'tabIndex/**'
- 'utils/**'
- 'package.json'
- '.github/workflows/tabindex-tests.yml'
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- run: npm run test:tabIndex
No preview for this file type
...@@ -84,6 +84,13 @@ module.exports = { ...@@ -84,6 +84,13 @@ module.exports = {
); );
// return api.post("dj.api.smartcarlife.employee.getByMerchantId", data); // 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店列表 */ /** 根据园区店商户号获取绑定4S店列表 */
getServiceMerchantList(data) { getServiceMerchantList(data) {
return api.post("dj.api.smartcarlife.serviceMerchant.list", data); return api.post("dj.api.smartcarlife.serviceMerchant.list", data);
...@@ -330,6 +337,11 @@ module.exports = { ...@@ -330,6 +337,11 @@ module.exports = {
return api.post("dj.api.smartcarlife.staff.daily.report.popup.need", data); return api.post("dj.api.smartcarlife.staff.daily.report.popup.need", data);
}, },
/** 是否需要新版本日报填报(true 展示三入口) */
dailyReportNewVersionIsNeed(data) {
return api.post("dj.api.smartcarlife.dailyReport.new.version.isNeed", data);
},
/** 校验手机号是否配置打卡和是否打卡 */ /** 校验手机号是否配置打卡和是否打卡 */
clockInConfigPhone(data) { clockInConfigPhone(data) {
// return api.post('dj.api.smartcarlife.staff.daily.report.merchant.valid', data) // return api.post('dj.api.smartcarlife.staff.daily.report.merchant.valid', data)
...@@ -561,4 +573,12 @@ module.exports = { ...@@ -561,4 +573,12 @@ module.exports = {
{ bucketName: bucketName, systemSource: systemSource } { bucketName: bucketName, systemSource: systemSource }
); );
}, },
// 获取园区店施工单出库支持的方式
getQueryScanConfigByYq(data) {
return api.post("dj.api.scenemerchantref.queryScanConfigByYq", data);
},
// 扫码出库查询结果
getScanRecognizeReduce(data) {
return api.post("dj.api.smartcarlife.scan.recognize.reduce", data)
}
}; };
...@@ -27,7 +27,10 @@ import { checkYqdSuper, checkScene } from "~/store/index"; ...@@ -27,7 +27,10 @@ import { checkYqdSuper, checkScene } from "~/store/index";
import eventbus from "./utils/eventbus"; import eventbus from "./utils/eventbus";
import api from "./api/api"; import api from "./api/api";
import { Version } from "glsx-common-sdk"; import { Version } from "glsx-common-sdk";
import { areaList } from "@vant/area-data"; //预加载省市区 // 预加载:多分包共用,满足主包依赖链(上传质量检测)
require('./utils/vinVaildate.js')
require('./utils/timeFormat/time-utils.js')
require('@vant/weapp/dialog/dialog')
import globalDataFunction from './mixins/globalDataFunction' import globalDataFunction from './mixins/globalDataFunction'
import { hasPermission, createPermissionHelpers, LOGIN_ROLE } from './utils/rolePermission' import { hasPermission, createPermissionHelpers, LOGIN_ROLE } from './utils/rolePermission'
...@@ -82,7 +85,6 @@ App({ ...@@ -82,7 +85,6 @@ App({
wx.$util = util; wx.$util = util;
wx.$api = wxApi; wx.$api = wxApi;
wx.$eventbus = eventbus; wx.$eventbus = eventbus;
wx.$areaList = areaList;
wx.$track = $Track wx.$track = $Track
wx.$hasPermission = hasPermission wx.$hasPermission = hasPermission
wx.$permission = createPermissionHelpers() wx.$permission = createPermissionHelpers()
...@@ -105,7 +107,6 @@ App({ ...@@ -105,7 +107,6 @@ App({
else { else {
const res = await wx.$versionConfig.get({ const res = await wx.$versionConfig.get({
moduleUrl: "dj-car-boutique-work-wechat", moduleUrl: "dj-car-boutique-work-wechat",
// moduleUrl: 'business-assistant',
env: "update", env: "update",
}); });
this.globalData.versionData = res; this.globalData.versionData = res;
...@@ -157,26 +158,6 @@ App({ ...@@ -157,26 +158,6 @@ App({
if (noSignInUuid) { if (noSignInUuid) {
// 调用防抖函数 // 调用防抖函数
debouncedReNoSignIn(noSignInUuid, that); debouncedReNoSignIn(noSignInUuid, that);
// util.debounce(() => {
// console.log(1112);
// api
// .reNoSignIn({
// noSignInUuid: noSignInUuid
// })
// .then(res => {
// let { code, data } = res
// if (code == '0' && data) {
// // util.setUserinfo( console.log('noSignInUuid_sessionId',data?.sessionId);
// // wx.reLaunch({url: '/pages/accountItems/accountItems'})
// util.setSessionId(data?.sessionId)
// wx.reLaunch({ url: '/pages/loading/loading' })
// } else {
// util.removeStorage()
// removeSystemStorage()
// that.login(false)
// }
// })
// }, 500, true)
} else { } else {
let thisPage = wx.$router.getPageInstance() let thisPage = wx.$router.getPageInstance()
// 启动页loading中的埋点接口 在触发登录超时后 ios端wx.showModal会被页面跳转截断,导致无弹窗,将loading页面这个埋点接口的登录超时不做弹窗处理 // 启动页loading中的埋点接口 在触发登录超时后 ios端wx.showModal会被页面跳转截断,导致无弹窗,将loading页面这个埋点接口的登录超时不做弹窗处理
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
"pages/log/log", "pages/log/log",
"pages/changeScene/changeScene", "pages/changeScene/changeScene",
"pages/materails/index", "pages/materails/index",
"pages/pointsReview/pointsReview",
"pages/h5AuthPhone/h5AuthPhone", "pages/h5AuthPhone/h5AuthPhone",
"pages/tabRepairOrder/pages/index/index" "pages/tabRepairOrder/pages/index/index"
], ],
...@@ -101,6 +100,8 @@ ...@@ -101,6 +100,8 @@
"name": "tabRepairOrder", "name": "tabRepairOrder",
"pages": [ "pages": [
"pages/confirmWorkOrder/confirmWorkOrder", "pages/confirmWorkOrder/confirmWorkOrder",
"pages/constructionComplete/constructionComplete",
"pages/goodsOutbound/goodsOutbound",
"pages/repairOrderDetail/repairOrderDetail" "pages/repairOrderDetail/repairOrderDetail"
] ]
}, },
...@@ -272,6 +273,17 @@ ...@@ -272,6 +273,17 @@
"pages/myExam/myExam", "pages/myExam/myExam",
"pages/staffRank/staffRank" "pages/staffRank/staffRank"
] ]
},
{
"root": "packageDynamicForm",
"name": "packageDynamicForm",
"pages": [
"pages/negotiationDetail/negotiationDetail",
"pages/storeDailyReport/storeDailyReport",
"pages/staffDailyReport/staffDailyReport",
"pages/carBrandPick/carBrandPick",
"pages/carBrandSeries/carBrandSeries"
]
} }
], ],
"usingComponents": { "usingComponents": {
...@@ -330,4 +342,4 @@ ...@@ -330,4 +342,4 @@
], ],
"lazyCodeLoading": "requiredComponents", "lazyCodeLoading": "requiredComponents",
"resizable": true "resizable": true
}
\ No newline at end of file \ No newline at end of file
}
...@@ -14,13 +14,13 @@ page { ...@@ -14,13 +14,13 @@ page {
/* 兼容 IOS>11.2 */ /* 兼容 IOS>11.2 */
--envSafeAreaInsetBottom: env(safe-area-inset-bottom); --envSafeAreaInsetBottom: env(safe-area-inset-bottom);
@for $i from 1 through 1300 { @for $i from 1 through 1070 {
--fontSize#{$i}: calc(#{$i}vmin / 7.5); --fontSize#{$i}: calc(#{$i}vmin / 7.5);
--fontSizeContent#{$i}: calc(#{$i}vmin / 7.176); --fontSizeContent#{$i}: calc(#{$i}vmin / 7.176);
} }
@media screen and (min-device-width: 768px) and (-webkit-min-device-pixel-ratio: 1) { @media screen and (min-device-width: 768px) and (-webkit-min-device-pixel-ratio: 1) {
@for $i from 1 through 1300 { @for $i from 1 through 1070 {
--fontSize#{$i}: calc(#{$i}vmin / 8.5); --fontSize#{$i}: calc(#{$i}vmin / 8.5);
--fontSizeContent#{$i}: calc(#{$i}vmin / 6.719); --fontSizeContent#{$i}: calc(#{$i}vmin / 6.719);
} }
......
...@@ -146,6 +146,9 @@ ...@@ -146,6 +146,9 @@
border: var(--fontSize2) solid #0075F9; border: var(--fontSize2) solid #0075F9;
box-sizing: border-box; box-sizing: border-box;
height: var(--fontSize80); height: var(--fontSize80);
display: flex;
align-items: center;
justify-content: center;
} }
...@@ -176,4 +179,4 @@ ...@@ -176,4 +179,4 @@
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
}
\ No newline at end of file \ No newline at end of file
}
// components/GLCustForm/GLCustForm.js // components/GLCustForm/GLCustForm.js
const { getAreaList } = require('~/utils/areaList')
Component({ Component({
externalClasses: ['custom-class'], externalClasses: ['custom-class'],
options: { options: {
...@@ -255,7 +257,7 @@ Component({ ...@@ -255,7 +257,7 @@ Component({
showArea, showArea,
areaList areaList
} = this.data } = this.data
if (!areaList.length) areaList = wx.$areaList // 省市区数据 if (!areaList.length) areaList = getAreaList() // 省市区数据
this.setData({ this.setData({
showArea: !showArea, showArea: !showArea,
areaList areaList
......
/* components/Goods/Goods.wxss */ /* components/Goods/Goods.wxss */
@import '../Coupon/Coupon.wxss'; /* 商品弹层布局(与 tabWorkOrder Coupon 组件独立维护,勿 @import) */
.coupon-box {
width: calc(100% + var(--fontSize64));
height: 100%;
margin-left: calc(-1 * var(--fontSize32));
}
.coupon {
height: calc(100% - var(--fontSize104));
}
.box {
border-bottom: var(--fontSize2) solid #EBEDF0;
padding-left: 0;
}
.item { .item {
border-top: var(--fontSize2) solid #EBEDF0;
height: var(--fontSize84);
display: flex;
align-items: center;
font-size: var(--fontSize28);
color: #888888;
position: relative;
justify-content: space-between; justify-content: space-between;
padding-right: var(--fontSize32); padding-right: var(--fontSize32);
width: calc(100% - var(--fontSize130)); width: calc(100% - var(--fontSize130));
...@@ -13,21 +35,18 @@ ...@@ -13,21 +35,18 @@
} }
.item .value { .item .value {
/* width: calc(100% - var(--fontSize180)); */
width: 100%; width: 100%;
display: flex; display: flex;
/* flex-direction: ; */
justify-content: space-between; justify-content: space-between;
} }
.item .labelWidth { .item .labelWidth {
width: calc(100% - var(--fontSize180)); width: calc(100% - var(--fontSize180));
/* display: flex; */
} }
.item .value .name { .item .value .name {
max-width: 85%; max-width: 85%;
width:calc(100vw - var(--fontSize100)) width: calc(100vw - var(--fontSize100));
} }
.item .value .name .warning_text { .item .value .name .warning_text {
...@@ -84,20 +103,15 @@ ...@@ -84,20 +103,15 @@
width: var(--fontSize32); width: var(--fontSize32);
height: var(--fontSize32); height: var(--fontSize32);
margin: 0 var(--fontSize32); margin: 0 var(--fontSize32);
// position: absolute;
// top: 50%;
// left: calc(-1 * var(--fontSize52));
// transform: translateY(-50%);
.arc {
width: 100%;
height: 100%;
border: var(--fontSize2) solid #979797;
border-radius: 100%;
box-sizing: border-box;
}
} }
.choose .arc {
width: 100%;
height: 100%;
border: var(--fontSize2) solid #979797;
border-radius: 100%;
box-sizing: border-box;
}
.nothing { .nothing {
padding: var(--fontSize100); padding: var(--fontSize100);
...@@ -105,24 +119,22 @@ ...@@ -105,24 +119,22 @@
color: #999; color: #999;
} }
.box {
padding-left: 0;
}
.itemBox { .itemBox {
display: flex; display: flex;
align-items: center; align-items: center;
}
.item { .itemBox .item {
flex: 1; flex: 1;
}
} }
.specification { .specification {
background: #F7F7F7; background: #F7F7F7;
border-radius: 16rpx 16rpx 0 0; border-radius: 16rpx 16rpx 0 0;
width:calc(100% - var(--fontSize80)); width: calc(100% - var(--fontSize80));
margin:var(--fontSize9) 0 var(--fontSize32) var(--fontSize52); margin: var(--fontSize9) 0 var(--fontSize32) var(--fontSize52);
} }
.picker { .picker {
display: flex; display: flex;
flex-direction: row-reverse; flex-direction: row-reverse;
...@@ -130,14 +142,16 @@ border-radius: 16rpx 16rpx 0 0; ...@@ -130,14 +142,16 @@ border-radius: 16rpx 16rpx 0 0;
line-height: var(--fontSize80); line-height: var(--fontSize80);
text-align: right; text-align: right;
} }
.placeholder { .placeholder {
font-weight: 400; font-weight: 400;
font-size: var(--fontSize28); font-size: var(--fontSize28);
color: #B6B6B8; color: #B6B6B8;
} }
.arrow { .arrow {
width: var(--fontSize28); width: var(--fontSize28);
height: var(--fontSize26); height: var(--fontSize26);
margin-top: var(--fontSize26); margin-top: var(--fontSize26);
flex-shrink: 0; flex-shrink: 0;
}
\ No newline at end of file \ No newline at end of file
}
<!-- components/InventoryInfo/InventoryInfo.wxml --> <!-- components/InventoryInfo/InventoryInfo.wxml -->
<glsx-privacy appletName="生意助手员工版" bind:agreeClick="agreeClick" bind:disagreeClick="disagreeClick"></glsx-privacy>
<view class="inventory-info-container" wx:if="{{isShowing}}"> <view class="inventory-info-container" wx:if="{{isShowing}}">
<view class="overlay" bindtap="onClose"></view> <view class="overlay" bindtap="onClose"></view>
<view class="popup"> <view class="popup">
......
/* components/SideSelectPopup/SideSelectPopup.wxss */
.popclass{
background-image: linear-gradient(180deg, #1D243D 0%, #30365C 100%);
border-radius: 0 var(--fontSize40) var(--fontSize40) 0;
z-index: 1999999999999;
box-sizing: border-box;
padding: var(--fontSize88) var(--fontSize16);
}
.wrapper .title_box{
height: var(--fontSize60);
line-height: var(--fontSize60);
margin-bottom: var(--fontSize20);
display: flex;
align-items: center;
}
.wrapper .title_box .title{
padding-left: var(--fontSize16);
margin-right: var(--fontSize32);
font-weight: 600;
font-size: var(--fontSize28);
color: #FFFFFF80;
}
.search-box {
display: flex;
position: sticky;
top: 0;
left: 0;
z-index: 1009;
box-sizing: border-box;
margin-bottom: var(--fontSize16);
}
.search-box .select_box{
width: var(--fontSize180);
display: flex;
flex-flow: column;
align-items: center;
justify-content: center;
font-size: var(--fontSize24);
color: #999999;
}
.search-box .select_box .select{
display: flex;
align-items: center;
width: var(--fontSize132);
}
.search-box .select_box .select .select_text{
color: #FFFFFF;
font-size: var(--fontSize28);
}
.search-box .select_box .select .select_img{
transform: rotate(90deg);
width: var(--fontSize12);
height: var(--fontSize20);
flex-shrink: 0;
margin-left: var(--fontSize6);
}
.search-box .select_box .select .select_img_rotate{
transform: rotate(-90deg);
}
.search-box .select_box .option_box{
position: absolute;
z-index: 200;
top: var(--fontSize100);
left: var(--fontSize32);
width: var(--fontSize194);
box-sizing: border-box;
background: #FFFFFF;
box-shadow: 0 var(--fontSize6) var(--fontSize12) 0 #0000000d;
border-radius: var(--fontSize16);
height: var(--fontSize176);
}
.search-box .select_box .option_box::after{
height: 0;
width: 0;
content: '';
position: absolute;
border: var(--fontSize14) solid transparent;
border-right: var(--fontSize14) solid #FFFFFF;
top: calc(-1 * var(--fontSize24));
left: var(--fontSize88);
z-index:-1;
transform: rotate(90deg);
}
.search-box .select_box .option_box::before{
height: 0;
width: 0;
content: '';
position: absolute;
border: var(--fontSize14) solid transparent;
border-right: var(--fontSize14) solid #FFFFFF;
top: calc(-1 * var(--fontSize24));
left: var(--fontSize88);
z-index:-1;
transform: rotate(90deg);
}
.search-box .select_box .option_box .option{
display: block;
height: var(--fontSize88);
line-height: var(--fontSize88);
text-align: center;
color: #333333;
overflow: hidden;
}
.search-box .select_box .option_box .option:first-child{
border-radius: var(--fontSize16) var(--fontSize16) 0 0;
}
.search-box .select_box .option_box .option:last-child{
border-radius: 0 0 var(--fontSize16) var(--fontSize16);
}
.search-box .select_box .option_box .option.active{
background: #347bff1a;
color: #347BFF;
}
.search-box .search-input {
width: 100%;
height: var(--fontSize72);
display: flex;
align-items: center;
background: rgba(255, 255, 255, .15);
border-radius: var(--fontSize38);
}
.search-box .search-input .search-icon {
width: var(--fontSize28);
height: var(--fontSize28);
margin: 0 var(--fontSize8) 0 var(--fontSize24);
flex-shrink: 0;
}
.search-box .search-input .search-clear {
flex-shrink: 0;
padding: var(--fontSize10);
width: var(--fontSize36);
height: var(--fontSize36);
margin: 0 var(--fontSize10) 0 var(--fontSize10);
}
.search-box .search-input .input {
font-size: var(--fontSize28);
color: #FFFFFF;
width: calc(100% - var(--fontSize100));
height: 100%;
}
.input-placeholder {
color: #BEC1C7;
}
.search-box .search {
width: var(--fontSize144);
height: 100%;
color: #666;
box-sizing: border-box;
padding: 0 var(--fontSize24);
}
.search-box .search .text-center {
font-size: var(--fontSize24);
/* background-color: #f7f7f7; */
border-radius: var(--fontSize12);
width: 100%;
height: var(--fontSize50);
color: #888;
}
.search-box .search .text-center .search-filter {
margin-left: var(--fontSize6);
width: var(--fontSize24);
height: var(--fontSize24);
}
.mask_class{
width: 100vw;
height: 100vh;
background: transparent;
position: fixed;
top: 0;
left: 0;
z-index: 100;
}
/* .wrapper .search_box{
padding-bottom: var(--fontSize16);
display: flex;
align-items: center;
justify-content: center;
font-size: var(--fontSize28);
}
.wrapper .search_box image{
width: var(--fontSize32);
height: var(--fontSize32);
}
.wrapper .search_box .clear_icon{
flex-shrink: 0;
padding: var(--fontSize10);
}
.wrapper .search_box .search-input {
width: var(--fontSize496);
height: var(--fontSize72);
background: rgba(255, 255, 255, .15);
border-radius: 38px;
padding: 0 var(--fontSize16);
box-sizing: border-box;
}
.wrapper .search_box .search-input .input{
display: flex;
align-items: center;
height: 100%;
color: #FFFFFF;
}
.wrapper .search_box .search-input .input .icon{
margin-right: var(--fontSize8);
}
.wrapper .search_box .search-input .input_box{
height: 100%;
display: flex;
align-items: center;
justify-content: space-between;
}
.wrapper .search_box .search-input .placeholder{
color: #BEC1C7;
} */
.wrapper .element{
position: relative;
padding: var(--fontSize32);
display: flex;
align-items: center;
}
.wrapper .element .text_box{
display: flex;
flex-flow: column;
justify-content: center;
width: calc(100% - var(--fontSize116));
}
.wrapper .element .text_box .custom_text{
display: flex;
align-items: center;
justify-content: space-between;
color: #FFFFFF;
margin-bottom: var(--fontSize16);
}
.wrapper .custom_element .text_box .custom_text .name_phone{
max-width: var(--fontSize260);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.wrapper .custom_element .text_box .custom_text .custom_name{
font-size: var(--fontSize28);
}
.wrapper .custom_element .text_box .custom_text .custom_phone{
font-size: var(--fontSize24);
margin-left: var(--fontSize8);
}
.wrapper .custom_element .text_box .status_text{
width: var(--fontSize76);
height: var(--fontSize36);
flex-shrink: 0;
line-height: var(--fontSize36);
border-radius: var(--fontSize4);
text-align: center;
font-size: var(--fontSize20);
font-weight: 600;
}
/* 待跟进 */
.wrapper .custom_element .text_box .status_text_0{
background: #FFF5E6;
color: #FF9D0A;
}
/* 已升级 */
.wrapper .custom_element .text_box .status_text_1{
background: #EAF1FF;
color: #347BFF;
}
/* 战败 */
.wrapper .custom_element .text_box .status_text_2{
background: #FDECE9;
color: #F24724;
}
/* 待支付 */
.wrapper .custom_element .text_box .status_text_3{
background: #FFF5E6;
color: #FF9D0A;
}
.wrapper .element .text_box .label{
font-weight: 500;
font-size: var(--fontSize30);
color: #FFFFFF;
max-width: var(--fontSize334);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.label_no{
font-size: var(--fontSize24);
color: #999EA8;
margin-top: var(--fontSize16);
}
.scene_label{
font-size: var(--fontSize24);
color: #999EA8;
margin-top: var(--fontSize8);
}
.wrapper .custom_element .text_box .label{
font-size: var(--fontSize24);
color: #999EA8;
}
.wrapper .custom_element .text_box .label_no{
margin-top: 0;
}
.wrapper .element image{
width: var(--fontSize96);
height: var(--fontSize96);
margin-right: var(--fontSize30);
flex-shrink: 0;
}
.wrapper .active{
background: #FFFFFF15;
border-radius: var(--fontSize16);
}
.wrapper .element .img{
display: none;
}
.wrapper .active .img{
display: block;
}
.wrapper .active .gap_icon{
display: none;
}
.wrapper .mine{
display: flex;
align-items: center;
justify-content: space-between;
margin: 0 calc(-1 * var(--fontSize16));
padding: var(--fontSize8) var(--fontSize32) var(--fontSize8) var(--fontSize16);
background: #2C3255;
}
.wrapper .mine .img{
width: var(--fontSize96);
height: var(--fontSize96);
}
.wrapper .mine .flex_box{
display: flex;
align-items: center;
}
.wrapper .mine .right_icon{
width: var(--fontSize12);
height: var(--fontSize12);
background-color: transparent; /* 模块背景为透明 */
border-color: #AEB2C2;
border-style: solid;
border-width: var(--fontSize4) var(--fontSize4) 0 0;
transform: rotate(45deg);
}
.list_nothing_img{
width: var(--fontSize226);
height: var(--fontSize156);
}
.big_list_nothing_img{
width: var(--fontSize258);
height: var(--fontSize258);
}
.list_not {
height: calc(100vh - var(--fontSize264) - var(--fontSize88));
width: 100%;
display: flex;
flex-flow: column;
align-items: center;
justify-content: center;
}
.list_not_text{
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: var(--fontSize28);
color: #BEC1C7;
margin-top: var(--fontSize24);
}
@media screen and (min-device-width: 600px) and (-webkit-min-device-pixel-ratio: 1) {
.wrapper .title_box .title{
font-size: var(--fontSize24);
}
.wrapper .element{
padding: var(--fontSize20);
}
.wrapper .element image{
width: var(--fontSize70);
height: var(--fontSize70);
}
.wrapper .element .text_box .label{
font-size: var(--fontSize26);
}
.wrapper .element .text_box .label_no{
font-size: var(--fontSize20);
}
}
\ No newline at end of file \ No newline at end of file
@import "../SideSelectPopup/SideSelectPopup.wxss";
...@@ -19,7 +19,12 @@ Component({ ...@@ -19,7 +19,12 @@ Component({
} }
} }
}, },
scroll: Boolean scroll: Boolean,
/** 为 true 时 ready / page_show 触发的 setTab 不 emit click,避免子页首屏重复拉数 */
suppressInitialClick: {
type: Boolean,
value: false
}
}, },
/** /**
* 组件的初始数据 * 组件的初始数据
...@@ -29,12 +34,10 @@ Component({ ...@@ -29,12 +34,10 @@ Component({
}, },
lifetimes: { lifetimes: {
ready() { ready() {
// console.log('lifetimes',this.data.tabIndex); this.setTab(this.data.tabIndex, { suppressClick: this.data.suppressInitialClick })
// console.log('lifetimes',this.data.activeIndex);
this.setTab(this.data.tabIndex)
let that = this let that = this
wx.$eventbus.on('page_show', n => { wx.$eventbus.on('page_show', n => {
!that.data.width && that.setTab(that.data.tabIndex) !that.data.width && that.setTab(that.data.tabIndex, { suppressClick: true })
}) })
} }
}, },
...@@ -49,7 +52,13 @@ Component({ ...@@ -49,7 +52,13 @@ Component({
} = e.currentTarget.dataset } = e.currentTarget.dataset
this.setTab(index) this.setTab(index)
}, },
setTab(index = 0) { /**
* 切换内部 tab 下标并更新指示条样式。
* @param {number} [index=0]
* @param {{ suppressClick?: boolean }} [options] - suppressClick 为 true 时不 trigger click(首屏/ page_show 防重复拉数)
*/
setTab(index = 0, options = {}) {
const suppressClick = options.suppressClick === true
let { let {
tabIndex, tabIndex,
} = this.data } = this.data
...@@ -75,7 +84,9 @@ Component({ ...@@ -75,7 +84,9 @@ Component({
to: `to-${index}`, to: `to-${index}`,
width width
}) })
this.triggerEvent('click', index) if (!suppressClick) {
this.triggerEvent('click', index)
}
}, 100) }, 100)
}, this) }, this)
}, this) }, this)
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
import api from '~/pages/tabMine/api' import api from '~/pages/tabMine/api'
const app = getApp() const app = getApp()
import constantData from '../../pages/constant/data' import constantData from '../../pages/constant/data'
import { withTabRefreshInFlight } from '../../packageEquity/services/tabRefreshService.js'
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/mine/' const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/mine/'
Component({ Component({
/** /**
...@@ -16,6 +17,13 @@ Component({ ...@@ -16,6 +17,13 @@ Component({
showCollege: { showCollege: {
type: Boolean, type: Boolean,
value: false value: false
},
/** Tab4 可见性:true 时刷新我的页银行卡/版本信息 */
show: {
type: Boolean,
observer(n) {
if (n) this.refreshOnShow()
}
} }
}, },
...@@ -33,30 +41,43 @@ Component({ ...@@ -33,30 +41,43 @@ Component({
lifetimes: { lifetimes: {
ready() { ready() {
let userInfo = wx.$util.getUserInfo() this.applyMineUserInfo()
this.setData({ }
},
/**
* 组件的方法列表
*/
methods: {
/** 从本地 userInfo 同步展示字段(ready 与每次 Tab 显示时调用) */
applyMineUserInfo() {
const userInfo = wx.$util.getUserInfo()
const payload = {
isForbidden: !wx.$hasPermission?.canSelectMultiStore?.(userInfo), isForbidden: !wx.$hasPermission?.canSelectMultiStore?.(userInfo),
isYqdSuper: app.globalData.isYqdSuper, isYqdSuper: app.globalData.isYqdSuper,
selectedSceneName: constantData?.sceneList?.filter(val => val.sceneType == userInfo?.sceneType)[0]?.sceneName, selectedSceneName: constantData?.sceneList?.filter(val => val.sceneType == userInfo?.sceneType)[0]?.sceneName,
selectedSceneDesc: constantData?.sceneList?.filter(val => val.sceneType == userInfo?.sceneType)[0]?.sceneDesc, selectedSceneDesc: constantData?.sceneList?.filter(val => val.sceneType == userInfo?.sceneType)[0]?.sceneDesc,
userInfo userInfo
}) }
if (userInfo.createdDate) { if (userInfo.createdDate) {
let date = userInfo.createdDate + '' let date = userInfo.createdDate + ''
date = date.replace(/-/g, '/').split(' ')[0] // 日期格式处理 date = date.replace(/-/g, '/').split(' ')[0]
this.setData({ payload['userInfo.createdTime'] = date
['userInfo.createdTime']: date
})
} }
this.getStaffBankList() this.setData(payload)
this.getVersionInfo() },
} /**
}, * Tab 切到我的时的统一入口;合并同 tick 并发。
* @returns {Promise<void>}
/** */
* 组件的方法列表 refreshOnShow() {
*/ return withTabRefreshInFlight('mine', () => this.refreshMineTab())
methods: { },
/** 刷新用户信息展示 + getStaffBankList + getVersionInfo */
async refreshMineTab() {
this.applyMineUserInfo()
await Promise.all([this.getStaffBankList(), this.getVersionInfo()])
},
/**跳转至银行卡 */ /**跳转至银行卡 */
toAddBankAccount(e) { toAddBankAccount(e) {
const { const {
......
...@@ -91,8 +91,10 @@ Component({ ...@@ -91,8 +91,10 @@ Component({
util.getViewInfo( util.getViewInfo(
'#navigation-bar', '#navigation-bar',
res => { res => {
const navBarRect = res || _this.getFallbackNavBarRect()
if (!navBarRect?.height) return
// console.log(res, '#navigation-bar'); // console.log(res, '#navigation-bar');
_this.triggerEvent('navbarReady', res) _this.triggerEvent('navbarReady', navBarRect)
_this.setData({ _this.setData({
showNavBar: true showNavBar: true
}) })
...@@ -102,6 +104,16 @@ Component({ ...@@ -102,6 +104,16 @@ Component({
// }, 0) // }, 0)
} }
}) })
},
getFallbackNavBarRect() {
const sys = wx.getSystemInfoSync()
const menu = wx.getMenuButtonBoundingClientRect()
const statusBarHeight =
sys.platform === 'ios' ? sys.safeArea?.top ?? sys.statusBarHeight : sys.statusBarHeight
const navContentHeight = menu.height + (menu.top - statusBarHeight) * 2
return {
height: statusBarHeight + navContentHeight
}
} }
}, },
pageLifetimes: { pageLifetimes: {
......
...@@ -20,6 +20,8 @@ Component({ ...@@ -20,6 +20,8 @@ Component({
value: 'var(--fontSize1020)' value: 'var(--fontSize1020)'
}, },
sceneObj: { sceneObj: {
type: Object,
value: {},
observer: function (v) { observer: function (v) {
// 是否是扫码核销或再次下单,是的话不显示补录入口 // 是否是扫码核销或再次下单,是的话不显示补录入口
if (Object.keys(v)?.length) { if (Object.keys(v)?.length) {
......
import api from '../../api/api.js'
import Util from '../../utils/util'
Component({
options: {
multipleSlots: true // 在组件定义时的选项中启用多slot支持
},
/*组件的属性列表*/
properties: {
title: {
type: String,
value: '标题'
},
// 弹窗内容
content: {
type: String,
value: '内容'
},
// 弹窗取消按钮文字
btn_no: {
type: String,
value: '取消'
},
// 弹窗确认按钮文字
btn_ok: {
type: String,
value: '补录这笔订单'
},
//是否显示取消按钮
isShowCancel: {
type: Boolean,
value: true
},
//是否显示右上角关闭按钮
isShowClose: {
type: Boolean,
value: true
// <view class="order-popup-close" bindtap="close">
// <image src="../images/order-close.png" />
// </view>
},
//应用于某些场景的button的open-type属性
sureButtonType: {
type: String,
value: ''
},
//控制弹窗的显示
flag: {
type: Boolean,
value: true
},
outTradeNo: Array,
switchVlauerec: Number
// merchantId: {
// //是否根据4s店查询
// type: String,
// value: ''
// }
},
/* 组件的初始数据 */
data: {
bgOpacity: 0,
wrapAnimate: 'wrapAnimate',
popupAnimate: 'popupAnimate',
currentPage: 1,
pageSize: 10,
tableList: [],
activeIndex: ''
},
lifetimes: {
attached: function () {
this.getWaitinputorder()
// 在组件实例进入页面节点树时执行
},
detached: function () {
// 在组件实例被从页面节点树移除时执行
}
},
/* 组件的方法列表 */
methods: {
choose(e) {
let { item, index } = e.currentTarget.dataset
console.log(index)
let { tableList } = this.data
tableList.forEach(element => {
element.active = false
})
tableList[index].active = true
this.setData({
tableList,
activeIndex: index
})
},
restPageNum() {
console.log('restPageNum')
this.setData({
currentPage: 1
})
this.getWaitinputorder()
},
scrollonReachBottom() {
console.log('scrollonReachBottom')
let { pages, currentPage } = this.data
// 判断当前页是否是末页
if (pages == currentPage) return wx.$util.showToast('列表已到底')
this.setData({
currentPage: currentPage + 1
})
this.getWaitinputorder()
},
getWaitinputorder() {
let { currentPage, pageSize, tableList } = this.data
api
.waitinputorder({ currentPage, pageSize })
.then(result => {
let { code, data } = result
if (code == 0) {
// console.log(data.list)
data.list.forEach(element => {
// element.totalFee = element.totalFee / 100
element.formatAccountDate = Util.tsFormatTime(element.accountDate, 'M/D h:m')
element.accountDate = new Date(element.accountDate).format('yyyy-MM-dd')
})
// console.log(data.list)
this.setData({
tableList: currentPage == 1 ? data.list : [...tableList, ...data.list],
pages: data.pages,
triggered: false
})
// console.log(tableList)
}
// console.log(result)
})
.catch(err => {})
},
/* 内部私有方法建议以下划线开头 triggerEvent 用于触发事件 */
_close() {
//触发取消回调
this.triggerEvent('close')
},
_success() {
let { tableList, activeIndex } = this.data
// console.log('number' === typeof activeIndex)
// debugger
if ('number' !== typeof activeIndex) return wx.$util.showToast('请选择订单')
let { accountDate, outTradeNo, totalFee } = tableList[activeIndex]
tableList[activeIndex] && this.triggerEvent('success', { accountDate, outTradeNo, totalFee })
// if (activeIndex != '') {
// //触发成功回调
// console.log(tableList[activeIndex].tradeNo)
// }
}
}
})
<!-- components/orderSwitchPopup/orderSwitchPopup.wxml -->
<view wx:if="{{flag}}" class='container' style=''>
<!-- bindtap='_close' 取消遮光层关闭事件 -->
<view class='wrap {{wrapAnimate}}' style='background:rgba(0,0,0,{{bgOpacity}});' />
<view class='popup-container {{popupAnimate}}'>
<view class="v_title">
<view class="wx-popup-title">{{title}}</view>
<image
bindtap='_close'
src='../images/order-close.png'
mode='widthFix'
class='btn-colse'
wx:if="{{isShowClose}}" />
</view>
<view class="wx-popup-con">
<view class="label">
<view class="num">交易参考号</view>
<view class="time">支付时间</view>
<view class="payNum">支付金额</view>
</view>
<view class="table-body">
<scroll-view
scroll-y
enable-back-to-top
refresher-enabled="{{true}}"
bindrefresherrefresh="restPageNum"
bindscrolltolower="scrollonReachBottom"
refresher-threshold="104"
style="height:100%;"
refresher-triggered="{{triggered}}">
<block
wx:for="{{tableList}}"
class="orderInfo"
wx:for-item="tableItem"
wx:key="index">
<view
class="orderInfo"
data-index="{{index}}"
data-item="{{tableItem}}"
bindtap="choose">
<block wx:if="{{tableItem.active}}">
<image class="checkedIcon" src="../images/checkedIcon.png" />
</block>
<block wx:if="{{!tableItem.active}}">
<view class="arc" />
</block>
<view class="tradeNo">{{tableItem.outTradeNo}}</view>
<view class="accountDate">{{tableItem.formatAccountDate}}</view>
<view class="orderPrice">¥{{tableItem.totalFee / 100}}</view>
</view>
</block>
<view class="tips" wx:if="{{tableList.length>4&&(currentPage==pages)}}">到底了~</view>
</scroll-view>
</view>
</view>
<view class="wx-popup-btn">
<view class="btn-ok" bindtap='_success' open-type="{{sureButtonType}}">{{btn_ok}}</view>
</view>
</view>
</view>
/* components/orderSwitchPopup/orderSwitchPopup.wxss */
.container {
font-size: 15px;
color: #666;
font-weight: bold;
z-index: 10;
position: fixed;
width: 100vw;
height: 100vh;
}
.wrap {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
}
.popup-container {
position: fixed;
left: 50%;
/* top: 70%; */
width: 90%;
/* max-height: 60%; */
/* overflow: ; */
border: var(--fontSize2) solid #ccc;
border-radius: var(--fontSize16);
box-sizing: bordre-box;
transform: translate(-50%, -30%);
background: #fff;
opacity: 0;
}
.wx-popup-title {
width: 100%;
padding: var(--fontSize26) 0;
text-align: center;
/* font-size: var(--fontSize30); */
font-size: var(--fontSize32);
font-weight: 600;
color: #333;
border-bottom: var(--fontSize1) solid #EBEDF0;
}
.wx-popup-con {
/* margin: var(--fontSize60) var(--fontSize10); */
padding: 0 var(--fontSize32);
max-height: var(--fontSize570);
text-align: center;
font-weight: 400;
}
.wx-popup-con .label {
display: flex;
height: var(--fontSize90);
}
.table-body {
height: var(--fontSize480);
}
.wx-popup-btn {
display: flex;
justify-content: space-around;
/* margin-bottom: var(--fontSize20);
margin-left: var(--fontSize20);
margin-right: var(--fontSize20); */
padding: var(--fontSize10) var(--fontSize32);
align-items: center;
border-top: var(--fontSize1) solid #EBEDF0;
}
.btn-no {
display: flex;
align-items: center;
justify-content: center;
height: var(--fontSize65);
border: var(--fontSize2) solid #ccc;
border-radius: var(--fontSize100);
margin: var(--fontSize30);
width: 40% !important;
background: gray;
color: #fff;
}
.btn-ok {
display: flex;
align-items: center;
justify-content: center;
font-size: var(--fontSize28);
padding: var(--fontSize22) 0;
font-weight: 400;
border-radius: var(--fontSize12);
width: 100% !important;
background: #347BFF;
color: #fff;
}
.v_title {
display: flex;
justify-content: center;
align-items: center;
/* padding: 0 var(--fontSize28); */
position: relative;
}
.btn-colse {
position: absolute;
right: var(--fontSize28);
top: 50%;
transform: translateY(-50%);
width: var(--fontSize44);
height: var(--fontSize44);
/* display: flex; */
/* justify-content: flex-end; */
}
.orderInfo {
display: flex;
height: var(--fontSize120);
justify-content: space-between;
align-items: center;
border-top: 1px solid #EBEDF0;
font-size: var(--fontSize26);
}
.wx-popup-con .label {
display: flex;
align-items: center;
}
.label .num {
width: 54%;
}
.label .time {
width: 24%;
}
.label .payNum {
width: 22%;
text-align: right;
}
.tradeNo {
/* flex: 1; */
margin-left: var(--fontSize10);
width: 47%;
word-break: break-word;
text-align: start;
}
.accountDate {
width: 30%;
}
.orderPrice {
width: 20%;
}
.orderInfo .orderPrice {
color: #347BFF;
text-align: right;
}
.checkedIcon {
width: var(--fontSize34);
height: var(--fontSize32);
}
.arc {
/* width: 100%;
height: 100%; */
width: var(--fontSize34);
height: var(--fontSize34);
border: var(--fontSize2) solid #979797;
border-radius: 100%;
box-sizing: border-box;
}
.wrapAnimate {
animation: wrapAnimate 1s linear forwards
}
@keyframes wrapAnimate {
0% {}
100% {
background: rgba(0, 0, 0, 0.7);
}
}
.wrapAnimateOut {
animation: wrapAnimateOut 1s 0.2s linear forwards
}
@keyframes wrapAnimateOut {
0% {
background: rgba(0, 0, 0, 0.7);
}
100% {
background: rgba(0, 0, 0, 0);
}
}
.popupAnimate {
animation: popupAnimate 1.2s linear forwards
}
@keyframes popupAnimate {
0% {}
60% {
top: 47%;
opacity: 1;
}
80% {
top: 53%;
opacity: 1;
}
100% {
top: 50%;
opacity: 1;
}
}
.popupAnimateOut {
animation: popupAnimateOut 1.2s linear forwards
}
@keyframes popupAnimateOut {
0% {
top: 50%;
opacity: 1;
}
20% {
top: 47%;
opacity: 1;
}
100% {}
}
.tips {
font-size: var(--fontSize24);
margin-bottom: var(--fontSize20);
}
\ No newline at end of file \ No newline at end of file
# 文档说明
## 跨模块
| 文档 | 用途 |
|------|------|
| [延保 & 权益 — 园区店 ID 使用清单](./YQ-MERCHANT-ID-USAGE.md) | 延保/权益场景下哪些功能与 API 用到园区店 ID |
| [packageEquity sceneType:0 专章](./EQUITY-SCENE0-YQ-MERCHANT-ID.md) | 权益本包 + 关联分包/页面的园区店 ID 清单 |
| [服务中心公告弹窗 — 精品 vs 权益](./SERVICE-CENTER-NOTICE-POPUP.md) | 两首页 `checkServiceNotice` 行为差异与版本变更记录 |
## 分包文档
动态表单(`packageDynamicForm`)相关文档已迁至分包目录,避免占用主包体积:
**[packageDynamicForm/docs/README.md](../packageDynamicForm/docs/README.md)**
# 服务中心公告:精品 vs 权益 弹窗逻辑
精品首页(`tabIndex`)与权益首页(`packageEquity`)对服务中心未读公告的处理**一致**:均更新角标并弹窗(同日同模块类型最多弹一次);本地 storage key 按首页隔离。
## 行为对比
| 首页 | 是否弹窗 | 入口 | 角标字段 | 说明 |
|------|----------|------|----------|------|
| **精品** | 是 | `dailyCheckService.checkServiceNotice` | `serviceCenterUnreadNum` | 与权益一致 |
| **权益** | 是 | `equityPage.checkServiceNotice` | `serviceCenterUnreadNum` | 与精品一致 |
## 精品首页(角标 + 弹窗)
**文件**:
- 编排:[`tabIndex/services/dailyCheckService.js`](../tabIndex/services/dailyCheckService.js) `checkServiceNotice`
- 服务:[`tabIndex/services/serviceCenterNoticeService.js`](../tabIndex/services/serviceCenterNoticeService.js)
- 弹窗入队:[`utils/serviceNoticePopupHandler.js`](../utils/serviceNoticePopupHandler.js)(与权益共用)
**调用链**:`tabIndex/pages/index/index.js` → `checkDailyRecport` → `runDailyChecks` → `checkServiceNotice(page)`(`isStaff` 时)
**历史**:v5.8.2 的 `13be0965` 曾注释弹窗;当前已恢复,行为与权益一致(同日同 `moduleType` 最多弹 1 次)。
## 权益首页(角标 + 弹窗)
**文件**:
- 页面:[`packageEquity/pages/TabBar/equityPage.js`](../packageEquity/pages/TabBar/equityPage.js) `checkServiceNotice`
- 服务:[`packageEquity/services/serviceCenterNoticeService.js`](../packageEquity/services/serviceCenterNoticeService.js)
**调用链**:`equityPage.onShow` → `initList`(`isStaff && tabIndex === 0`)→ `checkServiceNotice` → `showNextModal`
**流程**:
1. `fetchServiceCenterUnread()` — 角标数(60s TTL + in-flight 缓存)
2. `resolveServiceNoticePopupCandidate()` — 取今日尚未弹过的首条未读;本地 key `equityServiceNoticePop_yyyy-MM-dd`,**每个 `moduleType` 每天最多弹 1 次**
3. 有候选则 `markServiceNoticePopupShown` + `addModalToQueue`(priority 10),确认后跳转长课程 / 案例 / 企业通知详情
**版本变更**:
| 提交 | 日期 | 分支 | 变更 |
|------|------|------|------|
| `3f9e150a` | 2026-06-09 | `saas+v5.8.2` | 从内联 `getCompanyNoticeList` 重构为 `serviceCenterNoticeService`;**未关闭弹窗**,新增「同日同模块防重复」 |
**3f9e150a 之前**:有未读即每次进入都可能弹(无本地「今日已弹」标记)。
权益页**从未**像精品页那样注释掉弹窗。
## 排查「权益也不弹了」
1. **同日已弹过**:`resolveServiceNoticePopupCandidate()` 返回 `null`
2. **非 Tab0 / 非员工**:`initList` 仅在 `isStaff && tabIndex === 0` 时调用
3. **弹窗队列优先级**:priority=10,需等其他弹窗(开单预警 priority 1、异常订单 0 等)先展示
4. **与精品混淆**:精品 v5.8.2 起确实不弹;权益仍会弹
## 相关文档与测试
| 资源 | 路径 |
|------|------|
| 精品首页职责地图 | [`tabIndex/docs/HOMEPAGE-INDEX.md`](../tabIndex/docs/HOMEPAGE-INDEX.md) |
| 权益首页职责地图 | [`packageEquity/docs/HOMEPAGE-INDEX.md`](../packageEquity/docs/HOMEPAGE-INDEX.md) |
| 权益公告服务单测 | `npm run test:equity` — `IT-EQ-NOTICE-*` |
Component({
/**
* 组件的属性列表
*/
properties: {
info: Object,
show: Boolean
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
cancel() {
this.sumbit = false
this.setData({
show: false
})
},
confirm() {
if (this.sumbit) return
this.sumbit = true
this.cancel()
this.triggerEvent('sumbit')
},
}
})
.modal {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
z-index: 98;
perspective: 99999999px;
.modal-bg {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
animation: show-popup-bg .1s forwards .1s;
}
}
@keyframes show-popup-bg {
0% {
background-color: rgba(0, 0, 0, 0);
}
100% {
background-color: rgba(45, 45, 51, .6);
}
}
.modal-box {
width: 590rpx;
padding-bottom: 48rpx;
background: #FFFFFF;
box-shadow: inset 0 0 48rpx 16rpx #E0EAFF;
border-radius: 20rpx;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
box-sizing: border-box;
animation: show-modal .1s forwards;
display: flex;
align-items: center;
flex-direction: column;
.modal-title {
font-weight: 600;
font-size: 40rpx;
color: #3D5BD6;
margin-top: 64rpx;
margin-bottom: 24rpx;
}
.modal-tip {
font-weight: 400;
font-size: 30rpx;
color: #7A8299;
}
.modal-main {
margin-top: 48rpx;
.cell {
display: flex;
margin-bottom: 8rpx;
.label {
width: 120rpx;
height: 56rpx;
font-weight: 400;
font-size: 30rpx;
color: #7A8299;
margin-right: 24rpx;
line-height: 56rpx;
}
.value {
font-weight: 400;
font-size: 30rpx;
color: #1B233D;
line-height: 56rpx;
white-space: pre-wrap;
word-break: break-all;
}
}
}
.modal-footer {
margin-top: 64rpx;
display: flex;
align-items: center;
justify-content: center;
.btn {
width: 240rpx;
height: 88rpx;
background: #FFFFFF;
border: 2rpx solid #4466F0;
border-radius: 12rpx;
font-weight: 500;
font-size: 32rpx;
color: #3D5BD6;
display: flex;
align-items: center;
justify-content: center;
}
.right {
border: none;
background-image: linear-gradient(-78deg, #556AF5 0%, #7197FF 100%);
border-radius: 12rpx;
color: #FFFFFF;
}
}
}
\ No newline at end of file \ No newline at end of file
<view wx:if="{{show}}" class="modal">
<view class="modal-bg" />
<view class="modal-box">
<view class="modal-title">积分兑换到账详情</view>
<view class="modal-main">
<view class="cell">
<view class="label">兑换积分</view>
<view class="value">{{info.count || '--'}}</view>
</view>
<view class="cell">
<view class="label">到账积分</view>
<view class="value">{{info.money || '--'}}</view>
</view>
<view class="cell">
<view class="label">手续费率</view>
<view class="value">{{info.rate || '--'}}</view>
</view>
</view>
<view class="modal-footer">
<view bind:tap="confirm" class="btn right">好的</view>
</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
import WxValidate from '~/utils/WxValidate' import WxValidate from '~/integration/utils/WxValidate'
const { const {
methods methods
} = new WxValidate() } = new WxValidate()
......
{ {
"usingComponents": { "usingComponents": {
"van-dialog": "@vant/weapp/dialog/index", "van-dialog": "@vant/weapp/dialog/index",
"modal": "../../../components/Modal",
"tab":"../../../components/Tab/Tab" "tab":"../../../components/Tab/Tab"
}, },
"navigationBarTitleText":"兑换" "navigationBarTitleText":"兑换"
......
...@@ -9,8 +9,6 @@ ...@@ -9,8 +9,6 @@
"@vant/weapp": "^1.10.24", "@vant/weapp": "^1.10.24",
"dayjs": "^1.11.11", "dayjs": "^1.11.11",
"glsk-applet-component": "^1.0.0", "glsk-applet-component": "^1.0.0",
"glsk-map-jssdk": "^0.1.1",
"glsx-applet-component": "^1.1.29",
"glsx-common-sdk": "^0.2.8", "glsx-common-sdk": "^0.2.8",
"number-precision": "^1.6.0", "number-precision": "^1.6.0",
"rfdc": "^1.3.0" "rfdc": "^1.3.0"
...@@ -155,16 +153,6 @@ ...@@ -155,16 +153,6 @@
"resolved": "https://registry.npmjs.org/glsk-applet-component/-/glsk-applet-component-1.0.0.tgz", "resolved": "https://registry.npmjs.org/glsk-applet-component/-/glsk-applet-component-1.0.0.tgz",
"integrity": "sha512-ulz1OquWy4y4Q26Zu4FLDWzyqK+sInPWs4o8MKj2N8V/TnYQlUXoWkkgKh8fERK8A+rsusf3eiyZB0odchKk8g==" "integrity": "sha512-ulz1OquWy4y4Q26Zu4FLDWzyqK+sInPWs4o8MKj2N8V/TnYQlUXoWkkgKh8fERK8A+rsusf3eiyZB0odchKk8g=="
}, },
"node_modules/glsk-map-jssdk": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/glsk-map-jssdk/-/glsk-map-jssdk-0.1.1.tgz",
"integrity": "sha512-kwCyU8A1t7Q7V2hlzC03nc9VNNW9HPXQ5YhHsGGnrEtPxykGDG7AEyT5O7LY1zZk/8adkkk6FHgCM53r6p/4yw=="
},
"node_modules/glsx-applet-component": {
"version": "1.1.29",
"resolved": "https://registry.npmmirror.com/glsx-applet-component/-/glsx-applet-component-1.1.29.tgz",
"integrity": "sha512-HPzVayIRZvA3nvG2Lj9V9+S+BFiCer4XxjQwuZksta5Bs9JbbKaY4ztcIEe1Se3vw3rbPL0Dv2OsWvVz2b5jfw=="
},
"node_modules/glsx-common-sdk": { "node_modules/glsx-common-sdk": {
"version": "0.2.8", "version": "0.2.8",
"resolved": "https://registry.npmjs.org/glsx-common-sdk/-/glsx-common-sdk-0.2.8.tgz", "resolved": "https://registry.npmjs.org/glsx-common-sdk/-/glsx-common-sdk-0.2.8.tgz",
...@@ -194,7 +182,6 @@ ...@@ -194,7 +182,6 @@
"integrity": "sha512-UOnG6LftzbdaHZcKoPFtOcCKztrQ57WkHDeRD9t/PTQtmT0NHSeWWepj6pS0z/N7+08BHFDQVUrfmfMRcZwbMg==", "integrity": "sha512-UOnG6LftzbdaHZcKoPFtOcCKztrQ57WkHDeRD9t/PTQtmT0NHSeWWepj6pS0z/N7+08BHFDQVUrfmfMRcZwbMg==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"peer": true,
"bin": { "bin": {
"prettier": "bin/prettier.cjs" "prettier": "bin/prettier.cjs"
}, },
......
...@@ -4,8 +4,6 @@ ...@@ -4,8 +4,6 @@
"@vant/weapp": "^1.10.24", "@vant/weapp": "^1.10.24",
"dayjs": "^1.11.11", "dayjs": "^1.11.11",
"glsk-applet-component": "^1.0.0", "glsk-applet-component": "^1.0.0",
"glsk-map-jssdk": "^0.1.1",
"glsx-applet-component": "^1.1.29",
"glsx-common-sdk": "^0.2.8", "glsx-common-sdk": "^0.2.8",
"number-precision": "^1.6.0", "number-precision": "^1.6.0",
"rfdc": "^1.3.0" "rfdc": "^1.3.0"
...@@ -15,5 +13,11 @@ ...@@ -15,5 +13,11 @@
"@babel/parser": "^7.28.5", "@babel/parser": "^7.28.5",
"prettier": "^3.8.1", "prettier": "^3.8.1",
"prettier-plugin-mp": "^2.5.0" "prettier-plugin-mp": "^2.5.0"
},
"scripts": {
"test": "node --test packageDynamicForm/tests/**/*.test.mjs tabIndex/tests/**/*.test.mjs packageEquity/tests/**/*.test.mjs",
"test:tabIndex": "node --test tabIndex/tests/**/*.test.mjs",
"test:equity": "node --test packageEquity/tests/**/*.test.mjs",
"test:dynamicForm": "node --test packageDynamicForm/tests/**/*.test.mjs"
} }
} }
// packageCrowdFunding/components/OrderNoPopup/OrderNoPopup.js // packageCrowdFunding/components/OrderNoPopup/OrderNoPopup.js
import api from '../../api/api' import api from '~/api/api.js'
Component({ Component({
/** /**
* 组件的属性列表 * 组件的属性列表
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
</block> </block>
</view> </view>
<view class="checked" wx:if="{{item.active}}"> <view class="checked" wx:if="{{item.active}}">
<image src="../images/choose.png" /> <image src="/components/images/choose.png" />
</view> </view>
</view> </view>
</block> </block>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"navigationBarTitleText": "订单补录", "navigationBarTitleText": "订单补录",
"usingComponents": { "usingComponents": {
"gl-form": "/packageCrowdFunding/components/GLForm/GLForm", "gl-form": "/packageCrowdFunding/components/GLForm/GLForm",
"order-no-popup": "/components/OrderNoPopup/OrderNoPopup", "order-no-popup": "/packageCrowdFunding/components/OrderNoPopup/OrderNoPopup",
"picker-select": "/packageCrowdFunding/components/PickerSelect/PickerSelect" "picker-select": "/packageCrowdFunding/components/PickerSelect/PickerSelect"
} }
} }
\ No newline at end of file \ No newline at end of file
{ {
"usingComponents": { "usingComponents": {
"activity-info": "../components/activityInfoCom/activityInfoCom", "activity-info": "../components/activityInfoCom/activityInfoCom",
"order-no-popup": "/components/OrderNoPopup/OrderNoPopup", "order-no-popup": "/packageCrowdFunding/components/OrderNoPopup/OrderNoPopup",
"picker-select": "/packageCrowdFunding/components/PickerSelect/PickerSelect", "picker-select": "/packageCrowdFunding/components/PickerSelect/PickerSelect",
"gl-form": "/packageCrowdFunding/components/GLForm/GLForm" "gl-form": "/packageCrowdFunding/components/GLForm/GLForm"
}, },
......
# packageDynamicForm — 动态表单分包
精品 / 权益共用的 Schema 驱动日报分包(驻店 / 门店 / 洽谈三页)。
**文档入口**:[docs/README.md](docs/README.md)(完整索引)
**新人阅读顺序**:[DYNAMIC-FORM-GUIDE.md](docs/DYNAMIC-FORM-GUIDE.md) → [TECH-SHARE.md](docs/TECH-SHARE.md)(团队分享)→ [PAGES.md](docs/PAGES.md) → [ARCHITECTURE.md](docs/ARCHITECTURE.md)
```bash
npm test
```
联调开关:[`config/apiSwitch.js`](config/apiSwitch.js)(默认三页各能力为 `real`)。
/**
* 四级车型接口(对齐 App 动态表单 CarModelList + scrm carlife)
*/
const {
resolveMerchantCarBrandTree,
flattenMerchantCarBrandChilds
} = require('../form-engine/car-brand-merchant-tree.js')
const { isCarModelQueryMockMode } = require('../config/apiSwitch.js')
function requireMockMerchantCarBrandResponse() {
return require('../fixtures/mock-merchant-brand-api.js').MOCK_MERCHANT_CAR_BRAND_API_RESPONSE
}
function requireMockCarModelApi() {
return require('../fixtures/mock-car-model-api.js')
}
const CARLIFE_ROUTER = '/rop-scrm-carlife/router'
const CARLIFE_DOMAIN = 'scrm'
const MERCHANTS_ROUTER = '/rop-merchants/router'
const MERCHANTS_DOMAIN = 'merchants'
let getMerchantCarBrandListImpl = null
function getRequestApi() {
const requestModule = require('~/utils/request/request.js')
return requestModule.default || requestModule
}
function __setGetMerchantCarBrandList(impl) {
getMerchantCarBrandListImpl = impl
}
function getMerchantCarBrandList(merchantIdList = []) {
if (getMerchantCarBrandListImpl) {
return getMerchantCarBrandListImpl(merchantIdList)
}
const api = getRequestApi()
return api.post(
'merchants.api.open.merchant.info',
{
merchantIdList,
merchantInfoSwitch: {
brandFlag: true
}
},
[],
MERCHANTS_ROUTER,
MERCHANTS_DOMAIN
)
}
/**
* 动态表单 carBrandSelect L1+L2:门店主营树(App getMerchantCarBrandList)
*/
function fetchMerchantCarBrandTree(merchantId, options = {}) {
if (options.useMock) {
return Promise.resolve(resolveMerchantCarBrandTree(requireMockMerchantCarBrandResponse()))
}
if (!merchantId) {
return Promise.resolve([])
}
return getMerchantCarBrandList([merchantId]).then(res => resolveMerchantCarBrandTree(res))
}
/** L1/L2 节点 id(App c.id / j.id,兼容仅 brandId) */
function resolveBrandNodeId(node = {}) {
if (node.id != null && node.id !== '') {
return node.id
}
return node.brandId
}
/** L2 子品牌 id → getCarSeriesList childBrandId */
function resolveChildBrandId(node = {}) {
if (node.brandId != null && node.brandId !== '') {
return node.brandId
}
return node.id
}
/** L3 车系 id → getCarTypeList carSeriesId */
function resolveCarSeriesId(series = {}) {
if (series.id != null && series.id !== '') {
return series.id
}
return series.carSeriesId
}
function buildCarSeriesListParams(brandId, subBrandNode = {}) {
return {
brandId: resolveBrandNodeId({ id: brandId }),
childBrandId: resolveChildBrandId(subBrandNode)
}
}
/**
* 日报 schema 显隐:主营品牌列表(展平 childs)
*/
async function fetchMerchantOperatingBrandList(merchantId) {
if (!merchantId) {
return { code: 0, message: 'ok', data: [] }
}
const res = await getMerchantCarBrandList([merchantId])
const code = res?.code
if (code != null && code != 0) {
return {
code: code ?? -1,
message: res?.message || '获取经营品牌失败',
data: []
}
}
const tree = resolveMerchantCarBrandTree(res)
return {
code: 0,
message: 'ok',
data: flattenMerchantCarBrandChilds(tree)
}
}
module.exports = {
getCarBrandList(data = {}) {
const api = getRequestApi()
return api.post(
'scrm.api.carlife.common.getOnlyCarBrandList',
data,
[],
CARLIFE_ROUTER,
CARLIFE_DOMAIN
)
},
getMerchantCarBrandList,
fetchMerchantCarBrandTree,
fetchMerchantOperatingBrandList,
resolveBrandNodeId,
resolveChildBrandId,
resolveCarSeriesId,
buildCarSeriesListParams,
__setGetMerchantCarBrandList,
getCarSeriesList(data) {
if (isCarModelQueryMockMode()) {
const { getMockCarSeriesList } = requireMockCarModelApi()
return Promise.resolve({
code: 0,
message: 'ok',
data: getMockCarSeriesList(data || {})
})
}
const api = getRequestApi()
return api.post(
'scrm.api.carlife.common.getCarSeriesList',
data,
[],
CARLIFE_ROUTER,
CARLIFE_DOMAIN
)
},
getCarTypeList(carSeriesId) {
if (isCarModelQueryMockMode()) {
const { getMockCarTypeList } = requireMockCarModelApi()
return Promise.resolve({
code: 0,
message: 'ok',
data: getMockCarTypeList(carSeriesId)
})
}
const api = getRequestApi()
return api.post(
'scrm.api.carlife.common.getCarTypeList',
{ carSeriesId },
[],
CARLIFE_ROUTER,
CARLIFE_DOMAIN
)
}
}
import api from '~/utils/request/request.js'
function dailyReportWeeklyList(data) {
return api.post('dj.api.smartcarlife.dailyReport.weekly.list', data)
}
function dynamicDailyReportSave(data) {
return api.post('dj.api.smartcarlife.dailyReport.dynamic.save', data, [], undefined, 'dj', false)
}
function dynamicDailyReportDraftSave(data) {
return api.post('dj.api.smartcarlife.dailyReport.dynamic.draft.save', data, [], undefined, 'dj', false)
}
function dailyReportDetailGet(data) {
return api.get('dj.api.smartcarlife.dailyReport.detail.get', data, [], undefined, 'dj', false)
}
function dailyReportMonthlyPendingCountGet(data) {
return api.post(
// 'dj.api.smartcarlife.dailyReport.monthly.pending.count',
'dj.api.smartcarlife.dailyReport.monthly.pending.get',
data,
[],
undefined,
'dj',
false
)
}
function findAllSceneByMerchantId(data) {
return api.post('dj.api.scenemerchantref.findAllSceneByMerchantId', data)
}
function dailyReportDiscussionStaffList(data) {
return api.post(
'dj.api.smartcarlife.dailyReport.discussion.staff.list',
data,
[],
undefined,
'dj',
false
)
}
module.exports = {
dailyReportWeeklyList,
dynamicDailyReportSave,
dynamicDailyReportDraftSave,
dailyReportDetailGet,
dailyReportMonthlyPendingCountGet,
findAllSceneByMerchantId,
dailyReportDiscussionStaffList
}
/**
* 字段选项 HTTP 封装 — 在职员工列表等
* @see packageDynamicForm/docs/field-options-api.md
*
* 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
/** 懒加载 getEmployeeList API 模块 */
function getEmployeeListApi() {
if (!employeeListApiModule) {
employeeListApiModule = require('../../api/api.js')
}
return employeeListApiModule
}
/** 测试注入:覆盖 getEmployeeList API 模块 */
function __setEmployeeListApi(api) {
employeeListApiModule = api
}
/** 懒加载订单列表 API 模块(与 getEmployeeList 同走 api/api.js) */
function getOrderListApi() {
if (!orderListApiModule) {
orderListApiModule = require('../../api/api.js')
}
return orderListApiModule
}
/** 测试注入:覆盖订单列表 API 模块 */
function __setOrderListApi(api) {
orderListApiModule = api
}
/**
* 将员工列表映射为 { label, value } 选项
* @param {Array} [list=[]] getEmployeeList 返回的数据
* @returns {Array<{label: string, value: string}>}
*/
function mapEmployeeListToOptions(list = []) {
if (!Array.isArray(list)) {
return []
}
return list
.map(item => {
const value = item?.uuid ?? item?.staffUuid ?? item?.userId ?? ''
const label = item?.staffName ?? item?.name ?? item?.employeeName ?? ''
const phone = item?.phone ?? item?.mobile ?? item?.staffPhone ?? ''
if (value === '' || label === '') {
return null
}
const option = {
label: String(label),
value: String(value),
id: String(value),
name: String(label)
}
if (phone !== '') {
option.phone = String(phone)
}
return option
})
.filter(Boolean)
}
/**
* 拉取在职员工选项(onTheJob.getByMerchantId)
* @param {Object} [options={}]
* @param {string|number} options.merchantId 商户 ID(驻店为园区店,门店/洽谈为 4S 店)
* @returns {Promise<{code: number, message: string, data: Array}>}
*/
async function fetchStoreStaffListOptions({ merchantId } = {}) {
if (!merchantId) {
return { code: -1, message: '缺少门店信息', data: [] }
}
const params = { merchantId }
const result = await getEmployeeListApi().getEmployeeList(params)
const code = result?.code ?? -1
if (code != 0) {
return {
code: code ?? -1,
message: result?.message || '获取驻店人员失败',
data: []
}
}
return {
code: 0,
message: 'ok',
data: mapEmployeeListToOptions(result?.data)
}
}
/**
* 将订单列表映射为 { label, value } 选项
* @param {Array} [list=[]]
* @returns {Array<{label: string, value: string}>}
*/
function mapOrderListToOptions(list = []) {
if (!Array.isArray(list)) {
return []
}
return list
.map(item => {
const value = item?.orderCode ?? item?.value ?? ''
const label =
item?.orderCode != null && item?.orderCode !== ''
? String(item.orderCode)
: item?.productName ?? item?.label ?? ''
if (value === '' || label === '') {
return null
}
return {
label: String(label),
value: String(value),
id: String(value),
name: String(label),
raw: item
}
})
.filter(Boolean)
}
/**
* 拉取洽谈订单选项(goodsOrder.product.outputValue.list)
* @param {Object} [options={}]
* @param {string|number} options.merchantId 4S 门店 ID
* @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,
sceneList,
groupBrandIds
} = {}) {
if (!merchantId) {
return { code: -1, message: '缺少门店信息', data: [] }
}
const params = {
merchantId,
sellerUserId: staffUuid || '',
// baseGoodsCodeList: resolveBaseGoodsCodeList(sceneList),
carBrandTypeFlag: resolveCarBrandTypeFlag(groupBrandIds),
saleDate: saleDate || reportDate || ''
}
const result = await getOrderListApi().getGoodsOrderOutputValueList(params)
const code = result?.code ?? -1
if (code != 0) {
return {
code: code ?? -1,
message: result?.message || '获取订单列表失败',
data: []
}
}
return {
code: 0,
message: 'ok',
data: mapOrderListToOptions(result?.data)
}
}
module.exports = {
mapEmployeeListToOptions,
mapOrderListToOptions,
fetchStoreStaffListOptions,
fetchOrderListOptions,
__setEmployeeListApi,
__setOrderListApi
}
import api from '~/utils/request/request.js'
/**
* 动态表单字段选项( multipleSelect 通过 optionsKey 拉取 )
* 联调时替换为真实接口名
*/
function fetchFieldOptions(data) {
return api.post('dj.api.smartcarlife.dailyReport.field.options', data)
}
module.exports = {
fetchFieldOptions
}
/**
* 字段选项 adapter — optionsKey 路由
* @see packageDynamicForm/docs/field-options-api.md
*
* storeStaffList / 4sStaffList → fetchStoreStaffListOptions(getEmployeeList)
* mock:fixtures/mock-field-options;real:按 reportType 读 apiSwitch.fieldOptions
*/
const { isStaffMockMode, isStoreMockMode, isNegotiationMockMode } = require('../config/apiSwitch.js')
const { fetchStoreStaffListOptions, fetchOrderListOptions } = require('./fieldOptionProviders.js')
let fieldOptionsApiModule = null
/** 懒加载 fieldOptions API 模块 */
function getFieldOptionsApi() {
if (!fieldOptionsApiModule) {
fieldOptionsApiModule = require('./fieldOptions.js')
}
return fieldOptionsApiModule
}
/**
* 按 reportType 解析 fieldOptions 是否走 mock
* @param {string} [reportType='store'] 'staff' | 'store' | 'negotiation'
* @returns {boolean}
*/
function resolveMockMode(reportType = 'store') {
if (reportType === 'staff') return isStaffMockMode('fieldOptions')
if (reportType === 'negotiation') return isNegotiationMockMode('fieldOptions')
return isStoreMockMode('fieldOptions')
}
const EMPLOYEE_LIST_OPTIONS_KEYS = new Set(['storeStaffList', '4sStaffList'])
/** storeStaffList 用园区店 id;4sStaffList 用 4S shopMerchantId */
function resolveEmployeeListMerchantId(optionsKey, params = {}) {
if (optionsKey === 'storeStaffList') {
return params.yqMerchantId || params.merchantId
}
return params.merchantId
}
/**
* 按 optionsKey 路由字段选项(mock / 员工列表 / 通用 fieldOptions API)
* @param {Object} [params={}]
* @param {string} params.optionsKey 选项键
* @param {string} [params.reportType='store'] 日报类型
* @param {string|number} [params.yqMerchantId] 园区店 ID(storeStaffList 优先)
* @param {string} [params.staffUuid] 员工 UUID
* @param {string} [params.reportDate] 报表日期
* @returns {Promise<{code: number, message: string, data: Array}>}
*/
async function fetchFieldOptionsAdapter(params = {}) {
const { optionsKey, reportType = 'store' } = params
if (!optionsKey) {
return { code: 0, message: 'ok', data: [] }
}
if (resolveMockMode(reportType)) {
const { getMockOptionsByKey } = require('../fixtures/mock-field-options.js')
return {
code: 0,
message: 'ok',
data: getMockOptionsByKey(optionsKey)
}
}
if (EMPLOYEE_LIST_OPTIONS_KEYS.has(optionsKey)) {
return fetchStoreStaffListOptions({
merchantId: resolveEmployeeListMerchantId(optionsKey, params)
})
}
if (optionsKey === 'orderList') {
return fetchOrderListOptions({
merchantId: params.merchantId,
staffUuid: params.staffUuid,
reportDate: params.reportDate,
saleDate: params.saleDate,
sceneList: params.sceneList,
groupBrandIds: params.groupBrandIds
})
}
const { fetchFieldOptions } = getFieldOptionsApi()
return fetchFieldOptions({
optionsKey: params.optionsKey,
merchantId: params.merchantId,
staffUuid: params.staffUuid,
reportDate: params.reportDate,
sceneType: params.sceneType
})
}
module.exports = {
fetchFieldOptionsAdapter,
getFieldOptionsApi
}
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 || '',
params.yqMerchantId || '',
params.staffUuid || '',
params.reportDate || '',
params.saleDate || '',
params.reportType || 'store',
brandKey,
JSON.stringify(params.sceneList || [])
].join('|')
}
async function fetchFieldOptions(params = {}, options = {}) {
const { useCache = true } = options
const cacheKey = buildCacheKey(params)
if (useCache && optionsCache.has(cacheKey)) {
return optionsCache.get(cacheKey)
}
const result = await fetchFieldOptionsAdapter(params)
if (result?.code === 0 && useCache) {
optionsCache.set(cacheKey, result)
}
return result
}
function clearFieldOptionsCache() {
optionsCache.clear()
}
module.exports = {
fetchFieldOptions,
clearFieldOptionsCache
}
const { normalizeConfigToSchemaRoot } = require('../config/configCenter.js')
const { mergeValuesIntoSchema } = require('../form-engine/submit-adapter.js')
/** detail.get:jsonContent 为 visibleFormList(带 value 的 schema list) */
function buildMockDetailJsonContent(schemaIndexed, values = {}) {
const schemaRoot = normalizeConfigToSchemaRoot(schemaIndexed)
const withValues = mergeValuesIntoSchema(schemaRoot, values)
return JSON.stringify(withValues.list)
}
module.exports = {
buildMockDetailJsonContent
}
const { BOUTIQUE_PAGE_CONTEXT } = require('../fixtures/mock-meta.js')
const schemaIndexed = require('../fixtures/schema-staff-daily-full.js')
const { buildMockDetailJsonContent } = require('./mockDetailJsonContent.js')
const { buildNormalizedFieldDataList } = require('../form-engine/submit-adapter.js')
const { normalizeConfigToSchemaRoot } = require('../config/configCenter.js')
const { DEFAULT_REPORT_TEMPLATE_ID: TEMPLATE_IDS } = require('../config/dailyReportConstants.js')
const detailStore = new Map()
const DEFAULT_REPORT_TEMPLATE_ID = TEMPLATE_IDS.staff
const DEFAULT_STAFF_RECORD_ID = 90001
function formatDate(date) {
const y = date.getFullYear()
const m = `${date.getMonth() + 1}`.padStart(2, '0')
const d = `${date.getDate()}`.padStart(2, '0')
return `${y}-${m}-${d}`
}
function getStoreKey({ merchantId, staffUuid, reportDate }) {
return `${merchantId || '0'}:${staffUuid || '0'}:${reportDate}`
}
function getBoutiqueSampleValues() {
return {
'F1-1': '1',
'F1-4': 'mock 精品回显备注',
'F1-5-1': 2,
'F1-5-2': 3,
'F1-5-3': 1,
'F1-6-1': 4,
'F1-6-2': 5,
'F1-6-3': 6,
'F1-7-1': 7,
'F1-7-2': 8,
'F1-7-3': 9,
'F1-8-1': 10,
'F1-8-2': 11,
'F1-8-3': 12,
'F1-9-1': 13,
'F1-9-2': 14,
'F1-9-3': 15,
'F1-10-1': 16,
'F1-10-2': 17
}
}
const SCHEMA_FIELD_LABELS = {
'F1-1': '今日出勤',
'F1-4': '备注'
}
function mapMockFieldStorageType(fieldKey) {
if (fieldKey === 'F1-1') return 'STRING'
if (fieldKey === 'F1-4') return 'STRING'
return 'INT'
}
function valuesToFieldDataList(values = {}, schemaLabels = {}) {
return Object.keys(values).map(fieldKey => {
const displayName = schemaLabels[fieldKey] || SCHEMA_FIELD_LABELS[fieldKey] || fieldKey
const fieldType = mapMockFieldStorageType(fieldKey)
const rawValue = values[fieldKey]
const fieldValue =
fieldType === 'JSON' && typeof rawValue === 'object'
? JSON.stringify(rawValue)
: String(rawValue)
return {
fieldKey,
displayName,
fieldName: displayName,
fieldType,
fieldValue
}
})
}
function fieldDataListToValues(fieldDataList = []) {
const values = {}
fieldDataList.forEach(item => {
if (item?.fieldKey !== undefined && item?.fieldKey !== null && item.fieldKey !== '') {
let value = item.fieldValue
if (item.fieldType === 'JSON' && typeof value === 'string') {
try {
value = JSON.parse(value)
} catch (error) {
// keep string
}
} else if (
(item.fieldType === 'INT' || item.fieldType === 'DECIMAL') &&
typeof value === 'string'
) {
const num = Number(value)
value = Number.isNaN(num) ? value : num
}
values[item.fieldKey] = value
}
})
return values
}
function buildStaffSampleDetail(params = {}) {
const { reportTemplateId } = params
const values = getBoutiqueSampleValues()
const schemaRoot = normalizeConfigToSchemaRoot(schemaIndexed)
const fieldDataList = buildNormalizedFieldDataList(schemaRoot.list, values)
const jsonContent = buildMockDetailJsonContent(schemaIndexed, values)
return {
id: DEFAULT_STAFF_RECORD_ID,
reportTemplateId: reportTemplateId || DEFAULT_REPORT_TEMPLATE_ID,
dailyReportRecordId: DEFAULT_STAFF_RECORD_ID,
baseSceneCode: BOUTIQUE_PAGE_CONTEXT.baseSceneCode,
fieldDataList,
jsonContent,
subformDataList: []
}
}
function ensureDetailRecord(params = {}) {
const { merchantId, staffUuid, reportDate, reportTemplateId } = params
if (!reportDate) return null
const storeKey = getStoreKey({ merchantId, staffUuid, reportDate })
let record = detailStore.get(storeKey)
if (!record) {
record = buildStaffSampleDetail({ reportTemplateId })
detailStore.set(storeKey, record)
}
return record
}
function initSampleDetail() {
const today = new Date()
const day = today.getDay()
const mondayOffset = day === 0 ? -6 : 1 - day
const monday = new Date(today)
monday.setDate(today.getDate() + mondayOffset)
const mondayStr = formatDate(monday)
const todayStr = formatDate(today)
;[mondayStr, todayStr].forEach(dateStr => {
const sampleKey = getStoreKey({
merchantId: 'mock',
staffUuid: 'mock',
reportDate: dateStr
})
if (!detailStore.has(sampleKey)) {
detailStore.set(sampleKey, buildStaffSampleDetail())
}
})
}
function delay(data, ms = 80) {
return new Promise(resolve => {
setTimeout(() => resolve(data), ms)
})
}
initSampleDetail()
function fetchMockDynamicDetail(params = {}) {
const { merchantId, staffUuid, reportDate, reportTemplateId } = params
const record = ensureDetailRecord({ merchantId, staffUuid, reportDate, reportTemplateId })
return delay({
code: 0,
message: 'ok',
data: {
id: record.id ?? record.dailyReportRecordId ?? null,
reportTemplateId: record.reportTemplateId || reportTemplateId || DEFAULT_REPORT_TEMPLATE_ID,
dailyReportRecordId: record.dailyReportRecordId || null,
baseSceneCode: record.baseSceneCode ?? BOUTIQUE_PAGE_CONTEXT.baseSceneCode,
fieldDataList: record.fieldDataList || [],
jsonContent: record.jsonContent || '',
subformDataList: record.subformDataList || []
}
})
}
function saveMockDynamicDetail(params = {}) {
const {
merchantId,
staffUuid,
reportDate,
reportTemplateId,
dailyReportRecordId,
fieldDataList,
jsonContent,
subformDataList
} = params
if (!reportDate) return null
const storeKey = getStoreKey({ merchantId, staffUuid, reportDate })
const prev = detailStore.get(storeKey) || buildStaffSampleDetail({ reportTemplateId })
const nextRecord = {
reportTemplateId: reportTemplateId || prev.reportTemplateId || DEFAULT_REPORT_TEMPLATE_ID,
id: dailyReportRecordId || prev.id || prev.dailyReportRecordId || Date.now(),
dailyReportRecordId: dailyReportRecordId || prev.dailyReportRecordId || Date.now(),
baseSceneCode: prev.baseSceneCode ?? BOUTIQUE_PAGE_CONTEXT.baseSceneCode,
fieldDataList: fieldDataList ?? prev.fieldDataList ?? [],
jsonContent: jsonContent ?? prev.jsonContent ?? '',
subformDataList: subformDataList ?? prev.subformDataList ?? []
}
detailStore.set(storeKey, nextRecord)
return nextRecord
}
module.exports = {
fetchMockDynamicDetail,
saveMockDynamicDetail,
buildStaffSampleDetail,
ensureDetailRecord,
DEFAULT_REPORT_TEMPLATE_ID,
fieldDataListToValues
}
const { DEFAULT_REPORT_TEMPLATE_ID: TEMPLATE_IDS } = require('../config/dailyReportConstants.js')
const detailStore = new Map()
const DEFAULT_REPORT_TEMPLATE_ID = TEMPLATE_IDS.negotiation
function formatDate(date) {
const y = date.getFullYear()
const m = `${date.getMonth() + 1}`.padStart(2, '0')
const d = `${date.getDate()}`.padStart(2, '0')
return `${y}-${m}-${d}`
}
function getStoreKey({ merchantId, staffUuid, reportDate }) {
return `${merchantId || '0'}:${staffUuid || '0'}:${reportDate}`
}
function delay(data, ms = 80) {
return new Promise(resolve => {
setTimeout(() => resolve(data), ms)
})
}
function fetchMockNegotiationDynamicDetail(params = {}) {
const { merchantId, staffUuid, reportDate, reportTemplateId } = params
const storeKey = getStoreKey({ merchantId, staffUuid, reportDate })
const record = detailStore.get(storeKey)
if (!record) {
return delay({
code: 0,
message: 'ok',
data: {
id: null,
reportTemplateId: reportTemplateId || DEFAULT_REPORT_TEMPLATE_ID,
dailyReportRecordId: null,
baseSceneCode: null,
fieldDataList: [],
subformDataList: [],
jsonContent: ''
}
})
}
return delay({
code: 0,
message: 'ok',
data: {
id: record.id ?? record.dailyReportRecordId ?? null,
reportTemplateId: record.reportTemplateId || reportTemplateId || DEFAULT_REPORT_TEMPLATE_ID,
dailyReportRecordId: record.dailyReportRecordId || null,
baseSceneCode: record.baseSceneCode ?? null,
fieldDataList: record.fieldDataList || [],
subformDataList: record.subformDataList || [],
jsonContent: record.jsonContent || ''
}
})
}
function saveMockNegotiationDynamicDetail(params = {}) {
const {
merchantId,
staffUuid,
reportDate,
reportTemplateId,
dailyReportRecordId,
fieldDataList,
subformDataList,
jsonContent
} = params
if (!reportDate) return null
const storeKey = getStoreKey({ merchantId, staffUuid, reportDate })
const prev = detailStore.get(storeKey) || {}
const nextRecord = {
reportTemplateId: reportTemplateId || prev.reportTemplateId || DEFAULT_REPORT_TEMPLATE_ID,
dailyReportRecordId: dailyReportRecordId || prev.dailyReportRecordId || Date.now(),
baseSceneCode: prev.baseSceneCode ?? null,
fieldDataList: fieldDataList ?? prev.fieldDataList ?? [],
subformDataList: subformDataList ?? prev.subformDataList ?? [],
jsonContent: jsonContent ?? prev.jsonContent ?? ''
}
detailStore.set(storeKey, nextRecord)
return nextRecord
}
module.exports = {
fetchMockNegotiationDynamicDetail,
saveMockNegotiationDynamicDetail,
DEFAULT_REPORT_TEMPLATE_ID
}
const { WARRANTY_PAGE_CONTEXT } = require('../fixtures/mock-meta.js')
const schemaIndexed = require('../fixtures/schema-store-daily-full.js')
const { buildMockDetailJsonContent } = require('./mockDetailJsonContent.js')
const { DEFAULT_REPORT_TEMPLATE_ID: TEMPLATE_IDS } = require('../config/dailyReportConstants.js')
const { parseRequestJsonLists } = require('../form-engine/save-request.js')
const detailStore = new Map()
const DEFAULT_REPORT_TEMPLATE_ID = TEMPLATE_IDS.store
function formatDate(date) {
const y = date.getFullYear()
const m = `${date.getMonth() + 1}`.padStart(2, '0')
const d = `${date.getDate()}`.padStart(2, '0')
return `${y}-${m}-${d}`
}
function getStoreKey({ merchantId, staffUuid, reportDate }) {
return `${merchantId || '0'}:${staffUuid || '0'}:${reportDate}`
}
function getWarrantySampleValues() {
return {
'F2-1': ['staff-001', 'staff-002'],
'F2-2': 3,
'F2-30': 5,
'F2-36': 2,
'F2-3': 4,
'F2-9': [
{
'F2-9-1': '4s-001',
'F2-9-2': 1,
'F2-9-3': 2,
'F2-9-4': 3,
'F2-9-5': 1,
'F2-9-6': 0,
'F2-9-7': 0,
'F2-9-8': 0
},
{
'F2-9-1': '4s-002',
'F2-9-2': 2,
'F2-9-3': 1,
'F2-9-4': 0,
'F2-9-5': 0,
'F2-9-6': 1,
'F2-9-7': 0,
'F2-9-8': 1
}
]
}
}
function valuesToFieldDataList(values = {}, schemaLabels = {}) {
const items = []
Object.keys(values).forEach(fieldKey => {
const fieldValue = values[fieldKey]
if (Array.isArray(fieldValue) && fieldValue.length && typeof fieldValue[0] === 'object') {
fieldValue.forEach((row, rowIndex) => {
Object.keys(row || {}).forEach(childKey => {
const childValue = row[childKey]
if (childValue === undefined || childValue === null || childValue === '') {
return
}
items.push({
groupKey: fieldKey,
rowIndex,
fieldKey: childKey,
fieldName: schemaLabels[childKey] || childKey,
fieldType: childKey.endsWith('-1') ? 'select' : 'numberInput',
fieldValue: childValue
})
})
})
return
}
items.push({
fieldKey,
fieldName: schemaLabels[fieldKey] || fieldKey,
fieldType: fieldKey === 'F2-1' ? 'multipleSelect' : fieldKey.endsWith('-1') ? 'select' : 'numberInput',
fieldValue
})
})
return items
}
function initSampleDetail() {
const today = new Date()
const day = today.getDay()
const mondayOffset = day === 0 ? -6 : 1 - day
const monday = new Date(today)
monday.setDate(today.getDate() + mondayOffset)
const mondayStr = formatDate(monday)
const sampleKey = getStoreKey({
merchantId: 'mock',
staffUuid: 'mock',
reportDate: mondayStr
})
if (!detailStore.has(sampleKey)) {
const values = getWarrantySampleValues()
detailStore.set(sampleKey, {
id: 91001,
reportTemplateId: DEFAULT_REPORT_TEMPLATE_ID,
dailyReportRecordId: 91001,
baseSceneCode: WARRANTY_PAGE_CONTEXT.baseSceneCode,
reportStatus: '0',
fieldDataList: valuesToFieldDataList(values),
subformDataList: [],
jsonContent: buildMockDetailJsonContent(schemaIndexed, values)
})
}
}
function delay(data, ms = 80) {
return new Promise(resolve => {
setTimeout(() => resolve(data), ms)
})
}
// initSampleDetail() — 联调空详情时不预置周一示例数据
function buildDefaultMockDetailData(reportTemplateId) {
return {
reportTemplateId: reportTemplateId || DEFAULT_REPORT_TEMPLATE_ID,
dailyReportRecordId: null,
baseSceneCode: WARRANTY_PAGE_CONTEXT.baseSceneCode,
reportStatus: '0',
fieldDataList: [],
subformDataList: [],
jsonContent: ''
}
}
function fetchMockStoreDynamicDetail(params = {}) {
const { merchantId, staffUuid, reportDate, reportTemplateId } = params
const storeKey = getStoreKey({ merchantId, staffUuid, reportDate })
const record = detailStore.get(storeKey)
if (!record) {
return delay({
code: 0,
message: 'ok',
data: buildDefaultMockDetailData(reportTemplateId)
})
}
return delay({
code: 0,
message: 'ok',
data: {
id: record.id ?? record.dailyReportRecordId ?? null,
reportTemplateId: record.reportTemplateId || reportTemplateId || DEFAULT_REPORT_TEMPLATE_ID,
dailyReportRecordId: record.dailyReportRecordId || null,
baseSceneCode: record.baseSceneCode ?? WARRANTY_PAGE_CONTEXT.baseSceneCode,
reportStatus: record.reportStatus ?? '0',
fieldDataList: record.fieldDataList || [],
subformDataList: record.subformDataList || [],
jsonContent: record.jsonContent || ''
}
})
}
function saveMockStoreDynamicDetail(params = {}) {
const {
merchantId,
staffUuid,
reportDate,
reportTemplateId,
dailyReportRecordId,
fieldDataList,
subformDataList,
requestJson,
jsonContent,
reportStatus
} = params
if (!reportDate) return null
const listsFromRequestJson =
requestJson != null && requestJson !== ''
? parseRequestJsonLists(requestJson)
: null
const storeKey = getStoreKey({ merchantId, staffUuid, reportDate })
const prev = detailStore.get(storeKey) || {}
const nextRecord = {
reportTemplateId: reportTemplateId || prev.reportTemplateId || DEFAULT_REPORT_TEMPLATE_ID,
dailyReportRecordId: dailyReportRecordId || prev.dailyReportRecordId || Date.now(),
baseSceneCode: prev.baseSceneCode ?? WARRANTY_PAGE_CONTEXT.baseSceneCode,
reportStatus: reportStatus != null ? String(reportStatus) : prev.reportStatus ?? '0',
fieldDataList:
fieldDataList ??
listsFromRequestJson?.fieldDataList ??
prev.fieldDataList ??
[],
subformDataList:
subformDataList ??
listsFromRequestJson?.subformDataList ??
prev.subformDataList ??
[],
jsonContent: jsonContent ?? prev.jsonContent ?? ''
}
detailStore.set(storeKey, nextRecord)
return nextRecord
}
module.exports = {
fetchMockStoreDynamicDetail,
saveMockStoreDynamicDetail,
DEFAULT_REPORT_TEMPLATE_ID
}
/**
* 洽谈明细 adapter — mock/real 与缓存
* @see packageDynamicForm/docs/ARCHITECTURE.md
*
* fetchDetailAdapter:detail.get templateType=3
* fetchWeeklyAdapter:weekly.list templateType=3
* 默认 apiSwitch 多数 mock;weekly/scene/save 常为 real
*/
const { isNegotiationMockMode, isNegotiationSaveEchoEnabled } = require('../config/apiSwitch.js')
function requireNegotiationSchemaTemplate() {
return require('../fixtures/schema-negotiation-full.js')
}
function requireMockMerchantSceneList() {
return require('../fixtures/mock-meta.js').MOCK_MERCHANT_SCENE_LIST
}
function requireMockNegotiationDynamicDetail() {
return require('./mockNegotiationDynamicDetail.js')
}
const {
getCachedScene,
setCachedScene,
getCachedSchema,
setCachedSchema,
getCachedBrand,
setCachedBrand
} = require('./negotiationDailyReportCache.js')
const {
fetchConfigCenterTemplate,
normalizeConfigToSchemaRoot,
DYNAMIC_FORM_TEMPLATE_MODULE
} = require('../config/configCenter.js')
const { DAILY_REPORT_TEMPLATE_TYPE } = require('../config/dailyReportConstants.js')
const MOCK_DISCUSSION_STAFF_LIST = [
{ staffName: '张三', staffUuid: 'uuid-staff-001' },
{ staffName: '李四', staffUuid: 'uuid-staff-002' },
{ staffName: '王五', staffUuid: 'uuid-staff-003' }
]
/** 洽谈 brand=mock:问界 / 岚图 / 宝马(3454 / 3067 / 2161) */
const MOCK_NEGOTIATION_OPERATING_BRAND_LIST = [
{ brandId: 3454, id: 3454, name: 'AITO', firstBrandId: 3454 },
{ brandId: 3067, id: 3067, name: '岚图汽车', firstBrandId: 3067 },
{ brandId: 2161, id: 2161, name: '宝马', firstBrandId: 2161 }
]
let fetchMerchantOperatingBrandListOverride = null
/** 测试注入:覆盖经营品牌 fetcher */
function __setFetchMerchantOperatingBrandList(fetcher) {
fetchMerchantOperatingBrandListOverride = fetcher
}
/** 配置中心原始数据 → 标准 schema root 响应 */
function resolveSchemaRootResult(rawData) {
return {
code: 0,
message: 'ok',
data: normalizeConfigToSchemaRoot(rawData)
}
}
/** 周历列表兜底为数组 */
function normalizeWeeklyListData(data) {
return Array.isArray(data) ? data : []
}
let dynamicDailyReportApiModule = null
/** 懒加载 dynamicDailyReport API 模块 */
function getDynamicDailyReportApi() {
if (!dynamicDailyReportApiModule) {
dynamicDailyReportApiModule = require('./dynamicDailyReport.js')
}
return dynamicDailyReportApiModule
}
/** 测试注入:覆盖 dynamicDailyReport API 模块 */
function __setDynamicDailyReportApi(api) {
dynamicDailyReportApiModule = api
}
/**
* 拉取洽谈明细详情(mock 或 detail.get templateType=3)
* @param {Object} [params={}] merchantId、staffUuid、reportDate 等
* @returns {Promise<{code: number, message: string, data: Object}>}
*/
async function fetchDetailAdapter(params = {}) {
if (isNegotiationMockMode('detail')) {
return requireMockNegotiationDynamicDetail().fetchMockNegotiationDynamicDetail(params)
}
const { dailyReportDetailGet } = getDynamicDailyReportApi()
const { merchantId, staffUuid, reportDate } = params
return dailyReportDetailGet({
merchantId,
staffUuid,
reportDate,
templateType: DAILY_REPORT_TEMPLATE_TYPE.negotiation
})
}
/**
* 拉取洽谈 schema 根节点(mock fixture 或配置中心 negotiation-details-template + schemaCache)
* @param {Object} [params={}] reportTemplateId、baseSceneCode、merchantId
* @returns {Promise<{code: number, message: string, data: Object}>}
*/
async function fetchSchemaRootAdapter(params = {}) {
const { reportTemplateId, baseSceneCode, merchantId } = params
if (isNegotiationMockMode('schema')) {
return resolveSchemaRootResult(requireNegotiationSchemaTemplate())
}
const moduleUrl = DYNAMIC_FORM_TEMPLATE_MODULE.negotiation
const cached = getCachedSchema(moduleUrl, baseSceneCode)
if (cached) {
return cached
}
const result = await fetchConfigCenterTemplate(moduleUrl)
const resolved = resolveSchemaRootResult(result.data)
setCachedSchema(moduleUrl, baseSceneCode, resolved)
return resolved
}
/**
* 拉取门店场景列表(mock 或 findAllSceneByMerchantId + sceneCache)
* @param {Object} [params={}] merchantId
* @returns {Promise<{code: number, message: string, data: Array}>}
*/
async function fetchSceneAdapter(params = {}) {
const { merchantId } = params
if (isNegotiationMockMode('scene')) {
return {
code: 0,
message: 'ok',
data: requireMockMerchantSceneList()
}
}
const cached = getCachedScene(merchantId)
if (cached) {
return cached
}
const { findAllSceneByMerchantId } = getDynamicDailyReportApi()
const result = await findAllSceneByMerchantId({ merchantId })
setCachedScene(merchantId, result)
return result
}
/**
* 拉取门店经营品牌(mock 注入 carBrandApi 或 real + brandCache;key=merchantId,进程内复用)
* @param {Object} [params={}] merchantId
* @returns {Promise<{code: number, message: string, data: Array}>}
*/
async function fetchBrandAdapter(params = {}) {
const runFetch = async () => {
const fetcher =
fetchMerchantOperatingBrandListOverride ||
(id => {
const { fetchMerchantOperatingBrandList } = require('./carBrandApi.js')
return fetchMerchantOperatingBrandList(id)
})
return fetcher(params.merchantId)
}
if (isNegotiationMockMode('brand')) {
return { code: 0, message: 'ok', data: MOCK_NEGOTIATION_OPERATING_BRAND_LIST }
}
const { merchantId } = params
const cached = getCachedBrand(merchantId)
if (cached) {
return cached
}
const result = await runFetch()
setCachedBrand(merchantId, result)
return result
}
/**
* 拉取周历提交标记(mock 空数组或 weekly.list templateType=3)
* @param {Object} [params={}] merchantId、staffUuid、reportStartDate、reportEndDate
* @returns {Promise<{code: number, message: string, data: Array}>}
*/
async function fetchWeeklyAdapter(params = {}) {
if (isNegotiationMockMode('weekly')) {
return { code: 0, message: 'ok', data: [] }
}
const { dailyReportWeeklyList } = getDynamicDailyReportApi()
const {
merchantId,
staffUuid,
reportStartDate,
reportEndDate,
templateType = DAILY_REPORT_TEMPLATE_TYPE.negotiation
} = params
const result = await dailyReportWeeklyList({
merchantId,
staffUuid,
templateType,
reportStartDate,
reportEndDate
})
if (result?.code != 0) {
return result
}
return {
...result,
data: normalizeWeeklyListData(result.data)
}
}
/**
* 查询洽谈明细驻店人员名单(mock 或 discussion.staff.list)
* @param {Object} [params={}] merchantId、reportDate
* @returns {Promise<{code: number, message: string, data: Array}>}
*/
async function fetchDiscussionStaffListAdapter(params = {}) {
if (isNegotiationMockMode('discussionStaffList')) {
return {
code: 0,
message: 'ok',
data: MOCK_DISCUSSION_STAFF_LIST
}
}
const { dailyReportDiscussionStaffList } = getDynamicDailyReportApi()
const { merchantId, reportDate } = params
const result = await dailyReportDiscussionStaffList({ merchantId, reportDate })
if (result?.code != 0) {
return result
}
const data = Array.isArray(result.data) ? result.data : []
return {
...result,
data
}
}
/**
* 提交成功后 mock 本地回显(saveEcho=mock 时写入 mock detail)
* @param {Object} [params={}] 保存参数与 jsonContent
* @returns {Object|null} 回显记录,未启用时返回 null
*/
function saveEchoAdapter(params = {}) {
if (!isNegotiationSaveEchoEnabled()) {
return null
}
return requireMockNegotiationDynamicDetail().saveMockNegotiationDynamicDetail(params)
}
module.exports = {
fetchDetailAdapter,
fetchSchemaRootAdapter,
fetchSceneAdapter,
fetchBrandAdapter,
fetchWeeklyAdapter,
fetchDiscussionStaffListAdapter,
saveEchoAdapter,
getDynamicDailyReportApi,
__setDynamicDailyReportApi,
__setFetchMerchantOperatingBrandList,
MOCK_DISCUSSION_STAFF_LIST
}
/**
* 洽谈明细进程内缓存 — scene / schema / brand
* key:scene/brand=merchantId;schema=reportTemplateId:baseSceneCode
*/
const sceneCache = new Map()
const schemaCache = new Map()
const brandCache = new Map()
/**
* 生成 schema 缓存键
* @param {number|string} reportTemplateId 模板 ID
* @param {string} baseSceneCode 门店场景编码
* @returns {string}
*/
function getSchemaCacheKey(reportTemplateId, baseSceneCode) {
return `${reportTemplateId || ''}:${baseSceneCode || ''}`
}
/**
* 读取门店场景缓存
* @param {string|number} merchantId 门店 ID
* @returns {Object|null} 缓存的 API 响应
*/
function getCachedScene(merchantId) {
if (!merchantId) return null
return sceneCache.get(merchantId) || null
}
/**
* 写入门店场景缓存
* @param {string|number} merchantId 门店 ID
* @param {Object} value API 响应
* @returns {void}
*/
function setCachedScene(merchantId, value) {
if (!merchantId) return
sceneCache.set(merchantId, value)
}
/**
* 读取 schema 根节点缓存
* @param {number|string} reportTemplateId 模板 ID(或 moduleUrl)
* @param {string} baseSceneCode 门店场景编码
* @returns {Object|null} 缓存的 schema root 响应
*/
function getCachedSchema(reportTemplateId, baseSceneCode) {
return schemaCache.get(getSchemaCacheKey(reportTemplateId, baseSceneCode)) || null
}
/**
* 写入 schema 根节点缓存
* @param {number|string} reportTemplateId 模板 ID(或 moduleUrl)
* @param {string} baseSceneCode 门店场景编码
* @param {Object} value schema root 响应
* @returns {void}
*/
function setCachedSchema(reportTemplateId, baseSceneCode, value) {
schemaCache.set(getSchemaCacheKey(reportTemplateId, baseSceneCode), value)
}
/**
* 读取经营品牌缓存
* @param {string|number} merchantId 门店 ID
* @returns {Object|null} 缓存的品牌 API 响应
*/
function getCachedBrand(merchantId) {
if (!merchantId) return null
return brandCache.get(merchantId) || null
}
/**
* 写入经营品牌缓存
* @param {string|number} merchantId 门店 ID
* @param {Object} value 品牌 API 响应
* @returns {void}
*/
function setCachedBrand(merchantId, value) {
if (!merchantId) return
brandCache.set(merchantId, value)
}
/**
* 清空洽谈明细全部进程内缓存
* @returns {void}
*/
function clearNegotiationDailyReportCache() {
sceneCache.clear()
schemaCache.clear()
brandCache.clear()
}
module.exports = {
getSchemaCacheKey,
getCachedScene,
setCachedScene,
getCachedSchema,
setCachedSchema,
getCachedBrand,
setCachedBrand,
clearNegotiationDailyReportCache
}
/**
* 驻店日报 adapter — mock/real 与缓存
* @see packageDynamicForm/docs/ARCHITECTURE.md
*
* fetchDetailAdapter:detail.get templateType=1
* fetchSchemaRootAdapter:配置中心 staff-daily-template + schemaCache
* fetchSceneAdapter / fetchBrandAdapter:sceneCache、brandCache(key=merchantId)
* 联调:isStaffMockMode(../config/apiSwitch.js STAFF_DAILY_API_SWITCH)
*/
const { isStaffMockMode, isStaffSaveEchoEnabled } = require('../config/apiSwitch.js')
const {
getCachedScene,
setCachedScene,
getCachedSchema,
setCachedSchema,
getCachedBrand,
setCachedBrand
} = require('./staffDailyReportCache.js')
const {
fetchConfigCenterTemplate,
normalizeConfigToSchemaRoot,
DYNAMIC_FORM_TEMPLATE_MODULE
} = require('../config/configCenter.js')
const { DAILY_REPORT_TEMPLATE_TYPE } = require('../config/dailyReportConstants.js')
let fetchMerchantOperatingBrandListOverride = null
function requireStaffSchemaTemplate() {
return require('../fixtures/schema-staff-daily-full.js')
}
function requireMockMerchantSceneList() {
return require('../fixtures/mock-meta.js').MOCK_MERCHANT_SCENE_LIST
}
function requireMockMerchantCarBrandResponse() {
return require('../fixtures/mock-merchant-brand-api.js').MOCK_MERCHANT_CAR_BRAND_API_RESPONSE
}
function requireMockDynamicDetail() {
return require('./mockDynamicDetail.js')
}
/** 测试注入:覆盖经营品牌 fetcher */
function __setFetchMerchantOperatingBrandList(fetcher) {
fetchMerchantOperatingBrandListOverride = fetcher
}
/** 配置中心原始数据 → 标准 schema root 响应 */
function resolveSchemaRootResult(rawData) {
return {
code: 0,
message: 'ok',
data: normalizeConfigToSchemaRoot(rawData)
}
}
/** 周历列表兜底为数组 */
function normalizeWeeklyListData(data) {
return Array.isArray(data) ? data : []
}
let dynamicDailyReportApiModule = null
/** 懒加载 dynamicDailyReport API 模块 */
function getDynamicDailyReportApi() {
if (!dynamicDailyReportApiModule) {
dynamicDailyReportApiModule = require('./dynamicDailyReport.js')
}
return dynamicDailyReportApiModule
}
/** 测试注入:覆盖 dynamicDailyReport API 模块 */
function __setDynamicDailyReportApi(api) {
dynamicDailyReportApiModule = api
}
/**
* 拉取驻店日报详情(mock 或 detail.get templateType=1)
* @param {Object} [params={}] merchantId、staffUuid、reportDate 等
* @returns {Promise<{code: number, message: string, data: Object}>}
*/
async function fetchDetailAdapter(params = {}) {
if (isStaffMockMode('detail')) {
return requireMockDynamicDetail().fetchMockDynamicDetail(params)
}
const { dailyReportDetailGet } = getDynamicDailyReportApi()
const { merchantId, staffUuid, reportDate } = params
return dailyReportDetailGet({
merchantId,
staffUuid,
reportDate,
templateType: DAILY_REPORT_TEMPLATE_TYPE.staff
})
}
/**
* 拉取驻店 schema 根节点(mock fixture 或配置中心 + schemaCache)
* @param {Object} [params={}] baseSceneCode 等
* @returns {Promise<{code: number, message: string, data: Object}>}
*/
async function fetchSchemaRootAdapter(params = {}) {
const { baseSceneCode } = params
if (isStaffMockMode('schema')) {
return resolveSchemaRootResult(requireStaffSchemaTemplate())
}
const moduleUrl = DYNAMIC_FORM_TEMPLATE_MODULE.staff
const cached = getCachedSchema(moduleUrl, baseSceneCode)
if (cached) {
return cached
}
const result = await fetchConfigCenterTemplate(moduleUrl)
const resolved = resolveSchemaRootResult(result.data)
setCachedSchema(moduleUrl, baseSceneCode, resolved)
return resolved
}
/**
* 拉取门店场景列表(mock 或 findAllSceneByMerchantId + sceneCache)
* @param {Object} [params={}] merchantId
* @returns {Promise<{code: number, message: string, data: Array}>}
*/
async function fetchSceneAdapter(params = {}) {
const { merchantId } = params
if (isStaffMockMode('scene')) {
return {
code: 0,
message: 'ok',
data: requireMockMerchantSceneList()
}
}
const cached = getCachedScene(merchantId)
if (cached) {
return cached
}
const { findAllSceneByMerchantId } = getDynamicDailyReportApi()
const result = await findAllSceneByMerchantId({ merchantId })
setCachedScene(merchantId, result)
return result
}
/**
* 拉取门店经营品牌(mock 或 carBrandApi + brandCache,key=merchantId,切日期复用)
* @param {Object} [params={}] merchantId
* @returns {Promise<{code: number, message: string, data: Array}>}
*/
async function fetchBrandAdapter(params = {}) {
const runFetch = async () => {
const fetcher =
fetchMerchantOperatingBrandListOverride ||
(id => {
const { fetchMerchantOperatingBrandList } = require('./carBrandApi.js')
return fetchMerchantOperatingBrandList(id)
})
return fetcher(params.merchantId)
}
if (isStaffMockMode('brand')) {
const carBrandApi = require('./carBrandApi.js')
carBrandApi.__setGetMerchantCarBrandList(() =>
Promise.resolve(requireMockMerchantCarBrandResponse())
)
try {
return await runFetch()
} finally {
carBrandApi.__setGetMerchantCarBrandList(null)
}
}
const { merchantId } = params
const cached = getCachedBrand(merchantId)
if (cached) {
return cached
}
const result = await runFetch()
setCachedBrand(merchantId, result)
return result
}
/**
* 拉取周历提交标记(mock 空数组或 weekly.list templateType=1)
* @param {Object} [params={}] merchantId、staffUuid、reportStartDate、reportEndDate
* @returns {Promise<{code: number, message: string, data: Array}>}
*/
async function fetchWeeklyAdapter(params = {}) {
if (isStaffMockMode('weekly')) {
return { code: 0, message: 'ok', data: [] }
}
const { dailyReportWeeklyList } = getDynamicDailyReportApi()
const {
merchantId,
staffUuid,
reportStartDate,
reportEndDate,
templateType = DAILY_REPORT_TEMPLATE_TYPE.staff
} = params
const result = await dailyReportWeeklyList({
merchantId,
staffUuid,
templateType,
reportStartDate,
reportEndDate
})
if (result?.code != 0) {
return result
}
return {
...result,
data: normalizeWeeklyListData(result.data)
}
}
/**
* 提交成功后 mock 本地回显(saveEcho=mock 时写入 mock detail)
* @param {Object} [params={}] 保存参数与 jsonContent
* @returns {Object|null} 回显记录,未启用时返回 null
*/
function saveEchoAdapter(params = {}) {
if (!isStaffSaveEchoEnabled()) {
return null
}
return requireMockDynamicDetail().saveMockDynamicDetail(params)
}
module.exports = {
fetchDetailAdapter,
fetchSchemaRootAdapter,
fetchSceneAdapter,
fetchBrandAdapter,
fetchWeeklyAdapter,
saveEchoAdapter,
getDynamicDailyReportApi,
__setDynamicDailyReportApi,
__setFetchMerchantOperatingBrandList
}
/**
* 驻店日报进程内缓存 — scene / schema / brand
* key:scene/brand=merchantId;schema=reportTemplateId:baseSceneCode
*/
const sceneCache = new Map()
const schemaCache = new Map()
const brandCache = new Map()
/**
* 生成 schema 缓存键
* @param {number|string} reportTemplateId 模板 ID
* @param {string} baseSceneCode 门店场景编码
* @returns {string}
*/
function getSchemaCacheKey(reportTemplateId, baseSceneCode) {
return `${reportTemplateId || ''}:${baseSceneCode || ''}`
}
/**
* 读取门店场景缓存
* @param {string|number} merchantId 门店 ID
* @returns {Object|null} 缓存的 API 响应
*/
function getCachedScene(merchantId) {
if (!merchantId) return null
return sceneCache.get(merchantId) || null
}
/**
* 写入门店场景缓存
* @param {string|number} merchantId 门店 ID
* @param {Object} value API 响应
* @returns {void}
*/
function setCachedScene(merchantId, value) {
if (!merchantId) return
sceneCache.set(merchantId, value)
}
/**
* 读取 schema 根节点缓存
* @param {number|string} reportTemplateId 模板 ID(或 moduleUrl)
* @param {string} baseSceneCode 门店场景编码
* @returns {Object|null} 缓存的 schema root 响应
*/
function getCachedSchema(reportTemplateId, baseSceneCode) {
return schemaCache.get(getSchemaCacheKey(reportTemplateId, baseSceneCode)) || null
}
/**
* 写入 schema 根节点缓存
* @param {number|string} reportTemplateId 模板 ID(或 moduleUrl)
* @param {string} baseSceneCode 门店场景编码
* @param {Object} value schema root 响应
* @returns {void}
*/
function setCachedSchema(reportTemplateId, baseSceneCode, value) {
schemaCache.set(getSchemaCacheKey(reportTemplateId, baseSceneCode), value)
}
/**
* 读取经营品牌缓存
* @param {string|number} merchantId 门店 ID
* @returns {Object|null} 缓存的品牌 API 响应
*/
function getCachedBrand(merchantId) {
if (!merchantId) return null
return brandCache.get(merchantId) || null
}
/**
* 写入经营品牌缓存
* @param {string|number} merchantId 门店 ID
* @param {Object} value 品牌 API 响应
* @returns {void}
*/
function setCachedBrand(merchantId, value) {
if (!merchantId) return
brandCache.set(merchantId, value)
}
/**
* 清空驻店日报全部进程内缓存
* @returns {void}
*/
function clearStaffDailyReportCache() {
sceneCache.clear()
schemaCache.clear()
brandCache.clear()
}
module.exports = {
getSchemaCacheKey,
getCachedScene,
setCachedScene,
getCachedSchema,
setCachedSchema,
getCachedBrand,
setCachedBrand,
clearStaffDailyReportCache
}
/**
* 门店日报 adapter — mock/real 与缓存
* @see packageDynamicForm/docs/ARCHITECTURE.md
*
* fetchDetailAdapter:detail.get templateType=2
* fetchSchemaRootAdapter:store-daily-template + schemaCache
* fetchBrandAdapter:brandCache,切日期不重复 merchant.info
* saveDraftAdapter:dynamic.draft.save(saveEcho 控制 mock 回显)
*/
const { isStoreMockMode, isStoreSaveEchoEnabled } = require('../config/apiSwitch.js')
function requireStoreSchemaTemplate() {
return require('../fixtures/schema-store-daily-full.js')
}
function requireMockMerchantSceneList() {
return require('../fixtures/mock-meta.js').MOCK_MERCHANT_SCENE_LIST
}
function requireMockMerchantCarBrandResponse() {
return require('../fixtures/mock-merchant-brand-api.js').MOCK_MERCHANT_CAR_BRAND_API_RESPONSE
}
function requireMockStoreDynamicDetail() {
return require('./mockStoreDynamicDetail.js')
}
const {
getCachedScene,
setCachedScene,
getCachedSchema,
setCachedSchema,
getCachedBrand,
setCachedBrand
} = require('./storeDailyReportCache.js')
const {
fetchConfigCenterTemplate,
normalizeConfigToSchemaRoot,
DYNAMIC_FORM_TEMPLATE_MODULE
} = require('../config/configCenter.js')
const { DAILY_REPORT_TEMPLATE_TYPE } = require('../config/dailyReportConstants.js')
let fetchMerchantOperatingBrandListOverride = null
/** 测试注入:覆盖经营品牌 fetcher */
function __setFetchMerchantOperatingBrandList(fetcher) {
fetchMerchantOperatingBrandListOverride = fetcher
}
/** 配置中心原始数据 → 标准 schema root 响应 */
function resolveSchemaRootResult(rawData) {
return {
code: 0,
message: 'ok',
data: normalizeConfigToSchemaRoot(rawData)
}
}
/** 周历列表兜底为数组 */
function normalizeWeeklyListData(data) {
return Array.isArray(data) ? data : []
}
let dynamicDailyReportApiModule = null
/** 懒加载 dynamicDailyReport API 模块 */
function getDynamicDailyReportApi() {
if (!dynamicDailyReportApiModule) {
dynamicDailyReportApiModule = require('./dynamicDailyReport.js')
}
return dynamicDailyReportApiModule
}
/** 测试注入:覆盖 dynamicDailyReport API 模块 */
function __setDynamicDailyReportApi(api) {
dynamicDailyReportApiModule = api
}
/**
* 拉取门店日报详情(mock 或 detail.get templateType=2)
* @param {Object} [params={}] merchantId、staffUuid、reportDate 等
* @returns {Promise<{code: number, message: string, data: Object}>}
*/
async function fetchDetailAdapter(params = {}) {
if (isStoreMockMode('detail')) {
return requireMockStoreDynamicDetail().fetchMockStoreDynamicDetail(params)
}
const { dailyReportDetailGet } = getDynamicDailyReportApi()
const { merchantId, staffUuid, reportDate } = params
return dailyReportDetailGet({
merchantId,
staffUuid,
reportDate,
templateType: DAILY_REPORT_TEMPLATE_TYPE.store
})
}
/**
* 拉取门店 schema 根节点(mock fixture 或配置中心 + schemaCache)
* @param {Object} [params={}] reportTemplateId、baseSceneCode、merchantId
* @returns {Promise<{code: number, message: string, data: Object}>}
*/
async function fetchSchemaRootAdapter(params = {}) {
const { reportTemplateId, baseSceneCode, merchantId } = params
if (isStoreMockMode('schema')) {
return resolveSchemaRootResult(requireStoreSchemaTemplate())
}
const moduleUrl = DYNAMIC_FORM_TEMPLATE_MODULE.store
const cached = getCachedSchema(moduleUrl, baseSceneCode)
if (cached) {
return cached
}
const result = await fetchConfigCenterTemplate(moduleUrl)
const resolved = resolveSchemaRootResult(result.data)
setCachedSchema(moduleUrl, baseSceneCode, resolved)
return resolved
}
/**
* 拉取门店场景列表(mock 或 findAllSceneByMerchantId + sceneCache)
* @param {Object} [params={}] merchantId
* @returns {Promise<{code: number, message: string, data: Array}>}
*/
async function fetchSceneAdapter(params = {}) {
const { merchantId } = params
if (isStoreMockMode('scene')) {
return {
code: 0,
message: 'ok',
data: requireMockMerchantSceneList()
}
}
const cached = getCachedScene(merchantId)
if (cached) {
return cached
}
const { findAllSceneByMerchantId } = getDynamicDailyReportApi()
const result = await findAllSceneByMerchantId({ merchantId })
setCachedScene(merchantId, result)
return result
}
/**
* 拉取门店经营品牌(mock 或 carBrandApi + brandCache,key=merchantId,同门店切日期不重复请求)
* @param {Object} [params={}] merchantId
* @returns {Promise<{code: number, message: string, data: Array}>}
*/
async function fetchBrandAdapter(params = {}) {
const runFetch = async () => {
const fetcher =
fetchMerchantOperatingBrandListOverride ||
(id => {
const { fetchMerchantOperatingBrandList } = require('./carBrandApi.js')
return fetchMerchantOperatingBrandList(id)
})
return fetcher(params.merchantId)
}
if (isStoreMockMode('brand')) {
const carBrandApi = require('./carBrandApi.js')
carBrandApi.__setGetMerchantCarBrandList(() =>
Promise.resolve(requireMockMerchantCarBrandResponse())
)
try {
return await runFetch()
} finally {
carBrandApi.__setGetMerchantCarBrandList(null)
}
}
const { merchantId } = params
const cached = getCachedBrand(merchantId)
if (cached) {
return cached
}
const result = await runFetch()
setCachedBrand(merchantId, result)
return result
}
/**
* 拉取周历提交标记(mock 空数组或 weekly.list templateType=2)
* @param {Object} [params={}] merchantId、staffUuid、reportStartDate、reportEndDate
* @returns {Promise<{code: number, message: string, data: Array}>}
*/
async function fetchWeeklyAdapter(params = {}) {
if (isStoreMockMode('weekly')) {
return { code: 0, message: 'ok', data: [] }
}
const { dailyReportWeeklyList } = getDynamicDailyReportApi()
const {
merchantId,
staffUuid,
reportStartDate,
reportEndDate,
templateType = DAILY_REPORT_TEMPLATE_TYPE.store
} = params
const result = await dailyReportWeeklyList({
merchantId,
staffUuid,
templateType,
reportStartDate,
reportEndDate
})
if (result?.code != 0) {
return result
}
return {
...result,
data: normalizeWeeklyListData(result.data)
}
}
/**
* 提交成功后 mock 本地回显(saveEcho=mock 时写入 mock detail,reportStatus='1')
* @param {Object} [params={}] 保存参数与 jsonContent
* @returns {Object|null} 回显记录,未启用时返回 null
*/
function saveEchoAdapter(params = {}) {
if (!isStoreSaveEchoEnabled()) {
return null
}
return requireMockStoreDynamicDetail().saveMockStoreDynamicDetail({
...params,
reportStatus: '1'
})
}
/**
* 保存门店日报草稿(mock reportStatus='0' 或 dynamic.draft.save)
* @param {Object} [params={}] buildDailyReportSaveRequest 产出的请求体
* @returns {Promise<{code: number, message: string, data: Object}>}
*/
async function saveDraftAdapter(params = {}) {
if (isStoreMockMode('save')) {
const saved = requireMockStoreDynamicDetail().saveMockStoreDynamicDetail({
...params,
reportStatus: '0'
})
return {
code: 0,
message: 'ok',
data: {
dailyReportRecordId: saved?.dailyReportRecordId || params.dailyReportRecordId || null
}
}
}
const { dynamicDailyReportDraftSave } = getDynamicDailyReportApi()
return dynamicDailyReportDraftSave(params)
}
const MOCK_MONTHLY_PENDING_COUNT = 12
/**
* 拉取门店本月待邀约数(mock 或 monthly.pending.count POST)
* @param {Object} [params={}] merchantId、reportDate
* @returns {Promise<{code: number, message: string, data: { pendingCount: number }|null}>}
*/
async function fetchMonthlyPendingCountAdapter(params = {}) {
if (isStoreMockMode('monthlyPendingCount')) {
return {
code: 0,
message: 'ok',
data: { pendingCount: MOCK_MONTHLY_PENDING_COUNT }
}
}
const { dailyReportMonthlyPendingCountGet } = getDynamicDailyReportApi()
return dailyReportMonthlyPendingCountGet(params)
}
/**
* 从 monthly.pending 接口 data 提取待邀约数(兼容 pendingcount / pendingCount / pending_count / 标量)
* @param {*} data
* @returns {number|undefined}
*/
function extractPendingCountFromResponseData(data) {
if (data == null || data === '') {
return undefined
}
if (typeof data === 'number') {
return data
}
if (typeof data === 'string' && data.trim() !== '') {
const parsed = Number(data)
return Number.isFinite(parsed) ? parsed : undefined
}
if (typeof data === 'object') {
const raw =
data.pendingCount ??
data.pending_count ??
data.pendingcount
if (raw == null || raw === '') {
return undefined
}
const parsed = typeof raw === 'number' ? raw : Number(raw)
return Number.isFinite(parsed) ? parsed : undefined
}
return undefined
}
/**
* 归一 monthly.pending 响应为 { code, message, data: { pendingCount } }
* @param {Object} [result={}]
* @returns {{code: number, message: string, data: { pendingCount: number }|null}}
*/
function normalizeMonthlyPendingCountResponse(result = {}) {
if (result.code != 0) {
return {
code: result.code ?? -1,
message: result.message || '请求失败',
data: null
}
}
const pendingCount = extractPendingCountFromResponseData(result.data)
if (!Number.isFinite(pendingCount)) {
return { code: -1, message: '待邀约数无效', data: null }
}
return {
code: 0,
message: 'ok',
data: { pendingCount }
}
}
module.exports = {
fetchDetailAdapter,
fetchSchemaRootAdapter,
fetchSceneAdapter,
fetchBrandAdapter,
fetchWeeklyAdapter,
saveEchoAdapter,
saveDraftAdapter,
fetchMonthlyPendingCountAdapter,
extractPendingCountFromResponseData,
normalizeMonthlyPendingCountResponse,
getDynamicDailyReportApi,
__setDynamicDailyReportApi,
__setFetchMerchantOperatingBrandList
}
/**
* 门店日报进程内缓存 — scene / schema / brand
* key:scene/brand=merchantId;schema=reportTemplateId:baseSceneCode
*/
const sceneCache = new Map()
const schemaCache = new Map()
const brandCache = new Map()
/**
* 生成 schema 缓存键
* @param {number|string} reportTemplateId 模板 ID
* @param {string} baseSceneCode 门店场景编码
* @returns {string}
*/
function getSchemaCacheKey(reportTemplateId, baseSceneCode) {
return `${reportTemplateId || ''}:${baseSceneCode || ''}`
}
/**
* 读取门店场景缓存
* @param {string|number} merchantId 门店 ID
* @returns {Object|null} 缓存的 API 响应
*/
function getCachedScene(merchantId) {
if (!merchantId) return null
return sceneCache.get(merchantId) || null
}
/**
* 写入门店场景缓存
* @param {string|number} merchantId 门店 ID
* @param {Object} value API 响应
* @returns {void}
*/
function setCachedScene(merchantId, value) {
if (!merchantId) return
sceneCache.set(merchantId, value)
}
/**
* 读取 schema 根节点缓存
* @param {number|string} reportTemplateId 模板 ID(或 moduleUrl)
* @param {string} baseSceneCode 门店场景编码
* @returns {Object|null} 缓存的 schema root 响应
*/
function getCachedSchema(reportTemplateId, baseSceneCode) {
return schemaCache.get(getSchemaCacheKey(reportTemplateId, baseSceneCode)) || null
}
/**
* 写入 schema 根节点缓存
* @param {number|string} reportTemplateId 模板 ID(或 moduleUrl)
* @param {string} baseSceneCode 门店场景编码
* @param {Object} value schema root 响应
* @returns {void}
*/
function setCachedSchema(reportTemplateId, baseSceneCode, value) {
schemaCache.set(getSchemaCacheKey(reportTemplateId, baseSceneCode), value)
}
/**
* 读取经营品牌缓存
* @param {string|number} merchantId 门店 ID
* @returns {Object|null} 缓存的品牌 API 响应
*/
function getCachedBrand(merchantId) {
if (!merchantId) return null
return brandCache.get(merchantId) || null
}
/**
* 写入经营品牌缓存
* @param {string|number} merchantId 门店 ID
* @param {Object} value 品牌 API 响应
* @returns {void}
*/
function setCachedBrand(merchantId, value) {
if (!merchantId) return
brandCache.set(merchantId, value)
}
/**
* 清空门店日报全部进程内缓存
* @returns {void}
*/
function clearStoreDailyReportCache() {
sceneCache.clear()
schemaCache.clear()
brandCache.clear()
}
module.exports = {
getSchemaCacheKey,
getCachedScene,
setCachedScene,
getCachedSchema,
setCachedSchema,
getCachedBrand,
setCachedBrand,
clearStoreDailyReportCache
}
/**
* 动态表单壳组件 — 按 type 分发 form-field-*
* @see packageDynamicForm/docs/ARCHITECTURE.md
*
* 接收 engine 输出的 fixedFields / sectionGroups / groupFields / values
* requestContext 透传给 select、multipleSelect 的 optionsKey 拉取
*/
const { buildFixedFieldBlocks } = require('../../form-engine/fixed-field-layout.js')
const { getFieldComponentMap } = require('../../form-engine/field-types/registry.js')
/** 字段 type → 组件名(registry 与内置 map 合并) */
const FIELD_COMPONENT_MAP = getFieldComponentMap()
Component({
properties: {
fixedFields: {
type: Array,
value: []
},
sectionGroups: {
type: Array,
value: []
},
groupFields: {
type: Array,
value: []
},
values: {
type: Object,
value: {}
},
errors: {
type: Object,
value: {}
},
disabled: {
type: Boolean,
value: false
},
requestContext: {
type: Object,
value: {}
},
groupActiveIndex: {
type: Object,
value: {}
},
groupRowVisibleMap: {
type: Object,
value: {}
},
groupRowTotalMap: {
type: Object,
value: {}
}
},
data: {
fieldComponentMap: FIELD_COMPONENT_MAP,
fixedFieldBlocks: []
},
observers: {
fixedFields: function (fixedFields) {
this.setData({
fixedFieldBlocks: buildFixedFieldBlocks(fixedFields || [])
})
}
},
lifetimes: {
attached() {
this.setData({
fixedFieldBlocks: buildFixedFieldBlocks(this.properties.fixedFields || [])
})
}
},
methods: {
/** 固定区/分组区字段 change(含 carBrandSelect)→ 向页面 triggerEvent('change') */
onFieldChange(e) {
this.triggerEvent('change', e.detail)
},
onFieldBlur(e) {
this.triggerEvent('blur', e.detail)
},
/** form-group-repeater 点击新增 → 向页面 triggerEvent('groupadd') */
onGroupAdd(e) {
this.triggerEvent('groupadd', e.detail)
},
/** form-group-repeater 点击删除行 → 向页面 triggerEvent('groupremove') */
onGroupRemove(e) {
this.triggerEvent('groupremove', e.detail)
},
/** form-group-repeater 行翻页 → 向页面 triggerEvent('groupnav') */
onGroupNav(e) {
this.triggerEvent('groupnav', e.detail)
},
/** subform 单元格 change → 向页面 triggerEvent('groupchange') */
onGroupFieldChange(e) {
this.triggerEvent('groupchange', e.detail)
},
onGroupFieldBlur(e) {
this.triggerEvent('groupblur', e.detail)
}
}
})
{
"component": true,
"usingComponents": {
"form-field-radio": "../form-field-radio/form-field-radio",
"form-field-number": "../form-field-number/form-field-number",
"form-field-textarea": "../form-field-textarea/form-field-textarea",
"form-field-divider": "../form-field-divider/form-field-divider",
"form-field-select": "../form-field-select/form-field-select",
"form-field-multipleSelect": "../form-field-multipleSelect/form-field-multipleSelect",
"form-field-input": "../form-field-input/form-field-input",
"form-field-phone": "../form-field-phone/form-field-phone",
"form-field-datetime": "../form-field-datetime/form-field-datetime",
"form-field-carBrand": "../form-field-carBrand/form-field-carBrand",
"form-group-repeater": "../form-group-repeater/form-group-repeater"
}
}
<view class="dynamic-form {{ disabled ? 'is-readonly' : '' }}">
<block wx:for="{{ fixedFieldBlocks }}" wx:key="blockKey" wx:for-item="block">
<form-field-divider
wx:if="{{ block.type === 'divider' }}"
field="{{ block.field }}"
/>
<view wx:elif="{{ block.type === 'section' }}" class="form-section">
<block wx:for="{{ block.fields }}" wx:key="key" wx:for-item="item">
<form-field-radio
wx:if="{{ item.type === 'radio' }}"
field="{{ item }}"
value="{{ values[item.key] }}"
disabled="{{ disabled || item.disabled }}"
error="{{ errors[item.key] || '' }}"
bind:change="onFieldChange"
/>
<form-field-select
wx:elif="{{ item.type === 'select' }}"
field="{{ item }}"
value="{{ values[item.key] }}"
disabled="{{ disabled || item.disabled }}"
error="{{ errors[item.key] || '' }}"
request-context="{{ requestContext }}"
bind:change="onFieldChange"
/>
<form-field-input
wx:elif="{{ item.type === 'input' }}"
field="{{ item }}"
value="{{ values[item.key] }}"
disabled="{{ disabled || item.disabled }}"
error="{{ errors[item.key] || '' }}"
bind:change="onFieldChange"
bind:blur="onFieldBlur"
/>
<form-field-phone
wx:elif="{{ item.type === 'phoneInput' }}"
field="{{ item }}"
value="{{ values[item.key] }}"
disabled="{{ disabled || item.disabled }}"
error="{{ errors[item.key] || '' }}"
bind:change="onFieldChange"
bind:blur="onFieldBlur"
/>
<form-field-datetime
wx:elif="{{ item.type === 'datetime' || item.type === 'date' }}"
field="{{ item }}"
value="{{ values[item.key] }}"
disabled="{{ disabled || item.disabled }}"
error="{{ errors[item.key] || '' }}"
bind:change="onFieldChange"
/>
<form-field-carBrand
wx:elif="{{ item.type === 'carBrandSelect' }}"
field="{{ item }}"
value="{{ values[item.key] }}"
disabled="{{ disabled || item.disabled }}"
error="{{ errors[item.key] || '' }}"
bind:change="onFieldChange"
/>
<form-field-multipleSelect
wx:elif="{{ item.type === 'multipleSelect' }}"
field="{{ item }}"
value="{{ values[item.key] }}"
disabled="{{ disabled || item.disabled }}"
error="{{ errors[item.key] || '' }}"
request-context="{{ requestContext }}"
bind:change="onFieldChange"
/>
<form-field-number
wx:elif="{{ item.type === 'numberInput' }}"
field="{{ item }}"
value="{{ values[item.key] }}"
disabled="{{ disabled || item.disabled }}"
error="{{ errors[item.key] || '' }}"
bind:change="onFieldChange"
bind:blur="onFieldBlur"
/>
<form-field-textarea
wx:elif="{{ item.type === 'textarea' }}"
field="{{ item }}"
value="{{ values[item.key] }}"
disabled="{{ disabled || item.disabled }}"
error="{{ errors[item.key] || '' }}"
bind:change="onFieldChange"
/>
</block>
</view>
</block>
<view
wx:for="{{ sectionGroups }}"
wx:key="key"
wx:for-item="section"
class="form-group-section"
>
<view class="group-title {{ disabled ? 'is-disabled' : '' }}">{{ section.label }}</view>
<view class="group-fields form-section">
<block wx:for="{{ section.children }}" wx:key="key" wx:for-item="item">
<form-field-radio
wx:if="{{ item.type === 'radio' }}"
field="{{ item }}"
value="{{ values[item.key] }}"
disabled="{{ disabled || item.disabled }}"
error="{{ errors[item.key] || '' }}"
bind:change="onFieldChange"
/>
<form-field-select
wx:elif="{{ item.type === 'select' }}"
field="{{ item }}"
value="{{ values[item.key] }}"
disabled="{{ disabled || item.disabled }}"
error="{{ errors[item.key] || '' }}"
request-context="{{ requestContext }}"
bind:change="onFieldChange"
/>
<form-field-input
wx:elif="{{ item.type === 'input' }}"
field="{{ item }}"
value="{{ values[item.key] }}"
disabled="{{ disabled || item.disabled }}"
error="{{ errors[item.key] || '' }}"
bind:change="onFieldChange"
bind:blur="onFieldBlur"
/>
<form-field-phone
wx:elif="{{ item.type === 'phoneInput' }}"
field="{{ item }}"
value="{{ values[item.key] }}"
disabled="{{ disabled || item.disabled }}"
error="{{ errors[item.key] || '' }}"
bind:change="onFieldChange"
bind:blur="onFieldBlur"
/>
<form-field-datetime
wx:elif="{{ item.type === 'datetime' || item.type === 'date' }}"
field="{{ item }}"
value="{{ values[item.key] }}"
disabled="{{ disabled || item.disabled }}"
error="{{ errors[item.key] || '' }}"
bind:change="onFieldChange"
/>
<form-field-carBrand
wx:elif="{{ item.type === 'carBrandSelect' }}"
field="{{ item }}"
value="{{ values[item.key] }}"
disabled="{{ disabled || item.disabled }}"
error="{{ errors[item.key] || '' }}"
bind:change="onFieldChange"
/>
<form-field-multipleSelect
wx:elif="{{ item.type === 'multipleSelect' }}"
field="{{ item }}"
value="{{ values[item.key] }}"
disabled="{{ disabled || item.disabled }}"
error="{{ errors[item.key] || '' }}"
request-context="{{ requestContext }}"
bind:change="onFieldChange"
/>
<form-field-number
wx:elif="{{ item.type === 'numberInput' }}"
field="{{ item }}"
value="{{ values[item.key] }}"
disabled="{{ disabled || item.disabled }}"
error="{{ errors[item.key] || '' }}"
bind:change="onFieldChange"
bind:blur="onFieldBlur"
/>
<form-field-textarea
wx:elif="{{ item.type === 'textarea' }}"
field="{{ item }}"
value="{{ values[item.key] }}"
disabled="{{ disabled || item.disabled }}"
error="{{ errors[item.key] || '' }}"
bind:change="onFieldChange"
/>
</block>
</view>
</view>
<form-group-repeater
wx:for="{{ groupFields }}"
wx:key="key"
wx:for-item="group"
group="{{ group }}"
visible-row-fields="{{ groupRowVisibleMap[group.key] }}"
row-total="{{ groupRowTotalMap[group.key] || 0 }}"
active-index="{{ groupActiveIndex[group.key] || 0 }}"
disabled="{{ disabled }}"
errors="{{ errors }}"
request-context="{{ requestContext }}"
bind:add="onGroupAdd"
bind:remove="onGroupRemove"
bind:nav="onGroupNav"
bind:change="onGroupFieldChange"
bind:blur="onGroupFieldBlur"
/>
</view>
.dynamic-form {
width: 100%;
}
.form-section {
background: #fff;
border-radius: 16rpx;
overflow: hidden;
margin-bottom: 20rpx;
}
.form-group-section {
margin-bottom: 20rpx;
}
.group-title {
padding: 24rpx 32rpx 16rpx;
font-size: 28rpx;
font-weight: 500;
color: #292d33;
line-height: 40rpx;
}
.group-title.is-disabled {
color: #5a5e66;
}
.group-fields {
margin-bottom: 0;
}
const carBrandValueModule = require('../../form-engine/car-brand-value.js')
const {
buildUpgradeIconUrl,
FORM_FIELD_ARROW_ICON
} = require('../../utils/upgrade-icon-url.js')
const normalizeCarBrandValue =
carBrandValueModule.normalizeCarBrandValue ||
carBrandValueModule.default?.normalizeCarBrandValue
Component({
properties: {
field: { type: Object, value: {} },
value: { type: null },
disabled: { type: Boolean, value: false },
error: { type: String, value: '' },
groupKey: { type: String, value: '' },
rowIndex: { type: Number, value: -1 }
},
data: {
displayLabel: '',
arrowIconUrl: ''
},
lifetimes: {
attached() {
this.setData({
arrowIconUrl: buildUpgradeIconUrl(FORM_FIELD_ARROW_ICON)
})
}
},
observers: {
value: function (value) {
if (typeof normalizeCarBrandValue !== 'function') {
this.setData({ displayLabel: '' })
return
}
const normalized = normalizeCarBrandValue(value)
this.setData({
displayLabel: normalized?.displayText || ''
})
}
},
methods: {
onTap() {
if (this.data.disabled) return
const pages = getCurrentPages()
const page = pages[pages.length - 1]
if (!page || typeof page.openCarBrandForField !== 'function') {
return wx.$util?.showToast?.('当前页面不支持车型选择')
}
const field = this.data.field || {}
const rowIndex = this.properties.rowIndex
page.openCarBrandForField({
childKey: field.key,
groupKey: this.properties.groupKey || undefined,
rowIndex: rowIndex >= 0 ? rowIndex : undefined
})
}
}
})
{ {
"component": true, "component": true,
"usingComponents": {} "usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
}
<view class="form-info-row {{ disabled ? 'is-disabled' : '' }}" bindtap="onTap">
<view class="form-info-row__label">
<text>{{ field.label }}</text>
<text class="form-info-row__required" wx:if="{{ field.required }}">*</text>
</view>
<view class="form-info-row__value {{ displayLabel ? '' : 'is-placeholder' }}">
<text>{{ displayLabel || '请选择车型' }}</text>
<image class="form-info-row__arrow" src="{{ arrowIconUrl }}" mode="aspectFit" />
</view>
</view>
<view wx:if="{{ error }}" class="form-info-row__error">{{ error }}</view>
@import '../form-field-select/form-field-select.wxss';
const {
buildDatetimePickerState,
mergeDateTimeValue,
clampDateTimeToNow,
resolveNotAfterNow
} = require('../../form-engine/datetime-picker-mode.js')
const {
buildUpgradeIconUrl,
FORM_FIELD_ARROW_ICON
} = require('../../utils/upgrade-icon-url.js')
Component({
properties: {
field: { type: Object, value: {} },
value: { type: null },
disabled: { type: Boolean, value: false },
error: { type: String, value: '' },
groupKey: { type: String, value: '' },
rowIndex: { type: Number, value: -1 }
},
data: {
useMinutePicker: false,
displayLabel: '',
pickerMode: 'date',
pickerValue: '',
dateValue: '',
timeValue: '',
dateStart: '',
dateEnd: '',
timeEnd: '',
endDate: '',
arrowIconUrl: ''
},
lifetimes: {
attached() {
this.setData({
arrowIconUrl: buildUpgradeIconUrl(FORM_FIELD_ARROW_ICON)
})
}
},
observers: {
'field, value': function (field, value) {
this.setData(buildDatetimePickerState(field, value))
}
},
methods: {
buildChangeDetail(nextValue) {
const detail = { key: this.data.field.key, value: nextValue }
if (this.properties.groupKey) {
detail.groupKey = this.properties.groupKey
const rowIndex = Number(this.properties.rowIndex)
if (!Number.isNaN(rowIndex) && rowIndex >= 0) {
detail.rowIndex = rowIndex
}
}
return detail
},
emitMergedValue(nextValue) {
const field = this.properties.field
const state = buildDatetimePickerState(field, nextValue)
this.setData(state)
this.triggerEvent('change', this.buildChangeDetail(nextValue))
},
onChange(e) {
if (this.data.disabled) return
const nextValue = e.detail.value
this.setData({
displayLabel: nextValue,
pickerValue: nextValue
})
this.triggerEvent('change', this.buildChangeDetail(nextValue))
},
normalizeMergedValue(merged) {
const field = this.properties.field
if (resolveNotAfterNow(field)) {
return clampDateTimeToNow(merged)
}
return merged
},
onDateChange(e) {
if (this.data.disabled) return
const date = e.detail.value
const merged = this.normalizeMergedValue(
mergeDateTimeValue(date, this.data.timeValue)
)
this.emitMergedValue(merged)
},
onTimeChange(e) {
if (this.data.disabled) return
const time = e.detail.value
const merged = this.normalizeMergedValue(
mergeDateTimeValue(this.data.dateValue, time)
)
this.emitMergedValue(merged)
}
}
})
{ {
"component": true, "component": true,
"usingComponents": {} "usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
}
<view class="form-info-row {{ disabled ? 'is-disabled' : '' }}">
<view class="form-info-row__label">
<text>{{ field.label }}</text>
<text class="form-info-row__required" wx:if="{{ field.required }}">*</text>
</view>
<block wx:if="{{ useMinutePicker }}">
<view class="form-info-row__pickers form-info-row__pickers--minute">
<picker
mode="date"
value="{{ dateValue }}"
start="{{ dateStart }}"
end="{{ dateEnd }}"
disabled="{{ disabled }}"
bindchange="onDateChange"
>
<view class="form-info-row__picker-part {{ dateValue ? '' : 'is-placeholder' }}">
<text>{{ dateValue || '日期' }}</text>
</view>
</picker>
<picker
mode="time"
value="{{ timeValue }}"
end="{{ timeEnd }}"
disabled="{{ disabled }}"
bindchange="onTimeChange"
>
<view class="form-info-row__picker-part {{ timeValue ? '' : 'is-placeholder' }}">
<text>{{ timeValue || '时间' }}</text>
<image class="form-info-row__arrow" src="{{ arrowIconUrl }}" mode="aspectFit" />
</view>
</picker>
</view>
</block>
<picker
wx:else
mode="{{ pickerMode }}"
value="{{ pickerValue }}"
start="{{ dateStart }}"
end="{{ endDate }}"
disabled="{{ disabled }}"
bindchange="onChange"
>
<view class="form-info-row__value {{ displayLabel ? '' : 'is-placeholder' }}">
<text>{{ displayLabel || '请选择' }}</text>
<image class="form-info-row__arrow" src="{{ arrowIconUrl }}" mode="aspectFit" />
</view>
</picker>
</view>
<view wx:if="{{ error }}" class="form-info-row__error">{{ error }}</view>
@import '../form-field-select/form-field-select.wxss';
.form-info-row__pickers {
display: flex;
flex: 1;
align-items: center;
justify-content: flex-end;
min-width: 0;
}
.form-info-row__pickers--minute {
gap: 16rpx;
}
.form-info-row__picker-part {
display: flex;
align-items: center;
font-size: 28rpx;
color: #292d33;
line-height: 40rpx;
}
.form-info-row__picker-part.is-placeholder {
color: #bec1c7;
}
.form-info-row.is-disabled .form-info-row__picker-part {
color: #5a5e66;
}
Component({
properties: {
field: {
type: Object,
value: {}
}
}
})
{ {
"component": true, "component": true,
"usingComponents": {} "usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
}
<view class="form-divider">
<view class="form-divider__line"></view>
<text class="form-divider__text">{{ field.label }}</text>
<view class="form-divider__line"></view>
</view>
.form-divider {
display: flex;
align-items: center;
gap: 16rpx;
margin: 32rpx 0;
padding: 0 32rpx;
box-sizing: border-box;
}
.form-divider__line {
flex: 1;
height: 0;
border-top: 4rpx dashed #cfd3d9;
background: none;
}
.form-divider__text {
flex-shrink: 0;
font-size: 26rpx;
font-weight: 500;
color: #5a5e66;
line-height: 36rpx;
}
const DEFAULT_OCR_ICON =
'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/ocr_icon.png'
const { formatVinInput } = require('~/utils/vinVaildate.js')
Component({
properties: {
field: {
type: Object,
value: {},
observer: 'observeField'
},
value: {
type: null,
observer: 'syncDisplayValue'
},
disabled: { type: Boolean, value: false },
error: { type: String, value: '' },
groupKey: { type: String, value: '' },
rowIndex: { type: Number, value: -1 }
},
data: {
displayValue: '',
showOcr: false,
scanIcon: ''
},
lifetimes: {
attached() {
const app = typeof getApp === 'function' ? getApp() : null
const imgUrl = app?.globalData?.IMG_URL || wx.$util?.IMG_URL || ''
this.setData({
scanIcon: imgUrl ? `${imgUrl}ocr_icon.png` : DEFAULT_OCR_ICON
})
}
},
methods: {
observeField(field = {}) {
this.setData({
showOcr: field.prefixComponent === 'scan' && !this.data.disabled
})
},
syncDisplayValue(value) {
const displayValue =
value === null || value === undefined ? '' : String(value)
this.setData({ displayValue })
},
onInput(e) {
if (this.data.disabled) return
const rawValue = e.detail.value
const field = this.properties.field || {}
this.setData({ displayValue: rawValue })
const detail = { key: field.key, value: rawValue }
if (this.properties.groupKey) {
detail.groupKey = this.properties.groupKey
const rowIndex = Number(this.properties.rowIndex)
if (!Number.isNaN(rowIndex) && rowIndex >= 0) {
detail.rowIndex = rowIndex
}
}
this.triggerEvent('change', detail)
},
onBlur() {
const field = this.properties.field || {}
const detail = {
key: field.key,
value: this.data.displayValue
}
if (this.properties.groupKey) {
detail.groupKey = this.properties.groupKey
const rowIndex = Number(this.properties.rowIndex)
if (!Number.isNaN(rowIndex) && rowIndex >= 0) {
detail.rowIndex = rowIndex
}
}
this.triggerEvent('blur', detail)
},
onOcr() {
if (this.data.disabled) return
const pages = getCurrentPages()
const page =
pages.find(p => typeof p.openVinOcrForField === 'function') ||
pages[pages.length - 1]
if (!page || typeof page.openVinOcrForField !== 'function') {
return wx.$util?.showToast?.('当前页面不支持识别')
}
const field = this.properties.field || {}
const groupKey = this.properties.groupKey || undefined
let rowIndex = Number(this.properties.rowIndex)
if (groupKey && (Number.isNaN(rowIndex) || rowIndex < 0)) {
const active = page.data?.groupActiveIndex?.[groupKey]
rowIndex =
active != null && active !== '' && !Number.isNaN(Number(active))
? Number(active)
: 0
}
page.openVinOcrForField({
childKey: field.key,
groupKey,
rowIndex: groupKey ? rowIndex : undefined
})
}
}
})
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!