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
6a65bded
authored
Oct 11, 2022
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
批量修改
parent
347264c0
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
140 additions
and
1 deletions
app/Http/Controllers/Api/SupplierExaminationApiController.php
app/Http/Controllers/SupplierExaminationController.php
app/Http/Services/SupplierExaminationService.php
resources/views/script/BatchUpdateSupplierExaminationScript.blade.php
resources/views/script/SupplierExaminationListScript.blade.php
resources/views/web/BatchUpdateSupplierExamination.blade.php
resources/views/web/SupplierExaminationList.blade.php
app/Http/Controllers/Api/SupplierExaminationApiController.php
View file @
6a65bded
...
...
@@ -122,6 +122,22 @@ class SupplierExaminationApiController extends Controller
$this
->
response
(
-
1
,
'删除失败'
,
$result
);
}
public
function
BatchUpdateSupplierExamination
(
$request
)
{
$params
=
$request
->
only
([
'ids'
,
'examine_result'
]);
if
(
empty
(
$params
[
'ids'
]))
{
$this
->
response
(
-
1
,
'请选择需要批量修改的检测数据'
);
}
$result
=
(
new
SupplierExaminationService
())
->
batchUpdateSupplierExamination
(
$params
);
if
(
$result
)
{
$this
->
response
(
0
,
'修改成功'
);
}
$this
->
response
(
-
1
,
'修改失败'
,
$result
);
}
//上传IQC检测记录
private
function
ImportSupplierExamination
(
$request
)
{
...
...
app/Http/Controllers/SupplierExaminationController.php
View file @
6a65bded
...
...
@@ -93,4 +93,23 @@ class SupplierExaminationController extends Controller
$this
->
data
[
'title'
]
=
'添加IQC检测记录'
;
return
$this
->
view
(
'添加IQC检测记录'
);
}
public
function
BatchUpdateSupplierExamination
(
$request
)
{
$ids
=
$request
->
get
(
'ids'
);
if
(
empty
(
$ids
))
{
return
'请选择对应的检测记录'
;
}
$this
->
data
[
'ids'
]
=
$ids
;
$ids
=
explode
(
','
,
$ids
);
$supplierId
=
$request
->
get
(
'supplier_id'
);
if
(
$supplierId
)
{
$supplierName
=
SupplierChannelModel
::
where
(
'supplier_id'
,
$supplierId
)
->
value
(
'supplier_name'
);
$this
->
data
[
'supplierName'
]
=
$supplierName
;
}
$examinationList
=
SupplierExaminationModel
::
whereIn
(
'id'
,
$ids
)
->
get
()
->
toArray
();
$this
->
data
[
'examinationList'
]
=
$examinationList
;
$this
->
data
[
'title'
]
=
'批量修改IQC检测记录'
;
return
$this
->
view
(
'批量修改IQC检测记录'
);
}
}
\ No newline at end of file
app/Http/Services/SupplierExaminationService.php
View file @
6a65bded
...
...
@@ -54,6 +54,16 @@ class SupplierExaminationService
}
}
//批量修改
public
function
batchUpdateSupplierExamination
(
$data
)
{
$ids
=
explode
(
','
,
$data
[
'ids'
]);
return
SupplierExaminationModel
::
whereIn
(
'id'
,
$ids
)
->
update
([
'update_time'
=>
time
(),
'examine_result'
=>
$data
[
'examine_result'
],
]);
}
//删除
public
function
deleteSupplierExaminations
(
$ids
)
{
...
...
resources/views/script/BatchUpdateSupplierExaminationScript.blade.php
0 → 100644
View file @
6a65bded
<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(batchUpdateSupplierExamination)'
,
function
(
data
)
{
layer
.
confirm
(
'是否确认修改IQC检测资料?'
,
function
(
index
)
{
let
url
=
'/api/supplier_examination/BatchUpdateSupplierExamination'
;
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
{
let
errMsg
=
res
.
err_msg
;
let
msg
=
''
;
$
.
each
(
errMsg
.
split
(
'|'
),
function
(
index
,
value
)
{
msg
+=
"
<
span
>
" + value + "
<
/span><br>
"
});
parent
.
layer
.
msg
(
msg
,
{
icon
:
5
})
}
}
return
false
;
});
});
form
.
on
(
'submit(cancel)'
,
function
(
data
)
{
admin
.
closeThisDialog
();
});
});
</script>
\ No newline at end of file
resources/views/script/SupplierExaminationListScript.blade.php
View file @
6a65bded
...
...
@@ -159,6 +159,30 @@
return
false
;
});
$
(
"#batch_update_supplier_examination"
).
click
(
function
()
{
let
checkStatus
=
table
.
checkStatus
(
'supplierExaminationList'
);
let
data
=
checkStatus
.
data
;
let
ids
=
[];
$
.
each
(
data
,
function
(
i
,
v
)
{
ids
.
push
(
v
.
id
);
});
if
(
!
ids
)
{
layer
.
msg
(
'请先选择要操作的记录'
,
{
icon
:
5
});
}
else
{
ids
=
ids
.
join
(
','
)
layer
.
open
({
type
:
2
,
content
:
'/supplier_examination/BatchUpdateSupplierExamination?view=iframe&ids='
+
ids
+
'&supplier_id='
+
getQueryVariable
(
'supplier_id'
),
area
:
[
'80%'
,
'90%'
],
title
:
'批量修改IQC检测记录'
,
end
:
function
()
{
table
.
reload
(
'supplierExaminationList'
);
}
});
}
return
false
;
});
//启用
$
(
"#delete_supplier_examination"
).
click
(
function
()
{
let
checkStatus
=
table
.
checkStatus
(
'supplierExaminationList'
);
...
...
resources/views/web/BatchUpdateSupplierExamination.blade.php
0 → 100644
View file @
6a65bded
<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>
检验结果设置
</b>
</blockquote>
<form
class=
"layui-form"
action=
""
autocomplete=
"off"
>
<input
type=
"hidden"
name=
"ids"
value=
"{{$ids}}"
>
<div
class=
"layui-form-item"
>
<div
class=
"layui-col-xs12"
>
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('examine_result','检验结果', '',
config('field.SupplierExamineResult'),['required'=>true]) !!}
</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=
"batchUpdateSupplierExamination"
>
确认
</button>
<button
type=
"button"
class=
"layui-btn layui-btn-sm layui-btn-primary"
lay-submit
lay-filter=
"cancel"
>
取消
</button>
</div>
</div>
</form>
</div>
</div>
resources/views/web/SupplierExaminationList.blade.php
View file @
6a65bded
...
...
@@ -44,9 +44,11 @@
@if(checkPerm('AddSupplierExamination'))
<button
type=
"button"
class=
"layui-btn layui-btn-sm"
id=
"add_supplier_examination"
>
新增
</button>
@endif
@if(checkPerm('BatchUpdateSupplierExamination'))
<button
type=
"button"
class=
"layui-btn layui-btn-sm"
id=
"batch_update_supplier_examination"
>
批量修改
</button>
@endif
@if(checkPerm('UpdateSupplierExamination'))
<button
type=
"button"
class=
"layui-btn layui-btn-sm"
id=
"update_supplier_examination"
>
编辑
</button>
@endif
@if($routerName=='SupplierExaminationList')
@if(checkPerm('ImportSupplierExamination'))
...
...
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