supplierIndex.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <template>
  2. <div id="supplierIndex">
  3. <div v-if="isList">
  4. <el-card v-loading="loading" style="position: relative;">
  5. <p>内部供应商档案列表</p>
  6. <div class="btn_grooup">
  7. <el-button type="primary" size="mini" @click="addDivision">新增</el-button>
  8. <el-button type="primary" size="mini" @click="delItems">删除</el-button>
  9. </div>
  10. <el-super-ux-table
  11. id="data-table"
  12. v-model="tableData"
  13. index
  14. checkbox
  15. :size="size"
  16. :dict="dict"
  17. :page="pageInfo"
  18. :height=500
  19. :columns="TableColumns"
  20. pagination
  21. convenitentOperation
  22. storage-key="supplierTable"
  23. @row-dblclick="useSee"
  24. @row-select="useSelect"
  25. @selection-change="handleSelectionChange"
  26. @row-click="rowSelect"
  27. @pagination="useQuery(params, pageInfo)"
  28. ref="tables"
  29. >
  30. <ux-table-column
  31. fixed="right"
  32. title="操作"
  33. align="center"
  34. width="100"
  35. >
  36. <template slot-scope="scope">
  37. <!-- <el-button type="text" size="mini" v-if="scope.row.status == '1' && scope.row.flowId" @click="reback(scope.row)">收回</el-button> -->
  38. <el-button type="text" size="mini" @click="check(scope.row)">查看</el-button>
  39. <el-button type="text" size="mini" @click="delItem(scope.row)">删除</el-button>
  40. </template>
  41. </ux-table-column>
  42. </el-super-ux-table>
  43. </el-card>
  44. </div>
  45. <Add v-model="isList" v-if="!isList" :pageStu="page" :disable="disable" :row="rowDetail" @refresh="searchList"/>
  46. </div>
  47. </template>
  48. <script>
  49. export default {
  50. dicts: [],
  51. components: {
  52. Add: () => import("./addSupplier.vue"),
  53. ElSuperUxTable: () => import("@/components/super-ux-table/index.vue"),
  54. },
  55. data () {
  56. return {
  57. // 页面配置
  58. isList: true,
  59. // 页面状态
  60. page: '',
  61. disable: false,
  62. rowDetail: {},
  63. size: "mini",
  64. loading: false,
  65. pageInfo: {
  66. pageNum: 1,
  67. pageSize: 20,
  68. total: 0
  69. },
  70. tableData: [],
  71. selectData: [],
  72. // SearchColumns: SearchColumns,
  73. TableColumns: [
  74. { item: { key: "supplierName", title: "供应商" }, attr: {} },
  75. { item: { key: "registrationName", title: "xxx" }, attr: {} },
  76. { item: { key: "remark", title: "备注"}, attr: {} },
  77. ].map(({ item, attr }) => ({
  78. attr,
  79. item: {
  80. ...item,
  81. sortabled: true,
  82. fixedabled: true,
  83. filterabled: true,
  84. hiddenabled: true,
  85. },
  86. })),
  87. ids: []
  88. }
  89. },
  90. methods: {
  91. // 新增
  92. addDivision() {
  93. this.isList = false
  94. this.page = 'add'
  95. this.disable = false
  96. },
  97. delItems() {},
  98. searchList() {
  99. // this.useQuery(this.params, this.pageInfo)
  100. },
  101. useSee() {},
  102. useSelect() {},
  103. handleSelectionChange(selection) {
  104. console.log('选中', selection)
  105. this.ids = selection.map(item => item.id)
  106. console.log('选中数组', this.ids)
  107. },
  108. rowSelect(row) {
  109. this.$refs.tables.toggleRowSelection([{row: row}]);
  110. },
  111. // 加载列表
  112. async useQuery(prop, page) {
  113. let params = {...prop, ...page}
  114. // await getEquipmentDataList(params).then(res => {
  115. // if( res.code === 200 ) {
  116. // this.tableData = res.rows
  117. // this.pageInfo.total = res.total
  118. // }
  119. // })
  120. },
  121. }
  122. }
  123. </script>
  124. <style lang="scss" scoped>
  125. #supplierIndex {
  126. padding: 12px;
  127. box-sizing: border-box;
  128. overflow-y: scroll;
  129. }
  130. .btn_grooup {
  131. margin-bottom: 10px;
  132. display: flex;
  133. justify-content: flex-end;
  134. }
  135. </style>