Newer
Older
KaiFengPC / src / views / project / compensation / noticeReward.vue
@zhangdeliang zhangdeliang on 23 May 4 KB 初始化项目
  1. <template>
  2. <div class="water-analysis-page">
  3. <div class="top">
  4. <el-form label-width="auto" ref="ruleForm" inline :model="tableData" v-show="showSearch">
  5. <el-form-item label="文档名称:" prop="documentName">
  6. <el-input clearable v-model="tableData.documentName" placeholder="请输入文档名称" style="width: 240px"></el-input>
  7. </el-form-item>
  8. <el-form-item label="文档负责人:" prop="documentDutyUserName" class="formItem110">
  9. <el-select value-key="userId" v-model="tableData.documentDutyUserName" placeholder="请选择文档负责人" style="width: 100%">
  10. <el-option v-for="dict in userLists" :key="dict.userId" :label="dict.nickName" :value="dict.userId" />
  11. </el-select>
  12. </el-form-item>
  13. <el-form-item label="文档更新时间:" prop="updateTime">
  14. <el-date-picker
  15. v-model="tableData.updateTime"
  16. value-format="YYYY-MM-DD"
  17. type="daterange"
  18. range-separator="至"
  19. start-placeholder="开始日期"
  20. end-placeholder="结束日期"
  21. :clearable="false"
  22. ></el-date-picker>
  23. </el-form-item>
  24. <el-form-item>
  25. <el-button type="primary" icon="Search" @click="searchForm"> 查询</el-button>
  26. <el-button icon="Refresh" @click="resectClcik"> 重置</el-button>
  27. </el-form-item>
  28. </el-form>
  29. <el-row :gutter="10" class="mb8">
  30. <el-col :span="1.5">
  31. <el-button type="primary" plain icon="Plus" @click="onCheck(4)" v-hasPermi="['system:post:add']">新增奖补须知</el-button>
  32. <el-button type="danger" plain icon="SemiSelect" @click="DeleteCheck" v-hasPermi="['system:post:add']">删除奖补须知</el-button>
  33. </el-col>
  34. <right-toolbar v-model:showSearch="showSearch" @queryTable="searchForm"></right-toolbar>
  35. </el-row>
  36. </div>
  37. <todoDon ref="todoDonRef" :userLists="userLists" v-if="userLists.length > 0"></todoDon>
  38. <el-dialog v-model="visible" title="项目类型新增" :modal-append-to-body="false" :close-on-click-modal="false" width="50%">
  39. <tableDalgo ref="tableDalgoRef" :typeList="typeList" @onModalClose="onModalClose" v-if="visible"></tableDalgo>
  40. <template #footer>
  41. <div class="dialog-footer">
  42. <el-button type="primary" @click="submit">保存</el-button>
  43. <el-button @click="closed">关闭</el-button>
  44. </div>
  45. </template>
  46. </el-dialog>
  47. </div>
  48. </template>
  49. <script setup>
  50. import { userList } from '@/api/project/constructionPermits';
  51. import tableDalgo from './noticeRewardComponents/tableDalgo.vue';
  52. import todoDon from './noticeRewardComponents/todoDon.vue';
  53. import { formatMonths } from '@/utils';
  54. const todoDonRef = ref(null);
  55. const userLists = ref([]);
  56. const ruleForm = ref(null);
  57. let typeList = ref({});
  58. const showSearch = ref(true);
  59. import { reactive } from 'vue';
  60. const tableDalgoRef = ref();
  61. let visible = ref(false);
  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. let updateStartTime = '';
  73. let updateEndTime = '';
  74. if (tableData.value.updateTime?.length > 0) {
  75. updateStartTime = tableData.value.updateTime[0];
  76. updateEndTime = tableData.value.updateTime[1];
  77. }
  78. tableData.value = { ...tableData.value, updateStartTime, updateEndTime };
  79. todoDonRef.value.search(tableData.value);
  80. };
  81. //重置
  82. function resectClcik() {
  83. tableData.value = { pageNum: 1, pageSize: 10 };
  84. todoDonRef.value.search(tableData.value);
  85. }
  86. const onCheck = ty => {
  87. visible.value = true;
  88. nextTick(() => {
  89. tableDalgoRef.value.desertFilds();
  90. });
  91. };
  92. function onModalClose() {
  93. visible.value = false;
  94. todoDonRef.value.search(tableData.value);
  95. }
  96. function submit() {
  97. tableDalgoRef.value.submit();
  98. }
  99. function closed() {
  100. visible.value = false;
  101. }
  102. function DeleteCheck() {
  103. todoDonRef.value.delAll();
  104. }
  105.  
  106. //获取文档负责人
  107. //文档负责人
  108. const getUserList = async () => {
  109. const res = await userList();
  110. if (res?.code !== 200) return;
  111. userLists.value = res?.data || [];
  112. };
  113.  
  114. onMounted(() => {
  115. getUserList();
  116. });
  117. </script>
  118. <style lang="scss" scoped>
  119. .water-analysis-page {
  120. padding: 20px;
  121. height: 90vh;
  122. }
  123. </style>