15807800591 2 anni fa
parent
commit
36c9a08879
2 ha cambiato i file con 70 aggiunte e 3 eliminazioni
  1. 69 2
      pages/index/detail.vue
  2. 1 1
      pages/model/return.vue

+ 69 - 2
pages/index/detail.vue

@@ -167,6 +167,7 @@
 		</view>
 		<view class="footer" v-if="btnshow">
 			<view class="flex">
+				<view class="f"><button class="btn br" @click="validate()">保存</button></view>
 				<view class="f"><button class="btn br" @click="submission()">提交</button></view>
 				<view class="f" v-if="state == 1"><button class="btn br back" @click="back()">回退</button></view>
 			</view>
@@ -259,7 +260,19 @@ export default {
 				userids: '__jFFZYvLIG6uFc7CdBMg'
 			},
 			btnshow: false,
-			state: 0
+			state: 0,
+			btitem: {
+				applicationId: '__gAPYBW4YxB3UePM3lqO',
+				exparams: {},
+				formId: '__0FLGNncOS1lz0T9jsFn',
+				id: '__79Wtw03ya4dJUDGPyAN',
+				isRelate: 'true',
+				parentId: '',
+				sign: '',
+				subDocuments: [],
+				templateForm: '',
+				versions: '0'
+			},
 		};
 	},
 	onLoad(e) {
@@ -324,9 +337,20 @@ export default {
 				success: res => {
 					this.item = res.data.data.items;
 					this.p = res.data.data;
+					
+					console.log('res.data:' + JSON.stringify(res.data));
+					
+					//保存数据
+					this.btitem.id = res.data.data.id;
+					this.btitem.formId = res.data.data.formid;
+					this.btitem.versions = res.data.data.versions;
+					this.btitem.parentId = "";
+				
+					
+					
 					this.item.unstructured = JSON.parse(this.item.unstructured);
 					if (this.p.lastFlowOperation == undefined || this.p.auditorList.includes(this.getUser().id)) {
-						console.log('this.p1:' + JSON.stringify(this.p));
+						
 						this.btnshow = true;
 					}
 
@@ -371,6 +395,13 @@ export default {
 					console.log('res2:' + JSON.stringify(res));
 					this.item = res.data.data.items;
 					this.p = res.data.data;
+					//保存数据
+					this.btitem.id = res.data.data.id;
+					this.btitem.formId = res.data.data.formid;
+					this.btitem.versions = res.data.data.versions;
+					this.btitem.parentId = "";
+					
+					
 					console.log('this.p1:' + JSON.stringify(this.p));
 					//this.current=res.data.data.items.report_type;
 					if (this.item.report_type == '正式报告') {
@@ -491,6 +522,42 @@ export default {
 				}
 			});
 		},
+		//保存
+		validate() {
+		
+		this.btitem.items = this.item;
+			this.http.request({
+				url: this.http.urls.validate +'/'+this.btitem.id+
+					'/withoutValid?' +
+					this.btitem.parentId,
+				data: this.btitem,
+				method: 'PUT',
+				success: res => {
+					console.log('validate1:' + JSON.stringify(res));
+						
+					if(res.data.errcode==0){
+						uni.$emit('index');
+						uni.redirectTo({
+							url: '/pages/index/index'
+						});
+					}else{
+						uni.showModal({
+							title: '提示',
+							content: res.data.data.errmsg,
+							showCancel: false,
+							success: res => {
+								if (res.confirm) {
+									//uni.navigateBack();
+								}
+							}
+						});
+						
+						return;
+					}
+					
+				}
+			});
+		},
 		//提交流程面板
 		submission() {
 			this.http.request({

+ 1 - 1
pages/model/return.vue

@@ -520,7 +520,7 @@
 
 				});
 			},
-			//提交
+			//保存
 			validate() {