Newer
Older
KaiFengPC / src / views / spongePerformance / waterlogging / floodControlStandard / todoDon.vue
@zhangdeliang zhangdeliang on 23 May 5 KB 初始化项目
  1. <template>
  2. <div class="water-analysis-page">
  3. <el-table :key="isFlag" :data="tableData" max-height="500" v-loading="tableLoading">
  4. <el-table-column type="index" width="55" label="序号" />
  5. <el-table-column :label="i.value" :prop="i.key" show-overflow-tooltip v-for="i in cloums">
  6. <el-table-column v-for="item in i.titleGroup" :label="item.value" :prop="item.key" width="200"> </el-table-column>
  7. <template #default="{ row }" v-if="i.key == 'standardFlag'">
  8. <el-tag v-if="row.standardFlag === ''" type="warning">未填报</el-tag>
  9. <el-tag v-else-if="row.standardFlag === 102" type="warning">无法评价</el-tag>
  10. <el-tag v-else :type="row.standardFlag === 1 ? 'success' : 'error'">{{ row.standardFlag === 1 ? '达标' : '未达标' }}</el-tag>
  11. </template>
  12. <template #default="{ row }" v-if="i.key == 'attachFileList'">
  13. <span style="color: #108ee9" v-for="i in row?.attachFileList" @click="handlePreview(i)">{{ i.name }} </span>
  14. </template>
  15. <template #default="{ row }" v-if="i.key == 'year'">
  16. {{ row.year }}
  17. </template>
  18. <template #default="{ row }" v-if="i.key == 'updateBy'">
  19. {{ row.updateBy }}
  20. </template>
  21. <template #default="{ row }" v-if="i.key == 'updateTime'">
  22. {{ row.updateTime }}
  23. </template>
  24. </el-table-column>
  25. <el-table-column label="操作" width="150">
  26. <template #default="{ row }">
  27. <el-button link type="primary" icon="View" @click="onCheck(row, 1, '详情')">详情</el-button>
  28. <el-button link icon="Edit" type="warning" @click="onCheck(row, 2, '修改')">修改</el-button>
  29. </template>
  30. </el-table-column>
  31. </el-table>
  32. </div>
  33. <pagination
  34. v-show="totals > 0"
  35. :total="totals"
  36. v-model:page="FormList.pageNum"
  37. v-model:limit="FormList.pageSize"
  38. @pagination="dynamic_page_data_typeM(FormList)"
  39. />
  40. <el-dialog
  41. v-model="visible"
  42. :title="'内涝防治标准' + FormList.title"
  43. :modal-append-to-body="false"
  44. :close-on-click-modal="false"
  45. width="51%"
  46. >
  47. <tableDalgo ref="tableDalgoRef" v-if="visible" @onModalClose="onModalClose" :typeList="typeList" :key="isFlag"> </tableDalgo>
  48. <template #footer>
  49. <div class="dialog-footer">
  50. <el-button v-show="typeList.type == '2'" @click="open2" type="primary">保存</el-button>
  51. <el-button @click="closed">关闭</el-button>
  52. </div>
  53. </template>
  54. </el-dialog>
  55. </template>
  56. <script setup>
  57. import { getInfo, projectInfoDelete, projectInfoGet, dynamic_page_data_type } from '@/api/spongePerformance/prevention';
  58. import { FileSystemList } from '@/api/project/tenderReview';
  59. import tableDalgo from './tableDalgo.vue';
  60. import { ElMessage, ElMessageBox } from 'element-plus';
  61. const { proxy } = getCurrentInstance();
  62. const { fund_source, unit_list } = proxy.useDict('fund_source', 'unit_list');
  63. import { reactive } from 'vue';
  64. let visible = ref(false);
  65. let isFlag = ref(1);
  66. const cloums = ref([]);
  67. const standardFlag = ref('');
  68. const tableDalgoRef = ref();
  69. const { params } = defineProps(['params']);
  70. const FormList = ref({
  71. pageNum: 1,
  72. pageSize: 10,
  73. itemDataType: 'CSFHBZ',
  74. });
  75. const totals = ref(0);
  76. //动态组件
  77. let dataForm = reactive({
  78. tableData: '',
  79. tableDateTwo: '',
  80. tableLoading: true,
  81. });
  82. let { tableData, tableLoading } = toRefs(dataForm);
  83. //获取列表数据
  84. //搜索
  85. const search = p => {
  86. FormList.value.pageNum = 1;
  87. dynamic_page_data_typeM(p);
  88. isFlag.value++;
  89. };
  90. defineExpose({ search });
  91. // 查看上报数据
  92. let typeList = ref({});
  93. const onCheck = (row, ty, t) => {
  94. FormList.value.title = t;
  95. if (ty == 1 || ty == 2) {
  96. typeList.value = { ...params, data: row, type: ty, monitorDynamicTableTitleList: cloums.value };
  97. FileSystemList({
  98. refId: row.performanceEvaluateId,
  99. refType: 'CSFHBZ',
  100. }).then(({ data }) => {
  101. typeList.value.fileList1 = data;
  102. visible.value = true;
  103. });
  104. // 获取文件列表
  105. } else if (ty == 3) {
  106. proxy.$modal
  107. .confirm(`是否确认删除?`)
  108. .then(async () => {
  109. projectInfoDeleteM(row.performanceEvaluateId);
  110. getTableData();
  111. })
  112. .catch(() => {});
  113. }
  114. };
  115. //删除
  116. const projectInfoDeleteM = async id => {
  117. let { code } = await projectInfoDelete(id);
  118. search(p);
  119. };
  120. const dynamic_page_data_typeM = async id => {
  121. let { code, data, monitorDynamicTableTitleList, total } = await dynamic_page_data_type(id);
  122. tableData.value = data;
  123. totals.value = total;
  124. cloums.value = monitorDynamicTableTitleList;
  125. tableLoading.value = false;
  126. };
  127. function onModalClose() {
  128. visible.value = false;
  129. // dynamic_page_data_typeM();
  130. dynamic_page_data_typeM(params);
  131. }
  132.  
  133. function open2() {
  134. tableDalgoRef.value.submit();
  135. }
  136. function handlePreview(file) {
  137. return ElMessageBox.confirm(`下载此文件: ${file.name}?`).then(
  138. () => window.open(file.url),
  139. () => false
  140. );
  141. }
  142. function isDb(v, m) {
  143. return v * 1 - m * 1 > 0;
  144. }
  145. function closed() {
  146. dynamic_page_data_typeM(params);
  147. visible.value = false;
  148. }
  149. onMounted(() => {
  150. dynamic_page_data_typeM(params);
  151. });
  152. </script>
  153. <style lang="scss" scoped></style>