You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

130 lines
4.2 KiB

import {filterObj} from '@/utils/util';
import {deleteAction, downFile, getAction} from '@/api/manage'
import Vue from 'vue'
import {ACCESS_TOKEN} from "@/store/mutation-types"
import JEllipsis from '@/components/jeecg/JEllipsis'
export const activitiMixin = {
components: {
JEllipsis
},
data(){
return {
//token header
tokenHeader: {'X-Access-Token': Vue.ls.get(ACCESS_TOKEN)},
}
},
computed:{
/*todo 所有的流程表单,组件化注册,在此维护*/
allFormComponent:function(){
return [
{
text:'预算计划采购流程',
routeName:'@/views/activiti/form/ProcessUdgetPlanForm',
component:() => import(`@/views/activiti/form/ProcessUdgetPlanForm`),
businessTable:'ProcessUdgetPlanForm'
},
{
text:'物资入库流程',
routeName:'@/views/activiti/form/ProcessMaterialWarehousingForm',
component:() => import(`@/views/activiti/form/ProcessMaterialWarehousingForm`),
businessTable:'ProcessMaterialWarehousingForm'
},
{
text:'物资出库流程',
routeName:'@/views/activiti/form/ProcessMaterialsDeliveryForm',
component:() => import(`@/views/activiti/form/ProcessMaterialsDeliveryForm`),
businessTable:'ProcessMaterialsDeliveryForm'
},
{
text:'物资调拨流程',
routeName:'@/views/activiti/form/ProcessMaterialsAllotForm',
component:() => import(`@/views/activiti/form/ProcessMaterialsAllotForm`),
businessTable:'ProcessMaterialsAllotForm'
},
{
text:'物资借用流程',
routeName:'@/views/activiti/form/ProcessMaterialBorrowingForm',
component:() => import(`@/views/activiti/form/ProcessMaterialBorrowingForm`),
businessTable:'ProcessMaterialBorrowingForm'
},
{
text:'物资归还流程',
routeName:'@/views/activiti/form/ProcessMaterialsReturnForm',
component:() => import(`@/views/activiti/form/ProcessMaterialsReturnForm`),
businessTable:'ProcessMaterialsReturnForm'
},
{
text:'物资报废流程',
routeName:'@/views/activiti/form/ProcessSmaterialsScrapForm',
component:() => import(`@/views/activiti/form/ProcessSmaterialsScrapForm`),
businessTable:'ProcessSmaterialsScrapForm'
},
{
text:'特殊物资审批流程',
routeName:'@/views/activiti/form/ProcessSpecialMaterialsForm',
component:() => import(`@/views/activiti/form/ProcessSpecialMaterialsForm`),
businessTable:'ProcessSpecialMaterialsForm'
},
]
},
historicDetail:function () {
return () => import(`@/views/activiti/historicDetail`)
}
},
methods:{
getFormComponent(routeName){
return _.find(this.allFormComponent,{routeName:routeName})||{};
},
millsToTime(mills) {
if (!mills) {
return "";
}
let s = mills / 1000;
if (s < 60) {
return s.toFixed(0) + " 秒"
}
let m = s / 60;
if (m < 60) {
return m.toFixed(0) + " 分钟"
}
let h = m / 60;
if (h < 24) {
return h.toFixed(0) + " 小时"
}
let d = h / 24;
if (d < 30) {
return d.toFixed(0) + " 天"
}
let month = d / 30
if (month < 12) {
return month.toFixed(0) + " 个月"
}
let year = month / 12
return year.toFixed(0) + " 年"
},
handleTableChange(pagination, filters, sorter) {
//分页、排序、筛选变化时触发
//TODO 筛选
if (Object.keys(sorter).length > 0) {
this.isorter.column = sorter.field;
this.isorter.order = "ascend" == sorter.order ? "asc" : "desc"
}
this.ipagination = pagination;
// this.loadData();
},
//根据key 获取流程定义数据
getProcessDefByKey(key){
let procDef = null;
let newestProcessList = JSON.parse(window.sessionStorage.getItem("newestProcessList"));
newestProcessList.forEach(function(item) {
if(item.processKey === key){
procDef = item;
}
});
return procDef;
},
}
}