需求:增加郑州儿童医院的职称:中医师 主治中医师 副主任中医师
需在js中拿到appId这个变量,然后用ng-if=" "来判断,其中引号中的内容就是if语句的条件,正常写就可以
<td ng-switch="doctor.DoctorLevel" width="9%">
<span ng-switch-when="0">医师</span>
<span ng-switch-when="1">住院医师</span>
<span ng-switch-when="2">主治医师</span>
<span ng-switch-when="3">副主任医师</span>
<span ng-switch-when="4">主任医师</span>
<span ng-switch-when="5">专家</span>
<span ng-switch-when="6">主任中医师</span>
<span ng-switch-when="7">北京知名专家</span>
<span ng-switch-when="8">北京主任医师</span>
<span ng-switch-when="9">北京副主任医师</span>
<span ng-if="AppId=='501103'" ng-switch-when="10">中医师</span>
<span ng-if="AppId=='501103'" ng-switch-when="11">主治中医师</span>
<span ng-if="AppId=='501103'" ng-switch-when="12">副主任中医师</span>
</td>
<div class="input-group-btn">
<button type="button" ng-click="change()" class="btn btn-default dropdown-toggle btn-sm btn-square" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><span class="caret"></span></button>
<ul id="ul_offerchange" class="dropdown-menu dropdown-menu-right" style="width:200px;height:200px;overflow-y:auto;">
<li><a ng-click="currentDoctor.DoctorLevel = '0'">医师</a></li>
<li><a ng-click="currentDoctor.DoctorLevel = '1'">住院医师</a></li>
<li><a ng-click="currentDoctor.DoctorLevel = '2'">主治医师</a></li>
<li><a ng-click="currentDoctor.DoctorLevel = '3'">副主任医师</a></li>
<li><a ng-click="currentDoctor.DoctorLevel = '4'">主任医师</a></li>
<li><a ng-click="currentDoctor.DoctorLevel = '5'">专家</a></li>
<li><a ng-click="currentDoctor.DoctorLevel = '6'">主任中医师</a></li>
<li><a ng-click="currentDoctor.DoctorLevel = '7'">北京知名专家</a></li>
<li><a ng-click="currentDoctor.DoctorLevel = '8'">北京主任医师</a></li>
<li><a ng-click="currentDoctor.DoctorLevel = '9'">北京副主任医师</a></li>
<li><a ng-if="AppId=='501103'" ng-click="currentDoctor.DoctorLevel = '10'" >中医师</a></li>
<li><a ng-if="AppId=='501103'" ng-click="currentDoctor.DoctorLevel = '11'" >主治中医师</a></li>
<li><a ng-if="AppId=='501103'" ng-click="currentDoctor.DoctorLevel = '12'" >副主任中医师</a></li>
</ul>
</div>
//同步医生职称
$scope.AppId = config.appId;
$scope.getDoctorLevel = function (doctorLevel) {
var level;
switch (doctorLevel) {
case '0':
level = "医师";
break;
case '1':
level = "住院医师";
break;
case '2':
level = "主治医师";
break;
case '3':
level = "副主任医师";
break;
case '4':
level = "主任医师";
break;
case '5':
level = "专家";
break;
case '6':
level = "主任中医师";
break;
case '7':
level = "北京知名专家";
break;
case '8':
level = "北京主任医师";
break;
case '9':
level = "北京副主任医师";
break;
case '10':
level = "中医师";
break;
case '11':
level = "主治中医师";
break;
case '12':
level = "副主任中医师";
break;
default:
level = undefined;
break;
}
return level;
}