housedetail.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424
  1. <template>
  2. <view class="check">
  3. <view class="cbox">
  4. <view class="chtop flexc">
  5. <view class="line"></view>
  6. <view>房屋信息</view>
  7. </view>
  8. <view class="chmain">
  9. <uni-forms ref="form" :model="datainfo" :rules="rules">
  10. <uni-forms-item label="房屋坐落" required name="location">
  11. <view class="flexc">
  12. <uni-easyinput :disabled="isdisabled" v-model="datainfo.location" :inputBorder='false' placeholder="" />
  13. <view class="rimg"></view>
  14. </view>
  15. </uni-forms-item>
  16. <uni-forms-item label="权利人姓名" name="ownerName">
  17. <view class="flexc">
  18. <uni-easyinput :disabled="isdisabled" v-model="datainfo.ownerName" :inputBorder='false' placeholder="" />
  19. <view class="rimg"></view>
  20. </view>
  21. </uni-forms-item>
  22. <uni-forms-item label="权利类型" name="rightType">
  23. <picker range-key='dictLabel' :disabled="isdisabled" :value="qllxidx" :range="qllxList" @change='bindDateChange'>
  24. <view class="flexc">
  25. <view class="flex1 txr f13 co27" v-if="datainfo.rightType&&!qllx">{{statusFormats(datainfo.rightType,qllxList,'qllx')}}</view>
  26. <view class="flex1 txr f13" v-else :class="qllx?'co27':'coa'">{{qllx||""}}</view>
  27. <view class="rimg"></view>
  28. <!-- <image :src="rimg"></image> -->
  29. </view>
  30. </picker>
  31. </uni-forms-item>
  32. <uni-forms-item label="建筑面积" required name="area">
  33. <view class="flexc">
  34. <uni-easyinput :disabled="isdisabled" v-model="datainfo.area" :inputBorder='false' placeholder="" />
  35. <view class="tips">m²</view>
  36. <view class="rimg"></view>
  37. </view>
  38. </uni-forms-item>
  39. <uni-forms-item label="不动产单元号" name="propertyUnitNumber">
  40. <view class="flexc">
  41. <uni-easyinput :disabled="isdisabled" v-model="datainfo.propertyUnitNumber" :inputBorder='false' placeholder="" />
  42. <view class="rimg"></view>
  43. </view>
  44. </uni-forms-item>
  45. <uni-forms-item label="相关的字第号" name="documentNumber">
  46. <view class="flexc">
  47. <uni-easyinput :disabled="isdisabled" v-model="datainfo.documentNumber" :inputBorder='false' placeholder="" />
  48. <view class="rimg"></view>
  49. </view>
  50. </uni-forms-item>
  51. <uni-forms-item label="小区名称" name="communityName">
  52. <view class="flexc">
  53. <uni-easyinput :disabled="isdisabled" v-model="datainfo.communityName" :inputBorder='false' placeholder="" />
  54. <view class="rimg"></view>
  55. </view>
  56. </uni-forms-item>
  57. <uni-forms-item label="门牌号" required name="detailedAddress">
  58. <view class="flexc">
  59. <uni-easyinput :disabled="isdisabled" v-model="datainfo.detailedAddress" :inputBorder='false' placeholder="" />
  60. <view class="rimg"></view>
  61. </view>
  62. </uni-forms-item>
  63. <uni-forms-item label="使用期限" name="usagePeriod">
  64. <view class="flexc">
  65. <uni-easyinput :disabled="isdisabled" v-model="datainfo.usagePeriod" :inputBorder='false' placeholder="" />
  66. <view class="rimg"></view>
  67. </view>
  68. </uni-forms-item>
  69. <uni-forms-item label="登记日期" name="registrationDate">
  70. <view class="flexc">
  71. <uni-datetime-picker :disabled="isdisabled" :class="datainfo.registrationDate?'co27':'coa'" type="datetime" placeholder=" " :border="false" v-model="datainfo.registrationDate" @change="changeLog" />
  72. <view class="rimg"></view>
  73. </view>
  74. </uni-forms-item>
  75. <uni-forms-item label="共有姓名" name="coOwner">
  76. <view class="flexc">
  77. <uni-easyinput :disabled="isdisabled" v-model="datainfo.coOwner" :inputBorder='false' placeholder="" />
  78. <view class="rimg"></view>
  79. </view>
  80. </uni-forms-item>
  81. <uni-forms-item label="共有情况" name="coOwnership">
  82. <view class="flexc">
  83. <uni-easyinput :disabled="isdisabled" v-model="datainfo.coOwnership" :inputBorder='false' placeholder="" />
  84. <view class="rimg"></view>
  85. </view>
  86. </uni-forms-item>
  87. <uni-forms-item label="房屋状态" name="houseStatus">
  88. <picker range-key='dictLabel' :disabled="isdisabled" :value="fwztidx" :range="fwztList" @change='bindDateChangeb'>
  89. <view class="flexc">
  90. <view class="flex1 txr f13 co27" v-if="datainfo.houseStatus&&!fwzt">{{statusFormats(datainfo.houseStatus,fwztList,'fwzt')}}</view>
  91. <view class="flex1 txr f13" v-else :class="fwzt?'co27':'coa'">{{fwzt||""}}</view>
  92. <view class="rimg"></view>
  93. </view>
  94. </picker>
  95. </uni-forms-item>
  96. <uni-forms-item label="房屋用途" name="usageType">
  97. <picker range-key='dictLabel' :disabled="isdisabled" :value="fwytidx" :range="fwytList" @change='bindDateChangec'>
  98. <view class="flexc">
  99. <view class="flex1 txr f13 co27" v-if="datainfo.usageType&&!fwyt">{{statusFormats(datainfo.usageType,fwytList,'fwyt')}}</view>
  100. <view class="flex1 txr f13" v-else :class="fwyt?'co27':'coa'">{{fwyt||""}}</view>
  101. <view class="rimg"></view>
  102. </view>
  103. </picker>
  104. </uni-forms-item>
  105. <uni-forms-item label="有无车位" name="hasParkingSpace">
  106. <picker range-key='dictLabel' :disabled="isdisabled" :value="ywcwidx" :range="ywcwList" @change='bindDateChanged'>
  107. <view class="flexc">
  108. <view class="flex1 txr f13 co27" v-if="datainfo.hasParkingSpace&&!ywcw">{{statusFormats(datainfo.hasParkingSpace,ywcwList,'ywcw')}}</view>
  109. <view class="flex1 txr f13" v-else :class="ywcw?'co27':'coa'">{{ywcw||""}}</view>
  110. <view class="rimg"></view>
  111. </view>
  112. </picker>
  113. </uni-forms-item>
  114. <uni-forms-item label="车位号" name="parkingNumber">
  115. <view class="flexc">
  116. <uni-easyinput :disabled="isdisabled" v-model="datainfo.parkingNumber" :inputBorder='false' placeholder="" />
  117. <view class="rimg"></view>
  118. </view>
  119. </uni-forms-item>
  120. </uni-forms>
  121. <view class="hfbtns flexcj">
  122. <view class="btn btn1" >拒绝</view>
  123. <view class="btn btn2" >通过</view>
  124. </view>
  125. </view>
  126. </view>
  127. <loading></loading>
  128. </view>
  129. </template>
  130. <script>
  131. import config from '@/config'
  132. import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
  133. import {uploadIdentify,selectValueKey,geocodeAddress} from '@/utils/common.js'
  134. import {getDictionaryFn} from "@/api/system/user.js"
  135. import {houseInfoAdd,houseInfoPut,houseInfoDet} from "@/api/work/work.js"
  136. export default{
  137. components:{},
  138. data(){
  139. return{
  140. rimg: require('@/mine/static/house/rimg.png'),
  141. cmico:require('@/mine/static/house/cmico.png'),
  142. baseUrl:config.baseUrl,
  143. datainfo:{
  144. // "houseId":"",//房屋信息主键
  145. "ownerName":"",//权利人姓名
  146. "location":"",//房屋坐落位置
  147. "rightType":"",//权利类型,如所有权、使用权等
  148. "area":"",//房屋面积,单位为平方米
  149. "documentNumber":"",//房屋相关的字第号
  150. "propertyUnitNumber":"",//不动产单元号
  151. "coOwnership":"",//房屋的共有情况,如共有比例等
  152. "usageType":"",//房屋用途,如住宅、商业等
  153. "usagePeriod":"",//房屋使用期限
  154. "registrationDate":"",//房屋登记日期
  155. "coOwner":"",//共有人姓名,多个共有人可以用逗号分隔
  156. "detailedAddress":"",//房屋的详细门牌号
  157. "hasParkingSpace":"",//是否有车位,Y表示有,N表示无
  158. "communityName":"",//房屋所在小区名称
  159. "houseStatus":"",//房屋状态:1-自住,2-出租,3-空闲,4-待售
  160. "parkingNumber":'',//车位号
  161. },
  162. rules: {
  163. location: {rules: [{required: true,errorMessage: '请输入房屋坐落位置' }]},
  164. detailedAddress: {rules: [{required: true,errorMessage: '请输入详细门牌号' }]},
  165. area: {rules: [{required: true,errorMessage: '请输入面积' }]},
  166. },
  167. id:'',
  168. ptype:'add',
  169. fwzt:'',
  170. qllx:'',
  171. fwyt:'',
  172. ywcw:'',
  173. fwztidx:'',
  174. qllxidx:'',
  175. fwytidx:'',
  176. ywcwidx:'',
  177. fwztList:[],
  178. qllxList:[],
  179. fwytList:[],
  180. ywcwList:[{dictLabel:'有',dictValue:'Y'},{dictLabel:'无',dictValue:'N'},],
  181. isdisabled:true,
  182. latitude:'',
  183. longitude:"",
  184. starttime:'',
  185. }
  186. },
  187. onLoad: function(e) {
  188. if(e.id){
  189. this.id=e.id;
  190. this.ptype="edit";
  191. // this.isdisabled=true;
  192. this.getDetail()
  193. }
  194. this.init()
  195. },
  196. methods:{
  197. checkPermi, checkRole,
  198. getEditFn(){
  199. this.isdisabled=false;
  200. },
  201. statusFormats(data, list,type) {
  202. var aite=selectValueKey(list, data);
  203. if(type=='qllx'){
  204. this.qllxidx=aite.key;
  205. }else if(type=='fwzt'){
  206. this.fwztidx=aite.key;
  207. }else if(type=='fwyt'){
  208. this.fwytidx=aite.key;
  209. }else if(type=='ywcw'){
  210. this.ywcwidx=aite.key;
  211. }
  212. return aite.actions;
  213. },
  214. init(){
  215. // 房屋状态
  216. getDictionaryFn('house_status').then(res=>{
  217. if(res.code==200){
  218. this.fwztList = res.data.map(v => {
  219. return {
  220. dictLabel: v.dictLabel,
  221. dictValue: v.dictValue
  222. }
  223. })
  224. }
  225. })
  226. //权利类型
  227. getDictionaryFn('types_rights').then(res=>{
  228. if(res.code==200){
  229. this.qllxList = res.data.map(v => {
  230. return {
  231. dictLabel: v.dictLabel,
  232. dictValue: v.dictValue
  233. }
  234. })
  235. }
  236. })
  237. //房屋用途
  238. getDictionaryFn('use_remises').then(res=>{
  239. if(res.code==200){
  240. this.fwytList = res.data.map(v => {
  241. return {
  242. dictLabel: v.dictLabel,
  243. dictValue: v.dictValue
  244. }
  245. })
  246. }
  247. })
  248. },
  249. bindDateChange(e){
  250. var val=e.detail.value;
  251. this.datainfo.rightType=this.qllxList[val].dictValue;
  252. this.qllx=this.qllxList[val].dictLabel;
  253. },
  254. bindDateChangea(e){
  255. var val=e.detail.value;
  256. this.datainfo.registrationDate=val;
  257. },
  258. bindDateChangeb(e){
  259. var val=e.detail.value;
  260. this.datainfo.houseStatus=this.fwztList[val].dictValue;
  261. this.fwzt=this.fwztList[val].dictLabel;
  262. },
  263. bindDateChangec(e){
  264. var val=e.detail.value;
  265. this.datainfo.usageType=this.fwytList[val].dictValue;
  266. this.fwyt=this.fwytList[val].dictLabel;
  267. },
  268. bindDateChanged(e){
  269. var val=e.detail.value;
  270. this.datainfo.hasParkingSpace=this.ywcwList[val].dictValue;
  271. this.ywcw=this.ywcwList[val].dictLabel;
  272. },
  273. getDetail(){
  274. houseInfoDet(this.id).then(res=>{
  275. if(res.code==200){
  276. this.datainfo=res.data;
  277. }
  278. })
  279. },
  280. getSubmit(){
  281. this.$refs.form.validate().then(res => {
  282. var params=JSON.parse(JSON.stringify(this.datainfo))
  283. // if(!params.portalId){
  284. // this.$toast("请选择来访门户")
  285. // return
  286. // }
  287. // if(params.isCar=='Y'&&!params.plateNumber){
  288. // this.$toast("请输入车牌号")
  289. // return
  290. // }
  291. // if(!params.visitorTime){
  292. // this.$toast("请选择来访时间")
  293. // return
  294. // }
  295. if(this.ptype=='add'){
  296. houseInfoAdd(params).then(res=>{
  297. if(res.code==200){
  298. this.$toast("新增成功")
  299. setTimeout(function(){
  300. uni.$emit("refHouseList")
  301. uni.navigateBack({
  302. delta:1
  303. })
  304. },1500)
  305. }
  306. })
  307. }else{
  308. houseInfoPut(params).then(res=>{
  309. if(res.code==200){
  310. this.$toast("修改成功")
  311. setTimeout(function(){
  312. uni.$emit("refHouseList")
  313. uni.navigateBack({
  314. delta:1
  315. })
  316. },1500)
  317. }
  318. })
  319. }
  320. })
  321. },
  322. getaddImage(e){
  323. let that = this;
  324. let file =[],count=9
  325. uni.chooseImage({
  326. count: 1,
  327. success:function(res){
  328. let img= res.tempFilePaths;
  329. if(img.length + file.length > count){
  330. uni.showToast({
  331. title: '最多上传'+count+'张图片',
  332. icon: 'none',
  333. duration: 2000
  334. })
  335. }else{
  336. let imglen = res.tempFilePaths.length;
  337. var fuwufile = [];
  338. uploadIdentify('/common/upload',img,0,0,0,imglen,fuwufile,function(rs){
  339. // var resurl=rs[0];
  340. // if(e=='front'){
  341. // that.datainfo.front=resurl.fileName;
  342. // }else{
  343. // that.datainfo.back=resurl.fileName;
  344. // }
  345. // if(rs&&rs.length>0){
  346. // var obj={
  347. // type:e,
  348. // url:resurl.urlOnline
  349. // }
  350. // that.getOcrIdCard(obj)
  351. // }
  352. })
  353. }
  354. }
  355. });
  356. },
  357. getOcrIdCard(obj){
  358. var params={
  359. image:obj.url,
  360. idCardSide:obj.type
  361. }
  362. getOcrIdCard(params).then(res=>{
  363. if(res.code==200){
  364. var datainfo=res.data;
  365. if(obj.type=='front'){
  366. this.datainfo.realName=datainfo.realName;
  367. this.datainfo.idCard=datainfo.idCard;
  368. this.datainfo.address=datainfo.address;
  369. }else{
  370. this.datainfo.expirationDate=datainfo.expirationDate
  371. }
  372. }
  373. })
  374. },
  375. }
  376. }
  377. </script>
  378. <style>
  379. page{background: #F3F3F0;}
  380. </style>
  381. <style lang="scss" scoped>
  382. .coa /deep/ .uni-date__x-input{text-align: right;color: #AAAAAA;}
  383. .check /deep/ .uni-date-editor--x__disabled{opacity: 1;}
  384. .check /deep/ .uni-forms-item{min-height: 106rpx;box-sizing: border-box;display: flex;align-items: center;margin-bottom: 0;border-bottom: 2rpx solid #E6E6E6;padding:10rpx 0;}
  385. .check /deep/ .uni-forms-item__label{font-weight: bold;font-size: 26rpx;color: #222327;flex: 0 0 auto;width: auto !important;}
  386. .check /deep/ .uni-easyinput{flex: 1;text-align: right;font-size: 26rpx;color: #222327;}
  387. .check /deep/ .uni-easyinput__content-textarea{min-height: 40rpx;font-size: 26rpx;}
  388. .check /deep/ .uni-easyinput__placeholder-class{font-size: 26rpx;color: #AAAAAA;}
  389. .check /deep/ .uni-input-input{font-size: 26rpx;}
  390. .check /deep/ .uni-textarea-textarea{font-size: 26rpx;}
  391. .check /deep/ .uni-forms-item__label text{width: 110rpx;text-align-last: justify;}
  392. .check /deep/ .uni-forms-item__label .is-required{width: auto;}
  393. .check /deep/ .is-disabled{color: #222327;background-color: #ffffff !important;}
  394. .check{min-height: 100vh;padding: 20rpx 18rpx 22rpx;box-sizing: border-box;display: flex;box-sizing: border-box;}
  395. .cbox{background: #FFFFFF;border-radius: 20rpx;flex: 1;padding-bottom: 28rpx;
  396. .chtop{padding-top: 32rpx;margin-bottom: 22rpx;
  397. .line{width: 14rpx;height: 48rpx;background: #0256FD;border-radius:0 12rpx 12rpx 0;margin-right: 18rpx;}
  398. view{font-weight: bold;font-size: 32rpx;color: #272727;}
  399. }
  400. .chmain{
  401. padding: 0 32rpx;
  402. .upbox{height: 224rpx;background: #EFF4FF;border-radius: 20rpx;display: flex;align-items: center;justify-content: center;flex-direction: column;margin-bottom: 8rpx;overflow: auto;
  403. .img{width: 100%;height: 100%;}
  404. .addimg{width: 90rpx;height: 90rpx;margin-bottom: 8rpx;}
  405. view{font-weight: bold;font-size: 26rpx;color: #4C6686;}
  406. }
  407. }
  408. .rimg{width: 16rpx;height: 28rpx;flex: 0 0 auto;margin-left: 20rpx;
  409. image{width: 100%;height: 100%;}
  410. }
  411. }
  412. .tips{font-weight: bold;color: #272727;font-size: 26rpx;margin-left: 8rpx;}
  413. .hfbtns{margin-top: 140rpx;
  414. .btn{height: 88rpx;background: #FFF8F8;border-radius: 20rpx;width: 316rpx;display: flex;align-items: center;justify-content: center;font-weight: bold;
  415. font-size: 26rpx;box-sizing: border-box;
  416. &.btn1{border: 2rpx solid #FF6969;background: #FFF8F8;color: #FF6969;}
  417. &.btn2{background: #0256FD;color: #ffffff;}
  418. }
  419. }
  420. </style>