view.vue 17 KB

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