|
|
|
@ -94,8 +94,7 @@
|
|
|
|
|
<dict-tag :options="dict.type.split_merge" :value="scope.row.splitMerge"/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<!--<el-table-column label="拆合值" align="center" prop="splitMergNum" :show-overflow-tooltip="true"/>-->
|
|
|
|
|
<el-table-column label="工作中心" align="center" prop="workCenter" :show-overflow-tooltip="true"/>
|
|
|
|
|
<el-table-column label="线体设备" align="center" prop="workCenter" :show-overflow-tooltip="true"/>
|
|
|
|
|
<el-table-column label="工作时长" align="center" prop="workTime" :show-overflow-tooltip="true"/>
|
|
|
|
|
<el-table-column label="是否启用" align="center" prop="enableFlag">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
@ -132,15 +131,17 @@
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<!-- 添加或修改生产工序对话框 -->
|
|
|
|
|
<el-dialog :title="title" :visible.sync="open" width="960px" append-to-body>
|
|
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
|
|
|
|
<el-dialog :title="title" :visible.sync="open" width="960px" append-to-body >
|
|
|
|
|
<div>
|
|
|
|
|
<UseType :key="useTypeKey"/>
|
|
|
|
|
</div>
|
|
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="100px" >
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item label="工序编码" prop="processCode">
|
|
|
|
|
<el-input v-model="form.processCode" placeholder="请输入工序编码" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
|
|
<el-col :span="7">
|
|
|
|
|
<el-form-item label="工序名称" prop="processName">
|
|
|
|
|
<el-input v-model="form.processName" placeholder="请输入工序名称" />
|
|
|
|
@ -205,8 +206,10 @@
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="工作中心" prop="workCenter">
|
|
|
|
|
<el-input v-model="form.workCenter" type="input" placeholder="请输入工作中心" />
|
|
|
|
|
<el-form-item label="线体设备" prop="workCenter">
|
|
|
|
|
<el-input v-model="form.workCenter" placeholder="请选择线体设备" >
|
|
|
|
|
<el-button slot="append" @click="handleBoundeEuipment" icon="el-icon-search"></el-button>
|
|
|
|
|
</el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
@ -246,11 +249,88 @@
|
|
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
<!-- 新弹出表单 左树右表格 -->
|
|
|
|
|
<el-dialog :title="this.boundTitle" :visible.sync="boundeEuipmentOpen" width="1200px" append-to-body>
|
|
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="6">
|
|
|
|
|
<el-tree
|
|
|
|
|
ref="tree"
|
|
|
|
|
:check-strictly="true"
|
|
|
|
|
:data="treeData"
|
|
|
|
|
:expand-on-click-node="false"
|
|
|
|
|
:filter-node-method="filterNode"
|
|
|
|
|
:default-expand-all="true"
|
|
|
|
|
highlight-current
|
|
|
|
|
node-key="id"
|
|
|
|
|
@node-click="handleNodeClick"
|
|
|
|
|
>
|
|
|
|
|
</el-tree>
|
|
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="18">
|
|
|
|
|
<el-form :model="queryEquipmentParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
|
|
|
|
|
<el-form-item label="设备编码" prop="equipmentCode">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="queryEquipmentParams.equipmentCode"
|
|
|
|
|
placeholder="请输入设备编码"
|
|
|
|
|
clearable
|
|
|
|
|
@keyup.enter.native="handleEquipmentTypeQuery"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="设备名称" prop="equipmentName">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="queryEquipmentParams.equipmentName"
|
|
|
|
|
placeholder="请输入设备名称"
|
|
|
|
|
clearable
|
|
|
|
|
@keyup.enter.native="handleEquipmentTypeQuery"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item>
|
|
|
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleEquipmentTypeQuery">搜索</el-button>
|
|
|
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetEquipmentQuery">重置</el-button>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
<el-table v-loading="loading" :data="equipmentList" @selection-change="handleEquipmentSelectionChange" ref="myTable">
|
|
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
|
|
<!-- 序号 -->
|
|
|
|
|
<el-table-column type="index" width="90" align="center" :index="indexMethod" label="序号"></el-table-column>
|
|
|
|
|
<el-table-column label="设备编码" align="center" prop="equipmentCode">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="设备名称" align="center" prop="equipmentName" />
|
|
|
|
|
<el-table-column label="设备类型编码" align="center" prop="equipmentTypeCode" key="equipmentTypeCode"/>
|
|
|
|
|
<el-table-column label="设备类型名称" align="center" prop="equipmentTypeName" key="equipmentTypeName"/>
|
|
|
|
|
</el-table>
|
|
|
|
|
|
|
|
|
|
<pagination
|
|
|
|
|
v-show="total > 0"
|
|
|
|
|
:total="total"
|
|
|
|
|
:page.sync="queryEquipmentParams.pageNum"
|
|
|
|
|
:limit.sync="queryEquipmentParams.pageSize"
|
|
|
|
|
@pagination="getEquipmentList"
|
|
|
|
|
/>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
</el-form>
|
|
|
|
|
<!-- <el-tabs type="border-card" v-if="form.equipmentCode != null">
|
|
|
|
|
<el-tab-pane label="设备绑定物料">
|
|
|
|
|
<EquipmentBoundMaterials v-if="form.equipmentCode != null" :optType="optType" :equipmentCode="form.equipmentCode"></EquipmentBoundMaterials>
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
</el-tabs> -->
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
<el-table-column label="操作">
|
|
|
|
|
<el-button type="primary" @click="submitEquipmentForm">确 定</el-button>
|
|
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { listProcess, getProcess, delProcess, addProcess, updateProcess } from "@/api/mes/pro/process";
|
|
|
|
|
import { listEquipment, getEquipment, delEquipment, addEquipment, updateEquipment } from "@/api/wms/equipment";
|
|
|
|
|
import Processcontent from "./content.vue";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
@ -259,6 +339,28 @@ export default {
|
|
|
|
|
components: {Processcontent},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
treeData: [{
|
|
|
|
|
id: '1',
|
|
|
|
|
label: '设备类别',
|
|
|
|
|
children: [{
|
|
|
|
|
id: 'equ_type_lg',
|
|
|
|
|
label: '料罐'
|
|
|
|
|
}, {
|
|
|
|
|
id: 'equ_type_cxj',
|
|
|
|
|
label: '成型机'
|
|
|
|
|
}, {
|
|
|
|
|
id: 'equ_type_hf',
|
|
|
|
|
label: '烘房'
|
|
|
|
|
}, {
|
|
|
|
|
id: 'equ_type_spj',
|
|
|
|
|
label: '收坯机'
|
|
|
|
|
}, {
|
|
|
|
|
id: 'equ_type_bzx',
|
|
|
|
|
label: '包装线'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}],
|
|
|
|
|
useTypeKey:0,
|
|
|
|
|
//自动生成编码
|
|
|
|
|
autoGenFlag:false,
|
|
|
|
|
optType: undefined,
|
|
|
|
@ -266,6 +368,8 @@ export default {
|
|
|
|
|
loading: true,
|
|
|
|
|
// 选中数组
|
|
|
|
|
ids: [],
|
|
|
|
|
//最底层
|
|
|
|
|
ids1:[],
|
|
|
|
|
// 非单个禁用
|
|
|
|
|
single: true,
|
|
|
|
|
// 非多个禁用
|
|
|
|
@ -275,11 +379,19 @@ export default {
|
|
|
|
|
// 总条数
|
|
|
|
|
total: 0,
|
|
|
|
|
// 生产工序表格数据
|
|
|
|
|
processList: [],
|
|
|
|
|
processList:[],
|
|
|
|
|
equipmentList:[],
|
|
|
|
|
// 弹出层标题
|
|
|
|
|
title: "",
|
|
|
|
|
boundTitle:"",
|
|
|
|
|
// 是否显示弹出层
|
|
|
|
|
open: false,
|
|
|
|
|
boundeEuipmentOpen:false,
|
|
|
|
|
equipmentTypeName : undefined,
|
|
|
|
|
defaultProps: {
|
|
|
|
|
children: "children",
|
|
|
|
|
label: "label"
|
|
|
|
|
},
|
|
|
|
|
// 查询参数
|
|
|
|
|
queryParams: {
|
|
|
|
|
pageNum: 1,
|
|
|
|
@ -288,6 +400,16 @@ export default {
|
|
|
|
|
processName: null,
|
|
|
|
|
enableFlag: null,
|
|
|
|
|
},
|
|
|
|
|
queryEquipmentParams: {
|
|
|
|
|
equipmentTypeName :null,
|
|
|
|
|
equipmentTypeCode:null,
|
|
|
|
|
equipmentName :null,
|
|
|
|
|
equipmentCode:null,
|
|
|
|
|
equipmentId:'',
|
|
|
|
|
processId:null,
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
},
|
|
|
|
|
// 表单参数
|
|
|
|
|
form: {},
|
|
|
|
|
// 表单校验
|
|
|
|
@ -308,13 +430,75 @@ export default {
|
|
|
|
|
{ required: true, message: "可多单运行不能为空", trigger: "blur" }
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
fileList:[]
|
|
|
|
|
fileList:[],
|
|
|
|
|
equipmentId:'',
|
|
|
|
|
watch: {
|
|
|
|
|
equipmentTypeName(val) {
|
|
|
|
|
this.$refs.tree.filter(val);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.getList();
|
|
|
|
|
this.getEquipmentList();
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
activated(){
|
|
|
|
|
this.useTypeKey +=1
|
|
|
|
|
},
|
|
|
|
|
handleEquipmentSelectionChange (val) {
|
|
|
|
|
this.equipmentList = val
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/** 查询物料信息列表 */
|
|
|
|
|
getEquipmentList() {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
listEquipment(this.queryEquipmentParams).then(response => {
|
|
|
|
|
this.equipmentList = response.rows;
|
|
|
|
|
this.total = response.total;
|
|
|
|
|
this.loading = false;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 筛选节点
|
|
|
|
|
filterNode(value, data) {
|
|
|
|
|
if (!value) return true;
|
|
|
|
|
return data.label.indexOf(value) !== -1;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 节点单击事件
|
|
|
|
|
handleNodeClick(data) {
|
|
|
|
|
this.queryEquipmentParams.equipmentTypeCode = data.id;
|
|
|
|
|
this.handleEquipmentTypeQuery();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/** 搜索按钮操作 */
|
|
|
|
|
handleEquipmentTypeQuery() {
|
|
|
|
|
console.log(2);
|
|
|
|
|
this.getEquipmentList();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/** 搜索按钮操作 */
|
|
|
|
|
handleEquipmentQuery() {
|
|
|
|
|
this.queryEquipmentParams.pageNum = 1;
|
|
|
|
|
this.getEquipmentList();
|
|
|
|
|
console.log(this.form);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 生成表头序号
|
|
|
|
|
indexMethod(index){
|
|
|
|
|
return index+1 ;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 多选框选中数据
|
|
|
|
|
handleEquipmentSelectionChange(selection) {
|
|
|
|
|
this.ids = selection.map(item => item.equipmentId);
|
|
|
|
|
this.single = selection.length!==1;
|
|
|
|
|
this.multiple = !selection.length;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/** 查询生产工序列表 */
|
|
|
|
|
getList() {
|
|
|
|
|
this.loading = true;
|
|
|
|
@ -324,15 +508,22 @@ export default {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 取消按钮
|
|
|
|
|
cancel() {
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.reset();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 取消按钮
|
|
|
|
|
equipmentCancel() {
|
|
|
|
|
this.boundeEuipmentOpen = false;
|
|
|
|
|
this.reset();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 表单重置
|
|
|
|
|
reset() {
|
|
|
|
|
this.form = {
|
|
|
|
|
processId: null,
|
|
|
|
|
processCode: null,
|
|
|
|
|
processName: null,
|
|
|
|
|
attention: null,
|
|
|
|
@ -342,7 +533,13 @@ export default {
|
|
|
|
|
createTime: null,
|
|
|
|
|
updateBy: null,
|
|
|
|
|
updateTime: null,
|
|
|
|
|
fileList:''
|
|
|
|
|
fileList:'',
|
|
|
|
|
equipmentTypeName:'',
|
|
|
|
|
equipmentId :null,
|
|
|
|
|
equipmentTypeName :null,
|
|
|
|
|
equipmentTypeCode:null,
|
|
|
|
|
equipmentName :null,
|
|
|
|
|
equipmentCode:null
|
|
|
|
|
};
|
|
|
|
|
this.autoGenFlag = false;
|
|
|
|
|
this.resetForm("form");
|
|
|
|
@ -357,9 +554,15 @@ export default {
|
|
|
|
|
this.resetForm("queryForm");
|
|
|
|
|
this.handleQuery();
|
|
|
|
|
},
|
|
|
|
|
/** 重置按钮操作 */
|
|
|
|
|
resetEquipmentQuery() {
|
|
|
|
|
this.resetForm("queryForm");
|
|
|
|
|
this.handleEquipmentQuery();
|
|
|
|
|
},
|
|
|
|
|
// 多选框选中数据
|
|
|
|
|
handleSelectionChange(selection) {
|
|
|
|
|
this.ids = selection.map(item => item.processId)
|
|
|
|
|
this.ids = selection.map(item => item.processId);
|
|
|
|
|
this.ids1 = selection.map(item => item.processId);
|
|
|
|
|
this.single = selection.length!==1
|
|
|
|
|
this.multiple = !selection.length
|
|
|
|
|
},
|
|
|
|
@ -370,6 +573,13 @@ export default {
|
|
|
|
|
this.title = "添加生产工序";
|
|
|
|
|
this.optType = "add";
|
|
|
|
|
},
|
|
|
|
|
/** 绑定设备操作 */
|
|
|
|
|
handleBoundeEuipment() {
|
|
|
|
|
//this.reset();
|
|
|
|
|
this.boundeEuipmentOpen = true;
|
|
|
|
|
this.boundTitle = "绑定设备";
|
|
|
|
|
this.optType = "bound";
|
|
|
|
|
},
|
|
|
|
|
// 查询明细按钮操作
|
|
|
|
|
handleView(row){
|
|
|
|
|
this.reset();
|
|
|
|
@ -402,13 +612,12 @@ export default {
|
|
|
|
|
this.optType = "edit";
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/** 提交按钮 */
|
|
|
|
|
submitForm() {
|
|
|
|
|
|
|
|
|
|
if(Array.isArray(this.form.fileList)){
|
|
|
|
|
this.form.fileList = this.listToString(this.form.fileList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
if (this.form.processId != null) {
|
|
|
|
@ -417,7 +626,7 @@ export default {
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
}else {
|
|
|
|
|
addProcess(this.form).then(response => {
|
|
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
|
|
this.open = false;
|
|
|
|
@ -427,6 +636,19 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
submitEquipmentForm() {
|
|
|
|
|
const table = this.$refs.myTable;
|
|
|
|
|
const data = table.data;
|
|
|
|
|
console.log(data);
|
|
|
|
|
for (const one of data) {
|
|
|
|
|
const equipmentCode = one.equipmentCode;
|
|
|
|
|
this.form.workCenter = this.form.workCenter + ','+ equipmentCode;
|
|
|
|
|
this.boundeEuipmentOpen = false;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/** 删除按钮操作 */
|
|
|
|
|
handleDelete(row) {
|
|
|
|
|
const processIds = row.processId || this.ids;
|
|
|
|
|