移动端
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.
 
 

585 lines
20 KiB

  1. <template>
  2. <div class="app-container">
  3. <van-nav-bar left-arrow fixed placeholder @click-left="goBack" >
  4. <template #title>
  5. <div class="tb_main">
  6. {{ titleName }}
  7. </div>
  8. </template>
  9. </van-nav-bar>
  10. <div class="list_main">
  11. <van-form ref="formData">
  12. <van-field v-model="form.dkbm" label="地块代码:" placeholder="请选择地块代码" required :rules="[{ required: true }]" :border="false"
  13. input-align="right" right-icon="arrow-down" readonly clickable @click="openLandCodePopup" :disabled="isDisabled" maxlength="19" />
  14. <van-popup v-model="showLandCode" position="bottom">
  15. <van-search v-model="searchKeyword" placeholder="请输入地块名称搜索" />
  16. <van-picker
  17. ref="landCodePicker"
  18. show-toolbar
  19. :columns="filteredLandList"
  20. @confirm="onConfirmLandCodeOptions"
  21. @cancel="showLandCode = false"
  22. >
  23. <template #option="option">
  24. <div style="display: flex; flex-direction: column; align-items: center;">
  25. <div>{{option.dkmc}}-{{option.dkbm}}</div>
  26. </div>
  27. </template>
  28. </van-picker>
  29. </van-popup>
  30. <van-field v-model="form.dkmc" label="地块名称:" placeholder="请输入地块名称" required :rules="[{ required: true }]" :border="false" input-align="right" maxlength="50" />
  31. <van-field
  32. v-model="syqxzText"
  33. label="所有权性质:"
  34. placeholder="请选择所有权性质"
  35. required
  36. :rules="[{ required: true }]"
  37. :border="false"
  38. input-align="right"
  39. right-icon="arrow-down"
  40. readonly
  41. clickable
  42. @click="showOwnership = true"
  43. />
  44. <van-popup v-model="showOwnership" position="bottom">
  45. <van-picker
  46. show-toolbar
  47. :columns="syqxzOptions"
  48. value-key="dictLabel"
  49. @confirm="onConfirmOwnershipOptions"
  50. @cancel="showOwnership = false"
  51. />
  52. </van-popup>
  53. <van-field
  54. v-model="tdlylxText"
  55. label="土地利用类型:"
  56. placeholder="请选择土地利用类型"
  57. required
  58. :rules="[{ required: true }]"
  59. :border="false"
  60. input-align="right"
  61. right-icon="arrow-down"
  62. readonly
  63. clickable
  64. @click="showLandUseType = true"
  65. />
  66. <van-popup v-model="showLandUseType" position="bottom">
  67. <van-picker
  68. show-toolbar
  69. :columns="tdlylxOptions"
  70. value-key="dictLabel"
  71. @confirm="onConfirmLandUseTypeOptions"
  72. @cancel="showLandUseType = false"
  73. />
  74. </van-popup>
  75. <van-field
  76. v-model="dldjText"
  77. label="地力等级:"
  78. placeholder="请选择地力等级"
  79. required
  80. :rules="[{ required: true }]"
  81. :border="false"
  82. input-align="right"
  83. right-icon="arrow-down"
  84. readonly
  85. clickable
  86. @click="showLandGrade = true"
  87. />
  88. <van-popup v-model="showLandGrade" position="bottom">
  89. <van-picker
  90. show-toolbar
  91. :columns="dldjOptions"
  92. value-key="dictLabel"
  93. @confirm="onConfirmLandGradeOptions"
  94. @cancel="showLandGrade = false"
  95. />
  96. </van-popup>
  97. <van-field
  98. v-model="tdytText"
  99. label="土地用途:"
  100. placeholder="请选择土地用途"
  101. required
  102. :rules="[{ required: true }]"
  103. :border="false"
  104. input-align="right"
  105. right-icon="arrow-down"
  106. readonly
  107. clickable
  108. @click="showLandPurpose = true"
  109. />
  110. <van-popup v-model="showLandPurpose" position="bottom">
  111. <van-picker
  112. show-toolbar
  113. :columns="tdytOptions"
  114. value-key="dictLabel"
  115. @confirm="onConfirmTDYTOptions"
  116. @cancel="showLandPurpose = false"
  117. />
  118. </van-popup>
  119. <van-field v-model="form.sfjbnt" label="基本农田:" placeholder="请选择基本农田" required :rules="[{ required: true }]" :border="false" input-align="right">
  120. <template #input>
  121. <van-radio-group v-model="form.sfjbnt" direction="horizontal">
  122. <van-radio v-for="item in sfjbntOptions" :key="item.dictValue" :name="item.dictValue">{{ item.dictLabel }}</van-radio>
  123. </van-radio-group>
  124. </template>
  125. </van-field>
  126. <van-field v-model="form.zjrxm" label="指界人姓名:" placeholder="请输入指界人姓名" required :rules="[{ required: true }]" :border="false" input-align="right" maxlength="100" />
  127. <van-field v-model="form.dkdz" label="地块东至:" placeholder="请输入地块东至" required :rules="[{ required: true }]" :border="false" input-align="right" maxlength="50" />
  128. <van-field v-model="form.dkxz" label="地块西至:" placeholder="请输入地块西至" required :rules="[{ required: true }]" :border="false" input-align="right" maxlength="50" />
  129. <van-field v-model="form.dknz" label="地块南至:" placeholder="请输入地块南至" required :rules="[{ required: true }]" :border="false" input-align="right" maxlength="50" />
  130. <van-field v-model="form.dkbz" label="地块北至:" placeholder="请输入地块北至" required :rules="[{ required: true }]" :border="false" input-align="right" maxlength="50" />
  131. <van-field v-model="form.dkbzxx" label="地块备注信息:" placeholder="请输入地块备注信息" :border="false" input-align="right" maxlength="250" /> <!-- type="textarea" rows="3" -->
  132. <van-field
  133. v-model="qdfsText"
  134. label="经营权取得方式:"
  135. placeholder="请选择经营权取得方式"
  136. required
  137. :rules="[{ required: true }]"
  138. :border="false"
  139. input-align="right"
  140. right-icon="arrow-down"
  141. readonly
  142. clickable
  143. @click="showQdfs = true"
  144. />
  145. <van-popup v-model="showQdfs" position="bottom">
  146. <van-picker
  147. show-toolbar
  148. :columns="qdfsOptions"
  149. value-key="dictLabel"
  150. @confirm="onConfirmQdfsOptions"
  151. @cancel="showQdfs = false"
  152. />
  153. </van-popup>
  154. <van-field v-model="form.htmjm" type="number" label="合同面积(亩):" placeholder="请输入合同面积(亩)" required :rules="[{ required: true }]" :border="false" input-align="right" />
  155. <van-field v-model="form.yhtmjm" type="number" label="原合同面积(亩):" placeholder="请输入原合同面积(亩)" :border="false" input-align="right" />
  156. <van-field v-model="form.lzhtbm" label="流转合同代码:" placeholder="请输入流转合同代码" :border="false" input-align="right" maxlength="18" />
  157. <van-field v-model="form.sfqqqg" label="是否确权确股:" placeholder="请选择是否确权确股" :border="false" input-align="right">
  158. <template #input>
  159. <van-radio-group v-model="form.sfqqqg" direction="horizontal">
  160. <van-radio v-for="item in sfqqqgOptions" :key="item.dictValue" :name="item.dictValue">{{ item.dictLabel }}</van-radio>
  161. </van-radio-group>
  162. </template>
  163. </van-field>
  164. <div class="mapBox">
  165. <common-map ref="contractedLandMap" :minMapZoom="15" :maxMapZoom="18" :allowDraw="true" @drawFinished="onMapDrawFinished" />
  166. </div>
  167. </van-form>
  168. <p class="btn" @click="submitForm" v-if="taskStatus === '2' && $route.params.surveyStatus !== '3'">保存</p>
  169. </div>
  170. </div>
  171. </template>
  172. <script>
  173. import Cookies from "js-cookie";
  174. import { getCbdkxx, addCbdkxx, updateCbdkxx } from "@/api/contracted/cbdkxx";
  175. import { listDk } from "@/api/contracted/dk";
  176. import { getDept } from "@/api/contracted";
  177. import CommonMap from "@/components/house/CommonMap";
  178. export default {
  179. name: "contractedVillageContractor",
  180. components: {
  181. CommonMap
  182. },
  183. data() {
  184. return {
  185. titleName: '', // 标题信息
  186. isDisabled: false, // 是否禁用
  187. form: {}, // 承包地信息表单
  188. showLandCode: false, // 控制地块代码弹出层的显示和隐藏
  189. syqxzOptions: [], // 所有权性质字典
  190. syqxzText: null, // 所有权性质标签名
  191. showOwnership: false, // 控制所有权性质字典弹出层的显示和隐藏
  192. tdlylxOptions: [], // 土地利用类型字典
  193. tdlylxText: null, // 土地利用类型标签名
  194. showLandUseType: false, // 控制土地利用类型字典弹出层的显示和隐藏
  195. dldjOptions: [], // 地力等级字典
  196. dldjText: null, // 地力等级标签名
  197. showLandGrade: false, // 控制地力等级字典弹出层的显示和隐藏
  198. tdytOptions: [], // 土地用途字典
  199. tdytText: null, // 土地用途标签名
  200. showLandPurpose: false, // 控制土地用途字典弹出层的显示和隐藏
  201. sfjbntOptions: [], // 是否基本农田字典
  202. qdfsOptions: [], // 承包经营权取得方式字典
  203. qdfsText: null, // 经营权取得方式标签名
  204. showQdfs: false, // 控制土地用途字典弹出层的显示和隐藏
  205. sfqqqgOptions: [], // 是否确权确股字典
  206. landList: [], // 地块信息列表
  207. taskStatus: null, // 调查任务的完成状态:1表示已完成,2表示未完成
  208. searchKeyword: '', // 弹出框查询关键字
  209. };
  210. },
  211. created() {
  212. this.taskStatus = Cookies.get('taskStatus');
  213. this.getDicts("land_ownership").then(response => {
  214. this.syqxzOptions = response.data;
  215. });
  216. this.getDicts("land_use").then(response => {
  217. this.tdlylxOptions = response.data;
  218. });
  219. this.getDicts("land_grade").then(response => {
  220. this.dldjOptions = response.data;
  221. });
  222. this.getDicts("use_code").then(response => {
  223. this.tdytOptions = response.data;
  224. });
  225. this.getDicts("is_common").then(response => {
  226. this.sfjbntOptions = response.data;
  227. this.sfqqqgOptions = response.data;
  228. });
  229. this.getDicts("jyq_method").then(response => {
  230. this.qdfsOptions = response.data;
  231. });
  232. },
  233. mounted() {
  234. if (this.$route.params.id) {
  235. this.titleName = '修改承包地信息';
  236. this.isDisabled = true;
  237. setTimeout(() => {
  238. this.getDetail();
  239. }, 500)
  240. } else {
  241. this.titleName = '新增承包地信息';
  242. this.resetForm();
  243. this.getCoordinates();
  244. this.getLandList();
  245. }
  246. },
  247. computed: {
  248. filteredLandList() {
  249. return this.landList.filter(item => {
  250. return item.dkmc.indexOf(this.searchKeyword) !== -1;
  251. })
  252. }
  253. },
  254. methods: {
  255. getCoordinates() {
  256. getDept(this.$route.params.deptId).then(response => {
  257. const lng = response.data.lng;
  258. const lat = response.data.lat;
  259. if (lng && lat) {
  260. this.$nextTick(() => {
  261. this.$refs.contractedLandMap.setCoord(lng, lat);
  262. });
  263. }
  264. });
  265. },
  266. getLandList() {
  267. // 查询出非承包地块(dklb != '10')且未流转(dkzt = '1')的地块信息
  268. listDk({deptId: this.$route.params.deptId, jtdklb: '10', dkzt: '1'}).then(response => {
  269. this.landList = response.rows;
  270. });
  271. },
  272. getDetail(){
  273. getCbdkxx(this.$route.params.id).then(response => {
  274. this.form = response.data;
  275. this.syqxzText = this.selectDictLabel(this.syqxzOptions, response.data.syqxz);
  276. this.tdlylxText = this.selectDictLabel(this.tdlylxOptions, response.data.tdlylx);
  277. this.dldjText = this.selectDictLabel(this.dldjOptions, response.data.dldj);
  278. this.tdytText = this.selectDictLabel(this.tdytOptions, response.data.tdyt);
  279. this.qdfsText = this.selectDictLabel(this.qdfsOptions, response.data.cbjyqqdfs);
  280. if (response.data.theGeomJson) {
  281. this.form.theGeom = JSON.stringify(JSON.parse(response.data.theGeomJson).coordinates);
  282. this.$nextTick(() => {
  283. this.$refs.contractedLandMap.setLayer('_Draw_layer', response.data.theGeomJson);
  284. });
  285. } else {
  286. this.getCoordinates();
  287. }
  288. });
  289. },
  290. resetForm() {
  291. this.form = {
  292. deptId: null,
  293. cbfbm: null,
  294. dkbm: null,
  295. dkmc: null,
  296. syqxz: null,
  297. tdlylx: null,
  298. dldj: null,
  299. tdyt: null,
  300. sfjbnt: null,
  301. zjrxm: null,
  302. dkdz: null,
  303. dkxz: null,
  304. dknz: null,
  305. dkbz: null,
  306. dkbzxx: null,
  307. theGeom: null,
  308. cbjyqqdfs: '110',
  309. htmjm: null,
  310. yhtmjm: null,
  311. lzhtbm: null,
  312. sfqqqg: null
  313. };
  314. this.qdfsText = '家庭承包';
  315. },
  316. openLandCodePopup() {
  317. /* if (this.form.dkbm) {
  318. const index = this.landList.findIndex(item => item.dkbm === this.form.dkbm);
  319. this.$refs.landCodePicker.setColumnIndex(0, index);
  320. } */
  321. if (!this.isDisabled) {
  322. this.showLandCode = true;
  323. this.searchKeyword = '';
  324. }
  325. },
  326. onConfirmLandCodeOptions(value) {
  327. this.form.dkbm = value.dkbm;
  328. this.form.dkmc = value.dkmc;
  329. this.form.syqxz = value.syqxz;
  330. this.syqxzText = this.selectDictLabel(this.syqxzOptions, value.syqxz);
  331. this.form.tdlylx = value.tdlylx;
  332. this.tdlylxText = this.selectDictLabel(this.tdlylxOptions, value.tdlylx);
  333. this.form.dldj = value.dldj;
  334. this.dldjText = this.selectDictLabel(this.dldjOptions, value.dldj);
  335. this.form.tdyt = value.tdyt
  336. this.tdytText = this.selectDictLabel(this.tdytOptions, value.tdyt);
  337. this.form.sfjbnt = value.sfjbnt;
  338. this.form.htmjm = value.scmjm;
  339. this.form.zjrxm = value.zjrxm;
  340. this.form.dkdz = value.dkdz;
  341. this.form.dkxz = value.dkxz
  342. this.form.dknz = value.dknz;
  343. this.form.dkbz = value.dkbz;
  344. this.form.dkbzxx = value.dkbzxx;
  345. if (value.theGeomJson) {
  346. this.form.theGeom = JSON.stringify(JSON.parse(value.theGeomJson).coordinates);
  347. this.$refs.contractedLandMap.setLayer('_Draw_layer', value.theGeomJson);
  348. } else {
  349. this.form.theGeom = null;
  350. }
  351. this.showLandCode = false;
  352. },
  353. onConfirmOwnershipOptions(value){
  354. this.form.syqxz = value.dictValue;
  355. this.syqxzText = value.dictLabel;
  356. this.showOwnership = false;
  357. },
  358. onConfirmLandUseTypeOptions(value) {
  359. this.form.tdlylx = value.dictValue;
  360. this.tdlylxText = value.dictLabel;
  361. this.showLandUseType = false;
  362. },
  363. onConfirmLandGradeOptions(value) {
  364. this.form.dldj = value.dictValue;
  365. this.dldjText = value.dictLabel;
  366. this.showLandGrade = false;
  367. },
  368. onConfirmTDYTOptions(value){
  369. this.form.tdyt = value.dictValue;
  370. this.tdytText = value.dictLabel;
  371. this.showLandPurpose = false;
  372. },
  373. onConfirmQdfsOptions(value) {
  374. this.form.cbjyqqdfs = value.dictValue;
  375. this.qdfsText = value.dictLabel;
  376. this.showQdfs = false;
  377. },
  378. goBack() {
  379. this.$router.push({
  380. name: 'contractedVillageContractorLand',
  381. params: {
  382. deptId: this.$route.params.deptId,
  383. cbfbm: this.$route.params.cbfbm,
  384. cbfmc: this.$route.params.cbfmc,
  385. surveyStatus: this.$route.params.surveyStatus
  386. }
  387. });
  388. },
  389. submitForm() {
  390. this.$refs.formData.validate().then(() => {
  391. if (this.$route.params.id) {
  392. updateCbdkxx(this.form).then(response => {
  393. if (response.code == 200) {
  394. this.$toast({
  395. icon: 'success',
  396. message: '保存成功',
  397. duration:"1000",
  398. onClose: () => {
  399. this.goBack();
  400. }
  401. });
  402. }
  403. });
  404. } else {
  405. this.form.deptId = this.$route.params.deptId;
  406. this.form.cbfbm = this.$route.params.cbfbm;
  407. addCbdkxx(this.form).then(response => {
  408. if (response.code == 200) {
  409. this.$toast({
  410. icon: 'success',
  411. message: '保存成功',
  412. duration:"1000",
  413. onClose: () => {
  414. this.goBack();
  415. }
  416. });
  417. }
  418. });
  419. }
  420. }).catch(() => {
  421. this.$notify({ type: 'danger', message: '请填写完整的表单项' });
  422. });
  423. },
  424. onMapDrawFinished(data) {
  425. if (data) {
  426. this.form.theGeom = JSON.stringify(data);
  427. } else {
  428. this.form.theGeom = null;
  429. }
  430. },
  431. },
  432. };
  433. </script>
  434. <style scoped lang="scss">
  435. .app-container{
  436. background: #fff url("../../../../../static/images/contracted/contracted_index_bg.png") no-repeat center;
  437. background-size: 100% 100%;
  438. height: 100vh;
  439. padding: 0 4vw;
  440. overflow: hidden;
  441. }
  442. /deep/ .van-nav-bar{
  443. background: transparent;
  444. }
  445. /deep/ .van-nav-bar .van-icon{
  446. color: #000000;
  447. }
  448. /deep/ .van-hairline--bottom::after{
  449. border: none;
  450. }
  451. /deep/ .van-ellipsis{
  452. overflow: initial;
  453. }
  454. /deep/ .van-field--disabled .van-field__label {
  455. color: #646566;
  456. }
  457. /deep/ .van-field__label {
  458. width: 8em;
  459. }
  460. .tb_main{
  461. position: relative;
  462. p{
  463. position: absolute;
  464. display: inline-block;
  465. margin-left: 10PX;
  466. }
  467. }
  468. .tb{
  469. font-size: 12px;
  470. color: #ff8900;
  471. background: #daf6e7;
  472. border: 1px solid #d7be6e;
  473. padding: 2PX 8PX;
  474. border-radius: 50PX;
  475. margin-right: 5PX;
  476. }
  477. .tap_block{
  478. width: 100%;
  479. display: flex;
  480. justify-content: space-between;
  481. background: #ebfaf2;
  482. padding: 2PX 4PX;
  483. border-radius: 10PX;
  484. margin-top: 1vh;
  485. .active{
  486. background-image: linear-gradient(to right,#c6fe8b,#48e5a2);
  487. box-shadow: 0 0 10PX #cccccc;
  488. color: #333333;
  489. }
  490. p{
  491. width: 25%;
  492. text-align: center;
  493. padding: 5PX 0;
  494. border-radius: 10PX;
  495. color: #666666;
  496. }
  497. }
  498. .search_main{
  499. display: flex;
  500. margin-top: 2vh;
  501. .search_btn{
  502. background: rgba(255,255,255,.5);
  503. width: 25%;
  504. border-radius: 50PX;
  505. margin-left: 10PX;
  506. padding: 2PX;
  507. .active{
  508. background-image: linear-gradient(to right,#c6fe8b,#48e5a2);
  509. color: #333333;
  510. border-radius: 50PX;
  511. display: flex;
  512. align-items: center;
  513. justify-content: center;
  514. height: 100%;
  515. }
  516. }
  517. }
  518. .second_tap{
  519. display: flex;
  520. align-items: center;
  521. margin-top: 1vh;
  522. p{
  523. background: #dbf1ea;
  524. border: 1px solid #cdcdcd;
  525. color: #5f5f5f;
  526. padding: 5PX 15PX;
  527. margin-right: 3vw;
  528. border-radius: 50PX;
  529. }
  530. .active{
  531. background: #99eecb;
  532. border-color: #48e5a2;
  533. color: #333333;
  534. }
  535. }
  536. .list_main{
  537. margin-top: 2vh;
  538. overflow-y: scroll;
  539. text-align: center;
  540. background: #ffffff;
  541. border-top-left-radius: 10PX;
  542. border-top-right-radius: 10PX;
  543. height: 88vh;
  544. .btn{
  545. background-image: linear-gradient(to right,#c6fe8b,#48e5a2);
  546. box-shadow: 0 0 10PX #cccccc;
  547. padding: 10PX 0PX;
  548. border-radius: 50PX;
  549. display: inline-block;
  550. width: 40%;
  551. margin-top: 2vh;
  552. }
  553. }
  554. .mapBox{
  555. width: 94%;
  556. height: 50vw;
  557. background-image: linear-gradient(to right,#c6fe8b,#48e5a2);
  558. border-radius: 10PX;
  559. margin: 2vh auto;
  560. }
  561. </style>