zhuangyunsheng 1 年之前
父节点
当前提交
3be16f1a3b

+ 2 - 2
.env.development

@@ -12,10 +12,10 @@ VITE_BASE_MOCK_URL = "/mock-api"
 
 # boot服务端接口路径
 # VITE_BASE_SERVER_URL = "http://192.168.101.93:8000"
-VITE_BASE_SERVER_URL = "http://10.236.2.146:8080/dev-api" # 线上
+# VITE_BASE_SERVER_URL = "http://10.236.2.146:8080/dev-api" # 线上
 # VITE_BASE_SERVER_URL = "http://10.206.20.153:8000" # 青岛港-内网 dns: 10.201.192.1
 # VITE_BASE_SERVER_URL = "http://192.168.43.231:8000" # 热点
-# VITE_BASE_SERVER_URL = "http://192.168.1.133:8000" # 青岛港-7楼
+VITE_BASE_SERVER_URL = "http://192.168.1.105:8000" # 青岛港-7楼
 # 微前端-工作流
 VITE_WORKFLOW_URL = "http://localhost:1888/"
 # 微前端-代码生成器

+ 38 - 0
src/api/policy/progress.js

@@ -0,0 +1,38 @@
+import request from "@/utils/request";
+
+export default {
+    progress: {
+        share: function (params) {
+            return request({
+                url: "/qdport-zcgx/progress/sharePage",
+                method: "get",
+                params
+            })
+        },
+
+        strive: function (params) {
+            return request({
+                url: "/qdport-zcgx/progress/strivePage",
+                method: "get",
+                params
+            })
+        }
+    },
+
+    condition: {
+        get: function () {
+            return request({
+                url: "/qdport-zcgx/condition/getYtbDate",
+                method: "get"
+            })
+        },
+
+        edit: function (data) {
+            return request({
+                url: "/qdport-zcgx/condition/update",
+                method: "post",
+                data
+            })
+        }
+    }
+}

+ 2 - 2
src/layout/components/NavBar/components/MenuSearch.vue

@@ -1,7 +1,7 @@
 <template>
     <div :class="{ show: show }" class="menu_search">
-        <el-icon class="tjm_tools_icon" size="24" :color="layoutStyle=='vertical'?'':'#fff'">
-            <tjm-icon-ep-Search @click.stop="click" />
+        <el-icon class="tjm_tools_icon" size="24" :color="layoutStyle == 'horizontal' && '#fff'" @click.stop="click">
+            <tjm-icon-ep-Search />
         </el-icon>
         <el-select
             v-model="search"

+ 1 - 3
src/utils/request.js

@@ -6,7 +6,7 @@ import { useUserStore } from "@/store/user";
 // 创建axios实例
 const request = axios.create({
     baseURL: getConfig("baseUrl"),
-    timeout: 1000
+    timeout: 60000
 })
 
 request.interceptors.request.use(
@@ -32,8 +32,6 @@ request.interceptors.response.use(
 
     }, error => {
         if (error.response) {
-            console.log('axios: response', error.response)
-
             if (error.response.data.code == 401 || error.response.status == 401) {
                 ElMessageBox.confirm("登录状态已过期,请重新登录", "系统提示", {
                     type: "warning",

+ 8 - 0
src/views/progress/component/index.js

@@ -0,0 +1,8 @@
+const modules = import.meta.glob("./*.vue");
+const resultComps = {};
+
+for (const path in modules) {
+    const module = await modules[path]();
+    resultComps[`policy_${path.replace(/^\.\/(.*)\.\w+$/, "$1")}`] = markRaw(module.default);
+}
+export default resultComps;

+ 72 - 0
src/views/progress/component/share.vue

@@ -0,0 +1,72 @@
+<template>
+    <el-card class="tjm_card_style_custom">
+        <div class="tjm_card_table">
+            <el-table v-loading="loading" row-key="id" header-cell-class-name="tjm_card_table_header" height="400" :data="tableData" border @row-click="table_detail">
+                <el-table-column type="index" label="序号" width="55"></el-table-column>
+            </el-table>
+        </div>
+        <div class="tjm_card_pagination">
+            <yh-pagination v-model:pageNo="params.page" v-model:pageSize="params.size" :total="total" @paginationChange="reloadTable"></yh-pagination>
+        </div>
+    </el-card>
+</template>
+
+<script>
+import API from "@/api/policy/progress";
+import yhPagination from "@/components/Pagination/index.vue";
+
+export default {
+    components: {
+        yhPagination
+    },
+
+    data() {
+        return {
+            loading: false,
+            params: {
+                page: 1,
+                size: 10
+            },
+
+            total: 0,
+            tableData: []
+        }
+    },
+
+    mounted() {
+        this.reloadTable();
+    },
+
+    methods: {
+        reloadTable() {
+            this.loading = true;
+            API.progress.share(this.params).then(res => {
+                this.loading = false;
+                if (res.code === 200) {
+                    this.tableData = res.data.records;
+                    this.total = res.data.total;
+                } else ElMessage.error(res.msg);
+            }).catch(() => this.loading = false);
+        },
+
+        table_detail(row) {
+            // this.$emit("table_detail", );
+        }
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+.tjm_card_style_custom {
+  border: none;
+  box-shadow: 0 0;
+
+  :deep(.el-card__body) {
+    padding-top: 10px;
+
+    .tjm_card_table {
+      margin-top: 0;
+    }
+  }
+}
+</style>

+ 117 - 0
src/views/progress/component/strive.vue

@@ -0,0 +1,117 @@
+<template>
+    <el-card class="tjm_card_style_custom">
+        <div class="tjm_card_title">条件检索</div>
+        <div class="tjm_card_select">
+            <el-form class="tjm_card_select_left" :model="params" inline label-width="80px" label-position="left">
+                <el-form-item label="项目名称">
+                    <el-input v-model="params.name" clearable placeholder="请输入项目名称"></el-input>
+                </el-form-item>
+                <el-form-item label="填报日期">
+                    <el-date-picker v-model="createTime" type="daterange" value-format="YYYY-MM-DD" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
+                </el-form-item>
+
+                <el-form-item>
+                    <el-button type="primary" icon="search" @click="reloadTable">搜索</el-button>
+                    <el-button icon="refresh-right" @click="reset">重置</el-button>
+                </el-form-item>
+            </el-form>
+        </div>
+        <el-divider></el-divider>
+
+        <div class="tjm_card_tools">
+            <div class="tjm_card_tools_left">
+                <el-button type="primary" icon="tools" @click="table_add">配置应填报日期</el-button>
+            </div>
+            <div class="tjm_card_tools_right">
+                <el-button icon="download" @click="table_export">导出</el-button>
+            </div>
+        </div>
+
+        <div class="tjm_card_table">
+            <el-table v-loading="loading" row-key="id" header-cell-class-name="tjm_card_table_header" height="400" :data="tableData" border @row-click="table_detail">
+                <el-table-column type="index" label="序号" width="55"></el-table-column>
+                 <template v-for="(item, index) in columns" :key="index">
+                    <el-table-column :label="item.label" :prop="item.props" :min-width="item.width || 180" show-overflow-tooltip>
+                        <template #default="scope">{{ columnFormat(scope.row, item.props) }}</template>
+                    </el-table-column>
+                </template>
+                <el-table-column label="操作" fixed="right" width="100">
+                    <template #default="scope">
+                        <el-button type="primary" link icon="tickets" @click.stop="table_detail(scope.row)">查看</el-button>
+                    </template>
+                </el-table-column>
+            </el-table>
+        </div>
+        <div class="tjm_card_pagination">
+            <yh-pagination v-model:pageNo="params.page" v-model:pageSize="params.size" :total="total" @paginationChange="reloadTable"></yh-pagination>
+        </div>
+    </el-card>
+</template>
+
+<script>
+import API from "@/api/policy/progress";
+import { columns } from "@/views/progress/main";
+import yhPagination from "@/components/Pagination/index.vue";
+
+export default {
+    components: {
+        yhPagination
+    },
+
+    data() {
+        return {
+            columns,
+
+            loading: false,
+            params: {
+                page: 1,
+                size: 10
+            },
+
+            total: 0,
+            tableData: []
+        }
+    },
+
+    mounted() {
+        this.reloadTable();
+    },
+
+    methods: {
+        columnFormat(row, props) {
+            if (props == "ytbDate") return "ytbDate";
+            return row[props];
+        },
+
+        reloadTable() {
+            this.loading = true;
+            API.progress.strive(this.params).then(res => {
+                this.loading = false;
+                if (res.code === 200) {
+                    this.tableData = res.data.records;
+                    this.total = res.data.total;
+                } else ElMessage.error(res.msg);
+            }).catch(() => this.loading = false);
+        },
+
+        table_detail(row) {
+            // this.$emit("table_detail", );
+        }
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+.tjm_card_style_custom {
+  border: none;
+  box-shadow: 0 0;
+
+  :deep(.el-card__body) {
+    padding-top: 10px;
+
+    .tjm_card_table {
+      margin-top: 0;
+    }
+  }
+}
+</style>

+ 157 - 0
src/views/progress/index.vue

@@ -0,0 +1,157 @@
+<template>
+    <div class="progress-content">
+        <!-- <el-form class="progress-header">
+            <el-form-item :class="isEdit && 'show'" label="应填报日期">
+                <div class="input-col">
+                    <el-input-number v-model="form.ytbDate" :min="1" :max="28" step-strictly :controls="false"></el-input-number>
+                    <el-button :loading="isSaving" type="primary" @click="submit">保 存</el-button>
+                    <el-button @click="cancel">取 消</el-button>
+                </div>
+                <div class="tag-col" @click="isEdit = !isEdit">
+                    <el-tag v-if="form.ytbDate" type="primary" size="large">每月{{ form.ytbDate }}日</el-tag>
+                    <el-tag v-else type="info" size="large">未设置</el-tag>
+                </div>
+            </el-form-item>
+        </el-form> -->
+
+        <el-tabs v-model="element">
+            <el-tab-pane v-for="(label, key) in progressTab" :key="key" :label="label" :name="key"></el-tab-pane>
+        </el-tabs>
+
+        <component :is="allComps[element]"></component>
+    </div>
+</template>
+
+<script>
+import API from "@/api/policy/progress";
+import allComps from "@/views/progress/component/index";
+import { progressTab } from "@/views/progress/main";
+
+export default {
+    data() {
+        return {
+            allComps,
+            progressTab,
+
+            // element: "policy_share",
+            element: "policy_strive",
+
+            isEdit: false,
+            isSaving: false,
+            form: {
+                ytbDate: null
+            }
+        }
+    },
+
+    // watch: {
+    //     isEdit(value) {
+    //         if (value) document.body.addEventListener("click", this.close);
+    //         else document.body.removeEventListener("click", this.close);
+    //     }
+    // },
+
+    mounted() {
+        this.getCondition();
+    },
+
+    methods: {
+        getCondition() {
+            API.condition.get().then(res => this.form.ytbDate = res.data || null).catch(() => this.form.ytbDate = null);
+        },
+
+        cancel() {
+            this.getCondition();
+            this.isEdit = false;
+        },
+
+        submit() {
+            if (!this.form.ytbDate) this.cancel();
+            else {
+                this.isSaving = true;
+                API.condition.edit(this.form).then(res => {
+                    this.isSaving = false;
+                    ElMessage.success("操作成功");
+                    this.cancel();
+                }).catch(() => this.isSaving = false);
+            }
+        }
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+.progress-content {
+  padding-top: 10px;
+  background: #fff;
+  border: 1px solid var(--el-border-color-light);
+  border-radius: var(--el-border-radius-base);
+  box-shadow: var(--el-box-shadow-light);
+
+  .progress-header {
+    margin: 20px;
+
+    .el-form-item {
+      margin-bottom: 0;
+
+      .input-col {
+        display: flex;
+        transition: width 0.2s;
+        width: 0;
+
+        .el-input-number {
+          display: none;
+          width: 100px;
+
+          :deep(.el-input .el-input__wrapper) {
+            padding: 1px 11px;
+
+            .el-input__inner {
+              text-align: unset;
+            }
+          }
+        }
+
+        .el-input-number + .el-button {
+          margin-left: 20px;
+        }
+
+        .el-button {
+          display: none;
+        }
+      }
+
+      .tag-col {
+        display: inline-flex;
+
+        .el-tag {
+          cursor: pointer;
+        }
+      }
+    }
+
+    .el-form-item.show {
+      .input-col {
+        width: fit-content;
+
+        .el-input-number,
+        .el-button {
+          display: inline-flex;
+        }
+      }
+
+      .tag-col {
+        display: none;
+      }
+    }
+  }
+
+  .el-tabs {
+    padding: 0 20px;
+
+    :deep(.el-tabs__content) {
+      display: none;
+    }
+  }
+}
+</style>

+ 15 - 0
src/views/progress/main.js

@@ -0,0 +1,15 @@
+export const progressTab = {
+    policy_share: "政策分享",
+    policy_strive: "政策争取"
+}
+
+export const columns = [
+    { label: "填报单位", props: "companyName" },
+    { label: "填报部门", props: "deptName" },
+    { label: "填报人", props: "createName" },
+    { label: "项目名称", props: "name" },
+    { label: "预计争取金额", props: "yjStriveAmount", width: "120" },
+    { label: "应填报日期", props: "ytbDate", width: "120" },
+    { label: "是否上报", props: "ytbDate", width: "120" },
+    { label: "是否迟报", props: "ytbDate", width: "120" }
+]