Newer
Older
KaiFengPC / src / views / spongePerformance / waterlogging / waterloggedArea / detial / index.vue
@鲁yixuan 鲁yixuan on 29 Aug 4 KB updata
  1. <template>
  2. <div class="water-analysis-pageGC">
  3. <div class="top">
  4. <el-form ref="ruleForm" inline :model="tableData" v-show="showSearch">
  5. <el-form-item label="内涝点:" prop="stCode">
  6. <el-select clearable v-model="tableData.stCode" class="m-2" placeholder="请选择内涝点" size="mini" style="width: 100%">
  7. <el-option v-for="i in loggingListAll" :key="i.stCode" :label="i.stName" :value="i.stCode" />
  8. </el-select>
  9. </el-form-item>
  10. <el-form-item label="内涝点状态:" prop="loggingRemoveStatus">
  11. <el-select
  12. value-key="stCode"
  13. clearable
  14. v-model="tableData.loggingRemoveStatus"
  15. class="m-2"
  16. placeholder="请选择内涝点"
  17. size="mini"
  18. style="width: 100%"
  19. >
  20. <el-option v-for="i in loggingRemoveStatusList" :key="i.value" :label="i.label" :value="i.value" />
  21. </el-select>
  22. </el-form-item>
  23. <el-form-item>
  24. <el-button type="primary" icon="Search" @click="searchForm"> 搜索</el-button>
  25. <!-- <el-button type="primary" plain icon="Plus" @click="onCheck(4)">新增</el-button> -->
  26. <el-button icon="Refresh" @click="resectClcik"> 重置</el-button>
  27. <el-button icon="CaretLeft" @click="resect"> 返回</el-button>
  28. </el-form-item>
  29. </el-form>
  30. <todoDon
  31. ref="todoDonRef"
  32. :params="tableData"
  33. :waterloggingRelationWaterloggingListM="waterloggingRelationWaterloggingListM"
  34. ></todoDon>
  35. </div>
  36. <el-dialog v-model="visible" title="新增积水点完工记录" :modal-append-to-body="false" :close-on-click-modal="false" width="40%">
  37. <tableDalgo
  38. ref="tableDalgoRef"
  39. :waterloggingRelationWaterloggingListM="waterloggingRelationWaterloggingListM"
  40. @onModalClose="onModalClose"
  41. :isComponent="isComponent.data"
  42. :typeList="typeList"
  43. :key="isFlag"
  44. >
  45. </tableDalgo>
  46. <template #footer>
  47. <div class="dialog-footer">
  48. <el-button @click="open2" type="primary">确定</el-button>
  49. <!-- <el-button @click="submitClict" type="success">提 交</el-button> -->
  50. <el-button @click="visible = false">取消</el-button>
  51. </div>
  52. </template>
  53. </el-dialog>
  54. </div>
  55. </template>
  56. <script setup>
  57. import { waterloggingRelationWaterloggingList, waterloggingRelationAll } from '@/api/spongePerformance/waterloggedArea';
  58. import tableDalgo from './tableDalgo.vue';
  59. import todoDon from './todoDon.vue';
  60. import emgBox from '@/utils/ElMessageBox';
  61. import home from '@/views/index.vue';
  62.  
  63. const { proxy } = getCurrentInstance();
  64. const { fund_source } = proxy.useDict('fund_source');
  65. import { useRouter } from 'vue-router';
  66. import { defineEmits } from 'vue';
  67. const todoDonRef = ref(null);
  68. const ruleForm = ref(null);
  69. let typeList = ref({});
  70. const tableDalgoRef = ref();
  71. const showSearch = ref(true);
  72. let visible = ref(false);
  73. const activeName = ref('todo');
  74. const useRout = useRouter();
  75. const emits = defineEmits();
  76. const { isComponent } = defineProps(['isComponent']);
  77. const loggingList = ref([]);
  78. const loggingListAll = ref([]);
  79. const loggingRemoveStatusList = reactive([
  80. { label: '已消除', value: '1' },
  81. { label: '未消除', value: '0' },
  82. ]);
  83. //动态组件
  84. let dataForm = reactive({
  85. tableData: isComponent.data,
  86. tableDateTwo: '',
  87. tableLoading: true,
  88. });
  89. let { tableData } = toRefs(dataForm);
  90. //获取列表数据
  91. //搜索
  92. const searchForm = () => {
  93. todoDonRef.value.search(tableData.value);
  94. console.log('tableData.value', tableData.value);
  95. };
  96. //重置
  97. const resectClcik = () => {
  98. ruleForm.value.resetFields();
  99. todoDonRef.value.search(tableData.value);
  100. };
  101. function resect() {
  102. // useRout.go(-1)
  103. emits('searchClick', 0);
  104. }
  105. // 新增
  106. const onCheck = ty => {
  107. visible.value = true;
  108. typeList.value.type = ty;
  109. typeList.value.loggingList = loggingList.value;
  110. nextTick(() => {
  111. tableDalgoRef.value.resetFiled();
  112. });
  113. };
  114. //确定
  115. function open2() {
  116. tableDalgoRef.value.submit();
  117. }
  118. function onModalClose() {
  119. visible.value = false;
  120. todoDonRef.value.search(tableData.value);
  121. }
  122. async function waterloggingRelationWaterloggingListM() {
  123. let { data } = await waterloggingRelationWaterloggingList();
  124. loggingList.value = data;
  125. }
  126.  
  127. async function waterloggingRelationAllM() {
  128. let { data } = await waterloggingRelationAll();
  129. loggingListAll.value = data;
  130. }
  131. onMounted(() => {
  132. waterloggingRelationAllM();
  133. waterloggingRelationWaterloggingListM();
  134. });
  135. </script>
  136. <style lang="scss" scoped>
  137. .water-analysis-pageGC {
  138. padding: 20px;
  139. overflow-y: hidden;
  140. }
  141. </style>