Browse Source

审批详情部分接口对接

cxmo 1 year ago
parent
commit
49f890fd74

+ 1 - 1
src/api/modules/approve.js

@@ -102,7 +102,7 @@ export const approveInterence = {
      * @returns 
      */
     getApproveDetail(params){
-        return http.post("/report_approve/detail",params)
+        return http.get("/report_approve/detail",params)
     },
 
 

+ 47 - 2
src/views/approve_manage/approveDetail.vue

@@ -42,7 +42,9 @@
             <div class="approve-timeline-wrap">
                 <p>审批流程</p>
                 <div class="timeline">
-                    <TimeLine />
+                    <TimeLine 
+                        :TimeLineData="TimeLineData"
+                    />
                 </div>
                 <div class="approve-status">
                     <img src="~@/assets/img/approve_m/pending.png" alt="">
@@ -56,16 +58,59 @@
 import ReportDetail from '@/views/smartReport/reportDetail.vue';
 import Reportdtl from '@/views/report_manage/reportdtl.vue'
 import TimeLine from './components/timeLine.vue';
-
+import {approveInterence} from '@/api/modules/approve.js';
 export default {
     data() {
         return {
             isError:false,
             isLoading:false,
+            TimeLineData:[]
         };
     },
     methods: {
         getApproveDetail(){
+            const {type,approveId} = this.$route.query
+            if(!approveId) return 
+            approveInterence.getApproveDetail({
+                ReportApproveId:Number(approveId)
+            }).then(res=>{
+                if(res.Ret!==200) return 
+                console.log('res',res)
+                this.formatTimeLineData(res.Data)
+                
+            })
+        },
+        //转换接口数据
+        formatTimeLineData({Approve={},ApproveFlowNodes=[]}){
+            const ApproveType = ['','依次审批','会签','或签']
+            const startNode = {
+                nodeType:1,
+                nodeText:'发起人:',
+                approveList:[{
+                    approveName:Approve.ApplyUserName||'',
+                    approveTime:Approve.CreateTime||''
+                }]
+            }
+            let Nodes = ApproveFlowNodes.map(i=>{
+                const node = {
+                    nodeType:2,
+                    nodeText:'审批人:'+i.Users.length+'人('+ApproveType[i.ApproveType]+')',
+                    nodeStatus:i.ReportApproveNodeId===Approve.CurrNodeId?'process':'reject',
+                    approveType:ApproveType[i.ApproveType]
+                }
+                const approveList = i.Users.map(u=>{
+                    return {
+                        approverName:u.UserName,
+                        approveStatus:u.ApproveRecord.State,
+                        approveTime:u.ApproveRecord.ApproveTime,
+                        approveReason:u.ApproveRecord.ApproveRemark
+                    }
+                })
+                node.approveList = approveList
+                return node
+            })
+            this.TimeLineData = [...startNode,...Nodes]
+
         }
     },
     mounted(){

+ 20 - 10
src/views/approve_manage/approveList.vue

@@ -39,9 +39,9 @@
                     </template>
                     <template v-if="activeTab==='originate'">
                         <el-option label="待审批" :value="1" />
-                        <el-option label="已通过" :value="2" />
-                        <el-option label="已驳回" :value="1" />
-                        <el-option label="已撤销" :value="2" />
+                        <el-option label="已审批" :value="2" />
+                        <el-option label="已驳回" :value="3" />
+                        <el-option label="已撤销" :value="4" />
                     </template>
                     
                 </el-select>
@@ -58,7 +58,14 @@
                     :prop="item.key"
                     :sortable="item.sortable"
                     align="center"
-                ></el-table-column>
+                >
+                    <template slot-scope="{row}">
+                        <span v-if="item.key==='State'">
+                            {{['','待审批','已审批','已驳回','已撤销'][row.State]}}
+                        </span>
+                        <span v-else>{{row[item.key]}}</span>
+                    </template>
+                </el-table-column>
                 <el-table-column label="操作" align="center">
                     <template slot-scope="{row}">
                         <template v-if="activeTab==='pending'">
@@ -69,9 +76,9 @@
                             <el-button type="text" style="padding:0" @click="handleShowDetail(row)">驳回理由</el-button>
                         </template>
                         <template v-if="activeTab==='originate'">
-                            <el-button type="text" style="padding:0;" @click="toApproveDetail(row,'myself')">详情</el-button>
-                            <el-button type="text" style="padding:0;">撤销</el-button>
-                            <el-button type="text" style="padding:0" @click="handleShowDetail(row)">驳回理由</el-button>
+                            <el-button type="text" style="padding:0;" @click="toApproveDetail(row,'myself')" v-if="row.State!==4">详情</el-button>
+                            <el-button type="text" style="padding:0;" v-if="row.State!==4">撤销</el-button>
+                            <el-button type="text" style="padding:0" @click="handleShowDetail(row)" v-if="row.State===3">驳回理由</el-button>
                         </template>
                     </template>
                     
@@ -133,7 +140,7 @@ export default {
             sortRule:0,
             sortField:0,
             
-            tableData: [{ name: 1 }],
+            tableData: [],
             tableColumns: approve_pending_columns,
             page: 1,
             pageSize: 10,
@@ -171,7 +178,9 @@ export default {
                 ...selectParams
             }).then(res=>{
                 if(res.Ret!==200) return 
-                console.log('resssss',res)
+                const {List=[],Paging={}} = res.Data||{}
+                this.tableData = List||[]
+                this.total = Paging.Totals||0
             })
         },
         handleCurrentChange(page) {
@@ -192,11 +201,12 @@ export default {
         },
         handleSearchChange(){},
         toApproveDetail(data,type){
+            console.log('data?',data)
             this.$router.push({
                 path:'/approveDetail',
                 query:{
                     type,
-                    approveId:data.id
+                    approveId:data.ReportApproveId
                 }
             })
         }

+ 7 - 2
src/views/approve_manage/components/timeLine.vue

@@ -1,8 +1,8 @@
 <template>
     <div class="time-line-wrap">
         <ul>
-            <li v-for="(node,index) in mockTimeLine" :key="index">
-                <TimeLineItem :node="node" :isLast="index===mockTimeLine.length-1"/>
+            <li v-for="(node,index) in TimeLineData" :key="index">
+                <TimeLineItem :node="node" :isLast="index===TimeLineData.length-1"/>
             </li>
         </ul>
     </div>
@@ -12,6 +12,11 @@
 import TimeLineItem from './timeLineItem.vue';
 export default {
     components:{TimeLineItem},
+    props:{
+        TimeLineData:{
+            type:Array
+        }
+    },
     data() {
         return {
             mockTimeLine:[

+ 1 - 1
src/views/report_manage/addreportNew.vue

@@ -614,7 +614,7 @@ export default {
 				window.open(href, '_blank');
 				return false;
 			}
-			if (tp == 'fb'||tb == 'submit') {
+			if (tp == 'fb'||tp == 'submit') {
 				this.isPublishloading = true;
 			}
 			const isPost = this.permissionBtn.checkPermissionBtn(this.permissionBtn.reportManageBtn.reportManage_sendMsg)&&(!this.isApprove)

+ 0 - 45
src/views/report_manage/components/submitReportDialog.vue

@@ -1,45 +0,0 @@
-<template>
-    <!-- 研报提交弹窗 -->
-    <el-dialog title="提示" :visible.sync="showSubmit" :modal-append-to-body="false" :close-on-click-modal="false"
-        :center="true" v-dialogDrag custom-class="dialogclass" width="510px" @close="$emit('close')">
-        <div>
-            <div style="height: 100px; padding-top: 40px">
-                <i class="el-icon-warning" style="font-size: 24px; color: #e6a23c; vertical-align: middle"></i>
-                是否提交报告,且 审批通过后,是否推送模板消息?
-            </div>
-            <div style="margin-bottom: 20px; text-align: center">
-                <el-button type="primary" plain style="width: 100px" @click="$emit('close')">取消</el-button>
-                <el-button type="primary" style="width: 100px; margin: 0 20px" @click="$emit('submit')">仅提交</el-button>
-                <el-button type="primary" style="width: 100px" :disabled="!canPushMsg" @click="$emit('both')">提交&推送
-                </el-button>
-            </div>
-        </div>
-    </el-dialog>
-</template>
-
-<script>
-    export default {
-        props:{
-            showSubmit:{
-                type:Boolean,
-                default:false
-            },
-            canPushMsg:{
-                type:Boolean,
-                default:false
-            }
-        },
-        data() {
-            return {
-
-            };
-        },
-        methods: {
-
-        },
-    };
-</script>
-
-<style scoped lang="scss">
-
-</style>

+ 1 - 1
src/views/report_manage/mixins/messagePush.js

@@ -71,7 +71,7 @@ export default {
           } else if(tp=='dsfb'){
             this.showDSFB=true
             // this.$router.push({path:'/reportlist'});
-          }else if(to=='submit'){
+          }else if(tp=='submit'){
             this.handleSubmitReport(res.Data.ReportId)
           }
           //已经添加过报告

+ 20 - 13
src/views/report_manage/reportlist.vue

@@ -578,13 +578,6 @@
         </div>
       </div>
     </el-dialog>
-    <SubmitReportDialog 
-        :showSubmit="showSubmit"
-        :canPushMsg="canPushMsgInApprove"
-        @close="showSubmit=false"
-        @submit="submitReport('submit')"
-        @both="submitReport('both')"
-    />
   </div>
 </template>
 
@@ -604,10 +597,8 @@ import {
 } from "api/api.js";
 import {approveInterence} from '@/api/modules/approve.js';
 import reportApproveConfig from "@/mixins/reportApproveConfig.js"
-import SubmitReportDialog from "./components/submitReportDialog.vue";
 export default {
   mixins:[reportApproveConfig],
-  components:{SubmitReportDialog},
   computed: {
     exportUrlDl() {
       let url = this.exportUrl;
@@ -689,9 +680,7 @@ export default {
       tableKey:0,
       selectNum:1,
 
-      showSubmit:false, //提交询问弹窗是否展示
       submitId:0,//当前选择的报告id
-      canPushMsgInApprove:false,//是否能够推送
     };
   },
   mounted() {
@@ -1032,8 +1021,26 @@ export default {
     //提交报告
     handleSubmitReport(item){
         this.submitId = item.Id
-        this.showSubmit=true
-        this.canPushMsgInApprove = item.MsgIsSend===0
+        const canPost = this.permissionBtn.checkPermissionBtn(this.permissionBtn.reportManageBtn.reportManage_sendMsg)&&item.MsgIsSend===0
+        if(canPost){
+            this.$confirm("报告通过审批后,是否推送消息?","提示",{
+                confirmButtonText: '推送',
+                cancelButtonText: '不推送',
+                type: 'warning',
+                distinguishCancelAndClose:true,
+                beforeClose:(action, instance,done)=>{
+                    if(action=='close') {
+                    } else if(action=='cancel') {
+                        this.submitReport("submit")
+                    }else {
+                        this.submitReport("both")
+                    }
+                    done()
+                }
+            })
+        }else{
+            this.submitReport("submit")
+        }
     },
     submitReport(type){
         //both:提交&推送