pickOrder.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <template>
  2. <div>
  3. <el-dialog
  4. title="选择领料单"
  5. :visible.sync="dialogVisible"
  6. width="40%"
  7. :before-close="handleClose"
  8. >
  9. <div class="main">
  10. <ele-pro-table
  11. ref="table"
  12. :initLoad="false"
  13. :columns="columns"
  14. :current.sync="current"
  15. highlight-current-row
  16. :datasource="tableData"
  17. tool-class="ele-toolbar-form"
  18. cache-key="systemOrgUserTable"
  19. @row-click="chooseRow"
  20. >
  21. <!-- 表头工具栏 -->
  22. <template v-slot:action="{ row }">
  23. <el-radio class="radio" v-model="radio" :label="row.id"
  24. ><i></i
  25. ></el-radio>
  26. </template>
  27. </ele-pro-table>
  28. </div>
  29. <span slot="footer" class="dialog-footer">
  30. <el-button @click="dialogVisible = false">取 消</el-button>
  31. <el-button type="primary" @click="handleMine">确 定</el-button>
  32. </span>
  33. </el-dialog>
  34. </div>
  35. </template>
  36. <script>
  37. import { pickOrderPage } from '@/api/mes';
  38. export default {
  39. data() {
  40. return {
  41. dialogVisible: false,
  42. pages: {
  43. pageNum: 1,
  44. size: 10
  45. },
  46. total: 0,
  47. tableData: [],
  48. current: {},
  49. radio: null,
  50. columns: [
  51. {
  52. columnKey: 'index',
  53. type: 'index',
  54. width: 80,
  55. label: '序号',
  56. align: 'center',
  57. showOverflowTooltip: true,
  58. fixed: 'left'
  59. },
  60. {
  61. prop: 'code',
  62. label: '领料单号',
  63. showOverflowTooltip: true
  64. },
  65. {
  66. prop: 'executorName',
  67. label: '执行人名称',
  68. showOverflowTooltip: true
  69. },
  70. {
  71. prop: 'executorTime',
  72. label: '执行日期',
  73. showOverflowTooltip: true
  74. },
  75. {
  76. prop: 'status',
  77. label: '领料状态',
  78. showOverflowTooltip: true
  79. },
  80. {
  81. columnKey: 'action',
  82. slot: 'action',
  83. align: 'center',
  84. fixed: 'right',
  85. width: 50
  86. }
  87. ]
  88. };
  89. },
  90. methods: {
  91. handleMine() {
  92. this.$emit('success', this.current);
  93. this.dialogVisible = false;
  94. },
  95. async open() {
  96. this.dialogVisible = true;
  97. const res = await pickOrderPage(this.pages);
  98. console.log(res);
  99. this.tableData = res.data.list;
  100. this.total = res.data.count;
  101. },
  102. chooseRow(row) {
  103. this.current = row;
  104. this.radio = row.id;
  105. },
  106. handleClose(done) {}
  107. }
  108. };
  109. </script>