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.

151 lines
3.5 KiB

2 years ago
//申请流程按钮
/**
* @param {*} that 主页this
* @returns
*/
export function requestData(that,label){
return [
{
type: 'primary',
icon: 'el-icon-circle-check',
label: label==undefined?'提交':label,
name: "submitRequest",
hide: () => { return hideButtonRequest(that, [1]) },
size: 'mini'
},
{
type: 'primary',
icon: 'el-icon-circle-check',
label: label==undefined?'审批':label,
name: "agreeRequest",
hide: () => { return hideButtonRequest(that, [2]) },
size: 'mini'
},
{
type: 'primary',
icon: 'el-icon-circle-check',
label: label==undefined?'处理':label,
name: "handleRequest",
hide: () => { return hideButtonRequest(that, [4]) },
size: 'mini'
},
{
type: 'primary',
icon: 'el-icon-circle-check',
label: '执行',
name: "againHandleRequest",
hide: () => { return hideButtonRequest(that, [9]) },
size: 'mini'
},
{
type: 'danger',
icon: 'el-icon-delete-solid',
label: '中止',
name: "abortRequest",
hide: () => { return hideButtonRequest(that, [5]) },
size: 'mini'
},
{
type: 'danger',
icon: 'el-icon-circle-check',
label: '驳回',
name: "refuseRequest",
hide: () => { return hideButtonRequest(that, [2]) },
size: 'mini'
},
{
type: 'danger',
icon: 'el-icon-delete-solid',
label: '取消',
name: "cancelRequest",
hide: () => { return hideButtonRequest(that, [1,2,4]) },
size: 'mini'
},
// {
// type: 'primary',
// icon: 'el-icon-circle-check',
// label: '执行',
// name: "completeRequest",
// hide: () => { return hideButtonRequest(that, [5]) },
// size: 'mini'
// },
]
}
//任务流程按钮
/**
* @param {*} that 主页this
* @returns
*/
export function jobData(that){
return [
{
type: 'primary',
icon: 'el-icon-circle-check',
label: '接受',
name: "acceptJob",
hide: () => { return hideButtonJob(that, [1]) },
size: 'mini'
},
{
type: 'primary',
icon: 'el-icon-circle-check',
label: '执行',
name: "handleJob",
hide: () => { return hideButtonJob(that, [2]) },
size: 'mini'
},
{
type: 'primary',
icon: 'el-icon-circle-check',
label: '打开',
name: "openJob",
hide: () => { return hideButtonJob(that, [4]) },
size: 'mini'
},
{
type: 'danger',
icon: 'el-icon-circle-close',
label: '关闭',
name: "closeJob",
hide: () => { return hideButtonJob(that, [1]) },
size: 'mini'
},
{
type: 'danger',
icon: 'el-icon-delete-solid',
label: '作废',
name: "invalidJob",
hide: () => { return hideButtonJob(that, [1, 4]) },
size: 'mini'
},
{
type: 'danger',
icon: 'el-icon-circle-close',
label: '取消',
name: "cancelAcceptJob",
hide: () => { return hideButtonJob(that, [2]) },
size: 'mini'
},
]
}
function hideButtonRequest(that, val) {
let data = true
val.forEach(key => {
if (that.propsData.requestStatus == key) {
data = false
}
})
return data
}
function hideButtonJob(that, val) {
let data = true
val.forEach(key => {
if (that.propsData.jobStatus == key) {
data = false
}
})
return data
}