Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
朱继来
/
后台订单管理
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
8f593127
authored
Mar 12, 2021
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
temp
parent
8678f987
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
2576 additions
and
1724 deletions
app/Http/Controllers/OrderController.php
config/params.php
public/js/add_order.js
public/js/add_order_bak.js
public/js/plugins/footable/footable.all.min.js
resources/views/addOrder.blade.php
resources/views/addOrder/content.blade.php
resources/views/addOrder/content1.blade.php
resources/views/addOrder/content_bak.blade.php
resources/views/orderlist/content.blade.php
resources/views/selfOrder/content.blade.php
app/Http/Controllers/OrderController.php
View file @
8f593127
...
...
@@ -203,6 +203,10 @@ function getOrderSource($order_id, $order_type=1, $order_goods_type=1)
$source
=
'移动端'
;
}
else
if
(
preg_match
(
'/pf=6/'
,
$order_source
->
order_source
))
{
$source
=
'小程序'
;
}
else
if
(
preg_match
(
'/pf=8/'
,
$order_source
->
order_source
))
{
$source
=
'询报价平台'
;
}
else
if
(
preg_match
(
'/pf=9/'
,
$order_source
->
order_source
))
{
$source
=
'云芯平台'
;
}
else
{
$source
=
'平台'
;
}
...
...
config/params.php
View file @
8f593127
...
...
@@ -12,6 +12,7 @@
10
=>
'交易成功'
,
],
// 订单付款方式
'order_pay_type'
=>
[
1
=>
'全款'
,
2
=>
'预付款'
,
...
...
@@ -19,6 +20,19 @@
4
=>
'货到猎芯付款'
,
],
// 订单来源
'order_source_pf'
=>
[
1
=>
'PC端'
,
2
=>
'移动端'
,
3
=>
'后台'
,
4
=>
'京东'
,
5
=>
'ERP'
,
6
=>
'小程序'
,
7
=>
'开放平台'
,
8
=>
'询报价平台'
,
9
=>
'云芯平台'
,
],
// 支付方式
'order_paid_name'
=>
[
1
=>
'微信支付'
,
...
...
public/js/add_order.js
View file @
8f593127
+
(
function
(
$
){
$
.
lie
=
$
.
lie
||
{
version
:
"v1.0.0"
};
layui
.
use
([
'form'
,
'table'
,
'element'
],
function
()
{
var
form
=
layui
.
form
;
var
table
=
layui
.
table
;
var
element
=
layui
.
element
;
$
.
extend
(
$
.
lie
,
{
add_order
:{
lyorder
:
function
()
{
// 联营订单
this
.
bind
(
1
,
1
);
},
zyorder
:
function
()
{
// 自营线上订单
this
.
bind
(
2
,
1
);
},
offline
:
function
(
internal_uid
)
{
// 自营线下订单
this
.
bind
(
2
,
0
,
internal_uid
);
this
.
lists
(
internal_uid
,
2
,
0
);
},
businessType
:
function
()
{
// 自营其他业务订单
this
.
bind
(
2
,
2
);
},
/**
* goods_type: is_online:是否线上订单
* @param {[type]} goods_type [1-联营,2-自营]
* @param {Boolean} is_online [0-自营线下,1-联营/自营线上,2-自营其他业务]
* @param {String} internal_uid [自营内部采购账号ID]
* @return {[type]} [description]
*/
bind
:
function
(
goods_type
,
is_online
,
internal_uid
=
''
)
{
var
loading
=
this
;
// 获取用户信息
function
get_user
(){
var
mobile
=
$
(
'.search-user'
).
val
();
// if(mobile == -1){
// var mobile = getUrlParam('user_id');
// }
if
(
!
mobile
)
return
false
;
// 自营其他订单类型---仓库损耗
if
(
mobile
==
'15022222222'
)
{
$
(
'#business_type'
).
val
(
2
).
attr
(
'disabled'
,
true
);
}
else
{
$
(
'#business_type'
).
val
(
1
).
attr
(
'disabled'
,
false
);
}
$
.
ajax
({
url
:
'/ajax/getUserInfo'
,
type
:
'post'
,
data
:
{
goods_type
:
goods_type
,
mobile
:
mobile
},
dataType
:
'json'
,
success
:
function
(
resp
)
{
if
(
resp
.
errcode
==
0
)
{
var
data
=
resp
.
data
;
var
reg
=
/@/
;
$
(
'.user-info'
).
show
();
// 账号信息
$
(
'.user_id'
).
val
(
data
.
user
.
user_id
);
if
(
reg
.
test
(
mobile
))
{
$
(
'.user-mobile'
).
text
(
data
.
user
.
email
);
}
else
{
$
(
'.user-mobile'
).
text
(
data
.
user
.
mobile
);
}
var
is_test
=
data
.
user
.
is_test
?
'是'
:
'否'
;
$
(
'.user-test'
).
text
(
is_test
);
// 快递信息
if
(
data
.
address
!=
null
)
{
var
addr_len
=
data
.
address
.
length
;
var
addr_str
=
'<option value="">请选择</option>'
;
for
(
var
i
=
0
;
i
<
addr_len
;
i
++
)
{
addr_str
+=
'<option value="'
+
data
.
address
[
i
][
'address_id'
]
+
'">'
+
data
.
address
[
i
][
'consignee'
]
+
'</option>'
;
}
$
(
'#address'
).
empty
().
append
(
addr_str
);
}
// 发票信息
// if (data.invoice != null) {
// var inv_len = data.invoice.length;
// var inv_str = '<option value="">请选择</option>';
// for (var i = 0; i < inv_len; i++) {
// inv_str += '<option value="'+data.invoice[i]['tax_id']+'">'+data.invoice[i]['tax_title']+'</option>';
// }
// $('#invoice').empty().append(inv_str);
// }
loading
.
lists
(
data
.
user
.
user_id
,
goods_type
,
is_online
);
// 加载该用户购物车
return
false
;
}
layer
.
msg
(
resp
.
errmsg
)
},
})
}
get_user
();
$
(
'.get-user'
).
click
(
function
(){
// var mobile = $(this).siblings('.search-user').val();
// get_user(mobile)
get_user
();
})
// 选择收货地址
$
(
'.user-info'
).
delegate
(
'#address'
,
'change'
,
function
()
{
var
user_id
=
$
(
'.user_id'
).
val
();
var
address_id
=
$
(
this
).
val
();
var
user_coupon_id
=
$
(
'.user_coupon_id'
).
val
();
var
cart_ids
=
[];
$
(
'.shop-table tbody'
).
find
(
'tr'
).
each
(
function
()
{
var
cid
=
$
(
this
).
data
(
'cid'
);
cart_ids
.
push
(
cid
);
})
if
(
address_id
)
{
$
.
ajax
({
url
:
'/ajax/selectAddr'
,
type
:
'post'
,
data
:
{
address_id
:
address_id
},
dataType
:
'json'
,
success
:
function
(
resp
)
{
if
(
resp
.
errcode
==
0
)
{
var
data
=
resp
.
data
;
$
(
'.address-content'
).
show
();
$
(
'.address_id'
).
val
(
data
.
address_id
);
$
(
'.address-consignee'
).
text
(
data
.
consignee
);
$
(
'.address-mobile'
).
text
(
data
.
mobile
);
$
(
'.address-detail'
).
text
(
data
.
province_val
+
data
.
city_val
+
data
.
district_val
+
data
.
detail_address
);
if
(
cart_ids
.
length
>
0
)
{
loading
.
confirm
(
user_id
,
address_id
,
cart_ids
,
user_coupon_id
,
goods_type
,
is_online
);
// 确认订单信息
}
return
false
;
}
layer
.
msg
(
resp
.
errmsg
||
'网络异常'
);
}
})
}
else
{
$
(
'.address-content'
).
hide
();
$
(
'.address_id'
).
val
(
''
);
if
(
cart_ids
.
length
>
0
)
{
loading
.
confirm
(
user_id
,
address_id
,
cart_ids
,
user_coupon_id
,
goods_type
,
is_online
);
// 确认订单信息
}
}
})
// 选择发票类型
$
(
'.user-info'
).
delegate
(
'.radio-inv-type'
,
'click'
,
function
()
{
var
inv_type
=
$
(
this
).
val
();
var
user_id
=
$
(
'.user_id'
).
val
();
var
inv_str
=
'<option value="">请选择</option>'
;
$
(
'.invoice-content'
).
hide
();
$
(
'.tax_id'
).
val
(
''
);
// 提示
if
(
inv_type
==
2
||
inv_type
==
''
)
{
layer
.
alert
(
'个人和不开票只能为个人形式,后续不能更改为公司进行开票,请确认风险'
);
}
if
(
inv_type
)
{
$
.
ajax
({
url
:
'/ajax/selectInvType'
,
type
:
'post'
,
data
:
{
user_id
:
user_id
,
inv_type
:
inv_type
},
dataType
:
'json'
,
success
:
function
(
resp
)
{
if
(
resp
.
errcode
==
0
)
{
var
data
=
resp
.
data
;
if
(
data
!=
null
)
{
var
inv_len
=
data
.
length
;
for
(
var
i
=
0
;
i
<
inv_len
;
i
++
)
{
inv_str
+=
'<option value="'
+
data
[
i
][
'tax_id'
]
+
'">'
+
data
[
i
][
'tax_title'
]
+
'</option>'
;
}
$
(
'#invoice'
).
empty
().
append
(
inv_str
);
}
else
{
$
(
'#invoice'
).
empty
().
append
(
inv_str
);
}
return
false
;
}
layer
.
msg
(
resp
.
errmsg
||
'网络异常'
);
}
})
}
else
{
$
(
'#invoice'
).
empty
().
append
(
inv_str
);
}
})
// 选择发票信息
$
(
'.user-info'
).
delegate
(
'#invoice'
,
'change'
,
function
()
{
var
tax_id
=
$
(
this
).
val
();
if
(
tax_id
)
{
$
.
ajax
({
url
:
'/ajax/selectInv'
,
type
:
'post'
,
data
:
{
tax_id
:
tax_id
},
dataType
:
'json'
,
success
:
function
(
resp
)
{
if
(
resp
.
errcode
==
0
)
{
var
data
=
resp
.
data
;
var
inv_type_val
=
''
;
$
(
'.invoice-content'
).
show
();
$
(
'.tax_id'
).
val
(
data
.
tax_id
);
$
(
'.tax_title'
).
text
(
data
.
tax_title
);
$
(
'.tax_no'
).
text
(
data
.
tax_no
);
$
(
'.bank_account'
).
text
(
data
.
bank_account
);
$
(
'.bank_name'
).
text
(
data
.
bank_name
);
$
(
'.company_phone'
).
text
(
data
.
company_phone
);
$
(
'.company_address'
).
text
(
data
.
company_address
);
$
(
'.consignee'
).
text
(
data
.
consignee
);
$
(
'.consignee_phone'
).
text
(
data
.
consignee_phone
);
$
(
'.consignee_address'
).
text
(
data
.
province_val
+
data
.
city_val
+
data
.
district_val
+
data
.
consignee_address
);
switch
(
data
.
inv_type
)
{
case
2
:
inv_type_val
=
'普通发票'
;
break
;
case
3
:
inv_type_val
=
'增值税专用发票'
;
break
;
case
4
:
inv_type_val
=
'增值税普通发票'
;
break
;
default
:
inv_type_val
=
'未知'
;
break
;
}
$
(
'.inv_type'
).
text
(
inv_type_val
);
// 若购物车存在Digikey商品,选择增值税普票或专票后,默认将发票抬头赋值给终端信息(中文名称),且不能更改
if
(
$
(
'.client-info'
).
css
(
'display'
)
==
'block'
)
{
if
(
data
.
inv_type
==
3
||
data
.
inv_type
==
4
)
{
$
(
'.customer_cn'
).
val
(
data
.
tax_title
);
$
(
'.customer_en'
).
val
(
data
.
customer_en
);
$
(
'.customer_type'
).
val
(
data
.
customer_type
);
$
(
'.product_use_classone_sn'
).
val
(
data
.
product_use_classone_sn
);
$
(
'.product_use_classone_sn'
).
change
();
// 添加change事件
$
(
'.product_use_classtwo_sn'
).
val
(
data
.
product_use_classtwo_sn
);
$
(
'.customer_website'
).
val
(
data
.
customer_website
);
}
else
{
$
(
'.customer_cn'
).
val
(
''
);
$
(
'.customer_en'
).
val
(
''
);
$
(
'.customer_type'
).
val
(
''
);
$
(
'.product_use_classone_sn'
).
val
(
''
);
$
(
'.product_use_classone_sn'
).
change
();
$
(
'.customer_website'
).
val
(
''
);
layer
.
msg
(
'购物车中存在digikey商品,请选择增值税普票或专票'
);
}
}
}
}
})
}
else
{
$
(
'.invoice-content'
).
hide
();
$
(
'.tax_id'
).
val
(
''
);
}
})
// 获取SKU信息
$
(
'.get-sku'
).
click
(
function
()
{
var
sku_id
=
$
(
this
).
siblings
(
'.search-sku'
).
val
();
var
user_id
=
$
(
'.user_id'
).
val
()
||
0
;
if
(
!
sku_id
)
{
layer
.
msg
(
'请输入SKU_ID'
);
return
false
;
}
if
(
!
/^
\d
*$/
.
test
(
sku_id
))
{
layer
.
msg
(
'参数错误,请输入正确的SKU_ID'
);
return
false
;
}
$
.
ajax
({
url
:
'/ajax/getSku'
,
type
:
'post'
,
data
:
{
sku_id
:
sku_id
.
trim
(),
user_id
:
user_id
},
dataType
:
'json'
,
success
:
function
(
resp
)
{
console
.
log
(
resp
)
if
(
resp
.
errcode
!=
0
)
{
console
.
log
(
resp
.
data
)
layer
.
msg
(
resp
.
errmsg
);
return
false
;
}
$
(
'.sku-info'
).
show
();
var
data
=
resp
.
data
;
var
status_val
=
''
;
$
(
'.goods_name'
).
text
(
data
.
goods_name
);
$
(
'.brand_name'
).
text
(
data
.
brand_name
);
$
(
'.supplier_name'
).
text
(
data
.
supplier_name
);
$
(
'.stock'
).
text
(
data
.
goods_number
);
$
(
'.moq'
).
text
(
data
.
min_buy
);
$
(
'.mpq'
).
text
(
data
.
min_mpq
);
if
(
data
.
self_supplier_type
==
1
){
$
(
'.self_supplier_type'
).
text
(
'自采'
);
}
else
if
(
data
.
self_supplier_type
==
2
){
$
(
'.self_supplier_type'
).
text
(
'立创'
);
}
else
{
$
(
'.self_supplier_type'
).
text
(
'自采'
);
}
// if (goods_type == 1) {
// var status = data.goods_status;
// } else {
// var status = data.status;
// }
// switch (status) {
// case 0: status_val = '待入库'; break;
// case 1: status_val = '审核通过(上架)'; break;
// case 3: status_val = '下架'; break;
// case 4: status_val = '删除'; break;
// }
status_val
=
data
.
is_buy
?
'是'
:
'否'
;
$
(
'.status'
).
text
(
status_val
);
$
(
'.goods_id'
).
val
(
data
.
goods_id
);
$
(
'.goods_type'
).
val
(
data
.
goods_type
);
//阶梯价格
if
(
data
.
tiered
!=
null
)
{
var
len
=
data
.
tiered
.
length
;
if
(
len
>
0
)
{
var
html
=
''
;
html
+=
'<tr><th>阶梯</th><th>RMB价格</th>'
;
if
(
data
.
ac_type
&&
data
.
ac_type
!=
5
)
{
// ac_type = 5 为新客价,目前后台不展示新客价
switch
(
data
.
ac_type
)
{
case
1
:
html
+=
'<th>限时限量</th>'
;
break
;
case
2
:
html
+=
'<th>活动价</th>'
;
break
;
case
3
:
html
+=
'<th>会员价</th>'
;
break
;
case
6
:
html
+=
'<th>自营清库存</th>'
;
break
;
case
7
:
html
+=
'<th>团购价</th>'
;
break
;
case
8
:
html
+=
'<th>折扣价</th>'
;
break
;
case
10
:
html
+=
'<th>活动打折</th>'
;
break
;
default
:
html
+=
'<th></th>'
;
break
;
}
}
var
joint_goods_type
=
[
'1'
,
'2'
];
// 商品联营类型
if
(
joint_goods_type
.
indexOf
(
data
.
goods_type
)
!=
-
1
)
{
html
+=
'<th>USD价格</th>'
;
}
html
+=
'</tr>'
;
for
(
var
i
=
0
;
i
<
len
;
i
++
)
{
html
+=
'<tr>'
;
if
(
i
==
0
)
{
if
(
data
.
ac_type
&&
data
.
ac_type
!=
5
)
{
html
+=
'<td><span class="goods-min-num">'
+
data
.
tiered
[
i
][
'purchases'
]
+
'</span></td><td>¥<span class="goods-min-price price-line">'
+
data
.
tiered
[
i
][
'price_cn'
]
+
'</span><td>¥<span>'
+
data
.
tiered
[
i
][
'price_ac'
]
+
'</span></td>'
;
}
else
{
html
+=
'<td><span class="goods-min-num">'
+
data
.
tiered
[
i
][
'purchases'
]
+
'</span></td><td>¥<span class="goods-min-price">'
+
data
.
tiered
[
i
][
'price_cn'
]
+
'</span></td>'
;
}
if
(
joint_goods_type
.
indexOf
(
data
.
goods_type
)
!=
-
1
)
{
html
+=
'<td>$<span class="goods-min-price-us">'
+
data
.
tiered
[
i
][
'price_us'
]
+
'</span></td>'
;
}
}
else
{
if
(
data
.
ac_type
&&
data
.
ac_type
!=
5
)
{
html
+=
'<td><span>'
+
data
.
tiered
[
i
][
'purchases'
]
+
'</span></td><td>¥<span class="price-line">'
+
data
.
tiered
[
i
][
'price_cn'
]
+
'</span></td><td>¥<span>'
+
data
.
tiered
[
i
][
'price_ac'
]
+
'</span></td>'
;
}
else
{
html
+=
'<td><span>'
+
data
.
tiered
[
i
][
'purchases'
]
+
'</span></td><td>¥<span>'
+
data
.
tiered
[
i
][
'price_cn'
]
+
'</span></td>'
;
}
if
(
joint_goods_type
.
indexOf
(
data
.
goods_type
)
!=
-
1
)
{
html
+=
'<td>$<span>'
+
data
.
tiered
[
i
][
'price_us'
]
+
'</span></td>'
;
}
}
html
+=
'</tr>'
;
}
// $('.ladder_price_table tr:gt(0)').remove();
$
(
'.ladder_price_table'
).
empty
().
append
(
html
);
}
}
}
})
})
// 添加到商品列表
$
(
'.add-to-lists'
).
click
(
function
()
{
var
goods_min_num
=
$
(
this
).
parents
(
'.sku-info'
).
find
(
'.moq'
).
text
();
var
goods_id
=
$
(
this
).
siblings
(
'.goods_id'
).
val
();
var
type
=
$
(
this
).
siblings
(
'.goods_type'
).
val
();
var
delivery_place
=
1
;
// 1.大陆,2.香港 自营默认是大陆
var
user_id
=
0
;
if
(
internal_uid
)
{
user_id
=
internal_uid
;
}
else
{
user_id
=
$
(
'.user_id'
).
val
();
}
if
(
!
user_id
)
{
layer
.
msg
(
'请先选择用户'
);
return
false
;
}
// if (goods_type == 1) { // 联营需要选择交货地
delivery_place
=
$
(
'input[name=delivery_place]:checked'
).
val
();
if
(
delivery_place
==
null
)
{
layer
.
msg
(
'请选择交货地'
);
return
false
;
}
// if (type == 3 || type == 4) {
// layer.msg('仅支持联营商品下单,请在自营订单中下单');
// return false;
// }
var
goods_min_price
=
$
(
this
).
parents
(
'.sku-info'
).
find
(
'.goods-min-price'
).
text
();
var
goods_min_price_us
=
$
(
this
).
parents
(
'.sku-info'
).
find
(
'.goods-min-price-us'
).
text
();
if
(
delivery_place
==
1
)
{
if
(
goods_min_price
==
0
)
{
layer
.
msg
(
'缺少RMB价格,商品添加失败'
);
return
false
;
}
}
else
if
(
delivery_place
==
2
)
{
if
(
goods_min_price_us
==
0
)
{
layer
.
msg
(
'缺少美金价格,商品添加失败'
);
return
false
;
}
}
// } else {
// if (type == 1 || type == 2) { // 1.联营 2.专卖
// layer.msg('仅支持自营商品下单,请在联营订单中下单');
// return false;
// }
// }
var
datax
=
{
uid
:
user_id
,
id
:
goods_id
,
num
:
goods_min_num
,
buy
:
-
1
,
delivery_place
:
delivery_place
,
}
$
.
ajax
({
type
:
"POST"
,
url
:
'/ajax/addCart'
,
data
:
datax
,
dataType
:
"json"
,
success
:
function
(
resp
){
layer
.
msg
(
resp
.
errmsg
);
loading
.
lists
(
user_id
,
goods_type
,
is_online
,
delivery_place
);
// 加载购物车列表
return
false
;
},
})
})
// 切换交货地
$
(
'.delivery_place'
).
click
(
function
()
{
var
user_id
=
$
(
'.user_id'
).
val
();
var
delivery_place
=
$
(
this
).
val
();
loading
.
lists
(
user_id
,
goods_type
,
is_online
,
delivery_place
);
// 加载购物车列表
})
// 调整商品数量
$
(
'.shop-table'
).
delegate
(
'.goods_num'
,
'blur'
,
function
()
{
var
self
=
$
(
this
);
var
origin_num
=
self
.
data
(
'origin_num'
);
// 原始数量
var
num
=
self
.
val
();
var
min_buy
=
Number
(
self
.
parents
(
'tr'
).
attr
(
'min_buy'
));
var
cart_id
=
self
.
parents
(
'tr'
).
data
(
'cid'
);
var
type
=
self
.
parents
(
'tr'
).
data
(
'type'
);
var
user_id
=
0
;
var
delivery_place
=
1
;
// 1.大陆,2.香港 自营默认是大陆
if
(
origin_num
==
num
)
return
;
// 未修改数量,则return
if
(
internal_uid
)
{
user_id
=
internal_uid
;
}
else
{
user_id
=
$
(
'.user_id'
).
val
();
}
if
(
num
<
min_buy
)
{
self
.
val
(
min_buy
);
layer
.
msg
(
'购买数量低于最小起订量,默认调整为最小起订量'
);
return
}
var
curr_goods_type
=
$
(
this
).
parents
(
'tr'
).
data
(
'goods_type'
);
var
joint_goods_type
=
[
1
,
2
];
// 商品联营类型
// if (goods_type == 1) { // 联营需要选择交货地
if
(
joint_goods_type
.
indexOf
(
curr_goods_type
)
!=
-
1
)
{
delivery_place
=
$
(
'input[name=delivery_place]:checked'
).
val
();
}
else
{
// 自营数量需要结合倍数
var
mpl
=
Number
(
self
.
parents
(
'tr'
).
find
(
'.goods_mpl'
).
text
());
// 倍数
num
=
Math
.
ceil
(
num
/
mpl
)
*
mpl
;
}
$
.
ajax
({
type
:
"POST"
,
url
:
'/ajax/changeNum'
,
data
:
{
uid
:
user_id
,
num
:
num
,
cart_id
:
cart_id
,
type
:
type
,
goods_type
:
goods_type
},
dataType
:
"json"
,
success
:
function
(
resp
){
if
(
resp
.
errcode
==
0
)
{
loading
.
lists
(
user_id
,
goods_type
,
is_online
,
delivery_place
);
// 加载购物车列表
return
false
;
}
layer
.
msg
(
resp
.
errmsg
);
},
})
})
// 删除商品
$
(
'.shop-table'
).
delegate
(
'.remove-goods'
,
'click'
,
function
()
{
var
self
=
$
(
this
);
var
cart_id
=
self
.
parents
(
'tr'
).
data
(
'cid'
);
var
user_id
=
0
;
var
delivery_place
=
1
;
// 1.大陆,2.香港 自营默认是大陆
if
(
internal_uid
)
{
user_id
=
internal_uid
;
}
else
{
user_id
=
$
(
'.user_id'
).
val
();
}
if
(
goods_type
==
1
)
{
// 联营需要选择交货地
delivery_place
=
$
(
'input[name=delivery_place]:checked'
).
val
();
}
layer
.
open
({
title
:
'删除提示'
,
content
:
'确定删除该商品吗?'
,
btn
:
[
'确定'
,
'取消'
],
btn1
:
function
()
{
$
.
ajax
({
type
:
"POST"
,
url
:
'/ajax/deleteGoods'
,
data
:
{
uid
:
user_id
,
cart_id
:
cart_id
},
dataType
:
"json"
,
success
:
function
(
resp
){
layer
.
msg
(
resp
.
errmsg
);
// self.parents('tr').remove();
loading
.
lists
(
user_id
,
goods_type
,
is_online
,
delivery_place
);
// 加载购物车列表
return
false
;
},
})
layer
.
msg
(
'商品删除中...'
,
{
icon
:
16
,
time
:
0
,
shade
:
0.3
});
},
btn2
:
function
(
index
)
{
layer
.
close
(
index
);
}
})
})
// 选择优惠券
$
(
'#user_coupon'
).
change
(
function
(){
var
coupon_id
=
$
(
this
).
val
();
var
address_id
=
$
(
'.address_id'
).
val
();
var
user_id
=
$
(
'.user_id'
).
val
();
var
cart_ids
=
[];
$
(
'.shop-table tbody'
).
find
(
'tr'
).
each
(
function
()
{
var
cid
=
$
(
this
).
data
(
'cid'
);
cart_ids
.
push
(
cid
);
})
if
(
coupon_id
)
{
$
(
'.user_coupon_id'
).
val
(
coupon_id
);
}
else
{
$
(
'.user_coupon_id'
).
val
(
''
);
}
loading
.
confirm
(
user_id
,
address_id
,
cart_ids
,
coupon_id
,
goods_type
,
is_online
);
// 确认订单信息
})
// 切换销售类型
$
(
'#sale_type'
).
change
(
function
()
{
var
coupon_id
=
$
(
'.user_coupon_id'
).
val
();
var
address_id
=
$
(
'.address_id'
).
val
();
var
user_id
=
$
(
'.user_id'
).
val
();
var
sale_type
=
$
(
this
).
val
();
var
cart_ids
=
[];
$
(
'.shop-table tbody'
).
find
(
'tr'
).
each
(
function
()
{
var
cid
=
$
(
this
).
data
(
'cid'
);
cart_ids
.
push
(
cid
);
})
if
(
cart_ids
.
length
>
0
)
{
$
.
ajax
({
type
:
"POST"
,
url
:
'/ajax/switchSaleType'
,
data
:
{
sale_type
:
sale_type
,
cart_ids
:
cart_ids
},
dataType
:
"json"
,
success
:
function
(
resp
){
if
(
resp
.
errcode
==
0
)
{
layer
.
msg
(
resp
.
errmsg
);
loading
.
lists
(
user_id
,
goods_type
,
is_online
);
// 加载购物车列表
return
false
;
}
layer
.
msg
(
resp
.
errmsg
);
},
})
}
})
// 批量导入物料
$
(
'.goods_import'
).
click
(
function
()
{
var
user_id
=
$
(
'.user_id'
).
val
();
var
delivery_place
=
1
;
// 1.大陆,2.香港 自营默认是大陆
user_id
=
internal_uid
?
internal_uid
:
user_id
;
// 若是内部下单则使用内部用户ID
if
(
!
user_id
)
{
layer
.
msg
(
'请先选择用户'
);
return
false
;
}
if
(
goods_type
==
1
)
{
delivery_place
=
$
(
'input[name=delivery_place]:checked'
).
val
();
}
// 上传文件
var
form
=
$
(
'<form id="formUpload" method="post" enctype="multipart/form-data">\
<input type="file" name="upload" id="fileInput" accept="application/vnd.ms-excel, application/x-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, .csv">\
</form>'
);
var
type
=
$
(
this
).
data
(
'type'
);
// 1-联营模板,2-自营模板
form
.
find
(
'input'
).
change
(
function
(){
var
formData
=
new
FormData
();
formData
.
append
(
'file'
,
this
.
files
[
0
]);
formData
.
append
(
'type'
,
type
);
formData
.
append
(
'user_id'
,
user_id
);
formData
.
append
(
'delivery_place'
,
delivery_place
);
$
.
ajax
({
type
:
"POST"
,
url
:
'/ajax/batchGoodsImport'
,
data
:
formData
,
dataType
:
'json'
,
cache
:
false
,
processData
:
false
,
contentType
:
false
,
success
:
function
(
resp
){
if
(
resp
.
errcode
==
0
)
{
layer
.
msg
(
resp
.
errmsg
);
loading
.
lists
(
user_id
,
goods_type
,
is_online
,
delivery_place
);
// 加载购物车列表
return
false
;
}
layer
.
alert
(
resp
.
errmsg
);
},
})
layer
.
msg
(
'批量导入中...'
,
{
icon
:
16
,
time
:
0
,
shade
:
0.3
});
})
form
.
find
(
'input[type="file"]'
).
trigger
(
'click'
);
})
// 提交订单
// $('.submit-order').on('click', function() {
$
(
'.submit-order'
).
off
().
on
(
'click'
,
function
()
{
var
self
=
$
(
this
);
var
address_id
=
$
(
'input[name=address_id]'
).
val
();
var
type
=
self
.
data
(
'type'
);
// 1-联营线上,2-自营线上,3-自营线下,4-自营其他业务
var
cart_ids
=
[];
var
user_id
=
0
;
var
remark
=
$
(
'#remark'
).
val
();
// 订单备注
if
(
internal_uid
)
{
user_id
=
internal_uid
;
}
else
{
user_id
=
$
(
'.user_id'
).
val
();
}
var
is_dgk
=
false
;
$
(
'.shop-table tbody tr'
).
each
(
function
()
{
var
cid
=
$
(
this
).
data
(
'cid'
);
cart_ids
.
push
(
cid
);
var
supplier_id
=
$
(
this
).
data
(
'sup_id'
);
var
supplier_name
=
$
(
this
).
data
(
'sup_name'
);
if
(
supplier_id
==
'7'
||
supplier_name
.
toString
().
toLowerCase
()
==
'digikey'
)
{
is_dgk
=
true
;
}
})
if
(
cart_ids
.
length
>
0
)
{
var
submit
=
true
;
var
datax
=
{
uid
:
user_id
,
sale_id
:
sale_id
,
address_id
:
address_id
,
type
:
type
,
cart_ids
:
cart_ids
,
remark
:
remark
,
}
if
(
type
==
3
)
{
// 自营线下订单
datax
.
address_name
=
$
(
'input[name=address_name]'
).
val
();
datax
.
address_mobile
=
$
(
'input[name=address_mobile]'
).
val
();
}
else
{
// 联营、自营线上订单
var
tax_id
=
$
(
'.tax_id'
).
val
();
var
inv_type
=
$
(
'input[name=inv_type]:checked'
).
val
();
var
user_coupon_id
=
$
(
'.user_coupon_id'
).
val
();
var
zy_delivery_type
=
$
(
'.zy_delivery_type'
).
val
();
if
(
!
address_id
)
{
layer
.
msg
(
'请选择快递信息'
);
return
false
;
}
if
(
!
zy_delivery_type
)
{
layer
.
msg
(
'请选择发货方式'
);
return
false
;
}
if
((
typeof
(
inv_type
)
==
'undefined'
||
inv_type
!=
''
)
&&
!
tax_id
)
{
layer
.
msg
(
'请选择发票信息'
);
return
false
;
}
if
(
type
==
4
)
{
// 自营其他业务
var
business_type
=
$
(
'#business_type'
).
val
();
datax
.
business_type
=
business_type
;
datax
.
role
=
role
;
// 自营线上下单添加角色
}
else
{
// if ((inv_type && !tax_id) || (!tax_id && goods_type == 2)) {
// layer.msg('请选择发票信息');
// return false;
// }
}
if
(
type
==
1
&&
is_dgk
)
{
// 联营包含digikey商品,则填写终端资料
var
customer_cn
=
$
(
'.customer_cn'
).
val
();
var
customer_en
=
$
(
'.customer_en'
).
val
();
var
customer_type
=
$
(
'.customer_type'
).
val
();
var
product_use_classone_sn
=
$
(
'.product_use_classone_sn'
).
val
();
var
product_use_classtwo_sn
=
$
(
'.product_use_classtwo_sn'
).
val
();
var
customer_website
=
$
(
'.customer_website'
).
val
();
if
(
!
customer_cn
)
{
layer
.
msg
(
'请填写终端中文名称'
);
return
false
;
}
if
(
customer_type
==
''
)
{
layer
.
msg
(
'请选择客户类型'
);
return
false
;
}
if
(
customer_type
==
1
)
{
// 若客户类型为终端,则外文名称,产品用途和网址为必填
if
(
!
customer_en
)
{
layer
.
msg
(
'请填写终端英文名称'
);
return
false
;
}
var
en_reg
=
/^
[
a-zA-Z0-9
\.\-\s\,\(\)]
+$/
;
if
(
!
en_reg
.
test
(
customer_en
)){
layer
.
msg
(
'请填写全英文名称'
);
return
false
;
}
if
(
product_use_classone_sn
==
''
)
{
layer
.
msg
(
'请选择产品用途一级分类'
);
return
false
;
}
if
(
!
customer_website
)
{
layer
.
msg
(
'请填写客户网址'
);
return
false
;
}
}
datax
.
customer_cn
=
customer_cn
;
datax
.
customer_en
=
customer_en
;
datax
.
customer_type
=
customer_type
;
datax
.
product_use_classone_sn
=
product_use_classone_sn
;
datax
.
product_use_classtwo_sn
=
product_use_classtwo_sn
;
datax
.
customer_website
=
customer_website
;
}
datax
.
tax_id
=
tax_id
;
datax
.
user_coupon_id
=
user_coupon_id
;
datax
.
zy_delivery_type
=
zy_delivery_type
;
}
// 自营线上
if
(
type
==
2
&&
is_online
==
1
)
{
var
sale_type
=
$
(
'#sale_type'
).
val
();
var
cart_info
=
[];
$
(
'.shop-table tbody tr'
).
each
(
function
()
{
var
gid
=
$
(
this
).
find
(
'.goods_id'
).
text
();
var
num
=
$
(
this
).
find
(
'.goods_num'
).
val
();
cart_info
.
push
({
'gid'
:
gid
,
'num'
:
num
});
})
datax
.
role
=
role
;
// 自营线上下单添加角色
$
.
ajax
({
type
:
"POST"
,
url
:
'/ajax/checkStock'
,
data
:
{
cart_info
:
JSON
.
stringify
(
cart_info
),
sale_type
:
sale_type
},
dataType
:
"json"
,
async
:
false
,
success
:
function
(
resp
){
if
(
resp
.
errcode
==
-
1
)
{
var
data
=
eval
(
resp
.
data
);
var
content
=
'<p>'
+
resp
.
errmsg
+
'</p>'
;
submit
=
false
;
for
(
var
i
=
0
;
i
<
data
.
length
;
i
++
)
{
content
+=
'<p><span>'
+
(
i
+
1
)
+
'、</span>'
+
data
[
i
][
'goods_name'
]
+
',可用库存:'
+
data
[
i
][
'stock'
]
+
'</p>'
;
}
// 弹出提示
layer
.
open
({
area
:
[
'500px'
,
'300px'
],
title
:
'提示信息'
,
content
:
content
,
btn
:
[],
});
// self.removeAttr('disabled').css('pointer-events', 'auto');
return
false
;
}
},
})
}
if
(
submit
)
{
$
.
ajax
({
type
:
"POST"
,
url
:
'/ajax/create'
,
data
:
datax
,
dataType
:
"json"
,
success
:
function
(
resp
){
if
(
resp
.
errcode
==
0
)
{
layer
.
msg
(
resp
.
errmsg
);
location
.
href
=
'/addorder/success?order_id='
+
resp
.
data
.
order_id
+
'&type='
+
resp
.
data
.
type
;
return
false
;
}
else
if
(
resp
.
errcode
==
21024
)
{
layer
.
alert
(
'该用户已进入公司黑名单,具体请联系吴承义,同时订单无法提交'
);
return
false
;
}
else
if
(
resp
.
errcode
==
21030
)
{
layer
.
alert
(
resp
.
errmsg
,
function
()
{
var
delivery_place
=
$
(
'.delivery_place'
).
val
();
loading
.
lists
(
user_id
,
goods_type
,
is_online
,
delivery_place
);
// 加载购物车列表
loading
.
confirm
(
user_id
,
address_id
,
cart_ids
,
user_coupon_id
,
goods_type
,
is_online
);
// 确认订单信息
});
return
false
;
}
layer
.
alert
(
resp
.
errmsg
);
},
})
layer
.
msg
(
'订单生成中...'
,
{
icon
:
16
,
time
:
0
,
shade
:
0.3
});
}
}
else
{
layer
.
msg
(
'请先添加商品'
);
}
})
// 发货方式
$
(
'.zy_delivery_type'
).
change
(
function
()
{
var
coupon_id
=
$
(
'#user_coupon'
).
val
();
var
address_id
=
$
(
'.address_id'
).
val
();
var
user_id
=
$
(
'.user_id'
).
val
();
var
cart_ids
=
[];
$
(
'.shop-table tbody'
).
find
(
'tr'
).
each
(
function
()
{
var
cid
=
$
(
this
).
data
(
'cid'
);
cart_ids
.
push
(
cid
);
})
if
(
coupon_id
)
{
$
(
'.user_coupon_id'
).
val
(
coupon_id
);
}
else
{
$
(
'.user_coupon_id'
).
val
(
''
);
}
loading
.
confirm
(
user_id
,
address_id
,
cart_ids
,
coupon_id
,
goods_type
,
is_online
);
// 确认订单信息
})
},
// 购物车商品列表
lists
:
function
(
user_id
,
goods_type
,
is_online
,
delivery_place
=
"1"
)
{
// type:1-联营,2-自营
var
self
=
this
;
var
user_coupon_id
=
$
(
'.user_coupon_id'
).
val
()
?
$
(
'.user_coupon_id'
).
val
()
:
0
;
$
.
ajax
({
type
:
'post'
,
url
:
'/ajax/cartList'
,
data
:
{
uid
:
user_id
,
type
:
goods_type
,
delivery_place
:
delivery_place
},
dataType
:
"json"
,
success
:
function
(
resp
){
if
(
resp
.
errcode
==
0
)
{
var
list
=
resp
.
data
.
list
;
var
len
=
list
.
length
;
var
html
=
''
;
var
order_amount
=
0
;
var
currency
=
''
;
var
cart_ids
=
[];
var
cart_gift
=
resp
.
data
.
cart_gift
;
// 订单赠品信息
if
(
len
==
0
)
return
false
;
var
buyer
=
''
;
// list = list.reverse();
// 购物车列表
for
(
var
i
=
len
-
1
;
i
>=
0
;
i
--
)
{
html
+=
'<tr data-cid="'
+
list
[
i
].
cart_id
+
'" data-type="'
+
list
[
i
].
type
+
'" min_buy="'
+
list
[
i
].
min_buy
+
'" data-sup_name="'
+
list
[
i
].
supplier_name
+
'" data-sup_id="'
+
list
[
i
].
supplier_id
+
'" data-brand_id="'
+
list
[
i
].
brand_id
+
'" data-brand_name="'
+
list
[
i
].
brand_name
+
'" data-goods_type="'
+
list
[
i
].
goods_type
+
'">'
+
'<td>'
+
(
len
-
i
)
+
'</td>'
+
'<td class="goods_id">'
+
list
[
i
].
goods_id
+
'</td>'
+
'<td>'
+
list
[
i
].
goods_name
+
'</td>'
+
'<td>'
+
list
[
i
].
brand_name
+
'</td>'
;
if
(
goods_type
==
1
)
{
// 联营添加标准品牌列
html
+=
list
[
i
].
standard_brand_name
?
'<td class="standard-brand-yellow">'
:
'<td>'
;
html
+=
'<input type="text" class="change_standard_brand_name" name="standard_brand_name" value="'
+
list
[
i
].
standard_brand_name
+
'" readonly /><i class="fa fa-exclamation-triangle fa-2x select-standard-brand" aria-hidden="true" data-type=1></i></td>'
;
}
// if (goods_type == 2) {
var
mpl
=
list
[
i
].
mpl
?
list
[
i
].
mpl
:
''
;
html
+=
'<td><span class="goods_mpl">'
+
mpl
+
'</span></td>'
;
// }
html
+=
'<td><input type="text" class="goods_num" name="goods_num" value="'
+
list
[
i
].
goods_number
+
'" data-origin_num="'
+
list
[
i
].
goods_number
+
'"></td>'
+
'<td class="goods_price">'
+
list
[
i
].
goods_price
+
'</td>'
+
'<td class="goods_amount">'
+
list
[
i
].
goods_amount_format
+
'</td>'
+
'<td>'
+
list
[
i
].
delivery_time
+
'</td>'
;
if
(
goods_type
==
1
)
{
html
+=
'<td>'
+
list
[
i
].
supplier_name
+
'</td>'
;
buyer
=
list
[
i
].
buyer_id
!=
'0'
?
list
[
i
].
buyer_id
:
''
;
html
+=
'<td>'
+
buyer
+
'</td>'
;
html
+=
'<td>'
+
list
[
i
].
batch
+
'</td>'
;
}
html
+=
'<td><a class="btn btn-danger btn-xs remove-goods">删除</a></td>'
+
'</tr>'
;
cart_ids
.
push
(
list
[
i
].
cart_id
);
// 购物车ID集合
}
$
(
'.shop-lists'
).
show
();
$
(
'.shop-table tbody'
).
empty
().
append
(
html
);
$
(
'#sale_type'
).
val
(
list
[
0
].
sale_type
);
// 自营线上订单选择销售类型
var
address_id
=
$
(
'.address_id'
).
val
();
self
.
confirm
(
user_id
,
address_id
,
cart_ids
,
user_coupon_id
,
goods_type
,
is_online
);
// 确认订单信息
// 自营商品检查数量
// if (goods_type == 2) { // 20200826 订单合并后,不以goods_type为判断条件
var
changeGoods
=
[];
$
(
'.shop-table tbody tr'
).
each
(
function
()
{
var
goods_id
=
$
(
this
).
find
(
'.goods_id'
).
text
();
var
num
=
Number
(
$
(
this
).
find
(
'.goods_num'
).
val
());
var
mpl
=
Number
(
$
(
this
).
find
(
'.goods_mpl'
).
text
());
var
cart_id
=
$
(
this
).
data
(
'cid'
);
var
type
=
$
(
this
).
data
(
'type'
);
var
curr_goods_type
=
$
(
this
).
data
(
'goods_type'
);
var
self_goods_type
=
[
'3'
,
'4'
];
// 自营商品类型
// 自营商品 且 数量与倍数不匹配
if
(
self_goods_type
.
indexOf
(
curr_goods_type
)
!=
-
1
&&
num
%
mpl
!=
0
)
{
num
=
Math
.
ceil
(
num
/
mpl
)
*
mpl
;
$
.
ajax
({
type
:
"POST"
,
url
:
'/ajax/changeNum'
,
data
:
{
uid
:
user_id
,
num
:
num
,
cart_id
:
cart_id
,
type
:
type
,
goods_type
:
goods_type
},
dataType
:
"json"
,
async
:
false
,
success
:
function
(
resp
){
if
(
resp
.
errcode
==
0
)
{
changeGoods
.
push
(
goods_id
);
}
},
})
}
})
if
(
changeGoods
.
length
>
0
)
{
layer
.
alert
(
'已按倍数调整购买数量,商品ID:'
+
changeGoods
.
join
(
', '
));
self
.
lists
(
user_id
,
goods_type
,
is_online
,
delivery_place
);
// 加载购物车列表
}
// }
// 赠品信息
if
(
cart_gift
.
err_code
==
0
)
{
var
gift_len
=
cart_gift
.
data
.
length
;
var
gift_data
=
cart_gift
.
data
;
var
str
=
''
;
for
(
var
i
=
0
;
i
<
gift_len
;
i
++
)
{
str
+=
'<tr>\
<td>'
+
gift_data
[
i
].
activity_id
+
'</td>\
<td>\
<div class="layer-photos-demo">\
<a><img src="'
+
gift_data
[
i
].
pic
+
'" width="20" height="20"></a>\
</div>\
</td>\
<td>'
+
gift_data
[
i
].
item_name
+
'</td>\
<td>'
+
gift_data
[
i
].
num
+
'</td>\
<td>'
+
gift_data
[
i
].
content
+
'</td>\
</tr>'
;
}
$
(
'.gift-table tbody'
).
empty
().
append
(
str
);
$
(
'.order-gift-info'
).
show
();
}
else
{
$
(
'.order-gift-info'
).
hide
();
}
return
false
;
}
layer
.
msg
(
resp
.
errmsg
||
'网络异常'
);
$
(
'.shop-lists'
).
hide
();
if
(
is_online
)
{
$
(
'.order-info'
).
hide
();
}
else
{
$
(
'.amount-section'
).
hide
();
}
},
});
},
// 可用优惠券
getCoupon
:
function
(
user_id
,
goods_type
,
cart_ids
)
{
$
.
ajax
({
type
:
'post'
,
url
:
'/ajax/getCoupon'
,
data
:
{
uid
:
user_id
,
goods_type
:
goods_type
,
cart_ids
:
cart_ids
},
dataType
:
"json"
,
success
:
function
(
resp
){
if
(
resp
.
errcode
==
0
)
{
var
data
=
resp
.
data
;
var
str
=
'<option value="">请选择</option>'
;
if
(
data
.
user_coupon_id
!=
null
)
{
layer
.
msg
(
resp
.
errmsg
);
str
+=
'<option value="'
+
data
.
user_coupon_id
+
'">'
+
data
.
coupon_name
+
'</option>'
;
$
(
'#user_coupon'
).
attr
(
'data-amount'
,
data
.
sale_amount
);
// 优惠券金额
$
(
'#user_coupon'
).
empty
().
append
(
str
);
return
false
;
}
else
{
$
(
'#user_coupon'
).
empty
().
append
(
str
);
}
return
false
;
}
layer
.
msg
(
resp
.
errmsg
||
'网络异常'
);
}
})
},
// 确认订单信息
confirm
:
function
(
user_id
,
address_id
,
cart_ids
,
user_coupon_id
,
goods_type
,
is_online
=
1
)
{
var
self
=
this
;
var
business_type
=
$
(
'#business_type'
);
// 自营其他业务
var
zy_delivery_type
=
$
(
'.zy_delivery_type'
).
val
();
// 发货方式
if
(
business_type
.
length
>
0
)
{
business_type
=
business_type
.
val
();
}
else
{
business_type
=
0
;
}
$
.
ajax
({
type
:
'post'
,
url
:
'/ajax/confirm'
,
data
:
{
uid
:
user_id
,
address_id
:
address_id
,
cart_ids
:
cart_ids
,
user_coupon_id
:
user_coupon_id
,
goods_type
:
goods_type
,
is_online
:
is_online
,
business_type
:
business_type
,
zy_delivery_type
:
zy_delivery_type
},
dataType
:
"json"
,
success
:
function
(
resp
){
if
(
resp
.
errcode
==
0
)
{
var
data
=
resp
.
data
;
if
(
is_online
)
{
$
(
'.order-info'
).
show
();
$
(
'.goods_amount_val'
).
empty
().
text
(
data
.
goods_total_format
);
// 商品总额
$
(
'.order_amount'
).
empty
().
text
(
data
.
order_amount_format
);
// 订单总额
// 联营和自营线上
if
(
is_online
!=
2
)
{
if
(
!
user_coupon_id
)
{
// 若优惠券ID不存在,则推荐
$
(
'.preferential_price'
).
hide
();
$
(
'.preferential_price_val'
).
empty
();
self
.
getCoupon
(
user_id
,
goods_type
,
cart_ids
);
// 获取最优的优惠券
}
else
{
$
(
'.preferential_price'
).
show
();
$
(
'.preferential_price_val'
).
empty
().
text
(
data
.
preferential_price_format
);
}
}
if
(
goods_type
==
1
)
{
var
list
=
resp
.
data
.
list
;
var
is_dgk
=
false
;
for
(
var
i
=
0
;
i
<
list
.
length
;
i
++
)
{
if
(
list
[
i
].
supplier_id
==
'7'
||
list
[
i
].
supplier_name
.
toLowerCase
()
==
'digikey'
)
{
is_dgk
=
true
;
}
}
if
(
is_dgk
)
{
$
(
'.client-info'
).
css
(
'display'
,
'block'
);
// 若已选择发票,再次触发发票事件,添加终端信息
if
(
$
(
'.tax_id'
).
val
())
{
$
(
'#invoice'
).
trigger
(
'change'
);
}
}
else
{
$
(
'.client-info'
).
css
(
'display'
,
'none'
);
}
}
if
(
data
.
extend_fee
)
{
$
(
'.extend_fee'
).
show
();
$
(
'.extend_fee_val'
).
empty
().
text
(
data
.
extend_fee_format
);
// 附加费
}
// if (goods_type == 2 && business_type != 2) { // 自营仓库损耗不需要运费
// $('.express_fee_val').empty().text(data.finally_shipping_price_format); // 运费
// }
$
(
'.express_fee_val'
).
empty
().
text
(
data
.
finally_shipping_price_format
);
// 订单合并后,如果存在运费则需要展示
}
else
{
$
(
'.amount-section'
).
show
();
$
(
'.order_amount'
).
empty
().
text
(
data
.
order_amount_format
);
}
return
false
;
}
else
{
$
(
'.client-info'
).
css
(
'display'
,
'none'
);
// 隐藏终端信息
}
layer
.
msg
(
resp
.
errmsg
||
'网络异常'
);
}
})
},
}
});
})(
jQuery
)
//获取url中的参数
function
getUrlParam
(
name
)
{
var
reg
=
new
RegExp
(
"(^|&)"
+
name
+
"=([^&]*)(&|$)"
);
//构造一个含有目标参数的正则表达式对象
var
r
=
window
.
location
.
search
.
substr
(
1
).
match
(
reg
);
//匹配目标参数
if
(
r
!=
null
)
return
unescape
(
r
[
2
]);
return
null
;
//返回参数值
}
\ No newline at end of file
})
\ No newline at end of file
public/js/add_order_bak.js
0 → 100644
View file @
8f593127
+
(
function
(
$
){
$
.
lie
=
$
.
lie
||
{
version
:
"v1.0.0"
};
$
.
extend
(
$
.
lie
,
{
add_order
:{
lyorder
:
function
()
{
// 联营订单
this
.
bind
(
1
,
1
);
},
zyorder
:
function
()
{
// 自营线上订单
this
.
bind
(
2
,
1
);
},
offline
:
function
(
internal_uid
)
{
// 自营线下订单
this
.
bind
(
2
,
0
,
internal_uid
);
this
.
lists
(
internal_uid
,
2
,
0
);
},
businessType
:
function
()
{
// 自营其他业务订单
this
.
bind
(
2
,
2
);
},
/**
* goods_type: is_online:是否线上订单
* @param {[type]} goods_type [1-联营,2-自营]
* @param {Boolean} is_online [0-自营线下,1-联营/自营线上,2-自营其他业务]
* @param {String} internal_uid [自营内部采购账号ID]
* @return {[type]} [description]
*/
bind
:
function
(
goods_type
,
is_online
,
internal_uid
=
''
)
{
var
loading
=
this
;
// 获取用户信息
function
get_user
(){
var
mobile
=
$
(
'.search-user'
).
val
();
// if(mobile == -1){
// var mobile = getUrlParam('user_id');
// }
if
(
!
mobile
)
return
false
;
// 自营其他订单类型---仓库损耗
if
(
mobile
==
'15022222222'
)
{
$
(
'#business_type'
).
val
(
2
).
attr
(
'disabled'
,
true
);
}
else
{
$
(
'#business_type'
).
val
(
1
).
attr
(
'disabled'
,
false
);
}
$
.
ajax
({
url
:
'/ajax/getUserInfo'
,
type
:
'post'
,
data
:
{
goods_type
:
goods_type
,
mobile
:
mobile
},
dataType
:
'json'
,
success
:
function
(
resp
)
{
if
(
resp
.
errcode
==
0
)
{
var
data
=
resp
.
data
;
var
reg
=
/@/
;
$
(
'.user-info'
).
show
();
// 账号信息
$
(
'.user_id'
).
val
(
data
.
user
.
user_id
);
if
(
reg
.
test
(
mobile
))
{
$
(
'.user-mobile'
).
text
(
data
.
user
.
email
);
}
else
{
$
(
'.user-mobile'
).
text
(
data
.
user
.
mobile
);
}
var
is_test
=
data
.
user
.
is_test
?
'是'
:
'否'
;
$
(
'.user-test'
).
text
(
is_test
);
// 快递信息
if
(
data
.
address
!=
null
)
{
var
addr_len
=
data
.
address
.
length
;
var
addr_str
=
'<option value="">请选择</option>'
;
for
(
var
i
=
0
;
i
<
addr_len
;
i
++
)
{
addr_str
+=
'<option value="'
+
data
.
address
[
i
][
'address_id'
]
+
'">'
+
data
.
address
[
i
][
'consignee'
]
+
'</option>'
;
}
$
(
'#address'
).
empty
().
append
(
addr_str
);
}
// 发票信息
// if (data.invoice != null) {
// var inv_len = data.invoice.length;
// var inv_str = '<option value="">请选择</option>';
// for (var i = 0; i < inv_len; i++) {
// inv_str += '<option value="'+data.invoice[i]['tax_id']+'">'+data.invoice[i]['tax_title']+'</option>';
// }
// $('#invoice').empty().append(inv_str);
// }
loading
.
lists
(
data
.
user
.
user_id
,
goods_type
,
is_online
);
// 加载该用户购物车
return
false
;
}
layer
.
msg
(
resp
.
errmsg
)
},
})
}
get_user
();
$
(
'.get-user'
).
click
(
function
(){
// var mobile = $(this).siblings('.search-user').val();
// get_user(mobile)
get_user
();
})
// 选择收货地址
$
(
'.user-info'
).
delegate
(
'#address'
,
'change'
,
function
()
{
var
user_id
=
$
(
'.user_id'
).
val
();
var
address_id
=
$
(
this
).
val
();
var
user_coupon_id
=
$
(
'.user_coupon_id'
).
val
();
var
cart_ids
=
[];
$
(
'.shop-table tbody'
).
find
(
'tr'
).
each
(
function
()
{
var
cid
=
$
(
this
).
data
(
'cid'
);
cart_ids
.
push
(
cid
);
})
if
(
address_id
)
{
$
.
ajax
({
url
:
'/ajax/selectAddr'
,
type
:
'post'
,
data
:
{
address_id
:
address_id
},
dataType
:
'json'
,
success
:
function
(
resp
)
{
if
(
resp
.
errcode
==
0
)
{
var
data
=
resp
.
data
;
$
(
'.address-content'
).
show
();
$
(
'.address_id'
).
val
(
data
.
address_id
);
$
(
'.address-consignee'
).
text
(
data
.
consignee
);
$
(
'.address-mobile'
).
text
(
data
.
mobile
);
$
(
'.address-detail'
).
text
(
data
.
province_val
+
data
.
city_val
+
data
.
district_val
+
data
.
detail_address
);
if
(
cart_ids
.
length
>
0
)
{
loading
.
confirm
(
user_id
,
address_id
,
cart_ids
,
user_coupon_id
,
goods_type
,
is_online
);
// 确认订单信息
}
return
false
;
}
layer
.
msg
(
resp
.
errmsg
||
'网络异常'
);
}
})
}
else
{
$
(
'.address-content'
).
hide
();
$
(
'.address_id'
).
val
(
''
);
if
(
cart_ids
.
length
>
0
)
{
loading
.
confirm
(
user_id
,
address_id
,
cart_ids
,
user_coupon_id
,
goods_type
,
is_online
);
// 确认订单信息
}
}
})
// 选择发票类型
$
(
'.user-info'
).
delegate
(
'.radio-inv-type'
,
'click'
,
function
()
{
var
inv_type
=
$
(
this
).
val
();
var
user_id
=
$
(
'.user_id'
).
val
();
var
inv_str
=
'<option value="">请选择</option>'
;
$
(
'.invoice-content'
).
hide
();
$
(
'.tax_id'
).
val
(
''
);
// 提示
if
(
inv_type
==
2
||
inv_type
==
''
)
{
layer
.
alert
(
'个人和不开票只能为个人形式,后续不能更改为公司进行开票,请确认风险'
);
}
if
(
inv_type
)
{
$
.
ajax
({
url
:
'/ajax/selectInvType'
,
type
:
'post'
,
data
:
{
user_id
:
user_id
,
inv_type
:
inv_type
},
dataType
:
'json'
,
success
:
function
(
resp
)
{
if
(
resp
.
errcode
==
0
)
{
var
data
=
resp
.
data
;
if
(
data
!=
null
)
{
var
inv_len
=
data
.
length
;
for
(
var
i
=
0
;
i
<
inv_len
;
i
++
)
{
inv_str
+=
'<option value="'
+
data
[
i
][
'tax_id'
]
+
'">'
+
data
[
i
][
'tax_title'
]
+
'</option>'
;
}
$
(
'#invoice'
).
empty
().
append
(
inv_str
);
}
else
{
$
(
'#invoice'
).
empty
().
append
(
inv_str
);
}
return
false
;
}
layer
.
msg
(
resp
.
errmsg
||
'网络异常'
);
}
})
}
else
{
$
(
'#invoice'
).
empty
().
append
(
inv_str
);
}
})
// 选择发票信息
$
(
'.user-info'
).
delegate
(
'#invoice'
,
'change'
,
function
()
{
var
tax_id
=
$
(
this
).
val
();
if
(
tax_id
)
{
$
.
ajax
({
url
:
'/ajax/selectInv'
,
type
:
'post'
,
data
:
{
tax_id
:
tax_id
},
dataType
:
'json'
,
success
:
function
(
resp
)
{
if
(
resp
.
errcode
==
0
)
{
var
data
=
resp
.
data
;
var
inv_type_val
=
''
;
$
(
'.invoice-content'
).
show
();
$
(
'.tax_id'
).
val
(
data
.
tax_id
);
$
(
'.tax_title'
).
text
(
data
.
tax_title
);
$
(
'.tax_no'
).
text
(
data
.
tax_no
);
$
(
'.bank_account'
).
text
(
data
.
bank_account
);
$
(
'.bank_name'
).
text
(
data
.
bank_name
);
$
(
'.company_phone'
).
text
(
data
.
company_phone
);
$
(
'.company_address'
).
text
(
data
.
company_address
);
$
(
'.consignee'
).
text
(
data
.
consignee
);
$
(
'.consignee_phone'
).
text
(
data
.
consignee_phone
);
$
(
'.consignee_address'
).
text
(
data
.
province_val
+
data
.
city_val
+
data
.
district_val
+
data
.
consignee_address
);
switch
(
data
.
inv_type
)
{
case
2
:
inv_type_val
=
'普通发票'
;
break
;
case
3
:
inv_type_val
=
'增值税专用发票'
;
break
;
case
4
:
inv_type_val
=
'增值税普通发票'
;
break
;
default
:
inv_type_val
=
'未知'
;
break
;
}
$
(
'.inv_type'
).
text
(
inv_type_val
);
// 若购物车存在Digikey商品,选择增值税普票或专票后,默认将发票抬头赋值给终端信息(中文名称),且不能更改
if
(
$
(
'.client-info'
).
css
(
'display'
)
==
'block'
)
{
if
(
data
.
inv_type
==
3
||
data
.
inv_type
==
4
)
{
$
(
'.customer_cn'
).
val
(
data
.
tax_title
);
$
(
'.customer_en'
).
val
(
data
.
customer_en
);
$
(
'.customer_type'
).
val
(
data
.
customer_type
);
$
(
'.product_use_classone_sn'
).
val
(
data
.
product_use_classone_sn
);
$
(
'.product_use_classone_sn'
).
change
();
// 添加change事件
$
(
'.product_use_classtwo_sn'
).
val
(
data
.
product_use_classtwo_sn
);
$
(
'.customer_website'
).
val
(
data
.
customer_website
);
}
else
{
$
(
'.customer_cn'
).
val
(
''
);
$
(
'.customer_en'
).
val
(
''
);
$
(
'.customer_type'
).
val
(
''
);
$
(
'.product_use_classone_sn'
).
val
(
''
);
$
(
'.product_use_classone_sn'
).
change
();
$
(
'.customer_website'
).
val
(
''
);
layer
.
msg
(
'购物车中存在digikey商品,请选择增值税普票或专票'
);
}
}
}
}
})
}
else
{
$
(
'.invoice-content'
).
hide
();
$
(
'.tax_id'
).
val
(
''
);
}
})
// 获取SKU信息
$
(
'.get-sku'
).
click
(
function
()
{
var
sku_id
=
$
(
this
).
siblings
(
'.search-sku'
).
val
();
var
user_id
=
$
(
'.user_id'
).
val
()
||
0
;
if
(
!
sku_id
)
{
layer
.
msg
(
'请输入SKU_ID'
);
return
false
;
}
if
(
!
/^
\d
*$/
.
test
(
sku_id
))
{
layer
.
msg
(
'参数错误,请输入正确的SKU_ID'
);
return
false
;
}
$
.
ajax
({
url
:
'/ajax/getSku'
,
type
:
'post'
,
data
:
{
sku_id
:
sku_id
.
trim
(),
user_id
:
user_id
},
dataType
:
'json'
,
success
:
function
(
resp
)
{
console
.
log
(
resp
)
if
(
resp
.
errcode
!=
0
)
{
console
.
log
(
resp
.
data
)
layer
.
msg
(
resp
.
errmsg
);
return
false
;
}
$
(
'.sku-info'
).
show
();
var
data
=
resp
.
data
;
var
status_val
=
''
;
$
(
'.goods_name'
).
text
(
data
.
goods_name
);
$
(
'.brand_name'
).
text
(
data
.
brand_name
);
$
(
'.supplier_name'
).
text
(
data
.
supplier_name
);
$
(
'.stock'
).
text
(
data
.
goods_number
);
$
(
'.moq'
).
text
(
data
.
min_buy
);
$
(
'.mpq'
).
text
(
data
.
min_mpq
);
if
(
data
.
self_supplier_type
==
1
){
$
(
'.self_supplier_type'
).
text
(
'自采'
);
}
else
if
(
data
.
self_supplier_type
==
2
){
$
(
'.self_supplier_type'
).
text
(
'立创'
);
}
else
{
$
(
'.self_supplier_type'
).
text
(
'自采'
);
}
// if (goods_type == 1) {
// var status = data.goods_status;
// } else {
// var status = data.status;
// }
// switch (status) {
// case 0: status_val = '待入库'; break;
// case 1: status_val = '审核通过(上架)'; break;
// case 3: status_val = '下架'; break;
// case 4: status_val = '删除'; break;
// }
status_val
=
data
.
is_buy
?
'是'
:
'否'
;
$
(
'.status'
).
text
(
status_val
);
$
(
'.goods_id'
).
val
(
data
.
goods_id
);
$
(
'.goods_type'
).
val
(
data
.
goods_type
);
//阶梯价格
if
(
data
.
tiered
!=
null
)
{
var
len
=
data
.
tiered
.
length
;
if
(
len
>
0
)
{
var
html
=
''
;
html
+=
'<tr><th>阶梯</th><th>RMB价格</th>'
;
if
(
data
.
ac_type
&&
data
.
ac_type
!=
5
)
{
// ac_type = 5 为新客价,目前后台不展示新客价
switch
(
data
.
ac_type
)
{
case
1
:
html
+=
'<th>限时限量</th>'
;
break
;
case
2
:
html
+=
'<th>活动价</th>'
;
break
;
case
3
:
html
+=
'<th>会员价</th>'
;
break
;
case
6
:
html
+=
'<th>自营清库存</th>'
;
break
;
case
7
:
html
+=
'<th>团购价</th>'
;
break
;
case
8
:
html
+=
'<th>折扣价</th>'
;
break
;
case
10
:
html
+=
'<th>活动打折</th>'
;
break
;
default
:
html
+=
'<th></th>'
;
break
;
}
}
var
joint_goods_type
=
[
'1'
,
'2'
];
// 商品联营类型
if
(
joint_goods_type
.
indexOf
(
data
.
goods_type
)
!=
-
1
)
{
html
+=
'<th>USD价格</th>'
;
}
html
+=
'</tr>'
;
for
(
var
i
=
0
;
i
<
len
;
i
++
)
{
html
+=
'<tr>'
;
if
(
i
==
0
)
{
if
(
data
.
ac_type
&&
data
.
ac_type
!=
5
)
{
html
+=
'<td><span class="goods-min-num">'
+
data
.
tiered
[
i
][
'purchases'
]
+
'</span></td><td>¥<span class="goods-min-price price-line">'
+
data
.
tiered
[
i
][
'price_cn'
]
+
'</span><td>¥<span>'
+
data
.
tiered
[
i
][
'price_ac'
]
+
'</span></td>'
;
}
else
{
html
+=
'<td><span class="goods-min-num">'
+
data
.
tiered
[
i
][
'purchases'
]
+
'</span></td><td>¥<span class="goods-min-price">'
+
data
.
tiered
[
i
][
'price_cn'
]
+
'</span></td>'
;
}
if
(
joint_goods_type
.
indexOf
(
data
.
goods_type
)
!=
-
1
)
{
html
+=
'<td>$<span class="goods-min-price-us">'
+
data
.
tiered
[
i
][
'price_us'
]
+
'</span></td>'
;
}
}
else
{
if
(
data
.
ac_type
&&
data
.
ac_type
!=
5
)
{
html
+=
'<td><span>'
+
data
.
tiered
[
i
][
'purchases'
]
+
'</span></td><td>¥<span class="price-line">'
+
data
.
tiered
[
i
][
'price_cn'
]
+
'</span></td><td>¥<span>'
+
data
.
tiered
[
i
][
'price_ac'
]
+
'</span></td>'
;
}
else
{
html
+=
'<td><span>'
+
data
.
tiered
[
i
][
'purchases'
]
+
'</span></td><td>¥<span>'
+
data
.
tiered
[
i
][
'price_cn'
]
+
'</span></td>'
;
}
if
(
joint_goods_type
.
indexOf
(
data
.
goods_type
)
!=
-
1
)
{
html
+=
'<td>$<span>'
+
data
.
tiered
[
i
][
'price_us'
]
+
'</span></td>'
;
}
}
html
+=
'</tr>'
;
}
// $('.ladder_price_table tr:gt(0)').remove();
$
(
'.ladder_price_table'
).
empty
().
append
(
html
);
}
}
}
})
})
// 添加到商品列表
$
(
'.add-to-lists'
).
click
(
function
()
{
var
goods_min_num
=
$
(
this
).
parents
(
'.sku-info'
).
find
(
'.moq'
).
text
();
var
goods_id
=
$
(
this
).
siblings
(
'.goods_id'
).
val
();
var
type
=
$
(
this
).
siblings
(
'.goods_type'
).
val
();
var
delivery_place
=
1
;
// 1.大陆,2.香港 自营默认是大陆
var
user_id
=
0
;
if
(
internal_uid
)
{
user_id
=
internal_uid
;
}
else
{
user_id
=
$
(
'.user_id'
).
val
();
}
if
(
!
user_id
)
{
layer
.
msg
(
'请先选择用户'
);
return
false
;
}
// if (goods_type == 1) { // 联营需要选择交货地
delivery_place
=
$
(
'input[name=delivery_place]:checked'
).
val
();
if
(
delivery_place
==
null
)
{
layer
.
msg
(
'请选择交货地'
);
return
false
;
}
// if (type == 3 || type == 4) {
// layer.msg('仅支持联营商品下单,请在自营订单中下单');
// return false;
// }
var
goods_min_price
=
$
(
this
).
parents
(
'.sku-info'
).
find
(
'.goods-min-price'
).
text
();
var
goods_min_price_us
=
$
(
this
).
parents
(
'.sku-info'
).
find
(
'.goods-min-price-us'
).
text
();
if
(
delivery_place
==
1
)
{
if
(
goods_min_price
==
0
)
{
layer
.
msg
(
'缺少RMB价格,商品添加失败'
);
return
false
;
}
}
else
if
(
delivery_place
==
2
)
{
if
(
goods_min_price_us
==
0
)
{
layer
.
msg
(
'缺少美金价格,商品添加失败'
);
return
false
;
}
}
// } else {
// if (type == 1 || type == 2) { // 1.联营 2.专卖
// layer.msg('仅支持自营商品下单,请在联营订单中下单');
// return false;
// }
// }
var
datax
=
{
uid
:
user_id
,
id
:
goods_id
,
num
:
goods_min_num
,
buy
:
-
1
,
delivery_place
:
delivery_place
,
}
$
.
ajax
({
type
:
"POST"
,
url
:
'/ajax/addCart'
,
data
:
datax
,
dataType
:
"json"
,
success
:
function
(
resp
){
layer
.
msg
(
resp
.
errmsg
);
loading
.
lists
(
user_id
,
goods_type
,
is_online
,
delivery_place
);
// 加载购物车列表
return
false
;
},
})
})
// 切换交货地
$
(
'.delivery_place'
).
click
(
function
()
{
var
user_id
=
$
(
'.user_id'
).
val
();
var
delivery_place
=
$
(
this
).
val
();
loading
.
lists
(
user_id
,
goods_type
,
is_online
,
delivery_place
);
// 加载购物车列表
})
// 调整商品数量
$
(
'.shop-table'
).
delegate
(
'.goods_num'
,
'blur'
,
function
()
{
var
self
=
$
(
this
);
var
origin_num
=
self
.
data
(
'origin_num'
);
// 原始数量
var
num
=
self
.
val
();
var
min_buy
=
Number
(
self
.
parents
(
'tr'
).
attr
(
'min_buy'
));
var
cart_id
=
self
.
parents
(
'tr'
).
data
(
'cid'
);
var
type
=
self
.
parents
(
'tr'
).
data
(
'type'
);
var
user_id
=
0
;
var
delivery_place
=
1
;
// 1.大陆,2.香港 自营默认是大陆
if
(
origin_num
==
num
)
return
;
// 未修改数量,则return
if
(
internal_uid
)
{
user_id
=
internal_uid
;
}
else
{
user_id
=
$
(
'.user_id'
).
val
();
}
if
(
num
<
min_buy
)
{
self
.
val
(
min_buy
);
layer
.
msg
(
'购买数量低于最小起订量,默认调整为最小起订量'
);
return
}
var
curr_goods_type
=
$
(
this
).
parents
(
'tr'
).
data
(
'goods_type'
);
var
joint_goods_type
=
[
1
,
2
];
// 商品联营类型
// if (goods_type == 1) { // 联营需要选择交货地
if
(
joint_goods_type
.
indexOf
(
curr_goods_type
)
!=
-
1
)
{
delivery_place
=
$
(
'input[name=delivery_place]:checked'
).
val
();
}
else
{
// 自营数量需要结合倍数
var
mpl
=
Number
(
self
.
parents
(
'tr'
).
find
(
'.goods_mpl'
).
text
());
// 倍数
num
=
Math
.
ceil
(
num
/
mpl
)
*
mpl
;
}
$
.
ajax
({
type
:
"POST"
,
url
:
'/ajax/changeNum'
,
data
:
{
uid
:
user_id
,
num
:
num
,
cart_id
:
cart_id
,
type
:
type
,
goods_type
:
goods_type
},
dataType
:
"json"
,
success
:
function
(
resp
){
if
(
resp
.
errcode
==
0
)
{
loading
.
lists
(
user_id
,
goods_type
,
is_online
,
delivery_place
);
// 加载购物车列表
return
false
;
}
layer
.
msg
(
resp
.
errmsg
);
},
})
})
// 删除商品
$
(
'.shop-table'
).
delegate
(
'.remove-goods'
,
'click'
,
function
()
{
var
self
=
$
(
this
);
var
cart_id
=
self
.
parents
(
'tr'
).
data
(
'cid'
);
var
user_id
=
0
;
var
delivery_place
=
1
;
// 1.大陆,2.香港 自营默认是大陆
if
(
internal_uid
)
{
user_id
=
internal_uid
;
}
else
{
user_id
=
$
(
'.user_id'
).
val
();
}
if
(
goods_type
==
1
)
{
// 联营需要选择交货地
delivery_place
=
$
(
'input[name=delivery_place]:checked'
).
val
();
}
layer
.
open
({
title
:
'删除提示'
,
content
:
'确定删除该商品吗?'
,
btn
:
[
'确定'
,
'取消'
],
btn1
:
function
()
{
$
.
ajax
({
type
:
"POST"
,
url
:
'/ajax/deleteGoods'
,
data
:
{
uid
:
user_id
,
cart_id
:
cart_id
},
dataType
:
"json"
,
success
:
function
(
resp
){
layer
.
msg
(
resp
.
errmsg
);
// self.parents('tr').remove();
loading
.
lists
(
user_id
,
goods_type
,
is_online
,
delivery_place
);
// 加载购物车列表
return
false
;
},
})
layer
.
msg
(
'商品删除中...'
,
{
icon
:
16
,
time
:
0
,
shade
:
0.3
});
},
btn2
:
function
(
index
)
{
layer
.
close
(
index
);
}
})
})
// 选择优惠券
$
(
'#user_coupon'
).
change
(
function
(){
var
coupon_id
=
$
(
this
).
val
();
var
address_id
=
$
(
'.address_id'
).
val
();
var
user_id
=
$
(
'.user_id'
).
val
();
var
cart_ids
=
[];
$
(
'.shop-table tbody'
).
find
(
'tr'
).
each
(
function
()
{
var
cid
=
$
(
this
).
data
(
'cid'
);
cart_ids
.
push
(
cid
);
})
if
(
coupon_id
)
{
$
(
'.user_coupon_id'
).
val
(
coupon_id
);
}
else
{
$
(
'.user_coupon_id'
).
val
(
''
);
}
loading
.
confirm
(
user_id
,
address_id
,
cart_ids
,
coupon_id
,
goods_type
,
is_online
);
// 确认订单信息
})
// 切换销售类型
$
(
'#sale_type'
).
change
(
function
()
{
var
coupon_id
=
$
(
'.user_coupon_id'
).
val
();
var
address_id
=
$
(
'.address_id'
).
val
();
var
user_id
=
$
(
'.user_id'
).
val
();
var
sale_type
=
$
(
this
).
val
();
var
cart_ids
=
[];
$
(
'.shop-table tbody'
).
find
(
'tr'
).
each
(
function
()
{
var
cid
=
$
(
this
).
data
(
'cid'
);
cart_ids
.
push
(
cid
);
})
if
(
cart_ids
.
length
>
0
)
{
$
.
ajax
({
type
:
"POST"
,
url
:
'/ajax/switchSaleType'
,
data
:
{
sale_type
:
sale_type
,
cart_ids
:
cart_ids
},
dataType
:
"json"
,
success
:
function
(
resp
){
if
(
resp
.
errcode
==
0
)
{
layer
.
msg
(
resp
.
errmsg
);
loading
.
lists
(
user_id
,
goods_type
,
is_online
);
// 加载购物车列表
return
false
;
}
layer
.
msg
(
resp
.
errmsg
);
},
})
}
})
// 批量导入物料
$
(
'.goods_import'
).
click
(
function
()
{
var
user_id
=
$
(
'.user_id'
).
val
();
var
delivery_place
=
1
;
// 1.大陆,2.香港 自营默认是大陆
user_id
=
internal_uid
?
internal_uid
:
user_id
;
// 若是内部下单则使用内部用户ID
if
(
!
user_id
)
{
layer
.
msg
(
'请先选择用户'
);
return
false
;
}
if
(
goods_type
==
1
)
{
delivery_place
=
$
(
'input[name=delivery_place]:checked'
).
val
();
}
// 上传文件
var
form
=
$
(
'<form id="formUpload" method="post" enctype="multipart/form-data">\
<input type="file" name="upload" id="fileInput" accept="application/vnd.ms-excel, application/x-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, .csv">\
</form>'
);
var
type
=
$
(
this
).
data
(
'type'
);
// 1-联营模板,2-自营模板
form
.
find
(
'input'
).
change
(
function
(){
var
formData
=
new
FormData
();
formData
.
append
(
'file'
,
this
.
files
[
0
]);
formData
.
append
(
'type'
,
type
);
formData
.
append
(
'user_id'
,
user_id
);
formData
.
append
(
'delivery_place'
,
delivery_place
);
$
.
ajax
({
type
:
"POST"
,
url
:
'/ajax/batchGoodsImport'
,
data
:
formData
,
dataType
:
'json'
,
cache
:
false
,
processData
:
false
,
contentType
:
false
,
success
:
function
(
resp
){
if
(
resp
.
errcode
==
0
)
{
layer
.
msg
(
resp
.
errmsg
);
loading
.
lists
(
user_id
,
goods_type
,
is_online
,
delivery_place
);
// 加载购物车列表
return
false
;
}
layer
.
alert
(
resp
.
errmsg
);
},
})
layer
.
msg
(
'批量导入中...'
,
{
icon
:
16
,
time
:
0
,
shade
:
0.3
});
})
form
.
find
(
'input[type="file"]'
).
trigger
(
'click'
);
})
// 提交订单
// $('.submit-order').on('click', function() {
$
(
'.submit-order'
).
off
().
on
(
'click'
,
function
()
{
var
self
=
$
(
this
);
var
address_id
=
$
(
'input[name=address_id]'
).
val
();
var
type
=
self
.
data
(
'type'
);
// 1-联营线上,2-自营线上,3-自营线下,4-自营其他业务
var
cart_ids
=
[];
var
user_id
=
0
;
var
remark
=
$
(
'#remark'
).
val
();
// 订单备注
if
(
internal_uid
)
{
user_id
=
internal_uid
;
}
else
{
user_id
=
$
(
'.user_id'
).
val
();
}
var
is_dgk
=
false
;
$
(
'.shop-table tbody tr'
).
each
(
function
()
{
var
cid
=
$
(
this
).
data
(
'cid'
);
cart_ids
.
push
(
cid
);
var
supplier_id
=
$
(
this
).
data
(
'sup_id'
);
var
supplier_name
=
$
(
this
).
data
(
'sup_name'
);
if
(
supplier_id
==
'7'
||
supplier_name
.
toString
().
toLowerCase
()
==
'digikey'
)
{
is_dgk
=
true
;
}
})
if
(
cart_ids
.
length
>
0
)
{
var
submit
=
true
;
var
datax
=
{
uid
:
user_id
,
sale_id
:
sale_id
,
address_id
:
address_id
,
type
:
type
,
cart_ids
:
cart_ids
,
remark
:
remark
,
}
if
(
type
==
3
)
{
// 自营线下订单
datax
.
address_name
=
$
(
'input[name=address_name]'
).
val
();
datax
.
address_mobile
=
$
(
'input[name=address_mobile]'
).
val
();
}
else
{
// 联营、自营线上订单
var
tax_id
=
$
(
'.tax_id'
).
val
();
var
inv_type
=
$
(
'input[name=inv_type]:checked'
).
val
();
var
user_coupon_id
=
$
(
'.user_coupon_id'
).
val
();
var
zy_delivery_type
=
$
(
'.zy_delivery_type'
).
val
();
if
(
!
address_id
)
{
layer
.
msg
(
'请选择快递信息'
);
return
false
;
}
if
(
!
zy_delivery_type
)
{
layer
.
msg
(
'请选择发货方式'
);
return
false
;
}
if
((
typeof
(
inv_type
)
==
'undefined'
||
inv_type
!=
''
)
&&
!
tax_id
)
{
layer
.
msg
(
'请选择发票信息'
);
return
false
;
}
if
(
type
==
4
)
{
// 自营其他业务
var
business_type
=
$
(
'#business_type'
).
val
();
datax
.
business_type
=
business_type
;
datax
.
role
=
role
;
// 自营线上下单添加角色
}
else
{
// if ((inv_type && !tax_id) || (!tax_id && goods_type == 2)) {
// layer.msg('请选择发票信息');
// return false;
// }
}
if
(
type
==
1
&&
is_dgk
)
{
// 联营包含digikey商品,则填写终端资料
var
customer_cn
=
$
(
'.customer_cn'
).
val
();
var
customer_en
=
$
(
'.customer_en'
).
val
();
var
customer_type
=
$
(
'.customer_type'
).
val
();
var
product_use_classone_sn
=
$
(
'.product_use_classone_sn'
).
val
();
var
product_use_classtwo_sn
=
$
(
'.product_use_classtwo_sn'
).
val
();
var
customer_website
=
$
(
'.customer_website'
).
val
();
if
(
!
customer_cn
)
{
layer
.
msg
(
'请填写终端中文名称'
);
return
false
;
}
if
(
customer_type
==
''
)
{
layer
.
msg
(
'请选择客户类型'
);
return
false
;
}
if
(
customer_type
==
1
)
{
// 若客户类型为终端,则外文名称,产品用途和网址为必填
if
(
!
customer_en
)
{
layer
.
msg
(
'请填写终端英文名称'
);
return
false
;
}
var
en_reg
=
/^
[
a-zA-Z0-9
\.\-\s\,\(\)]
+$/
;
if
(
!
en_reg
.
test
(
customer_en
)){
layer
.
msg
(
'请填写全英文名称'
);
return
false
;
}
if
(
product_use_classone_sn
==
''
)
{
layer
.
msg
(
'请选择产品用途一级分类'
);
return
false
;
}
if
(
!
customer_website
)
{
layer
.
msg
(
'请填写客户网址'
);
return
false
;
}
}
datax
.
customer_cn
=
customer_cn
;
datax
.
customer_en
=
customer_en
;
datax
.
customer_type
=
customer_type
;
datax
.
product_use_classone_sn
=
product_use_classone_sn
;
datax
.
product_use_classtwo_sn
=
product_use_classtwo_sn
;
datax
.
customer_website
=
customer_website
;
}
datax
.
tax_id
=
tax_id
;
datax
.
user_coupon_id
=
user_coupon_id
;
datax
.
zy_delivery_type
=
zy_delivery_type
;
}
// 自营线上
if
(
type
==
2
&&
is_online
==
1
)
{
var
sale_type
=
$
(
'#sale_type'
).
val
();
var
cart_info
=
[];
$
(
'.shop-table tbody tr'
).
each
(
function
()
{
var
gid
=
$
(
this
).
find
(
'.goods_id'
).
text
();
var
num
=
$
(
this
).
find
(
'.goods_num'
).
val
();
cart_info
.
push
({
'gid'
:
gid
,
'num'
:
num
});
})
datax
.
role
=
role
;
// 自营线上下单添加角色
$
.
ajax
({
type
:
"POST"
,
url
:
'/ajax/checkStock'
,
data
:
{
cart_info
:
JSON
.
stringify
(
cart_info
),
sale_type
:
sale_type
},
dataType
:
"json"
,
async
:
false
,
success
:
function
(
resp
){
if
(
resp
.
errcode
==
-
1
)
{
var
data
=
eval
(
resp
.
data
);
var
content
=
'<p>'
+
resp
.
errmsg
+
'</p>'
;
submit
=
false
;
for
(
var
i
=
0
;
i
<
data
.
length
;
i
++
)
{
content
+=
'<p><span>'
+
(
i
+
1
)
+
'、</span>'
+
data
[
i
][
'goods_name'
]
+
',可用库存:'
+
data
[
i
][
'stock'
]
+
'</p>'
;
}
// 弹出提示
layer
.
open
({
area
:
[
'500px'
,
'300px'
],
title
:
'提示信息'
,
content
:
content
,
btn
:
[],
});
// self.removeAttr('disabled').css('pointer-events', 'auto');
return
false
;
}
},
})
}
if
(
submit
)
{
$
.
ajax
({
type
:
"POST"
,
url
:
'/ajax/create'
,
data
:
datax
,
dataType
:
"json"
,
success
:
function
(
resp
){
if
(
resp
.
errcode
==
0
)
{
layer
.
msg
(
resp
.
errmsg
);
location
.
href
=
'/addorder/success?order_id='
+
resp
.
data
.
order_id
+
'&type='
+
resp
.
data
.
type
;
return
false
;
}
else
if
(
resp
.
errcode
==
21024
)
{
layer
.
alert
(
'该用户已进入公司黑名单,具体请联系吴承义,同时订单无法提交'
);
return
false
;
}
else
if
(
resp
.
errcode
==
21030
)
{
layer
.
alert
(
resp
.
errmsg
,
function
()
{
var
delivery_place
=
$
(
'.delivery_place'
).
val
();
loading
.
lists
(
user_id
,
goods_type
,
is_online
,
delivery_place
);
// 加载购物车列表
loading
.
confirm
(
user_id
,
address_id
,
cart_ids
,
user_coupon_id
,
goods_type
,
is_online
);
// 确认订单信息
});
return
false
;
}
layer
.
alert
(
resp
.
errmsg
);
},
})
layer
.
msg
(
'订单生成中...'
,
{
icon
:
16
,
time
:
0
,
shade
:
0.3
});
}
}
else
{
layer
.
msg
(
'请先添加商品'
);
}
})
// 发货方式
$
(
'.zy_delivery_type'
).
change
(
function
()
{
var
coupon_id
=
$
(
'#user_coupon'
).
val
();
var
address_id
=
$
(
'.address_id'
).
val
();
var
user_id
=
$
(
'.user_id'
).
val
();
var
cart_ids
=
[];
$
(
'.shop-table tbody'
).
find
(
'tr'
).
each
(
function
()
{
var
cid
=
$
(
this
).
data
(
'cid'
);
cart_ids
.
push
(
cid
);
})
if
(
coupon_id
)
{
$
(
'.user_coupon_id'
).
val
(
coupon_id
);
}
else
{
$
(
'.user_coupon_id'
).
val
(
''
);
}
loading
.
confirm
(
user_id
,
address_id
,
cart_ids
,
coupon_id
,
goods_type
,
is_online
);
// 确认订单信息
})
},
// 购物车商品列表
lists
:
function
(
user_id
,
goods_type
,
is_online
,
delivery_place
=
"1"
)
{
// type:1-联营,2-自营
var
self
=
this
;
var
user_coupon_id
=
$
(
'.user_coupon_id'
).
val
()
?
$
(
'.user_coupon_id'
).
val
()
:
0
;
$
.
ajax
({
type
:
'post'
,
url
:
'/ajax/cartList'
,
data
:
{
uid
:
user_id
,
type
:
goods_type
,
delivery_place
:
delivery_place
},
dataType
:
"json"
,
success
:
function
(
resp
){
if
(
resp
.
errcode
==
0
)
{
var
list
=
resp
.
data
.
list
;
var
len
=
list
.
length
;
var
html
=
''
;
var
order_amount
=
0
;
var
currency
=
''
;
var
cart_ids
=
[];
var
cart_gift
=
resp
.
data
.
cart_gift
;
// 订单赠品信息
if
(
len
==
0
)
return
false
;
var
buyer
=
''
;
// list = list.reverse();
// 购物车列表
for
(
var
i
=
len
-
1
;
i
>=
0
;
i
--
)
{
html
+=
'<tr data-cid="'
+
list
[
i
].
cart_id
+
'" data-type="'
+
list
[
i
].
type
+
'" min_buy="'
+
list
[
i
].
min_buy
+
'" data-sup_name="'
+
list
[
i
].
supplier_name
+
'" data-sup_id="'
+
list
[
i
].
supplier_id
+
'" data-brand_id="'
+
list
[
i
].
brand_id
+
'" data-brand_name="'
+
list
[
i
].
brand_name
+
'" data-goods_type="'
+
list
[
i
].
goods_type
+
'">'
+
'<td>'
+
(
len
-
i
)
+
'</td>'
+
'<td class="goods_id">'
+
list
[
i
].
goods_id
+
'</td>'
+
'<td>'
+
list
[
i
].
goods_name
+
'</td>'
+
'<td>'
+
list
[
i
].
brand_name
+
'</td>'
;
if
(
goods_type
==
1
)
{
// 联营添加标准品牌列
html
+=
list
[
i
].
standard_brand_name
?
'<td class="standard-brand-yellow">'
:
'<td>'
;
html
+=
'<input type="text" class="change_standard_brand_name" name="standard_brand_name" value="'
+
list
[
i
].
standard_brand_name
+
'" readonly /><i class="fa fa-exclamation-triangle fa-2x select-standard-brand" aria-hidden="true" data-type=1></i></td>'
;
}
// if (goods_type == 2) {
var
mpl
=
list
[
i
].
mpl
?
list
[
i
].
mpl
:
''
;
html
+=
'<td><span class="goods_mpl">'
+
mpl
+
'</span></td>'
;
// }
html
+=
'<td><input type="text" class="goods_num" name="goods_num" value="'
+
list
[
i
].
goods_number
+
'" data-origin_num="'
+
list
[
i
].
goods_number
+
'"></td>'
+
'<td class="goods_price">'
+
list
[
i
].
goods_price
+
'</td>'
+
'<td class="goods_amount">'
+
list
[
i
].
goods_amount_format
+
'</td>'
+
'<td>'
+
list
[
i
].
delivery_time
+
'</td>'
;
if
(
goods_type
==
1
)
{
html
+=
'<td>'
+
list
[
i
].
supplier_name
+
'</td>'
;
buyer
=
list
[
i
].
buyer_id
!=
'0'
?
list
[
i
].
buyer_id
:
''
;
html
+=
'<td>'
+
buyer
+
'</td>'
;
html
+=
'<td>'
+
list
[
i
].
batch
+
'</td>'
;
}
html
+=
'<td><a class="btn btn-danger btn-xs remove-goods">删除</a></td>'
+
'</tr>'
;
cart_ids
.
push
(
list
[
i
].
cart_id
);
// 购物车ID集合
}
$
(
'.shop-lists'
).
show
();
$
(
'.shop-table tbody'
).
empty
().
append
(
html
);
$
(
'#sale_type'
).
val
(
list
[
0
].
sale_type
);
// 自营线上订单选择销售类型
var
address_id
=
$
(
'.address_id'
).
val
();
self
.
confirm
(
user_id
,
address_id
,
cart_ids
,
user_coupon_id
,
goods_type
,
is_online
);
// 确认订单信息
// 自营商品检查数量
// if (goods_type == 2) { // 20200826 订单合并后,不以goods_type为判断条件
var
changeGoods
=
[];
$
(
'.shop-table tbody tr'
).
each
(
function
()
{
var
goods_id
=
$
(
this
).
find
(
'.goods_id'
).
text
();
var
num
=
Number
(
$
(
this
).
find
(
'.goods_num'
).
val
());
var
mpl
=
Number
(
$
(
this
).
find
(
'.goods_mpl'
).
text
());
var
cart_id
=
$
(
this
).
data
(
'cid'
);
var
type
=
$
(
this
).
data
(
'type'
);
var
curr_goods_type
=
$
(
this
).
data
(
'goods_type'
);
var
self_goods_type
=
[
'3'
,
'4'
];
// 自营商品类型
// 自营商品 且 数量与倍数不匹配
if
(
self_goods_type
.
indexOf
(
curr_goods_type
)
!=
-
1
&&
num
%
mpl
!=
0
)
{
num
=
Math
.
ceil
(
num
/
mpl
)
*
mpl
;
$
.
ajax
({
type
:
"POST"
,
url
:
'/ajax/changeNum'
,
data
:
{
uid
:
user_id
,
num
:
num
,
cart_id
:
cart_id
,
type
:
type
,
goods_type
:
goods_type
},
dataType
:
"json"
,
async
:
false
,
success
:
function
(
resp
){
if
(
resp
.
errcode
==
0
)
{
changeGoods
.
push
(
goods_id
);
}
},
})
}
})
if
(
changeGoods
.
length
>
0
)
{
layer
.
alert
(
'已按倍数调整购买数量,商品ID:'
+
changeGoods
.
join
(
', '
));
self
.
lists
(
user_id
,
goods_type
,
is_online
,
delivery_place
);
// 加载购物车列表
}
// }
// 赠品信息
if
(
cart_gift
.
err_code
==
0
)
{
var
gift_len
=
cart_gift
.
data
.
length
;
var
gift_data
=
cart_gift
.
data
;
var
str
=
''
;
for
(
var
i
=
0
;
i
<
gift_len
;
i
++
)
{
str
+=
'<tr>\
<td>'
+
gift_data
[
i
].
activity_id
+
'</td>\
<td>\
<div class="layer-photos-demo">\
<a><img src="'
+
gift_data
[
i
].
pic
+
'" width="20" height="20"></a>\
</div>\
</td>\
<td>'
+
gift_data
[
i
].
item_name
+
'</td>\
<td>'
+
gift_data
[
i
].
num
+
'</td>\
<td>'
+
gift_data
[
i
].
content
+
'</td>\
</tr>'
;
}
$
(
'.gift-table tbody'
).
empty
().
append
(
str
);
$
(
'.order-gift-info'
).
show
();
}
else
{
$
(
'.order-gift-info'
).
hide
();
}
return
false
;
}
layer
.
msg
(
resp
.
errmsg
||
'网络异常'
);
$
(
'.shop-lists'
).
hide
();
if
(
is_online
)
{
$
(
'.order-info'
).
hide
();
}
else
{
$
(
'.amount-section'
).
hide
();
}
},
});
},
// 可用优惠券
getCoupon
:
function
(
user_id
,
goods_type
,
cart_ids
)
{
$
.
ajax
({
type
:
'post'
,
url
:
'/ajax/getCoupon'
,
data
:
{
uid
:
user_id
,
goods_type
:
goods_type
,
cart_ids
:
cart_ids
},
dataType
:
"json"
,
success
:
function
(
resp
){
if
(
resp
.
errcode
==
0
)
{
var
data
=
resp
.
data
;
var
str
=
'<option value="">请选择</option>'
;
if
(
data
.
user_coupon_id
!=
null
)
{
layer
.
msg
(
resp
.
errmsg
);
str
+=
'<option value="'
+
data
.
user_coupon_id
+
'">'
+
data
.
coupon_name
+
'</option>'
;
$
(
'#user_coupon'
).
attr
(
'data-amount'
,
data
.
sale_amount
);
// 优惠券金额
$
(
'#user_coupon'
).
empty
().
append
(
str
);
return
false
;
}
else
{
$
(
'#user_coupon'
).
empty
().
append
(
str
);
}
return
false
;
}
layer
.
msg
(
resp
.
errmsg
||
'网络异常'
);
}
})
},
// 确认订单信息
confirm
:
function
(
user_id
,
address_id
,
cart_ids
,
user_coupon_id
,
goods_type
,
is_online
=
1
)
{
var
self
=
this
;
var
business_type
=
$
(
'#business_type'
);
// 自营其他业务
var
zy_delivery_type
=
$
(
'.zy_delivery_type'
).
val
();
// 发货方式
if
(
business_type
.
length
>
0
)
{
business_type
=
business_type
.
val
();
}
else
{
business_type
=
0
;
}
$
.
ajax
({
type
:
'post'
,
url
:
'/ajax/confirm'
,
data
:
{
uid
:
user_id
,
address_id
:
address_id
,
cart_ids
:
cart_ids
,
user_coupon_id
:
user_coupon_id
,
goods_type
:
goods_type
,
is_online
:
is_online
,
business_type
:
business_type
,
zy_delivery_type
:
zy_delivery_type
},
dataType
:
"json"
,
success
:
function
(
resp
){
if
(
resp
.
errcode
==
0
)
{
var
data
=
resp
.
data
;
if
(
is_online
)
{
$
(
'.order-info'
).
show
();
$
(
'.goods_amount_val'
).
empty
().
text
(
data
.
goods_total_format
);
// 商品总额
$
(
'.order_amount'
).
empty
().
text
(
data
.
order_amount_format
);
// 订单总额
// 联营和自营线上
if
(
is_online
!=
2
)
{
if
(
!
user_coupon_id
)
{
// 若优惠券ID不存在,则推荐
$
(
'.preferential_price'
).
hide
();
$
(
'.preferential_price_val'
).
empty
();
self
.
getCoupon
(
user_id
,
goods_type
,
cart_ids
);
// 获取最优的优惠券
}
else
{
$
(
'.preferential_price'
).
show
();
$
(
'.preferential_price_val'
).
empty
().
text
(
data
.
preferential_price_format
);
}
}
if
(
goods_type
==
1
)
{
var
list
=
resp
.
data
.
list
;
var
is_dgk
=
false
;
for
(
var
i
=
0
;
i
<
list
.
length
;
i
++
)
{
if
(
list
[
i
].
supplier_id
==
'7'
||
list
[
i
].
supplier_name
.
toLowerCase
()
==
'digikey'
)
{
is_dgk
=
true
;
}
}
if
(
is_dgk
)
{
$
(
'.client-info'
).
css
(
'display'
,
'block'
);
// 若已选择发票,再次触发发票事件,添加终端信息
if
(
$
(
'.tax_id'
).
val
())
{
$
(
'#invoice'
).
trigger
(
'change'
);
}
}
else
{
$
(
'.client-info'
).
css
(
'display'
,
'none'
);
}
}
if
(
data
.
extend_fee
)
{
$
(
'.extend_fee'
).
show
();
$
(
'.extend_fee_val'
).
empty
().
text
(
data
.
extend_fee_format
);
// 附加费
}
// if (goods_type == 2 && business_type != 2) { // 自营仓库损耗不需要运费
// $('.express_fee_val').empty().text(data.finally_shipping_price_format); // 运费
// }
$
(
'.express_fee_val'
).
empty
().
text
(
data
.
finally_shipping_price_format
);
// 订单合并后,如果存在运费则需要展示
}
else
{
$
(
'.amount-section'
).
show
();
$
(
'.order_amount'
).
empty
().
text
(
data
.
order_amount_format
);
}
return
false
;
}
else
{
$
(
'.client-info'
).
css
(
'display'
,
'none'
);
// 隐藏终端信息
}
layer
.
msg
(
resp
.
errmsg
||
'网络异常'
);
}
})
},
}
});
})(
jQuery
)
//获取url中的参数
function
getUrlParam
(
name
)
{
var
reg
=
new
RegExp
(
"(^|&)"
+
name
+
"=([^&]*)(&|$)"
);
//构造一个含有目标参数的正则表达式对象
var
r
=
window
.
location
.
search
.
substr
(
1
).
match
(
reg
);
//匹配目标参数
if
(
r
!=
null
)
return
unescape
(
r
[
2
]);
return
null
;
//返回参数值
}
\ No newline at end of file
public/js/plugins/footable/footable.all.min.js
deleted
100644 → 0
View file @
8678f987
/*!
* FooTable - Awesome Responsive Tables
* Version : 2.0.3
* http://fooplugins.com/plugins/footable-jquery/
*
* Requires jQuery - http://jquery.com/
*
* Copyright 2014 Steven Usher & Brad Vincent
* Released under the MIT license
* You are free to use FooTable in commercial projects as long as this copyright header is left intact.
*
* Date: 11 Nov 2014
*/
(
function
(
e
,
t
){
function
a
(){
var
e
=
this
;
e
.
id
=
null
,
e
.
busy
=!
1
,
e
.
start
=
function
(
t
,
a
){
e
.
busy
||
(
e
.
stop
(),
e
.
id
=
setTimeout
(
function
(){
t
(),
e
.
id
=
null
,
e
.
busy
=!
1
},
a
),
e
.
busy
=!
0
)},
e
.
stop
=
function
(){
null
!==
e
.
id
&&
(
clearTimeout
(
e
.
id
),
e
.
id
=
null
,
e
.
busy
=!
1
)}}
function
i
(
i
,
o
,
n
){
var
r
=
this
;
r
.
id
=
n
,
r
.
table
=
i
,
r
.
options
=
o
,
r
.
breakpoints
=
[],
r
.
breakpointNames
=
""
,
r
.
columns
=
{},
r
.
plugins
=
t
.
footable
.
plugins
.
load
(
r
);
var
l
=
r
.
options
,
d
=
l
.
classes
,
s
=
l
.
events
,
u
=
l
.
triggers
,
f
=
0
;
return
r
.
timers
=
{
resize
:
new
a
,
register
:
function
(
e
){
return
r
.
timers
[
e
]
=
new
a
,
r
.
timers
[
e
]}},
r
.
init
=
function
(){
var
a
=
e
(
t
),
i
=
e
(
r
.
table
);
if
(
t
.
footable
.
plugins
.
init
(
r
),
i
.
hasClass
(
d
.
loaded
))
return
r
.
raise
(
s
.
alreadyInitialized
),
undefined
;
r
.
raise
(
s
.
initializing
),
i
.
addClass
(
d
.
loading
),
i
.
find
(
l
.
columnDataSelector
).
each
(
function
(){
var
e
=
r
.
getColumnData
(
this
);
r
.
columns
[
e
.
index
]
=
e
});
for
(
var
o
in
l
.
breakpoints
)
r
.
breakpoints
.
push
({
name
:
o
,
width
:
l
.
breakpoints
[
o
]}),
r
.
breakpointNames
+=
o
+
" "
;
r
.
breakpoints
.
sort
(
function
(
e
,
t
){
return
e
.
width
-
t
.
width
}),
i
.
unbind
(
u
.
initialize
).
bind
(
u
.
initialize
,
function
(){
i
.
removeData
(
"footable_info"
),
i
.
data
(
"breakpoint"
,
""
),
i
.
trigger
(
u
.
resize
),
i
.
removeClass
(
d
.
loading
),
i
.
addClass
(
d
.
loaded
).
addClass
(
d
.
main
),
r
.
raise
(
s
.
initialized
)}).
unbind
(
u
.
redraw
).
bind
(
u
.
redraw
,
function
(){
r
.
redraw
()}).
unbind
(
u
.
resize
).
bind
(
u
.
resize
,
function
(){
r
.
resize
()}).
unbind
(
u
.
expandFirstRow
).
bind
(
u
.
expandFirstRow
,
function
(){
i
.
find
(
l
.
toggleSelector
).
first
().
not
(
"."
+
d
.
detailShow
).
trigger
(
u
.
toggleRow
)}).
unbind
(
u
.
expandAll
).
bind
(
u
.
expandAll
,
function
(){
i
.
find
(
l
.
toggleSelector
).
not
(
"."
+
d
.
detailShow
).
trigger
(
u
.
toggleRow
)}).
unbind
(
u
.
collapseAll
).
bind
(
u
.
collapseAll
,
function
(){
i
.
find
(
"."
+
d
.
detailShow
).
trigger
(
u
.
toggleRow
)}),
i
.
trigger
(
u
.
initialize
),
a
.
bind
(
"resize.footable"
,
function
(){
r
.
timers
.
resize
.
stop
(),
r
.
timers
.
resize
.
start
(
function
(){
r
.
raise
(
u
.
resize
)},
l
.
delay
)})},
r
.
addRowToggle
=
function
(){
if
(
l
.
addRowToggle
){
var
t
=
e
(
r
.
table
),
a
=!
1
;
t
.
find
(
"span."
+
d
.
toggle
).
remove
();
for
(
var
i
in
r
.
columns
){
var
o
=
r
.
columns
[
i
];
if
(
o
.
toggle
){
a
=!
0
;
var
n
=
"> tbody > tr:not(."
+
d
.
detail
+
",."
+
d
.
disabled
+
") > td:nth-child("
+
(
parseInt
(
o
.
index
,
10
)
+
1
)
+
"),"
+
"> tbody > tr:not(."
+
d
.
detail
+
",."
+
d
.
disabled
+
") > th:nth-child("
+
(
parseInt
(
o
.
index
,
10
)
+
1
)
+
")"
;
return
t
.
find
(
n
).
not
(
"."
+
d
.
detailCell
).
prepend
(
e
(
l
.
toggleHTMLElement
).
addClass
(
d
.
toggle
)),
undefined
}}
a
||
t
.
find
(
"> tbody > tr:not(."
+
d
.
detail
+
",."
+
d
.
disabled
+
") > td:first-child"
).
add
(
"> tbody > tr:not(."
+
d
.
detail
+
",."
+
d
.
disabled
+
") > th:first-child"
).
not
(
"."
+
d
.
detailCell
).
prepend
(
e
(
l
.
toggleHTMLElement
).
addClass
(
d
.
toggle
))}},
r
.
setColumnClasses
=
function
(){
var
t
=
e
(
r
.
table
);
for
(
var
a
in
r
.
columns
){
var
i
=
r
.
columns
[
a
];
if
(
null
!==
i
.
className
){
var
o
=
""
,
n
=!
0
;
e
.
each
(
i
.
matches
,
function
(
e
,
t
){
n
||
(
o
+=
", "
),
o
+=
"> tbody > tr:not(."
+
d
.
detail
+
") > td:nth-child("
+
(
parseInt
(
t
,
10
)
+
1
)
+
")"
,
n
=!
1
}),
t
.
find
(
o
).
not
(
"."
+
d
.
detailCell
).
addClass
(
i
.
className
)}}},
r
.
bindToggleSelectors
=
function
(){
var
t
=
e
(
r
.
table
);
r
.
hasAnyBreakpointColumn
()
&&
(
t
.
find
(
l
.
toggleSelector
).
unbind
(
u
.
toggleRow
).
bind
(
u
.
toggleRow
,
function
(){
var
t
=
e
(
this
).
is
(
"tr"
)?
e
(
this
):
e
(
this
).
parents
(
"tr:first"
);
r
.
toggleDetail
(
t
)}),
t
.
find
(
l
.
toggleSelector
).
unbind
(
"click.footable"
).
bind
(
"click.footable"
,
function
(
a
){
t
.
is
(
".breakpoint"
)
&&
e
(
a
.
target
).
is
(
"td,th,."
+
d
.
toggle
)
&&
e
(
this
).
trigger
(
u
.
toggleRow
)}))},
r
.
parse
=
function
(
e
,
t
){
var
a
=
l
.
parsers
[
t
.
type
]
||
l
.
parsers
.
alpha
;
return
a
(
e
)},
r
.
getColumnData
=
function
(
t
){
var
a
=
e
(
t
),
i
=
a
.
data
(
"hide"
),
o
=
a
.
index
();
i
=
i
||
""
,
i
=
jQuery
.
map
(
i
.
split
(
","
),
function
(
e
){
return
jQuery
.
trim
(
e
)});
var
n
=
{
index
:
o
,
hide
:{},
type
:
a
.
data
(
"type"
)
||
"alpha"
,
name
:
a
.
data
(
"name"
)
||
e
.
trim
(
a
.
text
()),
ignore
:
a
.
data
(
"ignore"
)
||!
1
,
toggle
:
a
.
data
(
"toggle"
)
||!
1
,
className
:
a
.
data
(
"class"
)
||
null
,
matches
:[],
names
:{},
group
:
a
.
data
(
"group"
)
||
null
,
groupName
:
null
,
isEditable
:
a
.
data
(
"editable"
)};
if
(
null
!==
n
.
group
){
var
d
=
e
(
r
.
table
).
find
(
'> thead > tr.footable-group-row > th[data-group="'
+
n
.
group
+
'"], > thead > tr.footable-group-row > td[data-group="'
+
n
.
group
+
'"]'
).
first
();
n
.
groupName
=
r
.
parse
(
d
,{
type
:
"alpha"
})}
var
u
=
parseInt
(
a
.
prev
().
attr
(
"colspan"
)
||
0
,
10
);
f
+=
u
>
1
?
u
-
1
:
0
;
var
p
=
parseInt
(
a
.
attr
(
"colspan"
)
||
0
,
10
),
c
=
n
.
index
+
f
;
if
(
p
>
1
){
var
b
=
a
.
data
(
"names"
);
b
=
b
||
""
,
b
=
b
.
split
(
","
);
for
(
var
g
=
0
;
p
>
g
;
g
++
)
n
.
matches
.
push
(
g
+
c
),
b
.
length
>
g
&&
(
n
.
names
[
g
+
c
]
=
b
[
g
])}
else
n
.
matches
.
push
(
c
);
n
.
hide
[
"default"
]
=
"all"
===
a
.
data
(
"hide"
)
||
e
.
inArray
(
"default"
,
i
)
>=
0
;
var
h
=!
1
;
for
(
var
m
in
l
.
breakpoints
)
n
.
hide
[
m
]
=
"all"
===
a
.
data
(
"hide"
)
||
e
.
inArray
(
m
,
i
)
>=
0
,
h
=
h
||
n
.
hide
[
m
];
n
.
hasBreakpoint
=
h
;
var
v
=
r
.
raise
(
s
.
columnData
,{
column
:{
data
:
n
,
th
:
t
}});
return
v
.
column
.
data
},
r
.
getViewportWidth
=
function
(){
return
window
.
innerWidth
||
(
document
.
body
?
document
.
body
.
offsetWidth
:
0
)},
r
.
calculateWidth
=
function
(
e
,
t
){
return
jQuery
.
isFunction
(
l
.
calculateWidthOverride
)?
l
.
calculateWidthOverride
(
e
,
t
):(
t
.
viewportWidth
<
t
.
width
&&
(
t
.
width
=
t
.
viewportWidth
),
t
.
parentWidth
<
t
.
width
&&
(
t
.
width
=
t
.
parentWidth
),
t
)},
r
.
hasBreakpointColumn
=
function
(
e
){
for
(
var
t
in
r
.
columns
)
if
(
r
.
columns
[
t
].
hide
[
e
]){
if
(
r
.
columns
[
t
].
ignore
)
continue
;
return
!
0
}
return
!
1
},
r
.
hasAnyBreakpointColumn
=
function
(){
for
(
var
e
in
r
.
columns
)
if
(
r
.
columns
[
e
].
hasBreakpoint
)
return
!
0
;
return
!
1
},
r
.
resize
=
function
(){
var
t
=
e
(
r
.
table
);
if
(
t
.
is
(
":visible"
)){
if
(
!
r
.
hasAnyBreakpointColumn
())
return
t
.
trigger
(
u
.
redraw
),
undefined
;
var
a
=
{
width
:
t
.
width
(),
viewportWidth
:
r
.
getViewportWidth
(),
parentWidth
:
t
.
parent
().
width
()};
a
=
r
.
calculateWidth
(
t
,
a
);
var
i
=
t
.
data
(
"footable_info"
);
if
(
t
.
data
(
"footable_info"
,
a
),
r
.
raise
(
s
.
resizing
,{
old
:
i
,
info
:
a
}),
!
i
||
i
&&
i
.
width
&&
i
.
width
!==
a
.
width
){
for
(
var
o
,
n
=
null
,
l
=
0
;
r
.
breakpoints
.
length
>
l
;
l
++
)
if
(
o
=
r
.
breakpoints
[
l
],
o
&&
o
.
width
&&
a
.
width
<=
o
.
width
){
n
=
o
;
break
}
var
d
=
null
===
n
?
"default"
:
n
.
name
,
f
=
r
.
hasBreakpointColumn
(
d
),
p
=
t
.
data
(
"breakpoint"
);
t
.
data
(
"breakpoint"
,
d
).
removeClass
(
"default breakpoint"
).
removeClass
(
r
.
breakpointNames
).
addClass
(
d
+
(
f
?
" breakpoint"
:
""
)),
d
!==
p
&&
(
t
.
trigger
(
u
.
redraw
),
r
.
raise
(
s
.
breakpoint
,{
breakpoint
:
d
,
info
:
a
}))}
r
.
raise
(
s
.
resized
,{
old
:
i
,
info
:
a
})}},
r
.
redraw
=
function
(){
r
.
addRowToggle
(),
r
.
bindToggleSelectors
(),
r
.
setColumnClasses
();
var
t
=
e
(
r
.
table
),
a
=
t
.
data
(
"breakpoint"
),
i
=
r
.
hasBreakpointColumn
(
a
);
t
.
find
(
"> tbody > tr:not(."
+
d
.
detail
+
")"
).
data
(
"detail_created"
,
!
1
).
end
().
find
(
"> thead > tr:last-child > th"
).
each
(
function
(){
var
i
=
r
.
columns
[
e
(
this
).
index
()],
o
=
""
,
n
=!
0
;
e
.
each
(
i
.
matches
,
function
(
e
,
t
){
n
||
(
o
+=
", "
);
var
a
=
t
+
1
;
o
+=
"> tbody > tr:not(."
+
d
.
detail
+
") > td:nth-child("
+
a
+
")"
,
o
+=
", > tfoot > tr:not(."
+
d
.
detail
+
") > td:nth-child("
+
a
+
")"
,
o
+=
", > colgroup > col:nth-child("
+
a
+
")"
,
n
=!
1
}),
o
+=
', > thead > tr[data-group-row="true"] > th[data-group="'
+
i
.
group
+
'"]'
;
var
l
=
t
.
find
(
o
).
add
(
this
);
if
(
""
!==
a
&&
(
i
.
hide
[
a
]
===!
1
?
l
.
addClass
(
"footable-visible"
).
show
():
l
.
removeClass
(
"footable-visible"
).
hide
()),
1
===
t
.
find
(
"> thead > tr.footable-group-row"
).
length
){
var
s
=
t
.
find
(
'> thead > tr:last-child > th[data-group="'
+
i
.
group
+
'"]:visible, > thead > tr:last-child > th[data-group="'
+
i
.
group
+
'"]:visible'
),
u
=
t
.
find
(
'> thead > tr.footable-group-row > th[data-group="'
+
i
.
group
+
'"], > thead > tr.footable-group-row > td[data-group="'
+
i
.
group
+
'"]'
),
f
=
0
;
e
.
each
(
s
,
function
(){
f
+=
parseInt
(
e
(
this
).
attr
(
"colspan"
)
||
1
,
10
)}),
f
>
0
?
u
.
attr
(
"colspan"
,
f
).
show
():
u
.
hide
()}}).
end
().
find
(
"> tbody > tr."
+
d
.
detailShow
).
each
(
function
(){
r
.
createOrUpdateDetailRow
(
this
)}),
t
.
find
(
"[data-bind-name]"
).
each
(
function
(){
r
.
toggleInput
(
this
)}),
t
.
find
(
"> tbody > tr."
+
d
.
detailShow
+
":visible"
).
each
(
function
(){
var
t
=
e
(
this
).
next
();
t
.
hasClass
(
d
.
detail
)
&&
(
i
?
t
.
show
():
t
.
hide
())}),
t
.
find
(
"> thead > tr > th.footable-last-column, > tbody > tr > td.footable-last-column"
).
removeClass
(
"footable-last-column"
),
t
.
find
(
"> thead > tr > th.footable-first-column, > tbody > tr > td.footable-first-column"
).
removeClass
(
"footable-first-column"
),
t
.
find
(
"> thead > tr, > tbody > tr"
).
find
(
"> th.footable-visible:last, > td.footable-visible:last"
).
addClass
(
"footable-last-column"
).
end
().
find
(
"> th.footable-visible:first, > td.footable-visible:first"
).
addClass
(
"footable-first-column"
),
r
.
raise
(
s
.
redrawn
)},
r
.
toggleDetail
=
function
(
t
){
var
a
=
t
.
jquery
?
t
:
e
(
t
),
i
=
a
.
next
();
a
.
hasClass
(
d
.
detailShow
)?(
a
.
removeClass
(
d
.
detailShow
),
i
.
hasClass
(
d
.
detail
)
&&
i
.
hide
(),
r
.
raise
(
s
.
rowCollapsed
,{
row
:
a
[
0
]})):(
r
.
createOrUpdateDetailRow
(
a
[
0
]),
a
.
addClass
(
d
.
detailShow
).
next
().
show
(),
r
.
raise
(
s
.
rowExpanded
,{
row
:
a
[
0
]}))},
r
.
removeRow
=
function
(
t
){
var
a
=
t
.
jquery
?
t
:
e
(
t
);
a
.
hasClass
(
d
.
detail
)
&&
(
a
=
a
.
prev
());
var
i
=
a
.
next
();
a
.
data
(
"detail_created"
)
===!
0
&&
i
.
remove
(),
a
.
remove
(),
r
.
raise
(
s
.
rowRemoved
)},
r
.
appendRow
=
function
(
t
){
var
a
=
t
.
jquery
?
t
:
e
(
t
);
e
(
r
.
table
).
find
(
"tbody"
).
append
(
a
),
r
.
redraw
()},
r
.
getColumnFromTdIndex
=
function
(
t
){
var
a
=
null
;
for
(
var
i
in
r
.
columns
)
if
(
e
.
inArray
(
t
,
r
.
columns
[
i
].
matches
)
>=
0
){
a
=
r
.
columns
[
i
];
break
}
return
a
},
r
.
createOrUpdateDetailRow
=
function
(
t
){
var
a
,
i
=
e
(
t
),
o
=
i
.
next
(),
n
=
[];
if
(
i
.
data
(
"detail_created"
)
===!
0
)
return
!
0
;
if
(
i
.
is
(
":hidden"
))
return
!
1
;
if
(
r
.
raise
(
s
.
rowDetailUpdating
,{
row
:
i
,
detail
:
o
}),
i
.
find
(
"> td:hidden"
).
each
(
function
(){
var
t
=
e
(
this
).
index
(),
a
=
r
.
getColumnFromTdIndex
(
t
),
i
=
a
.
name
;
if
(
a
.
ignore
===!
0
)
return
!
0
;
t
in
a
.
names
&&
(
i
=
a
.
names
[
t
]);
var
o
=
e
(
this
).
attr
(
"data-bind-name"
);
if
(
null
!=
o
&&
e
(
this
).
is
(
":empty"
)){
var
l
=
e
(
"."
+
d
.
detailInnerValue
+
"["
+
'data-bind-value="'
+
o
+
'"]'
);
e
(
this
).
html
(
e
(
l
).
contents
().
detach
())}
var
s
;
return
a
.
isEditable
!==!
1
&&
(
a
.
isEditable
||
e
(
this
).
find
(
":input"
).
length
>
0
)
&&
(
null
==
o
&&
(
o
=
"bind-"
+
e
.
now
()
+
"-"
+
t
,
e
(
this
).
attr
(
"data-bind-name"
,
o
)),
s
=
e
(
this
).
contents
().
detach
()),
s
||
(
s
=
e
(
this
).
contents
().
clone
(
!
0
,
!
0
)),
n
.
push
({
name
:
i
,
value
:
r
.
parse
(
this
,
a
),
display
:
s
,
group
:
a
.
group
,
groupName
:
a
.
groupName
,
bindName
:
o
}),
!
0
}),
0
===
n
.
length
)
return
!
1
;
var
u
=
i
.
find
(
"> td:visible"
).
length
,
f
=
o
.
hasClass
(
d
.
detail
);
return
f
||
(
o
=
e
(
'<tr class="'
+
d
.
detail
+
'"><td class="'
+
d
.
detailCell
+
'"><div class="'
+
d
.
detailInner
+
'"></div></td></tr>'
),
i
.
after
(
o
)),
o
.
find
(
"> td:first"
).
attr
(
"colspan"
,
u
),
a
=
o
.
find
(
"."
+
d
.
detailInner
).
empty
(),
l
.
createDetail
(
a
,
n
,
l
.
createGroupedDetail
,
l
.
detailSeparator
,
d
),
i
.
data
(
"detail_created"
,
!
0
),
r
.
raise
(
s
.
rowDetailUpdated
,{
row
:
i
,
detail
:
o
}),
!
f
},
r
.
raise
=
function
(
t
,
a
){
r
.
options
.
debug
===!
0
&&
e
.
isFunction
(
r
.
options
.
log
)
&&
r
.
options
.
log
(
t
,
"event"
),
a
=
a
||
{};
var
i
=
{
ft
:
r
};
e
.
extend
(
!
0
,
i
,
a
);
var
o
=
e
.
Event
(
t
,
i
);
return
o
.
ft
||
e
.
extend
(
!
0
,
o
,
i
),
e
(
r
.
table
).
trigger
(
o
),
o
},
r
.
reset
=
function
(){
var
t
=
e
(
r
.
table
);
t
.
removeData
(
"footable_info"
).
data
(
"breakpoint"
,
""
).
removeClass
(
d
.
loading
).
removeClass
(
d
.
loaded
),
t
.
find
(
l
.
toggleSelector
).
unbind
(
u
.
toggleRow
).
unbind
(
"click.footable"
),
t
.
find
(
"> tbody > tr"
).
removeClass
(
d
.
detailShow
),
t
.
find
(
"> tbody > tr."
+
d
.
detail
).
remove
(),
r
.
raise
(
s
.
reset
)},
r
.
toggleInput
=
function
(
t
){
var
a
=
e
(
t
).
attr
(
"data-bind-name"
);
if
(
null
!=
a
){
var
i
=
e
(
"."
+
d
.
detailInnerValue
+
"["
+
'data-bind-value="'
+
a
+
'"]'
);
null
!=
i
&&
(
e
(
t
).
is
(
":visible"
)?
e
(
i
).
is
(
":empty"
)
||
e
(
t
).
html
(
e
(
i
).
contents
().
detach
()):
e
(
t
).
is
(
":empty"
)
||
e
(
i
).
html
(
e
(
t
).
contents
().
detach
()))}},
r
.
init
(),
r
}
t
.
footable
=
{
options
:{
delay
:
100
,
breakpoints
:{
phone
:
480
,
tablet
:
1024
},
parsers
:{
alpha
:
function
(
t
){
return
e
(
t
).
data
(
"value"
)
||
e
.
trim
(
e
(
t
).
text
())},
numeric
:
function
(
t
){
var
a
=
e
(
t
).
data
(
"value"
)
||
e
(
t
).
text
().
replace
(
/
[^
0-9.
\-]
/g
,
""
);
return
a
=
parseFloat
(
a
),
isNaN
(
a
)
&&
(
a
=
0
),
a
}},
addRowToggle
:
!
0
,
calculateWidthOverride
:
null
,
toggleSelector
:
" > tbody > tr:not(.footable-row-detail)"
,
columnDataSelector
:
"> thead > tr:last-child > th, > thead > tr:last-child > td"
,
detailSeparator
:
":"
,
toggleHTMLElement
:
"<span />"
,
createGroupedDetail
:
function
(
e
){
for
(
var
t
=
{
_none
:{
name
:
null
,
data
:[]}},
a
=
0
;
e
.
length
>
a
;
a
++
){
var
i
=
e
[
a
].
group
;
null
!==
i
?(
i
in
t
||
(
t
[
i
]
=
{
name
:
e
[
a
].
groupName
||
e
[
a
].
group
,
data
:[]}),
t
[
i
].
data
.
push
(
e
[
a
])):
t
.
_none
.
data
.
push
(
e
[
a
])}
return
t
},
createDetail
:
function
(
t
,
a
,
i
,
o
,
n
){
var
r
=
i
(
a
);
for
(
var
l
in
r
)
if
(
0
!==
r
[
l
].
data
.
length
){
"_none"
!==
l
&&
t
.
append
(
'<div class="'
+
n
.
detailInnerGroup
+
'">'
+
r
[
l
].
name
+
"</div>"
);
for
(
var
d
=
0
;
r
[
l
].
data
.
length
>
d
;
d
++
){
var
s
=
r
[
l
].
data
[
d
].
name
?
o
:
""
;
t
.
append
(
e
(
"<div></div>"
).
addClass
(
n
.
detailInnerRow
).
append
(
e
(
"<div></div>"
).
addClass
(
n
.
detailInnerName
).
append
(
r
[
l
].
data
[
d
].
name
+
s
)).
append
(
e
(
"<div></div>"
).
addClass
(
n
.
detailInnerValue
).
attr
(
"data-bind-value"
,
r
[
l
].
data
[
d
].
bindName
).
append
(
r
[
l
].
data
[
d
].
display
)))}}},
classes
:{
main
:
"footable"
,
loading
:
"footable-loading"
,
loaded
:
"footable-loaded"
,
toggle
:
"footable-toggle"
,
disabled
:
"footable-disabled"
,
detail
:
"footable-row-detail"
,
detailCell
:
"footable-row-detail-cell"
,
detailInner
:
"footable-row-detail-inner"
,
detailInnerRow
:
"footable-row-detail-row"
,
detailInnerGroup
:
"footable-row-detail-group"
,
detailInnerName
:
"footable-row-detail-name"
,
detailInnerValue
:
"footable-row-detail-value"
,
detailShow
:
"footable-detail-show"
},
triggers
:{
initialize
:
"footable_initialize"
,
resize
:
"footable_resize"
,
redraw
:
"footable_redraw"
,
toggleRow
:
"footable_toggle_row"
,
expandFirstRow
:
"footable_expand_first_row"
,
expandAll
:
"footable_expand_all"
,
collapseAll
:
"footable_collapse_all"
},
events
:{
alreadyInitialized
:
"footable_already_initialized"
,
initializing
:
"footable_initializing"
,
initialized
:
"footable_initialized"
,
resizing
:
"footable_resizing"
,
resized
:
"footable_resized"
,
redrawn
:
"footable_redrawn"
,
breakpoint
:
"footable_breakpoint"
,
columnData
:
"footable_column_data"
,
rowDetailUpdating
:
"footable_row_detail_updating"
,
rowDetailUpdated
:
"footable_row_detail_updated"
,
rowCollapsed
:
"footable_row_collapsed"
,
rowExpanded
:
"footable_row_expanded"
,
rowRemoved
:
"footable_row_removed"
,
reset
:
"footable_reset"
},
debug
:
!
1
,
log
:
null
},
version
:{
major
:
0
,
minor
:
5
,
toString
:
function
(){
return
t
.
footable
.
version
.
major
+
"."
+
t
.
footable
.
version
.
minor
},
parse
:
function
(
e
){
var
t
=
/
(\d
+
)\.?(\d
+
)?\.?(\d
+
)?
/
.
exec
(
e
);
return
{
major
:
parseInt
(
t
[
1
],
10
)
||
0
,
minor
:
parseInt
(
t
[
2
],
10
)
||
0
,
patch
:
parseInt
(
t
[
3
],
10
)
||
0
}}},
plugins
:{
_validate
:
function
(
a
){
if
(
!
e
.
isFunction
(
a
))
return
t
.
footable
.
options
.
debug
===!
0
&&
console
.
error
(
'Validation failed, expected type "function", received type "{0}".'
,
typeof
a
),
!
1
;
var
i
=
new
a
;
return
"string"
!=
typeof
i
.
name
?(
t
.
footable
.
options
.
debug
===!
0
&&
console
.
error
(
'Validation failed, plugin does not implement a string property called "name".'
,
i
),
!
1
):
e
.
isFunction
(
i
.
init
)?(
t
.
footable
.
options
.
debug
===!
0
&&
console
.
log
(
'Validation succeeded for plugin "'
+
i
.
name
+
'".'
,
i
),
!
0
):(
t
.
footable
.
options
.
debug
===!
0
&&
console
.
error
(
'Validation failed, plugin "'
+
i
.
name
+
'" does not implement a function called "init".'
,
i
),
!
1
)},
registered
:[],
register
:
function
(
a
,
i
){
t
.
footable
.
plugins
.
_validate
(
a
)
&&
(
t
.
footable
.
plugins
.
registered
.
push
(
a
),
"object"
==
typeof
i
&&
e
.
extend
(
!
0
,
t
.
footable
.
options
,
i
))},
load
:
function
(
e
){
var
a
,
i
,
o
=
[];
for
(
i
=
0
;
t
.
footable
.
plugins
.
registered
.
length
>
i
;
i
++
)
try
{
a
=
t
.
footable
.
plugins
.
registered
[
i
],
o
.
push
(
new
a
(
e
))}
catch
(
n
){
t
.
footable
.
options
.
debug
===!
0
&&
console
.
error
(
n
)}
return
o
},
init
:
function
(
e
){
for
(
var
a
=
0
;
e
.
plugins
.
length
>
a
;
a
++
)
try
{
e
.
plugins
[
a
].
init
(
e
)}
catch
(
i
){
t
.
footable
.
options
.
debug
===!
0
&&
console
.
error
(
i
)}}}};
var
o
=
0
;
e
.
fn
.
footable
=
function
(
a
){
a
=
a
||
{};
var
n
=
e
.
extend
(
!
0
,{},
t
.
footable
.
options
,
a
);
return
this
.
each
(
function
(){
o
++
;
var
t
=
new
i
(
this
,
n
,
o
);
e
(
this
).
data
(
"footable"
,
t
)})}})(
jQuery
,
window
);;(
function
(
e
,
t
,
undefined
){
function
a
(
t
){
var
a
=
e
(
"<th>"
+
t
.
title
+
"</th>"
);
return
e
.
isPlainObject
(
t
.
data
)
&&
a
.
data
(
t
.
data
),
e
.
isPlainObject
(
t
.
style
)
&&
a
.
css
(
t
.
style
),
t
.
className
&&
a
.
addClass
(
t
.
className
),
a
}
function
o
(
t
,
o
){
var
i
=
t
.
find
(
"thead"
);
0
===
i
.
size
()
&&
(
i
=
e
(
"<thead>"
).
appendTo
(
t
));
for
(
var
n
=
e
(
"<tr>"
).
appendTo
(
i
),
r
=
0
,
l
=
o
.
cols
.
length
;
l
>
r
;
r
++
)
n
.
append
(
a
(
o
.
cols
[
r
]))}
function
i
(
t
){
var
a
=
t
.
find
(
"tbody"
);
0
===
a
.
size
()
&&
(
a
=
e
(
"<tbody>"
).
appendTo
(
t
))}
function
n
(
t
,
a
,
o
){
if
(
o
){
t
.
attr
(
"data-page-size"
,
o
[
"page-size"
]);
var
i
=
t
.
find
(
"tfoot"
);
0
===
i
.
size
()
&&
(
i
=
e
(
'<tfoot class="hide-if-no-paging"></tfoot>'
).
appendTo
(
t
)),
i
.
append
(
"<tr><td colspan="
+
a
.
length
+
"></td></tr>"
);
var
n
=
e
(
"<div>"
).
appendTo
(
i
.
find
(
"tr:last-child td"
));
n
.
addClass
(
o
[
"pagination-class"
])}}
function
r
(
t
){
for
(
var
a
=
t
[
0
],
o
=
0
,
i
=
t
.
length
;
i
>
o
;
o
++
){
var
n
=
t
[
o
];
if
(
n
.
data
&&
(
n
.
data
.
toggle
===!
0
||
"true"
===
n
.
data
.
toggle
))
return
}
a
.
data
=
e
.
extend
(
a
.
data
,{
toggle
:
!
0
})}
function
l
(
e
,
t
,
a
){
0
===
e
.
find
(
"tr.emptyInfo"
).
size
()
&&
e
.
find
(
"tbody"
).
append
(
'<tr class="emptyInfo"><td colspan="'
+
t
.
length
+
'">'
+
a
+
"</td></tr>"
)}
function
d
(
t
,
a
,
o
,
i
){
t
.
find
(
"tr:not(."
+
o
+
")"
).
each
(
function
(){
var
t
=
e
(
this
),
o
=
a
.
data
(
"index"
),
n
=
parseInt
(
t
.
data
(
"index"
),
0
),
r
=
n
+
i
;
n
>=
o
&&
this
!==
a
.
get
(
0
)
&&
t
.
attr
(
"data-index"
,
r
).
data
(
"index"
,
r
)})}
function
s
(){
function
t
(
t
,
a
,
o
){
var
i
=
e
(
"<td>"
);
return
t
.
formatter
?
i
.
html
(
t
.
formatter
(
a
,
i
,
o
)):
i
.
html
(
a
||
""
),
i
}
var
a
=
this
;
a
.
name
=
"Footable Grid"
,
a
.
init
=
function
(
t
){
var
d
=
t
.
options
.
classes
.
toggle
,
s
=
t
.
options
.
classes
.
detail
,
f
=
t
.
options
.
grid
;
if
(
f
.
cols
){
a
.
footable
=
t
;
var
u
=
e
(
t
.
table
);
u
.
data
(
"grid"
,
a
),
e
.
isPlainObject
(
f
.
data
)
&&
u
.
data
(
f
.
data
),
a
.
_items
=
[],
r
(
f
.
cols
),
f
.
showCheckbox
&&
(
f
.
multiSelect
=!
0
,
f
.
cols
.
unshift
({
title
:
f
.
checkboxFormatter
(
!
0
),
name
:
""
,
data
:{
"sort-ignore"
:
!
0
},
formatter
:
f
.
checkboxFormatter
})),
f
.
showIndex
&&
f
.
cols
.
unshift
({
title
:
"#"
,
name
:
"index"
,
data
:{
"sort-ignore"
:
!
0
},
formatter
:
f
.
indexFormatter
}),
o
(
u
,
f
),
i
(
u
),
n
(
u
,
f
.
cols
,
f
.
pagination
),
u
.
off
(
".grid"
).
on
({
"footable_initialized.grid"
:
function
(){
f
.
url
||
f
.
ajax
?
e
.
ajax
(
f
.
ajax
||
{
url
:
f
.
url
}).
then
(
function
(
e
){
a
.
newItem
(
e
),
t
.
raise
(
f
.
events
.
loaded
)},
function
(){
throw
"load data from "
+
(
f
.
url
||
f
.
ajax
.
url
)
+
" fail"
}):(
a
.
newItem
(
f
.
items
||
[]),
t
.
raise
(
f
.
events
.
loaded
))},
"footable_sorted.grid footable_grid_created.grid footable_grid_removed.grid"
:
function
(){
f
.
showIndex
&&
a
.
getItem
().
length
>
0
&&
u
.
find
(
"tbody tr:not(."
+
s
+
")"
).
each
(
function
(
t
){
var
a
=
e
(
this
).
find
(
"td:first"
);
a
.
html
(
f
.
indexFormatter
(
null
,
a
,
t
))})},
"footable_redrawn.grid footable_row_removed.grid"
:
function
(){
0
===
a
.
getItem
().
length
&&
f
.
showEmptyInfo
&&
l
(
u
,
f
.
cols
,
f
.
emptyInfo
)}}).
on
({
"click.grid"
:
function
(
a
){
if
(
e
(
a
.
target
).
closest
(
"td"
).
find
(
">."
+
d
).
size
()
>
0
)
return
!
0
;
var
o
=
e
(
a
.
currentTarget
);
return
o
.
hasClass
(
s
)?
!
0
:(
f
.
multiSelect
||
o
.
hasClass
(
f
.
activeClass
)
||
u
.
find
(
"tbody tr."
+
f
.
activeClass
).
removeClass
(
f
.
activeClass
),
o
.
toggleClass
(
f
.
activeClass
),
f
.
showCheckbox
&&
o
.
find
(
"input:checkbox.check"
).
prop
(
"checked"
,
function
(
e
,
t
){
return
a
.
target
===
this
?
t
:
!
t
}),
t
.
toggleDetail
(
o
),
undefined
)}},
"tbody tr"
).
on
(
"click.grid"
,
"thead input:checkbox.checkAll"
,
function
(
e
){
var
t
=!!
e
.
currentTarget
.
checked
;
t
?
u
.
find
(
"tbody tr"
).
addClass
(
f
.
activeClass
):
u
.
find
(
"tbody tr"
).
removeClass
(
f
.
activeClass
),
u
.
find
(
"tbody input:checkbox.check"
).
prop
(
"checked"
,
t
)})}},
a
.
getSelected
=
function
(){
var
t
=
a
.
footable
.
options
.
grid
,
o
=
e
(
a
.
footable
.
table
).
find
(
"tbody>tr."
+
t
.
activeClass
);
return
o
.
map
(
function
(){
return
e
(
this
).
data
(
"index"
)})},
a
.
getItem
=
function
(
t
){
return
t
!==
undefined
?
e
.
isArray
(
t
)?
e
.
map
(
t
,
function
(
e
){
return
a
.
_items
[
e
]}):
a
.
_items
[
t
]:
a
.
_items
},
a
.
_makeRow
=
function
(
o
,
i
){
var
n
,
r
=
a
.
footable
.
options
.
grid
;
if
(
e
.
isFunction
(
r
.
template
))
n
=
e
(
r
.
template
(
e
.
extend
({},{
__index
:
i
},
o
)));
else
{
n
=
e
(
"<tr>"
);
for
(
var
l
=
0
,
d
=
r
.
cols
.
length
;
d
>
l
;
l
++
){
var
s
=
r
.
cols
[
l
];
n
.
append
(
t
(
s
,
o
[
s
.
name
]
||
""
,
i
))}}
return
n
.
attr
(
"data-index"
,
i
),
n
},
a
.
newItem
=
function
(
t
,
o
,
i
){
var
n
=
e
(
a
.
footable
.
table
).
find
(
"tbody"
),
r
=
a
.
footable
.
options
.
classes
.
detail
;
if
(
n
.
find
(
"tr.emptyInfo"
).
remove
(),
e
.
isArray
(
t
)){
for
(
var
l
;
l
=
t
.
pop
();)
a
.
newItem
(
l
,
o
,
!
0
);
return
a
.
footable
.
redraw
(),
a
.
footable
.
raise
(
a
.
footable
.
options
.
grid
.
events
.
created
,{
item
:
t
,
index
:
o
}),
undefined
}
if
(
e
.
isPlainObject
(
t
)){
var
s
,
f
=
a
.
_items
.
length
;
if
(
o
===
undefined
||
0
>
o
||
o
>
f
)
s
=
a
.
_makeRow
(
t
,
f
++
),
a
.
_items
.
push
(
t
),
n
.
append
(
s
);
else
{
if
(
s
=
a
.
_makeRow
(
t
,
o
),
0
===
o
)
a
.
_items
.
unshift
(
t
),
n
.
prepend
(
s
);
else
{
var
u
=
n
.
find
(
"tr[data-index="
+
(
o
-
1
)
+
"]"
);
a
.
_items
.
splice
(
o
,
0
,
t
),
u
.
data
(
"detail_created"
)
===!
0
&&
(
u
=
u
.
next
()),
u
.
after
(
s
)}
d
(
n
,
s
,
r
,
1
)}
i
||
(
a
.
footable
.
redraw
(),
a
.
footable
.
raise
(
a
.
footable
.
options
.
grid
.
events
.
created
,{
item
:
t
,
index
:
o
}))}},
a
.
setItem
=
function
(
t
,
o
){
if
(
e
.
isPlainObject
(
t
)){
var
i
=
e
(
a
.
footable
.
table
).
find
(
"tbody"
),
n
=
a
.
_makeRow
(
t
,
o
);
e
.
extend
(
a
.
_items
[
o
],
t
);
var
r
=
i
.
find
(
"tr"
).
eq
(
o
);
r
.
html
(
n
.
html
()),
a
.
footable
.
redraw
(),
a
.
footable
.
raise
(
a
.
footable
.
options
.
grid
.
events
.
updated
,{
item
:
t
,
index
:
o
})}},
a
.
removeItem
=
function
(
t
){
var
o
=
e
(
a
.
footable
.
table
).
find
(
"tbody"
),
i
=
a
.
footable
.
options
.
classes
.
detail
,
n
=
[];
if
(
e
.
isArray
(
t
)){
for
(
var
r
;
r
=
t
.
pop
();)
n
.
push
(
a
.
removeItem
(
r
));
return
a
.
footable
.
raise
(
a
.
footable
.
options
.
grid
.
events
.
removed
,{
item
:
n
,
index
:
t
}),
n
}
if
(
t
===
undefined
)
o
.
find
(
"tr"
).
each
(
function
(){
n
.
push
(
a
.
_items
.
shift
()),
a
.
footable
.
removeRow
(
this
)});
else
{
var
l
=
o
.
find
(
"tr[data-index="
+
t
+
"]"
);
n
=
a
.
_items
.
splice
(
t
,
1
)[
0
],
a
.
footable
.
removeRow
(
l
),
d
(
o
,
l
,
i
,
-
1
)}
return
a
.
footable
.
raise
(
a
.
footable
.
options
.
grid
.
events
.
removed
,{
item
:
n
,
index
:
t
}),
n
}}
if
(
t
.
footable
===
undefined
||
null
===
t
.
foobox
)
throw
Error
(
"Please check and make sure footable.js is included in the page and is loaded prior to this script."
);
var
f
=
{
grid
:{
enabled
:
!
0
,
data
:
null
,
template
:
null
,
cols
:
null
,
items
:
null
,
url
:
null
,
ajax
:
null
,
activeClass
:
"active"
,
multiSelect
:
!
1
,
showIndex
:
!
1
,
showCheckbox
:
!
1
,
showEmptyInfo
:
!
1
,
emptyInfo
:
'<p class="text-center text-warning">No Data</p>'
,
pagination
:{
"page-size"
:
20
,
"pagination-class"
:
"pagination pagination-centered"
},
indexFormatter
:
function
(
e
,
t
,
a
){
return
a
+
1
},
checkboxFormatter
:
function
(
e
){
return
'<input type="checkbox" class="'
+
(
e
?
"checkAll"
:
"check"
)
+
'">'
},
events
:{
loaded
:
"footable_grid_loaded"
,
created
:
"footable_grid_created"
,
removed
:
"footable_grid_removed"
,
updated
:
"footable_grid_updated"
}}};
t
.
footable
.
plugins
.
register
(
s
,
f
)})(
jQuery
,
window
);;(
function
(
t
,
e
,
undefined
){
function
a
(){
var
e
=
this
;
e
.
name
=
"Footable Filter"
,
e
.
init
=
function
(
a
){
if
(
e
.
footable
=
a
,
a
.
options
.
filter
.
enabled
===!
0
){
if
(
t
(
a
.
table
).
data
(
"filter"
)
===!
1
)
return
;
a
.
timers
.
register
(
"filter"
),
t
(
a
.
table
).
unbind
(
".filtering"
).
bind
({
"footable_initialized.filtering"
:
function
(){
var
i
=
t
(
a
.
table
),
o
=
{
input
:
i
.
data
(
"filter"
)
||
a
.
options
.
filter
.
input
,
timeout
:
i
.
data
(
"filter-timeout"
)
||
a
.
options
.
filter
.
timeout
,
minimum
:
i
.
data
(
"filter-minimum"
)
||
a
.
options
.
filter
.
minimum
,
disableEnter
:
i
.
data
(
"filter-disable-enter"
)
||
a
.
options
.
filter
.
disableEnter
};
o
.
disableEnter
&&
t
(
o
.
input
).
keypress
(
function
(
t
){
return
window
.
event
?
13
!==
window
.
event
.
keyCode
:
13
!==
t
.
which
}),
i
.
bind
(
"footable_clear_filter"
,
function
(){
t
(
o
.
input
).
val
(
""
),
e
.
clearFilter
()}),
i
.
bind
(
"footable_filter"
,
function
(
t
,
a
){
e
.
filter
(
a
.
filter
)}),
t
(
o
.
input
).
keyup
(
function
(
i
){
a
.
timers
.
filter
.
stop
(),
27
===
i
.
which
&&
t
(
o
.
input
).
val
(
""
),
a
.
timers
.
filter
.
start
(
function
(){
var
a
=
t
(
o
.
input
).
val
()
||
""
;
e
.
filter
(
a
)},
o
.
timeout
)})},
"footable_redrawn.filtering"
:
function
(){
var
i
=
t
(
a
.
table
),
o
=
i
.
data
(
"filter-string"
);
o
&&
e
.
filter
(
o
)}}).
data
(
"footable-filter"
,
e
)}},
e
.
filter
=
function
(
a
){
var
i
=
e
.
footable
,
o
=
t
(
i
.
table
),
n
=
o
.
data
(
"filter-minimum"
)
||
i
.
options
.
filter
.
minimum
,
r
=!
a
,
l
=
i
.
raise
(
"footable_filtering"
,{
filter
:
a
,
clear
:
r
});
if
(
!
(
l
&&
l
.
result
===!
1
||
l
.
filter
&&
n
>
l
.
filter
.
length
))
if
(
l
.
clear
)
e
.
clearFilter
();
else
{
var
d
=
l
.
filter
.
split
(
" "
);
o
.
find
(
"> tbody > tr"
).
hide
().
addClass
(
"footable-filtered"
);
var
s
=
o
.
find
(
"> tbody > tr:not(.footable-row-detail)"
);
t
.
each
(
d
,
function
(
t
,
e
){
e
&&
e
.
length
>
0
&&
(
o
.
data
(
"current-filter"
,
e
),
s
=
s
.
filter
(
i
.
options
.
filter
.
filterFunction
))}),
s
.
each
(
function
(){
e
.
showRow
(
this
,
i
),
t
(
this
).
removeClass
(
"footable-filtered"
)}),
o
.
data
(
"filter-string"
,
l
.
filter
),
i
.
raise
(
"footable_filtered"
,{
filter
:
l
.
filter
,
clear
:
!
1
})}},
e
.
clearFilter
=
function
(){
var
a
=
e
.
footable
,
i
=
t
(
a
.
table
);
i
.
find
(
"> tbody > tr:not(.footable-row-detail)"
).
removeClass
(
"footable-filtered"
).
each
(
function
(){
e
.
showRow
(
this
,
a
)}),
i
.
removeData
(
"filter-string"
),
a
.
raise
(
"footable_filtered"
,{
clear
:
!
0
})},
e
.
showRow
=
function
(
e
,
a
){
var
i
=
t
(
e
),
o
=
i
.
next
(),
n
=
t
(
a
.
table
);
i
.
is
(
":visible"
)
||
(
n
.
hasClass
(
"breakpoint"
)
&&
i
.
hasClass
(
"footable-detail-show"
)
&&
o
.
hasClass
(
"footable-row-detail"
)?(
i
.
add
(
o
).
show
(),
a
.
createOrUpdateDetailRow
(
e
)):
i
.
show
())}}
if
(
e
.
footable
===
undefined
||
null
===
e
.
footable
)
throw
Error
(
"Please check and make sure footable.js is included in the page and is loaded prior to this script."
);
var
i
=
{
filter
:{
enabled
:
!
0
,
input
:
".footable-filter"
,
timeout
:
300
,
minimum
:
2
,
disableEnter
:
!
1
,
filterFunction
:
function
(){
var
e
=
t
(
this
),
a
=
e
.
parents
(
"table:first"
),
i
=
a
.
data
(
"current-filter"
).
toUpperCase
(),
o
=
e
.
find
(
"td"
).
text
();
return
a
.
data
(
"filter-text-only"
)
||
e
.
find
(
"td[data-value]"
).
each
(
function
(){
o
+=
t
(
this
).
data
(
"value"
)}),
o
.
toUpperCase
().
indexOf
(
i
)
>=
0
}}};
e
.
footable
.
plugins
.
register
(
a
,
i
)})(
jQuery
,
window
);;(
function
(
e
,
t
,
undefined
){
function
a
(
t
){
var
a
=
e
(
t
.
table
),
i
=
a
.
data
();
this
.
pageNavigation
=
i
.
pageNavigation
||
t
.
options
.
pageNavigation
,
this
.
pageSize
=
i
.
pageSize
||
t
.
options
.
pageSize
,
this
.
firstText
=
i
.
firstText
||
t
.
options
.
firstText
,
this
.
previousText
=
i
.
previousText
||
t
.
options
.
previousText
,
this
.
nextText
=
i
.
nextText
||
t
.
options
.
nextText
,
this
.
lastText
=
i
.
lastText
||
t
.
options
.
lastText
,
this
.
limitNavigation
=
parseInt
(
i
.
limitNavigation
||
t
.
options
.
limitNavigation
||
o
.
limitNavigation
,
10
),
this
.
limitPreviousText
=
i
.
limitPreviousText
||
t
.
options
.
limitPreviousText
,
this
.
limitNextText
=
i
.
limitNextText
||
t
.
options
.
limitNextText
,
this
.
limit
=
this
.
limitNavigation
>
0
,
this
.
currentPage
=
i
.
currentPage
||
0
,
this
.
pages
=
[],
this
.
control
=!
1
}
function
i
(){
var
t
=
this
;
t
.
name
=
"Footable Paginate"
,
t
.
init
=
function
(
a
){
if
(
a
.
options
.
paginate
===!
0
){
if
(
e
(
a
.
table
).
data
(
"page"
)
===!
1
)
return
;
t
.
footable
=
a
,
e
(
a
.
table
).
unbind
(
".paging"
).
bind
({
"footable_initialized.paging footable_row_removed.paging footable_redrawn.paging footable_sorted.paging footable_filtered.paging"
:
function
(){
t
.
setupPaging
()}}).
data
(
"footable-paging"
,
t
)}},
t
.
setupPaging
=
function
(){
var
i
=
t
.
footable
,
o
=
e
(
i
.
table
).
find
(
"> tbody"
);
i
.
pageInfo
=
new
a
(
i
),
t
.
createPages
(
i
,
o
),
t
.
createNavigation
(
i
,
o
),
t
.
fillPage
(
i
,
o
,
i
.
pageInfo
.
currentPage
)},
t
.
createPages
=
function
(
t
,
a
){
var
i
=
1
,
o
=
t
.
pageInfo
,
n
=
i
*
o
.
pageSize
,
r
=
[],
l
=
[];
o
.
pages
=
[];
var
d
=
a
.
find
(
"> tr:not(.footable-filtered,.footable-row-detail)"
);
d
.
each
(
function
(
e
,
t
){
r
.
push
(
t
),
e
===
n
-
1
?(
o
.
pages
.
push
(
r
),
i
++
,
n
=
i
*
o
.
pageSize
,
r
=
[]):
e
>=
d
.
length
-
d
.
length
%
o
.
pageSize
&&
l
.
push
(
t
)}),
l
.
length
>
0
&&
o
.
pages
.
push
(
l
),
o
.
currentPage
>=
o
.
pages
.
length
&&
(
o
.
currentPage
=
o
.
pages
.
length
-
1
),
0
>
o
.
currentPage
&&
(
o
.
currentPage
=
0
),
1
===
o
.
pages
.
length
?
e
(
t
.
table
).
addClass
(
"no-paging"
):
e
(
t
.
table
).
removeClass
(
"no-paging"
)},
t
.
createNavigation
=
function
(
a
){
var
i
=
e
(
a
.
table
).
find
(
a
.
pageInfo
.
pageNavigation
);
if
(
0
===
i
.
length
){
if
(
i
=
e
(
a
.
pageInfo
.
pageNavigation
),
i
.
parents
(
"table:first"
).
length
>
0
&&
i
.
parents
(
"table:first"
)
!==
e
(
a
.
table
))
return
;
i
.
length
>
1
&&
a
.
options
.
debug
===!
0
&&
console
.
error
(
"More than one pagination control was found!"
)}
if
(
0
!==
i
.
length
){
i
.
is
(
"ul"
)
||
(
0
===
i
.
find
(
"ul:first"
).
length
&&
i
.
append
(
"<ul />"
),
i
=
i
.
find
(
"ul"
)),
i
.
find
(
"li"
).
remove
();
var
o
=
a
.
pageInfo
;
o
.
control
=
i
,
o
.
pages
.
length
>
0
&&
(
i
.
append
(
'<li class="footable-page-arrow"><a data-page="first" href="#first">'
+
a
.
pageInfo
.
firstText
+
"</a>"
),
i
.
append
(
'<li class="footable-page-arrow"><a data-page="prev" href="#prev">'
+
a
.
pageInfo
.
previousText
+
"</a></li>"
),
o
.
limit
&&
i
.
append
(
'<li class="footable-page-arrow"><a data-page="limit-prev" href="#limit-prev">'
+
a
.
pageInfo
.
limitPreviousText
+
"</a></li>"
),
o
.
limit
||
e
.
each
(
o
.
pages
,
function
(
e
,
t
){
t
.
length
>
0
&&
i
.
append
(
'<li class="footable-page"><a data-page="'
+
e
+
'" href="#">'
+
(
e
+
1
)
+
"</a></li>"
)}),
o
.
limit
&&
(
i
.
append
(
'<li class="footable-page-arrow"><a data-page="limit-next" href="#limit-next">'
+
a
.
pageInfo
.
limitNextText
+
"</a></li>"
),
t
.
createLimited
(
i
,
o
,
0
)),
i
.
append
(
'<li class="footable-page-arrow"><a data-page="next" href="#next">'
+
a
.
pageInfo
.
nextText
+
"</a></li>"
),
i
.
append
(
'<li class="footable-page-arrow"><a data-page="last" href="#last">'
+
a
.
pageInfo
.
lastText
+
"</a></li>"
)),
i
.
off
(
"click"
,
"a[data-page]"
).
on
(
"click"
,
"a[data-page]"
,
function
(
n
){
n
.
preventDefault
();
var
r
=
e
(
this
).
data
(
"page"
),
l
=
o
.
currentPage
;
if
(
"first"
===
r
)
l
=
0
;
else
if
(
"prev"
===
r
)
l
>
0
&&
l
--
;
else
if
(
"next"
===
r
)
o
.
pages
.
length
-
1
>
l
&&
l
++
;
else
if
(
"last"
===
r
)
l
=
o
.
pages
.
length
-
1
;
else
if
(
"limit-prev"
===
r
){
l
=-
1
;
var
d
=
i
.
find
(
".footable-page:first a"
).
data
(
"page"
);
t
.
createLimited
(
i
,
o
,
d
-
o
.
limitNavigation
),
t
.
setPagingClasses
(
i
,
o
.
currentPage
,
o
.
pages
.
length
)}
else
if
(
"limit-next"
===
r
){
l
=-
1
;
var
s
=
i
.
find
(
".footable-page:last a"
).
data
(
"page"
);
t
.
createLimited
(
i
,
o
,
s
+
1
),
t
.
setPagingClasses
(
i
,
o
.
currentPage
,
o
.
pages
.
length
)}
else
l
=
r
;
if
(
l
>=
0
){
if
(
o
.
limit
&&
o
.
currentPage
!=
l
){
for
(
var
f
=
l
;
0
!==
f
%
o
.
limitNavigation
;)
f
-=
1
;
t
.
createLimited
(
i
,
o
,
f
)}
t
.
paginate
(
a
,
l
)}}),
t
.
setPagingClasses
(
i
,
o
.
currentPage
,
o
.
pages
.
length
)}},
t
.
createLimited
=
function
(
e
,
t
,
a
){
a
=
a
||
0
,
e
.
find
(
"li.footable-page"
).
remove
();
var
i
,
o
,
n
=
e
.
find
(
'li.footable-page-arrow > a[data-page="limit-prev"]'
).
parent
(),
r
=
e
.
find
(
'li.footable-page-arrow > a[data-page="limit-next"]'
).
parent
();
for
(
i
=
t
.
pages
.
length
-
1
;
i
>=
0
;
i
--
)
o
=
t
.
pages
[
i
],
i
>=
a
&&
a
+
t
.
limitNavigation
>
i
&&
o
.
length
>
0
&&
n
.
after
(
'<li class="footable-page"><a data-page="'
+
i
+
'" href="#">'
+
(
i
+
1
)
+
"</a></li>"
);
0
===
a
?
n
.
hide
():
n
.
show
(),
a
+
t
.
limitNavigation
>=
t
.
pages
.
length
?
r
.
hide
():
r
.
show
()},
t
.
paginate
=
function
(
a
,
i
){
var
o
=
a
.
pageInfo
;
if
(
o
.
currentPage
!==
i
){
var
n
=
e
(
a
.
table
).
find
(
"> tbody"
),
r
=
a
.
raise
(
"footable_paging"
,{
page
:
i
,
size
:
o
.
pageSize
});
if
(
r
&&
r
.
result
===!
1
)
return
;
t
.
fillPage
(
a
,
n
,
i
),
o
.
control
.
find
(
"li"
).
removeClass
(
"active disabled"
),
t
.
setPagingClasses
(
o
.
control
,
o
.
currentPage
,
o
.
pages
.
length
)}},
t
.
setPagingClasses
=
function
(
e
,
t
,
a
){
e
.
find
(
"li.footable-page > a[data-page="
+
t
+
"]"
).
parent
().
addClass
(
"active"
),
t
>=
a
-
1
&&
(
e
.
find
(
'li.footable-page-arrow > a[data-page="next"]'
).
parent
().
addClass
(
"disabled"
),
e
.
find
(
'li.footable-page-arrow > a[data-page="last"]'
).
parent
().
addClass
(
"disabled"
)),
1
>
t
&&
(
e
.
find
(
'li.footable-page-arrow > a[data-page="first"]'
).
parent
().
addClass
(
"disabled"
),
e
.
find
(
'li.footable-page-arrow > a[data-page="prev"]'
).
parent
().
addClass
(
"disabled"
))},
t
.
fillPage
=
function
(
a
,
i
,
o
){
a
.
pageInfo
.
currentPage
=
o
,
e
(
a
.
table
).
data
(
"currentPage"
,
o
),
i
.
find
(
"> tr"
).
hide
(),
e
(
a
.
pageInfo
.
pages
[
o
]).
each
(
function
(){
t
.
showRow
(
this
,
a
)}),
a
.
raise
(
"footable_page_filled"
)},
t
.
showRow
=
function
(
t
,
a
){
var
i
=
e
(
t
),
o
=
i
.
next
(),
n
=
e
(
a
.
table
);
n
.
hasClass
(
"breakpoint"
)
&&
i
.
hasClass
(
"footable-detail-show"
)
&&
o
.
hasClass
(
"footable-row-detail"
)?(
i
.
add
(
o
).
show
(),
a
.
createOrUpdateDetailRow
(
t
)):
i
.
show
()}}
if
(
t
.
footable
===
undefined
||
null
===
t
.
footable
)
throw
Error
(
"Please check and make sure footable.js is included in the page and is loaded prior to this script."
);
var
o
=
{
paginate
:
!
0
,
pageSize
:
10
,
pageNavigation
:
".pagination"
,
firstText
:
"«"
,
previousText
:
"‹"
,
nextText
:
"›"
,
lastText
:
"»"
,
limitNavigation
:
0
,
limitPreviousText
:
"..."
,
limitNextText
:
"..."
};
t
.
footable
.
plugins
.
register
(
i
,
o
)})(
jQuery
,
window
);;(
function
(
t
,
e
,
undefined
){
function
a
(){
var
e
=
this
;
e
.
name
=
"Footable Sortable"
,
e
.
init
=
function
(
a
){
e
.
footable
=
a
,
a
.
options
.
sort
===!
0
&&
t
(
a
.
table
).
unbind
(
".sorting"
).
bind
({
"footable_initialized.sorting"
:
function
(){
var
i
,
o
,
n
=
t
(
a
.
table
),
r
=
(
n
.
find
(
"> tbody"
),
a
.
options
.
classes
.
sort
);
if
(
n
.
data
(
"sort"
)
!==!
1
){
n
.
find
(
"> thead > tr:last-child > th, > thead > tr:last-child > td"
).
each
(
function
(){
var
e
=
t
(
this
),
i
=
a
.
columns
[
e
.
index
()];
i
.
sort
.
ignore
===!
0
||
e
.
hasClass
(
r
.
sortable
)
||
(
e
.
addClass
(
r
.
sortable
),
t
(
"<span />"
).
addClass
(
r
.
indicator
).
appendTo
(
e
))}),
n
.
find
(
"> thead > tr:last-child > th."
+
r
.
sortable
+
", > thead > tr:last-child > td."
+
r
.
sortable
).
unbind
(
"click.footable"
).
bind
(
"click.footable"
,
function
(
a
){
a
.
preventDefault
(),
o
=
t
(
this
);
var
i
=!
o
.
hasClass
(
r
.
sorted
);
return
e
.
doSort
(
o
.
index
(),
i
),
!
1
});
var
l
=!
1
;
for
(
var
s
in
a
.
columns
)
if
(
i
=
a
.
columns
[
s
],
i
.
sort
.
initial
){
var
d
=
"descending"
!==
i
.
sort
.
initial
;
e
.
doSort
(
i
.
index
,
d
);
break
}
l
&&
a
.
bindToggleSelectors
()}},
"footable_redrawn.sorting"
:
function
(){
var
i
=
t
(
a
.
table
),
o
=
a
.
options
.
classes
.
sort
;
i
.
data
(
"sorted"
)
>=
0
&&
i
.
find
(
"> thead > tr:last-child > th"
).
each
(
function
(
a
){
var
i
=
t
(
this
);
return
i
.
hasClass
(
o
.
sorted
)
||
i
.
hasClass
(
o
.
descending
)?(
e
.
doSort
(
a
),
undefined
):
undefined
})},
"footable_column_data.sorting"
:
function
(
e
){
var
a
=
t
(
e
.
column
.
th
);
e
.
column
.
data
.
sort
=
e
.
column
.
data
.
sort
||
{},
e
.
column
.
data
.
sort
.
initial
=
a
.
data
(
"sort-initial"
)
||!
1
,
e
.
column
.
data
.
sort
.
ignore
=
a
.
data
(
"sort-ignore"
)
||!
1
,
e
.
column
.
data
.
sort
.
selector
=
a
.
data
(
"sort-selector"
)
||
null
;
var
i
=
a
.
data
(
"sort-match"
)
||
0
;
i
>=
e
.
column
.
data
.
matches
.
length
&&
(
i
=
0
),
e
.
column
.
data
.
sort
.
match
=
e
.
column
.
data
.
matches
[
i
]}}).
data
(
"footable-sort"
,
e
)},
e
.
doSort
=
function
(
a
,
i
){
var
o
=
e
.
footable
;
if
(
t
(
o
.
table
).
data
(
"sort"
)
!==!
1
){
var
n
=
t
(
o
.
table
),
r
=
n
.
find
(
"> tbody"
),
l
=
o
.
columns
[
a
],
s
=
n
.
find
(
"> thead > tr:last-child > th:eq("
+
a
+
")"
),
d
=
o
.
options
.
classes
.
sort
,
f
=
o
.
options
.
events
.
sort
;
if
(
i
=
i
===
undefined
?
s
.
hasClass
(
d
.
sorted
):
"toggle"
===
i
?
!
s
.
hasClass
(
d
.
sorted
):
i
,
l
.
sort
.
ignore
===!
0
)
return
!
0
;
var
u
=
o
.
raise
(
f
.
sorting
,{
column
:
l
,
direction
:
i
?
"ASC"
:
"DESC"
});
u
&&
u
.
result
===!
1
||
(
n
.
data
(
"sorted"
,
l
.
index
),
n
.
find
(
"> thead > tr:last-child > th, > thead > tr:last-child > td"
).
not
(
s
).
removeClass
(
d
.
sorted
+
" "
+
d
.
descending
),
i
===
undefined
&&
(
i
=
s
.
hasClass
(
d
.
sorted
)),
i
?
s
.
removeClass
(
d
.
descending
).
addClass
(
d
.
sorted
):
s
.
removeClass
(
d
.
sorted
).
addClass
(
d
.
descending
),
e
.
sort
(
o
,
r
,
l
,
i
),
o
.
bindToggleSelectors
(),
o
.
raise
(
f
.
sorted
,{
column
:
l
,
direction
:
i
?
"ASC"
:
"DESC"
}))}},
e
.
rows
=
function
(
e
,
a
,
i
){
var
o
=
[];
return
a
.
find
(
"> tr"
).
each
(
function
(){
var
a
=
t
(
this
),
n
=
null
;
if
(
a
.
hasClass
(
e
.
options
.
classes
.
detail
))
return
!
0
;
a
.
next
().
hasClass
(
e
.
options
.
classes
.
detail
)
&&
(
n
=
a
.
next
().
get
(
0
));
var
r
=
{
row
:
a
,
detail
:
n
};
return
i
!==
undefined
&&
(
r
.
value
=
e
.
parse
(
this
.
cells
[
i
.
sort
.
match
],
i
)),
o
.
push
(
r
),
!
0
}).
detach
(),
o
},
e
.
sort
=
function
(
t
,
a
,
i
,
o
){
var
n
=
e
.
rows
(
t
,
a
,
i
),
r
=
t
.
options
.
sorters
[
i
.
type
]
||
t
.
options
.
sorters
.
alpha
;
n
.
sort
(
function
(
t
,
e
){
return
o
?
r
(
t
.
value
,
e
.
value
):
r
(
e
.
value
,
t
.
value
)});
for
(
var
l
=
0
;
n
.
length
>
l
;
l
++
)
a
.
append
(
n
[
l
].
row
),
null
!==
n
[
l
].
detail
&&
a
.
append
(
n
[
l
].
detail
)}}
if
(
e
.
footable
===
undefined
||
null
===
e
.
footable
)
throw
Error
(
"Please check and make sure footable.js is included in the page and is loaded prior to this script."
);
var
i
=
{
sort
:
!
0
,
sorters
:{
alpha
:
function
(
t
,
e
){
return
"string"
==
typeof
t
&&
(
t
=
t
.
toLowerCase
()),
"string"
==
typeof
e
&&
(
e
=
e
.
toLowerCase
()),
t
===
e
?
0
:
e
>
t
?
-
1
:
1
},
numeric
:
function
(
t
,
e
){
return
t
-
e
}},
classes
:{
sort
:{
sortable
:
"footable-sortable"
,
sorted
:
"footable-sorted"
,
descending
:
"footable-sorted-desc"
,
indicator
:
"footable-sort-indicator"
}},
events
:{
sort
:{
sorting
:
"footable_sorting"
,
sorted
:
"footable_sorted"
}}};
e
.
footable
.
plugins
.
register
(
a
,
i
)})(
jQuery
,
window
);;(
function
(
t
,
e
,
undefined
){
function
a
(){
var
e
=
this
;
e
.
name
=
"Footable Striping"
,
e
.
init
=
function
(
a
){
e
.
footable
=
a
,
t
(
a
.
table
).
unbind
(
"striping"
).
bind
({
"footable_initialized.striping footable_row_removed.striping footable_redrawn.striping footable_sorted.striping footable_filtered.striping"
:
function
(){
t
(
this
).
data
(
"striping"
)
!==!
1
&&
e
.
setupStriping
(
a
)}})},
e
.
setupStriping
=
function
(
e
){
var
a
=
0
;
t
(
e
.
table
).
find
(
"> tbody > tr:not(.footable-row-detail)"
).
each
(
function
(){
var
i
=
t
(
this
);
i
.
removeClass
(
e
.
options
.
classes
.
striping
.
even
).
removeClass
(
e
.
options
.
classes
.
striping
.
odd
),
0
===
a
%
2
?
i
.
addClass
(
e
.
options
.
classes
.
striping
.
even
):
i
.
addClass
(
e
.
options
.
classes
.
striping
.
odd
),
a
++
})}}
if
(
e
.
footable
===
undefined
||
null
===
e
.
foobox
)
throw
Error
(
"Please check and make sure footable.js is included in the page and is loaded prior to this script."
);
var
i
=
{
striping
:{
enabled
:
!
0
},
classes
:{
striping
:{
odd
:
"footable-odd"
,
even
:
"footable-even"
}}};
e
.
footable
.
plugins
.
register
(
a
,
i
)})(
jQuery
,
window
);;(
function
(
t
,
e
,
undefined
){
function
a
(
t
,
e
){
e
=
e
?
e
:
location
.
hash
;
var
a
=
RegExp
(
"&"
+
t
+
"(?:=([^&]*))?(?=&|$)"
,
"i"
);
return
(
e
=
e
.
replace
(
/^
\#
/
,
"&"
).
match
(
a
))?
e
[
1
]
===
undefined
?
""
:
decodeURIComponent
(
e
[
1
]):
undefined
}
function
i
(
e
,
a
){
var
i
=
t
(
e
.
table
).
find
(
"tbody"
).
find
(
"tr:not(.footable-row-detail, .footable-filtered)"
).
length
;
t
(
e
.
table
).
data
(
"status_num_total"
,
i
);
var
o
=
t
(
e
.
table
).
find
(
"tbody"
).
find
(
"tr:not(.footable-row-detail)"
).
filter
(
":visible"
).
length
;
t
(
e
.
table
).
data
(
"status_num_shown"
,
o
);
var
n
=
t
(
e
.
table
).
data
(
"sorted"
),
r
=
t
(
e
.
table
).
find
(
"th"
)[
n
],
l
=
t
(
r
).
hasClass
(
"footable-sorted-desc"
);
if
(
t
(
e
.
table
).
data
(
"status_descending"
,
l
),
e
.
pageInfo
){
var
s
=
e
.
pageInfo
.
currentPage
;
t
(
e
.
table
).
data
(
"status_pagenum"
,
s
)}
var
d
=
""
,
f
=
t
(
e
.
table
).
data
(
"filter"
);
t
(
f
).
length
&&
(
d
=
t
(
f
).
val
()),
t
(
e
.
table
).
data
(
"status_filter_val"
,
d
);
var
u
,
p
,
c
;
if
(
"footable_row_expanded"
==
a
.
type
&&
(
u
=
a
.
row
,
u
&&
(
p
=
t
(
e
.
table
).
data
(
"expanded_rows"
),
c
=
[],
p
&&
(
c
=
p
.
split
(
","
)),
c
.
push
(
u
.
rowIndex
),
t
(
e
.
table
).
data
(
"expanded_rows"
,
c
.
join
(
","
)))),
"footable_row_collapsed"
==
a
.
type
&&
(
u
=
a
.
row
)){
p
=
t
(
e
.
table
).
data
(
"expanded_rows"
),
c
=
[],
p
&&
(
c
=
p
.
split
(
","
));
var
g
=
[];
for
(
var
b
in
c
)
if
(
c
[
b
]
==
u
.
rowIndex
){
g
=
c
.
splice
(
b
,
1
);
break
}
t
(
e
.
table
).
data
(
"expanded_rows"
,
g
.
join
(
","
))}}
function
o
(){
var
e
=
this
;
e
.
name
=
"Footable LucidBookmarkable"
,
e
.
init
=
function
(
e
){
e
.
options
.
bookmarkable
.
enabled
&&
t
(
e
.
table
).
bind
({
footable_initialized
:
function
(){
var
i
=
e
.
table
.
id
,
o
=
a
(
i
+
"_f"
),
n
=
a
(
i
+
"_p"
),
r
=
a
(
i
+
"_s"
),
l
=
a
(
i
+
"_d"
),
s
=
a
(
i
+
"_e"
);
if
(
o
){
var
d
=
t
(
e
.
table
).
data
(
"filter"
);
t
(
d
).
val
(
o
),
t
(
e
.
table
).
trigger
(
"footable_filter"
,{
filter
:
o
})}
if
(
n
&&
t
(
e
.
table
).
data
(
"currentPage"
,
n
),
r
!==
undefined
){
var
f
=
t
(
e
.
table
).
data
(
"footable-sort"
),
u
=!
0
;
"true"
==
l
&&
(
u
=!
1
),
f
.
doSort
(
r
,
u
)}
else
t
(
e
.
table
).
trigger
(
"footable_setup_paging"
);
if
(
s
){
var
p
=
s
.
split
(
","
);
for
(
var
c
in
p
){
var
g
=
t
(
e
.
table
.
rows
[
p
[
c
]]);
g
.
find
(
"> td:first"
).
trigger
(
"footable_toggle_row"
)}}
e
.
lucid_bookmark_read
=!
0
},
"footable_page_filled footable_redrawn footable_filtered footable_sorted footable_row_expanded footable_row_collapsed"
:
function
(
a
){
if
(
i
(
e
,
a
),
e
.
lucid_bookmark_read
){
var
o
=
e
.
table
.
id
,
n
=
o
+
"_f"
,
r
=
o
+
"_p"
,
l
=
o
+
"_s"
,
s
=
o
+
"_d"
,
d
=
o
+
"_e"
,
f
=
location
.
hash
.
replace
(
/^
\#
/
,
"&"
),
u
=
[
n
,
r
,
l
,
s
,
d
];
for
(
var
p
in
u
){
var
c
=
RegExp
(
"&"
+
u
[
p
]
+
"=([^&]*)"
,
"g"
);
f
=
f
.
replace
(
c
,
""
)}
var
g
=
{};
g
[
n
]
=
t
(
e
.
table
).
data
(
"status_filter_val"
),
g
[
r
]
=
t
(
e
.
table
).
data
(
"status_pagenum"
),
g
[
l
]
=
t
(
e
.
table
).
data
(
"sorted"
),
g
[
s
]
=
t
(
e
.
table
).
data
(
"status_descending"
),
g
[
d
]
=
t
(
e
.
table
).
data
(
"expanded_rows"
);
var
b
=
[];
for
(
var
h
in
g
)
g
[
h
]
!==
undefined
&&
b
.
push
(
h
+
"="
+
encodeURIComponent
(
g
[
h
]));
f
.
length
&&
b
.
push
(
f
),
location
.
hash
=
b
.
join
(
"&"
)}}})}}
if
(
e
.
footable
===
undefined
||
null
===
e
.
foobox
)
throw
Error
(
"Please check and make sure footable.js is included in the page and is loaded prior to this script."
);
var
n
=
{
bookmarkable
:{
enabled
:
!
1
}};
e
.
footable
.
plugins
.
register
(
o
,
n
)})(
jQuery
,
window
);
\ No newline at end of file
resources/views/addOrder.blade.php
View file @
8f593127
...
...
@@ -7,8 +7,11 @@
<title>
订单管理后台 | {{ $title }}
</title>
<script>
document
.
domain
=
"{{ Config::get('website.domain') }}"
;
</script>
@include('addOffline.css')
@include('addOffline.js')
<link
href=
"/js/layui/css/layui.css"
rel=
"stylesheet"
>
<link
href=
"/css/admin.css"
rel=
"stylesheet"
>
@include('table.css')
<script
src=
"/js/jquery-2.2.1.js"
></script>
</head>
<body
class=
"body-small"
>
...
...
@@ -21,16 +24,23 @@
<div
class=
"wrapper"
>
@include('layouts.header')
<div
class=
"page-content"
>
<div
class=
"page-content"
style=
"margin-top: 10px;"
>
<div
class=
"ibox float-e-margins"
>
<div
class=
"ibox-content"
>
@include('addOrder.content')
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@include('table.js')
<script
src=
"/js/layui/layui.js"
></script>
<script
src=
"/js/web/common.js"
></script>
<script
src=
"/js/add_order.js"
></script>
</div>
</body>
resources/views/addOrder/content.blade.php
View file @
8f593127
<style>
.user-info
h4
{
line-height
:
30px
;
border-bottom
:
1px
dotted
#ccc
;
}
<style
type=
"text/css"
>
.addOrder
.layui-colla-title
{
margin-top
:
0px
;
margin-bottom
:
0px
;
}
.invoice-section
{
border
:
1px
solid
#ccc
;
}
.invoice-section
label
{
width
:
110px
;
}
.invoice-section
span
{
line-height
:
35px
;
}
</style>
<form>
<div
class=
"ibox-title"
style=
"border-top:0;"
>
<h3>
客户信息
</h3>
</div>
<div
class=
"ibox-content create-order"
>
<div
class=
"row"
style=
"margin-bottom: 30px;"
>
<div
class=
"col-sm-12"
>
<input
type=
"text"
class=
"search-user"
name=
"user-mobile"
value=
"{{ $crm_account }}"
placeholder=
"请输入会员账号"
>
<a
class=
"btn btn-info get-user"
>
获取用户信息
</a>
<span>
快捷入口:
<a
href=
"{{Config('website.add-user-url')}}"
target=
"_blank"
style=
"margin-right: 10px;"
>
新增用户账号
</a>
<a
href=
"{{Config('website.check-user-url')}}"
target=
"_blank"
>
查询/编辑用户账号
</a>
</span>
</div>
</div>
<div
class=
"user-info"
>
<div
class=
"account-info"
>
<h4>
账户信息
</h4>
<input
type=
"hidden"
name=
"user_id"
class=
"user_id"
value=
""
>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
会员账号:
</span>
<span
class=
"user-mobile"
></span>
</div>
</div>
<div
class=
"layui-collapse addOrder"
>
<form
class=
"layui-form layui-box quoteForm"
method=
"post"
>
<div
class=
"layui-colla-item"
>
<h2
class=
"layui-colla-title"
>
客户信息
</h2>
<div
class=
"layui-colla-content layui-show"
>
<div
class=
"layui-row"
>
<div
class=
"layui-col-xs6 layui-col-sm6 layui-col-md6"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
开票方式:
</label>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
密码:
</span>
<span>
******
</span>
<div
class=
"layui-input-block"
>
<input
type=
"radio"
class=
"radio-invoice-type"
name=
"invoice_type"
value=
"2"
title=
"个人"
>
<input
type=
"radio"
class=
"radio-invoice-type"
name=
"invoice_type"
value=
"3"
title=
"增值税专用发票"
>
<input
type=
"radio"
class=
"radio-invoice-type"
name=
"invoice_type"
value=
"4"
title=
"增值税普通发票"
>
<input
type=
"radio"
class=
"radio-invoice-type"
name=
"invoice_type"
value=
""
title=
"不开发票"
>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
测试账号:
</span>
<span
class=
"user-test"
></span>
</div>
</div>
</div>
</div>
<div
class=
"express-info"
>
<h4>
快递信息
<span
class=
"title-tips"
><i
class=
"fa fa-info-circle"
></i>
必须在下单前填写快递信息
</span></h4>
<input
type=
"hidden"
name=
"address_id"
class=
"address_id"
value=
""
>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
收货方式:
</span>
<span>
快递上门
</span>
</div>
</div>
<div
class=
"layui-row"
>
<div
class=
"layui-col-xs6 layui-col-sm6 layui-col-md6"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
发票/公司:
</label>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span><i
class=
"text-danger"
>
*
</i>
选择收货地址:
</span>
<select
name=
"address"
id=
"address"
>
</select>
<div
class=
"layui-input-inline"
>
<input
type=
"text"
name=
"com_name"
required
lay-verify=
""
placeholder=
"请输入公司"
autocomplete=
"off"
class=
"layui-input"
>
</div>
</div>
</div>
<div
class=
"address-content"
>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
联系人:
</span>
<span
class=
"address-consignee"
></span>
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
联系电话:
</span>
<span
class=
"address-mobile"
></span>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
收货地址:
</span>
<span
class=
"address-detail"
></span>
</div>
</div>
<div
class=
"layui-row"
>
<div
class=
"layui-col-xs6 layui-col-sm6 layui-col-md6"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
联系方式:
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"text"
name=
"account"
required
lay-verify=
"required"
placeholder=
"请输入联系方式"
autocomplete=
"off"
class=
"layui-input account"
>
</div>
</div>
</div>
<div
class=
"shipping-info"
>
<h4>
发货方式
<span
class=
"title-tips"
><i
class=
"fa fa-info-circle"
></i>
现货发货创建的自营通知单,账户为原客户账户,公司和原客户地址; 拼单发货创建的自营通知单,账户为15011111111,猎芯公司以及星火仓的地址
</span></h4>
<div
class=
"layui-col-xs6 layui-col-sm6 layui-col-md6"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
联系人:
</label>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span><i
class=
"text-danger"
>
*
</i>
选择发货方式:
</span>
<select
name=
"zy_delivery_type"
class=
"zy_delivery_type"
>
<option
value=
""
>
请选择
</option>
<option
value=
"1"
>
现货发货
</option>
<option
value=
"2"
>
拼单发货
</option>
</select>
<div
class=
"layui-input-inline"
>
<input
type=
"text"
name=
"user_name"
required
lay-verify=
""
placeholder=
"请输入联系人"
autocomplete=
"off"
class=
"layui-input"
>
</div>
</div>
</div>
</div>
<div
class=
"invoice-info"
>
<h4>
发票信息
<span
class=
"title-tips"
><i
class=
"fa fa-info-circle"
></i>
可在订单中心完善发票信息,需要在订单审核通过前填写发票信息,否则无法同步至ERP
</span></h4>
<!-- 与开票方式联动展示 -->
<div
class=
"invoice-section"
>
<!-- 个人 -->
<div
class=
"invoice-section-2"
>
<input
type=
"hidden"
name=
"tax_id"
class=
"tax_id"
value=
""
>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
发票类型:
</span>
<label
class=
"radio-inline"
>
<input
type=
"radio"
name=
"inv_type"
class=
"radio-inv-type"
value=
"2"
>
个人
</label>
<label
class=
"radio-inline"
>
<input
type=
"radio"
name=
"inv_type"
class=
"radio-inv-type"
value=
"3"
>
增值税专用发票
</label>
<label
class=
"radio-inline"
>
<input
type=
"radio"
name=
"inv_type"
class=
"radio-inv-type"
value=
"4"
>
增值税普通发票
</label>
<label
class=
"radio-inline"
>
<input
type=
"radio"
name=
"inv_type"
class=
"radio-inv-type"
value=
""
>
不开发票
</label>
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
选择发票信息:
</span>
<select
name=
"invoice"
id=
"invoice"
>
<option
value=
""
>
请选择
</option>
</select>
<!-- 增值税专用发票展示信息 -->
<div
class=
"invoice-section-3"
>
<div
class=
"layui-row"
>
<div
class=
"layui-col-xs4 layui-col-sm4 layui-col-md4"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
发票抬头:
</label>
<span>
xxxxxx
</span>
</div>
</div>
<div
class=
"layui-col-xs4 layui-col-sm4 layui-col-md4"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
开户银行:
</label>
<span>
xxxxxx
</span>
</div>
<div
class=
"invoice-content"
>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
发票抬头:
</span>
<span
class=
"tax_title"
></span>
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
税务登记号:
</span>
<span
class=
"tax_no"
></span>
<div
class=
"layui-col-xs4 layui-col-sm4 layui-col-md4"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
收票人:
</label>
<span>
xxxxxx
</span>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
银行卡号:
</span>
<span
class=
"bank_account"
></span>
<div
class=
"layui-row"
>
<div
class=
"layui-col-xs4 layui-col-sm4 layui-col-md4"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
税务登记号:
</label>
<span>
xxxxxx
</span>
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
开户银行:
</span>
<span
class=
"bank_name"
></span>
<div
class=
"layui-col-xs4 layui-col-sm4 layui-col-md4"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
银行卡号:
</label>
<span>
xxxxxx
</span>
</div>
</div>
<div
class=
"layui-col-xs4 layui-col-sm4 layui-col-md4"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
发票联系电话:
</label>
<span>
xxxxxx
</span>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
公司电话:
</span>
<span
class=
"company_phone"
></span>
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
公司注册地址:
</span>
<span
class=
"company_address"
></span>
<div
class=
"layui-row"
>
<div
class=
"layui-col-xs4 layui-col-sm4 layui-col-md4"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
公司电话:
</label>
<span>
xxxxxx
</span>
</div>
</div>
<div
class=
"layui-col-xs4 layui-col-sm4 layui-col-md4"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
公司注册地址:
</label>
<span>
xxxxxx
</span>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
联系人:
</span>
<span
class=
"consignee"
></span>
</div>
<div
class=
"layui-col-xs4 layui-col-sm4 layui-col-md4"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
收票地址:
</label>
<span>
xxxxxx
</span>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
联系电话:
</span>
<span
class=
"consignee_phone"
></span>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
收货地址:
</span>
<span
class=
"consignee_address"
></span>
<!-- 增值税普通发票展示信息 -->
<div
class=
"invoice-section-4"
>
<div
class=
"layui-row"
>
<div
class=
"layui-col-xs4 layui-col-sm4 layui-col-md4"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
发票抬头:
</label>
<span>
xxxxxx
</span>
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
发票类型:
</span>
<span
class=
"inv_type"
></span>
<div
class=
"layui-col-xs4 layui-col-sm4 layui-col-md4"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
税务登记号:
</label>
<span>
xxxxxx
</span>
</div>
</div>
</div>
</div>
</div>
<div
class=
"delivery-info"
>
<h4>
交货信息
</h4>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
交货地址:
</span>
<label
class=
"radio-inline"
>
<input
type=
"radio"
name=
"delivery_place"
class=
"delivery_place"
value=
"1"
checked=
"checked"
>
大陆
</label>
<label
class=
"radio-inline"
>
<input
type=
"radio"
name=
"delivery_place"
class=
"delivery_place"
value=
"2"
>
香港
</label>
</div>
</div>
</div>
</div>
<style>
.client-info
input
{
width
:
300px
;
}
.customer_type
{
width
:
30%
;
}
.product_use_classone_sn
,
.product_use_classtwo_sn
{
float
:
left
;
width
:
30%
;
}
</style>
<div
class=
"client-info form-horizontal"
>
<h4>
终端客户信息
<span
class=
"title-tips"
><i
class=
"fa fa-info-circle"
></i>
digikey渠道商品必填,其他渠道可不填写
</span></h4>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
><i
class=
"text-danger"
>
*
</i>
终端中文名称:
</label>
<div
class=
"col-sm-10"
>
<input
type=
"text"
class=
"form-control customer_cn"
name=
"customer_cn"
value=
""
autocomplete=
"off"
>
</div>
</div>
</div>
<div
class=
"layui-colla-item"
>
<h2
class=
"layui-colla-title"
>
收货信息
</h2>
<div
class=
"layui-colla-content layui-show"
>
<div
class=
"layui-row"
>
<div
class=
"layui-col-xs6 layui-col-sm6 layui-col-md6"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
发货方式:
</label>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
><i
class=
"text-danger"
>
*
</i>
客户类型:
</label>
<div
class=
"col-sm-10"
>
<select
class=
"form-control customer_type"
name=
"customer_type"
>
<option
value=
""
>
请选择
</option>
@if (Config('params.end_user_type'))
@foreach (Config('params.end_user_type') as $k => $v)
<option
value=
"{{ $k }}"
>
{{ $v }}
</option>
@endforeach
@endif
<div
class=
"layui-input-inline"
>
<select
name=
"zy_delivery_type"
class=
"zy_delivery_type"
lay-verify=
"required"
>
<option
value=
""
></option>
<option
value=
"1"
>
现货发货
</option>
<option
value=
"2"
>
拼单发货
</option>
</select>
</div>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
><i
class=
"text-danger"
>
*
</i>
终端英文名称:
</label>
<div
class=
"col-sm-10"
>
<input
type=
"text"
class=
"customer_en"
name=
"customer_en"
value=
""
autocomplete=
"off"
>
<a
href=
"https://translate.google.cn/"
target=
"_blank"
>
谷歌翻译
</a>
</div>
</div>
</div>
<div
class=
"layui-row"
>
<div
class=
"layui-col-xs6 layui-col-sm6 layui-col-md6"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
销售组织:
</label>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
><i
class=
"text-danger"
>
*
</i>
产品用途:
</label>
<div
class=
"col-sm-10"
>
<select
class=
"form-control product_use_classone_sn"
name=
"product_use_classone_sn"
>
<option
value=
""
>
请选择
</option>
<div
class=
"layui-input-inline"
>
<select
name=
"city"
lay-verify=
"required"
>
<option
value=
""
></option>
<option
value=
"1"
>
现货发货
</option>
<option
value=
"2"
>
拼单发货
</option>
</select>
<select
class=
"form-control product_use_classtwo_sn"
name=
"product_use_classtwo_sn"
></select>
</div>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
><i
class=
"text-danger"
>
*
</i>
客户网址:
</label>
<div
class=
"col-sm-10"
>
<input
type=
"text"
class=
"customer_website"
name=
"customer_website"
value=
""
autocomplete=
"off"
>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"ibox-title"
>
<h3>
商品信息
</h3>
</div>
<div
class=
"ibox-content create-order"
>
<div
class=
"row"
>
<div
class=
"col-sm-12"
>
<input
type=
"text"
class=
"search-sku"
name=
"sku_id"
value=
""
placeholder=
"请输入SKUID"
>
<a
class=
"btn btn-info get-sku"
>
获取SKU信息
</a>
<span>
快捷入口:
<a
href=
"{{Config('website.add-sku-url')}}"
target=
"_blank"
style=
"margin-right: 10px;"
>
+新增SKU
</a>
<a
href=
"{{Config('website.search-sku-url-1')}}"
target=
"_blank"
style=
"margin-right: 10px;"
>
查询联营SKU
</a>
<a
href=
"{{Config('website.search-sku-url-2')}}"
target=
"_blank"
>
查询自营SKU
</a>
</span>
<div
class=
"batch-btn"
>
<a
class=
"btn btn-success goods_import"
data-type=
"1"
>
批量导入物料
</a>
<a
class=
"btn btn-info"
href=
"https://img.ichunt.com/doc/excel/template/%E8%81%94%E8%90%A5%E6%89%B9%E9%87%8F%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.xlsx"
>
联营物料模板下载
</a>
</div>
</div>
</div>
<!-- SKU信息 -->
<div
class=
"sku-info"
>
<h4>
型号信息
</h4>
<div
class=
"sku-info-left"
>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
SKU型号:
</span>
<span
class=
"goods_name"
></span>
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
制造商:
</span>
<span
class=
"brand_name"
></span>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
供应商:
</span>
<span
class=
"supplier_name"
></span>
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
库存数量:
</span>
<span
class=
"stock"
></span>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
起订量:
</span>
<span
class=
"moq"
></span>
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
标准包装量:
</span>
<span
class=
"mpq"
></span>
</div>
</div>
</div>
<div
class=
"layui-col-xs6 layui-col-sm6 layui-col-md6"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
交货地:
</label>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
是否能购买:
</span>
<span
class=
"status"
></span>
</div>
</div>
</div>
</div>
<div
class=
"sku-info-right table-responsive"
>
<table
class=
"table table-hover ladder_price_table"
>
<!-- <tr>
<th>阶梯</th>
<th>RMB价格</th>
<th>USD价格</th>
</tr> -->
</table>
</div>
<input
type=
"hidden"
name=
"goods_id"
class=
"goods_id"
value=
""
>
<input
type=
"hidden"
name=
"goods_type"
class=
"goods_type"
value=
""
>
<div
class=
"clear"
></div>
<a
class=
"btn btn-success add-to-lists"
>
添加至商品列表
</a>
<div
class=
"layui-input-inline"
>
<select
name=
"city"
lay-verify=
"required"
>
<option
value=
""
></option>
<option
value=
"1"
>
大陆
</option>
<option
value=
"2"
>
香港
</option>
</select>
</div>
<!-- 商品列表 -->
<style>
.shop-table
tbody
tr
td
{
word-break
:
break-all
;
}
</style>
<div
class=
"shop-lists table-responsive"
>
<table
class=
"table table-bordered table-hover shop-table"
>
<thead>
<tr>
<th
width=
"4%"
>
序号
</th>
<th
width=
"10%"
>
SKUID
</th>
<th
width=
"10%"
>
商品名称
</th>
<th
width=
"10%"
>
制造商
</th>
<th
width=
"10%"
>
标准品牌
</th>
<th
width=
"4%"
>
倍数
</th>
<th
width=
"8%"
>
采购数量
</th>
<th
width=
"7%"
>
采购单价
</th>
<th
width=
"7%"
>
小计
</th>
<th
width=
"7%"
>
货期
</th>
<th
width=
"6%"
>
供应商
</th>
<th
width=
"6%"
>
采购员
</th>
<th
width=
"7%"
>
批次
</th>
<th
width=
"5%"
>
操作
</th>
</tr>
</thead>
<tbody></tbody>
</table>
<textarea
name=
"remark"
id=
"remark"
class=
"form-control"
placeholder=
"填写订单备注信息"
></textarea>
</div>
</div>
<div
class=
"order-gift-info"
>
<div
class=
"ibox-title"
>
<h3>
赠品信息
</h3>
</div>
<div
class=
"ibox-content"
>
<table
class=
"table table-bordered table-hover gift-table"
>
<thead>
<tr>
<th
width=
"10%"
>
活动ID
</th>
<th
width=
"20%"
>
赠品图片
</th>
<th
width=
"20%"
>
赠品名称
</th>
<th
width=
"20%"
>
赠品数量
</th>
<th
width=
"30%"
>
赠品说明
</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
<div
class=
"order-info"
>
<div
class=
"ibox-title"
>
<h3>
订单信息
</h3>
</div>
<div
class=
"ibox-content"
>
<div
class=
"row"
>
<p
class=
"con-title"
><span>
商品总额:
</span></p>
<p
class=
"con-val goods_amount_val"
></p>
</div>
<div
class=
"row"
>
<input
type=
"hidden"
class=
"user_coupon_id"
name=
"user_coupon_id"
value=
""
>
<p
class=
"con-title"
><span
style=
"margin-top: 5px;"
>
选择优惠券:
</span></p>
<p
class=
"con-val"
>
<select
name=
"user_coupon"
id=
"user_coupon"
>
<option
value=
""
>
请选择
</option>
</select>
</p>
</div>
<div
class=
"row preferential_price"
>
<p
class=
"con-title"
><span>
优惠金额:
</span></p>
<p
class=
"con-val preferential_price_val"
>
0.00
</p>
</div>
<div
class=
"layui-colla-item"
>
<h2
class=
"layui-colla-title"
>
商品信息
</h2>
<div
class=
"layui-colla-content layui-show"
>
<div
class=
"row extend_fee"
>
<p
class=
"con-title"
><span>
附加费:
</span></p>
<p
class=
"con-val extend_fee_val"
>
0.00
</p>
</div>
<div
class=
"row"
>
<p
class=
"con-title"
><span>
运费:
</span></p>
<p
class=
"con-val express_fee_val"
>
0.00
</p>
</div>
<div
class=
"row"
>
<p
class=
"con-title"
><span>
应付金额:
</span></p>
<p
class=
"con-val text-danger order_amount"
></p>
</div>
</div>
</div>
<div
class=
"ibox-title"
style=
"text-align: right;"
>
<a
class=
"btn btn-success submit-order"
data-type=
"1"
>
提交
</a>
</div>
</form>
@include('common.selectBrand')
<script>
var
sale_id
=
"{{$sale_id}}"
;
var
URL_api
=
"{{Config('website.api_domain')}}"
;
var
role
=
"{{ $role }}"
;
window
.
api_dgk_url_text
=
"
<?php
echo
$api_dgk_url
;
?>
"
setTimeout
(
function
(){
$
.
get
(
window
.
api_dgk_url_text
,
function
(
data
){
window
.
data
=
data
.
data
.
data
console
.
log
(
window
.
data
)
var
product
=
Object
.
keys
(
window
.
data
);
// 获取一级分类
var
product_len
=
Object
.
keys
(
window
.
data
).
length
for
(
var
i
=
0
;
i
<
product_len
;
i
++
){
$
(
'.product_use_classone_sn'
).
append
(
'
<
option
value
=
"'+i+'"
>
'+product[i]+'
<
/option>'
)
}
},
'json'
)
},
10
)
$
(
document
).
on
(
'change'
,
'.product_use_classone_sn'
,
function
(
data
){
var
select_key
=
$
(
'.product_use_classone_sn option:selected'
).
text
();
$
(
'.product_use_classtwo_sn'
).
html
(
''
);
for
(
let
key
in
window
.
data
){
if
(
key
==
select_key
){
// console.log(window.data[key])
for
(
var
i
=
0
;
i
<
window
.
data
[
key
].
length
;
i
++
){
$
(
'.product_use_classtwo_sn'
).
append
(
'
<
option
value
=
"'+i+'"
>
'+window.data[key][i]+'
<
/option>'
)
}
}
}
})
$
.
lie
.
add_order
.
lyorder
();
// $.lie.standardBrand.index();
</script>
\ No newline at end of file
</form>
</div>
\ No newline at end of file
resources/views/addOrder/content1.blade.php
0 → 100644
View file @
8f593127
<style>
.user-info
h4
{
line-height
:
30px
;
border-bottom
:
1px
dotted
#ccc
;
}
</style>
<form>
<div
class=
"ibox-title"
>
<sapn>
开票方式:
</span>
<label
class=
"radio-inline"
>
<input
type=
"radio"
name=
"invoice_type"
class=
"radio-invoice-type"
value=
"2"
>
个人
</label>
<label
class=
"radio-inline"
>
<input
type=
"radio"
name=
"invoice_type"
class=
"radio-invoice-type"
value=
"3"
>
增值税专用发票
</label>
<label
class=
"radio-inline"
>
<input
type=
"radio"
name=
"invoice_type"
class=
"radio-invoice-type"
value=
"4"
>
增值税普通发票
</label>
<label
class=
"radio-inline"
>
<input
type=
"radio"
name=
"invoice_type"
class=
"radio-invoice-type"
value=
""
>
不开发票
</label>
</div>
<div
class=
"ibox-title"
style=
"border-top:0;"
>
<h3>
客户信息
</h3>
</div>
<div
class=
"ibox-content"
>
<div
class=
"row"
>
<div
class=
"col-sm-12"
>
<span>
发票/公司:
</span>
<input
type=
"text"
name=
"com_name"
value=
""
class=
"com_name"
>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<span>
联系方式:
</span>
<input
type=
"text"
name=
"account"
value=
""
class=
"account"
>
</div>
<div
class=
"col-sm-6"
>
<span>
联系人:
</span>
<input
type=
"text"
name=
"user_name"
value=
""
class=
"user_name"
>
</div>
</div>
</div>
<div
class=
"ibox-content create-order"
>
<div
class=
"row"
style=
"margin-bottom: 30px;"
>
<div
class=
"col-sm-12"
>
<input
type=
"text"
class=
"search-user"
name=
"user-mobile"
value=
"{{ $crm_account }}"
placeholder=
"请输入会员账号"
>
<a
class=
"btn btn-info get-user"
>
获取用户信息
</a>
<span>
快捷入口:
<a
href=
"{{Config('website.add-user-url')}}"
target=
"_blank"
style=
"margin-right: 10px;"
>
新增用户账号
</a>
<a
href=
"{{Config('website.check-user-url')}}"
target=
"_blank"
>
查询/编辑用户账号
</a>
</span>
</div>
</div>
<div
class=
"user-info"
>
<div
class=
"account-info"
>
<h4>
账户信息
</h4>
<input
type=
"hidden"
name=
"user_id"
class=
"user_id"
value=
""
>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
会员账号:
</span>
<span
class=
"user-mobile"
></span>
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
密码:
</span>
<span>
******
</span>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
测试账号:
</span>
<span
class=
"user-test"
></span>
</div>
</div>
</div>
</div>
<div
class=
"express-info"
>
<h4>
快递信息
<span
class=
"title-tips"
><i
class=
"fa fa-info-circle"
></i>
必须在下单前填写快递信息
</span></h4>
<input
type=
"hidden"
name=
"address_id"
class=
"address_id"
value=
""
>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
收货方式:
</span>
<span>
快递上门
</span>
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span><i
class=
"text-danger"
>
*
</i>
选择收货地址:
</span>
<select
name=
"address"
id=
"address"
>
</select>
</div>
</div>
</div>
<div
class=
"address-content"
>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
联系人:
</span>
<span
class=
"address-consignee"
></span>
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
联系电话:
</span>
<span
class=
"address-mobile"
></span>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
收货地址:
</span>
<span
class=
"address-detail"
></span>
</div>
</div>
</div>
</div>
</div>
<div
class=
"shipping-info"
>
<h4>
发货方式
<span
class=
"title-tips"
><i
class=
"fa fa-info-circle"
></i>
现货发货创建的自营通知单,账户为原客户账户,公司和原客户地址; 拼单发货创建的自营通知单,账户为15011111111,猎芯公司以及星火仓的地址
</span></h4>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span><i
class=
"text-danger"
>
*
</i>
选择发货方式:
</span>
<select
name=
"zy_delivery_type"
class=
"zy_delivery_type"
>
<option
value=
""
>
请选择
</option>
<option
value=
"1"
>
现货发货
</option>
<option
value=
"2"
>
拼单发货
</option>
</select>
</div>
</div>
</div>
</div>
<div
class=
"invoice-info"
>
<h4>
发票信息
<span
class=
"title-tips"
><i
class=
"fa fa-info-circle"
></i>
可在订单中心完善发票信息,需要在订单审核通过前填写发票信息,否则无法同步至ERP
</span></h4>
<input
type=
"hidden"
name=
"tax_id"
class=
"tax_id"
value=
""
>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
发票类型:
</span>
<label
class=
"radio-inline"
>
<input
type=
"radio"
name=
"inv_type"
class=
"radio-inv-type"
value=
"2"
>
个人
</label>
<label
class=
"radio-inline"
>
<input
type=
"radio"
name=
"inv_type"
class=
"radio-inv-type"
value=
"3"
>
增值税专用发票
</label>
<label
class=
"radio-inline"
>
<input
type=
"radio"
name=
"inv_type"
class=
"radio-inv-type"
value=
"4"
>
增值税普通发票
</label>
<label
class=
"radio-inline"
>
<input
type=
"radio"
name=
"inv_type"
class=
"radio-inv-type"
value=
""
>
不开发票
</label>
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
选择发票信息:
</span>
<select
name=
"invoice"
id=
"invoice"
>
<option
value=
""
>
请选择
</option>
</select>
</div>
</div>
</div>
<div
class=
"invoice-content"
>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
发票抬头:
</span>
<span
class=
"tax_title"
></span>
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
税务登记号:
</span>
<span
class=
"tax_no"
></span>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
银行卡号:
</span>
<span
class=
"bank_account"
></span>
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
开户银行:
</span>
<span
class=
"bank_name"
></span>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
公司电话:
</span>
<span
class=
"company_phone"
></span>
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
公司注册地址:
</span>
<span
class=
"company_address"
></span>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
联系人:
</span>
<span
class=
"consignee"
></span>
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
联系电话:
</span>
<span
class=
"consignee_phone"
></span>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
收货地址:
</span>
<span
class=
"consignee_address"
></span>
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
发票类型:
</span>
<span
class=
"inv_type"
></span>
</div>
</div>
</div>
</div>
</div>
<div
class=
"delivery-info"
>
<h4>
交货信息
</h4>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
交货地址:
</span>
<label
class=
"radio-inline"
>
<input
type=
"radio"
name=
"delivery_place"
class=
"delivery_place"
value=
"1"
checked=
"checked"
>
大陆
</label>
<label
class=
"radio-inline"
>
<input
type=
"radio"
name=
"delivery_place"
class=
"delivery_place"
value=
"2"
>
香港
</label>
</div>
</div>
</div>
</div>
<style>
.client-info
input
{
width
:
300px
;
}
.customer_type
{
width
:
30%
;
}
.product_use_classone_sn
,
.product_use_classtwo_sn
{
float
:
left
;
width
:
30%
;
}
</style>
<div
class=
"client-info form-horizontal"
>
<h4>
终端客户信息
<span
class=
"title-tips"
><i
class=
"fa fa-info-circle"
></i>
digikey渠道商品必填,其他渠道可不填写
</span></h4>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
><i
class=
"text-danger"
>
*
</i>
终端中文名称:
</label>
<div
class=
"col-sm-10"
>
<input
type=
"text"
class=
"form-control customer_cn"
name=
"customer_cn"
value=
""
autocomplete=
"off"
>
</div>
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
><i
class=
"text-danger"
>
*
</i>
客户类型:
</label>
<div
class=
"col-sm-10"
>
<select
class=
"form-control customer_type"
name=
"customer_type"
>
<option
value=
""
>
请选择
</option>
@if (Config('params.end_user_type'))
@foreach (Config('params.end_user_type') as $k => $v)
<option
value=
"{{ $k }}"
>
{{ $v }}
</option>
@endforeach
@endif
</select>
</div>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
><i
class=
"text-danger"
>
*
</i>
终端英文名称:
</label>
<div
class=
"col-sm-10"
>
<input
type=
"text"
class=
"customer_en"
name=
"customer_en"
value=
""
autocomplete=
"off"
>
<a
href=
"https://translate.google.cn/"
target=
"_blank"
>
谷歌翻译
</a>
</div>
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
><i
class=
"text-danger"
>
*
</i>
产品用途:
</label>
<div
class=
"col-sm-10"
>
<select
class=
"form-control product_use_classone_sn"
name=
"product_use_classone_sn"
>
<option
value=
""
>
请选择
</option>
</select>
<select
class=
"form-control product_use_classtwo_sn"
name=
"product_use_classtwo_sn"
></select>
</div>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
><i
class=
"text-danger"
>
*
</i>
客户网址:
</label>
<div
class=
"col-sm-10"
>
<input
type=
"text"
class=
"customer_website"
name=
"customer_website"
value=
""
autocomplete=
"off"
>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"ibox-title"
>
<h3>
商品信息
</h3>
</div>
<div
class=
"ibox-content create-order"
>
<div
class=
"row"
>
<div
class=
"col-sm-12"
>
<input
type=
"text"
class=
"search-sku"
name=
"sku_id"
value=
""
placeholder=
"请输入SKUID"
>
<a
class=
"btn btn-info get-sku"
>
获取SKU信息
</a>
<span>
快捷入口:
<a
href=
"{{Config('website.add-sku-url')}}"
target=
"_blank"
style=
"margin-right: 10px;"
>
+新增SKU
</a>
<a
href=
"{{Config('website.search-sku-url-1')}}"
target=
"_blank"
style=
"margin-right: 10px;"
>
查询联营SKU
</a>
<a
href=
"{{Config('website.search-sku-url-2')}}"
target=
"_blank"
>
查询自营SKU
</a>
</span>
<div
class=
"batch-btn"
>
<a
class=
"btn btn-success goods_import"
data-type=
"1"
>
批量导入物料
</a>
<a
class=
"btn btn-info"
href=
"https://img.ichunt.com/doc/excel/template/%E8%81%94%E8%90%A5%E6%89%B9%E9%87%8F%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.xlsx"
>
联营物料模板下载
</a>
</div>
</div>
</div>
<!-- SKU信息 -->
<div
class=
"sku-info"
>
<h4>
型号信息
</h4>
<div
class=
"sku-info-left"
>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
SKU型号:
</span>
<span
class=
"goods_name"
></span>
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
制造商:
</span>
<span
class=
"brand_name"
></span>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
供应商:
</span>
<span
class=
"supplier_name"
></span>
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
库存数量:
</span>
<span
class=
"stock"
></span>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
起订量:
</span>
<span
class=
"moq"
></span>
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
标准包装量:
</span>
<span
class=
"mpq"
></span>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
是否能购买:
</span>
<span
class=
"status"
></span>
</div>
</div>
</div>
</div>
<div
class=
"sku-info-right table-responsive"
>
<table
class=
"table table-hover ladder_price_table"
>
<!-- <tr>
<th>阶梯</th>
<th>RMB价格</th>
<th>USD价格</th>
</tr> -->
</table>
</div>
<input
type=
"hidden"
name=
"goods_id"
class=
"goods_id"
value=
""
>
<input
type=
"hidden"
name=
"goods_type"
class=
"goods_type"
value=
""
>
<div
class=
"clear"
></div>
<a
class=
"btn btn-success add-to-lists"
>
添加至商品列表
</a>
</div>
<!-- 商品列表 -->
<style>
.shop-table
tbody
tr
td
{
word-break
:
break-all
;
}
</style>
<div
class=
"shop-lists table-responsive"
>
<table
class=
"table table-bordered table-hover shop-table"
>
<thead>
<tr>
<th
width=
"4%"
>
序号
</th>
<th
width=
"10%"
>
SKUID
</th>
<th
width=
"10%"
>
商品名称
</th>
<th
width=
"10%"
>
制造商
</th>
<th
width=
"10%"
>
标准品牌
</th>
<th
width=
"4%"
>
倍数
</th>
<th
width=
"8%"
>
采购数量
</th>
<th
width=
"7%"
>
采购单价
</th>
<th
width=
"7%"
>
小计
</th>
<th
width=
"7%"
>
货期
</th>
<th
width=
"6%"
>
供应商
</th>
<th
width=
"6%"
>
采购员
</th>
<th
width=
"7%"
>
批次
</th>
<th
width=
"5%"
>
操作
</th>
</tr>
</thead>
<tbody></tbody>
</table>
<textarea
name=
"remark"
id=
"remark"
class=
"form-control"
placeholder=
"填写订单备注信息"
></textarea>
</div>
</div>
<div
class=
"order-gift-info"
>
<div
class=
"ibox-title"
>
<h3>
赠品信息
</h3>
</div>
<div
class=
"ibox-content"
>
<table
class=
"table table-bordered table-hover gift-table"
>
<thead>
<tr>
<th
width=
"10%"
>
活动ID
</th>
<th
width=
"20%"
>
赠品图片
</th>
<th
width=
"20%"
>
赠品名称
</th>
<th
width=
"20%"
>
赠品数量
</th>
<th
width=
"30%"
>
赠品说明
</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
<div
class=
"order-info"
>
<div
class=
"ibox-title"
>
<h3>
订单信息
</h3>
</div>
<div
class=
"ibox-content"
>
<div
class=
"row"
>
<p
class=
"con-title"
><span>
商品总额:
</span></p>
<p
class=
"con-val goods_amount_val"
></p>
</div>
<div
class=
"row"
>
<input
type=
"hidden"
class=
"user_coupon_id"
name=
"user_coupon_id"
value=
""
>
<p
class=
"con-title"
><span
style=
"margin-top: 5px;"
>
选择优惠券:
</span></p>
<p
class=
"con-val"
>
<select
name=
"user_coupon"
id=
"user_coupon"
>
<option
value=
""
>
请选择
</option>
</select>
</p>
</div>
<div
class=
"row preferential_price"
>
<p
class=
"con-title"
><span>
优惠金额:
</span></p>
<p
class=
"con-val preferential_price_val"
>
0.00
</p>
</div>
<div
class=
"row extend_fee"
>
<p
class=
"con-title"
><span>
附加费:
</span></p>
<p
class=
"con-val extend_fee_val"
>
0.00
</p>
</div>
<div
class=
"row"
>
<p
class=
"con-title"
><span>
运费:
</span></p>
<p
class=
"con-val express_fee_val"
>
0.00
</p>
</div>
<div
class=
"row"
>
<p
class=
"con-title"
><span>
应付金额:
</span></p>
<p
class=
"con-val text-danger order_amount"
></p>
</div>
</div>
</div>
<div
class=
"ibox-title"
style=
"text-align: right;"
>
<a
class=
"btn btn-success submit-order"
data-type=
"1"
>
提交
</a>
</div>
</form>
@include('common.selectBrand')
<script>
var
sale_id
=
"{{$sale_id}}"
;
var
URL_api
=
"{{Config('website.api_domain')}}"
;
var
role
=
"{{ $role }}"
;
window
.
api_dgk_url_text
=
"
<?php
echo
$api_dgk_url
;
?>
"
setTimeout
(
function
(){
$
.
get
(
window
.
api_dgk_url_text
,
function
(
data
){
window
.
data
=
data
.
data
.
data
console
.
log
(
window
.
data
)
var
product
=
Object
.
keys
(
window
.
data
);
// 获取一级分类
var
product_len
=
Object
.
keys
(
window
.
data
).
length
for
(
var
i
=
0
;
i
<
product_len
;
i
++
){
$
(
'.product_use_classone_sn'
).
append
(
'
<
option
value
=
"'+i+'"
>
'+product[i]+'
<
/option>'
)
}
},
'json'
)
},
10
)
$
(
document
).
on
(
'change'
,
'.product_use_classone_sn'
,
function
(
data
){
var
select_key
=
$
(
'.product_use_classone_sn option:selected'
).
text
();
$
(
'.product_use_classtwo_sn'
).
html
(
''
);
for
(
let
key
in
window
.
data
){
if
(
key
==
select_key
){
// console.log(window.data[key])
for
(
var
i
=
0
;
i
<
window
.
data
[
key
].
length
;
i
++
){
$
(
'.product_use_classtwo_sn'
).
append
(
'
<
option
value
=
"'+i+'"
>
'+window.data[key][i]+'
<
/option>'
)
}
}
}
})
$
.
lie
.
add_order
.
lyorder
();
// $.lie.standardBrand.index();
</script>
\ No newline at end of file
resources/views/addOrder/content_bak.blade.php
0 → 100644
View file @
8f593127
<style>
.user-info
h4
{
line-height
:
30px
;
border-bottom
:
1px
dotted
#ccc
;
}
</style>
<form>
<div
class=
"ibox-title"
style=
"border-top:0;"
>
<h3>
客户信息
</h3>
</div>
<div
class=
"ibox-content create-order"
>
<div
class=
"row"
style=
"margin-bottom: 30px;"
>
<div
class=
"col-sm-12"
>
<input
type=
"text"
class=
"search-user"
name=
"user-mobile"
value=
"{{ $crm_account }}"
placeholder=
"请输入会员账号"
>
<a
class=
"btn btn-info get-user"
>
获取用户信息
</a>
<span>
快捷入口:
<a
href=
"{{Config('website.add-user-url')}}"
target=
"_blank"
style=
"margin-right: 10px;"
>
新增用户账号
</a>
<a
href=
"{{Config('website.check-user-url')}}"
target=
"_blank"
>
查询/编辑用户账号
</a>
</span>
</div>
</div>
<div
class=
"user-info"
>
<div
class=
"account-info"
>
<h4>
账户信息
</h4>
<input
type=
"hidden"
name=
"user_id"
class=
"user_id"
value=
""
>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
会员账号:
</span>
<span
class=
"user-mobile"
></span>
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
密码:
</span>
<span>
******
</span>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
测试账号:
</span>
<span
class=
"user-test"
></span>
</div>
</div>
</div>
</div>
<div
class=
"express-info"
>
<h4>
快递信息
<span
class=
"title-tips"
><i
class=
"fa fa-info-circle"
></i>
必须在下单前填写快递信息
</span></h4>
<input
type=
"hidden"
name=
"address_id"
class=
"address_id"
value=
""
>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
收货方式:
</span>
<span>
快递上门
</span>
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span><i
class=
"text-danger"
>
*
</i>
选择收货地址:
</span>
<select
name=
"address"
id=
"address"
>
</select>
</div>
</div>
</div>
<div
class=
"address-content"
>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
联系人:
</span>
<span
class=
"address-consignee"
></span>
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
联系电话:
</span>
<span
class=
"address-mobile"
></span>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
收货地址:
</span>
<span
class=
"address-detail"
></span>
</div>
</div>
</div>
</div>
</div>
<div
class=
"shipping-info"
>
<h4>
发货方式
<span
class=
"title-tips"
><i
class=
"fa fa-info-circle"
></i>
现货发货创建的自营通知单,账户为原客户账户,公司和原客户地址; 拼单发货创建的自营通知单,账户为15011111111,猎芯公司以及星火仓的地址
</span></h4>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span><i
class=
"text-danger"
>
*
</i>
选择发货方式:
</span>
<select
name=
"zy_delivery_type"
class=
"zy_delivery_type"
>
<option
value=
""
>
请选择
</option>
<option
value=
"1"
>
现货发货
</option>
<option
value=
"2"
>
拼单发货
</option>
</select>
</div>
</div>
</div>
</div>
<div
class=
"invoice-info"
>
<h4>
发票信息
<span
class=
"title-tips"
><i
class=
"fa fa-info-circle"
></i>
可在订单中心完善发票信息,需要在订单审核通过前填写发票信息,否则无法同步至ERP
</span></h4>
<input
type=
"hidden"
name=
"tax_id"
class=
"tax_id"
value=
""
>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
发票类型:
</span>
<label
class=
"radio-inline"
>
<input
type=
"radio"
name=
"inv_type"
class=
"radio-inv-type"
value=
"2"
>
个人
</label>
<label
class=
"radio-inline"
>
<input
type=
"radio"
name=
"inv_type"
class=
"radio-inv-type"
value=
"3"
>
增值税专用发票
</label>
<label
class=
"radio-inline"
>
<input
type=
"radio"
name=
"inv_type"
class=
"radio-inv-type"
value=
"4"
>
增值税普通发票
</label>
<label
class=
"radio-inline"
>
<input
type=
"radio"
name=
"inv_type"
class=
"radio-inv-type"
value=
""
>
不开发票
</label>
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
选择发票信息:
</span>
<select
name=
"invoice"
id=
"invoice"
>
<option
value=
""
>
请选择
</option>
</select>
</div>
</div>
</div>
<div
class=
"invoice-content"
>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
发票抬头:
</span>
<span
class=
"tax_title"
></span>
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
税务登记号:
</span>
<span
class=
"tax_no"
></span>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
银行卡号:
</span>
<span
class=
"bank_account"
></span>
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
开户银行:
</span>
<span
class=
"bank_name"
></span>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
公司电话:
</span>
<span
class=
"company_phone"
></span>
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
公司注册地址:
</span>
<span
class=
"company_address"
></span>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
联系人:
</span>
<span
class=
"consignee"
></span>
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
联系电话:
</span>
<span
class=
"consignee_phone"
></span>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
收货地址:
</span>
<span
class=
"consignee_address"
></span>
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
发票类型:
</span>
<span
class=
"inv_type"
></span>
</div>
</div>
</div>
</div>
</div>
<div
class=
"delivery-info"
>
<h4>
交货信息
</h4>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
交货地址:
</span>
<label
class=
"radio-inline"
>
<input
type=
"radio"
name=
"delivery_place"
class=
"delivery_place"
value=
"1"
checked=
"checked"
>
大陆
</label>
<label
class=
"radio-inline"
>
<input
type=
"radio"
name=
"delivery_place"
class=
"delivery_place"
value=
"2"
>
香港
</label>
</div>
</div>
</div>
</div>
<style>
.client-info
input
{
width
:
300px
;
}
.customer_type
{
width
:
30%
;
}
.product_use_classone_sn
,
.product_use_classtwo_sn
{
float
:
left
;
width
:
30%
;
}
</style>
<div
class=
"client-info form-horizontal"
>
<h4>
终端客户信息
<span
class=
"title-tips"
><i
class=
"fa fa-info-circle"
></i>
digikey渠道商品必填,其他渠道可不填写
</span></h4>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
><i
class=
"text-danger"
>
*
</i>
终端中文名称:
</label>
<div
class=
"col-sm-10"
>
<input
type=
"text"
class=
"form-control customer_cn"
name=
"customer_cn"
value=
""
autocomplete=
"off"
>
</div>
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
><i
class=
"text-danger"
>
*
</i>
客户类型:
</label>
<div
class=
"col-sm-10"
>
<select
class=
"form-control customer_type"
name=
"customer_type"
>
<option
value=
""
>
请选择
</option>
@if (Config('params.end_user_type'))
@foreach (Config('params.end_user_type') as $k => $v)
<option
value=
"{{ $k }}"
>
{{ $v }}
</option>
@endforeach
@endif
</select>
</div>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
><i
class=
"text-danger"
>
*
</i>
终端英文名称:
</label>
<div
class=
"col-sm-10"
>
<input
type=
"text"
class=
"customer_en"
name=
"customer_en"
value=
""
autocomplete=
"off"
>
<a
href=
"https://translate.google.cn/"
target=
"_blank"
>
谷歌翻译
</a>
</div>
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
><i
class=
"text-danger"
>
*
</i>
产品用途:
</label>
<div
class=
"col-sm-10"
>
<select
class=
"form-control product_use_classone_sn"
name=
"product_use_classone_sn"
>
<option
value=
""
>
请选择
</option>
</select>
<select
class=
"form-control product_use_classtwo_sn"
name=
"product_use_classtwo_sn"
></select>
</div>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
><i
class=
"text-danger"
>
*
</i>
客户网址:
</label>
<div
class=
"col-sm-10"
>
<input
type=
"text"
class=
"customer_website"
name=
"customer_website"
value=
""
autocomplete=
"off"
>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"ibox-title"
>
<h3>
商品信息
</h3>
</div>
<div
class=
"ibox-content create-order"
>
<div
class=
"row"
>
<div
class=
"col-sm-12"
>
<input
type=
"text"
class=
"search-sku"
name=
"sku_id"
value=
""
placeholder=
"请输入SKUID"
>
<a
class=
"btn btn-info get-sku"
>
获取SKU信息
</a>
<span>
快捷入口:
<a
href=
"{{Config('website.add-sku-url')}}"
target=
"_blank"
style=
"margin-right: 10px;"
>
+新增SKU
</a>
<a
href=
"{{Config('website.search-sku-url-1')}}"
target=
"_blank"
style=
"margin-right: 10px;"
>
查询联营SKU
</a>
<a
href=
"{{Config('website.search-sku-url-2')}}"
target=
"_blank"
>
查询自营SKU
</a>
</span>
<div
class=
"batch-btn"
>
<a
class=
"btn btn-success goods_import"
data-type=
"1"
>
批量导入物料
</a>
<a
class=
"btn btn-info"
href=
"https://img.ichunt.com/doc/excel/template/%E8%81%94%E8%90%A5%E6%89%B9%E9%87%8F%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.xlsx"
>
联营物料模板下载
</a>
</div>
</div>
</div>
<!-- SKU信息 -->
<div
class=
"sku-info"
>
<h4>
型号信息
</h4>
<div
class=
"sku-info-left"
>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
SKU型号:
</span>
<span
class=
"goods_name"
></span>
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
制造商:
</span>
<span
class=
"brand_name"
></span>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
供应商:
</span>
<span
class=
"supplier_name"
></span>
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
库存数量:
</span>
<span
class=
"stock"
></span>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
起订量:
</span>
<span
class=
"moq"
></span>
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
标准包装量:
</span>
<span
class=
"mpq"
></span>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"form-group"
>
<span>
是否能购买:
</span>
<span
class=
"status"
></span>
</div>
</div>
</div>
</div>
<div
class=
"sku-info-right table-responsive"
>
<table
class=
"table table-hover ladder_price_table"
>
<!-- <tr>
<th>阶梯</th>
<th>RMB价格</th>
<th>USD价格</th>
</tr> -->
</table>
</div>
<input
type=
"hidden"
name=
"goods_id"
class=
"goods_id"
value=
""
>
<input
type=
"hidden"
name=
"goods_type"
class=
"goods_type"
value=
""
>
<div
class=
"clear"
></div>
<a
class=
"btn btn-success add-to-lists"
>
添加至商品列表
</a>
</div>
<!-- 商品列表 -->
<style>
.shop-table
tbody
tr
td
{
word-break
:
break-all
;
}
</style>
<div
class=
"shop-lists table-responsive"
>
<table
class=
"table table-bordered table-hover shop-table"
>
<thead>
<tr>
<th
width=
"4%"
>
序号
</th>
<th
width=
"10%"
>
SKUID
</th>
<th
width=
"10%"
>
商品名称
</th>
<th
width=
"10%"
>
制造商
</th>
<th
width=
"10%"
>
标准品牌
</th>
<th
width=
"4%"
>
倍数
</th>
<th
width=
"8%"
>
采购数量
</th>
<th
width=
"7%"
>
采购单价
</th>
<th
width=
"7%"
>
小计
</th>
<th
width=
"7%"
>
货期
</th>
<th
width=
"6%"
>
供应商
</th>
<th
width=
"6%"
>
采购员
</th>
<th
width=
"7%"
>
批次
</th>
<th
width=
"5%"
>
操作
</th>
</tr>
</thead>
<tbody></tbody>
</table>
<textarea
name=
"remark"
id=
"remark"
class=
"form-control"
placeholder=
"填写订单备注信息"
></textarea>
</div>
</div>
<div
class=
"order-gift-info"
>
<div
class=
"ibox-title"
>
<h3>
赠品信息
</h3>
</div>
<div
class=
"ibox-content"
>
<table
class=
"table table-bordered table-hover gift-table"
>
<thead>
<tr>
<th
width=
"10%"
>
活动ID
</th>
<th
width=
"20%"
>
赠品图片
</th>
<th
width=
"20%"
>
赠品名称
</th>
<th
width=
"20%"
>
赠品数量
</th>
<th
width=
"30%"
>
赠品说明
</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
<div
class=
"order-info"
>
<div
class=
"ibox-title"
>
<h3>
订单信息
</h3>
</div>
<div
class=
"ibox-content"
>
<div
class=
"row"
>
<p
class=
"con-title"
><span>
商品总额:
</span></p>
<p
class=
"con-val goods_amount_val"
></p>
</div>
<div
class=
"row"
>
<input
type=
"hidden"
class=
"user_coupon_id"
name=
"user_coupon_id"
value=
""
>
<p
class=
"con-title"
><span
style=
"margin-top: 5px;"
>
选择优惠券:
</span></p>
<p
class=
"con-val"
>
<select
name=
"user_coupon"
id=
"user_coupon"
>
<option
value=
""
>
请选择
</option>
</select>
</p>
</div>
<div
class=
"row preferential_price"
>
<p
class=
"con-title"
><span>
优惠金额:
</span></p>
<p
class=
"con-val preferential_price_val"
>
0.00
</p>
</div>
<div
class=
"row extend_fee"
>
<p
class=
"con-title"
><span>
附加费:
</span></p>
<p
class=
"con-val extend_fee_val"
>
0.00
</p>
</div>
<div
class=
"row"
>
<p
class=
"con-title"
><span>
运费:
</span></p>
<p
class=
"con-val express_fee_val"
>
0.00
</p>
</div>
<div
class=
"row"
>
<p
class=
"con-title"
><span>
应付金额:
</span></p>
<p
class=
"con-val text-danger order_amount"
></p>
</div>
</div>
</div>
<div
class=
"ibox-title"
style=
"text-align: right;"
>
<a
class=
"btn btn-success submit-order"
data-type=
"1"
>
提交
</a>
</div>
</form>
@include('common.selectBrand')
<script>
var
sale_id
=
"{{$sale_id}}"
;
var
URL_api
=
"{{Config('website.api_domain')}}"
;
var
role
=
"{{ $role }}"
;
window
.
api_dgk_url_text
=
"
<?php
echo
$api_dgk_url
;
?>
"
setTimeout
(
function
(){
$
.
get
(
window
.
api_dgk_url_text
,
function
(
data
){
window
.
data
=
data
.
data
.
data
console
.
log
(
window
.
data
)
var
product
=
Object
.
keys
(
window
.
data
);
// 获取一级分类
var
product_len
=
Object
.
keys
(
window
.
data
).
length
for
(
var
i
=
0
;
i
<
product_len
;
i
++
){
$
(
'.product_use_classone_sn'
).
append
(
'
<
option
value
=
"'+i+'"
>
'+product[i]+'
<
/option>'
)
}
},
'json'
)
},
10
)
$
(
document
).
on
(
'change'
,
'.product_use_classone_sn'
,
function
(
data
){
var
select_key
=
$
(
'.product_use_classone_sn option:selected'
).
text
();
$
(
'.product_use_classtwo_sn'
).
html
(
''
);
for
(
let
key
in
window
.
data
){
if
(
key
==
select_key
){
// console.log(window.data[key])
for
(
var
i
=
0
;
i
<
window
.
data
[
key
].
length
;
i
++
){
$
(
'.product_use_classtwo_sn'
).
append
(
'
<
option
value
=
"'+i+'"
>
'+window.data[key][i]+'
<
/option>'
)
}
}
}
})
$
.
lie
.
add_order
.
lyorder
();
// $.lie.standardBrand.index();
</script>
\ No newline at end of file
resources/views/orderlist/content.blade.php
View file @
8f593127
...
...
@@ -140,13 +140,11 @@
<dt>
订单来源:
</dt>
<dd>
<select
id=
"order_source_pf"
name=
"order_source_pf"
class=
"form-control order_source_pf selectpicker"
title=
"全部"
multiple
>
<option
value=
"1"
>
PC端
</option>
<option
value=
"2"
>
移动端
</option>
<option
value=
"3"
>
后台
</option>
<option
value=
"4"
>
京东
</option>
<option
value=
"5"
>
ERP
</option>
<option
value=
"6"
>
小程序
</option>
<option
value=
"7"
>
开放平台
</option>
@if (Config('params.order_source_pf'))
@foreach (Config('params.order_source_pf') as $k=>$v)
<option
value=
"{{ $k }}"
>
{{ $v }}
</option>
@endforeach
@endif
</select>
</dd>
</dl>
...
...
resources/views/selfOrder/content.blade.php
View file @
8f593127
...
...
@@ -115,12 +115,11 @@
<dt>
订单来源:
</dt>
<dd>
<select
id=
"order_source_pf"
name=
"order_source_pf"
class=
"form-control order_source_pf selectpicker"
title=
"全部"
multiple
>
<option
value=
"1"
>
PC端
</option>
<option
value=
"2"
>
移动端
</option>
<option
value=
"3"
>
后台
</option>
<option
value=
"4"
>
京东
</option>
<option
value=
"6"
>
小程序
</option>
<option
value=
"7"
>
象牙宝
</option>
@if (Config('params.order_source_pf'))
@foreach (Config('params.order_source_pf') as $k=>$v)
<option
value=
"{{ $k }}"
>
{{ $v }}
</option>
@endforeach
@endif
</select>
</dd>
</dl>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment