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
d7884a9a
authored
Dec 27, 2019
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
添加联营无SKUID商品
parent
68214dc8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
96 additions
and
5 deletions
app/Http/Controllers/AddOrderController.php
app/Model/CmsModel.php
public/js/goods.js
app/Http/Controllers/AddOrderController.php
View file @
d7884a9a
...
...
@@ -789,9 +789,29 @@ Class AddOrderController extends Controller
public
function
addGoods
(
Request
$request
)
{
if
(
$request
->
isMethod
(
'post'
))
{
$add_type
=
$request
->
input
(
'add_type'
,
''
);
// 新增类型
if
(
$add_type
)
{
$data
[
'add_goods_name'
]
=
$request
->
input
(
'add_goods_name'
,
''
);
$data
[
'add_brand_name'
]
=
$request
->
input
(
'add_brand_name'
,
''
);
$data
[
'add_supplier_name'
]
=
$request
->
input
(
'add_supplier_name'
,
''
);
$data
[
'add_goods_number'
]
=
$request
->
input
(
'add_goods_number'
,
0
);
$data
[
'add_goods_price'
]
=
$request
->
input
(
'add_goods_price'
,
0
);
$data
[
'add_delivery_time'
]
=
$request
->
input
(
'add_delivery_time'
,
''
);
$CmsModel
=
new
CmsModel
();
$add_buyer_id
=
$request
->
input
(
'add_buyer_id'
,
0
);
$data
[
'add_buyer_id'
]
=
$add_buyer_id
?
$CmsModel
->
getSaleId
(
$add_buyer_id
)
:
0
;
$data
[
'add_batch'
]
=
$request
->
input
(
'add_batch'
,
''
);
$data
[
'add_remarks'
]
=
$request
->
input
(
'add_remarks'
,
''
);
}
else
{
$data
[
'goods_id'
]
=
$request
->
input
(
'goods_id'
);
$data
[
'goods_num'
]
=
$request
->
input
(
'goods_num'
);
}
$data
[
'order_id'
]
=
$request
->
input
(
'order_id'
);
$data
[
'goods_id'
]
=
$request
->
input
(
'goods_id'
);
$data
[
'goods_num'
]
=
$request
->
input
(
'goods_num'
);
$data
[
'add_type'
]
=
$add_type
;
$data
[
'operator_id'
]
=
$request
->
user
->
userId
;
$url
=
Config
(
'website.order_api_domain'
)
.
'/order/addgoods'
;
...
...
app/Model/CmsModel.php
View file @
d7884a9a
...
...
@@ -20,4 +20,16 @@ class CmsModel extends Model
return
$user
?
$user
->
name
:
''
;
}
// 获取用户ID
public
function
getSaleId
(
$name
=
''
)
{
if
(
!
$name
)
return
false
;
$name
&&
$map
[
'name'
]
=
$name
;
$user
=
$this
->
where
(
$map
)
->
select
(
'userId'
)
->
first
();
return
$user
?
$user
->
userId
:
0
;
}
}
\ No newline at end of file
public/js/goods.js
View file @
d7884a9a
...
...
@@ -88,12 +88,70 @@
content
:
$
(
'#addGoodsNoSkuid'
),
btn
:
[
'新增'
,
'取消'
],
btn1
:
function
()
{
var
order_id
=
$
(
'#order_id'
).
val
();
var
add_goods_name
=
$
(
'input[name=add_goods_name]'
).
val
();
var
add_brand_name
=
$
(
'input[name=add_brand_name]'
).
val
();
var
add_supplier_name
=
$
(
'input[name=add_supplier_name]'
).
val
();
var
add_goods_number
=
$
(
'input[name=add_goods_number]'
).
val
();
var
add_goods_price
=
$
(
'input[name=add_goods_price]'
).
val
();
var
add_delivery_time
=
$
(
'input[name=add_delivery_time]'
).
val
();
var
add_buyer_id
=
$
(
'input[name=add_buyer_id]'
).
val
();
var
add_batch
=
$
(
'input[name=add_batch]'
).
val
();
var
add_remarks
=
$
(
'textarea[name=add_remarks]'
).
val
();
var
reg
=
/
\d
/
;
if
(
!
add_goods_name
)
{
layer
.
msg
(
'请输入商品名称'
);
return
false
;
}
if
(
!
add_brand_name
)
{
layer
.
msg
(
'请输入制造商'
);
return
false
;
}
if
(
!
add_supplier_name
)
{
layer
.
msg
(
'请输入供应商'
);
return
false
;
}
if
(
!
add_goods_number
)
{
layer
.
msg
(
'请输入采购数量'
);
return
false
;
}
if
(
!
reg
.
test
(
add_goods_number
))
{
layer
.
msg
(
'格式错误,请输入正确的采购数量'
);
return
false
;
}
if
(
!
add_goods_price
)
{
layer
.
msg
(
'请输入采购单价'
);
return
false
;
}
if
(
!
reg
.
test
(
add_goods_price
))
{
layer
.
msg
(
'格式错误,请输入正确的采购单价'
);
return
false
;
}
if
(
!
add_delivery_time
)
{
layer
.
msg
(
'请输入货期'
);
return
false
;
}
var
datax
=
{
add_type
:
1
,
order_id
:
order_id
,
goods_id
:
goods_id
,
goods_num
:
goods_min_num
,
add_goods_name
:
add_goods_name
,
add_brand_name
:
add_brand_name
,
add_supplier_name
:
add_supplier_name
,
add_goods_number
:
add_goods_number
,
add_goods_price
:
add_goods_price
,
add_delivery_time
:
add_delivery_time
,
add_buyer_id
:
add_buyer_id
,
add_batch
:
add_batch
,
add_remarks
:
add_remarks
,
};
$
.
ajax
({
...
...
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