Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
liexin_supplier
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
022b576b
authored
Jul 19, 2022
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
优化新增和修改iqc逻辑
parent
1b1da179
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
36 deletions
app/Http/Controllers/SupplierExaminationController.php
app/Http/Services/SupplierExaminationService.php
app/Http/Validators/SupplierExaminationValidator.php
resources/views/web/AddSupplierExamination.blade.php
resources/views/web/UpdateSupplierExamination.blade.php
app/Http/Controllers/SupplierExaminationController.php
View file @
022b576b
...
@@ -63,6 +63,8 @@ class SupplierExaminationController extends Controller
...
@@ -63,6 +63,8 @@ class SupplierExaminationController extends Controller
$purchaseUsers
=
(
new
IntracodeModel
())
->
getAllEncode
();
$purchaseUsers
=
(
new
IntracodeModel
())
->
getAllEncode
();
$purchaseUserNames
=
collect
(
$purchaseUsers
)
->
pluck
(
'name'
,
'name'
)
->
toArray
();
$purchaseUserNames
=
collect
(
$purchaseUsers
)
->
pluck
(
'name'
,
'name'
)
->
toArray
();
$this
->
data
[
'purchaseUserNames'
]
=
$purchaseUserNames
;
$this
->
data
[
'purchaseUserNames'
]
=
$purchaseUserNames
;
$this
->
data
[
'supplierNames'
]
=
(
new
SupplierChannelModel
())
->
where
(
'is_type'
,
0
)
->
pluck
(
'supplier_name'
,
'supplier_name'
)
->
toArray
();
$this
->
data
[
'title'
]
=
'添加IQC检测记录'
;
$this
->
data
[
'title'
]
=
'添加IQC检测记录'
;
return
$this
->
view
(
'添加IQC检测记录'
);
return
$this
->
view
(
'添加IQC检测记录'
);
}
}
...
@@ -82,6 +84,8 @@ class SupplierExaminationController extends Controller
...
@@ -82,6 +84,8 @@ class SupplierExaminationController extends Controller
$purchaseUsers
=
(
new
IntracodeModel
())
->
getAllEncode
();
$purchaseUsers
=
(
new
IntracodeModel
())
->
getAllEncode
();
$purchaseUserNames
=
collect
(
$purchaseUsers
)
->
pluck
(
'name'
,
'name'
)
->
toArray
();
$purchaseUserNames
=
collect
(
$purchaseUsers
)
->
pluck
(
'name'
,
'name'
)
->
toArray
();
$this
->
data
[
'purchaseUserNames'
]
=
$purchaseUserNames
;
$this
->
data
[
'purchaseUserNames'
]
=
$purchaseUserNames
;
$this
->
data
[
'supplierNames'
]
=
(
new
SupplierChannelModel
())
->
where
(
'is_type'
,
0
)
->
pluck
(
'supplier_name'
,
'supplier_name'
)
->
toArray
();
$examination
=
SupplierExaminationModel
::
where
(
'id'
,
$id
)
->
first
()
->
toArray
();
$examination
=
SupplierExaminationModel
::
where
(
'id'
,
$id
)
->
first
()
->
toArray
();
$examination
[
'examine_time'
]
=
$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
[
'examination'
]
=
$examination
;
...
...
app/Http/Services/SupplierExaminationService.php
View file @
022b576b
...
@@ -4,20 +4,12 @@
...
@@ -4,20 +4,12 @@
namespace
App\Http\Services
;
namespace
App\Http\Services
;
use
App\Http\Controllers\Filter\SupplierAccountFilter
;
use
App\Http\Controllers\Filter\SupplierExaminationFilter
;
use
App\Http\Controllers\Filter\SupplierExaminationFilter
;
use
App\Http\Transformers\SupplierAccountTransformer
;
use
App\Http\Transformers\SupplierExaminationTransformer
;
use
App\Http\Transformers\SupplierExaminationTransformer
;
use
App\Model\IntracodeModel
;
use
App\Model\IntracodeModel
;
use
App\Model\LogModel
;
use
App\Model\RedisModel
;
use
App\Model\SupplierChannelModel
;
use
App\Model\SupplierChannelModel
;
use
App\Model\SupplierContactModel
;
use
App\Model\SupplierExaminationModel
;
use
App\Model\SupplierExaminationModel
;
use
Carbon\Carbon
;
use
Maatwebsite\Excel\Facades\Excel
;
use
Maatwebsite\Excel\Facades\Excel
;
use
PhpAmqpLib\Connection\AMQPStreamConnection
;
use
PhpAmqpLib\Message\AMQPMessage
;
class
SupplierExaminationService
class
SupplierExaminationService
{
{
...
...
app/Http/Validators/SupplierExaminationValidator.php
View file @
022b576b
...
@@ -20,9 +20,9 @@ class SupplierExaminationValidator
...
@@ -20,9 +20,9 @@ class SupplierExaminationValidator
"purchase_name"
=>
"required"
,
"purchase_name"
=>
"required"
,
"sku_name"
=>
"required"
,
"sku_name"
=>
"required"
,
"brand_name"
=>
"required"
,
"brand_name"
=>
"required"
,
"amount"
=>
"required"
,
"amount"
=>
"required
|integer|min:1
"
,
"examine_amount"
=>
"required"
,
"examine_amount"
=>
"required
|integer
"
,
"unhealthy_amount"
=>
"required"
,
"unhealthy_amount"
=>
"required
|integer
"
,
"unhealthy_content"
=>
"required"
,
"unhealthy_content"
=>
"required"
,
"examine_result"
=>
"required"
,
"examine_result"
=>
"required"
,
"abnormal_level"
=>
"required"
,
"abnormal_level"
=>
"required"
,
...
@@ -32,7 +32,7 @@ class SupplierExaminationValidator
...
@@ -32,7 +32,7 @@ class SupplierExaminationValidator
$validator
=
Validator
::
make
(
$params
,
$rules
,
$messages
,
$this
->
attributes
());
$validator
=
Validator
::
make
(
$params
,
$rules
,
$messages
,
$this
->
attributes
());
//判断联系方式的表单验证
//判断联系方式的表单验证
if
(
$validator
->
fails
())
{
if
(
$validator
->
fails
())
{
return
implode
(
'|'
,
$validator
->
errors
()
->
all
());
return
implode
(
'|'
,
$validator
->
errors
()
->
all
());
}
}
return
null
;
return
null
;
...
@@ -43,6 +43,7 @@ class SupplierExaminationValidator
...
@@ -43,6 +43,7 @@ class SupplierExaminationValidator
return
[
return
[
'required'
=>
':attribute 不能为空'
,
'required'
=>
':attribute 不能为空'
,
'numeric'
=>
':attribute 必须为数字'
,
'numeric'
=>
':attribute 必须为数字'
,
'integer'
=>
':attribute 必须为整数'
,
];
];
}
}
...
...
resources/views/web/AddSupplierExamination.blade.php
View file @
022b576b
...
@@ -8,11 +8,11 @@
...
@@ -8,11 +8,11 @@
<blockquote
class=
"layui-elem-quote layui-text"
>
<blockquote
class=
"layui-elem-quote layui-text"
>
<b>
IQC基本信息
</b>
<b>
IQC基本信息
</b>
</blockquote>
</blockquote>
<form
class=
"layui-form"
action=
""
>
<form
class=
"layui-form"
action=
""
autocomplete=
"off"
>
<div
class=
"layui-form-item"
>
<div
class=
"layui-form-item"
>
<div
class=
"layui-col-xs6"
>
<div
class=
"layui-col-xs6"
>
@inject('datePresenter','App\Presenters\DatePresenter')
@inject('datePresenter','App\Presenters\DatePresenter')
{!! $datePresenter->render('examine_time','检货时间 : ','') !!}
{!! $datePresenter->render('examine_time','检货时间 : ',''
,['required'=>true]
) !!}
</div>
</div>
<div
class=
"layui-col-xs6"
>
<div
class=
"layui-col-xs6"
>
@if(empty($supplierName))
@if(empty($supplierName))
...
@@ -32,12 +32,9 @@
...
@@ -32,12 +32,9 @@
<div
class=
"layui-form-item"
>
<div
class=
"layui-form-item"
>
<div
class=
"layui-col-xs6"
>
<div
class=
"layui-col-xs6"
>
@if(empty($supplierName))
@if(empty($supplierName))
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
供应商 :
</label>
@inject('statusPresenter','App\Presenters\StatusPresenter')
<div
class=
"layui-input-block"
>
{!! $statusPresenter->render('supplier_name','供应商 : ','',
<input
type=
"text"
name=
"supplier_name"
id=
"supplier_name"
$supplierNames,['required'=>true,'width'=>'70%']) !!}
placeholder=
"请输入供应商名称"
class=
"layui-input"
value=
"{{$account['supplier_name'] or ''}}"
>
</div>
@else
@else
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
供应商 :
</label>
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
供应商 :
</label>
<div
class=
"layui-input-block"
style=
"padding-top: 7px"
>
<div
class=
"layui-input-block"
style=
"padding-top: 7px"
>
...
@@ -51,7 +48,7 @@
...
@@ -51,7 +48,7 @@
<div
class=
"layui-input-block"
>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"amount"
id=
"amount"
<input
type=
"text"
name=
"amount"
id=
"amount"
placeholder=
"请填写数量(个)"
class=
"layui-input"
placeholder=
"请填写数量(个)"
class=
"layui-input"
value=
"
{{$account['amount'] or ''}}
"
>
value=
""
>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -61,7 +58,7 @@
...
@@ -61,7 +58,7 @@
<div
class=
"layui-input-block"
>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"brand_name"
id=
"brand_name"
<input
type=
"text"
name=
"brand_name"
id=
"brand_name"
placeholder=
"请填写品牌"
class=
"layui-input"
placeholder=
"请填写品牌"
class=
"layui-input"
value=
"
{{$account['brand_name'] or ''}}
"
>
value=
""
>
</div>
</div>
</div>
</div>
<div
class=
"layui-col-xs6"
>
<div
class=
"layui-col-xs6"
>
...
@@ -69,7 +66,7 @@
...
@@ -69,7 +66,7 @@
<div
class=
"layui-input-block"
>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"sku_name"
id=
"sku_name"
<input
type=
"text"
name=
"sku_name"
id=
"sku_name"
placeholder=
"请输入型号"
class=
"layui-input"
placeholder=
"请输入型号"
class=
"layui-input"
value=
"
{{$account['sku_name'] or ''}}
"
>
value=
""
>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -79,7 +76,7 @@
...
@@ -79,7 +76,7 @@
<div
class=
"layui-input-block"
>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"examine_amount"
id=
"examine_amount"
<input
type=
"text"
name=
"examine_amount"
id=
"examine_amount"
placeholder=
"请填写检测数量(个)"
class=
"layui-input"
placeholder=
"请填写检测数量(个)"
class=
"layui-input"
value=
"
{{$account['examine_amount'] or ''}}
"
>
value=
""
>
</div>
</div>
</div>
</div>
<div
class=
"layui-col-xs6"
>
<div
class=
"layui-col-xs6"
>
...
@@ -87,7 +84,7 @@
...
@@ -87,7 +84,7 @@
<div
class=
"layui-input-block"
>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"unhealthy_amount"
id=
"unhealthy_amount"
<input
type=
"text"
name=
"unhealthy_amount"
id=
"unhealthy_amount"
placeholder=
"请填写不良数(个)"
class=
"layui-input"
placeholder=
"请填写不良数(个)"
class=
"layui-input"
value=
"
{{$account['unhealthy_amount'] or ''}}
"
>
value=
""
>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -97,7 +94,7 @@
...
@@ -97,7 +94,7 @@
<div
class=
"layui-input-block"
>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"unhealthy_content"
id=
"unhealthy_content"
<input
type=
"text"
name=
"unhealthy_content"
id=
"unhealthy_content"
placeholder=
"请填写不良现象"
class=
"layui-input"
placeholder=
"请填写不良现象"
class=
"layui-input"
value=
"
{{$account['unhealthy_content'] or ''}}
"
>
value=
""
>
</div>
</div>
</div>
</div>
<div
class=
"layui-col-xs6"
>
<div
class=
"layui-col-xs6"
>
...
@@ -105,7 +102,7 @@
...
@@ -105,7 +102,7 @@
<div
class=
"layui-input-block"
>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"examine_result"
id=
"examine_result"
<input
type=
"text"
name=
"examine_result"
id=
"examine_result"
placeholder=
"请填写检验结果"
class=
"layui-input"
placeholder=
"请填写检验结果"
class=
"layui-input"
value=
"
{{$account['examine_result'] or ''}}
"
>
value=
""
>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -120,7 +117,7 @@
...
@@ -120,7 +117,7 @@
<div
class=
"layui-input-block"
>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"handle_way"
id=
"handle_way"
<input
type=
"text"
name=
"handle_way"
id=
"handle_way"
placeholder=
"请填写处理方式"
class=
"layui-input"
placeholder=
"请填写处理方式"
class=
"layui-input"
value=
"
{{$account['handle_way'] or ''}}
"
>
value=
""
>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -129,7 +126,7 @@
...
@@ -129,7 +126,7 @@
<div
class=
"layui-input-block"
>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"remark"
id=
"remark"
<input
type=
"text"
name=
"remark"
id=
"remark"
placeholder=
"备注说明"
class=
"layui-input"
placeholder=
"备注说明"
class=
"layui-input"
value=
"
{{$account['remark'] or ''}}
"
>
value=
""
>
</div>
</div>
</div>
</div>
<div
class=
"layui-form-item"
>
<div
class=
"layui-form-item"
>
...
...
resources/views/web/UpdateSupplierExamination.blade.php
View file @
022b576b
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
<blockquote
class=
"layui-elem-quote layui-text"
>
<blockquote
class=
"layui-elem-quote layui-text"
>
<b>
IQC基本信息
</b>
<b>
IQC基本信息
</b>
</blockquote>
</blockquote>
<form
class=
"layui-form"
action=
""
>
<form
class=
"layui-form"
action=
""
autocomplete=
"off"
>
<div
class=
"layui-form-item"
>
<div
class=
"layui-form-item"
>
<div
class=
"layui-col-xs6"
>
<div
class=
"layui-col-xs6"
>
<input
type=
"hidden"
name=
"id"
value=
"{{$examination['id']}}"
>
<input
type=
"hidden"
name=
"id"
value=
"{{$examination['id']}}"
>
...
@@ -32,12 +32,9 @@
...
@@ -32,12 +32,9 @@
<div
class=
"layui-form-item"
>
<div
class=
"layui-form-item"
>
<div
class=
"layui-col-xs6"
>
<div
class=
"layui-col-xs6"
>
@if(empty($supplierName))
@if(empty($supplierName))
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
供应商 :
</label>
@inject('statusPresenter','App\Presenters\StatusPresenter')
<div
class=
"layui-input-block"
>
{!! $statusPresenter->render('supplier_name','供应商 : ',$examination['supplier_name'],
<input
type=
"text"
name=
"supplier_name"
id=
"supplier_name"
$supplierNames,['required'=>true,'width'=>'70%','disable'=>true]) !!}
placeholder=
"请输入供应商名称"
class=
"layui-input layui-disabled"
value=
"{{$examination['supplier_name'] or ''}}"
disabled
>
</div>
@else
@else
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
供应商 :
</label>
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
供应商 :
</label>
<div
class=
"layui-input-block"
style=
"padding-top: 7px"
>
<div
class=
"layui-input-block"
style=
"padding-top: 7px"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment