增加APP调用方法
This commit is contained in:
parent
2762f6179a
commit
f13b3e8cc6
@ -5,13 +5,15 @@
|
||||
var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
|
||||
|
||||
function AppOaFormUtil() {
|
||||
|
||||
this.confirmAssignees = null;
|
||||
this.fields = null;
|
||||
this.formButton = null;
|
||||
this.currentUser = null;
|
||||
this.form = null;
|
||||
|
||||
/**
|
||||
* 初始化APP数据
|
||||
* 初始化APP数据,H5 -> APP
|
||||
* @param dataObj
|
||||
*/
|
||||
this.initAppFormData = function (dataObj) {
|
||||
@ -25,8 +27,59 @@
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化APP附件
|
||||
* @param attachments
|
||||
*/
|
||||
this.initAppAttachments = function(attachments) {
|
||||
if(!attachments) {
|
||||
return;
|
||||
}
|
||||
if (isAndroid) {
|
||||
window.android.invokeNative('echoAccessory', attachments)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交表单
|
||||
* @param btnIndex
|
||||
*/
|
||||
this.submitFormReport = function (btnIndex) {
|
||||
document.getElementById('submitFormBtn'+ btnIndex).click();
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置字段值
|
||||
* @param fieldName
|
||||
* @param fieldValue
|
||||
*/
|
||||
this.setFieldValue = function (fieldName, fieldValue) {
|
||||
var obj = {};
|
||||
obj[fieldName] = fieldValue;
|
||||
this.form.val('dataForm', obj);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置附件
|
||||
* @param attachments
|
||||
*/
|
||||
this.setAttachments = function (attachments) {
|
||||
this.form.val('dataForm', {attachments: attachments});
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置抄送人
|
||||
* @param setCcs
|
||||
*/
|
||||
this.setCcs = function (ccs) {
|
||||
this.form.val('dataForm', {ccs: ccs});
|
||||
}
|
||||
|
||||
this.setForm = function (form) {
|
||||
this.form = form;
|
||||
}
|
||||
|
||||
this.getConfirmAssignees = function () {
|
||||
alert(JSON.stringify(this.confirmAssignees))
|
||||
return this.confirmAssignees;
|
||||
}
|
||||
|
||||
|
@ -777,7 +777,13 @@ function OaFormUtil(layui) {
|
||||
layer.close(promptIndex);
|
||||
|
||||
var loadLayerIndex;
|
||||
restAjax.put(restAjax.path('api/oa-form-report/update-go-back/process-instance-id/{processInstanceId}/task-id/{taskId}/node-id/{nodeId}', [processInstanceId, taskId, nodeId]), {
|
||||
var url;
|
||||
if(isApp) {
|
||||
url = 'app/oa-form-report/update-go-back/process-instance-id/{processInstanceId}/task-id/{taskId}/node-id/{nodeId}';
|
||||
} else {
|
||||
url = 'api/oa-form-report/update-go-back/process-instance-id/{processInstanceId}/task-id/{taskId}/node-id/{nodeId}';
|
||||
}
|
||||
restAjax.put(restAjax.path(url, [processInstanceId, taskId, nodeId]), {
|
||||
reason: reason
|
||||
}, null, function (code, data) {
|
||||
layer.msg('回退成功', {offset: getMsgOffset(isApp)});
|
||||
|
Loading…
Reference in New Issue
Block a user