|
|
@@ -54,6 +54,10 @@ class Returns extends Start_Controller {
|
|
|
}
|
|
|
else if($arg == 'scan_waybill'){
|
|
|
$this->_scanWaybill();
|
|
|
+ }elseif($arg == 'saveJiaji'){
|
|
|
+ $this->_saveJiaji();
|
|
|
+ }elseif($arg == 'jiajiover'){
|
|
|
+ $this->_jiajiover();
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
@@ -189,7 +193,7 @@ class Returns extends Start_Controller {
|
|
|
$where .= " and ".$xztime." > '$timetk' and ".$xztime." < '$timetj'";
|
|
|
}
|
|
|
//数据排序
|
|
|
- $order_str = $xztime." desc";
|
|
|
+ $order_str = " is_jiaji desc, ".$xztime." desc";
|
|
|
if(empty($page))
|
|
|
{
|
|
|
$start = 0;
|
|
|
@@ -199,7 +203,7 @@ class Returns extends Start_Controller {
|
|
|
{
|
|
|
$start = ($page - 1)*$perpage;
|
|
|
}
|
|
|
- $info_list = $this->returns->find_all($where,'id,region,number,name,express,torderinfo,shop,,time,edittime,qr',$order_str,$start,$perpage);
|
|
|
+ $info_list = $this->returns->find_all($where,'id,region,number,name,express,torderinfo,shop,,time,edittime,qr,is_jiaji,jiaji_status,extra_cont',$order_str,$start,$perpage);
|
|
|
foreach ($info_list as $key=>$value)
|
|
|
{
|
|
|
$info_list[$key]['time'] = date('Y-m-d H:i:s',$value['time']);
|
|
|
@@ -231,13 +235,40 @@ class Returns extends Start_Controller {
|
|
|
}
|
|
|
if($value['qr'] == '0')
|
|
|
{
|
|
|
- $info_list[$key]['qr'] = '<span class="thqr" data-id="'.$value['id'].'">未处理</span>';
|
|
|
+ $str = '<span class="thqr" data-id="'.$value['id'].'">未处理</span>';
|
|
|
+ if($value['is_jiaji'] == 0){
|
|
|
+ if($value['jiaji_status'] == 0){
|
|
|
+ $str .= '<span style="background-color:#f33" data-id="'.$value['id'].'" onclick="addJiaji(this)">加急</span>';
|
|
|
+ }
|
|
|
+
|
|
|
+ }else{
|
|
|
+ if($value['jiaji_status'] == 0){
|
|
|
+ $str .= '<br/><span style="background-color:#f33" data-id="'.$value['id'].'" onclick="huizhiJiaji(this)">加急回执</span>';
|
|
|
+ }elseif($value['jiaji_status'] == 1){
|
|
|
+ $str .= '<br/><span style="background-color:#f33" onclick="jiajiover('.$value['id'].')">加急完成</span>';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $info_list[$key]['qr'] = $str;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
$info_list[$key]['qr'] = '<span class="thqr" style="background-color:#ccc" data-id="'.$value['id'].'">已处理</span>';
|
|
|
}
|
|
|
-
|
|
|
+ if($value['is_jiaji'] == 1){
|
|
|
+ $extra = json_decode($value['extra_cont'],true);
|
|
|
+ $str = "";
|
|
|
+ if(!empty($extra['dy_jiaji'])){
|
|
|
+ $str .= '店员备注:'.$extra['dy_jiaji']['jiaji_remark']."<br/>";
|
|
|
+ }
|
|
|
+ if(!empty($extra['mc_jiaji'])){
|
|
|
+ $str .= '仓库回执:'.$extra['mc_jiaji']['jiaji_huizhi']."<br/>";
|
|
|
+ }
|
|
|
+ $str = trim($str,"<br/>");
|
|
|
+ $info_list[$key]['number'] = '<div style="position: relative;padding-top:10px;color:red;"><i class="method_self fa fa-list-ul" data-t="'.$str.'" style="position: absolute;top: 0;right: 0;"></i> '.$value['number']."</div>";;
|
|
|
+ }
|
|
|
+ unset($info_list[$key]['is_jiaji']);
|
|
|
+ unset($info_list[$key]['extra_cont']);
|
|
|
+ unset($info_list[$key]['jiaji_status']);
|
|
|
}
|
|
|
$total = $this->returns->find_count($where);
|
|
|
$pagenum = ceil($total/$perpage);
|
|
|
@@ -983,4 +1014,69 @@ class Returns extends Start_Controller {
|
|
|
$this->_Template('returns_scanwaybill',$this->data);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ private function _saveJiaji(){
|
|
|
+ if($this->input->method() === 'post'){
|
|
|
+ $id = $this->input->post('id',true);
|
|
|
+ $val = $this->input->post('val',true);
|
|
|
+ $column = $this->input->post('column',true);
|
|
|
+ $info = $this->returns->read($id);
|
|
|
+ $extra_cont = json_decode($info['extra_cont'],true);
|
|
|
+ if($column == 'jiaji_remark'){
|
|
|
+ $dy_jiaji = [
|
|
|
+ 'jiaji_remark'=>$val,
|
|
|
+ 'time'=>date('Y-m-d H:i:s'),
|
|
|
+ ];
|
|
|
+ $extra_cont['dy_jiaji'] = $dy_jiaji;
|
|
|
+ $update_arr = [
|
|
|
+ 'is_jiaji'=>1,
|
|
|
+ 'extra_cont'=>json_encode($extra_cont,JSON_UNESCAPED_UNICODE),
|
|
|
+ ];
|
|
|
+ }elseif($column == 'jiaji_huizhi'){
|
|
|
+ $mc_jiaji = [
|
|
|
+ 'jiaji_huizhi'=>$val,
|
|
|
+ 'time'=>date('Y-m-d H:i:s'),
|
|
|
+ ];
|
|
|
+ $extra_cont['mc_jiaji'] = $mc_jiaji;
|
|
|
+ $update_arr = [
|
|
|
+ 'jiaji_status'=>1,
|
|
|
+ 'extra_cont'=>json_encode($extra_cont,JSON_UNESCAPED_UNICODE),
|
|
|
+ ];
|
|
|
+ }else{
|
|
|
+ echo json_encode(['code'=>-1,'msg'=>'数据类型异常']);exit;
|
|
|
+ }
|
|
|
+ $r = $this->returns->save($update_arr,$id);
|
|
|
+ if($r){
|
|
|
+ echo json_encode(['code'=>1,'msg'=>'操作成功']);exit;
|
|
|
+ }else{
|
|
|
+ echo json_encode(['code'=>-1,'msg'=>'操作失败']);exit;
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ echo json_encode(['code'=>-1,'msg'=>'请求方式错误']);exit;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private function _jiajiover(){
|
|
|
+ if($this->input->method() === 'post'){
|
|
|
+ $id = $this->input->post('id',true);
|
|
|
+ $info = $this->returns->read($id);
|
|
|
+ if($info['jiaji_status'] == 1 && $info['is_jiaji'] == 1){
|
|
|
+ $update_arr = [
|
|
|
+ 'jiaji_status'=>2,
|
|
|
+ 'is_jiaji'=>0,
|
|
|
+ ];
|
|
|
+ $r = $this->returns->save($update_arr,$id);
|
|
|
+ if($r){
|
|
|
+ echo json_encode(['code'=>1,'msg'=>'操作成功']);exit;
|
|
|
+ }else{
|
|
|
+ echo json_encode(['code'=>-1,'msg'=>'操作失败']);exit;
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ echo json_encode(['code'=>-1,'msg'=>'当前状态不允许进行操作']);exit;
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ echo json_encode(['code'=>-1,'msg'=>'请求方式错误']);exit;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|