15807800591 %!s(int64=2) %!d(string=hai) anos
pai
achega
9c07217dba
Modificáronse 5 ficheiros con 957 adicións e 27 borrados
  1. 13 1
      common/http.js
  2. 8 0
      pages.json
  3. 617 0
      pages/model/borrowing.vue
  4. 1 1
      pages/model/index.vue
  5. 318 25
      pages/model/return.vue

+ 13 - 1
common/http.js

@@ -1,10 +1,13 @@
 const ip = 'http://192.168.0.251/obpm';
 //const ip = 'https://tdmtest.liugong.com/obpm';
+const ip2 = 'http://192.168.0.251/';
+
 /**
  * 全部接口
  */
 const urls = {
 	ip: ip,
+	ip2: ip2,
 	home: ip + '/app/home/index', //首页数据
 
 	login: ip + '/runtime/login/loginWithCiphertext2', //用户登陆
@@ -36,7 +39,16 @@ const urls = {
 		'/runtime/__gAPYBW4YxB3UePM3lqO/forms/__w9J1gxcIWgXmNw6pE1F/empty?formId=__w9J1gxcIWgXmNw6pE1F&appId=__gAPYBW4YxB3UePM3lqO', //创建设备借用
 	return_empty: ip +
 		'/runtime/__gAPYBW4YxB3UePM3lqO/forms/__LcDaGhYHt5xOSeHMCs0/empty?formId=__LcDaGhYHt5xOSeHMCs0&appId=__gAPYBW4YxB3UePM3lqO', //创建设备归还
-eq_list: ip +'/runtime/__gAPYBW4YxB3UePM3lqO/views/__WLVxKX6e0Pq0cTwdNUQ/documents?',
+
+	tool_borrowing_empty: ip +
+		'/runtime/__gAPYBW4YxB3UePM3lqO/forms/__9lR0Vy6jiAmTJTWiM8t/empty?formId=__9lR0Vy6jiAmTJTWiM8t&appId=__gAPYBW4YxB3UePM3lqO', //创建设备借用台账
+
+
+
+runViewDialogConfirmScript: ip + '/runtime/views/selectbox/runViewDialogConfirmScript?',
+
+
+	eq_list: ip + '/runtime/__gAPYBW4YxB3UePM3lqO/views/__WLVxKX6e0Pq0cTwdNUQ/documents?',
 }
 /**
  * 封装的http请求wt_

+ 8 - 0
pages.json

@@ -41,6 +41,14 @@
 
 		},
 		{
+			"path": "pages/model/borrowing",
+			"style": {
+				"navigationBarTitleText": "设备借用",
+				"enablePullDownRefresh": false
+			}
+		
+		},
+		{
 			"path": "pages/index/index",
 			"style": {
 				"navigationBarTitleText": "委托单列表",

+ 617 - 0
pages/model/borrowing.vue

@@ -0,0 +1,617 @@
+<template>
+	<view class="page">
+		<view class="vtitle">借用人信息</view>
+		<view class="form_group">
+			<view class="lable">扫码</view>
+			<view class="tag" @click="qr()">
+				<text class="span" style="width: 90%;">{{ code }}</text>
+				<text class="icon code">&#xe60e;</text>
+			</view>
+		</view>
+		<view class="form_group"  v-if="op == '设备借用11'">
+			<view class="lable">设备所属部门</view>
+			<view class="tag">
+				<view class="span">
+					<picker @change="bindChange($event, 'dept')" :range="array1">
+						<view class="picks">{{ item.dept ? item.dept : '选择2' }}</view>
+					</picker>
+				</view>
+				<text class="icon more">&#xe631;</text>
+			</view>
+		</view>
+		<view class="form_group" v-if="op == '设备借用'">
+			<view class="lable">借用人</view>
+			<view class="tag">
+				<input v-model="item.borrower" placeholder="输入借用人" />
+				<text class="icon more">&#xe631;</text>
+			</view>
+		</view>
+		<view class="form_group" v-if="op == '设备归还'">
+			<view class="lable">归还者</view>
+			<view class="tag">
+				<input v-model="item.ghz" placeholder="归还者" />
+				<text class="icon more">&#xe631;</text>
+			</view>
+		</view>
+		<view class="form_group" v-if="op == '设备借用'">
+			<view class="lable">借用人部门</view>
+			<view class="tag">
+				<text class="span">{{ item.UNIT }}</text>
+				<text class="icon more">&#xe631;</text>
+			</view>
+		</view>
+		<view class="form_group">
+			<view class="lable">手机号</view>
+			<view class="tag">
+				<input v-model="item.tel" placeholder="输入手机号" />
+				<text class="icon more">&#xe631;</text>
+			</view>
+		</view>
+		<view class="vtitle">借用设备信息</view>
+		<view v-for="(item, index) in list" :key="index" class="item">
+			<view class="form_group">
+				<view class="lable">序号</view>
+				<view class="tag">
+					<text class="span">{{ index + 1 }}</text>
+				</view>
+			</view>
+			<view class="form_group">
+				<view class="lable">计量编号</view>
+				<view class="tag">
+					<text class="span">{{ item.items.__b5UmDDfLaCJJdn5F4JF.value }}</text>
+				</view>
+			</view>
+			<view class="form_group">
+				<view class="lable">设备名称</view>
+				<view class="tag">
+					<text class="span">{{ item.items.__FwAgiHdxI4bCZaKNs4A.value }}</text>
+				</view>
+			</view>
+			<view class="form_group">
+				<view class="lable">型号规格</view>
+				<view class="tag">
+					<text class="span">{{ item.items.__drInpQcmkMf2iWseaRR.value }}</text>
+				</view>
+			</view>
+			<view class="form_group">
+				<view class="lable">测量范围</view>
+				<view class="tag">
+					<text class="span">{{ item.items.__XcfZD8dzEQb5qURydpP.value }}</text>
+				</view>
+			</view>
+			<view class="form_group">
+				<view class="lable">最大允许误差</view>
+				<view class="tag">
+					<text class="span">{{ item.items.__ARvSmuzLwNLg6TlB4tV.value }}</text>
+				</view>
+			</view>
+			<view class="form_group">
+				<view class="lable">内部编号</view>
+				<view class="tag">
+					<text class="span">{{ item.items.__BEViJOuGBdPWSxES5Z5.value }}</text>
+				</view>
+			</view>
+			<view class="form_group">
+				<button class="btn del" @click="del(item)">移除</button>
+			</view>
+		</view>
+		<u-empty v-if="list.length == 0"></u-empty>
+		<view class="footer">
+			<view class="flex">
+				<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 class="f"><button class="btn" @click="validate()">保存</button></view>-->
+			</view>
+		</view>
+
+		<u-popup :show="show" mode="bottom" @close="show = false" closeable round="15">
+			<view class="popup">
+				<u-divider text="提交流程面板"></u-divider>
+				<scroll-view scroll-y="true" style="height: 300rpx;">
+					<view v-for="(item, index) in nextNodes" :key="index" class="bitem"
+						@click="bselect(item, 'nextNodes')">
+						<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>
+				</scroll-view>
+				<view class="confrim-btn"><button class="btn" @click="submit()">确定</button></view>
+			</view>
+		</u-popup>
+		<u-popup :show="bshow" mode="bottom" @close="bshow = false" closeable round="15">
+			<view class="popup">
+				<u-divider text="回退流程面板"></u-divider>
+				<scroll-view scroll-y="true" style="height: 300rpx;">
+					<view v-for="(item, index) in backNodes" :key="index" class="bitem"
+						@click="bselect(item, 'backNodes')">
+						<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>
+				</scroll-view>
+				<view class="confrim-btn"><button class="btn" @click="workflowsback()">确定</button></view>
+			</view>
+		</u-popup>
+
+
+
+
+	</view>
+</template>
+
+<script>
+	let qrcode = require('@/common/code.js');
+	export default {
+		data() {
+			return {
+				array1: ['类型1', '类型2', '类型3', '类型4'], //实验类型1
+				bitem: {
+					applicationId: '__gAPYBW4YxB3UePM3lqO',
+					exparams: {},
+					formId: '__0FLGNncOS1lz0T9jsFn',
+					id: '__79Wtw03ya4dJUDGPyAN',
+					isRelate: 'undefined',
+					parentId: '',
+					sign: '',
+					subDocuments: [],
+					templateForm: '',
+					versions: '0'
+				},
+				btitem: {
+					applicationId: '__gAPYBW4YxB3UePM3lqO',
+					exparams: {},
+					formId: '__0FLGNncOS1lz0T9jsFn',
+					id: '__79Wtw03ya4dJUDGPyAN',
+					isRelate: 'undefined',
+					parentId: '',
+					sign: '',
+					subDocuments: [],
+					templateForm: '',
+					versions: '0'
+				},
+				geteq: {
+					DEVID: '202209211603170016',
+					allow: 'false',
+					appId: '__gAPYBW4YxB3UePM3lqO',
+					datetime: '1670485443880',
+					detp: '',
+					fieldid: '__iLwKGJTxD89ZKnFzo2Y',
+					formId: '__w9J1gxcIWgXmNw6pE1F',
+					isEdit: 'true',
+					mutil: 'true',
+					parentId: '__NYI0rVs0LXbiW21z6Nv',
+					searchForm: 'false',
+					selectOne: 'false',
+					viewId: '__WLVxKX6e0Pq0cTwdNUQ'
+				},
+				item: {},
+				op: '设备归还',
+				current: 0,
+				code: '',
+				list: [],
+				show: false,
+				bshow: false,
+				itemt: {},
+				up: {},
+				content: '标题',
+				nextNodes: [],
+				backNodes: [],
+				items: {
+					document: {
+						items: {}
+					}
+				},
+				runViewDialogConfirmScript: {
+					docId: "__DIl607e1fsiknRgGRQj",
+					document: {
+						items: {
+							group: "",
+							depttool: "",
+							UNIT: "柳工",
+							borrower: "",
+							tel: "",
+							remarks: ""
+						},
+						
+					},
+					fieldId: "__0TQu1UrRbMZVX1UvtBL",
+					formId: "__w9J1gxcIWgXmNw6pE1F",
+					viewId: "__WLVxKX6e0Pq0cTwdNUQ",
+					_selects: "__sIJiL5GlxEYoL095Vo9",
+				},
+			};
+		},
+		onLoad(e) {
+			this.op = e.op;
+			this.empty();
+			//选中审批人员监听函数,其它类型的参考这个
+			uni.$on('select', res => {
+				console.log('asd:' + JSON.stringify(res));
+			});
+		},
+		onReady() {
+			uni.setNavigationBarTitle({
+				title: this.op
+			});
+		},
+		methods: {
+			//提交或回退
+			bselect(e, tag) {
+				this[tag].forEach(item => {
+					item.check = false;
+				});
+				e.check = true;
+				this.itemt.nextNodeIds = [];
+				this.itemt.nextNodeIds.push(e.id);
+				this.$forceUpdate();
+			}, //详情
+			qr() {
+				// 调用uni提供的调用相机api
+				uni.chooseImage({
+					sizeType: ['original'],
+					sourceType: ['camera'],
+					count: 1,
+					success: res => {
+						const tempFilePaths = res.tempFilePaths[0]; // 获取到二维码图片的链接
+						qrcode.decode(tempFilePaths); // 解析二维码图片
+						qrcode.callback = r => {
+							this.code = r;
+
+							this.geteq.DEVID = this.code;
+							if (this.list.length == 0) {
+								this.getEq();
+							} else {
+								this.list.forEach(item => {
+
+									if (item.items.__2sfNVgOh5Bzq6lXRVuM.value == this.geteq
+										.DEVID) {
+										uni.showModal({
+											title: '提示',
+											content: '该设备已经选择过了',
+											showCancel: false,
+											success: res => {
+												if (res.confirm) {
+													//	uni.navigateBack();
+												}
+											}
+										});
+									} else {
+										
+								this.getEq();
+									}
+								});
+							}
+
+							console.log('asd:' + r);
+							this.$forceUpdate();
+						};
+					}
+				});
+			},
+			//选择结果形式
+			change(e) {
+				this.current = e;
+				console.log('aa:' + this.radio[this.current].name);
+			},
+			//选择实验类型
+			bindChange(e, type) {
+				this.item[type] = this.array1[e.target.value];
+				this.$forceUpdate();
+			},
+			//选择审批人员
+			select() {
+				uni.navigateTo({
+					url: '/pages/index/select'
+				});
+			},
+			getEq() {
+				this.http.request({
+					url: this.http.urls.eq_list +
+						'parentId=' +
+						this.geteq.parentid,
+					data: this.geteq,
+					method: 'POST',
+					success: res => {
+						//console.log('res2:' + JSON.stringify(res));
+						if (res.data.errcode == 0) {
+
+							res.data.data.data.forEach(item => {
+								//console.log('res2:' + JSON.stringify(res));
+							//	this.runViewDialogConfirmScript.docId=this.bitem.id ;
+								//this.runViewDialogConfirmScript._selects=item.docId;
+								//this.runViewDialogConfirm();
+								this.list.push(item);
+							});
+						}
+					}
+				});
+			},
+			empty() {
+				var url = '';
+				if (this.op == '设备借用') {
+					url = this.http.urls.borr_empty;
+				} else {
+					url = this.http.urls.return_empty;
+				}
+				this.http.request({
+					url: url,
+					data: this.item,
+
+					success: res => {
+						this.item = res.data.data.items;
+						this.bitem.id = res.data.data.id;
+						this.bitem.formId = res.data.data.formid;
+						this.bitem.versions = res.data.data.versions;
+						this.geteq.parentid = res.data.data.id;
+
+
+
+						//创建时组建提交流程面板请求数据
+						this.iteml = res.data.data;
+						this.items.applicationId = '__gAPYBW4YxB3UePM3lqO';
+						this.items.docId = this.iteml.id;
+						this.items.id = this.iteml.id;
+						this.items.formId = this.iteml.formid;
+						this.items.parentId = '';
+						this.items.subSelects = [];
+						this.items.templateForm = '';
+						this.items.viewId = '';
+						this.items.document.items = this.item;
+						this.items.document.applicationId = '__gAPYBW4YxB3UePM3lqO';
+						this.items.document.exparams = {};
+						this.items.document.formId = this.iteml.formid;
+						this.items.document.id = this.iteml.id;
+						this.items.document.parentId = '';
+						this.items.document.sign = '';
+						this.items.document.stateId = this.iteml.stateid;
+						this.items.document.subDocuments = [];
+						this.items.document.templateForm = '';
+						this.items.document.versions = '0';
+						//console.log('res2:' + JSON.stringify(res.data.data));
+					}
+				});
+			},
+			//移除借用设备信息
+			del(item) {
+				this.list.splice(this.list.indexOf(item), 1);
+			},
+
+			tool_borrowing_empty() {
+				this.list.forEach(item => {
+
+
+
+
+					this.http.request({
+						url: this.http.urls.tool_borrowing_empty,
+						data: this.item,
+
+						success: res => {
+							console.log('tool_borrowing_empty:' + JSON.stringify(res));
+							//this.item = res.data.data.items;
+							console.log('this.bitem:' + JSON.stringify(this.bitem));
+							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.bitem.id;
+							//this.btitem.parent=this.bitem.id;
+							this.btitem.items = res.data.data.items;
+
+							this.btitem.items.HERST = item.items.__SH6ZSHZMqHeGHDFLAaO.value; //
+							this.btitem.items.TYPBZ = item.items.__drInpQcmkMf2iWseaRR.value; //
+							this.btitem.items.EQKTX = item.items.__FwAgiHdxI4bCZaKNs4A.value; //
+							this.btitem.items.FBL = item.items.__Tyyw12PleIHLPjjJWsV.value; //
+							this.btitem.items.TPLNR = item.items.__a7cgJzxvCbcNNH0KjCn.value; //
+							this.btitem.items.EQUNR = item.items.__b5UmDDfLaCJJdn5F4JF.value; //
+							this.btitem.items.NUMBER = item.items.__2sfNVgOh5Bzq6lXRVuM.value;
+							this.btitem.items.CLFW = item.items.__XcfZD8dzEQb5qURydpP.value; //
+							this.btitem.items.borrowing_date = new Date(); //借用日期
+							this.btitem.items.ZQDDJ = item.items.__Rhr5ihIebMolSIr8CKn.value; //
+							this.btitem.items.ZDYXWC = item.items.__ARvSmuzLwNLg6TlB4tV.value; //
+							this.btitem.items.STTXU = item.items.__SBtfwetYprHFQ5J2MAn.value; //
+							this.btitem.items.SERGE = item.items.__qyobrAFN4PtseWXiY5A.value; //
+							this.btitem.items.INTNUM = item.items.__BEViJOuGBdPWSxES5Z5.value; //
+							this.btitem.items.NPLDA = item.items.__R8QpJNSHAVFaYwHnVCo.value; //
+							//this.btitem.items.toolstate=0;//借用日期
+
+
+							this.btitem.items.DEVID = item.items.__2sfNVgOh5Bzq6lXRVuM.value;
+							console.log('this.btitem1:' + JSON.stringify(this.btitem));
+							this.validate();
+
+
+							//console.log('res2:' + JSON.stringify(res.data.data));
+						}
+					});
+
+				});
+			},
+			//提交
+			validate() {
+
+
+				this.http.request({
+					url: this.http.urls.validate +
+						'?parentId=' +
+						this.btitem.parentId,
+					data: this.btitem,
+					method: 'POST',
+					success: res => {
+						console.log('validate1:' + JSON.stringify(res));
+                       this.updateparent(this.btitem.parentId,this.btitem.id);
+					}
+				});
+			},
+			updateparent(parent,id) {
+			
+			
+				this.http.request({
+					url: this.http.urls.ip2+'liug/app?parent='+parent+'&id='+id+'&table=tlk_tool_borrowing',
+					
+					method: 'POST',
+					success: res => {
+						console.log('validate1:' + JSON.stringify(res));
+			
+					}
+				});
+			},
+			//提交流程面板
+			submission() {
+
+				//this.validatet();
+				this.http.request({
+					url: this.http.urls.documents + this.bitem.id + '/panels/submission',
+					data: this.items,
+
+					method: 'POST',
+					success: res => {
+						//this.item=res.data.data;
+						//console.log('zx22:' + JSON.stringify(res));
+						this.show = true;
+
+						this.title = res.data.data.name;
+						this.nextNodes = res.data.data.nextNodes;
+						this.itemt.flowId = res.data.data.flowId;
+						this.itemt.flowType = '80';
+						this.itemt.currentNodeId = res.data.data.currentNodeId;
+						this.itemt.attitude = '';
+						this.itemt.signature = '';
+						this.itemt.submitTo = '';
+						this.itemt.circulatorInfo = '';
+						this.itemt.subFlowApproverInfo = '';
+						this.itemt.subFlowApproverInfoAll = '';
+						this.itemt.document = this.items.document;
+						//this.content=res.data.data.formname;
+					}
+				});
+			}, //提交流程
+			submit() {
+				//this.itemt.document.items.purpose="试验目的5656";
+				//this.itemt.document.items.title="标题5656";
+
+				if (this.itemt.document.items.borrower == '' || this.itemt.document.items.borrower == null) {
+					uni.showModal({
+						title: '提示',
+						content: '请填写借用人',
+						showCancel: false,
+						success: res => {
+							if (res.confirm) {
+								//uni.navigateBack();
+							}
+						}
+					});
+
+					return;
+				}
+				if (this.itemt.document.items.tel == '' || this.itemt.document.items.tel == null) {
+					uni.showModal({
+						title: '提示',
+						content: '请填写手机号',
+						showCancel: false,
+						success: res => {
+							if (res.confirm) {
+								//uni.navigateBack();
+							}
+						}
+					});
+
+					return;
+				}
+
+
+
+
+
+				this.itemt.applicationId = '__gAPYBW4YxB3UePM3lqO';
+				this.itemt.docId = this.iteml.id;
+				this.itemt.id = this.iteml.id;
+				this.itemt.formId = this.iteml.formid;
+				this.itemt.parentId = '';
+				this.itemt.subFlowApprover = [];
+				this.itemt.subSelects = [];
+				this.itemt.submitTo = [];
+				this.itemt.templateForm = '';
+				this.itemt.viewId = '';
+				this.http.request({
+					url: this.http.urls.documents + this.id + '/workflows/submit',
+					data: this.itemt,
+
+					method: 'PUT',
+					success: res => {
+						//this.item=res.data.data;
+						console.log('zx22:' + JSON.stringify(res));
+						if (res.data.errcode == 0) {
+
+							uni.showModal({
+								title: '提示',
+								content: res.data.data,
+								showCancel: false,
+								success: res => {
+									if (res.confirm) {
+										uni.navigateBack();
+									}
+								}
+							});
+
+							this.tool_borrowing_empty();
+						} else {
+							uni.showModal({
+								title: '提示',
+								content: res.data.errmsg,
+								showCancel: false,
+								success: res => {
+									if (res.confirm) {
+										//uni.navigateBack();
+									}
+								}
+							});
+
+						}
+
+
+						this.show = false;
+
+						this.title = res.data.data.name;
+						this.nextNodes = res.data.data.nextNodes;
+
+					}
+				});
+			}, //刷新数据
+			//提交
+			add() {
+				this.http.request({
+					url: this.http.urls.user_task_add,
+					data: this.item,
+					method: 'POST',
+					success: res => {
+						uni.showModal({
+							title: '提示',
+							content: '提交成功',
+							showCancel: false,
+							success: res => {
+								if (res.confirm) {
+									uni.navigateBack();
+								}
+							}
+						});
+					}
+				});
+			}
+		}
+	};
+</script>
+
+<style lang="scss">
+	.page {
+		padding-bottom: 80px;
+	}
+
+	.item {
+		margin-bottom: 10px;
+	}
+
+	.del {
+		width: 70%;
+		background-color: #e64340;
+	}
+</style>

+ 1 - 1
pages/model/index.vue

@@ -41,7 +41,7 @@
 		<view class="footer">
 			<view class="flex">
 				<view class="f"><button class="btn br" @click="go('/pages/model/return?op=设备归还')">归还设备</button></view>
-				<view class="f"><button class="btn br" @click="go('/pages/model/return?op=设备借用')">借用设备</button></view>
+				<view class="f"><button class="btn br" @click="go('/pages/model/borrowing?op=设备借用')">借用设备</button></view>
 			</view>
 		</view>
 	</view>

+ 318 - 25
pages/model/return.vue

@@ -8,7 +8,7 @@
 				<text class="icon code">&#xe60e;</text>
 			</view>
 		</view>
-		<view class="form_group">
+		<view class="form_group"  v-if="op == '设备借用11'">
 			<view class="lable">设备所属部门</view>
 			<view class="tag">
 				<view class="span">
@@ -22,7 +22,7 @@
 		<view class="form_group" v-if="op == '设备借用'">
 			<view class="lable">借用人</view>
 			<view class="tag">
-				<input v-model="item.title" placeholder="输入借用人" />
+				<input v-model="item.borrower" placeholder="输入借用人" />
 				<text class="icon more">&#xe631;</text>
 			</view>
 		</view>
@@ -98,10 +98,44 @@
 		<u-empty v-if="list.length == 0"></u-empty>
 		<view class="footer">
 			<view class="flex">
-				<view class="f"><button class="btn">提交</button></view>
-				<view class="f"><button class="btn" @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 class="f"><button class="btn" @click="validate()">保存</button></view>-->
 			</view>
 		</view>
+
+		<u-popup :show="show" mode="bottom" @close="show = false" closeable round="15">
+			<view class="popup">
+				<u-divider text="提交流程面板"></u-divider>
+				<scroll-view scroll-y="true" style="height: 300rpx;">
+					<view v-for="(item, index) in nextNodes" :key="index" class="bitem"
+						@click="bselect(item, 'nextNodes')">
+						<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>
+				</scroll-view>
+				<view class="confrim-btn"><button class="btn" @click="submit()">确定</button></view>
+			</view>
+		</u-popup>
+		<u-popup :show="bshow" mode="bottom" @close="bshow = false" closeable round="15">
+			<view class="popup">
+				<u-divider text="回退流程面板"></u-divider>
+				<scroll-view scroll-y="true" style="height: 300rpx;">
+					<view v-for="(item, index) in backNodes" :key="index" class="bitem"
+						@click="bselect(item, 'backNodes')">
+						<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>
+				</scroll-view>
+				<view class="confrim-btn"><button class="btn" @click="workflowsback()">确定</button></view>
+			</view>
+		</u-popup>
+
+
+
+
 	</view>
 </template>
 
@@ -123,6 +157,18 @@
 					templateForm: '',
 					versions: '0'
 				},
+				btitem: {
+					applicationId: '__gAPYBW4YxB3UePM3lqO',
+					exparams: {},
+					formId: '__0FLGNncOS1lz0T9jsFn',
+					id: '__79Wtw03ya4dJUDGPyAN',
+					isRelate: 'undefined',
+					parentId: '',
+					sign: '',
+					subDocuments: [],
+					templateForm: '',
+					versions: '0'
+				},
 				geteq: {
 					DEVID: '202209211603170016',
 					allow: 'false',
@@ -133,7 +179,7 @@
 					formId: '__w9J1gxcIWgXmNw6pE1F',
 					isEdit: 'true',
 					mutil: 'true',
-					parentid: '__NYI0rVs0LXbiW21z6Nv',
+					parentId: '__NYI0rVs0LXbiW21z6Nv',
 					searchForm: 'false',
 					selectOne: 'false',
 					viewId: '__WLVxKX6e0Pq0cTwdNUQ'
@@ -142,7 +188,37 @@
 				op: '设备归还',
 				current: 0,
 				code: '',
-				list: []
+				list: [],
+				show: false,
+				bshow: false,
+				itemt: {},
+				up: {},
+				content: '标题',
+				nextNodes: [],
+				backNodes: [],
+				items: {
+					document: {
+						items: {}
+					}
+				},
+				runViewDialogConfirmScript: {
+					docId: "__DIl607e1fsiknRgGRQj",
+					document: {
+						items: {
+							group: "",
+							depttool: "",
+							UNIT: "柳工",
+							borrower: "",
+							tel: "",
+							remarks: ""
+						},
+						
+					},
+					fieldId: "__0TQu1UrRbMZVX1UvtBL",
+					formId: "__w9J1gxcIWgXmNw6pE1F",
+					viewId: "__WLVxKX6e0Pq0cTwdNUQ",
+					_selects: "__sIJiL5GlxEYoL095Vo9",
+				},
 			};
 		},
 		onLoad(e) {
@@ -159,6 +235,16 @@
 			});
 		},
 		methods: {
+			//提交或回退
+			bselect(e, tag) {
+				this[tag].forEach(item => {
+					item.check = false;
+				});
+				e.check = true;
+				this.itemt.nextNodeIds = [];
+				this.itemt.nextNodeIds.push(e.id);
+				this.$forceUpdate();
+			}, //详情
 			qr() {
 				// 调用uni提供的调用相机api
 				uni.chooseImage({
@@ -170,13 +256,13 @@
 						qrcode.decode(tempFilePaths); // 解析二维码图片
 						qrcode.callback = r => {
 							this.code = r;
-							
+
 							this.geteq.DEVID = this.code;
 							if (this.list.length == 0) {
 								this.getEq();
 							} else {
 								this.list.forEach(item => {
-								
+
 									if (item.items.__2sfNVgOh5Bzq6lXRVuM.value == this.geteq
 										.DEVID) {
 										uni.showModal({
@@ -190,7 +276,8 @@
 											}
 										});
 									} else {
-										this.getEq();
+										
+								this.getEq();
 									}
 								});
 							}
@@ -225,10 +312,14 @@
 					data: this.geteq,
 					method: 'POST',
 					success: res => {
-						console.log('res2:' + JSON.stringify(res));
+						//console.log('res2:' + JSON.stringify(res));
 						if (res.data.errcode == 0) {
 
 							res.data.data.data.forEach(item => {
+								//console.log('res2:' + JSON.stringify(res));
+							//	this.runViewDialogConfirmScript.docId=this.bitem.id ;
+								//this.runViewDialogConfirmScript._selects=item.docId;
+								//this.runViewDialogConfirm();
 								this.list.push(item);
 							});
 						}
@@ -252,6 +343,30 @@
 						this.bitem.formId = res.data.data.formid;
 						this.bitem.versions = res.data.data.versions;
 						this.geteq.parentid = res.data.data.id;
+
+
+
+						//创建时组建提交流程面板请求数据
+						this.iteml = res.data.data;
+						this.items.applicationId = '__gAPYBW4YxB3UePM3lqO';
+						this.items.docId = this.iteml.id;
+						this.items.id = this.iteml.id;
+						this.items.formId = this.iteml.formid;
+						this.items.parentId = '';
+						this.items.subSelects = [];
+						this.items.templateForm = '';
+						this.items.viewId = '';
+						this.items.document.items = this.item;
+						this.items.document.applicationId = '__gAPYBW4YxB3UePM3lqO';
+						this.items.document.exparams = {};
+						this.items.document.formId = this.iteml.formid;
+						this.items.document.id = this.iteml.id;
+						this.items.document.parentId = '';
+						this.items.document.sign = '';
+						this.items.document.stateId = this.iteml.stateid;
+						this.items.document.subDocuments = [];
+						this.items.document.templateForm = '';
+						this.items.document.versions = '0';
 						//console.log('res2:' + JSON.stringify(res.data.data));
 					}
 				});
@@ -260,30 +375,208 @@
 			del(item) {
 				this.list.splice(this.list.indexOf(item), 1);
 			},
+
+			tool_borrowing_empty() {
+				this.list.forEach(item => {
+
+
+
+
+					this.http.request({
+						url: this.http.urls.tool_borrowing_empty,
+						data: this.item,
+
+						success: res => {
+							console.log('tool_borrowing_empty:' + JSON.stringify(res));
+							//this.item = res.data.data.items;
+							console.log('this.bitem:' + JSON.stringify(this.bitem));
+							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.bitem.id;
+							//this.btitem.parent=this.bitem.id;
+							this.btitem.items = res.data.data.items;
+
+							this.btitem.items.HERST = item.items.__SH6ZSHZMqHeGHDFLAaO.value; //
+							this.btitem.items.TYPBZ = item.items.__drInpQcmkMf2iWseaRR.value; //
+							this.btitem.items.EQKTX = item.items.__FwAgiHdxI4bCZaKNs4A.value; //
+							this.btitem.items.FBL = item.items.__Tyyw12PleIHLPjjJWsV.value; //
+							this.btitem.items.TPLNR = item.items.__a7cgJzxvCbcNNH0KjCn.value; //
+							this.btitem.items.EQUNR = item.items.__b5UmDDfLaCJJdn5F4JF.value; //
+							this.btitem.items.NUMBER = item.items.__2sfNVgOh5Bzq6lXRVuM.value;
+							this.btitem.items.CLFW = item.items.__XcfZD8dzEQb5qURydpP.value; //
+							this.btitem.items.borrowing_date = new Date(); //借用日期
+							this.btitem.items.ZQDDJ = item.items.__Rhr5ihIebMolSIr8CKn.value; //
+							this.btitem.items.ZDYXWC = item.items.__ARvSmuzLwNLg6TlB4tV.value; //
+							this.btitem.items.STTXU = item.items.__SBtfwetYprHFQ5J2MAn.value; //
+							this.btitem.items.SERGE = item.items.__qyobrAFN4PtseWXiY5A.value; //
+							this.btitem.items.INTNUM = item.items.__BEViJOuGBdPWSxES5Z5.value; //
+							this.btitem.items.NPLDA = item.items.__R8QpJNSHAVFaYwHnVCo.value; //
+							//this.btitem.items.toolstate=0;//借用日期
+
+
+							this.btitem.items.DEVID = item.items.__2sfNVgOh5Bzq6lXRVuM.value;
+							console.log('this.btitem1:' + JSON.stringify(this.btitem));
+							this.validate();
+
+
+							//console.log('res2:' + JSON.stringify(res.data.data));
+						}
+					});
+
+				});
+			},
 			//提交
 			validate() {
-				this.bitem.items = this.item;
-				this.bitem.items.ghz = '20221208测试app保存';
+
+
 				this.http.request({
-					url: this.http.urls.validate,
-					data: this.bitem,
+					url: this.http.urls.validate +
+						'?parentId=' +
+						this.btitem.parentId,
+					data: this.btitem,
 					method: 'POST',
 					success: res => {
-						//console.log('res:' + JSON.stringify(res));
+						console.log('validate1:' + JSON.stringify(res));
+                       this.updateparent(this.btitem.parentId,this.btitem.id);
+					}
+				});
+			},
+			updateparent(parent,id) {
+			
+			
+				this.http.request({
+					url: this.http.urls.ip2+'liug/app?parent='+parent+'&id='+id+'&table=tlk_tool_borrowing',
+					
+					method: 'POST',
+					success: res => {
+						console.log('validate1:' + JSON.stringify(res));
+			
+					}
+				});
+			},
+			//提交流程面板
+			submission() {
 
-						uni.showModal({
-							title: '提示',
-							content: res.data.errmsg,
-							showCancel: false,
-							success: res => {
-								if (res.confirm) {
-									uni.navigateBack();
-								}
+				//this.validatet();
+				this.http.request({
+					url: this.http.urls.documents + this.bitem.id + '/panels/submission',
+					data: this.items,
+
+					method: 'POST',
+					success: res => {
+						//this.item=res.data.data;
+						//console.log('zx22:' + JSON.stringify(res));
+						this.show = true;
+
+						this.title = res.data.data.name;
+						this.nextNodes = res.data.data.nextNodes;
+						this.itemt.flowId = res.data.data.flowId;
+						this.itemt.flowType = '80';
+						this.itemt.currentNodeId = res.data.data.currentNodeId;
+						this.itemt.attitude = '';
+						this.itemt.signature = '';
+						this.itemt.submitTo = '';
+						this.itemt.circulatorInfo = '';
+						this.itemt.subFlowApproverInfo = '';
+						this.itemt.subFlowApproverInfoAll = '';
+						this.itemt.document = this.items.document;
+						//this.content=res.data.data.formname;
+					}
+				});
+			}, //提交流程
+			submit() {
+				//this.itemt.document.items.purpose="试验目的5656";
+				//this.itemt.document.items.title="标题5656";
+
+				if (this.itemt.document.items.borrower == '' || this.itemt.document.items.borrower == null) {
+					uni.showModal({
+						title: '提示',
+						content: '请填写借用人',
+						showCancel: false,
+						success: res => {
+							if (res.confirm) {
+								//uni.navigateBack();
 							}
-						});
+						}
+					});
+
+					return;
+				}
+				if (this.itemt.document.items.tel == '' || this.itemt.document.items.tel == null) {
+					uni.showModal({
+						title: '提示',
+						content: '请填写手机号',
+						showCancel: false,
+						success: res => {
+							if (res.confirm) {
+								//uni.navigateBack();
+							}
+						}
+					});
+
+					return;
+				}
+
+
+
+
+
+				this.itemt.applicationId = '__gAPYBW4YxB3UePM3lqO';
+				this.itemt.docId = this.iteml.id;
+				this.itemt.id = this.iteml.id;
+				this.itemt.formId = this.iteml.formid;
+				this.itemt.parentId = '';
+				this.itemt.subFlowApprover = [];
+				this.itemt.subSelects = [];
+				this.itemt.submitTo = [];
+				this.itemt.templateForm = '';
+				this.itemt.viewId = '';
+				this.http.request({
+					url: this.http.urls.documents + this.id + '/workflows/submit',
+					data: this.itemt,
+
+					method: 'PUT',
+					success: res => {
+						//this.item=res.data.data;
+						console.log('zx22:' + JSON.stringify(res));
+						if (res.data.errcode == 0) {
+
+							uni.showModal({
+								title: '提示',
+								content: res.data.data,
+								showCancel: false,
+								success: res => {
+									if (res.confirm) {
+										uni.navigateBack();
+									}
+								}
+							});
+
+							this.tool_borrowing_empty();
+						} else {
+							uni.showModal({
+								title: '提示',
+								content: res.data.errmsg,
+								showCancel: false,
+								success: res => {
+									if (res.confirm) {
+										//uni.navigateBack();
+									}
+								}
+							});
+
+						}
+
+
+						this.show = false;
+
+						this.title = res.data.data.name;
+						this.nextNodes = res.data.data.nextNodes;
+
 					}
 				});
-			},
+			}, //刷新数据
 			//提交
 			add() {
 				this.http.request({