authenadd.vue 38 KB

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