Commit 7d3ecbce by 杨树贤

修复修改问题

parent d05ff3df
......@@ -46,7 +46,7 @@ class SupplierExaminationController extends Controller
{
//获取所有采购员提供选择
$purchaseUsers = (new IntracodeModel())->getAllEncode();
$purchaseUserNames = collect($purchaseUsers)->pluck('name','name')->toArray();
$purchaseUserNames = collect($purchaseUsers)->pluck('name', 'name')->toArray();
$this->data['purchaseUserNames'] = $purchaseUserNames;
$this->data['title'] = 'IQC检测列表';
return $this->view('IQC检测列表');
......@@ -54,9 +54,14 @@ class SupplierExaminationController extends Controller
public function AddSupplierExamination($request)
{
$supplierId = $request->get('supplier_id');
if ($supplierId) {
$supplierName = SupplierChannelModel::where('supplier_id', $supplierId)->value('supplier_name');
$this->data['supplierName'] = $supplierName;
}
//获取所有采购员提供选择
$purchaseUsers = (new IntracodeModel())->getAllEncode();
$purchaseUserNames = collect($purchaseUsers)->pluck('name','name')->toArray();
$purchaseUserNames = collect($purchaseUsers)->pluck('name', 'name')->toArray();
$this->data['purchaseUserNames'] = $purchaseUserNames;
$this->data['title'] = '添加IQC检测记录';
return $this->view('添加IQC检测记录');
......@@ -68,12 +73,17 @@ class SupplierExaminationController extends Controller
if (empty($id)) {
return '请选择对应的检测记录';
}
$supplierId = $request->get('supplier_id');
if ($supplierId) {
$supplierName = SupplierChannelModel::where('supplier_id', $supplierId)->value('supplier_name');
$this->data['supplierName'] = $supplierName;
}
//获取所有采购员提供选择
$purchaseUsers = (new IntracodeModel())->getAllEncode();
$purchaseUserNames = collect($purchaseUsers)->pluck('name','name')->toArray();
$purchaseUserNames = collect($purchaseUsers)->pluck('name', 'name')->toArray();
$this->data['purchaseUserNames'] = $purchaseUserNames;
$examination = SupplierExaminationModel::where('id', $id)->first()->toArray();
$examination['examine_time'] = date('Y-m-d', $examination['examine_time']);
$examination['examine_time'] = $examination['examine_time'] ? date('Y-m-d', $examination['examine_time']) : '';
$this->data['examination'] = $examination;
$this->data['title'] = '添加IQC检测记录';
return $this->view('添加IQC检测记录');
......
......@@ -61,13 +61,14 @@
$("#add_supplier_examination").click(function () {
layer.open({
type: 2,
content: '/supplier_examination/AddSupplierExamination?view=iframe',
content: '/supplier_examination/AddSupplierExamination?view=iframe&supplier_id=' + getQueryVariable('supplier_id'),
area: ['80%', '70%'],
title: '添加IQC检测记录',
end: function () {
table.reload('supplierExaminationList');
}
});
return false;
});
$("#update_supplier_examination").click(function () {
......@@ -83,7 +84,7 @@
let id = data[0].id;
layer.open({
type: 2,
content: '/supplier_examination/UpdateSupplierExamination?view=iframe&id=' + id,
content: '/supplier_examination/UpdateSupplierExamination?view=iframe&id=' + id + '&supplier_id=' + getQueryVariable('supplier_id'),
area: ['80%', '70%'],
title: '添加IQC检测记录',
end: function () {
......@@ -91,6 +92,7 @@
}
});
}
return false;
});
//启用
......
......@@ -15,19 +15,36 @@
{!! $datePresenter->render('examine_time','检货时间 : ','') !!}
</div>
<div class="layui-col-md6">
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('purchase_name','采购员 : ','',
$purchaseUserNames,['required'=>true]) !!}
@if(empty($supplierName))
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('purchase_name','采购员 : ','',
$purchaseUserNames,['required'=>true]) !!}
@else
<label class="layui-form-label"><span class="require">*</span>采购员 : </label>
<div class="layui-input-block" style="padding-top: 7px">
<input type="hidden" name="purchase_name" value="{{request()->user->name}}">
{{request()->user->name}}
</div>
@endif
</div>
</div>
<div class="layui-form-item">
<div class="layui-col-md6">
<label class="layui-form-label"><span class="require">*</span>供应商 : </label>
<div class="layui-input-block">
<input type="text" name="supplier_name" id="supplier_name"
placeholder="请输入供应商名称" class="layui-input"
value="{{$account['mobile'] or ''}}">
</div>
@if(empty($supplierName))
<label class="layui-form-label"><span class="require">*</span>供应商 : </label>
<div class="layui-input-block">
<input type="text" name="supplier_name" id="supplier_name"
placeholder="请输入供应商名称" class="layui-input"
value="{{$account['supplier_name'] or ''}}">
</div>
@else
<label class="layui-form-label"><span class="require">*</span>供应商 : </label>
<div class="layui-input-block" style="padding-top: 7px">
<input type="hidden" name="supplier_name" value="{{$supplierName}}">
{{$supplierName}}
</div>
@endif
</div>
<div class="layui-col-md6">
<label class="layui-form-label"><span class="require">*</span>数量 : </label>
......@@ -96,7 +113,7 @@
<div class="layui-col-md6">
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('abnormal_level','异常等级 : ','',
[0=>0,1=>1,2=>2,3=>3],['required'=>true]) !!}
[1=>1,2=>2,3=>3],['required'=>true]) !!}
</div>
<div class="layui-col-md6">
<label class="layui-form-label"><span class="require">*</span>处理方式 : </label>
......
......@@ -58,4 +58,6 @@
<table class="layui-table" id="supplierExaminationList" lay-filter="supplierExaminationList"></table>
</div>
@include('script.SupplierExaminationListScript')
\ No newline at end of file
@if(request()->get('supplier_id'))
@include('script.SupplierExaminationListScript')
@endif
......@@ -16,19 +16,35 @@
{!! $datePresenter->render('examine_time','检货时间 : ',$examination['examine_time']) !!}
</div>
<div class="layui-col-md6">
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('purchase_name','采购员 : ',$examination['purchase_name'],
$purchaseUserNames,['required'=>true]) !!}
@if(empty($supplierName))
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('purchase_name','采购员 : ',$examination['purchase_name'],
$purchaseUserNames,['required'=>true]) !!}
@else
<label class="layui-form-label"><span class="require">*</span>采购员 : </label>
<div class="layui-input-block" style="padding-top: 7px">
<input type="hidden" name="purchase_name" value="{{request()->user->name}}">
{{request()->user->name}}
</div>
@endif
</div>
</div>
<div class="layui-form-item">
<div class="layui-col-md6">
<label class="layui-form-label"><span class="require">*</span>供应商 : </label>
<div class="layui-input-block">
<input type="text" name="supplier_name" id="supplier_name"
placeholder="请输入供应商名称" class="layui-input"
value="{{$examination['supplier_name'] or ''}}">
</div>
@if(empty($supplierName))
<label class="layui-form-label"><span class="require">*</span>供应商 : </label>
<div class="layui-input-block">
<input type="text" name="supplier_name" id="supplier_name"
placeholder="请输入供应商名称" class="layui-input"
value="{{$examination['supplier_name'] or ''}}">
</div>
@else
<label class="layui-form-label"><span class="require">*</span>供应商 : </label>
<div class="layui-input-block" style="padding-top: 7px">
<input type="hidden" name="supplier_name" value="{{$supplierName}}">
{{$supplierName}}
</div>
@endif
</div>
<div class="layui-col-md6">
<label class="layui-form-label"><span class="require">*</span>数量 : </label>
......@@ -97,7 +113,7 @@
<div class="layui-col-md6">
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('abnormal_level','异常等级 : ',$examination['abnormal_level'],
[0=>0,1=>1,2=>2,3=>3],['required'=>true]) !!}
[1=>1,2=>2,3=>3],['required'=>true]) !!}
</div>
<div class="layui-col-md6">
<label class="layui-form-label"><span class="require">*</span>处理方式 : </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