index.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858
  1. <template>
  2. <div class="pageIndexClass">
  3. <div class="content">
  4. <byTable :source="sourceList.data" :pagination="sourceList.pagination" :selectConfig="selectConfig" :config="config" highlight-current-row
  5. :action-list="[{
  6. text: '导出Excel',
  7. action: () => exportExcel(),
  8. disabled: false,
  9. }
  10. ]" @get-list="getList" :hideTable="true" :hidePagination="true">
  11. <template #code="{item}">
  12. <div style="width:100%">
  13. <span class="el-click" @click="getDtl(item)">{{item.code}}</span>
  14. </div>
  15. </template>
  16. </byTable>
  17. <div style="padding:0 15px 10px 15px;background:#fff">
  18. <el-table :data="sourceList.data" :height="tableHeight" style="width: 100%;margin-top:-10px" v-loading="loading" border
  19. :span-method="objectSpanMethod" :row-class-name="getRowClass" id="my-table">
  20. <el-table-column prop="supplierName" label="供应商名称" width="130" fixed="left">
  21. <!-- <template #default="{ row, $index }">
  22. <div style="width: 100%">
  23. <span v-if="$index < sourceList.data.length - 1"> {{row.supplierName}}</span>
  24. <div style="text-align:right" v-else>
  25. 合计:
  26. </div>
  27. </div>
  28. </template> -->
  29. </el-table-column>
  30. <el-table-column prop="supplierShortName" label="供应商简称" width="130" fixed="left">
  31. </el-table-column>
  32. <el-table-column prop="supplierTaxPoints" label="税点" width="60" fixed="left">
  33. </el-table-column>
  34. <el-table-column prop="warehouseName" label="入库仓库" width="130" fixed="left">
  35. </el-table-column>
  36. <el-table-column prop="yearBeginBalance" label="年初余额" width="80" fixed="left" align="right">
  37. <template #default="{ row, $index }">
  38. <div style="width: 100%">
  39. {{moneyFormat(row.yearBeginBalance,2)}}
  40. </div>
  41. </template>
  42. </el-table-column>
  43. <template v-if="monthList && monthList.length>0">
  44. <el-table-column v-for="col in monthList" :key="col.key" :label="col.label" align="center">
  45. <el-table-column label="贷方发生额" align="center">
  46. <el-table-column label="到货金额" width="80" align="right">
  47. <template #default="{ row, $index }">
  48. <div style="width: 100%" v-if="row.monthData[col.key] && row.monthData[col.key].arrivalAmount">
  49. {{moneyFormat(row.monthData[col.key].arrivalAmount,2)}}
  50. </div>
  51. </template>
  52. </el-table-column>
  53. <el-table-column label="退货金额" width="80" align="right">
  54. <template #default="{ row, $index }">
  55. <div style="width: 100%" v-if="row.monthData[col.key] && row.monthData[col.key].backAmount">
  56. {{moneyFormat(row.monthData[col.key].backAmount,2)}}
  57. </div>
  58. </template>
  59. </el-table-column>
  60. <el-table-column label="货款调整" width="80" align="right">
  61. <template #default="{ row, $index }">
  62. <div style="width: 100%" v-if="row.monthData[col.key] && row.monthData[col.key].arrivalAdjustAmount">
  63. {{moneyFormat(row.monthData[col.key].arrivalAdjustAmount,2)}}
  64. </div>
  65. </template>
  66. </el-table-column>
  67. <el-table-column label="税费" width="80" align="right">
  68. <template #default="{ row, $index }">
  69. <div style="width: 100%" v-if="row.monthData[col.key] && row.monthData[col.key].taxAmount">
  70. {{moneyFormat(row.monthData[col.key].taxAmount,2)}}
  71. </div>
  72. </template>
  73. </el-table-column>
  74. <el-table-column label="税费调整" width="100" align="right">
  75. <template #default="{ row, $index }">
  76. <el-input-number onmousewheel="return false;" v-model="row.monthData[col.key].taxAdjustAmount" placeholder=" " style="width: 100%"
  77. :precision="2" :controls="false" @change="(val)=>changeData(row,val)" />
  78. <!-- <el-input v-model="row.monthData[col.key].taxAdjustAmount" placeholder=" " @change="(val)=>changeData(row,val)"></el-input> -->
  79. </template>
  80. </el-table-column>
  81. </el-table-column>
  82. <el-table-column label="借方发生额" width="80" align="right">
  83. <template #default="{ row, $index }">
  84. <div style="width: 100%" v-if="row.monthData[col.key] && row.monthData[col.key].paymentAmount">
  85. {{moneyFormat(row.monthData[col.key].paymentAmount,2)}}
  86. </div>
  87. </template>
  88. </el-table-column>
  89. <el-table-column label="期末余额" width="80" align="right">
  90. <template #default="{ row, $index }">
  91. <div style="width: 100%">
  92. {{moneyFormat(row.monthData[col.key].endAmount,2)}}
  93. </div>
  94. </template>
  95. </el-table-column>
  96. </el-table-column>
  97. <el-table-column label="备注" width="130">
  98. <template #default="{ row, $index }">
  99. <el-input v-model="row.remark" placeholder=" " @change="(val)=>changeData(row,val)"></el-input>
  100. </template>
  101. </el-table-column>
  102. </template>
  103. </el-table>
  104. <el-row class="table-pagination" justify="end" type="flex" style="margin-top:10px ">
  105. <el-pagination background layout="total, sizes, prev, pager, next, jumper" :current-page="sourceList.pagination.pageNum"
  106. :page-size="sourceList.pagination.pageSize" :total="sourceList.pagination.total" @size-change="handleSizeChange"
  107. @current-change="handlePageChange" :page-sizes="[10, 20, 30, 40, 50]" />
  108. </el-row>
  109. </div>
  110. </div>
  111. <el-dialog :title="modalType == 'add' ? '添加' : '编辑'" v-if="dialogVisible" v-model="dialogVisible" width="60%">
  112. <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="submit" v-loading="loadingDialog">
  113. </byForm>
  114. <template #footer>
  115. <el-button @click="dialogVisible = false" size="default">取 消</el-button>
  116. <el-button type="primary" @click="submitForm()" size="default">确 定</el-button>
  117. </template>
  118. </el-dialog>
  119. </div>
  120. </template>
  121. <script setup>
  122. import { computed, ref } from "vue";
  123. import byTable from "@/components/byTable/index";
  124. import byForm from "@/components/byForm/index";
  125. import moment from "moment";
  126. import FileSaver from "file-saver";
  127. import * as XLSX from "xlsx";
  128. const { proxy } = getCurrentInstance();
  129. const tableHeight = ref(0);
  130. const getTableHeight = () => {
  131. tableHeight.value = window.innerHeight - 150 - 30 - 50;
  132. };
  133. getTableHeight();
  134. window.addEventListener("resize", () => {
  135. getTableHeight();
  136. });
  137. const sealType = computed(() => proxy.useUserStore().allDict["seal_type"]);
  138. const userList = ref([]);
  139. const deptData = ref([]);
  140. const typeData = ref([
  141. {
  142. label: "收入",
  143. value: "10",
  144. },
  145. {
  146. label: "支出",
  147. value: "20",
  148. },
  149. ]);
  150. const monthList = ref([
  151. { key: 1, label: "1月" },
  152. { key: 2, label: "2月" },
  153. { key: 3, label: "3月" },
  154. { key: 4, label: "4月" },
  155. { key: 5, label: "5月" },
  156. { key: 6, label: "6月" },
  157. { key: 7, label: "7月" },
  158. { key: 8, label: "8月" },
  159. { key: 9, label: "9月" },
  160. { key: 10, label: "10月" },
  161. { key: 11, label: "11月" },
  162. { key: 12, label: "12月" },
  163. ]);
  164. const sourceList = ref({
  165. data: [],
  166. pagination: {
  167. total: 0,
  168. pageNum: 1,
  169. pageSize: 10,
  170. keyword: "",
  171. year: moment().format("yyyy"),
  172. },
  173. });
  174. const loading = ref(false);
  175. const statusData = ref([
  176. {
  177. label: "草稿",
  178. value: 0,
  179. },
  180. {
  181. label: "审批中",
  182. value: 10,
  183. },
  184. {
  185. label: "审批驳回",
  186. value: 20,
  187. },
  188. {
  189. label: "审批通过",
  190. value: 30,
  191. },
  192. {
  193. label: "作废",
  194. value: 88,
  195. },
  196. ]);
  197. const processingMethod = ref([
  198. {
  199. dictKey: 10,
  200. dictValue: "业务自采",
  201. },
  202. {
  203. dictKey: 20,
  204. dictValue: "生产处理",
  205. },
  206. ]);
  207. const contractType = ref([
  208. {
  209. dictKey: "3",
  210. dictValue: "打样订单",
  211. },
  212. {
  213. dictKey: "2",
  214. dictValue: "内销订单",
  215. },
  216. {
  217. dictKey: "1",
  218. dictValue: "外贸订单(退税)",
  219. },
  220. {
  221. dictKey: "4",
  222. dictValue: "外贸订单(不退税)",
  223. },
  224. ]);
  225. const selectConfig = computed(() => {
  226. return [
  227. {
  228. type: "time",
  229. itemType: "year",
  230. label: "年份",
  231. placeholder: "请选择",
  232. prop: "year",
  233. placeholderOne: "",
  234. propOne: "",
  235. clearable: false,
  236. fn: () => {
  237. getList();
  238. },
  239. },
  240. ];
  241. });
  242. const config = computed(() => {
  243. return [
  244. {
  245. attrs: {
  246. label: "订单编号",
  247. slot: "code",
  248. },
  249. },
  250. // {
  251. // attrs: {
  252. // label: "印章类型",
  253. // prop: "type",
  254. // },
  255. // render(val) {
  256. // return proxy.dictKeyValue(val, sealType.value);
  257. // },
  258. // },
  259. {
  260. attrs: {
  261. label: "业务员",
  262. prop: "createUserName",
  263. },
  264. },
  265. {
  266. attrs: {
  267. label: "跟单员",
  268. prop: "applyTime",
  269. },
  270. },
  271. {
  272. attrs: {
  273. label: "订单类型",
  274. prop: "contractType",
  275. width: 110,
  276. },
  277. render(val) {
  278. return proxy.dictKeyValue(val, contractType.value);
  279. },
  280. },
  281. {
  282. attrs: {
  283. label: "订单处理方式",
  284. prop: "processingMethod",
  285. width: 110,
  286. },
  287. render(val) {
  288. return proxy.dictKeyValue(val, processingMethod.value);
  289. },
  290. },
  291. {
  292. attrs: {
  293. label: "销售金额",
  294. prop: "deptName",
  295. },
  296. },
  297. {
  298. attrs: {
  299. label: "订单出货金额",
  300. prop: "educationName",
  301. },
  302. },
  303. {
  304. attrs: {
  305. label: "出货申请出货金额",
  306. prop: "amount",
  307. },
  308. render(val) {
  309. return proxy.moneyFormat(val, 2);
  310. },
  311. },
  312. {
  313. attrs: {
  314. label: "已收定金",
  315. prop: "amount",
  316. },
  317. render(val) {
  318. return proxy.moneyFormat(val, 2);
  319. },
  320. },
  321. {
  322. attrs: {
  323. label: "是否可结算",
  324. prop: "educationName",
  325. },
  326. },
  327. {
  328. attrs: {
  329. label: "是否已结算",
  330. prop: "educationName",
  331. },
  332. },
  333. {
  334. attrs: {
  335. label: "客户名称",
  336. prop: "educationName",
  337. },
  338. },
  339. {
  340. attrs: {
  341. label: "客户简称",
  342. prop: "educationName",
  343. },
  344. },
  345. {
  346. attrs: {
  347. label: "应收金额",
  348. prop: "educationName",
  349. },
  350. },
  351. {
  352. attrs: {
  353. label: "收款金额",
  354. prop: "amount",
  355. },
  356. render(val) {
  357. return proxy.moneyFormat(val, 2);
  358. },
  359. },
  360. {
  361. attrs: {
  362. label: "未收金额",
  363. prop: "amount",
  364. },
  365. render(val) {
  366. return proxy.moneyFormat(val, 2);
  367. },
  368. },
  369. {
  370. attrs: {
  371. label: "出货日期",
  372. prop: "amount",
  373. },
  374. },
  375. {
  376. attrs: {
  377. label: "账龄级别",
  378. prop: "amount",
  379. },
  380. },
  381. // {
  382. // attrs: {
  383. // label: "审批状态",
  384. // prop: "status",
  385. // width: 100,
  386. // },
  387. // render(type) {
  388. // return proxy.dictValueLabel(type, statusData.value);
  389. // },
  390. // },
  391. {
  392. attrs: {
  393. label: "操作",
  394. width: "120",
  395. align: "center",
  396. },
  397. renderHTML(row) {
  398. return row.createUser == proxy.useUserStore().user.userId
  399. ? [
  400. row.status == 0
  401. ? {
  402. attrs: {
  403. label: "修改",
  404. type: "primary",
  405. text: true,
  406. },
  407. el: "button",
  408. click() {
  409. clickUpdate(row);
  410. },
  411. }
  412. : {},
  413. row.status == 0
  414. ? {
  415. attrs: {
  416. label: "删除",
  417. type: "danger",
  418. text: true,
  419. },
  420. el: "button",
  421. click() {
  422. proxy
  423. .msgConfirm()
  424. .then((res) => {
  425. proxy
  426. .post("/educationSubsidy/delete", {
  427. id: row.id,
  428. })
  429. .then((res) => {
  430. proxy.msgTip("操作成功", 1);
  431. getList();
  432. });
  433. })
  434. .catch((err) => {});
  435. },
  436. }
  437. : {},
  438. row.status == 10 || row.status == 30
  439. ? {
  440. attrs: {
  441. label: "作废",
  442. type: "danger",
  443. text: true,
  444. },
  445. el: "button",
  446. click() {
  447. proxy
  448. .msgConfirm()
  449. .then((res) => {
  450. proxy
  451. .post("/educationSubsidy/cancellation", {
  452. id: row.id,
  453. })
  454. .then((res) => {
  455. proxy.msgTip("操作成功", 1);
  456. getList();
  457. });
  458. })
  459. .catch((err) => {});
  460. },
  461. }
  462. : {},
  463. ]
  464. : [];
  465. },
  466. },
  467. ];
  468. });
  469. const corporationList = ref([]);
  470. const getList = async (req) => {
  471. sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
  472. loading.value = true;
  473. proxy
  474. .post("/report/finance/accountsPayablePage", sourceList.value.pagination)
  475. .then((res) => {
  476. sourceList.value.data = res.rows;
  477. console.log(res.rows, "wadaw");
  478. sourceList.value.pagination.total = res.total;
  479. setTimeout(() => {
  480. loading.value = false;
  481. }, 200);
  482. });
  483. };
  484. getList();
  485. const getDeptData = (val) => {
  486. proxy
  487. .get("/tenantUser/list", {
  488. pageNum: 1,
  489. pageSize: 10000,
  490. tenantId: proxy.useUserStore().user.tenantId,
  491. companyId: proxy.useUserStore().user.companyId,
  492. })
  493. .then((res) => {
  494. userList.value = res.rows.map((item) => {
  495. return {
  496. ...item,
  497. label: item.nickName,
  498. value: item.userId,
  499. };
  500. });
  501. });
  502. proxy
  503. .get("/tenantDept/list", {
  504. pageNum: 1,
  505. pageSize: 9999,
  506. keyword: "",
  507. ancestors: proxy.useUserStore().user.companyId,
  508. tenantId: proxy.useUserStore().user.tenantId,
  509. // type: 2,
  510. })
  511. .then((res) => {
  512. deptData.value = proxy.handleTree(res.data, "deptId");
  513. });
  514. };
  515. // getDeptData();
  516. const modalType = ref("add");
  517. const dialogVisible = ref(false);
  518. const loadingDialog = ref(false);
  519. const submit = ref(null);
  520. const formOption = reactive({
  521. inline: true,
  522. labelWidth: 100,
  523. itemWidth: 100,
  524. rules: [],
  525. });
  526. const formConfig = computed(() => {
  527. return [
  528. {
  529. type: "title1",
  530. title: "基本信息",
  531. },
  532. {
  533. type: "input",
  534. prop: "name",
  535. label: "印章名称",
  536. required: true,
  537. itemWidth: 50,
  538. itemType: "text",
  539. },
  540. {
  541. type: "select",
  542. prop: "sealType",
  543. label: "印章类型",
  544. data: sealType.value,
  545. itemWidth: 50,
  546. },
  547. {
  548. type: "select",
  549. prop: "applyUserId",
  550. label: "存管人员",
  551. required: true,
  552. filterable: true,
  553. data: userList.value,
  554. itemWidth: 50,
  555. fn: (val) => {
  556. let current = userList.value.find((x) => x.value == val);
  557. console.log(current, "ada");
  558. if (current) {
  559. formData.data.deptId = current.deptId;
  560. }
  561. },
  562. },
  563. {
  564. type: "treeSelect",
  565. prop: "deptId",
  566. label: "存管部门",
  567. data: deptData.value,
  568. propsTreeLabel: "deptName",
  569. propsTreeValue: "deptId",
  570. itemWidth: 50,
  571. disabled: 50,
  572. },
  573. {
  574. type: "input",
  575. prop: "accountNumber",
  576. label: "印章用途",
  577. itemWidth: 100,
  578. itemType: "textarea",
  579. },
  580. ];
  581. });
  582. const rules = ref({
  583. name: [{ required: true, message: "请输入承包商", trigger: "blur" }],
  584. taxPoints: [{ required: true, message: "请输入税点", trigger: "blur" }],
  585. accountBank: [{ required: true, message: "请输入开户行", trigger: "blur" }],
  586. accountName: [{ required: true, message: "请输入开户名", trigger: "blur" }],
  587. accountNumber: [{ required: true, message: "请输入账号", trigger: "blur" }],
  588. });
  589. const formData = reactive({
  590. data: {
  591. accountRemainderList: [{ currency: "", remainder: undefined }],
  592. },
  593. });
  594. const openModal = (val) => {
  595. // modalType.value = val;
  596. // formData.data = {
  597. // accountRemainderList: [{ currency: "", remainder: undefined }],
  598. // };
  599. // loadingDialog.value = false;
  600. // dialogVisible.value = true;
  601. proxy.$router.replace({
  602. path: "/platform_manage/process/processApproval",
  603. query: {
  604. flowKey: "education_subsidy_flow",
  605. flowName: "学历补贴发起流程",
  606. random: proxy.random(),
  607. },
  608. });
  609. };
  610. const clickBalance = () => {
  611. if (
  612. formData.data.accountRemainderList &&
  613. formData.data.accountRemainderList.length > 0
  614. ) {
  615. formData.data.accountRemainderList.push({
  616. currency: "",
  617. remainder: undefined,
  618. });
  619. } else {
  620. formData.data.accountRemainderList = [
  621. { currency: "", remainder: undefined },
  622. ];
  623. }
  624. };
  625. const handleRemove = (index) => {
  626. formData.data.accountRemainderList.splice(index, 1);
  627. };
  628. const isRepeat = (arr) => {
  629. var hash = {};
  630. for (var i in arr) {
  631. if (hash[arr[i].currency]) return true;
  632. hash[arr[i].currency] = true;
  633. }
  634. return false;
  635. };
  636. const submitForm = () => {
  637. submit.value.handleSubmit(() => {
  638. loadingDialog.value = true;
  639. proxy.post("/contractor/" + modalType.value, formData.data).then(
  640. () => {
  641. proxy.msgTip("操作成功", 1);
  642. dialogVisible.value = false;
  643. getList();
  644. },
  645. (err) => {
  646. console.log(err);
  647. loadingDialog.value = false;
  648. }
  649. );
  650. // if (
  651. // formData.data.accountRemainderList &&
  652. // formData.data.accountRemainderList.length > 0
  653. // ) {
  654. // if (isRepeat(formData.data.accountRemainderList)) {
  655. // return ElMessage("请勿重复添加货币余额");
  656. // } else {
  657. // loadingDialog.value = true;
  658. // proxy.post("/accountManagement/" + modalType.value, formData.data).then(
  659. // () => {
  660. // ElMessage({
  661. // message: modalType.value == "add" ? "添加成功" : "编辑成功",
  662. // type: "success",
  663. // });
  664. // dialogVisible.value = false;
  665. // getList();
  666. // },
  667. // (err) => {
  668. // console.log(err);
  669. // loadingDialog.value = false;
  670. // }
  671. // );
  672. // }
  673. // } else {
  674. // return ElMessage("请添加至少一条类型余额");
  675. // }
  676. });
  677. };
  678. const update = (row) => {
  679. loadingDialog.value = false;
  680. modalType.value = "edit";
  681. formData.data = proxy.deepClone(row);
  682. dialogVisible.value = true;
  683. };
  684. const clickUpdate = (row) => {
  685. proxy.$router.push({
  686. path: "/platform_manage/process/processApproval",
  687. query: {
  688. flowKey: "education_subsidy_flow",
  689. flowName: "学历补贴发起流程",
  690. random: proxy.random(),
  691. businessId: row.id,
  692. },
  693. });
  694. };
  695. const getDtl = (row) => {
  696. proxy.$router.push({
  697. path: "/platform_manage/process/processApproval",
  698. query: {
  699. flowKey: "education_subsidy_flow",
  700. flowName: "学历补贴流程查看",
  701. random: proxy.random(),
  702. businessId: row.id,
  703. processType: 20,
  704. },
  705. });
  706. };
  707. const exportExcel = () => {
  708. proxy.msgTip("正在导出,请稍后", 2);
  709. proxy
  710. .postTwo(
  711. "/report/finance/accountsPayableExportExcel",
  712. sourceList.value.pagination
  713. )
  714. .then((res) => {
  715. proxy.downloadFile(res, "应付账款汇总.xlsx");
  716. });
  717. return;
  718. proxy.msgTip("正在导出,请稍后", 2);
  719. const wb = XLSX.utils.table_to_book(document.querySelector("#my-table")); // 关联dom节点
  720. // 设置百分比列的单元格样式
  721. const percentStyle = {
  722. font: { bold: true },
  723. fill: { fgColor: { rgb: "FFFF00" } },
  724. border: { top: { style: "thin" }, bottom: { style: "thin" } },
  725. };
  726. // if (wb.Sheets.Sheet1) {
  727. // // 达成率单元格的key开头
  728. // let cellKey = "";
  729. // for (const key in wb.Sheets.Sheet1) {
  730. // let value = wb.Sheets.Sheet1[key];
  731. // if (value && value.v == "月达成率") {
  732. // cellKey = key.match(/[a-zA-Z]+/g)[0];
  733. // }
  734. // // key有包含cellKey的
  735. // if (cellKey && key.includes(cellKey)) {
  736. // // 单元格的样式
  737. // wb.Sheets.Sheet1[key].s = percentStyle;
  738. // // 用于指定单元格中显示值的格式,例如日期格式、百分比格式等
  739. // wb.Sheets.Sheet1[key].z = "0.00%";
  740. // }
  741. // }
  742. // }
  743. const wbout = XLSX.write(wb, {
  744. bookType: "xlsx",
  745. bookSST: true,
  746. type: "array",
  747. });
  748. try {
  749. FileSaver.saveAs(
  750. new Blob([wbout], {
  751. type: "application/octet-stream",
  752. }),
  753. "快递充值汇总.xlsx"
  754. );
  755. } catch (e) {
  756. console.log(e, wbout);
  757. }
  758. return wbout;
  759. };
  760. const objectSpanMethod = ({ row, column, rowIndex, columnIndex }) => {
  761. // 手动配置合计列
  762. if (rowIndex == sourceList.value.data.length - 1) {
  763. if (columnIndex == 0) {
  764. return {
  765. rowspan: 1,
  766. colspan: 2,
  767. };
  768. } else if (columnIndex == 1) {
  769. return {
  770. rowspan: 1,
  771. colspan: 0,
  772. };
  773. } else {
  774. return {
  775. rowspan: 1,
  776. colspan: 1,
  777. };
  778. }
  779. }
  780. };
  781. const getRowClass = ({ row, rowIndex }) => {
  782. if (rowIndex == sourceList.value.data.length - 1) {
  783. return "sumRow";
  784. }
  785. return "";
  786. };
  787. const handleCurrentChange = (val) => {
  788. sourceList.value.pagination.pageNum = val;
  789. getList();
  790. };
  791. const handleSizeChange = (val) => {
  792. sourceList.value.pagination.pageSize = val;
  793. getList();
  794. };
  795. const changeData = (item) => {
  796. let data = {
  797. idStr: item.idStr,
  798. year: sourceList.value.pagination.year,
  799. remark: item.remark,
  800. };
  801. for (let i = 1; i <= 12; i++) {
  802. data["month" + i + "TaxAdjust"] = item.monthData[i].taxAdjustAmount;
  803. }
  804. proxy.post("/payableBalance/edit", data).then((res) => {});
  805. };
  806. </script>
  807. <style lang="scss" scoped>
  808. .tenant {
  809. padding: 20px;
  810. }
  811. :deep(
  812. .el-table .el-table__header-wrapper th,
  813. .el-table .el-table__fixed-header-wrapper th
  814. ) {
  815. height: auto !important;
  816. }
  817. :deep(.el-table th.el-table__cell) {
  818. background: #fff !important;
  819. }
  820. :deep(.el-table .el-table__cell) {
  821. padding: 0 !important;
  822. }
  823. :deep(.el-table .cell) {
  824. padding: 0 8px !important;
  825. font-size: 12px !important;
  826. }
  827. :deep(.sumRow) {
  828. background-color: #f5f7fa !important;
  829. .el-table-fixed-column--left,
  830. .el-table-fixed-column--right {
  831. background-color: #f5f7fa !important;
  832. }
  833. }
  834. </style>