Knowledge-my-apply-detail.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <template>
  2. <div class="knowledge-my-apply-detail-container">
  3. <el-dialog title="申请详情" v-model="state.dialogVisible" draggable width="769px">
  4. <el-form :model="state.ruleForm" ref="ruleFormRef" label-width="100px">
  5. <el-row :gutter="35">
  6. <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
  7. <el-form-item label="申请类型" class="mb10">
  8. {{ state.ruleForm.knowledgeApplyType === 0 ? '新增' : '更新' }}
  9. </el-form-item>
  10. </el-col>
  11. <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
  12. <el-form-item label="诉求处理部门" class="mb10">
  13. {{ state.ruleForm.department }}
  14. </el-form-item>
  15. </el-col>
  16. <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
  17. <el-form-item label="申请人" class="mb10">
  18. {{ state.ruleForm.creationName }}
  19. </el-form-item>
  20. </el-col>
  21. <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
  22. <el-form-item label="申请部门" class="mb10">
  23. {{ state.ruleForm.creationBMName }}
  24. </el-form-item>
  25. </el-col>
  26. <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" v-if="state.ruleForm.expiredTime">
  27. <el-form-item label="截止时间" class="mb10">
  28. {{ formatDate(state.ruleForm.expiredTime, 'YYYY-mm-dd HH:MM:SS') }}
  29. </el-form-item>
  30. </el-col>
  31. <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
  32. <el-form-item label="诉求内容" class="mb10">
  33. {{ state.ruleForm.content }}
  34. </el-form-item>
  35. </el-col>
  36. <el-divider />
  37. <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" v-if="state.ruleForm.kbTitle">
  38. <el-form-item label="关联知识" class="mb10">
  39. <el-button link type="primary" @click="onPreview">{{ state.ruleForm.kbTitle }}</el-button>
  40. </el-form-item>
  41. </el-col>
  42. <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" v-if="state.ruleForm.processor">
  43. <el-form-item label="处理人" class="mb10">
  44. {{ state.ruleForm.processor }}
  45. </el-form-item>
  46. </el-col>
  47. <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" v-if="state.ruleForm.handleTime">
  48. <el-form-item label="处理完成时间" class="mb10">
  49. {{ formatDate(state.ruleForm.handleTime, 'YYYY-mm-dd HH:MM:SS') }}
  50. </el-form-item>
  51. </el-col>
  52. <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" v-if="state.ruleForm.returnTime">
  53. <el-form-item label="退回时间" class="mb10">
  54. {{ formatDate(state.ruleForm.returnTime, 'YYYY-mm-dd HH:MM:SS') }}
  55. </el-form-item>
  56. </el-col>
  57. <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" v-if="state.ruleForm.opinion">
  58. <el-form-item label="备注" class="mb10">
  59. {{ state.ruleForm.opinion }}
  60. </el-form-item>
  61. </el-col>
  62. </el-row>
  63. </el-form>
  64. <template #footer>
  65. <span class="dialog-footer">
  66. <el-button @click="closeDialog" class="default-button">关 闭</el-button>
  67. </span>
  68. </template>
  69. </el-dialog>
  70. </div>
  71. </template>
  72. <script setup lang="ts" name="knowledgeMyApplyDetail">
  73. import { reactive, ref } from 'vue';
  74. import { useRouter } from 'vue-router';
  75. import { formatDate } from '/@/utils/formatTime';
  76. import { KnowledgeApplyDetail } from '/@/api/knowledge/apply';
  77. // 定义变量内容
  78. const ruleFormRef = ref<any>(); // 表单ref
  79. const router = useRouter(); // 路由
  80. const state = reactive<any>({
  81. dialogVisible: false,
  82. ruleForm: {
  83. knowledgeApplyType: 1, // 申请类型
  84. department: '', // 诉求处理部门
  85. creationName: '', // 申请人
  86. creationBMName: '', // 申请部门
  87. expiredTime: '', // 截止时间
  88. content: '', // 诉求内容
  89. kbTitle: '', // 关联知识
  90. processor: '', // 处理人
  91. handleTime: '', // 处理完成时间
  92. returnTime: '', // 退回时间
  93. opinion: '', // 备注
  94. },
  95. orgData: [], // 机构数据
  96. loading: false, // 加载状态
  97. });
  98. // 打开弹窗
  99. const openDialog = async (row: any) => {
  100. state.loading = true;
  101. try {
  102. const res: any = await KnowledgeApplyDetail(row.id);
  103. state.ruleForm = res.result ?? {};
  104. state.dialogVisible = true;
  105. state.loading = false;
  106. } catch (error) {
  107. state.loading = false;
  108. }
  109. };
  110. // 预览
  111. const onPreview = () => {
  112. router.push({
  113. name: 'knowledgePreview',
  114. params: {
  115. id: state.ruleForm.kbid,
  116. tagsViewName: '知识预览',
  117. },
  118. });
  119. };
  120. // 关闭弹窗
  121. const closeDialog = () => {
  122. state.dialogVisible = false;
  123. };
  124. // 暴露变量
  125. defineExpose({
  126. openDialog,
  127. closeDialog,
  128. });
  129. </script>