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];