gjy hace 2 años
padre
commit
597c7551cd

+ 4 - 2
config/index.js

@@ -4,13 +4,15 @@ const dev = {
 	// baseUrlNew: 'http://192.168.110.67:9100/',
 	// baseUrlNew: 'http://192.168.1.118:8090/',
 	// baseUrlNew: 'http://192.168.110.9:9888/',
-	baseUrlNew: 'http://192.168.110.138:8090/',
+	// baseUrlNew: 'http://192.168.110.138:8090/',
+	// baseUrlNew: 'http://192.168.110.9:9888/',
+	// baseUrlNew: 'http://192.168.110.138:8090/',
 	// baseUrlNew: 'http://192.168.110.82:8090/',
 	// baseUrlNew: 'http://192.168.110.82:8090/',
 	// baseUrlNew: 'http://192.168.110.202:8090/',
 	// baseUrlNew: 'http://192.168.110.138:8090/',
 	// 上传图片的
-	baseUrlNew: 'https://api2.eliangeyun.com/',
+	// baseUrlNew: 'https://api2.eliangeyun.com/',
 	h5Appid: 'wxb66b599f7f61b46f',
 	debug: false
 }

+ 131 - 22
pages/task/audit/universalityAudit.vue

@@ -53,7 +53,7 @@
 								<view class="char_css">{{item.appendixName}}</view>
 								<view class="img_size">{{item.appendixSize}}</view>
 							</view>
-							<view style="color: #22C572;" class="img_dowload" @click="openDocument(item)">
+							<view style="color: #22C572;" class="img_dowload" @click="openDownload(item)">
 								下载
 							</view>
 						</view>
@@ -64,7 +64,7 @@
 				</view>
 				</u-form-item>
 			</u-form>
-			<u-form style='padding-bottom: 180rpx;' ref="uForm">
+			<u-form style='padding-bottom: 80rpx;' ref="uForm">
 				<view class="form_top">审批流</view>
 				<view class="content2">
 					<view v-for="(item,index) in auditList" :key='index' class="audit">
@@ -109,6 +109,11 @@
 								<view v-if='item.auditMind' class="right-content">
 									{{item.auditMind}}
 								</view>
+								<view class="flex audit_img">
+									<view v-for="(items,indexs) in item.fileUrl" class="url_css">
+										<image :src="items" mode="aspectFill" class="url_img" @click="auditFile(items)"></image>
+									</view>
+								</view>
 							</view>
 							<view v-if='item.commonStaffs1' class="right">
 								<u-icon @click='showcontent(item)' :name="item.showflow?'arrow-up':'arrow-down'" size="28">
@@ -143,11 +148,21 @@
 					<view class="right-bottom">
 						{{auditMind.length}}/1000个字
 					</view>
-					<u-input class="" v-model='auditMind' placeholder="请在此输入审核意见" type="textarea" height="414"
-						maxlength="1000" />
+					<!-- <u-input class="" v-model='auditMind' placeholder="请在此输入审核意见" type="textarea" height="414"
+						maxlength="1000" /> -->
+						<textarea maxlength="1000" v-model='auditMind' placeholder="请在此输入审核意见" name="" id="" cols="30" rows="11"></textarea>
+				</view>
+				<view class="upload_css">
+					上传附件
+					<upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="99"
+						:size-type="['compressed']" @on-success="getImgUrl" @on-error="onError" @on-remove="onRemove"
+						@on-uploaded="isAdd = true" :before-upload="filterFileType" @on-progress="onProgress"></upload>
 				</view>
-				<view @click='close()' class="cancel">取消</view>
-				<view @click='passSubmit()' class="confirm">确定</view>
+				<view class="audit_btn">
+					<view @click='close()' class="cancel">取消</view>
+					<view @click='passSubmit()' class="confirm">确定</view>
+				</view>
+				
 			</view>
 		</view>
 		<view style='padding:10px;' class='flex bottom-btn'>
@@ -159,7 +174,11 @@
 </template>
 
 <script>
+	import upload from '@/components/upload.vue';
 	export default {
+		components: {
+			upload
+		},
 		data() {
 			return {
 				id:'',
@@ -168,7 +187,10 @@
 				auditMind:'',
 				title:'',
 				imglist:[],
-				auditList:[]
+				auditList:[],
+				action: this.$uploadUrl,
+				maxSize: 50 * 1024 * 1024, //限制文件大小 50M,
+				fileUrl:[]
 			}
 		},
 		onLoad(options){
@@ -182,9 +204,36 @@
 			
 		},
 		methods: {
-			openDocument(src) {
+			openDownload(item){
 				uni.downloadFile({
-					url: src.appendixPath,
+					url: item.appendixPath,
+					success: function(res) {
+						var filePath = res.tempFilePath;
+						uni.openDocument({
+							filePath: filePath,
+							showMenu: true,
+							success: function(res) {
+								console.log('打开文档成功');
+							}
+						});
+					}
+				});	
+			},
+			filterFileType(index, lists) {
+				if (lists[index].fileType != 'jpg' && lists[index].fileType != 'png' && lists[index].fileType != 'gif') {
+					lists.splice(index, 1);
+					// 当前文件不支持
+					uni.showModal({
+						title: '暂不支持当前图片类型',
+						showCancel: false
+					});
+				} else {
+					this.isAdd = false;
+				}
+			},
+			auditFile(src) {
+				uni.downloadFile({
+					url: src,
 					success: function(res) {
 						var filePath = res.tempFilePath;
 						uni.openDocument({
@@ -197,6 +246,20 @@
 					}
 				});
 			},
+			getImgUrl(res) {
+				this.fileUrl.push(res)
+			},
+			onError(error) {
+				alert(error)
+				console.log('------------error-----------')
+				console.log(error)
+			},
+			onProgress(e) {
+				console.log(e)
+			},
+			onRemove(index) {
+				this.fileUrl.splice(index, 1)
+			},
 			pass() {
 				this.show = true
 				this.title = '审核意见(通过)'
@@ -247,13 +310,18 @@
 			//审核方法
 			audit(list, index, status, status2, reason) {
 				uni.showLoading({
-					title: "审核中"
+					title: "审核中",
+					mask: true
 				})
 				let that = this
+				var info = that.auditMind
+				if (that.fileUrl.length > 0) {
+					info = that.auditMind + "##" + that.fileUrl.toString()
+				}
 					this.$api.doRequest('post', '/newWorkflow/api/handle', {
 						taskId: list.taskId,
 						approved: status,
-						auditMind: this.auditMind ,
+						auditMind: info?info:"",
 						needReapply: status2 != undefined ? true : false,
 					}).then(res => {
 						if (status == true) {
@@ -368,8 +436,14 @@
 										.getTime()
 										response.data.data[i].updateDate = this.$u.timeFormat(
 											time, 'mm.dd hh:MM')
-										response.data.data[i].auditMind = response.data.data[i]
-											.workflowHistoricTasks[len].auditMind
+										// response.data.data[i].auditMind = response.data.data[i]
+										// 	.workflowHistoricTasks[len].auditMind
+											if (response.data.data[i].workflowHistoricTasks[len].auditMind && response.data.data[i].workflowHistoricTasks[len].auditMind.indexOf("##") !=-1) {
+												response.data.data[i].auditMind = response.data.data[i].workflowHistoricTasks[len].auditMind.split("##")[0]
+												response.data.data[i].fileUrl = response.data.data[i].workflowHistoricTasks[len].auditMind.split("##")[1].split(",")
+											}else{
+												response.data.data[i].auditMind = response.data.data[i].workflowHistoricTasks[len].auditMind
+											}
 									} else {
 										this.$set(response.data.data[i], 'status', 'question')
 										// response.data.data[i].status='question'
@@ -462,7 +536,7 @@
 	
 			.left {
 				display: flex;
-				align-items: center;
+	// 			align-items: center;
 	
 				.item1 {
 					position: relative;
@@ -479,11 +553,15 @@
 					}
 	
 					.status {
-						position: absolute;
+						text-align: center;
+						position: relative;
+						width: 18px;
+						height: 18px;
 						border-radius: 50%;
 						padding: 0px 2px;
-						right: -3px;
-						bottom: -3px;
+						margin: auto;
+						margin-right: -5px;
+						top: -16px;
 						background: #fff;
 					}
 	
@@ -547,6 +625,26 @@
 						}
 					}
 				}
+				.audit_img {
+					flex-wrap: wrap;
+					// margin: 0 10rpx;
+					margin-left: 20rpx;
+				
+					.url_css {
+						border: 1px solid #999999;
+						border-radius: 10px;
+						margin-top: 10px;
+						margin-right: 4px;
+						overflow: hidden;
+						width: 73px;
+						height: 73px;
+						.url_img {
+							width: 73px;
+							height: 73px;
+							// border-radius: 10px;
+						}
+					}
+				}
 			}
 		}
 	
@@ -604,7 +702,7 @@
 		border: 1px solid #EEEEEE;
 		padding: 10rpx 20rpx;
 		position: relative;
-		height:240px;
+		height:165px;
 		/deep/.uni-textarea-textarea{
 			width: 80%;
 		}
@@ -681,6 +779,7 @@
 		width: 100%;
 		background: rgba(0, 0, 0, 0.4);
 		z-index: 3;
+		overflow-y: scroll;
 	
 		.wrap {
 			position: absolute;
@@ -691,7 +790,9 @@
 			margin: auto;
 			background: #fff;
 			width: calc(100% - 198rpx);
-			height: 700rpx;
+			height: 840rpx;
+			overflow-y: scroll;
+			// overflow: hidden;
 			border-radius: 20rpx;
 	
 			.alert-top {
@@ -712,19 +813,27 @@
 				position: absolute;
 				right: 33rpx;
 			}
+			.upload_css {
+				margin-left: 20rpx;
+			}
 		}
 	}
+	.audit_btn{
+		display: flex;
+		top: 0px;
+	}
 	
 	.cancel,
 	.confirm {
-		position: absolute;
-		display: inline-block;
+		// position: absolute;
+		// display: inline-block;
 		width: 50%;
 		text-align: center;
-		bottom: 0;
+		// bottom: 0;
 		padding: 10px;
 		border-top: 1px solid #eee;
 		font-size: 34rpx;
+		margin: auto;
 	}
 	
 	.cancel {

+ 6 - 3
pages/universalityAudit/addaduit.vue

@@ -2,7 +2,7 @@
 	<view>
 		<view>
 			<u-form :model="dataobj" ref="uForm">
-				<u-form-item class='typeform'  :border-bottom='false' label="类型"><view style='color:#000;width:100%;text-align:right;' @click='typeselect'>{{dataobj.businessType?dataobj.businessType:'请选择类型 >'}}</view></u-form-item>
+				<u-form-item class='typeform'  :border-bottom='false' label="类型"><view style='color:#000;width:100%;text-align:right;' @click='typeselect'>{{dataobj.businessType?dataobj.businessType+" >":'请选择类型 >'}}</view></u-form-item>
 			</u-form>
 			<u-form :model="dataobj"  ref="uForm">
 				<u-form-item :border-bottom='false' :label-position='"top"' label="备注">
@@ -95,13 +95,15 @@
 						for (let item of chooseImageRes.tempFiles) {
 							files.push({
 								name: 'fileName',
-								uri : item.path
+								url : item.path
 							});
 						}
+							for (let i = 0; i < files.length; i++) {
 						uni.uploadFile({
 							url: baseUrlNew + 'appendix/api/uploadFiles',
 							// url: baseUrlNew+'appendix/api/uploadFiles', //仅为示例,非真实的接口地址
-							files: files,
+							filePath: files[i].url,
+							name: files[i].name,
 							formData: {
 								// fileName: chooseImageRes.tempFiles[0],
 								companyId: pcUserInfo.compId,
@@ -126,6 +128,7 @@
 								console.log(res);
 							}
 						});
+						}
 					}
 				});
 			},

+ 1 - 1
pages/universalityAudit/list.vue

@@ -19,7 +19,7 @@
 				<view>{{item.createDate}}</view>
 			</view>
 		</view>
-		<view v-if='show' style='text-align:center;background:#F2F6FA;'>暂无更多数据</view>
+		<view v-if='show' style='text-align:center;background:#F2F6FA;margin-top: 20rpx;'>暂无更多数据</view>
 	</view>
 </template>
 

+ 62 - 6
pages/universalityAudit/look.vue

@@ -91,6 +91,11 @@
 								<view v-if='item.auditMind' class="right-content">
 									{{item.auditMind}}
 								</view>
+								<view class="flex audit_img">
+									<view v-for="(items,indexs) in item.fileUrl" class="url_css">
+										<image :src="items" mode="aspectFill" class="url_img" @click="auditFile(items)"></image>
+									</view>
+								</view>
 							</view>
 							<view v-if='item.commonStaffs1' class="right">
 								<u-icon @click='showcontent(item)' :name="item.showflow?'arrow-up':'arrow-down'" size="28">
@@ -137,6 +142,21 @@
 			
 		},
 		methods: {
+			auditFile(src) {
+				uni.downloadFile({
+					url: src,
+					success: function(res) {
+						var filePath = res.tempFilePath;
+						uni.openDocument({
+							filePath: filePath,
+							showMenu: true,
+							success: function(res) {
+								console.log('打开文档成功');
+							}
+						});
+					}
+				});
+			},
 			getList(){
 				var that =this
 				this.$api.doRequest('get', '/generalAuditInfo/getGeneralAuditInfo', {
@@ -232,8 +252,14 @@
 										.getTime()
 										response.data.data[i].updateDate = this.$u.timeFormat(
 											time, 'mm.dd hh:MM')
-										response.data.data[i].auditMind = response.data.data[i]
-											.workflowHistoricTasks[len].auditMind
+										// response.data.data[i].auditMind = response.data.data[i]
+										// 	.workflowHistoricTasks[len].auditMind
+										if (response.data.data[i].workflowHistoricTasks[len].auditMind && response.data.data[i].workflowHistoricTasks[len].auditMind.indexOf("##") !=-1) {
+											response.data.data[i].auditMind = response.data.data[i].workflowHistoricTasks[len].auditMind.split("##")[0]
+											response.data.data[i].fileUrl = response.data.data[i].workflowHistoricTasks[len].auditMind.split("##")[1].split(",")
+										}else{
+											response.data.data[i].auditMind = response.data.data[i].workflowHistoricTasks[len].auditMind
+										}
 									} else {
 										this.$set(response.data.data[i], 'status', 'question')
 										// response.data.data[i].status='question'
@@ -304,7 +330,7 @@
 	
 			.left {
 				display: flex;
-				align-items: center;
+				// align-items: center;
 	
 				.item1 {
 					position: relative;
@@ -321,11 +347,21 @@
 					}
 	
 					.status {
-						position: absolute;
+						// position: absolute;
+						// border-radius: 50%;
+						// padding: 0px 2px;
+						// right: -3px;
+						// bottom: -3px;
+						// background: #fff;
+						text-align: center;
+						position: relative;
+						width: 18px;
+						height: 18px;
 						border-radius: 50%;
 						padding: 0px 2px;
-						right: -3px;
-						bottom: -3px;
+						margin: auto;
+						margin-right: -5px;
+						top: -16px;
 						background: #fff;
 					}
 	
@@ -426,6 +462,26 @@
 		.audit {
 			margin-top: 20rpx;
 		}
+		.audit_img {
+			flex-wrap: wrap;
+			// margin: 0 10rpx;
+			margin-left: 20rpx;
+		
+			.url_css {
+				border: 1px solid #999999;
+				border-radius: 10px;
+				margin-top: 10px;
+				margin-right: 4px;
+				overflow: hidden;
+				width: 73px;
+				height: 73px;
+				.url_img {
+					width: 73px;
+					height: 73px;
+					// border-radius: 10px;
+				}
+			}
+		}
 	}
 .u-form {
 		margin: 20rpx;