salesReconciliation.vue 3.9 KB

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