employeeAdd.html 13.6 KB
<div class="inmodal" >
    <div class="modal-header">
        <h4 class="modal-title">{{employeeId ? '修改':'添加'}}</h4>
        <button type="button" class="close" data-dismiss="modal" ng-click="$dismiss()" ng-disabled="saveBtnDisabled">
            <span aria-hidden="true">×</span> <span class="sr-only">Close</span>
        </button>
    </div>
    <div class="modal-body ofy-visible" style="min-height: 400px;">
        <form class="form-horizontal form-fixed form-fixed-6" name="creatForm" autocomplete="off">
        	
            <div class="ibox float-e-margins">
                <div class="ibox-content">
                    <div class="form-group" ng-if="!employeeId">
                        <label class="col-sm-2 control-label required">登录账号:</label>
                        <div class="col-sm-8">
                        	<!--  防止浏览器记住用户名及密码-->
                        	<input type="text"  autocomplete="off" name="accountName" style="width: 0px;height: 0px;position: absolute;z-index: -1;">
            				<input type="password" name="password" autocomplete="off" style="width: 0px;height: 0px;position: absolute;z-index: -1;">
            				
                            <input type="text" class="form-control" placeholder="3~15位字符,至少包含一个字母" name="accountName" autocomplete="off"
                            maxlength="15" required ng-model="info.accountName" ng-pattern="/^(?![0-9]+$)[0-9A-Za-z]{3,15}$/">
                            <div class="m-t-xs" ng-show="creatForm.accountName.$invalid && isInValidate">
                                <small class="text-danger" ng-show="true">请输入正确格式的登录账号</small>
                            </div>
                            <input type="text" style="width: 0px;height: 0px;position: absolute;z-index: -100;">
            				<input type="password" style="width: 0px;height: 0px;position: absolute;z-index: -1;">
                        </div>
                    </div>
                    <div class="form-group" ng-if="!employeeId || $root.loginUser.userType != 1 || $root.loginUser.isSuper">
                        <label class="col-sm-2 control-label required">姓名/名称:</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control" placeholder="请输入姓名/名称" name="name" required ng-model="info.name" maxlength="10">
                            <div class="m-t-xs" ng-show="creatForm.name.$invalid && isInValidate">
                                <small class="text-danger" ng-show="true">请输入姓名/名称</small>
                            </div>
                        </div>
                    </div>
                    <div class="form-group" ng-show="!employeeId">
                    	<label class="col-sm-2 control-label required">账户分类:</label>
                        <div class="col-sm-8">
                        	<label ng-repeat="item in employeeDictList" style="margin-right: 20px;">
	                        	<input icheck type="checkbox" ng-model="item.checked" ng-change="changePersonalCodeItem(item)"> {{item.confKey}}
	                        </label>
                      		<div class="m-t-xs" ng-show="selectPersonalCode && isInValidate">
                                <small class="text-danger">请至少选择一个员工分类</small>
                            </div>
            			</div>
            		</div>
                    <div class="form-group" ng-if="!employeeId && $root.loginUser.isSuper">
                        <label class="col-sm-2 control-label required">商户号:</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control" placeholder="请输入所属商户号" name="merchantId" ng-pattern="/^[1-9]\d*$/" 
                            ng-model="$parent.info.merchantId" required ng-blur="validMerchantId(info.merchantId)" maxlength="9" ng-change="changeMerchantId()">
                            <div class="m-t-xs">
                                <small class="text-danger">{{validMerchantMsg}}</small>
                                <small class="text-danger" ng-show="creatForm.merchantId.$invalid && isInValidate">请输入正确的商户号</small>
                            </div>
                        </div>
                    </div>
	            	<div class="form-group" ng-if="source != 1 && (!employeeId || $root.loginUser.userType != 1 || $root.loginUser.isSuper)">
	                    <label class="col-sm-2 control-label required">角色权限:</label>
	                    <div class="col-sm-8">
	                    	<ui-select class="a_select pd0" ng-model="$parent.info.role" name="role" theme="select2" required style="width:300px;">
                            	<ui-select-match placeholder="全部">{{$select.selected.name}}
                             	</ui-select-match>
                              	<ui-select-choices repeat="item in roleList | filter:{name:$select.search}">
                                	<span ng-bind="item.name"></span>
                             	</ui-select-choices>
                     		</ui-select>
                     		<div class="m-t-xs" ng-show="creatForm.role.$invalid && isInValidate">
                                <small class="text-danger" ng-show="true">请选择角色权限</small>
                            </div>
	                    </div>
	                </div>
                   <div class="form-group">
                		<label class="col-sm-2 control-label required">登录手机号:</label>
                		<div class="col-sm-10">
                  			<input type="text" class="form-control" placeholder="请输入登录手机号" ng-disabled="employeeId && info.loginPhone"
                  			name="loginPhone" ng-model="loginPhone" ng-pattern="/^[1][3,4,5,6,7,8,9][0-9]{9}$/" maxlength="11" style="width:58%;display:inline;" required>
                  			<!-- 
                  			<button type="button" class="btn btn-primary" ng-click="updateLoginPhone(3)" data-style="expand-right" ng-if="employeeId && !info.loginPhone" ng-disabled="!loginPhone">绑定</button>
                  			<button type="button" class="btn btn-primary" ng-click="changeEditLoginPhone(true)" data-style="expand-right" ng-if="employeeId && info.loginPhone && !editLoginPhone">修改</button>
                  			<button type="button" class="btn btn-primary" ng-click="updateLoginPhone(1)" data-style="expand-right" ng-if="employeeId && info.loginPhone && !editLoginPhone" ng-disabled="saveBtnDisabled2">解绑</button>
                  			<button type="button" class="btn btn-primary" ng-click="updateLoginPhone(2)" data-style="expand-right" ng-if="employeeId && editLoginPhone && info.loginPhone" ng-disabled="!loginPhone || loginPhone==info.loginPhone">确定</button>
                  			<button type="button" class="btn btn-primary" ng-click="changeEditLoginPhone(false)" data-style="expand-right" ng-if="employeeId && editLoginPhone && info.loginPhone">取消</button>
                  			 -->
                  			<div class="m-t-xs" ng-show="creatForm.loginPhone.$invalid && isInValidate">
                    			<p class="text-danger">请输入正确的登录手机号</p>
                  			</div>
                		</div>
              		</div>
              		
              		<div class="form-group">
	                    <label class="col-sm-2 control-label">主要职务:</label>
	                    <div class="col-sm-8">
	                        <label ng-repeat="item in dutyList" style="margin-right: 20px;">
	                        	<input icheck type="checkbox" ng-model="item.checked" ng-change="changeDutyItem(item)" /> {{item.name}}
	                        </label>
	                        <input type="text" class="form-control" placeholder="请输入自定义头衔,建议不超过4个汉字" ng-model="info.selfDuty" ng-change="inputDuty()" maxlength="20" style="width:300px;display:inline-block">
	                    </div>
					</div>
                   <div class="form-group">
                    	<label class="col-sm-2 control-label required">开通小程序名片:</label>
                       	<div class="col-sm-8">
                 	        <label><input icheck type="radio" value="1" ng-model="info.isOpenCard"> 是</label>
                            <label><input icheck type="radio" value="0" ng-model="info.isOpenCard"> 否</label>
          	            </div>
                   </div>
                    
                   <div ng-if="info.isOpenCard == 1">
                   <div class="form-group">
                        <label class="col-sm-2 control-label">账户分组:</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control" placeholder="请输入账户所在组别,如售后、售前,建议不超过4个字" name="accountGroup" ng-model="info.accountGroup" maxlength="20" />
                        </div>
                    </div>
                   
					<div class="form-group" style="height:140px;">
						<label class="control-label required">头像:</label>
						<div class="control-content col-lg-4">
							<div class="fileUploadArea clearfix pre">
								<img ng-src="{{info.photo}}" style="height:100px;width: 100px; border-radius: 50%;border:solid rgb(100,100,100) 1px;">
								<div style="color:#00a479;display: inline-block;">(请上传格式PNG,JPG图片,推荐大小在10MB内)</div>
								<p ng-show="!info.photo && isInValidate" class="text-danger form-text">请上传图片</p>
								<div class="files pa img"  name="file" ng-click="imgCrop()">
									<div class="add" ng-show='!info.photo'>+</div>
								</div>
							</div>
						</div>
					</div>
					<div class="form-group">
                        <label class="col-sm-2 control-label required">电话:</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control" placeholder="请输入11位手机号" name="phone"  required ng-model="info.phone" maxlength="11">
                            <div class="m-t-xs" ng-show="creatForm.phone.$invalid && isInValidate">
                                <small class="text-danger" ng-show="true">电话是必填项</small>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">微信:</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control" placeholder="请输入微信号,顾客可能会添加微信联系" name="wechatNum" ng-model="info.wechatNum" maxlength="20">
                            <div class="m-t-xs" ng-show="creatForm.wechatNum.$invalid && isInValidate">
                                <small class="text-danger" ng-show="true">请输入正确格式的微信号</small>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
	                    <label class="col-sm-2 control-label required">标签:</label>
	                    <div class="col-sm-8">
	                        <label ng-repeat="item in labelList" style="margin-right: 20px;">
	                        	<input icheck type="checkbox" name="" ng-checked='item.checked' ng-model="item.checked" ng-change="changeLabelItem(item)" 
	                        	ng-disabled="selectLabelName.length >= 5 && !item.checked"> {{item.name}}
	                        </label>
	                        <div ng-repeat="item in curSelfLabelList" class="selfLabel">
	                        	<input type="text" class="form-control" placeholder="请自定义标签,总标签数建议不超过5个" maxlength="20" ng-model="item.name" ng-change="changeLabelItem()"
	                        	ng-disabled="selectLabelName.length >= 5 && !item.name">
	                        	<div class="add" ng-click="addLabel();" ng-if="$last && curSelfLabelList.length < 5 && selectLabelName.length < 5">+</div>
	                        	<div class="add" ng-click="deleteLabel($index);" ng-if="!($index == 0 && curSelfLabelList.length == 1)">-</div>
	                        </div>
	                        <div class="m-t-xs" ng-show="selectLabelName.length == 0 && isInValidate">
                                <small class="text-danger">请选择或自定义标签</small>
                            </div>
	                    </div>
	                </div>
	                <div class="form-group">
	                    <label class="col-sm-2 control-label"></label>
	                    <div class="col-sm-8">*以上信息将显示在服务顾问名片上</div>
	                </div>
	                </div>
                </div>
            </div>
        </form>
    </div>
    <div class="modal-footer">
        <button ng-if="parentData.userType != 2" type="button" class="btn btn-primary" ng-click="ok()" ladda="submiting" data-style="expand-right">确认</button>
        <button type="button" class="btn btn-default" ng-click="$dismiss()">取消</button>
    </div>
</div>
<style>
	.fileUploadArea .img{
		width: 100px;
		height: 100px;
		opacity: 1;
	}
	.fileUploadArea .img input{
		position: relative;
		opacity: 0;
		z-index: 1;
	}
	.fileUploadArea .img .add{
		position: absolute;
		top: 50%;
		left: 50%;
		transform: translate(-50%,-50%);
		font-size: 20px;
		color: #000;
	}
	.selfLabel input{
		display:inline-block;
		width:80%;
	}
	.selfLabel .add{
		width: 20px;
		height: 20px;
		cursor: pointer;
		border: 1px solid;
		text-align: center;
		margin-left: 10px;
		border-radius: 100%;
		font-weight: bold;
		box-sizing: border-box;
		display:inline-block;
	}
</style>