优化工作流页面

This commit is contained in:
java110 2020-06-20 15:53:38 +08:00
parent 41935748dc
commit 57ddf865e7
2 changed files with 8 additions and 97 deletions

View File

@ -81,7 +81,7 @@
</div> </div>
</div> </div>
<div class="ibox-content"> <div class="ibox-content">
<button class="btn btn-primary float-right" type="button" v-on:click="saveActivitiesInfo()"><i <button class="btn btn-primary float-right" type="button" v-on:click="saveWorkflowSettingInfo()"><i
class="fa fa-check"></i>&nbsp;提交 class="fa fa-check"></i>&nbsp;提交
</button> </button>
<button type="button" class="btn btn-warning float-right" style="margin-right:20px;" <button type="button" class="btn btn-warning float-right" style="margin-right:20px;"

View File

@ -16,76 +16,6 @@
}, },
methods: { methods: {
addWorkflowSettingValidate() {
return vc.validate.validate({
workflowSettingInfo: vc.component.workflowSettingInfo
}, {
'workflowSettingInfo.title': [
{
limit: "required",
param: "",
errInfo: "活动标题不能为空"
},
{
limit: "maxin",
param: "1,200",
errInfo: "活动标题不能超过200位"
},
],
'workflowSettingInfo.typeCd': [
{
limit: "required",
param: "",
errInfo: "活动类型不能为空"
},
{
limit: "num",
param: "",
errInfo: "活动类型格式错误"
},
],
'workflowSettingInfo.headerImg': [
{
limit: "required",
param: "",
errInfo: "头部照片不能为空"
}
],
'workflowSettingInfo.context': [
{
limit: "required",
param: "",
errInfo: "活动内容不能为空"
}
],
'workflowSettingInfo.startTime': [
{
limit: "required",
param: "",
errInfo: "开始时间不能为空"
},
{
limit: "dateTime",
param: "",
errInfo: "开始时间格式错误"
},
],
'workflowSettingInfo.endTime': [
{
limit: "required",
param: "",
errInfo: "结束时间不能为空"
},
{
limit: "dateTime",
param: "",
errInfo: "结束时间格式错误"
},
],
});
},
saveWorkflowSettingInfo: function () { saveWorkflowSettingInfo: function () {
if (!vc.component.addWorkflowSettingValidate()) { if (!vc.component.addWorkflowSettingValidate()) {
vc.toast(vc.validate.errInfo); vc.toast(vc.validate.errInfo);
@ -95,25 +25,20 @@
vc.component.workflowSettingInfo.communityId = vc.getCurrentCommunity().communityId; vc.component.workflowSettingInfo.communityId = vc.getCurrentCommunity().communityId;
vc.http.post( vc.http.apiPost(
'workflowSetting', 'workflow.updateWorkflow',
'save',
JSON.stringify(vc.component.workflowSettingInfo), JSON.stringify(vc.component.workflowSettingInfo),
{ {
emulateJSON: true emulateJSON: true
}, },
function (json, res) { function (json, res) {
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0); let data = JSON.parse(json);
if (res.status == 200) { if (data.code == 0) {
//关闭model vc.toast(data.msg);
$that.getBack();
vc.component.clearworkflowSettingInfo();
vc.emit('activitiesManage', 'listWorkflowSetting', {});
return; return;
} }
vc.toast(json); vc.toast(data.msg);
}, },
function (errInfo, error) { function (errInfo, error) {
console.log('请求失败处理'); console.log('请求失败处理');
@ -122,18 +47,6 @@
}); });
}, },
clearworkflowSettingInfo: function () {
vc.component.workflowSettingInfo = {
activitiesId: '',
title: '',
typeCd: '',
headerImg: '',
context: '',
startTime: '',
endTime: ''
};
},
_initWorkflowSettingInfo: function () { _initWorkflowSettingInfo: function () {
let flowId = vc.getParam('flowId'); let flowId = vc.getParam('flowId');
@ -142,8 +55,6 @@
vc.getBack(); vc.getBack();
return; return;
} }
let _that = $that.workflowSettingInfo;
$that.workflowSettingInfo.flowId = flowId; $that.workflowSettingInfo.flowId = flowId;
$that.workflowSettingInfo.flowName = vc.getParam('flowName'); $that.workflowSettingInfo.flowName = vc.getParam('flowName');
}, },