salesReconciliation.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <template>
  2. <template-page
  3. ref="pageRef"
  4. :get-list="getList"
  5. :export-list="exportList"
  6. :options-evens-group="optionsEvensGroup"
  7. :operation="operation()"
  8. :column-parsing="columnParsing"
  9. >
  10. <Popu v-if="visible">
  11. <el-page-header slot="head" content="对账" @back="handleClose" />
  12. <ReconciliationDetail :order-code="orderCode" :detail="detail" param="sales_check_code" @close="handleClose" />
  13. </Popu>
  14. </template-page>
  15. </template>
  16. <script>
  17. import ReconciliationDetail from './components/reconciliationDetail.vue'
  18. import TemplatePage from '@/components/template/template-page-1.vue'
  19. import import_mixin from '@/components/template/import_mixin.js'
  20. import add_callback_mixin from '@/components/template/add_callback_mixin.js'
  21. import Popu from '@/components/template/popu.vue'
  22. import { getCostBillListSalesList, exportCostBillListSalesList, costBillSalesCheck } from '@/api/salesReconciliation'
  23. export default {
  24. components: { TemplatePage, Popu, ReconciliationDetail },
  25. mixins: [import_mixin, add_callback_mixin],
  26. data() {
  27. return {
  28. visible: false,
  29. // 事件组合
  30. optionsEvensGroup: [
  31. // [
  32. // [
  33. // {
  34. // name: '导入',
  35. // render: this.importButton(importCustomerV2)
  36. // }
  37. // ]
  38. // ]
  39. ],
  40. // 表格属性
  41. tableAttributes: {
  42. // 启用勾选列
  43. selectColumn: true
  44. }, // 关闭新增弹窗
  45. // 表格事件
  46. tableEvents: {
  47. 'selection-change': this.selectionChange
  48. },
  49. recordSelected: [],
  50. formData: {},
  51. dialogVisible: false,
  52. orderCode: null,
  53. detail: {}
  54. }
  55. },
  56. methods: {
  57. // 列表请求函数
  58. getList(...p) {
  59. this.recordSelected = []
  60. return getCostBillListSalesList(...p)
  61. },
  62. // 列表导出函数
  63. exportList: exportCostBillListSalesList,
  64. // 表格列解析渲染数据更改
  65. columnParsing(item, defaultData) {
  66. return defaultData
  67. },
  68. // 监听勾选变化
  69. selectionChange(data) {
  70. this.recordSelected = data
  71. },
  72. operation() {
  73. return (h, { row, index, column }) => {
  74. return (
  75. <div class='operation-btns'>
  76. {row.processStatus == 'COST_IN_SALES_CHECK'?<div>
  77. <el-button
  78. size='mini'
  79. type='text'
  80. onClick={() => {
  81. this.visible = true
  82. this.orderCode = row.salesCheckCode
  83. this.detail = row
  84. }}
  85. >
  86. 对账
  87. </el-button>
  88. <el-button
  89. size='mini'
  90. type='text'
  91. onClick={() => {
  92. this.$confirm('请确认本月对账账单数据正确,经确认后则不能回退对账结果', '提示', {
  93. confirmButtonText: '确定',
  94. cancelButtonText: '取消',
  95. type: 'warning'
  96. })
  97. .then(() => {
  98. costBillSalesCheck({ salesCheckCode: row.salesCheckCode }).then(res => {
  99. this.$message({
  100. type: 'success',
  101. message: '完成对账成功!'
  102. })
  103. })
  104. })
  105. .catch(() => {
  106. this.$message({
  107. type: 'info',
  108. message: '已取消完成对账'
  109. })
  110. })
  111. }}
  112. >
  113. 完成对账
  114. </el-button>
  115. </div>:null}
  116. </div>
  117. )
  118. }
  119. },
  120. handleClose() {
  121. this.visible = false
  122. },
  123. onSbumit() {
  124. costBillSalesCheck({ salesCheckCode: 11 }).then(res => {})
  125. }
  126. }
  127. }
  128. </script>
  129. <style lang="scss" scoped></style>