list.vue 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <template>
  2. <div class="unit container normal-panel">
  3. <el-row style="display:flex;justify-content:space-between" :gutter="20">
  4. <el-col :span="12">
  5. <p class="normal-title normal-margin">计量单位</p>
  6. <slot name="unitAdd" :data="unitList"/>
  7. <table-new-layout v-if="unitList" :layout="tablecols1" :data="unitList" :custom="false" height="calc(100vh - 250px)">
  8. <template v-slot:opreation="scope">
  9. <div style="display:flex">
  10. <slot name="unitEdit" :data="scope.data" />
  11. <slot name="unitDel" :data="scope" />
  12. </div>
  13. </template>
  14. </table-new-layout>
  15. </el-col>
  16. <el-col :span="12">
  17. <p class="normal-title normal-margin">计量单位组</p>
  18. <slot name="unitGroupAdd" :data="unitList"/>
  19. <table-new-layout v-if="unitGroupList" :layout="tablecols2" :data="unitGroupList" :custom="false" height="calc(100vh - 250px)">
  20. <template v-slot:opreation="scope">
  21. <div style="display:flex">
  22. <slot name="unitGroupEdit" :data="{row:scope.data,unitList:unitList}" />
  23. <slot name="unitGroupDel" :data="scope.data" />
  24. </div>
  25. </template>
  26. </table-new-layout>
  27. </el-col>
  28. </el-row>
  29. </div>
  30. </template>
  31. <script>
  32. export default {
  33. name: '',
  34. data() {
  35. return {
  36. unitList:'',
  37. unitGroupList:'',
  38. tablecols1:'',
  39. tabelCol2:''
  40. };
  41. },
  42. computed:{
  43. },
  44. watch:{
  45. },
  46. created() {
  47. this.getUnit()
  48. this.getUnitGroup()
  49. this.tablecols1 = this.tool.tabelCol(this.$route.name).unitTable.tablecols
  50. this.tablecols2 = this.tool.tabelCol(this.$route.name).unitGroupTable.tablecols
  51. },
  52. methods: {
  53. /* 获取单位列表 */
  54. async getUnit() {
  55. let res = await this.$api.requested({
  56. "id": "20220922084803",
  57. "version":1,
  58. "content": {
  59. "nocache":true,
  60. "pageSize":999999999,
  61. "pageNumber":1,
  62. "where":{
  63. "condition":""
  64. }
  65. }
  66. })
  67. this.unitList = res.data
  68. console.log(res)
  69. },
  70. /* 计量单位组数据 */
  71. async getUnitGroup() {
  72. let res = await this.$api.requested({
  73. "id": "20220922084503",
  74. "version":1,
  75. "content": {
  76. "nocache":true,
  77. "pageSize":999999999,
  78. "pageNumber":1,
  79. "where":{
  80. "condition":""
  81. }
  82. }
  83. })
  84. this.unitGroupList = res.data
  85. console.log(res);
  86. }
  87. },
  88. };
  89. </script>
  90. <style scoped>
  91. a{
  92. justify-content: sp;
  93. }
  94. </style>