Commit 2d02c691 by 朱继来

调整审单新增无SKUID商品(供应商为digikey时,skuid必填)

parent 4244f186
......@@ -837,6 +837,7 @@ Class AddOrderController extends Controller
$data['add_goods_name'] = $request->input('add_goods_name', '');
$data['add_brand_name'] = $request->input('add_brand_name', '');
$data['add_supplier_name'] = $request->input('add_supplier_name', '');
$data['add_goods_id'] = $request->input('add_goods_id', 0);
$data['add_goods_number'] = $request->input('add_goods_number', 0);
$data['add_goods_price'] = $request->input('add_goods_price', 0);
$data['add_delivery_time'] = $request->input('add_delivery_time', '');
......
......@@ -80,6 +80,19 @@
})
})
// 无SKUID --- 供应商
$('#addGoodsNoSkuid').delegate('.add_supplier_name', 'keyup', function() {
var val = $(this).val();
if (val.toLowerCase() == 'digikey') {
$('.skuid-info').css('display', 'block');
$('.layui-layer-iframe .layui-layer-btn, .layui-layer-page .layui-layer-btn').css('padding-top', '50px');
} else {
$('.skuid-info').css('display', 'none');
$('.layui-layer-iframe .layui-layer-btn, .layui-layer-page .layui-layer-btn').css('padding-top', '0px');
}
})
$('.order-change-main').on('click', '.add_goods_no_skuid', function() {
layer.open({
area: ['600px'],
......@@ -92,6 +105,7 @@
var add_goods_name = $('input[name=add_goods_name]').val();
var add_brand_name = $('input[name=add_brand_name]').val();
var add_supplier_name = $('input[name=add_supplier_name]').val();
var add_goods_id = $('input[name=add_goods_id]').val();
var add_goods_number = $('input[name=add_goods_number]').val();
var add_goods_price = $('input[name=add_goods_price]').val();
var add_delivery_time = $('input[name=add_delivery_time]').val();
......@@ -115,6 +129,18 @@
return false;
}
if (add_supplier_name.toLowerCase() == 'digikey') {
if (!add_goods_id) {
layer.msg('供应商为digikey,请输入SKUID');
return false;
}
if (!reg.test(add_goods_id)) {
layer.msg('格式错误,请输入正确的SKUID');
return false;
}
}
if (!add_goods_number) {
layer.msg('请输入采购数量');
return false;
......@@ -146,6 +172,7 @@
add_goods_name: add_goods_name,
add_brand_name: add_brand_name,
add_supplier_name: add_supplier_name,
add_goods_id: add_goods_id,
add_goods_number: add_goods_number,
add_goods_price: add_goods_price,
add_delivery_time: add_delivery_time,
......
<style>
#addGoodsNoSkuid{ display: none; }
#addGoodsNoSkuid, #addGoodsNoSkuid .skuid-info { display: none; }
#addGoodsNoSkuid input { width: 280px; height: 35px; }
#addGoodsNoSkuid textarea { width: 280px; }
</style>
......@@ -21,7 +21,13 @@
<div class="form-group">
<label for="inputEmail3" class="col-sm-4 control-label"><i class="error">*</i> 供应商</label>
<div class="col-sm-8">
<input class="form-control" type="text" name="add_supplier_name" value="" placeholder="请输入供应商">
<input class="form-control add_supplier_name" type="text" name="add_supplier_name" value="" placeholder="请输入供应商">
</div>
</div>
<div class="form-group skuid-info">
<label for="inputEmail3" class="col-sm-4 control-label"><i class="error">*</i> SKUID</label>
<div class="col-sm-8">
<input class="form-control" type="text" name="add_goods_id" value="" placeholder="请输入商品SKUID">
</div>
</div>
<div class="form-group">
......
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