employeeAdd.html
13.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
<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>