Newer
Older
KaiFengPC / src / views / project / compensation / noticeReward.vue
@zhangdeliang zhangdeliang on 23 May 4 KB 初始化项目
<template>
  <div class="water-analysis-page">
    <div class="top">
      <el-form label-width="auto" ref="ruleForm" inline :model="tableData" v-show="showSearch">
        <el-form-item label="文档名称:" prop="documentName">
          <el-input clearable v-model="tableData.documentName" placeholder="请输入文档名称" style="width: 240px"></el-input>
        </el-form-item>
        <el-form-item label="文档负责人:" prop="documentDutyUserName" class="formItem110">
          <el-select value-key="userId" v-model="tableData.documentDutyUserName" placeholder="请选择文档负责人" style="width: 100%">
            <el-option v-for="dict in userLists" :key="dict.userId" :label="dict.nickName" :value="dict.userId" />
          </el-select>
        </el-form-item>
        <el-form-item label="文档更新时间:" prop="updateTime">
          <el-date-picker
            v-model="tableData.updateTime"
            value-format="YYYY-MM-DD"
            type="daterange"
            range-separator="至"
            start-placeholder="开始日期"
            end-placeholder="结束日期"
            :clearable="false"
          ></el-date-picker>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" icon="Search" @click="searchForm"> 查询</el-button>
          <el-button icon="Refresh" @click="resectClcik"> 重置</el-button>
        </el-form-item>
      </el-form>
      <el-row :gutter="10" class="mb8">
        <el-col :span="1.5">
          <el-button type="primary" plain icon="Plus" @click="onCheck(4)" v-hasPermi="['system:post:add']">新增奖补须知</el-button>
          <el-button type="danger" plain icon="SemiSelect" @click="DeleteCheck" v-hasPermi="['system:post:add']">删除奖补须知</el-button>
        </el-col>
        <right-toolbar v-model:showSearch="showSearch" @queryTable="searchForm"></right-toolbar>
      </el-row>
    </div>
    <todoDon ref="todoDonRef" :userLists="userLists" v-if="userLists.length > 0"></todoDon>
    <el-dialog v-model="visible" title="项目类型新增" :modal-append-to-body="false" :close-on-click-modal="false" width="50%">
      <tableDalgo ref="tableDalgoRef" :typeList="typeList" @onModalClose="onModalClose" v-if="visible"></tableDalgo>
      <template #footer>
        <div class="dialog-footer">
          <el-button type="primary" @click="submit">保存</el-button>
          <el-button @click="closed">关闭</el-button>
        </div>
      </template>
    </el-dialog>
  </div>
</template>
<script setup>
import { userList } from '@/api/project/constructionPermits';
import tableDalgo from './noticeRewardComponents/tableDalgo.vue';
import todoDon from './noticeRewardComponents/todoDon.vue';
import { formatMonths } from '@/utils';
const todoDonRef = ref(null);
const userLists = ref([]);
const ruleForm = ref(null);
let typeList = ref({});
const showSearch = ref(true);
import { reactive } from 'vue';
const tableDalgoRef = ref();
let visible = ref(false);
//动态组件
let dataForm = reactive({
  date: formatMonths(new Date()),
  tableData: { pageNum: 1, pageSize: 10 },
  tableDateTwo: '',
  tableLoading: true,
});
let { tableData } = toRefs(dataForm);
//搜索
const searchForm = () => {
  let updateStartTime = '';
  let updateEndTime = '';
  if (tableData.value.updateTime?.length > 0) {
    updateStartTime = tableData.value.updateTime[0];
    updateEndTime = tableData.value.updateTime[1];
  }
  tableData.value = { ...tableData.value, updateStartTime, updateEndTime };
  todoDonRef.value.search(tableData.value);
};
//重置
function resectClcik() {
  tableData.value = { pageNum: 1, pageSize: 10 };
  todoDonRef.value.search(tableData.value);
}
const onCheck = ty => {
  visible.value = true;
  nextTick(() => {
    tableDalgoRef.value.desertFilds();
  });
};
function onModalClose() {
  visible.value = false;
  todoDonRef.value.search(tableData.value);
}
function submit() {
  tableDalgoRef.value.submit();
}
function closed() {
  visible.value = false;
}
function DeleteCheck() {
  todoDonRef.value.delAll();
}

//获取文档负责人
//文档负责人
const getUserList = async () => {
  const res = await userList();
  if (res?.code !== 200) return;
  userLists.value = res?.data || [];
};

onMounted(() => {
  getUserList();
});
</script>
<style lang="scss" scoped>
.water-analysis-page {
  padding: 20px;
  height: 90vh;
}
</style>