科恒数字网-持续研发、集成、交付、运营方案资源库
标题: 给ecshop订单流程增加拣货状态,最新版本,支持ECSHOP3.6系统 [打印本页]
作者: admin 时间: 2020-6-12 09:15
标题: 给ecshop订单流程增加拣货状态,最新版本,支持ECSHOP3.6系统
针对ecshop订单中的物品,需要支持拣货的状态,比如未拣货、拣货中、拣货完成,以及显示拣货人姓名。
# W& x7 j+ w. u5 Z+ o" Q/ a. n
' O6 O7 b; Q9 |1.SQL操作: ]1 j9 }2 s. a
" K! ~5 h0 S. S" F: y! N
2.在文件languages\zh_cn\admin\order.php中增加:
, t; U* k5 x. Q# P( j6 m' o) _2 [2 C6 Y2 I6 f# c) a% _
/* 拣货 */5 ?- K% k; t6 p+ a
$_LANG['order_picking_status'] = '拣货状态';+ T; ^! U0 Z+ D! a' o4 w$ w# Z
$_LANG['order_picking_status_none'] = '未拣货';6 j- H8 e2 ^0 g; z; K# M
$_LANG['order_picking_status_processing'] = '拣货中';
( N. f/ Y6 h; A% f: g' Z$_LANG['order_picking_status_finish'] = '拣货完成';
8 e# |# {0 w# [4 n$_LANG['invalid_order_picking_status'] = '拣货状态无效。0:未拣货;1:拣货中;2:拣货完成';
* n4 s i6 k, E4 M
$ i+ |4 g. k# U) `* u9 w- `/ s6 z4 ]( {8 e2 d" y! R& r' Y2 x
3.文件admin\templates\order_list.htm中在一下两行之间: p- O/ Z8 L0 U2 @0 C% ^
第一个地方
# d7 z: B4 b5 U! T5 @<th>{$lang.all_status}</th>- L6 e/ k5 S. z
<th>{$lang.handler}</th># B1 l* ]' L& g
中间加上 g2 U) u+ c8 T3 `9 D h! m
<th>{$lang.order_picking_status}</th>) M5 D# K7 E! ]5 T2 g
# k' A9 r$ L7 X8 L- L& V! }) G第二个地方4 r7 B; k5 |* M6 c
在<td align="center" valign="top" nowrap="nowrap">{$lang.os[$order.order_status]},{$lang.ps[$order.pay_status]},{$lang.ss[$order.shipping_status]}</td>9 x! \2 k) [1 E" C+ m
后面加上
7 @+ m3 d0 K/ j$ u( s<td align="right" valign="top"nowrap="nowrap"><span>{$order.user_name}【{if $order.order_picking_status == 1}{$lang.order_picking_status_processing}{elseif $order.order_picking_status ==2} {$lang.order_picking_status_finish} {else}{$lang.order_picking_status_none}{/if}】</span></td>/ a! D/ p; U0 D p
5 s0 I8 G9 [" f4 r+ f& R! Y9 l
+ A8 A7 r& ?" x4 @1 P% m
5 f$ v: M: A$ B/ B5 `7 P
4.admin\js\listtable.js中,listTable.edit的响应函数修改如下:
8 }' b7 r. A& b7 r/ J! H
( u9 X) x/ ~- F* d5 s
/ j n" X* O3 C R/**
* 创建一个可编辑区
*/
listTable.edit = function(obj, act, id)
{
var tag =obj.firstChild.tagName;
if (typeof(tag) !="undefined" && tag.toLowerCase() == "input")
{
return;
}
/* 保存原始的内容 */
var org = obj.innerHTML;
var val = Browser.isIE ?obj.innerText : obj.textContent;
/* 创建一个输入框 */
var txt =document.createElement("INPUT");
txt.value = (val == 'N/A') ?'' : val;
txt.style.width =(obj.offsetWidth + 12) + "px" ;
/* 隐藏对象中的内容,并将输入框加入到对象中 */
obj.innerHTML ="";
obj.appendChild(txt);
txt.focus();
txt.select();
/* 编辑区输入事件处理函数 */
txt.onkeypress = function(e)
{
var evt =Utils.fixEvent(e);
var obj =Utils.srcElement(e);
if (evt.keyCode == 13)//www.zuimoban.com
{
obj.blur();
return false;
}
if (evt.keyCode == 27)
{
obj.parentNode.innerHTML= org;
}
}
/* 编辑区失去焦点的处理函数 */
txt.onblur = function(e)
{
if(Utils.trim(txt.value).length > 0)
{
res =Ajax.call(listTable.url, "act="+act+"&val=" +encodeURIComponent(Utils.trim(txt.value)) + "&id=" +id, null,"POST", "JSON", false);
if (res.message)
{
alert(res.message);
}
if(res.id &&(res.act == 'goods_auto' || res.act == 'article_auto'))
{
document.getElementById('del'+res.id).innerHTML = "<ahref=\""+ thisfile +"?goods_id="+ res.id+"&act=del\" onclick=\"returnconfirm('"+deleteck+"');\">"+deleteid+"</a>";
}
obj.innerHTML = (res.error== 0) ? res.content : org;
}
else
{
obj.innerHTML = org;
}
if (act =='edit_is_validated')
{
var content = obj.innerHTML.trim();
if (content == '1' || content.indexOf("yes") >= 0)
{
obj.innerHTML = '<imgsrc="images/yes.gif">';
}
else
{
obj.innerHTML ='<img src="images/no.gif">';
}
}
else if (act =='edit_order_picking_status')
{
if (org == obj.innerHTML)
{
return true;
}
if (obj.innerHTML == '1')
{
obj.innerHTML ="【拣货中】";
}
else if (obj.innerHTML == '2')
{
obj.innerHTML ="【拣货完成】";
}
else
{
obj.innerHTML ="【未拣货】";
}
}
else
{
}
}
0 k/ J' i: m; J9 v* |+ m2 K
}
# a d5 N& ~# T) k; g' f1 C; }
5.admin\order.php文件中增加下面的函数:
; ~& ?) m. M# g. {! k7 A0 _0 i0 W) [2 I
/*------------------------------------------------------ */$ n& j& W3 p% c8 X# F% }/ G6 T3 I
//-- 订单拣货状态查询
/ g. s Y; @4 _, G O, K/*------------------------------------------------------ */
3 r7 q" b" W7 g6 \( ]2 J / }* v$ A4 ?% C3 Z8 x
if ($_REQUEST['act'] == 'edit_order_picking_status')
/ O5 H6 r7 T/ E{
: [7 B! B. S d+ I% j1 W /* 检查权限 */
2 W3 Z1 K. `3 W! q3 x check_authz_json('users_manage');6 t5 v+ Y i! b
" r1 r7 [: _. ]; v7 _ $id =empty($_REQUEST['id']) ? 0 : intval($_REQUEST['id']);
$ F7 V# x1 o6 G $order_picking_status =empty($_REQUEST['val']) ? '' : json_str_iconv(trim($_REQUEST['val']));) v) }( u" i0 }/ L, p5 @6 L' v) G
$ ]1 M6 L& o' ]/ ^4 J: k+ x7 I% [+ W8 y $sql = "DELETE fromorder_picking_status WHERE order_id = '". $id ."' LIMIT 1";
! t! l/ {0 W" p $db->query($sql);
' L$ H7 A- [) f! p2 L ! m6 E: x% j. A \ ]
$sql = "INSERT INTOorder_picking_status (order_id, user_name, order_picking_status) VALUES('". $id ."', '". $_SESSION['admin_name'] ."', '".$order_picking_status ."')";, Z) E* X9 M+ P" C8 l
$db->query($sql);* }& R* i U) X% p# C2 e0 i
2 H& C2 b' Q( H8 v- X if ($order_picking_status> 2 || $order_picking_status < 0)
$ B e+ r; P- F$ y# R* d5 R {/ o( W$ Y, Z" t; v
make_json_error($GLOBALS['_LANG']['invalid_order_picking_status']); p% Q4 d# H: b) B
}, C7 J; w7 |6 {: k H
else3 f1 w7 S. M- |6 Z, ]% ~, V
{
! q) z% h& U0 J: X+ v9 p5 e( q2 k make_json_result($order_picking_status);" w l8 o( y3 f- T+ d
}
8 s$ _6 p: ^! a- Z6 ?}# o( P, w& Z, P% T# L; x0 E
) L* u( Z9 K+ c$ \% U6 T
6、admin\order.php文件中增加下面的函数将以下代码
# W( w2 r6 \" h# G* d2 Q7 N4 g! o /* 查询 */0 Z0 I. y3 |, j
$sql = "SELECT o.*," .
" j0 y+ w# o7 x" r8 o4 G "o.pay_status, o.consignee, o.firstname, o.lastname, o.address, o.email, o.tel, o.extension_code, o.extension_id, " .
1 p: U: d( g, J2 I "(" . order_amount_field('o.') . ") AS total_fee, " .
; [' z3 s7 a+ L0 B" R* j+ B "IFNULL(u.user_name, '" .$GLOBALS['_LANG']['anonymous']. "') AS buyer ".
- z: S/ N( l. { " FROM " . $GLOBALS['ecs']->table('order_info') . " AS o " .
1 v) j1 Y: J9 E* A+ I, d4 E " LEFT JOIN " .$GLOBALS['ecs']->table('users'). " AS u ON u.user_id=o.user_id ". $where .
* G' S% X" X& u0 F2 | " ORDER BY $filter[sort_by] $filter[sort_order] ".
. ?8 y& R6 [ B* p " LIMIT " . ($filter['page'] - 1) * $filter['page_size'] . ",$filter[page_size]"; $ ^2 Q9 A9 S2 ~4 ?$ H
修改为:! u% m+ k/ S: O I) e$ V
//* 查询 */3 I$ W0 K0 O6 {6 p, ?8 ?
$sql = "SELECT o.*," .' g; t( Y0 N! M0 n \
"o.pay_status, o.consignee, o.firstname, o.lastname, o.address, o.email, o.tel, o.extension_code, o.extension_id, " .
# P1 S1 ~1 M# Y: \' @; \ Z0 X "(" . order_amount_field('o.') . ") AS total_fee, " .- c1 l' V1 h# i: G" z+ n4 r& N
"IFNULL(u.user_name, '" .$GLOBALS['_LANG']['anonymous']. "') AS buyer , p.user_name, p.order_picking_status, r.order_reply_status ".
e+ D* R& U# S$ k4 H " FROM " . $GLOBALS['ecs']->table('order_info') . " AS o " .
# R! S; n. T, [% d2 ~2 _ " LEFT JOIN " .$GLOBALS['ecs']->table('users'). " AS u ON u.user_id=o.user_id ". + O, k" F7 `) c
" LEFT JOIN order_reply_status AS r ON r.order_id = o.order_id ". / o8 l4 D; [! i' r
" LEFT JOIN order_picking_status AS p ON p.order_id = o.order_id ". $where .: O8 O$ A( z- t2 [4 p& O
" ORDER BY $filter[sort_by] $filter[sort_order] ".
" B5 W7 V+ N1 s: i2 M# y: A " LIMIT " . ($filter['page'] - 1) * $filter['page_size'] . ",$filter[page_size]";5 I/ e r6 _& A, }# B
" j& n0 L: u0 _( ?6 q) c1 ]6 w! p: b
. S9 f/ J/ Z" |
| 欢迎光临 科恒数字网-持续研发、集成、交付、运营方案资源库 (https://www.khcic.com/) |
Powered by Discuz! X3.5 |