Newer
Older
KaiFengPC / src / views / spongePerformance / waterlogging / waterloggedArea / detial / todoDon.vue
@鲁yixuan 鲁yixuan on 14 Aug 4 KB updata
  1. <template>
  2. <div class="water-analysis-page">
  3. <el-table :key="isFlag" :data="tableData" max-height="800" 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. <template #default="{ row }" v-if="i.key == 'projectStatus'">
  7. <el-tag round :type="row.projectStatus == 1 ? 'success' : 'error'">{{ row.projectStatus == 1 ? '已完工' : '未完工' }}</el-tag>
  8. </template>
  9. <template #default="{ row }" v-if="i.key == 'isFlood'">
  10. <el-tag round :type="row.isFlood == '0' ? 'success' : 'error'">{{ row.isFlood == '0' ? '已消除' : '未消除' }}</el-tag>
  11. </template>
  12. <template #default="{ row }" v-if="i.key == 'targetPercent'">
  13. <span @click="handlePreview(k)" style="color: #30dc7f" v-for="k in row.fileSaveRequestList">{{ k.name }}</span>
  14. </template>
  15. </el-table-column>
  16. <!-- <el-table-column fixed="right" label="操作" width="250">
  17. <template #default="{ row }">
  18. <el-button link type="primary" icon="View" @click="onCheck(row, 1, '详情')">详情</el-button>
  19. <el-button link icon="Edit" type="warning" @click="onCheck(row, 2, '修改')">修改</el-button>
  20. <el-button link icon="Delete" type="danger" @click="onCheck(row, 3)">删除</el-button>
  21. </template>
  22. </el-table-column> -->
  23. </el-table>
  24. </div>
  25. <pagination
  26. v-show="totals > 0"
  27. :total="totals"
  28. v-model:page="FormList.pageNum"
  29. v-model:limit="FormList.pageSize"
  30. @pagination="dynamic_page_data_typeM(FormList)"
  31. />
  32. <el-dialog
  33. v-model="visible"
  34. :title="'积水点完工记录' + FormList.title"
  35. :modal-append-to-body="false"
  36. :close-on-click-modal="false"
  37. width="51%"
  38. >
  39. <tableDalgo ref="tableDalgoRef" v-if="visible" @onModalClose="onModalClose" :isComponent="params" :typeList="typeList" :key="isFlag">
  40. </tableDalgo>
  41. <template #footer>
  42. <div class="dialog-footer">
  43. <el-button v-show="typeList.type == '2'" @click="open2" type="primary">确定</el-button>
  44. <el-button @click="visible = false">关闭</el-button>
  45. </div>
  46. </template>
  47. </el-dialog>
  48. </template>
  49. <script setup>
  50. import { waterloggingRelationoDelete, waterloggingRelationPage } from '@/api/spongePerformance/waterloggedArea';
  51. import { FileSystemList } from '@/api/project/tenderReview';
  52. import tableDalgo from './tableDalgo.vue';
  53. import { ElMessage, ElMessageBox } from 'element-plus';
  54. const { proxy } = getCurrentInstance();
  55. import { reactive } from 'vue';
  56.  
  57. let visible = ref(false);
  58. let isFlag = ref(1);
  59. const cloums = ref([
  60. { value: '关联项目', key: 'projectName' },
  61. // { value: '项目状态', key: 'projectStatus' },
  62. { value: '完工时间', key: 'projectEndTime' },
  63. { value: '内涝点名称', key: 'name' },
  64. { value: '内涝点状态', key: 'isFlood' },
  65. ]);
  66. const tableDalgoRef = ref();
  67. const { params, waterloggingRelationWaterloggingListM } = defineProps(['params', 'waterloggingRelationWaterloggingListM']);
  68. console.log('params', params);
  69.  
  70. const FormList = ref({
  71. pageNum: 1,
  72. pageSize: 10,
  73. title: '',
  74. });
  75. const totals = ref(0);
  76. //动态组件
  77. let dataForm = reactive({
  78. tableData: '',
  79. tableDateTwo: '',
  80. tableLoading: true,
  81. });
  82. let { date, tableData, tableDateTwo, tableLoading } = toRefs(dataForm);
  83. //搜索
  84. const search = p => {
  85. FormList.value.pageNum = 1;
  86. dynamic_page_data_typeM(p);
  87. isFlag.value++;
  88. };
  89. defineExpose({ search });
  90. // 查看上报数据
  91. let typeList = ref({});
  92. const onCheck = (row, ty, t) => {
  93. FormList.value.title = t;
  94. if (ty == 1 || ty == 2) {
  95. typeList.value = { ...row, type: ty };
  96. // 获取文件列表
  97. FileSystemList({
  98. refId: row.id,
  99. refType: 'waterlogging_engineering',
  100. }).then(({ data }) => {
  101. typeList.value.fileList1 = data;
  102. visible.value = true;
  103. });
  104. } else if (ty == 3) {
  105. proxy.$modal
  106. .confirm(`是否确认删除?`)
  107. .then(async () => {
  108. projectInfoDeleteM(row.id);
  109. })
  110. .catch(() => {});
  111. }
  112. };
  113. //删除
  114. const projectInfoDeleteM = async id => {
  115. let { code } = await waterloggingRelationoDelete(id);
  116. dynamic_page_data_typeM(params);
  117. waterloggingRelationWaterloggingListM();
  118. };
  119. const dynamic_page_data_typeM = async id => {
  120. let { data, total } = await waterloggingRelationPage(id);
  121. tableData.value = data;
  122. console.log('tableData.value', tableData.value);
  123. totals.value = total;
  124. tableLoading.value = false;
  125. };
  126. function onModalClose() {
  127. visible.value = false;
  128. dynamic_page_data_typeM(params);
  129. }
  130. function open2() {
  131. tableDalgoRef.value.submit();
  132. }
  133. function handlePreview(file) {
  134. return ElMessageBox.confirm(`下载此文件: ${file.name}?`).then(
  135. () => window.open(file.url),
  136. () => false
  137. );
  138. }
  139. onMounted(() => {
  140. tableData.value = params.allWaterLoggingPointList;
  141. console.log('tableData.value ', tableData.value);
  142. tableLoading.value = false;
  143. // dynamic_page_data_typeM(params);
  144. });
  145. </script>
  146. <style lang="scss" scoped></style>