toExamine.vue 15 KB

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