Newer
Older
KaiFengPC / src / views / spongePerformance / waterlogging / waterloggedArea / detial / index.vue
@鲁yixuan 鲁yixuan on 19 Aug 4 KB updata
<template>
  <div class="water-analysis-pageGC">
    <div class="top">
      <el-form ref="ruleForm" inline :model="tableData" v-show="showSearch">
        <el-form-item label="内涝点:" prop="stCode">
          <el-select clearable v-model="tableData.stCode" class="m-2" placeholder="请选择内涝点" size="mini" style="width: 100%">
            <el-option v-for="i in loggingListAll" :key="i.stCode" :label="i.stName" :value="i.stCode" />
          </el-select>
        </el-form-item>
        <el-form-item label="内涝点状态:" prop="loggingRemoveStatus">
          <el-select
            value-key="stCode"
            clearable
            v-model="tableData.loggingRemoveStatus"
            class="m-2"
            placeholder="请选择内涝点"
            size="mini"
            style="width: 100%"
          >
            <el-option v-for="i in loggingRemoveStatusList" :key="i.value" :label="i.label" :value="i.value" />
          </el-select>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" icon="Search" @click="searchForm"> 搜索</el-button>
          <!-- <el-button type="primary" plain icon="Plus" @click="onCheck(4)">新增</el-button> -->
          <el-button icon="Refresh" @click="resectClcik"> 重置</el-button>
          <el-button icon="CaretLeft" @click="resect"> 返回</el-button>
        </el-form-item>
      </el-form>
      <todoDon
        ref="todoDonRef"
        :params="tableData"
        :waterloggingRelationWaterloggingListM="waterloggingRelationWaterloggingListM"
      ></todoDon>
    </div>
    <el-dialog v-model="visible" title="新增积水点完工记录" :modal-append-to-body="false" :close-on-click-modal="false" width="40%">
      <tableDalgo
        ref="tableDalgoRef"
        :waterloggingRelationWaterloggingListM="waterloggingRelationWaterloggingListM"
        @onModalClose="onModalClose"
        :isComponent="isComponent.data"
        :typeList="typeList"
        :key="isFlag"
      >
      </tableDalgo>
      <template #footer>
        <div class="dialog-footer">
          <el-button @click="open2" type="primary">确定</el-button>
          <!-- <el-button @click="submitClict" type="success">提 交</el-button> -->
          <el-button @click="visible = false">关闭</el-button>
        </div>
      </template>
    </el-dialog>
  </div>
</template>
<script setup>
import { waterloggingRelationWaterloggingList, waterloggingRelationAll } from '@/api/spongePerformance/waterloggedArea';
import tableDalgo from './tableDalgo.vue';
import todoDon from './todoDon.vue';
import emgBox from '@/utils/ElMessageBox';
import home from '@/views/index.vue';

const { proxy } = getCurrentInstance();
const { fund_source } = proxy.useDict('fund_source');
import { useRouter } from 'vue-router';
import { defineEmits } from 'vue';
const todoDonRef = ref(null);
const ruleForm = ref(null);
let typeList = ref({});
const tableDalgoRef = ref();
const showSearch = ref(true);
let visible = ref(false);
const activeName = ref('todo');
const useRout = useRouter();
const emits = defineEmits();
const { isComponent } = defineProps(['isComponent']);
const loggingList = ref([]);
const loggingListAll = ref([]);
const loggingRemoveStatusList = reactive([
  { label: '已消除', value: '1' },
  { label: '未消除', value: '0' },
]);
//动态组件
let dataForm = reactive({
  tableData: isComponent.data,
  tableDateTwo: '',
  tableLoading: true,
});
let { tableData } = toRefs(dataForm);
//获取列表数据
//搜索
const searchForm = () => {
  todoDonRef.value.search(tableData.value);
  console.log('tableData.value', tableData.value);
};
//重置
const resectClcik = () => {
  ruleForm.value.resetFields();
  todoDonRef.value.search(tableData.value);
};
function resect() {
  // useRout.go(-1)
  emits('searchClick', 0);
}
// 新增
const onCheck = ty => {
  visible.value = true;
  typeList.value.type = ty;
  typeList.value.loggingList = loggingList.value;
  nextTick(() => {
    tableDalgoRef.value.resetFiled();
  });
};
//确定
function open2() {
  tableDalgoRef.value.submit();
}
function onModalClose() {
  visible.value = false;
  todoDonRef.value.search(tableData.value);
}
async function waterloggingRelationWaterloggingListM() {
  let { data } = await waterloggingRelationWaterloggingList();
  loggingList.value = data;
}

async function waterloggingRelationAllM() {
  let { data } = await waterloggingRelationAll();
  loggingListAll.value = data;
}
onMounted(() => {
  waterloggingRelationAllM();
  waterloggingRelationWaterloggingListM();
});
</script>
<style lang="scss" scoped>
.water-analysis-pageGC {
  padding: 20px;
  overflow-y: hidden;
}
</style>