|
@@ -31,8 +31,8 @@ class DeviceController extends Curd
|
|
|
public function selectList()
|
|
|
{
|
|
|
$class = get_class($this->model);
|
|
|
- $data = $class::where('device_status', 'ACTIVED')
|
|
|
- ->select('device_id', 'device_name','device_identify')
|
|
|
+ $data = $class::whereIn('device_status', ['PROCESSING','PENDING'])
|
|
|
+ ->select('device_id', 'device_name', 'device_identify')
|
|
|
->get()
|
|
|
->toArray();
|
|
|
|
|
@@ -58,6 +58,18 @@ class DeviceController extends Curd
|
|
|
{
|
|
|
$id = SysSerial::getSerial();
|
|
|
|
|
|
- return "DE".str_pad($id,16,'0',STR_PAD_LEFT).random_string(8);
|
|
|
+ return "DE" . str_pad($id, 16, '0', STR_PAD_LEFT) . random_string(8);
|
|
|
+ }
|
|
|
+
|
|
|
+ public function delete(Request $request): Response
|
|
|
+ {
|
|
|
+ $ids = $this->deleteInput($request);
|
|
|
+
|
|
|
+ if (Device::whereIn('device_id', $ids)->where('device_status', '<>', 'WAITING')->exists()) {
|
|
|
+ return json_fail('只有库存状态的设备可以删除');
|
|
|
+ }
|
|
|
+
|
|
|
+ $this->doDelete($ids);
|
|
|
+ return json_success('success');
|
|
|
}
|
|
|
}
|