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

472 lines
15 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. <div class="main_box">
  14. <van-field
  15. readonly
  16. clickable
  17. name="picker"
  18. v-model="circulation.nmfwdm"
  19. label="农民房屋代码"
  20. placeholder="请选择"
  21. @click="showzjddm = true"
  22. input-align="right"
  23. right-icon="arrow-down"
  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. name="picker"
  37. v-model="fwzt"
  38. label="房屋状态"
  39. placeholder="请选择"
  40. @click="showfwzt = true"
  41. input-align="right"
  42. right-icon="arrow-down"
  43. label-width="auto"
  44. />
  45. <van-popup v-model="showfwzt" position="bottom">
  46. <van-picker
  47. show-toolbar
  48. :columns="fwztDictionaries"
  49. @confirm="onConfirmFwzt"
  50. @cancel="showfwzt = false"
  51. />
  52. </van-popup>
  53. <van-field
  54. readonly
  55. clickable
  56. name="picker"
  57. v-model="fwaqxjddj"
  58. label="房屋安全性鉴定等级"
  59. placeholder="请选择"
  60. @click="showfwaqxjddj = true"
  61. input-align="right"
  62. right-icon="arrow-down"
  63. label-width="auto"
  64. />
  65. <van-popup v-model="showfwaqxjddj" position="bottom">
  66. <van-picker
  67. show-toolbar
  68. :columns="fwaqxjddjDictionaries"
  69. @confirm="onConfirmFwaqxjddj"
  70. @cancel="showfwaqxjddj = false"
  71. />
  72. </van-popup>
  73. <van-field
  74. readonly
  75. clickable
  76. name="picker"
  77. v-model="lyzk"
  78. label="利用状况"
  79. placeholder="请选择"
  80. @click="showlyzk = true"
  81. input-align="right"
  82. right-icon="arrow-down"
  83. label-width="auto"
  84. />
  85. <van-popup v-model="showlyzk" position="bottom">
  86. <van-picker
  87. show-toolbar
  88. :columns="lyzkDictionaries"
  89. @confirm="onConfirmLyzk"
  90. @cancel="showlyzk = false"
  91. />
  92. </van-popup>
  93. <van-field
  94. readonly
  95. clickable
  96. name="picker"
  97. v-model="fwsfxz"
  98. label="房屋是否闲置"
  99. placeholder="请选择"
  100. @click="showfwsfxz = true"
  101. input-align="right"
  102. right-icon="arrow-down"
  103. label-width="auto"
  104. />
  105. <van-popup v-model="showfwsfxz" position="bottom">
  106. <van-picker
  107. show-toolbar
  108. :columns="fwsfxzDictionaries"
  109. @confirm="onConfirmFwsfxz"
  110. @cancel="showfwsfxz = false"
  111. />
  112. </van-popup>
  113. <van-field v-model="circulation.fwxzyy" label="闲置原因" placeholder="闲置原因" input-align="right" label-width="auto"/>
  114. <van-field
  115. readonly
  116. clickable
  117. name="picker"
  118. v-model="circulation.fwxzqssj"
  119. label="房屋闲置起始时间"
  120. placeholder="房屋闲置起始时间"
  121. @click="showfwxzqssj = true"
  122. input-align="right"
  123. right-icon="arrow-down"
  124. label-width="auto"
  125. />
  126. <van-popup v-model="showfwxzqssj" position="bottom">
  127. <van-datetime-picker
  128. v-model="currentDate"
  129. type="date"
  130. title="选择年月日"
  131. :min-date="minDate"
  132. :max-date="maxDate"
  133. @confirm="onConfirmFwxzqssj"
  134. />
  135. </van-popup>
  136. <van-field
  137. readonly
  138. clickable
  139. name="picker"
  140. v-model="phlyms"
  141. label="盘活利用模式"
  142. placeholder="请选择"
  143. @click="showphlyms = true"
  144. input-align="right"
  145. right-icon="arrow-down"
  146. label-width="auto"
  147. />
  148. <van-popup v-model="showphlyms" position="bottom">
  149. <van-picker
  150. show-toolbar
  151. :columns="phlymsDictionaries"
  152. @confirm="onConfirmPhlyms"
  153. @cancel="showphlyms = false"
  154. />
  155. </van-popup>
  156. <van-field
  157. readonly
  158. clickable
  159. name="picker"
  160. v-model="circulation.dcsj"
  161. label="调查时间"
  162. placeholder="选择调查时间"
  163. @click="showdcsj = true"
  164. input-align="right"
  165. right-icon="arrow-down"
  166. />
  167. <van-popup v-model="showdcsj" position="bottom">
  168. <van-datetime-picker
  169. v-model="currentDate"
  170. type="date"
  171. title="选择年月日"
  172. :min-date="minDate"
  173. :max-date="maxDate"
  174. @confirm="onConfirmDcsj"
  175. />
  176. </van-popup>
  177. <van-field v-model="circulation.nsy" label="年收益" placeholder="年收益" input-align="right" label-width="auto"/>
  178. </div>
  179. <p class="main_title">照片信息</p>
  180. <div class="main_box" style="padding: 5%;">
  181. <van-row>
  182. <van-col span="12">
  183. <p style="margin-bottom: 5%;color: #333333;font-size: 14px;">现场照片东</p>
  184. <van-uploader v-model="findListD" max-count="1" :before-delete="deleteFileD"/>
  185. </van-col>
  186. <van-col span="12">
  187. <p style="margin-bottom: 5%;color: #333333;font-size: 14px;">现场照片南</p>
  188. <van-uploader v-model="findListN" max-count="1" :before-delete="deleteFileX" />
  189. </van-col>
  190. </van-row>
  191. <van-row>
  192. <van-col span="12">
  193. <p style="margin-bottom: 5%;color: #333333;font-size: 14px;">现场照片西</p>
  194. <van-uploader v-model="findListX" max-count="1" :before-delete="deleteFileN" />
  195. </van-col>
  196. <van-col span="12">
  197. <p style="margin-bottom: 5%;color: #333333;font-size: 14px;">现场照片北</p>
  198. <van-uploader v-model="findListB" max-count="1" :before-delete="deleteFileB" />
  199. </van-col>
  200. </van-row>
  201. </div>
  202. <p class="main_title">补偿信息</p>
  203. <div class="main_box">
  204. <van-field v-model="circulation.bz" label="备注" type="textarea" placeholder="请输入内容" input-align="right" label-width="auto"/>
  205. </div>
  206. <div style="padding: 16px 0;">
  207. <van-row>
  208. <van-col span="12" align="center">
  209. <van-button type="info" color="#B4B0B0" native-type="submit" class="submitButton">关闭</van-button>
  210. </van-col>
  211. <van-col span="12" align="center">
  212. <van-button type="info" native-type="submit" class="submitButton" @click="goSubmit">保存</van-button>
  213. </van-col>
  214. </van-row>
  215. <div class="clear"></div>
  216. </div>
  217. </div>
  218. </template>
  219. <script>
  220. import { zjdzd } from "@/api/onlineHome/homestead/circulation";
  221. import { getZjdly , nmfwlyEdit , upload} from "@/api/onlineHome/homestead/utilization";
  222. export default {
  223. name: "utilizationModify",
  224. data() {
  225. return {
  226. minDate: new Date(),
  227. maxDate: new Date(2025, 10, 1),
  228. currentDate: new Date(),
  229. findListD:[],
  230. findListN:[],
  231. findListX:[],
  232. findListB:[],
  233. phlyms : '',
  234. fwsfxz : '',
  235. lyzk : '',
  236. fwaqxjddj : '',
  237. fwzt: '',
  238. showzjddm:false,
  239. showphlyms:false,
  240. showfwsfxz:false,
  241. showlyzk:false,
  242. showfwaqxjddj:false,
  243. showfwzt:false,
  244. showdcsj: false,
  245. showfwxzqssj: false,
  246. phlymsDictionaries: [],
  247. fwsfxzDictionaries: [],
  248. lyzkDictionaries: [],
  249. fwaqxjddjDictionaries: [],
  250. fwztDictionaries: [],
  251. zjdDictionaries: [],
  252. circulation: {}
  253. };
  254. },
  255. created() {
  256. this.getDetail();
  257. },
  258. methods: {
  259. getDetail(){
  260. getZjdly(this.$route.query.id).then(response => {
  261. console.log(response)
  262. //退出权利类型
  263. this.houseGetDicts("fwzt").then((res) => {
  264. for(var i = 0 ; i < res.data.length ; i++){
  265. this.fwztDictionaries.push({text:res.data[i].dictLabel,value:res.data[i].dictValue});
  266. }
  267. this.fwzt = this.selectDictLabel(res.data, response.data.fwzt);
  268. });
  269. this.houseGetDicts("fwaqxjddj").then((res) => {
  270. for(var i = 0 ; i < res.data.length ; i++){
  271. this.fwaqxjddjDictionaries.push({text:res.data[i].dictLabel,value:res.data[i].dictValue});
  272. }
  273. this.fwaqxjddj = this.selectDictLabel(res.data, response.data.fwaqxjddj);
  274. });
  275. this.houseGetDicts("nmfwlyzk").then((res) => {
  276. for(var i = 0 ; i < res.data.length ; i++){
  277. this.lyzkDictionaries.push({text:res.data[i].dictLabel,value:res.data[i].dictValue});
  278. }
  279. this.lyzk = this.selectDictLabel(res.data, response.data.lyzk);
  280. });
  281. this.houseGetDicts("sys_yes_no").then((res) => {
  282. for(var i = 0 ; i < res.data.length ; i++){
  283. this.fwsfxzDictionaries.push({text:res.data[i].dictLabel,value:res.data[i].dictValue});
  284. }
  285. this.fwsfxz = this.selectDictLabel(res.data, response.data.fwsfxz);
  286. });
  287. this.houseGetDicts("phlyms").then((res) => {
  288. for(var i = 0 ; i < res.data.length ; i++){
  289. this.phlymsDictionaries.push({text:res.data[i].dictLabel,value:res.data[i].dictValue});
  290. }
  291. this.phlyms = this.selectDictLabel(res.data, response.data.phlyms);
  292. });
  293. //宅基地代码
  294. zjdzd().then(zjdRes => {
  295. for( let i = 0 ; i < zjdRes.rows.length ; i++){
  296. this.zjdDictionaries.push(zjdRes.rows[i].zjddm);
  297. }
  298. });
  299. this.circulation = response.data;
  300. if(response.data.xczpd != null){this.findListD.push({url:'http://192.168.31.26:8080'+ response.data.xczpd, isImage: true});}
  301. if(response.data.xczpx != null){this.findListX.push({url:'http://192.168.31.26:8080'+ response.data.xczpx, isImage: true});}
  302. if(response.data.xczpn != null){this.findListN.push({url:'http://192.168.31.26:8080'+ response.data.xczpn, isImage: true});}
  303. if(response.data.xczpb != null){this.findListB.push({url:'http://192.168.31.26:8080'+ response.data.xczpb, isImage: true});}
  304. });
  305. },
  306. onConfirmZjddm(data){
  307. console.log(data)
  308. this.circulation.nmfwdm = data;
  309. this.showzjddm = false;
  310. },
  311. onConfirmPhlyms(data){
  312. this.phlyms = data.text;
  313. this.circulation.phlyms = data.value;
  314. this.showphlyms = false;
  315. },
  316. onConfirmFwsfxz(data){
  317. this.fwsfxz = data.text;
  318. this.circulation.fwsfxz = data.value;
  319. this.showfwsfxz = false;
  320. },
  321. onConfirmLyzk(data){
  322. this.lyzk = data.text;
  323. this.circulation.lyzk = data.value;
  324. this.showlyzk = false;
  325. },
  326. onConfirmFwaqxjddj(data){
  327. this.fwaqxjddj = data.text;
  328. this.circulation.fwaqxjddj = data.value;
  329. this.showfwaqxjddj = false;
  330. },
  331. onConfirmFwzt(data){
  332. this.fwzt = data.text;
  333. this.circulation.fwzt = data.value;
  334. this.showfwzt = false;
  335. },
  336. onConfirmFwxzqssj(data){
  337. this.circulation.fwxzqssj = this.getNowFormatDate(data).substr(0,10);;
  338. this.showfwxzqssj = false;
  339. },
  340. onConfirmDcsj(data){
  341. this.circulation.dcsj = this.getNowFormatDate(data).substr(0,10);;
  342. this.showdcsj = false;
  343. },
  344. base64toFile(dataurl, filename = "file") {
  345. let arr = dataurl.split(",");
  346. let mime = arr[0].match(/:(.*?);/)[1];
  347. let suffix = mime.split("/")[1];
  348. let bstr = atob(arr[1]);
  349. let n = bstr.length;
  350. let u8arr = new Uint8Array(n);
  351. while (n--) {
  352. u8arr[n] = bstr.charCodeAt(n);
  353. }
  354. return new File([u8arr], `${filename}.${suffix}`, {
  355. type: mime,
  356. });
  357. },
  358. goSubmit(){
  359. if(this.findListD != '' && this.findListD[0].content != undefined){
  360. console.log('1111')
  361. const params = new FormData()
  362. params.append('file', this.base64toFile(this.findListD[0].content))
  363. upload(params).then(res => {
  364. this.circulation.xczpd = res.fileName;
  365. });
  366. }
  367. if(this.findListX != '' && this.findListX[0].content != undefined){
  368. console.log('2222')
  369. const params = new FormData()
  370. params.append('file', this.base64toFile(this.findListX[0].content))
  371. upload(params).then(res => {
  372. this.circulation.xczpx = res.fileName;
  373. });
  374. }
  375. if( this.findListN != '' && this.findListN[0].content != undefined){
  376. console.log('3333')
  377. const params = new FormData()
  378. params.append('file', this.base64toFile(this.findListN[0].content))
  379. upload(params).then(res => {
  380. this.circulation.xczpn = res.fileName;
  381. });
  382. }
  383. if( this.findListB != '' && this.findListB[0].content != undefined){
  384. console.log('4444')
  385. const params = new FormData()
  386. params.append('file', this.base64toFile(this.findListB[0].content))
  387. upload(params).then(res => {
  388. this.circulation.xczpb = res.fileName;
  389. });
  390. }
  391. var that = this ;
  392. setTimeout(function(){
  393. console.log(that.circulation);
  394. nmfwlyEdit(that.circulation).then(response => {
  395. if(response.code = 200){
  396. that.$toast.success('保存成功');
  397. }
  398. });
  399. },2000);
  400. },
  401. deleteFileD(elIndex){
  402. this.circulation.xczpd = null ;
  403. this.findListD = [];
  404. console.log()
  405. return (file, name) => {
  406. let fileIndex = name.index
  407. this.findListD[elIndex].splice(fileIndex, 1)
  408. }
  409. },
  410. deleteFileX(elIndex){
  411. this.circulation.xczpx = null ;
  412. this.findListX = [];
  413. return (file, name) => {
  414. let fileIndex = name.index
  415. this.findListX[elIndex].splice(fileIndex, 1)
  416. }
  417. },
  418. deleteFileN(elIndex){
  419. this.circulation.xczpn = null ;
  420. this.findListN = [];
  421. return (file, name) => {
  422. let fileIndex = name.index
  423. this.findListN[elIndex].splice(fileIndex, 1)
  424. }
  425. },
  426. deleteFileB(elIndex){
  427. this.circulation.xczpb = null ;
  428. this.findListB = [];
  429. return (file, name) => {
  430. let fileIndex = name.index
  431. this.findListB[elIndex].splice(fileIndex, 1)
  432. }
  433. },
  434. },
  435. }
  436. </script>
  437. <style scoped lang="scss">
  438. .app-container {
  439. padding: 2% 0;
  440. }
  441. .main_title{
  442. font-size: 0.4rem;
  443. color: #1D6FE9;
  444. margin: 0.2rem 6%;
  445. position: relative;
  446. }
  447. .main_box{
  448. width: 96%;
  449. margin: 0 auto;
  450. border-radius: 6px;
  451. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  452. overflow: hidden;
  453. background-color: #FFF;
  454. }
  455. .submitButton{
  456. width: 80%;
  457. margin: 0 auto;
  458. background-color: #1D6FE9;
  459. }
  460. </style>