/**
|
* 按钮处理 业务类型审签
|
*/
|
import {paramLow,callPreEvent, callPostEvent} from '../BaseAction';
|
import {validatenull} from "@/util/validate";
|
import Vue from "vue";
|
|
export const doAction = (options,callback) => {
|
options.sourceData = options.sourceData || {};
|
options.dataStore = options.dataStore || [];
|
if (!options.dataStore || options.dataStore.length < 1) {
|
Vue.prototype.$message.error("请选择需要发起流程的数据");
|
return false;
|
}
|
if (!options.paramVOS.multi && options.dataStore.length > 1) {
|
Vue.prototype.$message.error("仅能选择一条数据发起流程");
|
return false;
|
}
|
|
//验证不允许启动的条件
|
if(!validatenull(options.paramVOS.checknotprocess)) {
|
let notprocess = options.paramVOS.checknotprocess.split('&');
|
let checknotprocess=false;
|
notprocess.forEach((item,i)=>{
|
if (options.dataStore[0][item.split('=')[0]] == item.split('=')[1]) {
|
checknotprocess=true;
|
return false;
|
}
|
})
|
if (checknotprocess) {
|
Vue.prototype.$message.error(replaceFreeMarker(options.paramVOS.checknotprocessmsg,options.dataStore,{}) || "当前数据不允许发起流程");
|
return false;
|
}
|
}
|
|
callPreEvent(options, doBefore, function (options) {
|
showStartWindow(options, function () {
|
callPostEvent(options, doAfter, callback,type);
|
});
|
});
|
};
|
|
/**
|
* 显示流程的窗口
|
* @param options 按钮的配置信息
|
* @param callback 回调
|
*/
|
export const showStartWindow = (options,callback)=> {
|
const paramVOS = options.paramVOS;
|
|
|
}
|
/**
|
* 前置事件
|
* @param options 按钮的配置信息
|
* @param callback 回调
|
*/
|
export const doBefore = (options,callback)=> {
|
console.log("执行增加前置事件")
|
if(callback){
|
callback(options);
|
}
|
}
|
/**
|
* 后置事件
|
* @param options 按钮的配置信息
|
* @param callback 回调
|
*/
|
export const doAfter = (options,callback,actionType)=> {
|
console.log('执行增加后置事件');
|
if(callback){
|
callback(actionType);
|
}
|
}
|