科恒数字网-持续研发、集成、交付、运营方案资源库
标题: 给ecshop订单流程增加拣货状态,最新版本,支持ECSHOP3.6系统 [打印本页]
作者: admin 时间: 2020-6-12 09:15
标题: 给ecshop订单流程增加拣货状态,最新版本,支持ECSHOP3.6系统
针对ecshop订单中的物品,需要支持拣货的状态,比如未拣货、拣货中、拣货完成,以及显示拣货人姓名。
j4 C& b. \% Z+ d2 {8 D7 l7 e/ c% S% r
1.SQL操作:8 T# e3 x; O% P$ z! [3 p: b
. Q. D" b8 {( } H' s2.在文件languages\zh_cn\admin\order.php中增加:( }: n5 s: ^, w% b f# I
0 Y9 `8 O% \ }( F, p/* 拣货 */
2 T0 c6 K6 u7 A( \3 z) W$_LANG['order_picking_status'] = '拣货状态';
$ z$ a6 N7 q1 O; m/ M$ X; L$_LANG['order_picking_status_none'] = '未拣货';* o( X0 }3 m( R( Z+ I3 G, u
$_LANG['order_picking_status_processing'] = '拣货中';6 c& ?* |0 `5 r, r" q6 L5 K d% L
$_LANG['order_picking_status_finish'] = '拣货完成';
9 j( C2 s+ S! A/ Z+ o |8 P$_LANG['invalid_order_picking_status'] = '拣货状态无效。0:未拣货;1:拣货中;2:拣货完成';
/ ~; g) {; u2 U) q! |/ R: q5 Q$ ~/ c. F
; n1 Y1 O6 p, g: b% M" O
3.文件admin\templates\order_list.htm中在一下两行之间:/ i+ w/ j/ l; }# l5 f( G1 A8 x N% M
第一个地方
( M0 T9 E5 q R: J% M<th>{$lang.all_status}</th>
3 N* \, b. h1 u* ~; _" I; m<th>{$lang.handler}</th>7 {1 l* q. a! Y; b& R- b& [0 {
中间加上
4 T; _ a( \, z0 w9 Z) J7 k<th>{$lang.order_picking_status}</th>
( q/ |" y! r. Q, J, z. O; v! q" z, ]+ U; a; K1 y
第二个地方4 @! B* E4 H# A4 i
在<td align="center" valign="top" nowrap="nowrap">{$lang.os[$order.order_status]},{$lang.ps[$order.pay_status]},{$lang.ss[$order.shipping_status]}</td>
$ {6 |7 L6 B7 c6 z- N# [7 a后面加上: c& t) o9 E, F& u
<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>1 `, e0 ?9 J1 r0 j ]' k+ J
! p! |+ i! W K* B6 K/ Q" M) A
3 p3 C4 i+ T) r3 u$ X+ b7 o) |0 j# G! R5 V& A2 @( J4 X4 s
4.admin\js\listtable.js中,listTable.edit的响应函数修改如下:, N% G: E" r$ D" }- v
- r; \/ m# t- u
9 \6 w+ ?+ s7 V1 L+ o/**
* 创建一个可编辑区
*/
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
{
}
}
. }. ^' {' k" \- P( O
}
" Y: p! u1 W; s5 f5.admin\order.php文件中增加下面的函数:
6 Z' H4 y; t4 M1 {& t' {
. ], `3 y9 @3 ?' M: ]" K+ }/*------------------------------------------------------ */
1 z V9 Z5 F# O% i7 `//-- 订单拣货状态查询; O: s$ W5 M6 ^; ~9 c7 g5 m: b
/*------------------------------------------------------ */
9 k9 r- r# M# N; P* } 7 [# m6 i4 a0 b( {) A: e+ {; K9 g
if ($_REQUEST['act'] == 'edit_order_picking_status'). z% c7 A+ @# ~+ f/ T+ }8 M
{
T4 T6 W9 W2 j& M# O+ E /* 检查权限 */6 `, K4 J8 P Q+ I8 Z/ J* w5 W
check_authz_json('users_manage');
m2 d6 u9 W/ s+ l4 I
l. K! K5 l, k8 p $id =empty($_REQUEST['id']) ? 0 : intval($_REQUEST['id']);' Z: w/ I. L- e: U7 d
$order_picking_status =empty($_REQUEST['val']) ? '' : json_str_iconv(trim($_REQUEST['val']));
% E% a7 ?" ~7 Q1 k) N
% J# b. u( a" h/ L $sql = "DELETE fromorder_picking_status WHERE order_id = '". $id ."' LIMIT 1";
. w3 Y( W v5 ]7 @6 v $db->query($sql);
) r+ v/ F P! r! @: A % o! \: a/ @: ]+ v% j6 f
$sql = "INSERT INTOorder_picking_status (order_id, user_name, order_picking_status) VALUES('". $id ."', '". $_SESSION['admin_name'] ."', '".$order_picking_status ."')";9 O5 }7 d) o5 U( x4 c6 G
$db->query($sql);
# u b0 c# P& L6 }7 n3 l ! `' F" \6 T1 O1 B. ~
if ($order_picking_status> 2 || $order_picking_status < 0), o: J5 n0 f o+ m6 Z, E
{9 F3 R' {; d6 q
make_json_error($GLOBALS['_LANG']['invalid_order_picking_status']);
0 ? `/ @7 J" _6 W3 T# m }) R: ?. A- k; T! S9 M( [( f4 {
else9 m, y: e7 T1 m- V$ r
{ n9 C$ C f" e! ?- v8 `3 j& J- h
make_json_result($order_picking_status);
+ s* a8 z& a4 Y1 q# ~ }, o5 _; f5 t$ P" x: _* e' f+ ?
}
* W9 ?6 F M }5 C, c) V* `( p" G/ A7 k2 s# e4 C5 A4 T; x: p( Y2 P
6、admin\order.php文件中增加下面的函数将以下代码
# h. X4 Y6 ~& {/ N /* 查询 */
9 q( o; u+ a) O$sql = "SELECT o.*," ., Y' h! Z8 u. U* ?) d$ h
"o.pay_status, o.consignee, o.firstname, o.lastname, o.address, o.email, o.tel, o.extension_code, o.extension_id, " .
- z2 f) I4 [& k- ?: Y0 G% r# h "(" . order_amount_field('o.') . ") AS total_fee, " .
* s1 ]5 r ~6 _% s "IFNULL(u.user_name, '" .$GLOBALS['_LANG']['anonymous']. "') AS buyer ".: a" _. z7 o! j8 e/ e2 `
" FROM " . $GLOBALS['ecs']->table('order_info') . " AS o " .0 F% F: ^: P, J6 q" P
" LEFT JOIN " .$GLOBALS['ecs']->table('users'). " AS u ON u.user_id=o.user_id ". $where . # H3 B" N/ s+ @
" ORDER BY $filter[sort_by] $filter[sort_order] ".: P! W( r: {' m1 N
" LIMIT " . ($filter['page'] - 1) * $filter['page_size'] . ",$filter[page_size]"; 8 u* a; y6 H* d; c8 t: Q w# E8 N# @1 N' n
修改为:. h- Y: i9 {4 [8 v
//* 查询 */; g f% u/ t' R# R) f! m7 Z8 g
$sql = "SELECT o.*," ." _6 \% \ B; x4 J- _
"o.pay_status, o.consignee, o.firstname, o.lastname, o.address, o.email, o.tel, o.extension_code, o.extension_id, " .0 T* J) x/ p3 t& c
"(" . order_amount_field('o.') . ") AS total_fee, " .0 v9 ^4 E6 x7 Q% y
"IFNULL(u.user_name, '" .$GLOBALS['_LANG']['anonymous']. "') AS buyer , p.user_name, p.order_picking_status, r.order_reply_status "." r* Y, ~- \: |- S, p4 \! y
" FROM " . $GLOBALS['ecs']->table('order_info') . " AS o " .# K/ y- ?% t* g( J
" LEFT JOIN " .$GLOBALS['ecs']->table('users'). " AS u ON u.user_id=o.user_id ". & Q, I) Q2 ?/ u
" LEFT JOIN order_reply_status AS r ON r.order_id = o.order_id ". 7 g! T, P9 y# b* r% ?. q
" LEFT JOIN order_picking_status AS p ON p.order_id = o.order_id ". $where .
0 y* z& D" C5 C " ORDER BY $filter[sort_by] $filter[sort_order] ".
7 }" I$ X( a0 U! ~7 ]2 | " LIMIT " . ($filter['page'] - 1) * $filter['page_size'] . ",$filter[page_size]";
* Z# Q! t! L; }
% ?8 X& B5 C9 U) z3 |
! {0 d6 _) H" n1 D# o1 E+ j
- U3 z F0 t) v; T! _9 x
| 欢迎光临 科恒数字网-持续研发、集成、交付、运营方案资源库 (https://www.khcic.com/) |
Powered by Discuz! X3.5 |