zhuangyunsheng 1 gadu atpakaļ
vecāks
revīzija
76b397b7a8

+ 12 - 0
src/api/common.js

@@ -0,0 +1,12 @@
+import request from "@/utils/request"
+
+// 文件方法
+export default {
+    // 获取当前组织/单位
+    getUserDept: function (deptId) {
+        return request({
+            url: `/qdport-zcgx/system/${deptId}`,
+            method: "get"
+        })
+    }
+}

+ 10 - 0
src/api/folder.js

@@ -47,5 +47,15 @@ export default {
             method: "get",
             responseType: "blob"
         })
+    },
+
+    import: function (url, excelUrl) { // 导入
+        return request({
+            url: `qdport-zcgx/import/${url}`,
+            method: "post",
+            data: {
+                excelUrl
+            }
+        })
     }
 }

+ 2 - 18
src/api/policy/share.js

@@ -1,14 +1,6 @@
 import request from "@/utils/request";
 
 export default {
-    // 获取当前组织/单位
-    getUserDept: function (deptId) {
-        return request({
-            url: `/qdport-zcgx/system/${deptId}`,
-            method: "get"
-        })
-    },
-
     get: function (params) {
         return request({
             url: "/qdport-zcgx/share/page",
@@ -83,17 +75,9 @@ export default {
         })
     },
 
-    // withdraw: function (data) { // 退回
-    //     return request({
-    //         url: "/qdport-zcgx/share/withdraw",
-    //         method: "post",
-    //         data
-    //     })
-    // },
-
-    import: function (data) { // 导入
+    refuse: function (data) { // 退回
         return request({
-            url: "qdport-zcgx/import/policyShare",
+            url: "/qdport-zcgx/share/refuse",
             method: "post",
             data
         })

+ 93 - 0
src/api/policy/strive.js

@@ -0,0 +1,93 @@
+import request from "@/utils/request";
+
+export default {
+    get: function (params) {
+        return request({
+            url: "/qdport-zcgx/strive/page",
+            method: "get",
+            params
+        })
+    },
+
+    detail: function (id) {
+        return request({
+            url: `/qdport-zcgx/strive/${id}`,
+            method: "get"
+        })
+    },
+
+    add: function (data) {
+        return request({
+            url: "/qdport-zcgx/strive/save",
+            method: "post",
+            data
+        })
+    },
+
+    saveDone: function (data) {
+        return request({
+            url: "/qdport-zcgx/strive/saveDone",
+            method: "post",
+            data
+        })
+    },
+
+    edit: function (data) {
+        return request({
+            url: "/qdport-zcgx/strive/update",
+            method: "post",
+            data
+        })
+    },
+
+    explain: function (data) {
+        return request({
+            url: "/qdport-zcgx/strive/updateById",
+            method: "post",
+            data
+        })
+    },
+
+    del: function (data) {
+        return request({
+            headers: {
+                "Content-Type": "application/x-www-form-urlencoded"
+            },
+            url: "/qdport-zcgx/strive/remove",
+            method: "post",
+            data
+        })
+    },
+
+    saveApprove: function (data) { // 直接上报/提交
+        return request({
+            url: "/qdport-zcgx/strive/saveApprove",
+            method: "post",
+            data
+        })
+    },
+
+    withdraw: function (data) { // 撤回
+        return request({
+            url: "/qdport-zcgx/strive/withdraw",
+            method: "post",
+            data
+        })
+    },
+
+    agree: function (data) { // 审核通过
+        return request({
+            url: "/qdport-zcgx/strive/approve",
+            method: "post",
+            data
+        })
+    },
+
+    refuse: function (data) { // 退回
+        return request({
+            url: "/qdport-zcgx/strive/refuse",
+            method: "post",
+            data
+        })
+    }
+}

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1 - 0
src/assets/svg/policy/decode.svg


+ 2 - 2
src/components/SvgIcon/index.vue

@@ -37,7 +37,7 @@ export default defineComponent({
 
 <style scope lang="scss">
 .svg-icon {
-  width: 24px;
-  height: 24px;
+  width: 1em;
+  height: 1em;
 }
 </style>

+ 97 - 0
src/components/Upload/tableImport.vue

@@ -0,0 +1,97 @@
+<template>
+    <el-upload :class="hasMargin && 'import-upload'"
+        action=""
+        accept=".xlsx, .xls"
+        :limit="1"
+        :show-file-list="false"
+        :http-request="request"
+        :before-upload="before"
+        :on-success="success"
+        :on-error="error">
+        <slot>
+            <el-button icon="upload-filled">导入</el-button>
+        </slot>
+    </el-upload>
+</template>
+
+<script>
+    import Folder from "@/api/folder";
+
+	export default {
+		props: {
+			url: { type: String, default: "" },
+			hasMargin: { type: Boolean, default: true },
+			maxSize: { type: Number, default: 50 },
+			onSuccess: { type: Function, default: () => { return true } }
+		},
+
+		data() {
+			return {
+                loading: null
+            }
+		},
+
+		methods: {
+			before(file) {
+				const maxSize = file.size / 1024 / 1024 < this.maxSize;
+				if (!maxSize) {
+					ElMessage.warning(`上传文件大小不能超过 ${this.maxSize}MB!`);
+					return false;
+				}
+			},
+
+			success(res, file) {
+				let os = this.onSuccess(res, file);
+				if (!this.url || os != undefined && os == false) return false;
+ 
+                this.loading = ElLoading.service({
+                    lock: true,
+                    text: "导入中请等待…",
+                    spinner: "el-icon-loading",
+                    background: "rgba(0, 0, 0, 0.7)"
+                });
+                Folder.import(this.url, res).then(res => {
+                    if (res.code == 200) {
+                        this.loading && this.loading.close();
+                        ElMessage.success(res.data);
+                        this.$emit("success");
+                    } else ElMessage.error(res.msg);
+                }).catch(() => this.loading && this.loading.close());
+			},
+
+			error(message) {
+                this.loading && this.loading.close();
+				ElNotification.error({ title: "上传文件未成功", message });
+			},
+
+			request(param) {
+                this.loading = ElLoading.service({
+                    lock: true,
+                    text: "上传中请等待…",
+                    spinner: "el-icon-loading",
+                    background: "rgba(0, 0, 0, 0.7)"
+                });
+
+				const data = new FormData();
+				data.append(param.filename, param.file);
+
+                Folder.up(data, {
+					onUploadProgress: e => {
+						const percent = parseInt(((e.loaded / e.total) * 100) | 0, 10);
+						param.onProgress({ percent });
+					}
+				}).then(res => {
+                    this.loading && this.loading.close()
+					if (res.code == 200) param.onSuccess(res.data.link);
+					else param.onError(res.msg || "未知错误");
+				}).catch(err => param.onError(err));
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+.import-upload {
+  margin-right: 12px;
+}
+</style>

+ 8 - 33
src/layout/components/SideBar/sideBarItem.vue

@@ -54,48 +54,23 @@ const handleClickMenu = item => {
 <template>
     <template v-if="!item.hidden">
         <template v-if="fatherHasOneSonOrMenu(item.children, item) && !item.alwaysShow">
-            <el-menu-item
-                :index="onlyOneChild.path"
-                @click="handleClickMenu(onlyOneChild)"
-            >
-                <el-icon
-                    size="16"
-                    class="icon"
-                    v-if="onlyOneChild.meta.icon.indexOf('ep') !== -1"
-                >
-                    <component :is="onlyOneChild.meta.icon.slice(2)" />
+            <el-menu-item :index="onlyOneChild.path" @click="handleClickMenu(onlyOneChild)">
+                <el-icon size="16">
+                    <component v-if="onlyOneChild.meta.icon.indexOf('ep') !== -1" :is="onlyOneChild.meta.icon.slice(2)" />
+                    <svg-icon v-if="onlyOneChild.meta.icon.indexOf('tjm') !== -1" :icon-class="onlyOneChild.meta.icon.slice(4)" />
                 </el-icon>
-                <svg-icon
-                    v-if="onlyOneChild.meta.icon.indexOf('tjm') !== -1"
-                    :icon-class="onlyOneChild.meta.icon.slice(4)"
-                    class-name="icon"
-                    style="height: 16px; width: 16px"
-                />
                 <template #title>{{ onlyOneChild.meta.title }}</template>
             </el-menu-item>
         </template>
         <el-sub-menu v-else :index="item.path">
             <template #title>
-                <el-icon
-                    size="16"
-                    class="icon"
-                    v-if="item.meta.icon.indexOf('ep') !== -1"
-                >
-                    <component :is="item.meta.icon.slice(2)" />
+                <el-icon size="16">
+                    <component v-if="item.meta.icon.indexOf('ep') !== -1" :is="item.meta.icon.slice(2)" />
+                    <svg-icon v-if="item.meta.icon.indexOf('tjm') !== -1" :icon-class="item.meta.icon.slice(4)" />
                 </el-icon>
-                <svg-icon
-                    v-if="item.meta.icon.indexOf('tjm') !== -1"
-                    :icon-class="item.meta.icon.slice(4)"
-                    class-name="icon"
-                    style="height: 16px; width: 16px"
-                />
                 <span>{{ item.meta.title }}</span>
             </template>
-            <sideBarItem
-                v-for="(route, index) in item.children"
-                :key="route.path + index"
-                :item="route"
-            />
+            <sideBarItem v-for="(route, index) in item.children" :key="route.path + index" :item="route" />
         </el-sub-menu>
     </template>
 </template>

+ 18 - 18
src/views/home/home.vue

@@ -236,7 +236,7 @@ const tableData = ref([{ name: '小明', num: '123', number: '11', step: '0.1',
 
         .title {
           color: #999;
-          font-family: "PingFang HK";
+          font-family: 'PingFang HK';
           font-size: 12px;
           font-style: normal;
           font-weight: 600;
@@ -254,7 +254,7 @@ const tableData = ref([{ name: '小明', num: '123', number: '11', step: '0.1',
 
           .top {
             display: flex;
-            align-items: center
+            align-items: center;
           }
 
           .bottom {
@@ -266,7 +266,7 @@ const tableData = ref([{ name: '小明', num: '123', number: '11', step: '0.1',
           img {
             height: 17px;
             width: 17px;
-            margin-right: 10px
+            margin-right: 10px;
           }
         }
 
@@ -281,13 +281,13 @@ const tableData = ref([{ name: '小明', num: '123', number: '11', step: '0.1',
             height: 48px;
             width: 48px;
             background-color: lightgrey;
-            border-radius: 50%
+            border-radius: 50%;
           }
 
           .label {
             margin-top: 5px;
             color: #666;
-            font-family: "Alibaba PuHuiTi 3.0";
+            font-family: 'Alibaba PuHuiTi 3.0';
             font-size: 14px;
             font-style: normal;
             font-weight: 400;
@@ -306,7 +306,7 @@ const tableData = ref([{ name: '小明', num: '123', number: '11', step: '0.1',
         overflow: hidden;
         .title {
           color: #000;
-          font-family: "PingFang SC";
+          font-family: 'PingFang SC';
           font-size: 14px;
           font-style: normal;
           font-weight: 500;
@@ -325,7 +325,7 @@ const tableData = ref([{ name: '小明', num: '123', number: '11', step: '0.1',
 
         .title {
           color: #000;
-          font-family: "PingFang SC";
+          font-family: 'PingFang SC';
           font-size: 14px;
           font-style: normal;
           font-weight: 500;
@@ -355,7 +355,7 @@ const tableData = ref([{ name: '小明', num: '123', number: '11', step: '0.1',
           .left {
             margin-left: 7px;
             color: #000;
-            font-family: "PingFang SC";
+            font-family: 'PingFang SC';
             font-size: 14px;
             font-style: normal;
             font-weight: 500;
@@ -365,7 +365,7 @@ const tableData = ref([{ name: '小明', num: '123', number: '11', step: '0.1',
           .right {
             width: fit-content;
             color: #999;
-            font-family: "Alibaba PuHuiTi 3.0";
+            font-family: 'Alibaba PuHuiTi 3.0';
             font-size: 12px;
             font-style: normal;
             font-weight: 500;
@@ -383,12 +383,12 @@ const tableData = ref([{ name: '小明', num: '123', number: '11', step: '0.1',
           justify-content: space-between;
 
           &.line {
-            border-bottom: 1px solid #EBEBEB;
+            border-bottom: 1px solid #ebebeb;
           }
 
           .time {
             color: #999;
-            font-family: "Alibaba PuHuiTi 3.0";
+            font-family: 'Alibaba PuHuiTi 3.0';
             font-size: 12px;
             font-style: normal;
             font-weight: 500;
@@ -398,7 +398,7 @@ const tableData = ref([{ name: '小明', num: '123', number: '11', step: '0.1',
             width: 60%;
             height: 20px;
             color: #333;
-            font-family: "Alibaba PuHuiTi 3.0";
+            font-family: 'Alibaba PuHuiTi 3.0';
             font-size: 14px;
             font-style: normal;
             font-weight: 400;
@@ -416,7 +416,7 @@ const tableData = ref([{ name: '小明', num: '123', number: '11', step: '0.1',
             text-align: center;
             color: white;
             border-radius: 4px;
-            background: #FF852E;
+            background: #ff852e;
           }
         }
       }
@@ -440,7 +440,7 @@ const tableData = ref([{ name: '小明', num: '123', number: '11', step: '0.1',
           .left {
             margin-left: 7px;
             color: #000;
-            font-family: "PingFang SC";
+            font-family: 'PingFang SC';
             font-size: 14px;
             font-style: normal;
             font-weight: 500;
@@ -450,7 +450,7 @@ const tableData = ref([{ name: '小明', num: '123', number: '11', step: '0.1',
           .right {
             width: fit-content;
             color: #999;
-            font-family: "Alibaba PuHuiTi 3.0";
+            font-family: 'Alibaba PuHuiTi 3.0';
             font-size: 12px;
             font-style: normal;
             font-weight: 500;
@@ -476,7 +476,7 @@ const tableData = ref([{ name: '小明', num: '123', number: '11', step: '0.1',
 
             .title {
               color: #000;
-              font-family: "Alibaba PuHuiTi 3.0";
+              font-family: 'Alibaba PuHuiTi 3.0';
               font-size: 14px;
               font-style: normal;
               font-weight: 400;
@@ -490,7 +490,7 @@ const tableData = ref([{ name: '小明', num: '123', number: '11', step: '0.1',
 
           .time {
             color: #999;
-            font-family: "Alibaba PuHuiTi 3.0";
+            font-family: 'Alibaba PuHuiTi 3.0';
             font-size: 12px;
             font-style: normal;
             font-weight: 400;
@@ -513,7 +513,7 @@ const tableData = ref([{ name: '小明', num: '123', number: '11', step: '0.1',
 
     .title {
       color: #000;
-      font-family: "PingFang SC";
+      font-family: 'PingFang SC';
       font-size: 14px;
       font-style: normal;
       font-weight: 500;

+ 8 - 7
src/views/manage/policyShare/dialog.vue

@@ -64,7 +64,7 @@
                 <el-col :span="12">
                     <el-form-item label="是否入库">
                         <el-radio-group v-model="form.isInWh" @change="form.inWhType = null">
-                            <el-radio v-for="(label, key) in inWHDic" :key="key" :label="label" :value="parseInt(key)"></el-radio>
+                            <el-radio v-for="(label, key) in whetherDic" :key="key" :label="label" :value="parseInt(key)"></el-radio>
                         </el-radio-group>
                     </el-form-item>
                 </el-col>
@@ -102,9 +102,10 @@
 </template>
 
 <script>
+import Common from "@/api/common";
 import API from "@/api/policy/share";
 import { useUserStore } from "@/store/user";
-import { levelDic, typeDic, inWHDic, storageTypeDic } from "@/views/policyShare/main";
+import { levelDic, typeDic, whetherDic, storageTypeDic } from "@/views/policyShare/main";
 import yhUpload from "@/components/Upload/index.vue";
 
 const { userInfo } = useUserStore(); // store 用户
@@ -117,13 +118,13 @@ export default {
 
     data() {
         return {
-            levelDic, typeDic, inWHDic, storageTypeDic,
+            levelDic, typeDic, whetherDic, storageTypeDic,
             visible: false,
             mode: "add",
             titleMap: {
-                add: "新增政策",
-                edit: "编辑政策",
-                decode: "政策解读"
+                add: "新增",
+                edit: "修改",
+                decode: "添加解读"
             },
             form: {
                 id: null,
@@ -189,7 +190,7 @@ export default {
         },
 
         getUserDept() {
-            API.getUserDept(userInfo.deptId).then(res => {
+            Common.getUserDept(userInfo.deptId).then(res => {
                 if (res.code === 200) {
                     this.form.companyName = res.data.companyName;
                     this.form.deptName = res.data.deptName;

+ 12 - 9
src/views/manage/policyShare/index.vue

@@ -18,7 +18,7 @@
                 </el-form-item>
                 <el-form-item label="是否入库">
                     <el-select v-model="params.isInWh" clearable placeholder="请选择入库状态">
-                        <el-option v-for="(label, key) in inWHDic" :key="key" :label="label" :value="parseInt(key)"></el-option>
+                        <el-option v-for="(label, key) in whetherDic" :key="key" :label="label" :value="parseInt(key)"></el-option>
                     </el-select>
                 </el-form-item>
                 <el-form-item label="入库类别">
@@ -50,15 +50,18 @@
             <el-table v-loading="loading" row-key="id" header-cell-class-name="tjm_card_table_header" height="400" :data="tableData" border>
                 <el-table-column type="index" width="50"></el-table-column>
                 <template v-for="(item, index) in columns" :key="index">
-                    <el-table-column :label="item.label" :prop="item.props" :width="item.width || 180">
+                    <el-table-column :label="item.label" :prop="item.props" :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="180">
+                <el-table-column label="操作" fixed="right" width="240">
                     <template #default="scope">
-                        <el-button type="primary" link @click="table_edit(scope.row)">修改</el-button>
-                        <el-button v-if="scope.row.inWhType == '文件类'" type="primary" link @click="table_edit(scope.row, 'decode')">添加解读</el-button>
-                        <el-button type="primary" link @click="table_del(scope.row)">删除</el-button>
+                        <el-button type="primary" link icon="edit" @click="table_edit(scope.row)">修改</el-button>
+                        <el-button v-if="scope.row.inWhType == '文件类'" type="primary" link @click="table_edit(scope.row, 'decode')">
+                            <el-icon><svg-icon #icon icon-class="policy-decode" /></el-icon>
+                            <span>添加解读</span>
+                        </el-button>
+                        <el-button type="primary" link icon="delete" @click="table_del(scope.row)">删除</el-button>
                     </template>
                 </el-table-column>
             </el-table>
@@ -74,7 +77,7 @@
 <script>
 import API from "@/api/policy/share"
 import { exportExcel } from "@/utils/exportExcel";
-import { columns, levelDic, typeDic, storageTypeDic, inWHDic, statusDic } from "@/views/policyShare/main";
+import { columns, levelDic, typeDic, storageTypeDic, whetherDic, statusDic } from "@/views/policyShare/main";
 import yhPagination from "@/components/Pagination/index.vue";
 import policyDetail from "./dialog.vue";
 
@@ -87,7 +90,7 @@ export default {
     data() {
         return {
             columns: columns.filter(c => c.props != "status"),
-            levelDic, typeDic, storageTypeDic, inWHDic, statusDic,
+            levelDic, typeDic, storageTypeDic, whetherDic, statusDic,
 
             loading: false,
             createTime: [],
@@ -110,7 +113,7 @@ export default {
 
     methods: {
         columnFormat(row, props) {
-            if (props == "isInWh") return inWHDic[row[props]] || "";
+            if (props == "isInWh") return whetherDic[row[props]] || "";
             return row[props];
         },
 

+ 44 - 32
src/views/policyShare/dialog.vue

@@ -29,51 +29,54 @@
                 </el-col>
                 <el-col :span="12">
                     <el-form-item label="政策名称" prop="name">
-                        <el-input v-model="form.name" :disabled="mode.includes('agree')" placeholder="请输入政策名称"></el-input>
+                        <el-input v-model="form.name" :disabled="isApprove" placeholder="请输入政策名称"></el-input>
                     </el-form-item>
                 </el-col>
                 <el-col :span="12">
                     <el-form-item label="政策等级" prop="zcLevel">
-                        <el-select v-model="form.zcLevel" :disabled="mode.includes('agree')" placeholder="请选择政策等级">
+                        <el-select v-model="form.zcLevel" :disabled="isApprove" placeholder="请选择政策等级">
                             <el-option v-for="item in levelDic" :key="item" :label="item" :value="item"></el-option>
                         </el-select>
                     </el-form-item>
                 </el-col>
                 <el-col :span="12">
                     <el-form-item label="政策类别" prop="zcType">
-                        <el-select v-model="form.zcType" :disabled="mode.includes('agree')" placeholder="请选择政策类别">
+                        <el-select v-model="form.zcType" :disabled="isApprove" placeholder="请选择政策类别">
                             <el-option v-for="item in typeDic" :key="item" :label="item" :value="item"></el-option>
                         </el-select>
                     </el-form-item>
                 </el-col>
                 <el-col :span="12">
                     <el-form-item label="政策文号" prop="docNo">
-                        <el-input v-model="form.docNo" :disabled="mode.includes('agree')" placeholder="请输入政策文号"></el-input>
+                        <el-input v-model="form.docNo" :disabled="isApprove" placeholder="请输入政策文号"></el-input>
                     </el-form-item>
                 </el-col>
                 <el-col :span="12">
                     <el-form-item label="联系方式" prop="contactPhone">
-                        <el-input v-model="form.contactPhone" :disabled="mode.includes('agree')" placeholder="请输入联系方式"></el-input>
+                        <el-input v-model="form.contactPhone" :disabled="isApprove" placeholder="请输入联系方式"></el-input>
                     </el-form-item>
                 </el-col>
                 <el-col :span="24">
                     <el-form-item label="政策概要" prop="abstractContent">
-                        <el-input v-model="form.abstractContent" type="textarea" :rows="4" :disabled="mode.includes('agree')" placeholder="请输入政策概要"></el-input>
+                        <el-input v-model="form.abstractContent" type="textarea" :rows="4" :disabled="isApprove" placeholder="请输入政策概要"></el-input>
                     </el-form-item>
                 </el-col>
                 <el-col :span="24">
-                    <el-form-item :class="(mode == 'detail' || mode.includes('agree')) && 'no-upload-btn'" label="附件">
-                        <yhUpload v-model="form.fileList" :limit="10" :disabled="mode.includes('agree')" @updateTable="fileIsDel = true">
+                    <el-form-item :class="(mode == 'detail' || isApprove) && 'no-upload-btn'" label="附件">
+                        <yhUpload v-model="form.fileList" :limit="10" :disabled="isApprove" @updateTable="fileIsDel = true">
                             <el-button type="primary" icon="upload" size="small"></el-button>
                         </yhUpload>
                     </el-form-item>
                 </el-col>
+            </el-row>
 
-                <template v-if="(mode == 'detail' && form.status == 'done') || mode == 'agree'">
+            <template v-if="form.status == 'done' || mode == 'agree'">
+                <div>审核详情</div>
+                <el-row>
                     <el-col :span="12">
                         <el-form-item label="是否入库" prop="isInWh">
                             <el-radio-group v-model="form.isInWh" @change="form.inWhType = null">
-                                <el-radio v-for="(label, key) in inWHDic" :key="key" :label="label" :value="parseInt(key)"></el-radio>
+                                <el-radio v-for="(label, key) in whetherDic" :key="key" :label="label" :value="parseInt(key)"></el-radio>
                             </el-radio-group>
                         </el-form-item>
                     </el-col>
@@ -84,22 +87,27 @@
                             </el-select>
                         </el-form-item>
                     </el-col>
-                    <el-col :push="1" :span="13">
+                    <el-col :span="12">
                         <el-form-item label="分值(0-10)" prop="score">
                             <el-input-number v-model="form.score" :min="0" :max="10" :step="0.1" :precision="2" controls-position="right" placeholder="请输入分值"></el-input-number>
                         </el-form-item>
                     </el-col>
-                </template>
-                <el-col v-if="mode == 'disagree'" :span="24">
-                    <el-form-item label="意见" prop="remark">
-                        <el-input v-model="form.remark" type="textarea" :rows="4" placeholder="请输入意见"></el-input>
-                    </el-form-item>
-                </el-col>
-            </el-row>
+                </el-row>
+            </template>
+            <template v-if="form.status == 'inactive' || mode == 'refuse'">
+                <div>审核详情</div>
+                <el-row>
+                    <el-col :span="24">
+                        <el-form-item label="意见" prop="remark">
+                            <el-input v-model="form.remark" type="textarea" :rows="4" :disabled="mode == 'edit'" placeholder="请输入意见"></el-input>
+                        </el-form-item>
+                    </el-col>
+                </el-row>
+            </template>
         </el-form>
 
         <template #footer>
-            <template v-if="mode.includes('agree')">
+            <template v-if="isApprove">
                 <el-button type="primary" @click="validateForm(mode)">确 定</el-button>
             </template>
             <template v-if="mode == 'add' || mode == 'edit'">
@@ -111,9 +119,10 @@
 </template>
 
 <script>
+import Common from "@/api/common";
 import API from "@/api/policy/share";
 import { useUserStore } from "@/store/user";
-import { levelDic, typeDic, storageTypeDic, inWHDic } from "./main";
+import { levelDic, typeDic, storageTypeDic, whetherDic } from "./main";
 import yhUpload from "@/components/Upload/index.vue";
 
 const { userInfo } = useUserStore(); // store 用户
@@ -126,16 +135,16 @@ export default {
 
     data() {
         return {
-            levelDic, typeDic, storageTypeDic, inWHDic,
+            levelDic, typeDic, storageTypeDic, whetherDic,
 
             visible: false,
             mode: "add",
             titleMap: {
-                add: "新增政策",
-                edit: "编辑政策",
-                detail: "政策详情",
+                add: "新增",
+                edit: "编辑",
+                detail: "详情",
                 agree: "考核评分",
-                disagree: "退回意见"
+                refuse: "退回意见"
             },
             form: {
                 id: null,
@@ -169,7 +178,7 @@ export default {
                 score: [{ required: true, message: "请输入分值" }],
                 isInWh: [{ required: true }],
                 inWhType: [{ required: true, message: "请选择入库类型" }],
-                remark: [{ required: true, message: "请输入退回意见" }]
+                // remark: [{ required: true, message: "请输入退回意见" }]
             },
 
             fileIsDel: false,
@@ -177,6 +186,12 @@ export default {
         }
     },
 
+    computed: {
+        isApprove() {
+            return this.mode == "agree" || this.mode == "refuse";
+        }
+    },
+
     mounted() {
         this.getUserDept();
     },
@@ -194,19 +209,16 @@ export default {
                     for (const key in this.form) {
                         if (key == "fileList") {
                             this.form[key] = res.data[key].map(file => ({ ...file, name: file.originalName, path: file.fileDomain + "/" + file.fileName }));
-                        } else this.form[key] = res.data[key] || null;
+                        } else if (key == "isInWh") this.form.isInWh = !!res.data[key] && res.data[key] || 0;
+                        else this.form[key] = res.data[key] || null;
                     }
                     this.form.updateId = userInfo.id;
-                    if (this.mode == "agree") {
-                        this.form.isInWh = 0;
-                        this.form.inWhType = null;
-                    }
                 } else ElMessage.error(res.msg);
             });
         },
 
         getUserDept() {
-            API.getUserDept(userInfo.deptId).then(res => {
+            Common.getUserDept(userInfo.deptId).then(res => {
                 if (res.code === 200) {
                     this.form.companyName = res.data.companyName;
                     this.form.deptName = res.data.deptName;

+ 18 - 62
src/views/policyShare/index.vue

@@ -23,7 +23,7 @@
                 </el-form-item>
                 <el-form-item label="是否入库">
                     <el-select v-model="params.isInWh" clearable placeholder="请选择入库状态">
-                        <el-option v-for="(label, key) in inWHDic" :key="key" :label="label" :value="key"></el-option>
+                        <el-option v-for="(label, key) in whetherDic" :key="key" :label="label" :value="key"></el-option>
                     </el-select>
                 </el-form-item>
                 <el-form-item label="入库类别">
@@ -47,10 +47,8 @@
             <div class="tjm_card_tools_left">
                 <el-button type="primary" icon="plus" @click="table_add">新增</el-button>
             </div>
-            <div class="tjm_card_tools_right">
-                <el-upload class="import-upload" action="" accept=".xlsx, .xls" :limit="1" :show-file-list="false" :http-request="table_import" :on-success="import_success">
-                    <el-button icon="upload-filled">导入</el-button>
-                </el-upload>
+            <div class="tjm_card_tools_right flex-row">
+                <table-import url="policyShare" @success="reloadTable"></table-import>
                 <el-button icon="download" @click="table_export">导出</el-button>
             </div>
         </div>
@@ -58,19 +56,19 @@
             <el-table v-loading="loading" row-key="id" header-cell-class-name="tjm_card_table_header" height="400" :data="tableData" border>
                 <el-table-column type="index" width="50"></el-table-column>
                 <template v-for="(item, index) in columns" :key="index">
-                    <el-table-column :label="item.label" :prop="item.props" :width="item.width || 180">
+                    <el-table-column :label="item.label" :prop="item.props" :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="180">
+                <el-table-column label="操作" fixed="right" width="220">
                     <template #default="scope">
                         <template v-if="scope.row.status == 'active' || scope.row.status == 'inactive'">
-                            <el-button type="primary" link @click="table_edit(scope.row)">修改</el-button>
-                            <el-button type="primary" link @click="table_update(scope.row)">提交</el-button>
-                            <el-button type="primary" link @click="table_del(scope.row)">删除</el-button>
+                            <el-button type="primary" link icon="edit" @click="table_edit(scope.row)">修改</el-button>
+                            <el-button type="primary" link icon="upload" @click="table_update(scope.row)">提交</el-button>
+                            <el-button type="primary" link icon="delete" @click="table_del(scope.row)">删除</el-button>
                         </template>
-                        <el-button v-if="scope.row.status == 'approve' || scope.row.status == 'done'" type="primary" link @click="table_edit(scope.row, 'detail')">详情</el-button>
-                        <el-button v-if="scope.row.status == 'approve'" type="primary" link @click="table_update(scope.row, 'withdraw')">撤回</el-button>
+                        <el-button v-if="scope.row.status == 'approve' || scope.row.status == 'done'" type="primary" link icon="tickets" @click="table_edit(scope.row, 'detail')">详情</el-button>
+                        <el-button v-if="scope.row.status == 'approve'" type="primary" link icon="refresh-right" @click="table_update(scope.row, 'withdraw')">撤回</el-button>
                     </template>
                 </el-table-column>
             </el-table>
@@ -85,12 +83,14 @@
 
 <script>
 import API from "@/api/policy/share"
-import Folder from "@/api/folder.js";
+import { useUserStore } from "@/store/user";
 import { exportExcel } from "@/utils/exportExcel";
-import { columns, levelDic, typeDic, storageTypeDic, inWHDic, statusDic } from "./main";
+import { columns, levelDic, typeDic, storageTypeDic, whetherDic, statusDic } from "./main";
 import yhPagination from "@/components/Pagination/index.vue";
 import policyDetail from "./dialog.vue";
 
+const { userInfo } = useUserStore(); // store 用户
+
 export default {
     components: {
         yhPagination,
@@ -99,7 +99,7 @@ export default {
 
     data() {
         return {
-            columns, levelDic, typeDic, storageTypeDic, inWHDic, statusDic,
+            columns, levelDic, typeDic, storageTypeDic, whetherDic, statusDic,
 
             loading: false,
             createTime: [],
@@ -122,7 +122,7 @@ export default {
     methods: {
         columnFormat(row, props) {
             if (props == "status") return statusDic[row[props]] || "";
-            if (props == "isInWh") return inWHDic[row[props]] || "";
+            if (props == "isInWh") return whetherDic[row[props]] || "";
             return row[props];
         },
 
@@ -183,7 +183,7 @@ export default {
                 confirmButtonText: "确定",
                 cancelButtonText: "取消"
             }).then(() => {
-                API[mode](row).then(res => {
+                API[mode]({ ...row, updateId: userInfo.id }).then(res => {
                     if (res.code === 200) {
                         ElMessage.success("操作成功");
                         this.reloadTable();
@@ -202,51 +202,7 @@ export default {
             const data = this.tableData.map(v => columns.map(c => c.props).map(j => this.columnFormat(v, j)));
 
             exportExcel(header, data, [], `${this.$route.name}.xlsx`);
-        },
-
-        table_import(param) {
-            const importLoading = ElLoading.service({
-                lock: true,
-                text: "上传中请等待…",
-                spinner: "el-icon-loading",
-                background: "rgba(0, 0, 0, 0.7)"
-            });
-            const data = new FormData();
-            data.append(param.filename, param.file);
-
-            Folder.up(data).then(res => {
-                importLoading.close();
-                if (res.code == 200) param.onSuccess(res.data.link);
-                else ElMessage.error(res.msg || "未知错误");
-            }).catch(() => importLoading.close());
-        },
-
-        import_success(excelUrl) {
-            const importLoading = ElLoading.service({
-                lock: true,
-                text: "导入中请等待…",
-                spinner: "el-icon-loading",
-                background: "rgba(0, 0, 0, 0.7)"
-            })
-            API.import({ excelUrl }).then(res => {
-                if (res.code == 200) {
-                    importLoading.close();
-				    ElMessage.success(res.data);
-                    this.reloadTable();
-                } else ElMessage.error(res.msg);
-            }).catch(() => importLoading.close());
         }
     }
 }
-</script>
-
-<style lang="scss" scoped>
-.tjm_card_style_custom .tjm_card_tools .tjm_card_tools_right {
-  display: flex;
-  align-items: center;
-
-  .import-upload {
-    margin-right: 12px;
-  }
-}
-</style>
+</script>

+ 1 - 1
src/views/policyShare/main.js

@@ -17,7 +17,7 @@ export const columns = [
 export const levelDic = ["国家级", "省部级", "市区级"];
 export const typeDic = ["财税政策", "人才支持", "市场开拓", "智慧创新", "招商引资", "技术改造", "法律法规", "营商环境", "企业管理"];
 export const storageTypeDic = ["文件类", "解读类"];
-export const inWHDic = { 0: "否", 1: "是" };
+export const whetherDic = { 0: "否", 1: "是" };
 export const statusDic = {
     active: "保存",
     approve: "审核",

+ 288 - 0
src/views/policyStrive/dialog.vue

@@ -0,0 +1,288 @@
+<template>
+    <el-dialog v-model="visible" :title="titleMap[mode]" :width="680" @closed="$emit('closed', fileIsDel)">
+        <el-form ref="formRef" :model="form" :rules="rules" :disabled="mode == 'detail'" label-width="110px">
+            <el-row>
+                <el-col v-if="form.id" :span="12">
+                    <el-form-item label="政策编号" prop="businessNo">
+                        <el-input v-model="form.businessNo" disabled></el-input>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="12">
+                    <el-form-item label="填报人">
+                        <el-input v-model="form.createName" disabled></el-input>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="12">
+                    <el-form-item label="填报部门">
+                        <el-input v-model="form.deptName" disabled></el-input>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="12">
+                    <el-form-item label="填报单位">
+                        <el-input v-model="form.companyName" disabled></el-input>
+                    </el-form-item>
+                </el-col>
+                <el-col v-if="form.id" :span="12">
+                    <el-form-item label="填报时间">
+                        <el-date-picker v-model="form.createTime" disabled format="YYYY-MM-DD HH:mm:ss"></el-date-picker>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="12">
+                    <el-form-item label="项目名称" prop="name">
+                        <el-input v-model="form.name" :disabled="mode == 'explain'" placeholder="请输入项目名称"></el-input>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="12">
+                    <el-form-item label="项目等级" prop="zcLevel">
+                        <el-select v-model="form.zcLevel" :disabled="mode == 'explain'" placeholder="请选择项目等级">
+                            <el-option v-for="item in levelDic" :key="item" :label="item" :value="item"></el-option>
+                        </el-select>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="12">
+                    <el-form-item label="项目类别" prop="zcType">
+                        <el-select v-model="form.zcType" :disabled="mode == 'explain'" placeholder="请选择项目类别">
+                            <el-option v-for="item in typeDic" :key="item" :label="item" :value="item"></el-option>
+                        </el-select>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="12">
+                    <el-form-item label="政策文号" prop="docNo">
+                        <el-input v-model="form.docNo" :disabled="mode == 'explain'" placeholder="请输入政策文号"></el-input>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="12">
+                    <el-form-item label="联系方式" prop="contactPhone">
+                        <el-input v-model="form.contactPhone" :disabled="mode == 'explain'" placeholder="请输入联系方式"></el-input>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="12">
+                    <el-form-item label="预计争取金额" prop="yjStriveAmount">
+                        <el-input-number v-model="form.yjStriveAmount" :min="0" :step="0.1" :precision="2" controls-position="right" :disabled="mode == 'explain'" placeholder="请输入预计争取金额"></el-input-number>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="12">
+                    <el-form-item label="预计完成时间" prop="yjFinishTime">
+                        <el-date-picker v-model="form.yjFinishTime" value-format="YYYY-MM-DD" :disabled="mode == 'explain'" placeholder="请选择预计完成时间"></el-date-picker>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="12">
+                    <el-form-item label="责任人" prop="directorName">
+                        <el-input v-model="form.directorName" :disabled="mode == 'explain'" placeholder="请输入责任人"></el-input>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="24">
+                    <el-form-item label="项目概要" prop="abstractContent">
+                        <el-input v-model="form.abstractContent" type="textarea" :rows="4" :disabled="mode == 'explain'" placeholder="请输入项目概要"></el-input>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="24">
+                    <el-form-item :class="(mode == 'detail' || mode == 'explain') && 'no-upload-btn'" label="附件">
+                        <yhUpload v-model="form.fileList" :limit="10" :disabled="mode == 'explain'" @updateTable="fileIsDel = true">
+                            <el-button type="primary" icon="upload" size="small"></el-button>
+                        </yhUpload>
+                    </el-form-item>
+                </el-col>
+            </el-row>
+
+            <el-row v-if="form.status == 'done'">
+                <el-col :span="12">
+                    <el-form-item label="是否已落地" prop="isLand">
+                        <el-radio-group v-model="form.isLand" @change="form.landAmount = null, form.partPersonArr = null">
+                            <el-radio v-for="(label, key) in whetherDic" :key="key" :label="label" :value="parseInt(key)"></el-radio>
+                        </el-radio-group>
+                    </el-form-item>
+                </el-col>
+                <template v-if="form.isLand == 1">
+                    <el-col :span="12">
+                        <el-form-item label="落地金额" prop="landAmount">
+                            <el-input-number v-model="form.landAmount" :min="0" :step="0.1" :precision="2" controls-position="right" placeholder="请输入落地金额"></el-input-number>
+                        </el-form-item>
+                    </el-col>
+                    <el-col :span="24">
+                        <el-form-item label="参与人" prop="partPerson">
+                            <el-input v-model="form.partPerson" type="textarea" :rows="4" placeholder="请输入参与人(以英文 , 分割)"></el-input>
+                        </el-form-item>
+                    </el-col>
+                </template>
+                <el-col :span="24">
+                    <el-form-item class="label-column-2" :label="titleMap['explain']" prop="monthSituation" label-width="80px">
+                        <el-input v-model="form.monthSituation" type="textarea" :rows="4" :placeholder="`请输入${titleMap['explain']}`"></el-input>
+                    </el-form-item>
+                </el-col>
+            </el-row>
+        </el-form>
+
+        <template #footer>
+            <template v-if="mode == 'explain'">
+                <el-button type="primary" @click="validateForm(mode)">保存上报</el-button>
+            </template>
+            <template v-if="mode == 'add' || mode == 'edit'">
+                <el-button type="primary" @click="validateForm(mode)">保 存</el-button>
+                <el-button type="primary" @click="validateForm('saveApprove')">直接上报</el-button>
+            </template>
+        </template>
+    </el-dialog>
+</template>
+
+<script>
+import Common from "@/api/common";
+import API from "@/api/policy/strive";
+import { useUserStore } from "@/store/user";
+import { levelDic, typeDic, whetherDic } from "@/views/policyShare/main";
+import yhUpload from "@/components/Upload/index.vue";
+
+const { userInfo } = useUserStore(); // store 用户
+
+export default {
+    emits: ["success", "closed"],
+    components: {
+        yhUpload
+    },
+
+    data() {
+        return {
+            levelDic, typeDic, whetherDic,
+
+            visible: false,
+            mode: "add",
+            titleMap: {
+                add: "新增",
+                edit: "编辑",
+                detail: "详情",
+                explain: "月度争取情况说明"
+            },
+            form: {
+                id: null,
+                businessNo: null,
+                status: null,
+                createId: userInfo.id,
+                createName: userInfo.name,
+                createTime: null,
+                name: null,
+                companyName: null,
+                deptName: null,
+                zcLevel: null,
+                zcType: null,
+                docNo: null,
+                contactPhone: null,
+                directorName: null,
+                yjFinishTime: null,
+                yjStriveAmount: null,
+                abstractContent: null,
+                isLand: 0,
+                landAmount: null,
+                partPersonArr: "[]", // [{name: }]
+                partPerson: null, // a1,a2
+                monthSituation: null,
+                fileList: []
+            },
+
+            rules: {
+                businessNo: [{ required: true }],
+                name: [{ required: true, message: "请输入政策名称" }],
+                zcLevel: [{ required: true, message: "请选择政策等级" }],
+                zcType: [{ required: true, message: "请选择政策类别" }],
+                docNo: [{ required: true, message: "请输入政策文号" }],
+                contactPhone: [{ required: true, message: "请输入联系方式" }],
+                directorName: [{ required: true, message: "请输入责任人" }],
+                yjFinishTime: [{ required: true, message: "请选择预计完成时间" }],
+                yjStriveAmount: [{ required: true, message: "请输入预计争取金额" }],
+                abstractContent: [{ required: true, message: "请输入政策概要" }],
+                isLand: [{ required: true }],
+                landAmount: [{ required: true, message: "请输入落地金额" }],
+                partPerson: [{ required: true, message: "请输入参与人(以英文 , 分割)" }],
+                monthSituation: [{ required: true, message: "请输入月度争取情况" }]
+            },
+
+            fileIsDel: false,
+            dialog: false
+        }
+    },
+
+    mounted() {
+        this.getUserDept();
+    },
+
+    methods: {
+        init(mode = "add") {
+            this.mode = mode;
+            this.visible = true;
+            return this;
+        },
+
+        setData(id) {
+            API.detail(id).then(res => {
+                if (res.code === 200) {
+                    for (const key in this.form) {
+                        if (key == "fileList") {
+                            this.form[key] = res.data[key].map(file => ({ ...file, name: file.originalName, path: file.fileDomain + "/" + file.fileName }));
+                        } else if (key == "isLand") this.form.isLand = !!res.data[key] && res.data[key] || 0;
+                        else this.form[key] = res.data[key] || null;
+                    }
+                    this.form.updateId = userInfo.id;
+                    this.form.partPerson = res.data["partPersonArr"] && JSON.parse(res.data["partPersonArr"]).map(item => item.name).join() || null;
+                } else ElMessage.error(res.msg);
+            });
+        },
+
+        getUserDept() {
+            Common.getUserDept(userInfo.deptId).then(res => {
+                if (res.code === 200) {
+                    this.form.companyName = res.data.companyName;
+                    this.form.deptName = res.data.deptName;
+                }
+            });
+        },
+
+        // 表单提交方法
+        validateForm(mode) {
+            this.$refs.formRef.validate(valid => {
+                if (valid) {
+                    this.submit(mode);
+                } else {
+                    return false;
+                }
+            });
+        },
+			
+        submit(mode) {
+            const partPersonArr = this.form.partPerson && JSON.stringify(this.form.partPerson.split(",").map(name => ({ name }))) || "";
+            API[mode]({ ...this.form, partPersonArr }).then(() => {
+                ElMessage.success("操作成功");
+                this.visible = false;
+                this.fileIsDel = false;
+                this.$emit("success", mode);
+            });
+        }
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+.no-upload-btn :deep(.yh-upload-file) {
+  .el-upload {
+    display: none;
+  }
+
+  .el-upload-list.is-disabled {
+    margin-top: 0;
+  }
+}
+
+.el-input-number {
+  width: 100%;
+
+  :deep(.el-input) .el-input__wrapper {
+    padding: 1px 11px;
+
+    .el-input__inner {
+      text-align: unset;
+    }
+  }
+}
+
+.label-column-2 :deep(.el-form-item__label) {
+  margin-left: 30px;
+}
+</style>

+ 204 - 0
src/views/policyStrive/index.vue

@@ -0,0 +1,204 @@
+<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-select v-model="params.zcLevel" clearable placeholder="请选择项目等级">
+                        <el-option v-for="item in levelDic" :key="item" :label="item" :value="item"></el-option>
+                    </el-select>
+                </el-form-item>
+                <el-form-item label="项目类别">
+                    <el-select v-model="params.zcType" clearable placeholder="请选择项目类别">
+                        <el-option v-for="item in typeDic" :key="item" :label="item" :value="item"></el-option>
+                    </el-select>
+                </el-form-item>
+                <el-form-item label="状态">
+                    <el-select v-model="params.status" clearable placeholder="请选择状态">
+                        <el-option v-for="(label, key) in statusDic" :key="key" :label="label" :value="key"></el-option>
+                    </el-select>
+                </el-form-item>
+                <el-form-item label="是否落地">
+                    <el-select v-model="params.isLand" clearable placeholder="请选择落地状态">
+                        <el-option v-for="(label, key) in whetherDic" :key="key" :label="label" :value="key"></el-option>
+                    </el-select>
+                </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="plus" @click="table_add">新增</el-button>
+            </div>
+            <div class="tjm_card_tools_right flex-row">
+                <table-import url="policyStrive" @success="reloadTable"></table-import>
+                <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>
+                <el-table-column type="index" width="50"></el-table-column>
+                <template v-for="(item, index) in columns" :key="index">
+                    <el-table-column :label="item.label" :prop="item.props" :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="230">
+                    <template #default="scope">
+                        <template v-if="scope.row.status == 'active' || scope.row.status == 'inactive'">
+                            <el-button type="primary" link icon="edit" @click="table_edit(scope.row)">修改</el-button>
+                            <el-button type="primary" link icon="upload" @click="table_update(scope.row)">提交</el-button>
+                            <el-button type="primary" link icon="delete" @click="table_del(scope.row)">删除</el-button>
+                        </template>
+                        <el-button v-if="scope.row.status == 'approve'" type="primary" link icon="refresh-right" @click="table_update(scope.row, 'withdraw')">撤回</el-button>
+                        <el-button v-if="scope.row.status == 'done'" type="primary" link icon="info-filled" @click="table_edit(scope.row, 'explain')">月度争取情况说明</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>
+
+    <policy-detail v-if="dialog" ref="policyDetail" @success="reloadTable" @closed="closed"></policy-detail>
+</template>
+
+<script>
+import API from "@/api/policy/strive"
+import { exportExcel } from "@/utils/exportExcel";
+import { levelDic, typeDic, whetherDic } from "@/views/policyShare/main";
+import { columns, statusDic } from "./main";
+
+import tableImport from "@/components/Upload/tableImport.vue";
+import yhPagination from "@/components/Pagination/index.vue";
+import policyDetail from "./dialog.vue";
+
+export default {
+    components: {
+        tableImport,
+        yhPagination,
+        policyDetail
+    },
+
+    data() {
+        return {
+            columns, levelDic, typeDic, statusDic, whetherDic,
+
+            loading: false,
+            createTime: [],
+            params: {
+                page: 1,
+                size: 10
+            },
+
+            total: 0,
+            tableData: [],
+
+            dialog: false
+        }
+    },
+
+    mounted() {
+        this.reloadTable();
+    },
+
+    methods: {
+        columnFormat(row, props) {
+            if (props == "status") return statusDic[row[props]] || "";
+            if (props == "isLand") return whetherDic[row[props]] || "";
+            return row[props];
+        },
+
+        reloadTable(mode = "add") {
+            if (mode == "add") this.params.page = 1;
+            this.params.beginCreateTime = this.createTime && this.createTime.length && this.createTime[0] + " 00:00:00" || null;
+            this.params.endCreateTime = this.createTime && this.createTime.length && this.createTime[1] + " 23:59:59" || null;
+
+            this.loading = true;
+            API.get(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);
+        },
+
+        reset() {
+            this.createTime = [];
+            for (const key in this.params) {
+                if (key == "page") this.params[key] = 1;
+                else if (key == "size") this.params[key] = 10;
+                else this.params[key] = null;
+            }
+            this.reloadTable();
+        },
+
+        table_add() {
+            this.dialog = true;
+            this.$nextTick(() => this.$refs.policyDetail.init());
+        },
+
+        table_edit(row, mode = "edit") {
+            this.dialog = true;
+            this.$nextTick(() => this.$refs.policyDetail.init(mode).setData(row.id));
+        },
+
+        table_del(row) {
+            ElMessageBox.confirm("是否确认删除?", "删除警告", {
+                type: "warning",
+                confirmButtonText: "确定",
+                cancelButtonText: "取消"
+            }).then(() => {
+                API.del({ ids: row.id }).then(res => {
+                    if (res.code == 200) {
+                        ElMessage.success("操作成功");
+                        this.reloadTable();
+                    } else ElMessage.warning(res.msg);
+                });
+            });
+        },
+
+        table_update(row, mode = "saveApprove") {
+            const msg = mode == "withdraw" && "撤回" || "提交";
+            ElMessageBox.confirm(`是否确认${msg}?`, "提示", {
+                type: "warning",
+                confirmButtonText: "确定",
+                cancelButtonText: "取消"
+            }).then(() => {
+                API[mode](row).then(res => {
+                    if (res.code === 200) {
+                        ElMessage.success("操作成功");
+                        this.reloadTable();
+                    } else ElMessage.error(res.msg);
+                });
+            });
+        },
+
+        closed(e) {
+            e && this.reloadTable();
+            this.dialog = false;
+        },
+
+        table_export() {
+            const header = columns.map(c => c.label);
+            const data = this.tableData.map(v => columns.map(c => c.props).map(j => this.columnFormat(v, j)));
+
+            exportExcel(header, data, [], `${this.$route.name}.xlsx`);
+        }
+    }
+}
+</script>

+ 25 - 0
src/views/policyStrive/main.js

@@ -0,0 +1,25 @@
+export const columns = [
+    { label: "政策编号", props: "businessNo" },
+    { label: "状态", props: "status", width: "100" },
+    { label: "是否落地", props: "isLand", width: "100" },
+    { label: "项目名称", props: "name" },
+    { label: "项目概要", props: "abstractContent" },
+    { label: "项目等级", props: "zcLevel", width: "100" },
+    { label: "项目类别", props: "zcType", width: "100" },
+    { label: "政策文号", props: "docNo" },
+    { label: "预计争取金额", props: "yjStriveAmount", width: "120" },
+    { label: "预计完成时间", props: "yjFinishTime", width: "120" },
+    { label: "责任人", props: "directorName" },
+    { label: "填报人", props: "createName" },
+    { label: "填报部门", props: "deptName" },
+    { label: "填报单位", props: "companyName" },
+    { label: "联系方式", props: "contactPhone" },
+    { label: "填报时间", props: "createTime" }
+];
+
+export const statusDic = {
+    active: "保存",
+    approve: "审核",
+    done: "争取中",
+    inactive: "退回"
+};

+ 3 - 15
src/views/system/menu.vue

@@ -170,21 +170,9 @@
                                         readonly
                                     >
                                         <template #prefix v-if="form.icon">
-                                            <el-icon
-                                                size="16"
-                                                class="el-input__icon"
-                                                v-if="form.icon.indexOf('ep') !== -1"
-                                            >
-                                                <component :is="form.icon.slice(2)" />
-                                            </el-icon>
-                                            <svg-icon
-                                                v-else-if="form.icon.indexOf('tjm') !== -1"
-                                                :icon-class="form.icon.slice(4)"
-                                                class="el-input__icon"
-                                                style="height: 16px; width: 16px"
-                                            />
-                                            <el-icon v-else style="height: 32px; width: 16px">
-                                                <search />
+                                            <el-icon size="16" class="el-input__icon">
+                                                <component v-if="form.icon.indexOf('ep') !== -1" :is="form.icon.slice(2)" />
+                                                <svg-icon v-if="form.icon.indexOf('tjm') !== -1" :icon-class="form.icon.slice(4)" />
                                             </el-icon>
                                         </template>
                                     </el-input>

+ 37 - 15
src/views/toDo/index.vue

@@ -26,17 +26,17 @@
         <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>
                 <el-table-column type="index" width="50"></el-table-column>
-                <el-table-column label="政策名称" prop="zcName" width="180"></el-table-column>
-                <el-table-column label="政策概要" prop="zcAbstractContent" width="180" show-overflow-tooltip></el-table-column>
-                <el-table-column label="政策类别" prop="zcType" width="100"></el-table-column>
-                <el-table-column label="填报人" prop="zcCreateName" width="180"></el-table-column>
-                <el-table-column label="填报单位" prop="zcCompanyName" width="180"></el-table-column>
-                <el-table-column label="联系方式" prop="zcContactPhone" width="180"></el-table-column>
-                <el-table-column label="填报时间" prop="zcCreateTime" width="180"></el-table-column>
-                <el-table-column label="操作" fixed="right" width="120">
+                <el-table-column label="政策名称" prop="zcName" min-width="180" show-overflow-tooltip></el-table-column>
+                <el-table-column label="政策概要" prop="zcAbstractContent" min-width="180" show-overflow-tooltip></el-table-column>
+                <el-table-column label="政策类别" prop="zcType" min-width="100" show-overflow-tooltip></el-table-column>
+                <el-table-column label="填报人" prop="zcCreateName" min-width="180" show-overflow-tooltip></el-table-column>
+                <el-table-column label="填报单位" prop="zcCompanyName" min-width="180" show-overflow-tooltip></el-table-column>
+                <el-table-column label="联系方式" prop="zcContactPhone" width="180" show-overflow-tooltip></el-table-column>
+                <el-table-column label="填报时间" prop="zcCreateTime" width="180" show-overflow-tooltip></el-table-column>
+                <el-table-column label="操作" fixed="right" width="160">
                     <template #default="scope">
-                        <el-button type="primary" link @click="table_detail(scope.row)">通过</el-button>
-                        <el-button type="primary" link @click="table_detail(scope.row, 'disagree')">退回</el-button>
+                        <el-button type="primary" link icon="check" @click="table_detail(scope.row)">通过</el-button>
+                        <el-button type="primary" link icon="close" @click="table_detail(scope.row, 'refuse')">退回</el-button>
                     </template>
                 </el-table-column>
             </el-table>
@@ -51,14 +51,18 @@
 
 <script>
 import API from "@/api/policy/todo"
+import Strive from "@/api/policy/strive"
+import { useUserStore } from "@/store/user";
 import { typeDic } from "@/views/policyShare/main";
 import yhPagination from "@/components/Pagination/index.vue";
-import PolicyShareDetail from "@/views/policyShare/dialog.vue";
+import policyShareDetail from "@/views/policyShare/dialog.vue";
+
+const { userInfo } = useUserStore(); // store 用户
 
 export default {
     components: {
         yhPagination,
-        PolicyShareDetail
+        policyShareDetail
     },
 
     data() {
@@ -69,7 +73,8 @@ export default {
             createTime: [],
             params: {
                 page: 1,
-                size: 10
+                size: 10,
+                todoUserId: userInfo.id
             },
 
             total: 0,
@@ -109,8 +114,25 @@ export default {
         },
     
         table_detail({ refId, refType }, mode = "agree") {
-            this.dialog = true;
-            this.$nextTick(() => this.$refs[refType].init(mode).setData(refId));
+            if (refType == "policy_share") {
+                this.dialog = true;
+                this.$nextTick(() => this.$refs[refType].init(mode).setData(refId));
+            }
+            if (refType == "policy_strive") {
+                const msg = mode == "agree" && "同意" || "退回";
+                ElMessageBox.confirm(`是否确认${msg}?`, "提示", {
+                    type: "warning",
+                    confirmButtonText: "确定",
+                    cancelButtonText: "取消"
+                }).then(() => {
+                    Strive[mode]({ id: refId, updateId: userInfo.id }).then(res => {
+                        if (res.code === 200) {
+                            ElMessage.success("操作成功");
+                            this.reloadTable();
+                        } else ElMessage.error(res.msg);
+                    });
+                });
+            }
         }
     }
 }