Commit fed54ad5 by chenwq

feat(日报): 新增轻改区域日报功能并优化日报逻辑

- 添加轻改区域日报模板及相关配置
- 修改日报名称从"延保日报"为"延保区域日报"
- 增加日报模板参数传递和标题动态显示
- 添加轻改日报的校验规则和表单处理逻辑
- 优化日报编辑和提交功能,支持不同模板类型
1 parent 31c9c8cb
...@@ -177,9 +177,12 @@ Component({ ...@@ -177,9 +177,12 @@ Component({
], ],
menuList: [ menuList: [
{ {
menuText: '轻改日报', menuText: '轻改区域日报',
icon: 'icon-market', icon: 'lightDaily',
path: 'tabWorkOrder.supervisorDaily', path: 'tabWorkOrder.supervisorDaily',
params: {
templateCode: 'qinggai-temp-001'
},
recordId: 18, recordId: 18,
noCheckdailyReport: true noCheckdailyReport: true
} }
...@@ -611,9 +614,9 @@ Component({ ...@@ -611,9 +614,9 @@ Component({
}) })
} }
// 区域运营/飞行督导 // 区域运营/飞行督导
if ((userInfo?.loginRole == 3 || userInfo?.loginRole == 6) && menuList.every((item) => item.menuText != '延保日报')) { if ((userInfo?.loginRole == 3 || userInfo?.loginRole == 6) && menuList.every((item) => item.menuText != '延保区域日报')) {
menuList.push({ menuList.push({
menuText: "延保日报", menuText: "延保区域日报",
path: "tabWorkOrder.supervisorDaily", path: "tabWorkOrder.supervisorDaily",
icon: "supervisorDaily", icon: "supervisorDaily",
}) })
...@@ -1119,11 +1122,11 @@ Component({ ...@@ -1119,11 +1122,11 @@ Component({
message message
} = res } = res
if (code == 0) { if (code == 0) {
let index = menuList.findIndex((v) => v.menuText == "延保日报"); let index = menuList.findIndex((v) => v.menuText == "延保区域日报");
if (index > -1) menuList.splice(index, 1); if (index > -1) menuList.splice(index, 1);
if (data && menuList.every((item) => item.menuText != "延保日报")) { if (data && menuList.every((item) => item.menuText != "延保区域日报")) {
menuList.push({ menuList.push({
menuText: "延保日报", menuText: "延保区域日报",
path: "tabWorkOrder.supervisorDaily", path: "tabWorkOrder.supervisorDaily",
icon: "supervisorDaily" icon: "supervisorDaily"
}); });
...@@ -1313,7 +1316,7 @@ Component({ ...@@ -1313,7 +1316,7 @@ Component({
if (item.path == 'tabWorkOrder.mentorshipManage' && userInfo?.loginRole == 6) { if (item.path == 'tabWorkOrder.mentorshipManage' && userInfo?.loginRole == 6) {
wx.$track.setTrackData(0, 'mentorship_page', {}, '', 0) wx.$track.setTrackData(0, 'mentorship_page', {}, '', 0)
} }
// 飞行督导/导师点击延保日报入口埋点 // 飞行督导/导师点击延保区域日报入口埋点
if (item.path == 'tabWorkOrder.supervisorDaily' && (userInfo?.loginRole == 6 || mentorFlag)) { if (item.path == 'tabWorkOrder.supervisorDaily' && (userInfo?.loginRole == 6 || mentorFlag)) {
wx.$track.setTrackData(0, 'supervisor_daily_page', {}, '', 0) wx.$track.setTrackData(0, 'supervisor_daily_page', {}, '', 0)
} }
......
...@@ -531,7 +531,7 @@ Page({ ...@@ -531,7 +531,7 @@ Page({
) { ) {
wx.$track.setTrackData(0, 'mentorship_page', {}, '', 1) wx.$track.setTrackData(0, 'mentorship_page', {}, '', 1)
} }
// 飞行督导/导师点击延保日报入口埋点 // 飞行督导/导师点击延保区域日报入口埋点
if ( if (
item.url == 'tabWorkOrder.supervisorDaily' && item.url == 'tabWorkOrder.supervisorDaily' &&
(userInfo?.loginRole == 6 || mentorFlag) (userInfo?.loginRole == 6 || mentorFlag)
...@@ -1324,11 +1324,11 @@ Page({ ...@@ -1324,11 +1324,11 @@ Page({
.then(res => { .then(res => {
let { code, data, message } = res let { code, data, message } = res
if (code == 0) { if (code == 0) {
let index = menu.findIndex(v => v.name == '延保日报') let index = menu.findIndex(v => v.name == '延保区域日报')
if (index > -1) menu.splice(index, 1) if (index > -1) menu.splice(index, 1)
if (data && menu.every(item => item.name != '延保日报')) { if (data && menu.every(item => item.name != '延保区域日报')) {
menu.push({ menu.push({
name: '延保日报', name: '延保区域日报',
url: 'tabWorkOrder.supervisorDaily', url: 'tabWorkOrder.supervisorDaily',
icon: 'supervisorDaily', icon: 'supervisorDaily',
recordId: 15 recordId: 15
...@@ -1499,10 +1499,10 @@ Page({ ...@@ -1499,10 +1499,10 @@ Page({
// 区域运营/飞行督导 // 区域运营/飞行督导
if ( if (
(userInfo?.loginRole == 3 || userInfo?.loginRole == 6) && (userInfo?.loginRole == 3 || userInfo?.loginRole == 6) &&
menu.every(item => item.name != '延保日报') menu.every(item => item.name != '延保区域日报')
) { ) {
menu.push({ menu.push({
name: '延保日报', name: '延保区域日报',
url: 'tabWorkOrder.supervisorDaily', url: 'tabWorkOrder.supervisorDaily',
icon: 'supervisorDaily', icon: 'supervisorDaily',
recordId: 15 recordId: 15
......
...@@ -81,10 +81,13 @@ export default { ...@@ -81,10 +81,13 @@ export default {
icon: 'icon-market' icon: 'icon-market'
}, },
{ {
name: '轻改日报', name: '轻改区域日报',
url: 'tabWorkOrder.supervisorDaily', url: 'tabWorkOrder.supervisorDaily',
params: {
templateCode: 'qinggai-temp-001'
},
recordId: 18, recordId: 18,
icon: 'icon-market', icon: 'lightDaily',
noCheckdailyReport: true noCheckdailyReport: true
} }
], ],
......
...@@ -216,6 +216,89 @@ export const tempRuleFnObj = { ...@@ -216,6 +216,89 @@ export const tempRuleFnObj = {
} }
}, },
}, },
/** 今日总结 */
todayReport: {
/** 今日区域合计交车 */
todayRegionalTotalDeliveries: {
ruleFn: (rule, value) => {
if (value < 0 || value > 1000) {
return { message: '今日区域合计交车请输入0-1000' }
}
return /^$|^\d{1}$|^[1-9]\d{0,3}$/.test(value) ? null : { message: '今日区域合计交车请输入四位数字' }
}
},
/** 今日区域合计升级 */
todayRegionalTotalUpgrades: {
ruleFn: (rule, value) => {
if (value < 0 || value > 1000) {
return { message: '今日区域合计升级请输入0-1000' }
}
return /^$|^\d{1}$|^[1-9]\d{0,3}$/.test(value) ? null : { message: '今日区域合计升级请输入四位数字' }
}
},
/** 今日区域升级率 */
todayRegionalUpgradeRate: {
ruleFn: (rule, value) => {
const maxValue = 100
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: '今日区域升级率请输入仅有两位小数的数字' }
}
},
/** 今日区域合计产值 */
todayRegionalTotalOutput: {
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: '今日区域合计产值请输入仅有两位小数的数字' }
}
},
/** 本月区域合计产值 */
monthRegionalTotalOutput: {
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: '本月区域合计产值请输入仅有两位小数的数字' }
}
},
/** 本月区域产值目标 */
monthRegionalOutputTarget: {
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: '本月区域产值目标请输入仅有两位小数的数字' }
}
},
/** 本月时间进度 */
monthTimeProgress: {
ruleFn: (rule, value) => {
const maxValue = 100
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: '本月时间进度请输入仅有两位小数的数字' }
}
},
/** 本区域预算达成率 */
regionalBudgetAchievementRate: {
ruleFn: (rule, value) => {
const maxValue = 100
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: '本区域预算达成率请输入仅有两位小数的数字' }
}
}
},
/** 工作总结 */
workReport: {}
/** 工作总结 */ /** 工作总结 */
// workSummary: { // workSummary: {
// /** 今日总结 */ // /** 今日总结 */
......
...@@ -24,7 +24,11 @@ Page({ ...@@ -24,7 +24,11 @@ Page({
isDisable: false, isDisable: false,
hasDailyValue: false, hasDailyValue: false,
isUpload: false, isUpload: false,
isTodayEdit: false,
// userInfo: {}, // userInfo: {},
// 轻改日报模版code
qgReportCode: null,
title: '',
// 模版表单提交数据 // 模版表单提交数据
tmlpFormData: {}, tmlpFormData: {},
timeBean: {}, timeBean: {},
...@@ -71,7 +75,24 @@ Page({ ...@@ -71,7 +75,24 @@ Page({
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
async onLoad(options) { onLoad(options) {
console.log(options, '-----')
if(options.refresh) {
this.setData({
qgReportCode: options?.templateCode || null,
title: options?.templateCode ? '轻改区域日报' : '延保区域日报'
})
this.initData(options)
}
wx.$router.getData((route) => {
this.setData({
qgReportCode: route?.params?.templateCode || null,
title: route?.params?.templateCode ? '轻改区域日报' : '延保区域日报'
})
this.initData(options)
})
},
async initData(options) {
// 获取配置服务数据 // 获取配置服务数据
let baseConfigData = await setConfigInfo(app.globalData) let baseConfigData = await setConfigInfo(app.globalData)
this.setData({ this.setData({
...@@ -123,7 +144,7 @@ Page({ ...@@ -123,7 +144,7 @@ Page({
} }
const pAttrList = Object.keys(allRuleObj) const pAttrList = Object.keys(allRuleObj)
console.log(tmlpCode, 'pAttrList---') console.log(tmlpCode, 'pAttrList---')
if (tmlpCode == 'uuid-temp-001') { if (['qinggai-temp-001', 'uuid-temp-001'].includes(tmlpCode)) {
pAttrList.forEach(pAttrItem => { pAttrList.forEach(pAttrItem => {
tmlpObj[pAttrItem].forEach(item => { tmlpObj[pAttrItem].forEach(item => {
if (!item.name.includes('dayOffStatus')) { if (!item.name.includes('dayOffStatus')) {
...@@ -174,10 +195,13 @@ Page({ ...@@ -174,10 +195,13 @@ Page({
}, },
/** 查询用户指定日期的日报详情 */ /** 查询用户指定日期的日报详情 */
getRecordDetail() { getRecordDetail() {
let { timeBean } = this.data let { timeBean, qgReportCode } = this.data
let params = { let params = {
date: timeBean.weekDayList[timeBean.selectDay].date date: timeBean.weekDayList[timeBean.selectDay].date
} }
if(qgReportCode) {
params.templateCode = qgReportCode
}
wx.$util.showLoading() wx.$util.showLoading()
api.getRecordDetail(params).then(res => { api.getRecordDetail(params).then(res => {
if (res.data == null) { if (res.data == null) {
...@@ -200,7 +224,7 @@ Page({ ...@@ -200,7 +224,7 @@ Page({
/** 查询用户指定日期范围内填写日报的日期 */ /** 查询用户指定日期范围内填写日报的日期 */
getDateRecord() { getDateRecord() {
let { timeBean, isDisable, tmlpEditList, tmlpCode } = this.data let { timeBean, isDisable, tmlpEditList, tmlpCode, qgReportCode } = this.data
console.log(tmlpEditList, 'tmlpEditList') console.log(tmlpEditList, 'tmlpEditList')
console.log(tmlpCode, 'tmlpCode') console.log(tmlpCode, 'tmlpCode')
// console.log(timeBean.weekDayList, 'timeBean.weekDayList--') // console.log(timeBean.weekDayList, 'timeBean.weekDayList--')
...@@ -208,8 +232,12 @@ Page({ ...@@ -208,8 +232,12 @@ Page({
sDate: timeBean.reportStartDate, sDate: timeBean.reportStartDate,
eDate: timeBean.reportEndDate eDate: timeBean.reportEndDate
} }
if(qgReportCode) {
params.templateCode = qgReportCode
}
this.setData({ this.setData({
hasDailyValue: false hasDailyValue: false,
isTodayEdit: ['qinggai-temp-001', 'uuid-temp-001'].includes(tmlpCode)
}) })
wx.$util.showLoading() wx.$util.showLoading()
api.getDateRecord(params).then(res => { api.getDateRecord(params).then(res => {
...@@ -573,6 +601,10 @@ Page({ ...@@ -573,6 +601,10 @@ Page({
}, },
getStaffList(staffName, suffix) { getStaffList(staffName, suffix) {
const { qgReportCode } = this.data
if(qgReportCode == 'qinggai-temp-001') {
return true
}
var trainSuffix = suffix || this.data.trainTmlpSuffix var trainSuffix = suffix || this.data.trainTmlpSuffix
let that = this let that = this
let params = { let params = {
...@@ -729,12 +761,13 @@ Page({ ...@@ -729,12 +761,13 @@ Page({
}, },
handleCancel() { handleCancel() {
const { qgReportCode } = this.data
this.changeVal('isDisable', true) this.changeVal('isDisable', true)
this.onLoad() this.onLoad({ refresh: true, templateCode: qgReportCode })
}, },
handleConfirm() { handleConfirm() {
let { isConfirm } = this.data let { isConfirm, qgReportCode } = this.data
if (isConfirm) { if (isConfirm) {
return true return true
} }
...@@ -768,6 +801,9 @@ Page({ ...@@ -768,6 +801,9 @@ Page({
let params = { let params = {
formJson: this.dealParams() formJson: this.dealParams()
} }
if(qgReportCode) {
params.templateCode = qgReportCode
}
console.log(JSON.parse(params.formJson), 'params-----') console.log(JSON.parse(params.formJson), 'params-----')
// 删----要给新字段加校验++++ // 删----要给新字段加校验++++
// this.setData({ // this.setData({
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<view class="layout {{ flag ? 'opacity' : '' }}" v-loading="true"> <view class="layout {{ flag ? 'opacity' : '' }}" v-loading="true">
<navigation-bar bindback="jump" bindnavbarReady="navbarReady" showBack="true"> <navigation-bar bindback="jump" bindnavbarReady="navbarReady" showBack="true">
<view class="navigation-title"> <view class="navigation-title">
<view class="navigation-title-text text-hide">延保日报</view> <view class="navigation-title-text text-hide">{{title}}</view>
</view> </view>
</navigation-bar> </navigation-bar>
<view style="margin-top:{{ navBarHeight }}px"> <view style="margin-top:{{ navBarHeight }}px">
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
<view class="confirm text-center" bindtap="handleConfirm">提交</view> <view class="confirm text-center" bindtap="handleConfirm">提交</view>
</view> </view>
</view> </view>
<view class="btns two-btns {{ isFullSucreen ? 'isFullSucreen-btn':'' }}" wx:if="{{tmlpCode == 'uuid-temp-001' && hasDailyValue}}"> <view class="btns two-btns {{ isFullSucreen ? 'isFullSucreen-btn':'' }}" wx:if="{{isTodayEdit && hasDailyValue}}">
<view class="btns-con" wx:if="{{isDisable}}"> <view class="btns-con" wx:if="{{isDisable}}">
<view class="confirm text-center" style="width: 100%;" bindtap="handleEdit">修改</view> <view class="confirm text-center" style="width: 100%;" bindtap="handleEdit">修改</view>
</view> </view>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!