Newer
Older
Nanping_sponge_GCGL / src / views / project / projectTable / index.vue
@liyingjing liyingjing on 25 Oct 2023 5 KB 海绵工程管理
<template>
  <div class="water-analysis-page">
    <div class="top">
      <el-form ref="ruleForm" inline :model="queryParams" v-show="showSearch">
        <el-form-item v-for="i in queryClouns" :label="i.label" :prop="i.prop">
          <el-select
            v-if="i.prop == 'projectOperationPattern'"
            clearable
            v-model="queryParams.projectOperationPattern"
            :placeholder="i.placeholder"
          >
            <el-option
              v-for="item in project_operation_pattern"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            ></el-option>
          </el-select>
          <el-select
            v-else-if="i.prop == 'status'"
            clearable
            v-model="queryParams.status"
            :placeholder="i.placeholder"
          >
            <el-option
              v-for="dict in dangerous_status"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
          <el-input
            v-else
            clearable
            v-model="queryParams[i.prop]"
            :placeholder="i.placeholder"
            style="width: 220px"
          ></el-input>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" icon="Search" @click="searchForm">
            查询</el-button
          >
          <el-button icon="Refresh" @click="resetQuery">重置</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)"
            >新增</el-button
          >
        </el-col>
        <right-toolbar
          v-model:showSearch="showSearch"
          @queryTable="searchForm"
        ></right-toolbar>
      </el-row>
    </div>
    <el-tabs
      v-model="activeName"
      class="demo-tabs"
      @tab-click="handleClick"
      style="margin-top: -10px"
      type="border-card"
    >
      <el-tab-pane label="待办列表" name="todo"> </el-tab-pane>
      <el-tab-pane label="已办列表" name="done"> </el-tab-pane>
      <el-tab-pane label="我的" name="main"> </el-tab-pane>
      <todoDon ref="todoDonRef" :key="isKey"></todoDon>
    </el-tabs>
    <!-- 查看详情弹框 -->
    <el-dialog
      v-model="visible"
      title="项目立项新增"
      :modal-append-to-body="false"
      :close-on-click-modal="false"
      width="80%"
    >
      <tableDalgo
        ref="tableDalgoRef"
        :typeList="typeList"
        :key="isKey"
        @onModalClose="onModalClose"
      ></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 tableDalgo from "./tableDalgo.vue";
import todoDon from "./todoDon.vue";
const { proxy } = getCurrentInstance();
const { project_operation_pattern, dangerous_status } = proxy.useDict(
  "project_operation_pattern",
  "dangerous_status"
);
const todoDonRef = ref(null);
const tableDalgoRef = ref();
let typeList = ref({});
const showSearch = ref(true);
const activeName = ref("todo");
let visible = ref(false);
let isKey = ref(0);
const queryClouns = [
  { label: "项目名称:", prop: "projectName", placeholder: "请输入项目名称" },
  {
    label: "项目运作模式:",
    prop: "projectOperationPattern",
    placeholder: "请选择项目运作模式",
  },
  {
    label: "责任部门:",
    prop: "chargeDepartment",
    placeholder: "请输入责任部门",
  },
  { label: "责任人:", prop: "chargeUser", placeholder: "请输入责任人" },
  { label: "流程步骤:", prop: "status", placeholder: "请选择流程步骤" },
];
let queryParams = ref({ pageNum: 1, pageSize: 10, queryScope: "todo" });
const handleClick = ({ props: { name } }, event) => {
  queryParams.value.queryScope = name;
  todoDonRef.value.getInfoList(queryParams.value);
};
//搜索
const searchForm = () => {
  todoDonRef.value.getInfoList(queryParams.value);
};
// 重置
const resetQuery = () => {
  queryParams.value = {
    pageNum: 1,
    pageSize: 10,
    queryScope: queryParams.value.queryScope,
  };
  todoDonRef.value.getInfoList(queryParams.value);
};
// 新增
const onCheck = (v) => {
  typeList.value.type = v;
  visible.value = true;
  nextTick(() => {
    tableDalgoRef.value.resetFiled();
  });
};
//关闭
function onModalClose() {
  visible.value = false;
  todoDonRef.value.getInfoList(queryParams.value);
}
// 保存
function open2() {
  tableDalgoRef.value.submit();
}
//新增提交
function submitClict() {
  tableDalgoRef.value.submit(6);
}
onMounted(() => {
  todoDonRef.value.getInfoList(queryParams.value);
});
</script>
<style lang="scss" scoped>
.water-analysis-page {
  padding: 20px;
  height: 90vh;
  overflow-y: hidden;
  .top {
    margin-bottom: 15px;
  }
}
:deep(.el-dialog__body) {
  background-color: #eef1fb;
  height: 850px;
  overflow: auto;
}
</style>