优化代码

This commit is contained in:
java110 2021-08-26 19:11:28 +08:00
parent f244d0cfd6
commit 0d8f2e3987
5 changed files with 118 additions and 14 deletions

View File

@ -72,10 +72,7 @@
<td class="text-center">
<div class="btn-group">
<button class="btn-white btn btn-xs"
v-on:click="_openNewOaWorkflowUndoDetail(undo)">审核
</button>
<button class="btn-white btn btn-xs"
v-on:click="_openNewOaWorkflowUndoDetail(undo)">委托
v-on:click="_openAuditNewOaWorkflowUndoDetail(undo)">办理
</button>
<button class="btn-white btn btn-xs"
v-on:click="_openNewOaWorkflowUndoDetail(undo)">详情

View File

@ -83,8 +83,14 @@
}
);
},
_openNewOaWorkflowUndoDetail: function (_notice) {
vc.jumpToPage("/admin.html#/pages/common/noticeDetail?noticeId=" + _notice.noticeId);
_openNewOaWorkflowUndoDetail: function (_undo) {
vc.jumpToPage("/admin.html#/pages/property/newOaWorkflowDetail?id=" + _undo.id + "&flowId=" + $that.newOaWorkflowUndoInfo.conditions.flowId);
},
_openAuditNewOaWorkflowUndoDetail:function(_undo){
vc.jumpToPage("/admin.html#/pages/property/newOaWorkflowDetail?id=" + _undo.id
+ "&flowId=" + $that.newOaWorkflowUndoInfo.conditions.flowId
+ "&action=Audit"
+ "&taskId="+_undo.taskId);
},
_queryOaWorkflowUndoMethod: function () {
vc.component._listOaWorkflowUndos(DEFAULT_PAGE, DEFAULT_ROWS);

View File

@ -80,4 +80,57 @@
</div>
</div>
</div>
<div class="row" v-if="newOaWorkflowDetailInfo.action">
<div class="col-lg-12">
<div class="ibox">
<div class="ibox-title">
<h5>工单办理</h5>
<div class="ibox-tools" style="top:10px;">
</div>
</div>
<div class="ibox-content">
<div>
<div class="form-group row">
<label class="col-sm-2 col-form-label text-right">动作</label>
<div class="col-sm-10">
<select class="custom-select" v-model="newOaWorkflowDetailInfo.audit.auditCode">
<option selected disabled value="">请选择</option>
<option value="1100">办理</option>
<option value="1200">退回</option>
<option value="1300">转单</option>
</select>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label text-right">工单说明</label>
<div class="col-sm-10">
<textarea placeholder="必填,请填写工单说明" class="form-control"
v-model="newOaWorkflowDetailInfo.audit.auditMessage">
</textarea>
</div>
</div>
<div class="form-group row" v-if="newOaWorkflowDetailInfo.audit.auditCode != '1200'">
<label class="col-sm-2 col-form-label text-right">下一处理人</label>
<div class="col-sm-8">
<input type="text" class="form-control" placeholder="必填,请选择下一处理人" disabled
v-model="newOaWorkflowDetailInfo.audit.staffName">
</div>
<div class="col-sm-2">
<button class="btn btn-white " type="button" v-on:click="chooseStaff()">
选择
</button>
</div>
</div>
<div class="ibox-content">
<button class="btn btn-primary float-right" type="button" v-on:click="_auditSubmit()">
提交
</button>
</div>
</div>
</div>
</div>
</div>
</div>
<vc:create path="property/selectStaff"></vc:create>
</div>

View File

@ -7,17 +7,26 @@
pools: {},
formJson: [],
comments: [],
action: '',
audit: {
auditCode: '1100',
auditMessage: '',
staffId: '',
staffName: '',
taskId: ''
}
}
},
_initMethod: function () {
let id = vc.getParam('id');
if (!vc.notNull(id)) {
vc.toast('非法操作');
vc.
return;
return;
}
$that.newOaWorkflowDetailInfo.id = id;
$that.newOaWorkflowDetailInfo.flowId = vc.getParam('flowId');
$that.newOaWorkflowDetailInfo.action = vc.getParam('action');
$that.newOaWorkflowDetailInfo.audit.taskId = vc.getParam('taskId');
$that._listOaWorkflowDetails();
$that._loadComments();
},
@ -89,6 +98,51 @@
_goBack: function () {
vc.goBack()
},
chooseStaff: function () {
vc.emit('selectStaff', 'openStaff', $that.newOaWorkflowDetailInfo.audit);
},
_auditSubmit: function () {
let _audit = $that.newOaWorkflowDetailInfo.audit;
_audit.flowId = $that.newOaWorkflowDetailInfo.flowId;
_audit.id = $that.newOaWorkflowDetailInfo.id;
if (!_audit.auditCode) {
vc.toast('请选择状态');
return;
}
if (!_audit.auditMessage) {
vc.toast('请填写说明');
return;
}
if (_audit.auditCode != '1200' && !_audit.staffId) {
vc.toast('请选择下一节点处理人');
return;
}
vc.http.apiPost(
'/oaWorkflow/auditOaWorkflow',
JSON.stringify(_audit),
{
emulateJSON: true
},
function (json, res) {
let _json = JSON.parse(json);
if (_json.code == 0) {
//关闭model
vc.toast('提交成功');
vc.emit('newOaWorkflow', 'switch', 'newOaWorkflowPool')
return;
}
vc.toast(_json.msg);
},
function (errInfo, error) {
console.log('请求失败处理');
vc.toast(errInfo);
});
},
_getNewOaWorkflowDetailState: function (_pool) {
/**
* 1001 申请 1002 待审核 1003 退回 1004 委托 1005 办结
@ -96,7 +150,6 @@
if (!_pool.hasOwnProperty('state')) {
return "未知";
}
switch (_pool.state) {
case '1001':
return "申请";

View File

@ -19,7 +19,6 @@
methods: {
saveWorkflowSettingInfo: function () {
vc.component.workflowSettingInfo.communityId = vc.getCurrentCommunity().communityId;
vc.http.apiPost(
@ -39,9 +38,7 @@
},
function (errInfo, error) {
console.log('请求失败处理');
vc.toast(errInfo);
});
},
_initWorkflowSettingInfo: function () {
@ -124,9 +121,7 @@
_steps.push(_step);
}
$that.workflowSettingInfo.steps = _steps;
},
addWorkflowStep: function () {
let _step = {