auditIndex.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657
  1. import { approveSalesForecastSummary, getSalesForecastMainPage, approveSalesForecastSummaryParticulars } from '@/api/forecast/forecast-summary'
  2. import { mapGetters } from 'vuex'
  3. import {
  4. APPROVAL_STATUS,
  5. APPROVAL_STATUS_OPTIONS,
  6. getApprovalStatusLabel,
  7. getApprovalStatusType,
  8. canApprove as canApproveStatus,
  9. canReject as canRejectStatus,
  10. formatNumber,
  11. formatDateTime as formatDateTimeUtil
  12. } from '@/constants/forecast'
  13. import { safeBigInt } from '@/util/util'
  14. /**
  15. * @typedef {import('./types').ForecastRecord} ForecastRecord
  16. * @typedef {import('./types').PageConfig} PageConfig
  17. * @typedef {import('./types').ApprovalFormData} ApprovalFormData
  18. * @typedef {import('./types').PermissionConfig} PermissionConfig
  19. * @typedef {import('./types').ForecastAuditComponent} ForecastAuditComponent
  20. */
  21. /**
  22. * 销售预测审核页面业务逻辑混入
  23. * @description 提供预测申报的审核功能,包括列表展示、详情查看、审批操作等
  24. */
  25. export default {
  26. /**
  27. * @this {Vue & ForecastAuditComponent}
  28. */
  29. data() {
  30. return {
  31. /** @type {Record<string, any>} 表单数据 */
  32. form: {},
  33. /** @type {Record<string, any>} 查询参数 */
  34. query: {},
  35. /** @type {boolean} 表格加载状态 */
  36. loading: true,
  37. /** @type {boolean} 提交状态 */
  38. submitting: false,
  39. /** @type {boolean} 详情弹窗显示状态 */
  40. detailDialogVisible: false,
  41. /** @type {boolean} 审批弹窗显示状态 */
  42. approvalDialogVisible: false,
  43. /** @type {PageConfig} 分页配置 */
  44. page: {
  45. pageSize: 10,
  46. currentPage: 1,
  47. total: 0
  48. },
  49. /** @type {Array<ForecastRecord>} 表格数据 */
  50. data: [],
  51. /** @type {Record<string, any>} 详情表单数据 */
  52. detailForm: {},
  53. /** 当前正在审批的主表记录(用于批量审批子表) */
  54. selectedMainRecord: null,
  55. /** @type {ApprovalFormData} 审批表单数据 */
  56. approvalForm: {
  57. id: null,
  58. isApprove: true
  59. },
  60. option: {
  61. height: 'auto',
  62. calcHeight: 30,
  63. searchShow: true,
  64. searchMenuSpan: 18,
  65. searchIndex: 3,
  66. border: true,
  67. index: false,
  68. viewBtn: false,
  69. selection: false,
  70. addBtn: false,
  71. editBtn: false,
  72. delBtn: false,
  73. excelBtn: false,
  74. columnBtn: false,
  75. refreshBtn: true,
  76. dialogClickModal: false,
  77. menu: true,
  78. menuWidth: 280,
  79. menuFixed: false,
  80. // 行展开配置,展示子表明细
  81. expand: true,
  82. expandRowKeys: [],
  83. defaultExpandAll: false,
  84. column: [
  85. { label: 'ID', prop: 'id', width: 200, overHidden: false },
  86. { label: '序号', prop: 'seq', width: 70, align: 'center', slot: true },
  87. {
  88. label: '年份',
  89. prop: 'year',
  90. type: 'year',
  91. valueFormat: 'yyyy',
  92. search: true,
  93. searchSpan: 6,
  94. width: 100
  95. },
  96. {
  97. label: '月份',
  98. prop: 'month',
  99. type: 'select',
  100. dicData: [
  101. { label: '1月', value: 1 },
  102. { label: '2月', value: 2 },
  103. { label: '3月', value: 3 },
  104. { label: '4月', value: 4 },
  105. { label: '5月', value: 5 },
  106. { label: '6月', value: 6 },
  107. { label: '7月', value: 7 },
  108. { label: '8月', value: 8 },
  109. { label: '9月', value: 9 },
  110. { label: '10月', value: 10 },
  111. { label: '11月', value: 11 },
  112. { label: '12月', value: 12 }
  113. ],
  114. search: true,
  115. searchSpan: 6,
  116. width: 100
  117. },
  118. {
  119. label: '客户编码',
  120. prop: 'customerCode',
  121. search: true,
  122. searchSpan: 6,
  123. width: 150,
  124. overHidden: true
  125. },
  126. {
  127. label: '客户名称',
  128. prop: 'customerName',
  129. search: true,
  130. searchSpan: 6,
  131. width: 180,
  132. overHidden: true
  133. },
  134. {
  135. label: '审批状态',
  136. prop: 'approvalStatus',
  137. type: 'select',
  138. dicData: APPROVAL_STATUS_OPTIONS,
  139. search: true,
  140. searchSpan: 6,
  141. width: 100,
  142. slot: true
  143. },
  144. {
  145. label: '审批人',
  146. prop: 'approvedName',
  147. search: false,
  148. width: 120,
  149. overHidden: true
  150. },
  151. {
  152. label: '审批时间',
  153. prop: 'approvedTime',
  154. type: 'datetime',
  155. search: false,
  156. width: 160,
  157. overHidden: true
  158. },
  159. {
  160. label: '创建时间',
  161. prop: 'createTime',
  162. type: 'datetime',
  163. search: false,
  164. width: 160,
  165. overHidden: true
  166. },
  167. { label: '更新时间', prop: 'updateTime', type: 'datetime', search: false, width: 160, overHidden: true }
  168. ]
  169. },
  170. // 子表(展开区)配置,展示明细列表
  171. childOption: {
  172. // width: '100%',
  173. // height: 'auto',
  174. // calcHeight: 0,
  175. tip: false,
  176. searchShow: false,
  177. border: true,
  178. index: true,
  179. viewBtn: false,
  180. editBtn: false,
  181. delBtn: false,
  182. addBtn: false,
  183. selection: false,
  184. menu: true,
  185. menuWidth: 160,
  186. menuFixed: false,
  187. expand: false,
  188. column: [
  189. { label: '物料编码', prop: 'itemCode', minWidth: 120 },
  190. { label: '物料名称', prop: 'itemName', minWidth: 180, overHidden: true },
  191. { label: '规格型号', prop: 'specs', minWidth: 140, overHidden: true },
  192. { label: '花型/图案', prop: 'pattern', minWidth: 120, overHidden: true },
  193. { label: '品牌名称', prop: 'brandName', minWidth: 120, overHidden: true },
  194. { label: '预测数量', prop: 'forecastQuantity', minWidth: 120, align: 'right', slot: true },
  195. { label: '审核状态', prop: 'approvalStatus', type: 'select', dicData: APPROVAL_STATUS_OPTIONS, minWidth: 100, slot: true },
  196. // { label: '客户名称', prop: 'customerName', minWidth: 160, overHidden: true },
  197. // { label: '年份', prop: 'year', minWidth: 100 },
  198. // { label: '月份', prop: 'month', minWidth: 100 },
  199. { label: '审批人', prop: 'approvedName', minWidth: 120, overHidden: true },
  200. { label: '审批时间', prop: 'approvedTime', type: 'datetime', minWidth: 160, overHidden: true, slot: true }
  201. ]
  202. }
  203. }
  204. },
  205. computed: {
  206. ...mapGetters(['permission', 'userInfo']),
  207. /**
  208. * 权限列表
  209. * @this {Vue & ForecastAuditComponent}
  210. * @returns {PermissionConfig} 权限配置对象
  211. */
  212. permissionList() {
  213. return {
  214. // addBtn: this.vaildData(this.permission.forecast_audit_add, false),
  215. // viewBtn: this.vaildData(this.permission.forecast_audit_view, false),
  216. // editBtn: this.vaildData(this.permission.forecast_audit_edit, false),
  217. // delBtn: this.vaildData(this.permission.forecast_audit_delete, false)
  218. addBtn: false,
  219. viewBtn: false,
  220. editBtn: false,
  221. delBtn: false
  222. }
  223. },
  224. /**
  225. * 审批弹窗标题
  226. * @this {Vue & ForecastAuditComponent}
  227. * @returns {string} 弹窗标题文本
  228. */
  229. approvalDialogTitle() {
  230. return this.approvalForm.isApprove ? '审批通过确认' : '审批拒绝确认'
  231. }
  232. },
  233. created() {
  234. // 初始化时不需要加载额外数据,只等待表格自动加载
  235. },
  236. methods: {
  237. /**
  238. * 获取审批状态标签
  239. * @param {import('@/constants/forecast').ApprovalStatus} status - 审批状态值
  240. * @returns {string} 状态标签文本
  241. */
  242. getApprovalStatusLabel(status) {
  243. return getApprovalStatusLabel(status)
  244. },
  245. /**
  246. * 获取审批状态类型
  247. * @param {import('@/constants/forecast').ApprovalStatus} status - 审批状态值
  248. * @returns {string} 状态类型
  249. */
  250. getApprovalStatusType(status) {
  251. return getApprovalStatusType(status)
  252. },
  253. /**
  254. * 判断是否可以审批通过
  255. * @this {Vue & ForecastAuditComponent}
  256. * @param {ForecastRecord | {approvalStatus: number}} row - 数据行对象
  257. * @returns {boolean} 是否可以审批通过
  258. */
  259. canApprove(row) {
  260. return canApproveStatus(/** @type {import('@/constants/forecast').ApprovalStatus} */ (row.approvalStatus ?? APPROVAL_STATUS.PENDING))
  261. },
  262. /**
  263. * 判断是否可以审批拒绝
  264. * @this {Vue & ForecastAuditComponent}
  265. * @param {ForecastRecord | {approvalStatus: number}} row - 数据行对象
  266. * @returns {boolean} 是否可以审批拒绝
  267. */
  268. canReject(row) {
  269. return canRejectStatus(/** @type {import('@/constants/forecast').ApprovalStatus} */ (row.approvalStatus ?? APPROVAL_STATUS.PENDING))
  270. },
  271. /**
  272. * 格式化数字显示
  273. * @this {Vue & ForecastAuditComponent}
  274. * @param {number|null|undefined} value - 数值
  275. * @returns {string} 格式化后的字符串
  276. */
  277. formatNumber(value) {
  278. return formatNumber(value)
  279. },
  280. // 新增:格式化日期时间显示,供子表“审批时间”列使用
  281. /**
  282. * @param {string|null|undefined} dateTime - 日期时间值
  283. * @returns {string} 格式化后的日期时间字符串
  284. */
  285. formatDateTime(dateTime) {
  286. return formatDateTimeUtil(dateTime)
  287. },
  288. /**
  289. * 查看详情
  290. * @this {Vue & ForecastAuditComponent}
  291. * @param {ForecastRecord} row - 数据行对象
  292. * @param {number} index - 行索引
  293. * @returns {void}
  294. */
  295. viewDetail(row, index) {
  296. this.detailForm = { ...row }
  297. this.detailDialogVisible = true
  298. },
  299. /**
  300. * 审批通过记录(主表)
  301. * @this {Vue & ForecastAuditComponent}
  302. * @param {ForecastRecord} row - 数据行对象
  303. * @param {number} index - 行索引
  304. * @returns {Promise<void>}
  305. */
  306. async approveRecord(row, index) {
  307. /** @type {Vue & ForecastAuditComponent} */
  308. const self = /** @type {any} */ (this)
  309. try {
  310. await self.$confirm('确认通过此预测申报吗?', '审批确认', {
  311. confirmButtonText: '确定',
  312. cancelButtonText: '取消',
  313. type: 'success'
  314. })
  315. self.performApproval(row, true)
  316. } catch (e) {
  317. // 用户取消或错误
  318. }
  319. },
  320. /**
  321. * 审批拒绝记录(主表)
  322. * @this {Vue & ForecastAuditComponent}
  323. * @param {ForecastRecord} row - 数据行对象
  324. * @param {number} index - 行索引
  325. * @returns {Promise<void>}
  326. */
  327. async rejectRecord(row, index) {
  328. /** @type {Vue & ForecastAuditComponent} */
  329. const self = /** @type {any} */ (this)
  330. try {
  331. await self.$confirm('确认拒绝此预测申报吗?', '审批确认', {
  332. confirmButtonText: '确定',
  333. cancelButtonText: '取消',
  334. type: 'warning'
  335. })
  336. self.performApproval(row, false)
  337. } catch (e) {
  338. // 用户取消或错误
  339. }
  340. },
  341. /**
  342. * 执行审批(主表)
  343. * @this {Vue & ForecastAuditComponent}
  344. * @param {ForecastRecord} row - 主表记录
  345. * @param {boolean} isApprove - 是否通过
  346. * @returns {Promise<void>}
  347. */
  348. async performApproval(row, isApprove) {
  349. /** @type {Vue & ForecastAuditComponent} */
  350. const self = /** @type {any} */ (this)
  351. if (!row) {
  352. self.$message.error('记录不存在,无法审批')
  353. return
  354. }
  355. const id = (row && row.id != null && row.id !== '')
  356. ? String(row.id)
  357. : (row && row.idBigint != null ? String(row.idBigint) : '')
  358. if (!id) {
  359. self.$message.error('主表ID缺失,无法提交审批')
  360. return
  361. }
  362. self.submitting = true
  363. try {
  364. const payload = {
  365. id,
  366. approvalStatus: isApprove ? APPROVAL_STATUS.APPROVED : APPROVAL_STATUS.REJECTED
  367. }
  368. await approveSalesForecastSummary(payload)
  369. self.$message.success(isApprove ? '审批通过成功' : '审批拒绝成功')
  370. await self.onLoad(self.page, self.query)
  371. } catch (e) {
  372. self.$message.error('审批操作失败')
  373. } finally {
  374. self.submitting = false
  375. }
  376. },
  377. /**
  378. * 子表明细审批通过
  379. * @param {import('./types').ForecastChildRecord} sub - 子项记录
  380. * @returns {Promise<void>}
  381. */
  382. async approveChildRecord(sub) {
  383. /** @type {Vue & ForecastAuditComponent} */
  384. const self = /** @type {any} */ (this)
  385. try {
  386. await self.$confirm('确认通过此明细吗?', '审批确认', {
  387. confirmButtonText: '确定',
  388. cancelButtonText: '取消',
  389. type: 'success'
  390. })
  391. await self.submitChildApproval(sub, true)
  392. } catch (e) {
  393. // 用户取消或错误
  394. }
  395. },
  396. /**
  397. * 子表明细审批拒绝
  398. * @param {import('./types').ForecastChildRecord} sub - 子项记录
  399. * @returns {Promise<void>}
  400. */
  401. async rejectChildRecord(sub) {
  402. /** @type {Vue & ForecastAuditComponent} */
  403. const self = /** @type {any} */ (this)
  404. try {
  405. await self.$confirm('确认拒绝此明细吗?', '审批确认', {
  406. confirmButtonText: '确定',
  407. cancelButtonText: '取消',
  408. type: 'warning'
  409. })
  410. await self.submitChildApproval(sub, false)
  411. } catch (e) {
  412. // 用户取消或错误
  413. }
  414. },
  415. /**
  416. * 执行子表明细审批
  417. * @param {import('./types').ForecastChildRecord} sub - 子项记录
  418. * @param {boolean} isApprove - 是否通过
  419. * @returns {Promise<void>}
  420. */
  421. async submitChildApproval(sub, isApprove) {
  422. /** @type {Vue & ForecastAuditComponent} */
  423. const self = /** @type {any} */ (this)
  424. self.submitting = true
  425. const id = /** @type {string|number} */ (sub && sub.id)
  426. const forecastMainId = /** @type {string|number} */ (sub && sub.forecastMainId)
  427. if (id === '' || id === null || id === undefined || forecastMainId === '' || forecastMainId === null || forecastMainId === undefined) {
  428. self.submitting = false
  429. self.$message.error('子表或主表ID缺失,无法提交审批')
  430. return
  431. }
  432. const payload = {
  433. id,
  434. forecastMainId,
  435. approvalStatus: isApprove ? APPROVAL_STATUS.APPROVED : APPROVAL_STATUS.REJECTED
  436. }
  437. try {
  438. await approveSalesForecastSummaryParticulars(payload)
  439. self.$message.success('明细审批成功')
  440. await self.onLoad(self.page, self.query)
  441. } catch (e) {
  442. self.$message.error('明细审批失败')
  443. } finally {
  444. self.submitting = false
  445. }
  446. },
  447. /**
  448. * 从详情页面审批通过
  449. * @this {Vue & ForecastAuditComponent}
  450. * @returns {Promise<void>}
  451. */
  452. async approveFromDetail() {
  453. /** @type {Vue & ForecastAuditComponent} */
  454. const self = /** @type {any} */ (this)
  455. try {
  456. await self.$confirm('确认通过此预测申报吗?', '审批确认', {
  457. confirmButtonText: '确定',
  458. cancelButtonText: '取消',
  459. type: 'success'
  460. })
  461. self.detailDialogVisible = false
  462. self.performApproval(/** @type {ForecastRecord} */ (self.detailForm), true)
  463. } catch (e) {
  464. // 用户取消或错误
  465. }
  466. },
  467. /**
  468. * 从详情页面审批拒绝
  469. * @this {Vue & ForecastAuditComponent}
  470. * @returns {Promise<void>}
  471. */
  472. async rejectFromDetail() {
  473. /** @type {Vue & ForecastAuditComponent} */
  474. const self = /** @type {any} */ (this)
  475. try {
  476. await self.$confirm('确认拒绝此预测申报吗?', '审批确认', {
  477. confirmButtonText: '确定',
  478. cancelButtonText: '取消',
  479. type: 'warning'
  480. })
  481. self.detailDialogVisible = false
  482. self.performApproval(/** @type {ForecastRecord} */ (self.detailForm), false)
  483. } catch (e) {
  484. // 用户取消或错误
  485. }
  486. },
  487. /**
  488. * 提交审批(主表)
  489. * @this {Vue & ForecastAuditComponent}
  490. * @returns {Promise<void>}
  491. */
  492. async submitApproval() {
  493. /** @type {Vue & ForecastAuditComponent} */
  494. const self = /** @type {any} */ (this)
  495. self.submitting = true
  496. const approvalData = {
  497. id: /** @type {string|number} */ (self.approvalForm.id),
  498. approvalStatus: self.approvalForm.isApprove ? APPROVAL_STATUS.APPROVED : APPROVAL_STATUS.REJECTED
  499. }
  500. // id 为空保护
  501. if (approvalData.id === null || approvalData.id === undefined || approvalData.id === '') {
  502. self.submitting = false
  503. self.$message.error('审批记录ID缺失,无法提交')
  504. return
  505. }
  506. try {
  507. await approveSalesForecastSummary(approvalData)
  508. self.$message.success('审批操作成功')
  509. self.approvalDialogVisible = false
  510. await self.onLoad(self.page)
  511. } catch (e) {
  512. self.$message.error('审批操作失败')
  513. } finally {
  514. self.submitting = false
  515. }
  516. },
  517. /**
  518. * 取消审批
  519. * @this {Vue & ForecastAuditComponent}
  520. * @returns {void}
  521. */
  522. cancelApproval() {
  523. this.approvalDialogVisible = false
  524. this.approvalForm = {
  525. id: null,
  526. isApprove: true,
  527. }
  528. },
  529. /**
  530. * 搜索变化事件
  531. * @this {Vue & ForecastAuditComponent}
  532. * @param {Record<string, any>} params - 搜索参数
  533. * @param {() => void} done - 完成回调
  534. * @returns {void}
  535. */
  536. searchChange(params, done) {
  537. this.query = params
  538. this.onLoad(this.page, params)
  539. done()
  540. },
  541. /**
  542. * 搜索重置事件
  543. * @this {Vue & ForecastAuditComponent}
  544. * @returns {void}
  545. */
  546. searchReset() {
  547. this.query = {}
  548. this.onLoad(this.page)
  549. },
  550. /**
  551. * 刷新事件
  552. * @this {Vue & ForecastAuditComponent}
  553. * @returns {void}
  554. */
  555. refreshChange() {
  556. this.onLoad(this.page, this.query)
  557. },
  558. /**
  559. * 加载数据(使用销售预测主表分页)
  560. * @this {Vue & ForecastAuditComponent}
  561. * @param {import('./types').PageConfig} page - 分页配置
  562. * @param {Partial<{year: number, month: number, customerName: string}>} [params={}] - 查询参数
  563. */
  564. async onLoad(page, params = {}) {
  565. try {
  566. this.loading = true
  567. const queryParams = {
  568. year: params.year ?? this.query.year,
  569. month: params.month ?? this.query.month,
  570. customerName: params.customerName ?? this.query.customerName,
  571. // 补充:将“客户编码、审批状态”一并传给接口
  572. customerCode: params.customerCode ?? this.query.customerCode,
  573. approvalStatus: params.approvalStatus ?? this.query.approvalStatus
  574. }
  575. // 使用新分页接口(主表分页)
  576. const res = await getSalesForecastMainPage(
  577. page.currentPage,
  578. page.pageSize,
  579. queryParams
  580. )
  581. const { records = [], total = 0, current = 1, size = 10 } = (res.data && res.data.data) || {}
  582. // 处理ID为 BigInt 字符串,同时保留字符串ID以便传输
  583. const mapped = (records || []).map(rec => {
  584. const idStr = rec && rec.id != null ? String(rec.id) : ''
  585. const idBigint = safeBigInt(idStr)
  586. const subList = Array.isArray(rec.pcBladeSalesForecastSummaryList)
  587. ? rec.pcBladeSalesForecastSummaryList.map(sub => {
  588. const subIdStr = sub && sub.id != null ? String(sub.id) : ''
  589. const subIdBigint = safeBigInt(subIdStr)
  590. const fmIdStr = sub && sub.forecastMainId != null ? String(sub.forecastMainId) : idStr
  591. const fmIdBigint = safeBigInt(fmIdStr)
  592. return {
  593. ...sub,
  594. id: subIdStr,
  595. forecastMainId: fmIdStr,
  596. year: Number(sub.year),
  597. month: Number(sub.month),
  598. forecastQuantity: typeof sub.forecastQuantity === 'string' ? Number(sub.forecastQuantity) : Number(sub.forecastQuantity),
  599. idBigint: subIdBigint,
  600. forecastMainIdBigint: fmIdBigint,
  601. // 继承父级字段,保证子表新增列有值可展示
  602. approvalStatus: sub && sub.approvalStatus != null ? sub.approvalStatus : (rec && rec.approvalStatus != null ? rec.approvalStatus : APPROVAL_STATUS.PENDING),
  603. customerName: sub && sub.customerName != null ? sub.customerName : rec && rec.customerName,
  604. approvedName: sub && sub.approvedName != null ? sub.approvedName : rec && rec.approvedName,
  605. approvedTime: sub && sub.approvedTime != null ? sub.approvedTime : rec && rec.approvedTime
  606. }
  607. })
  608. : []
  609. const approvalStatus = /** @type {import('@/constants/forecast').ApprovalStatus} */ (rec.approvalStatus ?? APPROVAL_STATUS.PENDING)
  610. return { ...rec, id: idStr, idBigint, year: Number(rec.year), month: Number(rec.month), approvalStatus, pcBladeSalesForecastSummaryList: subList }
  611. })
  612. this.data = /** @type {import('./types').ForecastRecord[]} */ (mapped)
  613. this.page.total = Number(total)
  614. this.page.currentPage = Number(current)
  615. this.page.pageSize = Number(size)
  616. } catch (error) {
  617. // eslint-disable-next-line no-console
  618. console.error('加载列表失败', error)
  619. } finally {
  620. this.loading = false
  621. }
  622. }
  623. }
  624. }