index.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863
  1. <template>
  2. <div class="page-container list-container">
  3. <!-- 功能按钮区 -->
  4. <div class="list-btns-container">
  5. <el-dropdown style="margin-top: 2px">
  6. <el-button type="primary" size="small">
  7. 其它<el-icon class="el-icon--right"><arrow-down /></el-icon>
  8. </el-button>
  9. <template #dropdown>
  10. <el-dropdown-menu>
  11. <el-dropdown-item
  12. icon="Download"
  13. @click="handleExport"
  14. v-hasPermi="['business:deposit:export']"
  15. >
  16. 导出</el-dropdown-item
  17. >
  18. <!-- <el-dropdown-item type="warning" size="small" icon="Download" @click="handleArea"
  19. v-hasPermi="['business:deposit:export']"> area</el-dropdown-item> -->
  20. </el-dropdown-menu>
  21. </template>
  22. </el-dropdown>
  23. <el-radio-group
  24. v-model="queryRadio"
  25. style="margin-left: 20px; height: 100%"
  26. size="small"
  27. @change="radioChangeHandler"
  28. >
  29. <el-radio-button label="全部" />
  30. <el-radio-button label="待确认扣款" />
  31. <el-radio-button label="可扣款" />
  32. <el-radio-button label="已申报" />
  33. <el-radio-button label="已扣款" />
  34. <el-radio-button label="扣款失败" />
  35. </el-radio-group>
  36. <!-- <el-button type="warning" size="small" icon="Download" @click="handleExport"
  37. v-hasPermi="['business:deposit:export']">导出</el-button> -->
  38. <!--<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>-->
  39. </div>
  40. <!-- 搜索区 -->
  41. <el-form
  42. class="list-search-container"
  43. size="small"
  44. :model="queryParams"
  45. ref="queryRef"
  46. :inline="true"
  47. label-width="78px"
  48. >
  49. <el-form-item label="来源名:">
  50. <el-select
  51. v-model="queryParams.sourceNames"
  52. placeholder="请选择来源名"
  53. multiple
  54. >
  55. <el-option
  56. v-for="item in sources"
  57. :key="item.value"
  58. :label="item.label"
  59. :value="item.value"
  60. />
  61. </el-select>
  62. </el-form-item>
  63. <el-form-item label="客户名称:">
  64. <el-input
  65. v-model.trim="queryParams.companyName"
  66. size="small"
  67. type="text"
  68. placeholder="客户名称"
  69. :clearable="true"
  70. style="width: 140px"
  71. />
  72. </el-form-item>
  73. <el-form-item label="所属期:">
  74. <el-date-picker
  75. v-model="queryParams.currentMonth"
  76. type="month"
  77. format="YYYY年MM月"
  78. value-format="YYYY-MM"
  79. style="width: 130px"
  80. />
  81. </el-form-item>
  82. <el-form-item label="是否自己负责:">
  83. <el-switch v-model="oneself" @change="handleOneself" />
  84. </el-form-item>
  85. <el-form-item>
  86. <el-button type="primary" icon="Search" @click="handleQuery"
  87. >搜索</el-button
  88. >
  89. <el-button icon="operation" @click="moreSearch = true">更多</el-button>
  90. <el-button icon="Refresh" @click="resetQuery">重置</el-button>
  91. </el-form-item>
  92. </el-form>
  93. <!-- 列表区 -->
  94. <el-table
  95. v-loading="loading"
  96. :data="list"
  97. size="small"
  98. border
  99. height="100%"
  100. @selection-change="handleSelectionChange"
  101. >
  102. <el-table-column type="selection" width="55" align="center" />
  103. <el-table-column
  104. label="客户名"
  105. prop="companyName"
  106. min-width="250"
  107. align="center"
  108. />
  109. <el-table-column
  110. label="来源"
  111. min-width="100"
  112. align="center"
  113. prop="fromCompanyName"
  114. />
  115. <el-table-column
  116. label="纳税性质"
  117. prop="taxType"
  118. width="100"
  119. align="center"
  120. />
  121. <el-table-column
  122. label="扣款期"
  123. prop="currentMonth"
  124. min-width="100"
  125. align="center"
  126. >
  127. <template #default="scope">
  128. {{ scope.row.year }}年{{ scope.row.month }}月
  129. </template>
  130. </el-table-column>
  131. <el-table-column
  132. label="来源名"
  133. prop="sourceName"
  134. width="150"
  135. align="center"
  136. />
  137. <el-table-column label="金额" prop="amount" width="150" align="center">
  138. <template #default="scope">
  139. <el-button
  140. v-if="scope.row.deductible === 1"
  141. type="primary"
  142. link
  143. size="small"
  144. @click="amountDetail(scope.row)"
  145. >{{ scope.row.amount }}</el-button
  146. >
  147. </template>
  148. </el-table-column>
  149. <el-table-column
  150. label="确认人"
  151. prop="confirmName"
  152. width="110"
  153. align="center"
  154. />
  155. <el-table-column
  156. label="确认时间"
  157. prop="confirmDate"
  158. min-width="140"
  159. align="center"
  160. />
  161. <el-table-column
  162. label="操作人"
  163. prop="operationName"
  164. width="100"
  165. align="center"
  166. />
  167. <el-table-column
  168. label="操作时间"
  169. min-width="140"
  170. prop="operationDate"
  171. align="center"
  172. />
  173. <el-table-column label="文件查看" align="center" width="100">
  174. <template #default="scope">
  175. <el-button
  176. v-if="scope.row.status === 2"
  177. size="small"
  178. type="primary"
  179. link
  180. @click="showFiles(scope.row)"
  181. >查看文件</el-button
  182. >
  183. <span v-else>--</span>
  184. </template>
  185. </el-table-column>
  186. <el-table-column label="状态" width="100" align="center">
  187. <template #default="scope">
  188. <span v-if="scope.row.status === 0">待审核</span>
  189. <span v-if="scope.row.status === 1">可扣款</span>
  190. <span v-if="scope.row.status === 2">已扣款</span>
  191. <el-tooltip
  192. v-if="scope.row.status === 4"
  193. :content="
  194. scope.row.failureType === 1 ? scope.row.failureResult : '余额不足'
  195. "
  196. placement="top"
  197. >
  198. <span>扣款失败</span>
  199. </el-tooltip>
  200. <span v-if="scope.row.status === 5">已申报</span>
  201. </template>
  202. </el-table-column>
  203. <el-table-column label="操作" fixed="right" width="220" align="center">
  204. <template #default="scope">
  205. <template v-if="scope.row.deductible === 1">
  206. <el-button
  207. v-hasPermi="['business:deduction:confirm']"
  208. v-show="
  209. (scope.row.status === 0 || scope.row.status === 4) &&
  210. checkConfirm(scope.row)
  211. "
  212. link
  213. type="primary"
  214. size="small"
  215. @click="showConfirm(scope.row)"
  216. >确认扣款</el-button
  217. >
  218. <div v-if="scope.row.sourceName === '公积金'">
  219. <el-button
  220. link
  221. v-hasPermi="['business:deduction:declare']"
  222. v-show="scope.row.status === 1"
  223. style="margin-right: 5px"
  224. type="primary"
  225. size="small"
  226. @click="applySuccess(scope.row, 5)"
  227. >申报成功</el-button
  228. >
  229. </div>
  230. <div
  231. v-if="scope.row.sourceName === '公积金'"
  232. style="margin-left: 26px; display: flex; align-items: center"
  233. >
  234. <el-button
  235. link
  236. v-hasPermi="['business:deduction:deduction']"
  237. v-show="scope.row.status === 5"
  238. style="margin-left: 5px; :5px "
  239. type="primary"
  240. size="small"
  241. @click="showFeedbackDialog(scope.row)"
  242. >扣款失败</el-button
  243. >
  244. <el-button
  245. link
  246. v-hasPermi="['business:deduction:deduction']"
  247. v-show="scope.row.status === 5"
  248. style="margin-right: 5px"
  249. type="primary"
  250. size="small"
  251. @click="openUpload(scope.row)"
  252. >扣款成功</el-button
  253. >
  254. </div>
  255. <div
  256. v-else
  257. style="margin-left: 26px; display: flex; align-items: center"
  258. >
  259. <el-button
  260. link
  261. v-hasPermi="['business:deduction:deduction']"
  262. v-show="scope.row.status === 1"
  263. style="margin-right: 5px"
  264. type="primary"
  265. size="small"
  266. @click="openUpload(scope.row)"
  267. >扣款成功</el-button
  268. >
  269. <el-button
  270. link
  271. v-hasPermi="['business:deduction:deduction']"
  272. v-show="scope.row.status === 1"
  273. style="margin-left: 5px; :5px "
  274. type="primary"
  275. size="small"
  276. @click="showFeedbackDialog(scope.row)"
  277. >扣款失败</el-button
  278. >
  279. </div>
  280. </template>
  281. </template>
  282. </el-table-column>
  283. </el-table>
  284. <!-- <Deposit-form ref="DepositRef" :get-list="getList" /> -->
  285. <el-dialog
  286. title="扣款信息"
  287. v-model="formOpen"
  288. width="500px"
  289. append-to-body
  290. draggable
  291. @close="formCancel"
  292. >
  293. <el-form ref="dictRef" :model="form" label-width="100" size="small">
  294. <el-row :gutter="30">
  295. <el-col :span="24">
  296. <el-form-item label="扣款金额:">
  297. <div>{{ form.amount }}</div>
  298. </el-form-item>
  299. </el-col>
  300. <el-col :span="24">
  301. <el-form-item label="凭证附件:">
  302. <div class="details-btns-container" style="display: flex">
  303. <el-upload
  304. action="#"
  305. :http-request="upload"
  306. :with-credentials="true"
  307. :show-file-list="false"
  308. multiple
  309. >
  310. <el-button size="small" type="primary" icon="Upload"
  311. >点击上传</el-button
  312. >
  313. </el-upload>
  314. </div>
  315. <el-table
  316. ref="filesTable"
  317. :data="form.files"
  318. size="small"
  319. height="200px"
  320. border
  321. header-row-class-name="list-header-row"
  322. >
  323. <el-table-column
  324. type="index"
  325. label="序号"
  326. width="47"
  327. align="center"
  328. />
  329. <el-table-column
  330. label="文件名"
  331. prop="originalFileName"
  332. align="center"
  333. >
  334. <template #default="scope">
  335. <el-link
  336. :href="`${baseUrl}${scope.row.fileUrl}`"
  337. :underline="false"
  338. target="_blank"
  339. type="primary"
  340. >
  341. {{ scope.row.originalFileName }}
  342. </el-link>
  343. </template>
  344. </el-table-column>
  345. <el-table-column label="操作" width="47" align="center">
  346. <template #default="scope">
  347. <el-button
  348. link
  349. size="small"
  350. type="danger"
  351. @click="handleDelFile(scope.$index)"
  352. >删除</el-button
  353. >
  354. </template>
  355. </el-table-column>
  356. </el-table>
  357. </el-form-item>
  358. </el-col>
  359. </el-row>
  360. </el-form>
  361. <template #footer>
  362. <div class="dialog-footer">
  363. <el-button
  364. type="primary"
  365. size="small"
  366. icon="Finished"
  367. @click="saveHandler"
  368. >确 定</el-button
  369. >
  370. <el-button icon="close" size="small" @click="formCancel"
  371. >取 消</el-button
  372. >
  373. </div>
  374. </template>
  375. </el-dialog>
  376. <!-- 分页 -->
  377. <pagination
  378. v-show="total > 0"
  379. :total="total"
  380. v-model:page="queryParams.pageNum"
  381. v-model:limit="queryParams.pageSize"
  382. @pagination="getList"
  383. />
  384. <el-image-viewer
  385. v-if="showViewer"
  386. :url-list="currentFileList"
  387. @close="closeImages"
  388. :initial-index="showIndex"
  389. />
  390. <feedbackDialog ref="feedbackDialogRef" :verify="verifyDeduction" />
  391. <FileDialog ref="fileDialog" />
  392. <MergeTaxViewDialog ref="mergeTaxViewDialog" />
  393. <HousingFundViewDialog ref="housingFundViewDialog" />
  394. <SocialSecurityViewDialog ref="socialSecurityViewDialog" />
  395. <!-- 更多搜索弹窗 -->
  396. <el-dialog
  397. title="更多搜索"
  398. v-model="moreSearch"
  399. width="620px"
  400. append-to-body
  401. draggable
  402. >
  403. <el-form
  404. :model="queryParams"
  405. ref="queryRef"
  406. size="small"
  407. :rules="rules"
  408. label-width="100"
  409. >
  410. <el-row :gutter="20">
  411. <el-col :span="12">
  412. <el-form-item label="客户名称:">
  413. <el-input
  414. v-model.trim="queryParams.companyName"
  415. size="small"
  416. type="text"
  417. placeholder="客户名称"
  418. :clearable="true"
  419. />
  420. </el-form-item>
  421. <el-form-item label="来源名:" prop="sourceNames">
  422. <el-select
  423. v-model="queryParams.sourceNames"
  424. placeholder="请选择来源名"
  425. multiple
  426. >
  427. <el-option
  428. v-for="item in sources"
  429. :key="item.value"
  430. :label="item.label"
  431. :value="item.value"
  432. />
  433. </el-select>
  434. </el-form-item>
  435. <el-form-item label="来源:" prop="fromCompanyName">
  436. <el-input
  437. size="small"
  438. v-model="queryParams.fromCompanyName"
  439. type="text"
  440. placeholder="客户来源"
  441. :clearable="true"
  442. />
  443. </el-form-item>
  444. </el-col>
  445. <el-col :span="12">
  446. <el-form-item label="纳税性质:" prop="taxType">
  447. <el-select
  448. size="small"
  449. v-model="queryParams.taxType"
  450. placeholder="请选择纳税性质"
  451. :clearable="true"
  452. @change="taxTypeChange"
  453. >
  454. <el-option
  455. v-for="item in taxTypes"
  456. :key="item.label"
  457. :label="item.label"
  458. :value="item.value"
  459. />
  460. </el-select>
  461. </el-form-item>
  462. <el-form-item label="所属期:">
  463. <el-date-picker
  464. v-model="queryParams.currentMonth"
  465. type="month"
  466. format="YYYY年MM月"
  467. value-format="YYYY-MM"
  468. />
  469. </el-form-item>
  470. </el-col>
  471. </el-row>
  472. </el-form>
  473. <template #footer>
  474. <div class="dialog-footer">
  475. <el-button
  476. type="primary"
  477. icon="Finished"
  478. size="small"
  479. @click="handleQuery"
  480. >确 定</el-button
  481. >
  482. <el-button icon="close" size="small" @click="moreSearch = false"
  483. >取 消</el-button
  484. >
  485. </div>
  486. </template>
  487. </el-dialog>
  488. </div>
  489. </template>
  490. <script setup name="Company">
  491. import {
  492. listDeduction,
  493. exportDeposition,
  494. saveDeduction,
  495. } from "@/api/business/production/deduction";
  496. import MergeTaxViewDialog from "./MergeTaxViewDialog.vue";
  497. import feedbackDialog from "./feedbackDialog.vue";
  498. import { uploadFile } from "@/api/tool/file";
  499. import { listCompany } from "@/api/business/crm/company";
  500. import { taxTypes } from "@/utils/default";
  501. import useUserStore from "@/store/modules/user";
  502. import { getTenant } from "@/utils/auth";
  503. import { ref } from "vue";
  504. import FileDialog from "../../dialog/fileDialog.vue";
  505. import HousingFundViewDialog from "./HousingFundViewDialog";
  506. import SocialSecurityViewDialog from "./SocialSecurityViewDialog";
  507. // import DepositForm from "./form"
  508. const { proxy } = getCurrentInstance();
  509. /** 字典数组区 */
  510. /** 查询 对象 */
  511. const list = ref([]);
  512. const loading = ref(true);
  513. const ids = ref([]);
  514. const single = ref(true);
  515. const multiple = ref(true);
  516. const oneself = ref(false);
  517. const moreSearch = ref(false);
  518. const total = ref(0);
  519. const prev = ref([]);
  520. const baseUrl = ref(import.meta.env.VITE_APP_BASE_API);
  521. const showViewer = ref(false);
  522. const currentFileList = ref([]);
  523. const showIndex = ref(0);
  524. const queryRadio = ref("全部");
  525. const permissions = useUserStore().permissions;
  526. const sources = ref([
  527. {
  528. value: "税款",
  529. label: "税款",
  530. },
  531. {
  532. value: "社保",
  533. label: "社保",
  534. },
  535. {
  536. value: "公积金",
  537. label: "公积金",
  538. },
  539. ]);
  540. const formOpen = ref(false);
  541. const form = ref({
  542. id: null,
  543. companyName: "",
  544. companyId: null,
  545. remark: "",
  546. type: 1,
  547. files: [],
  548. });
  549. const emptyForm = {
  550. id: null,
  551. companyName: "",
  552. companyId: null,
  553. type: 1,
  554. remark: "",
  555. files: [],
  556. };
  557. const { verify_status } = proxy.useDict("verify_status");
  558. /** 查询对象 */
  559. const queryParams = ref({
  560. pageNum: 1,
  561. pageSize: 10,
  562. companyName: "",
  563. orderByColumn: "create_time",
  564. noContract: 1,
  565. });
  566. /*********************** 方法区 ****************************/
  567. /** 查询company列表 */
  568. function getList() {
  569. loading.value = true;
  570. listDeduction(queryParams.value).then((response) => {
  571. list.value = response.rows.map((l) => ({ ...l }));
  572. prev.value = proxy.deepClone(response.rows);
  573. total.value = response.total;
  574. loading.value = false;
  575. });
  576. }
  577. /** 是否为自己负责 */
  578. function handleOneself() {
  579. if (oneself.value) {
  580. queryParams.value.principal = useUserStore().user.userId;
  581. } else {
  582. queryParams.value.principal = null;
  583. }
  584. getList();
  585. }
  586. function radioChangeHandler(arg) {
  587. const query = {
  588. pageNum: 1,
  589. pageSize: 10,
  590. companyName: "",
  591. };
  592. switch (arg) {
  593. case "全部":
  594. query.status = null;
  595. break;
  596. case "待确认扣款":
  597. query.status = 0;
  598. break;
  599. case "可扣款":
  600. query.status = 1;
  601. break;
  602. case "已扣款":
  603. query.status = 2;
  604. break;
  605. case "已申报":
  606. query.status = 5;
  607. break;
  608. case "扣款失败":
  609. query.status = 4;
  610. break;
  611. default:
  612. break;
  613. }
  614. queryParams.value = query;
  615. handleQuery();
  616. }
  617. /** 搜索按钮操作 */
  618. function handleQuery() {
  619. queryParams.value.pageNum = 1;
  620. moreSearch.value = false;
  621. getList();
  622. }
  623. /** 重置按钮操作 */
  624. function resetQuery() {
  625. // proxy.resetForm("queryRef");
  626. queryParams.value = {
  627. pageNum: 1,
  628. pageSize: 10,
  629. companyName: "",
  630. orderByColumn: "create_time",
  631. noContract: 1,
  632. };
  633. handleQuery();
  634. }
  635. // 多选框选中数据
  636. function handleSelectionChange(selection) {
  637. ids.value = selection.map((item) => item.id);
  638. single.value = selection.length != 1;
  639. multiple.value = !selection.length;
  640. }
  641. /** 新增按钮操作 */
  642. function handleAdd() {
  643. // proxy.$refs.DepositRef.open();
  644. formOpen.value = true;
  645. }
  646. function formCancel() {
  647. formOpen.value = false;
  648. reset();
  649. }
  650. function reset() {
  651. form.value = proxy.deepClone(emptyForm);
  652. }
  653. /** 修改按钮操作 */
  654. function handleUpdate(row) {
  655. // const id = row.id || ids.value;
  656. // proxy.$refs.DepositRef.open(id);
  657. }
  658. /** 删除按钮操作 */
  659. function handleDelete(row) {
  660. const _ids = row.id || ids.value;
  661. proxy.$modal
  662. .confirm("是否确认删除选中的数据项?")
  663. .then(function () {
  664. return delDeposit(_ids);
  665. })
  666. .then(() => {
  667. getList();
  668. proxy.$modal.msgSuccess("删除成功!");
  669. })
  670. .catch(() => {});
  671. }
  672. /** 导出按钮操作 */
  673. function handleExport() {
  674. // proxy.download(
  675. // "business/archive/order/export",
  676. // {
  677. // ...queryParams.value,
  678. // },
  679. // `合同导出_${new Date().getTime()}.xlsx`
  680. // );
  681. exportDeposit(queryParams.value);
  682. }
  683. function startDateChangeHandler(row, startDate) {
  684. if (startDate) {
  685. // console.log(startDate)
  686. row.endMonth = proxy
  687. .moment(startDate)
  688. .add(row.monthNum - 1, "M")
  689. .format("YYYY-MM-DD");
  690. } else row.endMonth = null;
  691. console.log(row);
  692. }
  693. function saveHandler() {
  694. if (form.value.amount == null || form.value.amount === 0) {
  695. proxy.$modal.msgError("请输入存款金额");
  696. return;
  697. }
  698. if (form.value.files.length === 0) {
  699. proxy.$modal.msgError("请上传凭证附件");
  700. return;
  701. }
  702. form.value.operationId = useUserStore().user.userId;
  703. form.value.operationDate = proxy.moment().format("YYYY-MM-DD HH:mm:ss");
  704. form.value.status = 2;
  705. saveDeduction(form.value).then((res) => {
  706. formCancel();
  707. getList();
  708. });
  709. }
  710. function upload(param) {
  711. const formData = new FormData();
  712. formData.append("file", param.file);
  713. uploadFile(formData).then((res) => {
  714. if (res.code === 200) {
  715. const file = {};
  716. file.fileName = res.newFileName;
  717. file.url = res.url;
  718. file.originalFileName = res.originalFilename;
  719. file.fileUrl = res.fileName;
  720. file.masterId = form.value.id;
  721. file.masterTableName = "biz_deduction";
  722. form.value.files.push(file);
  723. }
  724. });
  725. }
  726. function openFollowFile(arg) {
  727. // console.log(arg)
  728. const attach = arg;
  729. window.open(`${arg.url}`, arg.fileName);
  730. }
  731. function showFileList(row) {
  732. currentFileList.value = row.files.map((l) => `${baseUrl.value}${l.fileUrl}`);
  733. showViewer.value = true;
  734. }
  735. function closeImages() {
  736. showViewer.value = false;
  737. }
  738. function handleInfo(row) {
  739. formOpen.value = true;
  740. getForm(row.id);
  741. }
  742. function getForm(id) {
  743. getDeposit(id).then((res) => {
  744. form.value = res.data;
  745. if (form.value == null) {
  746. reset();
  747. }
  748. });
  749. }
  750. function handleDelFile(index) {
  751. form.value.files.splice(index, 1);
  752. }
  753. function amountDetail(row) {
  754. const item = {
  755. year: proxy.moment().format("YYYY"),
  756. month: proxy.moment().subtract(1, "months").format("MM"),
  757. };
  758. switch (row.sourceName) {
  759. case "税款":
  760. proxy.$refs.mergeTaxViewDialog.open(row);
  761. break;
  762. case "社保":
  763. proxy.$refs.socialSecurityViewDialog.open(row);
  764. break;
  765. case "公积金":
  766. proxy.$refs.housingFundViewDialog.open(row);
  767. break;
  768. }
  769. }
  770. function showFiles(row) {
  771. proxy.$refs.fileDialog.open({
  772. masterTableName: "biz_deduction",
  773. masterId: row.id,
  774. });
  775. }
  776. function checkConfirm(row) {
  777. // console.log(row.tenantId)
  778. if (row.tenantId === getTenant()) {
  779. return true;
  780. } else {
  781. return false;
  782. }
  783. }
  784. function showConfirm(row) {
  785. proxy.$modal.confirm("确认扣款么?").then((res) => {
  786. row.confirmId = useUserStore().user.userId;
  787. row.confirmDate = proxy.moment().format("YYYY-MM-DD HH:mm:ss");
  788. row.status = 1;
  789. saveDeduction(row).then((res) => {
  790. getList();
  791. });
  792. });
  793. }
  794. function applySuccess(row, status) {
  795. proxy.$modal
  796. .confirm("确认公积金申报成功么?")
  797. .then((_) => {
  798. const value = proxy.deepClone(row);
  799. value.status = status;
  800. saveDeduction(value).then((res) => {
  801. getList();
  802. });
  803. })
  804. .catch((_) => {
  805. proxy.$modal.msg("取消申报");
  806. });
  807. }
  808. function showFeedbackDialog(row) {
  809. const value = proxy.deepClone(row);
  810. value.status = 4;
  811. proxy.$refs.feedbackDialogRef.open(value);
  812. }
  813. function verifyDeduction(value) {
  814. saveDeduction(value).then((res) => {
  815. getList();
  816. });
  817. }
  818. function openUpload(row) {
  819. formOpen.value = true;
  820. form.value = proxy.deepClone(row);
  821. }
  822. getList();
  823. </script>