移动端
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 

321 行
13 KiB

  1. <template>
  2. <div class="app-container">
  3. <van-sticky style="position:relative;">
  4. <div class="bannerBg">
  5. <van-nav-bar
  6. style="background:transparent;border-bottom-width:0;height:2rem;margin-bottom:.5rem;"
  7. @click-left="goBack()"
  8. >
  9. <template #left>
  10. <van-icon name="arrow-left" size="18" color="#fff" />
  11. </template>
  12. <!-- <template #right>
  13. <van-icon name="map-marked" size="18" color="#fff" />
  14. </template>-->
  15. <template #title>
  16. <p style="color:#fff">入户调查</p>
  17. </template>
  18. </van-nav-bar>
  19. </div>
  20. <div style="width:95%;left:2.5%;position:absolute;background:#fff;border-radius:15px;box-shadow: 0px 3px 5px 0px rgba(0,0,0,0.16);padding: .3rem;top:1.2rem">
  21. <van-row>
  22. <van-col span="4" :offset="1" style="text-align:center;" @click="$router.push({path:'/homesteadSurvey/add'})">
  23. <van-icon :name="require('../../assets/images/housesteadSurvey/zjd'+(active==1?'A':'D')+'.png')" size="1rem" style="margin-top:0px;"/>
  24. <p :style="{color:(active==1?'rgb(34, 183, 242)':'#000')}">宅基地</p>
  25. </van-col>
  26. <van-col span="2">
  27. <div style="border-top: 2px dashed #b5b4b4;margin-top: 20px;"></div>
  28. </van-col>
  29. <van-col span="4" style="text-align:center;" @click="$router.push({path:'/homesteadSurvey/add2'})" >
  30. <van-icon :name="require('../../assets/images/housesteadSurvey/nhxx'+(active==2?'A':'D')+'.png')" size="1rem" style="margin-top:0px;"/>
  31. <p :style="{color:(active==2?'rgb(34, 183, 242)':'#000')}">农户</p>
  32. </van-col>
  33. <van-col span="2">
  34. <div style="border-top: 2px dashed #b5b4b4;margin-top: 20px;"></div>
  35. </van-col>
  36. <van-col span="4" style="text-align:center;" @click="$router.push({path:'/homesteadSurvey/add3'})" >
  37. <van-icon :name="require('../../assets/images/housesteadSurvey/fwxx'+(active==3?'A':'D')+'.png')" size="1rem" style="margin-top:0px;"/>
  38. <p :style="{color:(active==3?'rgb(34, 183, 242)':'#000')}">房屋</p>
  39. </van-col>
  40. <van-col span="2">
  41. <div style="border-top: 2px dashed #b5b4b4;margin-top: 20px;"></div>
  42. </van-col>
  43. <van-col span="4" style="text-align:center;" @click="$router.push({path:'/homesteadSurvey/add4'})">
  44. <van-icon :name="require('../../assets/images/housesteadSurvey/fsss'+(active==4?'A':'D')+'.png')" size="1rem" style="margin-top:0px;"/>
  45. <p :style="{color:(active==4?'rgb(34, 183, 242)':'#000')}">附属物</p>
  46. </van-col>
  47. </van-row>
  48. </div>
  49. </van-sticky>
  50. <div style="margin:30px auto 0;width: 95%;">
  51. <p class="title" style="position:relative;padding-left:10px;line-height:20px;font-size: 16px;margin-bottom: 5px;">附属设施</p>
  52. </div>
  53. <van-swipe-cell v-for="(item,index) in fssslist" :key="'fsss'+index" style="border-radius: 16px;box-shadow: 0px 3px 5px 0px rgba(0,0,0,0.16); width:95%;margin:15px auto 0;background:#fff;">
  54. <div style="padding:15px;">
  55. <p style="display: flex;align-items: center;">
  56. <img src="../../assets/images/housesteadSurvey/add03.png" alt="" style="margin-right: 5px;">
  57. <span style="line-height: 1;font-size: 16px;">{{item.fssslx}}</span>
  58. </p>
  59. <div style="display:flex;line-height:20px;margin-top: 15px;font-size: 14px;color: #999999;">
  60. <p style="flex:1;text-align:left;">建筑面积(㎡):</p>
  61. <p style="flex:1;text-align:right;">{{item.jzmj}}</p>
  62. </div>
  63. <div style="display:flex;line-height:20px;margin-top: 5px;font-size: 14px;color: #999999;">
  64. <p style="flex:1;text-align:left;">建筑物情况:</p>
  65. <p style="flex:1;text-align:right;">{{item.jzwqk}}</p>
  66. </div>
  67. <div style="text-align:center;overflow:auto;display: flex;justify-content: center;margin-top: 10px;">
  68. <p style="width:49%;display: flex;align-items: center;justify-content:center;border: 1px solid transparent;background: #22B7F2;padding: 3px 0;border-radius: 50px;" @click="showPopupzrz(item)">
  69. <img src="../../assets/images/housesteadSurvey/add01.png" alt="">
  70. <span style="font-size: 14px;color: #fff;margin-left: 5px;" >查看附属设施信息</span>
  71. </p>
  72. </div>
  73. </div>
  74. <template #right>
  75. <van-button square text="删除" type="danger" class="delete-button" @click="deletefsss(item.id,index)"/>
  76. </template>
  77. </van-swipe-cell>
  78. <div style=" width:95%;margin:20px auto;display: flex;justify-content: center;">
  79. <div style="width:100%;text-align:center;overflow:auto;border-radius: 16px;box-shadow: 0px 3px 5px 0px rgba(0,0,0,0.16);padding: 15px 0px;background: #ffffff;color: #22B7F2;">
  80. <p style="font-size: 16px;" @click="showPopupAddzrz()">+ 添加附属设施信息</p>
  81. </div>
  82. </div>
  83. <div style="width:95%;margin:20px auto;text-align:center;overflow:auto;display: flex;justify-content: space-around;">
  84. <p style="width:32%;border: 1px solid transparent;background: #FA5353;padding: 5px 0;border-radius: 50px;">
  85. <span style="font-size: 14px;color: #fff;margin-left: 5px;" @click="ycbj()">异常标记</span>
  86. </p>
  87. <p style="width:32%;border: 1px solid transparent;background: #22B7F2;padding: 5px 0;border-radius: 50px;">
  88. <span style="font-size: 14px;color: #fff;margin-left: 5px;" @click="qmqr()">签名确认</span>
  89. </p>
  90. <p style="width:32%;border: 1px solid #22B7F2;background: #ffffff;padding: 5px 0;border-radius: 50px;">
  91. <span style="font-size: 14px;color: #22B7F2;margin-left: 5px;" @click="dcsh()">调查审核</span>
  92. </p>
  93. </div>
  94. <van-popup v-model="dcshShow" position="bottom">
  95. <van-picker
  96. show-toolbar
  97. :columns="examineData"
  98. value-key="dictLabel"
  99. @confirm="onSurveyStatusChanged"
  100. @cancel="dcshShow = false"
  101. />
  102. </van-popup>
  103. <van-popup v-model="showesign" position="bottom" closeable
  104. close-icon="close">
  105. <van-row style="margin:0 10%">
  106. <p class="title" style="margin:20px 0;position:relative;padding-left:20px;font-size:0.5rem">电子签名</p>
  107. </van-row>
  108. <van-row style="margin: 0 5% 5% 5%;border:1px solid #BFBFBF;">
  109. <vue-esign
  110. ref="esign"
  111. class="mySign"
  112. :height="200"
  113. :isCrop="signature.isCrop"
  114. :lineWidth="signature.lineWidth"
  115. :lineColor="signature.lineColor"
  116. :bgColor.sync="signature.bgColor"
  117. v-if="!signature.resultImg"
  118. />
  119. <img :src="signature.resultImg" alt="" width="100%" height="100%;" v-if="signature.resultImg"/>
  120. </van-row>
  121. <van-row type="flex" justify="center" v-if="!signature.resultImg" style="margin-bottom:20px;"> <!--v-if="!formEnabled.acceptingForm.townFormEnabled"-->
  122. <van-col span="6" style="text-align:center;"><van-button type="primary" round size="small" @click="handleReset">清空画板</van-button></van-col>
  123. <van-col span="6" style="text-align:center;"><van-button type="primary" round size="small" @click="handleGenerate">保存提交</van-button></van-col>
  124. </van-row>
  125. </van-popup>
  126. </div>
  127. </template>
  128. <script>
  129. import {listShyqr,addShyqr,updateShyqr,delShyqr,setSyqrInfo} from "@/api/homesteadSurvey/shyqr";
  130. import {listZjdzd,getZjdzd,updateZjdzd,zjddcSign,addZjdzd,uploadFile,getQueryLand,submitOnly} from "@/api/homesteadSurvey/zjdzd";
  131. import MapGisDrawing from "@/components/Map/MapGisDrawing";
  132. import {listZrz,addZrz,updateZrz,getZrzZjdDmList,delZrz,updateZrzStatus} from "@/api/homesteadSurvey/zrz";
  133. import {listNmfw,addNmfw,updateNmfw,delNmfw} from "@/api/homesteadSurvey/nmfw";
  134. import {listSuyqr,addSuyqr,updateSuyqr} from "@/api/homesteadSurvey/suyqr";
  135. import {listNhhncy,addNhhncy,updateNhhncy,delNhhncy} from "@/api/homesteadSurvey/nhhncy";
  136. import {addNh, delNh, exportNh, getNh, listNh, updateNh,setNhInfo} from "@/api/homesteadSurvey/nh";
  137. import {listFsss,addFsss,updateFsss,delFsss,getFsssZjdDmList,updateFsssStatus} from "@/api/homesteadSurvey/fsss";
  138. import { listTown, getTown } from "@/api/homesteadSurvey/town";
  139. import { listVillage} from "@/api/homesteadSurvey/village";
  140. import { sysConfig} from "@/api/homesteadSurvey/index";
  141. import { Notify, Dialog, Toast } from 'vant';
  142. import axios from "axios";
  143. export default {
  144. name: "homesteadAdd",
  145. components: { MapGisDrawing},
  146. data() {
  147. return {
  148. active:4,
  149. dcshShow:false,
  150. showesign:false,
  151. examineData:[{dictLabel:"审批通过",dictValue:"5"},{dictLabel:"审批驳回",dictValue:"4"}],
  152. zjdzdxx:{surveyStatus:"5"},
  153. fssslist:[],
  154. //电子签名
  155. signature: {
  156. lineWidth: 6, // 画笔的线条粗细
  157. lineColor: "#000000", // 画笔的颜色
  158. bgColor: "", // 画布的背景颜色
  159. resultImg: "", // 最终画布生成的base64图片
  160. isCrop: false, // 是否裁剪,在画布设定尺寸基础上裁掉四周空白部分
  161. },
  162. };
  163. },
  164. created(){
  165. this.zjdzdxx = JSON.parse(localStorage.getItem("zjdzdxxItem"));
  166. if(this.zjdzdxx.surveySign != null){
  167. this.signature.resultImg = "http://localhost/api/"+this.zjdzdxx.surveySign;
  168. }
  169. this.getList();
  170. },
  171. mounted(){
  172. },
  173. methods: {
  174. getList(){
  175. listFsss({zjddm:this.zjdzdxx.zjddm}).then(response => {
  176. this.fssslist = response.rows;
  177. });
  178. },
  179. onSurveyStatusChanged(val){
  180. this.$set(this.zjdzdxx, 'surveyStatus', val.dictValue);
  181. updateZjdzd(this.zjdzdxx).then(response => {
  182. let _this =this
  183. _this.$toast({
  184. icon: 'success', // 找到自己需要的图标
  185. message: '保存成功',
  186. duration:"1000",
  187. onClose:function(){
  188. _this.dcshShow = false;
  189. _this.$router.push({path:'/homesteadSurvey/add4',query: {zjddm: _this.zjdzdxx.zjddm}});
  190. }
  191. })
  192. });
  193. },
  194. // 清空画板
  195. handleReset() {
  196. this.resultImg = null
  197. if(this.$refs.esign){
  198. this.$refs.esign.reset();
  199. }
  200. },
  201. // 生成签字图
  202. handleGenerate() {
  203. console.info( this.$refs.esign
  204. .generate() );
  205. this.$refs.esign
  206. .generate() // 使用生成器调用把签字的图片转换成为base64图片格式
  207. .then((res) => {
  208. this.signature.resultImg = res;
  209. let wj = this.dataURLtoBlob(res);
  210. let param = new FormData() // 创建form对象
  211. param.append('file', wj) // 通过append向form对象添加数据
  212. param.append('date', this.format(new Date(), 'yyyy-MM-dd')) // 通过append向form对象添加数据
  213. zjddcSign(param, this.zjdzdxx.zjddm).then(response => {
  214. this.$notify({type: 'success', message: '签字成功'});
  215. this.showesign = false;
  216. // location.reload();
  217. getZjdzd(this.zjdzdxx.id).then((response) => {
  218. localStorage.setItem("zjdzdxxItem",JSON.stringify(response.data))
  219. });
  220. this.getList();
  221. });
  222. })
  223. .catch((err) => {
  224. // 画布没有签字时会执行这里提示一下
  225. this.$toast.fail('请签名后再保存签字');
  226. });
  227. },
  228. dataURLtoBlob (dataurl, filename = 'file') {
  229. let arr = dataurl.split(',')
  230. let mime = arr[0].match(/:(.*?);/)[1]
  231. let suffix = mime.split('/')[1]
  232. let bstr = atob(arr[1])
  233. let n = bstr.length
  234. let u8arr = new Uint8Array(n)
  235. while (n--) {
  236. u8arr[n] = bstr.charCodeAt(n)
  237. }
  238. return new File([u8arr], `${filename}.${suffix}`, {
  239. type: mime
  240. })
  241. },
  242. goBack(){
  243. if(this.ztMap && this.enterMap ==1){
  244. if(this.form.id == null){
  245. this.backMap.backMapZjdAData.theGeom= "";
  246. }else{
  247. this.backMap.backMapZjdAData = this.form;
  248. }
  249. this.$cookies.set("search",this.backMap);
  250. } else {
  251. this.$cookies.set("search","");
  252. }
  253. this.$router.push({name: this.$router.back(-1)});
  254. // }
  255. },
  256. showPopupzrz(item){ this.$router.push({name:'fsssAdd',query:item});},
  257. showPopupAddzrz(){
  258. this.$router.push({name:'fsssAdd',query:{zjddm:this.zjdzdxx.zjddm}});
  259. },
  260. shownmfwlist(){},
  261. deletezrz(){},
  262. qmqr(){
  263. this.showesign = true;
  264. },
  265. ycbj(){
  266. this.$set(this.zjdzdxx, 'surveyStatus', "2");
  267. updateZjdzd(this.zjdzdxx).then(response => {
  268. let _this =this
  269. this.$toast({
  270. icon: 'success', // 找到自己需要的图标
  271. message: '保存成功',
  272. duration:"1000",
  273. onClose:function(){
  274. _this.$router.push({path:'/homesteadSurvey/add4',query: {zjddm: _this.zjdzdxx.zjddm}});
  275. }
  276. })
  277. });
  278. },
  279. dcsh(){
  280. this.dcshShow = true;
  281. },
  282. }
  283. }
  284. </script>
  285. <style scoped>
  286. >>> .bannerBg{
  287. width: 100%;
  288. color:#fff;
  289. padding:10px;
  290. background: linear-gradient(134deg,#7ac943 1%, #22b7f2);
  291. }
  292. >>> .van-hairline--bottom::after {
  293. border-bottom-width: 0;
  294. }
  295. >>> .title:before
  296. {
  297. content:"";
  298. width: 6px;
  299. height: 20PX;
  300. background: #7ac943;
  301. border-radius: 3px;
  302. position:absolute;
  303. left:0;
  304. bottom:0;
  305. }
  306. >>> .delete-button {
  307. height: 100%;
  308. }
  309. >>> .van-swipe-cell__wrapper{
  310. margin-right:-3px;
  311. }
  312. >>> .label-class .van-collapse-item__title--expanded{
  313. font-weight: bold;
  314. }
  315. </style>