Selaa lähdekoodia

更新工作审批

libushang 7 kuukautta sitten
vanhempi
commit
bbe17201b3

+ 9 - 0
src/api/InformationReception/InformationReception.ts

@@ -35,3 +35,12 @@ export function confirmSignature(data) {
     data: data
   });
 }
+
+// 工作审批列表
+export function WorkApprovalList(params) {
+  return request({
+    url: "/api/info_publish/me/work_approval/list",
+    method: "get",
+    params: params
+  });
+}

+ 18 - 0
src/router/routes.ts

@@ -287,6 +287,24 @@ export const constantRoutes: Array<RouteRecordRaw> = [
     meta: {
       title: "任务详情"
     }
+  },
+  {
+    path: "/workApproval/index",
+    name: "workApprovalIndex",
+    component: () =>
+      import("@/views/workApproval/index.vue"),
+    meta: {
+      title: "工作审批"
+    }
+  },
+  {
+    path: "/workApproval/detail",
+    name: "workApprovalDetail",
+    component: () =>
+      import("@/views/workApproval/detail.vue"),
+    meta: {
+      title: "审批详情"
+    }
   }
 ];
 

+ 1 - 1
src/views/leader/index.vue

@@ -106,7 +106,7 @@ const handleNoticeBar = () => {
 };
 // 菜单数据
 const menu = ref([
-  { name: "工作审批", icon: "icon1", num: 0, url: "" },
+  { name: "工作审批", icon: "icon1", num: 0, url: "workApprovalIndex" },
   { name: "信息接报", icon: "icon2", num: 0, url: "InformationReception" },
   { name: "在线点名", icon: "icon3", num: 0, url: "OnlineRollCall" },
   { name: "事件管理", icon: "icon4", num: 0, url: "EventList" }

+ 329 - 0
src/views/workApproval/approvalList.vue

@@ -0,0 +1,329 @@
+<template>
+    <div class="container">
+      <!--搜索框-->
+      <van-search
+        v-model="queryParams.search_keyword"
+        class="common-search"
+        placeholder="请输入信息"
+        :left-icon="searchImg"
+        :right-icon="closeImg"
+        :clearable="false"
+        @search="on_search_keyword"
+        @click-right-icon.stop="on_search_cancel"
+      />
+      <!--三个类型选择-->
+      <van-dropdown-menu>
+        <van-dropdown-item
+          v-model="queryParams.info_type"
+          :title="!!queryParams.info_type ? '' : '审批类型'"
+          :options="opt_info_type"
+          @change="change_info_type"
+        />
+        <van-dropdown-item
+          v-model="queryParams.time_type"
+          :title="!!queryParams.time_type ? '' : '时间'"
+          :options="opt_time_type"
+          @change="change_time_type"
+        </van-dropdown-item>
+        <van-dropdown-item
+          v-model="queryParams.info_order"
+          :title="!!queryParams.info_order ? '' : '时间顺序'"
+          :options="opt_info_order"
+          @change="change_info_order"
+        />
+      </van-dropdown-menu>
+  
+      <van-list
+        v-model:loading="loading"
+        v-model:error="error"
+        error-text="请求失败,点击重新加载"
+        :finished="finished"
+        finished-text="没有更多信息了"
+        class="list"
+        @load="getList"
+      >
+        <div
+          v-for="(item, index) in info_list"
+          :key="item.id"
+          class="event-list-item"
+          @click="handleInfo(item)"
+        >
+            <div class="item-title">
+              <div class="item-title-text">
+                {{ item.publish_group }}
+              </div>
+              <div :class="['info_type', get_info_type_color(item.info_type)]">
+                {{ get_info_type_text(item.info_type) }}
+              </div>
+            </div>
+            <div class="item-content" style="display: flex; align-items: center; justify-content:space-between;">
+                <div>申请时间:{{ item.add_time }} </div>
+                <div>申请人:{{ item.nick_name }}</div>
+            </div>
+            <div class="item-content">
+                信息摘要:{{ item.content || "暂无信息摘要"}}
+            </div>
+        </div>
+      </van-list>
+    </div>
+  </template>
+  
+  <script lang="ts" setup>
+  import { getCurrentInstance, onMounted, ref, toRefs } from "vue";
+  import { useRouter } from "vue-router";
+  import { WorkApprovalList } from "@/api/InformationReception/InformationReception";
+  import searchImg from "@/assets/images/search.png";
+  import closeImg from "@/assets/images/close.png";
+
+  interface Props {
+    status: number;
+  }
+  
+  const props = withDefaults(defineProps<Props>(), {
+    status: 0
+  });
+
+  const router = useRouter();
+  
+  const opt_info_type = [
+    { text: "全部", value: "" },
+    { text: "预警信息", value: "0" },
+    { text: "灾害事件", value: "1" },
+    { text: "灾情信息", value: "2" },
+    { text: "灾害资讯", value: "3" },
+    { text: "应急救援总结报告", value: "4" }
+  ];
+  
+  const opt_time_type = [
+    { text: "全部", value: "" },
+    { text: "一周内", value: "0" },
+    { text: "一个月内", value: "1" },
+    { text: "六个月内", value: "2" }
+  ];
+  
+  const opt_info_order = [
+    { text: "升序", value: "asc" },
+    { text: "降序", value: "desc" }
+  ];
+  
+  const get_info_type_text = (val) => {
+      return opt_info_type.find(item => item.value == val).text
+  }
+  
+  const get_info_type_color = (val) => {
+    return "info_type_" + val
+  }
+  
+  const info_list = ref([]);
+  const total = ref(0);
+  const loading = ref(false);
+  const error = ref(false);
+  const finished = ref(false);
+  
+  const queryParams = ref({
+    page: 0,
+    page_size: 5,
+    status: 0,
+    info_type: "",
+    time_type: "",
+    event_level: "",
+    info_order: "desc",
+    search_keyword: ""
+  });
+  
+  const on_search_keyword = val => {
+    queryParams.value.search_keyword = val;
+    queryParams.value.page = 0;
+    getList();
+  };
+  
+  const on_search_cancel = () => {
+    queryParams.value.search_keyword = "";
+    queryParams.value.page = 0;
+    getList();
+  };
+  
+  const change_info_type = () => {
+    queryParams.value.page = 0;
+    getList();
+  };
+  
+  const change_time_type = () => {
+    queryParams.value.page = 0;
+    getList();
+  };
+  
+  const change_info_order = () => {
+    queryParams.value.page = 0;
+    getList();
+  };
+  
+  const handleInfo = (item) => {
+    router.push("/workApproval/detail?id=" + item.id);
+  }
+  
+  const getList = () => {
+    queryParams.value.status = props.status;
+    queryParams.value.page++;
+    let params = queryParams.value;
+    WorkApprovalList(params)
+      .then(res => {
+        var items = res.data || [];
+        total.value = res.total;
+        if (queryParams.value.page == 1) {
+          info_list.value = [];
+        }
+        items.forEach(val => {
+          info_list.value.push(val);
+        });
+        if (queryParams.value.page_size * queryParams.value.page >= total.value) {
+          finished.value = true;
+        } else {
+          finished.value = false;
+        }
+      })
+      .catch(() => {
+        error.value = true;
+        finished.value = false;
+      })
+      .finally(() => {
+        loading.value = false;
+      });
+  };
+  </script>
+  
+  <style lang="scss" scoped>
+  .list {
+    height: calc(100vh - 102px);
+    overflow-y: auto;
+  }
+  .van-doc-block__title {
+    color: var(--van-doc-text-color-4);
+    margin: 0;
+    padding: 32px 16px 16px;
+    font-size: 14px;
+    font-weight: 400;
+    line-height: 16px;
+  }
+  
+  .event-list-item {
+    position: relative;
+    margin: 16px 16px 0;
+    background: #ffffff;
+    border-radius: 4px;
+    border: 0.5px solid #eaedf7;
+    box-shadow: 0 0 4px 0 #4554661a;
+    &:first-child {
+      margin-top: 0;
+    }
+    .item-title {
+      display: flex;
+      align-items: center;
+      justify-content:space-between;
+      min-height: 46px;
+      background-image: linear-gradient(180deg, #f3f7fd 0%, #ffffff 100%);
+      padding: 0 12px;
+      .item-title-text {
+        font-size: 14px;
+        color: #414f64;
+        font-weight: 600;
+        max-width: 200px;
+        overflow: hidden;
+        white-space: nowrap;
+        text-overflow: ellipsis;
+      }
+  
+      .info_type {
+          font-size: 14px;
+          padding: 3px 10px;
+          color:#fff;
+          margin-right: 5px;
+          white-space: nowrap;
+      }
+  
+      .info_type_0 {
+        background: #FFAF00;
+      }
+  
+      .info_type_1 {
+        background: #FF1818;
+      }
+  
+      .info_type_2 {
+        background: #2c81ff;
+      }
+  
+      .info_type_3 {
+        background: #FF9F9F;
+      }
+  
+      .info_type_4 {
+        background: #A4D3FF;
+      }
+    }
+    .item-content {
+        padding: 0 12px 12px;
+        font-size: 14px;
+        color: #414f64;
+    }
+  }
+  .van-dropdown-menu {
+    :deep(.van-dropdown-menu__bar) {
+      background: transparent;
+      box-shadow: none;
+    }
+  }
+  .common-search {
+    :deep(.van-field__left-icon) {
+      .van-icon__image {
+        width: 12px;
+        height: 12px;
+      }
+    }
+    :deep(.van-field__right-icon) {
+      width: 30px;
+      height: 30px;
+      padding: 0;
+      .van-icon__image {
+        width: 30px;
+        height: 30px;
+      }
+    }
+  }
+  .icon1 {
+    width: 17px;
+    height: 16px;
+    background: url("@/assets/images/event/icon1.png") no-repeat;
+    background-size: 100% 100%;
+    margin-right: 7px;
+  }
+  .icon2 {
+    width: 17px;
+    height: 16px;
+    background: url("@/assets/images/event/icon2.png") no-repeat;
+    background-size: 100% 100%;
+    margin-right: 7px;
+  }
+  .icon3 {
+    width: 17px;
+    height: 16px;
+    background: url("@/assets/images/event/icon3.png") no-repeat;
+    background-size: 100% 100%;
+    margin-right: 7px;
+  }
+  .icon4 {
+    width: 17px;
+    height: 16px;
+    background: url("@/assets/images/event/icon4.png") no-repeat;
+    background-size: 100% 100%;
+    margin-right: 7px;
+  }
+  .icon5 {
+    width: 16px;
+    height: 16px;
+    background: url("@/assets/images/event/icon5.png") no-repeat;
+    background-size: 100% 100%;
+    margin-right: 7px;
+  }
+  </style>
+  

+ 179 - 0
src/views/workApproval/detail.vue

@@ -0,0 +1,179 @@
+<template>
+<div class="container">
+    <div class="box">
+        <div class="info_title">
+        {{ infoDetail.publish_group }}发布申请
+      </div>
+
+      <div class="info_tab">
+        <div class="info-data-item">
+            <div class="info-left">
+                <div class="info-data-item-title">审批类型:</div>
+            </div>
+            <div class="info-data-item-value">{{ get_info_type_text(infoDetail.info_type) }}发布申请</div>
+        </div>
+
+        <div class="info-data-item">
+            <div class="info-left">
+                <div class="info-data-item-title">申请日期:</div>
+            </div>
+            <div class="info-data-item-value">{{ infoDetail.add_time }}</div>
+        </div>
+        <div class="info-data-item">
+            <div class="info-left">
+                <div class="info-data-item-title">申请人:</div>
+            </div>
+            <div class="info-data-item-value">{{ infoDetail.nick_name }}</div>
+        </div>
+        <div class="info-data-item">
+            <div class="info-left">
+                <div class="info-data-item-title">所在科室:</div>
+            </div>
+            <div class="info-data-item-value">{{ infoDetail.dept_name }}</div>
+        </div>
+        <div class="info-data-item">
+            <div class="info-left">
+                <div class="info-data-item-title">审批内容:</div>
+            </div>
+            <div class="info-data-item-value">{{ infoDetail.content }}</div>
+        </div>
+        <div class="info-data-item">
+            <div class="info-left">
+                <div class="info-data-item-title">附件:</div>
+            </div>
+            <div class="info-data-item-value file-list">
+                <div
+                    v-for="(item, index) in infoDetail.files"
+                    :key="index"
+                    class="file-item"
+                    @click="handleDownload(item)"
+                >
+                {{ item.name }}
+                </div>
+            </div>
+        </div>
+      </div>
+    </div>
+
+    <div class="box">
+        
+    </div>
+</div>
+</template>
+
+<script lang="ts" setup>
+import { getCurrentInstance, reactive, ref, toRefs, onMounted } from "vue";
+import { useRouter, useRoute } from "vue-router";
+import { InformationDetail } from "@/api/InformationReception/InformationReception";
+import {download2} from "@/utils/request";
+
+const baseUrl = import.meta.env.VITE_BASE_API;
+
+const infoId = ref("");
+const data = reactive({
+  infoDetail: {
+    id: "",
+    info_type: "",
+    publish_group: "",
+    add_time: "",
+    nick_name: "",
+    dept_name: "",
+    content: "",
+    files: []
+  }
+})
+
+const opt_info_type = [
+    { text: "全部", value: "" },
+    { text: "预警信息", value: "0" },
+    { text: "灾害事件", value: "1" },
+    { text: "灾情信息", value: "2" },
+    { text: "灾害资讯", value: "3" },
+    { text: "应急救援总结报告", value: "4" }
+  ];
+
+  const get_info_type_text = (val) => {
+      return opt_info_type.find(item => item.value == val).text
+  }
+const { infoDetail } = toRefs(data);
+
+const route = useRoute();
+
+const refreshData = () => {
+    infoId.value = route.query.id as string;
+    InformationDetail({ id: infoId.value }).then(res => {
+    infoDetail.value = res.data;
+  })
+}
+
+// 下载方法
+const handleDownload = (file: any) => {
+  download2(baseUrl + '/file/download/' + file.url, file.name);
+};
+
+onMounted(() => {
+    refreshData();
+})
+
+</script>
+
+<style lang="scss" scoped>
+.box {
+  margin: 16px;
+  background-color: #ffffff;
+  border-radius: 4px;
+  box-shadow: 0 0 4px 0 #4554661a;
+}
+
+.info_title {
+  font-weight: 600;
+  min-height: 46px;
+  background-image: linear-gradient(180deg, #f3f7fd 0%, #ffffff 100%);
+  padding: 12px;
+}
+
+.info_tab {
+  padding: 16px;
+  // color: #a6000000;
+
+  .info-data-item {
+    font-size: 14px;
+    line-height: 8vmin;
+    display: flex;
+    flex-direction: row;
+    align-items: flex-start;
+    // justify-content: space-between;
+
+    .info-left {
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        flex-shrink: 0;
+
+        .info-data-item-title {
+        color: #888;
+        min-width: 5em;
+        font-weight: 600;
+        }
+    }
+
+    .info-data-item-value {
+      color: #888;
+
+        .file-item {
+            color: #2C81FF;
+            text-decoration: underline;
+        }
+    }
+
+    .blue {
+      color: #1989fa;
+    }
+
+    h3 {
+        font-size: 4.2vmin;
+        line-height: 8vmin;
+    }
+    }
+}
+</style>

+ 20 - 0
src/views/workApproval/index.vue

@@ -0,0 +1,20 @@
+<template>
+    <van-tabs v-model:active="active">
+        <van-tab title="待办">
+            <ApprovalList :status="1"></ApprovalList>
+        </van-tab>
+        <van-tab title="已完成">
+            <ApprovalList :status="2"></ApprovalList>
+        </van-tab>
+    </van-tabs>
+</template>
+
+<script lang="ts" setup>
+import { ref } from 'vue';
+import ApprovalList from "./approvalList.vue";
+
+const active = ref(0);
+</script>
+
+<style lang="scss" scoped>
+</style>