移动端
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 

217 linhas
6.3 KiB

  1. <template>
  2. <div class="app-container">
  3. <van-nav-bar
  4. left-arrow
  5. fixed
  6. placeholder
  7. @click-left="$router.back(-1)"
  8. >
  9. <template #title>
  10. <p style="font-weight: bold;">宅基地利用情况</p>
  11. </template>
  12. </van-nav-bar>
  13. <van-form ref="_Form">
  14. <div class="main_box">
  15. <van-field
  16. readonly
  17. clickable
  18. v-model="circulation.zjddm"
  19. label="宅基地代码"
  20. placeholder="请选择"
  21. @click="showzjddm = true"
  22. input-align="right"
  23. right-icon="arrow-down" :rules="[{ required: true }]" required
  24. />
  25. <van-popup v-model="showzjddm" position="bottom">
  26. <van-picker
  27. show-toolbar
  28. :columns="zjdDictionaries"
  29. @confirm="onConfirmZjddm"
  30. @cancel="showzjddm = false"
  31. />
  32. </van-popup>
  33. <van-field
  34. readonly
  35. clickable
  36. v-model="zjdlyzk"
  37. label="宅基地利用情况"
  38. placeholder="请选择"
  39. @click="showzjdlyzk = true"
  40. input-align="right"
  41. right-icon="arrow-down"
  42. label-width="auto" :rules="[{ required: true }]" required
  43. />
  44. <van-popup v-model="showzjdlyzk" position="bottom">
  45. <van-picker
  46. show-toolbar
  47. :columns="zjdlyzkDictionaries"
  48. @confirm="onConfirmZjdlyzk"
  49. @cancel="showzjdlyzk = false"
  50. />
  51. </van-popup>
  52. <van-field v-model="circulation.zjdxzyy" label="宅基地闲置原因" placeholder="闲置原因" input-align="right" label-width="auto"/>
  53. <van-field
  54. readonly
  55. clickable
  56. v-model="circulation.zjdxzqssj"
  57. label="宅基地闲置开始时间"
  58. placeholder="宅基地闲置开始时间"
  59. @click="showzjdxzqssj = true"
  60. input-align="right"
  61. right-icon="arrow-down"
  62. label-width="auto"
  63. />
  64. <van-popup v-model="showzjdxzqssj" position="bottom">
  65. <van-datetime-picker
  66. v-model="currentDate"
  67. type="date"
  68. title="选择年月日"
  69. :min-date="minDate"
  70. :max-date="maxDate"
  71. @confirm="onConfirmZjdxzqssj"
  72. />
  73. </van-popup>
  74. <van-field
  75. readonly
  76. clickable
  77. v-model="circulation.dcsj"
  78. label="调查时间"
  79. placeholder="调查时间"
  80. @click="showdcsj = true"
  81. input-align="right"
  82. right-icon="arrow-down"
  83. label-width="auto" :rules="[{ required: true }]" required
  84. />
  85. <van-popup v-model="showdcsj" position="bottom">
  86. <van-datetime-picker
  87. v-model="currentDate"
  88. type="date"
  89. title="选择年月日"
  90. :min-date="minDate"
  91. :max-date="maxDate"
  92. @confirm="onConfirmDcsj"
  93. />
  94. </van-popup>
  95. <van-field v-model="circulation.bz" label="备注" type="textarea" placeholder="请输入内容" input-align="right" label-width="auto"/>
  96. </div>
  97. </van-form>
  98. <div style="padding: 16px 0;">
  99. <van-row>
  100. <van-col span="12" align="center">
  101. <van-button type="info" color="#B4B0B0" native-type="submit" class="submitButton" @click="$router.back()">关闭</van-button>
  102. </van-col>
  103. <van-col span="12" align="center">
  104. <van-button type="info" native-type="submit" class="submitButton" @click="goSubmit">保存</van-button>
  105. </van-col>
  106. </van-row>
  107. <div class="clear"></div>
  108. </div>
  109. </div>
  110. </template>
  111. <script>
  112. import { zjdzd } from "@/api/onlineHome/homestead/circulation";
  113. import { zjdlyEdit , getZjdly } from "@/api/onlineHome/homestead/homesteadUtilize";
  114. import {Notify} from "vant";
  115. export default {
  116. name: "homesteadUtilizeModify",
  117. data() {
  118. return {
  119. zjdlyzk:'',//宅基地利用状况
  120. zjdlyzkDictionaries:[],//宅基地利用状况 字典
  121. circulation:{},
  122. zjdDictionaries:[],
  123. showzjddm : false ,
  124. showzjdlyzk : false ,
  125. showzjdxzqssj : false ,
  126. showdcsj : false ,
  127. minDate: new Date(),
  128. maxDate: new Date(2025, 10, 1),
  129. currentDate: new Date(),
  130. };
  131. },
  132. created() {
  133. this.getDetail();
  134. },
  135. methods: {
  136. getDetail(){
  137. getZjdly(this.$route.query.id).then(response => {
  138. console.log(response)
  139. this.houseGetDicts("zjdlyzk").then((res) => {
  140. for(var i = 0 ; i < res.data.length ; i++){
  141. this.zjdlyzkDictionaries.push({text:res.data[i].dictLabel,value:res.data[i].dictValue});
  142. }
  143. this.zjdlyzk = this.selectDictLabel(res.data, response.data.zjdlyzk);
  144. });
  145. //宅基地代码
  146. zjdzd().then(zjdRes => {
  147. for( let i = 0 ; i < zjdRes.rows.length ; i++){
  148. this.zjdDictionaries.push(zjdRes.rows[i].zjddm);
  149. }
  150. });
  151. this.circulation = response.data;
  152. });
  153. },
  154. onConfirmZjddm(data){
  155. console.log(data)
  156. this.circulation.zjddm = data;
  157. this.showzjddm = false;
  158. },
  159. onConfirmZjdlyzk(data){
  160. this.zjdlyzk = data.text;
  161. this.circulation.zjdlyzk = data.value;
  162. this.showzjdlyzk = false;
  163. },
  164. onConfirmZjdxzqssj(data){
  165. this.circulation.zjdxzqssj = this.getNowFormatDate(data).substr(0,10);
  166. this.showzjdxzqssj = false;
  167. },
  168. onConfirmDcsj(data){
  169. this.circulation.dcsj = this.getNowFormatDate(data).substr(0,10);
  170. this.showdcsj = false;
  171. },
  172. goSubmit(){
  173. console.log(this.circulation);
  174. this.$refs._Form.validate().then(() => {
  175. zjdlyEdit(this.circulation).then(response => {
  176. if(response.code = 200){
  177. this.$toast.success('保存成功');
  178. }
  179. });
  180. }).catch((e) => {
  181. Notify({ type: 'danger', message: '请填写完整的表单项' });
  182. });
  183. }
  184. },
  185. }
  186. </script>
  187. <style scoped lang="scss">
  188. .app-container {
  189. padding: 2% 0;
  190. }
  191. .main_title{
  192. font-size: 0.4rem;
  193. color: #1D6FE9;
  194. margin: 0.2rem 6%;
  195. position: relative;
  196. }
  197. .main_box{
  198. width: 96%;
  199. margin: 0 auto;
  200. border-radius: 6px;
  201. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  202. overflow: hidden;
  203. background-color: #FFF;
  204. }
  205. .submitButton{
  206. width: 80%;
  207. margin: 0 auto;
  208. background-color: #1D6FE9;
  209. }
  210. </style>