Commit 214a0b6d authored by 赵汉亭's avatar 赵汉亭

BOM页面及工艺路线

parent 573cd23a
import request from '@/utils/request'
// 查询生产BOM列表
export function listBom(query) {
return request({
url: '/mes/pro/bom/list',
method: 'get',
params: query
})
}
// 查询所有有效生产BOM
export function listAllBom() {
return request({
url: '/mes/pro/bom/listAll',
method: 'get'
})
}
// 查询生产BOM详细
export function getBom(bomId) {
return request({
url: '/mes/pro/bom/' + bomId,
method: 'get'
})
}
// 新增生产BOM
export function addBom(data) {
return request({
url: '/mes/pro/bom',
method: 'post',
data: data
})
}
// 修改生产BOM
export function updateBom(data) {
return request({
url: '/mes/pro/bom',
method: 'put',
data: data
})
}
// 删除生产BOM
export function delBom(bomId) {
return request({
url: '/mes/pro/bom/' + bomId,
method: 'delete'
})
}
import request from '@/utils/request'
// 查询生产BOM组件列表
export function listBomItem(query) {
return request({
url: '/mes/pro/bomItem/list',
method: 'get',
params: query
})
}
// 查询生产BOM组件详细
export function getBomItem(bomItemId) {
return request({
url: '/mes/pro/bomItem/' + bomItemId,
method: 'get'
})
}
// 新增生产BOM组件
export function addBomItem(data) {
return request({
url: '/mes/pro/bomItem',
method: 'post',
data: data
})
}
// 修改生产BOM组件
export function updateBomItem(data) {
return request({
url: '/mes/pro/bomItem',
method: 'put',
data: data
})
}
// 删除生产BOM组件
export function delBomItem(bomItemId) {
return request({
url: '/mes/pro/bomItem/' + bomItemId,
method: 'delete'
})
}
<template>
<el-dialog
title="用途选择"
v-if="showFlag"
:visible.sync="showFlag"
:modal="false"
width="57%"
center
>
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="用途编码" prop="usageCode">
<el-input
v-model="queryParams.usageCode"
placeholder="请输入用途编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="用途名称" prop="usageName">
<el-input
v-model="queryParams.usageName"
placeholder="请输入用途名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-table
v-loading="loading"
:data="usageList"
@current-change="handleCurrent"
@row-dblclick="handleRowDbClick"
>
<el-table-column width="200" align="center">
<template v-slot="scope">
<el-radio
v-model="selectedusageId"
:label="scope.row.usageId"
@change="handleRowChange(scope.row)"
>{{ "" }}</el-radio
>
</template>
</el-table-column>
<el-table-column label="用途编码" width="200" prop="usageCode">
</el-table-column>
<el-table-column
label="用途名称"
width="100"
align="center"
prop="usageName"
:show-overflow-tooltip="true"
/>
<el-table-column label="备注" width="400" align="center" prop="remark">
<template slot-scope="scope">
<dict-tag
:options="dict.type.mes_usage_sourcetype"
:value="scope.row.orderSource"
/>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="confirmSelect">确 定</el-button>
<el-button @click="showFlag = false">取 消</el-button>
</div>
</el-dialog>
</template>
<script>
import { listUsage } from "@/api/mes/pro/usage";
export default {
name: "UsageSelectSingle",
components: {},
dicts: ["mes_order_status", "mes_workorder_sourcetype"],
// props:{
// workorder: {
// type: Object,
// default: function(){
// return {'workorderType': 'SELF'}
// }} //外部传入的用途过滤信息
// },
data() {
return {
showFlag: false,
// 遮罩层
loading: true,
// 选中数组
selectedUsageId: undefined,
selectedRows: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 生产用途表格数据
usageList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
usageCode: null,
usageName: null,
},
// 列信息
columns: [
{ key: 0, label: `用途编码`, visible: true },
{ key: 1, label: `用途名称`, visible: true },
{ key: 2, label: `备注`, visible: true },
],
};
},
created() {
this.getList();
},
methods: {
/** 查询生产用途列表 */
getList() {
this.loading = true;
listUsage(this.queryParams).then((response) => {
this.usageList = response.rows;
this.total = response.total;
this.loading = false;
});
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
handleCurrent(row) {
if (row) {
this.selectedRows = row;
}
},
// 单选选中数据
handleRowChange(row) {
if (row) {
this.selectedRows = row;
}
},
//双击选中
handleRowDbClick(row) {
if (row) {
this.selectedRows = row;
this.$emit("onSelected", this.selectedRows);
this.showFlag = false;
}
},
//确定选中
confirmSelect() {
if (this.selectedUsageId == null || this.selectedUsageId == 0) {
this.$notify({
title: "提示",
type: "warning",
message: "请至少选择一条数据!",
});
return;
}
this.$emit("onSelected", this.selectedRows);
this.showFlag = false;
},
},
};
</script>
<template> <template>
<el-dialog title="工作站选择" <el-dialog
title="工作站选择"
v-if="showFlag" v-if="showFlag"
:visible.sync="showFlag" :visible.sync="showFlag"
:modal= false :modal="false"
width="80%" width="80%"
center center
> >
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px"> <el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="90px"
>
<el-row> <el-row>
<el-col :span="7"> <el-col :span="7">
<el-form-item label="工作站编号" prop="workstationCode"> <el-form-item
label="工作站编号"
label-width="120"
prop="workstationCode"
>
<el-input <el-input
v-model="queryParams.workstationCode" v-model="queryParams.workstationCode"
placeholder="请输入工作站编号" placeholder="请输入工作站编号"
...@@ -19,7 +31,7 @@ ...@@ -19,7 +31,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="7"> <el-col :span="7">
<el-form-item label="所属工序" prop="processName"> <el-form-item label="所属工序" prop="processId">
<el-select v-model="queryParams.processId" placeholder="请选择工序"> <el-select v-model="queryParams.processId" placeholder="请选择工序">
<el-option <el-option
v-for="item in processOptions" v-for="item in processOptions"
...@@ -32,7 +44,10 @@ ...@@ -32,7 +44,10 @@
</el-col> </el-col>
<el-col :span="7"> <el-col :span="7">
<el-form-item label="所在车间" prop="workshopName"> <el-form-item label="所在车间" prop="workshopName">
<el-select v-model="queryParams.workshopId" placeholder="请选择车间"> <el-select
v-model="queryParams.workshopId"
placeholder="请选择车间"
>
<el-option <el-option
v-for="item in workshopOptions" v-for="item in workshopOptions"
:key="item.workshopId" :key="item.workshopId"
...@@ -44,34 +59,63 @@ ...@@ -44,34 +59,63 @@
</el-col> </el-col>
<el-col :span="3"> <el-col :span="3">
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <el-button
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24"> </el-col>
</el-col>
</el-row> </el-row>
</el-form> </el-form>
<el-table v-loading="loading" :data="workstationList" @current-change="handleCurrent" @row-dblclick="handleRowDbClick"> <el-table
<el-table-column width="55" align="center" > v-loading="loading"
:data="workstationList"
@current-change="handleCurrent"
@row-dblclick="handleRowDbClick"
>
<el-table-column width="55" align="center">
<template v-slot="scope"> <template v-slot="scope">
<el-radio v-model="selectedWorkstationId" :label="scope.row.workstationId" @change="handleRowChange(scope.row)">{{""}}</el-radio> <el-radio
v-model="selectedWorkstationId"
:label="scope.row.workstationId"
@change="handleRowChange(scope.row)"
>{{ "" }}</el-radio
>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="工作站编号" align="center" prop="workstationCode" > <el-table-column label="工作站编号" align="center" prop="workstationCode">
</el-table-column> </el-table-column>
<el-table-column label="工作站名称" align="center" prop="workstationName" /> <el-table-column
<el-table-column label="工作站地点" align="center" prop="workstationAddress" /> label="工作站名称"
<el-table-column label="所在车间名称" align="center" prop="workshopName" /> align="center"
prop="workstationName"
/>
<el-table-column
label="工作站地点"
align="center"
prop="workstationAddress"
/>
<el-table-column
label="所在车间名称"
align="center"
prop="workshopName"
/>
<el-table-column label="所属工序" align="center" prop="processName" /> <el-table-column label="所属工序" align="center" prop="processName" />
<el-table-column label="标准工时" align="center" prop="stdWorkingTime" />
<el-table-column label="备注" align="center" prop="remark" /> <el-table-column label="备注" align="center" prop="remark" />
</el-table> </el-table>
<pagination <pagination
v-show="total>0" v-show="total > 0"
:total="total" :total="total"
:page.sync="queryParams.pageNum" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
...@@ -79,21 +123,29 @@ ...@@ -79,21 +123,29 @@
/> />
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="confirmSelect">确 定</el-button> <el-button type="primary" @click="confirmSelect">确 定</el-button>
<el-button @click="showFlag=false">取 消</el-button> <el-button @click="showFlag = false">取 消</el-button>
</div> </div>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import { listWorkstation, getWorkstation, delWorkstation, addWorkstation, updateWorkstation } from "@/api/mes/md/workstation"; import {
import {listAllProcess} from "@/api/mes/pro/process"; listWorkstation,
getWorkstation,
delWorkstation,
addWorkstation,
updateWorkstation,
} from "@/api/mes/md/workstation";
import { listAllProcess } from "@/api/mes/pro/process";
import { listAllWorkshop } from "@/api/mes/md/workshop"; import { listAllWorkshop } from "@/api/mes/md/workshop";
export default { export default {
name: "WorkstationSelect", name: "WorkstationSelect",
dicts: ['sys_yes_no'], dicts: ["sys_yes_no"],
data() { data() {
return { return {
showFlag:false, // processId: this.processId,
showFlag: false,
// 遮罩层 // 遮罩层
loading: true, loading: true,
// 选中数组 // 选中数组
...@@ -110,9 +162,9 @@ export default { ...@@ -110,9 +162,9 @@ export default {
// 工作站表格数据 // 工作站表格数据
workstationList: [], workstationList: [],
//车间选项 //车间选项
workshopOptions:[], workshopOptions: [],
//工序选项 //工序选项
processOptions:[], processOptions: [],
// 弹出层标题 // 弹出层标题
title: "", title: "",
// 是否显示弹出层 // 是否显示弹出层
...@@ -127,42 +179,56 @@ export default { ...@@ -127,42 +179,56 @@ export default {
workshopId: null, workshopId: null,
workshopCode: null, workshopCode: null,
workshopName: null, workshopName: null,
processId: this.processId, processId: null,
processCode: null, processCode: null,
processName: null, processName: null,
enableFlag: null, enableFlag: null,
stdWorkingTime: null,
}, },
// 表单参数 // 表单参数
form: {}, form: {},
}; };
}, },
props:{ props: {
processId: undefined //外部传入的工序过滤条件 processId: {
type: Number | undefined,
default: undefined,
}, //外部传入的工序过滤条件
}, },
created() { created() {
this.getList(); this.getList();
this.getWorkshops(); this.getWorkshops();
this.getProcess(); this.getProcess();
}, },
watch: {
processId: {
handler(val) {
this.queryParams.processId = val;
this.getList();
},
immediate: true,
},
},
methods: { methods: {
/** 查询工作站列表 */ /** 查询工作站列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listWorkstation(this.queryParams).then(response => { listWorkstation(this.queryParams).then((response) => {
console.log(this.queryParams);
this.workstationList = response.rows; this.workstationList = response.rows;
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
}); });
}, },
//查询车间信息 //查询车间信息
getWorkshops(){ getWorkshops() {
listAllWorkshop().then( response => { listAllWorkshop().then((response) => {
this.workshopOptions = response.data; this.workshopOptions = response.data;
}); });
}, },
//查询工序信息 //查询工序信息
getProcess(){ getProcess() {
listAllProcess().then( response =>{ listAllProcess().then((response) => {
this.processOptions = response.data; this.processOptions = response.data;
}); });
}, },
...@@ -184,12 +250,13 @@ export default { ...@@ -184,12 +250,13 @@ export default {
processId: null, processId: null,
processCode: null, processCode: null,
processName: null, processName: null,
enableFlag: 'Y', enableFlag: "Y",
remark: null, remark: null,
createBy: null, createBy: null,
createTime: null, createTime: null,
updateBy: null, updateBy: null,
updateTime: null updateTime: null,
stdWorkingTime: null,
}; };
this.resetForm("form"); this.resetForm("form");
}, },
...@@ -203,38 +270,41 @@ export default { ...@@ -203,38 +270,41 @@ export default {
this.resetForm("queryForm"); this.resetForm("queryForm");
this.handleQuery(); this.handleQuery();
}, },
handleCurrent(row){ handleCurrent(row) {
if(row){ if (row) {
this.selectedRows = row; this.selectedRows = row;
} }
}, },
// 单选选中数据 // 单选选中数据
handleRowChange(row) { handleRowChange(row) {
if(row){ if (row) {
this.selectedRows = row; this.selectedRows = row;
} }
}, },
//双击选中 //双击选中
handleRowDbClick(row){ handleRowDbClick(row) {
if(row){ if (row) {
this.selectedRows = row; this.selectedRows = row;
this.$emit('onSelected',this.selectedRows); this.$emit("onSelected", this.selectedRows);
this.showFlag = false; this.showFlag = false;
} }
}, },
//确定选中 //确定选中
confirmSelect(){ confirmSelect() {
if(this.selectedWorkstationId == null || this.selectedWorkstationId == 0){ if (
this.selectedWorkstationId == null ||
this.selectedWorkstationId == 0
) {
this.$notify({ this.$notify({
title:'提示', title: "提示",
type:'warning', type: "warning",
message: '请至少选择一条数据!' message: "请至少选择一条数据!",
}); });
return; return;
} }
this.$emit('onSelected',this.selectedRows); this.$emit("onSelected", this.selectedRows);
this.showFlag = false; this.showFlag = false;
} },
} },
}; };
</script> </script>
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px"> <el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="100px"
>
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="工作站编码" prop="workstationCode"> <el-form-item label="工作站编码" prop="workstationCode">
...@@ -24,7 +31,10 @@ ...@@ -24,7 +31,10 @@
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="所在车间名称" prop="workshopName"> <el-form-item label="所在车间名称" prop="workshopName">
<el-select v-model="queryParams.workshopId" placeholder="请选择车间"> <el-select
v-model="queryParams.workshopId"
placeholder="请选择车间"
>
<el-option <el-option
v-for="item in workshopOptions" v-for="item in workshopOptions"
:key="item.workshopId" :key="item.workshopId"
...@@ -50,8 +60,16 @@ ...@@ -50,8 +60,16 @@
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <el-button
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -66,7 +84,8 @@ ...@@ -66,7 +84,8 @@
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['mes:md:workstation:add']" v-hasPermi="['mes:md:workstation:add']"
>新增</el-button> >新增</el-button
>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
...@@ -77,7 +96,8 @@ ...@@ -77,7 +96,8 @@
:disabled="single" :disabled="single"
@click="handleUpdate" @click="handleUpdate"
v-hasPermi="['mes:md:workstation:edit']" v-hasPermi="['mes:md:workstation:edit']"
>修改</el-button> >修改</el-button
>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
...@@ -88,7 +108,8 @@ ...@@ -88,7 +108,8 @@
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click="handleDelete"
v-hasPermi="['mes:md:workstation:remove']" v-hasPermi="['mes:md:workstation:remove']"
>删除</el-button> >删除</el-button
>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
...@@ -98,33 +119,62 @@ ...@@ -98,33 +119,62 @@
size="mini" size="mini"
@click="handleExport" @click="handleExport"
v-hasPermi="['mes:md:workstation:export']" v-hasPermi="['mes:md:workstation:export']"
>导出</el-button> >导出</el-button
>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loading" :data="workstationList" @selection-change="handleSelectionChange"> <el-table
v-loading="loading"
:data="workstationList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="工作站编号" align="center" prop="workstationCode" > <el-table-column label="工作站编号" align="center" prop="workstationCode">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
type="text" type="text"
@click="handleView(scope.row)" @click="handleView(scope.row)"
v-hasPermi="['mes:md:workstation:query']" v-hasPermi="['mes:md:workstation:query']"
>{{scope.row.workstationCode}}</el-button> >{{ scope.row.workstationCode }}</el-button
>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="工作站名称" align="center" prop="workstationName" /> <el-table-column
<el-table-column label="工作站地点" align="center" prop="workstationAddress" /> label="工作站名称"
<el-table-column label="所在车间名称" align="center" prop="workshopName" /> align="center"
prop="workstationName"
/>
<el-table-column
label="工作站地点"
align="center"
prop="workstationAddress"
/>
<el-table-column
label="所在车间名称"
align="center"
prop="workshopName"
/>
<el-table-column label="所属工序" align="center" prop="processName" /> <el-table-column label="所属工序" align="center" prop="processName" />
<el-table-column label="是否启用" align="center" prop="enableFlag"> <el-table-column label="是否启用" align="center" prop="enableFlag">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.enableFlag"/> <dict-tag
:options="dict.type.sys_yes_no"
:value="scope.row.enableFlag"
/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="标准工时" align="center" prop="stdWorkingTime" />
<el-table-column label="备注" align="center" prop="remark" /> <el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="mini" size="mini"
...@@ -132,20 +182,22 @@ ...@@ -132,20 +182,22 @@
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['mes:md:workstation:edit']" v-hasPermi="['mes:md:workstation:edit']"
>修改</el-button> >修改</el-button
>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['mes:md:workstation:remove']" v-hasPermi="['mes:md:workstation:remove']"
>删除</el-button> >删除</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination
v-show="total>0" v-show="total > 0"
:total="total" :total="total"
:page.sync="queryParams.pageNum" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
...@@ -158,28 +210,40 @@ ...@@ -158,28 +210,40 @@
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="工作站编号" prop="workstationCode"> <el-form-item label="工作站编号" prop="workstationCode">
<el-input v-model="form.workstationCode" placeholder="请输入工作站编码" /> <el-input
v-model="form.workstationCode"
placeholder="请输入工作站编码"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label-width="80"> <el-form-item label-width="80">
<el-switch v-model="autoGenFlag" <el-switch
v-model="autoGenFlag"
active-color="#13ce66" active-color="#13ce66"
active-text="自动生成" active-text="自动生成"
@change="handleAutoGenChange(autoGenFlag)" v-if="optType != 'view'"> @change="handleAutoGenChange(autoGenFlag)"
v-if="optType != 'view'"
>
</el-switch> </el-switch>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="工作站名称" prop="workstationName"> <el-form-item label="工作站名称" prop="workstationName">
<el-input v-model="form.workstationName" placeholder="请输入工作站名称" /> <el-input
v-model="form.workstationName"
placeholder="请输入工作站名称"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="工作站地点" prop="workstationAddress"> <el-form-item label="工作站地点" prop="workstationAddress">
<el-input v-model="form.workstationAddress" placeholder="请输入工作站地点" /> <el-input
v-model="form.workstationAddress"
placeholder="请输入工作站地点"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
...@@ -208,21 +272,35 @@ ...@@ -208,21 +272,35 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-form-item label="标准工时" prop="stdWorkingTime">
<el-input
v-model="form.stdWorkingTime"
placeholder="请输入标准工时"
/>
</el-form-item>
</el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="是否启用" prop="enableFlag"> <el-form-item label="是否启用" prop="enableFlag">
<el-radio-group v-model="form.enableFlag" disabled v-if="optType=='view'"> <el-radio-group
v-model="form.enableFlag"
disabled
v-if="optType == 'view'"
>
<el-radio <el-radio
v-for="dict in dict.type.sys_yes_no" v-for="dict in dict.type.sys_yes_no"
:key="dict.value" :key="dict.value"
:label="dict.value" :label="dict.value"
>{{dict.label}}</el-radio> >{{ dict.label }}</el-radio
>
</el-radio-group> </el-radio-group>
<el-radio-group v-model="form.enableFlag" v-else> <el-radio-group v-model="form.enableFlag" v-else>
<el-radio <el-radio
v-for="dict in dict.type.sys_yes_no" v-for="dict in dict.type.sys_yes_no"
:key="dict.value" :key="dict.value"
:label="dict.value" :label="dict.value"
>{{dict.label}}</el-radio> >{{ dict.label }}</el-radio
>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -230,48 +308,90 @@ ...@@ -230,48 +308,90 @@
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" /> <el-input
v-model="form.remark"
type="textarea"
placeholder="请输入内容"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<el-divider content-position="center" v-if="form.workstationId !=null">工作站资源</el-divider> <el-divider content-position="center" v-if="form.workstationId != null"
<MachinerySelectSingle ref="machinerySelect" @onSelected="onMachineryAdd"></MachinerySelectSingle> >工作站资源</el-divider
<el-row v-if="form.workstationId !=null"> >
<el-col :span=24> <MachinerySelectSingle
ref="machinerySelect"
@onSelected="onMachineryAdd"
></MachinerySelectSingle>
<el-row v-if="form.workstationId != null">
<el-col :span="24">
<el-carousel trigger="click" type="card" :autoplay="false"> <el-carousel trigger="click" type="card" :autoplay="false">
<el-carousel-item> <el-carousel-item>
<el-card shadow="always" style="width:450px"> <el-card shadow="always" style="width: 450px">
<div slot="header"> <div slot="header">
<span>设备资源</span> <span>设备资源</span>
<el-button style="float:right; padding: 3px 0" @click="handleMachineryAdd" v-if="optType !='view'" type="text">新增</el-button> <el-button
style="float: right; padding: 3px 0"
@click="handleMachineryAdd"
v-if="optType != 'view'"
type="text"
>新增</el-button
>
</div> </div>
<WorkStationMachine ref="machineryList" :optType="optType" :workstationId="form.workstationId" style="align:center"></WorkStationMachine> <WorkStationMachine
ref="machineryList"
:optType="optType"
:workstationId="form.workstationId"
style="align: center"
></WorkStationMachine>
</el-card> </el-card>
</el-carousel-item> </el-carousel-item>
<el-carousel-item> <el-carousel-item>
<el-card shadow="always" style="width:400px"> <el-card shadow="always" style="width: 400px">
<div slot="header"> <div slot="header">
<span>人力资源</span> <span>人力资源</span>
<el-button style="float:right; padding: 3px 0" @click="handlePostAdd" v-if="optType !='view'" type="text">新增</el-button> <el-button
style="float: right; padding: 3px 0"
@click="handlePostAdd"
v-if="optType != 'view'"
type="text"
>新增</el-button
>
</div> </div>
<Workstationworker ref="postList" :optType="optType" :workstationId="form.workstationId"></Workstationworker> <Workstationworker
ref="postList"
:optType="optType"
:workstationId="form.workstationId"
></Workstationworker>
</el-card> </el-card>
</el-carousel-item> </el-carousel-item>
<el-carousel-item> <el-carousel-item>
<el-card shadow="always" style="width:400px"> <el-card shadow="always" style="width: 400px">
<div slot="header"> <div slot="header">
<span>工装夹具</span> <span>工装夹具</span>
<el-button style="float:right; padding: 5px 0" @click="handleToolTypeAdd" v-if="optType !='view'" type="text">新增</el-button> <el-button
style="float: right; padding: 5px 0"
@click="handleToolTypeAdd"
v-if="optType != 'view'"
type="text"
>新增</el-button
>
</div> </div>
<WorkStationTool ref="toolList" :optType="optType" :workstationId="form.workstationId"></WorkStationTool> <WorkStationTool
ref="toolList"
:optType="optType"
:workstationId="form.workstationId"
></WorkStationTool>
</el-card> </el-card>
</el-carousel-item> </el-carousel-item>
</el-carousel> </el-carousel>
</el-col> </el-col>
</el-row> </el-row>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="cancel" v-if="optType =='view'">返回</el-button> <el-button type="primary" @click="cancel" v-if="optType == 'view'"
>返回</el-button
>
<el-button type="primary" @click="submitForm" v-else>保 存</el-button> <el-button type="primary" @click="submitForm" v-else>保 存</el-button>
<el-button @click="cancel">关 闭</el-button> <el-button @click="cancel">关 闭</el-button>
</div> </div>
...@@ -280,35 +400,46 @@ ...@@ -280,35 +400,46 @@
</template> </template>
<script> <script>
import { listWorkstation, getWorkstation, delWorkstation, addWorkstation, updateWorkstation } from "@/api/mes/md/workstation"; import {
listWorkstation,
getWorkstation,
delWorkstation,
addWorkstation,
updateWorkstation,
} from "@/api/mes/md/workstation";
//设备资源选择与保存 //设备资源选择与保存
import WorkStationMachine from "./components/machine"; import WorkStationMachine from "./components/machine";
import MachinerySelectSingle from "@/components/machinerySelect/single.vue"; import MachinerySelectSingle from "@/components/machinerySelect/single.vue";
import {addWorkstationmachine} from "@/api/mes/md/workstationmachine"; import { addWorkstationmachine } from "@/api/mes/md/workstationmachine";
//人力资源选择与保存 //人力资源选择与保存
import Workstationworker from "./components/worker"; import Workstationworker from "./components/worker";
//工装夹具资源选择与保存 //工装夹具资源选择与保存
import WorkStationTool from "./components/tool"; import WorkStationTool from "./components/tool";
import {getTreeList} from "@/api/mes/wm/warehouse" import { getTreeList } from "@/api/mes/wm/warehouse";
import {listAllProcess} from "@/api/mes/pro/process"; import { listAllProcess } from "@/api/mes/pro/process";
import {genCode} from "@/api/system/autocode/rule"; import { genCode } from "@/api/system/autocode/rule";
import { listAllWorkshop } from "@/api/mes/md/workshop"; import { listAllWorkshop } from "@/api/mes/md/workshop";
export default { export default {
name: "Workstation", name: "Workstation",
dicts: ['sys_yes_no'], dicts: ["sys_yes_no"],
components: {WorkStationMachine,MachinerySelectSingle,Workstationworker,WorkStationTool}, components: {
WorkStationMachine,
MachinerySelectSingle,
Workstationworker,
WorkStationTool,
},
data() { data() {
return { return {
//自动生成编码 //自动生成编码
autoGenFlag:false, autoGenFlag: false,
optType: undefined, optType: undefined,
warehouseInfo:[], warehouseInfo: [],
warehouseOptions:[], warehouseOptions: [],
warehouseProps:{ warehouseProps: {
multiple: false, multiple: false,
value: 'pId', value: "pId",
label: 'pName', label: "pName",
}, },
// 遮罩层 // 遮罩层
loading: true, loading: true,
...@@ -325,9 +456,9 @@ export default { ...@@ -325,9 +456,9 @@ export default {
// 工作站表格数据 // 工作站表格数据
workstationList: [], workstationList: [],
//车间选项 //车间选项
workshopOptions:[], workshopOptions: [],
//工序选项 //工序选项
processOptions:[], processOptions: [],
// 弹出层标题 // 弹出层标题
title: "", title: "",
// 是否显示弹出层 // 是否显示弹出层
...@@ -349,27 +480,31 @@ export default { ...@@ -349,27 +480,31 @@ export default {
locationId: null, locationId: null,
areaId: null, areaId: null,
enableFlag: null, enableFlag: null,
stdWorkingTime: null,
}, },
// 表单参数 // 表单参数
form: {}, form: {},
// 表单校验 // 表单校验
rules: { rules: {
workstationCode: [ workstationCode: [
{ required: true, message: "工作站编号不能为空", trigger: "blur" } { required: true, message: "工作站编号不能为空", trigger: "blur" },
], ],
workstationName: [ workstationName: [
{ required: true, message: "工作站名称不能为空", trigger: "blur" } { required: true, message: "工作站名称不能为空", trigger: "blur" },
], ],
enableFlag: [ enableFlag: [
{ required: true, message: "是否启用不能为空", trigger: "blur" } { required: true, message: "是否启用不能为空", trigger: "blur" },
], ],
workshopId: [ workshopId: [
{ required: true, message: "请选择所属车间", trigger: "blur" } { required: true, message: "请选择所属车间", trigger: "blur" },
], ],
processId: [ processId: [
{ required: true, message: "请选择所属工序", trigger: "blur" } { required: true, message: "请选择所属工序", trigger: "blur" },
] ],
} stdWorkingTime: [
{ required: true, message: "标准工时不能为空", trigger: "blur" },
],
},
}; };
}, },
created() { created() {
...@@ -382,45 +517,52 @@ export default { ...@@ -382,45 +517,52 @@ export default {
/** 查询工作站列表 */ /** 查询工作站列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listWorkstation(this.queryParams).then(response => { listWorkstation(this.queryParams).then((response) => {
this.workstationList = response.rows; this.workstationList = response.rows;
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
}); });
}, },
//查询车间信息 //查询车间信息
getWorkshops(){ getWorkshops() {
listAllWorkshop().then( response => { listAllWorkshop().then((response) => {
this.workshopOptions = response.data; this.workshopOptions = response.data;
}); });
}, },
//查询工序信息 //查询工序信息
getProcess(){ getProcess() {
listAllProcess().then( response =>{ listAllProcess().then((response) => {
this.processOptions = response.data; this.processOptions = response.data;
}); });
}, },
//获取仓库 //获取仓库
getWarehouseList(){ getWarehouseList() {
getTreeList().then( response =>{ getTreeList().then((response) => {
this.warehouseOptions = response.data; this.warehouseOptions = response.data;
this.warehouseOptions.map(w =>{ this.warehouseOptions.map((w) => {
w.children.map(l =>{ w.children.map((l) => {
let lstr =JSON.stringify(l.children).replace(/locationId/g,'lId').replace(/areaId/g, 'pId').replace(/areaName/g,'pName'); let lstr = JSON.stringify(l.children)
.replace(/locationId/g, "lId")
.replace(/areaId/g, "pId")
.replace(/areaName/g, "pName");
l.children = JSON.parse(lstr); l.children = JSON.parse(lstr);
}); });
let wstr = JSON.stringify(w.children).replace(/warehouseId/g,'wId').replace(/locationId/g, 'pId').replace(/locationName/g,'pName'); let wstr = JSON.stringify(w.children)
.replace(/warehouseId/g, "wId")
.replace(/locationId/g, "pId")
.replace(/locationName/g, "pName");
w.children = JSON.parse(wstr); w.children = JSON.parse(wstr);
}); });
let ostr=JSON.stringify(this.warehouseOptions).replace(/warehouseId/g,'pId').replace(/warehouseName/g, 'pName'); let ostr = JSON.stringify(this.warehouseOptions)
.replace(/warehouseId/g, "pId")
.replace(/warehouseName/g, "pName");
this.warehouseOptions = JSON.parse(ostr); this.warehouseOptions = JSON.parse(ostr);
}); });
}, },
//选择默认的仓库、库区、库位 //选择默认的仓库、库区、库位
handleWarehouseChanged(obj){ handleWarehouseChanged(obj) {
if(obj !=null){ if (obj != null) {
this.form.warehouseId = obj[0]; this.form.warehouseId = obj[0];
this.form.locationId = obj[1]; this.form.locationId = obj[1];
this.form.areaId = obj[2]; this.form.areaId = obj[2];
...@@ -447,12 +589,12 @@ export default { ...@@ -447,12 +589,12 @@ export default {
warehouseId: null, warehouseId: null,
locationId: null, locationId: null,
areaId: null, areaId: null,
enableFlag: 'Y', enableFlag: "Y",
remark: null, remark: null,
createBy: null, createBy: null,
createTime: null, createTime: null,
updateBy: null, updateBy: null,
updateTime: null updateTime: null,
}; };
this.autoGenFlag = false; this.autoGenFlag = false;
this.resetForm("form"); this.resetForm("form");
...@@ -464,7 +606,7 @@ export default { ...@@ -464,7 +606,7 @@ export default {
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.queryParams ={ this.queryParams = {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
workstationCode: null, workstationCode: null,
...@@ -486,9 +628,9 @@ export default { ...@@ -486,9 +628,9 @@ export default {
}, },
// 多选框选中数据 // 多选框选中数据
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.workstationId) this.ids = selection.map((item) => item.workstationId);
this.single = selection.length!==1 this.single = selection.length !== 1;
this.multiple = !selection.length this.multiple = !selection.length;
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
...@@ -499,11 +641,11 @@ export default { ...@@ -499,11 +641,11 @@ export default {
this.optType = "add"; this.optType = "add";
}, },
// 查询明细按钮操作 // 查询明细按钮操作
handleView(row){ handleView(row) {
this.reset(); this.reset();
this.getWorkshops(); this.getWorkshops();
const workstationId = row.workstationId || this.ids; const workstationId = row.workstationId || this.ids;
getWorkstation(workstationId).then(response => { getWorkstation(workstationId).then((response) => {
this.form = response.data; this.form = response.data;
this.open = true; this.open = true;
this.title = "查看车间信息"; this.title = "查看车间信息";
...@@ -514,8 +656,8 @@ export default { ...@@ -514,8 +656,8 @@ export default {
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
this.getWorkshops(); this.getWorkshops();
const workstationId = row.workstationId || this.ids const workstationId = row.workstationId || this.ids;
getWorkstation(workstationId).then(response => { getWorkstation(workstationId).then((response) => {
this.form = response.data; this.form = response.data;
this.open = true; this.open = true;
this.title = "修改工作站"; this.title = "修改工作站";
...@@ -524,16 +666,16 @@ export default { ...@@ -524,16 +666,16 @@ export default {
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
this.$refs["form"].validate(valid => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
if (this.form.workstationId != null) { if (this.form.workstationId != null) {
updateWorkstation(this.form).then(response => { updateWorkstation(this.form).then((response) => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.open = false; this.open = false;
this.getList(); this.getList();
}); });
} else { } else {
addWorkstation(this.form).then(response => { addWorkstation(this.form).then((response) => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.open = false; this.open = false;
this.getList(); this.getList();
...@@ -545,51 +687,59 @@ export default { ...@@ -545,51 +687,59 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const workstationIds = row.workstationId || this.ids; const workstationIds = row.workstationId || this.ids;
this.$modal.confirm('是否确认删除工作站?').then(function() { this.$modal
.confirm("是否确认删除工作站?")
.then(function () {
return delWorkstation(workstationIds); return delWorkstation(workstationIds);
}).then(() => { })
.then(() => {
this.getList(); this.getList();
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功");
}).catch(() => {}); })
.catch(() => {});
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.download('mes/md/workstation/export', { this.download(
...this.queryParams "mes/md/workstation/export",
}, `workstation_${new Date().getTime()}.xlsx`) {
...this.queryParams,
},
`workstation_${new Date().getTime()}.xlsx`
);
}, },
//自动生成编码 //自动生成编码
handleAutoGenChange(autoGenFlag){ handleAutoGenChange(autoGenFlag) {
if(autoGenFlag){ if (autoGenFlag) {
genCode('WORKSTATION_CODE').then(response =>{ genCode("WORKSTATION_CODE").then((response) => {
this.form.workstationCode = response; this.form.workstationCode = response;
}); });
}else{ } else {
this.form.workstationCode = null; this.form.workstationCode = null;
} }
}, },
//设备资源选择弹出 //设备资源选择弹出
handleMachineryAdd(){ handleMachineryAdd() {
this.$refs.machinerySelect.showFlag = true; this.$refs.machinerySelect.showFlag = true;
}, },
//设备资源选择回调 //设备资源选择回调
onMachineryAdd(rows){ onMachineryAdd(rows) {
debugger debugger;
this.loading = true; this.loading = true;
rows.workstationId = this.form.workstationId; rows.workstationId = this.form.workstationId;
addWorkstationmachine(rows).then(response =>{ addWorkstationmachine(rows).then((response) => {
this.$refs.machineryList.getList(); this.$refs.machineryList.getList();
this.loading = false; this.loading = false;
}); });
}, },
//人力资源-岗位新增 //人力资源-岗位新增
handlePostAdd(){ handlePostAdd() {
this.$refs.postList.handleAdd(); this.$refs.postList.handleAdd();
}, },
//工装夹具资源新增 //工装夹具资源新增
handleToolTypeAdd(){ handleToolTypeAdd() {
this.$refs.toolList.handleAdd(); this.$refs.toolList.handleAdd();
} },
} },
}; };
</script> </script>
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="100px"
>
<el-form-item label="BOM编码" prop="bomCode">
<el-input
v-model="queryParams.bomCode"
placeholder="请输入BOM编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="产品名称" prop="itemName">
<el-input
v-model="queryParams.itemName"
placeholder="请输入产品名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="用途名称" prop="usageName">
<el-input
v-model="queryParams.usageName"
placeholder="请输入用途名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="是否启用" prop="enableFlag">
<el-input
v-model="queryParams.enableFlag"
placeholder="请输入是否启用"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['mes:pro:bom:add']"
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['mes:pro:bom:edit']"
>修改</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['mes:pro:bom:remove']"
>删除</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['mes:pro:bom:export']"
>导出</el-button
>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="bomList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="BOM编码" width="130" align="center" prop="bomCode">
<template slot-scope="scope">
<el-button
type="text"
@click="handleView(scope.row)"
v-hasPermi="['mes:pro:bom:query']"
>{{ scope.row.bomCode }}</el-button
>
</template>
</el-table-column>
<el-table-column label="产品名称" fixed="left" width="120" align="center" prop="itemName" />
<el-table-column label="生产用途" align="center" prop="usageName" />
<el-table-column label="基本数量" align="center" prop="quantity" />
<el-table-column
label="基本计量单位"
width="125"
align="center"
prop="unitOfMeasure"
/>
<el-table-column label="是否启用" align="center" prop="enableFlag">
<template slot-scope="scope">
<dict-tag
:options="dict.type.sys_yes_no"
:value="scope.row.enableFlag"
/>
</template>
</el-table-column>
<el-table-column
label="有效期开始"
align="center"
prop="expirationDateStart"
width="120"
>
<template slot-scope="scope">
<span>{{
parseTime(scope.row.expirationDateStart, "{y}-{m}-{d}")
}}</span>
</template>
</el-table-column>
<el-table-column
label="有效期结束"
align="center"
prop="expirationDateEnd"
width="120"
>
<template slot-scope="scope">
<span>{{
parseTime(scope.row.expirationDateEnd, "{y}-{m}-{d}")
}}</span>
</template>
</el-table-column>
<el-table-column label="ECN编码" width="120" align="center" prop="ecnCode" />
<el-table-column
label="单层厚"
width="120"
align="center"
prop="singleLayerThickness"
/>
<el-table-column label="单重" width="120" align="center" prop="singleWeight" />
<el-table-column label="排版行数" width="120" align="center" prop="rowNum" />
<el-table-column
label="派工倍数"
width="120"
align="center"
prop="dispatchMultiple"
/>
<el-table-column label="是否启用" width="120" align="center" prop="enableFlag">
<template slot-scope="scope">
<dict-tag
:options="dict.type.sys_yes_no"
:value="scope.row.enableFlag"
/>
</template>
</el-table-column>
<el-table-column
label="备注"
width="120"
align="center"
prop="remark"
:show-overflow-tooltip="true"
/>
<el-table-column
label="操作"
align="center"
width="130"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-link
size="mini"
type="primary"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['mes:pro:bom:edit']"
>修改</el-link
>
<el-link
style="margin-left: 10px"
size="mini"
type="danger"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['mes:pro:bom:remove']"
>删除</el-link
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改生产BOM对话框 -->
<el-dialog :title="title" :visible.sync="open" width="960px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-row>
<el-col :span="8">
<el-form-item label="BOM编码" prop="bomCode">
<el-input v-model="form.bomCode" placeholder="请输入BOM编码" />
</el-form-item>
</el-col>
<el-col :span="3">
<el-form-item label-width="80">
<el-switch
v-model="autoGenFlag"
active-color="#13ce66"
active-text="自动生成"
@change="handleAutoGenChange(autoGenFlag)"
v-if="optType != 'view'"
>
</el-switch>
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item label="物料名称" prop="itemName">
<el-input
v-model="form.itemName"
disabled
placeholder="请选择物料信息"
>
<el-button
slot="append"
icon="el-icon-search"
@click="handleItemSelect"
></el-button>
</el-input>
<MdItem ref="MdItem" @onSelected="onItemSelected"></MdItem>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="是否启用" prop="enableFlag">
<el-radio-group
v-model="form.enableFlag"
disabled
v-if="optType == 'view'"
>
<el-radio
v-for="dict in dict.type.sys_yes_no"
:key="dict.value"
:label="dict.value"
>{{ dict.label }}</el-radio
>
</el-radio-group>
<el-radio-group v-model="form.enableFlag" v-else>
<el-radio
v-for="dict in dict.type.sys_yes_no"
:key="dict.value"
:label="dict.value"
>{{ dict.label }}</el-radio
>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="7">
<el-form-item label="用途名称" prop="usageId">
<el-input
v-model="form.usageName"
disabled
placeholder="请选择用途"
>
<el-button
slot="append"
icon="el-icon-search"
@click="handleUsageSelect()"
></el-button>
</el-input>
<UsageItem
ref="woSelect"
@onSelected="onUsageSelected"
></UsageItem>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="基本数量" prop="quantity">
<el-input v-model="form.quantity" placeholder="请输入基本数量" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="基本计量单位" prop="unitOfMeasure">
<el-input v-model="form.unitOfMeasure" disabled />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="有效期开始" prop="expirationDateStart">
<el-date-picker
clearable
v-model="form.expirationDateStart"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择有效期开始"
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="有效期结束" prop="expirationDateEnd">
<el-date-picker
clearable
v-model="form.expirationDateEnd"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择有效期结束"
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="ECN编码" prop="ecnCode">
<el-input v-model="form.ecnCode" placeholder="请输入ECN编码" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="单层厚" prop="singleLayerThickness">
<el-input
v-model="form.singleLayerThickness"
placeholder="请输入单层厚"
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="单重" prop="singleWeight">
<el-input v-model="form.singleWeight" placeholder="请输入单重" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="排版行数" prop="rowNum">
<el-input v-model="form.rowNum" placeholder="请输入排版行数" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="派工倍数" prop="dispatchMultiple">
<el-input
v-model="form.dispatchMultiple"
placeholder="请输入派工倍数"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="备注" prop="remark">
<el-input
v-model="form.remark"
type="textarea"
placeholder="请输入内容"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-divider content-position="center" v-if="form.bomId != null"
>组件</el-divider
>
<BomItem
v-if="form.bomId != null"
:bomId="form.bomId"
:optType="optType"
></BomItem>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="cancel" v-if="optType == 'view'"
>返回</el-button
>
<el-button type="primary" @click="submitForm" v-else> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listBom, getBom, delBom, addBom, updateBom } from "@/api/mes/pro/bom";
// import { listAllUsage } from "@/api/mes/pro/usage";
import BomItem from "./item.vue";
import MdItem from "@/components/itemSelect/single.vue";
import UsageItem from "@/components/usageSelect/single.vue";
import { genCode } from "@/api/system/autocode/rule";
export default {
name: "Bom",
dicts: ["sys_yes_no"],
components: { BomItem, MdItem, UsageItem },
data() {
return {
//自动生成编码
autoGenFlag: false,
optType: undefined,
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 生产BOM表格数据
bomList: [],
// 用途列表
UsageOptions: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
bomCode: null,
usageId: null,
itemId: null,
enableFlag: null,
},
// 表单参数
form: {},
// 表单校验
rules: {
bomCode: [
{ required: true, message: "BOM编码不能为空", trigger: "blur" },
],
usageName: [
{ required: true, message: "用途不能为空", trigger: "blur" },
],
itemName: [
{ required: true, message: "产品id不能为空", trigger: "blur" },
],
enableFlag: [
{ required: true, message: "是否启用不能为空", trigger: "blur" },
],
usageId: [{ required: true, message: "用途不能为空", trigger: "blur" }],
},
};
},
created() {
this.getList();
// this.getUsage();
},
methods: {
/** 查询生产BOM列表 */
getList() {
this.loading = true;
listBom(this.queryParams).then((response) => {
this.bomList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 查询物料信息
handleItemSelect() {
this.$refs.MdItem.showFlag = true;
},
onItemSelected(row) {
if (row != undefined && row != null) {
this.form.itemId = row.itemId;
this.form.itemCode = row.itemCode;
this.form.itemName = row.itemName;
this.form.itemRemark = row.itemRemark;
this.form.unitOfMeasure = row.unitOfMeasure;
}
},
// 查询用途信息
handleUsageSelect() {
this.$refs.woSelect.showFlag = true;
},
onUsageSelected(row) {
if (row != undefined && row != null) {
this.form.usageId = row.usageId;
this.form.usageCode = row.usageCode;
this.form.usageName = row.usageName;
}
},
// getUsage() {
// listAllUsage().then((response) => {
// this.UsageOptions = response.data;
// });
// },
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
bomId: null,
bomCode: null,
itemId: null,
itemName: null,
usageName: null,
usageId: null,
quantity: null,
unitOfMeasure: null,
expirationDateStart: null,
expirationDateEnd: null,
ecnCode: null,
singleLayerThickness: null,
singleWeight: null,
rowNum: null,
dispatchMultiple: null,
enableFlag: "Y",
remark: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
};
this.autoGenFlag = false;
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.bomId);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加BOM";
this.optType = "add";
},
// 查询明细按钮操作
handleView(row) {
this.reset();
const bomId = row.bomId || this.ids;
getBom(bomId).then((response) => {
this.form = response.data;
this.open = true;
this.title = "查看BOM信息";
this.optType = "view";
});
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const bomId = row.bomId || this.ids;
getBom(bomId).then((response) => {
this.form = response.data;
this.open = true;
this.title = "修改BOM";
this.optType = "edit";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.bomId != null) {
updateBom(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addBom(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const bomIds = row.bomId || this.ids;
this.$modal
.confirm("是否确认删除BOM?")
.then(function () {
return delBom(bomIds);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download(
"mes/pro/bom/export",
{
...this.queryParams,
},
`bom_${new Date().getTime()}.xlsx`
);
},
//自动生成编码
handleAutoGenChange(autoGenFlag) {
if (autoGenFlag) {
genCode("BOM_CODE").then((response) => {
this.form.bomCode = response;
});
} else {
this.form.bomCode = null;
}
},
},
};
</script>
<template>
<div class="app-container">
<el-row v-if="optType != 'view'" :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['mes:pro:bom:add']"
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['mes:pro:bom:edit']"
>修改</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['mes:pro:bom:remove']"
>删除</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['mes:pro:bom:export']"
>导出</el-button
>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="bomItemList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column
label="物料名称"
fixed="left"
width="120"
align="center"
prop="itemName"
/>
<el-table-column
label="组件数量"
align="center"
prop="quantity"
:show-overflow-tooltip="true"
/>
<el-table-column
label="计量单位"
align="center"
prop="unitOfMeasure"
:show-overflow-tooltip="true"
/>
<el-table-column
label="报废百分比"
width="120"
align="center"
prop="scrapPercentage"
:show-overflow-tooltip="true"
/>
<el-table-column label="是否启用" align="center" prop="enableFlag">
<template slot-scope="scope">
<dict-tag
:options="dict.type.sys_yes_no"
:value="scope.row.enableFlag"
/>
</template>
</el-table-column>
<el-table-column
label="替代组"
align="center"
prop="alternativeGroup"
:show-overflow-tooltip="true"
/>
<el-table-column
label="替代优先级"
width="120"
align="center"
prop="alternativePriorities"
:show-overflow-tooltip="true"
/>
<el-table-column
label="替代策略"
width="120"
align="center"
prop="alternativeStrategy"
:show-overflow-tooltip="true"
/>
<el-table-column
label="替代使用概率"
width="120"
align="center"
prop="alternativeProbability"
:show-overflow-tooltip="true"
/>
<el-table-column
label="BOM行备注"
align="center"
width="120"
prop="bomItemRemark"
:show-overflow-tooltip="true"
/>
<el-table-column
label="物料备注"
width="150"
align="center"
prop="itemRemark"
:show-overflow-tooltip="true"
/>
<el-table-column
label="操作"
width="150px"
v-if="optType != 'view'"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-link
size="mini"
type="primary"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['mes:pro:bom:edit']"
>修改</el-link
>
<el-link
size="mini"
style="margin-left: 10px"
type="danger"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['mes:pro:bom:remove']"
>删除</el-link
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改生产BOM内容对话框 -->
<el-dialog :title="title" :visible.sync="open" width="960px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<el-col :span="8">
<el-form-item label="物料编码" prop="itemCode">
<el-input v-model="form.itemCode" placeholder="请选择物料信息">
<el-button
slot="append"
icon="el-icon-search"
@click="handleItemSelect"
></el-button>
</el-input>
<MdItem ref="woSelect" @onSelected="onItemSelected"></MdItem>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="物料名称" prop="itemName">
<el-input v-model="form.itemName" placeholder="请输入物料名称" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="组件数量" prop="quantity">
<el-input v-model="form.quantity" placeholder="请输入组件数量" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="计量单位" prop="unitOfMeasure">
<el-input v-model="form.unitOfMeasure" disabled />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="报废百分比" prop="scrapPercentage">
<el-input
v-model="form.scrapPercentage"
placeholder="请输入报废百分比"
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="替代组" prop="alternativeGroup">
<el-input
v-model="form.alternativeGroup"
placeholder="请输入替代组"
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="替代优先级" prop="alternativePriorities">
<el-input
v-model="form.alternativePriorities"
placeholder="请输入替代优先级"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="替代策略" prop="alternativeStrategy">
<el-input
v-model="form.alternativeStrategy"
placeholder="请输入替代策略"
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="替代使用概率" prop="alternativeProbability">
<el-input
v-model="form.alternativeProbability"
placeholder="请输入替代使用概率"
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="是否启用" prop="enableFlag">
<el-radio-group
v-model="form.enableFlag"
disabled
v-if="optType == 'view'"
>
<el-radio
v-for="dict in dict.type.sys_yes_no"
:key="dict.value"
:label="dict.value"
>{{ dict.label }}</el-radio
>
</el-radio-group>
<el-radio-group v-model="form.enableFlag" v-else>
<el-radio
v-for="dict in dict.type.sys_yes_no"
:key="dict.value"
:label="dict.value"
>{{ dict.label }}</el-radio
>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="BOM行备注" prop="bomItemRemark">
<el-input
v-model="form.bomItemRemark"
type="textarea"
placeholder="请输入内容"
/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="物料备注" prop="itemRemark">
<el-input
v-model="form.itemRemark"
type="textarea"
placeholder="请输入内容"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listBomItem,
getBomItem,
delBomItem,
addBomItem,
updateBomItem,
} from "@/api/mes/pro/bomItem";
import MdItem from "@/components/itemSelect/single.vue";
import { listMdItem } from "@/api/mes/md/mdItem";
export default {
name: "BomItem",
dicts: ["sys_yes_no"],
components: { MdItem },
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 生产BOM内容表格数据
bomItemList: [],
// 物料选项
itemOptions: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
bomId: this.bomId,
itemId: null,
},
// 表单参数
form: {},
// 表单校验
rules: {
// bomId: [{ required: true, message: "BOM不能为空", trigger: "blur" }],
},
};
},
props: {
bomId: undefined,
optType: undefined,
},
created() {
this.getList();
// this.getMdItem();
},
methods: {
/** 查询生产BOM内容列表 */
getList() {
this.loading = true;
listBomItem(this.queryParams).then((response) => {
this.bomItemList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 查询物料信息
getMdItem() {
listMdItem().then((response) => {
this.itemOptions = response.data;
});
},
handleItemSelect() {
this.$refs.woSelect.showFlag = true;
},
onItemSelected(row) {
if (row != undefined && row != null) {
this.form.itemId = row.itemId;
this.form.itemCode = row.itemCode;
this.form.itemName = row.itemName;
this.form.itemRemark = row.itemRemark;
this.form.unitOfMeasure = row.unitOfMeasure;
}
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
bomItemId: null,
bomId: null,
itemId: null,
itemName: null,
quantity: null,
unitOfMeasure: null,
scrapPercentage: null,
alternativeGroup: null,
alternativePriorities: null,
alternativeStrategy: null,
alternativeProbability: null,
bomItemRemark: null,
itemRemark: null,
enableFlag: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.bomItemId);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加操作步骤";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const bomItemId = row.bomItemId || this.ids;
getBomItem(bomItemId).then((response) => {
this.form = response.data;
this.open = true;
this.title = "修改操作步骤";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.bomItemId != null) {
updateBomItem(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
const params = {
...this.form,
bomId: this.bomId,
};
addBomItem(params).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const bomItemIds = row.bomItemId || this.ids;
this.$modal
.confirm("是否确认删除操作步骤?")
.then(function () {
return delBomItem(bomItemIds);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download(
"mes/pro/bomItem/export",
{
...this.queryParams,
},
`bomItem_${new Date().getTime()}.xlsx`
);
},
},
};
</script>
<template> <template>
<div class="app-container"> <div class="app-container">
<el-row v-if="optType !='view'" :gutter="10" class="mb8"> <el-row v-if="optType != 'view'" :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="primary" type="primary"
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['mes:pro:process:add']" v-hasPermi="['mes:pro:process:add']"
>新增</el-button> >新增</el-button
>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
...@@ -20,7 +21,8 @@ ...@@ -20,7 +21,8 @@
:disabled="single" :disabled="single"
@click="handleUpdate" @click="handleUpdate"
v-hasPermi="['mes:pro:process:edit']" v-hasPermi="['mes:pro:process:edit']"
>修改</el-button> >修改</el-button
>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
...@@ -31,7 +33,8 @@ ...@@ -31,7 +33,8 @@
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click="handleDelete"
v-hasPermi="['mes:pro:process:remove']" v-hasPermi="['mes:pro:process:remove']"
>删除</el-button> >删除</el-button
>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
...@@ -41,19 +44,54 @@ ...@@ -41,19 +44,54 @@
size="mini" size="mini"
@click="handleExport" @click="handleExport"
v-hasPermi="['mes:pro:process:export']" v-hasPermi="['mes:pro:process:export']"
>导出</el-button> >导出</el-button
>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loading" :data="processcontentList" @selection-change="handleSelectionChange"> <el-table
v-loading="loading"
:data="processcontentList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="顺序编号" align="center" prop="orderNum" /> <el-table-column label="顺序编号" align="center" prop="orderNum" />
<el-table-column label="步骤说明" width="400px" align="center" prop="contentText" :show-overflow-tooltip="true"/> <el-table-column
<el-table-column label="辅助设备" align="center" prop="device" :show-overflow-tooltip="true"/> label="步骤说明"
<el-table-column label="辅助材料" align="center" prop="material" :show-overflow-tooltip="true"/> width="400px"
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true"/> align="center"
<el-table-column label="操作" width="100px" v-if="optType !='view'" align="center" class-name="small-padding fixed-width"> prop="contentText"
:show-overflow-tooltip="true"
/>
<el-table-column
label="辅助设备"
align="center"
prop="device"
:show-overflow-tooltip="true"
/>
<el-table-column
label="辅助材料"
align="center"
prop="material"
:show-overflow-tooltip="true"
/>
<el-table-column
label="备注"
align="center"
prop="remark"
:show-overflow-tooltip="true"
/>
<el-table-column
label="操作"
width="100px"
v-if="optType != 'view'"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="mini" size="mini"
...@@ -61,20 +99,22 @@ ...@@ -61,20 +99,22 @@
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['mes:pro:process:edit']" v-hasPermi="['mes:pro:process:edit']"
>修改</el-button> >修改</el-button
>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['mes:pro:process:remove']" v-hasPermi="['mes:pro:process:remove']"
>删除</el-button> >删除</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination
v-show="total>0" v-show="total > 0"
:total="total" :total="total"
:page.sync="queryParams.pageNum" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
...@@ -84,10 +124,14 @@ ...@@ -84,10 +124,14 @@
<!-- 添加或修改生产工序内容对话框 --> <!-- 添加或修改生产工序内容对话框 -->
<el-dialog :title="title" :visible.sync="open" width="960px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="960px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px"> <el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row > <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="顺序编号" prop="orderNum"> <el-form-item label="顺序编号" prop="orderNum">
<el-input-number :min="1" v-model="form.orderNum" placeholder="请输入顺序编号" /> <el-input-number
:min="1"
v-model="form.orderNum"
placeholder="请输入顺序编号"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
...@@ -111,14 +155,22 @@ ...@@ -111,14 +155,22 @@
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="步骤说明" prop="contentText"> <el-form-item label="步骤说明" prop="contentText">
<el-input v-model="form.contentText" type="textarea" placeholder="请输入内容" /> <el-input
v-model="form.contentText"
type="textarea"
placeholder="请输入内容"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" /> <el-input
v-model="form.remark"
type="textarea"
placeholder="请输入内容"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -132,7 +184,13 @@ ...@@ -132,7 +184,13 @@
</template> </template>
<script> <script>
import { listProcesscontent, getProcesscontent, delProcesscontent, addProcesscontent, updateProcesscontent } from "@/api/mes/pro/processcontent"; import {
listProcesscontent,
getProcesscontent,
delProcesscontent,
addProcesscontent,
updateProcesscontent,
} from "@/api/mes/pro/processcontent";
export default { export default {
name: "Processcontent", name: "Processcontent",
...@@ -172,14 +230,14 @@ export default { ...@@ -172,14 +230,14 @@ export default {
// 表单校验 // 表单校验
rules: { rules: {
processId: [ processId: [
{ required: true, message: "工序不能为空", trigger: "blur" } { required: true, message: "工序不能为空", trigger: "blur" },
], ],
} },
}; };
}, },
props :{ props: {
processId: undefined, processId: undefined,
optType: undefined optType: undefined,
}, },
created() { created() {
this.getList(); this.getList();
...@@ -188,7 +246,7 @@ export default { ...@@ -188,7 +246,7 @@ export default {
/** 查询生产工序内容列表 */ /** 查询生产工序内容列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listProcesscontent(this.queryParams).then(response => { listProcesscontent(this.queryParams).then((response) => {
this.processcontentList = response.rows; this.processcontentList = response.rows;
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
...@@ -213,7 +271,7 @@ export default { ...@@ -213,7 +271,7 @@ export default {
createBy: null, createBy: null,
createTime: null, createTime: null,
updateBy: null, updateBy: null,
updateTime: null updateTime: null,
}; };
this.resetForm("form"); this.resetForm("form");
}, },
...@@ -229,9 +287,9 @@ export default { ...@@ -229,9 +287,9 @@ export default {
}, },
// 多选框选中数据 // 多选框选中数据
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.contentId) this.ids = selection.map((item) => item.contentId);
this.single = selection.length!==1 this.single = selection.length !== 1;
this.multiple = !selection.length this.multiple = !selection.length;
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
...@@ -242,8 +300,8 @@ export default { ...@@ -242,8 +300,8 @@ export default {
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
const contentId = row.contentId || this.ids const contentId = row.contentId || this.ids;
getProcesscontent(contentId).then(response => { getProcesscontent(contentId).then((response) => {
this.form = response.data; this.form = response.data;
this.open = true; this.open = true;
this.title = "修改操作步骤"; this.title = "修改操作步骤";
...@@ -251,16 +309,16 @@ export default { ...@@ -251,16 +309,16 @@ export default {
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
this.$refs["form"].validate(valid => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
if (this.form.contentId != null) { if (this.form.contentId != null) {
updateProcesscontent(this.form).then(response => { updateProcesscontent(this.form).then((response) => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.open = false; this.open = false;
this.getList(); this.getList();
}); });
} else { } else {
addProcesscontent(this.form).then(response => { addProcesscontent(this.form).then((response) => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.open = false; this.open = false;
this.getList(); this.getList();
...@@ -272,19 +330,27 @@ export default { ...@@ -272,19 +330,27 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const contentIds = row.contentId || this.ids; const contentIds = row.contentId || this.ids;
this.$modal.confirm('是否确认删除操作步骤?').then(function() { this.$modal
.confirm("是否确认删除操作步骤?")
.then(function () {
return delProcesscontent(contentIds); return delProcesscontent(contentIds);
}).then(() => { })
.then(() => {
this.getList(); this.getList();
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功");
}).catch(() => {}); })
.catch(() => {});
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.download('mes/pro/processcontent/export', { this.download(
...this.queryParams "mes/pro/processcontent/export",
}, `processcontent_${new Date().getTime()}.xlsx`) {
} ...this.queryParams,
} },
`processcontent_${new Date().getTime()}.xlsx`
);
},
},
}; };
</script> </script>
...@@ -96,14 +96,14 @@ ...@@ -96,14 +96,14 @@
<el-dialog :title="title" :visible.sync="open" width="1100px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="1100px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="150px"> <el-form ref="form" :model="form" :rules="rules" label-width="150px">
<el-row> <el-row>
<el-col :span="12"> <el-col :span="8">
<el-form-item label="序号" prop="orderNum"> <el-form-item label="序号" width="120px" prop="orderNum">
<el-input-number :min="1" v-model="form.orderNum" placeholder="请输入序号" /> <el-input-number :min="1" v-model="form.orderNum" placeholder="请输入序号" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="8">
<el-form-item label="工序" prop="processId"> <el-form-item label="工序" prop="processId">
<el-select v-model="form.processId" placeholder="请选择工序"> <el-select v-model="form.processId" placeholder="请选择工序" @change="changeProcessId">
<el-option <el-option
v-for="item in processOptions" v-for="item in processOptions"
:key="item.processId" :key="item.processId"
...@@ -113,9 +113,7 @@ ...@@ -113,9 +113,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> <el-col :span="8">
<el-row>
<el-col :span="12">
<el-form-item label="与下一道工序关系" prop="linkType"> <el-form-item label="与下一道工序关系" prop="linkType">
<el-tooltip effect="dark" placement="right"> <el-tooltip effect="dark" placement="right">
<div slot="content"> <div slot="content">
...@@ -140,12 +138,10 @@ ...@@ -140,12 +138,10 @@
<el-color-picker v-model="form.colorCode"></el-color-picker> <el-color-picker v-model="form.colorCode"></el-color-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="7"> <el-col :span="2">
<el-input v-model="form.colorCode" maxlength="7" placeholder="请输入颜色编码在左侧选择颜色" /> <el-input v-model="form.colorCode" style="left: 5px" maxlength="7" placeholder="请输入颜色编码在左侧选择颜色" />
</el-col> </el-col>
</el-row> <el-col :span="7">
<el-row>
<el-col :span="8">
<el-form-item label="是否关键工序" prop="keyFlag"> <el-form-item label="是否关键工序" prop="keyFlag">
<el-tooltip effect="dark" placement="right"> <el-tooltip effect="dark" placement="right">
<div slot="content"> <div slot="content">
...@@ -163,7 +159,7 @@ ...@@ -163,7 +159,7 @@
</el-tooltip> </el-tooltip>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="10">
<el-form-item label="是否需要质检确认" prop="isCheck"> <el-form-item label="是否需要质检确认" prop="isCheck">
<el-tooltip effect="dark" placement="right"> <el-tooltip effect="dark" placement="right">
<div slot="content"> <div slot="content">
...@@ -181,8 +177,6 @@ ...@@ -181,8 +177,6 @@
</el-tooltip> </el-tooltip>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row>
<el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="准备时间" prop="defaultPreTime"> <el-form-item label="准备时间" prop="defaultPreTime">
<el-tooltip effect="dark" content="当前系统支持的最小时间粒度为1小时" placement="right"> <el-tooltip effect="dark" content="当前系统支持的最小时间粒度为1小时" placement="right">
...@@ -195,8 +189,27 @@ ...@@ -195,8 +189,27 @@
<el-input-number :min="0" :step="1" v-model="form.defaultSufTime" placeholder="请输入等待时间" /> <el-input-number :min="0" :step="1" v-model="form.defaultSufTime" placeholder="请输入等待时间" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> <el-col :span="8">
<el-row> <el-form-item label="工作站" prop="workstationId">
<el-input
v-model="form.workstationName"
disabled
placeholder="请选择工作站信息"
>
<el-button
slot="append"
icon="el-icon-search"
@click="handleWorkstationSelect"
></el-button>
</el-input>
<WorkstationSelect ref="WorkstationSelect" :processId="form.processId" @onSelected="onWorkstationSelected"></WorkstationSelect>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="标准工时" prop="stdWorkingTime">
<el-input-number :min="0" :step="0.1" v-model="form.stdWorkingTime" placeholder="请输入标准工时" />
</el-form-item>
</el-col>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" /> <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
...@@ -216,9 +229,12 @@ ...@@ -216,9 +229,12 @@
<script> <script>
import { listRouteprocess, getRouteprocess, delRouteprocess, addRouteprocess, updateRouteprocess } from "@/api/mes/pro/routeprocess"; import { listRouteprocess, getRouteprocess, delRouteprocess, addRouteprocess, updateRouteprocess } from "@/api/mes/pro/routeprocess";
import {listAllProcess} from "@/api/mes/pro/process"; import {listAllProcess} from "@/api/mes/pro/process";
import WorkstationSelect from "@/components/workstationSelect/simpletableSingle.vue";
import { log } from 'three';
export default { export default {
name: "Routeprocess", name: "Routeprocess",
dicts: ['mes_link_type','sys_yes_no'], dicts: ['mes_link_type','sys_yes_no'],
components: {WorkstationSelect},
data() { data() {
return { return {
// 遮罩层 // 遮罩层
...@@ -276,6 +292,9 @@ export default { ...@@ -276,6 +292,9 @@ export default {
], ],
isCheck: [ isCheck: [
{ required: true, message: "请指定当前工序是否需要质检确认", trigger: "blur" } { required: true, message: "请指定当前工序是否需要质检确认", trigger: "blur" }
],
workstationId: [
{ required: true, message: "请选择工作站", trigger: "blur" }
] ]
} }
}; };
...@@ -301,9 +320,22 @@ export default { ...@@ -301,9 +320,22 @@ export default {
//查询工序信息 //查询工序信息
getProcess(){ getProcess(){
listAllProcess().then( response =>{ listAllProcess().then( response =>{
console.log(response.data)
this.processOptions = response.data; this.processOptions = response.data;
console.log(this.processOptions.processId)
}); });
}, },
// 查询工作站信息
handleWorkstationSelect() {
this.$refs.WorkstationSelect.showFlag = true;
},
onWorkstationSelected(row) {
if (row != undefined && row != null) {
this.form.workstationId = row.workstationId;
this.form.workstationName = row.workstationName;
this.form.stdWorkingTime = row.stdWorkingTime;
}
},
// 取消按钮 // 取消按钮
cancel() { cancel() {
this.open = false; this.open = false;
...@@ -327,14 +359,13 @@ export default { ...@@ -327,14 +359,13 @@ export default {
defaultSufTime: 0, defaultSufTime: 0,
colorCode: '#00AEF3', colorCode: '#00AEF3',
remark: null, remark: null,
attr1: null,
attr2: null,
attr3: null,
attr4: null,
createBy: null, createBy: null,
createTime: null, createTime: null,
updateBy: null, updateBy: null,
updateTime: null updateTime: null,
workstationId: null,
workstationName: null,
stdWorkingTime: null
}; };
this.resetForm("form"); this.resetForm("form");
}, },
...@@ -389,6 +420,23 @@ export default { ...@@ -389,6 +420,23 @@ export default {
} }
} }
}); });
},
// 工序改变
changeProcessId(){
this.form.workstationId = ''
this.form.workstationName = ''
this.form.stdWorkingTime = ''
// watch:{
// processId(newValue){
// alert("工序发生改变,请重新选择工作站");
// this.form={
// workstationId : null,
// workstationName: null,
// stdWorkingTime: null
// }
// }
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment