Commit 2d15dc90 authored by agping's avatar agping

后台职称 修改

parent c9197b33
...@@ -137,11 +137,11 @@ ...@@ -137,11 +137,11 @@
新增职称人员 新增职称人员
</h4> </h4>
</div> </div>
<div class="modal-body" style="height: 500px;"> <div class="modal-body" style="height: 350px;">
<form class="form-horizontal" id="form_reset"> <form class="form-horizontal" id="form_reset">
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">职称:</label> <label class="col-sm-3 control-label">职称:</label>
<select name="district_id" class="form-control btn6"> <select id="professional_id" class="form-control btn6">
<option value="-1">选择职称</option> <option value="-1">选择职称</option>
<option value="1">店长</option> <option value="1">店长</option>
<option value="2">经理</option> <option value="2">经理</option>
...@@ -159,6 +159,13 @@ ...@@ -159,6 +159,13 @@
</div> </div>
</form> </form>
</div> </div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal" id="close">关闭
</button>
<button type="button" class="btn btn-primary" id="add_professional">
提交
</button>
</div>
</div><!-- /.modal-content --> </div><!-- /.modal-content -->
</div><!-- /.modal --> </div><!-- /.modal -->
</div> </div>
......
...@@ -11,7 +11,6 @@ define(['doT', 'text!temp/professional_list_template_tpl.html', 'text!temp/repor ...@@ -11,7 +11,6 @@ define(['doT', 'text!temp/professional_list_template_tpl.html', 'text!temp/repor
init: function() { init: function() {
//初始化dot //初始化dot
$(document.body).append(template); $(document.body).append(template);
//初始化 站点城市筛选
professional.event(); professional.event();
professional.getList(1); professional.getList(1);
...@@ -49,7 +48,7 @@ define(['doT', 'text!temp/professional_list_template_tpl.html', 'text!temp/repor ...@@ -49,7 +48,7 @@ define(['doT', 'text!temp/professional_list_template_tpl.html', 'text!temp/repor
var _this = $(this); var _this = $(this);
_this.removeClass('btn-default').addClass('btn-info').siblings().removeClass('btn-info').addClass('btn-default'); _this.removeClass('btn-default').addClass('btn-info').siblings().removeClass('btn-info').addClass('btn-default');
if(_this.index() == 0){ if(_this.index() == 0){
professional.mainTabIndex = ''; professional.mainTabIndex = 5;
} }
if(_this.index() == 1){ if(_this.index() == 1){
professional.mainTabIndex = 1; professional.mainTabIndex = 1;
...@@ -72,13 +71,37 @@ define(['doT', 'text!temp/professional_list_template_tpl.html', 'text!temp/repor ...@@ -72,13 +71,37 @@ define(['doT', 'text!temp/professional_list_template_tpl.html', 'text!temp/repor
_doc.on('click', '#maintable_search', function(e) { _doc.on('click', '#maintable_search', function(e) {
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
professional.getList(1); //一级审核搜索 professional.getList(1);
}); });
//搜索的重置 //搜索的重置
$("#maintable_reset").click(function() { $("#maintable_reset").click(function() {
document.getElementById("maintable_form_search").reset(); document.getElementById("maintable_form_search").reset();
professional.agent_id_choose=''; professional.agent_id_choose='';
}); });
$("#add_professional").click(function() {
professional.addProfessional(); //新增 职称人员
});
},
//新增 职称人员
addProfessional: function() {
$.ajax({
url: '/index/updatePosition',
type: 'GET',
async: true,
data: {
"agent_id": professional.agent_id_choose_add,
"position": $("#professional_id").val()
},
dataType: 'json',
success: function(data) {
if(data.code == 200) {
} else {
alert(data.msg);
}
}
});
}, },
//获取不同职位的列表 //获取不同职位的列表
getList: function(pageNo){ getList: function(pageNo){
...@@ -88,7 +111,7 @@ define(['doT', 'text!temp/professional_list_template_tpl.html', 'text!temp/repor ...@@ -88,7 +111,7 @@ define(['doT', 'text!temp/professional_list_template_tpl.html', 'text!temp/repor
'pageSize': professional.pageSize, 'pageSize': professional.pageSize,
'name':professional.agent_id_choose, 'name':professional.agent_id_choose,
'phone':$('#realtime_city_choose').val(), 'phone':$('#realtime_city_choose').val(),
'position':professional.order_ranking, 'position':professional.mainTabIndex,
}; };
$.ajax({ $.ajax({
type: 'GET', type: 'GET',
...@@ -102,7 +125,6 @@ define(['doT', 'text!temp/professional_list_template_tpl.html', 'text!temp/repor ...@@ -102,7 +125,6 @@ define(['doT', 'text!temp/professional_list_template_tpl.html', 'text!temp/repor
success: function(data) { success: function(data) {
if(typeof data === 'object') { if(typeof data === 'object') {
if(data.code == 200) { if(data.code == 200) {
// var tpl=professional.switchTpl();
var tpl='professional_list_tpl'; var tpl='professional_list_tpl';
console.log(tpl); console.log(tpl);
var doTtmpl = doT.template(document.getElementById(tpl).innerHTML); var doTtmpl = doT.template(document.getElementById(tpl).innerHTML);
...@@ -184,7 +206,7 @@ define(['doT', 'text!temp/professional_list_template_tpl.html', 'text!temp/repor ...@@ -184,7 +206,7 @@ define(['doT', 'text!temp/professional_list_template_tpl.html', 'text!temp/repor
addphoneAgentAdd: function(obj) {//客户列表 客方姓名 搜索 input赋值(新增) addphoneAgentAdd: function(obj) {//客户列表 客方姓名 搜索 input赋值(新增)
var user_ht = $(obj).html(); var user_ht = $(obj).html();
$("#user_agent_name_add").val(user_ht); $("#user_agent_name_add").val(user_ht);
$(".user-ul-agent_add").html(''); $(".user-ul-agent-add").html('');
professional.agent_id_choose_add = $(obj).attr("data-id"); professional.agent_id_choose_add = $(obj).attr("data-id");
}, },
}; };
......
<!--职称列表--> <!--职称列表-->
<script id="professional_list_tpl" type="text/template"> <script id="professional_list_tpl" type="text/template">
[% var sw=function(s){switch(Number(s)){case 2:return"btn-info";case 1:return"btn-default"}}; %] [% var sw=function(s){switch(Number(s)){case 0:return"新人";case 1:return"店长";case 2:return"经理";case 3:return"主任";case 4:return"顾问";case 1:return"无职称"}}; %]
[% var sw2=function(s){switch(Number(s)){case 10:return"业务员";case 20:return"店长";case 30:return"总监";case 40:return"店长和总监"}}; %]
[% if(it && it.length && it.length>0) { %] [% if(it && it.length && it.length>0) { %]
<tr class="maintable-tr-bar"> <tr class="maintable-tr-bar">
<th class="text-center">用户ID</th> <th class="text-center">用户ID</th>
...@@ -13,19 +14,15 @@ ...@@ -13,19 +14,15 @@
</tr> </tr>
[% for(var item in it){ %] [% for(var item in it){ %]
<tr data-id="[%= it[item]['district_id'] %]"> <tr data-id="[%= it[item]['district_id'] %]">
<td class="text-center">[%= it[item]['index_'] %]</td> <td class="text-center">[%= it[item]['id'] %]</td>
<td class="text-center">[%= it[item]['index_'] %]</td> <td class="text-center">[%= sw2(it[item]['level']) %]</td>
<td class="text-center">[%= it[item]['index_'] %]</td> <td class="text-center">[%= sw(it[item]['position']) %]</td>
<td class="text-center">[%= it[item]['index_'] %]</td> <td class="text-center">[%= it[item]['store_name'] %]</td>
<td class="text-center">[%= it[item]['index_'] %]</td> <td class="text-center">[%= it[item]['name'] %]</td>
<td class="text-center">[%= it[item]['index_'] %]</td> <td class="text-center">[%= it[item]['phone'] %]</td>
<td class="text-center"> <td class="text-center">
<a class="btn1 is_show [%= sw(it[item]['is_collect']) %]" data-id='[%= it[item]["id"] %]' data-cid='[%= it[item]["is_collect"] %]' data-baohu='[%= it[item]["is_outstrip_twenty_four_hours"] %]' data-agent='[%= it[item]["agent_id"] %]'> <a class="btn1 btn-info concel-professional" data-id='[%= it[item]["id"] %]' data-agent='[%= it[item]["agent_id"] %]'>
[% if(it[item]["is_collect"] == 2) { %] 取消职称
收藏
[% }else if(it[item]["is_collect"] == 1 ) { %]
取消收藏
[% } %]
</a> </a>
</td> </td>
</tr> </tr>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment