zhengkaixin před 1 rokem
rodič
revize
eca4ed89d3

+ 60 - 4
components/ApproveInfo.vue

@@ -1,6 +1,6 @@
 <template>
 	<view>
-		<view  class="head-approve-main" >
+		<view  class="head-approve-main" v-if="formData.applyPersonName" >
 			<view class="head-approve">
 				<view class="head-approve-a">
 					<view class="head-approve-a1">
@@ -39,6 +39,62 @@
 						<u-button @click="stepBtn"  type="warning"  size="medium">{{item.text}}</u-button>
 					</view>
 				</template>
+				<template v-else-if="item.type.indexOf('tableList')>-1">
+				
+					<template v-if="formData[item.key]&&formData[item.key].length">
+						<view v-if="item.type.indexOf('tableList-vertical')>-1">
+							<u-table>
+								<u-tr class="u-tr">
+									<u-th class="u-th"></u-th>
+									<u-th class="u-th" v-for="(num2,index2) in formData[item.key].length"
+										:key="index2+'it'">{{item.text}}{{index2+1}}</u-th>
+								</u-tr>
+								<u-tr class="u-tr" v-for="(it,index) in item.list" :key="index+'it'">
+										
+									<u-td class="u-td" style="flex-direction: unset;">{{it.text}}<span v-if="it.isrequset"
+											style="color:red">*</span></u-td>
+									<u-td class="u-td"  style="flex-direction: unset;" v-for="(num2,index2) in formData[item.key].length" :key="index2+'it'">
+										
+										{{formData[item.key][index2][it.key]}}  <span style="color:#fff">.</span>
+									</u-td>
+										
+								</u-tr>
+										
+							</u-table>
+						</view>
+						<view
+							v-if="item.type.indexOf('tableList-horizontal')>-1&&formData[item.key]&&formData[item.key].length">
+							<u-table>
+								<u-tr class="u-tr">
+										
+									<u-th class="u-th" style="flex-direction: unset;" v-for="(it,index) in item.list"
+										:key="index+'it'">{{it.text}}<span v-if="it.isrequset"
+											style="color:red">*</span></u-th>
+								</u-tr>
+								<u-tr class="u-tr" v-for="(num2,index2) in formData[item.key].length" :key="index2+'it'">
+										
+										
+									<u-td class="u-td"  style="flex-direction: unset;" v-for="(it,index) in item.list" :key="index+'it'">
+										
+										{{formData[item.key][index2][it.key]}}<span style="color:#fff">.</span>
+										
+									</u-td>
+										
+								</u-tr>
+										
+							</u-table>
+						</view>
+					</template>
+					<template v-else>
+						<view style="
+								text-align: center;
+								color: #777777;
+								margin-bottom: 20px;
+							">
+							未填写
+						</view>
+					</template>
+				</template>
 				<template v-else>
 		
 		
@@ -78,9 +134,9 @@
 										</u-radio>
 									</u-radio-group> -->
 									
-									<span  v-for="(item, index) in item.list?item.list:radioListDefault" :key="index" 
-									v-if="formData[item.key]==item.value||((formData[item.key]?1:0)==item.value)" >
-											{{item.name}}
+									<span  v-for="(item2, index) in item.list?item.list:radioListDefault" :key="index" 
+									v-if="formData[item.key]==item2.value||((formData[item.key]?1:0)==item2.value)" >
+											{{item2.name}}
 									</span>
 		
 								</template>

+ 1 - 1
config/.env.dev.js

@@ -4,7 +4,7 @@ const UNI_APP = {
 
 	IMG_URL:"http://www.jsrailway.com.cn/",
 	
-	BASE_URL:'http://192.168.77.162:8086/railroad-server/',
+	//BASE_URL:'http://192.168.77.162:8086/railroad-server/',
 	//BASE_URL:'http://192.168.77.222:8086/railroad-server/',
 		//BASE_URL: 'http://192.168.33.220:8086/',
 	

+ 41 - 42
pages/oawork/waybill/add.vue

@@ -16,7 +16,7 @@
 				</template>
 				<template v-else-if="item.type.indexOf('tableList')>-1&&formData[item.key]&&formData[item.key].length">
 					<view v-if="item.type.indexOf('tableList-vertical')>-1">
-						<u-table>
+						<u-table  align="left">
 							<u-tr class="u-tr">
 								<u-th class="u-th"></u-th>
 								<u-th class="u-th" v-for="(num2,index2) in item.num"
@@ -40,7 +40,7 @@
 					</view>
 					<view
 						v-if="item.type.indexOf('tableList-horizontal')>-1&&formData[item.key]&&formData[item.key].length">
-						<u-table>
+						<u-table align="left">
 							<u-tr class="u-tr">
 
 								<u-th class="u-th" style="flex-direction: unset;" v-for="(it,index) in item.list"
@@ -143,14 +143,14 @@
 				</template>
 
 			</view>
-			<view class="submitBtn">
-				<u-button type="info" :class="{
+			<view class="submitBtn"  v-if="isReady">
+				<u-button type="info"  :class="{
 					submitBtn30:isReady
 				}" @click="submit(0)">保存</u-button>
-				<u-button type="primary" v-if="isReady" class="submitBtn60" @click="submit(1)">提交</u-button>
+				<u-button type="primary" class="submitBtn60" @click="submit(1)">提交</u-button>
 			</view>
 		</view>
-		<!-- 		<approve-view :activityList="activityList" :initStart="false"></approve-view -->>
+		<!-- 		<approve-view :activityList="activityList" :initStart="false"></approve-view -->
 
 
 
@@ -221,16 +221,18 @@
 		},
 		onLoad(op) {
 			this.oatype = 11
-			if (op.id) {
-				this.id = op.id
-			}
+			
 
 			this.fieldInfo = dataJsGetInfo(this.oatype)
 
 			this.fieldList = this.fieldInfo.list;
-
-
-			this.getProcessDetails();
+			this.init()
+
+			if (op.id) {
+				this.id = op.id
+				this.getProcessDetails();
+				
+			}
 
 		},
 		computed: {
@@ -349,13 +351,13 @@
 				}
 				 
 		
-				return 
+				 
 
 				uni.showLoading({
 					title: "加载中",
 					mask: true,
 				})
-				submitObj.draftStatus = draftStatus
+				submitObj.status = draftStatus?0:-1
 
 				API.applyWayBill(submitObj).then((res) => {
 					uni.hideLoading();
@@ -379,21 +381,19 @@
 				})
 			},
 			getProcessDetails() {
-				this.init()
-				return
+				
 				uni.showLoading({
 					title: "加载中",
 					mask: true,
 				})
 
-				API.processDetails({
+				API.waybillDetails({
 					formId: this.oatype,
 					id: this.id
 				}).then((res) => {
 					uni.hideLoading();
-					this.activityList = res.data.activityList
 
-					var applyContent = res.data.applyContent
+					var applyContent = res.data.waybillInfo
 
 					if (applyContent) {
 						this.formData.id = applyContent.id
@@ -404,33 +404,32 @@
 							if (data == null) {
 								continue
 							}
-							if (obj.type.indexOf("upload") > -1) {
-								if (data) {
-
-									var sz = JSON.parse(data).map(str => {
-										var item = JSON.parse(str)
-										return {
-											url: item.url,
-											name: item.name,
-											view: 1
-										}
-									})
-
-									this.fileList =
-										sz //data.split(",").map(item=>{return {url:item,item.name=,view:1}})
-								}
-
+							console.log(obj.key,applyContent[obj.key])
+							this.formData[obj.key] = applyContent[obj.key]
+							
+							if (obj.type.indexOf('tableList') > -1) {
+								//var sz = []
+							
+								for (var k = this.formData[obj.key].length; k < obj.num; k++) {
+									var ob = {}
+									for (var j in obj.list) {
+										var io = obj.list[j]
+										ob[io.key] = ""
+									}
+									this.formData[obj.key].push(ob)
+								}
+								//this.formData[obj.key] = sz
+							}
+							if(applyContent.status!=-1){
+								this.isReady=false
 							}
-							this.formData[obj.key] = applyContent[obj.key]
 
 						}
-
-
+						
+							this.$forceUpdate();
 
 					}
-
-					//console.log("formData",this.formData)
-					////(this.formData.maintenanceDescription,res.data.applyContent.maintenanceDescription)
+					
 				}).catch(error => {
 
 					uni.showToast({
@@ -551,7 +550,7 @@
 
 		background: #fff;
 		padding-top: 10rpx;
-		padding-bottom: 50rpx;
+		padding-bottom: 180rpx;
 		margin-bottom: 40rpx;
 		display: flex;
 		flex-wrap: wrap;

+ 10 - 93
pages/oawork/waybill/info.vue

@@ -1,25 +1,13 @@
 <template>
 	<view>
 		<u-navbar title="详情查看">
-			<view slot="right"  
-				style="margin-right: 20px;  ">
-			
-				<u-button type="error"  v-if="processRevokeShow"
-				  @click="processRevokeBtn()" size="mini">撤回</u-button>
-			</view>
+			
 		</u-navbar>
 	
 		<approve-info  v-if="viewApproveBl"
 		:fieldInfo="fieldInfo" :formData="formData"  :fileList="fileList" ></approve-info>
 		
-		<view class="submitBtn" v-if="0">
-			<u-button type="info" class="submitBtn30">保存</u-button>
-			<u-button type="primary" class="submitBtn60" >提交</u-button>
-		</view>
-		<approve-view  :activityList="activityList"></approve-view>
-
-
-
+	
 	</view>
 </template>
 
@@ -64,9 +52,7 @@
 				fieldInfo: {},
 				fieldList: [],
 				formData: {},
-				activityList: [
-
-				],
+				 
 				action: "",
 				
 				personInfo: {},
@@ -98,81 +84,25 @@
 
 		},
 		methods: {
-			processRevokeApi(){
-				uni.showLoading({
-					title: "加载中",
-					mask: true,
-				})
-				
-				API.processRevoke({
-				
-					procinstId: this.formData.procinstId
-				}).then((res) => {
-					this.viewApproveBl=false
-					this.formData={}
-					this.getProcessDetails(true);
-					uni.showModal({
-						title:"提示",
-						showCancel:false,
-						content:"操作成功!",
-						
-						success() {
-							
-						}
-					})
-					const eventChannel = this.getOpenerEventChannel();
-					eventChannel.emit('refreshData');
-					
-						
-					
-					
-				}).catch(error => {
-					uni.showToast({
-						title: error,
-						icon: "none"
-					})
-				})
-			},
-			processRevokeBtn(){
-				
-				uni.showModal({
-					title: '提示',
-					content: '确认是否撤回本表单?',
-					success: res=> {
-						if (res.confirm) {
-						   
-						   this.processRevokeApi();
-						   
-						} else if (res.cancel) {
-							console.log('用户点击取消');
-						}
-					}
-				});
-			},
-			submit(draftStatus) {
-				
-			},
+			  
 			getProcessDetails(bl) {
 				uni.showLoading({
 					title: "加载中",
 					mask: true,
 				})
 
-				API.processDetails({
+				API.waybillDetails({
 					formId: this.oatype,
 					id: this.id
 				}).then((res) => {
 					uni.hideLoading();
-					this.activityList = res.data.activityList
-					var applyContent = res.data.applyContent
+					
+					
+					var applyContent = res.data.waybillInfo
 					this.init()
 					if(applyContent){
 						var personInfo=this.carhelp.getPersonInfo()
-						if(applyContent.applyPersonId==personInfo.id&&applyContent.status=="0"){
-							this.processRevokeShow=true
-						}else{
-							this.processRevokeShow=false
-						}
+						 
 						this.formData={
 							...applyContent,
 							...this.formData
@@ -185,20 +115,7 @@
 							if(data==null){
 								continue
 							}
-							if (obj.type.indexOf("upload") > -1) {
-								if(data){
-									 
-									var sz=JSON.parse(data).map(str=>{
-										var item=JSON.parse(str)
-										return {
-											url:item.url,name:item.name,view:1
-										}
-									})
-									
-									this.fileList=sz//data.split(",").map(item=>{return {url:item,item.name=,view:1}})
-								}
-								
-							} 
+						
 							this.formData[obj.key] = applyContent[obj.key]
 						
 						}

+ 21 - 9
pages/oawork/waybill/list.vue

@@ -7,7 +7,24 @@
 		
 		<view class="list1">
 			<view class="item" v-for="(item,i) in list" @click="ckInfo(item)" :key="i">
-				 
+				 <view class="group" >
+				 	<view  class="group1" >
+				 		<view class="name">
+				 			{{item.stationStart}}-{{item.stationEnd}}
+				 		</view>
+				 		
+				 	</view>
+				 	<view  class="group2" >
+				 		<view class="title">
+				 			<span :style="{color:recordStatusColor(item.status)}">
+							{{item.status==-1?'草稿':''}}
+							{{item.status=="0"?'已提交':''}}
+							{{item.status==1?'已打印':''}}
+							</span>
+				 			
+				 		</view>
+				 	</view>
+				 </view>
 				<view class="group" v-for="(tinfo,i) in typeKey" :key="i">
 					<view  class="group1" >
 						<view class="name">
@@ -18,12 +35,7 @@
 							
 						</view>
 					</view>
-					<view  class="group2" v-if="i==0">
-						<view class="title">
-							<span :style="{color:recordStatusColor(item.status)}">{{item.statusN}}</span>
-							
-						</view>
-					</view>
+					
 				</view>
 				<view class="group">
 					<view  class="group1">
@@ -129,10 +141,10 @@
 						retu = '#f29a38'
 						break;
 					case '0':
-						retu = '#f29a38'
+							retu = '#52b56b'
 						break;
 					case '1':
-						retu = '#52b56b'
+							retu = '#3a3bc2'
 						break;
 					case '2':
 						retu = '#c94031'

+ 2 - 1
uni_modules/uview-ui/components/u-td/u-td.vue

@@ -38,6 +38,7 @@
 				let style = {};
 				if (this.width != "auto") style.flex = `0 0 ${this.width}`;
 				style.textAlign = this.parent.align;
+				
 				style.fontSize = this.parent.fontSize + 'rpx';
 				style.padding = this.parent.padding;
 				style.borderBottom = `solid 1px ${this.parent.borderColor}`;
@@ -56,7 +57,7 @@
 		@include vue-flex;
 		flex-direction: column;
 		flex: 1;
-		justify-content: center;
+		//justify-content: center;
 		font-size: 28rpx;
 		color: $u-content-color;
 		align-self: stretch;

+ 2 - 1
uni_modules/uview-ui/components/u-th/u-th.vue

@@ -36,6 +36,7 @@
 				let style = {};
 				if (this.width) style.flex = `0 0 ${this.width}`;
 				style.textAlign = this.parent.align;
+				
 				style.padding = this.parent.padding;
 				style.borderBottom = `solid 1px ${this.parent.borderColor}`;
 				style.borderRight = `solid 1px ${this.parent.borderColor}`;
@@ -53,7 +54,7 @@
 		@include vue-flex;
 		flex-direction: column;
 		flex: 1;
-		justify-content: center;
+		//justify-content: center;
 		font-size: 28rpx;
 		color: $u-main-color;
 		font-weight: bold;