Commit 9fabe599 by 张立顺

Merge branch 'SAAS+v5.5.3' of 192.168.3.233:saas_plus/regional-assistant into SAAS+v5.5.3

2 parents c6b21555 ada32ec5
// 日报/周报/月报 首次填写,默认填入的字段数据结构
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
......@@ -54,6 +54,16 @@ export const tempRuleFnObj = {
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: {
ruleFn: (rule, value) => {
......
// tabWorkOrder/pages/supervisorDaily/supervisorDaily.js
var util = require("~/utils/timeFormat/time-utils.js");
import { resData } from "./resData"
import { tempRuleFnObj } from "./ruleFnObj"
import fn from '~/components/GLCustForm/ruleFn'
import { resData } from "./resData";
import { tempRuleFnObj } from "./ruleFnObj";
import { reportFirstAutoObj } from "./reportFirstAuto";
import fn from "~/components/GLCustForm/ruleFn";
import api from "../../api";
import apiDefault from "~/api/api";
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/regional-assistant/'
var allRuleObj = {}
import {
setConfigInfo
} from '~/store/index'
const app = getApp()
var allRuleObj = {};
import { setConfigInfo } from "~/store/index";
const app = getApp();
Page({
/**
* 页面的初始数据
......@@ -106,6 +106,48 @@ Page({
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) {
const { routeParams } = this.data;
// 获取配置服务数据
......@@ -162,7 +204,13 @@ Page({
radioEvent(e) {
let pAttr = e.target.id;
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) => {
if (!item.name.includes("isTrainingOrganized")) {
item.isHide = tmlpFormData[attr] == "否" ? true : false;
......@@ -305,7 +353,7 @@ Page({
currentYear,
selectedMonth,
selectedWeek,
dailyReportTempList
dailyReportTempList,
} = this.data;
console.log(tmlpEditList, "tmlpEditList");
console.log(tmlpCode, "tmlpCode");
......@@ -425,6 +473,11 @@ Page({
updates.isDisable = disable;
updates.hasDailyValue = false;
updates.isTodayEdit = false;
// 当前月且可提交且未提交
if (isCurrentMonth && currentMonthData.beAbleSubmit === true) {
this.getUserStat();
}
}
this.setData(updates);
}
......@@ -457,7 +510,6 @@ Page({
});
}
this.setData({ weekList });
let currentWeekData = weekList.find(
(w) => w.week == this.data.selectedWeek
);
......@@ -479,6 +531,10 @@ Page({
updates.isDisable = false;
updates.hasDailyValue = false;
updates.isTodayEdit = false;
if (currentWeekData.beAbleSubmit === true) {
this.getUserStat();
}
}
} else {
// Cannot operate -> Read Only
......@@ -502,12 +558,15 @@ Page({
new Date().format("yyyy-MM-dd")
) {
//改----------------
const hasDailyValue =
timeBean.weekDayList[timeBean.selectDay].hasDailyValue || false;
this.setData({
isDisable:
timeBean.weekDayList[timeBean.selectDay].hasDailyValue || false,
hasDailyValue:
timeBean.weekDayList[timeBean.selectDay].hasDailyValue || false,
isDisable: hasDailyValue,
hasDailyValue: hasDailyValue,
});
if (!hasDailyValue) {
this.getUserStat();
}
} else if (tmlpEditList.includes(tmlpCode)) {
// 往期编辑
this.setData({
......@@ -1328,4 +1387,4 @@ Page({
this.getDateRecord();
this.getRecordDetail();
},
});
\ No newline at end of file
});
......@@ -28,7 +28,7 @@ Page({
}, {
name: "工作日报",
url: "packageWorkspace.supervisorDaily",
icon: "modifications-supervisor-daily",
icon: "warranty-supervisor-daily",
reportTypeAttr: 'daily',
reportTypeVal: '1',
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!