index.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <template>
  2. <div class="airportInfo">
  3. <div class="wrap">
  4. <Minheader :is-auth="true" :is-statuser="true" @addForm="addForm">
  5. <template #header>
  6. <div class="status flex-wrap">
  7. <div class="manageTitle">特殊货物类型维护</div>
  8. </div>
  9. </template></Minheader
  10. >
  11. <DataTable
  12. :state="state"
  13. :tableData="tableData"
  14. @editDialog="editDialog"
  15. @eleDialog="eleDialog"
  16. />
  17. <Dialog
  18. :flag="flag"
  19. :type="type"
  20. :msgTitle="msgTitle"
  21. @resetForm="resetForm"
  22. @delRest="delRest"
  23. >
  24. <div class="diacont">
  25. <el-form :model="tableForm">
  26. <el-row :gutter="24">
  27. <el-col>
  28. <el-form-item label="类型名称">
  29. <el-input
  30. v-model="tableForm.name"
  31. placeholder="请输入类型名称"
  32. />
  33. </el-form-item>
  34. </el-col>
  35. <el-col>
  36. <el-form-item label="类型编码">
  37. <el-input
  38. v-model="tableForm.china"
  39. placeholder="请输入类型编码"
  40. />
  41. </el-form-item>
  42. </el-col>
  43. <el-col>
  44. <el-form-item label="描述">
  45. <el-input
  46. type="textarea"
  47. v-model="tableForm.englin"
  48. placeholder="请输入描述"
  49. />
  50. </el-form-item>
  51. </el-col>
  52. </el-row>
  53. </el-form>
  54. </div>
  55. </Dialog>
  56. </div>
  57. </div>
  58. </template>
  59. <script setup lang="ts">
  60. import DataTable from "@/views/table/index.vue";
  61. import Minheader from "@/components/minheader/index.vue";
  62. import Dialog from "@/components/dialog/index.vue";
  63. const flag = ref<Boolean>(false); //弹窗开关
  64. const type = ref<String>(""); //判断是否删除
  65. const msgTitle = ref<String>("新增特殊货物类型维护"); //弹窗标题
  66. const tableColsCopys = reactive<Object>({}); //弹窗
  67. const tableForm = reactive({
  68. name: "",
  69. china: "",
  70. englin: "",
  71. }); //弹窗内容
  72. //列表
  73. const tableData = ref([
  74. {
  75. name: "测试",
  76. china: "测试",
  77. englin: "测试",
  78. },
  79. {
  80. name: "测试",
  81. china: "测试",
  82. englin: "测试",
  83. },
  84. {
  85. name: "测试",
  86. china: "测试",
  87. englin: "测试",
  88. },
  89. ]);
  90. //表头
  91. const state = reactive({
  92. list: [
  93. { label: "类型名称", key: "name" },
  94. { label: "类型编码", key: "china" },
  95. { label: "描述", key: "englin" },
  96. ],
  97. listLoading: true,
  98. });
  99. //新增
  100. const addForm = () => {
  101. msgTitle.value = "新增特殊货物类型维护";
  102. flag.value = true;
  103. type.value = "";
  104. };
  105. //取消
  106. const resetForm = () => {
  107. flag.value = false;
  108. tableForm.name = "";
  109. tableForm.china = "";
  110. tableForm.englin = "";
  111. };
  112. //编辑
  113. const editDialog = (data) => {
  114. msgTitle.value = "编辑特殊货物类型维护";
  115. flag.value = true;
  116. type.value = "";
  117. tableForm.name = data.name;
  118. tableForm.china = data.china;
  119. tableForm.englin = data.englin;
  120. };
  121. //删除
  122. const eleDialog = () => {
  123. msgTitle.value = "删除特殊货物类型维护";
  124. flag.value = true;
  125. type.value = "del";
  126. };
  127. //删除
  128. const delRest = () => {
  129. flag.value = false;
  130. };
  131. </script>
  132. <style lang="scss" scoped>
  133. ::v-deep .el-form-item__label {
  134. width: 80px;
  135. }
  136. </style>