add: 区域编码
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -51,6 +51,7 @@ public class DeviceDto implements Serializable {
|
||||
* 是否启用
|
||||
*/
|
||||
private String is_active;
|
||||
private String region_code;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -55,4 +57,4 @@
|
||||
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
Binary file not shown.
@@ -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 }
|
||||
|
||||
@@ -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,9 +179,15 @@ export default {
|
||||
device_model: [
|
||||
{ required: true, message: '设备类型不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
},
|
||||
regionList: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudDevice.getAllRegions().then(res => {
|
||||
this.regionList = res
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
|
||||
Reference in New Issue
Block a user