瀏覽代碼

多历史记录

yuedefeng 6 年之前
父節點
當前提交
ef3bf69294

+ 43 - 24
src/dashoo.cn/backend/api/business/workflow/ActivitiService.go

@@ -20,11 +20,11 @@ import (
 )
 
 type ActivitiService struct {
-	BaseUrl		string
-	AposeUrl	string
-	OriginUrl	string
-	Username 	string
-	Password 	string
+	BaseUrl   string
+	AposeUrl  string
+	OriginUrl string
+	Username  string
+	Password  string
 	ServiceBase
 }
 
@@ -32,8 +32,8 @@ func GetActivitiService(xormEngine *xorm.Engine) *ActivitiService {
 	s := new(ActivitiService)
 	s.DBE = xormEngine
 	//s.BaseUrl = "http://123.56.168.26:8080/activiti-rest/service"
-	//s.BaseUrl = "http://localhost:8081/api/acti"
-	s.BaseUrl = "http://47.92.212.59:8080/acti-api/api/acti"
+	s.BaseUrl = "http://localhost:8081/api/acti"
+	//s.BaseUrl = "http://47.92.212.59:8080/acti-api/api/acti"
 	//s.BaseUrl = "http://localhost:8081/api/acti"
 	s.AposeUrl = "http://47.92.212.59:8080/acti-api/api/apose"
 	//s.OriginUrl = "http://localhost:8081/api"
@@ -118,13 +118,13 @@ func (this *ActivitiService) StartProcess(processKey string, formEntityId string
 }
 
 //func (this *ActivitiService) TaskComplete(processKey string, formEntityId string, userNames string, userId string, result string, remarks string) string {
-	/*var ActiComplete ActiCompleteVM
-	ActiComplete.ProcessKey = processKey
-	ActiComplete.BusinessKey = formEntityId
-	ActiComplete.UserNames = userNames
-	ActiComplete.UserId = userId
-	ActiComplete.Result = result
-	ActiComplete.Remarks = remarks*/
+/*var ActiComplete ActiCompleteVM
+ActiComplete.ProcessKey = processKey
+ActiComplete.BusinessKey = formEntityId
+ActiComplete.UserNames = userNames
+ActiComplete.UserId = userId
+ActiComplete.Result = result
+ActiComplete.Remarks = remarks*/
 
 func (this *ActivitiService) TaskComplete(ActiComplete ActiCompleteVM) string {
 
@@ -142,15 +142,15 @@ func (this *ActivitiService) TaskComplete(ActiComplete ActiCompleteVM) string {
 
 /*func (this *ActivitiService) MultiTaskComplete(processKey string, formEntityId string, userNames string, multiOrgAudits []MultiOrgAuditVM, userId string, result string, remarks string, callbackUrl string) string {
 
-	var ActiComplete MultiActiCompleteVM
-	ActiComplete.ProcessKey = processKey
-	ActiComplete.BusinessKey = formEntityId
-	ActiComplete.UserNames = userNames
-	ActiComplete.MultiOrgAudits = multiOrgAudits
-	ActiComplete.UserId = userId
-	ActiComplete.Result = result
-	ActiComplete.Remarks = remarks
-	ActiComplete.CallbackUrl = callbackUrl*/
+var ActiComplete MultiActiCompleteVM
+ActiComplete.ProcessKey = processKey
+ActiComplete.BusinessKey = formEntityId
+ActiComplete.UserNames = userNames
+ActiComplete.MultiOrgAudits = multiOrgAudits
+ActiComplete.UserId = userId
+ActiComplete.Result = result
+ActiComplete.Remarks = remarks
+ActiComplete.CallbackUrl = callbackUrl*/
 
 func (this *ActivitiService) MultiTaskComplete(ActiComplete MultiActiCompleteVM) string {
 
@@ -203,6 +203,26 @@ func (this *ActivitiService) GetHistoricTasks(processKey string, businessKey str
 	return historicTasks
 }
 
+func (this *ActivitiService) GetHistoricMultiTasks(processKey string, businessKey string, processInstanceId string) []ActiHistoricTask {
+	var ActiProcess ActiProcessVM
+	ActiProcess.ProcessKey = processKey
+	ActiProcess.BusinessKey = businessKey
+	ActiProcess.ProcessInstanceId = processInstanceId
+	jsonParam, err := json.Marshal(ActiProcess)
+	if err != nil {
+		fmt.Println(err, "生成json字符串错误")
+	}
+	params := string(jsonParam)
+	fmt.Println(params)
+	//token = Authorization(this.Username, this.Password)
+	retVal := this.Post("/historic-multi-tasks", params, "")
+	jsonblob, _ := ioutil.ReadAll(retVal.Body)
+	//	var historicTasks []ActiHistoricTask
+	historicTasks := make([]ActiHistoricTask, 0)
+	json.Unmarshal(jsonblob, &historicTasks)
+	return historicTasks
+}
+
 func (this *ActivitiService) GetActivitiProccessImage(processInstanceId string) []byte {
 	var ActiProcess ActiProcessVM
 	ActiProcess.ProcessInstanceId = processInstanceId
@@ -281,7 +301,6 @@ func (this *ActivitiService) ExcelToPdf(addressUrl string) string {
 	return retDocUrl
 }
 
-
 func (this *ActivitiService) FillWordTemplate(datas map[string]interface{}, templateUrl string, fileName string) string {
 	var wordTempVM WordTemplateVM
 	wordTempVM.Datas = datas

+ 19 - 0
src/dashoo.cn/backend/api/controllers/workflow/workflow.go

@@ -33,6 +33,25 @@ func (this *WorkflowController) GetHistoricTask() {
 	this.ServeJSON()
 }
 
+// @Title get
+// @Description get workflow by token
+// @Success 200 {object} historicTasks
+// @router /historymultitask [get]
+func (this *WorkflowController) GetHistoricMultiTask() {
+	businessKey := this.GetString("business")
+	processKey := this.GetString("process")
+	processInstanceId := this.GetString("instance")
+
+	var historicTasks []workflow.ActiHistoricTask
+	svcActiviti := workflow.GetActivitiService(utils.DBE)
+	historicTasks = svcActiviti.GetHistoricMultiTasks(processKey, businessKey, processInstanceId)
+
+	var datainfo DataInfo
+	datainfo.Items = historicTasks
+	this.Data["json"] = &datainfo
+	this.ServeJSON()
+}
+
 // @Title 获取所有用户
 // @Description get user by token
 // @Success 200 {object} models.User

+ 196 - 0
src/dashoo.cn/frontend_web/src/components/workflow/wfmultihistory.vue

@@ -0,0 +1,196 @@
+<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.getuserlist()
+    },
+    computed: {
+      ...mapGetters({
+        session: 'session'
+      })
+    },
+    watch: {
+      entryinfo: {
+        handler: function (newVal, oldVal) {
+          this.getuserlist()
+        },
+        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
+          })
+          .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() {
+        let _this = this
+        _this.$axios.get('workflow/userlist', {})
+          .then(res => {
+            // response
+            _this.userlist = res.data.items
+            this.getHistoryTask()
+          })
+          .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>

+ 17 - 7
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplier/_opera/basisedit.vue

@@ -6,10 +6,14 @@
       <el-breadcrumb-item>基建类供方准入评审表</el-breadcrumb-item>
     </el-breadcrumb>
 
-    <float-img-btn ref="floatBtn" text="下一步" :itemWidth="58" :itemHeight="30" :coefficientHeight="0.8" @onFloatBtnClicked="nextTab">
-    </float-img-btn>
-    <float-img-btn ref="floatBtn" text="上一步" :itemWidth="58" :itemHeight="30" :coefficientHeight="0.85" @onFloatBtnClicked="backTab" v-if="certId">
-    </float-img-btn>
+    <no-ssr>
+      <div>
+        <float-img-btn ref="floatBtn" text="下一步" :itemWidth="58" :itemHeight="30" :coefficientHeight="0.8" @onFloatBtnClicked="nextTab">
+        </float-img-btn>
+        <float-img-btn ref="floatBtn" text="上一步" :itemWidth="58" :itemHeight="30" :coefficientHeight="0.85" @onFloatBtnClicked="backTab" v-if="certId">
+        </float-img-btn>
+      </div>
+    </no-ssr>
 
     <el-card class="box-card">
       <div slot="header">
@@ -215,7 +219,7 @@
                 </el-button>
               </span> -->
             </div>
-            <wf-history ref="WfHistory" :entryinfo="entrydetail"></wf-history>
+            <wf-multi-history ref="WfHistory" :entryinfo="entrydetail"></wf-multi-history>
           </el-card>
         </el-tab-pane>
 
@@ -280,7 +284,7 @@
   import api from '@/api/oilsupplier/supplier'
   import apiCert from '@/api/oilsupplier/suppliercert'
   import SupplierFileTable from '@/pages/oilsupplier/supplierfile/table.vue'
-  import WfHistory from '@/components/workflow/wfhistory.vue'
+  import WfMultiHistory from '@/components/workflow/wfmultihistory.vue'
   import WfBackHistory from '@/components/workflow/wfbackhistory.vue'
   import SupplierCertEdit from '@/components/oilsupplier/suppliercertedit.vue'
 
@@ -300,7 +304,7 @@
     components: {
       FloatImgBtn,
       SupplierFileTable,
-      WfHistory,
+      WfMultiHistory,
       WfBackHistory,
       SupplierCertEdit,
 
@@ -663,6 +667,9 @@
         if (this.formDataCert.Status > 0) {
           totalTab = 5
         }
+        if (this.formDataCert.Status < 0) {
+          totalTab = 5
+        }
         if (this.formDataCert.Status >= 5) {
           totalTab = 6
         }
@@ -692,6 +699,9 @@
         if (this.formDataCert.Status > 0) {
           totalTab = 5
         }
+        if (this.formDataCert.Status < 0) {
+          totalTab = 5
+        }
         if (this.formDataCert.Status >= 5) {
           totalTab = 6
         }

+ 17 - 7
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplier/_opera/goodsedit.vue

@@ -6,10 +6,14 @@
       <el-breadcrumb-item>物资类供方准入评审表</el-breadcrumb-item>
     </el-breadcrumb>
 
-    <float-img-btn ref="floatBtn" text="下一步" :itemWidth="58" :itemHeight="30" :coefficientHeight="0.8" @onFloatBtnClicked="nextTab">
-    </float-img-btn>
-    <float-img-btn ref="floatBtn" text="上一步" :itemWidth="58" :itemHeight="30" :coefficientHeight="0.85" @onFloatBtnClicked="backTab"  v-if="certId">
-    </float-img-btn>
+    <no-ssr>
+      <div>
+        <float-img-btn ref="floatBtn" text="下一步" :itemWidth="58" :itemHeight="30" :coefficientHeight="0.8" @onFloatBtnClicked="nextTab">
+        </float-img-btn>
+        <float-img-btn ref="floatBtn" text="上一步" :itemWidth="58" :itemHeight="30" :coefficientHeight="0.85" @onFloatBtnClicked="backTab"  v-if="certId">
+        </float-img-btn>
+      </div>
+    </no-ssr>
 
     <el-card class="box-card">
       <div slot="header">
@@ -314,7 +318,7 @@
                 </el-button>
               </span>-->
             </div>
-            <wf-history ref="WfHistory" :entryinfo="entrydetail"></wf-history>
+            <wf-multi-history ref="WfHistory" :entryinfo="entrydetail"></wf-multi-history>
           </el-card>
         </el-tab-pane>
 
@@ -379,7 +383,7 @@ import { mapGetters } from "vuex";
 import api from "@/api/oilsupplier/supplier";
 import apiCert from "@/api/oilsupplier/suppliercert";
 import SupplierFileTable from "@/pages/oilsupplier/supplierfile/table.vue";
-import WfHistory from "@/components/workflow/wfhistory.vue";
+import WfMultiHistory from "@/components/workflow/wfmultihistory.vue";
 import WfBackHistory from "@/components/workflow/wfbackhistory.vue";
 import SupplierCertEdit from "@/components/oilsupplier/suppliercertedit.vue";
 
@@ -398,7 +402,7 @@ export default {
   components: {
     FloatImgBtn,
     SupplierFileTable,
-    WfHistory,
+    WfMultiHistory,
     WfBackHistory,
     SupplierCertEdit,
 
@@ -814,6 +818,9 @@ export default {
       if (this.formDataCert.Status > 0) {
         totalTab = 5
       }
+      if (this.formDataCert.Status < 0) {
+        totalTab = 5
+      }
       if (this.formDataCert.Status >= 5) {
         totalTab = 6
       }
@@ -842,6 +849,9 @@ export default {
       if (this.formDataCert.Status > 0) {
         totalTab = 5
       }
+      if (this.formDataCert.Status < 0) {
+        totalTab = 5
+      }
       if (this.formDataCert.Status >= 5) {
         totalTab = 6
       }

+ 9 - 3
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplier/_opera/techedit.vue

@@ -219,7 +219,7 @@
                 </el-button>
               </span> -->
             </div>
-            <wf-history ref="WfHistory" :entryinfo="entrydetail"></wf-history>
+            <wf-multi-history ref="WfHistory" :entryinfo="entrydetail"></wf-multi-history>
           </el-card>
         </el-tab-pane>
         <el-tab-pane label="审批历史" v-if="this.formData.AuditIndex > 0 ">
@@ -284,7 +284,7 @@
   import api from '@/api/oilsupplier/supplier'
   import apiCert from '@/api/oilsupplier/suppliercert'
   import SupplierFileTable from '@/pages/oilsupplier/supplierfile/table.vue'
-  import WfHistory from '@/components/workflow/wfhistory.vue'
+  import WfMultiHistory from '@/components/workflow/wfmultihistory.vue'
   import WfBackHistory from '@/components/workflow/wfbackhistory.vue'
   import SupplierCertEdit from '@/components/oilsupplier/suppliercertedit.vue'
 
@@ -304,7 +304,7 @@
     components: {
       FloatImgBtn,
       SupplierFileTable,
-      WfHistory,
+      WfMultiHistory,
       WfBackHistory,
       SupplierCertEdit,
 
@@ -713,6 +713,9 @@
         if (this.formDataCert.Status > 0) {
           totalTab = 5
         }
+        if (this.formDataCert.Status < 0) {
+          totalTab = 5
+        }
         if (this.formDataCert.Status >= 5) {
           totalTab = 6
         }
@@ -742,6 +745,9 @@
         if (this.formDataCert.Status > 0) {
           totalTab = 5
         }
+        if (this.formDataCert.Status < 0) {
+          totalTab = 5
+        }
         if (this.formDataCert.Status >= 5) {
           totalTab = 6
         }