移动端
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 

369 rindas
12 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 #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:30px 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="/system/dict/data/type/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="/system/dict/data/type/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="/system/dict/data/type/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="/system/dict/data/type/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. maxlength="50"
  119. autocomplete="off"
  120. />
  121. <common-map ref="pointDarwMap" style="height:200px;"
  122. :allowDraw="true"
  123. @drawReseted="onMapDrawReseted"
  124. @drawFinished="onMapDrawFinished"
  125. >
  126. </common-map>
  127. </div>
  128. <div style="margin: 16px;display: flex;justify-content: space-around;">
  129. <van-button round color="#22B7F2" style="width:45%" @click="submitzjd">保存</van-button>
  130. <van-button plain color="#22B7F2" style="width:45%" round type="info" @click="cancel">取消</van-button>
  131. </div>
  132. <div style="height: 50px;"></div>
  133. </van-form>
  134. </div>
  135. </template>
  136. <script>
  137. import {listShyqr,addShyqr,updateShyqr,delShyqr,setSyqrInfo} from "@/api/homesteadSurvey/shyqr";
  138. import {listZjdzd,getZjdzd,updateZjdzd,addZjdzd,uploadFile,getQueryLand,submitOnly} from "@/api/homesteadSurvey/zjdzd";
  139. import FieldSelect from "@/components/form/FieldSelect";
  140. import FieldRadio from "@/components/form/FieldRadio";
  141. import CommonMap from "@/components/house/CommonMap";
  142. import {addNh, delNh, exportNh, getNh, listNh, updateNh,setNhInfo} from "@/api/homesteadSurvey/nh";
  143. import {listZrz,addZrz,updateZrz,getZrzZjdDmList,delZrz,updateZrzStatus} from "@/api/homesteadSurvey/zrz";
  144. import {listNmfw,addNmfw,updateNmfw,delNmfw} from "@/api/homesteadSurvey/nmfw";
  145. import {listSuyqr,addSuyqr,updateSuyqr} from "@/api/homesteadSurvey/suyqr";
  146. import {listNhhncy,addNhhncy,updateNhhncy,delNhhncy} from "@/api/homesteadSurvey/nhhncy";
  147. import {listFsss,addFsss,updateFsss,delFsss,getFsssZjdDmList,updateFsssStatus} from "@/api/homesteadSurvey/fsss";
  148. import { listTown, getTown } from "@/api/homesteadSurvey/town";
  149. import { listVillage} from "@/api/homesteadSurvey/village";
  150. import { sysConfig} from "@/api/homesteadSurvey/index";
  151. import { Notify, Dialog, Toast } from 'vant';
  152. import axios from "axios";
  153. export default {
  154. components: {FieldSelect, FieldRadio,CommonMap},
  155. name: "zrzAdd",
  156. data() {
  157. return {
  158. active:3,
  159. // 使用权人列表
  160. syqrlist:[
  161. {
  162. shyqrdbxm :'测试测试',
  163. shyqrdbzjhm :'12324648564',
  164. nhdm :'777888999',
  165. }
  166. ],
  167. // 地图绘制
  168. drawInsert: null,
  169. // 当前位置信息
  170. tGeoOrganizationLat: null,
  171. tGeoOrganizationLng: null,
  172. minDate: new Date(),
  173. maxDate: new Date(2025, 10, 1),
  174. showZgqrzrq:false,
  175. form:{}
  176. };
  177. },
  178. created(){
  179. let data = this.$route.query;
  180. this.form = data;
  181. if(this.form.id == null){
  182. this.$set(this.form, 'fssslx', "11");
  183. this.$set(this.form, 'sfzsy', "1");
  184. this.$set(this.form, 'jzwqk', "1");
  185. this.$set(this.form, 'jsqtdzk', "1");
  186. }
  187. this.$nextTick(() => {
  188. this.pointDarw(null);
  189. // this.pointDarwNature(null);
  190. this.$refs.pointDarwMap && this.$refs.pointDarwMap.update();
  191. })
  192. },
  193. mounted(){
  194. },
  195. methods: {
  196. getList(){
  197. listNh({hzzjhm:this.form.shyqrdbzjhm}).then(response => {
  198. this.form = response.rows[0];
  199. });
  200. },
  201. submitzjd(){
  202. this.$refs.form.validate().then(() => {
  203. if(this.form.id == null){
  204. addFsss(this.form).then(response => {
  205. let _this =this
  206. this.$toast({
  207. icon: 'success', // 找到自己需要的图标
  208. message: '保存成功',
  209. duration:"1000",
  210. onClose:function(){
  211. _this.$router.push({path:'/homesteadSurvey/add4',query: {zjddm: _this.form.zjddm}});
  212. }
  213. })
  214. });
  215. }else{
  216. updateFsss(this.form).then(response => {
  217. let _this =this
  218. this.$toast({
  219. icon: 'success', // 找到自己需要的图标
  220. message: '保存成功',
  221. duration:"1000",
  222. onClose:function(){
  223. _this.$router.push({path:'/homesteadSurvey/add4',query: {zjddm: _this.form.zjddm}});
  224. }
  225. })
  226. });
  227. }
  228. }).catch((e) => {
  229. Dialog({ type: 'danger', message: '请填写完整的表单项' });
  230. });
  231. },
  232. // 绘制申请地图
  233. pointDarw(data) {
  234. this.$nextTick(() => {
  235. let map = this.$refs.pointDarwMap;
  236. if(data === null)
  237. data = this.form.theGeomJson;
  238. this.setMapData(map, data);
  239. });
  240. },
  241. // 通用设置地图数据函数
  242. setMapData(map, data) {
  243. //console.log(map, data ? true : false);
  244. if(!map) return;
  245. if(data)
  246. {
  247. map.setLayer('pointDarwLayer', data);
  248. }
  249. else {
  250. this.getLandCoord((lng, lat) => {
  251. map.setCoord(this.tGeoOrganizationLng, this.tGeoOrganizationLat);
  252. });
  253. }
  254. },
  255. // 当地图绘制完成时
  256. onMapDrawFinished(data) {
  257. console.info(data);
  258. this.drawInsert = data;
  259. this.form.theGeomJson = JSON.stringify(this.drawInsert);
  260. },
  261. // 当申请地图被重置时
  262. onMapDrawReseted() {
  263. this.drawInsert = null;
  264. if(this.form.theGeomJson)
  265. {
  266. let lastData = JSON.parse(this.form.theGeomJson);
  267. if(lastData.hasOwnProperty('coordinates')) // 从后台获取的
  268. this.drawInsert = lastData.coordinates;
  269. }
  270. },
  271. cancel(){
  272. this.$router.push({path:'/homesteadSurvey/add4',query: {zjddm: this.form.zjddm}});
  273. },
  274. // 获取登录人位置坐标
  275. getLandCoord(func) {
  276. if (func
  277. && this.tGeoOrganizationLng !== null && this.tGeoOrganizationLng !== ''
  278. && this.tGeoOrganizationLat !== null && this.tGeoOrganizationLat !== '') {
  279. this.$nextTick(() => {
  280. func(this.tGeoOrganizationLng, this.tGeoOrganizationLat);
  281. })
  282. }
  283. else {
  284. console.info(this.deptId);
  285. getQueryLand(this.deptId).then((response) => {
  286. if (response.code == 200) {
  287. let InsertCode = response.data;
  288. this.form.orgCode = InsertCode.orgCode;
  289. this.tGeoOrganizationLat = InsertCode.lat;
  290. this.tGeoOrganizationLng = InsertCode.lng;
  291. if(func)
  292. {
  293. func(this.tGeoOrganizationLng, this.tGeoOrganizationLat);
  294. }
  295. }
  296. });
  297. }
  298. },
  299. guidProduct(){
  300. return 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
  301. var r = Math.random() * 16 | 0,
  302. v = c == 'x' ? r : (r & 0x3 | 0x8);
  303. return v.toString(16);
  304. });
  305. },
  306. /** 查找地图中定位点 */
  307. MapTag: function (data) {
  308. this.$refs[this.zjdProductResh].drawingPaceCountryDarw();
  309. },
  310. onConfirmZgqrzrq(data){
  311. this.form.jgrq = this.getNowFormatDate(data).substr(0,10);
  312. this.showZgqrzrq = false;
  313. },
  314. goBack(){
  315. if(this.ztMap && this.enterMap ==1){
  316. if(this.form.id == null){
  317. this.backMap.backMapZjdAData.theGeom= "";
  318. }else{
  319. this.backMap.backMapZjdAData = this.form;
  320. }
  321. this.$cookies.set("search",this.backMap);
  322. } else {
  323. this.$cookies.set("search","");
  324. }
  325. this.$router.push({name: this.$router.back(-1)});
  326. // }
  327. },
  328. }
  329. }
  330. </script>
  331. <style scoped>
  332. >>> .bannerBg{
  333. width: 100%;
  334. color:#fff;
  335. padding:10px;
  336. background: linear-gradient(134deg,#7ac943 1%, #22b7f2);
  337. }
  338. >>> .van-hairline--bottom::after {
  339. border-bottom-width: 0;
  340. }
  341. >>> .title:before
  342. {
  343. content:"";
  344. width: 6px;
  345. height: 20PX;
  346. background: #7ac943;
  347. border-radius: 3px;
  348. position:absolute;
  349. left:0;
  350. bottom:0;
  351. }
  352. >>> .delete-button {
  353. height: 100%;
  354. }
  355. >>> .van-swipe-cell__wrapper{
  356. margin-right:-3px;
  357. }
  358. >>> .label-class .van-collapse-item__title--expanded{
  359. font-weight: bold;
  360. }
  361. </style>