list.vue 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <template>
  2. <div class="unit container normal-panel">
  3. <el-row>
  4. <el-col :span="11">
  5. <p class="normal-title normal-margin">计量单位</p>
  6. <slot name="unitAdd"/>
  7. <tableLayout v-if="unitList" :layout="tablecols1" :data="unitList" :custom="false" height="70vh">
  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. </tableLayout>
  15. </el-col>
  16. <el-col :span="11" style="margin-left:16px">
  17. <p class="normal-title normal-margin">计量单位组</p>
  18. <slot name="unitGroupAdd"/>
  19. <tableLayout v-if="unitGroupList" :layout="tablecols2" :data="unitGroupList" :custom="false" height="70vh">
  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. </tableLayout>
  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. "where":{
  61. "condition":""
  62. }
  63. }
  64. })
  65. this.unitList = res.data
  66. console.log(res)
  67. },
  68. /* 计量单位组数据 */
  69. async getUnitGroup() {
  70. let res = await this.$api.requested({
  71. "id": "20220922084503",
  72. "version":1,
  73. "content": {
  74. "nocache":true,
  75. "where":{
  76. "condition":""
  77. }
  78. }
  79. })
  80. this.unitGroupList = res.data
  81. console.log(res);
  82. }
  83. },
  84. };
  85. </script>
  86. <style scoped>
  87. </style>