|
@@ -3,60 +3,59 @@
|
|
<common @asynCallBack="asynCallBack"></common>
|
|
<common @asynCallBack="asynCallBack"></common>
|
|
<top-header :pageTitle="pageTitle"></top-header>
|
|
<top-header :pageTitle="pageTitle"></top-header>
|
|
|
|
|
|
|
|
+
|
|
<div class="mui-content vongi-wordcard-sp">
|
|
<div class="mui-content vongi-wordcard-sp">
|
|
- <div id="slider" class="mui-slider mui-fullscreen vongi-over">
|
|
|
|
- <div id="sliderSegmentedControl" class="mui-scroll-wrapper mui-slider-indicator mui-segmented-control mui-segmented-control-inverted">
|
|
|
|
- <div class="mui-scroll">
|
|
|
|
- <a class="mui-control-item mui-active" href="#item1mobile">
|
|
|
|
- <span class="fyy-badge">待处理<span class="mui-badge">5</span></span>
|
|
|
|
- </a>
|
|
|
|
- <a class="mui-control-item" href="#item2mobile">
|
|
|
|
- 已处理
|
|
|
|
- </a>
|
|
|
|
- </div>
|
|
|
|
|
|
+
|
|
|
|
+ <div id="sliderSegmentedControl" class="mui-scroll-wrapper mui-slider-indicator mui-segmented-control mui-segmented-control-inverted">
|
|
|
|
+ <div class="mui-scroll">
|
|
|
|
+ <a @click="reloadList('0')" :class="'mui-control-item '+(listForm.status=='0'?'mui-active':'')">
|
|
|
|
+ <span class="fyy-badge">待处理<span class="mui-badge" v-if="firstRecordsTotal" v-text="firstRecordsTotal"></span></span>
|
|
|
|
+ </a>
|
|
|
|
+ <a @click="reloadList('1')" :class="'mui-control-item '+(listForm.status=='1'?'mui-active':'')">
|
|
|
|
+ 已处理
|
|
|
|
+ </a>
|
|
</div>
|
|
</div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <NullList :remark="'暂无申请记录'" v-if="!recordList.length"></NullList>
|
|
|
|
+
|
|
|
|
+ <div id="slider" class="mui-slider mui-fullscreen vongi-over">
|
|
|
|
+
|
|
<div class="mui-slider-group vongi-cchai">
|
|
<div class="mui-slider-group vongi-cchai">
|
|
- <div id="item1mobile" class="mui-slider-item mui-control-content mui-active">
|
|
|
|
- <div id="scroll1" class="mui-scroll-wrapper vongi-over-hei">
|
|
|
|
|
|
+ <div v-if="listForm.status=='0'" class="mui-slider-item mui-control-content mui-active">
|
|
|
|
+ <div class="mui-scroll-wrapper vongi-over-hei">
|
|
<div class="mui-scroll">
|
|
<div class="mui-scroll">
|
|
<form class="mui-input-group fyy-checkbox">
|
|
<form class="mui-input-group fyy-checkbox">
|
|
- <div class="mui-input-row mui-checkbox mui-left">
|
|
|
|
- <a href="">
|
|
|
|
- <h4>赵刚的加班申请<span class="mui-h6 mui-pull-right">11-04 20:30</span></h4>
|
|
|
|
- <p class='mui-ellipsis'>加班时间:2020年12月21日 17:30-21:30</p>
|
|
|
|
|
|
+ <div v-for="(item,index) in recordList" class="mui-input-row mui-checkbox mui-left">
|
|
|
|
+ <router-link :to="{name:'MasterExtraWorkVerifyInfo',query:{id:item.id}}">
|
|
|
|
+ <h4>{{item.personName}}的加班申请<span class="mui-h6 mui-pull-right" v-text="item.dateTime.substr(5)"></span></h4>
|
|
|
|
+ <p class='mui-ellipsis'>加班时间:{{item.workOverTime}}</p>
|
|
<p class='mui-ellipsis flew-items flew-sp'>
|
|
<p class='mui-ellipsis flew-items flew-sp'>
|
|
- 加班时长:4小时
|
|
|
|
|
|
+ 加班时长:{{item.hours}}小时
|
|
|
|
+ <button type="button" class="mui-btn mui-btn-primary mui-btn-outlined" :style="getColor(item.status)"
|
|
|
|
+ v-text="item.statusN"></button>
|
|
</p>
|
|
</p>
|
|
- </a>
|
|
|
|
- <input name="checkbox" value="Item 1" type="checkbox" checked>
|
|
|
|
|
|
+ </router-link>
|
|
|
|
+ <input name="checkbox" v-model="selectIdList" :value="item.id" type="checkbox">
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <div id="item2mobile" class="mui-slider-item mui-control-content">
|
|
|
|
|
|
+ <div v-if="listForm.status=='1'" class="mui-slider-item mui-control-content">
|
|
<div class="mui-scroll-wrapper">
|
|
<div class="mui-scroll-wrapper">
|
|
<div class="mui-scroll">
|
|
<div class="mui-scroll">
|
|
<ul class="mui-table-view mui-table-view-chevron">
|
|
<ul class="mui-table-view mui-table-view-chevron">
|
|
- <li class="mui-table-view-cell mui-media">
|
|
|
|
- <a href="">
|
|
|
|
- <h4>赵刚的加班申请<span class="mui-h6 mui-pull-right">10-17</span></h4>
|
|
|
|
- <p class='mui-ellipsis'>加班时间:2020年12月21日 17:30-21:30</p>
|
|
|
|
|
|
+ <li v-for="(item,index) in recordList" class="mui-table-view-cell mui-media">
|
|
|
|
+ <router-link :to="{name:'MasterExtraWorkVerifyInfo',query:{id:item.id}}">
|
|
|
|
+ <h4>{{item.personName}}的加班申请<span class="mui-h6 mui-pull-right" v-text="item.dateTime.substr(5)"></span></h4>
|
|
|
|
+ <p class='mui-ellipsis'>加班时间:{{item.workOverTime}}</p>
|
|
<p class='mui-ellipsis flew-items flew-sp'>
|
|
<p class='mui-ellipsis flew-items flew-sp'>
|
|
- 加班时长:4小时
|
|
|
|
- <button type="button" class="mui-btn mui-btn-success mui-btn-outlined">已通过</button>
|
|
|
|
|
|
+ 加班时长:{{item.hours}}小时
|
|
|
|
+ <button type="button" class="mui-btn mui-btn-primary mui-btn-outlined" :style="getColor(item.status)"
|
|
|
|
+ v-text="item.statusN"></button>
|
|
</p>
|
|
</p>
|
|
- </a>
|
|
|
|
- </li>
|
|
|
|
- <li class="mui-table-view-cell mui-media">
|
|
|
|
- <a href="">
|
|
|
|
- <h4>赵刚的加班申请<span class="mui-h6 mui-pull-right">10-17</span></h4>
|
|
|
|
- <p class='mui-ellipsis'>加班时间:2020年12月21日 17:30-21:30</p>
|
|
|
|
- <p class='mui-ellipsis flew-items flew-sp'>
|
|
|
|
- 加班时长:4小时
|
|
|
|
- <button type="button" class="mui-btn mui-btn-danger mui-btn-outlined">已拒绝</button>
|
|
|
|
- </p>
|
|
|
|
- </a>
|
|
|
|
|
|
+ </router-link>
|
|
</li>
|
|
</li>
|
|
</ul>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
@@ -64,14 +63,20 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <div class="vongi-ad-fix">
|
|
|
|
- <div class=" vongi-wordcard">
|
|
|
|
|
|
+
|
|
|
|
+ <div v-show="recordList.length>0 && listForm.status==0" class="vongi-ad-fix" style="z-index:99">
|
|
|
|
+
|
|
|
|
+ <div class=" vongi-wordcard" v-if="approvalPersonList.length">
|
|
<form class="mui-input-group">
|
|
<form class="mui-input-group">
|
|
<div class="mui-input-row">
|
|
<div class="mui-input-row">
|
|
- <label class="color4fc5f7">下一步审核人</label>
|
|
|
|
- <div class="mui-navigate-right">
|
|
|
|
- <button id='showUserPicker' class="mui-btn mui-btn-block" type='button'>郑强</button>
|
|
|
|
|
|
+ <label class="color4fc5f7">下一步审批人</label>
|
|
|
|
+ <div v-if="approvalPersonList.length!=1" class="mui-navigate-right" @click="selectPerson">
|
|
|
|
+ <button id='showUserPicker' class="mui-btn mui-btn-block" type='button'><span v-text="approvalPersonName"></span></button>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div v-if="approvalPersonList.length==1">
|
|
|
|
+ <button class="mui-btn mui-btn-block" type='button'><span v-text="approvalPersonName"></span></button>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
@@ -79,13 +84,12 @@
|
|
<form class="mui-input-group">
|
|
<form class="mui-input-group">
|
|
<div class="mui-input-row mui-checkbox mui-left">
|
|
<div class="mui-input-row mui-checkbox mui-left">
|
|
<label>全选</label>
|
|
<label>全选</label>
|
|
- <input name="checkbox" value="Item 1" type="checkbox">
|
|
|
|
|
|
+ <input v-model="allSelect" value="1" type="checkbox" @click="selectAll" :checked="recordList.length==selectIdList.length">
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</form>
|
|
- <button type="button" class="mui-btn mui-btn-danger">拒绝</button>
|
|
|
|
- <button type="button" class="mui-btn mui-btn-success">同意</button>
|
|
|
|
|
|
+ <button type="button" class="mui-btn mui-btn-danger" @click="openFrom('2')">拒绝</button>
|
|
|
|
+ <button type="button" class="mui-btn mui-btn-success" @click="openFrom('1')">同意</button>
|
|
</div>
|
|
</div>
|
|
-
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
@@ -94,10 +98,13 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+ import * as API_BusinessTravel from '@/apis/Master/business_travel'
|
|
import * as API_ExtraWork from '@/apis/Master/extra_work'
|
|
import * as API_ExtraWork from '@/apis/Master/extra_work'
|
|
import Common from '$project/components/Common.vue'
|
|
import Common from '$project/components/Common.vue'
|
|
import Loading from '$project/components/Loading.vue'
|
|
import Loading from '$project/components/Loading.vue'
|
|
import TopHeader from '$project/components/TopHeader.vue'
|
|
import TopHeader from '$project/components/TopHeader.vue'
|
|
|
|
+ import isReachBottom from '$project/utils/isReachBottom'
|
|
|
|
+ import NullList from '$project/components/NullList.vue'
|
|
import {
|
|
import {
|
|
mapGetters,
|
|
mapGetters,
|
|
mapMutations
|
|
mapMutations
|
|
@@ -108,32 +115,241 @@
|
|
Common,
|
|
Common,
|
|
Loading,
|
|
Loading,
|
|
TopHeader,
|
|
TopHeader,
|
|
|
|
+ NullList
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
pageTitle: '加班审批',
|
|
pageTitle: '加班审批',
|
|
|
|
|
|
isLoading: false,
|
|
isLoading: false,
|
|
|
|
+
|
|
|
|
+ listForm: {
|
|
|
|
+ type: '3',
|
|
|
|
+ pageIndex: 1,
|
|
|
|
+ pageSize: 20,
|
|
|
|
+ totalPage: 1,
|
|
|
|
+ status: '0'
|
|
|
|
+ },
|
|
|
|
+ recordList: [],
|
|
|
|
+ approvalPersonList: [],
|
|
|
|
+ approvalPerson: true,
|
|
|
|
+
|
|
|
|
+ subForm: {
|
|
|
|
+ ids: '',
|
|
|
|
+ approvalContent: '',
|
|
|
|
+ status: '',
|
|
|
|
+ nextApprovalId: '',
|
|
|
|
+ },
|
|
|
|
+ //补卡1,外出2,出差3 ,请假/加班4
|
|
|
|
+ personForm: {
|
|
|
|
+ type: '4'
|
|
|
|
+ },
|
|
|
|
+ selectIdList: [],
|
|
|
|
+ allSelect: [],
|
|
|
|
+ firstRecordsTotal: 0,
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created() {},
|
|
created() {},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ //获取审核人列表
|
|
|
|
+ getBusinessOutApprovalPerson() {
|
|
|
|
+ this.isLoading = true;
|
|
|
|
+ API_BusinessTravel.getBusinessOutApprovalPerson(this.personForm).then(response => {
|
|
|
|
+ this.isLoading = false;
|
|
|
|
+
|
|
|
|
+ var list = response.data;
|
|
|
|
+ var approvalPersonList = [];
|
|
|
|
+ for (var i = 0; i < list.length; i++) {
|
|
|
|
+ approvalPersonList.push({
|
|
|
|
+ value: list[i]['id'],
|
|
|
|
+ text: list[i]['personName']
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ if (approvalPersonList.length) {
|
|
|
|
+ this.subForm.nextApprovalId = approvalPersonList[0]['value'];
|
|
|
|
+ this.approvalPersonName = approvalPersonList[0]['text'];
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ this.approvalPersonList = approvalPersonList;
|
|
|
|
+
|
|
|
|
+ this.approvalPerson = true;
|
|
|
|
+ }).catch(error => {
|
|
|
|
+ this.isLoading = false;
|
|
|
|
+ mui.toast(error);
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ //选择审核人
|
|
|
|
+ selectPerson() {
|
|
|
|
+ var _this = this;
|
|
|
|
+ var picker = new mui.PopPicker();
|
|
|
|
+ picker.setData(_this.approvalPersonList);
|
|
|
|
+ picker.pickers[0].setSelectedValue(this.subForm.nextApprovalId);
|
|
|
|
+ picker.show(function(selectItems) {
|
|
|
|
+ _this.subForm.nextApprovalId = selectItems[0].value;
|
|
|
|
+ _this.approvalPersonName = selectItems[0].text;
|
|
|
|
+ _this.$forceUpdate()
|
|
|
|
+
|
|
|
|
+ picker.dispose();
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ //获取列表
|
|
|
|
+ getList() {
|
|
|
|
+ this.isLoading = true;
|
|
|
|
+ API_ExtraWork.verifyList(this.listForm).then(response => {
|
|
|
|
+ if (response) {
|
|
|
|
+ if (this.listForm.pageIndex == 1) {
|
|
|
|
+ this.recordList = response.data;
|
|
|
|
+ this.listForm.pageIndex = response.pageNumber;
|
|
|
|
+ this.listForm.totalPage = response.totalPage;
|
|
|
|
+ } else {
|
|
|
|
+ this.recordList = [
|
|
|
|
+ ...this.recordList,
|
|
|
|
+ ...response.data
|
|
|
|
+ ];
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (this.listForm.status == 0) {
|
|
|
|
+ this.firstRecordsTotal = response.recordsTotal;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ this.listForm.pageIndex++;
|
|
|
|
+ this.isLoading = false;
|
|
|
|
+ }).catch(error => {
|
|
|
|
+ this.isLoading = false;
|
|
|
|
+ mui.toast(error);
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ //下拉事件
|
|
|
|
+ handleScrool() {
|
|
|
|
+ if (isReachBottom()) {
|
|
|
|
+ console.log('到达底部')
|
|
|
|
+ if (this.listForm.pageIndex <= this.listForm.totalPage && this.isLoading == false) {
|
|
|
|
+ this.getList();
|
|
|
|
+ } else {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ //切换
|
|
|
|
+ reloadList(status) {
|
|
|
|
+ this.listForm.status = status;
|
|
|
|
+ this.listForm.pageIndex = 1;
|
|
|
|
+ this.getList();
|
|
|
|
+ },
|
|
|
|
+ //选择所有
|
|
|
|
+ selectAll() {
|
|
|
|
+ if (this.allSelect.length) {
|
|
|
|
+ this.selectIdList = [];
|
|
|
|
+ } else {
|
|
|
|
+ var selectIdList = [];
|
|
|
|
+ this.recordList.forEach(function(item, index) {
|
|
|
|
+ selectIdList.push(item.id);
|
|
|
|
+ })
|
|
|
|
+ this.selectIdList = selectIdList;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ //显示内容表单
|
|
|
|
+ openFrom(status) {
|
|
|
|
+ if (!this.selectIdList.length) {
|
|
|
|
+ mui.toast('请选择要处理的信息');
|
|
|
|
+ } else {
|
|
|
|
+ this.subForm.status = status;
|
|
|
|
+ this.subForm.approvalContent = status == 1 ? '同意' : '拒绝';
|
|
|
|
+ //this.openFromVisible = true;
|
|
|
|
+ //直接点击处理,不需要弹窗理由框
|
|
|
|
+ this.doAction();
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ //检测表单
|
|
|
|
+ checkForm() {
|
|
|
|
+ if (!this.approvalPerson) {
|
|
|
|
+ mui.toast('加载下一级审批人失败,请刷新页面');
|
|
|
|
+ return false;
|
|
|
|
+ } else if (!this.subForm.ids) {
|
|
|
|
+ mui.toast('请选择要处理的信息');
|
|
|
|
+ return false;
|
|
|
|
+ } else {
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ //同意拒绝
|
|
|
|
+ doAction() {
|
|
|
|
+ this.subForm.ids = this.selectIdList.join(',');
|
|
|
|
+ if (this.checkForm()) {
|
|
|
|
+ this.isLoading = true;
|
|
|
|
+ API_ExtraWork.approvalWorkOver(this.subForm).then(response => {
|
|
|
|
+ this.isLoading = false;
|
|
|
|
+
|
|
|
|
+ this.openFromVisible = false;
|
|
|
|
+ this.listForm.pageIndex = 1;
|
|
|
|
+ this.getList();
|
|
|
|
+ }).catch(error => {
|
|
|
|
+ this.isLoading = false;
|
|
|
|
+ mui.toast(error);
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ //获取状态颜色
|
|
|
|
+ getColor(status) {
|
|
|
|
+ var color = '';
|
|
|
|
+ if (status == '0') {
|
|
|
|
+ color = '#4fc5f7';
|
|
|
|
+ } else if (status == '1') {
|
|
|
|
+ color = '#55f868';
|
|
|
|
+ } else if (status == '2') {
|
|
|
|
+ color = '#fe616c';
|
|
|
|
+ }
|
|
|
|
+ return 'color:' + color + ';border-color:' + color + ';';
|
|
|
|
+ },
|
|
asynCallBack() {
|
|
asynCallBack() {
|
|
|
|
|
|
},
|
|
},
|
|
},
|
|
},
|
|
- mounted() {},
|
|
|
|
- destroyed() {},
|
|
|
|
|
|
+ mounted() {
|
|
|
|
+ this.getList();
|
|
|
|
+ //this.getBusinessOutApprovalPerson()
|
|
|
|
+ //监控下拉加载事件
|
|
|
|
+ var _this = this;
|
|
|
|
+ window.addEventListener('scroll', _this.handleScrool);
|
|
|
|
+ },
|
|
|
|
+ destroyed() {
|
|
|
|
+ //销毁监听事件
|
|
|
|
+ var _this = this;
|
|
|
|
+ window.removeEventListener('scroll', _this.handleScrool);
|
|
|
|
+ },
|
|
computed: {
|
|
computed: {
|
|
...mapGetters({
|
|
...mapGetters({
|
|
openId: 'wx_openid',
|
|
openId: 'wx_openid',
|
|
token: 'token',
|
|
token: 'token',
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ //keepalive监控判断
|
|
|
|
+ beforeRouteLeave(to, from, next) {
|
|
|
|
+ console.log(to.name);
|
|
|
|
+ if (['MasterExtraWorkVerifyInfo'].indexOf(to.name) > -1) {
|
|
|
|
+ this.$store.commit('SET_KEEP_ALIVE_COMPONENTS', ['MasterExtraWorkVerifyList'])
|
|
|
|
+ } else {
|
|
|
|
+ this.$store.commit('SET_KEEP_ALIVE_COMPONENTS', [])
|
|
|
|
+ }
|
|
|
|
+ next()
|
|
|
|
+ },
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style scoped src="$project/assets/css/xpwyfyy.css"></style>
|
|
<style scoped src="$project/assets/css/xpwyfyy.css"></style>
|
|
<style src="$project/assets/css/iconfont.css"></style>
|
|
<style src="$project/assets/css/iconfont.css"></style>
|
|
-<style>
|
|
|
|
|
|
+<style scoped>
|
|
|
|
+
|
|
|
|
+ .mui-segmented-control {
|
|
|
|
+ position: fixed;
|
|
|
|
+ top: 44px;
|
|
|
|
+ z-index: 99;
|
|
|
|
+ background-color: #eee;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .mui-fullscreen {
|
|
|
|
+ position: unset;
|
|
|
|
+ margin-top: 45px;
|
|
|
|
+ }
|
|
</style>
|
|
</style>
|