From a6439036a91893625e5e178a321435da24cf3b0e Mon Sep 17 00:00:00 2001 From: ndbs Date: Thu, 27 Oct 2022 15:03:37 +0800 Subject: [PATCH] =?UTF-8?q?app2.0=E6=96=B0=E7=94=9F=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LearunApp-2.2.0/pages/welcome/list.vue | 63 ++++++++++++------- 1 file changed, 39 insertions(+), 24 deletions(-) diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/welcome/list.vue b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/welcome/list.vue index ee82d7bed..4033b5864 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/welcome/list.vue +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/welcome/list.vue @@ -16,18 +16,13 @@ - - 采集照片信息 - - - - - - - - - + 自然信息 @@ -68,7 +63,9 @@ - 保存 + 附件 + + 保存 @@ -76,9 +73,16 @@ import moment from 'moment'; import get from 'lodash/get'; import set from 'lodash/set'; +import uploadFile from '@/components/upload-file.vue' export default { + components:{ + uploadFile, + }, data() { return { + photo:[], + fileList:[], + uploadVisiable:false, imgSrc: '', scheme: { PartyFaceNo: { @@ -120,9 +124,7 @@ export default { StuInfoFreshFamilyEntities:[], StuInfoFreshEmergePeopleEntities: [] }, - StuInfoFreshEntity:{ - - } + StuInfoFreshEntity:{} }; }, methods: { @@ -137,30 +139,36 @@ export default { value: t.partyfaceno })); }), - () => {} ]); _this.LOADING('加载数据…'); _this.HTTP_GET('StuInfoFresh/stuInfoFreshEntity', _this.userInfo.account, '加载数据时出错').then(res => { this.HIDE_LOADING(); - // console.log(res); - _this.StuInfoFreshEntity = _this.COPY(res.StuInfoFreshEntity); + _this.StuInfoFreshEntity = _this.COPY(res.StuInfoFreshEntity)||{}; _this.queryData.StuInfoFreshFamilyEntities = _this.COPY(res.StuInfoFreshFamilyList); _this.queryData.StuInfoFreshEmergePeopleEntities = _this.COPY(res.StuInfoFreshEmergePeopleList); _this.queryData.ID = res.StuInfoFreshEntity.ID; + _this.queryData.Photo = res.StuInfoFreshEntity.Photo; + _this.photo = res.StuInfoFreshEntity.Photo?[{url:res.StuInfoFreshEntity.Url,id:res.StuInfoFreshEntity.Photo}]:[]; + _this.fileList = res.StuInfoFreshEntity.FilesList||[] + _this.refreshComponent() _this.queryData.telephone = res.StuInfoFreshEntity.telephone; _this.queryData.FamilyAddress = res.StuInfoFreshEntity.FamilyAddress; _this.queryData.RegionNo = res.StuInfoFreshEntity.RegionNo; - _this.imgSrc = this.API.slice(0,-1) + res.Url; + // _this.imgSrc = this.API.slice(0,-1) + res.Url; }); }, - tapBtn() { - console.log(this.queryData) + async submit() { this.LOADING('正在提交数据…'); - this.HTTP_GET('StuInfoFresh/saveStuInfoFresh', this.queryData, '加载数据时出错').then(res => { + let res = await this.$refs["upload"].uploadImage() + if(res&&res.length){ + this.queryData.Photo = res[0]["id"]; + }else{ + this.queryData.Photo = "" + } + this.HTTP_GET('StuInfoFresh/saveStuInfoFresh', this.queryData).then(res => { this.HIDE_LOADING(); - // console.log(res); if (res) { this.TOAST('保存成功'); } @@ -174,7 +182,14 @@ export default { del(str, num) { this.queryData[str].splice(num, 1) }, - + + refreshComponent(){ + // this.uploadVisiable = false + this.$nextTick(()=>{ + this.uploadVisiable = true + }) + }, + // 显示列表中的标题项 displayListItem(item, field) { const fieldItem = this.scheme[field];