Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
黄成意
/
yunxin
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
97ad74d3
authored
May 13, 2019
by
PRY5YKGJ82EZEPX\Administrator
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
更新联营物料
parent
d0cb2549
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
263 additions
and
32 deletions
app/Http/Controllers/ApiController.php
app/Http/Controllers/WebController.php
app/Http/Middleware/CheckLogin.php
app/Model/SupplierAccountModel.php
app/Model/UploadLogModel.php
doc/v2.0.md
public/pc/js/controller/GoodsComList.js
public/pc/js/controller/Login.js
resources/views/errors/error.blade.php
resources/views/pc.blade.php
resources/views/pc/GoodsComList.blade.php
resources/views/pc/Login.blade.php
app/Http/Controllers/ApiController.php
View file @
97ad74d3
...
@@ -166,5 +166,12 @@ class ApiController extends Controller
...
@@ -166,5 +166,12 @@ class ApiController extends Controller
Export
(
2
,
"没完成"
);
Export
(
2
,
"没完成"
);
}
}
}
}
//批量上传联营物料
private
function
ApiUploadSkuList
(
$request
,
$id
){
print_r
(
$request
);
die
();
$res
=
(
new
UploadLogModel
())
->
uploadSkuFile
(
$request
->
supplier_com_name
);
Export
(
$res
);
}
}
}
app/Http/Controllers/WebController.php
View file @
97ad74d3
...
@@ -22,6 +22,7 @@ class WebController extends Controller
...
@@ -22,6 +22,7 @@ class WebController extends Controller
$data
[
'_DOMAIN_'
]
=
config
(
"website.domain"
);
$data
[
'_DOMAIN_'
]
=
config
(
"website.domain"
);
$data
[
'mobile'
]
=
$request
->
mobile
;
$data
[
'mobile'
]
=
$request
->
mobile
;
$data
[
'time'
]
=
time
();
$data
[
'time'
]
=
time
();
$data
[
'supplier_com_id'
]
=
$request
->
supplier_com_id
;
return
$this
->
$id
(
$request
,
$data
,
$id
);
return
$this
->
$id
(
$request
,
$data
,
$id
);
}
}
...
@@ -54,9 +55,20 @@ class WebController extends Controller
...
@@ -54,9 +55,20 @@ class WebController extends Controller
$data
[
'title'
]
=
'忘记密码'
;
$data
[
'title'
]
=
'忘记密码'
;
return
view
(
'pc.ForgetPassword'
,
$data
);
return
view
(
'pc.ForgetPassword'
,
$data
);
}
}
//商品列表
//
自营
商品列表
private
function
GoodsList
(
$request
,
$data
,
$id
){
private
function
GoodsList
(
$request
,
$data
,
$id
){
$data
[
'title'
]
=
'商品列表'
;
$data
[
'title'
]
=
'自营商品列表'
;
return
view
(
'pc'
,
$data
);
}
//联营商品列表
private
function
GoodsComList
(
$request
,
$data
,
$id
){
$data
[
'title'
]
=
'联营商品列表'
;
return
view
(
'pc'
,
$data
);
}
//联营商品列表上传日志
private
function
GoodsComImportLogList
(
$request
,
$data
,
$id
){
$data
[
'title'
]
=
'联营商品上传日志列表'
;
return
view
(
'pc'
,
$data
);
return
view
(
'pc'
,
$data
);
}
}
//订单列表(寄售)
//订单列表(寄售)
...
@@ -151,5 +163,4 @@ class WebController extends Controller
...
@@ -151,5 +163,4 @@ class WebController extends Controller
return
view
(
'pc'
,
$data
);
return
view
(
'pc'
,
$data
);
}
}
}
}
app/Http/Middleware/CheckLogin.php
View file @
97ad74d3
...
@@ -37,9 +37,11 @@ class CheckLogin
...
@@ -37,9 +37,11 @@ class CheckLogin
Redis
::
expire
(
'yunxin_login_'
.
$yunxin_token
,
7200
);
//延长登录时间
Redis
::
expire
(
'yunxin_login_'
.
$yunxin_token
,
7200
);
//延长登录时间
$userInfoArr
=
json_decode
(
$userInfo
,
true
);
$userInfoArr
=
json_decode
(
$userInfo
,
true
);
$request
->
mobile
=
$userInfoArr
[
'mobile'
];
$request
->
mobile
=
$userInfoArr
[
'mobile'
];
$request
->
account_id
=
$userInfoArr
[
'account_id'
];
$request
->
account_id
=
$userInfoArr
[
'account_id'
];
//自营id
$request
->
supplier_id
=
$userInfoArr
[
'supplier_id'
];
$request
->
supplier_id
=
$userInfoArr
[
'supplier_id'
];
$request
->
supplier_name
=
$userInfoArr
[
'supplier_name'
];
$request
->
supplier_name
=
$userInfoArr
[
'supplier_name'
];
$request
->
supplier_com_id
=
@
$userInfoArr
[
'supplier_com_id'
];
//联营id
$request
->
supplier_com_code
=
@
$userInfoArr
[
'supplier_com_code'
];
$request
->
role_id
=
$userInfoArr
[
'role_id'
];
//1寄售 2自采 3云芯
$request
->
role_id
=
$userInfoArr
[
'role_id'
];
//1寄售 2自采 3云芯
$request
->
appid
=
$userInfoArr
[
'appid'
];
$request
->
appid
=
$userInfoArr
[
'appid'
];
$request
->
key
=
$userInfoArr
[
'key'
];
$request
->
key
=
$userInfoArr
[
'key'
];
...
...
app/Model/SupplierAccountModel.php
View file @
97ad74d3
...
@@ -54,8 +54,12 @@ class SupplierAccountModel extends Model
...
@@ -54,8 +54,12 @@ class SupplierAccountModel extends Model
$info
=
[
$info
=
[
'supplier_id'
=>
$account
[
'supplier_id'
],
'supplier_id'
=>
$account
[
'supplier_id'
],
'mobile'
=>
$account
[
'mobile'
],
'supplier_name'
=>
$supplierInfo
[
'supplier_name'
],
'supplier_name'
=>
$supplierInfo
[
'supplier_name'
],
'supplier_code'
=>
$supplierInfo
[
'supplier_code'
],
'supplier_com_id'
=>
$account
[
'supplier_com_id'
],
'supplier_com_name'
=>
$supplierInfo
[
'supplier_com_name'
],
'supplier_com_code'
=>
$supplierInfo
[
'supplier_com_code'
],
'mobile'
=>
$account
[
'mobile'
],
'account_id'
=>
$account
[
'id'
],
'account_id'
=>
$account
[
'id'
],
'appid'
=>
$account
[
'appid'
],
'appid'
=>
$account
[
'appid'
],
'key'
=>
$account
[
'key'
],
'key'
=>
$account
[
'key'
],
...
...
app/Model/UploadLogModel.php
View file @
97ad74d3
...
@@ -72,7 +72,7 @@ class UploadLogModel extends Model
...
@@ -72,7 +72,7 @@ class UploadLogModel extends Model
return
$result
[
'data'
][
0
];
return
$result
[
'data'
][
0
];
}
}
//上传文件
//上传文件
public
function
uploadFile
(
$create_name
=
''
){
public
function
upload
Sku
File
(
$create_name
=
''
){
$file
=
Request
::
file
(
'file'
);
$file
=
Request
::
file
(
'file'
);
if
(
$file
->
isValid
())
{
if
(
$file
->
isValid
())
{
$ext
=
$file
->
getClientOriginalExtension
();
$ext
=
$file
->
getClientOriginalExtension
();
...
...
doc/v2.0.md
View file @
97ad74d3
...
@@ -29,6 +29,30 @@
...
@@ -29,6 +29,30 @@
四:模糊查询联营供应商 接口 (明星提供)
四:模糊查询联营供应商 接口 (明星提供)
五:模糊查询自营供应商接口 (采购提供)
五:模糊查询自营供应商接口 (采购提供)
```
```
\ No newline at end of file
#db设计
数据库:liexin_yunxin
环境:正式+测试
执行sql:
-- 添加联营供应商信息
ALTER TABLE
`lie_supplier_account`
ADD COLUMN
`supplier_name`
varchar(64) NOT NULL AFTER
`supplier_self_id`
,
ADD COLUMN
`supplier_code`
varchar(16) NOT NULL DEFAULT '' COMMENT '自营供应商编码' AFTER
`supplier_self_name`
,
ADD COLUMN
`supplier_com_id`
smallint(5) UNSIGNED NOT NULL DEFAULT 0 COMMENT '联营供应商id' AFTER
`supplier_self_code`
,
ADD COLUMN
`supplier_com_name`
varchar(64) NOT NULL DEFAULT '' COMMENT '联营供应商名称' AFTER
`supplier_com_id`
,
ADD COLUMN
`supplier_com_code`
varchar(16) NOT NULL DEFAULT '' COMMENT '联营供应商编码' AFTER
`supplier_com_name`
;
ALTER TABLE
`lie_supplier_account`
ADD INDEX
`idx_supplier_name`
(
`supplier_name`
) ,
ADD INDEX
`idx_supplier_com_name`
(
`supplier_com_name`
) ;
-- 上传日志添加字段
ALTER TABLE
`lie_upload_log`
MODIFY COLUMN
`type`
tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '1: 批量上传联营物料' AFTER
`id`
,
ADD COLUMN
`create_name`
varchar(32) NOT NULL DEFAULT '' COMMENT '创建人名称' AFTER
`create_uid`
;
原因:添加联营账号
\ No newline at end of file
public/pc/js/controller/GoodsComList.js
0 → 100644
View file @
97ad74d3
;
!
function
()
{
var
ids
=
[];
//选择的ids
var
table_data
=
[];
window
.
app
=
{
init
:
function
()
{
app
.
tableList
();
app
.
checkbox
();
app
.
uploadSku
();
//刷新列表
$
(
"#search"
).
click
(
function
()
{
app
.
tableList
()
})
//重置表单
$
(
"#reset"
).
click
(
function
()
{
$
(
"input[name='supplier_goods_id']"
).
val
(
""
)
$
(
"input[name='goods_name']"
).
val
(
""
)
$
(
"input[name='brand_id']"
).
val
(
""
)
$
(
"#brand_name"
).
empty
();
//清空select2数据
})
//导出
$
(
"#export"
).
click
(
function
()
{
app
.
export
()
})
},
tableList
:
function
()
{
layui
.
table
.
render
({
elem
:
'#list'
,
url
:
'/api/ApiSkuList'
,
method
:
'post'
,
cellMinWidth
:
100
//全局定义常规单元格的最小宽度
,
request
:
{
pageName
:
'p'
//页码的参数名称,默认:page
,
limitName
:
'limit'
//每页数据量的参数名,默认:limit
}
,
where
:
formJson
(
'form1'
)
,
loading
:
true
,
first
:
true
//不显示首页
,
last
:
false
//不显示尾页
,
cols
:
[[
{
field
:
'goods_id'
,
title
:
'SKUID'
,
align
:
'center'
},
{
field
:
'old_goods_id'
,
title
:
'原ID'
,
align
:
'center'
},
{
field
:
'goods_name'
,
title
:
'SKU型号'
,
align
:
'center'
},
{
field
:
'type_name'
,
title
:
'商品类别'
,
align
:
'center'
},
{
field
:
'supplier_name'
,
title
:
'供应商'
,
align
:
'center'
},
{
field
:
'brand_name'
,
title
:
'制造商'
,
align
:
'center'
},
{
field
:
'canal'
,
title
:
'渠道标签'
,
align
:
'center'
},
{
field
:
'goods_images'
,
title
:
'图片'
,
align
:
'center'
},
{
field
:
'encoded'
,
title
:
'内部编号'
,
align
:
'center'
},
{
field
:
'batch_sn'
,
title
:
'批次'
,
align
:
'center'
},
{
field
:
'stock'
,
title
:
'库存'
,
align
:
'center'
},
{
field
:
'status_name'
,
title
:
'状态'
,
align
:
'center'
},
{
field
:
'is_expire'
,
title
:
'是否过期'
,
align
:
'center'
},
{
field
:
'update_time'
,
title
:
'更新时间'
,
align
:
'center'
},
]]
,
id
:
'Abnormal'
,
page
:{
}
,
done
:
function
(
res
,
curr
,
count
)
{
// 若无数据,则禁用导出按钮
if
(
!
count
)
{
$
(
'.export'
).
addClass
(
'layui-disabled'
);
}
else
{
$
(
'.export'
).
removeClass
(
'layui-disabled'
);
}
//设置全部数据到全局变量
table_data
=
res
.
data
;
}
});
},
export
:
function
(){
//商品列表导出
common_export
(
'/api/ApiGoodsListExport'
,
formJson
(
'form1'
))
},
export_result
:
function
(){
//循环导出结果
var
res
=
ajax_push
(
'/api/ApiGoodsListExportResult'
,
formJson
(
'form1'
))
},
uploadSku
:
function
()
{
//审核操作
//执行实例
var
uploadInst
=
layui
.
upload
.
render
({
elem
:
'#BatchAdd'
//绑定元素
,
url
:
'/api/ApiUploadSkuList'
//上传接口
,
accept
:
'file'
,
exts
:
'csv'
,
done
:
function
(
res
){
if
(
!
res
)
return
layer
.
msg
(
'网络连接失败,请重试'
,{
icon
:
6
});
return
layer
.
msg
(
res
.
msg
,{
icon
:
6
});
}
,
error
:
function
(){
return
layer
.
msg
(
'上传异常'
,{
icon
:
5
});
}
});
},
checkbox
:
function
()
{
//多选全选
layui
.
table
.
on
(
'checkbox(test)'
,
function
(
obj
)
{
if
(
obj
.
checked
==
true
){
if
(
obj
.
type
==
'one'
){
ids
.
push
(
obj
.
data
.
id
);
}
else
if
(
obj
.
type
==
'all'
){
ids
=
[];
for
(
var
i
=
0
;
i
<
table_data
.
length
;
i
++
){
ids
.
push
(
table_data
[
i
].
id
);
}
}
}
else
{
if
(
obj
.
type
==
'one'
){
for
(
var
i
=
0
;
i
<
ids
.
length
;
i
++
){
if
(
ids
[
i
]
==
obj
.
data
.
id
){
ids
.
splice
(
i
,
1
)
}
}
}
else
if
(
obj
.
type
==
'all'
)
{
ids
=
[];
}
}
// console.log(JSON.stringify(ids))
});
}
},
$
(
function
()
{
app
.
init
();
})
}();
public/pc/js/controller/Login.js
View file @
97ad74d3
...
@@ -112,4 +112,11 @@
...
@@ -112,4 +112,11 @@
},
$
(
function
()
{
},
$
(
function
()
{
Login
.
init
();
Login
.
init
();
})
})
}();
}();
\ No newline at end of file
function
enterIn
(
evt
){
var
evt
=
evt
?
evt
:(
window
.
event
?
window
.
event
:
null
);
//兼容IE和FF
if
(
evt
.
keyCode
==
13
){
$
(
"#submit"
).
click
()
}
}
\ No newline at end of file
resources/views/errors/error.blade.php
View file @
97ad74d3
...
@@ -18,8 +18,6 @@
...
@@ -18,8 +18,6 @@
<div
class=
"error-desc"
>
<div
class=
"error-desc"
>
没有访问权限
<br/>
没有访问权限
<br/>
请前往权限系统申请权限
<br/>
<a
href=
"{{$url or ''}}"
target=
"_blank"
><i
class=
"fa fa-mail-reply"
></i>
Go
</a>
</div>
</div>
</div>
</div>
</body>
</body>
...
...
resources/views/pc.blade.php
View file @
97ad74d3
...
@@ -88,7 +88,7 @@
...
@@ -88,7 +88,7 @@
</dd>
</dd>
</dl>
</dl>
</li>
</li>
<li
class=
"
<?php
if
(
in_array
(
$id
,[
'GoodsAuditList'
,
'GoodsList'
,
'GoodsDetail'
,
'UploadLogList'
])
!==
false
)
echo
"curr"
?>
"
>
<li
class=
"
<?php
if
(
in_array
(
$id
,[
'GoodsAuditList'
,
'GoodsList'
,
'GoodsDetail'
,
'UploadLogList'
,
'GoodsComList'
,
'GoodsComImportLogList'
])
!==
false
)
echo
"curr"
?>
"
>
<a
href=
"javascript:;"
class=
"bx"
>
<a
href=
"javascript:;"
class=
"bx"
>
<i
class=
"iconfont icon-shangpinguanli- va-m"
></i>
<i
class=
"iconfont icon-shangpinguanli- va-m"
></i>
<span
class=
"t1 lineBlock va-m"
>
商品管理
</span>
<span
class=
"t1 lineBlock va-m"
>
商品管理
</span>
...
@@ -97,17 +97,18 @@
...
@@ -97,17 +97,18 @@
<dl
>
<dl
>
<dd
class=
"
<?php
if
(
in_array
(
$id
,[
'GoodsList'
,
'GoodsDetail'
])
!==
false
)
echo
"curr"
?>
"
>
<dd
class=
"
<?php
if
(
in_array
(
$id
,[
'GoodsList'
,
'GoodsDetail'
])
!==
false
)
echo
"curr"
?>
"
>
<i
class=
"line"
></i>
<i
class=
"line"
></i>
<a
href=
"/web/GoodsList"
>
商品列表
</a>
<a
href=
"/web/GoodsList"
>
自营
商品列表
</a>
</dd>
</dd>
<!--
<?
Php
if
(
$supplier_com_id
)
{
?>
{{--<dd class="
<?php
if
(
in_array
(
$id
,[
'GoodsAuditList'
])
!==
false
)
echo
"curr"
?>
">--}}
<dd
class=
"
<?php
if
(
in_array
(
$id
,[
'GoodsComList'
])
!==
false
)
echo
"curr"
?>
"
>
{{--<i class="line"></i>--}}
<i
class=
"line"
></i>
{{--<a href="/web/GoodsAuditList">价格审核列表</a>--}}
<a
href=
"/web/GoodsComList"
>
联营商品列表
</a>
{{--</dd>--}}
</dd>
{{--<dd class="
<?php
if
(
in_array
(
$id
,[
'UploadLogList'
])
!==
false
)
echo
"curr"
?>
">--}}
<dd
class=
"
<?php
if
(
in_array
(
$id
,[
'GoodsComImportLogList'
])
!==
false
)
echo
"curr"
?>
"
>
{{--<i class="line"></i>--}}
<i
class=
"line"
></i>
{{--<a href="/web/UploadLogList">价格导入日志</a>--}}
<a
href=
"/web/GoodsComImportLogList"
>
联营商品导入日志
</a>
{{--</dd> --}}-->
</dd>
<?php
}
?>
</dl>
</dl>
</li>
</li>
<li
class=
"
<?php
if
(
in_array
(
$id
,[
'OrderList'
,
'OrderDetail'
,
'AbnormalList'
,
'AbnormalDetail'
,
'PutawayList'
,
'PutawayDetail'
])
!==
false
)
echo
"curr"
?>
"
>
<li
class=
"
<?php
if
(
in_array
(
$id
,[
'OrderList'
,
'OrderDetail'
,
'AbnormalList'
,
'AbnormalDetail'
,
'PutawayList'
,
'PutawayDetail'
])
!==
false
)
echo
"curr"
?>
"
>
...
@@ -129,14 +130,8 @@
...
@@ -129,14 +130,8 @@
<i
class=
"line"
></i>
<i
class=
"line"
></i>
<a
href=
"/web/PutawayList"
>
入库列表(寄售)
</a>
<a
href=
"/web/PutawayList"
>
入库列表(寄售)
</a>
</dd>
</dd>
<!--
{{--<dd class="
<?php
if
(
in_array
(
$id
,[
'AbnormalList'
,
'AbnormalDetail'
])
!==
false
)
echo
"curr"
?>
">--}}
{{--<i class="line"></i>--}}
{{--<a href="/web/AbnormalList">退货列表</a>--}}
{{--</dd>--}} -->
</dl>
</dl>
</li>
</li>
<!--
<!--
{{--<li >--}}
{{--<li >--}}
{{--<a href="javascript:;" class="bx">--}}
{{--<a href="javascript:;" class="bx">--}}
...
...
resources/views/pc/GoodsComList.blade.php
0 → 100644
View file @
97ad74d3
<div
class=
"lx-content-r fr"
>
<div
class=
"tit-bar"
>
<a
href=
""
>
商品管理
</a>
<span>
>
</span>
<a
class=
"text"
href=
""
>
{{ $title }}
</a>
</div>
<div
class=
"con-section shop-list"
>
<p
class=
"text"
>
{{ $title }}
</p>
<form
action=
""
id=
"form1"
>
<div
class=
"search-bar"
>
<div
class=
"lineBlock input-inline va-m"
>
<label
class=
"tag"
>
商品编码:
</label>
<input
type=
"text"
class=
"inp w180"
name=
"supplier_goods_id"
placeholder=
"输入商品编码"
>
</div>
<div
class=
"lineBlock input-inline va-m"
>
<label
class=
"tag"
>
型号:
</label>
<input
type=
"text"
class=
"inp w180"
name=
"goods_name"
placeholder=
"输入型号"
>
</div>
<div
class=
"lineBlock input-inline va-m"
>
<label
class=
"tag"
>
品牌:
</label>
<input
type=
"hidden"
id=
"brand_id"
name=
"brand_id"
placeholder=
"输入品牌"
>
<select
id=
"brand_name"
style=
"width: 200px;"
>
</select>
</div>
<div
style=
"margin-top: 10px"
>
<div
class=
"lineBlock input-inline va-m"
id=
"search"
>
<a
href=
"javascript:;"
class=
"export-btn"
>
<i
class=
"iconfont icon-chaxun-"
></i>
<span>
查询
</span>
</a>
</div>
<div
class=
"lineBlock input-inline va-m"
id=
"BatchAdd"
>
<a
href=
"javascript:;"
class=
"export-btn"
>
<i
class=
"iconfont icon-daochu-"
></i>
<span>
导入
</span>
</a>
</div>
<a
href=
""
style=
"color:red"
>
下载导入模板
</a>
</div>
</div>
</form>
<div
class=
"table-list"
id=
"shopList"
>
<table
class=
"layui-table"
lay-filter=
"test"
id=
"list"
></table>
</div>
<script
type=
"text/html"
id=
"cahe"
>
<
button
class
=
"btn btn-xs btn-outline btn-success pointer"
style
=
"color: #1080d0;border: 1px solid #1080d0;"
onclick
=
"purePrice(@{{ d.goods_id }})"
>&
nbsp
;
价格明细
&
nbsp
;
<
/button
>
</script>
</div>
</div>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/pc/js/select2/css/select2.css"
>
<script
type=
"text/javascript"
src=
"/pc/js/select2/js/select2.js"
></script>
<script
type=
"text/javascript"
src=
"/pc/js/select2/js/i18n/zh-CN.js"
></script>
<style>
.lx-content
.lx-content-wrap
.lx-content-r
.con-section
.table-list
table
tr
th
{
border-top
:
none
!important
;
}
</style>
\ No newline at end of file
resources/views/pc/Login.blade.php
View file @
97ad74d3
...
@@ -55,7 +55,7 @@
...
@@ -55,7 +55,7 @@
</div>
</div>
<div
class=
"code clr"
>
<div
class=
"code clr"
>
<div
class=
"code-inp fl"
>
<div
class=
"code-inp fl"
>
<input
type=
"text"
placeholder=
"请输入验证码"
name=
"code"
>
<input
type=
"text"
placeholder=
"请输入验证码"
name=
"code"
onkeydown=
"enterIn(event);"
>
</div>
</div>
<div
class=
"code-img fr"
id=
"code"
>
<div
class=
"code-img fr"
id=
"code"
>
<img
src=
"/helper/captcha"
id=
"img_code"
alt=
""
>
<img
src=
"/helper/captcha"
id=
"img_code"
alt=
""
>
...
...
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