Commit 34022770 authored by hujun's avatar hujun

客户列表跟进增加状态标签

parent 2faff2a3
...@@ -179,26 +179,26 @@ class Member extends Basic{ ...@@ -179,26 +179,26 @@ class Member extends Basic{
/** /**
* 添加跟进 * 添加跟进
*
* @return \think\Response * @return \think\Response
*/ */
public function pcAddFollow(){ public function pcAddFollow(){
$status = 200; $status = 200;
$msg = '成功!'; $msg = '成功!';
$table= new UPhoneFollowPp; $table = new UPhoneFollowPp;
$params = $this->request->param(); $params = $this->request->param();
$time=date("Y-m-d H:i:s",time());//当前时间
if(!empty($params['content'])&&!empty($params['user_id'])){ if(empty($params['content']) || empty($params['user_id'])) {
$params['id']=''; return $this->response(101, $msg = '缺少参数', $params);
$params['labels_id']=0;
$params['agent_id'] = Session::get("user_info.id");
$params['type']=2;
$params['create_time'] =$time;
$params['update_time'] =$time;
$table->save($params);
return $this->response($status, $msg, $params);
}else{
return $this->response(101, $msg='缺少参数', $params);
} }
$params['id'] = '';
$params['labels_id'] = 0;
$params['agent_id'] = Session::get("user_info.id");
$params['type'] = 1;
$params['user_status'] = $params;
$table->allowField(true)->save($params);
return $this->response($status, $msg, $params);
} }
......
...@@ -303,7 +303,18 @@ ...@@ -303,7 +303,18 @@
</h4> </h4>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<textarea class="form-control" rows="3" id="genj_text"></textarea> <label class="col-sm-3 control-label">跟进:</label>
<div class="col-sm-9">
<textarea class="form-control" rows="3" id="genj_text"></textarea>
<span class="use-span text-danger">(必填)</span>
</div>
<label class="col-sm-3 control-label">状态标签:</label>
<div class="col-sm-9">
<label class="control-label">求租</label><input type="radio" name="user_status" value="0">
<label class="control-label">已租</label><input type="radio" name="user_status" value="1">
<label class="control-label">无效</label><input type="radio" name="user_status" value="-1">
<span class="text-danger">(必填)</span>
</div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭 <button type="button" class="btn btn-default" data-dismiss="modal">关闭
......
...@@ -48,6 +48,7 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', ' ...@@ -48,6 +48,7 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', '
}); });
$ (document).delegate (".genj_ure", "click", function () { $ (document).delegate (".genj_ure", "click", function () {
user.user_id = $ (this).attr ("data-id"); user.user_id = $ (this).attr ("data-id");
$("input[name = 'user_status']:checked").attr("checked",false);
}); });
$ (document).delegate ("#add_user", "click", function () {//新增客户 $ (document).delegate ("#add_user", "click", function () {//新增客户
user.user_id = $ (this).attr ("data-id"); user.user_id = $ (this).attr ("data-id");
...@@ -168,21 +169,33 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', ' ...@@ -168,21 +169,33 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', '
}); });
}, },
edit_add : function () {//提交跟进 edit_add : function () {//提交跟进
var user_status = $("input[name = 'user_status']:checked").val();
var genj_text = $("#genj_text").val();
if (genj_text == '') {
alert('跟进内容为空');
return false;
}
if (user_status == undefined) {
alert('状态标签未选中');
return false;
}
$.ajax ({ $.ajax ({
url: '/index/pcAddFollow', url: '/index/pcAddFollow',
type: 'POST', type: 'POST',
async: true, async: true,
data: { data: {
"user_id":user.user_id, "user_id" : user.user_id,
"content":$("#genj_text").val() "content" : genj_text,
"user_status": user_status
}, },
dataType: 'json', dataType: 'json',
success: function (data) { success: function (data) {
if (data.code == 200) { if (data.code != 200) {
} else {
alert(data.msg); alert(data.msg);
} }
} }
}); });
}, },
......
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