更新联营物料

parent d0cb2549
......@@ -166,5 +166,12 @@ class ApiController extends Controller
Export(2,"没完成");
}
}
//批量上传联营物料
private function ApiUploadSkuList($request,$id){
print_r($request);
die();
$res = (new UploadLogModel())->uploadSkuFile($request->supplier_com_name);
Export($res);
}
}
......@@ -22,6 +22,7 @@ class WebController extends Controller
$data['_DOMAIN_'] = config("website.domain");
$data['mobile'] = $request->mobile;
$data['time']=time();
$data['supplier_com_id'] = $request->supplier_com_id;
return $this->$id($request,$data,$id);
}
......@@ -54,9 +55,20 @@ class WebController extends Controller
$data['title']='忘记密码';
return view('pc.ForgetPassword',$data);
}
//商品列表
//自营商品列表
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);
}
//订单列表(寄售)
......@@ -151,5 +163,4 @@ class WebController extends Controller
return view('pc',$data);
}
}
......@@ -37,9 +37,11 @@ class CheckLogin
Redis::expire('yunxin_login_'.$yunxin_token,7200); //延长登录时间
$userInfoArr = json_decode($userInfo,true);
$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_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->appid = $userInfoArr['appid'];
$request->key = $userInfoArr['key'];
......
......@@ -54,8 +54,12 @@ class SupplierAccountModel extends Model
$info = [
'supplier_id'=>$account['supplier_id'],
'mobile'=>$account['mobile'],
'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'],
'appid'=>$account['appid'],
'key'=>$account['key'],
......
......@@ -72,7 +72,7 @@ class UploadLogModel extends Model
return $result['data'][0];
}
//上传文件
public function uploadFile($create_name = ''){
public function uploadSkuFile($create_name = ''){
$file = Request::file('file');
if ($file->isValid()) {
$ext = $file->getClientOriginalExtension();
......
......@@ -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
;!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();
})
}();
......@@ -112,4 +112,11 @@
}, $(function () {
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
......@@ -18,8 +18,6 @@
<div class="error-desc">
没有访问权限<br/>
请前往权限系统申请权限 <br/>
<a href="{{$url or ''}}" target="_blank"><i class="fa fa-mail-reply"></i>Go</a>
</div>
</div>
</body>
......
......@@ -88,7 +88,7 @@
</dd>
</dl>
</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">
<i class="iconfont icon-shangpinguanli- va-m"></i>
<span class="t1 lineBlock va-m">商品管理</span>
......@@ -97,17 +97,18 @@
<dl >
<dd class="<?php if( in_array($id,['GoodsList','GoodsDetail']) !== false ) echo "curr" ?>">
<i class="line"></i>
<a href="/web/GoodsList">商品列表</a>
<a href="/web/GoodsList">自营商品列表</a>
</dd>
<!--
{{--<dd class="<?php if( in_array($id,['GoodsAuditList']) !== false ) echo "curr" ?>">--}}
{{--<i class="line"></i>--}}
{{--<a href="/web/GoodsAuditList">价格审核列表</a>--}}
{{--</dd>--}}
{{--<dd class="<?php if( in_array($id,['UploadLogList']) !== false ) echo "curr" ?>">--}}
{{--<i class="line"></i>--}}
{{--<a href="/web/UploadLogList">价格导入日志</a>--}}
{{--</dd> --}}-->
<?Php if($supplier_com_id) { ?>
<dd class="<?php if( in_array($id,['GoodsComList']) !== false ) echo "curr" ?>">
<i class="line"></i>
<a href="/web/GoodsComList">联营商品列表</a>
</dd>
<dd class="<?php if( in_array($id,['GoodsComImportLogList']) !== false ) echo "curr" ?>">
<i class="line"></i>
<a href="/web/GoodsComImportLogList">联营商品导入日志</a>
</dd>
<?php } ?>
</dl>
</li>
<li class="<?php if( in_array($id,['OrderList','OrderDetail','AbnormalList','AbnormalDetail','PutawayList','PutawayDetail']) !== false ) echo "curr" ?>">
......@@ -129,14 +130,8 @@
<i class="line"></i>
<a href="/web/PutawayList">入库列表(寄售)</a>
</dd>
<!--
{{--<dd class=" <?php if( in_array($id,['AbnormalList','AbnormalDetail']) !== false ) echo "curr" ?>">--}}
{{--<i class="line"></i>--}}
{{--<a href="/web/AbnormalList">退货列表</a>--}}
{{--</dd>--}} -->
</dl>
</li>
<!--
{{--<li >--}}
{{--<a href="javascript:;" class="bx">--}}
......
<div class="lx-content-r fr">
<div class="tit-bar">
<a href="">商品管理</a>
<span>&gt;</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
......@@ -55,7 +55,7 @@
</div>
<div class="code clr">
<div class="code-inp fl">
<input type="text" placeholder="请输入验证码" name="code">
<input type="text" placeholder="请输入验证码" name="code" onkeydown="enterIn(event);">
</div>
<div class="code-img fr" id="code">
<img src="/helper/captcha" id="img_code" alt="">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment