FullPartyMemberIndex.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931
  1. <!--
  2. * @Description: 党建管理 => 正式党员管理
  3. * @Author: Rockery
  4. * @Date: 2021-12-10 10:39:07
  5. * @LastEditors: Rockery
  6. * @LastEditTime: 2022-02-11 10:30:22
  7. * @FilePath: \party_construct_web\src\views\PartyBuildingMgr\FullPartyMember\FullPartyMemberIndex.vue
  8. * @Copyright: Copyright (c) 2016~2021 Rockery(1113269755@qq.com)
  9. -->
  10. <template>
  11. <div class="app-container fullpartymember">
  12. <template v-if="pageType == 'LIST'">
  13. <div class="fullpartymember-listpage">
  14. <div class="fullpartymember-head">
  15. <div class="fullpartymember-head-title">
  16. <div>
  17. <img
  18. :src="require('@/assets/logo/home-main-title-logo.png')"
  19. @error="imgViewerOnerror"
  20. />
  21. </div>
  22. <div>正式党员管理</div>
  23. </div>
  24. <div class="fullpartymember-head-btn">
  25. <div>列表样式</div>
  26. <svg-icon
  27. icon-class="partydatacard"
  28. class="fullpartymember-head-btn-card"
  29. :class="{ 'is-active': listActiveType === 'CARDLIST' }"
  30. @click="handleCardListClick"
  31. />
  32. <svg-icon
  33. icon-class="partydatalist"
  34. class="fullpartymember-head-btn-list"
  35. :class="{ 'is-active': listActiveType === 'TABLELIST' }"
  36. @click="handleTableListClick"
  37. />
  38. </div>
  39. </div>
  40. <div class="app-container-queryform" v-show="showSearch">
  41. <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
  42. <el-form-item prop="beginTime">
  43. <el-date-picker
  44. v-model="queryParams.beginTime"
  45. type="date"
  46. size="small"
  47. clearable
  48. format="yyyy年MM月dd日"
  49. value-format="yyyy-MM-dd"
  50. style="width: 100%;"
  51. placeholder="请选择入党开始时间"
  52. ></el-date-picker>
  53. </el-form-item>
  54. <el-form-item prop="endTime">
  55. <el-date-picker
  56. v-model="queryParams.endTime"
  57. type="date"
  58. size="small"
  59. clearable
  60. format="yyyy年MM月dd日"
  61. value-format="yyyy-MM-dd"
  62. style="width: 100%;"
  63. placeholder="请选择入党结束时间"
  64. ></el-date-picker>
  65. </el-form-item>
  66. <el-form-item prop="name">
  67. <el-input
  68. v-model="queryParams.name"
  69. placeholder="请输入姓名"
  70. clearable
  71. size="small"
  72. style="width: 100%;"
  73. @keyup.enter.native="handleQuery"
  74. />
  75. </el-form-item>
  76. <el-form-item prop="sex">
  77. <el-select
  78. v-model="queryParams.sex"
  79. placeholder="请选择性别"
  80. clearable
  81. size="small"
  82. style="width: 100%;"
  83. >
  84. <el-option label="男" value="男"></el-option>
  85. <el-option label="女" value="女"></el-option>
  86. </el-select>
  87. </el-form-item>
  88. <el-form-item>
  89. <el-button
  90. v-hasPermi="['partybuildingmgr:fullpartymember:query']"
  91. type="primary"
  92. icon="el-icon-search"
  93. size="mini"
  94. @click="handleQueryClick"
  95. >搜索</el-button>
  96. <el-button
  97. v-hasPermi="['partybuildingmgr:fullpartymember:reset']"
  98. icon="el-icon-refresh"
  99. size="mini"
  100. @click="resetQueryClick"
  101. >重置</el-button>
  102. </el-form-item>
  103. </el-form>
  104. </div>
  105. <div class="app-container-main fullpartymember-main" :class="showSearch ? 'mt15' : ''">
  106. <el-row :gutter="10" class="mb8">
  107. <el-col :span="1.5">&nbsp;</el-col>
  108. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  109. </el-row>
  110. <el-row :gutter="10">
  111. <template v-if="listActiveType === 'CARDLIST'">
  112. <el-col :span="24">
  113. <div class="fullpartymember-main-list">
  114. <template v-if="tableList.length > 0">
  115. <div class="list-row">
  116. <div
  117. v-for="item in tableList"
  118. :key="'FULLPARTYMEMBERCARDLIST_' + item.id"
  119. class="list-cell"
  120. >
  121. <div class="list-cell-img">
  122. <div v-show="item.status !== 0" class="list-cell-img-type">
  123. <div
  124. class="list-cell-img-type-content"
  125. >{{ fullPartyMemberStatusObj[item.status] }}</div>
  126. </div>
  127. <img
  128. :src="item.personPhoto ? (viewPdfFileUrlPrefix + item.personPhoto) : require('@/assets/images/tentative-img.png')"
  129. @error="imgViewerOnerror"
  130. />
  131. <div class="list-cell-shield">
  132. <div class="list-cell-shield-content">
  133. <div class="shield-content-label">入党时间</div>
  134. <div
  135. class="shield-content-datetime"
  136. >{{ parseTime(item.addPartyTime, '{y}年{m}月{d}日') || ' - 年 - 月 - 日' }}</div>
  137. <el-button
  138. v-hasPermi="['partybuildingmgr:fullpartymember:view']"
  139. type="rocwhiteplainbtn"
  140. style="width: 100%;"
  141. @click="handleViewClick(item)"
  142. >查看资料</el-button>
  143. <div
  144. v-hasPermi="['partybuildingmgr:fullpartymember:reactivate']"
  145. class="shield-content-relation"
  146. @click="handleReactivateClick(item)"
  147. >组织关系变更</div>
  148. </div>
  149. </div>
  150. </div>
  151. <div class="list-cell-name">{{ item.name || '—' }}</div>
  152. </div>
  153. </div>
  154. </template>
  155. <template v-else>
  156. <div class="fullpartymember-main-list-nodata">暂无数据</div>
  157. </template>
  158. </div>
  159. </el-col>
  160. </template>
  161. <template v-else>
  162. <el-col :span="24" class="mt15">
  163. <el-table
  164. :data="tableList"
  165. stripe
  166. border
  167. :header-cell-style="{'text-align':'center'}"
  168. header-row-class-name="develop-table_header-row"
  169. class="develop-main-table"
  170. style="width: 100%;"
  171. >
  172. <el-table-column label="党员姓名" prop="name" :show-overflow-tooltip="true" />
  173. <el-table-column
  174. label="性别"
  175. prop="sex"
  176. align="center"
  177. :show-overflow-tooltip="true"
  178. >
  179. <template slot-scope="scope">
  180. <span>{{ scope.row.sex || '—' }}</span>
  181. </template>
  182. </el-table-column>
  183. <el-table-column label="党龄" align="center" :show-overflow-tooltip="true">
  184. <template slot-scope="scope">
  185. <span>{{ getPartyStanding(parseTime(scope.row.applyAddPartyTime, '{y}-{m}-{d}'), parseTime(scope.row.addPartyTime, '{y}-{m}-{d}')) }}</span>
  186. </template>
  187. </el-table-column>
  188. <el-table-column
  189. label="入党介绍人"
  190. prop="addPartyIntroducer"
  191. :show-overflow-tooltip="true"
  192. >
  193. <template slot-scope="scope">
  194. <span>{{ scope.row.addPartyIntroducer || '—' }}</span>
  195. </template>
  196. </el-table-column>
  197. <el-table-column
  198. label="申请入党时间"
  199. prop="applyAddPartyTime"
  200. align="center"
  201. :show-overflow-tooltip="true"
  202. >
  203. <template slot-scope="scope">
  204. <span>{{ parseTime(scope.row.applyAddPartyTime, '{y}-{m}-{d}') || '—' }}</span>
  205. </template>
  206. </el-table-column>
  207. <el-table-column
  208. label="正式入党时间"
  209. prop="addPartyTime"
  210. align="center"
  211. :show-overflow-tooltip="true"
  212. >
  213. <template slot-scope="scope">
  214. <span>{{ parseTime(scope.row.addPartyTime, '{y}-{m}-{d}') || '—' }}</span>
  215. </template>
  216. </el-table-column>
  217. <el-table-column
  218. label="操作"
  219. align="center"
  220. fixed="right"
  221. width="200"
  222. class-name="small-padding fixed-width"
  223. >
  224. <template slot-scope="scope">
  225. <el-button
  226. v-hasPermi="['partybuildingmgr:fullpartymember:view']"
  227. size="mini"
  228. type="text"
  229. icon="el-icon-view"
  230. style="color: #909399;"
  231. @click="handleViewClick(scope.row)"
  232. >详情</el-button>
  233. <el-button
  234. v-hasPermi="['partybuildingmgr:fullpartymember:reactivate']"
  235. size="mini"
  236. type="text"
  237. style="color: #de0010;"
  238. @click="handleReactivateClick(scope.row)"
  239. >
  240. <svg-icon icon-class="relachange" />&nbsp;&nbsp;组织关系变更
  241. </el-button>
  242. </template>
  243. </el-table-column>
  244. </el-table>
  245. </el-col>
  246. </template>
  247. <el-col :span="24">
  248. <pagination
  249. v-show="total>0"
  250. :total="total"
  251. :pageSizes="[14, 28, 42, 56, 70]"
  252. :page.sync="queryParams.pageNum"
  253. :limit.sync="queryParams.pageSize"
  254. @pagination="refreshData"
  255. />
  256. </el-col>
  257. </el-row>
  258. </div>
  259. </div>
  260. </template>
  261. <template v-else-if="pageType == 'ADD'">
  262. <div class="fullpartymember-addpage">
  263. <div class="fullpartymember-addpage-head">
  264. <div class="fullpartymember-addpage-head-title">
  265. <div>
  266. <img
  267. :src="require('@/assets/logo/home-main-title-logo.png')"
  268. @error="imgViewerOnerror"
  269. />
  270. </div>
  271. <div>正式党员管理</div>
  272. </div>
  273. </div>
  274. <update-party-develop
  275. :operate-type="pageType"
  276. @page-submit="handleAddPageSubmitClick"
  277. @page-close="handleAddPageCloseClick"
  278. />
  279. </div>
  280. </template>
  281. <template v-else-if="pageType == 'VIEW'">
  282. <div class="toptitlepage">
  283. <div class="toptitlepage-head">
  284. <div class="toptitlepage-head-title">
  285. <div>
  286. <img
  287. :src="require('@/assets/logo/home-main-title-logo.png')"
  288. @error="imgViewerOnerror"
  289. />
  290. </div>
  291. <div>正式党员管理(查看资料)</div>
  292. </div>
  293. </div>
  294. <party-member-details :id="currentRow.id" @page-close="handleViewPageCloseClick" />
  295. </div>
  296. </template>
  297. <template v-else>
  298. <div>&nbsp;</div>
  299. </template>
  300. <!-- 组织关系变更对话框 -->
  301. <el-dialog
  302. title="组织关系变更"
  303. :visible.sync="orgRelationChangeObj.open"
  304. width="700px"
  305. append-to-body
  306. :destroy-on-close="true"
  307. :close-on-click-modal="false"
  308. class="orgrelationchange-dialog"
  309. >
  310. <el-form
  311. ref="orgRelationChangeFormRef"
  312. :model="orgRelationChangeObj.form"
  313. :rules="orgRelationChangeObj.rules"
  314. label-width="100px"
  315. >
  316. <el-row>
  317. <el-col :span="12">
  318. <el-form-item label="变更时间:" prop="modifyTime">
  319. <el-date-picker
  320. v-model="orgRelationChangeObj.form.modifyTime"
  321. type="date"
  322. clearable
  323. format="yyyy年MM月dd日"
  324. value-format="yyyy-MM-dd"
  325. style="width: 100%;"
  326. placeholder="请选择变更时间"
  327. ></el-date-picker>
  328. </el-form-item>
  329. </el-col>
  330. <el-col :span="12">
  331. <el-form-item label="姓名:" prop="memberName">
  332. <el-input
  333. v-model="orgRelationChangeObj.form.memberName"
  334. :disabled="!(!orgRelationChangeObj.currentRow.name)"
  335. clearable
  336. placeholder="请输入姓名"
  337. />
  338. </el-form-item>
  339. </el-col>
  340. <el-col :span="12">
  341. <el-form-item label="身份证号:" prop="cardNo">
  342. <el-input
  343. v-model="orgRelationChangeObj.form.cardNo"
  344. :disabled="!(!orgRelationChangeObj.currentRow.cardNo)"
  345. clearable
  346. placeholder="请输入身份证号"
  347. />
  348. </el-form-item>
  349. </el-col>
  350. <el-col :span="12">
  351. <el-form-item label="类型:" prop="modifyType">
  352. <el-select
  353. v-model="orgRelationChangeObj.form.modifyType"
  354. placeholder="请选择类型"
  355. clearable
  356. size="small"
  357. style="width: 100%;"
  358. >
  359. <el-option
  360. v-for="orgRelationChangeTypeOption in orgRelationChangeTypeOptions"
  361. :key="orgRelationChangeTypeOption.dictValue"
  362. :label="orgRelationChangeTypeOption.dictLabel"
  363. :value="orgRelationChangeTypeOption.dictValue"
  364. />
  365. </el-select>
  366. </el-form-item>
  367. </el-col>
  368. <el-col :span="24">
  369. <el-form-item label="相关材料:" prop="relatedFile">
  370. <roc-pdf-file-upload
  371. key="ROCPDFFILEUPLOADFULLPARTYMEMBERATTACHMENTKEY"
  372. v-model="orgRelationChangeObj.form.relatedFile"
  373. upload-file-title="相关材料"
  374. ></roc-pdf-file-upload>
  375. </el-form-item>
  376. </el-col>
  377. <el-col :span="24">
  378. <el-form-item label="说明:" prop="remark">
  379. <el-input
  380. v-model="orgRelationChangeObj.form.remark"
  381. type="textarea"
  382. :autosize="{ minRows: 4}"
  383. placeholder="请输入说明"
  384. clearable
  385. />
  386. </el-form-item>
  387. </el-col>
  388. </el-row>
  389. </el-form>
  390. <div slot="footer" class="dialog-footer">
  391. <el-button type="rocpartyprimaryplainbtn" @click="orgRelationChangeCancelClick">取 消</el-button>
  392. <el-button
  393. :disabled="!orgRelationChangeObj.form.modifyTime || !orgRelationChangeObj.form.memberName || !orgRelationChangeObj.form.cardNo || !orgRelationChangeObj.form.modifyType"
  394. type="rocpartyprimarybtn"
  395. @click="orgRelationChangeSubmitForm"
  396. >确定</el-button>
  397. </div>
  398. </el-dialog>
  399. </div>
  400. </template>
  401. <script>
  402. import { listFullPartyMember } from "@/api/PartyBuildingMgr/FullPartyMember";
  403. import { addOrgRelationship } from "@/api/PartyBuildingMgr/OrgRelationship";
  404. export default {
  405. name: "Fullpartymember",
  406. components: {
  407. 'roc-pdf-file-upload': () => import('@/components/RocPdfFileUpload'),
  408. 'update-party-develop': () => import('@/components/UpdatePartyDevelop'),
  409. 'party-member-details': () => import('@/components/PartyMemberDetails')
  410. },
  411. data() {
  412. return {
  413. // 页面类型
  414. pageType: 'LIST',
  415. // 遮罩层
  416. loading: true,
  417. // 显示搜索条件
  418. showSearch: true,
  419. // 列表样式
  420. listActiveType: 'CARDLIST',
  421. // 查询条件
  422. queryParams: {
  423. pageNum: 1,
  424. pageSize: 14,
  425. orderByColumn: 'id',
  426. isAsc: 'desc'
  427. },
  428. // 数据总条数
  429. total: 10,
  430. // 表格列表
  431. tableList: [],
  432. orgRelationChangeObj: {
  433. open: false,
  434. form: {},
  435. rules: {
  436. modifyTime: [
  437. { required: true, message: "变更时间不能为空", trigger: ['change', 'blur'] }
  438. ],
  439. memberName: [
  440. { required: true, message: "姓名不能为空", trigger: 'blur' }
  441. ],
  442. cardNo: [
  443. { required: true, message: "身份证号不能为空", trigger: 'blur' },
  444. {
  445. pattern: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/,
  446. message: "请输入正确身份证号",
  447. trigger: 'blur'
  448. }
  449. ],
  450. modifyType: [
  451. { required: true, message: "类型不能为空", trigger: ['change', 'blur'] }
  452. ]
  453. },
  454. currentRow: {}
  455. },
  456. orgRelationChangeTypeOptions: [],
  457. viewPdfFileUrlPrefix: `${window.origin}${process.env.VUE_APP_FILE_VIEW_API}`,
  458. fullPartyMemberStatusObj: {
  459. '1': '转出',
  460. '2': '退党',
  461. '3': '开除',
  462. '4': '去世',
  463. '5': '退休'
  464. }
  465. };
  466. },
  467. created() {
  468. this.initData();
  469. },
  470. methods: {
  471. /** 初始化数据 */
  472. async initData() {
  473. this.listActiveType = 'CARDLIST';
  474. this.refreshData();
  475. },
  476. /** 刷新数据 */
  477. async refreshData() {
  478. this.loading = true;
  479. this.getList();
  480. },
  481. /** 获取表格数据 */
  482. getList() {
  483. this.loading = true;
  484. listFullPartyMember(this.queryParams).then(
  485. response => {
  486. this.tableList = response.rows || [];
  487. this.total = response.total ?? 0;
  488. this.loading = false;
  489. this.pageType = 'LIST';
  490. }
  491. );
  492. },
  493. /**
  494. * 获取次要选项列表
  495. */
  496. async getSubOptions() {
  497. // 组织关系变更类型列表
  498. await this.getDicts('org_relation_change_type').then(response => {
  499. const orgRelationOptions = response?.data || [];
  500. this.orgRelationChangeTypeOptions = orgRelationOptions.filter((item) => {
  501. return item.dictValue !== '0';
  502. });
  503. });
  504. },
  505. /**
  506. * 卡片列表图标事件
  507. */
  508. handleCardListClick() {
  509. this.listActiveType = 'CARDLIST';
  510. },
  511. /**
  512. * 表格列表图标事件
  513. */
  514. handleTableListClick() {
  515. this.listActiveType = 'TABLELIST';
  516. },
  517. /**
  518. * 搜索按钮事件
  519. */
  520. handleQueryClick() {
  521. this.queryParams.pageNum = 1;
  522. this.refreshData();
  523. },
  524. /**
  525. * 重置按钮事件
  526. */
  527. resetQueryClick() {
  528. this.resetForm("queryForm");
  529. this.handleQueryClick();
  530. },
  531. /**
  532. * 查看详情按钮事件
  533. */
  534. handleViewClick(row) {
  535. if (!row?.id) return;
  536. this.pageType = 'VIEW';
  537. this.currentRow = row;
  538. },
  539. /**
  540. * 组织关系变更事件
  541. */
  542. async handleReactivateClick(row) {
  543. if (!row?.name) return;
  544. // 初始化数据
  545. this.orgRelationChangeObj.form = {};
  546. this.resetForm("orgRelationChangeFormRef");
  547. await this.getSubOptions();
  548. // 绑定数据
  549. this.orgRelationChangeObj.currentRow = row;
  550. this.orgRelationChangeObj.form = {
  551. memberId: row?.id,
  552. memberName: row?.name,
  553. cardNo: row?.cardNo
  554. };
  555. this.orgRelationChangeObj.open = true;
  556. },
  557. /**
  558. * 组织关系变更对话框确定按钮事件
  559. */
  560. orgRelationChangeSubmitForm() {
  561. this.$refs["orgRelationChangeFormRef"].validate(valid => {
  562. if (valid) {
  563. this.$confirm('是否确认当前操作?', "警告", {
  564. confirmButtonText: "确定",
  565. cancelButtonText: "取消",
  566. type: "warning"
  567. }).then(() => {
  568. addOrgRelationship(this.orgRelationChangeObj.form).then(
  569. () => {
  570. this.msgSuccess("组织关系变更成功!");
  571. this.orgRelationChangeCancelClick();
  572. this.pageType = 'LIST';
  573. this.refreshData();
  574. }
  575. );
  576. }).catch(() => { });
  577. }
  578. });
  579. },
  580. /**
  581. * 组织关系变更对话框取消按钮事件
  582. */
  583. orgRelationChangeCancelClick() {
  584. this.orgRelationChangeObj.open = false;
  585. this.orgRelationChangeObj.currentRow = {};
  586. this.orgRelationChangeObj.form = {};
  587. this.resetForm("orgRelationChangeFormRef");
  588. },
  589. /**
  590. * 新增页面保存按钮事件
  591. */
  592. handleAddPageSubmitClick(param) {
  593. this.pageType = param;
  594. this.refreshData();
  595. },
  596. /**
  597. * 新增页面取消按钮事件
  598. */
  599. handleAddPageCloseClick(param) {
  600. this.pageType = param;
  601. this.refreshData();
  602. },
  603. /**
  604. * 详情页面关闭按钮事件
  605. */
  606. handleViewPageCloseClick(param) {
  607. this.pageType = param;
  608. this.refreshData();
  609. },
  610. /**
  611. * 根据两个指定日期计算党龄
  612. * @applyAddPartyDate [String] 出生日期,格式为"1990-01-01"
  613. * @addPartyDate [String] 指定日期,格式为"1990-01-01"
  614. */
  615. getPartyStanding(applyAddPartyDate, addPartyDate) {
  616. // 不存在数据
  617. if (!applyAddPartyDate || !addPartyDate) {
  618. return '—';
  619. }
  620. // 初始化数据
  621. const [applyAddPartyDateArr, addPartyDateArr] = [applyAddPartyDate.split("-"), addPartyDate.split("-")];
  622. // 出生日期数据
  623. const [birthYear, birthMonth, birthDay] = applyAddPartyDateArr;
  624. // 指定日期数据
  625. const [specifyYear, specifyMonth, specifyDay] = addPartyDateArr;
  626. if (specifyYear == birthYear) {
  627. return 0; // 同年 则为0岁
  628. } else {
  629. // 年之差
  630. const ageDiff = specifyYear - birthYear;
  631. if (ageDiff > 0) {
  632. // 月份相等
  633. if (specifyMonth == birthMonth) {
  634. // 日之差
  635. const dayDiff = specifyDay - birthDay;
  636. // 日之差小于0
  637. if (dayDiff < 0) {
  638. return ageDiff - 1;
  639. }
  640. return ageDiff; // 日之差大于等于0
  641. }
  642. // 月之差
  643. const monthDiff = specifyMonth - birthMonth;
  644. // 月之差小于0
  645. if (monthDiff < 0) {
  646. return ageDiff - 1;
  647. }
  648. return ageDiff; // 月之差大于等于0
  649. }
  650. return '—'; // 返回— 表示出生日期输入错误或晚于今天
  651. }
  652. }
  653. }
  654. };
  655. </script>
  656. <style scoped lang="scss">
  657. .fullpartymember {
  658. &-head {
  659. display: flex;
  660. align-items: center;
  661. justify-content: space-between;
  662. margin-bottom: 15px;
  663. width: 100%;
  664. padding: 10px 20px;
  665. background-color: #ffffff;
  666. border-radius: 10px;
  667. &-title {
  668. display: flex;
  669. align-items: center;
  670. div {
  671. &:first-child {
  672. height: 37px;
  673. line-height: 37px;
  674. }
  675. &:last-child {
  676. margin-left: 15px;
  677. height: 37px;
  678. font-size: 26px;
  679. font-weight: 400;
  680. color: #4f4f4f;
  681. line-height: 37px;
  682. letter-spacing: 1px;
  683. }
  684. img {
  685. width: 34px;
  686. height: 34px;
  687. }
  688. }
  689. }
  690. &-btn {
  691. display: flex;
  692. align-items: center;
  693. div {
  694. &:first-child {
  695. margin-right: 15px;
  696. height: 37px;
  697. font-size: 16px;
  698. font-weight: 400;
  699. color: #646464;
  700. line-height: 37px;
  701. letter-spacing: 1px;
  702. }
  703. }
  704. &-card {
  705. margin-right: 10px;
  706. font-size: 26px;
  707. cursor: pointer;
  708. color: #909090;
  709. &.is-active {
  710. color: #e53333;
  711. }
  712. }
  713. &-list {
  714. font-size: 28px;
  715. cursor: pointer;
  716. color: #909090;
  717. &.is-active {
  718. color: #e53333;
  719. }
  720. }
  721. }
  722. }
  723. &-main {
  724. padding: 20px 20px 72px;
  725. min-height: 660px;
  726. background: url("../../../assets/images/home-head-img.png"), #ffffff;
  727. background-size: 67px 67px, cover;
  728. background-position: right 20px bottom 5px, center;
  729. background-repeat: no-repeat, no-repeat;
  730. border-radius: 10px;
  731. &-list {
  732. position: relative;
  733. margin: 20px 0 10px;
  734. width: 100%;
  735. .list-row {
  736. position: relative;
  737. width: 100%;
  738. .list-cell {
  739. float: left;
  740. margin: 0 10px 20px 10px;
  741. // overflow: hidden;
  742. width: 203px;
  743. height: 283px;
  744. background: #de0010;
  745. &-name {
  746. display: flex;
  747. justify-content: center;
  748. align-items: center;
  749. margin-top: -5px;
  750. width: 100%;
  751. height: 45px;
  752. font-size: 20px;
  753. font-weight: 400;
  754. color: #ffffff;
  755. line-height: 28px;
  756. opacity: 0.8;
  757. }
  758. &-img {
  759. &-type {
  760. position: absolute;
  761. width: 70px;
  762. height: 48px;
  763. background-image: url("../../../assets/images/list-cell-img-type-bg.png");
  764. background-size: cover;
  765. background-position: center;
  766. background-repeat: no-repeat;
  767. &-content {
  768. margin: 3px 0 0 8px;
  769. transform: rotate(-35deg);
  770. -ms-transform: rotate(-35deg); /* IE 9 */
  771. -moz-transform: rotate(-35deg); /* Firefox */
  772. -webkit-transform: rotate(-35deg); /* Safari 和 Chrome */
  773. -o-transform: rotate(-35deg); /* Opera */
  774. width: 40px;
  775. height: 35px;
  776. font-size: 16px;
  777. font-weight: 400;
  778. color: #ffffff;
  779. line-height: 22px;
  780. }
  781. }
  782. img {
  783. width: 203px;
  784. height: 239px;
  785. border: 1px solid #dcdfe6;
  786. }
  787. .list-cell-shield {
  788. display: none;
  789. position: absolute;
  790. margin-top: -243px;
  791. width: 203px;
  792. height: 239px;
  793. background-image: none;
  794. background-color: rgba(0, 0, 0, 0.3);
  795. &-content {
  796. padding: 20px 30px;
  797. width: 100%;
  798. .shield-content-label {
  799. width: 100%;
  800. font-weight: 400;
  801. font-size: 20px;
  802. color: #ffffff;
  803. }
  804. .shield-content-datetime {
  805. margin: 20px 0 40px;
  806. width: 100%;
  807. font-weight: 400;
  808. font-size: 18px;
  809. color: #ffffff;
  810. }
  811. .shield-content-relation {
  812. display: flex;
  813. justify-content: center;
  814. align-items: center;
  815. margin-top: 20px;
  816. width: 100%;
  817. font-weight: 400;
  818. font-size: 14px;
  819. color: #ffffff;
  820. cursor: pointer;
  821. }
  822. }
  823. }
  824. &:hover .list-cell-shield {
  825. display: block;
  826. }
  827. }
  828. }
  829. }
  830. &-nodata {
  831. display: flex;
  832. justify-content: center;
  833. align-items: center;
  834. width: 100%;
  835. height: 386px;
  836. border: 1px solid #b5b5b5;
  837. border-radius: 5px;
  838. color: #747474;
  839. opacity: 0.8;
  840. }
  841. }
  842. }
  843. &-addpage {
  844. &-head {
  845. margin-bottom: 20px;
  846. width: 100%;
  847. padding: 15px 20px;
  848. background: url("../../../assets/images/home-head-img.png"), #ffffff;
  849. background-size: 67px 67px, cover;
  850. background-position: right 5px bottom 0px, center;
  851. background-repeat: no-repeat, no-repeat;
  852. border-radius: 10px;
  853. &-title {
  854. display: flex;
  855. align-items: center;
  856. div {
  857. &:first-child {
  858. height: 37px;
  859. line-height: 37px;
  860. }
  861. &:last-child {
  862. margin-left: 15px;
  863. height: 37px;
  864. font-size: 26px;
  865. font-weight: 400;
  866. color: #4f4f4f;
  867. line-height: 37px;
  868. letter-spacing: 1px;
  869. }
  870. img {
  871. width: 34px;
  872. height: 34px;
  873. }
  874. }
  875. }
  876. }
  877. }
  878. }
  879. </style>