|
@@ -0,0 +1,222 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+
|
|
|
+ <common @asynCallBack="asynCallBack"></common>
|
|
|
+ <top-header :pageTitle="pageTitle" ></top-header>
|
|
|
+
|
|
|
+
|
|
|
+ <div class="mui-content margin60">
|
|
|
+ <p style="text-align: center;" v-show="listForm.templateFlag==1&&recordList.length" >模板选择最多10条,请不要过度添加</p>
|
|
|
+ <template v-for="item in recordList">
|
|
|
+
|
|
|
+ <div class="mui-content-padded" style="margin: 12px 12px !important;" >
|
|
|
+
|
|
|
+ <ul class="mui-table-view fyy-view" @click="detail(item.id)">
|
|
|
+
|
|
|
+ <li class="mui-table-view-cell" >
|
|
|
+ <label>公文标题:</label>
|
|
|
+ <span>{{item.docTitle}}<span class="mui-pull-right " :class="statusColor[item.docStatus]">{{status[item.docStatus]}}</span></span>
|
|
|
+ </li>
|
|
|
+ <li class="mui-table-view-cell" v-show="listForm.templateFlag==1" >
|
|
|
+ <label>模板标题:</label>
|
|
|
+ <span>{{item.templateTitle}}</span>
|
|
|
+ </li>
|
|
|
+ <!-- <li class="mui-table-view-cell" >
|
|
|
+ <label>公文类型:</label>
|
|
|
+ <span>{{item.typeName}}</span>
|
|
|
+ </li> -->
|
|
|
+ <li class="mui-table-view-cell" >
|
|
|
+ <label>提交时间:</label>
|
|
|
+ <span>{{item.createTime}}</span>
|
|
|
+ </li>
|
|
|
+
|
|
|
+
|
|
|
+ </ul>
|
|
|
+
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </template>
|
|
|
+ <!-- <div class="fyy-footer">
|
|
|
+ <div class="bindfyy-btn"><button type="submit" class="mui-btn mui-btn-primary " @click="save()">提报公文</button></div>
|
|
|
+ </div> -->
|
|
|
+
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <NullList :remark="'暂无模板'" v-if="!recordList.length"></NullList>
|
|
|
+
|
|
|
+
|
|
|
+ <loading :visible="isLoading"></loading>
|
|
|
+
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+
|
|
|
+<script>
|
|
|
+ import * as API from '@/apis/Oa/doc'
|
|
|
+ import Common from '@/components/Common.vue'
|
|
|
+ import Loading from '@/components/Loading.vue'
|
|
|
+ import TopHeader from '@/components/TopHeader.vue'
|
|
|
+ import isReachBottom from '@/utils/isReachBottom'
|
|
|
+ import NullList from '@/components/NullList.vue'
|
|
|
+
|
|
|
+ import {
|
|
|
+ mapGetters,
|
|
|
+ mapMutations
|
|
|
+ } from 'vuex'
|
|
|
+ export default {
|
|
|
+ name: 'OaDocumentList',
|
|
|
+ components: {
|
|
|
+ Common,
|
|
|
+ Loading,
|
|
|
+ TopHeader,
|
|
|
+ NullList
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ pageTitle: '我的模板',
|
|
|
+
|
|
|
+ isLoading: false,
|
|
|
+
|
|
|
+ listForm: {
|
|
|
+ pageIndex: 1,
|
|
|
+ pageSize: 20,
|
|
|
+ // token: '',
|
|
|
+ templateFlag:1,
|
|
|
+ totalPage: 1,
|
|
|
+ result: 0,
|
|
|
+ },
|
|
|
+ recordList: [],
|
|
|
+ status: ['待审核', '已通过', '未通过', '已撤销'],
|
|
|
+ statusColor: ['classFF8400', 'class389E0D', 'classFF6666','classA5A5A5'],
|
|
|
+
|
|
|
+ // rightLink: {
|
|
|
+ // show: true,
|
|
|
+ // //icon: 'icon-tongji',
|
|
|
+ // style: 'font-size:14px',
|
|
|
+ // title: '我的模板'
|
|
|
+ // },
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ //this.listForm.openId = this.openId;
|
|
|
+ //this.listForm.result = this.$route.query.result != null ? this.$route.query.result : 0;
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ doRightLink() {
|
|
|
+
|
|
|
+ if(this.listForm.templateFlag==1){
|
|
|
+ this.listForm.templateFlag=null
|
|
|
+ this.rightLink.title="我的模板"
|
|
|
+ }else{
|
|
|
+ this.listForm.templateFlag=1;
|
|
|
+ this.rightLink.title="返回列表"
|
|
|
+ }
|
|
|
+ this.listForm.pageIndex=1;
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+ //info
|
|
|
+ detail(id) {
|
|
|
+ this.$router.push({
|
|
|
+ name: 'OaDocumentInfo',
|
|
|
+ query: {
|
|
|
+ id: id
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ save() {
|
|
|
+ this.$router.push({
|
|
|
+ name: 'OaDocumentForm',
|
|
|
+ query: {
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //获取列表
|
|
|
+ getList() {
|
|
|
+ this.isLoading = true;
|
|
|
+ API.pageList(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
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ asynCallBack() {
|
|
|
+
|
|
|
+ },
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.getList();
|
|
|
+ //监控下拉加载事件
|
|
|
+ var _this = this;
|
|
|
+ window.addEventListener('scroll', _this.handleScrool);
|
|
|
+ },
|
|
|
+ destroyed() {
|
|
|
+ //销毁监听事件
|
|
|
+ var _this = this;
|
|
|
+ window.removeEventListener('scroll', _this.handleScrool);
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapGetters({
|
|
|
+ openId: 'wx_openid',
|
|
|
+ token: 'token',
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //keepalive监控判断
|
|
|
+ beforeRouteLeave(to, from, next) {
|
|
|
+ console.log(to.name);
|
|
|
+ if (['OaDocumentInfo'].indexOf(to.name) > -1) {
|
|
|
+ this.$store.commit('SET_KEEP_ALIVE_COMPONENTS', ['MasterAttendanceLeaveList'])
|
|
|
+ } else {
|
|
|
+ this.$store.commit('SET_KEEP_ALIVE_COMPONENTS', [])
|
|
|
+ }
|
|
|
+ next()
|
|
|
+ },
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped src="@/assets/css/xpwyfyy-oa.css"></style>
|
|
|
+<style src="@/assets/css/iconfont.css"></style>
|
|
|
+
|
|
|
+<style scoped >
|
|
|
+ .classFF8400 {
|
|
|
+ color: #FF8400 ;
|
|
|
+ }
|
|
|
+ .class389E0D {
|
|
|
+ color: #389E0D ;
|
|
|
+ }
|
|
|
+ .classFF6666 {
|
|
|
+ color: #FF6666 ;
|
|
|
+ }
|
|
|
+ .classA5A5A5 {
|
|
|
+ color: #A5A5A5 ;
|
|
|
+ }
|
|
|
+</style>
|