view.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599
  1. <template>
  2. <el-dialog title="公积金人员信息" v-model="visible" width="70%" append-to-body draggable @close="close"
  3. :close-on-click-modal="false">
  4. <!-- 功能按钮 -->
  5. <div style="padding: 8px 24px 16px 24px">
  6. <el-form size="small" label-width="120px" v-model="form">
  7. <el-row :gutter="30">
  8. <el-col :span="12">
  9. <el-form-item label="客户名称">
  10. <div>{{ form.companyName }}</div>
  11. </el-form-item>
  12. </el-col>
  13. <el-col :span="12">
  14. <el-form-item label="所属月份">
  15. <div>{{ form.year }}-{{ form.month }}</div>
  16. </el-form-item>
  17. </el-col>
  18. <el-col v-if="form.status === 4" :span="12">
  19. <el-form-item label="驳回原因">
  20. <div>{{ form.feedbackContent }}</div>
  21. </el-form-item>
  22. </el-col>
  23. <el-col :span="12">
  24. <el-form-item label="窗口缴纳:" required class="edit-label">
  25. <template #label>
  26. <div>窗口缴纳</div>
  27. </template>
  28. <div>{{ form.isPayOnWindow === 1 ? "是" : "否" }}</div>
  29. </el-form-item>
  30. </el-col>
  31. <el-col :span="12">
  32. <el-form-item label="公积金单位账号" required class="edit-label">
  33. <template #label>
  34. <div>公积金单位账号</div>
  35. </template>
  36. <div>{{ form.housingFundUnitAccount }}</div>
  37. </el-form-item>
  38. </el-col>
  39. <el-col :span="12">
  40. <el-form-item label="公积金秘钥密码" required class="edit-label">
  41. <template #label>
  42. <div>公积金秘钥密码</div>
  43. </template>
  44. <div>{{ form.housingFundPassword }}</div>
  45. </el-form-item>
  46. </el-col>
  47. <el-col :span="12">
  48. <el-form-item label="公积金划款密码" required class="edit-label">
  49. <template #label>
  50. <div>公积金划款密码</div>
  51. </template>
  52. <div>{{ form.housingFundDeductionPassword }}</div>
  53. </el-form-item>
  54. </el-col>
  55. <el-col :span="24" class="details-container">
  56. <!--操作按钮 开始-->
  57. <div class="details-head">
  58. <div class="title">
  59. <i class="fa fa-th-list" aria-hidden="true" /> 人员信息
  60. <el-button class="button-class" size="small" @click="printSalary" icon="printer"
  61. type="primary">打印</el-button>
  62. <el-button class="button-class" size="small" @click="exportSalary" icon="download"
  63. type="info">导出</el-button>
  64. </div>
  65. </div>
  66. <div class="details-body">
  67. <div>
  68. <el-table ref="sourceTable" :data="form.details" size="small" border
  69. highlight-current-row header-row-class-name="list-header-row" @selection-change="handleCheckChange"
  70. @current-change="handleCurrentChange" :row-class-name="tableRowClassName">
  71. <el-table-column type="selection" width="40" align="center" />
  72. <el-table-column type="index" label="序号" width="55" align="center" />
  73. <el-table-column label="姓名" width="80" align="center">
  74. <template #default="scope">
  75. <div>
  76. {{ scope.row.employeeName }}
  77. </div>
  78. <span style="
  79. color: red;
  80. position: absolute;
  81. z-index: 10;
  82. top: 4px;
  83. right: 6px;
  84. ">*</span>
  85. </template>
  86. </el-table-column>
  87. <el-table-column label="电话号" width="130" align="center">
  88. <template #default="scope">
  89. <div>
  90. {{ scope.row.phone }}
  91. </div>
  92. <span style="
  93. color: red;
  94. position: absolute;
  95. z-index: 10;
  96. top: 4px;
  97. right: 6px;
  98. ">*</span>
  99. </template>
  100. </el-table-column>
  101. <el-table-column label="身份证正面" width="120" align="center">
  102. <template #default="scope">
  103. <div class="show-image" style="display: flex; justify-content: center">
  104. <img class="img" :src="baseUrl + '/' + scope.row.idCardImage" alt=""
  105. @click="handleImageView(scope.row.idCardImage)" />
  106. </div>
  107. <span style="
  108. color: red;
  109. position: absolute;
  110. z-index: 10;
  111. top: 4px;
  112. right: 6px;
  113. ">*</span>
  114. </template>
  115. </el-table-column>
  116. <el-table-column label="身份证反面" width="120" align="center">
  117. <template #default="scope">
  118. <div class="show-image" style="display: flex; justify-content: center">
  119. <img class="img" :src="baseUrl + '/' + scope.row.idCardImageBack" alt=""
  120. @click="handleImageView(scope.row.idCardImageBack)" />
  121. </div>
  122. <span style="
  123. color: red;
  124. position: absolute;
  125. z-index: 10;
  126. top: 4px;
  127. right: 6px;
  128. ">*</span>
  129. </template>
  130. </el-table-column>
  131. <el-table-column label="基数" width="100" align="center">
  132. <template #default="scope">
  133. <div>
  134. {{ rowNum(scope.row.cardinalNumber) }}
  135. </div>
  136. <span style="
  137. color: red;
  138. position: absolute;
  139. z-index: 10;
  140. top: 4px;
  141. right: 6px;
  142. ">*</span>
  143. </template>
  144. </el-table-column>
  145. <el-table-column label="比例" width="100" align="center">
  146. <template #default="scope">
  147. <div>{{ scope.row.ratio }}%</div>
  148. <span style="
  149. color: red;
  150. position: absolute;
  151. z-index: 10;
  152. top: 4px;
  153. right: 6px;
  154. ">*</span>
  155. </template>
  156. </el-table-column>
  157. <el-table-column label="备注" header-align="center">
  158. <template #default="scope">
  159. <div>
  160. {{ scope.row.remark }}
  161. </div>
  162. </template>
  163. </el-table-column>
  164. </el-table>
  165. </div>
  166. </div>
  167. </el-col>
  168. <el-col :span="24">
  169. <el-divider />
  170. </el-col>
  171. <el-col :span="24">
  172. <el-form-item label="是否变更">
  173. {{ form.isChanged === 1 ? "是" : "否" }}
  174. </el-form-item>
  175. </el-col>
  176. <el-col :span="24">
  177. <el-form-item label="备注">
  178. {{ form.content }}
  179. </el-form-item>
  180. </el-col>
  181. <el-col v-if="showVerify()" :span="24">
  182. <el-divider />
  183. </el-col>
  184. <el-col v-if="showVerify()" :span="24">
  185. <el-form-item label="备注">
  186. <el-input v-model.trim="form.verifyContent" type="textarea" rows="2" />
  187. </el-form-item>
  188. </el-col>
  189. </el-row>
  190. </el-form>
  191. </div>
  192. <div class="form-btns-container" style="height: 40px">
  193. <el-button v-show="showVerify()" type="danger" size="small" style="float: right; margin-left: 12px" icon="back"
  194. @click="handleVerify(4)">
  195. 驳回</el-button>
  196. <el-button v-show="showVerify()" type="primary" size="small" icon="check" style="float: right; margin-left: 12px"
  197. @click="handleVerify(3)">审核通过</el-button>
  198. <el-button v-show="verifiableDelete() && form.status === 3" type="warning" size="small" icon="back"
  199. style="float: right; margin-left: 12px" @click="returnStatus()">退回</el-button>
  200. </div>
  201. <feedback-dialog ref="feedbackDialogView" :verify="verify" />
  202. <el-image-viewer v-if="showViewer" :url-list="currentFileList" @close="closeImages" :initial-index="showIndex" />
  203. <!-- <print-dialog ref="printDialog" /> -->
  204. </el-dialog>
  205. </template>
  206. <script setup>
  207. import {
  208. getDetail,
  209. verifyDetail,
  210. turnBackDetail,
  211. exportHousingFundConfirmEmployee,
  212. exportHousingFundConfirmPdf,
  213. } from "@/api/business/production/housingFundConfirm";
  214. import feedbackDialog from "../feedbackDialog.vue";
  215. import useUserStore from "@/store/modules/user";
  216. import { rowNum } from "@/utils/index";
  217. import { ref } from "vue";
  218. const { proxy } = getCurrentInstance();
  219. const visible = ref(false);
  220. const width = ref(800);
  221. const selections = ref([]);
  222. const currentSource = ref(null);
  223. const showViewer = ref(false);
  224. const currentFileList = ref([]);
  225. const showIndex = ref(0);
  226. const editStatus = ref(false);
  227. const baseUrl = ref(import.meta.env.VITE_APP_BASE_API);
  228. const permissions = useUserStore().permissions;
  229. const all_permission = "*:*:*";
  230. const feedbackDialogView = ref(null);
  231. const confirmChoices = ref([
  232. {
  233. label: "是",
  234. value: 1,
  235. },
  236. {
  237. label: "否",
  238. value: 0,
  239. },
  240. ]);
  241. const props = defineProps({
  242. getList: {
  243. type: Function,
  244. default: () => { },
  245. },
  246. });
  247. const { getList } = toRefs(props);
  248. const total = ref(0);
  249. const employeeEmptyData = {
  250. id: null,
  251. title: "",
  252. remark: "",
  253. employeeName: "",
  254. departmentName: "",
  255. idCode: "",
  256. salaryAmount: "",
  257. bonusAmount: "",
  258. allowanceAmount: "",
  259. subsidyAmount: "",
  260. absenceCut: "",
  261. planSalary: 0,
  262. actuallySalary: 0,
  263. endowmentInsurance: 0,
  264. medicalInsurance: 0,
  265. unemploymentBenefit: 0,
  266. seriousIllnessInsurance: 0,
  267. housingFund: 0,
  268. otherCut: 0,
  269. cumulativeIncome: 0,
  270. cumulativeSpecialCut: 0,
  271. cumulativeChildEduCut: 0,
  272. cumulativeHouseLoanInterestCut: 0,
  273. cumulativeHouseRentCut: 0,
  274. cumulativeSupportElderCut: 0,
  275. cumulativeContinuingEduCut: 0,
  276. cumulativeBabyCareCut: 0,
  277. sumSpecialCumulativeCut: 0,
  278. cumulativeOtherCut: 0,
  279. cumulativeIndividualIncomeTax: 0,
  280. cumulativeHasPaidIit: 0,
  281. currentIndividualIncomeTax: 0,
  282. idiograph: "",
  283. details: [],
  284. editStatus: true,
  285. };
  286. const form = ref({
  287. amount: null,
  288. details: [],
  289. });
  290. const emptyForm = {
  291. details: [],
  292. };
  293. function open(detail) {
  294. console.log(detail);
  295. visible.value = true;
  296. form.value = detail;
  297. loadData();
  298. }
  299. function loadData() {
  300. getDetail(form.value).then((res) => {
  301. form.value = { ...proxy.deepClone(emptyForm), ...res.data };
  302. computeTotal();
  303. });
  304. }
  305. function close() {
  306. visible.value = false;
  307. reset();
  308. }
  309. function reset() {
  310. form.value = proxy.deepClone(emptyForm);
  311. total.value = 0;
  312. }
  313. //人员信息打印
  314. function printSalary() {
  315. exportHousingFundConfirmPdf(form.value.id);
  316. }
  317. //人员信息导出
  318. function exportSalary() {
  319. exportHousingFundConfirmEmployee(form.value.id);
  320. }
  321. function showVerify() {
  322. if (
  323. form.value.id == null ||
  324. form.value.status === 0 ||
  325. form.value.status === 3 ||
  326. form.value.status === 4
  327. ) {
  328. return false;
  329. } else if (verifiable()) {
  330. return true;
  331. } else {
  332. return false;
  333. }
  334. }
  335. function verifiableDelete(){
  336. return (
  337. permissions.includes(all_permission) ||
  338. permissions.includes("business:housingFundConfirm:return")
  339. );
  340. }
  341. function verifiable() {
  342. return (
  343. permissions.includes(all_permission) ||
  344. permissions.includes("business:housingFundConfirm:verify")
  345. );
  346. }
  347. function handleCurrentChange(row) {
  348. currentSource.value = row;
  349. }
  350. function handleCheckChange(selection) {
  351. selections.value = selection.map((item) => item);
  352. }
  353. function getSummaries(param) {
  354. const { columns, data } = param;
  355. const sums = [];
  356. columns.forEach((column, index) => {
  357. if (index === 0) {
  358. sums[index] = "合计";
  359. return;
  360. } else if (index === 1) {
  361. sums[index] = "";
  362. return;
  363. }
  364. const values = data.map((item) => Number(item[column.property]));
  365. if (!values.every((value) => isNaN(value))) {
  366. sums[index] = values.reduce((prev, curr) => {
  367. const value = Number(curr);
  368. if (!isNaN(value)) {
  369. return (Number(prev) + Number(curr)).toFixed(2);
  370. } else {
  371. return Number(prev).toFixed(2);
  372. }
  373. }, 0);
  374. } else {
  375. sums[index] = "";
  376. }
  377. });
  378. return sums;
  379. }
  380. function handleVerify(status) {
  381. if (status === 4) {
  382. const saveValue = proxy.deepClone(form.value);
  383. saveValue.status = status;
  384. feedbackDialogView.value.open(saveValue);
  385. } else {
  386. proxy.$modal
  387. .confirm("确认审核么?")
  388. .then((_) => {
  389. const saveValue = proxy.deepClone(form.value);
  390. saveValue.status = status;
  391. verify(saveValue);
  392. })
  393. .catch((_) => {
  394. proxy.$modal.msg("已取消审核");
  395. });
  396. }
  397. }
  398. function verify(data) {
  399. verifyDetail(data).then((res) => {
  400. reset();
  401. getList.value();
  402. close();
  403. });
  404. }
  405. function rowChangeSum(row) {
  406. let actuallySalary = 0;
  407. actuallySalary += row.planSalary == null ? 0 : row.planSalary;
  408. actuallySalary += row.bonusAmount == null ? 0 : row.bonusAmount;
  409. actuallySalary -= row.endowmentInsurance == null ? 0 : row.endowmentInsurance;
  410. actuallySalary -= row.medicalInsurance == null ? 0 : row.medicalInsurance;
  411. actuallySalary -=
  412. row.unemploymentBenefit == null ? 0 : row.unemploymentBenefit;
  413. actuallySalary -=
  414. row.seriousIllnessInsurance == null ? 0 : row.seriousIllnessInsurance;
  415. actuallySalary -= row.housingFund == null ? 0 : row.housingFund;
  416. if (form.value.hasIndividualIncomeTax === 1) {
  417. actuallySalary -=
  418. row.individualIncomeTaxConfirm == null
  419. ? 0
  420. : row.individualIncomeTaxConfirm;
  421. } else {
  422. actuallySalary -=
  423. row.currentIndividualIncomeTax == null
  424. ? 0
  425. : row.currentIndividualIncomeTax;
  426. }
  427. actuallySalary -= row.otherCut == null ? 0 : row.otherCut;
  428. row.actuallySalary = actuallySalary;
  429. computeTotal();
  430. }
  431. function computeTotal() {
  432. let totalSalay = 0;
  433. form.value.details.forEach((l) => {
  434. totalSalay += l.actuallySalary == null ? 0 : l.actuallySalary;
  435. });
  436. form.value.amount = totalSalay.toFixed(2);
  437. }
  438. function returnStatus(status) {
  439. proxy.$modal
  440. .confirm("确认退回么?")
  441. .then((_) => {
  442. turnBackDetail(form.value).then((res) => {
  443. // if (res.data.successStatus = true) {
  444. // reset()
  445. // getList.value()
  446. // close()
  447. // } else {
  448. // proxy.$modal.msg(res.data.message)
  449. // }
  450. reset();
  451. getList.value();
  452. close();
  453. });
  454. })
  455. .catch((_) => {
  456. proxy.$modal.msg("已取消退回");
  457. });
  458. }
  459. function changeIndividual(arg) {
  460. // if (arg === 1) {
  461. form.value.details.forEach((row) => {
  462. let actuallySalary = 0;
  463. actuallySalary += row.planSalary == null ? 0 : row.planSalary;
  464. actuallySalary += row.bonusAmount == null ? 0 : row.bonusAmount;
  465. actuallySalary -=
  466. row.endowmentInsurance == null ? 0 : row.endowmentInsurance;
  467. actuallySalary -= row.medicalInsurance == null ? 0 : row.medicalInsurance;
  468. actuallySalary -=
  469. row.unemploymentBenefit == null ? 0 : row.unemploymentBenefit;
  470. actuallySalary -=
  471. row.seriousIllnessInsurance == null ? 0 : row.seriousIllnessInsurance;
  472. actuallySalary -= row.housingFund == null ? 0 : row.housingFund;
  473. if (arg === 1) {
  474. actuallySalary -=
  475. row.individualIncomeTaxConfirm == null
  476. ? 0
  477. : row.individualIncomeTaxConfirm;
  478. } else {
  479. actuallySalary -=
  480. row.currentIndividualIncomeTax == null
  481. ? 0
  482. : row.currentIndividualIncomeTax;
  483. }
  484. actuallySalary -= row.otherCut == null ? 0 : row.otherCut;
  485. row.actuallySalary = actuallySalary;
  486. });
  487. computeTotal();
  488. }
  489. function passwordCheckHandler(value, field) {
  490. // console.log(value)
  491. if (!passwordCheck(form.value[field])) {
  492. proxy.$modal.msgError("请输入正确密码");
  493. }
  494. }
  495. function handleImageView(fileUrl) {
  496. window.open(`${baseUrl.value}${fileUrl}`);
  497. }
  498. function closeImages() {
  499. showViewer.value = false;
  500. }
  501. function amountChange() {
  502. let amount = 0;
  503. if (form.value.details.length > 0) {
  504. for (let i = 0; i < form.value.details.length; i++) {
  505. amount = amount + form.value.details[i].arriveAmount;
  506. }
  507. // 判断到款状态
  508. form.value.arriveAmount = amount;
  509. if (form.value.arriveAmount > 0)
  510. form.value.arriveStatus =
  511. form.value.arriveAmount === form.value.amount ? 1 : 2;
  512. else form.value.arriveStatus = 0;
  513. }
  514. }
  515. function tableRowClassName({ row, index }) {
  516. if (row.changeStatus === 1) {
  517. return "list-row add-row";
  518. } else if (row.changeStatus === 2) {
  519. return "list-row delete-row";
  520. } else {
  521. return "list-row";
  522. }
  523. }
  524. // 暴露给父组件的方法
  525. defineExpose({
  526. open,
  527. });
  528. </script>
  529. <style scoped>
  530. .img {
  531. width: 23px;
  532. height: 23px;
  533. display: flex;
  534. justify-content: center;
  535. align-items: center;
  536. }
  537. .button-class {
  538. margin-top: 15px;
  539. margin-bottom: 15px;
  540. }
  541. ::v-deep(.el-upload) {
  542. display: flex;
  543. text-align: center;
  544. justify-content: center;
  545. cursor: pointer;
  546. outline: 0;
  547. }
  548. .required::after {
  549. content: "*";
  550. color: red;
  551. }
  552. </style>
  553. <style>
  554. .el-table .delete-row {
  555. background-color: rgb(251, 159, 173);
  556. }
  557. .el-table .add-row {
  558. background-color: rgb(184, 234, 147);
  559. }
  560. </style>