This commit is contained in:
zds
2022-07-19 18:54:24 +08:00
parent 45daab1a39
commit 4f30f55b66
6 changed files with 62 additions and 60 deletions

View File

@@ -67,6 +67,12 @@ public class EquipmentfileServiceImpl implements EquipmentfileService {
Long deptId = currentUser.getDeptId();
WQLObject mstTab = WQLObject.getWQLObject("EM_BI_EquipmentFile"); // 工艺路线主表
WQLObject EM_BI_DeviceLifeCycle = WQLObject.getWQLObject("EM_BI_DeviceLifeCycle"); // 工艺路线主表
String device_code = json.getString("device_code");
JSONObject old = mstTab.query("is_delete='0' and device_code='"+device_code+"'").uniqueResult(0);
if(old!=null){
throw new BadRequestException("已存在相同设备代码的档案!");
}
// 插入主表
String devicerecord_id = IdUtil.getSnowflake(1, 1).nextId()+"";
json.put("devicerecord_id", devicerecord_id);
@@ -100,8 +106,13 @@ public class EquipmentfileServiceImpl implements EquipmentfileService {
String now = DateUtil.now();
JwtUserDto currentUser = (JwtUserDto) SecurityUtils.getCurrentUser();
Long deptId = currentUser.getDeptId();
WQLObject mstTab = WQLObject.getWQLObject("EM_BI_EquipmentFile"); // 工艺路线主表
String device_code = whereJson.getString("device_code");
String devicerecord_id = whereJson.getString("devicerecord_id");
JSONObject old = mstTab.query("is_delete='0' and device_code='"+device_code+"' and devicerecord_id <>'"+devicerecord_id+"'").uniqueResult(0);
if(old!=null){
throw new BadRequestException("已存在相同设备代码的档案!");
}
WQLObject EM_BI_DeviceLifeCycle = WQLObject.getWQLObject("EM_BI_DeviceLifeCycle"); // 工艺路线主表
whereJson.put("update_optid", currentUserId);
whereJson.put("update_optname", nickName);
@@ -186,7 +197,7 @@ public class EquipmentfileServiceImpl implements EquipmentfileService {
jo2.put("create_id", currentUserId);
jo2.put("create_name", nickName);
jo2.put("create_time", now);
EM_BI_DeviceLifeCycle.insert(jo);
EM_BI_DeviceLifeCycle.insert(jo2);
} else if ("11".equals(status)) {//禁用
map.put("status", "11");
@@ -201,12 +212,12 @@ public class EquipmentfileServiceImpl implements EquipmentfileService {
jo2.put("create_id", currentUserId);
jo2.put("create_name", nickName);
jo2.put("create_time", now);
EM_BI_DeviceLifeCycle.insert(jo);
EM_BI_DeviceLifeCycle.insert(jo2);
}
map.put("update_optid", currentUserId + "");
map.put("update_optname", nickName);
map.put("update_time", now);
mstTab.update(map, "workorder_id ='" + jo.getString("workorder_id") + "'");
mstTab.update(map, "devicerecord_id ='" + jo.getString("devicerecord_id") + "'");
}
}
@@ -249,7 +260,8 @@ public class EquipmentfileServiceImpl implements EquipmentfileService {
@Override
public JSONArray queryBomList(Map whereJson) {
WQLObject EM_BI_DeviceBOM = WQLObject.getWQLObject("EM_BI_DeviceBOM"); // 工艺路线主表
JSONArray ja = EM_BI_DeviceBOM.query("is_delete='0' and is_used='1'").getResultJSONArray(0);
String material_type_id = (String) whereJson.get("material_type_id");
JSONArray ja = EM_BI_DeviceBOM.query("is_delete='0' and is_used='1' and material_type_id='"+material_type_id+"'").getResultJSONArray(0);
return ja;
}
}

View File

@@ -55,12 +55,14 @@
equipmentfile.*,
classstandard.class_name AS material_type_name,
dept1.name AS use_deptname,
dept2.name AS belong_deptname
dept2.name AS belong_deptname,
dept3.name AS use_groupname
FROM
em_bi_equipmentfile equipmentfile
LEFT JOIN md_pb_classstandard classstandard ON classstandard.class_id = equipmentfile.material_type_id
LEFT JOIN sys_dept dept1 ON dept1.dept_id = equipmentfile.use_deptid
LEFT JOIN sys_dept dept2 ON dept2.dept_id = equipmentfile.belong_deptid
LEFT JOIN sys_dept dept3 ON dept3.dept_id = equipmentfile.use_groupid
WHERE
equipmentfile.is_delete = '0'
OPTION 输入.is_produceuse <> ""

View File

@@ -73,7 +73,9 @@
:options="classes"
:load-options="loadClass"
style="width: 210px;"
:clearable= "false"
placeholder="设备类别"
@select="typeChange"
/>
</el-form-item>
<el-form-item label="生产用途" prop="is_produceuse">
@@ -101,19 +103,13 @@
/>
</el-form-item>
<el-form-item label="使用班组" prop="use_groupid">
<el-select
<treeselect
v-model="form.use_groupid"
placeholder="使用班组"
:options="depts"
:load-options="loadDepts"
style="width: 210px"
class="filter-item"
>
<el-option
v-for="item in dict.device_type"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
placeholder="使用班组"
/>
</el-form-item>
<el-form-item label="设备属性" prop="device_type">
<el-select
@@ -271,7 +267,7 @@ const defaultForm = {
supplier_id: '',
supplier_code: '',
is_produceuse: '1',
use_groupid: '',
use_groupid: null,
user_id: '',
user_code: '',
user_name: '',
@@ -351,17 +347,12 @@ export default {
crudWorkProcedure.downSelect().then(res => {
this.workProcedureList = res
})
equipmentfile.queryBomList().then(res => {
this.bomlist = res
})
},
methods: {
close() {
this.$emit('AddChanged')
},
[CRUD.HOOK.afterToCU](crud, form) {
debugger
if (!form.devicerecord_code) {
this.getDepts()
@@ -372,13 +363,18 @@ export default {
this.class_idStr = res.class_idStr
this.queryClassId()
})
equipmentfile.queryBomList({ material_type_id: '-1' }).then(res => {
this.bomlist = res
})
} else {
equipmentfile.queryBomList({ material_type_id: form.material_type_id }).then(res => {
this.bomlist = res
})
this.getSupDepts(form.use_deptid)
const param = {
'materOpt_code': '26'
}
crudDevicebom.getBjId(param).then(res => {
debugger
const data = {}
data.id = form.material_type_id
data.goal_id = res.class_idStr
@@ -387,9 +383,7 @@ export default {
}
},
getSubTypes(id) {
debugger
crudClassstandard.getClassSuperior2(id).then(res => {
debugger
const date = res.content
this.buildClass(date)
this.classes = date
@@ -434,7 +428,6 @@ export default {
}
},
getSupDepts(deptId) {
debugger
var number = parseFloat(deptId)
getDeptSuperior(number).then(res => {
const date = res.content
@@ -443,7 +436,6 @@ export default {
})
},
buildDepts(depts) {
debugger
depts.forEach(data => {
if (data.children) {
this.buildDepts(data.children)
@@ -479,6 +471,13 @@ export default {
})
})
},
typeChange(old) {
debugger
this.form.device_bom_id = ''
equipmentfile.queryBomList({ material_type_id: old.class_id }).then(res => {
this.bomlist = res
})
},
[CRUD.HOOK.beforeSubmit]() {
}
}

View File

@@ -101,7 +101,6 @@
>
<el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column min-width="150" prop="create_time" label="变更时间" align="center"/>
<el-table-column prop="changetype" label="变更类型编码" align="center" width="120px" />
<el-table-column prop="changetype" label="变更类型名称" align="center" width="120px" :formatter="device_typeFormat" />
<el-table-column min-width="120" prop="change_reason" label="变更内容" align="center" />
<el-table-column min-width="80" prop="change_name" label="操作人" align="center" />

View File

@@ -4,6 +4,7 @@
width="1100px"
:visible.sync="dialogVisible"
@close="close"
@open="open"
>
<el-form ref="form" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true" :model="form" size="mini" label-width="120px" label-suffix=":">
<el-form-item label="设备档案编码" prop="devicerecord_code">
@@ -91,20 +92,8 @@
<el-input v-model="form.use_deptname" disabled style="width: 210px" />
</el-form-item>
<el-form-item label="使用班组" prop="use_groupid">
<el-select
v-model="form.use_groupid"
placeholder="使用班组"
disabled
style="width: 210px"
class="filter-item"
>
<el-option
v-for="item in dict.device_type"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
<label slot="label">使用班组:</label>
<el-input v-model="form.use_groupname" disabled style="width: 210px" />
</el-form-item>
<el-form-item label="设备属性" prop="device_type">
<el-select
@@ -178,10 +167,10 @@
class="filter-item"
>
<el-option
v-for="item in dict.workorder_type"
:key="item.value"
:label="item.label"
:value="item.value"
v-for="item in bomlist"
:key="item.device_bom_id"
:label="item.material_name"
:value="item.device_bom_id"
/>
</el-select>
</el-form-item>
@@ -230,6 +219,7 @@
<script>
import crudWorkProcedure from '@/api/wms/basedata/pdm/workProcedure'
import equipmentfile from '@/api/wms/basedata/em/equipmentfile'
export default {
name: 'ViewDialog',
@@ -248,6 +238,7 @@ export default {
return {
dialogVisible: false,
workProcedureList: [],
bomlist: [],
form: {}
}
},
@@ -274,8 +265,10 @@ export default {
this.form = {}
this.$emit('AddChanged')
},
storChange() {
return false
open() {
equipmentfile.queryBomList({ material_type_id: this.form.material_type_id }).then(res => {
this.bomlist = res
})
}
}
}

View File

@@ -263,7 +263,6 @@ import { getDepts } from '@/api/system/dept'
import crudClassstandard from '@/api/wms/basedata/master/classstandard'
import crudMaterialbase from '@/api/wms/basedata/master/materialbase'
const start = new Date()
export default {
name: 'equipmentfile',
components: { Treeselect, ChangeDialog, ViewDialog, AddDialog, crudOperation, rrOperation, udOperation, pagination },
@@ -276,9 +275,7 @@ export default {
reset: true,
download: false
},
query: {
createTime: [start, start]
}})
query: {}})
},
mixins: [presenter(), header(), crud()],
// 数据字典
@@ -407,10 +404,10 @@ export default {
this.dissub_flag = false
this.open_flag = false
for (let i = 0; i < rows.length; i++) {
if (rows[i].is_active !== '10') {
if (!'00,11'.includes(rows[i].status)) {
this.sub_flag = true
}
if (rows[i].is_active !== '11') {
if (!'00,10'.includes(rows[i].status)) {
this.dissub_flag = true
}
if (rows.length !== 1) {
@@ -473,8 +470,6 @@ export default {
return this.crud.notify('请选择一条记录', CRUD.NOTIFICATION_TYPE.INFO)
}
const data = _selectData[0]
const time = data.create_time
const strTime = time.slice(0, 10)
const LODOP = getLodop()
LODOP.SET_SHOW_MODE('HIDE_DISBUTTIN_SETUP', 1)// 隐藏那些无效按钮
@@ -482,10 +477,12 @@ export default {
LODOP.PRINT_INIT('')
LODOP.SET_PRINT_PAGESIZE(1, '80mm', '60mm', '')
LODOP.ADD_PRINT_RECT('1mm', '3mm', '74mm', '54mm', 0, 1)
LODOP.SET_PRINT_STYLE('FontSize', 12)
LODOP.SET_PRINT_STYLE('FontSize', 9)
LODOP.SET_PRINT_STYLE('Bold', 1)
LODOP.ADD_PRINT_BARCODE('8mm', '25mm', '38mm', '38mm', 'QRCode', data.workorder_id + '##' + data.ext_id + '##' + data.pcsn + '##' + data.workorder_qty + '##' + strTime)
LODOP.ADD_PRINT_TEXT('45mm', '16mm', '80mm', '15mm', '工令号' + data.workorder_code + '')
LODOP.ADD_PRINT_BARCODE('10mm', '15mm', '60mm', '20mm', '128A', data.device_code)
LODOP.ADD_PRINT_TEXT('35mm', '15mm', '80mm', '15mm', '设备编码' + data.device_code + '')
LODOP.ADD_PRINT_TEXT('40mm', '15mm', '80mm', '15mm', '设备名称:' + data.device_name + '')
LODOP.ADD_PRINT_TEXT('45mm', '15mm', '80mm', '15mm', '型号:' + data.device_model + '')
LODOP.PRINT()// 打印
this.crud.notify('打印成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.crud.toQuery()