orderManagement.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <template>
  2. <!-- 订单管理 -->
  3. <div>
  4. <actionBar menuTitle="订单管理" :formList="formList"></actionBar>
  5. <tables :key="Math.random()" :suspension="false" :tableList="tableList" :tableData="tableData"
  6. @buttonData="buttonData"></tables>
  7. <!-- 分页 -->
  8. <div class="paging_bottom" v-if="Total">
  9. <pagination :total="Total" :currentPage="Pagination.PageIndex" @changeSize="changeSize"
  10. @changeCurrent="changeCurrent">
  11. </pagination>
  12. </div>
  13. <el-dialog :title="staffTitle" :visible.sync="staffDialogVisible" width="60%" :close-on-click-modal="false">
  14. <forms ref="childRules" :formNewList="formRuleList" labelWidth="100px"></forms>
  15. <span slot="footer" class="dialog-footer">
  16. <el-button plain @click="staffDialogVisible = false">取 消</el-button>
  17. <el-button type="primary" @click="staffDialogVisible = false">确 定</el-button>
  18. </span>
  19. </el-dialog>
  20. <div ref="root"></div>
  21. </div>
  22. </template>
  23. <script>
  24. import actionBar from '@/components/actionBar'
  25. import tables from '@/components/tables'
  26. import pagination from '@/components/pagination'
  27. import forms from '@/components/forms'
  28. import {
  29. formRules,
  30. employee
  31. } from "./order.js";
  32. import { ref, onMounted } from 'vue'
  33. export default {
  34. setup() {
  35. const root = ref(null)
  36. onMounted(() => {
  37. // 在渲染完成后, 这个 div DOM 会被赋值给 root ref 对象
  38. console.log(root.value,999) // <div/>
  39. })
  40. return {
  41. root,
  42. }
  43. },
  44. components: {
  45. actionBar,
  46. tables,
  47. pagination,
  48. forms
  49. },
  50. data() {
  51. return {
  52. staffTitle: '添加',
  53. staffDialogVisible: false,
  54. formList: [{
  55. type: 'input',
  56. label: '订单时间',
  57. field: 'T_name',
  58. placeholder: '订单时间',
  59. colWidth: 'el-col-24',
  60. }, {
  61. type: 'select',
  62. label: '订单状态',
  63. field: 'state',
  64. placeholder: '订单状态',
  65. colWidth: 'el-col-24',
  66. }, {
  67. type: 'input',
  68. label: '客户电话',
  69. field: 'phone',
  70. placeholder: '客户电话',
  71. colWidth: 'el-col-24',
  72. }],
  73. tableList: employee(),
  74. tableData: [{
  75. T_name: '2154'
  76. }, {
  77. T_name: '2154'
  78. }, {
  79. T_name: '2154'
  80. }],
  81. Pagination: {
  82. PageIndex: 1,
  83. PageSize: 10,
  84. },
  85. Total: 10,
  86. formRuleList: [],
  87. }
  88. },
  89. mounted() {
  90. const dataList = formRules();
  91. this.formRuleList = dataList;
  92. },
  93. methods: {
  94. buttonData(row, type) {
  95. this.operationType = type
  96. console.log(row, type, 25)
  97. if (type == 'edit') {
  98. this.staffTitle = '编辑'
  99. } else {
  100. this.staffTitle = '详情'
  101. }
  102. this.staffDialogVisible = true
  103. },
  104. changeSize(val) {
  105. this.Pagination.PageSize = val
  106. },
  107. changeCurrent(val) {
  108. this.Pagination.PageIndex = val
  109. },
  110. }
  111. }
  112. </script>
  113. <style lang="scss" scoped>
  114. </style>