index.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. <template>
  2. <div class="project org">
  3. <ProjectMenu cur-key="org/project" />
  4. <div id="query-form">
  5. <el-form inline>
  6. <el-form-item prop="name" label="名称">
  7. <el-input v-model="queryForm.name" clearable @change="pageQueryProjectList_OrgManager()" />
  8. </el-form-item>
  9. <el-form-item prop="status" label="状态">
  10. <el-select v-model="queryForm.status" @change="pageQueryProjectList_OrgManager()">
  11. <el-option label="全部" :value="-1" />
  12. <el-option label="制作中" :value="0" />
  13. <el-option label="审核中" :value="1" />
  14. <el-option label="已终审" :value="2" />
  15. <el-option label="已上架" :value="3" />
  16. <el-option label="已下架" :value="4" />
  17. </el-select>
  18. </el-form-item>
  19. </el-form>
  20. </div>
  21. <div class="project-list">
  22. <el-table :data="list">
  23. <el-table-column label="序号" width="60" align="center" header-align="center" class-name="index-column">
  24. <template slot-scope="{ $index }">
  25. {{ cur_page_begin_index + $index }}
  26. </template>
  27. </el-table-column>
  28. <el-table-column prop="sn" label="编号" width="140" header-align="center" />
  29. <el-table-column prop="name" label="名称" width="260" header-align="center" />
  30. <el-table-column prop="version" label="版本" width="100" header-align="center" />
  31. <el-table-column prop="org_name" label="所属机构" width="120" header-align="center" />
  32. <el-table-column prop="leader_name_desc" label="项目组长" width="140" header-align="center" />
  33. <el-table-column prop="create_time" label="创建时间" width="180" header-align="center" />
  34. <el-table-column prop="content_count_SJ" label="教材页面数" width="100" header-align="center" />
  35. <el-table-column prop="status_name" label="状态" align="center" width="120" header-align="center" />
  36. <el-table-column prop="request_status_name" label="申请状态" align="center" header-align="center" />
  37. <el-table-column fixed="right" label="操作" width="350" align="center" header-align="center">
  38. <template slot-scope="{ row }">
  39. <span
  40. class="link"
  41. @click="
  42. $router.push({
  43. path: `/personal_workbench/project_info/${row.id}`,
  44. query: { isManage: false, backPath: '/project_manage/org/project' },
  45. })
  46. "
  47. >查看信息</span
  48. >
  49. <span class="link" @click="previewProject(row.id)">预览项目</span>
  50. <template v-if="isTrue(row.is_can_audit)">
  51. <span class="link" @click="projectAuditOperate(row.id, 'true', row.request_status)"> 审核通过 </span>
  52. <span class="link" @click="projectAuditOperate(row.id, 'false', row.request_status)">审核拒绝</span>
  53. </template>
  54. <span v-if="isTrue(row.is_can_shangjia)" class="link" @click="shangjiaProject(row.id)">上架</span>
  55. <span v-if="isTrue(row.is_can_xiajia)" class="link" @click="xiajiaProject(row.id)">下架</span>
  56. </template>
  57. </el-table-column>
  58. </el-table>
  59. <PaginationPage ref="pagination" :total="total" @getList="pageQueryProjectList_OrgManager" />
  60. </div>
  61. </div>
  62. </template>
  63. <script>
  64. import PaginationPage from '@/components/PaginationPage.vue';
  65. import ProjectMenu from '@/views/project_manage/common/ProjectMenu.vue';
  66. import { PageQueryProjectList_OrgManager } from '@/api/list';
  67. import { isTrue } from '@/utils/validate';
  68. import { ProjectAuditOperate, ShangjiaBook, XiajiaBook } from '@/api/project';
  69. export default {
  70. name: 'OrgProjectPage',
  71. components: {
  72. PaginationPage,
  73. ProjectMenu,
  74. },
  75. data() {
  76. return {
  77. list: [],
  78. total: 0,
  79. cur_page_begin_index: 0,
  80. isTrue,
  81. queryForm: {
  82. name: '',
  83. status: -1,
  84. },
  85. };
  86. },
  87. methods: {
  88. /**
  89. * 项目审核操作
  90. * @param {number} project_id 项目id
  91. * @param {string} is_pass 是否审核通过,true-审核通过,false-审核拒绝
  92. * @param {string} request_status 申请状态
  93. */
  94. projectAuditOperate(project_id, is_pass, request_status) {
  95. this.$confirm(`确定要执行${is_pass === 'true' ? '审核通过' : '审核拒绝'}吗?`, '提示', {
  96. confirmButtonText: '确定',
  97. cancelButtonText: '取消',
  98. })
  99. .then(() => {
  100. let loading = null;
  101. if (request_status === 3) {
  102. loading = this.$loading({
  103. text: '正在生成新的修订项目,请等待...',
  104. });
  105. }
  106. ProjectAuditOperate({ project_id, is_pass })
  107. .then(() => {
  108. this.$message.success('操作成功');
  109. this.$refs.pagination.getList();
  110. })
  111. .catch(() => {})
  112. .finally(() => {
  113. if (loading) {
  114. loading.close();
  115. }
  116. });
  117. })
  118. .catch(() => {});
  119. },
  120. pageQueryProjectList_OrgManager(data) {
  121. const _data = {
  122. page_capacity: 10,
  123. cur_page: 1,
  124. ...data,
  125. ...this.queryForm,
  126. };
  127. PageQueryProjectList_OrgManager(_data)
  128. .then(({ total_count, cur_page_begin_index, project_list }) => {
  129. this.total = total_count;
  130. this.cur_page_begin_index = cur_page_begin_index;
  131. this.list = project_list;
  132. })
  133. .catch(() => {});
  134. },
  135. previewProject(projectId) {
  136. this.$router.push({ path: `/project_manage/org/project/preview/${projectId}` });
  137. },
  138. shangjiaProject(project_id) {
  139. this.$confirm('确定要上架该教材吗?', '提示', {
  140. confirmButtonText: '确定',
  141. cancelButtonText: '取消',
  142. })
  143. .then(() => {
  144. ShangjiaBook({ project_id })
  145. .then(() => {
  146. this.$message.success('操作成功');
  147. this.$refs.pagination.getList();
  148. })
  149. .catch(() => {});
  150. })
  151. .catch(() => {});
  152. },
  153. xiajiaProject(project_id) {
  154. this.$confirm('确定要下架该教材吗?', '提示', {
  155. confirmButtonText: '确定',
  156. cancelButtonText: '取消',
  157. })
  158. .then(() => {
  159. XiajiaBook({ project_id })
  160. .then(() => {
  161. this.$message.success('操作成功');
  162. this.$refs.pagination.getList();
  163. })
  164. .catch(() => {});
  165. })
  166. .catch(() => {});
  167. },
  168. },
  169. };
  170. </script>
  171. <style lang="scss" scoped>
  172. @use '@/styles/mixin.scss' as *;
  173. .project {
  174. @include page-base;
  175. @include table-list;
  176. }
  177. </style>