mbui.define(['form','layer','userPicker','fileupload'], function (exports) {
const layer = mbui.layer;
const form = mbui.form;
const tool = mbui.tool;
const fileupload = mbui.fileupload;
const opts={
"checkBox":"checkBox",//审核容器id
"check_name": "",//审核类型标识
"check_btn":1,//是否显示提交审核按钮
"checking_btn":'',//待审核状态下添加的按钮
"checked_btn":'',//审核通过后添加的按钮
"check_ok":function(){
//审核通过的执行函数
},
"check_no":function(){
//审核拒绝的执行函数
},
"check_back":function(){
//撤回的执行函数
},
"check_reversed":function(){
//反确认的执行函数
}
};
const obj = {
loading:false,
checkStatus: function (status) {
statusArray = ['待提交审批','审批中','审批通过','审批不通过','已撤回'];
return ''+statusArray[status]+'';
},
statusTemplate: function (status) {
let me = this;
let tem =`
审批状态
${me.checkStatus(status)}
`;
return tem;
},
uidsTemplate: function () {
let tem =`
`;
return tem;
},
flowTemplate: function (data) {
let flowtype='';
if(data && data.length>0){
for(let i=0;i'+data[i].title+'';
}
}
let tem =`
`;
return tem;
},
copyTemplate: function (detail) {
let me = this;
let tem =`
`;
return tem;
},
btnTemplate: function () {
let me = this;
let tem =`
${me.sets.checking_btn}
`;
if(me.sets.check_btn == 1){
return tem;
}else{
return '';
}
},
recordTemplate: function (record) {
let me = this;
let tem ='';
if(record.length>0){
tem+='
';
tem+='
审批记录
';
tem+='
';
for(let l=0;l。';
}
tem+='
'+record[l].check_time_str+''+record[l].name+'『'+record[l].status_str+'』了此申请。'+check_content+'';
let file_array= record[l].file_array;
if(file_array.length>0){
tem+='
审批附件
';
for(let f=0;f
';
}
tem+='
';
}
tem+='
';
tem+='
';
}
return tem;
},
createTemplate: function (flow) {
let me = this;
let checkHtml = `
`;
return checkHtml;
},
//审批待提交模版
initTemplate: function (detail) {
let me = this;
let checkHtml = `
`;
let viewHtml = `
`;
if(detail.is_creater==1){
return checkHtml;
}
else{
return viewHtml;
}
},
//审批中模版
checkTemplate: function (detail) {
let me = this,flowHtml='',list = detail.nodes;
for(var f=0;f1){
check_types= ' 会签';
if(list[f].check_types==2){
check_types= ' 或签';
}
}
}
if(list[f].check_role == 0 || list[f].check_role == 5){
checkUser=list[f].check_uids_info[0].name;
}
if(list[f].check_role == 1 || list[f].check_role == 2 || list[f].check_role == 3 || list[f].check_role == 4){
checkUser=list[f].flow_name;
}
if(list[f].check_list.length>0){
let one=0,two=0,three=0;
for(var m=0;m 0){
iconStatus ='';
strStatus ='