authenadd.vue 38 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033
  1. <template>
  2. <view class="check">
  3. <uni-forms ref="form" :model="datainfo" :rules="rules">
  4. <view class="cbox">
  5. <view class="chmain">
  6. <picker range-key='dictLabel' :disabled="ptype=='edit'&&datainfo.examine!='3'?true:false" :value="rylxidx" :range="rylxList" @change='bindDateChangee'>
  7. <uni-forms-item label="人员类型" required name="residentType">
  8. <view class="flexc mh35">
  9. <view class="flex1 txr f13 co27" v-if="datainfo.residentType&&!rylx">{{statusFormats(datainfo.residentType,rylxList,'rylx')}}</view>
  10. <view class="flex1 txr f13" v-else :class="rylx?'co27':'coa'">{{rylx||"请选择人员类型"}}</view>
  11. <view class="rimg"><image :src="rimg"></image></view>
  12. </view>
  13. </uni-forms-item>
  14. </picker>
  15. <uni-forms-item label="姓名" name="residentName">
  16. <view class="flexc">
  17. <uni-easyinput :disabled="isdisabled" v-model="datainfo.residentName" :inputBorder='false' placeholder="请输入姓名" />
  18. </view>
  19. </uni-forms-item>
  20. <uni-forms-item label="手机号码" required name="residentPhone">
  21. <view class="flexc">
  22. <uni-easyinput :disabled="isdisabled" v-model="datainfo.residentPhone" :inputBorder='false' placeholder="请输入手机号码" />
  23. </view>
  24. </uni-forms-item>
  25. <uni-forms-item label="小区名称" required name="tenantId">
  26. <w-select
  27. style="margin-left: 20rpx;"
  28. v-model="datainfo.tenantId"
  29. :list='voList'
  30. width='200rpx'
  31. valueName='dictLabel'
  32. keyName="dictValue"
  33. :valuea="datainfo.tenantId"
  34. :chosevalue="tenantName?tenantName:statusFormats(datainfo.tenantId,voList,'tenant')"
  35. :isdisabled="(ptype=='edit'&&datainfo.examine!='3')?true:false"
  36. :filterable="filterable"
  37. @change='getchangea'
  38. >
  39. </w-select>
  40. </uni-forms-item>
  41. <block v-if="datainfo.residentType&&datainfo.residentType!=3">
  42. <uni-forms-item label="房屋号" required name="houseId" v-if="datainfo.residentType!=3">
  43. <w-select
  44. style="margin-left: 20rpx;"
  45. v-model="datainfo.houseId"
  46. :list='fwlist'
  47. valueName='dictLabel'
  48. keyName="dictValue"
  49. :valuea="datainfo.houseId"
  50. :chosevalue="datainfo.detailedAddress"
  51. :filterable='filterable'
  52. @change='getchange'
  53. >
  54. </w-select>
  55. </uni-forms-item>
  56. <block v-if="datainfo.residentType==1">
  57. <uni-forms-item label="是否户主" required name="isHouseholder">
  58. <view class="flexc ">
  59. <view class="flex1"></view>
  60. <view class="sylist flexcc" :class="datainfo.isHouseholder==ite.dictValue?'act':''" v-for="(ite,idx) in sfList" :key="idx" @click="getSyFn(ite.dictValue)">{{ite.dictLabel}}</view>
  61. <view class="rimg"><image :src="rimg"></image></view>
  62. </view>
  63. </uni-forms-item>
  64. <block v-if="datainfo.isHouseholder!='Y'">
  65. <picker range-key='dictLabel' :disabled="isdisabled" :value="hzgxidx" :range="hzgxList" @change='bindDateChangea'>
  66. <uni-forms-item class="isnobor" label="与户主关系" required name="residentRelationship">
  67. <view class="flexc mh35">
  68. <view class="flex1 txr f13 co27" v-if="datainfo.residentRelationship&&!hzgx">{{statusFormats(datainfo.residentRelationship,hzgxList,'hzgx')}}</view>
  69. <view class="flex1 txr f13" v-else :class="hzgx?'co27':'coa'">{{hzgx||"请选择与户主关系"}}</view>
  70. <view class="rimg"><image :src="rimg"></image></view>
  71. </view>
  72. </uni-forms-item>
  73. </picker>
  74. </block>
  75. </block>
  76. </block>
  77. </view>
  78. <uni-collapse ref="collapse" >
  79. <block>
  80. <view class="chtit">人员信息</view>
  81. <block>
  82. <uni-collapse-item title-border="none" class="chmain">
  83. <template v-slot:title>
  84. <uni-forms-item label="身份证号" required name="residentIdCard">
  85. <view class="flexc">
  86. <uni-easyinput disabled v-model="datainfo.residentIdCard" :inputBorder='false' placeholder="自动识别" />
  87. <image v-if='datainfo.idCardBack' :src="baseUrl+datainfo.idCardBack" class="cmico" @click.stop="getPreview(datainfo.idCardBack)"></image>
  88. <image :src="cmico" @click.stop="getaddImage('front')" class="cmico"></image>
  89. </view>
  90. </uni-forms-item>
  91. </template>
  92. <view>
  93. <uni-forms-item label="性别" required name="residentGender">
  94. <view class="flexc">
  95. <view class="flex1"></view>
  96. <uni-data-checkbox :map="map" :disabled="isdisabled" selectedColor="#0156FE" selectedTextColor="#272727" v-model="datainfo.residentGender" :localdata="xbList" />
  97. </view>
  98. </uni-forms-item>
  99. <uni-forms-item label="家庭地址" required name="idCardAddress">
  100. <view class="flexc">
  101. <uni-easyinput disabled v-model="datainfo.idCardAddress" :inputBorder='false' placeholder="自动识别" />
  102. </view>
  103. </uni-forms-item>
  104. <!-- required -->
  105. <picker range-key='dictLabel' :disabled="isdisabled" :value="rymmidx" :range="rymmList" @change='bindDateChangef'>
  106. <uni-forms-item label="人员面貌" name="residentAppearance">
  107. <view class="flexc mh35">
  108. <view class="flex1 txr f13 co27" v-if="datainfo.residentAppearance&&!rymm">{{statusFormats(datainfo.residentAppearance,rymmList,'rymm')}}</view>
  109. <view class="flex1 txr f13" v-else :class="rymm?'co27':'coa'">{{rymm||"请选择人员面貌"}}</view>
  110. <view class="rimg"><image :src="rimg"></image></view>
  111. </view>
  112. </uni-forms-item>
  113. </picker>
  114. <picker range-key='dictLabel' :disabled="isdisabled" :value="dslxidx" :range="dslxList" @change='bindDateChangeg'>
  115. <uni-forms-item label="特殊类型" name="specialType">
  116. <view class="flexc mh35">
  117. <view class="flex1 txr f13 co27" v-if="datainfo.specialType&&!dslx">{{statusFormats(datainfo.specialType,dslxList,'dslx')}}</view>
  118. <view class="flex1 txr f13" v-else :class="dslx?'co27':'coa'">{{dslx||"如有五保户等特殊类型,请选择"}}</view>
  119. <view class="rimg"><image :src="rimg"></image></view>
  120. </view>
  121. </uni-forms-item>
  122. </picker>
  123. <uni-forms-item label="工作单位" name="residentEmployer">
  124. <view class="flexc">
  125. <uni-easyinput :disabled="isdisabled" v-model="datainfo.residentEmployer" :inputBorder='false' placeholder="请输入工作单位" />
  126. </view>
  127. </uni-forms-item>
  128. <uni-forms-item label="兴趣爱好" name="residentHobby">
  129. <view class="flexc ml10">
  130. <uni-easyinput type="textarea" :disabled="isdisabled" autoHeight v-model="datainfo.residentHobby" :inputBorder='false' placeholder="请输入兴趣爱好" />
  131. </view>
  132. </uni-forms-item>
  133. <uni-forms-item label="上传头像" name="facePhoto">
  134. <view class="addimgs">
  135. <block v-if="phofile&&phofile.length">
  136. <view class="assimg" v-for="(ite,idx) in phofile" :key="idx" @click="getPreviewa(idx,phofile)">
  137. <image :src="baseUrl+ite" class="img"></image>
  138. <image :src="rdelimg" class="delimg" @click.stop="getDelFn(idx,'fm')"></image>
  139. </view>
  140. </block>
  141. <view class="addbox" @click="getaddImageava">
  142. <image :src="aphoto"></image>
  143. <view>添加图片</view>
  144. </view>
  145. </view>
  146. </uni-forms-item>
  147. </view>
  148. </uni-collapse-item>
  149. </block>
  150. </block>
  151. <block v-if="datainfo.residentType==1&&datainfo.isHouseholder=='Y'">
  152. <view class="chtit">房本信息</view>
  153. <block>
  154. <uni-collapse-item title-border="none" class="chmain">
  155. <template v-slot:title>
  156. <uni-forms-item label="房屋坐落" required name="location">
  157. <view class="flexc">
  158. <uni-easyinput :disabled="isdisabled" v-model="houserinfo.location" :inputBorder='false' placeholder="自动识别" />
  159. <image v-if='houserinfo.houseImage' :src="baseUrl+houserinfo.houseImage" class="cmico" @click.stop="getPreview(houserinfo.houseImage)"></image>
  160. <image :src="cmico" @click.stop="getaddImage('fbxx')" class="cmico"></image>
  161. </view>
  162. </uni-forms-item>
  163. </template>
  164. <view >
  165. <uni-forms-item label="权利人姓名" name="ownerName">
  166. <view class="flexc">
  167. <uni-easyinput :disabled="isdisabled" v-model="houserinfo.ownerName" :inputBorder='false' placeholder="自动识别" />
  168. <view class="rimg"></view>
  169. </view>
  170. </uni-forms-item>
  171. <uni-forms-item label="权利类型" name="rightType">
  172. <picker range-key='dictLabel' :disabled="isdisabled" :value="qllxidx" :range="qllxList" @change='bindDateChange'>
  173. <view class="flexc">
  174. <view class="flex1 txr f13 co27" v-if="houserinfo.rightType&&!qllx">{{statusFormats(houserinfo.rightType,qllxList,'qllx')}}</view>
  175. <view class="flex1 txr f13" v-else :class="qllx?'co27':'coa'">{{qllx||"请选择权利类型"}}</view>
  176. <view class="rimg"><image :src="rimg"></image></view>
  177. </view>
  178. </picker>
  179. </uni-forms-item>
  180. <uni-forms-item label="建筑面积" required name="area">
  181. <view class="flexc">
  182. <uni-easyinput :disabled="isdisabled" v-model="houserinfo.area" :inputBorder='false' placeholder="自动识别" />
  183. <view class="tips">m²</view>
  184. <view class="rimg"></view>
  185. </view>
  186. </uni-forms-item>
  187. <uni-forms-item label="不动产单元号" name="propertyUnitNumber">
  188. <view class="flexc">
  189. <uni-easyinput :disabled="isdisabled" v-model="houserinfo.propertyUnitNumber" :inputBorder='false' placeholder="请输入不动产单元号" />
  190. <view class="rimg"></view>
  191. </view>
  192. </uni-forms-item>
  193. <uni-forms-item label="相关的字第号" name="documentNumber">
  194. <view class="flexc">
  195. <uni-easyinput :disabled="isdisabled" v-model="houserinfo.documentNumber" :inputBorder='false' placeholder="请输入相关的字第号" />
  196. <view class="rimg"></view>
  197. </view>
  198. </uni-forms-item>
  199. <uni-forms-item label="小区名称" name="communityName">
  200. <view class="flexc">
  201. <uni-easyinput :disabled="isdisabled" v-model="houserinfo.communityName" :inputBorder='false' placeholder="请输入小区名称" />
  202. <view class="rimg"></view>
  203. </view>
  204. </uni-forms-item>
  205. <uni-forms-item label="门牌号" required name="detailedAddress">
  206. <view class="flexc">
  207. <uni-easyinput disabled v-model="houserinfo.detailedAddress" :inputBorder='false' placeholder="请输入门牌号" />
  208. <view class="rimg"></view>
  209. </view>
  210. </uni-forms-item>
  211. <uni-forms-item label="使用期限" name="usagePeriod">
  212. <view class="flexc">
  213. <uni-easyinput :disabled="isdisabled" v-model="houserinfo.usagePeriod" :inputBorder='false' placeholder="请输入使用期限" />
  214. <view class="rimg"></view>
  215. </view>
  216. </uni-forms-item>
  217. <uni-forms-item label="登记日期" name="registrationDate">
  218. <!-- <picker mode="timed" :disabled="isdisabled" @change='bindDateChangea'>
  219. <view class="flexc">
  220. <view class="flex1 txr f13" :class="datainfo.registrationDate?'co27':'coa'">{{datainfo.registrationDate||"请选择登记日期"}}</view>
  221. <view class="rimg"><image :src="rimg"></image></view>
  222. </view>
  223. </picker> -->
  224. <!-- :hide-second='true' -->
  225. <view class="flexc">
  226. <uni-datetime-picker :disabled="isdisabled" :class="houserinfo.registrationDate?'co27':'coa'" type="datetime" placeholder="请选择登记日期" :border="false" v-model="houserinfo.registrationDate" />
  227. <view class="rimg"><image :src="rimg"></image></view>
  228. </view>
  229. </uni-forms-item>
  230. <uni-forms-item label="共有姓名" name="coOwner">
  231. <view class="flexc">
  232. <uni-easyinput :disabled="isdisabled" v-model="houserinfo.coOwner" :inputBorder='false' placeholder="请输入共有姓名" />
  233. <view class="rimg"></view>
  234. </view>
  235. </uni-forms-item>
  236. <uni-forms-item label="共有情况" name="coOwnership">
  237. <view class="flexc">
  238. <uni-easyinput :disabled="isdisabled" v-model="houserinfo.coOwnership" :inputBorder='false' placeholder="请输入共有情况" />
  239. <view class="rimg"></view>
  240. </view>
  241. </uni-forms-item>
  242. <uni-forms-item label="房屋状态" name="houseStatus">
  243. <picker range-key='dictLabel' :disabled="isdisabled" :value="fwztidx" :range="fwztList" @change='bindDateChangeb'>
  244. <view class="flexc">
  245. <view class="flex1 txr f13 co27" v-if="houserinfo.houseStatus&&!fwzt">{{statusFormats(houserinfo.houseStatus,fwztList,'fwzt')}}</view>
  246. <view class="flex1 txr f13" v-else :class="fwzt?'co27':'coa'">{{fwzt||"请选择房屋状态"}}</view>
  247. <view class="rimg"><image :src="rimg"></image></view>
  248. </view>
  249. </picker>
  250. </uni-forms-item>
  251. <uni-forms-item label="房屋用途" name="usageType">
  252. <picker range-key='dictLabel' :disabled="isdisabled" :value="fwytidx" :range="fwytList" @change='bindDateChangec'>
  253. <view class="flexc">
  254. <view class="flex1 txr f13 co27" v-if="houserinfo.usageType&&!fwyt">{{statusFormats(houserinfo.usageType,fwytList,'fwyt')}}</view>
  255. <view class="flex1 txr f13" v-else :class="fwyt?'co27':'coa'">{{fwyt||"请选择房屋用途"}}</view>
  256. <view class="rimg"><image :src="rimg"></image></view>
  257. </view>
  258. </picker>
  259. </uni-forms-item>
  260. <uni-forms-item label="有无车位" name="hasParkingSpace">
  261. <picker range-key='dictLabel' :disabled="isdisabled" :value="ywcwidx" :range="ywcwList" @change='bindDateChanged'>
  262. <view class="flexc">
  263. <view class="flex1 txr f13 co27" v-if="houserinfo.hasParkingSpace&&!ywcw">{{statusFormats(houserinfo.hasParkingSpace,ywcwList,'ywcw')}}</view>
  264. <view class="flex1 txr f13" v-else :class="ywcw?'co27':'coa'">{{ywcw||"请选择有/无"}}</view>
  265. <view class="rimg"><image :src="rimg"></image></view>
  266. </view>
  267. </picker>
  268. </uni-forms-item>
  269. <uni-forms-item label="车位号" name="parkingNumber">
  270. <view class="flexc">
  271. <uni-easyinput :disabled="isdisabled" v-model="houserinfo.parkingNumber" :inputBorder='false' placeholder="请输入车位号" />
  272. <view class="rimg"></view>
  273. </view>
  274. </uni-forms-item>
  275. </view>
  276. </uni-collapse-item>
  277. </block>
  278. </block>
  279. </uni-collapse>
  280. <view class="mt12">
  281. <!-- <view class="hbtns mb10 bgb" @click="getAddfb" v-if="datainfo.residentType==1&&datainfo.isHouseholder=='Y'">添加房屋信息</view> -->
  282. <view class="hbtns bga" @click="getSubmit">提交</view>
  283. </view>
  284. </view>
  285. </uni-forms>
  286. <loading></loading>
  287. </view>
  288. </template>
  289. <script>
  290. import config from '@/config'
  291. import {checkPermi,checkRole} from "@/utils/permission"; // 权限判断函数
  292. import {uploadIdentify,uploadmore} from '@/utils/common.js'
  293. import {listNoPageTenant,houseInfoDet} from "@/api/work/work.js"
  294. import {gettenantList} from "@/api/login.js"
  295. import {residentInfoAdd,residentInfoPut,authentication,addResidentInfo} from "@/api/work/people.js"
  296. import {getDictionaryFn} from "@/api/system/user.js"
  297. import {selectValueKey} from "@/utils/common.js"
  298. import {getOcrIdCard,getrealEstateCertificatee} from "@/api/system/card.js"
  299. import wSelect from "@/work/components/w-select/w-select.vue"
  300. export default {
  301. components: {wSelect},
  302. data() {
  303. return {
  304. rdelimg: require('@/work/static/service/rdel.png'),
  305. rimg: require('@/mine/static/house/rimg.png'),
  306. cmico: require('@/mine/static/house/cmico.png'),
  307. del: require('@/mine/static/house/del.png'),
  308. aphoto: require('@/work/static/service/photo.png'),
  309. baseUrl: config.baseUrl,
  310. checkflag:true,
  311. backgroundColor: "transparent",
  312. datainfo: {
  313. "tenantId":'',//租户id
  314. "residentType":null,//人员类型:1:业主 2:租户 3:其他
  315. "residentName":null,//居住人员姓名
  316. "residentPhone":null,//人员手机号
  317. "houseInfoRedidentList":[],//用户房屋信息集合
  318. "houseId":null,//关联房屋信息表的house_id
  319. "residentRelationship":null,//居住人员与户主的关系,如父子、夫妻等
  320. "isHouseholder":null,//是否是户主 N不是 Y是
  321. "residentIdCard":null,//居住人员身份证号码,18位
  322. // "residentBirthday":null,//居住人员出生日期
  323. "residentGender":'',//居住人员性别:1-男,2-女
  324. // "isTenant":null,//是否是租户:Y-是,N-否
  325. "residentEmployer":null,//居住人员工作单位
  326. "residentAppearance":null,//居住人员面貌,如党员、群众等
  327. "residentHobby":null,//爱好
  328. "facePhoto":null,//人脸地址
  329. "idCardAddress":null,//身份证住址
  330. "specialType":null,//特殊类型
  331. "idCardFront":null,//身份证正面
  332. "idCardBack":null,//身份证反面
  333. },
  334. rules:{
  335. residentType: {rules: [{required: true,errorMessage: '请选择人人员类型' }]},
  336. // residentIdCard: {rules: [{required: true,errorMessage: '请输入身份证号码' }]},
  337. // residentName: {rules: [{required: true,errorMessage: '请输入姓名' }]},
  338. // residentGender: {rules: [{required: true,errorMessage: '请选择性别' }]},
  339. // houseId: {rules: [{required: true,errorMessage: '请选择房屋号' }]},
  340. // detailedAddress: {rules: [{required: true,errorMessage: '请输入居住地址' }]},
  341. // isHouseholder: {rules: [{required: true,errorMessage: '请选择是否户主' }]},
  342. // residentRelationship: {rules: [{required: true,errorMessage: '请选择与户主关系' }]},
  343. residentPhone: {rules: [{required: true,errorMessage: '请输入手机号'}, {pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,errorMessage:'请输入正确的手机号码'}]},
  344. },
  345. hzgx:"",
  346. rylx:"",
  347. hzgxidx:0,
  348. dslxidx:0,
  349. rylxidx:0,
  350. list:[],
  351. phofile:[],
  352. fwlist:[],
  353. rylxList:[],
  354. fwzt:'',
  355. qllx:'',
  356. fwyt:'',
  357. ywcw:'',
  358. hzgx:'',
  359. sfhz:"",
  360. sfzh:"",
  361. rymm:"",
  362. dslx:"",
  363. fwztidx:0,
  364. qllxidx:0,
  365. fwytidx:0,
  366. ywcwidx:0,
  367. hzgxidx:0,
  368. sfzhidx:0,
  369. rymmidx:0,
  370. sfhzidx:0,
  371. dslxidx:0,
  372. fwztList:[],
  373. qllxList:[],
  374. fwytList:[],
  375. hzgxList:[],
  376. sfList:[],
  377. rymmList:[],
  378. dslxList:[],
  379. xbList:[],
  380. ywcwList:[{dictLabel:'有',dictValue:'Y'},{dictLabel:'无',dictValue:'N'},],
  381. isdisabled:false,
  382. ptype:'add',
  383. filterable:true,
  384. chooseValue:'',
  385. map:{text:'dictLabel',value:'dictValue'},
  386. userId:this.$store.state.user.userId,
  387. voList:[],
  388. tenantName:'',
  389. houseInfoRedidentList:[],
  390. fwztList:[],
  391. qllxList:[],
  392. fwytList:[],
  393. sfList:[],
  394. rzflag:false,
  395. choseidx:'',
  396. houserinfo:{
  397. "houseId":'',
  398. "tenantId":"",//租户id
  399. "houseImage":null,//房本照片
  400. "ownerName":null,//权利人姓名
  401. "location":null,//房屋坐落位置
  402. "rightType":null,//权利类型,如所有权、使用权等
  403. "area":null,//房屋面积,单位为平方米
  404. "documentNumber":null,//房屋相关的字第号
  405. "propertyUnitNumber":null,//不动产单元号
  406. "coOwnership":null,//房屋的共有情况,如共有比例等
  407. "usageType":null,//房屋用途,如住宅、商业等
  408. "usagePeriod":null,//房屋使用期限
  409. "registrationDate":null,//房屋登记日期
  410. "coOwner":null,//共有人姓名,多个共有人可以用逗号分隔
  411. "detailedAddress":null,//房屋的详细门牌号
  412. "hasParkingSpace":null,//是否有车位,Y表示有,N表示无
  413. "communityName":null,//房屋所在小区名称
  414. "houseStatus":null,//房屋状态:1-自住,2-出租,3-空闲,4-待售
  415. "parkingNumber":null,//车位号
  416. }
  417. }
  418. },
  419. onLoad: function(e) {
  420. if(e.type){
  421. this.rztype=e.type
  422. this.rzflag=true;
  423. this.datainfo.residentPhone=this.$store.state.user.phonenumber;
  424. this.datainfo.userId=this.$store.state.user.userId;
  425. }else{
  426. // var tenantId=this.$store.state.user.tenantId;
  427. // this.datainfo.tenantId=tenantId;
  428. // this.getRoleNopage(tenantId)
  429. }
  430. this.gettenantList();
  431. if(e.id){
  432. this.id=e.id;
  433. this.ptype="edit";
  434. // this.isdisabled=true;
  435. this.getDetail()
  436. }
  437. this.init()
  438. },
  439. onPageScroll(e) {
  440. var scrollTop = Number(e.scrollTop);
  441. if (scrollTop > 0) {
  442. this.backgroundColor = '#48CC9A'
  443. } else {
  444. this.backgroundColor = 'transparent'
  445. }
  446. },
  447. methods: {
  448. checkPermi,
  449. checkRole,
  450. getEditFn(){
  451. this.isdisabled=false;
  452. },
  453. getSyFn(e){
  454. this.datainfo.isHouseholder=e
  455. console.log(this.datainfo.isHouseholder)
  456. },
  457. getChose(idx){
  458. this.choseidx=idx;
  459. },
  460. getAddfb(){
  461. var obj={
  462. "ownerName":"",//权利人姓名
  463. "location":"",//房屋坐落位置
  464. "rightType":"",//权利类型,如所有权、使用权等
  465. "area":"",//房屋面积,单位为平方米
  466. "documentNumber":"",//房屋相关的字第号
  467. "propertyUnitNumber":"",//不动产单元号
  468. "coOwnership":"",//房屋的共有情况,如共有比例等
  469. "usageType":"",//房屋用途,如住宅、商业等
  470. "usagePeriod":"",//房屋使用期限
  471. "registrationDate":"",//房屋登记日期
  472. "coOwner":"",//共有人姓名,多个共有人可以用逗号分隔
  473. "detailedAddress":"",//房屋的详细门牌号
  474. "hasParkingSpace":"",//是否有车位,Y表示有,N表示无
  475. "communityName":"",//房屋所在小区名称
  476. "houseStatus":"",//房屋状态:1-自住,2-出租,3-空闲,4-待售
  477. "parkingNumber":'',//车位号
  478. }
  479. this.houseInfoRedidentList.push(obj)
  480. },
  481. getDelfb(idx){
  482. this.houseInfoRedidentList.splice(idx,1)
  483. },
  484. statusFormats(data, list,type) {
  485. var aite=selectValueKey(list, data);
  486. if(type=='qllx'){
  487. this.qllxidx=aite.key;
  488. }else if(type=='rylx'){
  489. this.rylxidx=aite.key;
  490. }else if(type=='hzgx'){
  491. this.hzgxidx=aite.key;
  492. }else if(type=='fwzt'){
  493. this.fwztidx=aite.key;
  494. }else if(type=='fwyt'){
  495. this.fwytidx=aite.key;
  496. }else if(type=='ywcw'){
  497. this.ywcwidx=aite.key;
  498. }else if(type=='tenant'){
  499. this.tenantName=aite.actions;
  500. }else if(type=='rymm'){
  501. this.rymmidx=aite.key;
  502. }else if(type=='dslx'){
  503. this.dslxidx=aite.key;
  504. }
  505. return aite.actions;
  506. },
  507. getchangea(e){
  508. var tenantId=this.datainfo.tenantId;
  509. this.datainfo.tenantId=e.dictValue;
  510. this.houserinfo.communityName=e.dictLabel;
  511. // 业主或租户
  512. this.listNoPageTenant(e.dictValue)
  513. },
  514. getchange(e){
  515. this.datainfo.houseId=e.dictValue;
  516. this.datainfo.detailedAddress=e.dictLabel;
  517. this.houserinfo.detailedAddress=e.dictLabel;
  518. this.houserinfo.houseId=e.dictValue;
  519. this.houserinfo.location=e.location;
  520. },
  521. // 获取租户列表
  522. gettenantList(){
  523. gettenantList().then(res=>{
  524. if(res.code==200){
  525. if(res.data.voList&&res.data.voList.length){
  526. this.voList = res.data.voList.map(v => {
  527. return {
  528. dictLabel: v.companyName,
  529. dictValue: v.tenantId
  530. }
  531. })
  532. }
  533. }else{
  534. this.$toast(res.msg)
  535. }
  536. })
  537. },
  538. listNoPageTenant(id){
  539. var params={
  540. tenantId:id,
  541. }
  542. listNoPageTenant(params).then(res=>{
  543. if(res.code==200){
  544. this.fwlist= res.data.map(v => {
  545. return {
  546. dictLabel: v.detailedAddress,
  547. dictValue: v.houseId,
  548. location: v.location
  549. }
  550. })
  551. // if(res.rows&&res.rows.length<2){
  552. // var newObj=res.rows[0];
  553. // this.datainfo.houseId=newObj.houseId;
  554. // this.datainfo.detailedAddress=newObj.detailedAddress
  555. // }
  556. }
  557. })
  558. },
  559. init(){
  560. // 人员类型
  561. getDictionaryFn('resident_Type').then(res=>{
  562. if(res.code==200){
  563. this.rylxList = res.data.map(v => {
  564. return {
  565. dictLabel: v.dictLabel,
  566. dictValue: v.dictValue
  567. }
  568. })
  569. }
  570. })
  571. // 是否
  572. getDictionaryFn('sys_yes_no').then(res=>{
  573. if(res.code==200){
  574. this.sfList = res.data.map(v => {
  575. return {
  576. dictLabel: v.dictLabel,
  577. dictValue: v.dictValue
  578. }
  579. })
  580. }
  581. })
  582. //户主关系
  583. getDictionaryFn('relationship_householder').then(res=>{
  584. if(res.code==200){
  585. this.hzgxList = res.data.map(v => {
  586. return {
  587. dictLabel: v.dictLabel,
  588. dictValue: v.dictValue
  589. }
  590. })
  591. }
  592. })
  593. // 房屋状态
  594. getDictionaryFn('house_status').then(res=>{
  595. if(res.code==200){
  596. this.fwztList = res.data.map(v => {
  597. return {
  598. dictLabel: v.dictLabel,
  599. dictValue: v.dictValue
  600. }
  601. })
  602. }
  603. })
  604. //权利类型
  605. getDictionaryFn('types_rights').then(res=>{
  606. if(res.code==200){
  607. this.qllxList = res.data.map(v => {
  608. return {
  609. dictLabel: v.dictLabel,
  610. dictValue: v.dictValue
  611. }
  612. })
  613. }
  614. })
  615. //房屋用途
  616. getDictionaryFn('use_remises').then(res=>{
  617. if(res.code==200){
  618. this.fwytList = res.data.map(v => {
  619. return {
  620. dictLabel: v.dictLabel,
  621. dictValue: v.dictValue
  622. }
  623. })
  624. }
  625. })
  626. //人员面貌
  627. getDictionaryFn('affiliation_personnel').then(res=>{
  628. if(res.code==200){
  629. this.rymmList = res.data.map(v => {
  630. return {
  631. dictLabel: v.dictLabel,
  632. dictValue: v.dictValue
  633. }
  634. })
  635. }
  636. })
  637. // 特殊类型
  638. getDictionaryFn('special_type').then(res=>{
  639. if(res.code==200){
  640. this.dslxList = res.data.map(v => {
  641. return {
  642. dictLabel: v.dictLabel,
  643. dictValue: v.dictValue
  644. }
  645. })
  646. }
  647. })
  648. //性别
  649. getDictionaryFn('gender').then(res=>{
  650. if(res.code==200){
  651. this.xbList = res.data.map(v => {
  652. return {
  653. dictLabel: v.dictLabel,
  654. dictValue: Number(v.dictValue)
  655. }
  656. })
  657. }
  658. })
  659. },
  660. getBackFn(){
  661. uni.navigateBack({
  662. delta:1
  663. })
  664. },
  665. bindDateChange(e){
  666. var val=e.detail.value;
  667. this.houserinfo.rightType=this.qllxList[val].dictValue;
  668. this.qllx=this.qllxList[val].dictLabel;
  669. },
  670. bindDateChangea(e){
  671. var val=e.detail.value;
  672. this.houserinfo.registrationDate=val;
  673. },
  674. bindDateChangeb(e){
  675. var val=e.detail.value;
  676. this.houserinfo.houseStatus=this.fwztList[val].dictValue;
  677. this.fwzt=this.fwztList[val].dictLabel;
  678. },
  679. bindDateChangec(e){
  680. var val=e.detail.value;
  681. this.houserinfo.usageType=this.fwytList[val].dictValue;
  682. this.fwyt=this.fwytList[val].dictLabel;
  683. },
  684. bindDateChanged(e){
  685. var val=e.detail.value;
  686. this.houserinfo.hasParkingSpace=this.ywcwList[val].dictValue;
  687. this.ywcw=this.ywcwList[val].dictLabel;
  688. },
  689. bindDateChangee(e){
  690. var val=e.detail.value;
  691. this.datainfo.residentType=this.rylxList[val].dictValue;
  692. this.rylx=this.rylxList[val].dictLabel;
  693. },
  694. bindDateChangef(e){
  695. var val=e.detail.value;
  696. this.datainfo.residentAppearance=this.rymmList[val].dictValue;
  697. this.rymm=this.rymmList[val].dictLabel;
  698. },
  699. bindDateChangeg(e){
  700. var val=e.detail.value;
  701. this.datainfo.specialType=this.dslxList[val].dictValue;
  702. this.dslx=this.dslxList[val].dictLabel;
  703. },
  704. getDetail(){
  705. authentication(this.id).then(res=>{
  706. if(res.code==200){
  707. this.datainfo=res.data;
  708. if(res.data.facePhoto){
  709. this.phofile=res.data.facePhoto.split(',')
  710. }
  711. var data=JSON.parse(JSON.stringify(res.data))
  712. if(data.residentType!=3){
  713. this.listNoPageTenant(data.tenantId)
  714. }
  715. if(res.data.houseInfoRedidentList&&res.data.houseInfoRedidentList.length&&res.data.houseInfoRedidentList[0]){
  716. var houseinfo=res.data.houseInfoRedidentList[0]
  717. this.houserinfo=JSON.parse(JSON.stringify(houseinfo))
  718. }
  719. }
  720. })
  721. },
  722. getSubmit(){
  723. var that=this;
  724. this.$refs.form.validate().then(res => {
  725. var params=JSON.parse(JSON.stringify(this.datainfo))
  726. var phofile=JSON.parse(JSON.stringify(this.phofile))
  727. // if(phofile&&phofile.length){
  728. // params.facePhoto=this.phofile.join(',');
  729. // }
  730. params.facePhoto=this.phofile.join(',');
  731. if(!params.tenantId){
  732. this.$toast('请选择小区名称')
  733. return
  734. }
  735. if(params.residentType==1&&params.isHouseholder=='Y'){
  736. var houserinfo=JSON.parse(JSON.stringify(this.houserinfo))
  737. if(!houserinfo.location){
  738. this.$toast('请输入房屋坐落')
  739. return
  740. }
  741. if(!houserinfo.area){
  742. this.$toast('请输入房屋面积')
  743. return
  744. }
  745. if(!houserinfo.detailedAddress){
  746. this.$toast('请输入详细门牌号')
  747. return
  748. }
  749. houserinfo.tenantId=params.tenantId;
  750. var newarr=[]
  751. newarr.push(houserinfo)
  752. params.houseInfoRedidentList=JSON.parse(JSON.stringify(newarr))
  753. }
  754. if(params.residentType==2){
  755. params.isTenant='Y'
  756. }else{
  757. params.isTenant=''
  758. }
  759. // if(!params.detailedAddress){
  760. // this.$toast('请选择居住门户')
  761. // return
  762. // }
  763. // let _IDRe18 =
  764. // /^([1-6][1-9]|50)\d{4}(18|19|20)\d{2}((0[1-9])|10|11|12)(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/
  765. // let _IDre15 = /^([1-6][1-9]|50)\d{4}\d{2}((0[1-9])|10|11|12)(([0-2][1-9])|10|20|30|31)\d{3}$/
  766. // // 校验身份证:
  767. // if (params.residentIdCard&&!_IDRe18.test(params.residentIdCard) && !_IDre15.test(params.residentIdCard)) {
  768. // this.$toast("请输入正确身份证号")
  769. // return
  770. // }
  771. if(this.ptype=='add'){
  772. if(this.rzflag){
  773. residentInfoAdd(params).then(res=>{
  774. if(res.code==200){
  775. this.$toast("新增成功")
  776. setTimeout(function(){
  777. uni.$emit("residentInfoList")
  778. var initFace='';
  779. that.$store.dispatch('checkInitFace', initFace).then(() => {
  780. })
  781. uni.navigateBack({
  782. delta:1
  783. })
  784. },1500)
  785. }
  786. })
  787. }
  788. }else{
  789. if(this.rzflag){
  790. params.isFilter=true;
  791. residentInfoPut(params).then(res=>{
  792. if(res.code==200){
  793. this.$toast("修改成功")
  794. setTimeout(function(){
  795. uni.$emit("residentInfoList")
  796. var initFace='';
  797. that.$store.dispatch('checkInitFace', initFace).then(() => {
  798. })
  799. uni.navigateBack({
  800. delta:1
  801. })
  802. },1500)
  803. }
  804. })
  805. }
  806. }
  807. })
  808. },
  809. getPreviewa(idx,arr) {
  810. var newArr=[];
  811. arr.forEach(ite=>{
  812. var ds=this.baseUrl+ite
  813. newArr.push(ds)
  814. })
  815. uni.previewImage({
  816. urls: newArr,
  817. current:idx,
  818. success: function(data) {},
  819. fail: function(err) {}
  820. });
  821. },
  822. getPreview(img) {
  823. var newArr=[];
  824. var url=this.baseUrl+img
  825. newArr.push(url)
  826. uni.previewImage({
  827. urls: newArr,
  828. current:0,
  829. success: function(data) {},
  830. fail: function(err) {}
  831. });
  832. },
  833. getDelFn(idx,type){
  834. var that=this;
  835. uni.showModal({
  836. title: '确认删除',
  837. content: "是否确认删除",
  838. cancelText: '取消',
  839. confirmText: '确认',
  840. success: function(res) {
  841. if (res.confirm) {
  842. that.phofile.splice(idx,1)
  843. } else if (res.cancel) {
  844. }
  845. }
  846. });
  847. },
  848. getaddImageava(type){
  849. if(this.isdisabled){
  850. return
  851. }
  852. let that = this;
  853. let file =[],count=9
  854. uni.chooseImage({
  855. success:function(res){
  856. let img= res.tempFilePaths;
  857. if(img.length + file.length > count){
  858. uni.showToast({
  859. title: '最多上传'+count+'张图片',
  860. icon: 'none',
  861. duration: 2000
  862. })
  863. }else{
  864. let imglen = res.tempFilePaths.length;
  865. var fuwufile = [];
  866. uploadmore('/common/upload',img,0,0,0,imglen,fuwufile,function(rs){
  867. that.phofile = that.phofile.concat(rs);
  868. })
  869. }
  870. }
  871. });
  872. },
  873. getaddImage(type){
  874. if(this.isdisabled){
  875. return
  876. }
  877. let that = this;
  878. let file =[],count=9
  879. uni.chooseImage({
  880. count: 1,
  881. success:function(res){
  882. let img= res.tempFilePaths;
  883. if(img.length + file.length > count){
  884. uni.showToast({
  885. title: '最多上传'+count+'张图片',
  886. icon: 'none',
  887. duration: 2000
  888. })
  889. }else{
  890. let imglen = res.tempFilePaths.length;
  891. var fuwufile = [];
  892. uploadIdentify('/common/upload',img,0,0,0,imglen,fuwufile,function(rs){
  893. var resurl=rs[0];
  894. if(type=='front'){
  895. that.datainfo.idCardBack = resurl.fileName;
  896. if (rs && rs.length > 0) {
  897. var obj = {
  898. type:type,
  899. url: resurl.urlOnline
  900. }
  901. that.getOcrIdCard(obj)
  902. }
  903. }else{
  904. that.houserinfo.houseImage=resurl.fileName;
  905. if(rs&&rs.length>0){
  906. var obj={
  907. url:resurl.urlOnline
  908. }
  909. that.getOcrIdCardfz(obj)
  910. }
  911. }
  912. })
  913. }
  914. }
  915. });
  916. },
  917. getOcrIdCard(obj) {
  918. var params = {
  919. image: obj.url,
  920. idCardSide: obj.type
  921. }
  922. getOcrIdCard(params).then(res => {
  923. if (res.code == 200) {
  924. var datainfo = res.data;
  925. if (obj.type == 'front') {
  926. this.datainfo.residentName = datainfo.realName;
  927. this.datainfo.residentIdCard = datainfo.idCard;
  928. this.datainfo.idCardAddress = datainfo.address;
  929. // } else {
  930. // this.datainfo.expirationDate = datainfo.expirationDate
  931. }
  932. }
  933. })
  934. },
  935. getOcrIdCardfz(obj){
  936. var params={
  937. image:obj.url
  938. }
  939. getrealEstateCertificatee(params).then(res=>{
  940. if(res.code==200){
  941. var datainfo=res.data;
  942. // var obj=JSON.parse(JSON.stringify(this.houseInfoRedidentList[idx]))
  943. this.houserinfo.ownerName=datainfo.ownerName;
  944. this.houserinfo.location=datainfo.location;
  945. this.houserinfo.rightType=datainfo.rightType;
  946. this.houserinfo.area=datainfo.area;
  947. this.houserinfo.documentNumber=datainfo.documentNumber;
  948. this.houserinfo.propertyUnitNumber=datainfo.propertyUnitNumber;
  949. this.houserinfo.coOwnership=datainfo.coOwnership;
  950. this.houserinfo.usageType=datainfo.usageType;
  951. this.houserinfo.usagePeriod=datainfo.usagePeriod;
  952. this.houserinfo.registrationDate=datainfo.registrationDate;
  953. this.houserinfo.coOwner=datainfo.coOwner;
  954. // this.houseInfoRedidentList.splice(idx,1,obj)
  955. }
  956. })
  957. },
  958. }
  959. }
  960. </script>
  961. <style>
  962. page{background: #F3F3F0;}
  963. </style>
  964. <style lang="scss" scoped>
  965. .coa /deep/ .uni-date__x-input{text-align: right;color: #AAAAAA;}
  966. .check /deep/ .select-wrap{border: none;width: 100%;}
  967. .mh35{min-height: 70rpx;display: flex;align-items: center;}
  968. .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;}
  969. .check .cbox .chmain /deep/ .isnobor{border: none;}
  970. .check /deep/ .uni-forms-item__label{font-weight: bold;font-size: 26rpx;color: #222327;flex: 0 0 auto;width: auto !important;}
  971. .check /deep/ .uni-easyinput{flex: 1;text-align: right;font-size: 26rpx;color: #222327;}
  972. .check /deep/ .uni-easyinput__content-textarea{min-height: 40rpx;font-size: 26rpx;}
  973. .check /deep/ .uni-easyinput__placeholder-class{font-size: 26rpx;color: #AAAAAA;}
  974. .check /deep/ .uni-input-input{font-size: 26rpx;}
  975. .check /deep/ .uni-textarea-textarea{font-size: 26rpx;}
  976. .check /deep/ .is-disabled{color: #222327;background-color: #ffffff !important;}
  977. .check /deep/ .uni-data-checklist .checklist-group .checklist-box{margin:10rpx 8rpx 10rpx 16rpx;}
  978. .check /deep/ .uni-data-checklist{flex: 0 0 auto;}
  979. .check /deep/ .is-required{font-size: 26rpx;color: #F40027;margin-right: 4rpx;}
  980. .check /deep/ .uni-collapse{background-color: transparent;}
  981. // .check /deep/ .uni-collapse .chmain{margin-bottom: 24rpx;}
  982. .check{min-height: 100vh;box-sizing: border-box;padding: 20rpx 18rpx 54rpx;}
  983. .cbox{
  984. .chtit{font-weight: 500;font-size: 24rpx;color: #666666;padding:20rpx 14rpx;}
  985. .chmain{
  986. padding: 0rpx 28rpx;background: #FFFFFF;border-radius: 20rpx;
  987. .rimg{width: 16rpx;height: 28rpx;flex: 0 0 auto;margin-left: 20rpx;
  988. image{width: 100%;height: 100%;}
  989. }
  990. }
  991. .hbtns{font-weight: bold;display: flex;align-items: center;justify-content: center;font-size: 26rpx;height: 88rpx;border-radius: 20rpx;box-sizing: border-box;
  992. &.bga{border: 1px solid #0256FD;color: #FFFFFF;background: #0256FD;}
  993. &.bgb{border: 1px solid #0256FD;color: #0256FD;background: #CADBFF;}
  994. }
  995. .sylist{background: #F0F0F0;border-radius: 26rpx;border:2rpx solid #DADADA;margin-left: 26rpx;font-weight: 500;min-width:112rpx;height: 54rpx;box-sizing: border-box;
  996. font-size: 26rpx;
  997. color: #666666;
  998. &.act{border: 2rpx solid #0256FD;background: #DCE8FF;color: #0256FD;}
  999. }
  1000. .cmico{width: 48rpx;height: 48rpx;margin-left: 16rpx;}
  1001. .delbox{padding: 12rpx 32rpx;
  1002. image{width: 26rpx;height: 26rpx;margin-right: 14rpx;}
  1003. view{font-weight: 500;font-size: 26rpx;color: #FF6969;}
  1004. }
  1005. }
  1006. .addbox{width: 160rpx;height: 128rpx;background: #F0F0F0;border-radius: 20rpx;display: flex;flex-direction: column;align-items: center;justify-content: center;margin-left: 24rpx;margin-bottom: 20rpx;flex: 0 0 auto;
  1007. image{width: 48rpx;height: 42rpx;margin-bottom: 12rpx;}
  1008. view{font-weight: 500;font-size: 24rpx;color: #666666;}
  1009. }
  1010. .addimgs{display: flex;align-items: center;flex-wrap: wrap;justify-content: flex-end;
  1011. .assimg{width: 128rpx;height: 128rpx;position: relative;overflow: hidden;margin: 0 0 20rpx 24rpx;
  1012. .img{width: 100%;height: 100%;}
  1013. .delimg{width: 24rpx;height: 24rpx;position: absolute;right: 0;top: 0;}
  1014. }
  1015. }
  1016. </style>