detail.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <template>
  2. <div class="card content-box">
  3. <el-form :model="formData" label-width="140px">
  4. <el-row>
  5. <el-col :span="12">
  6. <el-form-item label="店铺名称 :">
  7. <span>{{ formData.storeName }}</span>
  8. </el-form-item>
  9. <el-form-item label="名称 :">
  10. <span>{{ formData.name }}</span>
  11. </el-form-item>
  12. <el-form-item label="描述 :">
  13. <span>{{ formData.description }}</span>
  14. </el-form-item>
  15. </el-col>
  16. <el-col :span="12">
  17. <el-form-item label="状态:">
  18. <span>{{ getStatusName(formData.status) }}</span>
  19. </el-form-item>
  20. <el-form-item label="拒绝原因:" v-if="formData.status === '2'">
  21. <span>{{ formData.rejectionReason }}</span>
  22. </el-form-item>
  23. </el-col>
  24. </el-row>
  25. <el-row class="text-center" style="margin-top: 20px">
  26. <el-col :span="24">
  27. <el-button type="primary" @click="goBack"> 确定 </el-button>
  28. </el-col>
  29. </el-row>
  30. </el-form>
  31. </div>
  32. </template>
  33. <script setup lang="tsx" name="licenseManagementDetail">
  34. import { ref, onMounted } from "vue";
  35. import { useRoute, useRouter } from "vue-router";
  36. import { ElMessage } from "element-plus";
  37. import { getStaffConfigDeatail } from "@/api/modules/staffConfig";
  38. const route = useRoute();
  39. const router = useRouter();
  40. const formData = ref({});
  41. const id = ref((route.query.id as string) || "");
  42. const getStatusName = (status: string) => {
  43. switch (status) {
  44. case "0":
  45. return "待审核";
  46. case "1":
  47. return "审核通过";
  48. case "2":
  49. return "审核拒绝";
  50. default:
  51. return "未知状态";
  52. }
  53. };
  54. onMounted(async () => {
  55. await initData();
  56. });
  57. const initData = async () => {
  58. if (id.value) {
  59. try {
  60. const response = await getStaffConfigDeatail({ id: id.value });
  61. if (response.code === 200) {
  62. formData.value = response.data;
  63. }
  64. } catch (error) {
  65. ElMessage.error("获取详情失败");
  66. }
  67. }
  68. };
  69. const goBack = () => {
  70. router.go(-1);
  71. };
  72. </script>
  73. <style lang="scss" scoped>
  74. .el-form {
  75. width: 100%;
  76. .text-center {
  77. text-align: center;
  78. }
  79. }
  80. .el-col {
  81. box-sizing: border-box;
  82. padding-right: 10px;
  83. }
  84. </style>