优化代码

This commit is contained in:
java110 2021-01-27 00:42:08 +08:00
parent c7f9bd1df7
commit bed248817c
2 changed files with 7 additions and 5 deletions

View File

@ -32,6 +32,7 @@
<div class="col-sm-10"> <div class="col-sm-10">
<select class="custom-select" v-model="addNoticeViewInfo.objType" @change="_changeObjType()"> <select class="custom-select" v-model="addNoticeViewInfo.objType" @change="_changeObjType()">
<option selected disabled value="">必填,请选择公告范围</option> <option selected disabled value="">必填,请选择公告范围</option>
<option value="005">关注用户</option>
<option value="001">小区</option> <option value="001">小区</option>
<option value="002">楼栋</option> <option value="002">楼栋</option>
<option value="003">单元</option> <option value="003">单元</option>

View File

@ -106,10 +106,11 @@
}); });
}, },
saveNoticeInfo: function () { saveNoticeInfo: function () {
if($that.addNoticeViewInfo.noticeTypeCd != '1003'){ if ($that.addNoticeViewInfo.noticeTypeCd != '1003') {
$that.addNoticeViewInfo.objType ='001'; $that.addNoticeViewInfo.objType = '001';
} }
if ($that.addNoticeViewInfo.objType == '001') { if ($that.addNoticeViewInfo.objType == '001'
|| $that.addNoticeViewInfo.objType == '005') {
$that.addNoticeViewInfo.objId = vc.getCurrentCommunity().communityId; $that.addNoticeViewInfo.objId = vc.getCurrentCommunity().communityId;
} else if ($that.addNoticeViewInfo.objType == '002') { } else if ($that.addNoticeViewInfo.objType == '002') {
$that.addNoticeViewInfo.objId = $that.addNoticeViewInfo.floorId; $that.addNoticeViewInfo.objId = $that.addNoticeViewInfo.floorId;
@ -129,9 +130,9 @@
return; return;
} }
if($that.addNoticeViewInfo.objId == "" ){ if ($that.addNoticeViewInfo.objId == "") {
vc.toast("未选择发布范围"); vc.toast("未选择发布范围");
return ; return;
} }
vc.component.addNoticeViewInfo.communityId = vc.getCurrentCommunity().communityId; vc.component.addNoticeViewInfo.communityId = vc.getCurrentCommunity().communityId;