Newer
Older
KaiFengPC / src / views / project / projectConfiguration / dwwh / index.vue
@zhangdeliang zhangdeliang on 23 May 3 KB 初始化项目
  1. <template>
  2. <!-- 单位维护 -->
  3. <div class="water-analysis-page" :key="isFlag">
  4. <div class="top">
  5. <el-form label-width="auto" ref="ruleForm" inline :model="tableData" v-show="showSearch">
  6. <el-form-item label="单位名称:" prop="unitName">
  7. <el-input clearable v-model="tableData.unitName" placeholder="请输入单位名称" style="width: 240px"></el-input>
  8. </el-form-item>
  9. <el-form-item label="类型:" prop="unitType">
  10. <el-select clearable v-model="tableData.unitType" placeholder="请选择类型">
  11. <el-option v-for="dict in unit_type" :key="dict.stCode" :label="dict.label" :value="dict.value"></el-option>
  12. </el-select>
  13. </el-form-item>
  14. <el-form-item label="单位属性:" prop="unitProperty">
  15. <el-select clearable v-model="tableData.unitProperty" placeholder="请选择单位属性">
  16. <el-option v-for="dict in unit_property" :key="dict.stCode" :label="dict.label" :value="dict.value"></el-option>
  17. </el-select>
  18. </el-form-item>
  19. <el-form-item label="责任人:" prop="primaryConcatPersonName">
  20. <el-input clearable v-model="tableData.primaryConcatPersonName" placeholder="请输入责任人" style="width: 240px"></el-input>
  21. </el-form-item>
  22. <el-form-item>
  23. <el-button type="primary" icon="Search" @click="searchForm"> 查询</el-button>
  24. <el-button icon="Refresh" @click="resectClcik"> 重置</el-button>
  25. </el-form-item>
  26. </el-form>
  27. <el-row :gutter="10" class="mb8">
  28. <el-col :span="1.5">
  29. <el-button type="primary" plain icon="Plus" @click="onCheck('add')" v-hasPermi="['system:post:add']">新增</el-button>
  30. </el-col>
  31. <right-toolbar v-model:showSearch="showSearch" @queryTable="searchForm"></right-toolbar>
  32. </el-row>
  33. </div>
  34. <todoDon ref="todoDonRef" :tableData="tableData"></todoDon>
  35. <el-dialog v-model="visible" title="单位维护新增" :modal-append-to-body="false" :close-on-click-modal="false" width="65%">
  36. <tableDalgo :typeList="typeList" @onModalClose="onModalClose" ref="tableDalgoRef"></tableDalgo>
  37. <template #footer>
  38. <div class="dialog-footer">
  39. <el-button @click="open2" type="primary">保 存</el-button>
  40. <el-button @click="visible = false">关闭</el-button>
  41. </div>
  42. </template>
  43. </el-dialog>
  44. </div>
  45. </template>
  46. <script setup>
  47. import tableDalgo from './tableDalgo.vue';
  48. import todoDon from './todoDon.vue';
  49. import { formatMonths } from '@/utils';
  50.  
  51. const { proxy } = getCurrentInstance();
  52. const { unit_type, unit_property } = proxy.useDict('unit_type', 'unit_property');
  53. const todoDonRef = ref(null);
  54. const ruleForm = ref(null);
  55. const tableDalgoRef = ref();
  56. let typeList = reactive({});
  57. import { reactive } from 'vue';
  58. let visible = ref(false);
  59. let isFlag = ref(1);
  60.  
  61. const showSearch = ref(true);
  62. //动态组件
  63. let dataForm = reactive({
  64. date: formatMonths(new Date()),
  65. tableData: { pageNum: 1, pageSize: 10 },
  66. tableDateTwo: '',
  67. tableLoading: true,
  68. });
  69. let { tableData } = toRefs(dataForm);
  70. //搜索
  71. const searchForm = () => {
  72. todoDonRef.value.search(tableData.value);
  73. // isFlag.value++
  74. };
  75. function resectClcik() {
  76. tableData.value = { pageNum: 1, pageSize: 10 };
  77. todoDonRef.value.search(tableData.value);
  78. }
  79. // 查看上报数据
  80. const onCheck = ty => {
  81. typeList.add = ty;
  82. visible.value = true;
  83. nextTick(() => {
  84. tableDalgoRef.value.desertFilds();
  85. });
  86. };
  87. function onModalClose() {
  88. visible.value = false;
  89. todoDonRef.value.search(tableData.value);
  90. }
  91. function open2() {
  92. tableDalgoRef.value.submit();
  93. todoDonRef.value.search(tableData.value);
  94. }
  95. onMounted(() => {
  96. // getTableData(Date.parse(date.value));
  97. });
  98. </script>
  99. <style lang="scss" scoped>
  100. .water-analysis-page {
  101. padding: 20px;
  102. height: 90vh;
  103. }
  104. </style>