科恒数字网-持续研发、集成、交付、运营方案资源库
标题: 给ecshop订单流程增加拣货状态,最新版本,支持ECSHOP3.6系统 [打印本页]
作者: admin 时间: 2020-6-12 09:15
标题: 给ecshop订单流程增加拣货状态,最新版本,支持ECSHOP3.6系统
针对ecshop订单中的物品,需要支持拣货的状态,比如未拣货、拣货中、拣货完成,以及显示拣货人姓名。
9 v4 S6 n+ _1 w) X/ [# h7 e9 s" X' q/ b* w I3 l
1.SQL操作:5 x N5 B2 V4 _6 a
6 c B9 S" H, q( f" c$ Y
2.在文件languages\zh_cn\admin\order.php中增加:9 ?& p% l5 X9 ]% g+ U
( ]# T2 |0 L$ v6 }. z+ B
/* 拣货 */
) O% x' D9 d* ~$_LANG['order_picking_status'] = '拣货状态';; x/ O% s, d8 R
$_LANG['order_picking_status_none'] = '未拣货';* D* v$ \4 {$ l2 A, R6 U
$_LANG['order_picking_status_processing'] = '拣货中';4 m' k# G$ o5 I& D1 N
$_LANG['order_picking_status_finish'] = '拣货完成';" x: _) f- h6 [: H
$_LANG['invalid_order_picking_status'] = '拣货状态无效。0:未拣货;1:拣货中;2:拣货完成';; n& {5 P: }& C6 v) T" C# V m
% `5 _+ a5 E& q+ o- `- R) v( w0 p
! N* p) P- y# [" o- F3.文件admin\templates\order_list.htm中在一下两行之间:: G! l# u$ w" U" L9 O
第一个地方
9 N5 u6 R; l9 x! B& Q4 r<th>{$lang.all_status}</th>
, w7 h2 R$ v" b$ e: f<th>{$lang.handler}</th>
5 ^3 r/ Z9 C# I! ~中间加上
0 O m+ O2 ]: p( \! P! {+ u<th>{$lang.order_picking_status}</th>
& R1 {# e2 ~, Z( Q" R+ p+ }/ t7 C- E8 |/ ^, L
第二个地方1 B) {7 ~' O) L" q6 \6 ]& C1 E p
在<td align="center" valign="top" nowrap="nowrap">{$lang.os[$order.order_status]},{$lang.ps[$order.pay_status]},{$lang.ss[$order.shipping_status]}</td>
2 r+ e2 R1 J' E- g. X0 @后面加上0 J" b, S" d2 q
<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>) ]. ?( P! ]' `1 L7 L
5 R! J: x8 U+ X$ K0 `9 o; b3 m5 f
& i9 [% K3 h) \" }
( n) ]$ p" r+ c4 [4.admin\js\listtable.js中,listTable.edit的响应函数修改如下:
D+ u& t) l2 _" t+ ]
3 A1 A7 `8 e+ E p1 Z! \
1 _5 p3 R: K! d3 [0 H" K/**
* 创建一个可编辑区
*/
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
{
}
}
% t0 G0 h6 K: A( Q& [
}
! E/ @2 s* A/ _" `& v+ J$ ~5.admin\order.php文件中增加下面的函数:
# F3 q+ n% i: Z7 \+ n$ U& }- `# y( b8 [" p0 A
/*------------------------------------------------------ */
1 a; \ H+ j9 E# P5 I# b8 r//-- 订单拣货状态查询4 E& [0 A9 o2 {) l
/*------------------------------------------------------ */
) Z: o9 g6 r7 m- O+ o
4 S- B! l1 M- A, k3 g9 f; Oif ($_REQUEST['act'] == 'edit_order_picking_status')
, m2 D: J3 p* T9 m$ `/ m2 A4 u! ~{
% O# p, `% d& M0 h+ Y' x /* 检查权限 */; Q8 w! [' |% B; K) D2 M! A2 X+ @
check_authz_json('users_manage');
; ?9 u- u, q8 [7 Y7 ^) Q0 A) B
, w& m- u: \0 {$ W# W+ q $id =empty($_REQUEST['id']) ? 0 : intval($_REQUEST['id']);
8 v* Q f, I$ _" d9 j: p- ?5 S $order_picking_status =empty($_REQUEST['val']) ? '' : json_str_iconv(trim($_REQUEST['val']));
/ w) _) o* }" B% w# u4 q7 W 7 O0 H9 t' D5 f
$sql = "DELETE fromorder_picking_status WHERE order_id = '". $id ."' LIMIT 1";3 c, s5 V \" ^5 u
$db->query($sql);, _+ x9 H Y* r
( s2 c i. H; d8 E( v
$sql = "INSERT INTOorder_picking_status (order_id, user_name, order_picking_status) VALUES('". $id ."', '". $_SESSION['admin_name'] ."', '".$order_picking_status ."')";
! U# E7 {. n5 ^1 h3 e9 d $db->query($sql);* |/ K6 P3 F& l8 {4 J8 Y3 f
9 N) T2 @2 d) ^ if ($order_picking_status> 2 || $order_picking_status < 0), x4 d$ D" _0 v; i1 z G# T
{
) l' M+ @) B0 p" o8 m% Y( E' T make_json_error($GLOBALS['_LANG']['invalid_order_picking_status']);
6 Q) C' Z* j$ ?$ X) \$ M8 r- p }, A0 T5 i% l# J
else' j* x9 c& e9 l- {9 @ o
{
. V ~! m- l. L5 E. m0 g- g make_json_result($order_picking_status);
& F7 ]4 N* ^4 J }
' m3 I: o9 ]5 @0 k. O! \}
1 }8 w; m# N, T% R, [2 ~6 Y& Z( C2 u! N5 Q, }( {
6、admin\order.php文件中增加下面的函数将以下代码# L4 D( @+ o; h5 o
/* 查询 */
4 \0 g- }2 _- q5 K' M! ?) |+ A* ^$sql = "SELECT o.*," .
0 N$ i; {" d6 y "o.pay_status, o.consignee, o.firstname, o.lastname, o.address, o.email, o.tel, o.extension_code, o.extension_id, " .8 V7 p( j3 o% \
"(" . order_amount_field('o.') . ") AS total_fee, " .: L# Q7 w7 x) C+ A' I
"IFNULL(u.user_name, '" .$GLOBALS['_LANG']['anonymous']. "') AS buyer "." D i5 j/ N9 O+ \5 ^3 Q' P
" FROM " . $GLOBALS['ecs']->table('order_info') . " AS o " .
) c1 @# v/ m/ P0 _5 ~& L* a3 p " LEFT JOIN " .$GLOBALS['ecs']->table('users'). " AS u ON u.user_id=o.user_id ". $where . 2 S. U [, y( v
" ORDER BY $filter[sort_by] $filter[sort_order] ".
# K7 A: \7 a4 s L3 q6 U3 H " LIMIT " . ($filter['page'] - 1) * $filter['page_size'] . ",$filter[page_size]";
: _+ }9 R9 L# p& N3 {' _修改为:
$ k J! U) g' a! B; n; V //* 查询 */- R4 ~, t- X5 f( w( f! e! d
$sql = "SELECT o.*," .+ K7 O9 ^% k D7 |$ \
"o.pay_status, o.consignee, o.firstname, o.lastname, o.address, o.email, o.tel, o.extension_code, o.extension_id, " .9 I: I( J2 ~7 g+ [( d% z
"(" . order_amount_field('o.') . ") AS total_fee, " .
' B* m# A( q( I "IFNULL(u.user_name, '" .$GLOBALS['_LANG']['anonymous']. "') AS buyer , p.user_name, p.order_picking_status, r.order_reply_status ".# U( f; S* J; {2 L! }# ]+ Y2 I* n
" FROM " . $GLOBALS['ecs']->table('order_info') . " AS o " .
( a& c/ N6 s* r ` y " LEFT JOIN " .$GLOBALS['ecs']->table('users'). " AS u ON u.user_id=o.user_id ".
/ C# I/ Q# `- f1 `* \4 l3 @ " LEFT JOIN order_reply_status AS r ON r.order_id = o.order_id ".
0 m5 ]+ g5 n- s" LEFT JOIN order_picking_status AS p ON p.order_id = o.order_id ". $where .
9 q" u- H4 W) ]% u* z " ORDER BY $filter[sort_by] $filter[sort_order] ".
/ ]7 C/ N3 |0 P j, J0 Y " LIMIT " . ($filter['page'] - 1) * $filter['page_size'] . ",$filter[page_size]";5 Y: f0 F$ T: k/ X& j: ?
' P6 T: j/ U! J' e# J' ?
4 G: Z# I- p% S- I% R) x
5 G& M) j# `1 U3 ~) p7 g" V7 W" |) w5 b
| 欢迎光临 科恒数字网-持续研发、集成、交付、运营方案资源库 (https://www.khcic.com/) |
Powered by Discuz! X3.5 |