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

freeExitAdd.vue 14 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405
  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 v-model="circulation.sqrxm" label="申请人姓名" placeholder="申请人姓名" input-align="right" label-width="auto" :rules="[{ required: true }]" required/>-->
  16. <van-field v-model="circulation.sqrxm" label="申请人姓名" placeholder="申请人姓名" input-align="right" label-width="auto" :rules="[{ required: true }]" required @input="remoteTransfereeMethod" />
  17. <div id="dropList" v-show="showDropList" style="width: 92vw; position: absolute; z-index: 99; left: 50%; margin-left: -46vw; border: 1px solid #E2E0E0;" >
  18. <van-cell id="vanCell" v-for="(item, index) in getObligeeOptions" :key="index" @click="shyqrdmxmChange(item)" style="position: relative; z-index: 999;">
  19. {{item}}
  20. </van-cell>
  21. </div>
  22. <van-field
  23. readonly
  24. clickable
  25. v-model="circulation.zjddm"
  26. label="宅基地代码"
  27. placeholder="请选择"
  28. @click="remoteProposerMethod"
  29. input-align="right"
  30. right-icon="arrow-down" :rules="[{ required: true }]" required
  31. />
  32. <van-popup v-model="showzjddm" position="bottom">
  33. <van-picker
  34. show-toolbar
  35. :columns="zjdDictionaries"
  36. value-key="zjddm"
  37. @confirm="onConfirmZjddm"
  38. @cancel="showzjddm = false"
  39. />
  40. </van-popup>
  41. <van-field
  42. readonly
  43. clickable
  44. v-model="zjlx"
  45. label="申请人证件类型"
  46. placeholder="请选择"
  47. @click="showzjlx = true"
  48. input-align="right"
  49. right-icon="arrow-down"
  50. label-width="auto" :rules="[{ required: true }]" required
  51. />
  52. <van-popup v-model="showzjlx" position="bottom">
  53. <van-picker
  54. show-toolbar
  55. :columns="zjlxDictionaries"
  56. @confirm="onConfirmZjlx"
  57. @cancel="showzjlx = false"
  58. />
  59. </van-popup>
  60. <van-field v-model="circulation.sqrzjhm" label="申请人证件号码" placeholder="申请人证件号码" input-align="right" label-width="auto" :rules="[{ required: true }]" required/>
  61. </div>
  62. <p class="main_title">退出信息</p>
  63. <div class="main_box">
  64. <van-field
  65. readonly
  66. clickable
  67. v-model="tcqllx"
  68. label="退出权利类型"
  69. placeholder="请选择退出权利类型"
  70. @click="showtcqllx = true"
  71. input-align="right"
  72. right-icon="arrow-down"
  73. label-width="auto" :rules="[{ required: true }]" required
  74. />
  75. <van-popup v-model="showtcqllx" position="bottom">
  76. <van-picker
  77. show-toolbar
  78. :columns="tcqllxDictionaries"
  79. @confirm="onConfirmTcqllx"
  80. @cancel="showtcqllx = false"
  81. />
  82. </van-popup>
  83. <van-field
  84. readonly
  85. v-model="tclx"
  86. label="退出类型"
  87. input-align="right"
  88. label-width="auto"
  89. required
  90. />
  91. <van-field
  92. readonly
  93. clickable
  94. v-model="tcfs"
  95. label="退出方式"
  96. placeholder="请选择退出方式"
  97. @click="showtcfs = true"
  98. input-align="right"
  99. right-icon="arrow-down"
  100. label-width="auto" :rules="[{ required: true }]" required
  101. />
  102. <van-popup v-model="showtcfs" position="bottom">
  103. <van-picker
  104. show-toolbar
  105. :columns="tcfsDictionaries"
  106. @confirm="onConfirmTcfs"
  107. @cancel="showtcfs = false"
  108. />
  109. </van-popup>
  110. <van-field v-model="circulation.tcmj" label="退出面积(㎡)" placeholder="请输入退出面积㎡" input-align="right" label-width="auto" :rules="[{ required: true }]" required type="number"/>
  111. <van-field v-model="circulation.tcnx" label="退出年限" placeholder="请输入退出年限" input-align="right" label-width="auto" type="number"/>
  112. </div>
  113. <p class="main_title">补偿信息</p>
  114. <div class="main_box">
  115. <van-field
  116. readonly
  117. clickable
  118. v-model="bcfs"
  119. label="补偿方式"
  120. placeholder="请选择补偿方式"
  121. @click="showbcfs = true"
  122. label-width="auto"
  123. input-align="right"
  124. right-icon="arrow-down"
  125. />
  126. <van-popup v-model="showbcfs" position="bottom">
  127. <van-picker
  128. show-toolbar
  129. :columns="bcfsDictionaries"
  130. @confirm="onConfirmBcfs"
  131. @cancel="showbcfs = false"
  132. />
  133. </van-popup>
  134. <van-field v-model="circulation.bcje" label="补偿金额(元)" placeholder="请输入补偿金额 元" input-align="right" label-width="auto" type="number"/>
  135. <van-field v-model="circulation.zhfwmj" label="置换房屋面积(㎡)" placeholder="请输入房屋面积㎡" input-align="right" label-width="auto" type="number"/>
  136. <van-field v-model="circulation.zhfwzl" label="置换房屋坐落" placeholder="请输入房屋坐落" input-align="right" label-width="auto"/>
  137. <van-field v-model="circulation.bz" label="备注" placeholder="请输入内容" input-align="right" label-width="auto"/>
  138. </div>
  139. </van-form>
  140. <div style="padding: 16px 0;">
  141. <van-row>
  142. <van-col span="24" align="center">
  143. <van-button type="info" native-type="submit" class="submitButton" @click="goSubmit()">保存</van-button>
  144. </van-col>
  145. </van-row>
  146. <div class="clear"></div>
  147. </div>
  148. </div>
  149. </template>
  150. <script>
  151. import { zjdzd, getByZjddm, getObligeeList, obligeeList } from "@/api/onlineHome/homestead/circulation";
  152. import { dyAdd, } from "@/api/onlineHome/homestead/paidExit";
  153. import {Notify} from "vant";
  154. export default {
  155. name: "freeExitAdd",
  156. data() {
  157. return {
  158. tcqllxDictionaries:[],//退出权利类型
  159. tclxDictionaries:[],//退出类型
  160. tcfsDictionaries:[],//退出方式
  161. zjlxDictionaries:[],//申请人证件类型
  162. bcfsDictionaries:[],//补偿方式
  163. zjdDictionaries:[],//宅基地代码
  164. getObligeeOptions:[],//下拉框列表
  165. tcqllx:'',
  166. tclx:'无偿退出',
  167. tcfs:'',
  168. zjlx:'',
  169. bcfs:'',
  170. zjddm:'',
  171. showtcqllx: false,
  172. showtclx: false,
  173. showtcfs: false,
  174. showzjlx: false,
  175. showbcfs: false,
  176. showzjddm: false,
  177. showDropList: false,//是否显示下拉框
  178. circulation:{
  179. // 申请类型 1-宅基地退出
  180. sqlx: '1',
  181. // 退出类型 01-有偿退出 02-无偿退出
  182. tclx: '02',
  183. }
  184. };
  185. },
  186. created() {
  187. this.getDictionaries();
  188. },
  189. methods: {
  190. getDictionaries(){
  191. //退出权利类型
  192. this.houseGetDicts("tcqllx").then((res) => {
  193. for(var i = 0 ; i < res.data.length ; i++){
  194. this.tcqllxDictionaries.push({text:res.data[i].dictLabel,value:res.data[i].dictValue});
  195. }
  196. });
  197. //退出方式
  198. this.houseGetDicts("tcfs").then((res) => {
  199. for(var i = 0 ; i < res.data.length ; i++){
  200. this.tcfsDictionaries.push({text:res.data[i].dictLabel,value:res.data[i].dictValue});
  201. }
  202. });
  203. //申请人证件类型
  204. this.houseGetDicts("zjlx").then((res) => {
  205. for(var i = 0 ; i < res.data.length ; i++){
  206. this.zjlxDictionaries.push({text:res.data[i].dictLabel,value:res.data[i].dictValue});
  207. }
  208. });
  209. //补偿方式
  210. this.houseGetDicts("bcfs").then((res) => {
  211. for(var i = 0 ; i < res.data.length ; i++){
  212. this.bcfsDictionaries.push({text:res.data[i].dictLabel,value:res.data[i].dictValue});
  213. }
  214. });
  215. //宅基地代码
  216. /*zjdzd().then(zjdRes => {
  217. for( let i = 0 ; i < zjdRes.rows.length ; i++){
  218. this.zjdDictionaries.push(zjdRes.rows[i].zjddm);
  219. }
  220. if(this.zjdDictionaries.length > 0)
  221. this.onConfirmZjddm(this.zjdDictionaries[0]);
  222. });*/
  223. },
  224. /*onConfirmZjddm(data){
  225. console.log(data)
  226. this.circulation.zjddm = data;
  227. this.showzjddm = false;
  228. getByZjddm({zjddm: data,}).then(qlrRes => {
  229. let data = qlrRes.data;
  230. console.log(data)
  231. this.$set(this.circulation, 'sqrxm', data.shyqrdbxm);
  232. this.$set(this.circulation, 'sqrzjhm', data.shyqrdbzjhm);
  233. this.$set(this.circulation, 'sqrzjlx', data.shyqrdbzjlx);
  234. if(data.shyqrdbzjlx)
  235. {
  236. let val = this.zjlxDictionaries.find((x) => x.value == data.shyqrdbzjlx);
  237. if(val)
  238. this.zjlx = val.text;
  239. }
  240. this.$forceUpdate();
  241. });
  242. },*/
  243. onConfirmZjddm(data){
  244. console.log(data);
  245. this.showzjddm = false;
  246. if (data) {
  247. this.$set(this.circulation, 'zjddm', data.zjddm);
  248. this.$set(this.circulation, 'sqrzjhm', data.shyqrdbzjhm);
  249. this.$set(this.circulation, 'sqrzjlx', data.shyqrdbzjlx);
  250. if(data.shyqrdbzjlx)
  251. {
  252. let val = this.zjlxDictionaries.find((x) => x.value == data.shyqrdbzjlx);
  253. if(val)
  254. this.zjlx = val.text;
  255. }
  256. }
  257. // this.$forceUpdate();
  258. },
  259. onConfirmZjlx(data){
  260. this.zjlx = data.text;
  261. this.circulation.sqrzjlx = data.value;
  262. this.showzjlx = false;
  263. },
  264. onConfirmTcqllx(data){
  265. this.tcqllx = data.text;
  266. this.circulation.tcqllx = data.value;
  267. this.showtcqllx = false;
  268. },
  269. onConfirmTcfs(data){
  270. this.tcfs = data.text;
  271. this.circulation.tcfs = data.value;
  272. this.showtcfs = false;
  273. },
  274. onConfirmBcfs(data){
  275. this.bcfs = data.text;
  276. this.circulation.bcfs = data.value;
  277. this.showbcfs = false;
  278. },
  279. goSubmit(){
  280. console.log(this.circulation);
  281. this.$refs._Form.validate().then(() => {
  282. // 无偿退出申请不需要审批,保存成功之后默认就是审批通过状态,5 代表审批通过
  283. this.$set(this.circulation, "auditStatus", '5');
  284. dyAdd(this.circulation).then(response => {
  285. if(response.code = 200){
  286. this.$toast.success('保存成功');
  287. this.back();
  288. }
  289. })
  290. }).catch((e) => {
  291. Notify({ type: 'danger', message: '请填写完整的表单项' });
  292. });
  293. },
  294. back() {
  295. setTimeout(() => this.$router.back(-1), 1000)
  296. },
  297. remoteProposerMethod() {
  298. this.showzjddm = true;
  299. this.zjdDictionaries = [];
  300. if (this.circulation.sqrxm) {
  301. getObligeeList({shyqrdbxm:this.circulation.sqrxm}).then(response => {
  302. this.zjdDictionaries = response.data.map(item => {
  303. return {
  304. zjddm: item.zjddm,
  305. shyqrdbxm: item.shyqrdbxm,
  306. shyqrdbzjlx: item.shyqrdbzjlx,
  307. shyqrdbzjhm: item.shyqrdbzjhm
  308. }
  309. });
  310. });
  311. } else {
  312. this.zjdDictionaries = [];
  313. }
  314. },
  315. /** 模糊查询人员信息 */
  316. remoteTransfereeMethod(query) {
  317. if (query !== "") {
  318. obligeeList({shyqrdbxm:query,status:1}).then((response) => {
  319. if (response.code == 200) {
  320. this.getObligeeOptions = response.rows.map(item => item.shyqrdbxm);
  321. //设置模糊查询的下拉框和滚动条
  322. if (this.getObligeeOptions.length > 0) {
  323. this.showDropList = true; // div显示会阻挡下边的选择框和输入框,showDropList控制下拉框是否显示
  324. //设置模糊查询的和滚动条
  325. this.$nextTick(() => {
  326. if (this.getObligeeOptions.length > 4) {
  327. let height = document.getElementById("vanCell").offsetHeight * 4;
  328. document.getElementById("dropList").style.height = height + "px";
  329. document.getElementById("dropList").style.overflow = "scroll";
  330. } else {
  331. document.getElementById("dropList").style.height = "";
  332. document.getElementById("dropList").style.overflow = "visible";
  333. }
  334. });
  335. } else {
  336. this.showDropList = false;
  337. }
  338. }
  339. });
  340. } else {
  341. this.getObligeeOptions = [];
  342. this.showDropList = false;
  343. }
  344. },
  345. shyqrdmxmChange(val){
  346. this.$set(this.circulation, "sqrxm", val);
  347. this.getObligeeOptions=[];
  348. this.showDropList = false;
  349. }
  350. },
  351. }
  352. </script>
  353. <style scoped lang="scss">
  354. .app-container {
  355. padding: 2% 0;
  356. }
  357. .main_title{
  358. font-size: 0.4rem;
  359. color: #1D6FE9;
  360. margin: 0.2rem 6%;
  361. position: relative;
  362. }
  363. .main_box{
  364. width: 96%;
  365. margin: 0 auto;
  366. border-radius: 6px;
  367. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  368. overflow: hidden;
  369. background-color: #FFF;
  370. }
  371. .submitButton{
  372. width: 80%;
  373. margin: 0 auto;
  374. background-color: #1D6FE9;
  375. }
  376. #dropList::-webkit-scrollbar {
  377. /*滚动条整体样式*/
  378. width: 5px; /*高宽分别对应横竖滚动条的尺寸*/
  379. height: 1px;
  380. }
  381. #dropList::-webkit-scrollbar-thumb {
  382. /*滚动条里面小方块*/
  383. border-radius: 10px;
  384. background: #fff;
  385. box-shadow: inset 0 0 5px rgb(0, 122, 204);
  386. }
  387. #dropList::-webkit-scrollbar-track {
  388. border-radius: 10px;
  389. background: #fff;
  390. /*滚动条里面轨道*/
  391. box-shadow: inset 0 0 5px rgba( 0, 0, 0, .1);
  392. }
  393. </style>