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

373 行
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;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 #title>
  13. <p style="color:#fff">入户调查</p>
  14. </template>
  15. </van-nav-bar>
  16. </div>
  17. <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">
  18. <van-row>
  19. <van-col span="4" :offset="1" style="text-align:center;" @click="$router.push({path:'/homesteadSurvey/add'})">
  20. <van-icon :name="require('../../assets/images/housesteadSurvey/zjd'+(active==1?'A':'D')+'.png')" size="1rem" style="margin-top:0px;"/>
  21. <p :style="{color:(active==1?'rgb(34, 183, 242)':'#000')}">宅基地</p>
  22. </van-col>
  23. <van-col span="2">
  24. <div style="border-top: 2px dashed #b5b4b4;margin-top: 20px;"></div>
  25. </van-col>
  26. <van-col span="4" style="text-align:center;" @click="$router.push({path:'/homesteadSurvey/add2'})" >
  27. <van-icon :name="require('../../assets/images/housesteadSurvey/nhxx'+(active==2?'A':'D')+'.png')" size="1rem" style="margin-top:0px;"/>
  28. <p :style="{color:(active==2?'rgb(34, 183, 242)':'#000')}">农户</p>
  29. </van-col>
  30. <van-col span="2">
  31. <div style="border-top: 2px dashed #b5b4b4;margin-top: 20px;"></div>
  32. </van-col>
  33. <van-col span="4" style="text-align:center;" @click="$router.push({path:'/homesteadSurvey/add3'})" >
  34. <van-icon :name="require('../../assets/images/housesteadSurvey/fwxx'+(active==3?'A':'D')+'.png')" size="1rem" style="margin-top:0px;"/>
  35. <p :style="{color:(active==3?'rgb(34, 183, 242)':'#000')}">房屋</p>
  36. </van-col>
  37. <van-col span="2">
  38. <div style="border-top: 2px dashed #b5b4b4;margin-top: 20px;"></div>
  39. </van-col>
  40. <van-col span="4" style="text-align:center;" @click="$router.push({path:'/homesteadSurvey/add4'})">
  41. <van-icon :name="require('../../assets/images/housesteadSurvey/fsss'+(active==4?'A':'D')+'.png')" size="1rem" style="margin-top:0px;"/>
  42. <p :style="{color:(active==4?'rgb(34, 183, 242)':'#000')}">附属物</p>
  43. </van-col>
  44. </van-row>
  45. </div>
  46. </van-sticky>
  47. <van-form ref = "form">
  48. <div style="margin:1.6rem auto;background: #ffffff;width: 95%;box-shadow: 0px 3px 5px 0px rgba(0,0,0,0.16);border-radius:15px;padding-top: 20px;">
  49. <p class="title" style="position:relative;padding-left:10px;line-height:20px;font-size: 16px;margin-left: 3%;margin-bottom: 5px;">附属设施信息</p>
  50. <!--<van-field
  51. v-model="form.deptId"
  52. name="行政区划名称"
  53. label="行政区划名称"
  54. placeholder="行政区划名称"
  55. :rules="[{ required: true, message: '' }]"
  56. />-->
  57. <van-field
  58. input-align="right"
  59. v-model="form.zjddm"
  60. name="宅基地代码"
  61. label="宅基地代码"
  62. maxlength="50"
  63. autocomplete="off"
  64. :rules="[{ required: true }]"
  65. required
  66. />
  67. <field-select
  68. v-model="form.fssslx"
  69. label="附属设施类型"
  70. value-key="dictLabel"
  71. data-key="dictValue"
  72. placeholder="请选择附属设施类型"
  73. remote-url="/open/zdzh/list/fsss_type"
  74. :on-remote-response="'data'"
  75. :rules="[{ required: true }]"
  76. required
  77. />
  78. <van-field
  79. v-model="form.jzmj"
  80. label="建筑面积(m²)"
  81. placeholder="请输入建筑面积"
  82. input-align="right"
  83. label-width="auto"
  84. :rules="[{ required: true }]"
  85. required
  86. type="number"/>
  87. <FieldRadio
  88. v-model="form.sfzsy"
  89. label="是否正在使用"
  90. value-key="dictLabel"
  91. data-key="dictValue"
  92. remote-url="/open/zdzh/list/house_yes_no"
  93. :on-remote-response="'data'"
  94. />
  95. <field-select
  96. v-model="form.jzwqk"
  97. label="建筑物情况"
  98. value-key="dictLabel"
  99. data-key="dictValue"
  100. placeholder="请选择建筑物情况"
  101. remote-url="/open/zdzh/list/jzwqk"
  102. :on-remote-response="'data'"
  103. />
  104. <field-select
  105. v-model="form.jsqtdzk"
  106. label="建设前土地状况"
  107. value-key="dictLabel"
  108. data-key="dictValue"
  109. placeholder="请选择建设前土地状况"
  110. remote-url="/open/zdzh/list/land_state"
  111. :on-remote-response="'data'"
  112. />
  113. <van-field
  114. input-align="right"
  115. v-model="form.remark"
  116. name="备注"
  117. label="备注"
  118. placeholder="备注"
  119. maxlength="50"
  120. autocomplete="off"
  121. />
  122. <common-map ref="pointDarwMap" style="height:200px;"
  123. :allowDraw="true"
  124. @drawReseted="onMapDrawReseted"
  125. @drawFinished="onMapDrawFinished"
  126. >
  127. </common-map>
  128. </div>
  129. <div style="margin: 16px;display: flex;justify-content: space-around;">
  130. <van-button v-if="permission == 'true'" round color="#22B7F2" style="width:45%" @click="submitzjd">保存</van-button>
  131. <van-button plain color="#22B7F2" style="width:45%" round type="info" @click="cancel">取消</van-button>
  132. </div>
  133. <div style="height: 50px;"></div>
  134. </van-form>
  135. </div>
  136. </template>
  137. <script>
  138. import {listShyqr,addShyqr,updateShyqr,delShyqr,setSyqrInfo} from "@/api/homesteadSurvey/shyqr";
  139. import {listZjdzd,getZjdzd,updateZjdzd,addZjdzd,uploadFile,getQueryLand,submitOnly} from "@/api/homesteadSurvey/zjdzd";
  140. import FieldSelect from "@/components/form/FieldSelect";
  141. import FieldRadio from "@/components/form/FieldRadio";
  142. import CommonMap from "@/components/house/CommonMap";
  143. import {addNh, delNh, exportNh, getNh, listNh, updateNh,setNhInfo} from "@/api/homesteadSurvey/nh";
  144. import {listZrz,addZrz,updateZrz,getZrzZjdDmList,delZrz,updateZrzStatus} from "@/api/homesteadSurvey/zrz";
  145. import {listNmfw,addNmfw,updateNmfw,delNmfw} from "@/api/homesteadSurvey/nmfw";
  146. import {listSuyqr,addSuyqr,updateSuyqr} from "@/api/homesteadSurvey/suyqr";
  147. import {listNhhncy,addNhhncy,updateNhhncy,delNhhncy} from "@/api/homesteadSurvey/nhhncy";
  148. import {listFsss,addFsss,updateFsss,delFsss,getFsssZjdDmList,updateFsssStatus} from "@/api/homesteadSurvey/fsss";
  149. import { listTown, getTown } from "@/api/homesteadSurvey/town";
  150. import { listVillage} from "@/api/homesteadSurvey/village";
  151. import { sysConfig} from "@/api/homesteadSurvey/index";
  152. import { Notify, Dialog, Toast } from 'vant';
  153. import axios from "axios";
  154. export default {
  155. components: {FieldSelect, FieldRadio,CommonMap},
  156. name: "zrzAdd",
  157. data() {
  158. return {
  159. active:4,
  160. // 使用权人列表
  161. syqrlist:[
  162. {
  163. shyqrdbxm :'测试测试',
  164. shyqrdbzjhm :'12324648564',
  165. nhdm :'777888999',
  166. }
  167. ],
  168. // 地图绘制
  169. drawInsert: null,
  170. permission:false,
  171. // 当前位置信息
  172. tGeoOrganizationLat: null,
  173. tGeoOrganizationLng: null,
  174. minDate: new Date(),
  175. maxDate: new Date(2025, 10, 1),
  176. showZgqrzrq:false,
  177. form:{}
  178. };
  179. },
  180. created(){
  181. let data = this.$route.query;
  182. this.form = data;
  183. this.permission = localStorage.getItem("executePermission");
  184. this.zjdzdxx = JSON.parse(localStorage.getItem("zjdzdxxItem"));
  185. if(this.form.id == null){
  186. this.$set(this.form, 'fssslx', "11");
  187. this.$set(this.form, 'sfzsy', "1");
  188. this.$set(this.form, 'jzwqk', "1");
  189. this.$set(this.form, 'jsqtdzk', "1");
  190. }
  191. this.$nextTick(() => {
  192. this.pointDarw(null);
  193. // this.pointDarwNature(null);
  194. this.$refs.pointDarwMap && this.$refs.pointDarwMap.update();
  195. })
  196. },
  197. mounted(){
  198. },
  199. methods: {
  200. getList(){
  201. listNh({hzzjhm:this.form.shyqrdbzjhm}).then(response => {
  202. this.form = response.rows[0];
  203. });
  204. },
  205. submitzjd(){
  206. this.$refs.form.validate().then(() => {
  207. if(this.form.id == null){
  208. addFsss(this.form).then(response => {
  209. let _this =this
  210. this.$toast({
  211. icon: 'success', // 找到自己需要的图标
  212. message: '保存成功',
  213. duration:"1000",
  214. onClose:function(){
  215. _this.$router.push({path:'/homesteadSurvey/add4',query: {zjddm: _this.form.zjddm}});
  216. }
  217. })
  218. });
  219. }else{
  220. updateFsss(this.form).then(response => {
  221. let _this =this
  222. this.$toast({
  223. icon: 'success', // 找到自己需要的图标
  224. message: '保存成功',
  225. duration:"1000",
  226. onClose:function(){
  227. _this.$router.push({path:'/homesteadSurvey/add4',query: {zjddm: _this.form.zjddm}});
  228. }
  229. })
  230. });
  231. }
  232. }).catch((e) => {
  233. Dialog({ type: 'danger', message: '请填写完整的表单项' });
  234. });
  235. },
  236. // 绘制申请地图
  237. pointDarw(data) {
  238. this.$nextTick(() => {
  239. let map = this.$refs.pointDarwMap;
  240. if(data === null)
  241. data = this.form.theGeomJson;
  242. this.setMapData(map, data);
  243. });
  244. },
  245. // 通用设置地图数据函数
  246. setMapData(map, data) {
  247. //console.log(map, data ? true : false);
  248. if(!map) return;
  249. if(data)
  250. {
  251. map.setLayer('pointDarwLayer', data);
  252. console.info(this.zjdzdxx.surveyStatus);
  253. map.addLayerNew('pointDarwLayer3', this.zjdzdxx.theGeomJson,"zjdzdxx",this.zjdzdxx.surveyStatus);
  254. }
  255. else {
  256. map.addLayerNew('pointDarwLayer3', this.zjdzdxx.theGeomJson,"zjdzdxx",this.zjdzdxx.surveyStatus);
  257. }
  258. },
  259. // 当地图绘制完成时
  260. onMapDrawFinished(data) {
  261. console.info(data);
  262. this.drawInsert = data;
  263. this.form.theGeomJson = JSON.stringify(this.drawInsert);
  264. },
  265. // 当申请地图被重置时
  266. onMapDrawReseted() {
  267. this.drawInsert = null;
  268. if(this.form.theGeomJson)
  269. {
  270. let lastData = JSON.parse(this.form.theGeomJson);
  271. if(lastData.hasOwnProperty('coordinates')) // 从后台获取的
  272. this.drawInsert = lastData.coordinates;
  273. }
  274. },
  275. cancel(){
  276. this.$router.push({path:'/homesteadSurvey/add4',query: {zjddm: this.form.zjddm}});
  277. },
  278. // 获取登录人位置坐标
  279. getLandCoord(func) {
  280. if (func
  281. && this.tGeoOrganizationLng !== null && this.tGeoOrganizationLng !== ''
  282. && this.tGeoOrganizationLat !== null && this.tGeoOrganizationLat !== '') {
  283. this.$nextTick(() => {
  284. func(this.tGeoOrganizationLng, this.tGeoOrganizationLat);
  285. })
  286. }
  287. else {
  288. console.info(this.deptId);
  289. getQueryLand(this.deptId).then((response) => {
  290. if (response.code == 200) {
  291. let InsertCode = response.data;
  292. this.form.orgCode = InsertCode.orgCode;
  293. this.tGeoOrganizationLat = InsertCode.lat;
  294. this.tGeoOrganizationLng = InsertCode.lng;
  295. if(func)
  296. {
  297. func(this.tGeoOrganizationLng, this.tGeoOrganizationLat);
  298. }
  299. }
  300. });
  301. }
  302. },
  303. guidProduct(){
  304. return 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
  305. var r = Math.random() * 16 | 0,
  306. v = c == 'x' ? r : (r & 0x3 | 0x8);
  307. return v.toString(16);
  308. });
  309. },
  310. /** 查找地图中定位点 */
  311. MapTag: function (data) {
  312. this.$refs[this.zjdProductResh].drawingPaceCountryDarw();
  313. },
  314. onConfirmZgqrzrq(data){
  315. this.form.jgrq = this.getNowFormatDate(data).substr(0,10);
  316. this.showZgqrzrq = false;
  317. },
  318. goBack(){
  319. if(this.ztMap && this.enterMap ==1){
  320. if(this.form.id == null){
  321. this.backMap.backMapZjdAData.theGeom= "";
  322. }else{
  323. this.backMap.backMapZjdAData = this.form;
  324. }
  325. this.$cookies.set("search",this.backMap);
  326. } else {
  327. this.$cookies.set("search","");
  328. }
  329. this.$router.push({name: this.$router.back(-1)});
  330. // }
  331. },
  332. }
  333. }
  334. </script>
  335. <style scoped>
  336. >>> .bannerBg{
  337. width: 100%;
  338. color:#fff;
  339. padding:10px;
  340. background: linear-gradient(134deg,#7ac943 1%, #22b7f2);
  341. }
  342. >>> .van-hairline--bottom::after {
  343. border-bottom-width: 0;
  344. }
  345. >>> .title:before
  346. {
  347. content:"";
  348. width: 6px;
  349. height: 20PX;
  350. background: #7ac943;
  351. border-radius: 3px;
  352. position:absolute;
  353. left:0;
  354. bottom:0;
  355. }
  356. >>> .delete-button {
  357. height: 100%;
  358. }
  359. >>> .van-swipe-cell__wrapper{
  360. margin-right:-3px;
  361. }
  362. >>> .label-class .van-collapse-item__title--expanded{
  363. font-weight: bold;
  364. }
  365. </style>