...
|
...
|
@@ -3,55 +3,42 @@ Page({ |
|
|
|
|
|
|
|
|
data: {
|
|
|
id: '',
|
|
|
textareaNum: 0,
|
|
|
name: '',
|
|
|
job: '',
|
|
|
data: '',
|
|
|
time: '',
|
|
|
work_content: '',
|
|
|
date: '',
|
|
|
join_reason: '', //加入理由
|
|
|
|
|
|
imageList: []
|
|
|
},
|
|
|
|
|
|
|
|
|
//姓名
|
|
|
setname(e) {
|
|
|
console.log(e)
|
|
|
//获取信息
|
|
|
get_info() {
|
|
|
let that = this
|
|
|
let url = 'index/index/workReportInfo'
|
|
|
let params = {
|
|
|
id: that.data.id
|
|
|
}
|
|
|
if (this.data.user_id) {
|
|
|
params.user_id = this.data.user_id
|
|
|
}
|
|
|
let header = {
|
|
|
'XX-Token': wx.getStorageSync('token')
|
|
|
}
|
|
|
app.post(url, params, header).then((res) => {
|
|
|
console.log(res)
|
|
|
this.setData({
|
|
|
name: e.detail.value
|
|
|
})
|
|
|
name: res.name,
|
|
|
work_content: res.work_content,
|
|
|
date: res.time[0],
|
|
|
|
|
|
},
|
|
|
// 工作内容
|
|
|
setmove_job(e) {
|
|
|
console.log(e)
|
|
|
|
|
|
this.setData({
|
|
|
job: e.detail.value
|
|
|
})
|
|
|
},
|
|
|
// 日期
|
|
|
setmove_data(e) {
|
|
|
console.log(e)
|
|
|
|
|
|
this.setData({
|
|
|
data: e.detail.value
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
// 参加时间
|
|
|
setmove_time(e) {
|
|
|
console.log(e)
|
|
|
|
|
|
this.setData({
|
|
|
time: e.detail.value
|
|
|
})
|
|
|
|
|
|
},
|
|
|
//汇报
|
|
|
textareaIn: function (e) {
|
|
|
console.log(e)
|
|
|
|
|
|
this.setData({
|
|
|
textareaNum: e.detail.cursor,
|
|
|
join_reason: e.detail.value
|
...
|
...
|
@@ -88,59 +75,66 @@ Page({ |
|
|
|
|
|
|
|
|
|
|
|
// 提交
|
|
|
submit(e) {
|
|
|
let that = this;
|
|
|
|
|
|
// submit(e) {
|
|
|
// let that = this;
|
|
|
|
|
|
// let url = '/index/second/applyTeam';
|
|
|
// let head = {
|
|
|
// 'XX-Token': wx.getStorageSync('token')
|
|
|
// }
|
|
|
// let params = {
|
|
|
// name: that.data.name,
|
|
|
// job: that.data.job,
|
|
|
// data: that.data.data,
|
|
|
// time: that.data.time,
|
|
|
// join_reason: that.data.join_reason
|
|
|
// }
|
|
|
|
|
|
// app.post(url, params, head).then((res) => {
|
|
|
|
|
|
// wx.showModal({
|
|
|
// title: '提示',
|
|
|
// content: '请仔细核对信息,确认无误!',
|
|
|
// confirmText: '确认提交',
|
|
|
// cancelText: '我再想想',
|
|
|
// success(res) {
|
|
|
// if (res.confirm) {
|
|
|
|
|
|
// wx.showToast({
|
|
|
// title: '提交成功,等待审核',
|
|
|
// mask: true,
|
|
|
// icon: 'none',
|
|
|
// // duration: 2000
|
|
|
// })
|
|
|
// setTimeout(function () {
|
|
|
// wx.navigateBack({
|
|
|
// delta: 0,
|
|
|
// })
|
|
|
// }, 1000)
|
|
|
// console.log('用户点击确定')
|
|
|
// } else if (res.cancel) {
|
|
|
|
|
|
// console.log('用户点击取消')
|
|
|
// }
|
|
|
// }
|
|
|
// })
|
|
|
if (that.data.imageList == '') {
|
|
|
wx.showToast({
|
|
|
title: '请选择图片',
|
|
|
icon: 'none'
|
|
|
})
|
|
|
return
|
|
|
|
|
|
} else if (that.data.join_reason == '') {
|
|
|
wx.showToast({
|
|
|
title: '请输入汇报内容',
|
|
|
icon: 'none'
|
|
|
})
|
|
|
return
|
|
|
|
|
|
// }).catch(() => {})
|
|
|
}
|
|
|
|
|
|
|
|
|
let head = {
|
|
|
'XX-Token': wx.getStorageSync('token')
|
|
|
}
|
|
|
let params = {
|
|
|
id: that.data.id,
|
|
|
work_report: that.data.join_reason,
|
|
|
work_pic: that.data.imageList
|
|
|
}
|
|
|
|
|
|
wx.showModal({
|
|
|
title: '提示',
|
|
|
content: '请仔细核对信息,确认无误!',
|
|
|
confirmText: '确认提交',
|
|
|
cancelText: '我再想想',
|
|
|
success(res) {
|
|
|
if (res.confirm) {
|
|
|
let url = '/index/index/sginIn';
|
|
|
app.post(url, params, head).then((res) => {
|
|
|
wx.showToast({
|
|
|
title: '提交成功',
|
|
|
mask: true,
|
|
|
icon: 'none',
|
|
|
// duration: 2000
|
|
|
})
|
|
|
setTimeout(function () {
|
|
|
wx.navigateBack({
|
|
|
delta: 0,
|
|
|
})
|
|
|
}, 1000)
|
|
|
console.log('用户点击确定')
|
|
|
|
|
|
}).catch(() => {})
|
|
|
|
|
|
// },
|
|
|
} else if (res.cancel) {
|
|
|
console.log('用户点击取消')
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
|
|
|
|
|
|
|
...
|
...
|
@@ -149,23 +143,20 @@ Page({ |
|
|
* 生命周期函数--监听页面加载
|
|
|
*/
|
|
|
onLoad: function (options) {
|
|
|
// console.log(options)
|
|
|
console.log(options)
|
|
|
this.setData({
|
|
|
id: options.id
|
|
|
})
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
|
*/
|
|
|
|
|
|
onReady: function () {
|
|
|
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 生命周期函数--监听页面显示
|
|
|
*/
|
|
|
onShow: function () {
|
|
|
let that = this
|
|
|
that.get_info()
|
|
|
|
|
|
},
|
|
|
|
...
|
...
|
|