移动端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

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