Browse Source

add: 区域编码

master
李永德 2 years ago
parent
commit
ccee11b0db
  1. 8
      lms/nladmin-system/src/main/java/org/nl/wms/pdm/rest/DeviceController.java
  2. 7
      lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/DeviceService.java
  3. 1
      lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/dto/DeviceDto.java
  4. 7
      lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/DeviceServiceImpl.java
  5. 4
      lms/nladmin-system/src/main/java/org/nl/wms/pdm/wql/PDM_BI_DEVICE01.wql
  6. BIN
      lms/nladmin-system/src/main/java/org/nl/wms/wms.xls
  7. 9
      lms/nladmin-ui/src/api/wms/pdm/device.js
  8. 27
      lms/nladmin-ui/src/views/wms/pdm/device/index.vue

8
lms/nladmin-system/src/main/java/org/nl/wms/pdm/rest/DeviceController.java

@ -74,4 +74,12 @@ public class DeviceController {
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@GetMapping("/getAllRegions")
@Log("查询生产设备")
@ApiOperation("查询生产设备")
//@SaCheckPermission("device:list")
public ResponseEntity<Object> getAllRegions(){
return new ResponseEntity<>(deviceService.getAllRegions(),HttpStatus.OK);
}
}

7
lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/DeviceService.java

@ -1,6 +1,7 @@
package org.nl.wms.pdm.service;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.nl.wms.pdm.service.dto.DeviceDto;
import org.springframework.data.domain.Pageable;
@ -65,4 +66,10 @@ public interface DeviceService {
void changeActive(JSONObject json);
/**
* 获取所有区域信息
* @return
*/
JSONArray getAllRegions();
}

1
lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/dto/DeviceDto.java

@ -51,6 +51,7 @@ public class DeviceDto implements Serializable {
* 是否启用
*/
private String is_active;
private String region_code;
/**
* 创建人

7
lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/DeviceServiceImpl.java

@ -135,4 +135,11 @@ public class DeviceServiceImpl implements DeviceService {
WQLObject.getWQLObject("PDM_BI_Device").update(json);
}
@Override
public JSONArray getAllRegions() {
WQLObject wo = WQLObject.getWQLObject("SCH_BASE_Region");
JSONArray resultJSONArray = wo.query().getResultJSONArray(0);
return resultJSONArray;
}
}

4
lms/nladmin-system/src/main/java/org/nl/wms/pdm/wql/PDM_BI_DEVICE01.wql

@ -42,9 +42,11 @@
IF 输入.flag = "1"
PAGEQUERY
SELECT
device.*
device.*,
region.region_name
FROM
PDM_BI_Device device
LEFT JOIN sch_base_region region ON region.region_code = device.region_code
WHERE
device.is_delete = '0'

BIN
lms/nladmin-system/src/main/java/org/nl/wms/wms.xls

Binary file not shown.

9
lms/nladmin-ui/src/api/wms/pdm/device.js

@ -31,6 +31,13 @@ export function getWorkprocedure() {
})
}
export function getAllRegions() {
return request({
url: 'api/device/getAllRegions',
method: 'get'
})
}
export function getItemByDevice(data) {
return request({
url: 'api/device/getItemByDevice',
@ -71,4 +78,4 @@ export function changeActive(data) {
})
}
export default { add, edit, del, getWorkprocedure, getItemByDeviceId, copyAdd, changeActive }
export default { add, edit, del, getWorkprocedure, getItemByDeviceId, copyAdd, changeActive, getAllRegions }

27
lms/nladmin-ui/src/views/wms/pdm/device/index.vue

@ -59,6 +59,23 @@
<el-form-item label="设备产能">
<el-input v-model="form.productivity" type="number" style="width: 300px" />
</el-form-item>
<el-form-item label="所属区域">
<el-select
v-model="form.region_code"
clearable
filterable
size="mini"
placeholder="所属区域"
class="filter-item"
>
<el-option
v-for="item in regionList"
:key="item.region_code"
:label="item.region_name"
:value="item.region_code"
/>
</el-select>
</el-form-item>
<el-form-item label="外部编码">
<el-input v-model="form.extend_code" style="width: 300px" />
</el-form-item>
@ -89,6 +106,7 @@
</template>
</el-table-column>
<el-table-column prop="productivity" label="设备产能" />
<el-table-column prop="region_name" label="所属区域" />
<el-table-column prop="remark" label="备注" />
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
<template slot-scope="scope">
@ -123,6 +141,7 @@ const defaultForm = {
devicebill_id: null,
remark: null,
is_active: null,
region_code: null,
create_id: null,
create_name: null,
create_time: null,
@ -160,8 +179,14 @@ export default {
device_model: [
{ required: true, message: '设备类型不能为空', trigger: 'blur' }
]
},
regionList: []
}
}
},
created() {
crudDevice.getAllRegions().then(res => {
this.regionList = res
})
},
methods: {
// false

Loading…
Cancel
Save