diff --git a/src/api/sunVillage_info/homestead/application.js b/src/api/sunVillage_info/homestead/application.js index 398cfe85..bc38282e 100644 --- a/src/api/sunVillage_info/homestead/application.js +++ b/src/api/sunVillage_info/homestead/application.js @@ -104,7 +104,15 @@ export function attach(data){ data:data }) } - +//批量上传图片 +export function attachs(data){ + return request({ + url:'/common/attachs', + method:'post', + header: { "Content-Type": 'application/x-www-form-urlencoded' }, + data:data + }) +} //删除列表项 export function removeList(id){ return request({ diff --git a/src/components/house/MultiImageUploadComp.vue b/src/components/house/MultiImageUploadComp.vue index b5b2e121..efa0921c 100644 --- a/src/components/house/MultiImageUploadComp.vue +++ b/src/components/house/MultiImageUploadComp.vue @@ -80,7 +80,6 @@ export default { } file.fileList = this.uploadImg.fileList; this.$emit('fileChanged', this.uploadImg.fileList); - this.$emit('fileUpdate', file); this.updateValue(); console.log('新增', this.uploadImg.fileList); }).catch((e) => { @@ -185,7 +184,7 @@ export default { this.internalValue = arr; else this.internalValue = arr.join(','); - console.log('更新值: ', this.internalValue); + this.$emit('fileUpdate', this.internalValue); this.$emit('input', this.internalValue); }, } diff --git a/src/views/homesteadSurvey/add.vue b/src/views/homesteadSurvey/add.vue index a11c088f..86bbaee4 100644 --- a/src/views/homesteadSurvey/add.vue +++ b/src/views/homesteadSurvey/add.vue @@ -56,15 +56,14 @@ placeholder="行政区划名称" :rules="[{ required: true, message: '' }]" />--> - - - + +
宗地图
+ + + +
@@ -769,25 +767,18 @@ diff --git a/src/views/homesteadSurvey/index.vue b/src/views/homesteadSurvey/index.vue index 907cf191..ff160ab5 100644 --- a/src/views/homesteadSurvey/index.vue +++ b/src/views/homesteadSurvey/index.vue @@ -223,24 +223,29 @@ userList().then(response => { this.taskExecutortions = response.data }) - console.info(this.checked); if(this.checked){ - let userId = this.$store.getters.userId; setTimeout(() => { + let userId = this.$store.state.user.userId; + console.info(userId); this.nickName = this.$store.state.user.nickName; + this.$set(this.queryParams, "rwzxr", userId); + this.getList(); },1000) - this.$set(this.queryParams, "rwzxr", userId); - this.getList(); + }else{ this.$set(this.queryParams, "rwzxr", null); this.getList(); } getTownInfo(100).then(response => { this.xzList = response.data + let qbxz = {deptId:100,deptName:"全部乡镇"} + this.xzList.unshift(qbxz); }) + axios.get('../static/dictyType.json').then(res => { this.dictTypeList = res.data }) + }, mounted(){ @@ -371,7 +376,7 @@ }, checkChange(e){ if(e){ - let userId = this.$store.getters.userId; + let userId = this.$store.state.user.userId; this.$set(this.queryParams, "rwzxr", userId); this.getList(); }else{ @@ -398,7 +403,7 @@ this.$router.push({name:'homesteadList'}) this.$cookies.set("item",JSON.stringify(item)); }*/ - let userId = this.$store.getters.userId; + let userId = this.$store.state.user.userId; let businessLevel = this.$store.getters.businessLevel; if(businessLevel === "2" || item.rwzxrIds.includes(userId)){ localStorage.setItem("surveyItem",JSON.stringify(item)); @@ -420,9 +425,14 @@ xzChange(val){ this.deptName = val.deptName; this.showDropList = false; - this.$set(this.queryParams, "parentId", val.deptId); + if(val.deptId != 100){ + this.$set(this.queryParams, "parentId", val.deptId); + this.$set(this.switchParams, "parentId", val.deptId); + }else{ + this.$set(this.queryParams, "parentId", null); + this.$set(this.switchParams, "parentId", null); + } this.getList(); - this.$set(this.switchParams, "parentId", val.deptId); this.queryNum(); }, checkBadge(){ @@ -431,7 +441,7 @@ }, queryNum(){ if(this.checked){ - let userId = this.$store.getters.userId; + let userId = this.$store.state.user.userId; this.$set(this.switchParams, "rwzxr", userId); listTask(this.switchParams).then(response => { this.done = 0; diff --git a/src/views/homesteadSurvey/list.vue b/src/views/homesteadSurvey/list.vue index 7d2379b7..3463933d 100644 --- a/src/views/homesteadSurvey/list.vue +++ b/src/views/homesteadSurvey/list.vue @@ -5,14 +5,10 @@ - @@ -22,11 +18,11 @@

图片上传

- +
- 清空 - 上传 + 清空 + 上传
@@ -95,6 +91,7 @@

调查

+

附件

删除

@@ -120,12 +117,13 @@ import {addNhhncy, delNhhncy, exportNhhncy, getNhhncy, listNhhncy, updateNhhncy} from "@/api/homesteadSurvey/nhhncy"; import {listShyqr,setSyqrInfo} from "@/api/homesteadSurvey/shyqr"; import {listSuyqr,updateSuyqr,addSuyqr} from "@/api/homesteadSurvey/suyqr"; - import {listZrz,getZrzZjdDmList,getZrz} from "@/api/homesteadSurvey/zrz"; - import {listFsss,getFsssZjdDmList,getFsss} from "@/api/homesteadSurvey/fsss"; + import {getZrz} from "@/api/homesteadSurvey/zrz"; + import {getFsss} from "@/api/homesteadSurvey/fsss"; import {getGeoServerConfigKey} from "@/api/system/config"; - import { listTown, getTown } from "@/api/homesteadSurvey/town"; - import { listVillage} from "@/api/homesteadSurvey/village"; import {deptGetId,} from "@/api/homestead/index"; + import {attachmentFind} from "@/api/sunVillage_info/homestead/application"; + import {base64Attach} from "@/api/user"; + import {systemAttachment} from "@/api/onlineHome/bankAgriculture/paymentApproval"; import $ from "jquery"; import {Dialog} from "vant"; import {ref} from "vue"; @@ -313,6 +311,7 @@ isFinished:false, // showImageList:false, + zjdId:null, uploadImgList:[], uploadImgList1:[], // 字典列表json @@ -434,12 +433,28 @@ this.totalR = res.data.shyqrs; }); }, - showUploadList(){ + showUploadList(id){ + this.getAttachments(id); this.showImageList = true; + this.zjdId = id; }, - submitUploadList(){ - submitUploadImageList(this.uploadImgList1).then(res => { - let _this = this + submitUploadList(val){ + let f = [] + for (let i of this.uploadImgList){ + if(i.content !== undefined){ + f.push(i.content) + } + } + console.info(this.uploadImgList); + let _this = this; + let file = { + tableId:val, + tableName:"t_homestead_zjdzdxx", + bizPath:"upload", + fileType:"0", + files: f + }; + base64Attach(file).then((resp) => { this.$toast({ icon: 'success', // 找到自己需要的图标 message: '上传成功', @@ -448,11 +463,11 @@ _this.showImageList = false } }) - }) + }); }, // 图片上传前 beforeReadImageList(file){ - let _this = this + let _this = this; if(file.length!=undefined){ file.map(res => { let zjddm = res.file.name @@ -485,13 +500,7 @@ } let data2 = new FormData(); data2.append("file", new Blob([new Uint8Array(d)],{type:'image/jpeg'})); - uploadFile(data2).then(response => { - let p={ - "zjddm":zjddm, - "url":response.fileName - } - _this.uploadImgList1.push(p) - }) + uploadFile(data2); } }) }else{ @@ -525,24 +534,15 @@ } let data2 = new FormData(); data2.append("file", new Blob([new Uint8Array(d)],{type:'image/jpeg'})); - uploadFile(data2).then(response => { - let p={ - "zjddm":zjddm, - "url":response.fileName - } - _this.uploadImgList1.push(p) - }) + uploadFile(data2); } } }, deleteFileImageList(file){ - let url = file.file.name - this.uploadImgList1.map((res,index) => { - if(res.zjddm==url){ - this.uploadImgList1.remove(index); - } - }) + if(file.id !== undefined ){ + systemAttachment(file.id); + } }, validatorIdcardqlr(val){ if(this.qlrform.dbrzjlx=='01'){ @@ -1549,6 +1549,19 @@ } }) }, + getAttachments(id) { + this.uploadImgList = []; + let cond = { + tableId: id, + tableName: 't_homestead_zjdzdxx', + fileType: 0, + }; + attachmentFind(cond).then(resp => { + this.uploadImgList = resp.data.map(function(item){ + return {id:item.id,url:'/api'+item.fileUrl,isImage: true} + }); + }); + }, getZjdList(){ this.countyhc = 0; if(this.active === 0){ @@ -5041,7 +5054,15 @@ // } //数据库循环加载时使用 --------------------加载较慢 ------start }, - + qkClick(){ + this.uploadImgList1 = this.uploadImgList; + for(let i = 0; i < this.uploadImgList1.length; i++){ + if(this.uploadImgList[i].id !== undefined ){ + systemAttachment(this.uploadImgList[i].id); + } + } + this.uploadImgList = []; + }, /*右侧列表 --展开收缩*/ selectionPushMap() { this.selectionIconShow = true; diff --git a/src/views/homesteadSurvey/list2.vue b/src/views/homesteadSurvey/list2.vue index 723272aa..d841f650 100644 --- a/src/views/homesteadSurvey/list2.vue +++ b/src/views/homesteadSurvey/list2.vue @@ -28,7 +28,7 @@
-
入户
+
入户核查
农户信息
所有权人
切换地图
diff --git a/src/views/homesteadSurvey/list4.vue b/src/views/homesteadSurvey/list4.vue index b49d3eef..027c03b7 100644 --- a/src/views/homesteadSurvey/list4.vue +++ b/src/views/homesteadSurvey/list4.vue @@ -583,6 +583,7 @@ 审批通过 +