index.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <template>
  2. <div class="page">
  3. <template-page v-show="!formDialog" ref="pageRef" :get-list="getList" :table-attributes="tableAttributes"
  4. :table-events="tableEvents" :operationColumnWidth="50" :options-evens-group="optionsEvensGroup"
  5. :moreParameters="moreParameters" :column-parsing="columnParsing" :operation="operation()" :exportList="exportList">
  6. </template-page>
  7. <div class="detail" v-if="formDialog">
  8. <auxiliarySalesOrderDetail v-if="orderSource == 'M_SALES'" :id="id" @back="backList" :formType="2" title="辅材销售订单详情">
  9. </auxiliarySalesOrderDetail>
  10. <attachmentSalesOrderDetail v-if="orderSource == 'P_SALES'" :id="id" @back="backList" :formType="2"
  11. title="配件销售订单详情"></attachmentSalesOrderDetail>
  12. <auxiliarySalesReturnOrderDetail v-if="orderSource == 'SALES_RET'" :id="id" @back="backList" :formType="2"
  13. title="辅材销售退货单详情"></auxiliarySalesReturnOrderDetail>
  14. <attachmentNewReturnDetail v-if="orderSource == 'NEW_PARTS_RET'" :id="id" @back="backList" :formType="2"
  15. title="配件新件返还详情"></attachmentNewReturnDetail>
  16. <attachmentOldReturnDetail v-if="orderSource == 'OLD_PARTS_RET'" :id="id" @back="backList" :formType="2"
  17. title="配件旧件返还详情"></attachmentOldReturnDetail>
  18. </div>
  19. </div>
  20. </template>
  21. <script>
  22. import TemplatePage from '@/components/template/template-page-1.vue'
  23. import import_mixin from '@/components/template/import_mixin.js'
  24. import auxiliarySalesOrderDetail from '../components/auxiliarySalesOrderDetail.vue'
  25. import attachmentSalesOrderDetail from '../components/attachmentSalesOrderDetail.vue'
  26. import auxiliarySalesReturnOrderDetail from '../components/auxiliarySalesReturnOrderDetail.vue'
  27. import attachmentNewReturnDetail from '../components/attachmentNewReturnDetail.vue'
  28. import attachmentOldReturnDetail from '../components/attachmentOldReturnDetail.vue'
  29. import { downloadFiles } from '@/utils/util'
  30. import { listPageV2, pageExport } from "@/api/auxiliaryFittings/transaction";
  31. import operation_mixin from '@/components/template/operation_mixin.js'
  32. export default {
  33. components: { TemplatePage, auxiliarySalesOrderDetail, attachmentSalesOrderDetail, auxiliarySalesReturnOrderDetail, attachmentNewReturnDetail, attachmentOldReturnDetail },
  34. mixins: [import_mixin, operation_mixin],
  35. data() {
  36. return {
  37. // 事件组合
  38. optionsEvensGroup: [],
  39. // 表格属性
  40. tableAttributes: {
  41. // 启用勾选列
  42. selectColumn: true
  43. },
  44. // 表格事件
  45. tableEvents: {
  46. 'selection-change': this.selectionChange
  47. },
  48. // 勾选选中行
  49. recordSelected: [],
  50. /** 表单变量 */
  51. id: '',
  52. orderSource: '',
  53. formDialog: false
  54. }
  55. },
  56. computed: {
  57. // 更多参数
  58. moreParameters() {
  59. return []
  60. }
  61. },
  62. methods: {
  63. // 列表请求函数
  64. getList: listPageV2,
  65. // 列表导出函数
  66. exportList: pageExport,
  67. // 表格列解析渲染数据更改
  68. columnParsing(item, defaultData) {
  69. return defaultData
  70. },
  71. // 监听勾选变化
  72. selectionChange(data) {
  73. this.recordSelected = data
  74. },
  75. operation() {
  76. return this.operationBtn({
  77. detail: {
  78. click: ({ row, index, column }) => {
  79. this.id = row.orderId
  80. this.orderSource = row.orderSource
  81. if (row.orderSource) {
  82. this.formDialog = true
  83. } else {
  84. this.$message.warning('订单来源为空!')
  85. }
  86. }
  87. }
  88. })
  89. },
  90. backList() {
  91. this.id = ''
  92. this.formDialog = false;
  93. this.$refs.pageRef.refreshList()
  94. },
  95. }
  96. }
  97. </script>
  98. <style lang="scss" scoped>
  99. .page {
  100. height: 100%;
  101. }
  102. .tab {
  103. padding: 20px 20px 0 20px;
  104. }
  105. </style>