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
08ec2664
authored
Jul 13, 2022
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
更新IQC检测
parent
574822a0
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
229 additions
and
3 deletions
app/Http/Controllers/Api/SupplierExaminationApiController.php
app/Http/Controllers/SupplierExaminationController.php
resources/views/script/SupplierExaminationListScript.blade.php
resources/views/script/UpdateSupplierExaminationScript.blade.php
resources/views/web/UpdateSupplierExamination.blade.php
app/Http/Controllers/Api/SupplierExaminationApiController.php
View file @
08ec2664
...
...
@@ -56,6 +56,37 @@ class SupplierExaminationApiController extends Controller
$this
->
response
(
-
1
,
'添加失败'
,
$result
);
}
//修改
//添加
public
function
UpdateSupplierExamination
(
$request
)
{
$params
=
$request
->
only
([
'supplier_name'
,
'examine_time'
,
'purchase_name'
,
'sku_name'
,
'brand_name'
,
'amount'
,
'examine_amount'
,
'unhealthy_amount'
,
'unhealthy_content'
,
'examine_result'
,
'abnormal_level'
,
'handle_way'
,
'remark'
,
]);
$validator
=
new
SupplierExaminationValidator
();
$validateResult
=
$validator
->
checkSave
(
$params
);
if
(
$validateResult
)
{
$this
->
response
(
-
1
,
$validateResult
);
}
$result
=
(
new
SupplierExaminationService
())
->
saveSupplierExamination
(
$params
);
if
(
$result
)
{
$this
->
response
(
0
,
'添加成功'
);
}
$this
->
response
(
-
1
,
'添加失败'
,
$result
);
}
//删除
public
function
DeleteSupplierLog
(
$request
)
{
...
...
app/Http/Controllers/SupplierExaminationController.php
View file @
08ec2664
...
...
@@ -10,6 +10,7 @@ use App\Http\Services\ViewCheckService;
use
App\Model\IntracodeModel
;
use
App\Model\SupplierAccountModel
;
use
App\Model\SupplierChannelModel
;
use
App\Model\SupplierExaminationModel
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\DB
;
...
...
@@ -57,7 +58,24 @@ class SupplierExaminationController extends Controller
$purchaseUsers
=
(
new
IntracodeModel
())
->
getAllEncode
();
$purchaseUserNames
=
collect
(
$purchaseUsers
)
->
pluck
(
'name'
,
'name'
)
->
toArray
();
$this
->
data
[
'purchaseUserNames'
]
=
$purchaseUserNames
;
$this
->
data
[
'title'
]
=
'添加供应商账号'
;
return
$this
->
view
(
'添加供应商账号'
);
$this
->
data
[
'title'
]
=
'添加IQC检测记录'
;
return
$this
->
view
(
'添加IQC检测记录'
);
}
public
function
UpdateSupplierExamination
(
$request
)
{
$id
=
$request
->
get
(
'id'
);
if
(
empty
(
$id
))
{
return
'请选择对应的检测记录'
;
}
//获取所有采购员提供选择
$purchaseUsers
=
(
new
IntracodeModel
())
->
getAllEncode
();
$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'
]);
$this
->
data
[
'examination'
]
=
$examination
;
$this
->
data
[
'title'
]
=
'添加IQC检测记录'
;
return
$this
->
view
(
'添加IQC检测记录'
);
}
}
\ No newline at end of file
resources/views/script/SupplierExaminationListScript.blade.php
View file @
08ec2664
...
...
@@ -73,7 +73,6 @@
}
});
//根据供应商编码已经品牌等去基石调用接口下架
$
(
"#add_supplier_examination"
).
click
(
function
()
{
layer
.
open
({
type
:
2
,
...
...
@@ -86,6 +85,25 @@
});
});
$
(
"#update_supplier_examination"
).
click
(
function
()
{
let
checkStatus
=
table
.
checkStatus
(
'supplierExaminationList'
);
let
data
=
checkStatus
.
data
;
if
(
!
data
.
length
)
{
layer
.
msg
(
'请先选择要操作的记录'
,
{
icon
:
5
})
}
else
{
let
id
=
data
[
0
].
id
;
layer
.
open
({
type
:
2
,
content
:
'/supplier_examination/UpdateSupplierExamination?view=iframe&id='
+
id
,
area
:
[
'80%'
,
'70%'
],
title
:
'添加IQC检测记录'
,
end
:
function
()
{
table
.
reload
(
'supplierExaminationList'
);
}
});
}
});
form
.
on
(
'submit(load)'
,
function
(
data
)
{
whereCondition
=
$
.
extend
(
false
,
initCondition
,
data
.
field
);
...
...
resources/views/script/UpdateSupplierExaminationScript.blade.php
0 → 100644
View file @
08ec2664
<script>
layui
.
use
([
'table'
,
'form'
,
'element'
,
'table'
,
'layer'
,
'admin'
,
'xmSelect'
],
function
()
{
let
admin
=
layui
.
admin
;
let
form
=
layui
.
form
;
let
element
=
layui
.
element
;
let
xmSelect
=
layui
.
xmSelect
;
form
.
on
(
'submit(addSupplierExamination)'
,
function
(
data
)
{
let
url
=
'/api/supplier_examination/UpdateSupplierExamination'
;
let
res
=
ajax
(
url
,
data
.
field
);
if
(
!
res
)
{
layer
.
msg
(
'网络错误,请重试'
,
{
icon
:
6
});
}
else
{
if
(
res
.
err_code
===
0
)
{
admin
.
closeThisDialog
();
parent
.
layer
.
msg
(
res
.
err_msg
,
{
icon
:
6
});
}
else
{
parent
.
layer
.
msg
(
res
.
err_msg
,
{
icon
:
5
});
}
}
return
false
;
});
form
.
on
(
'submit(cancel)'
,
function
(
data
)
{
admin
.
closeThisDialog
();
});
});
</script>
\ No newline at end of file
resources/views/web/UpdateSupplierExamination.blade.php
0 → 100644
View file @
08ec2664
<style>
.layui-form-item
{
margin-bottom
:
5px
;
}
</style>
<div
class=
"layui-card"
>
<div
class=
"layui-card-body"
>
<blockquote
class=
"layui-elem-quote layui-text"
>
<b>
IQC基本信息
</b>
</blockquote>
<form
class=
"layui-form"
action=
""
>
<div
class=
"layui-form-item"
>
<div
class=
"layui-col-md6"
>
@inject('datePresenter','App\Presenters\DatePresenter')
{!! $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]) !!}
</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>
</div>
<div
class=
"layui-col-md6"
>
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
数量 :
</label>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"amount"
id=
"amount"
placeholder=
"请填写数量(个)"
class=
"layui-input"
value=
"{{$examination['amount'] or ''}}"
>
</div>
</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=
"brand_name"
id=
"brand_name"
placeholder=
"请填写品牌"
class=
"layui-input"
value=
"{{$examination['brand_name'] or ''}}"
>
</div>
</div>
<div
class=
"layui-col-md6"
>
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
型号 :
</label>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"sku_name"
id=
"sku_name"
placeholder=
"请输入登录账号"
class=
"layui-input"
value=
"{{$examination['sku_name'] or ''}}"
>
</div>
</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=
"examine_amount"
id=
"examine_amount"
placeholder=
"请填写检测数量(个)"
class=
"layui-input"
value=
"{{$examination['examine_amount'] or ''}}"
>
</div>
</div>
<div
class=
"layui-col-md6"
>
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
不良数 :
</label>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"unhealthy_amount"
id=
"unhealthy_amount"
placeholder=
"请填写不良数(个)"
class=
"layui-input"
value=
"{{$examination['unhealthy_amount'] or ''}}"
>
</div>
</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=
"unhealthy_content"
id=
"unhealthy_content"
placeholder=
"请填写不良现象"
class=
"layui-input"
value=
"{{$examination['unhealthy_content'] or ''}}"
>
</div>
</div>
<div
class=
"layui-col-md6"
>
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
检验结果 :
</label>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"examine_result"
id=
"examine_result"
placeholder=
"请填写检验结果"
class=
"layui-input"
value=
"{{$examination['examine_result'] or ''}}"
>
</div>
</div>
</div>
<div
class=
"layui-form-item"
>
<div
class=
"layui-col-md6"
>
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('abnormal_level','异常等级 : ',$examination['abnormal_level'],
[1=>1,2=>2,3=>3],['required'=>true]) !!}
</div>
<div
class=
"layui-col-md6"
>
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
处理方式 :
</label>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"handle_way"
id=
"handle_way"
placeholder=
"请填写处理方式"
class=
"layui-input"
value=
"{{$examination['handle_way'] or ''}}"
>
</div>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
备注说明 :
</label>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"remark"
id=
"remark"
placeholder=
"备注说明"
class=
"layui-input"
value=
"{{$examination['remark'] or ''}}"
>
</div>
</div>
<div
class=
"layui-form-item"
>
<div
align=
"center"
style=
"margin-top: 20px;text-align: right"
>
<button
type=
"button"
class=
"layui-btn layui-btn-sm layui-btn-info submit-loading"
lay-submit
lay-filter=
"addSupplierExamination"
>
确认
</button>
<button
type=
"button"
class=
"layui-btn layui-btn-sm layui-btn-primary"
lay-submit
lay-filter=
"cancel"
>
取消
</button>
</div>
</div>
</form>
</div>
</div>
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