移动端
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 

377 líneas
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. this.$set(this.form, 'theGeomJson', JSON.parse( this.form.theGeomJson));
  208. if(this.form.theGeomJson.hasOwnProperty('coordinates')) // 从后台获取的
  209. this.$set(this.form, 'theGeomJson',this.form.theGeomJson.coordinates);
  210. this.$set(this.form, 'theGeomJson', JSON.stringify( this.form.theGeomJson));
  211. if(this.form.id == null){
  212. addFsss(this.form).then(response => {
  213. let _this =this
  214. this.$toast({
  215. icon: 'success', // 找到自己需要的图标
  216. message: '保存成功',
  217. duration:"1000",
  218. onClose:function(){
  219. _this.$router.push({path:'/homesteadSurvey/add4',query: {zjddm: _this.form.zjddm}});
  220. }
  221. })
  222. });
  223. }else{
  224. updateFsss(this.form).then(response => {
  225. let _this =this
  226. this.$toast({
  227. icon: 'success', // 找到自己需要的图标
  228. message: '保存成功',
  229. duration:"1000",
  230. onClose:function(){
  231. _this.$router.push({path:'/homesteadSurvey/add4',query: {zjddm: _this.form.zjddm}});
  232. }
  233. })
  234. });
  235. }
  236. }).catch((e) => {
  237. Dialog({ type: 'danger', message: '请填写完整的表单项' });
  238. });
  239. },
  240. // 绘制申请地图
  241. pointDarw(data) {
  242. this.$nextTick(() => {
  243. let map = this.$refs.pointDarwMap;
  244. if(data === null)
  245. data = this.form.theGeomJson;
  246. this.setMapData(map, data);
  247. });
  248. },
  249. // 通用设置地图数据函数
  250. setMapData(map, data) {
  251. //console.log(map, data ? true : false);
  252. if(!map) return;
  253. if(data)
  254. {
  255. map.setLayer('pointDarwLayer', data);
  256. console.info(this.zjdzdxx.surveyStatus);
  257. map.addLayerNew('pointDarwLayer3', this.zjdzdxx.theGeomJson,"zjdzdxx",this.zjdzdxx.surveyStatus);
  258. }
  259. else {
  260. map.addLayerNew('pointDarwLayer3', this.zjdzdxx.theGeomJson,"zjdzdxx",this.zjdzdxx.surveyStatus);
  261. }
  262. },
  263. // 当地图绘制完成时
  264. onMapDrawFinished(data) {
  265. console.info(data);
  266. this.drawInsert = data;
  267. this.form.theGeomJson = JSON.stringify(this.drawInsert);
  268. },
  269. // 当申请地图被重置时
  270. onMapDrawReseted() {
  271. this.drawInsert = null;
  272. if(this.form.theGeomJson)
  273. {
  274. let lastData = JSON.parse(this.form.theGeomJson);
  275. if(lastData.hasOwnProperty('coordinates')) // 从后台获取的
  276. this.drawInsert = lastData.coordinates;
  277. }
  278. },
  279. cancel(){
  280. this.$router.push({path:'/homesteadSurvey/add4',query: {zjddm: this.form.zjddm}});
  281. },
  282. // 获取登录人位置坐标
  283. getLandCoord(func) {
  284. if (func
  285. && this.tGeoOrganizationLng !== null && this.tGeoOrganizationLng !== ''
  286. && this.tGeoOrganizationLat !== null && this.tGeoOrganizationLat !== '') {
  287. this.$nextTick(() => {
  288. func(this.tGeoOrganizationLng, this.tGeoOrganizationLat);
  289. })
  290. }
  291. else {
  292. console.info(this.deptId);
  293. getQueryLand(this.deptId).then((response) => {
  294. if (response.code == 200) {
  295. let InsertCode = response.data;
  296. this.form.orgCode = InsertCode.orgCode;
  297. this.tGeoOrganizationLat = InsertCode.lat;
  298. this.tGeoOrganizationLng = InsertCode.lng;
  299. if(func)
  300. {
  301. func(this.tGeoOrganizationLng, this.tGeoOrganizationLat);
  302. }
  303. }
  304. });
  305. }
  306. },
  307. guidProduct(){
  308. return 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
  309. var r = Math.random() * 16 | 0,
  310. v = c == 'x' ? r : (r & 0x3 | 0x8);
  311. return v.toString(16);
  312. });
  313. },
  314. /** 查找地图中定位点 */
  315. MapTag: function (data) {
  316. this.$refs[this.zjdProductResh].drawingPaceCountryDarw();
  317. },
  318. onConfirmZgqrzrq(data){
  319. this.form.jgrq = this.getNowFormatDate(data).substr(0,10);
  320. this.showZgqrzrq = false;
  321. },
  322. goBack(){
  323. if(this.ztMap && this.enterMap ==1){
  324. if(this.form.id == null){
  325. this.backMap.backMapZjdAData.theGeom= "";
  326. }else{
  327. this.backMap.backMapZjdAData = this.form;
  328. }
  329. this.$cookies.set("search",this.backMap);
  330. } else {
  331. this.$cookies.set("search","");
  332. }
  333. this.$router.push({name: this.$router.back(-1)});
  334. // }
  335. },
  336. }
  337. }
  338. </script>
  339. <style scoped>
  340. >>> .bannerBg{
  341. width: 100%;
  342. color:#fff;
  343. padding:10px;
  344. background: linear-gradient(134deg,#7ac943 1%, #22b7f2);
  345. }
  346. >>> .van-hairline--bottom::after {
  347. border-bottom-width: 0;
  348. }
  349. >>> .title:before
  350. {
  351. content:"";
  352. width: 6px;
  353. height: 20PX;
  354. background: #7ac943;
  355. border-radius: 3px;
  356. position:absolute;
  357. left:0;
  358. bottom:0;
  359. }
  360. >>> .delete-button {
  361. height: 100%;
  362. }
  363. >>> .van-swipe-cell__wrapper{
  364. margin-right:-3px;
  365. }
  366. >>> .label-class .van-collapse-item__title--expanded{
  367. font-weight: bold;
  368. }
  369. </style>