Commit a3eb2fe0 by chenwq

带教培训

1 parent 16e6bcd7
...@@ -62,21 +62,29 @@ Page({ ...@@ -62,21 +62,29 @@ Page({
flag: true, flag: true,
}); });
}, },
dealOrganizeTraining() {
const params = {
target: {
id: 'organizeTraining'
},
detail: {
attr: 'isTrainingOrganized'
}
}
this.radioEvent(params)
},
radioEvent(e) { radioEvent(e) {
console.log(e, 'radioEvent');
let pAttr = e.target.id let pAttr = e.target.id
let { let {
attr attr
} = e.detail } = e.detail
let { tmlpFormData, tmlpObj } = this.data let { tmlpFormData, tmlpObj } = this.data
tmlpObj.organizeTraining.forEach(item => { tmlpObj.organizeTraining?.forEach(item => {
if (item.name != 'isTrainingOrganized') { if (item.name != 'isTrainingOrganized') {
item.isHide = tmlpFormData[attr] == '否' ? true : false item.isHide = tmlpFormData[attr] == '否' ? true : false
} }
}) })
console.log(pAttr)
console.log(allRuleObj[pAttr])
if (allRuleObj[pAttr] && pAttr == 'organizeTraining') { if (allRuleObj[pAttr] && pAttr == 'organizeTraining') {
let keyList = Object.keys(allRuleObj[pAttr]) let keyList = Object.keys(allRuleObj[pAttr])
keyList.forEach(item => { keyList.forEach(item => {
...@@ -99,24 +107,6 @@ Page({ ...@@ -99,24 +107,6 @@ Page({
navBarHeight, navBarHeight,
}); });
}, },
// initData() {
// wx.$util.showLoading()
// // 根据不同角色做页面回显
// this.setData({
// timeBean: util.getWeekDayList(this.data.selectWeek),
// });
// api.getMyTemplate({}).then(res => {
// console.log(res, 'res---')
// this.setData({
// tmlpInitData: res.data.types
// // tmlpInitData: resData.types
// })
// this.getDynamicForm()
// this.setReportDate();
// }).finally(() => {
// wx.hideLoading()
// })
// },
onClickShow(e) { onClickShow(e) {
const { name } = e.target.dataset const { name } = e.target.dataset
...@@ -429,6 +419,7 @@ Page({ ...@@ -429,6 +419,7 @@ Page({
if (staffIdx != -1) { if (staffIdx != -1) {
this.getStaffList(staffIdx) this.getStaffList(staffIdx)
} }
this.dealOrganizeTraining()
// this.changeFormData() // this.changeFormData()
// this.recoveryData() // this.recoveryData()
}, },
...@@ -499,7 +490,7 @@ Page({ ...@@ -499,7 +490,7 @@ Page({
}) })
if (res.confirm) { if (res.confirm) {
api.saveTempReport(params).then(res => { api.saveTempReport(params).then(res => {
if(res.code == '0') { if (res.code == '0') {
that.getRecordDetail() that.getRecordDetail()
} }
wx.$util.showToast(res.message) wx.$util.showToast(res.message)
...@@ -513,7 +504,7 @@ Page({ ...@@ -513,7 +504,7 @@ Page({
// var { tabActive } = this.data // var { tabActive } = this.data
// let formRule = allRuleObj[tabActive] // let formRule = allRuleObj[tabActive]
let { isConfirm } = this.data let { isConfirm } = this.data
if(isConfirm) { if (isConfirm) {
return true return true
} }
this.setData({ this.setData({
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!