|
|
@ -11,7 +11,8 @@ import { |
|
|
|
close, |
|
|
|
cancel, |
|
|
|
cancelAccept, |
|
|
|
open |
|
|
|
open, |
|
|
|
CompleteAsyncJob |
|
|
|
} from '@/api/wms-job' |
|
|
|
export const drawerMixins = { |
|
|
|
data() { |
|
|
@ -57,186 +58,317 @@ export const drawerMixins = { |
|
|
|
// 申请业务 流程按钮实现
|
|
|
|
// 【提交】操作
|
|
|
|
if (val == requestDataNames.submit) { |
|
|
|
that.Loading.appMainLoading = true |
|
|
|
processRequest(that.propsData.id, that.URL + '/submit/').then(res => { |
|
|
|
that.$successMsg('已提交') |
|
|
|
getDetailed(that.propsData.id, that.URL).then(res => { |
|
|
|
that.propsData = res |
|
|
|
this.$confirm('是否确定提交?', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
that.Loading.appMainLoading = true |
|
|
|
processRequest(that.propsData.id, that.URL + '/submit/').then(res => { |
|
|
|
that.$successMsg('已提交') |
|
|
|
getDetailed(that.propsData.id, that.URL).then(res => { |
|
|
|
that.propsData = res |
|
|
|
}) |
|
|
|
that.paging() |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
}) |
|
|
|
that.paging() |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
}); |
|
|
|
} |
|
|
|
// 【审批】操作
|
|
|
|
else if (val == requestDataNames.agree) { |
|
|
|
that.Loading.appMainLoading = true |
|
|
|
processRequest(that.propsData.id, that.URL + '/agree/').then(res => { |
|
|
|
that.$successMsg('已同意') |
|
|
|
getDetailed(that.propsData.id, that.URL).then(res => { |
|
|
|
that.propsData = res |
|
|
|
this.$confirm('是否确定审批?', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
that.Loading.appMainLoading = true |
|
|
|
processRequest(that.propsData.id, that.URL + '/agree/').then(res => { |
|
|
|
that.$successMsg('已同意') |
|
|
|
getDetailed(that.propsData.id, that.URL).then(res => { |
|
|
|
that.propsData = res |
|
|
|
}) |
|
|
|
that.paging() |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
}) |
|
|
|
that.paging() |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
}); |
|
|
|
} |
|
|
|
// 【处理】操作
|
|
|
|
else if (val == requestDataNames.handle) { |
|
|
|
that.Loading.appMainLoading = true |
|
|
|
processRequest(that.propsData.id, that.URL + '/handle/').then(res => { |
|
|
|
that.$successMsg('处理完成') |
|
|
|
getDetailed(that.propsData.id, that.URL).then(res => { |
|
|
|
that.propsData = res |
|
|
|
this.$confirm('是否确定处理?', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
that.Loading.appMainLoading = true |
|
|
|
processRequest(that.propsData.id, that.URL + '/handle/').then(res => { |
|
|
|
that.$successMsg('处理完成') |
|
|
|
getDetailed(that.propsData.id, that.URL).then(res => { |
|
|
|
that.propsData = res |
|
|
|
}) |
|
|
|
that.paging() |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
}) |
|
|
|
that.paging() |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
}); |
|
|
|
} |
|
|
|
// 【执行】操作
|
|
|
|
else if (val == requestDataNames.againHandle) { // 针对部分完成情况下,再次执行任务操作
|
|
|
|
that.Loading.appMainLoading = true |
|
|
|
processRequest(that.propsData.id, that.URL + '/handle/').then(res => { |
|
|
|
that.$successMsg('执行成功') |
|
|
|
getDetailed(that.propsData.id, that.URL).then(res => { |
|
|
|
that.propsData = res |
|
|
|
this.$confirm('是否确定执行?', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
that.Loading.appMainLoading = true |
|
|
|
processRequest(that.propsData.id, that.URL + '/handle/').then(res => { |
|
|
|
that.$successMsg('执行成功') |
|
|
|
getDetailed(that.propsData.id, that.URL).then(res => { |
|
|
|
that.propsData = res |
|
|
|
}) |
|
|
|
that.paging() |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
}) |
|
|
|
that.paging() |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
}); |
|
|
|
} |
|
|
|
// 【中止】操作
|
|
|
|
else if (val == requestDataNames.abort) { |
|
|
|
that.Loading.appMainLoading = true |
|
|
|
processRequest(that.propsData.id, that.URL + '/abort/').then(res => { |
|
|
|
that.$successMsg('已中止') |
|
|
|
getDetailed(that.propsData.id, that.URL).then(res => { |
|
|
|
that.propsData = res |
|
|
|
this.$confirm('是否确定中止?', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
that.Loading.appMainLoading = true |
|
|
|
processRequest(that.propsData.id, that.URL + '/abort/').then(res => { |
|
|
|
that.$successMsg('已中止') |
|
|
|
getDetailed(that.propsData.id, that.URL).then(res => { |
|
|
|
that.propsData = res |
|
|
|
}) |
|
|
|
that.paging() |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
}) |
|
|
|
that.paging() |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
}); |
|
|
|
} |
|
|
|
// 【执行完成】操作
|
|
|
|
else if (val == 'completeRequest') { |
|
|
|
that.Loading.appMainLoading = true |
|
|
|
processRequest(that.propsData.id, that.URL + '/complete/').then(res => { |
|
|
|
that.$successMsg('执行完成') |
|
|
|
getDetailed(that.propsData.id, that.URL).then(res => { |
|
|
|
that.propsData = res |
|
|
|
this.$confirm('是否确定完成?', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
that.Loading.appMainLoading = true |
|
|
|
processRequest(that.propsData.id, that.URL + '/complete/').then(res => { |
|
|
|
that.$successMsg('执行完成') |
|
|
|
getDetailed(that.propsData.id, that.URL).then(res => { |
|
|
|
that.propsData = res |
|
|
|
}) |
|
|
|
that.paging() |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
}) |
|
|
|
that.paging() |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
}); |
|
|
|
} |
|
|
|
// 【取消】操作
|
|
|
|
else if (val == requestDataNames.cancel) { |
|
|
|
that.Loading.appMainLoading = true |
|
|
|
processRequest(that.propsData.id, that.URL + '/cancel/').then(res => { |
|
|
|
that.$successMsg('已取消') |
|
|
|
getDetailed(that.propsData.id, that.URL).then(res => { |
|
|
|
that.propsData = res |
|
|
|
this.$confirm('是否确定取消?', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
that.Loading.appMainLoading = true |
|
|
|
processRequest(that.propsData.id, that.URL + '/cancel/').then(res => { |
|
|
|
that.$successMsg('已取消') |
|
|
|
getDetailed(that.propsData.id, that.URL).then(res => { |
|
|
|
that.propsData = res |
|
|
|
}) |
|
|
|
that.paging() |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
}) |
|
|
|
that.paging() |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
}); |
|
|
|
} |
|
|
|
// 【驳回】操作
|
|
|
|
else if (val == requestDataNames.refuse) { |
|
|
|
that.Loading.appMainLoading = true |
|
|
|
processRequest(that.propsData.id, that.URL + '/refuse/').then(res => { |
|
|
|
that.$successMsg('已驳回') |
|
|
|
getDetailed(that.propsData.id, that.URL).then(res => { |
|
|
|
that.propsData = res |
|
|
|
this.$confirm('是否确定驳回?', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
that.Loading.appMainLoading = true |
|
|
|
processRequest(that.propsData.id, that.URL + '/refuse/').then(res => { |
|
|
|
that.$successMsg('已驳回') |
|
|
|
getDetailed(that.propsData.id, that.URL).then(res => { |
|
|
|
that.propsData = res |
|
|
|
}) |
|
|
|
that.paging() |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
}) |
|
|
|
that.paging() |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
}); |
|
|
|
} |
|
|
|
// 任务 流程按钮实现
|
|
|
|
if (val == 'acceptJob') { |
|
|
|
that.Loading.appMainLoading = true |
|
|
|
accept(that.URL, {id: that.propsData.id}).then(res => { |
|
|
|
that.$successMsg('已接任务') |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
getDetailed(that.propsData.id, that.URL).then(res => { |
|
|
|
that.propsData = res |
|
|
|
this.$confirm('是否确定接受任务?', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
that.Loading.appMainLoading = true |
|
|
|
accept(that.URL, {id: that.propsData.id}).then(res => { |
|
|
|
that.$successMsg('已接任务') |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
getDetailed(that.propsData.id, that.URL).then(res => { |
|
|
|
that.propsData = res |
|
|
|
}) |
|
|
|
that.paging(); |
|
|
|
}).catch(err => { |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
}) |
|
|
|
that.paging(); |
|
|
|
}).catch(err => { |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
}) |
|
|
|
} else if(val == 'closeJob'){ |
|
|
|
that.Loading.appMainLoading = true |
|
|
|
close(that.URL, {id: that.propsData.id}).then(res => { |
|
|
|
that.$successMsg('已关闭任务') |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
getDetailed(that.propsData.id, that.URL).then(res => { |
|
|
|
that.propsData = res |
|
|
|
.catch(() => { |
|
|
|
}); |
|
|
|
} |
|
|
|
else if(val == 'closeJob'){ |
|
|
|
this.$confirm('是否确定关闭任务?', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
that.Loading.appMainLoading = true |
|
|
|
close(that.URL, {id: that.propsData.id}).then(res => { |
|
|
|
that.$successMsg('已关闭任务') |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
getDetailed(that.propsData.id, that.URL).then(res => { |
|
|
|
that.propsData = res |
|
|
|
}) |
|
|
|
that.paging(); |
|
|
|
}).catch(err => { |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
}) |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
}); |
|
|
|
} |
|
|
|
else if(val == 'invalidJob'){ |
|
|
|
this.$confirm('是否确定作废任务?', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
that.Loading.appMainLoading = true |
|
|
|
cancel(that.URL, {id: that.propsData.id}).then(res => { |
|
|
|
that.$successMsg('已作废任务') |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
getDetailed(that.propsData.id, that.URL).then(res => { |
|
|
|
that.propsData = res |
|
|
|
}) |
|
|
|
that.paging(); |
|
|
|
}).catch(err => { |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
}) |
|
|
|
that.paging(); |
|
|
|
}).catch(err => { |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
}) |
|
|
|
} else if(val == 'invalidJob'){ |
|
|
|
that.Loading.appMainLoading = true |
|
|
|
cancel(that.URL, {id: that.propsData.id}).then(res => { |
|
|
|
that.$successMsg('已作废任务') |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
getDetailed(that.propsData.id, that.URL).then(res => { |
|
|
|
that.propsData = res |
|
|
|
.catch(() => { |
|
|
|
}); |
|
|
|
} |
|
|
|
// 新版独立操作
|
|
|
|
else if(val == 'CompleteAsyncJob'){ |
|
|
|
this.$confirm('是否确定完成任务?', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
that.Loading.appMainLoading = true |
|
|
|
CompleteAsyncJob(that.URL, {id: that.propsData.id}).then(res => { |
|
|
|
that.$successMsg('任务已完成') |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
getDetailed(that.propsData.id, that.URL).then(res => { |
|
|
|
that.propsData = res |
|
|
|
}) |
|
|
|
that.paging(); |
|
|
|
}).catch(err => { |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
}) |
|
|
|
that.paging(); |
|
|
|
}).catch(err => { |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
}) |
|
|
|
} else if(val == 'cancelAcceptJob'){ |
|
|
|
that.Loading.appMainLoading = true |
|
|
|
cancelAccept(that.URL, {id: that.propsData.id}).then(res => { |
|
|
|
that.$successMsg('已取消接受任务') |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
getDetailed(that.propsData.id, that.URL).then(res => { |
|
|
|
that.propsData = res |
|
|
|
.catch(() => { |
|
|
|
}); |
|
|
|
} |
|
|
|
else if(val == 'cancelAcceptJob'){ |
|
|
|
this.$confirm('是否确定取消接受任务?', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
that.Loading.appMainLoading = true |
|
|
|
cancelAccept(that.URL, {id: that.propsData.id}).then(res => { |
|
|
|
that.$successMsg('已取消接受任务') |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
getDetailed(that.propsData.id, that.URL).then(res => { |
|
|
|
that.propsData = res |
|
|
|
}) |
|
|
|
that.paging(); |
|
|
|
}).catch(err => { |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
}) |
|
|
|
that.paging(); |
|
|
|
}).catch(err => { |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
}) |
|
|
|
} else if(val == 'openJob'){ |
|
|
|
that.Loading.appMainLoading = true |
|
|
|
open(that.URL, {id: that.propsData.id}).then(res => { |
|
|
|
that.$successMsg('已打开任务') |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
getDetailed(that.propsData.id, that.URL).then(res => { |
|
|
|
that.propsData = res |
|
|
|
.catch(() => { |
|
|
|
}); |
|
|
|
} |
|
|
|
else if(val == 'openJob'){ |
|
|
|
this.$confirm('是否确定打开任务?', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
that.Loading.appMainLoading = true |
|
|
|
open(that.URL, {id: that.propsData.id}).then(res => { |
|
|
|
that.$successMsg('已打开任务') |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
getDetailed(that.propsData.id, that.URL).then(res => { |
|
|
|
that.propsData = res |
|
|
|
}) |
|
|
|
that.paging(); |
|
|
|
}).catch(err => { |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
}) |
|
|
|
that.paging(); |
|
|
|
}).catch(err => { |
|
|
|
that.Loading.appMainLoading = false |
|
|
|
}) |
|
|
|
} else if(val == 'handleJob'){ |
|
|
|
.catch(() => { |
|
|
|
}); |
|
|
|
} |
|
|
|
else if(val == 'handleJob'){ |
|
|
|
// 请在主页写相关执行任务操作代码
|
|
|
|
console.log('请在主页写相关执行任务操作代码') |
|
|
|
} |
|
|
|