Quellcode durchsuchen

项目部, 审批流调整

zhengkaixin vor 2 Jahren
Ursprung
Commit
12918f0c3b

+ 9 - 0
pages/projectDepartment/exportApplication/deliveryDetails.vue

@@ -47,6 +47,15 @@
 					{{info.endTime}}
 				</view>
 			</view>
+			
+			<view class="item">
+				<view class="name">
+					所属项目部
+				</view>
+				<view class="value">
+					{{info.departmentName}}
+				</view>
+			</view>
 			<view class="item">
 				<view class="name">
 					申请时间

+ 143 - 52
pages/projectDepartment/exportApplication/deliveryFrom.vue

@@ -6,6 +6,8 @@
 	
 		<!-- 出库单详情 -->
 		<view class="details">
+			<p  class="itemp">项目信息</p>
+			
 			<view class="item">
 				<view class="name">
 					所属项目<span style="color: red;">*</span>
@@ -34,33 +36,28 @@
 					<u-input v-model="endTime" @click="show=true,showText='endTime'"  @clear="showText='endTime',change('')"   placeholder="请输入使用周期" 	 type="select" />
 				</view>
 			</view>
-			<view class="item" v-if="false">
+			<view class="item" >
 				<view class="name">
 					所属项目部<span style="color: red;">*</span>
 				</view>
 				<view class="value">
 					
-					<u-input v-model="project" @click="show2=true,showText='project'"  @clear="showText='project',change('')"   placeholder="请选择所属项目部" 	 type="select" />
-				</view>
-			</view>
-			<view class="item" v-if="false">
-				<view class="name">
-					第一步审批<span style="color: red;">*</span>
-				</view>
-				<view class="value">
-					
-					<u-input v-model="approve1" @click="show2=true,showText='approve1'"  @clear="showText='approve1',change('')"   placeholder="请选择第一步审批人" 	 type="select" />
+					<u-input v-model="xmbId" @click="show3=true,showText='xmbId'"  @clear="showText='xmbId',change('')"   placeholder="请选择所属项目部" 	 type="select" />
 				</view>
 			</view>
-			<view class="item" v-if="false">
+			<p  class="itemp">选择审批人</p>
+			<view class="item" v-for="(item,i) in approveProcessList"  :key="i" >
 				<view class="name">
-					第二步审批<span style="color: red;">*</span>
+					{{item.name}}<span style="color: red;">*</span>
 				</view>
 				<view class="value">
 					
-					<u-input v-model="approve2" @click="show2=true,showText='approve2'"  @clear="showText='approve2',change('')"   placeholder="请选择第二步审批人" 	 type="select" />
+					<u-input v-model="item.approveName" @click="show2=true,showIndex=i" 
+					 @clear="showIndex=i,change2('')" 
+					   :placeholder="'请选择'+item.name+'审批人'" 	 type="select" />
 				</view>
 			</view>
+		
 
 		</view>
 		
@@ -182,7 +179,9 @@
 	 </view>
 	 <ujp-calendar v-model="show" mode="date"  max-date="2099-01-01"  @change="change"></ujp-calendar>
 	 
-	 <u-select v-model="show2" :list="list2"   @confirm="confirm" ></u-select>
+	 <u-select v-model="show3" :list="projectList"   @confirm="confirm" ></u-select>
+	 
+	 <u-select v-model="show2" :list="list2"   @confirm="confirm2" ></u-select>
 	 <!-- -sync -sync -->
 	 <u-popup  v-model="showpopup"  mode="bottom" 
 	 border-radius="14"
@@ -236,11 +235,13 @@
 					needTime:"",
 					endTime:"",
 					projectName:"",
+					xmbId:"",
 				},
 				
 				show:false,
-				project:"",
+				xmbId:"",
 				showText:"",
+				showIndex:0,
 				showpopup:false,
 				endTime:'',
 				needTime:'',
@@ -249,36 +250,17 @@
 				queryContent:'',
 				list:[],
 				show2:false,//审批人 步骤1
+				show3:false,//审批人 步骤1
 				//list2:[],
 				approveList1:[
-					{
-											value: '1',
-											label: '江1'
-										},
-										{
-											value: '2',
-											label: '湖1'
-										}
+					
 				],
 				approveList2:[
-					{
-											value: '1',
-											label: '江2'
-										},
-										{
-											value: '2',
-											label: '湖2'
-										}
+					
 				],
+				approveProcessList:[],
 				projectList:[
-					{
-											value: '1',
-											label: '江3'
-										},
-										{
-											value: '2',
-											label: '湖3'
-										}
+					
 				],
 			}
 		},
@@ -288,19 +270,71 @@
 		computed:{
 			 list2(){
 				 var list=[];
-				 if(this.showText=='approve1'){
-					list=this.approveList1
+				 if(this.approveProcessList.length){
+					 list=this.approveProcessList[this.showIndex].approveUserList.map(item=>{
+					 	return {
+					 		value: item.id,
+					 		label: item.name
+					 	}
+					 })
 				 }
-				if(this.showText=='approve2'){
-					list=this.approveList2
-				}
-				if(this.showText=='project'){
-					list=this.projectList
-				}
+				
 				 return list
 			 }
 		},
+		onReady() {
+			this.createOutRecord();
+		},
 		methods:{
+			createOutRecord(){
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				API.createOutRecord({
+					
+				}).then((res) => {
+					uni.hideLoading();
+					if(res.data.departmentList){
+						this.projectList=res.data.departmentList.map(item=>{
+							return {
+								value: item.id,
+								label: item.name
+							}
+						})
+						if(this.projectList.length==1){
+							this.form.xmbId=this.projectList[0].value;
+							this.xmbId=this.projectList[0].label
+						}
+					}
+					if(res.data.approveProcessList.length){
+						this.approveProcessList=res.data.approveProcessList;
+						for(var i in this.approveProcessList){
+							var obj=this.approveProcessList[i];
+							if(obj.approveUserList.length==1){
+								var e=obj.approveUserList
+								obj.approveId=e[0].id;
+								obj.approveName=e[0].name;
+								// this.approveProcessList[i]=obj
+								// console.log("ok",obj)
+							}
+							
+						}
+						
+					}else{
+						uni.showToast({
+							title: "审批流未配置,请联系管理员",
+							icon: "none"
+						})
+					}
+					
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
 			confirm(e) {
 				if(e==''){
 					this.form[this.showText]='';
@@ -310,7 +344,16 @@
 					this[this.showText]=e[0].label
 				}
 			},
-			
+			confirm2(e) {
+				if(e==''){
+					
+				}else{
+					var obj=this.approveProcessList[this.showIndex];
+					obj.approveId=e[0].value;
+					obj.approveName=e[0].label;
+				
+				}
+			},
 			showpopupBtn(){
 				
 				
@@ -333,7 +376,50 @@
 					this[this.showText]=e.year+"年"+e.month+"月"+e.day+"日"
 				}
 			},
+			change2(e){
+				if(e==''){
+					this.form[this.showText]='';
+					this[this.showText]=''
+				}else{
+					this.form[this.showText]=e.result;
+					this[this.showText]=e.year+"年"+e.month+"月"+e.day+"日"
+				}
+			},
 			submit(){
+				var sprData=[]
+				if(this.approveProcessList.length){
+					var bl=false;
+					var k =0
+					for(var i in this.approveProcessList){
+						k++;
+						var obj=this.approveProcessList[i]
+						if(obj.approveId){
+							sprData.push({
+								no:k,
+								userId:obj.approveId
+							})
+						}else{
+							bl=true;
+							uni.showToast({
+								title: '请选择'+obj.name+'审批人',
+								icon: "none"
+							})
+							break
+						}
+						
+					}
+					if(bl){
+						return
+					}
+				}else{
+					uni.showToast({
+						title: "审批流未配置,请联系管理员",
+						icon: "none"
+					})
+					return
+				}
+				
+				
 				if(!this.form.projectName){
 					uni.showToast({
 						title: "请填写所属项目"
@@ -360,8 +446,8 @@
 					delete obj.obj
 					return obj
 				})
-				this.form.deviceData=list
-				
+				this.form.deviceData=list;
+				this.form.sprData=sprData;
 				uni.showLoading({
 					title: "加载中",
 					mask: true,
@@ -562,7 +648,12 @@
 		background-color: #fff;
 		margin-top: 24rpx;
 		padding: 0 32rpx;
-
+		.itemp{
+			    margin: 3px 0px;
+			  
+			    font-size: 16px;
+			    font-weight: bold;
+		}
 		.item {
 			display: flex;
 			justify-content: space-between;

+ 8 - 0
pages/projectDepartment/exportProcess/deliveryDetails.vue

@@ -45,6 +45,14 @@
 					{{info.endTime}}
 				</view>
 			</view>
+			<view class="item">
+				<view class="name">
+					所属项目部
+				</view>
+				<view class="value">
+					{{info.departmentName}}
+				</view>
+			</view>
 			<view class="item">
 				<view class="name">
 					申请时间