zhengkaixin 2 anni fa
parent
commit
ba8bb44a7b

+ 14 - 0
src/apis/Oa/doc.js

@@ -14,6 +14,20 @@ export function add(data) {
 	})
 }
 
+//提交
+export function updateTemplateFlag(data) {
+	
+	return request({
+		url: '/mobile/doc/updateTemplateFlag' ,
+		data: data,
+		method: 'post',
+		headers: {
+		    "Content-Type": "application/json"
+		}
+	})
+}
+
+
 export function update(data) {
 	return request({
 		url: '/mobile/doc/update' ,

+ 1 - 1
src/components/TopHeader.vue

@@ -6,7 +6,7 @@
 		</template>
 		<a v-if="leftShow" class="mui-icon mui-icon-left-nav mui-pull-left" :routeName="routeName" @click="goBack"></a>
 		<a v-if="rightLink.show" @click="doRightLink" class="fyy-bar mui-pull-right">
-			<span :class="'mui-icon '+(rightLink.icon.indexOf('mui-')>-1?'':'iconfont')+' '+rightLink.icon" :style="rightLink.style">
+			<span :class="'mui-icon '+(rightLink.icon?(rightLink.icon.indexOf('mui-')>-1?'':'iconfont'):'')+' '+rightLink.icon" :style="rightLink.style">
 				<span class="header-right-wz">
 					{{rightLink.title}}<i></i>
 				</span>

+ 9 - 0
src/router/oa.js

@@ -38,6 +38,15 @@ const routes = [
 						}
 					},
 					//列表文件
+					{
+						path: 'ListTemplate',
+						name: 'OaDocumentListTemplate',
+						component: () => import('../views-oa/Document/ListTemplate.vue'),
+						meta: {
+							title: '列表文件',
+						}
+					},
+					//列表文件
 					{
 						path: 'Browse',
 						name: 'OaDocumentBrowse',

+ 1 - 1
src/utils/request.js

@@ -58,7 +58,7 @@ var BACKEND_URL = baseApiList[apiTypeIndex];
 if (process.env.VUE_APP_NODE_NAME == 'devlopment') {			
 	//BACKEND_URL = 'http://192.168.77.162:8086/jp-housekeeper-server/'
 	//baseApiList = ['http://127.0.0.1:8086/jp-housekeeper-server/']
-//	BACKEND_URL="http://192.168.33.220:8086/gaoa-server/";
+	//BACKEND_URL="http://192.168.33.220:8086/gaoa-server/";
 }
 
 // 创建axios实例

+ 100 - 21
src/views-oa/Document/ExamineDetail.vue

@@ -13,14 +13,19 @@
 		<div v-show="!showPerson">
 			<div class="mui-content-padded">
 				<h5>审核记录
-				<span v-show="edit&&examineDetail.examineStepDTOList.length==0" @click="getList()"  style="
+				<span v-show="edit&&(examineDetail.examineStepDTOList.length==0||templateFlag)" @click="getList()"  style="
 					float: right;
 					color: #3385FF;
-				" >使用上次审批人</span>
+				" >使用上次审批</span>
+				
+				<span v-show="edit&&(examineDetail.examineStepDTOList.length==0||templateFlag)" @click="getTemplate()"  style="
+					float: right;
+					color: #3385FF; margin-right: 20px;
+				" >使用模板</span>
 				
 					<span v-show="view&&!edit"  @click="edit=true" style="
 							float: right;
-							color: #3385FF;
+							color: #3385FF;   
 						" >修改流程</span>
 					<span v-show="view&&edit" @click="edit=false"  style="
 						float: right;
@@ -130,9 +135,9 @@
 			</div>
 
 			<div class="addbtn" style="text-align: center;" v-if="operationBool">
-				<button class="btn1 mui-btn mui-btn-primary" @click="addExamineBtn(-1)">添加流程</button>
+				<button type="button"  class="btn1 mui-btn mui-btn-primary" @click="addExamineBtn(-1)">添加流程</button>
 
-				<button class="btn1 mui-btn mui-btn-primary" v-show="view&&edit"  @click="save">保存</button>
+				<button type="button"  class="btn1 mui-btn mui-btn-primary" v-show="view&&edit"  @click="save">保存</button>
 
 			</div>
 		</div>
@@ -152,6 +157,17 @@
 		name: 'examineDetail',
 		data() {
 			return {
+				recordList:[],
+				
+				listForm: {
+					pageIndex: 1,
+					pageSize: 10,
+					//	token: '',
+					totalPage: 1,
+					result: 0,
+					templateFlag:1,
+				},
+				templateFlag:false,
 				defaultFace:require('@/assets/img/default_face.png'),
 				showPerson: false,
 				selectIndex: 0,
@@ -202,7 +218,85 @@
 			}
 		},
 		methods: {
+			getDetail(id) {
+			    this.isLoading = true;
+			    API.edit( id).then(response => {
+			       // this.detail = response.masterFile;
+					//this.list=response
+					this.list=response;
+					var  list=response.examineStepDTOList;
+					
+					this.setList(list);
+			        this.isLoading = false;
+			    }).catch(error => {
+			        this.isLoading = false;
+			        mui.toast(error);
+			    })
+			},
+			//类型选择
+			selectType() {
+				var picker = new mui.PopPicker();
+			
+				picker.setData(this.recordList);
+				var _this = this;
+				picker.show(function(selectItems) {
+					var id= selectItems[0].value;
+					//_this.tjForm.typeName= selectItems[0].text;
+					//_this.typeName = selectItems[0].text;
+					_this.getDetail(id)
+				})
+			},
+			getListTemplate() {
+				this.isLoading = true;
+				API.pageList(this.listForm).then(response => {
+					if (response) {
+						var list=response.data;;
+						this.recordList = []
+						for(var i in list){
+							var obj=list[i];
+							this.recordList.push({
+								value:obj.id,
+								text:obj.templateTitle
+							})
+						}
+						this.selectType()
+					}
+					
+					this.isLoading = false;
+				}).catch(error => {
+					this.isLoading = false;
+					mui.toast(error);
+				})
+			},
+			getTemplate(){
+				this.templateFlag=true;
+				if(this.recordList.length){
+					this.selectType()
+				}else{
+					this.getListTemplate();
+				}
+			},
+			setList(list){
+				list.sort(function(a,b){
+					return a.examineStep.examineStep-b.examineStep.examineStep
+				})
+				for (var i in list) {
+					var obj = list[i];
+					obj.examineStep.examineStatus=0;
+					
+					obj.examineStep.examineStep = parseInt(i)+1;
+					for (var j in obj.stepPersonList) {
+						var obj2 = obj.stepPersonList[j];
+						obj2.sortNo = parseInt(j)+1;
+						obj2.status=0;
+						obj2.opinion="";
+					}
+				
+				}
+				this.init()
+			},
 			getList(){
+				this.templateFlag=true;
 				if(this.docType){
 					this.isLoading = true;
 					API.loadLastStepPerson(this.docType).then(response => {
@@ -210,23 +304,8 @@
 						this.list=response;
 						//this.list.examineStepDTOList=response.stepPersonList
 						var  list=this.list.examineStepDTOList;
+						this.setList(list);
 						
-						list.sort(function(a,b){
-							return a.examineStep.examineStep-b.examineStep.examineStep
-						})
-						for (var i in list) {
-							var obj = list[i];
-							obj.examineStep.examineStatus=0;
-							obj.opinion="";
-							obj.examineStep.examineStep = parseInt(i)+1;
-							for (var j in obj.stepPersonList) {
-								var obj2 = obj.stepPersonList[j];
-								obj2.sortNo = parseInt(j)+1;
-								obj2.status=0;
-							}
-						
-						}
-						this.init()
 					}).catch(error => {
 						this.isLoading = false;
 						mui.toast("未获取到上一次审批记录,请手动添加");

+ 95 - 3
src/views-oa/Document/Info.vue

@@ -1,7 +1,9 @@
 <template>
 <div>
     <common @asynCallBack="asynCallBack"></common>
-    <top-header :pageTitle="pageTitle"></top-header>
+    <top-header :pageTitle="pageTitle"  :rightLink="rightLink" :doRightLink="doRightLink" >
+		
+	</top-header>
 
     <div class="mui-content vongi-qingjiadt margin60">
         <div class="vongi-qingjiadt-head flew-sp" style="" >
@@ -40,14 +42,19 @@
                 <span v-text="detail.createTime">2020-04-27 12:00:00</span>
             </div>
 
-
+			<div style="    text-align: center;    background-color: #fff; " v-if="detail.docStatus==0" >
+				<button type="button" class="btn1 mui-btn mui-btn-danger" @click="inforevoke"  >撤销审批</button>
+				
+			</div>
         </form>
         <div class="vongi-slot">
            
         </div>
 		<div class="mui-content vongi-wordcard"  v-if="list" style=" background-color: #ffffff;margin-top: 10px;    padding-top: 0px;">
 			<examineDetail :edit="false" :list="list" :view="detail.docStatus==0" ></examineDetail>	
+		
 		</div>
+		
     </div>
 
 	
@@ -87,6 +94,13 @@ export default {
             isLoading: false,
             id: this.$route.query.id,
             detail: {},
+			
+			rightLink: {
+				show: true,
+				//icon: 'icon-tongji',
+				style: 'font-size:14px',
+				title: '设为模板'
+			},
 				status: ['待审核', '已通过', '未通过', '已撤销'],
           //  status: ['待审核', '已批准', '已拒绝','已撤销'],
             statusColor: ['mui-btn-warning', 'mui-btn-success', 'mui-btn-danger',''],
@@ -96,6 +110,78 @@ export default {
 
     },
     methods: {
+		inforevoke(){
+			var _this=this;
+			mui.confirm('是否撤销当前审批','提示', ['取消', '确定'], function(e) {
+					if (e.index == 1) {
+						_this.detail.templateFlag=0;
+						_this.save()
+					}
+				}
+			)
+		},
+		save(){
+			this.isLoading = true;
+			this.list.masterFile.docStatus=3;
+			//撤销
+			API.update(this.list).then(response => {
+				this.isLoading = false;
+				//this.init();
+				mui.toast("操作成功");
+			}).catch(error => {
+				this.isLoading = false;
+				mui.toast(error);
+			})
+		},
+		//右上角点击事件
+		doRightLink() {
+			// this.$router.push({
+			// 	name: 'CommonHealthCert',
+			// 	query: {
+			// 		personId: this.detail.personId
+			// 	}
+			// })
+			var _this=this;
+			if( this.detail.templateFlag=="1"){
+				//this.detail.templateFlag=0;
+				mui.confirm('是否取消模板','提示', ['取消', '确定'], function(e) {
+						if (e.index == 1) {
+							_this.detail.templateFlag=0;
+							_this.updateTemplateFlag();
+						}
+					}
+				)
+			}else{
+			
+				mui.prompt('设置模板备注名称', _this.detail.docTitle,'提示', ['取消', '确定'], function(e) {
+						if (e.index == 1) {
+							_this.detail.templateFlag=1;
+							if(!e.value){
+								e.value=_this.detail.docTitle;
+							}
+							_this.detail.templateTitle=e.value
+							
+							_this.updateTemplateFlag();
+						}
+					}
+				)
+			}
+		
+			
+			
+			
+		},
+		updateTemplateFlag(){
+			this.isLoading = true;
+			API.updateTemplateFlag(this.detail).then(response => {
+				 mui.toast("操作成功");
+			   this.getDetail()
+			  
+			}).catch(error => {
+			    this.isLoading = false;
+			    mui.toast(error);
+			})
+		},
         //获取状态颜色
         getColor(status) {
             var color = '';
@@ -114,7 +200,13 @@ export default {
             API.edit( this.id).then(response => {
                 this.detail = response.masterFile;
 				this.list=response
-				
+				if( this.detail.templateFlag=="1"){
+					this.rightLink.title="取消模板"
+					this.rightLink.style="font-size:14px;color:red"
+				}else{
+					this.rightLink.title="设为模板"
+					this.rightLink.style="font-size:14px;"
+				}
                 this.isLoading = false;
             }).catch(error => {
                 this.isLoading = false;

+ 34 - 4
src/views-oa/Document/List.vue

@@ -2,17 +2,24 @@
 	<div>
 
 		<common @asynCallBack="asynCallBack"></common>
-		<top-header :pageTitle="pageTitle" :routeName="'Master'"></top-header>
+		<top-header :pageTitle="pageTitle" :routeName="'Master'"  :rightLink="rightLink" :doRightLink="doRightLink"  ></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" >
+							
+							<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>
+								<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>
@@ -82,7 +89,13 @@
 				recordList: [],
 				status: ['待审核', '已通过', '未通过', '已撤销'],
 				statusColor: ['classFF8400', 'class389E0D', 'classFF6666','classA5A5A5'],
-
+				
+				rightLink: {
+					show: true,
+					//icon: 'icon-tongji',
+					style: 'font-size:14px',
+					title: '我的模板'
+				},
 
 			}
 		},
@@ -91,6 +104,23 @@
 			//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()
+				this.$router.push({
+					name: 'OaDocumentListTemplate',
+				
+				})
+				
+			},
 			//info
 			detail(id) {
 				this.$router.push({

+ 222 - 0
src/views-oa/Document/ListTemplate.vue

@@ -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>

+ 5 - 2
src/views-oa/Document/VerifyInfo.vue

@@ -1,7 +1,9 @@
 <template>
 	<div>
 		<common @asynCallBack="asynCallBack"></common>
-		<top-header :pageTitle="(detail.typeN?detail.typeN:'')+pageTitle"></top-header>
+		<top-header :pageTitle="(detail.typeN?detail.typeN:'')+pageTitle"
+		:leftShow="isback==1"
+		></top-header>
 
 		<div class="mui-content vongi-qingjiadt margin60">
 		    <div class="vongi-qingjiadt-head flew-sp">
@@ -101,6 +103,7 @@ import * as API from '@/apis/Oa/doc'
 				isLoading: false,
 
 				id: this.$route.query.id,
+				isback:this.$route.query.isback,
 				detail: {},
 				list:null,
 				//审批内容弹窗显示
@@ -148,7 +151,7 @@ import * as API from '@/apis/Oa/doc'
 					for(var  i in  list){
 						var obj=list[i];
 						
-						if(obj.examineStep.examineStatus==1){
+						if(obj.examineStep.examineStatus==1&&this.detail.docStatus==0){
 							
 							var sz=obj.stepPersonList
 							for(var j in sz){

+ 2 - 1
src/views-oa/Document/VerifyList.vue

@@ -155,7 +155,8 @@
 				this.$router.push({
 					name: 'OaDocumentVerifyInfo',
 					query: {
-						id: id
+						id: id,
+						isback:"1"
 					}
 				})
 			},