更新添加联营物料

parent 00c8844a
......@@ -36,10 +36,11 @@ class PureController extends Controller
}
//联营价格明细弹框
private function PureComPrice($request,$data,$id){
$goods_id = $request->input("goods_id");
$data['title']='自营价格明细';
$data['time']=time();
$res = (new ServerMicModel())->synchronization(['goods_id'=>[$request->input("goods_id")]]);
$data['']
$res = (new ServerMicModel())->synchronization(['goods_id'=>[$goods_id]],2);
$data['ladder_price'] = $res['code'] > 0 ? [] : @$res['data'][$goods_id]['ladder_price'];
return view('pure',$data);
}
......
......@@ -127,45 +127,12 @@
sku价格明细弹框
*/
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({
type:1,
title: '调整固定额度',
shadeClose: true,
shade: 0.8,
area: ['380px', '280px'],
content: $("#box2"),
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()
})
})
}
type: 2
, scrollbar: false
, area: ['700px', '570px']
, maxmin: true
, title: '价格变化明细'
, content: '/pure/PureComPrice?goods_id='+goods_id
});
}
\ No newline at end of file
......@@ -131,46 +131,14 @@
/*
sku价格明细弹框
*/
function purePrice(goods_id) {
$("input[name='id2']").val(id)
$("input[name='mobile2']").val(mobile)
$("input[name='fixed_amount2']").val(fixed_amount)
function purePrice(sku_id) {
layer.open({
type:1,
title: '调整固定额度',
shadeClose: true,
shade: 0.8,
area: ['380px', '280px'],
content: $("#box2"),
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()
})
})
}
type: 2
, scrollbar: false
, area: ['700px', '570px']
, maxmin: true
, title: '价格变化明细'
, content: '/pure/PurePrice?sku_id='+sku_id
});
}
/*
......
......@@ -9,32 +9,32 @@
app.tableList()
})
},
tableList:function () {
layui.table.render({
elem: '#list'
,url:'/api/PurePrice'
,method:'post'
,cellMinWidth: 100 //全局定义常规单元格的最小宽度
,request: {
pageName: 'p' //页码的参数名称,默认:page
,limitName: 'limit' //每页数据量的参数名,默认:limit
}
,where: {'goods_id':$("#goods_id").val()}
,loading:true
,first: true //不显示首页
,last: false //不显示尾页
,cols: [[
{field:'add_time', title: '修改时间',align:'center'}
,{field:'cost', title: '价格',align:'center'}
]]
,id:'Abnormal'
,page:{
}
,done: function(res, curr, count) {
}
});
},
// tableList:function () {
// layui.table.render({
// elem: '#list'
// ,url:'/api/PurePrice'
// ,method:'post'
// ,cellMinWidth: 100 //全局定义常规单元格的最小宽度
// ,request: {
// pageName: 'p' //页码的参数名称,默认:page
// ,limitName: 'limit' //每页数据量的参数名,默认:limit
// }
// ,where: {'goods_id':$("#goods_id").val()}
// ,loading:true
// ,first: true //不显示首页
// ,last: false //不显示尾页
// ,cols: [[
// {field:'add_time', title: '修改时间',align:'center'}
// ,{field:'cost', title: '价格',align:'center'}
// ]]
// ,id:'Abnormal'
// ,page:{
//
// }
// ,done: function(res, curr, count) {
// }
// });
// },
}, $(function () {
app.init();
})
......
<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>
\ 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