zhongtianhaoyuan пре 2 година
родитељ
комит
57a6d1cacb
3 измењених фајлова са 120 додато и 12 уклоњено
  1. 2 2
      config/index.js
  2. 112 7
      pages/task/audit/universalityAudit.vue
  3. 6 3
      pages/universalityAudit/addaduit.vue

+ 2 - 2
config/index.js

@@ -3,14 +3,14 @@ const dev = {
 	// baseUrl: 'http://localhost:8080/',
 	// 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.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
 }

+ 112 - 7
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>
@@ -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="" 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">
@@ -146,6 +151,12 @@
 					<u-input class="" v-model='auditMind' placeholder="请在此输入审核意见" type="textarea" height="414"
 						maxlength="1000" />
 				</view>
+				<view class="upload_css">
+					上传附件
+					<upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="2"
+						: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>
@@ -159,7 +170,11 @@
 </template>
 
 <script>
+	import upload from '@/components/upload.vue';
 	export default {
+		components: {
+			upload
+		},
 		data() {
 			return {
 				id:'',
@@ -168,7 +183,10 @@
 				auditMind:'',
 				title:'',
 				imglist:[],
-				auditList:[]
+				auditList:[],
+				action: this.$uploadUrl,
+				maxSize: 50 * 1024 * 1024, //限制文件大小 50M,
+				fileUrl:[]
 			}
 		},
 		onLoad(options){
@@ -182,6 +200,63 @@
 			
 		},
 		methods: {
+			openDownload(item){
+				uni.downloadFile({
+					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({
+							filePath: filePath,
+							showMenu: true,
+							success: function(res) {
+								console.log('打开文档成功');
+							}
+						});
+					}
+				});
+			},
+			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 = '审核意见(通过)'
@@ -235,10 +310,14 @@
 					title: "审核中"
 				})
 				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) {
@@ -353,8 +432,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'
@@ -532,6 +617,23 @@
 						}
 					}
 				}
+				.audit_img {
+					flex-wrap: wrap;
+					margin: 0 20rpx;
+				
+					.url_css {
+						border: 1px solid #999999;
+						border-radius: 10px;
+						margin-top: 10px;
+						margin-right: 10px;
+				
+						.url_img {
+							width: 80px;
+							height: 80px;
+							border-radius: 10px;
+						}
+					}
+				}
 			}
 		}
 	
@@ -589,7 +691,7 @@
 		border: 1px solid #EEEEEE;
 		padding: 10rpx 20rpx;
 		position: relative;
-		height:240px;
+		height:165px;
 		/deep/.uni-textarea-textarea{
 			width: 80%;
 		}
@@ -676,7 +778,7 @@
 			margin: auto;
 			background: #fff;
 			width: calc(100% - 198rpx);
-			height: 700rpx;
+			height: 820rpx;
 			border-radius: 20rpx;
 	
 			.alert-top {
@@ -697,6 +799,9 @@
 				position: absolute;
 				right: 33rpx;
 			}
+			.upload_css {
+				margin-left: 20rpx;
+			}
 		}
 	}
 	

+ 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);
 							}
 						});
+						}
 					}
 				});
 			},