更新添加联营物料

parent 00c8844a
...@@ -36,10 +36,11 @@ class PureController extends Controller ...@@ -36,10 +36,11 @@ class PureController extends Controller
} }
//联营价格明细弹框 //联营价格明细弹框
private function PureComPrice($request,$data,$id){ private function PureComPrice($request,$data,$id){
$goods_id = $request->input("goods_id");
$data['title']='自营价格明细'; $data['title']='自营价格明细';
$data['time']=time(); $data['time']=time();
$res = (new ServerMicModel())->synchronization(['goods_id'=>[$request->input("goods_id")]]); $res = (new ServerMicModel())->synchronization(['goods_id'=>[$goods_id]],2);
$data[''] $data['ladder_price'] = $res['code'] > 0 ? [] : @$res['data'][$goods_id]['ladder_price'];
return view('pure',$data); return view('pure',$data);
} }
......
...@@ -127,45 +127,12 @@ ...@@ -127,45 +127,12 @@
sku价格明细弹框 sku价格明细弹框
*/ */
function purePrice(goods_id) { function purePrice(goods_id) {
console.log($("#s"+goods_id).attr('data'))
return
$("input[name='id2']").val(id)
$("input[name='mobile2']").val(mobile)
$("input[name='fixed_amount2']").val(fixed_amount)
layer.open({ layer.open({
type:1, type: 2
title: '调整固定额度', , scrollbar: false
shadeClose: true, , area: ['700px', '570px']
shade: 0.8, , maxmin: true
area: ['380px', '280px'], , title: '价格变化明细'
content: $("#box2"), , content: '/pure/PureComPrice?goods_id='+goods_id
btn: ['取消', '确定'],
success: function(layero){ //按钮居中
layero.find('.layui-layer-btn').css('text-align', 'center')
},
end:function () {
$('#form3')[0].reset()
},
btn1: function(index) {
layer.close(index);
},
btn2: function() {
var fixed_amount_new = $("input[name='fixed_amount_new']").val()
if(!num_int_two.test(fixed_amount_new)){
alert_err("固定额度填写不正确")
return false;
}
alert_confirm("你确定要修改固定额度吗?确定后交提交上级审核!",function () {
var res = ajax("/api/ApiChangeUserAmount",{
"id":id,
"type":1,
"change_amount":fixed_amount_new,
"effect_time":0
})
res.err_code > 0 ? alert_err(res.err_msg) : alert_succ(res.err_msg,function () {
window.location.reload()
})
})
}
}); });
} }
\ No newline at end of file
...@@ -131,46 +131,14 @@ ...@@ -131,46 +131,14 @@
/* /*
sku价格明细弹框 sku价格明细弹框
*/ */
function purePrice(goods_id) { function purePrice(sku_id) {
$("input[name='id2']").val(id)
$("input[name='mobile2']").val(mobile)
$("input[name='fixed_amount2']").val(fixed_amount)
layer.open({ layer.open({
type:1, type: 2
title: '调整固定额度', , scrollbar: false
shadeClose: true, , area: ['700px', '570px']
shade: 0.8, , maxmin: true
area: ['380px', '280px'], , title: '价格变化明细'
content: $("#box2"), , content: '/pure/PurePrice?sku_id='+sku_id
btn: ['取消', '确定'],
success: function(layero){ //按钮居中
layero.find('.layui-layer-btn').css('text-align', 'center')
},
end:function () {
$('#form3')[0].reset()
},
btn1: function(index) {
layer.close(index);
},
btn2: function() {
var fixed_amount_new = $("input[name='fixed_amount_new']").val()
if(!num_int_two.test(fixed_amount_new)){
alert_err("固定额度填写不正确")
return false;
}
alert_confirm("你确定要修改固定额度吗?确定后交提交上级审核!",function () {
var res = ajax("/api/ApiChangeUserAmount",{
"id":id,
"type":1,
"change_amount":fixed_amount_new,
"effect_time":0
})
res.err_code > 0 ? alert_err(res.err_msg) : alert_succ(res.err_msg,function () {
window.location.reload()
})
})
}
}); });
} }
/* /*
......
...@@ -9,32 +9,32 @@ ...@@ -9,32 +9,32 @@
app.tableList() app.tableList()
}) })
}, },
tableList:function () { // tableList:function () {
layui.table.render({ // layui.table.render({
elem: '#list' // elem: '#list'
,url:'/api/PurePrice' // ,url:'/api/PurePrice'
,method:'post' // ,method:'post'
,cellMinWidth: 100 //全局定义常规单元格的最小宽度 // ,cellMinWidth: 100 //全局定义常规单元格的最小宽度
,request: { // ,request: {
pageName: 'p' //页码的参数名称,默认:page // pageName: 'p' //页码的参数名称,默认:page
,limitName: 'limit' //每页数据量的参数名,默认:limit // ,limitName: 'limit' //每页数据量的参数名,默认:limit
} // }
,where: {'goods_id':$("#goods_id").val()} // ,where: {'goods_id':$("#goods_id").val()}
,loading:true // ,loading:true
,first: true //不显示首页 // ,first: true //不显示首页
,last: false //不显示尾页 // ,last: false //不显示尾页
,cols: [[ // ,cols: [[
{field:'add_time', title: '修改时间',align:'center'} // {field:'add_time', title: '修改时间',align:'center'}
,{field:'cost', title: '价格',align:'center'} // ,{field:'cost', title: '价格',align:'center'}
]] // ]]
,id:'Abnormal' // ,id:'Abnormal'
,page:{ // ,page:{
//
} // }
,done: function(res, curr, count) { // ,done: function(res, curr, count) {
} // }
}); // });
}, // },
}, $(function () { }, $(function () {
app.init(); app.init();
}) })
......
<div class="table-list" id="shopList" style="width: 95%"> <div class="table-list" id="shopList" style="width: 95%">
<table class="layui-table" lay-filter="test" id="list"></table> <table class="layui-table" id="tb" lay-filter="parse-table-demo1">
<thead>
<tr>
@if(!empty($ladder_price) && is_array($ladder_price))
@foreach($ladder_price as $k=>$v)
<th><div style="width:30px!important">阶梯数量 <?= $k+1 ?></div></th>
<th><div style="width:70px!important">国内含税价<?= $k+1 ?>(¥)</div></th>
<th><div style="width:70px!important">香港交货价<?= $k+1 ?></div></th>
@endforeach
@endif
</tr>
</thead>
<tr >
@if(!empty($ladder_price) && is_array($ladder_price))
@foreach($ladder_price as $k=>$v)
<td>{{$v['purchases']}}</td>
<td>{{$v['price_us']}}</td>
<td>{{$v['price_cn']}}</td>
@endforeach
@endif
</tr>
</tbody>
</table>
</div> </div>
\ No newline at end of file
<input type="hidden" value="<?= $_GET['sku_id'] ?>" id="goods_id">
\ No newline at end of file
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