소스 검색

审批流

zhuangyunsheng 1 년 전
부모
커밋
bcb2beabb4

+ 2 - 2
.env.development

@@ -11,11 +11,11 @@ VITE_BASE_URL = "/dev-api"
 VITE_BASE_MOCK_URL = "/mock-api"
 
 # boot服务端接口路径
-# VITE_BASE_SERVER_URL = "http://192.168.101.93:8000"
+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.206.20.153:8000" # 青岛港-内网
 # 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.133:8000" # 青岛港-7楼
 # 微前端-工作流
 VITE_WORKFLOW_URL = "http://localhost:1888/"
 # 微前端-代码生成器

+ 1 - 0
package.json

@@ -33,6 +33,7 @@
         "@iconify-json/fluent-emoji-high-contrast": "^1.2.1",
         "@iconify-json/mdi": "^1.1.54",
         "@iconify-json/tabler": "^1.2.5",
+        "@iconify-json/uis": "^1.2.1",
         "@rushstack/eslint-patch": "^1.3.3",
         "@vitejs/plugin-vue": "^4.3.4",
         "@vue/eslint-config-prettier": "^8.0.0",

+ 1 - 1
src/api/folder.js

@@ -51,7 +51,7 @@ export default {
 
     import: function (url, excelUrl) { // 导入
         return request({
-            url: `qdport-zcgx/import/${url}`,
+            url: `/qdport-zcgx/import/${url}`,
             method: "post",
             data: {
                 excelUrl

+ 12 - 5
src/api/policy/case.js

@@ -22,11 +22,7 @@ export default {
         return request({
             url: "/qdport-zcgx/case/save",
             method: "post",
-            data: {
-                ...data,
-                createId: userInfo.id,
-                createName: userInfo.name
-            }
+            data
         })
     },
 
@@ -94,5 +90,16 @@ export default {
                 updateId: userInfo.id
             }
         })
+    },
+
+    resubmit: function (data) { // 退回
+        return request({
+            url: "/qdport-zcgx/case/resubmit",
+            method: "post",
+            data: {
+                ...data,
+                updateId: userInfo.id
+            }
+        })
     }
 }

+ 11 - 0
src/api/policy/share.js

@@ -101,5 +101,16 @@ export default {
                 updateId: userInfo.id
             }
         })
+    },
+
+    resubmit: function (data) { // 重新发起
+        return request({
+            url: "/qdport-zcgx/share/resubmit",
+            method: "post",
+            data: {
+                ...data,
+                updateId: userInfo.id
+            }
+        })
     }
 }

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

@@ -109,5 +109,16 @@ export default {
                 updateId: userInfo.id
             }
         })
+    },
+
+    resubmit: function (data) { // 退回
+        return request({
+            url: "/qdport-zcgx/strive/resubmit",
+            method: "post",
+            data: {
+                ...data,
+                updateId: userInfo.id
+            }
+        })
     }
 }

+ 54 - 0
src/api/workflow.js

@@ -0,0 +1,54 @@
+import request from "@/utils/request"
+
+// 审批流详情
+export default {
+    detail: function (taskId, processInsId) {
+        return new Promise((resolve, reject) => {
+            request({
+                url: "/qdport-workflow/process/detail",
+                method: "get",
+                params: {
+                    taskId,
+                    processInsId
+                }
+            }).then(res => {
+                if (res.code == 200) {
+                    const { flow, process } = res.data;
+                    let flows = [];
+                    flow.forEach(item => {
+                        item.class = (!item.endTime && item.historyActivityType !== "candidate") ? "finish" : "";
+                        if (item.historyActivityType === "sequenceFlow") item.class = "lineWarn";
+                        else if (!item.class && item.historyActivityType !== "candidate") item.class = "success";
+
+                        if (item.comments && item.comments.find(c => c.action == "AddComment")) {
+                            const { type, fullMessage } = item.comments.find(c => c.action == "AddComment");
+                            if (type == "rollbackComment") {
+                                item.class = "error";
+                                item.desc = "驳回:" + fullMessage;
+                            }
+                            if (type == "comment") {
+                                item.class = "success";
+                                item.desc = "审批:" + fullMessage;
+                            }
+                        }
+
+                        const index = flows.findIndex(f => f.historyActivityId === item.historyActivityId)
+                        if (index !== -1) flows.splice(index, 1, item);
+                        else flows.push(item);
+                    });
+                    flows = flows.filter(f => f.class != "lineWarn");
+
+                    if (flows[flows.length - 1].historyActivityType != "endEvent") {
+                        flows.push({
+                            class: "",
+                            historyActivityId: "Event_04wbnmn",
+                            historyActivityType: "endEvent"
+                        })
+                    }
+
+                    resolve({ process, flows });
+                } else ElMessage.error(res.msg);
+            }).catch(() => reject())
+        })
+    }
+}

+ 86 - 0
src/components/Workflow/index.vue

@@ -0,0 +1,86 @@
+<template>
+    <div class="yh-workflow-dialog">
+        <el-dialog v-model="visible" title="审批流程" width="70%" @closed="$emit('closed')">
+            <div v-loading="loading" style="flex: 1;">
+                <el-empty v-if="!steps || !steps.length"></el-empty>
+                <el-steps v-else :active="active" finish-status="success">
+                    <el-step v-for="item in steps" :key="item.historyActivityId" :title="item.historyActivityName" icon="UserFilled" :status="item.class">
+                        <template v-if="item.historyActivityType == 'startEvent' || item.historyActivityType == 'endEvent'" #icon>
+                            <el-icon size="25"><tjm-icon-mdi-circle-outline></tjm-icon-mdi-circle-outline></el-icon>
+                        </template>
+                        <template v-if="item.assigneeName" #description>
+                            <el-text class="title" truncated>{{ item.assigneeName }}</el-text>
+                            <div class="time">{{ item.createTime }}</div>
+                            <el-text v-if="item.desc" class="title"  truncated>{{ item.desc }}</el-text>
+                        </template>
+                    </el-step>
+                </el-steps>
+            </div>
+        </el-dialog>
+    </div>
+</template>
+
+<script>
+    import API from "@/api/workflow";
+
+	export default {
+		data() {
+			return {
+                visible: true,
+                loading: false,
+
+                active: 0,
+                steps: []
+            }
+		},
+
+		methods: {
+            getDetail({ processTaskId, processInstanceId }) {
+                if (processTaskId && processInstanceId) {
+                    this.loading = true;
+                    API.detail(processTaskId, processInstanceId).then(res => {
+                        this.loading = false;
+                        this.steps = res.flows.slice() || [];
+                        this.active = res.flows.findIndex(f => f.class == "process") + 1;
+                    }).catch(() => this.loading = false);
+                }
+            }
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+.yh-workflow-dialog :deep(.el-dialog) {
+  position: absolute;
+  top: 40%;
+  left: 50%;
+  transform: translate(-50%, -40%);
+  max-height: calc(100% - 30px);
+  max-width: calc(100% - 30px);
+  margin: 0 !important;
+
+  .el-dialog__body {
+    height: 60vh;
+    padding: 0 20px;
+    display: flex;
+    align-items: center;
+
+    .el-steps .el-step {
+      max-width: 220px;
+
+      .el-step__main {
+        white-space: nowrap;
+
+        .el-step__description {
+          color: var(--el-text-color-primary);
+
+          .title {
+            font-size: inherit;
+            color: inherit;
+          }
+        }
+      }
+    }
+  }
+}
+</style>

+ 1 - 0
src/micro/index.vue

@@ -28,6 +28,7 @@ const router = useRouter()
 const loading = ref(true)
 function created() {
     console.log("micro-app元素被创建")
+    microApp.unmountApp("my-app")
 }
 function beforemount() {
     console.log("即将被渲染")

+ 4 - 3
src/store/permission.js

@@ -41,9 +41,10 @@ export const usePermissionStore = defineStore(
 )
 // 
 function filterAsyncRouter(asyncRouterMap, httpSave = true) {
-    const blackList = ["/workflow", "/system/dataList", "/system/template",
-        "/publicDomain", "/manage/policyStrive", "/policyStrive",
-        "/caseShare"
+    const blackList = [
+        // "/workflow", "/system/dataList", "/system/template",
+        // "/publicDomain", "/manage/policyStrive", "/policyStrive",
+        // "/caseShare"
     ]
 
     let arr = []

+ 15 - 10
src/views/caseShare/dialog.vue

@@ -75,17 +75,19 @@
 
         <template #footer>
             <template v-if="mode == 'add' || mode == 'edit'">
-                <el-button type="primary" @click="submit(mode)">保 存</el-button>
-                <el-button type="primary" @click="submit('saveApprove')">直接上报</el-button>
+                <el-button :loading="isSaving" type="primary" @click="submit(mode)">保 存</el-button>
+                <el-button :loading="isSaving" type="primary" @click="submit('saveApprove')">直接上报</el-button>
             </template>
         </template>
     </el-dialog>
 
-    <strive-select v-if="dialog" ref="striveSelect" @selected="striveChange" @closed="dialog = false"></strive-select>
+    <strive-select v-if="dialog" ref="striveSelect" :striveId="form.striveId" @selected="striveChange" @closed="dialog = false"></strive-select>
 </template>
 
 <script>
 import API from "@/api/policy/case";
+import { useUserStore } from "@/store/user";
+
 import yhUpload from "@/components/Upload/index.vue";
 import striveSelect from "./strive.vue";
 
@@ -93,17 +95,18 @@ export default {
     emits: ["success", "closed"],
     
     components: {
-        striveSelect,
-        yhUpload
+        yhUpload,
+        striveSelect
     },
 
     data() {
         return {
             visible: false,
+            isSaving: false,
             mode: "add",
             titleMap: {
                 add: "新增",
-                edit: "编辑",
+                edit: "修改",
                 detail: "详情"
             },
 
@@ -125,8 +128,8 @@ export default {
                 },
                 businessNo: null,
                 status: null,
-                createId: null,
-                createName: null,
+                createId: useUserStore().userInfo.id,
+                createName: useUserStore().userInfo.name,
                 createTime: null,
                 expContent: null
             },
@@ -166,7 +169,7 @@ export default {
         showStrive() {
             if (this.mode == "add") {
                 this.dialog = true;
-                this.$nextTick(() => this.$refs.striveSelect.open().setData(this.form.policyStrive));
+                this.$nextTick(() => this.$refs.striveSelect.open().reloadTable());
             }
         },
 
@@ -183,13 +186,15 @@ export default {
         submit(mode) {
             this.$refs.formRef.validate(valid => {
                 if (valid) {
+                    this.isSaving = true;
                     API[mode](this.form).then(res => {
+                        this.isSaving = false;
                         if (res.code === 200) {
                             ElMessage.success("操作成功");
                             this.visible = false;
                             this.$emit("success", mode);
                         } else ElMessage.error(res.msg);
-                    });
+                    }).catch(() => this.isSaving = false);
                 } else {
                     return false;
                 }

+ 54 - 13
src/views/caseShare/index.vue

@@ -45,22 +45,37 @@
             </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_edit($event, 'detail')">
+            <el-table v-loading="loading" row-key="id" header-cell-class-name="tjm_card_table_header" height="400" :data="tableData" border @row-click="(row, column) => !column.fixed && table_detail(row)">
                 <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" :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">
+                <el-table-column label="操作" fixed="right" width="280">
                     <template #default="scope">
                         <template v-if="scope.row.status == 'active' || scope.row.status == 'inactive'">
-                            <el-button type="primary" link icon="edit" @click.stop="table_edit(scope.row)">编辑</el-button>
-                            <el-button type="primary" link icon="upload" @click.stop="table_edit(scope.row)">上报</el-button>
+                            <template v-if="scope.row.status == 'active'">
+                                <el-button type="primary" link icon="edit" @click.stop="table_edit(scope.row)">修改</el-button>
+                                <el-button type="primary" link icon="upload" @click.stop="table_edit(scope.row)">上报</el-button>
+                            </template>
+                            <template v-if="scope.row.status == 'inactive'">
+                                <el-button type="primary" link icon="tickets" @click.stop="table_edit(scope.row)">重新上报</el-button>
+                                <el-button v-if="scope.row.processTaskId && scope.row.processInstanceId" type="primary" link @click.stop="table_process(scope.row)">
+                                    <template #icon><tjm-icon-uis-process /></template>
+                                    审批流程
+                                </el-button>
+                            </template>
                             <el-button type="primary" link icon="delete" @click.stop="table_del(scope.row)">删除</el-button>
                         </template>
-                        <el-button v-if="scope.row.status == 'approve' || scope.row.status == 'done'" type="primary" link icon="tickets" @click.stop="table_edit(scope.row, 'detail')">详情</el-button>
-                        <el-button v-if="scope.row.status == 'approve'" type="primary" link icon="refresh-right" @click.stop="table_withdraw(scope.row)">撤回</el-button>
+                        <template v-if="scope.row.status == 'approve' || scope.row.status == 'done'">
+                            <el-button type="primary" link icon="tickets" @click.stop="table_detail(scope.row)">详情</el-button>
+                            <el-button v-if="scope.row.processTaskId && scope.row.processInstanceId" type="primary" link @click.stop="table_process(scope.row)">
+                                <template #icon><tjm-icon-uis-process /></template>
+                                审批流程
+                            </el-button>
+                        </template>
+                        <el-button v-if="scope.row.status == 'approve' && scope.row.isWithdraw == 1" type="primary" link icon="refresh-right" @click.stop="table_withdraw(scope.row)">撤回</el-button>
                     </template>
                 </el-table-column>
             </el-table>
@@ -70,7 +85,9 @@
         </div>
     </el-card>
 
-    <case-share-detail v-if="dialog" ref="caseShareDetail" @success="reloadTable" @closed="dialog = false"></case-share-detail>
+    <case-share-detail v-if="dialog.detail" ref="caseShareDetail" @success="reloadTable" @closed="dialog.detail = false"></case-share-detail>
+    <policy-process-dialog v-if="dialog.process" ref="processDialog" @success="reloadTable" @closed="dialog.process = false"></policy-process-dialog>
+    <yh-workflow v-if="dialog.workflow" ref="yhWorkflow" @closed="dialog.workflow = false"></yh-workflow>
 </template>
 
 <script>
@@ -80,12 +97,16 @@ import { levelDic, typeDic } from "@/views/policyShare/main";
 import { columns, statusDic } from "./main";
 
 import yhPagination from "@/components/Pagination/index.vue";
+import yhWorkflow from "@/components/Workflow/index.vue";
 import caseShareDetail from "./dialog.vue";
+import policyProcessDialog from "@/views/toDo/case.vue";
 
 export default {
     components: {
         yhPagination,
-        caseShareDetail
+        yhWorkflow,
+        caseShareDetail,
+        policyProcessDialog
     },
 
     data() {
@@ -102,7 +123,11 @@ export default {
             total: 0,
             tableData: [],
 
-            dialog: false
+            dialog: {
+                detail: false,
+                process: false,
+                workflow: false
+            }
         }
     },
 
@@ -150,13 +175,24 @@ export default {
         },
 
         table_add() {
-            this.dialog = true;
+            this.dialog.detail = true;
             this.$nextTick(() => this.$refs.caseShareDetail.open());
         },
 
-        table_edit(row, mode = "edit") {
-            this.dialog = true;
-            this.$nextTick(() => this.$refs.caseShareDetail.open(mode).setData(row.id));
+        table_edit(row) {
+            if (row.status == "inactive") {
+                this.dialog.process = true;
+                this.$nextTick(() => this.$refs.processDialog.open("resubmit").setData(row.id));
+            }
+            if (row.status == "active") {
+                this.dialog.detail = true;
+                this.$nextTick(() => this.$refs.caseShareDetail.open("edit").setData(row.id));
+            }
+        },
+
+        table_detail(row) {
+            this.dialog.detail = true;
+            this.$nextTick(() => this.$refs.caseShareDetail.open("detail").setData(row.id));
         },
 
         table_del(row) {
@@ -187,6 +223,11 @@ export default {
                     } else ElMessage.error(res.msg);
                 });
             });
+        },
+
+        table_process(row) {
+            this.dialog.workflow = true;
+            this.$nextTick(() => this.$refs.yhWorkflow.getDetail(row));
         }
     }
 }

+ 10 - 6
src/views/caseShare/strive.vue

@@ -1,5 +1,5 @@
 <template>
-    <el-dialog v-model="visible" title="政策关联" width="80%" @closed="$emit('closed')">
+    <el-dialog v-model="visible" title="政策关联" width="80%" top="5vh" @closed="$emit('closed')">
         <el-card class="tjm_card_style_custom" shadow="never">
             <div class="tjm_card_select">
                 <el-form class="tjm_card_select_left" :model="params" inline label-width="80px" label-position="left">
@@ -37,7 +37,7 @@
             <el-divider></el-divider>
 
             <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 @select="select">
+                <el-table v-loading="loading" ref="selectStrive" row-key="id" header-cell-class-name="tjm_card_table_header" height="400" :data="tableData" border @select="select" @row-click="(row, column) => !column.fixed && column.type != 'selection' && table_detail(row)">
                     <el-table-column type="selection" align="center" width="55" :selectable="selectable"></el-table-column>
                     <el-table-column type="index" label="序号" width="55"></el-table-column>
                     <template v-for="(item, index) in link_columns" :key="index">
@@ -76,6 +76,9 @@ import policyStriveDetail from "@/views/policyStrive/explain.vue";
 
 export default {
     emits: ["closed"],
+    props: {
+        striveId: null
+    },
     
     components: {
         yhPagination,
@@ -113,10 +116,6 @@ export default {
             return this;
         },
 
-        setData(data) {
-            this.reloadTable();
-        },
-
         columnFormat(row, props) {
             if (props == "status") return statusDic[row.isLand] || "";
             if (props == "landAmount") return row.isLand == 1 && row[props] || "";
@@ -133,6 +132,11 @@ export default {
                 if (res.code === 200) {
                     this.tableData = res.data.records;
                     this.total = res.data.total;
+
+                    if (this.striveId) { // 回显
+                        this.$nextTick(() => this.$refs.selectStrive.toggleRowSelection(res.data.records.find(r => r.id == this.striveId)))
+                        this.selectData = Object.assign({}, res.data.records.find(r => r.id == this.striveId));
+                    }
                 } else ElMessage.error(res.msg);
             }).catch(() => this.loading = false);
         },

+ 30 - 24
src/views/manage/policyShare/dialog.vue

@@ -56,27 +56,30 @@
                         <el-input v-model="form.contactPhone" placeholder="请输入联系方式"></el-input>
                     </el-form-item>
                 </el-col>
-                <el-col :span="12">
-                    <el-form-item label="是否入库" prop="isInWh">
-                        <template v-if="mode == 'decode'">{{ whetherDic[form.isInWh] }}</template>
-                        <el-radio-group v-else v-model="form.isInWh" @change="form.inWhType = 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>
-                <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="false" placeholder="请输入分值"></el-input-number>
-                    </el-form-item>
-                </el-col>
-                <el-col v-if="form.isInWh == 1" :span="12">
-                    <el-form-item label="入库类型" prop="inWhType">
-                        <template v-if="mode == 'decode'">{{ form.inWhType }}</template>
-                        <el-select v-else v-model="form.inWhType" placeholder="请选择入库类型">
-                            <el-option v-for="item in storageTypeDic" :key="item" :label="item" :value="item"></el-option>
-                        </el-select>
-                    </el-form-item>
-                </el-col>
+                <template v-if="!form.status || form.status == 'done'">
+                    <el-col :span="12">
+                        <el-form-item label="是否入库" prop="isInWh">
+                            <template v-if="mode == 'decode'">{{ whetherDic[form.isInWh] }}</template>
+                            <el-radio-group v-else v-model="form.isInWh" @change="form.inWhType = 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>
+                    <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="false" placeholder="请输入分值"></el-input-number>
+                        </el-form-item>
+                    </el-col>
+                    <el-col v-if="form.isInWh == 1" :span="12">
+                        <el-form-item label="入库类型" prop="inWhType">
+                            <template v-if="mode == 'decode'">{{ form.inWhType }}</template>
+                            <el-select v-else v-model="form.inWhType" placeholder="请选择入库类型">
+                                <el-option v-for="item in storageTypeDic" :key="item" :label="item" :value="item"></el-option>
+                            </el-select>
+                        </el-form-item>
+                    </el-col>
+                </template>
+
                 <el-col :span="24">
                     <el-form-item label="政策概要" prop="abstractContent">
                         <el-input v-model="form.abstractContent" type="textarea" :rows="4" placeholder="请输入政策概要"></el-input>
@@ -101,7 +104,7 @@
 
         <template #footer>
             <template v-if="mode != 'detail'">
-                <el-button type="primary" :disabled="isUpload" @click="submit(mode == 'decode' && 'edit' || mode)">确 定</el-button>
+                <el-button :loading="isSaving" type="primary" :disabled="isUpload" @click="submit(mode == 'decode' && 'edit' || mode)">确 定</el-button>
             </template>
         </template>
     </el-dialog>
@@ -129,10 +132,11 @@ export default {
             isUpload: false,
 
             visible: false,
+            isSaving: false,
             mode: "saveDone",
             titleMap: {
                 saveDone: "新增",
-                edit: "编辑",
+                edit: "修改",
                 detail: "详情",
                 decode: "添加解读"
             },
@@ -212,14 +216,16 @@ export default {
         submit(mode) {
             this.$refs.formRef.validate(valid => {
                 if (valid) {
+                    this.isSaving = true;
                     API[mode](this.form).then(res => {
+                        this.isSaving = false;
                         if (res.code === 200) {
                             ElMessage.success("操作成功");
                             this.visible = false;
                             this.fileIsDel = false;
                             this.$emit("success", mode);
                         } else ElMessage.error(res.msg);
-                    });
+                    }).catch(() => this.isSaving = false);
                 } else {
                     return false;
                 }

+ 31 - 10
src/views/manage/policyShare/index.vue

@@ -50,21 +50,25 @@
             </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_edit($event, 'detail')">
+            <el-table v-loading="loading" row-key="id" header-cell-class-name="tjm_card_table_header" height="400" :data="tableData" border @row-click="(row, column) => !column.fixed && table_edit(row, '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" :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="240">
+                <el-table-column label="操作" fixed="right" width="210">
                     <template #default="scope">
                         <el-button type="primary" link icon="edit" @click.stop="table_edit(scope.row)">修改</el-button>
-                        <el-button v-if="scope.row.isInWh == 1 && scope.row.inWhType == '文件类'" type="primary" link @click.stop="table_edit(scope.row, 'decode')">
+                        <el-button type="primary" link icon="delete" @click.stop="table_del(scope.row)">删除</el-button>
+                        <el-button v-if="scope.row.isInWh == 1 && scope.row.inWhType == '文件类'" class="no-m-l" type="primary" link @click.stop="table_edit(scope.row, 'decode')">
                             <template #icon><tjm-icon-fluent-emoji-high-contrast-open-book /></template>
                             添加解读
                         </el-button>
-                        <el-button type="primary" link icon="delete" @click.stop="table_del(scope.row)">删除</el-button>
+                        <el-button v-if="scope.row.processTaskId && scope.row.processInstanceId" type="primary" link @click.stop="table_process(scope.row)">
+                            <template #icon><tjm-icon-uis-process /></template>
+                            审批流程
+                        </el-button>
                     </template>
                 </el-table-column>
             </el-table>
@@ -74,7 +78,8 @@
         </div>
     </el-card>
 
-    <policy-detail v-if="dialog" ref="policyDetail" @success="reloadTable" @closed="closed"></policy-detail>
+    <policy-detail v-if="dialog.detail" ref="policyDetail" @success="reloadTable" @closed="closed"></policy-detail>
+    <yh-workflow v-if="dialog.workflow" ref="yhWorkflow" @closed="dialog.workflow = false"></yh-workflow>
 </template>
 
 <script>
@@ -84,11 +89,13 @@ import { levelDic, typeDic, storageTypeDic, whetherDic } from "@/views/policySha
 import { columns } from "./main";
 
 import yhPagination from "@/components/Pagination/index.vue";
+import yhWorkflow from "@/components/Workflow/index.vue";
 import policyDetail from "./dialog.vue";
 
 export default {
     components: {
         yhPagination,
+        yhWorkflow,
         policyDetail
     },
 
@@ -108,7 +115,10 @@ export default {
             total: 0,
             tableData: [],
 
-            dialog: false
+            dialog: {
+                detail: false,
+                workflow: false
+            }
         }
     },
 
@@ -156,12 +166,12 @@ export default {
         },
 
         table_add() {
-            this.dialog = true;
+            this.dialog.detail = true;
             this.$nextTick(() => this.$refs.policyDetail.open());
         },
 
         table_edit(row, mode = "edit") {
-            this.dialog = true;
+            this.dialog.detail = true;
             this.$nextTick(() => this.$refs.policyDetail.open(mode).setData(row.id));
         },
 
@@ -182,8 +192,19 @@ export default {
 
         closed(e) {
             e && this.reloadTable();
-            this.dialog = false;
+            this.dialog.detail = false;
+        },
+
+        table_process(row) {
+            this.dialog.workflow = true;
+            this.$nextTick(() => this.$refs.yhWorkflow.getDetail(row));
         }
     }
 }
-</script>
+</script>
+
+<style scoped>
+.no-m-l {
+  margin-left: 0;
+}
+</style>

+ 20 - 3
src/views/manage/policyStrive/index.vue

@@ -42,7 +42,7 @@
             </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 v-loading="loading" row-key="id" header-cell-class-name="tjm_card_table_header" height="400" :data="tableData" border @row-click="(row, column) => !column.fixed && table_detail(row)">
                 <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" :width="item.width || 180" show-overflow-tooltip>
@@ -52,8 +52,12 @@
                 <el-table-column label="操作" fixed="right" width="240">
                     <template #default="scope">
                         <el-button type="primary" link icon="tickets" @click.stop="table_detail(scope.row)">详情</el-button>
+                        <el-button v-if="scope.row.processTaskId && scope.row.processInstanceId" type="primary" link @click.stop="table_process(scope.row)">
+                            <template #icon><tjm-icon-uis-process /></template>
+                            审批流程
+                        </el-button>
                         <el-button v-if="scope.row.isReward == 0 && scope.row.isLand == 1 && scope.row.rewardRadix" type="primary" link icon="star" @click.stop="table_score(scope.row)">打分</el-button>
-                        <el-button v-if="scope.row.rewardScore" type="primary" link @click.stop="table_reward(scope.row)">
+                        <el-button v-if="scope.row.rewardScore" class="no-m-l" type="primary" link @click.stop="table_reward(scope.row)">
                             <template #icon><tjm-icon-tabler-arrows-split-2 /></template>
                             奖励分配
                         </el-button>
@@ -69,6 +73,7 @@
     <policy-strive-detail v-if="dialog.detail" ref="policyStriveDetail" @success="reloadTable" @closed="dialog.detail = false"></policy-strive-detail>
     <policy-strive-score v-if="dialog.score" ref="policyStriveScore" @success="reloadTable" @closed="dialog.score = false"></policy-strive-score>
     <policy-strive-reward v-if="dialog.reward" ref="policyStriveReward" @success="reloadTable" @closed="dialog.reward = false"></policy-strive-reward>
+    <yh-workflow v-if="dialog.workflow" ref="yhWorkflow" @closed="dialog.workflow = false"></yh-workflow>
 </template>
 
 <script>
@@ -78,6 +83,7 @@ import { levelDic, typeDic } from "@/views/policyShare/main";
 import { columns, statusDic } from "./main";
 
 import yhPagination from "@/components/Pagination/index.vue";
+import yhWorkflow from "@/components/Workflow/index.vue";
 import policyStriveDetail from "@/views/policyStrive/explain.vue";
 import policyStriveScore from "./scoreDialog.vue";
 import policyStriveReward from "./rewardDialog.vue";
@@ -85,6 +91,7 @@ import policyStriveReward from "./rewardDialog.vue";
 export default {
     components: {
         yhPagination,
+        yhWorkflow,
         policyStriveDetail,
         policyStriveScore,
         policyStriveReward
@@ -108,7 +115,8 @@ export default {
             dialog: {
                 detail: false,
                 score: false,
-                reward: false
+                reward: false,
+                workflow: false
             }
         }
     },
@@ -168,6 +176,11 @@ export default {
         table_reward(row) {
             this.dialog.reward = true;
             this.$nextTick(() => this.$refs.policyStriveReward.open().setData(row));
+        },
+
+        table_process(row) {
+            this.dialog.workflow = true;
+            this.$nextTick(() => this.$refs.yhWorkflow.getDetail(row));
         }
     }
 }
@@ -177,4 +190,8 @@ export default {
 .tjm_card_style_custom .tjm_card_tools {
   justify-content: flex-end;
 }
+
+.no-m-l {
+  margin-left: 0;
+}
 </style>

+ 5 - 2
src/views/manage/policyStrive/rewardDialog.vue

@@ -24,7 +24,7 @@
         </el-form>
 
         <template #footer>
-            <el-button type="primary" @click="submit">确 定</el-button>
+            <el-button :loading="isSaving" type="primary" @click="submit">确 定</el-button>
         </template>
     </el-dialog>
 </template>
@@ -41,6 +41,7 @@ export default {
     data() {
         return {
             visible: false,
+            isSaving: false,
 
             form: {
                 id: null,
@@ -78,13 +79,15 @@ export default {
         submit() {
             this.$refs.formRef.validate(valid => {
                 if (valid) {
+                    this.isSaving = true;
                     API.updateById({ ...this.form, isReward: 1, partPersonArr: JSON.stringify(this.form.partPerson) }).then(res => {
+                        this.isSaving = false;
                         if (res.code === 200) {
                             ElMessage.success("操作成功");
                             this.visible = false;
                             this.$emit("success");
                         } else ElMessage.error(res.msg);
-                    });
+                    }).catch(() => this.isSaving = false);
                 } else {
                     return false;
                 }

+ 10 - 5
src/views/manage/policyStrive/scoreDialog.vue

@@ -36,7 +36,7 @@
         </el-form>
 
         <template #footer>
-            <el-button type="primary" @click="submit">确 定</el-button>
+            <el-button :loading="isSaving" type="primary" @click="submit">确 定</el-button>
         </template>
     </el-dialog>
 </template>
@@ -53,6 +53,7 @@ export default {
     data() {
         return {
             visible: false,
+            isSaving: false,
 
             form: {
                 id: null,
@@ -102,11 +103,15 @@ export default {
         submit() {
             this.$refs.formRef.validate(valid => {
                 if (valid) {
+                    this.isSaving = true;
                     API.updateById({ ...this.form }).then(res => {
-                        ElMessage.success("操作成功");
-                        this.visible = false;
-                        this.$emit("success");
-                    });
+                        this.isSaving = false;
+                        if (res.code === 200) {
+                            ElMessage.success("操作成功");
+                            this.visible = false;
+                            this.$emit("success");
+                        } else ElMessage.error(res.msg);
+                    }).catch(() => this.isSaving = false);
                 } else {
                     return false;
                 }

+ 7 - 4
src/views/policyShare/dialog.vue

@@ -72,8 +72,8 @@
         </el-form>
 
         <template #footer>
-            <el-button type="primary" :disabled="isUpload" @click="submit(mode)">保 存</el-button>
-            <el-button type="primary" :disabled="isUpload" @click="submit('saveApprove')">直接上报</el-button>
+            <el-button :loading="isSaving" type="primary" :disabled="isUpload" @click="submit(mode)">保 存</el-button>
+            <el-button :loading="isSaving" type="primary" :disabled="isUpload" @click="submit('saveApprove')">直接上报</el-button>
         </template>
     </el-dialog>
 </template>
@@ -100,10 +100,11 @@ export default {
             isUpload: false,
 
             visible: false,
+            isSaving: false,
             mode: "add",
             titleMap: {
                 add: "新增",
-                edit: "编辑"
+                edit: "修改"
             },
             form: {
                 id: null,
@@ -172,14 +173,16 @@ export default {
         submit(mode) {
             this.$refs.formRef.validate(valid => {
                 if (valid) {
+                    this.isSaving = true;
                     API[mode](this.form).then(res => {
+                        this.isSaving = false;
                         if (res.code === 200) {
                             ElMessage.success("操作成功");
                             this.visible = false;
                             this.fileIsDel = false;
                             this.$emit("success", mode);
                         } else ElMessage.error(res.msg);
-                    });
+                    }).catch(() => this.isSaving = false);
                 } else {
                     return false;
                 }

+ 54 - 17
src/views/policyShare/index.vue

@@ -56,22 +56,37 @@
             </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 v-loading="loading" row-key="id" header-cell-class-name="tjm_card_table_header" height="400" :data="tableData" border @row-click="(row, column) => !column.fixed && table_detail(row)">
                 <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" :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="220">
+                <el-table-column label="操作" fixed="right" width="280">
                     <template #default="scope">
                         <template v-if="scope.row.status == 'active' || scope.row.status == 'inactive'">
-                            <el-button type="primary" link icon="edit" @click.stop="table_edit(scope.row)">修改</el-button>
-                            <el-button type="primary" link icon="upload" @click.stop="table_edit(scope.row)">上报</el-button>
+                            <template v-if="scope.row.status == 'active'">
+                                <el-button type="primary" link icon="edit" @click.stop="table_edit(scope.row)">修改</el-button>
+                                <el-button type="primary" link icon="upload" @click.stop="table_edit(scope.row)">上报</el-button>
+                            </template>
+                            <template v-if="scope.row.status == 'inactive'">
+                                <el-button type="primary" link icon="tickets" @click.stop="table_edit(scope.row)">重新上报</el-button>
+                                <el-button v-if="scope.row.processTaskId && scope.row.processInstanceId" type="primary" link @click.stop="table_process(scope.row)">
+                                    <template #icon><tjm-icon-uis-process /></template>
+                                    审批流程
+                                </el-button>
+                            </template>
                             <el-button type="primary" link icon="delete" @click.stop="table_del(scope.row)">删除</el-button>
                         </template>
-                        <el-button v-if="scope.row.status == 'approve' || scope.row.status == 'done'" type="primary" link icon="tickets" @click.stop="table_detail(scope.row)">详情</el-button>
-                        <el-button v-if="scope.row.status == 'approve'" type="primary" link icon="refresh-right" @click.stop="table_withdraw(scope.row)">撤回</el-button>
+                        <template v-if="scope.row.status == 'approve' || scope.row.status == 'done'">
+                            <el-button type="primary" link icon="tickets" @click.stop="table_detail(scope.row)">详情</el-button>
+                            <el-button v-if="scope.row.processTaskId && scope.row.processInstanceId" type="primary" link @click.stop="table_process(scope.row)">
+                                <template #icon><tjm-icon-uis-process /></template>
+                                审批流程
+                            </el-button>
+                        </template>
+                        <el-button v-if="scope.row.status == 'approve' && scope.row.isWithdraw == 1" type="primary" link icon="refresh-right" @click.stop="table_withdraw(scope.row)">撤回</el-button>
                     </template>
                 </el-table-column>
             </el-table>
@@ -83,10 +98,13 @@
 
     <policy-dialog v-if="dialog.update" ref="policyDialog" @success="reloadTable" @closed="closed"></policy-dialog>
     <policy-detail v-if="dialog.detail" ref="policyDetail" @closed="dialog.detail = false"></policy-detail>
+    <policy-process-dialog v-if="dialog.process" ref="processDialog" @success="reloadTable" @closed="dialog.process = false"></policy-process-dialog>
+    <yh-workflow v-if="dialog.workflow" ref="yhWorkflow" @closed="dialog.workflow = false"></yh-workflow>
 </template>
 
 <script>
 import API from "@/api/policy/share";
+import { useUserStore } from "@/store/user";
 import { exportExcel } from "@/utils/exportExcel";
 import { columns, levelDic, typeDic, storageTypeDic, whetherDic, statusDic } from "./main";
 
@@ -94,13 +112,17 @@ import tableImport from "@/components/Upload/tableImport.vue";
 import yhPagination from "@/components/Pagination/index.vue";
 import policyDetail from "@/views/manage/policyShare/dialog.vue";
 import policyDialog from "./dialog.vue";
+import policyProcessDialog from "@/views/toDo/share.vue";
+import yhWorkflow from "@/components/Workflow/index.vue";
 
 export default {
     components: {
         tableImport,
         yhPagination,
+        yhWorkflow,
         policyDetail,
-        policyDialog
+        policyDialog,
+        policyProcessDialog
     },
 
     data() {
@@ -111,7 +133,8 @@ export default {
             createTime: [],
             params: {
                 page: 1,
-                size: 10
+                size: 10,
+                deptId: useUserStore().userInfo.deptId
             },
 
             total: 0,
@@ -119,7 +142,9 @@ export default {
 
             dialog: {
                 update: false,
-                detail: false
+                detail: false,
+                process: false,
+                workflow: false
             }
         }
     },
@@ -152,11 +177,12 @@ export default {
 
         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.params = {
+                page: 1,
+                size: 10,
+                deptId: useUserStore().userInfo.deptId
+            };
+                
             this.reloadTable();
         },
 
@@ -172,9 +198,15 @@ export default {
             this.$nextTick(() => this.$refs.policyDialog.open());
         },
 
-        table_edit(row, mode = "edit") {
-            this.dialog.update = true;
-            this.$nextTick(() => this.$refs.policyDialog.open(mode).setData(row.id));
+        table_edit(row) {
+            if (row.status == "inactive") {
+                this.dialog.process = true;
+                this.$nextTick(() => this.$refs.processDialog.open("resubmit").setData(row.id));
+            }
+            if (row.status == "active") {
+                this.dialog.update = true;
+                this.$nextTick(() => this.$refs.policyDialog.open("edit").setData(row.id));
+            }
         },
 
         table_detail(row) {
@@ -215,6 +247,11 @@ export default {
         closed(e) {
             e && this.reloadTable();
             this.dialog.update = false;
+        },
+
+        table_process(row) {
+            this.dialog.workflow = true;
+            this.$nextTick(() => this.$refs.yhWorkflow.getDetail(row));
         }
     }
 }

+ 7 - 4
src/views/policyStrive/dialog.vue

@@ -94,8 +94,8 @@
         </el-form>
 
         <template #footer>
-            <el-button type="primary" :disabled="isUpload" @click="submit(mode)">保 存</el-button>
-            <el-button type="primary" :disabled="isUpload" @click="submit('saveApprove')">直接上报</el-button>
+            <el-button :loading="isSaving" type="primary" :disabled="isUpload" @click="submit(mode)">保 存</el-button>
+            <el-button :loading="isSaving" type="primary" :disabled="isUpload" @click="submit('saveApprove')">直接上报</el-button>
         </template>
     </el-dialog>
 </template>
@@ -123,10 +123,11 @@ export default {
             isUpload: false,
 
             visible: false,
+            isSaving: false,
             mode: "add",
             titleMap: {
                 add: "新增",
-                edit: "编辑"
+                edit: "修改"
             },
             form: {
                 id: null,
@@ -203,14 +204,16 @@ export default {
         submit(mode) {
             this.$refs.formRef.validate(valid => {
                 if (valid) {
+                    this.isSaving = true;
                     API[mode](this.form).then(res => {
+                        this.isSaving = false;
                         if (res.code === 200) {
                             ElMessage.success("操作成功");
                             this.visible = false;
                             this.fileIsDel = false;
                             this.$emit("success", mode);
                         } else ElMessage.error(res.msg);
-                    });
+                    }).catch(() => this.isSaving = false);
                 } else {
                     return false;
                 }

+ 5 - 2
src/views/policyStrive/explain.vue

@@ -127,7 +127,7 @@
 
         <template #footer>
             <template v-if="mode == 'explain'">
-                <el-button type="primary" @click="submit">保存上报</el-button>
+                <el-button :loading="isSaving" type="primary" @click="submit">保 存</el-button>
             </template>
         </template>
     </el-dialog>
@@ -152,6 +152,7 @@ export default {
             levelDic, typeDic, whetherDic, rewardTypeDic,
 
             visible: false,
+            isSaving: false,
             mode: "explain",
             titleMap: {
                 explain: "月度争取情况说明",
@@ -231,14 +232,16 @@ export default {
         submit() {
             this.$refs.formRef.validate(valid => {
                 if (valid) {
+                    this.isSaving = true;
                     const partPersonArr = this.form.partPerson && JSON.stringify(this.form.partPerson.split(",").map(name => ({ name }))) || "";
                     API.updateById({ ...this.form, partPersonArr }).then(res => {
+                        this.isSaving = false;
                         if (res.code === 200) {
                             ElMessage.success("操作成功");
                             this.visible = false;
                             this.$emit("success");
                         } else ElMessage.error(res.msg);
-                    });
+                    }).catch(() => this.isSaving = false);
                 } else {
                     return false;
                 }

+ 61 - 21
src/views/policyStrive/index.vue

@@ -63,23 +63,38 @@
             </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($event)">
+            <el-table v-loading="loading" row-key="id" header-cell-class-name="tjm_card_table_header" height="400" :data="tableData" border @row-click="(row, column) => !column.fixed && table_detail(row)">
                 <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" :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">
+                <el-table-column label="操作" fixed="right" width="280">
                     <template #default="scope">
                         <template v-if="scope.row.status == 'active' || scope.row.status == 'inactive'">
-                            <el-button type="primary" link icon="edit" @click.stop="table_edit(scope.row)">修改</el-button>
-                            <el-button type="primary" link icon="upload" @click.stop="table_edit(scope.row)">上报</el-button>
+                            <template v-if="scope.row.status == 'active'">
+                                <el-button type="primary" link icon="edit" @click.stop="table_edit(scope.row)">修改</el-button>
+                                <el-button type="primary" link icon="upload" @click.stop="table_edit(scope.row)">上报</el-button>
+                            </template>
+                            <template v-if="scope.row.status == 'inactive'">
+                                <el-button type="primary" link icon="tickets" @click.stop="table_edit(scope.row)">重新上报</el-button>
+                                <el-button v-if="scope.row.processTaskId && scope.row.processInstanceId" type="primary" link @click.stop="table_process(scope.row)">
+                                    <template #icon><tjm-icon-uis-process /></template>
+                                    审批流程
+                                </el-button>
+                            </template>
                             <el-button type="primary" link icon="delete" @click.stop="table_del(scope.row)">删除</el-button>
                         </template>
-                        <el-button v-if="scope.row.status == 'approve' || scope.row.status == 'done'" type="primary" link icon="tickets" @click.stop="table_detail(scope.row)">详情</el-button>
-                        <el-button v-if="scope.row.status == 'approve'" type="primary" link icon="refresh-right" @click.stop="table_withdraw(scope.row)">撤回</el-button>
-                        <el-button v-if="scope.row.status == 'done'" type="primary" link icon="info-filled" @click.stop="table_detail(scope.row, 'explain')">月度争取情况说明</el-button>
+                        <template v-if="scope.row.status == 'approve' || scope.row.status == 'done'">
+                            <el-button type="primary" link icon="tickets" @click.stop="table_detail(scope.row)">详情</el-button>
+                            <el-button v-if="scope.row.processTaskId && scope.row.processInstanceId" type="primary" link @click.stop="table_process(scope.row)">
+                                <template #icon><tjm-icon-uis-process /></template>
+                                审批流程
+                            </el-button>
+                        </template>
+                        <el-button v-if="scope.row.status == 'approve' && scope.row.isWithdraw == 1" type="primary" link icon="refresh-right" @click.stop="table_withdraw(scope.row)">撤回</el-button>
+                        <el-button v-if="scope.row.status == 'done'" class="no-m-l" type="primary" link icon="info-filled" @click.stop="table_detail(scope.row, 'explain')">月度争取情况说明</el-button>
                     </template>
                 </el-table-column>
             </el-table>
@@ -91,25 +106,32 @@
 
     <policy-detail v-if="dialog.detail" ref="policyDetail" @success="reloadTable" @closed="closed"></policy-detail>
     <policy-explain v-if="dialog.explain" ref="policyExplain" @success="reloadTable" @closed="dialog.explain = false"></policy-explain>
+    <policy-process-dialog v-if="dialog.process" ref="processDialog" @success="reloadTable" @closed="dialog.process = false"></policy-process-dialog>
+    <yh-workflow v-if="dialog.workflow" ref="yhWorkflow" @closed="dialog.workflow = false"></yh-workflow>
 </template>
 
 <script>
 import API from "@/api/policy/strive";
+import { useUserStore } from "@/store/user";
 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 yhWorkflow from "@/components/Workflow/index.vue";
 import policyDetail from "./dialog.vue";
 import policyExplain from "./explain.vue";
+import policyProcessDialog from "@/views/toDo/strive.vue";
 
 export default {
     components: {
         tableImport,
         yhPagination,
+        yhWorkflow,
         policyDetail,
-        policyExplain
+        policyExplain,
+        policyProcessDialog
     },
 
     data() {
@@ -120,7 +142,8 @@ export default {
             createTime: [],
             params: {
                 page: 1,
-                size: 10
+                size: 10,
+                deptId: useUserStore().userInfo.deptId
             },
 
             total: 0,
@@ -128,7 +151,9 @@ export default {
 
             dialog: {
                 detail: false,
-                explain: false
+                explain: false,
+                process: false,
+                workflow: false
             }
         }
     },
@@ -161,10 +186,10 @@ export default {
 
         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.params = {
+                page: 1,
+                size: 10,
+                deptId: useUserStore().userInfo.deptId
             }
             this.reloadTable();
         },
@@ -182,8 +207,19 @@ export default {
         },
 
         table_edit(row) {
-            this.dialog.detail = true;
-            this.$nextTick(() => this.$refs.policyDetail.open("edit").setData(row.id));
+            if (row.status == "inactive") {
+                this.dialog.process = true;
+                this.$nextTick(() => this.$refs.processDialog.open("resubmit").setData(row.id));
+            }
+            if (row.status == "active") {
+                this.dialog.detail = true;
+                this.$nextTick(() => this.$refs.policyDetail.open("edit").setData(row.id));
+            }
+        },
+
+        table_detail(row, mode = "detail") {
+            this.dialog.explain = true;
+            this.$nextTick(() => this.$refs.policyExplain.open(mode).setData(row.id));
         },
 
         table_del(row) {
@@ -216,14 +252,14 @@ export default {
             });
         },
 
-        table_detail(row, mode = "detail") {
-            this.dialog.explain = true;
-            this.$nextTick(() => this.$refs.policyExplain.open(mode).setData(row.id));
-        },
-
         closed(e) {
             e && this.reloadTable();
             this.dialog.detail = false;
+        },
+
+        table_process(row) {
+            this.dialog.workflow = true;
+            this.$nextTick(() => this.$refs.yhWorkflow.getDetail(row));
         }
     }
 }
@@ -233,4 +269,8 @@ export default {
 .export-btn {
   margin-left: 12px;
 }
+
+.no-m-l {
+  margin-left: 0;
+}
 </style>

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

@@ -32,7 +32,7 @@
         <el-divider></el-divider>
 
         <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 v-loading="loading" row-key="id" header-cell-class-name="tjm_card_table_header" height="400" :data="tableData" border @row-click="(row, column) => !column.fixed && table_detail(row)">
                 <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" :width="item.width || 180" show-overflow-tooltip></el-table-column>

+ 1 - 1
src/views/publicDomain/link.vue

@@ -37,7 +37,7 @@
             <el-divider></el-divider>
 
             <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($event)">
+                <el-table v-loading="loading" row-key="id" header-cell-class-name="tjm_card_table_header" height="400" :data="tableData" border @row-click="(row, column) => !column.fixed && table_detail(row)">
                     <el-table-column type="index" label="序号" width="55"></el-table-column>
                     <template v-for="(item, index) in link_columns" :key="index">
                         <el-table-column :label="item.label" :prop="item.props" :width="item.width || 180" show-overflow-tooltip>

+ 38 - 17
src/views/toDo/case.vue

@@ -1,6 +1,6 @@
 <template>
     <el-dialog v-model="visible" title="详情" width="680" @closed="$emit('closed')">
-        <el-form ref="formRef" :model="form" :rules="rules" disabled label-width="110px">
+        <el-form ref="formRef" :model="form" :rules="rules" :disabled="mode == 'agree' || mode == 'refuse'"  label-width="110px">
             <el-row>
                 <el-col v-if="form.id" :span="12">
                     <el-form-item label="案例编号" prop="businessNo">
@@ -73,14 +73,28 @@
             </el-row>
         </el-form>
 
+        <el-form ref="approveRef" :model="form" :rules="rules" label-width="110px">
+            <el-row>
+                <el-col v-if="mode == 'refuse'" :span="24">
+                    <el-form-item label="意见" prop="comment">
+                        <el-input v-model="form.comment" type="textarea" :rows="4" placeholder="请输入意见"></el-input>
+                    </el-form-item>
+                </el-col>
+            </el-row>
+        </el-form>
+
         <template #footer>
-            <el-button type="primary" @click="submit">确 定</el-button>
+            <template v-if="form.processDefinitionId">
+                <el-button v-if="mode == 'resubmit'" :loading="isSaving" type="primary" @click="submit">重新上报</el-button>
+                <el-button v-else :loading="isSaving" type="primary" @click="submit">确 定</el-button>
+            </template>
         </template>
     </el-dialog>
 </template>
 
 <script>
 import API from "@/api/policy/case";
+import Workflow from "@/api/workflow";
 import yhUpload from "@/components/Upload/index.vue";
 
 export default {
@@ -93,10 +107,12 @@ export default {
     data() {
         return {
             visible: false,
+            isSaving: false,
             mode: "agree",
 
             form: {
                 id: null,
+                processDefinitionId: null,
                 striveId: null,
                 policyStrive: {
                     id: null,
@@ -122,7 +138,8 @@ export default {
             rules: {
                 businessNo: [{ required: true }],
                 "policyStrive.name": [{ required: true, message: "请选择政策争取" }],
-                expContent: [{ required: true, message: "请输入经验" }]
+                expContent: [{ required: true, message: "请输入经验" }],
+                comment: [{ required: true, message: "请输入退回意见" }]
             }
         }
     },
@@ -145,25 +162,29 @@ export default {
                             }
                         } else this.form[key] = res.data[key] || null;
                     }
+                    if (this.mode == "refuse") this.form["comment"] = "不同意";
+
+                    Workflow.detail(res.data.processTaskId, res.data.processInstanceId).then(workflowRes => this.form.processDefinitionId = workflowRes.process.processDefinitionId || null);
                 } else ElMessage.error(res.msg);
             });
         },
 
         // 表单提交方法
-        submit(mode) {
-            this.$refs.formRef.validate(valid => {
-                if (valid) {
-                    API[this.mode]({ id: this.form.id }).then(res => {
-                        if (res.code === 200) {
-                            ElMessage.success("操作成功");
-                            this.visible = false;
-                            this.$emit("success");
-                        } else ElMessage.error(res.msg);
-                    });
-                } else {
-                    return false;
-                }
-            });
+        submit() {
+            const promiseArray = [this.$refs.approveRef.validate()];
+            this.mode == "resubmit" && promiseArray.push(this.$refs.formRef.validate());
+
+            Promise.all(promiseArray).then(() => {
+                this.isSaving = true;
+                API[this.mode](this.form).then(res => {
+                    this.isSaving = false;
+                    if (res.code === 200) {
+                        ElMessage.success("操作成功");
+                        this.visible = false;
+                        this.$emit("success");
+                    } else ElMessage.error(res.msg);
+                }).catch(() => this.isSaving = false);
+            }).catch(() => false);
         }
     }
 }

+ 37 - 21
src/views/toDo/share.vue

@@ -1,6 +1,6 @@
 <template>
     <el-dialog v-model="visible" title="详情" width="680" @closed="$emit('closed')">
-        <el-form :model="form" :rules="rules" disabled label-width="110px">
+        <el-form ref="formRef" :model="form" :rules="rules" :disabled="mode == 'agree' || mode == 'refuse'" label-width="110px">
             <el-row>
                 <el-col :span="12">
                     <el-form-item label="政策编号" prop="businessNo">
@@ -67,9 +67,9 @@
             </el-row>
         </el-form>
 
-        <el-form ref="formRef" :model="form" :rules="rules" label-width="110px">
+        <el-form ref="approveRef" :model="form" :rules="rules" label-width="110px">
             <el-row>
-                <template v-if="mode == 'agree'">
+                <template v-if="mode == 'agree' && isLastApprover">
                     <el-col :span="12">
                         <el-form-item label="是否入库" prop="isInWh">
                             <el-radio-group v-model="form.isInWh" @change="form.inWhType = null">
@@ -92,21 +92,25 @@
                 </template>
 
                 <el-col v-if="mode == 'refuse'" :span="24">
-                    <el-form-item label="意见" prop="remark">
-                        <el-input v-model="form.remark" type="textarea" :rows="4" placeholder="请输入意见"></el-input>
+                    <el-form-item label="意见" prop="comment">
+                        <el-input v-model="form.comment" type="textarea" :rows="4" placeholder="请输入意见"></el-input>
                     </el-form-item>
                 </el-col>
             </el-row>
         </el-form>
 
         <template #footer>
-            <el-button type="primary" @click="submit">确 定</el-button>
+            <template v-if="form.processDefinitionId">
+                <el-button v-if="mode == 'resubmit'" :loading="isSaving" type="primary" @click="submit">重新上报</el-button>
+                <el-button v-else :loading="isSaving" type="primary" @click="submit">确 定</el-button>
+            </template>
         </template>
     </el-dialog>
 </template>
 
 <script>
 import API from "@/api/policy/share";
+import Workflow from "@/api/workflow";
 import { storageTypeDic, whetherDic } from "@/views/policyShare/main";
 
 import yhUpload from "@/components/Upload/index.vue";
@@ -123,9 +127,11 @@ export default {
             storageTypeDic, whetherDic,
 
             visible: false,
+            isSaving: false,
             mode: "agree",
             form: {
                 id: null,
+                processDefinitionId: null,
                 businessNo: null,
                 status: null,
                 createId: null,
@@ -156,8 +162,10 @@ export default {
                 score: [{ required: true, message: "请输入分值" }],
                 isInWh: [{ required: true }],
                 inWhType: [{ required: true, message: "请选择入库类型" }],
-                // remark: [{ required: true, message: "请输入退回意见" }]
-            }
+                comment: [{ required: true, message: "请输入退回意见" }]
+            },
+
+            isLastApprover: false
         }
     },
 
@@ -176,25 +184,33 @@ export default {
                         else if (key == "isInWh") this.form.isInWh = !!res.data[key] && res.data[key] || 0;
                         else this.form[key] = res.data[key] || null;
                     }
+                    if (this.mode == "refuse") this.form["comment"] = "不同意";
+
+                    Workflow.detail(res.data.processTaskId, res.data.processInstanceId).then(workflowRes => {
+                        const { process, flows } = workflowRes;
+                        this.isLastApprover = flows.findIndex(f => f.historyActivityType == "candidate") == -1;
+                        this.form.processDefinitionId = process.processDefinitionId || null;
+                    });
                 } else ElMessage.error(res.msg);
             });
         },
   
         // 表单提交方法
         submit() {
-            this.$refs.formRef.validate(valid => {
-                if (valid) {
-                    API[this.mode](this.form).then(res => {
-                        if (res.code === 200) {
-                            ElMessage.success("操作成功");
-                            this.visible = false;
-                            this.$emit("success");
-                        } else ElMessage.error(res.msg);
-                    });
-                } else {
-                    return false;
-                }
-            });
+            const promiseArray = [this.$refs.approveRef.validate()];
+            this.mode == "resubmit" && promiseArray.push(this.$refs.formRef.validate());
+
+            Promise.all(promiseArray).then(() => {
+                this.isSaving = true;
+                API[this.mode](this.form).then(res => {
+                    this.isSaving = false;
+                    if (res.code === 200) {
+                        ElMessage.success("操作成功");
+                        this.visible = false;
+                        this.$emit("success");
+                    } else ElMessage.error(res.msg);
+                }).catch(() => this.isSaving = false);
+            }).catch(() => false);
         }
     }
 }

+ 38 - 16
src/views/toDo/strive.vue

@@ -1,6 +1,6 @@
 <template>
     <el-dialog v-model="visible" title="详情" width="680" @closed="$emit('closed')">
-        <el-form ref="formRef" :model="form" :rules="rules" disabled label-width="110px">
+        <el-form ref="formRef" :model="form" :rules="rules" :disabled="mode == 'agree' || mode == 'refuse'" label-width="110px">
             <el-row>
                 <el-col v-if="form.id" :span="12">
                     <el-form-item label="政策编号" prop="businessNo">
@@ -89,15 +89,30 @@
             </el-row>
         </el-form>
 
+        <el-form ref="approveRef" :model="form" :rules="rules" label-width="110px">
+            <el-row>
+                <el-col v-if="mode == 'refuse'" :span="24">
+                    <el-form-item label="意见" prop="comment">
+                        <el-input v-model="form.comment" type="textarea" :rows="4" placeholder="请输入意见"></el-input>
+                    </el-form-item>
+                </el-col>
+            </el-row>
+        </el-form>
+
         <template #footer>
-            <el-button type="primary" @click="submit">确 定</el-button>
+            <template v-if="form.processDefinitionId">
+                <el-button v-if="mode == 'resubmit'" :loading="isSaving" type="primary" @click="submit">重新上报</el-button>
+                <el-button v-else :loading="isSaving" type="primary" @click="submit">确 定</el-button>
+            </template>
         </template>
     </el-dialog>
 </template>
 
 <script>
 import API from "@/api/policy/strive";
+import Workflow from "@/api/workflow";
 import { rewardTypeDic } from "@/views/policyStrive/main";
+
 import yhUpload from "@/components/Upload/index.vue";
 
 export default {
@@ -112,9 +127,11 @@ export default {
             rewardTypeDic,
 
             visible: false,
+            isSaving: false,
             mode: "agree",
             form: {
                 id: null,
+                processDefinitionId: null,
                 businessNo: null,
                 status: null,
                 createId: null,
@@ -146,7 +163,8 @@ export default {
                 yjFinishTime: [{ required: true, message: "请选择预计完成时间" }],
                 yjStriveAmount: [{ required: true, message: "请输入预计争取金额" }],
                 rewardType: [{ required: true, message: "请选择政策考核类别" }],
-                abstractContent: [{ required: true, message: "请输入政策概要" }]
+                abstractContent: [{ required: true, message: "请输入政策概要" }],
+                comment: [{ required: true, message: "请输入退回意见" }]
             }
         }
     },
@@ -165,25 +183,29 @@ export default {
                         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;
                     }
+                    if (this.mode == "refuse") this.form["comment"] = "不同意";
+
+                    Workflow.detail(res.data.processTaskId, res.data.processInstanceId).then(workflowRes => this.form.processDefinitionId = workflowRes.process.processDefinitionId || null);
                 } else ElMessage.error(res.msg);
             });
         },
 
         // 表单提交方法
         submit() {
-            this.$refs.formRef.validate(valid => {
-                if (valid) {
-                    API[this.mode]({ id: this.form.id }).then(res => {
-                        if (res.code === 200) {
-                            ElMessage.success("操作成功");
-                            this.visible = false;
-                            this.$emit("success");
-                        } else ElMessage.error(res.msg);
-                    });
-                } else {
-                    return false;
-                }
-            });
+            const promiseArray = [this.$refs.approveRef.validate()];
+            this.mode == "resubmit" && promiseArray.push(this.$refs.formRef.validate());
+
+            Promise.all(promiseArray).then(() => {
+                this.isSaving = true;
+                API[this.mode](this.form).then(res => {
+                    this.isSaving = false;
+                    if (res.code === 200) {
+                        ElMessage.success("操作成功");
+                        this.visible = false;
+                        this.$emit("success");
+                    } else ElMessage.error(res.msg);
+                }).catch(() => this.isSaving = false);
+            }).catch(() => false);
         }
     }
 }