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
62c0ef2e
authored
Jul 13, 2022
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
删除IQC检测
parent
08ec2664
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
29 deletions
app/Http/Controllers/Api/SupplierExaminationApiController.php
app/Http/Services/SupplierExaminationService.php
resources/views/script/SupplierExaminationListScript.blade.php
resources/views/web/UpdateSupplierExamination.blade.php
app/Http/Controllers/Api/SupplierExaminationApiController.php
View file @
62c0ef2e
...
...
@@ -61,6 +61,7 @@ class SupplierExaminationApiController extends Controller
public
function
UpdateSupplierExamination
(
$request
)
{
$params
=
$request
->
only
([
'id'
,
'supplier_name'
,
'examine_time'
,
'purchase_name'
,
...
...
@@ -82,17 +83,20 @@ class SupplierExaminationApiController extends Controller
}
$result
=
(
new
SupplierExaminationService
())
->
saveSupplierExamination
(
$params
);
if
(
$result
)
{
$this
->
response
(
0
,
'
添加
成功'
);
$this
->
response
(
0
,
'
修改
成功'
);
}
$this
->
response
(
-
1
,
'
添加
失败'
,
$result
);
$this
->
response
(
-
1
,
'
修改
失败'
,
$result
);
}
//删除
public
function
DeleteSupplier
Log
(
$request
)
public
function
DeleteSupplier
Examinations
(
$request
)
{
$logId
=
$request
->
get
(
'id'
);
$model
=
new
SupplierLogModel
();
$result
=
$model
->
where
(
'id'
,
$logId
)
->
delete
();
$ids
=
$request
->
get
(
'ids'
);
$ids
=
explode
(
','
,
trim
(
$ids
));
if
(
empty
(
$ids
))
{
$this
->
response
(
-
1
,
'请选择需要删除的数据'
);
}
$result
=
(
new
SupplierExaminationService
())
->
deleteSupplierExaminations
(
$ids
);
if
(
$result
)
{
$this
->
response
(
0
,
'删除成功'
);
}
...
...
app/Http/Services/SupplierExaminationService.php
View file @
62c0ef2e
...
...
@@ -35,10 +35,16 @@ class SupplierExaminationService
$data
[
'examine_time'
]
=
strtotime
(
$data
[
'examine_time'
]);
if
(
!
empty
(
$data
[
'id'
]))
{
$data
[
'update_time'
]
=
time
();
return
SupplierExaminationModel
::
where
(
$data
[
'id'
])
->
update
(
$data
);
return
SupplierExaminationModel
::
where
(
'id'
,
$data
[
'id'
])
->
update
(
$data
);
}
else
{
$data
[
'create_time'
]
=
time
();
return
SupplierExaminationModel
::
insert
(
$data
);
}
}
//删除
public
function
deleteSupplierExaminations
(
$ids
)
{
return
SupplierExaminationModel
::
whereIn
(
'id'
,
$ids
)
->
delete
();
}
}
\ No newline at end of file
resources/views/script/SupplierExaminationListScript.blade.php
View file @
62c0ef2e
...
...
@@ -11,7 +11,7 @@
let
type
=
'all'
;
let
cols
=
[
{
type
:
'
radio
'
},
{
type
:
'
checkbox
'
},
{
field
:
'id'
,
title
:
'ID'
,
align
:
'center'
,
width
:
80
},
{
field
:
'examine_time'
,
title
:
'检货时间'
,
align
:
'center'
,
width
:
150
...
...
@@ -52,27 +52,6 @@
});
//删除
$
(
"#delete_supplier_examination"
).
click
(
function
()
{
let
checkStatus
=
table
.
checkStatus
(
'supplierExaminationList'
);
let
data
=
checkStatus
.
data
;
if
(
!
data
.
length
)
{
layer
.
msg
(
'请先选择要操作的数据'
,
{
icon
:
5
})
}
else
{
layer
.
confirm
(
'确定要禁用该数据吗?'
,
function
(
index
)
{
let
id
=
data
[
0
].
id
;
let
res
=
ajax
(
'/api/supplier_account/DisableSupplierExamination'
,
{
id
:
id
})
if
(
res
.
err_code
===
0
)
{
table
.
reload
(
'supplierExaminationList'
);
layer
.
closeAll
();
layer
.
msg
(
res
.
err_msg
,
{
icon
:
6
})
}
else
{
layer
.
msg
(
res
.
err_msg
,
{
icon
:
5
})
}
});
}
});
$
(
"#add_supplier_examination"
).
click
(
function
()
{
layer
.
open
({
type
:
2
,
...
...
@@ -104,6 +83,30 @@
}
});
//启用
$
(
"#delete_supplier_examination"
).
click
(
function
()
{
let
checkStatus
=
table
.
checkStatus
(
'supplierExaminationList'
);
let
data
=
checkStatus
.
data
;
if
(
!
data
.
length
)
{
layer
.
msg
(
'请先选择要操作的检测数据'
,
{
icon
:
5
})
}
else
{
layer
.
confirm
(
'确定要删除检测数据吗?'
,
function
(
index
)
{
let
ids
=
[];
$
.
each
(
data
,
function
(
index
,
value
)
{
ids
.
push
(
value
.
id
);
});
ids
=
ids
.
join
(
','
);
let
res
=
ajax
(
'/api/supplier_examination/DeleteSupplierExaminations'
,
{
ids
:
ids
})
if
(
res
.
err_code
===
0
)
{
table
.
reload
(
'supplierExaminationList'
);
layer
.
closeAll
();
layer
.
msg
(
res
.
err_msg
,
{
icon
:
6
})
}
else
{
layer
.
msg
(
res
.
err_msg
,
{
icon
:
5
})
}
});
}
});
form
.
on
(
'submit(load)'
,
function
(
data
)
{
whereCondition
=
$
.
extend
(
false
,
initCondition
,
data
.
field
);
...
...
resources/views/web/UpdateSupplierExamination.blade.php
View file @
62c0ef2e
...
...
@@ -11,6 +11,7 @@
<form
class=
"layui-form"
action=
""
>
<div
class=
"layui-form-item"
>
<div
class=
"layui-col-md6"
>
<input
type=
"hidden"
name=
"id"
value=
"{{$examination['id']}}"
>
@inject('datePresenter','App\Presenters\DatePresenter')
{!! $datePresenter->render('examine_time','检货时间 : ',$examination['examine_time']) !!}
</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