移动端
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

202 righe
5.9 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" :rules="[{ required: true }]" required
  63. />
  64. <van-popup v-model="showzjdxzqssj" position="bottom">
  65. <van-datetime-picker
  66. :value="new Date"
  67. type="date"
  68. title="选择年月日"
  69. @confirm="onConfirmZjdxzqssj"
  70. @cancel="showzjdxzqssj = false"
  71. />
  72. </van-popup>
  73. <van-field
  74. readonly
  75. clickable
  76. v-model="circulation.dcsj"
  77. label="调查时间"
  78. placeholder="调查时间"
  79. @click="showdcsj = true"
  80. input-align="right"
  81. right-icon="arrow-down"
  82. label-width="auto" :rules="[{ required: true }]" required
  83. />
  84. <van-popup v-model="showdcsj" position="bottom">
  85. <van-datetime-picker
  86. :value="new Date"
  87. type="date"
  88. title="选择年月日"
  89. @confirm="onConfirmDcsj"
  90. @cancel="showdcsj = false"
  91. />
  92. </van-popup>
  93. <van-field v-model="circulation.bz" label="备注" type="textarea" placeholder="请输入内容" input-align="right" label-width="auto"/>
  94. </div>
  95. </van-form>
  96. <div style="padding: 16px 0;">
  97. <van-row>
  98. <van-col span="12" align="center">
  99. <van-button type="info" color="#B4B0B0" native-type="submit" class="submitButton" @click="$router.back()">关闭</van-button>
  100. </van-col>
  101. <van-col span="12" align="center">
  102. <van-button type="info" native-type="submit" class="submitButton" @click="goSubmit">保存</van-button>
  103. </van-col>
  104. </van-row>
  105. <div class="clear"></div>
  106. </div>
  107. </div>
  108. </template>
  109. <script>
  110. import { zjdzd } from "@/api/onlineHome/homestead/circulation";
  111. import { zjdlyAdd } from "@/api/onlineHome/homestead/homesteadUtilize";
  112. import {Notify} from "vant";
  113. export default {
  114. name: "homesteadUtilizeAdd",
  115. data() {
  116. return {
  117. zjdlyzk:'',//宅基地利用状况
  118. zjdlyzkDictionaries:[],//宅基地利用状况 字典
  119. circulation:{},
  120. zjdDictionaries:[],
  121. showzjddm : false ,
  122. showzjdlyzk : false ,
  123. showzjdxzqssj : false ,
  124. showdcsj : false ,
  125. };
  126. },
  127. created() {
  128. this.houseGetDicts("zjdlyzk").then((res) => {
  129. for(var i = 0 ; i < res.data.length ; i++){
  130. this.zjdlyzkDictionaries.push({text:res.data[i].dictLabel,value:res.data[i].dictValue});
  131. }
  132. });
  133. //宅基地代码
  134. zjdzd().then(zjdRes => {
  135. for( let i = 0 ; i < zjdRes.rows.length ; i++){
  136. this.zjdDictionaries.push(zjdRes.rows[i].zjddm);
  137. }
  138. });
  139. },
  140. methods: {
  141. onConfirmZjddm(data){
  142. console.log(data)
  143. this.circulation.zjddm = data;
  144. this.showzjddm = false;
  145. },
  146. onConfirmZjdlyzk(data){
  147. this.zjdlyzk = data.text;
  148. this.circulation.zjdlyzk = data.value;
  149. this.showzjdlyzk = false;
  150. },
  151. onConfirmZjdxzqssj(data){
  152. this.circulation.zjdxzqssj = this.getNowFormatDate(data).substr(0,10);
  153. this.showzjdxzqssj = false;
  154. },
  155. onConfirmDcsj(data){
  156. this.circulation.dcsj = this.getNowFormatDate(data).substr(0,10);
  157. this.showdcsj = false;
  158. },
  159. goSubmit(){
  160. this.$refs._Form.validate().then(() => {
  161. zjdlyAdd(this.circulation).then(response => {
  162. if(response.code = 200){
  163. this.$toast.success('保存成功');
  164. window.location.replace("homesteadUtilize")
  165. }
  166. });
  167. }).catch((e) => {
  168. Notify({ type: 'danger', message: '请填写完整的表单项' });
  169. });
  170. }
  171. },
  172. }
  173. </script>
  174. <style scoped lang="scss">
  175. .app-container {
  176. padding: 2% 0;
  177. }
  178. .main_title{
  179. font-size: 0.4rem;
  180. color: #1D6FE9;
  181. margin: 0.2rem 6%;
  182. position: relative;
  183. }
  184. .main_box{
  185. width: 96%;
  186. margin: 0 auto;
  187. border-radius: 6px;
  188. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  189. overflow: hidden;
  190. background-color: #FFF;
  191. }
  192. .submitButton{
  193. width: 80%;
  194. margin: 0 auto;
  195. background-color: #1D6FE9;
  196. }
  197. </style>