Commit ada32ec5 by chenwq

feat(日报): 添加日报模板默认值自动填充功能

新增reportFirstAutoObj配置对象用于定义各模板默认值映射关系
在supervisorDaily.js中添加getUserStat方法获取用户统计数据并自动填充
添加dailyCumulativeAchievement字段验证规则
更新api.js添加userStat接口用于获取统计数据
1 parent 3d71f8e2
...@@ -4,397 +4,407 @@ import api from '~/utils/request/request.js' ...@@ -4,397 +4,407 @@ import api from '~/utils/request/request.js'
module.exports = { module.exports = {
/**根据商户号获取可选套餐商品列表 */ /**根据商户号获取可选套餐商品列表 */
getGoodsList(data) { getGoodsList(data) {
return api.post('dj.api.smartcarlife.MerchantPackageGoods.list', data) return api.post("dj.api.smartcarlife.MerchantPackageGoods.list", data);
}, },
/**根据订单号获取订单详情(含套餐) */ /**根据订单号获取订单详情(含套餐) */
getPackageGoodsDetail(data) { getPackageGoodsDetail(data) {
return api.post('dj.api.smartcarlife.order.packageGoodsDetail', data) return api.post("dj.api.smartcarlife.order.packageGoodsDetail", data);
}, },
/**搜索订单(含套餐) */ /**搜索订单(含套餐) */
getWorkPackageGoodsList(data) { getWorkPackageGoodsList(data) {
let params = data || {} let params = data || {};
params.sceneType = 1 params.sceneType = 1;
return api.post('dj.api.smartcarlife.order.search.containPackageGoods', { return api.post("dj.api.smartcarlife.order.search.containPackageGoods", {
pageSize: 10, pageSize: 10,
...params ...params,
}) });
}, },
/** 工单列表 */ /** 工单列表 */
getWorkList(data) { getWorkList(data) {
let params = data || {} let params = data || {};
params.sceneType = 1 params.sceneType = 1;
return api.post('dj.api.smartcarlife.order.search', { return api.post("dj.api.smartcarlife.order.search", {
pageSize: 10, pageSize: 10,
...params ...params,
}) });
}, },
/** 提交施工订单 */ /** 提交施工订单 */
confirmConstruction(data) { confirmConstruction(data) {
return api.post('dj.api.smartcarlife.order.confirmConstruction', data) return api.post("dj.api.smartcarlife.order.confirmConstruction", data);
}, },
/**撤销工单 */ /**撤销工单 */
revokeOrder(data) { revokeOrder(data) {
return api.post('dj.api.smartcarlife.order.revoke', data) return api.post("dj.api.smartcarlife.order.revoke", data);
}, },
/** 根据订单号获取订单详情 */ /** 根据订单号获取订单详情 */
getOrderDetail(data) { getOrderDetail(data) {
return api.post('dj.api.smartcarlife.order.detail', data) return api.post("dj.api.smartcarlife.order.detail", data);
}, },
/**二维码 */ /**二维码 */
createWeappQrcode(data) { createWeappQrcode(data) {
// dj.api.smartcarlife.serviceMerchant.getByMerchantId // dj.api.smartcarlife.serviceMerchant.getByMerchantId
return api.post('dj.api.smartcarlife.common.createWeappQrcode', data) return api.post("dj.api.smartcarlife.common.createWeappQrcode", data);
}, },
/**商品列表 */ /**商品列表 */
getOrderBaseGoodsList(data) { getOrderBaseGoodsList(data) {
return api.post( return api.post(
'dj.api.smartcarlife.orderUpgradeGoods.listByMerchantId', "dj.api.smartcarlife.orderUpgradeGoods.listByMerchantId",
data data
) );
}, },
/** 选择支付方式下单 */ /** 选择支付方式下单 */
createWithPay(data) { createWithPay(data) {
return api.post('dj.api.smartcarlife.order.createWithPay', data) return api.post("dj.api.smartcarlife.order.createWithPay", data);
}, },
/**根据手机号查询客户信息 */ /**根据手机号查询客户信息 */
checkCustomerPhone(data) { checkCustomerPhone(data) {
return api.post('dj.api.smartcarlife.customer.queryByPhone', data) return api.post("dj.api.smartcarlife.customer.queryByPhone", data);
}, },
/**改变支付订单状态 */ /**改变支付订单状态 */
createPayOrder(data) { createPayOrder(data) {
return api.post('dj.api.smartcarlife.payOrder.create', data) return api.post("dj.api.smartcarlife.payOrder.create", data);
}, },
/** */ /** */
installOnly(data) { installOnly(data) {
return api.post('dj.api.smartcarlife.order.installOnly', data) return api.post("dj.api.smartcarlife.order.installOnly", data);
}, },
/**获取精品礼券 */ /**获取精品礼券 */
getCouponDeatil(data) { getCouponDeatil(data) {
return api.post('dj.api.smartCarLife.customer.coupon.detail', data) return api.post("dj.api.smartCarLife.customer.coupon.detail", data);
}, },
/** 根据订单号获取种草信息*/ /** 根据订单号获取种草信息*/
getGrassDetail(data) { getGrassDetail(data) {
return api.post('dj.api.smartcarlife.orderShareRecord.detail', data) return api.post("dj.api.smartcarlife.orderShareRecord.detail", data);
}, },
// 获取园区店配置 // 获取园区店配置
getYqStoreConfig(data) { getYqStoreConfig(data) {
return api.get('dj.api.smarcarlife.yqMerchantConfig.detail', data) return api.get("dj.api.smarcarlife.yqMerchantConfig.detail", data);
}, },
/** 修改工单时间 */ /** 修改工单时间 */
updateOrderTime(data) { updateOrderTime(data) {
return api.post('dj.api.smartcarlife.order.updateOrderTime', data) return api.post("dj.api.smartcarlife.order.updateOrderTime", data);
}, },
/** 修改客户信息 */ /** 修改客户信息 */
updateOrderInfo(data) { updateOrderInfo(data) {
return api.post('dj.api.smartcarlife.order.updateOrderInfo', data) return api.post("dj.api.smartcarlife.order.updateOrderInfo", data);
}, },
/** 根据订单状态统计订单数*/ /** 根据订单状态统计订单数*/
statByStatus(data) { statByStatus(data) {
data = data || {} data = data || {};
data.sceneType = 1 data.sceneType = 1;
return api.post('dj.api.smartcarlife.order.statByStatus', data) return api.post("dj.api.smartcarlife.order.statByStatus", data);
}, },
/** 获取企微活码 */ /** 获取企微活码 */
getWorkWechatLiveQRCode(data) { getWorkWechatLiveQRCode(data) {
return api.post('dj.api.smartcarlife.order.getWorkWechatLiveQRCode', data) return api.post("dj.api.smartcarlife.order.getWorkWechatLiveQRCode", data);
}, },
/** 订单补录 */ /** 订单补录 */
supplementOrder(data) { supplementOrder(data) {
return api.post('dj.api.smartcarlife.order.supplementOrder', data) return api.post("dj.api.smartcarlife.order.supplementOrder", data);
}, },
/** 订单修正 */ /** 订单修正 */
correctionOrder(data) { correctionOrder(data) {
return api.post('dj.api.smartcarlife.order.correctionOrder', data) return api.post("dj.api.smartcarlife.order.correctionOrder", data);
}, },
/** 战败订单批量补录 */ /** 战败订单批量补录 */
notUpgradeOrder(data) { notUpgradeOrder(data) {
return api.post('dj.api.smartcarlife.order.notUpgrade.batchInsert', data) return api.post("dj.api.smartcarlife.order.notUpgrade.batchInsert", data);
}, },
/** 批量新建预录工单 */ /** 批量新建预录工单 */
createPrerecordedOrderBatch(data) { createPrerecordedOrderBatch(data) {
return api.post('dj.api.smartcarlife.order.preliminaryOrder.batch', data) return api.post("dj.api.smartcarlife.order.preliminaryOrder.batch", data);
}, },
/** 新建预录工单 */ /** 新建预录工单 */
createPrerecordedOrder(data) { createPrerecordedOrder(data) {
return api.post('dj.api.smartcarlife.order.preliminaryOrder', data) return api.post("dj.api.smartcarlife.order.preliminaryOrder", data);
}, },
/** 升级商品生成条形码 */ /** 升级商品生成条形码 */
createBarCode(data) { createBarCode(data) {
return api.post('dj.api.smartcarlife.common.createBarCode', data) return api.post("dj.api.smartcarlife.common.createBarCode", data);
}, },
/** 获取商户基本信息 */ /** 获取商户基本信息 */
getServiceBaseInfo(data) { getServiceBaseInfo(data) {
return api.post( return api.post(
'dj.api.smartcarlife.serviceMerchant.getServiceBaseInfo', "dj.api.smartcarlife.serviceMerchant.getServiceBaseInfo",
data data
) );
}, },
/** 根据id查询待补录订单 */ /** 根据id查询待补录订单 */
waitinputorderSelectById(data) { waitinputorderSelectById(data) {
return api.post('dj.api.smartcarlife.weapp.waitinputorder.selectById', data) return api.post(
"dj.api.smartcarlife.weapp.waitinputorder.selectById",
data
);
}, },
/** 客户确认签名 */ /** 客户确认签名 */
customerConfirmationSignature(data) { customerConfirmationSignature(data) {
return api.post('dj.api.smartcarlife.customerConfirmationSignature', data) return api.post("dj.api.smartcarlife.customerConfirmationSignature", data);
}, },
/** 查询园区店是否开启签名配置 */ /** 查询园区店是否开启签名配置 */
getSignatureSwitch(data) { getSignatureSwitch(data) {
return api.post( return api.post(
'dj.api.smartcarlife.serviceMerchant.getSignatureSwitch', "dj.api.smartcarlife.serviceMerchant.getSignatureSwitch",
data data
) );
}, },
/** 根据客户优惠券id查询订单 */ /** 根据客户优惠券id查询订单 */
getOrderByCustomerCouponId(data) { getOrderByCustomerCouponId(data) {
// return api.post('dj.api.smartcarlife.order.getOrderByCustomerCouponId ', data) // return api.post('dj.api.smartcarlife.order.getOrderByCustomerCouponId ', data)
return api.get('dj.api.smartcarlife.order.getOrderByCustomerCouponId', data) return api.get(
"dj.api.smartcarlife.order.getOrderByCustomerCouponId",
data
);
}, },
/** 获取园区店配置技师数据 */ /** 获取园区店配置技师数据 */
getQYTechnicianList(data) { getQYTechnicianList(data) {
return api.post('dj.api.smartcarlife.roleTechnician.list', data) return api.post("dj.api.smartcarlife.roleTechnician.list", data);
// return api.post('dj.api.smartcarlife.technician.list', data) // return api.post('dj.api.smartcarlife.technician.list', data)
}, },
/** 根据手机号查询客户建档待跟进订单信息 */ /** 根据手机号查询客户建档待跟进订单信息 */
getQueryCouponInfoByPhone(data) { getQueryCouponInfoByPhone(data) {
return api.post('dj.api.smartcarlife.customer.queryCouponInfoByPhone', data) return api.post(
"dj.api.smartcarlife.customer.queryCouponInfoByPhone",
data
);
}, },
/** 根据订单更新技师信息 */ /** 根据订单更新技师信息 */
updateTechnicianInfo(data) { updateTechnicianInfo(data) {
return api.post('dj.api.smartcarlife.order.updateTechnicianInfo', data) return api.post("dj.api.smartcarlife.order.updateTechnicianInfo", data);
}, },
/** 根据订单商品获取膜卷号 */ /** 根据订单商品获取膜卷号 */
getfilmRollNoByGoods(data) { getfilmRollNoByGoods(data) {
return api.post('dj.api.smarcarlife.stock.filmroll.list', data) return api.post("dj.api.smarcarlife.stock.filmroll.list", data);
}, },
/** 子订单设置膜卷号 */ /** 子订单设置膜卷号 */
setfilmRollNo(data) { setfilmRollNo(data) {
return api.post('dj.api.smartcarlife.order.updateFilmRoll', data) return api.post("dj.api.smartcarlife.order.updateFilmRoll", data);
}, },
/** 保存员工日报(员工、管理员操作)*/ /** 保存员工日报(员工、管理员操作)*/
staffDailyReportSave(data) { staffDailyReportSave(data) {
return api.post('dj.api.smartcarlife.staff.daily.report.save', data) return api.post("dj.api.smartcarlife.staff.daily.report.save", data);
}, },
/** 员工日报详情 */ /** 员工日报详情 */
staffDailyReportDetail(data) { staffDailyReportDetail(data) {
return api.post('dj.api.smartcarlife.staff.daily.report.detail', data) return api.post("dj.api.smartcarlife.staff.daily.report.detail", data);
}, },
/** 查询当周员工日报是否填写列表 */ /** 查询当周员工日报是否填写列表 */
staffDailyReportDetailWeeklyList(data) { staffDailyReportDetailWeeklyList(data) {
return api.post('dj.api.smartcarlife.staff.daily.report.weekly.list', data) return api.post("dj.api.smartcarlife.staff.daily.report.weekly.list", data);
}, },
/** 批复员工日报 */ /** 批复员工日报 */
staffDailyReportApprove(data) { staffDailyReportApprove(data) {
return api.post('dj.api.smartcarlife.staff.daily.report.approve', data) return api.post("dj.api.smartcarlife.staff.daily.report.approve", data);
}, },
/** 4s店查询对应的园区店 */ /** 4s店查询对应的园区店 */
querySceneRefByShop(data) { querySceneRefByShop(data) {
return api.post('dj.api.scenemerchantref.querySceneRefByShop', data) return api.post("dj.api.scenemerchantref.querySceneRefByShop", data);
}, },
/** 查询该店员工日报是否开启 */ /** 查询该店员工日报是否开启 */
staffDailyReportMerchantValid(data) { staffDailyReportMerchantValid(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)
return api.post('dj.api.smartcarlife.staff.daily.report.popup.need', data) return api.post("dj.api.smartcarlife.staff.daily.report.popup.need", data);
}, },
/** 查询4s店填写驻店日报的品牌列表 */ /** 查询4s店填写驻店日报的品牌列表 */
staffDailyReportMerchantCarBand(data) { staffDailyReportMerchantCarBand(data) {
return api.post('dj.api.smartcarlife.staff.daily.report.car.brand', data) return api.post("dj.api.smartcarlife.staff.daily.report.car.brand", data);
}, },
/** 无需补录订单 */ /** 无需补录订单 */
noNeedSupplementOrder(data) { noNeedSupplementOrder(data) {
return api.post('dj.api.smartcarlife.order.noNeedSupplementOrder', data) return api.post("dj.api.smartcarlife.order.noNeedSupplementOrder", data);
}, },
/** 待补录订单统计 */ /** 待补录订单统计 */
waitinputorder(data) { waitinputorder(data) {
let params = data || {} let params = data || {};
params.inputStatus = 0 params.inputStatus = 0;
// params.payType = 1 // params.payType = 1
return api.post('dj.api.smartcarlife.weapp.waitinputorder.count', params) return api.post("dj.api.smartcarlife.weapp.waitinputorder.count", params);
}, },
/** 质保价格编辑接口 */ /** 质保价格编辑接口 */
modifyWarrantyPrice(data) { modifyWarrantyPrice(data) {
return api.post( return api.post(
'dj.api.smartcarlife.customer.warrantyCard.modifyWarrantyPrice', "dj.api.smartcarlife.customer.warrantyCard.modifyWarrantyPrice",
data data
) );
}, },
/** 查询用户日报模版 */ /** 查询用户日报模版 */
getMyTemplate(data) { getMyTemplate(data) {
return api.post('dj.api.mindworkplate.app.daily.report.myTemplate', data) return api.post("dj.api.mindworkplate.app.daily.report.myTemplate", data);
}, },
/** 查询用户指定日期范围内填写日报的日期 */ /** 查询用户指定日期范围内填写日报的日期 */
getDateRecord(data) { getDateRecord(data) {
return api.post( return api.post(
'dj.api.mindworkplate.app.daily.report.mySubmittedDateRecord', "dj.api.mindworkplate.app.daily.report.mySubmittedDateRecord",
data data
) );
}, },
/** 查询用户指定日期的日报详情 */ /** 查询用户指定日期的日报详情 */
getRecordDetail(data) { getRecordDetail(data) {
return api.post( return api.post(
'dj.api.mindworkplate.app.daily.report.myRecordDetail', "dj.api.mindworkplate.app.daily.report.myRecordDetail",
data data
) );
}, },
/** 根据月份查询查询员工周报提交 */ /** 根据月份查询查询员工周报提交 */
getWeeklyRecordDetail(data) { getWeeklyRecordDetail(data) {
return api.post( return api.post(
'dj.api.carboutique.assign.month.find.staff.weekly.report.submit', "dj.api.carboutique.assign.month.find.staff.weekly.report.submit",
data data
) );
}, },
/** 根据月份查询查询周 */ /** 根据月份查询查询周 */
getMonthCalWeek(data) { getMonthCalWeek(data) {
return api.post( return api.post("dj.api.carboutique.assign.month.cal.week", data);
'dj.api.carboutique.assign.month.cal.week',
data
)
}, },
/** 根据年份查询查询员工月报提交 */ /** 根据年份查询查询员工月报提交 */
getMonthlyRecordDetail(data) { getMonthlyRecordDetail(data) {
return api.post( return api.post(
'dj.api.carboutique.assign.year.find.staff.monthly.report.submit', "dj.api.carboutique.assign.year.find.staff.monthly.report.submit",
data data
) );
}, },
/** 用户提交日报 */ /** 用户提交日报 */
saveTempReport(data) { saveTempReport(data) {
return api.post('dj.api.mindworkplate.app.daily.report.save', data) return api.post("dj.api.mindworkplate.app.daily.report.save", data);
}, },
/** 获取与会驻店人员 */ /** 获取与会驻店人员 */
getStaffList(data) { getStaffList(data) {
// return api.post("dj.api.mindworkplate.app.daily.report.staffBaseInfo.pageList", data); // return api.post("dj.api.mindworkplate.app.daily.report.staffBaseInfo.pageList", data);
return api.post( return api.post(
'dj.api.mindworkplate.app.daily.report.staffBaseInfo.page', "dj.api.mindworkplate.app.daily.report.staffBaseInfo.page",
data data
) );
}, },
// 查询店铺配置 // 查询店铺配置
getShopMerchantPointConfig(data) { getShopMerchantPointConfig(data) {
return api.post('dj.api.smartcarlife.shopMerchantPointConfig.get', data) return api.post("dj.api.smartcarlife.shopMerchantPointConfig.get", data);
}, },
// 获取带教管理列表数据 // 获取带教管理列表数据
getMentorShipList(data) { getMentorShipList(data) {
return api.post( return api.post(
'dj.api.businessSchool.miniProgram.teachTask.page', "dj.api.businessSchool.miniProgram.teachTask.page",
data, data,
[], [],
'/rop-dj-business-school-miniprogram/router' "/rop-dj-business-school-miniprogram/router"
) );
}, },
// 修改带教任务信息 // 修改带教任务信息
updateMentorShipInfo(data) { updateMentorShipInfo(data) {
return api.post( return api.post(
'dj.api.businessSchool.miniProgram.teachTask.update', "dj.api.businessSchool.miniProgram.teachTask.update",
data, data,
[], [],
'/rop-dj-business-school-miniprogram/router' "/rop-dj-business-school-miniprogram/router"
) );
}, },
// 获取带教任务数量 // 获取带教任务数量
getMentorShipTaskNum(data) { getMentorShipTaskNum(data) {
return api.post( return api.post(
'dj.api.businessSchool.miniProgram.teachTask.count', "dj.api.businessSchool.miniProgram.teachTask.count",
data, data,
[], [],
'/rop-dj-business-school-miniprogram/router' "/rop-dj-business-school-miniprogram/router"
) );
}, },
// 根据商户号获取可选商品列表 // 根据商户号获取可选商品列表
getSelectOrderGoodsList(data) { getSelectOrderGoodsList(data) {
return api.post('dj.api.smartcarlife.selectOrderGoods.list', data) return api.post("dj.api.smartcarlife.selectOrderGoods.list", data);
}, },
// 更新施图 // 更新施图
updateCustomerphotos(data) { updateCustomerphotos(data) {
return api.post('dj.api.smartcarlife.updateCustomerphotos', data) return api.post("dj.api.smartcarlife.updateCustomerphotos", data);
}, },
// 技师施工图片审批 // 技师施工图片审批
technicianApprove(data) { technicianApprove(data) {
return api.post('dj.api.smartcarlife.technician.approve', data) return api.post("dj.api.smartcarlife.technician.approve", data);
}, },
// 根据商户号获取可选商品列表 // 根据商户号获取可选商品列表
getSelectOrderGoodsList(data) { getSelectOrderGoodsList(data) {
return api.post('dj.api.smartcarlife.selectOrderGoods.list', data) return api.post("dj.api.smartcarlife.selectOrderGoods.list", data);
}, },
// 退款审批列表查询 // 退款审批列表查询
getRefundReviewListAPI(data) { getRefundReviewListAPI(data) {
return api.post( return api.post(
'dj.api.smartcarlife.refundApplyRecord.waitForAudit.list', "dj.api.smartcarlife.refundApplyRecord.waitForAudit.list",
data data
) );
}, },
// 日报填报前参数校验 // 日报填报前参数校验
dailyReportCheck(data) { dailyReportCheck(data) {
return api.post('dj.api.smartcarlife.staff.daily.report.data.check', data) return api.post("dj.api.smartcarlife.staff.daily.report.data.check", data);
}, },
// 获取施工单按钮展示标识 // 获取施工单按钮展示标识
showFlag(data) { showFlag(data) {
return api.post('dj.api.smartcarlife.construction.get.showFlag', data) return api.post("dj.api.smartcarlife.construction.get.showFlag", data);
}, },
// 获取主订单商品列表 // 获取主订单商品列表
listSubOrder(data) { listSubOrder(data) {
return api.post('dj.api.smartcarlife.construction.list.subOrder', data) return api.post("dj.api.smartcarlife.construction.list.subOrder", data);
}, },
/**获取服务项目列表数据 */ /**获取服务项目列表数据 */
getServiceItemList(data) { getServiceItemList(data) {
return api.post('dj.api.carboutique.construction.item.group.list', data) return api.post("dj.api.carboutique.construction.item.group.list", data);
}, },
// 批量添加施工单 // 批量添加施工单
batchAdd(data) { batchAdd(data) {
return api.post('dj.api.smartcarlife.construction.batch.add', data) return api.post("dj.api.smartcarlife.construction.batch.add", data);
}, },
// 查询施工单详情 // 查询施工单详情
getConstructionDetail(data) { getConstructionDetail(data) {
return api.post( return api.post(
'dj.api.smartcarlife.construction.get.construction.detail', "dj.api.smartcarlife.construction.get.construction.detail",
data data
) );
}, },
// 根据主订单查询施工单列表 // 根据主订单查询施工单列表
listConstruction(data) { listConstruction(data) {
return api.post('dj.api.smartcarlife.construction.list.construction', data) return api.post("dj.api.smartcarlife.construction.list.construction", data);
}, },
// 获取园区店下角色名包含技师员工有效列表 // 获取园区店下角色名包含技师员工有效列表
getQYTechnicianList(data) { getQYTechnicianList(data) {
return api.post('dj.api.smartcarlife.roleTechnician.list.effective', data) return api.post("dj.api.smartcarlife.roleTechnician.list.effective", data);
}, },
/**施工单状态统计 */ /**施工单状态统计 */
statByStatus(data) { statByStatus(data) {
let params = data || {} let params = data || {};
return api.post('dj.api.smartcarlife.construction.summary.status', { return api.post("dj.api.smartcarlife.construction.summary.status", {
...params ...params,
}) });
} },
} /** 首页统计数据 - 日报/周报/月报默认值 */
userStat(data) {
return api.post("dj.api.smartcarlife.user.stat", data);
},
};
// 日报/周报/月报 首次填写,默认填入的字段数据结构
export const reportFirstAutoObj = {
/** 1.1轻改区域日报模版 */
'qinggai-temp-001': {
list: [{
attrName: 'todayRegionalTotalOutput',
// 今日产值
valueObj: 'staffTodayTotal'
}, {
attrName: 'monthRegionalTotalOutput',
// 本月产值
valueObj: 'staffMonthTotal'
}]
},
/** 2.3延保区域日报模版 */
'uuid-temp-001': {
list: [{
attrName: 'dailyCumulativeAchievement',
// 今日产值
valueObj: 'staffTodayTotal'
}, {
attrName: 'monthlyCumulativeAchievement',
// 本月产值
valueObj: 'staffMonthTotal'
}]
},
/** 2.1权益区域日报模版 */
'uuid-temp-011': {
list: [{
attrName: 'dailyCumulativeAchievement',
// 今日产值
valueObj: 'staffTodayTotal'
}, {
attrName: 'monthlyCumulativeAchievement',
// 本月产值
valueObj: 'staffMonthTotal'
}]
},
/** 2.1区域经理周报模版 */
'uuid-temp-012': {
list: [{
attrName: 'monthlyStoreCumulativeAchievement012',
// 本月产值
valueObj: 'staffMonthTotal'
}]
},
/** 1.1区域经理周报模版 */
'uuid-temp-013': {
list: [{
attrName: 'monthlyStoreCumulativeAchievement013',
// 本月产值
valueObj: 'staffMonthTotal'
}]
},
/** 2.3区域经理周报模版 */
'uuid-temp-014': {
list: [{
attrName: 'monthlyStoreCumulativeAchievement014',
// 本月产值
valueObj: 'staffMonthTotal'
}]
},
/** 2.1运营主管周报模版 */
'uuid-temp-015': {
list: [{
attrName: 'monthlyOutput015',
// 本月产值
valueObj: 'staffMonthTotal'
}]
},
/** 1.1运营主管周报模版 */
'uuid-temp-016': {
list: [{
attrName: 'monthlyOutput016',
// 本月产值
valueObj: 'staffMonthTotal'
}]
},
/** 2.3运营主管周报模版 */
'uuid-temp-017': {
list: [{
attrName: 'monthlyOutput017',
// 本月产值
valueObj: 'staffMonthTotal'
}]
},
/** 1.1区域经理月报模版 */
'uuid-temp-018': {
list: [{
attrName: 'actualAchievement018',
// 本月产值
valueObj: 'staffMonthTotal'
}]
},
/** 2.1区域经理月报模版 */
'uuid-temp-019': {
list: [{
attrName: 'actualAchievement019',
// 本月产值
valueObj: 'staffMonthTotal'
}]
},
/** 2.3区域经理月报模版 */
'uuid-temp-020': {
list: [{
attrName: 'actualAchievement020',
// 本月产值
valueObj: 'staffMonthTotal'
}]
},
/** 2.1运营主管月报模版 */
'uuid-temp-021': {
list: [{
attrName: 'monthlyOutput021',
// 本月产值
valueObj: 'staffMonthTotal'
}]
},
/** 1.1运营主管月报模版 */
'uuid-temp-022': {
list: [{
attrName: 'monthlyOutput022',
// 本月产值
valueObj: 'staffMonthTotal'
}]
},
/** 2.3运营主管月报模版 */
'uuid-temp-023': {
list: [{
attrName: 'monthlyOutput023',
// 本月产值
valueObj: 'staffMonthTotal'
}]
}
}
\ No newline at end of file \ No newline at end of file
...@@ -54,6 +54,16 @@ export const tempRuleFnObj = { ...@@ -54,6 +54,16 @@ export const tempRuleFnObj = {
return /^$|^[0]$|^\d{1}(\.\d{1,2})$|^([1-9]\d*)(\.\d{1,2})?$/.test(value) ? null : { message: '本月累计达成请输入仅有两位小数的数字' } return /^$|^[0]$|^\d{1}(\.\d{1,2})$|^([1-9]\d*)(\.\d{1,2})?$/.test(value) ? null : { message: '本月累计达成请输入仅有两位小数的数字' }
} }
}, },
/** 今日累计达成 */
dailyCumulativeAchievement: {
ruleFn: (rule, value) => {
const maxValue = 100000000
if (value < 0 || value > maxValue) {
return { message: `今日累计达成请输入0-${maxValue}` }
}
return /^$|^[0]$|^\d{1}(\.\d{1,2})$|^([1-9]\d*)(\.\d{1,2})?$/.test(value) ? null : { message: '今日累计达成请输入仅有两位小数的数字' }
}
},
/** 本月时间进度 */ /** 本月时间进度 */
monthlyTimeProgress: { monthlyTimeProgress: {
ruleFn: (rule, value) => { ruleFn: (rule, value) => {
......
// tabWorkOrder/pages/supervisorDaily/supervisorDaily.js // tabWorkOrder/pages/supervisorDaily/supervisorDaily.js
var util = require("~/utils/timeFormat/time-utils.js"); var util = require("~/utils/timeFormat/time-utils.js");
import { resData } from "./resData" import { resData } from "./resData";
import { tempRuleFnObj } from "./ruleFnObj" import { tempRuleFnObj } from "./ruleFnObj";
import fn from '~/components/GLCustForm/ruleFn' import { reportFirstAutoObj } from "./reportFirstAuto";
import fn from "~/components/GLCustForm/ruleFn";
import api from "../../api"; import api from "../../api";
import apiDefault from "~/api/api"; import apiDefault from "~/api/api";
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/regional-assistant/' const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/regional-assistant/'
var allRuleObj = {}
import { var allRuleObj = {};
setConfigInfo import { setConfigInfo } from "~/store/index";
} from '~/store/index' const app = getApp();
const app = getApp()
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
...@@ -106,6 +106,48 @@ Page({ ...@@ -106,6 +106,48 @@ Page({
this.initData(options); this.initData(options);
}); });
}, },
// 获取默认值
getUserStat() {
const userInfo = wx.$util.getUserInfo();
const { routeParams, tmlpFormData, tmlpInitData } = this.data;
console.log(routeParams, "routeParams");
if (!userInfo) {
return;
}
wx.$util.showLoading("加载中...");
api
.userStat({
merchantId: userInfo?.shopMerchantId || undefined,
})
.then((result) => {
let { code, data } = result;
if (code == 0) {
const needDefaultCodeList = Object.keys(reportFirstAutoObj);
console.log(needDefaultCodeList, "needDefaultCodeList----");
if (needDefaultCodeList.includes(routeParams.code)) {
reportFirstAutoObj[routeParams.code]?.list.forEach((item) => {
tmlpFormData[item.attrName] =
data[item.valueObj].totalOrderMoney + "";
});
this.setData(
{
tmlpFormData: tmlpFormData,
tabChange: false,
},
() => {
this.setData({
tabChange: true,
});
}
);
}
}
})
.finally(() => {
wx.hideLoading();
});
},
async initData(options) { async initData(options) {
const { routeParams } = this.data; const { routeParams } = this.data;
// 获取配置服务数据 // 获取配置服务数据
...@@ -162,7 +204,13 @@ Page({ ...@@ -162,7 +204,13 @@ Page({
radioEvent(e) { radioEvent(e) {
let pAttr = e.target.id; let pAttr = e.target.id;
let { attr } = e.detail; let { attr } = e.detail;
let { tmlpFormData, tmlpObj, trainTmlpSuffix, tmlpCode, dailyReportTempList } = this.data; let {
tmlpFormData,
tmlpObj,
trainTmlpSuffix,
tmlpCode,
dailyReportTempList,
} = this.data;
tmlpObj["organizeTraining" + trainTmlpSuffix]?.forEach((item) => { tmlpObj["organizeTraining" + trainTmlpSuffix]?.forEach((item) => {
if (!item.name.includes("isTrainingOrganized")) { if (!item.name.includes("isTrainingOrganized")) {
item.isHide = tmlpFormData[attr] == "否" ? true : false; item.isHide = tmlpFormData[attr] == "否" ? true : false;
...@@ -305,7 +353,7 @@ Page({ ...@@ -305,7 +353,7 @@ Page({
currentYear, currentYear,
selectedMonth, selectedMonth,
selectedWeek, selectedWeek,
dailyReportTempList dailyReportTempList,
} = this.data; } = this.data;
console.log(tmlpEditList, "tmlpEditList"); console.log(tmlpEditList, "tmlpEditList");
console.log(tmlpCode, "tmlpCode"); console.log(tmlpCode, "tmlpCode");
...@@ -425,6 +473,11 @@ Page({ ...@@ -425,6 +473,11 @@ Page({
updates.isDisable = disable; updates.isDisable = disable;
updates.hasDailyValue = false; updates.hasDailyValue = false;
updates.isTodayEdit = false; updates.isTodayEdit = false;
// 当前月且可提交且未提交
if (isCurrentMonth && currentMonthData.beAbleSubmit === true) {
this.getUserStat();
}
} }
this.setData(updates); this.setData(updates);
} }
...@@ -457,7 +510,6 @@ Page({ ...@@ -457,7 +510,6 @@ Page({
}); });
} }
this.setData({ weekList }); this.setData({ weekList });
let currentWeekData = weekList.find( let currentWeekData = weekList.find(
(w) => w.week == this.data.selectedWeek (w) => w.week == this.data.selectedWeek
); );
...@@ -479,6 +531,10 @@ Page({ ...@@ -479,6 +531,10 @@ Page({
updates.isDisable = false; updates.isDisable = false;
updates.hasDailyValue = false; updates.hasDailyValue = false;
updates.isTodayEdit = false; updates.isTodayEdit = false;
if (currentWeekData.beAbleSubmit === true) {
this.getUserStat();
}
} }
} else { } else {
// Cannot operate -> Read Only // Cannot operate -> Read Only
...@@ -502,12 +558,15 @@ Page({ ...@@ -502,12 +558,15 @@ Page({
new Date().format("yyyy-MM-dd") new Date().format("yyyy-MM-dd")
) { ) {
//改---------------- //改----------------
const hasDailyValue =
timeBean.weekDayList[timeBean.selectDay].hasDailyValue || false;
this.setData({ this.setData({
isDisable: isDisable: hasDailyValue,
timeBean.weekDayList[timeBean.selectDay].hasDailyValue || false, hasDailyValue: hasDailyValue,
hasDailyValue:
timeBean.weekDayList[timeBean.selectDay].hasDailyValue || false,
}); });
if (!hasDailyValue) {
this.getUserStat();
}
} else if (tmlpEditList.includes(tmlpCode)) { } else if (tmlpEditList.includes(tmlpCode)) {
// 往期编辑 // 往期编辑
this.setData({ this.setData({
...@@ -1328,4 +1387,4 @@ Page({ ...@@ -1328,4 +1387,4 @@ Page({
this.getDateRecord(); this.getDateRecord();
this.getRecordDetail(); this.getRecordDetail();
}, },
});
\ No newline at end of file \ No newline at end of file
});
...@@ -28,7 +28,7 @@ Page({ ...@@ -28,7 +28,7 @@ Page({
}, { }, {
name: "工作日报", name: "工作日报",
url: "packageWorkspace.supervisorDaily", url: "packageWorkspace.supervisorDaily",
icon: "modifications-supervisor-daily", icon: "warranty-supervisor-daily",
reportTypeAttr: 'daily', reportTypeAttr: 'daily',
reportTypeVal: '1', reportTypeVal: '1',
trackingCode: 'regional-modifications-supervisor-daily' trackingCode: 'regional-modifications-supervisor-daily'
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!