Commit fe4671f9 by 杨树贤

修复bug

parent 53822317
......@@ -54,6 +54,11 @@ class SupplierExaminationFilter
$query->where('purchase_name', $map['purchase_name']);
}
if (!empty($map['examine_result'])) {
$query->where('examine_result', $map['examine_result']);
}
if ((isset($map['abnormal_level']) && $map['abnormal_level'] === '0') || !empty($map['abnormal_level'])) {
$query->where('abnormal_level', $map['abnormal_level']);
}
......
......@@ -138,9 +138,8 @@ class SupplierExaminationService
array_values(config('field.SupplierExamineResult')))) {
throw new \Exception("检验结果只能(退货|特批入库|正常入库)其中一个且不能为空 (第${lineNo}行),请修改后再次提交");
}
if (!in_array($abnormalLevel, [1, 2, 3])) {
throw new \Exception("存在不合理的异常等级,等级必须为纯数字1,2,3 (第${lineNo}行),请修改后再次提交");
if (!empty($abnormalLevel) && !in_array($abnormalLevel, [1, 2, 3])) {
throw new \Exception("存在不合理的异常等级,等级必须为纯数字1,2,3或者不填 (第${lineNo}行),请修改后再次提交");
}
$examineData[] = [
......
......@@ -31,6 +31,8 @@ class DatePresenter
,type: 'date'
,format: 'yyyy-MM-dd'
});
// $('input[name=$name]').removeAttr('lay-key');
});
}
</script>
......
......@@ -39,7 +39,7 @@ class TransformableTimeIntervalPresenter
dateInterval="$todayTimeInterval"
id="${unique}_today">今日</button>
</div>
<div class="layui-col-md2">
<div class="layui-col-md2" id="three_days_button">
<button type="button" class="layui-btn layui-btn-primary layui-btn-sm day_type_button"
dateInterval="$threeDayTimeInterval"
id="${unique}_last_days">近三天</button>
......
......@@ -20,7 +20,7 @@ class StatusPresenter
$requiredHtml
$text
</label>
<div class="layui-input-inline" style="width: $width;margin-top: 0px">
<div class="layui-input-inline" style="width: $width">
<select name="$name" id="$name" lay-filter="$name" $isDisable lay-search="">
{$this->optionsRender($data, $status)}
</select>
......
......@@ -88,19 +88,32 @@
}
let suppliers = {!! json_encode($suppliers) !!};
let supplier = suppliers[supplierCode];
let selectedSupplierIds = $('#supplier_ids').val();
selectedSupplierIds = selectedSupplierIds ? selectedSupplierIds.split(',') : [];
if (jQuery.inArray(supplier['supplier_id'], selectedSupplierIds) === 0) {
layer.msg('列表已经有该供应商,请重新选择', {icon: 6});
return;
}
let appendHtml = `
<tr>
<td>${supplier['supplier_name']}</td>
<td>${supplier['system_tags']}</td>
<td>${supplier['customer_tags']}</td>
<td><button type="button" class="layui-btn layui-btn-xs deleteSupplier" value="${supplier['supplier_id']}">删除</button> </td>
</tr>
`;
console.log(appendHtml);
let selectedSupplierIds = $('#supplier_ids').val();
selectedSupplierIds = selectedSupplierIds ? selectedSupplierIds.split(',') : [];
selectedSupplierIds.push(supplier['supplier_id']);
$('#supplier_ids').val(selectedSupplierIds.join(','));
$('#operateSupplierList').append(appendHtml);
});
$(document).on('click', '.deleteSupplier', function () {
let selectedSupplierIds = $('#supplier_ids').val();
let deleteSupplierId = $(this).attr('value');
selectedSupplierIds = selectedSupplierIds ? selectedSupplierIds.split(',') : [];
selectedSupplierIds.splice(jQuery.inArray(deleteSupplierId, selectedSupplierIds), 1);
$('#supplier_ids').val(selectedSupplierIds.join(','));
$(this).parents('tr').remove();
});
});
</script>
\ No newline at end of file
......@@ -87,6 +87,7 @@
{field: 'delivery_sn', title: '送货单', align: 'center', width: 80},
{field: 'tally_request', title: '理货要求', align: 'center', width: 80},
{field: 'examine_request', title: '验货要求', align: 'center', width: 100},
{field: 'unhealthy_amount', title: '不良数', align: 'center', width: 80},
{field: 'abnormal_level', title: '异常等级', align: 'center', width: 80},
{field: 'unhealthy_content', title: '不良现象', align: 'center', width: 150},
{field: 'examine_result', title: '检验结果', align: 'center', width: 150},
......@@ -97,6 +98,9 @@
if (getQueryVariable('supplier_id')) {
url = '/api/supplier_examination/GetSupplierExaminationList?supplier_id=' + getQueryVariable('supplier_id');
}
$('#three_days_button').remove();
table.render({
elem: '#supplierExaminationList'
, url: url
......
......@@ -179,7 +179,7 @@
<div class="layui-col-xs6">
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('abnormal_level','异常等级 : ','',
config('field.SupplierAbnormalLevel'),['required'=>true,'width'=>'250px']) !!}
config('field.SupplierAbnormalLevel'),['width'=>'250px']) !!}
</div>
<div class="layui-col-xs6">
<label class="layui-form-label">不良现象 : </label>
......
......@@ -58,12 +58,14 @@
<col width="300">
<col width="400">
<col width="400">
<col width="200">
</colgroup>
<thead>
<tr>
<th>供应商名称</th>
<th>系统标签</th>
<th>自定义标签</th>
<th>操作</th>
</tr>
</thead>
<tbody id="operateSupplierList">
......
......@@ -24,6 +24,10 @@
@inject('transformableTimeIntervalPresenter','App\Presenters\Filter\TransformableTimeIntervalPresenter')
{!! $transformableTimeIntervalPresenter->render(['examine_time'=>'检货时间']) !!}
</div>
<div class="layui-inline">
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('examine_result','检验结果',request()->get('status'),config('field.SupplierExamineResult')) !!}
</div>
</div>
<div class="layui-row" style="margin-top:10px;margin-bottom: 10px;margin-left: 20px;">
<button class="layui-btn layui-btn-sm layui-btn load" id="getSupplierListButton" lay-submit=""
......
......@@ -180,7 +180,7 @@
<div class="layui-col-xs6">
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('abnormal_level','异常等级 : ',$examination['abnormal_level'],
config('field.SupplierAbnormalLevel'),['required'=>true,'width'=>'250px']) !!}
config('field.SupplierAbnormalLevel'),['width'=>'250px']) !!}
</div>
<div class="layui-col-xs6">
<label class="layui-form-label">不良现象 : </label>
......
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