15807800591 пре 2 година
родитељ
комит
d316f49859
5 измењених фајлова са 84 додато и 36 уклоњено
  1. 6 4
      common/http.js
  2. 4 3
      pages/home/index.vue
  3. 58 21
      pages/index/detail.vue
  4. 3 3
      pages/index/index.vue
  5. 13 5
      pages/index/selectApprovers.vue

+ 6 - 4
common/http.js

@@ -1,8 +1,10 @@
-//const ip = 'http://192.168.0.251/obpm';
-//const ip = 'http://106.55.241.82:8888/obpm';
-const ip = 'https://tdm.liugong.com/obpm';
-//const ip2 = 'https://tdm.liugong.com';
+const ip = 'http://192.168.0.251/obpm';
 const ip2 = 'http://192.168.0.251/liug';
+//const ip = 'http://106.55.241.82:8888/obpm';
+//const ip2 = 'http://106.55.241.82:8888/liug';
+//const ip = 'https://tdm.liugong.com/obpm';
+//const ip2 = 'https://tdm.liugong.com/liug';
+
 
 /**
  * 全部接口

+ 4 - 3
pages/home/index.vue

@@ -59,7 +59,7 @@
 				</view>
 				<view class="list">
 					<view class="tab"><u-tabs :list="tab" :current="current" @click="click"></u-tabs></view>
-					<view class="spitem" v-for="(item, index) in list" :key="index" @click="detail(item.formId, item.docId)">
+					<view class="spitem" v-for="(item, index) in list" :key="index" @click="detail(item.formId, item.docId,item.stateLabel)">
 						<view class="title">
 							<text class="icon">&#xe602;</text>
 							<text class="tit">[{{ item.flowName }}]</text>
@@ -95,6 +95,7 @@ export default {
 			this.http.request({
 				url: this.http.urls.myPending,
 				success: res => {
+					console.log('selectu:' + JSON.stringify(res));
 					this.tab[0].badge.value = res.data.data.rowCount;
 					this.list = res.data.data.datas;
 					this.list.forEach(item => {
@@ -112,7 +113,7 @@ export default {
 		},
 		click(e) {},
 		//跳转到详情
-		detail(formId, id) {
+		detail(formId, id,sta) {
 			var url;
 			if (formId == '__0FLGNncOS1lz0T9jsFn') {
 				url = '/pages/index/detail?id=';
@@ -122,7 +123,7 @@ export default {
 				url = '/pages/model/borrowing?id=';
 			}
 			uni.navigateTo({
-				url: url + id + '&ste=1&formId=' + formId
+				url: url + id + '&ste=1&formId=' + formId+ '&sta=' + sta
 			});
 		},
 		//退出登录

+ 58 - 21
pages/index/detail.vue

@@ -199,9 +199,9 @@
 						<view class="icon select check" v-if="item.check">&#xe600;</view>
 						<view class="icon select" v-else>&#xe8bb;</view>
 						<view class="title">{{ item.name }}</view>
-						<view class="xze">
+						<view class="xze" v-if="stues=='任务分派'||stues=='报告编制'||stues=='报告审核'">
 							<view class="users omit">
-								<text>基栋,滕工,周公,基栋,滕工,周公,基栋,滕工,周公,基栋,滕工,周公</text>
+								<text>{{tname}}</text>
 							</view>
 							<view class="icon" @click.stop="selectApprovers()">&#xeb25;</view>
 						</view>
@@ -281,25 +281,43 @@ export default {
 				subDocuments: [],
 				templateForm: '',
 				versions: '0'
-			}
+			},
+			stues:'',
+			secauser:{},
+			tname:''
 		};
 	},
 	onLoad(e) {
 		this.id = e.id;
 		//传过来的id
+		this.stues=e.sta;
 		this.state = e.ste;
 		if (e.ste == 1) {
-			/* this.http.request({
-					url: this.http.urls.xxxx + e.id,
-					success: res => {
-						this.item = res.data.data;
-					}
-				}); */
-			this.getDocuments();
+		this.getDocuments();
 		} else if (e.ste == 2) {
 			this.empty();
 		}
 		//选中审批人员监听函数,其它类型的参考这个
+		uni.$on('selectu', res => {
+			console.log('selectu:' + JSON.stringify(res));
+			this.itemt.submitTo=[];
+			var su={isToPerson:true};
+			var u="";
+			this.tname='';
+				res.forEach(item => {
+					su.nodeid=item.nodeId;
+					u+=item.id+';';
+					this.tname+=item.name+',';
+				});
+				su.userids=u;
+				console.log('su:' + JSON.stringify(su));
+				this.itemt.submitTo.push(su);
+					console.log('su:' + JSON.stringify(this.itemt));
+				
+			this.convert();
+		});
+		
+		//选中审批人员监听函数,其它类型的参考这个
 		uni.$on('select', res => {
 			console.log('asd2:' + JSON.stringify(res));
 			if (res.ste == 1) {
@@ -338,6 +356,9 @@ export default {
 			e.check = true;
 			this.itemt.nextNodeIds = [];
 			this.itemt.nextNodeIds.push(e.id);
+			this.secauser=this.itemt;
+			this.secauser.nodeid=e.id;
+			
 			this.$forceUpdate();
 		}, //详情
 		getDocuments() {
@@ -348,7 +369,7 @@ export default {
 					this.item = res.data.data.items;
 					this.p = res.data.data;
 					this.getUsers();
-
+console.log('this.p:' + JSON.stringify(res));
 					//保存数据
 					this.btitem.id = res.data.data.id;
 					this.btitem.formId = res.data.data.formid;
@@ -402,7 +423,7 @@ export default {
 				url: this.http.urls.empty,
 				data: this.item,
 				success: res => {
-					console.log('res2:' + JSON.stringify(res));
+					
 					this.item = res.data.data.items;
 					this.p = res.data.data;
 					//保存数据
@@ -491,8 +512,9 @@ export default {
 		},
 		//选择审批人员
 		selectApprovers(e) {
+			
 			uni.navigateTo({
-				url: '/pages/index/selectApprovers?item=' + JSON.stringify(this.itemt)
+				url: '/pages/index/selectApprovers?item=' + JSON.stringify(this.secauser)
 			});
 		},
 		//选择文件上传
@@ -620,7 +642,7 @@ export default {
 					this.itemt.currentNodeId = res.data.data.currentNodeId;
 					this.itemt.attitude = '';
 					this.itemt.signature = '';
-					this.itemt.submitTo = '';
+					this.itemt.submitTo = [];
 					this.itemt.circulatorInfo = '';
 					this.itemt.subFlowApproverInfo = '';
 					this.itemt.subFlowApproverInfoAll = '';
@@ -639,9 +661,26 @@ export default {
 			this.itemt.parentId = '';
 			this.itemt.subFlowApprover = [];
 			this.itemt.subSelects = [];
-			this.itemt.submitTo = [];
+			//this.itemt.submitTo = [];
 			this.itemt.templateForm = '';
 			this.itemt.viewId = '';
+			if(this.stues=='任务分派'||this.stues=='报告编制'||this.stues=='报告审核'){
+				if(this.itemt.submitTo.length == 0){
+					uni.showModal({
+						title: '提示',
+						content: '请选择审批人',
+						showCancel: false,
+						success: res => {
+							if (res.confirm) {
+								//	uni.navigateBack();
+							}
+						}
+					});
+					return;
+				}
+			}
+			
+			
 			this.http.request({
 				url: this.http.urls.documents + this.id + '/workflows/submit',
 				data: this.itemt,
@@ -652,8 +691,7 @@ export default {
 					console.log('zx22:' + JSON.stringify(res));
 					this.show = false;
 
-					this.title = res.data.data.name;
-					this.nextNodes = res.data.data.nextNodes;
+					
 					uni.$emit('index');
 					uni.redirectTo({
 						url: '/pages/index/index'
@@ -681,7 +719,7 @@ export default {
 					this.itemt.currentNodeId = res.data.data.currentNodeId;
 					this.itemt.attitude = '';
 					this.itemt.signature = '';
-					this.itemt.submitTo = '';
+					//this.itemt.submitTo = [];
 					this.itemt.circulatorInfo = '';
 					this.itemt.subFlowApproverInfo = '';
 					this.itemt.subFlowApproverInfoAll = '';
@@ -699,7 +737,7 @@ export default {
 			this.itemt.parentId = '';
 			this.itemt.subFlowApprover = [];
 			this.itemt.subSelects = [];
-			this.itemt.submitTo = [];
+			//this.itemt.submitTo = [];
 			this.itemt.templateForm = '';
 			this.itemt.viewId = '';
 			this.http.request({
@@ -712,8 +750,7 @@ export default {
 					console.log('zx22:' + JSON.stringify(res));
 					this.bshow = false;
 
-					this.title = res.data.data.name;
-					this.nextNodes = res.data.data.nextNodes;
+					
 					uni.$emit('index');
 					uni.redirectTo({
 						url: '/pages/index/index'

+ 3 - 3
pages/index/index.vue

@@ -13,7 +13,7 @@
 			</view>
 		</view>
 		<view class="list">
-			<view class="item" v-for="(item, index) in list" :key="index" @click="detail(item.id, '1')">
+			<view class="item" v-for="(item, index) in list" :key="index" @click="detail(item.id, '1',item.items.__oUywWKvn4BhpnBmxqYT.value)">
 				<view class="title">
 					<text class="tv">{{ item.items.__yZMMXcXNnmKq5pTTfPH.value }}</text>
 					<text class="icon">&#xe631;</text>
@@ -101,9 +101,9 @@ export default {
 			this.getData();
 		},
 		//跳转到详情
-		detail(id, ste) {
+		detail(id, ste,sta) {
 			uni.navigateTo({
-				url: '/pages/index/detail?id=' + id + '&ste=' + ste
+				url: '/pages/index/detail?id=' + id + '&ste=' + ste+ '&sta=' + sta
 			});
 		},
 		//跳转到详情

+ 13 - 5
pages/index/selectApprovers.vue

@@ -9,6 +9,9 @@
 			<view class="icon more">&#xe631;</view>
 			<view class="clear"></view>
 		</view>
+		<view class="footer">
+			<button class="btn ws" @click="back">确定({{ selects.length }})</button>
+		</view>
 	</view>
 </template>
 
@@ -32,7 +35,7 @@ export default {
 		this.param=JSON.parse(e.item);
 		console.log('this.param' + JSON.stringify(this.param));
 		this.flowId=this.param.flowId;
-		this.nodeId=this.param.currentNodeId;
+		this.nodeId=this.param.nodeid;
 		this.id=this.param.document.id;
 		this.getData();
 	},
@@ -41,7 +44,7 @@ export default {
 			
 			this.http.request({
 				url:  this.http.urls.documents + this.id+'/workflows/'+ this.flowId+'/selectApprovers?nodeId='+ this.nodeId+'&type=3&selectId='+ this.selectId,
-				data: this.param,
+				//data: this.param,
 				method: 'GET',
 				success: res => {
 					console.log('res.data.data.page===' + JSON.stringify(res));
@@ -64,14 +67,19 @@ export default {
 			item.check = !item.check;
 			
 			console.log('this.item===' + JSON.stringify(item));
-			this.selects = item;
-			uni.$emit('select', this.selects);
+			//this.selects = item;
+			//uni.$emit('select', this.selects);
 			//uni.navigateBack();
+			//this.selects = this.list.filter(item => item.check);
+			
+			
+			item.nodeId=this.nodeId;
+			//console.log("this.item==="+JSON.stringify(item));
 			this.selects = this.list.filter(item => item.check);
 		},
 		//选中并返回
 		back() {
-			uni.$emit('select', this.selects);
+			uni.$emit('selectu', this.selects);
 			uni.navigateBack();
 		}
 	}