Newer
Older
KaiFengPC / src / views / document / projectTransfer / index.vue
@zhangdeliang zhangdeliang on 23 May 5 KB 初始化项目
  1. <template>
  2. <div class="handOver">
  3. <div class="top">
  4. <el-form ref="ruleForm" inline :model="form">
  5. <el-form-item label="项目:" prop="projectId">
  6. <el-select v-model="form.projectId" placeholder="请选择项目" style="width: 100%">
  7. <el-option v-for="dict in projectList" :key="dict.id" :label="dict.projectName" :value="dict.id" />
  8. </el-select>
  9. </el-form-item>
  10. <el-form-item>
  11. <el-button type="primary" icon="Search" @click="search"> 查询</el-button>
  12. <el-button icon="Refresh" @click="resetQuery">重置</el-button>
  13. </el-form-item>
  14. </el-form>
  15. </div>
  16. <el-table :data="tableData" v-loading="loading" stripe :max-height="600">
  17. <el-table-column type="index" width="55" label="序号" />
  18. <el-table-column label="项目名称" prop="projectName" show-overflow-tooltip width="200" />
  19. <el-table-column label="项目实施状态" prop="buildStatus" show-overflow-tooltip>
  20. <template #default="{ row }">
  21. <dict-tag :options="build_status" :value="row.buildStatus" />
  22. </template>
  23. </el-table-column>
  24. <el-table-column label="建设单位" prop="chargeDepartment" show-overflow-tooltip />
  25. <el-table-column label="设计单位" prop="designUnit" show-overflow-tooltip />
  26. <el-table-column label="运营单位" prop="operationUnit" show-overflow-tooltip />
  27. <el-table-column label="实施单位" prop="constructUnit" show-overflow-tooltip />
  28. <el-table-column label="资料合计" prop="fileNum" show-overflow-tooltip>
  29. <template #default="{ row }">
  30. <el-button type="primary" link @click="openDialog3(row)">{{ row.fileNum }}</el-button>
  31. </template>
  32. </el-table-column>
  33. <el-table-column label="移交状态" prop="status" show-overflow-tooltip>
  34. <template #default="{ row }">
  35. <el-tag v-if="statusMap.get(row.status)" :type="statusMap.get(row.status).type">{{ statusMap.get(row.status).text }}</el-tag>
  36. <span v-else></span>
  37. </template>
  38. </el-table-column>
  39. <el-table-column label="操作" show-overflow-tooltip width="120">
  40. <template #default="{ row }">
  41. <el-button type="primary" link @click="openDialog(row, 'view')">详情</el-button>
  42. <el-button type="primary" link @click="openDialog(row, 'transfer')" v-if="!row.status">移交</el-button>
  43. <el-button type="primary" link @click="openDialog(row, 'audit')" v-if="row.status === 'approve'">审核</el-button>
  44. </template>
  45. </el-table-column>
  46. </el-table>
  47. <pagination :total="total" v-model:page="pageNum" v-model:limit="pageSize" @pagination="getTableList" />
  48.  
  49. <el-dialog
  50. v-model="visible"
  51. :title="`工程项目移交${opts.text}`"
  52. :close-on-click-modal="false"
  53. width="40%"
  54. :before-close="close"
  55. class="dialog"
  56. >
  57. <operate v-if="visible" ref="operateRef" :cur-row="curRow" :opts="opts" @close="close"></operate>
  58. <template #footer>
  59. <div class="dialog-footer" v-if="opts.type !== 'view'">
  60. <el-button type="primary" @click="submit">{{ opts.type === 'transfer' ? '移交' : '同意' }}</el-button>
  61. <el-button @click="close">取消</el-button>
  62. </div>
  63. </template>
  64. </el-dialog>
  65.  
  66. <el-dialog v-model="visible2" title="工程项目移交-查询进度" :close-on-click-modal="false" width="20%" class="dialog">
  67. <step />
  68. </el-dialog>
  69.  
  70. <el-dialog v-model="visible3" title="工程文件列表" :close-on-click-modal="false" width="60%" class="dialog" :before-close="close3">
  71. <tableList v-if="visible3" :cur-row="curRow" />
  72. </el-dialog>
  73. </div>
  74. </template>
  75.  
  76. <script setup>
  77. import { reactive, ref, onMounted, shallowRef } from 'vue';
  78. import { usePagination } from '@/hooks';
  79. import { getProjectTransferPage, getProjectInfoNewList } from '@/api/document/projectTransfer';
  80. import operate from './operate.vue';
  81. import tableList from './tableList.vue';
  82. import step from './step.vue';
  83. const { proxy } = getCurrentInstance();
  84. const { build_status } = proxy.useDict('build_status');
  85.  
  86. const statusMap = new Map([
  87. ['', { type: 'danger', text: '未移交' }],
  88. ['approve', { type: 'danger', text: '待审核' }],
  89. ['end', { type: 'success', text: '已移交' }],
  90. ]);
  91.  
  92. const form = reactive({
  93. projectId: '',
  94. });
  95. const opts = reactive({
  96. text: '',
  97. type: '',
  98. });
  99. const projectList = ref([]);
  100. const visible = ref(false);
  101. const curRow = shallowRef(null);
  102. const visible2 = ref(false);
  103. const visible3 = ref(false);
  104.  
  105. const { pageNum, pageSize, tableData, total, loading, getTableList } = usePagination(getProjectTransferPage, { value: form });
  106.  
  107. const search = () => {
  108. pageNum.value = 1;
  109. getTableList();
  110. };
  111.  
  112. const resetQuery = () => {
  113. proxy.$refs.ruleForm.resetFields();
  114. search();
  115. };
  116.  
  117. const openDialog = (data, type) => {
  118. visible.value = true;
  119. curRow.value = data;
  120. opts.type = type;
  121. if (type === 'audit') {
  122. opts.text = '审核';
  123. }
  124. };
  125.  
  126. const close = result => {
  127. if (result.isRefresh) getTableList();
  128. visible.value = false;
  129. curRow.value = null;
  130. };
  131.  
  132. const openDialog2 = row => {
  133. visible2.value = true;
  134. curRow.value = row;
  135. };
  136.  
  137. const close2 = () => {
  138. visible2.value = false;
  139. curRow.value = null;
  140. };
  141.  
  142. const openDialog3 = row => {
  143. visible3.value = true;
  144. curRow.value = row;
  145. };
  146.  
  147. const close3 = () => {
  148. visible3.value = false;
  149. curRow.value = null;
  150. };
  151.  
  152. const submit = () => {
  153. proxy.$refs.operateRef.submit();
  154. };
  155.  
  156. const getProjectInfoNewListFn = async () => {
  157. const res = await getProjectInfoNewList();
  158. if (res?.code !== 200) return;
  159. projectList.value = res.data || [];
  160. };
  161.  
  162. onMounted(() => {
  163. getProjectInfoNewListFn();
  164. getTableList();
  165. });
  166. </script>
  167.  
  168. <style lang="scss" scoped>
  169. .handOver {
  170. padding: 20px;
  171. height: 90vh;
  172. overflow-y: hidden;
  173. .top {
  174. margin-bottom: 15px;
  175. }
  176. }
  177.  
  178. :deep(.dialog) {
  179. .el-dialog__body {
  180. padding-bottom: 20px !important;
  181. }
  182. .el-dialog__footer {
  183. padding-top: 0 !important;
  184. }
  185. }
  186. </style>