add miniprogram
This commit is contained in:
277
miniprogram/pages/apply/apply.js
Normal file
277
miniprogram/pages/apply/apply.js
Normal file
@@ -0,0 +1,277 @@
|
||||
// pages/apply/apply.js
|
||||
var dateTimePicker = require('./dateTimePicker.js');
|
||||
Page({
|
||||
data: {
|
||||
isMaskWindowShow: false,
|
||||
maskWindowList: ['时间太早', '时间太晚', '距离太远', '交通不方便', '其他(输入)', '没有原因'],
|
||||
selectIndex: -1,
|
||||
isMaskWindowInputShow: false,
|
||||
maskWindowInputValue: "",
|
||||
type: '',
|
||||
typeTitle: '',
|
||||
transport: '',
|
||||
|
||||
date: '2018-10-01',
|
||||
time: '12:00',
|
||||
dateTimeArray: null,
|
||||
dateTime: null,
|
||||
dateTimeArray1: null,
|
||||
dateTime1: null,
|
||||
dateTimeArray2: null,
|
||||
dateTime2: null,
|
||||
startYear: 2000,
|
||||
endYear: 2050,
|
||||
date1: '',
|
||||
date2: '',
|
||||
|
||||
issue: '',
|
||||
place: '',
|
||||
id: wx.getStorageSync('id')
|
||||
},
|
||||
issue: function (e) {
|
||||
this.setData({
|
||||
issue: e.detail.value
|
||||
});
|
||||
},
|
||||
place: function (e) {
|
||||
this.setData({
|
||||
place: e.detail.value
|
||||
});
|
||||
},
|
||||
report: function () {
|
||||
var data = this.data;
|
||||
this.setData({
|
||||
date1: data.dateTimeArray1[0][data.dateTime1[0]] + "-" + data.dateTimeArray1[1][data.dateTime1[1]] + "-" +
|
||||
data.dateTimeArray1[2][data.dateTime1[2]] + " " + data.dateTimeArray1[3][data.dateTime1[3]] + ":" + data.dateTimeArray1[4][data.dateTime1[4]],
|
||||
date2: data.dateTimeArray2[0][data.dateTime2[0]] + "-" + data.dateTimeArray2[1][data.dateTime2[1]] + "-" +
|
||||
data.dateTimeArray2[2][data.dateTime2[2]] + " " + data.dateTimeArray2[3][data.dateTime2[3]] + ":" + data.dateTimeArray2[4][data.dateTime2[4]]
|
||||
})
|
||||
if(data.issue==''){
|
||||
wx.showToast({
|
||||
title: '请填写请假事由',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
}else if(data.transport==''){
|
||||
wx.showToast({
|
||||
title: '请填写交通方式',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
}else if(data.place==''){
|
||||
wx.showToast({
|
||||
title: '请填写目的地',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
}else if (data.dateTime1[0] <= data.dateTime2[0]) {
|
||||
if (data.dateTime1[1] > data.dateTime2[1] || (data.dateTime1[1] <= data.dateTime2[1] && data.dateTime1[2] > data.dateTime2[2])) {
|
||||
wx.showToast({
|
||||
title: '结束日期不能早于开始日期',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
} else if (data.dateTime1[1] == data.dateTime2[1] && data.dateTime1[2] == data.dateTime2[2]) {
|
||||
if (data.dateTime1[3] > data.dateTime2[3] || (data.dateTime1[3] <= data.dateTime2[3] && data.dateTime1[4] > data.dateTime2[4])) {
|
||||
wx.showToast({
|
||||
title: '结束时间不能早于开始时间',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
} else {
|
||||
this.apply();
|
||||
}
|
||||
} else {
|
||||
this.apply();
|
||||
}
|
||||
} else {
|
||||
wx.showToast({
|
||||
title: '结束日期不能早于开始日期',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
}
|
||||
},
|
||||
apply: function () {
|
||||
var data = this.data;
|
||||
wx.request({
|
||||
url: 'http://127.0.0.1:8080/apply/applySub',
|
||||
data: {
|
||||
stu_id: data.id,
|
||||
issue: data.issue,
|
||||
transport: data.transport,
|
||||
place: data.place,
|
||||
start_time: data.date1,
|
||||
end_time: data.date2
|
||||
},
|
||||
success: function (d) {
|
||||
if (d.data == "申请成功") {
|
||||
wx.showToast({
|
||||
title: d.data,
|
||||
icon: 'success',
|
||||
duration: 2000,
|
||||
success: function () {
|
||||
}
|
||||
})
|
||||
} else {
|
||||
wx.showToast({
|
||||
title: d.data,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
chooseTransport: function () {
|
||||
this.setData({
|
||||
type: 'transport',
|
||||
typeTitle: '交通方式',
|
||||
maskWindowList: ['飞机', '动车', '火车', '大巴', '私家车', '自行车', '步行', '其他(输入)']
|
||||
})
|
||||
this.showMaskWindow()
|
||||
},
|
||||
|
||||
//弹框以外区域点击
|
||||
maskWindowBgClick: function (e) {
|
||||
this.dismissMaskWindow();
|
||||
},
|
||||
|
||||
//弹窗区域点击事件
|
||||
clickTap: function (e) {
|
||||
|
||||
},
|
||||
|
||||
//切换选择项事件
|
||||
maskWindowTableSelect: function (e) {
|
||||
var index = e.currentTarget.dataset.windowIndex;
|
||||
this.setData({
|
||||
selectIndex: e.currentTarget.dataset.windowIndex,
|
||||
isMaskWindowInputShow: index == 7
|
||||
})
|
||||
},
|
||||
|
||||
//输入框输入绑定事件
|
||||
maskWindowInput: function (e) {
|
||||
var value = e.detail.value;
|
||||
this.setData({
|
||||
maskWindowInputValue: value
|
||||
})
|
||||
},
|
||||
|
||||
maskWindowOk: function (e) {
|
||||
var index = this.data.selectIndex;
|
||||
var text;
|
||||
if (this.data.type == 'transport') {
|
||||
if (index == 7) {
|
||||
text = this.data.maskWindowInputValue;
|
||||
} else {
|
||||
text = this.data.maskWindowList[index];
|
||||
}
|
||||
this.setData({
|
||||
transport: text
|
||||
})
|
||||
}
|
||||
this.dismissMaskWindow();
|
||||
},
|
||||
|
||||
maskWindowCancel: function (e) {
|
||||
this.dismissMaskWindow();
|
||||
},
|
||||
|
||||
// 显示蒙版弹窗
|
||||
showMaskWindow: function () {
|
||||
this.setData({
|
||||
isMaskWindowShow: true,
|
||||
selectIndex: -1,
|
||||
isMaskWindowInputShow: false,
|
||||
maskWindowInputValue: ""
|
||||
})
|
||||
},
|
||||
|
||||
// 隐藏蒙版窗体
|
||||
dismissMaskWindow: function () {
|
||||
this.setData({
|
||||
isMaskWindowShow: false,
|
||||
selectIndex: -1,
|
||||
isMaskWindowInputShow: false,
|
||||
maskWindowInputValue: ""
|
||||
})
|
||||
},
|
||||
onLoad() {
|
||||
// 获取完整的年月日 时分秒,以及默认显示的数组
|
||||
var obj = dateTimePicker.dateTimePicker(this.data.startYear, this.data.endYear);
|
||||
var obj1 = dateTimePicker.dateTimePicker(this.data.startYear, this.data.endYear);
|
||||
var obj2 = dateTimePicker.dateTimePicker(this.data.startYear, this.data.endYear);
|
||||
// 精确到分的处理,将数组的秒去掉
|
||||
var lastArray1 = obj1.dateTimeArray.pop();
|
||||
var lastTime1 = obj1.dateTime.pop();
|
||||
var lastArray2 = obj2.dateTimeArray.pop();
|
||||
var lastTime2 = obj2.dateTime.pop();
|
||||
obj2.dateTime[3] += 2
|
||||
this.setData({
|
||||
dateTime: obj.dateTime,
|
||||
dateTimeArray: obj.dateTimeArray,
|
||||
dateTimeArray1: obj1.dateTimeArray,
|
||||
dateTime1: obj1.dateTime,
|
||||
dateTimeArray2: obj2.dateTimeArray,
|
||||
dateTime2: obj2.dateTime,
|
||||
});
|
||||
},
|
||||
changeDate(e) {
|
||||
this.setData({
|
||||
date: e.detail.value
|
||||
});
|
||||
},
|
||||
changeTime(e) {
|
||||
this.setData({
|
||||
time: e.detail.value
|
||||
});
|
||||
},
|
||||
changeDateTime(e) {
|
||||
this.setData({
|
||||
dateTime: e.detail.value
|
||||
});
|
||||
},
|
||||
changeDateTime1(e) {
|
||||
this.setData({
|
||||
dateTime1: e.detail.value
|
||||
});
|
||||
},
|
||||
changeDateTime2(e) {
|
||||
this.setData({
|
||||
dateTime2: e.detail.value
|
||||
});
|
||||
},
|
||||
changeDateTimeColumn(e) {
|
||||
var arr = this.data.dateTime,
|
||||
dateArr = this.data.dateTimeArray;
|
||||
arr[e.detail.column] = e.detail.value;
|
||||
dateArr[2] = dateTimePicker.getMonthDay(dateArr[0][arr[0]], dateArr[1][arr[1]]);
|
||||
this.setData({
|
||||
dateTimeArray: dateArr,
|
||||
dateTime: arr
|
||||
});
|
||||
},
|
||||
changeDateTimeColumn1(e) {
|
||||
var arr = this.data.dateTime1,
|
||||
dateArr = this.data.dateTimeArray1;
|
||||
arr[e.detail.column] = e.detail.value;
|
||||
dateArr[2] = dateTimePicker.getMonthDay(dateArr[0][arr[0]], dateArr[1][arr[1]]);
|
||||
this.setData({
|
||||
dateTimeArray1: dateArr,
|
||||
dateTime1: arr
|
||||
});
|
||||
},
|
||||
changeDateTimeColumn2(e) {
|
||||
var arr = this.data.dateTime2,
|
||||
dateArr = this.data.dateTimeArray2;
|
||||
arr[e.detail.column] = e.detail.value;
|
||||
dateArr[2] = dateTimePicker.getMonthDay(dateArr[0][arr[0]], dateArr[1][arr[1]]);
|
||||
this.setData({
|
||||
dateTimeArray2: dateArr,
|
||||
dateTime2: arr
|
||||
});
|
||||
}
|
||||
})
|
3
miniprogram/pages/apply/apply.json
Normal file
3
miniprogram/pages/apply/apply.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
}
|
73
miniprogram/pages/apply/apply.wxml
Normal file
73
miniprogram/pages/apply/apply.wxml
Normal file
@@ -0,0 +1,73 @@
|
||||
<page-meta root-font-size="system" />
|
||||
<view>
|
||||
<view class="weui-form" style="padding:20px 0">
|
||||
<view class="weui-form__text-area">
|
||||
<h2 class="weui-form__title">出校申请</h2>
|
||||
</view>
|
||||
<view class="weui-form__control-area" style="margin-top: 20px;margin-bottom: 0;">
|
||||
<view class="weui-cells__group weui-cells__group_form">
|
||||
<view class="weui-cells__title">1.请假事由</view>
|
||||
<view class="weui-cell weui-cell_active">
|
||||
<view class="weui-cell__bd">
|
||||
<input class="weui-input" placeholder-class="weui-input__placeholder" bindinput='issue' />
|
||||
</view>
|
||||
</view>
|
||||
<view class="weui-cells__title">2.交通方式</view>
|
||||
<view class="weui-cell weui-cell_active">
|
||||
<view class="weui-cell__bd" bindtap="chooseTransport">
|
||||
<view class="weui-input" placeholder-class="weui-input__placeholder">{{transport}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="weui-cells__title">3.目的地</view>
|
||||
<view class="weui-cell weui-cell_active">
|
||||
<view class="weui-cell__bd">
|
||||
<input class="weui-input" placeholder-class="weui-input__placeholder" bindinput='place' />
|
||||
</view>
|
||||
</view>
|
||||
<view class="weui-cells__title">4.开始时间</view>
|
||||
<view class="weui-cell weui-cell_active">
|
||||
<view class="weui-cell__bd">
|
||||
<view class="weui-input" placeholder-class="weui-input__placeholder">
|
||||
<picker mode="multiSelector" value="{{dateTime1}}" bindchange="changeDateTime1" bindcolumnchange="changeDateTimeColumn1" range="{{dateTimeArray1}}">
|
||||
<view class="tui-picker-detail">
|
||||
{{dateTimeArray1[0][dateTime1[0]]}}-{{dateTimeArray1[1][dateTime1[1]]}}-{{dateTimeArray1[2][dateTime1[2]]}} {{dateTimeArray1[3][dateTime1[3]]}}:{{dateTimeArray1[4][dateTime1[4]]}}
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="weui-cells__title">5.结束时间</view>
|
||||
<view class="weui-cell weui-cell_active">
|
||||
<view class="weui-cell__bd">
|
||||
<view class="weui-input" placeholder-class="weui-input__placeholder">
|
||||
<picker mode="multiSelector" value="{{dateTime2}}" bindchange="changeDateTime2" bindcolumnchange="changeDateTimeColumn2" range="{{dateTimeArray2}}">
|
||||
<view class="tui-picker-detail" bindtap='date2'>
|
||||
{{dateTimeArray2[0][dateTime2[0]]}}-{{dateTimeArray2[1][dateTime2[1]]}}-{{dateTimeArray2[2][dateTime2[2]]}} {{dateTimeArray2[3][dateTime2[3]]}}:{{dateTimeArray2[4][dateTime2[4]]}}
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="weui-form__opr-area" style="margin-bottom: 0;">
|
||||
<a aria-role="button" class="weui-btn weui-btn_primary" catchtap="report" style="margin-top: 50px;">提交申请</a>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class='maskWindow' wx:if="{{isMaskWindowShow}}" catchtap='maskWindowBgClick' catchtouchmove='move'>
|
||||
<view class='maskWindowContent' catchtap='clickTap'>
|
||||
<text class="maskWindowTitleText">{{typeTitle}}</text>
|
||||
<view class='maskWindowList' wx:for='{{maskWindowList}}' wx:for-index='index' wx:if='{{index%2===0}}'>
|
||||
<view class="maskWindowText {{index == selectIndex? 'maskWindowText_selected' : 'maskWindowText_unselected'}}" catchtap='maskWindowTableSelect' data-window-Index='{{index}}'>{{maskWindowList[index]}}</view>
|
||||
<view class="maskWindowText {{index + 1 == selectIndex? 'maskWindowText_selected' : 'maskWindowText_unselected'}}" catchtap='maskWindowTableSelect' data-window-Index='{{index+1}}'>{{maskWindowList[index+1]}}</view>
|
||||
</view>
|
||||
<view class='maskWindowInputView'>
|
||||
<input class='maskWindowInput' maxlength='100' placeholder='请输入其他原因' hidden='{{!isMaskWindowInputShow}}' bindinput='maskWindowInput'></input>
|
||||
</view>
|
||||
<view class='maskWindowBtnView'>
|
||||
<view class='maskWindowBtn' catchtap='maskWindowOk'>确定</view>
|
||||
<view class='maskWindowBtn' catchtap='maskWindowCancel'>取消</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
72
miniprogram/pages/apply/apply.wxss
Normal file
72
miniprogram/pages/apply/apply.wxss
Normal file
@@ -0,0 +1,72 @@
|
||||
/* pages/apply/apply.wxss */
|
||||
.weui-cells__title{
|
||||
font-size: 17px;
|
||||
}
|
||||
.maskWindow{
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
position: fixed;
|
||||
background-color: rgba(0, 0, 0, .2);
|
||||
z-index:2;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
.maskWindowContent {
|
||||
padding: 20rpx 0;
|
||||
width: 100%;
|
||||
background: #ffffff;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space - around;
|
||||
align-items: center;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
}
|
||||
.maskWindowTitleText {
|
||||
padding: 10rpx 20rpx;
|
||||
margin: 10rpx;
|
||||
font-size: 16px;
|
||||
width: 80%;
|
||||
}
|
||||
.maskWindowList {
|
||||
width: 80%;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
.maskWindowText {
|
||||
padding: 10rpx 20rpx;
|
||||
margin: 8rpx;
|
||||
width: 50%;
|
||||
font-size: 14px;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
.maskWindowText_selected {
|
||||
border: 1px solid #15c261;
|
||||
}
|
||||
.maskWindowText_unselected {
|
||||
border: 1px solid lightgray;
|
||||
}
|
||||
.maskWindowInputView {
|
||||
width: 80%;
|
||||
}
|
||||
.maskWindowInput {
|
||||
margin: 15rpx 0;
|
||||
padding: 10rpx 20rpx;
|
||||
font-size: 14px;
|
||||
border: 1px solid lightgray;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
.maskWindowBtnView {
|
||||
width: 80%;
|
||||
margin-top: 20rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex - end;
|
||||
}
|
||||
.maskWindowBtn {
|
||||
padding: 10rpx 50rpx;
|
||||
margin: 20rpx;
|
||||
font-size: 14px;
|
||||
border-radius: 10rpx;
|
||||
border: 1px solid #15c261;
|
||||
}
|
136
miniprogram/pages/apply/applyReplay.js
Normal file
136
miniprogram/pages/apply/applyReplay.js
Normal file
@@ -0,0 +1,136 @@
|
||||
// pages/other/feedback.js
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
List:'',
|
||||
replay: [],
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
doReplay: function (e) {
|
||||
this.setData({
|
||||
replay: e.detail.value
|
||||
})
|
||||
},
|
||||
agree:function (event) {
|
||||
var that = this
|
||||
wx.request({
|
||||
url: 'http://127.0.0.1:8080/apply/applyReplay',
|
||||
data: {
|
||||
id:event.target.dataset.id,
|
||||
replay:event.target.dataset.replay,
|
||||
reasonId: 99
|
||||
},
|
||||
success: function (d) {
|
||||
wx.showToast({
|
||||
title: d.data.msg,
|
||||
icon: 'success',
|
||||
duration: 2000,
|
||||
success: function () {
|
||||
}
|
||||
})
|
||||
that.onShow();
|
||||
}
|
||||
})
|
||||
},
|
||||
disagree:function (event) {
|
||||
var that = this
|
||||
wx.showActionSheet({
|
||||
itemList: ['格式错误','出行地点不允许','时间填写错误'],
|
||||
success:function (res) {
|
||||
if(!res.cancel){
|
||||
wx.request({
|
||||
url: 'http://127.0.0.1:8080/apply/applyReplay',
|
||||
data: {
|
||||
id:event.target.dataset.id,
|
||||
replay:event.target.dataset.replay,
|
||||
reasonId:res.tapIndex,
|
||||
},
|
||||
success: function (d) {
|
||||
wx.showToast({
|
||||
title: d.data.msg,
|
||||
icon: 'success',
|
||||
duration: 2000,
|
||||
success: function () {
|
||||
that.onShow();
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
var that = this;
|
||||
wx.request({
|
||||
url: 'http://127.0.0.1:8080/apply/applyListNoReplay',
|
||||
success: function (d) {
|
||||
that.setData({
|
||||
List: d.data.data
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// replay: function (event) {
|
||||
// var that = this
|
||||
// console.log(event.target.dataset)
|
||||
// wx.request({
|
||||
// url: 'http://127.0.0.1:8080/apply/applyListNoReplay',
|
||||
|
||||
// })
|
||||
// },
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
|
||||
}
|
||||
})
|
3
miniprogram/pages/apply/applyReplay.json
Normal file
3
miniprogram/pages/apply/applyReplay.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
}
|
17
miniprogram/pages/apply/applyReplay.wxml
Normal file
17
miniprogram/pages/apply/applyReplay.wxml
Normal file
@@ -0,0 +1,17 @@
|
||||
<view class="perason">
|
||||
<h2 class="weui-form__title" style="text-align: center;padding-top: 20px;">申请审批</h2>
|
||||
<view class="issues-panel" wx:for="{{List}}">
|
||||
<view class="issues-input" bindinput="titleInput" disabled="true">姓名:{{item.name}}</view>
|
||||
<view class="issues-input" bindinput="titleInput" disabled="true">学号:{{item.stuId}}</view>
|
||||
<view class="issues-input" bindinput="contentInput" auto-height disabled="true" style="border-bottom: none;">出行方式: {{item.transport}}</view>
|
||||
<view class="issues-input" bindinput="contentInput" auto-height disabled="true" style="border-bottom: none;">地点:{{item.place}}</view>
|
||||
<view class="issues-input" bindinput="contentInput" auto-height disabled="true" style="border-bottom: none;">开始时间: {{item.start_time}}</view>
|
||||
<view class="issues-input" bindinput="contentInput" auto-height disabled="true" style="border-bottom: none;">结束时间: {{item.end_time}}</view>
|
||||
<view class="weui-cells weui-cells_after-title">
|
||||
<view class="weui-cell weui-cell_input">
|
||||
<button class="mini-btn" type="primary" size="mini" data-id="{{item.id}}" data-replay="1" bindtap="agree">通过</button>
|
||||
<button class="mini-btn" type="warn" size="mini" data-id="{{item.id}}" data-replay="2" bindtap="disagree">驳回</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
115
miniprogram/pages/apply/applyReplay.wxss
Normal file
115
miniprogram/pages/apply/applyReplay.wxss
Normal file
@@ -0,0 +1,115 @@
|
||||
/**issuse.wxss**/
|
||||
.perason{
|
||||
background-color: #f6f6f6;
|
||||
padding: 30rpx;
|
||||
padding-top: 0;
|
||||
font-size: 11pt;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
min-height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding-bottom: 100rpx;
|
||||
}
|
||||
.issues-label{
|
||||
font-size: 10pt;
|
||||
line-height: 100%;
|
||||
color: #999;
|
||||
margin: 25rpx 20rpx 15rpx;
|
||||
}
|
||||
.issues-panel{
|
||||
margin-top: 30px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
background-color: #fff;
|
||||
border-top: 1px solid #e5e5e5;
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
}
|
||||
.issues-img-panel{
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
background-color: #fff;
|
||||
border-top: 1px solid #e5e5e5;
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
padding: 15rpx 25rpx;
|
||||
}
|
||||
.issues-input{
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
padding: 15rpx 25rpx;
|
||||
}
|
||||
.issues-textarea{
|
||||
padding: 25rpx;
|
||||
min-height: 225rpx;
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
}
|
||||
.issues-photo-item {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #888;
|
||||
margin: 20rpx;
|
||||
margin-right: 0;
|
||||
width: 135rpx;
|
||||
height: 135rpx;
|
||||
border: 1rpx solid #e5e5e5;
|
||||
border-radius: 5rpx;
|
||||
}
|
||||
.issues-photo-item:active{
|
||||
opacity: .8;
|
||||
}
|
||||
.issues-photo-item .remind-img{
|
||||
padding: 0;
|
||||
}
|
||||
.issues-photo-item image{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.add-photo:active {
|
||||
background: #f0f0f0;
|
||||
}
|
||||
.add-photo::before, .add-photo::after{
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
background: #e5e5e5;
|
||||
}
|
||||
.add-photo:active::before, .add-photo:active::after{
|
||||
background: #ddd;
|
||||
}
|
||||
.add-photo::before {
|
||||
width: 10rpx;
|
||||
height: 80rpx;
|
||||
margin-top: -40rpx;
|
||||
margin-left: -5rpx;
|
||||
}
|
||||
.add-photo::after {
|
||||
width: 80rpx;
|
||||
height: 10rpx;
|
||||
margin-top: -5rpx;
|
||||
margin-left: -40rpx;
|
||||
}
|
||||
.issues-remind {
|
||||
flex: 1;
|
||||
font-size: 9pt;
|
||||
line-height: 135%;
|
||||
color: #ccc;
|
||||
padding: 0 30rpx;
|
||||
word-break: break-all;
|
||||
text-indent: 1em;
|
||||
padding-top: 30rpx;
|
||||
}
|
||||
.submit-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin: 40rpx 3%;
|
||||
height: 80rpx;
|
||||
border-radius: 3px;
|
||||
text-align: center;
|
||||
background-color: #FF8966;
|
||||
color: #fff;
|
||||
font-size: 12pt;
|
||||
}
|
80
miniprogram/pages/apply/dateTimePicker.js
Normal file
80
miniprogram/pages/apply/dateTimePicker.js
Normal file
@@ -0,0 +1,80 @@
|
||||
function withData(param){
|
||||
return param < 10 ? '0' + param : '' + param;
|
||||
}
|
||||
function getLoopArray(start,end){
|
||||
var start = start || 0;
|
||||
var end = end || 1;
|
||||
var array = [];
|
||||
for (var i = start; i <= end; i++) {
|
||||
array.push(withData(i));
|
||||
}
|
||||
return array;
|
||||
}
|
||||
function getMonthDay(year,month){
|
||||
var flag = year % 400 == 0 || (year % 4 == 0 && year % 100 != 0), array = null;
|
||||
|
||||
switch (month) {
|
||||
case '01':
|
||||
case '03':
|
||||
case '05':
|
||||
case '07':
|
||||
case '08':
|
||||
case '10':
|
||||
case '12':
|
||||
array = getLoopArray(1, 31)
|
||||
break;
|
||||
case '04':
|
||||
case '06':
|
||||
case '09':
|
||||
case '11':
|
||||
array = getLoopArray(1, 30)
|
||||
break;
|
||||
case '02':
|
||||
array = flag ? getLoopArray(1, 29) : getLoopArray(1, 28)
|
||||
break;
|
||||
default:
|
||||
array = '月份格式不正确,请重新输入!'
|
||||
}
|
||||
return array;
|
||||
}
|
||||
function getNewDateArry(){
|
||||
// 当前时间的处理
|
||||
var newDate = new Date();
|
||||
var year = withData(newDate.getFullYear()),
|
||||
mont = withData(newDate.getMonth() + 1),
|
||||
date = withData(newDate.getDate()),
|
||||
hour = withData(newDate.getHours()),
|
||||
minu = withData(newDate.getMinutes()),
|
||||
seco = withData(newDate.getSeconds());
|
||||
|
||||
return [year, mont, date, hour, minu, seco];
|
||||
}
|
||||
function dateTimePicker(startYear,endYear,date) {
|
||||
// 返回默认显示的数组和联动数组的声明
|
||||
var dateTime = [], dateTimeArray = [[],[],[],[],[],[]];
|
||||
var start = startYear || 1978;
|
||||
var end = endYear || 2100;
|
||||
// 默认开始显示数据
|
||||
var defaultDate = date ? [...date.split(' ')[0].split('-'), ...date.split(' ')[1].split(':')] : getNewDateArry();
|
||||
// 处理联动列表数据
|
||||
/*年月日 时分秒*/
|
||||
dateTimeArray[0] = getLoopArray(start,end);
|
||||
dateTimeArray[1] = getLoopArray(1, 12);
|
||||
dateTimeArray[2] = getMonthDay(defaultDate[0], defaultDate[1]);
|
||||
dateTimeArray[3] = getLoopArray(0, 23);
|
||||
dateTimeArray[4] = getLoopArray(0, 59);
|
||||
dateTimeArray[5] = getLoopArray(0, 59);
|
||||
|
||||
dateTimeArray.forEach((current,index) => {
|
||||
dateTime.push(current.indexOf(defaultDate[index]));
|
||||
});
|
||||
|
||||
return {
|
||||
dateTimeArray: dateTimeArray,
|
||||
dateTime: dateTime
|
||||
}
|
||||
}
|
||||
module.exports = {
|
||||
dateTimePicker: dateTimePicker,
|
||||
getMonthDay: getMonthDay
|
||||
}
|
119
miniprogram/pages/apply/myapply.js
Normal file
119
miniprogram/pages/apply/myapply.js
Normal file
@@ -0,0 +1,119 @@
|
||||
// pages/other/feedback.js
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
List:'',
|
||||
replay: [],
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
doReplay: function (e) {
|
||||
this.setData({
|
||||
replay: e.detail.value
|
||||
})
|
||||
},
|
||||
agree:function (event) {
|
||||
var that = this
|
||||
wx.request({
|
||||
url: 'http://127.0.0.1:8080/apply/applyReplay',
|
||||
data: {
|
||||
id:event.target.dataset.id,
|
||||
replay:event.target.dataset.replay,
|
||||
reasonId: 99
|
||||
},
|
||||
success: function (d) {
|
||||
if(d.data.msg == "成功"){
|
||||
that.onshow();
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
disagree:function (event) {
|
||||
var that = this
|
||||
wx.showActionSheet({
|
||||
itemList: ['格式错误','出行地点不允许','时间填写错误'],
|
||||
success:function (res) {
|
||||
if(!res.cancel){
|
||||
wx.request({
|
||||
url: 'http://127.0.0.1:8080/apply/applyReplay',
|
||||
data: {
|
||||
id:event.target.dataset.id,
|
||||
replay:event.target.dataset.replay,
|
||||
reasonId:res.tapIndex,
|
||||
},
|
||||
success: function (d) {
|
||||
if(d.data.msg == "成功"){
|
||||
that.onShow();
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
var that = this;
|
||||
wx.request({
|
||||
url: 'http://127.0.0.1:8080/apply/myApply',
|
||||
data:{id:wx.getStorageSync('id')},
|
||||
success: function (d) {
|
||||
that.setData({
|
||||
List: d.data.data
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
|
||||
}
|
||||
})
|
3
miniprogram/pages/apply/myapply.json
Normal file
3
miniprogram/pages/apply/myapply.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
}
|
13
miniprogram/pages/apply/myapply.wxml
Normal file
13
miniprogram/pages/apply/myapply.wxml
Normal file
@@ -0,0 +1,13 @@
|
||||
<!--pages/apply/myapply.wxml-->
|
||||
<view class="perason">
|
||||
<h2 class="weui-form__title" style="text-align: center;padding-top: 20px;">我的申请</h2>
|
||||
<view class="issues-panel" wx:for="{{List}}">
|
||||
<view class="issues-input" bindinput="titleInput" disabled="true">请假事由:{{item.issue}}</view>
|
||||
<textarea class="issues-textarea" bindinput="contentInput" auto-height disabled="true">
|
||||
<text>目的地:{{item.place}}\n</text>
|
||||
<text>开始时间:{{item.start_time}}\n</text>
|
||||
<text>结束时间:{{item.end_time}}\n</text>
|
||||
</textarea>
|
||||
<view class="issues-input" bindinput="titleInput" disabled="true">管理员意见:{{item.state==1?"同意":item.state==2?"驳回":"审批中"}}</view>
|
||||
</view>
|
||||
</view>
|
115
miniprogram/pages/apply/myapply.wxss
Normal file
115
miniprogram/pages/apply/myapply.wxss
Normal file
@@ -0,0 +1,115 @@
|
||||
/**issuse.wxss**/
|
||||
.perason{
|
||||
background-color: #f6f6f6;
|
||||
padding: 30rpx;
|
||||
padding-top: 0;
|
||||
font-size: 11pt;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
min-height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding-bottom: 100rpx;
|
||||
}
|
||||
.issues-label{
|
||||
font-size: 10pt;
|
||||
line-height: 100%;
|
||||
color: #999;
|
||||
margin: 25rpx 20rpx 15rpx;
|
||||
}
|
||||
.issues-panel{
|
||||
margin-top: 30px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
background-color: #fff;
|
||||
border-top: 1px solid #e5e5e5;
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
}
|
||||
.issues-img-panel{
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
background-color: #fff;
|
||||
border-top: 1px solid #e5e5e5;
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
padding: 15rpx 25rpx;
|
||||
}
|
||||
.issues-input{
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
padding: 15rpx 25rpx;
|
||||
}
|
||||
.issues-textarea{
|
||||
padding: 25rpx;
|
||||
min-height: 225rpx;
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
}
|
||||
.issues-photo-item {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #888;
|
||||
margin: 20rpx;
|
||||
margin-right: 0;
|
||||
width: 135rpx;
|
||||
height: 135rpx;
|
||||
border: 1rpx solid #e5e5e5;
|
||||
border-radius: 5rpx;
|
||||
}
|
||||
.issues-photo-item:active{
|
||||
opacity: .8;
|
||||
}
|
||||
.issues-photo-item .remind-img{
|
||||
padding: 0;
|
||||
}
|
||||
.issues-photo-item image{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.add-photo:active {
|
||||
background: #f0f0f0;
|
||||
}
|
||||
.add-photo::before, .add-photo::after{
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
background: #e5e5e5;
|
||||
}
|
||||
.add-photo:active::before, .add-photo:active::after{
|
||||
background: #ddd;
|
||||
}
|
||||
.add-photo::before {
|
||||
width: 10rpx;
|
||||
height: 80rpx;
|
||||
margin-top: -40rpx;
|
||||
margin-left: -5rpx;
|
||||
}
|
||||
.add-photo::after {
|
||||
width: 80rpx;
|
||||
height: 10rpx;
|
||||
margin-top: -5rpx;
|
||||
margin-left: -40rpx;
|
||||
}
|
||||
.issues-remind {
|
||||
flex: 1;
|
||||
font-size: 9pt;
|
||||
line-height: 135%;
|
||||
color: #ccc;
|
||||
padding: 0 30rpx;
|
||||
word-break: break-all;
|
||||
text-indent: 1em;
|
||||
padding-top: 30rpx;
|
||||
}
|
||||
.submit-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin: 40rpx 3%;
|
||||
height: 80rpx;
|
||||
border-radius: 3px;
|
||||
text-align: center;
|
||||
background-color: #FF8966;
|
||||
color: #fff;
|
||||
font-size: 12pt;
|
||||
}
|
Reference in New Issue
Block a user