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
4671ad0b
authored
Mar 27, 2020
by
allen
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
后台添加订单
parent
315afce2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
141 additions
and
0 deletions
app/Http/Controllers/AddOrderController.php
public/js/add_order.js
resources/views/addOrder/content.blade.php
app/Http/Controllers/AddOrderController.php
View file @
4671ad0b
...
...
@@ -72,6 +72,13 @@ Class AddOrderController extends Controller
$info
[
'crm_account'
]
=
$user_info
[
'mobile'
]
?
$user_info
[
'mobile'
]
:
$user_info
[
'email'
];
}
$data
[
'k1'
]
=
time
();
$data
[
'k2'
]
=
md5
(
md5
(
$data
[
'k1'
])
.
'fh6y5t4rr351d2c3bryi'
);
$url
=
Config
(
'website.api_domain'
)
.
'cart/getDJKConfg'
;
$info
[
'api_dgk_url'
]
=
(
$url
.
'?k1='
.
$data
[
'k1'
]
.
"&"
.
'k2='
.
$data
[
'k2'
]);
return
view
(
'addOrder'
,
$info
);
}
...
...
public/js/add_order.js
View file @
4671ad0b
...
...
@@ -270,10 +270,22 @@
dataType
:
'json'
,
success
:
function
(
resp
)
{
console
.
log
(
resp
)
if
(
resp
.
errcode
!=
0
)
{
console
.
log
(
resp
.
data
)
layer
.
msg
(
resp
.
errmsg
);
return
false
;
}
// 检查是否有dgk的商品 如果有就弹出提示框
// console.log(data.supplier_id)
if
(
resp
.
data
.
supplier_id
==
7
){
//包含digikey的商品
window
.
is_dgk
=
1
}
else
{
window
.
is_dgk
=
0
}
$
(
'.sku-info'
).
show
();
var
data
=
resp
.
data
;
...
...
@@ -650,6 +662,13 @@
// 提交订单
// $('.submit-order').on('click', function() {
$
(
'.submit-order'
).
off
().
on
(
'click'
,
function
()
{
//检查有没有digikey的商品 有的话弹出框
if
(
window
.
is_dgk
==
1
){
alert
(
11
);
return
false
;
}
var
self
=
$
(
this
);
var
address_id
=
$
(
'input[name=address_id]'
).
val
();
var
type
=
self
.
data
(
'type'
);
// 1-联营线上,2-自营线上,3-自营线下,4-自营其他业务
...
...
@@ -984,6 +1003,74 @@
},
}
});
setTimeout
(
function
(){
$
.
get
(
window
.
api_dgk_url_text
,
function
(
data
){
window
.
data
=
data
.
data
.
data
console
.
log
(
window
.
data
)
//循环第一级
// console.log(Object.keys(window.data).length)
product_len
=
Object
.
keys
(
window
.
data
).
length
for
(
let
key
in
window
.
data
){
// console.log(key)
// console.log(window.data[key])
$
(
'.product_one'
).
append
(
'<option class="product_one_select" >'
+
key
+
' </option>'
)
}
},
'json'
)
},
10
)
$
(
document
).
on
(
'change'
,
'.product_one'
,
function
(
data
){
var
select_key
=
$
(
'.product_one option:selected'
).
val
()
// console.log(select_key)
$
(
'.product_two'
).
html
(
''
)
for
(
let
key
in
window
.
data
){
if
(
key
==
select_key
){
console
.
log
(
'找到'
)
console
.
log
(
window
.
data
[
key
])
console
.
log
(
window
.
data
[
key
].
length
)
for
(
i
=
0
;
i
<
window
.
data
[
key
].
length
;
i
++
){
$
(
'.product_two'
).
append
(
'<option class="" >'
+
window
.
data
[
key
][
i
]
+
' </option>'
)
}
// for(let key_two in window.data[key]){
// $('.product_two').append('<option class="" >'+key_two+' </option>')
// }
}
// $('.product_one').append('<option class="product_one_select" >'+key+' </option>')
}
})
// $('')
})(
jQuery
)
//获取url中的参数
...
...
resources/views/addOrder/content.blade.php
View file @
4671ad0b
...
...
@@ -227,6 +227,50 @@
</div>
</div>
</div>
<div
class=
"delivery-info"
>
<span>
终端名称
</span>
<input
type=
"text"
class=
"search-sku"
name=
"client_name"
value=
""
placeholder=
""
>
<!-- <span> 终端名称 </span> <input type="text" class="search-sku" name="client_name" value="" placeholder=""> -->
<span>
客户类型
</span>
:
<select
class=
"layui-select"
>
<option>
请选择
</option>
<option
value=
"1"
>
终端
</option>
<option
value=
"2"
>
贸易商
</option>
<option
value=
"3"
>
大学
</option>
<option
value=
"4"
>
个人
</option>
</select>
</div>
<br/>
<div
class=
"delivery-info"
>
<span>
终端名称
</span>
<input
type=
"text"
class=
"search-sku"
name=
"client_name"
value=
""
placeholder=
""
>
<!-- <span> 终端名称 </span> <input type="text" class="search-sku" name="client_name" value="" placeholder=""> -->
<span>
产品用途
</span>
:
<select
class=
"layui-select product_one"
>
<option>
请选择
</option>
</select>
<select
class=
"layui-select product_two"
>
</select>
</div>
</div>
</div>
...
...
@@ -404,6 +448,8 @@
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
;
?>
"
$
.
lie
.
add_order
.
lyorder
();
</script>
\ No newline at end of file
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