Pārlūkot izejas kodu

流程查询部分功能

Signed-off-by: lijunqing <lijunqing@dashoo.cn>
lijunqing 6 gadi atpakaļ
vecāks
revīzija
258f3546cc

+ 16 - 13
src/dashoo.cn/frontend_web/src/pages/select/processselect/index.vue

@@ -26,7 +26,7 @@
             </el-select>
           </el-form-item>
           <el-form-item>
-            <el-dropdown split-button type="primary" size="mini" @command="searchCommand">
+            <el-dropdown split-button type="primary" size="mini" @command="searchCommand"  @click="initDatas(tabinx,$event)">
               查询
               <el-dropdown-menu slot="dropdown">
                 <el-dropdown-item command="clear">查询重置</el-dropdown-item>
@@ -162,7 +162,7 @@
       </el-tabs>
     </el-card>
     <el-dialog title="审批流程" :visible.sync="dialogVisible" width="1024px">
-      <el-card class="box-card" style="margin-top: 20px">
+      <el-card class="box-card">
         <div slot="header" class="clearfix">
           <span>审批流程</span>
         </div>
@@ -170,7 +170,7 @@
       </el-card>
     </el-dialog>
     <el-dialog title="审批流程" :visible.sync="dialogVisible1" width="1024px">
-      <el-card class="box-card" style="margin-top: 20px">
+      <el-card class="box-card">
         <div slot="header" class="clearfix">
           <span>审批流程</span>
         </div>
@@ -186,7 +186,7 @@
     mapGetters
   } from 'vuex'
   import api from '@/api/oilsupplier/select'
-  import WfMultiHistory from '@/components/workflow/wfmultihistory.vue'
+  import WfMultiHistory from '@/pages/select/processselect/wfmultihistory.vue'
   import WfHistory from '@/components/workflow/wfhistory.vue'
 
   export default {
@@ -249,12 +249,12 @@
     },
     methods: {
       handleClick (tab) {
-        console.log(tab)
+        this.currentPage = 1;
+        this.size= 10;
         this.tabinx = tab.index
         this.initDatas(tab.index)
       },
       openwfhistory (val) {
-        console.log(this.tabinx)
         if (this.tabinx == '0') { // 准入
           this.entrydetail.business = val.BusinessKey
           this.entrydetail.instance = val.WorkflowId
@@ -280,7 +280,11 @@
         }
 
       },
-      initDatas (val) {
+      initDatas (val,event) {
+        if (event != null) {
+          this.currentPage = 1;
+          this.size= 10;
+        }
         // 分页及列表条件
         let params = {
           _currentPage: this.currentPage,
@@ -303,7 +307,6 @@
         // 访问接口
         console.log(params)
         api.getProcessAuditList(myCreateOn.join(','), params, this.$axios).then(res => {
-          console.log(res.data.items, 'res.data.items')
           this.entityList = res.data.items
           this.currentItemCount = res.data.currentItemCount
         }).catch(err => {
@@ -326,13 +329,13 @@
           this.Column.Order = 'desc'
         }
         this.Column.Prop = column.prop
-        this.initDatas()
+        this.initDatas(this.tabinx)
       },
       clearSearch () {
         Object.assign(this.searchForm, this.searchFormReset)
         // this.searchForm = this.searchFormReset;
         this.CreateOn = ''
-        this.initDatas()
+        this.initDatas(this.tabinx)
       },
 
       transferStr (val) {
@@ -385,16 +388,16 @@
       handleSearch () {
         this.currentPage = 1
         this.dialogVisible = false
-        this.initDatas()
+        this.initDatas(this.tabinx)
       },
       handleCurrentChange (value) {
         this.currentPage = value
-        this.initDatas()
+        this.initDatas(this.tabinx)
       },
       handleSizeChange (value) {
         this.size = value
         this.currentPage = 1
-        this.initDatas()
+        this.initDatas(this.tabinx)
       },
 
       GetCommand (cmdType, row) {

+ 208 - 0
src/dashoo.cn/frontend_web/src/pages/select/processselect/wfmultihistory.vue

@@ -0,0 +1,208 @@
+<template>
+  <div style="overflow: auto">
+    <el-table :data="historyTask" border>
+      <el-table-column prop="taskName" sortable min-width="130" label="当前状态" align="center" show-overflow-tooltip></el-table-column>
+      <el-table-column prop="remarks" sortable min-width="130" label="审批意见" align="center" show-overflow-tooltip>
+        <template slot-scope="scope">
+          <span style="font-weight: bold" v-if="scope.row.assignee">
+            {{scope.row.remarks}}
+          </span>
+        </template>
+      </el-table-column>
+      <el-table-column prop="assignee" sortable min-width="100" label="审核人" align="center" show-overflow-tooltip>
+        <template slot-scope="scope">
+          <span style="font-weight: bold" v-if="scope.row.assignee">
+            {{ assigneeToAssignee(scope.row.assignee) }}
+          </span>
+          <el-tooltip class="item" v-if="!scope.row.assignee" content="当前步骤有审批权限的人员" placement="top-start">
+            <span style="font-style: italic; color:#00F">
+              {{ assigneeToUsers(scope.row.users) }}
+            </span>
+          </el-tooltip>
+        </template>
+      </el-table-column>
+      <el-table-column prop="startTime" sortable min-width="150" label="开始时间" align="center" show-overflow-tooltip>
+        <template slot-scope="scope">
+          {{ timestampToTime(scope.row.startTime) }}
+        </template>
+      </el-table-column>
+      <el-table-column prop="endTime" sortable min-width="150" label="结束时间" align="center" show-overflow-tooltip>
+        <template slot-scope="scope">
+          {{ jstimehandle(timestampToTime(scope.row.endTime)) }}
+        </template>
+      </el-table-column>
+    </el-table>
+    <!-- <div style="margin-top:5px; text-align: center;">
+      <img :src="baseurl + 'workflow/historyimg/' + entryinfo.instance +'?t='+(new Date()).getTime() " v-if="entryinfo.instance">
+    </div> -->
+  </div>
+</template>
+
+<script>
+  import {
+    mapGetters
+  } from 'vuex'
+
+  export default {
+    name: 'wfmultihistory',
+    props: {
+      visible: {
+        type: Boolean,
+        default: false
+      },
+      entryinfo: {}
+    },
+    created () {
+      this.getHistoryTask()
+    },
+    computed: {
+      ...mapGetters({
+        session: 'session'
+      })
+    },
+    watch: {
+      entryinfo: {
+        handler: function (newVal, oldVal) {
+          this.getHistoryTask()
+        },
+        deep: true
+      }
+    },
+
+    data () {
+      return {
+        baseurl: process.env.baseURL,
+        process: '',
+        business: '',
+        instance: '',
+        selfVisible: this.visible, // 避免vue双向绑定警告
+        historyTask: [],
+        userlist: [],
+      }
+    },
+    methods: {
+      getHistoryTask () {
+        let _this = this
+        this.$axios.get('/audithistory/list?id=' + this.entryinfo.business)
+          .then(res => {
+            let instanceIds = ''
+            for (let idx in res.data.item) {
+              instanceIds += res.data.item[idx].WorkflowId + ','
+            }
+            instanceIds += _this.entryinfo.instance + ','
+            _this.getHistoryMultiTask(instanceIds)
+          })
+          .catch(err => {
+            // handle error
+            console.error(err)
+          })
+      },
+      getHistoryMultiTask (instanceIds) {
+        let _this = this
+        const params = {
+          process: _this.entryinfo.process,
+          business: _this.entryinfo.business,
+          instance: instanceIds
+        }
+        this.$axios.get('/workflow/historymultitask', {
+          params
+        })
+          .then(res => {
+            // _this.historyTask = res.data.items
+            console.log(res.data.items)
+            this.tmp_historyTask = res.data.items
+            let useridstr = ''
+            for (let i = 0; i < this.tmp_historyTask.length; i++) {
+              if (this.tmp_historyTask[i].users !== '') {
+                useridstr = useridstr + this.tmp_historyTask[i].users + ','
+              }
+            }
+            if (useridstr) {
+              useridstr = useridstr.substring(0, useridstr.length - 1)
+            }
+            console.log(useridstr, 'useridstr')
+            this.getuserlist(useridstr)
+          })
+          .catch(err => {
+            // handle error
+            console.error(err)
+          })
+      },
+      assigneeToAssignee(val) {
+        for (let i = 0; i < this.userlist.length; i++) {
+          if (val == this.userlist[i].Id) {
+            return this.userlist[i].Realname
+          }
+        }
+      },
+      assigneeToUsers(users) {
+        let userNames = ""
+        let userArr = users.split(',')
+        for(let idx=0; idx<userArr.length; idx++) {
+          let val = userArr[idx]
+          for (let i = 0; i < this.userlist.length; i++) {
+            if (parseInt(val) == parseInt(this.userlist[i].Id)) {
+              userNames += this.userlist[i].Realname + ", "
+            }
+          }
+        }
+        if(userNames.length > 0) {
+          userNames = userNames.substring(0, userNames.length-2)
+        }
+        return userNames;
+      },
+      getuserlist (val) {
+        this.$axios.post('workflow/userlist_post?userids=' + val)
+          .then(res => {
+            // response
+            this.userlist = res.data.items
+            this.historyTask = this.tmp_historyTask
+          })
+          .catch(err => {
+            // handle error
+            console.error(err)
+          })
+      },
+      timestampToTime(val) {
+        var date = new Date(val) //时间戳为10位需*1000,时间戳为13位的话不需乘1000
+        var Y = date.getFullYear() + '-'
+        var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'
+        var D = date.getDate() + ' '
+        var h = date.getHours() + ':'
+        var m = date.getMinutes() + ':'
+        var s = date.getSeconds()
+        return Y + M + D + h + m + s
+      },
+      jstimehandle(val) {
+        if (val === '') {
+          return '----'
+        } else if (val === '0001-01-01T08:00:00+08:00') {
+          return '----'
+        } else if (val === '5000-01-01T23:59:59+08:00') {
+          return '永久'
+        } else if (val === '1970-01-01 8:0:0') {
+          return '----'
+        } else if (val === '1970-01-1 8:0:0') {
+          return '----'
+        } else {
+          val = val.replace('T', ' ')
+          return val.substring(0, 19)
+        }
+      },
+    }
+  }
+
+</script>
+
+<style>
+  .samplerecoveope .el-radio {
+    padding: 8px 15px 0 0;
+    margin-left: -2px;
+  }
+  .dialog-footer img{
+    position: relative;
+    width: 100%;
+    height: 100%;
+  }
+
+</style>