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

311 line
9.8 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. <p class="main_title">基本信息</p>
  15. <div class="main_box">
  16. <van-field
  17. readonly
  18. clickable
  19. label="是否在建建筑物"
  20. placeholder="请选择"
  21. v-model="sfzjjzw"
  22. @click="showSys = true"
  23. input-align="right"
  24. right-icon="arrow-down"
  25. label-width="auto" :rules="[{ required: true }]" required
  26. />
  27. <field-select
  28. v-model="jgList.zjddm"
  29. label="宅基地代码"
  30. value-key="zjddm"
  31. data-key="zjddm"
  32. placeholder="请选择宅基地代码"
  33. :rules="[{ required: true }]"
  34. required
  35. :readonly="!allowCUD"
  36. :columns="zjdDictionaries"
  37. @change="onZjddmChanged"
  38. />
  39. <van-field label="户主姓名" v-model="jgList.syrxm" placeholder="请填写户主姓名" input-align="right" label-width="auto" readonly :rules="[{ required: true }]" required/>
  40. <van-popup v-model="showSys" position="bottom">
  41. <van-picker
  42. show-toolbar
  43. :columns="sysDictionaries"
  44. @confirm="onConfirmSys"
  45. @cancel="showSys = false"
  46. />
  47. </van-popup>
  48. <van-field
  49. readonly
  50. clickable
  51. label="监管类型"
  52. placeholder="请选择"
  53. v-model="jglx"
  54. @click="showjglx = true"
  55. input-align="right"
  56. right-icon="arrow-down" :rules="[{ required: true }]" required
  57. />
  58. <van-popup v-model="showjglx" position="bottom">
  59. <van-picker
  60. show-toolbar
  61. :columns="jglxDictionaries"
  62. @confirm="onConfirmJglx"
  63. @cancel="showjglx = false"
  64. />
  65. </van-popup>
  66. <van-field
  67. readonly
  68. clickable
  69. v-model="jgList.lasj"
  70. label="立案时间"
  71. placeholder="请选择立案时间"
  72. @click="showlasj = true"
  73. input-align="right"
  74. right-icon="arrow-down" :rules="[{ required: true }]" required
  75. />
  76. <van-popup v-model="showlasj" position="bottom">
  77. <van-datetime-picker
  78. v-model="currentDate"
  79. type="date"
  80. title="选择年月日"
  81. @confirm="onConfirmLasj"
  82. />
  83. </van-popup>
  84. <van-field label="巡查人" v-model="jgList.inspector" placeholder="请输入巡查人" input-align="right" label-width="auto" :rules="[{ required: true }]" required/>
  85. <van-field
  86. readonly
  87. clickable
  88. label="巡查时间"
  89. v-model="jgList.inspectorTime"
  90. placeholder="请选择巡查时间"
  91. @click="showinspectorTime = true"
  92. input-align="right"
  93. right-icon="arrow-down" :rules="[{ required: true }]" required
  94. />
  95. <van-popup v-model="showinspectorTime" position="bottom">
  96. <van-datetime-picker
  97. v-model="currentDate"
  98. type="date"
  99. title="选择年月日"
  100. @confirm="onConfirmInspectorTime"
  101. />
  102. </van-popup>
  103. <van-field label="备注" v-model="jgList.bz" placeholder="填写备注" input-align="right" label-width="auto"/>
  104. </div>
  105. <p class="main_title">违法信息</p>
  106. <div class="main_box">
  107. <van-field
  108. readonly
  109. clickable
  110. label="违法用地类型"
  111. placeholder="请选择"
  112. v-model="wfydlx"
  113. @click="showwfydlx = true"
  114. input-align="right"
  115. right-icon="arrow-down" :rules="[{ required: true }]" required
  116. />
  117. <van-popup v-model="showwfydlx" position="bottom">
  118. <van-picker
  119. show-toolbar
  120. :columns="wfydlxDictionaries"
  121. @confirm="onConfirmWfydlx"
  122. @cancel="showwfydlx = false"
  123. />
  124. </van-popup>
  125. <van-field v-model="jgList.wfydmj" type="number" label="违法用地面积" placeholder="请输入面积" input-align="right" label-width="auto" :rules="[{ required: true }]" required/>
  126. <van-field v-model="jgList.fmkje" label="罚没款金额" placeholder="请输入金额" input-align="right" label-width="auto" type="number" :rules="[{ required: true }]" required/>
  127. <van-field v-model="jgList.msmj" type="number" label="没收面积" placeholder="请输入面积" input-align="right" label-width="auto" :rules="[{ required: true }]" required/>
  128. <van-field v-model="jgList.ccmj" type="number" label="拆除面积" placeholder="请输入面积" input-align="right" label-width="auto" :rules="[{ required: true }]" required/>
  129. <van-field
  130. readonly
  131. clickable
  132. label="整改截止时间"
  133. placeholder="选择整改截止时间"
  134. v-model="jgList.reformDeadline"
  135. @click="showReformDeadline = true"
  136. input-align="right"
  137. right-icon="arrow-down" :rules="[{ required: true }]" required
  138. />
  139. <van-popup v-model="showReformDeadline" position="bottom">
  140. <van-datetime-picker
  141. v-model="currentDate"
  142. type="date"
  143. title="选择年月日"
  144. @confirm="onConfirmReformDeadline"
  145. />
  146. </van-popup>
  147. </div>
  148. </van-form>
  149. <div style="padding: 16px 0;" v-if="allowCUD">
  150. <van-row>
  151. <van-col span="12" align="center">
  152. <van-button type="info" color="#B4B0B0" native-type="submit" @click="goBack" class="submitButton">取<i style="margin-right: 1em;"></i>消</van-button>
  153. </van-col>
  154. <van-col span="12" align="center">
  155. <van-button type="info" native-type="submit" @click="goAdd" class="submitButton">保<i style="margin-right: 1em;"></i>存</van-button>
  156. </van-col>
  157. </van-row>
  158. <div class="clear"></div>
  159. </div>
  160. </div>
  161. </template>
  162. <script>
  163. import { jgAdd } from "@/api/onlineHome/homestead/reporting";
  164. import { zjdzd , getByZjddm } from "@/api/onlineHome/homestead/circulation";
  165. import FieldSelect from "@/components/form/FieldSelect";
  166. import {Notify} from "vant";
  167. export default {
  168. name: "supervisionAdd",
  169. components: {
  170. FieldSelect},
  171. data() {
  172. return {
  173. showSys:false,
  174. showjglx:false,
  175. showlasj:false,
  176. showinspectorTime:false,
  177. showwfydlx:false,
  178. showReformDeadline:false,
  179. currentDate: new Date(),
  180. jgList:{},
  181. sfzjjzw:'',
  182. jglx:'',
  183. wfydlx:'',
  184. wfydlxDictionaries:[],
  185. jglxDictionaries:[],
  186. sysDictionaries:[],
  187. zjdDictionaries: [],
  188. };
  189. },
  190. created() {
  191. this.getDictionaries();
  192. },
  193. computed: {
  194. allowCUD: function () {
  195. return this.$store.getters.businessLevel == '2'
  196. },
  197. },
  198. methods: {
  199. getDictionaries(){
  200. //违法用地类型
  201. this.houseGetDicts("villations_type").then((res) => {
  202. for(var i = 0 ; i < res.data.length ; i++){
  203. this.wfydlxDictionaries.push({text:res.data[i].dictLabel,value:res.data[i].dictValue});
  204. }
  205. });
  206. //监管类型
  207. this.houseGetDicts("jglx").then((res) => {
  208. for(var i = 0 ; i < res.data.length ; i++){
  209. this.jglxDictionaries.push({text:res.data[i].dictLabel,value:res.data[i].dictValue});
  210. }
  211. });
  212. //是否在建建筑物
  213. this.houseGetDicts("sys_yes_no").then((res) => {
  214. for(var i = 0 ; i < res.data.length ; i++){
  215. this.sysDictionaries.push({text:res.data[i].dictLabel,value:res.data[i].dictValue});
  216. }
  217. });
  218. //宅基地代码
  219. zjdzd().then(zjdRes => {
  220. this.zjdDictionaries = zjdRes.rows;
  221. if(this.zjdDictionaries.length > 0)
  222. this.jgList.zjddm = this.zjdDictionaries[0].zjddm;
  223. });
  224. },
  225. onConfirmSys(data){
  226. this.sfzjjzw = data.text;
  227. this.jgList.sfzjjzw = data.value;
  228. this.showSys = false;
  229. },
  230. onConfirmJglx(data){
  231. this.jglx = data.text;
  232. this.jgList.jglx = data.value;
  233. this.showjglx = false;
  234. },
  235. onConfirmWfydlx(data){
  236. this.wfydlx = data.text;
  237. this.jgList.wfydlx = data.value;
  238. this.showwfydlx = false;
  239. },
  240. onConfirmLasj(data){
  241. this.jgList.lasj = this.getNowFormatDate(data).substr(0,10);
  242. this.showlasj = false;
  243. },
  244. onConfirmInspectorTime(data){
  245. this.jgList.inspectorTime = this.getNowFormatDate(data).substr(0,10);
  246. this.showinspectorTime = false;
  247. },
  248. onConfirmReformDeadline(data){
  249. this.jgList.reformDeadline = this.getNowFormatDate(data).substr(0,10);
  250. this.showReformDeadline = false;
  251. },
  252. goAdd(){
  253. console.log(this.jgList)
  254. this.$refs._Form.validate().then(() => {
  255. jgAdd(this.jgList).then(response => {
  256. console.log(response);
  257. this.$toast.success('保存成功');
  258. setTimeout(function(){
  259. history.go(-1)
  260. },2000)
  261. });
  262. }).catch((e) => {
  263. Notify({ type: 'danger', message: '请填写完整的表单项' });
  264. });
  265. },
  266. goBack(){
  267. window.history.go(-1)
  268. },
  269. onZjddmChanged(data) {
  270. let zjddm = data.zjddm;
  271. getByZjddm({zjddm: zjddm,}).then(qlrRes => {
  272. let data = qlrRes.data;
  273. console.log(data)
  274. this.jgList.syrxm = data.shyqrdbxm;
  275. this.$forceUpdate();
  276. });
  277. }
  278. },
  279. }
  280. </script>
  281. <style scoped lang="scss">
  282. .app-container {
  283. padding: 2% 0;
  284. }
  285. .main_title{
  286. font-size: 0.4rem;
  287. color: #1D6FE9;
  288. margin: 0.2rem 6%;
  289. position: relative;
  290. }
  291. .main_box{
  292. width: 96%;
  293. margin: 0 auto;
  294. border-radius: 6px;
  295. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  296. overflow: hidden;
  297. background-color: #FFF;
  298. }
  299. .submitButton{
  300. width: 80%;
  301. margin: 0 auto;
  302. background-color: #1D6FE9;
  303. }
  304. </style>