瀏覽代碼

根据其他系统详情数据生成页面

lizhenhao 1 年之前
父節點
當前提交
1eb6a8bfef

+ 18 - 0
src/api/centerservice/ccpm/CcpmService.js

@@ -0,0 +1,18 @@
+import request from '@/utils/httpRequest'
+
+export default class CcpmService {
+  getByIdGenerate (id, processDefKey) {
+    return request({
+      url: '/ccpm_control/getByIdGenerate',
+      method: 'get',
+      params: {id: id, processDefKey: processDefKey}
+    })
+  }
+  reimAudit (id, flag, comment, processDefKey) {
+    return request({
+      url: '/ccpm_reimbursement/reimAudit',
+      method: 'get',
+      params: {id: id, flag: flag, comment: comment, processDefKey: processDefKey}
+    })
+  }
+}

+ 2 - 1
src/router/index.js

@@ -41,7 +41,8 @@ const mainRoutes = {
     {path: '/form/explorer', component: null, name: 'form-explorer', meta: {title: '浏览器', type: 'iframe'}},
     {path: '/database/datatable/TableForm', component: _import('modules/database/datatable/TableForm'), name: 'table-form', meta: {title: '数据库表详情'}},
     {path: '/404', component: _import('common/404'), name: '404', meta: {title: '404未找到'}},
-    {path: '/flowable/task/CenterForm', component: _import('modules/flowable/task/CenterForm'), name: 'center-form', meta: {title: '流程详情-其他系统'}}
+    {path: '/flowable/task/CenterForm', component: _import('modules/flowable/task/CenterForm'), name: 'center-form', meta: {title: '流程详情-其他系统'}},
+    {path: '/generateForm/GenerateForm', component: _import('modules/generateForm/GenerateForm'), name: 'generate-form', meta: {title: '流程详情动态页面-其他系统'}}
   ]
 }
 

+ 4 - 6
src/views/modules/flowable/task/HistoryList.vue

@@ -249,21 +249,19 @@
         if (row.processDefKey === '13') {
           let id = row.businessId
           let title = '报销审批历史'
-          let formUrl = '/reimbursement/ReimbursementFormCcpm'
-          this.toCenterForm(id, title, formUrl, row.processDefKey) // 跳转
+          this.toCenterForm(id, title, row.processDefKey) // 跳转
         } else {
-          this.$message.warning('此流程的跨系统审核暂未开放,请前往所属系统进行审核')
+          this.$message.warning('此流程的跨系统审核暂未开放,请前往所属系统进行查看')
         }
       },
-      toCenterForm (id, title, formUrl, processDefKey) {
+      toCenterForm (id, title, processDefKey) {
         let backPath = '/sys/dashboard/workBench/PendingList'
         this.$router.push({ // 跳转
-          path: '/flowable/task/CenterForm',
+          path: '/generateForm/GenerateForm',
           query: {
             id: id,
             backPath: backPath,
             title: title,
-            formUrl: formUrl,
             processDefKey: processDefKey
           }
         })

+ 6 - 7
src/views/modules/flowable/task/TodoList.vue

@@ -313,26 +313,25 @@
           this.refreshList()
         })
       },
-      // 报销审核
+      // 审核方法
       todoCcpm (row) {
-        if (row.task.processDefKey === '13') {
+        if (row.task.processDefKey === '13' || row.task.processDefKey === '102') {
           let id = row.vars.notifyId
           let title = '报销申请审批'
-          let formUrl = '/reimbursement/ReimbursementFormCcpm'
-          this.toCenterForm(id, title, formUrl, row.task.processDefKey, 'audit') // 跳转
+          this.toCenterForm(id, title, row.task.processDefKey, 'audit') // 跳转
         } else {
           this.$message.warning('此流程的跨系统审核暂未开放,请前往所属系统进行审核')
         }
       },
-      toCenterForm (id, title, formUrl, processDefKey, type) {
+      // 审核页面跳转
+      toCenterForm (id, title, processDefKey, type) {
         let backPath = '/sys/dashboard/workBench/PendingList'
         this.$router.push({ // 跳转
-          path: '/flowable/task/CenterForm',
+          path: '/generateForm/GenerateForm',
           query: {
             id: id,
             backPath: backPath,
             title: title,
-            formUrl: formUrl,
             processDefKey: processDefKey,
             type: type
           }

+ 152 - 0
src/views/modules/generateForm/GenerateForm.vue

@@ -0,0 +1,152 @@
+<template>
+  <div>
+    <div style="padding: 10px 0px 66px 0px;min-height: 100px">
+      <!--标题-->
+      <h4 style="text-align:center">{{title}}</h4>
+      <el-card>
+        <!--表单-->
+        <fm-generate-form :data="jsonData" ref="generateForm" v-loading="loading"></fm-generate-form>
+        <!--附件-->
+        <UpLoadComponent ref="upLoadComponent"></UpLoadComponent>
+        <!--审核意见-->
+        <div v-if="type === 'audit'">
+          <el-divider content-position="left"><span style="color: red">*</span> <i class="el-icon-document"></i> 审批意见</el-divider>
+          <el-row><el-input type="textarea" :rows="5" maxlength="500" placeholder="请填写审核意见:" v-model="comments" show-word-limit></el-input></el-row>
+        </div>
+        <!--流程历史-->
+        <FlowHisTableCcpm ref="flowHisTableCcpm"></FlowHisTableCcpm>
+        <!--操作按钮-->
+        <div class="FlowFormFooter">
+          <el-button v-if="type === 'audit'" type="primary" :loading="loading" @click="agree" v-noMoreClick plain>同意</el-button>
+          <el-button v-if="type === 'audit'" type="danger" :loading="loading" @click="reject" v-noMoreClick plain>驳回</el-button>
+          <el-button :loading="loading" @click="close" v-noMoreClick plain>关闭</el-button>
+        </div>
+      </el-card>
+
+    </div>
+  </div>
+</template>
+
+<script>
+  import CcpmService from '@/api/centerservice/ccpm/CcpmService'
+  import UpLoadComponent from '@/views/common/UpLoadComponentCcpm'
+  import FlowHisTableCcpm from '@/views/modules/flowable/task/FlowHisTableCcpm'
+  export default {
+    data () {
+      return {
+        jsonData: {},
+        title: '',
+        businessId: '',
+        loading: false,
+        type: '',
+        processDefKey: '',
+        comments: '' // 审核意见
+      }
+    },
+    ccpmService: null,
+    activated () {
+      this.init()
+    },
+    created () {
+      this.ccpmService = new CcpmService()
+      this.init()
+    },
+    components: {
+      UpLoadComponent,
+      FlowHisTableCcpm
+    },
+    methods: {
+      // 初始化
+      init () {
+        this.businessId = this.$route.query.id
+        this.processDefKey = this.$route.query.processDefKey
+        this.title = this.$route.query.title
+        this.type = this.$route.query.type
+        this.jsonData = []
+        this.comments = ''
+        this.$nextTick(async () => {
+          this.loading = true
+          this.$refs.upLoadComponent.clearUpload()
+          this.$refs.flowHisTableCcpm.clearFlowHis()
+          let res = await this.ccpmService.getByIdGenerate(this.businessId, this.processDefKey)
+          if (res) {
+            this.loading = false
+            this.jsonData = JSON.parse(JSON.stringify(res.data))
+            if (this.commonJS.isEmpty(this.jsonData.files)) {
+              this.jsonData.files = []
+            }
+            let filesLabel = '附件'
+            if (this.commonJS.isNotEmpty(this.jsonData.filesLabel)) {
+              filesLabel = this.jsonData.filesLabel
+            }
+            this.$refs.upLoadComponent.newUpload('view', this.jsonData.files, null, null, filesLabel)
+            this.$refs.flowHisTableCcpm.setFlowHis(this.jsonData.flowChart, this.jsonData.histoicFlow)
+            this.$nextTick(() => {
+              this.$refs.generateForm.refresh()
+            })
+          } else {
+            this.loading = false
+          }
+        })
+      },
+      // 关闭
+      close () {
+        this.$refs.upLoadComponent.clearUpload()
+        this.$refs.flowHisTableCcpm.clearFlowHis()
+        this.jsonData = []
+        this.comments = ''
+        this.$store.dispatch('tagsView/delView', {fullPath: this.$route.fullPath})
+        if (this.$route.query.backPath) {
+          this.$router.push(this.$route.query.backPath)
+        } else {
+          this.$router.push('/sys/dashboard/workBench/Pending')
+        }
+      },
+      // 同意
+      agree () {
+        if (this.commonJS.isEmpty(this.comments)) {
+          this.$message.error('请填写审批意见')
+        } else {
+          this.loading = true
+          this.ccpmService.reimAudit(this.businessId, 'yes', this.comments, this.processDefKey).then(({data}) => {
+            this.loading = false
+            if (data.success) {
+              this.$message.success(data.message)
+              this.close()
+            } else {
+              this.$message.error(data.message)
+            }
+          }).catch(() => {
+            this.loading = false
+          })
+        }
+      },
+      // 驳回
+      reject () {
+        if (this.commonJS.isEmpty(this.comments)) {
+          this.$message.error('请填写审批意见')
+        } else {
+          this.$confirm(`确定驳回此报销申请吗?`, '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          }).then(async () => {
+            this.loading = true
+            this.ccpmService.reimAudit(this.businessId, 'no', this.comments, this.processDefKey).then(({data}) => {
+              this.loading = false
+              if (data.success) {
+                this.$message.success(data.message)
+                this.close()
+              } else {
+                this.$message.error(data.message)
+              }
+            }).catch(() => {
+              this.loading = false
+            })
+          })
+        }
+      }
+    }
+  }
+</script>
+

+ 5 - 6
src/views/modules/sys/dashboard/workBench/Pending.vue

@@ -608,25 +608,24 @@
       },
       // 审核方法
       todoCcpm (row) {
-        if (row.task.processDefKey === '13') {
+        if (row.task.processDefKey === '13' || row.task.processDefKey === '102') {
           let id = row.vars.notifyId
           let title = '报销申请审批'
-          let formUrl = '/reimbursement/ReimbursementFormCcpm'
-          this.toCenterForm(id, title, formUrl, 'audit') // 跳转
+          this.toCenterForm(id, title, row.task.processDefKey, 'audit') // 跳转
         } else {
           this.$message.warning('此流程的跨系统审核暂未开放,请前往所属系统进行审核')
         }
       },
       // 审核页面跳转
-      toCenterForm (id, title, formUrl, type) {
+      toCenterForm (id, title, processDefKey, type) {
         let backPath = '/home'
         this.$router.push({ // 跳转
-          path: '/flowable/task/CenterForm',
+          path: '/generateForm/GenerateForm',
           query: {
             id: id,
             backPath: backPath,
             title: title,
-            formUrl: formUrl,
+            processDefKey: processDefKey,
             type: type
           }
         })