Эх сурвалжийг харах

核查信息包含图片上传和数据回显处理和显示联调

maxiaoxiao 4 сар өмнө
parent
commit
c54bc6ae07

+ 22 - 14
pages/index/common/hcDetails.vue

@@ -71,8 +71,8 @@
 			</view>
 			<view class="hclist" v-show="active==2">
 				<view class="example-body">
-					<uni-file-picker ref="upsgfjsRef" limit="9" title="最多选择9张图片" v-model="fileList.sgfjs"
-						@select="e=>selectfile(e,'sgfjs')" @delete="e=>fileDelete(e,'sgfjs')"></uni-file-picker>
+					<uni-file-picker ref="upsgfjsRef" limit="9" title="最多选择9张图片" v-model="fileList.sdfjs"
+						@select="e=>selectfile(e,'sdfjs')" @delete="e=>fileDelete(e,'sdfjs')"></uni-file-picker>
 				</view>
 
 			</view>
@@ -187,15 +187,15 @@
 					if (res.data) {
 						this.checkform = res.data[0]
 						this.checkform.fjs.map(f =>
-							_this.fileList.fjs.push({
+							this.fileList.fjs.push({
 								name: 'fjsimg',
-								url: f.url
+								url: f.fjPreview
 							})
 						)
-						this.checkform.sgfjs.map(f =>
-							_this.fileList.sgfjs.push({
+						this.checkform.sdfjs.map(f =>
+							this.fileList.sdfjs.push({
 								name: 'sgfjsimg',
-								url: f.url
+								url: f.fjPreview
 							})
 						)
 					}
@@ -210,7 +210,7 @@
 				}).then((res) => {
 					res.data.map(di => {
 						this.decList.push({
-							value: di.dictCode,
+							value: di.dictValue,
 							text: di.dictLabel
 						})
 					})
@@ -221,7 +221,7 @@
 				}).then((res) => {
 					res.rows.map(di => {
 						this.hgxList.push({
-							value: di.dictCode,
+							value: di.dictValue,
 							text: di.dictLabel
 						})
 					})
@@ -275,6 +275,7 @@
 				let a = this.decList.find(d => d.value == this.checkform.dlbm)
 				if (a) this.checkform.dlmc = a.text;
 
+				console.log(this.checkform, 'fjs')
 				this.$refs.checkRef.validate().then(res => {
 					hcWork(this.checkform).then(response => {
 						this.$modal.msgSuccess("保存成功")
@@ -288,14 +289,21 @@
 			},
 			selectfile(e, fname) {
 				let _this = this
-				e.tempFilePaths.map(item => {
+				//e.tempFilePaths
+				e.tempFiles.map(item => {
 					_this.fileList[fname].push({
 						name: fname + 'img',
-						url: item
+						url: item.path
 					})
-					uploadFile(item, (data) => {
-						if (data) _this.checkform[fname].push(data);
-						else _this.fileList[fname].pop()
+					uploadFile(item.path, (data) => {
+						if (data) {
+							_this.checkform[fname].push({
+								fjPath: data.path,
+								fjSize: Number((item.size / 1024 / 1024).toFixed(2)),
+								fjType: item.fileType
+							});
+
+						} else _this.fileList[fname].pop()
 					})
 
 				})