toExamine.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490
  1. <template>
  2. <div class="main">
  3. <div></div>
  4. <div class="formContent">
  5. <div class="formContent-item">
  6. <div class="formContent-item_title">基础信息</div>
  7. <div class="formContent-formList">
  8. <zz-form
  9. :cols="formCols"
  10. :data="formData"
  11. :rules="formRules"
  12. :errors="formErrors"
  13. labelWidth="70"
  14. ref="form"
  15. >
  16. <!-- 查看审核 -->
  17. <template>
  18. <template slot="name">{{ formData.name || '--' }}</template>
  19. <template slot="phone">{{ formData.phone || '--' }}</template>
  20. <template slot="personnelNumber">{{ formData.personnelNumber || '--' }}</template>
  21. <template
  22. slot="sex"
  23. v-if="formData.sex === 0"
  24. >未知</template>
  25. <template
  26. slot="sex"
  27. v-else
  28. >{{ formData.sex === 1 ? '男' : '女' }}</template>
  29. <template slot="remarks">{{ formData.remarks || '--' }}</template>
  30. </template>
  31. </zz-form>
  32. <template>
  33. <div class="clickUpload">
  34. <div class="clickUpText">
  35. <img
  36. class="dataImg"
  37. v-if="!!formData.facePictureUrl"
  38. :src="formData.facePictureUrl"
  39. />
  40. <template v-else>
  41. <img
  42. class="bg-img"
  43. src="@/assets/img/ownerManagement/img_zhaopian2@2x.png"
  44. alt=""
  45. />
  46. <div>无人脸图片</div>
  47. </template>
  48. </div>
  49. </div>
  50. </template>
  51. </div>
  52. </div>
  53. <div class="formContent-item">
  54. <div class="formContent-item_title">证件信息</div>
  55. <zz-form
  56. :cols="formCols2"
  57. :data="formData"
  58. :errors="formErrors"
  59. labelWidth="70"
  60. >
  61. <!-- 查看审核 -->
  62. <template>
  63. <template slot="idType">{{ formData.idType | matchingVal(idTypeArray) }}</template>
  64. <template slot="idNumber">{{ formData.idNumber || '--' }}</template>
  65. <template slot="permanentAddress">{{ formData.permanentAddress || '--' }}</template>
  66. <template slot="issuingAuthority">{{ formData.issuingAuthority || '--' }}</template>
  67. <template slot="effectiveDate">{{
  68. !!formData.effectiveDateStart ? formData.effectiveDateStart + ' —— ' + formData.effectiveDateStart : '--'
  69. }}</template>
  70. <template slot="nationality">{{ formData.nationality | matchingVal(nationalityArray) }}</template>
  71. <template slot="nativePlace">{{ formData.nativePlace | matchingVal(nativePlaceArray) }}</template>
  72. <template slot="nation">{{ formData.nation | matchingVal(nationArray) }}</template>
  73. <template slot="birthDate">{{ formData.birthDate }}</template>
  74. </template>
  75. </zz-form>
  76. </div>
  77. <div class="formContent-item">
  78. <div class="formContent-item_title"><span class="show-required-icon-star"></span> 绑定房产和车位</div>
  79. <div
  80. class="formContent-formList house"
  81. v-for="(item, index) in formData.houseList"
  82. :key="index"
  83. >
  84. <div class="block-title">
  85. <div class="floor list-title">
  86. {{ `${item.buildingName} ${!!item.unitName ? CheckChinese(item.unitName, '单元') : ''}${item.roomNumber}` }}
  87. </div>
  88. <img
  89. class="bg-img"
  90. src="@/assets/img/ownerManagement/bg_card@2x.png"
  91. alt=""
  92. />
  93. <img
  94. class="bg-imgIoc"
  95. src="@/assets/img/ownerManagement/icon_building@2x.png"
  96. alt=""
  97. />
  98. </div>
  99. <zz-form
  100. :cols="formCols3"
  101. :data="item"
  102. :rules="formRules"
  103. :errors="formErrors"
  104. labelWidth="70"
  105. >
  106. <!-- 查看审核 -->
  107. <template>
  108. <template slot="householdType">{{ item.householdType | matchingVal(householdTypeArray) }}</template>
  109. <template slot="checkInDate">{{ item.checkInDate || '--' }}</template>
  110. </template>
  111. </zz-form>
  112. <div
  113. class="block-title car"
  114. v-for="(items, indexs) in item.parkingList"
  115. :key="indexs"
  116. >
  117. <div class="floor list-title">
  118. {{ `${items.garageName}${items.areaName || items.partitionName || ''}-${items.parkingNumber}` }}
  119. </div>
  120. <img
  121. class="bg-img"
  122. src="@/assets/img/ownerManagement/bg_card@2x.png"
  123. alt=""
  124. />
  125. <img
  126. class="bg-imgIoc"
  127. src="@/assets/img/ownerManagement/icon_car@2x.png"
  128. alt=""
  129. />
  130. </div>
  131. </div>
  132. </div>
  133. </div>
  134. <div class="buttons">
  135. <el-button @click="closes">取消</el-button>
  136. <el-button
  137. type="primary"
  138. @click="passOK(2)"
  139. >审核不通过</el-button>
  140. <el-button
  141. type="primary"
  142. @click="passOK(1)"
  143. >审核通过</el-button>
  144. </div>
  145. </div>
  146. </template>
  147. <script>
  148. export default {
  149. name: 'toExamine',
  150. props: {
  151. params: {
  152. type: Object
  153. },
  154. islook: {
  155. type: Boolean,
  156. default: false
  157. },
  158. isAdd: {
  159. type: Boolean,
  160. default: true
  161. }
  162. },
  163. filters: {
  164. matchingVal (val, arr) {
  165. let v = '--';
  166. if (!!val) {
  167. arr.forEach((item) => {
  168. if (!!item.status && item.status === val) {
  169. v = item.label;
  170. } else if (!!item.code && item.code === val) {
  171. v = item.name;
  172. }
  173. });
  174. }
  175. return v;
  176. }
  177. },
  178. data () {
  179. return {
  180. formData: {
  181. name: '',
  182. phone: '',
  183. personnelNumber: '',
  184. sex: 0,
  185. remarks: '',
  186. facePictureUrl: '',
  187. id: 0,
  188. idType: '',
  189. idNumber: '',
  190. permanentAddress: '',
  191. issuingAuthority: '',
  192. effectiveDateStart: '',
  193. effectiveDateEnd: '',
  194. nationality: 1,
  195. nativePlace: '',
  196. nation: '',
  197. birthDate: '',
  198. houseList: []
  199. },
  200. formCols: [
  201. [
  202. {
  203. label: '姓名',
  204. prop: 'name',
  205. slot: 'name'
  206. },
  207. {
  208. label: '手机号',
  209. prop: 'phone',
  210. slot: 'phone'
  211. },
  212. {
  213. label: '人员编号',
  214. prop: 'personnelNumber',
  215. slot: 'personnelNumber'
  216. },
  217. {
  218. label: '性别',
  219. prop: 'sex',
  220. slot: 'sex'
  221. },
  222. {
  223. label: '备注',
  224. prop: 'remarks',
  225. slot: 'remarks'
  226. }
  227. ]
  228. ],
  229. formCols2: [
  230. [
  231. {
  232. label: '证件类型',
  233. prop: 'idType',
  234. slot: 'idType'
  235. },
  236. {
  237. label: '证件号码',
  238. prop: 'idNumber',
  239. slot: 'idNumber'
  240. },
  241. {
  242. label: '户籍地址',
  243. prop: 'permanentAddress',
  244. slot: 'permanentAddress'
  245. },
  246. {
  247. label: '签发机关',
  248. prop: 'issuingAuthority',
  249. slot: 'issuingAuthority'
  250. },
  251. {
  252. label: '有效期',
  253. prop: 'effectiveDate',
  254. slot: 'effectiveDate'
  255. },
  256. {
  257. label: '国籍',
  258. prop: 'nationality',
  259. slot: 'nationality'
  260. },
  261. {
  262. label: '籍贯',
  263. prop: 'nativePlace',
  264. slot: 'nativePlace'
  265. },
  266. {
  267. label: '民族',
  268. prop: 'nation',
  269. slot: 'nation'
  270. },
  271. {
  272. label: '出生日期',
  273. prop: 'birthDate',
  274. slot: 'birthDate'
  275. }
  276. ]
  277. ],
  278. formCols3: [
  279. [
  280. {
  281. label: '类型',
  282. prop: 'householdType',
  283. slot: 'householdType',
  284. showRequired: true
  285. },
  286. {
  287. label: '入住时间',
  288. prop: 'checkInDate',
  289. slot: 'checkInDate'
  290. }
  291. ]
  292. ],
  293. nationalityArray: [
  294. {
  295. status: 1,
  296. label: '中国'
  297. },
  298. {
  299. status: 2,
  300. label: '其他'
  301. }
  302. ],
  303. idTypeArray: [
  304. {
  305. status: 1,
  306. label: '居民身份证'
  307. },
  308. {
  309. status: 2,
  310. label: '居民户口簿'
  311. },
  312. {
  313. status: 3,
  314. label: '暂住证'
  315. },
  316. {
  317. status: 4,
  318. label: '其他'
  319. }
  320. ],
  321. householdTypeArray: [
  322. {
  323. status: 1,
  324. label: '业主'
  325. },
  326. {
  327. status: 2,
  328. label: '亲属'
  329. },
  330. {
  331. status: 3,
  332. label: '租客'
  333. }, {
  334. status: 4,
  335. label: '承租人'
  336. }
  337. ],
  338. formRules: {
  339. name: [this.$valid.selectRequired('填写姓名')],
  340. phone: [this.$valid.selectRequired('填写手机号')],
  341. householdType: [this.$valid.selectRequired('填写类型')]
  342. }
  343. };
  344. },
  345. created () {
  346. this.$store.dispatch('collapse', true);
  347. if (!!this.params.id) {
  348. this.getDetails(this.params.id);
  349. } else {
  350. if (this.$parent.thisLeftData.type == 'room') {
  351. this.formData.houseList = [
  352. {
  353. checkInDate: '',
  354. householdType: 1,
  355. buildingName: this.$parent.thisLeftData.buildingName,
  356. unitName: this.$parent.thisLeftData.unitName,
  357. roomNumber: this.$parent.thisLeftData.houseName,
  358. houseId: this.$parent.thisLeftData.houseId,
  359. parkingList: []
  360. }
  361. ];
  362. }
  363. }
  364. },
  365. beforeDestroy () {
  366. this.$store.dispatch('collapse', false);
  367. },
  368. computed: {
  369. nationArray () {
  370. return this.$store.getters['getNationArray'];
  371. },
  372. nativePlaceArray () {
  373. return this.$store.getters['getNativeArray'];
  374. },
  375. islooks () {
  376. if (this.islook) {
  377. this.lookFormCols('formCols');
  378. this.lookFormCols('formCols2');
  379. this.lookFormCols('formCols3');
  380. }
  381. return this.islook;
  382. }
  383. },
  384. methods: {
  385. getDetails (id) {
  386. let url = '/czc-community/scResident/audit/find/' + id;
  387. this.$http.get(url).then(({ data, status, msg }) => {
  388. if (0 === status) {
  389. let { effectiveDateStart, effectiveDateEnd } = data;
  390. if (effectiveDateStart == null || effectiveDateEnd == null) {
  391. effectiveDateStart = '';
  392. effectiveDateEnd = '';
  393. }
  394. this.formData = data;
  395. } else {
  396. this.$message.error(msg);
  397. }
  398. })
  399. .catch(() => { });
  400. },
  401. lookFormCols (cols) {
  402. this[cols][0].forEach((item, index) => {
  403. if (!!item.input) {
  404. item.input = false;
  405. }
  406. });
  407. },
  408. closes () {
  409. this.$emit('clerOwnerStatus');
  410. },
  411. passOK (status) {
  412. this.$http
  413. .get('/czc-community/scResident/audit', { id: this.params.id, auditStatus: status })
  414. .then(({ status, msg }) => {
  415. if (0 === status) {
  416. this.$message.success(msg);
  417. this.closes();
  418. } else {
  419. this.$message.error(msg);
  420. }
  421. })
  422. .catch(() => { });
  423. },
  424. dimension (arr) {
  425. arr.map((item, index) => {
  426. if (!!item.children) {
  427. this.dimension(item.children);
  428. if (item.type == 'unit') {
  429. item.name = this.CheckChinese(item.name, '单元');
  430. } else if (item.type == 'building') {
  431. item.name = this.CheckChinese(item.name, '楼栋');
  432. }
  433. }
  434. });
  435. },
  436. CheckChinese (val, name) {
  437. var reg = new RegExp('[\\u4E00-\\u9FFF]+', 'g');
  438. let newVal = val;
  439. if (!reg.test(val)) {
  440. newVal = val + name;
  441. }
  442. return newVal;
  443. }
  444. }
  445. };
  446. </script>
  447. <style lang='scss' scoped >
  448. @import '../style.scss';
  449. .addHouse {
  450. cursor: pointer;
  451. img.add {
  452. margin-left: 20px;
  453. width: 13px;
  454. }
  455. }
  456. .formContent .formContent-item .block-title.car {
  457. margin-bottom: 20px;
  458. }
  459. .formContent-formList.house {
  460. flex-wrap: wrap;
  461. &::after {
  462. content: '';
  463. width: 100%;
  464. height: 1px;
  465. background: #e0e1e3;
  466. margin-bottom: 20px;
  467. }
  468. .el-form {
  469. width: calc(100% - 220px);
  470. /deep/ .el-date-editor.el-input {
  471. width: 100%;
  472. }
  473. }
  474. }
  475. .removeHouseButton {
  476. width: 80px;
  477. height: 32px;
  478. margin-bottom: 20px;
  479. }
  480. </style>