Compare commits
No commits in common. "3e7a17ace0b44926e138c534492dc63dba0c14d8" and "5558910d5cbd51f975605760996dc6bac0335f9f" have entirely different histories.
3e7a17ace0
...
5558910d5c
@ -29,5 +29,5 @@ public interface MachineService extends IService<MachineEntity> {
|
|||||||
String checkForm(MachineForm form, int i);
|
String checkForm(MachineForm form, int i);
|
||||||
void saveOrUpdate(MachineForm machineForm, String id, boolean isSave) throws Exception;
|
void saveOrUpdate(MachineForm machineForm, String id, boolean isSave) throws Exception;
|
||||||
|
|
||||||
List<MachineEntity> getMachineList(String keyWord, String procId);
|
List<MachineEntity> getMachineList(String keyWord);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -55,7 +55,7 @@ public class MachineParamServiceImpl extends ServiceImpl<MachineParamMapper, Mac
|
|||||||
}
|
}
|
||||||
|
|
||||||
wrapper.eq(MachineParamEntity::getDeleteMark, 0);
|
wrapper.eq(MachineParamEntity::getDeleteMark, 0);
|
||||||
wrapper.orderByDesc(MachineParamEntity::getId);
|
wrapper.orderByDesc(MachineParamEntity::getCreatorTime);
|
||||||
|
|
||||||
if ("0".equals(machineParamPagination.getDataType())) {
|
if ("0".equals(machineParamPagination.getDataType())) {
|
||||||
Page<MachineParamEntity> page = new Page<>(machineParamPagination.getCurrentPage(), machineParamPagination.getPageSize());
|
Page<MachineParamEntity> page = new Page<>(machineParamPagination.getCurrentPage(), machineParamPagination.getPageSize());
|
||||||
|
|||||||
@ -172,16 +172,11 @@ public class MachineServiceImpl extends ServiceImpl<MachineMapper, MachineEntity
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<MachineEntity> getMachineList(String keyWord, String procId) {
|
public List<MachineEntity> getMachineList(String keyWord) {
|
||||||
LambdaQueryWrapper<MachineEntity> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<MachineEntity> wrapper = new LambdaQueryWrapper<>();
|
||||||
wrapper.eq(MachineEntity::getEnabledStatus, "1");
|
wrapper.eq(MachineEntity::getEnabledStatus, "1");
|
||||||
wrapper.eq(MachineEntity::getDeleteMark, 0);
|
wrapper.eq(MachineEntity::getDeleteMark, 0);
|
||||||
if (!"0".equals(procId)) {
|
wrapper.like(MachineEntity::getMachineName, keyWord);
|
||||||
wrapper.eq(MachineEntity::getBelgProcId, procId);
|
|
||||||
}
|
|
||||||
if (StringUtil.isNotEmpty(keyWord)) {
|
|
||||||
wrapper.like(MachineEntity::getMachineName, keyWord);
|
|
||||||
}
|
|
||||||
wrapper.orderByDesc(MachineEntity::getId);
|
wrapper.orderByDesc(MachineEntity::getId);
|
||||||
return this.list(wrapper);
|
return this.list(wrapper);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -159,8 +159,6 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, MaterialEnt
|
|||||||
LambdaQueryWrapper<MaterialEntity> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<MaterialEntity> wrapper = new LambdaQueryWrapper<>();
|
||||||
wrapper.eq(MaterialEntity::getEnabledStatus, 1);
|
wrapper.eq(MaterialEntity::getEnabledStatus, 1);
|
||||||
wrapper.eq(MaterialEntity::getDeleteMark, 0);
|
wrapper.eq(MaterialEntity::getDeleteMark, 0);
|
||||||
wrapper.eq(MaterialEntity::getMatType, "3");
|
|
||||||
|
|
||||||
if (StringUtil.isNotEmpty(keyWord)) {
|
if (StringUtil.isNotEmpty(keyWord)) {
|
||||||
wrapper.like(MaterialEntity::getMatName, keyWord);
|
wrapper.like(MaterialEntity::getMatName, keyWord);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -156,9 +156,8 @@ public class MachineController {
|
|||||||
//获取机台下拉列表
|
//获取机台下拉列表
|
||||||
@Operation(summary = "获取机台下拉列表")
|
@Operation(summary = "获取机台下拉列表")
|
||||||
@GetMapping("/getMachineList")
|
@GetMapping("/getMachineList")
|
||||||
public ActionResult getMachineList(@RequestParam(required = false, defaultValue = "", value = "keyWord") String keyWord,
|
public ActionResult getMachineList(@RequestParam(required = false, defaultValue = "", value = "keyWord") String keyWord) {
|
||||||
@RequestParam(required = false, value = "procId", defaultValue = "0") String procId) {
|
List<MachineEntity> list = machineService.getMachineList(keyWord);
|
||||||
List<MachineEntity> list = machineService.getMachineList(keyWord, procId);
|
|
||||||
List<Map<String, Object>> result = list.stream()
|
List<Map<String, Object>> result = list.stream()
|
||||||
.map(entity -> {
|
.map(entity -> {
|
||||||
Map<String, Object> map = JsonUtil.entityToMap(entity);
|
Map<String, Object> map = JsonUtil.entityToMap(entity);
|
||||||
@ -170,4 +169,6 @@ public class MachineController {
|
|||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
return ActionResult.success(result);
|
return ActionResult.success(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -177,8 +177,6 @@ export default {
|
|||||||
this.materialOptions = res.data.map(item => ({
|
this.materialOptions = res.data.map(item => ({
|
||||||
label: item.matName,
|
label: item.matName,
|
||||||
value: String(item.id),
|
value: String(item.id),
|
||||||
matCode: item.matCode || '',
|
|
||||||
matName: item.matName || '',
|
|
||||||
}))
|
}))
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@ -216,7 +214,7 @@ export default {
|
|||||||
},
|
},
|
||||||
getMaterialName(matCode) {
|
getMaterialName(matCode) {
|
||||||
const item = this.materialOptions.find(opt => opt.value === matCode)
|
const item = this.materialOptions.find(opt => opt.value === matCode)
|
||||||
return item ? `${item.matCode}-${item.matName}` : ''
|
return item ? item.label : ''
|
||||||
},
|
},
|
||||||
getEnabledStatusName(status) {
|
getEnabledStatusName(status) {
|
||||||
const item = this.enabledStatusOptions.find(opt => opt.id === status)
|
const item = this.enabledStatusOptions.find(opt => opt.id === status)
|
||||||
|
|||||||
@ -11,13 +11,13 @@
|
|||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="工序" prop="procCd">
|
<el-form-item label="工序" prop="procCd">
|
||||||
<JnpfSelect v-model="dataForm.procCd" placeholder="请选择工序" :options="procOptions" :props="procProps" filterable clearable :disabled="!!dataForm.id" :style="{ width: '100%' }" @change="handleProcChange">
|
<JnpfSelect v-model="dataForm.procCd" placeholder="请选择工序" :options="procOptions" :props="procProps" filterable clearable :disabled="!!dataForm.id" :style="{ width: '100%' }">
|
||||||
</JnpfSelect>
|
</JnpfSelect>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="机台" prop="machineCd">
|
<el-form-item label="机台" prop="machineCd">
|
||||||
<JnpfSelect v-model="dataForm.machineCd" placeholder="请选择机台" :options="machineOptions" :props="machineProps" filterable clearable :disabled="!!dataForm.id || !dataForm.procCd" :style="{ width: '100%' }">
|
<JnpfSelect v-model="dataForm.machineCd" placeholder="请选择机台" :options="machineOptions" :props="machineProps" filterable clearable :disabled="!!dataForm.id" :style="{ width: '100%' }">
|
||||||
</JnpfSelect>
|
</JnpfSelect>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -209,7 +209,6 @@ export default {
|
|||||||
this.dataForm.id = id || '';
|
this.dataForm.id = id || '';
|
||||||
this.dialogVisible = true;
|
this.dialogVisible = true;
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
this.machineOptions = []; // 每次编辑前清空机台列表
|
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
if (this.$refs.formRef) {
|
if (this.$refs.formRef) {
|
||||||
this.$refs.formRef.resetFields();
|
this.$refs.formRef.resetFields();
|
||||||
@ -229,13 +228,6 @@ export default {
|
|||||||
matCode: String(data.matCode || ''),
|
matCode: String(data.matCode || ''),
|
||||||
enabledStatus: String(data.enabledStatus || '1'),
|
enabledStatus: String(data.enabledStatus || '1'),
|
||||||
};
|
};
|
||||||
|
|
||||||
// 编辑时,如果有工序ID,加载对应的机台列表
|
|
||||||
if (data.procId) {
|
|
||||||
this.dataForm.procId = data.procId;
|
|
||||||
this.loadMachineList(data.procId);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 回显工艺参数列表
|
// 回显工艺参数列表
|
||||||
if (data.detailList && Array.isArray(data.detailList)) {
|
if (data.detailList && Array.isArray(data.detailList)) {
|
||||||
this.paramList = data.detailList.map(item => {
|
this.paramList = data.detailList.map(item => {
|
||||||
@ -297,6 +289,7 @@ export default {
|
|||||||
loadBaseData() {
|
loadBaseData() {
|
||||||
this.loadProcList();
|
this.loadProcList();
|
||||||
this.loadMaterialList();
|
this.loadMaterialList();
|
||||||
|
this.loadMachineList();
|
||||||
this.loadParamNameOptions();
|
this.loadParamNameOptions();
|
||||||
},
|
},
|
||||||
loadParamNameOptions() {
|
loadParamNameOptions() {
|
||||||
@ -326,7 +319,7 @@ export default {
|
|||||||
lowerLimit: undefined,
|
lowerLimit: undefined,
|
||||||
upperLimit: undefined,
|
upperLimit: undefined,
|
||||||
dev: undefined,
|
dev: undefined,
|
||||||
isAlert: '1',
|
isAlert: '0',
|
||||||
remark: undefined,
|
remark: undefined,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -386,7 +379,7 @@ export default {
|
|||||||
}).then(res => {
|
}).then(res => {
|
||||||
this.materialList = res.data || [];
|
this.materialList = res.data || [];
|
||||||
this.materialOptions = this.materialList.map(item => ({
|
this.materialOptions = this.materialList.map(item => ({
|
||||||
label: `${item.matCode}-${item.matName}`,
|
label: `${item.matName}`,
|
||||||
value: String(item.id),
|
value: String(item.id),
|
||||||
matName: item.name,
|
matName: item.name,
|
||||||
id: item.id,
|
id: item.id,
|
||||||
@ -394,36 +387,21 @@ export default {
|
|||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
loadMachineList(procId) {
|
loadMachineList() {
|
||||||
request({
|
request({
|
||||||
url: `/api/example/machine/getMachineList`,
|
url: `/api/example/machine/getMachineList`,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
data: { procId: procId || '' }
|
params: { keyWord: '' }
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
this.machineList = res.data || [];
|
this.machineList = res.data || [];
|
||||||
this.machineOptions = this.machineList.map(item => ({
|
this.machineOptions = this.machineList.map(item => ({
|
||||||
label: item.name || '',
|
label: `${item.name}`,
|
||||||
value: String(item.id),
|
value: String(item.id),
|
||||||
machineName: item.name || '',
|
machineName: item.name,
|
||||||
id: item.id
|
id: item.id
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleProcChange(value) {
|
|
||||||
this.dataForm.machineCd = undefined;
|
|
||||||
if (value) {
|
|
||||||
const proc = this.procOptions.find(item => item.value === value);
|
|
||||||
if (proc) {
|
|
||||||
this.dataForm.procId = proc.id;
|
|
||||||
this.dataForm.procName = proc.procName;
|
|
||||||
this.loadMachineList(proc.id);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.dataForm.procId = undefined;
|
|
||||||
this.dataForm.procName = undefined;
|
|
||||||
this.machineOptions = [];
|
|
||||||
}
|
|
||||||
},
|
|
||||||
handleMaterialChange(value) {
|
handleMaterialChange(value) {
|
||||||
if (value) {
|
if (value) {
|
||||||
const material = this.materialOptions.find(item => item.value === value);
|
const material = this.materialOptions.find(item => item.value === value);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user