Commit 552d3453 by 朱继来

temp

parent a3a57461
......@@ -61,9 +61,9 @@
'self_map' => [
0 => 'id',
1 => 'goods_name',
2 => 'brand_name',
3 => 'num',
1 => 'num',
2 => 'goods_name',
3 => 'brand_name',
],
// 特殊业务类型
......
+(function($){
$.lie = $.lie || {version: "v1.0.0"};
$.extend($.lie, {
goods:{
add:function(){
$('.order-change-main').on('click', '.add_goods', function() {
layer.open({
area: ['1000px', '400px'],
type: 1,
title: '新增商品',
content: $('#addGoods'),
btn: ['新增', '取消'],
btn1: function() {
},
btn2: function(index) {
layer.close(index)
}
})
})
// 获取SKU信息
$('.get-sku').click(function() {
var sku_id = $(this).siblings('.search-sku').val();
if (!sku_id) {
layer.msg('请输入SKU_ID');
return false;
}
if (!/\d/.test(sku_id)) {
layer.msg('参数错误,请输入正确的SKU_ID');
return false;
}
$.ajax({
url: '/ajax/getSku',
type: 'post',
data: {sku_id : sku_id.trim()},
dataType: 'json',
success: function (resp) { console.log(resp)
if (resp.errcode != 0) {
layer.msg(resp.errmsg);
return false;
}
$('.sku-info').show();
var data = resp.data;
var status_val = '';
$('.goods_name').text(data.goods_name);
$('.brand_name').text(data.brand_name);
$('.supplier_name').text(data.supplier_name);
$('.stock').text(data.goods_number);
$('.moq').text(data.min_buy);
$('.mpq').text(data.min_mpq);
// if (goods_type == 1) {
// var status = data.goods_status;
// } else {
// var status = data.status;
// }
// switch (status) {
// case 0: status_val = '待入库'; break;
// case 1: status_val = '审核通过(上架)'; break;
// case 3: status_val = '下架'; break;
// case 4: status_val = '删除'; break;
// }
status_val = data.is_buy ? '是' : '否';
$('.status').text(status_val);
$('.goods_id').val(data.goods_id);
$('.goods_type').val(data.goods_type);
//阶梯价格
if (data.tiered != null) {
var len = data.tiered.length;
if (len > 0) {
var html = '';
html += '<tr><th>阶梯</th><th>RMB价格</th>';
if (data.ac_type) {
switch (data.ac_type) {
case 1: html += '<th>限时限量</th>'; break;
case 2: html += '<th>活动价</th>'; break;
case 3: html += '<th>会员价</th>'; break;
default: html += ''; break;
}
}
if (goods_type == 1 && data.tiered[0]['price_us']) {
html += '<th>USD价格</th>';
}
html += '</tr>';
for (var i = 0; i < len; i++) {
html += '<tr>';
if (data.ac_type) {
html += '<td><span>'+data.tiered[i]['purchases']+'</span></td><td>¥<span class="price-line">'+data.tiered[i]['price_cn']+'</span></td><td>¥<span>'+data.tiered[i]['price_ac']+'</span></td>';
} else {
html += '<td><span>'+data.tiered[i]['purchases']+'</span></td><td>¥<span>'+data.tiered[i]['price_cn']+'</span></td>';
}
if (goods_type == 1) {
html += '<td>$<span>'+data.tiered[i]['price_us']+'</span></td>';
}
html += '</tr>';
}
// $('.ladder_price_table tr:gt(0)').remove();
$('.ladder_price_table').empty().append(html);
}
}
}
})
})
},
}
});
})(jQuery)
......@@ -93,7 +93,7 @@
<div class="batch-btn">
<a class="btn btn-success goods_import" data-type="2">批量导入物料</a>
<a class="btn btn-info" href="http://img.ichunt.com/doc/excel/template/%E8%87%AA%E8%90%A5%E8%AE%A2%E5%8D%95%E6%89%B9%E9%87%8F%E6%B7%BB%E5%8A%A0%E6%A8%A1%E6%9D%BF.csv">自营物料模板下载</a>
<a class="btn btn-info" href="http://img.ichunt.com/doc/excel/template/%E8%87%AA%E8%90%A5%E6%89%B9%E9%87%8F%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.csv">自营物料模板下载</a>
</div>
</div>
</div>
......
......@@ -228,7 +228,7 @@
<div class="batch-btn">
<a class="btn btn-success goods_import" data-type="2">批量导入物料</a>
<a class="btn btn-info" href="http://img.ichunt.com/doc/excel/template/%E8%87%AA%E8%90%A5%E8%AE%A2%E5%8D%95%E6%89%B9%E9%87%8F%E6%B7%BB%E5%8A%A0%E6%A8%A1%E6%9D%BF.csv">自营物料模板下载</a>
<a class="btn btn-info" href="http://img.ichunt.com/doc/excel/template/%E8%87%AA%E8%90%A5%E6%89%B9%E9%87%8F%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.csv">自营物料模板下载</a>
</div>
</div>
</div>
......
......@@ -228,7 +228,7 @@
<div class="batch-btn">
<a class="btn btn-success goods_import" data-type="2">批量导入物料</a>
<a class="btn btn-info" href="http://img.ichunt.com/doc/excel/template/%E8%87%AA%E8%90%A5%E8%AE%A2%E5%8D%95%E6%89%B9%E9%87%8F%E6%B7%BB%E5%8A%A0%E6%A8%A1%E6%9D%BF.csv">自营物料模板下载</a>
<a class="btn btn-info" href="http://img.ichunt.com/doc/excel/template/%E8%87%AA%E8%90%A5%E6%89%B9%E9%87%8F%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.csv">自营物料模板下载</a>
</div>
</div>
</div>
......
<style>
#addGoods{ display: none; }
.search-sku{width: 240px !important;}
.label-prompt{padding: 6px 6px;}
.get-sku{padding: 3px 6px; margin-right: 20px;}
</style>
<div id="addGoods">
<div class="ibox-content">
<div class="row">
<div class="col-sm-12">
<input type="text" class="search-sku" name="sku_id" value="" placeholder="请输入SKUID">
<a class="btn btn-info get-sku">获取SKU信息</a>
<span>快捷入口:<a href="{{ $order_info['order_goods_type'] == 1 ? Config('website.search-sku-url-1') : Config('website.search-sku-url-2')}}" target="_blank">查询SKU</a></span>
</div>
</div>
<!-- SKU信息 -->
<div class="sku-info">
<h4>型号信息</h4>
<div class="sku-info-left">
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<span>SKU型号:</span>
<span class="goods_name"></span>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<span>制造商:</span>
<span class="brand_name"></span>
</div>
</div>
</div>
<div class="row">
<!-- <div class="col-sm-6">
<div class="form-group">
<span>供应商:</span>
<span class="supplier_name"></span>
</div>
</div> -->
<div class="col-sm-6">
<div class="form-group">
<span>库存数量:</span>
<span class="stock"></span>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<span>起订量:</span>
<span class="moq"></span>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<span>标准包装量:</span>
<span class="mpq"></span>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<span>状态:</span>
<span class="status"></span>
</div>
</div>
</div>
</div>
<div class="sku-info-right table-responsive">
<table class="table table-hover ladder_price_table">
<tr>
<th>阶梯</th>
<th>RMB价格</th>
</tr>
</table>
</div>
<input type="hidden" name="goods_id" class="goods_id" value="">
</div>
</div>
</div>
<script>
var goods_type = "{{ $order_info['order_goods_type'] }}";
</script>
......@@ -88,7 +88,11 @@
@endif
<!-- 调价 -->
<p>调价</p>
<div>
<p style="float: left;">调价</p>
<a class="btn btn-info add_goods" style="float: right; margin-bottom: 5px;">新增商品</a>
</div>
<table class="table table-bordered table-hover order-change-table">
<thead>
<th width="20%">供应商</th>
......@@ -491,6 +495,8 @@
</div>
@endif
@include('detail.addGoods')
<script>
var is_manager = "{{ $role == 1 || $role == 2 || $role == 10 ? true : false }}";
......
......@@ -958,4 +958,5 @@
}
$.lie.order.details();
$.lie.goods.add();
</script>
\ No newline at end of file
......@@ -13,4 +13,5 @@
<script src="/js/orderamount.js"></script>
<script src="/js/plugins/DatePicker/WdatePicker.js"></script>
<script src="/js/refund.js?v=<?= time() ?>"></script>
<script src="/js/goods.js?v=<?= time() ?>"></script>
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