工艺管理-生产工序

yangwl
A0010407 1 year ago
parent 3c857c1889
commit f65af61a3e

@ -48,7 +48,7 @@
<el-table v-loading="loading" :data="processcontentList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="顺序编号" align="center" pnpmrop="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 label="辅助设备" align="center" prop="device" :show-overflow-tooltip="true"/>
<el-table-column label="BOM材料" align="center" prop="material" :show-overflow-tooltip="true"/>
@ -103,12 +103,15 @@
<el-input v-model="form.device" placeholder="请选择辅助设备" >
<el-button slot="append" @click="handleSelectEquipment" icon="el-icon-search"></el-button>
</el-input>
<ItemSelect ref="itemSelect" @onSelected="onItemSelected" > </ItemSelect>
<ItemSelect ref="itemSelect" @onSelected="onItemSelectedEquipment" > </ItemSelect>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="BOM材料" prop="material">
<el-input v-model="form.material" placeholder="请输入辅助材料" />
<el-input v-model="form.material" placeholder="请选择BOM材料" >
<el-button slot="append" @click="handleSelectBom" icon="el-icon-search"></el-button>
</el-input>
<ItemSelectBom ref="itemSelectBom" @onSelected="onItemSelectedBom" ></ItemSelectBom>
</el-form-item>
</el-col>
</el-row>
@ -138,9 +141,10 @@
<script>
import { listProcesscontent, getProcesscontent, delProcesscontent, addProcesscontent, updateProcesscontent } from "@/api/technology/processcontent";
import ItemSelect from "./single.vue";
import ItemSelectBom from "./singleBom.vue";
export default {
name: "Processcontent",
components: {ItemSelect},
components: {ItemSelect,ItemSelectBom},
data() {
return {
//
@ -191,7 +195,7 @@ export default {
},
methods: {
//
onItemSelected(obj){
onItemSelectedEquipment(obj){
if(obj != undefined && obj != null){
console.log('返回',obj);
if(this.form.device == null){
@ -206,10 +210,29 @@ export default {
}
}
},
onItemSelectedBom(obj){
if(obj != undefined && obj != null){
console.log('返回',obj);
if(this.form.material == null){
//obj = obj.slice(1);
console.log("if获取的",obj);
console.log("if获取的material",this.form.material);
this.form.material = obj;
}else{
console.log("else获取的",obj);
console.log("else获取的material",this.form.material);
this.form.material = this.form.material +","+obj;
}
}
},
//
handleSelectEquipment(){
this.$refs.itemSelect.showFlag = true;
},
//
handleSelectBom(){
this.$refs.itemSelectBom.showFlag = true;
},
/** 查询生产工序内容列表 */
getList() {
this.loading = true;

@ -94,7 +94,8 @@
<dict-tag :options="dict.type.split_merge" :value="scope.row.splitMerge"/>
</template>
</el-table-column>
<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="equipment" :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">
@ -213,7 +214,16 @@
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="线体设备" prop="equipment">
<el-input v-model="form.equipment" placeholder="请选择线体设备" >
<el-button slot="append" @click="handleSelectEquipment" icon="el-icon-search"></el-button>
</el-input>
<ItemSelect ref="itemSelect" @onSelected="onItemSelectedEquipment" > </ItemSelect>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="工序SOP" prop="fileList">
@ -327,11 +337,12 @@
import { listProcess, getProcess, delProcess, addProcess, updateProcess } from "@/api/technology/process";
import { listEquipment, getEquipment, delEquipment, addEquipment, updateEquipment } from "@/api/wms/equipment";
import Processcontent from "./content.vue";
import ItemSelect from "./single.vue";
export default {
name: "Process",
dicts: ['sys_yes_no','split_merge'],
components: {Processcontent},
components: {Processcontent,ItemSelect},
data() {
return {
treeData: [{
@ -527,7 +538,8 @@ export default {
equipmentTypeName :null,
equipmentTypeCode:null,
equipmentName :null,
equipmentCode:null
equipmentCode:null,
equipment:null,
};
this.autoGenFlag = false;
this.resetForm("form");
@ -661,7 +673,30 @@ export default {
strs += list[i].url + separator;
}
return strs != '' ? strs.substr(0, strs.length - 1) : '';
}
},
//
onItemSelectedEquipment(obj){
if(obj != undefined && obj != null){
console.log('返回',obj);
if(this.form.equipment == null){
//obj = obj.slice(1);
console.log("if获取的",obj);
console.log("if获取的equipment",this.form.equipment);
this.form.equipment = obj;
console.log("赋值以后的equipment",this.form.equipment);
}else{
console.log("else获取的",obj);
console.log("else获取的equipment",this.form.equipment);
this.form.equipment = this.form.equipment +","+obj;
}
}
},
//
handleSelectEquipment(){
this.$refs.itemSelect.showFlag = true;
},
}
};
</script>

@ -0,0 +1,286 @@
<template>
<el-dialog title="BOM物料选择"
v-if="showFlag"
:visible.sync="showFlag"
:modal= false
width="1100px"
center
>
<el-row :gutter="20">
<!--分类数据-->
<el-col :span="4" :xs="24">
<div class="head-container">
<el-tree
:data="treeData"
node-key="id"
:expand-on-click-node="false"
:filter-node-method="filterNode"
ref="tree"
default-expand-all
@node-click="handleNodeClick"
/>
</div>
</el-col>
<!--BOM数据-->
<el-col :span="20" :xs="24">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="BOM物料编码" prop="itemCode">
<el-input
v-model="queryParams.itemCode"
placeholder="请输入BOM物料编码"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="BOM物料名称" prop="itemName">
<el-input
v-model="queryParams.itemName"
placeholder="请输入BOM物料名称"
clearable
style="width: 240px"
@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="itemList" @selection-change="handleBomSelectionChange" ref="myTable">
<el-table-column width="50" align="center" type="selection">
<!-- <template v-slot="scope">
<el-radio v-model="selectedItemId" :label="scope.row.itemId" @change="handleRowChange(scope.row)">{{""}}</el-radio>
</template> -->
</el-table-column>
<!-- 序号 -->
<el-table-column type="index" width="90" align="center" :index="indexMethod" label="序号"></el-table-column>
<el-table-column label="BOM物料编码" align="center" key="itemCode" prop="materialCode" v-if="columns[0].visible" >
</el-table-column>
<el-table-column label="BOM物料名称" align="left" key="itemName" prop="materialDesc" v-if="columns[1].visible" :show-overflow-tooltip="true" />
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-col>
</el-row>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitBomForm"> </el-button>
<el-button @click="showFlag=false"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { listBom, getBom, delBom, addBom, updateBom } from "@/api/wms/bom";
// import Treeselect from "@riophae/vue-treeselect";
// import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
name: "ItemSingleBom",
// components: { Treeselect },
data() {
return {
treeData: [{
id: '1',
label: 'BOM物料类别',
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: '包装线'
}
]
}],
showFlag:false,
//
selectedItemId: undefined,
selectedRows: undefined,
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
itemList: null,
//
itemTypeOptions: undefined,
//
materialCode: undefined,
defaultProps: {
id: "id",
label: "label"
},
//
queryParams: {
pageNum: 1,
pageSize: 10,
itemName: undefined,
materialCode: undefined,
itemTypeId: 0,
itemCodeGet: '',
},
//
columns: [
{ key: 0, label: `BOM物料编码`, visible: true },
{ key: 1, label: `BOM物料名称`, visible: true }
]
};
},
created() {
this.getList();
// this.getTreeselect();
},
methods: {
handleEquipmentSelectionChange (val) {
this.itemList = val
},
//
indexMethod(index){
return index+1 ;
},
//
/** 查询设备编码列表*/
getList() {
this.loading = true;
listBom(this.queryParams).then(response => {
this.itemList = response.rows;
this.total = response.total;
this.loading = false;
}
);
},
/** 查询分类下拉树结构 */
// getTreeselect() {
// treeselect().then(response => {
// this.itemTypeOptions = response.rows;
// console.log(response.rows);
// num = response.total;
// for (let id of response.rows) {
// if(id == 'equ_type_lg'){
// lable = '';
// }else if(id == 'equ_type_hf'){
// lable = '';
// }else if(id == 'equ_type_cpj'){
// lable = '';
// }else if(id == 'equ_type_bzx'){
// lable = '线';
// }else if(id == 'equ_type_cxj'){
// lable = '';
// }
// }
// });
// },
//
filterNode(value, data) {
console.log(value, data);
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
//
handleNodeClick(data) {
this.queryParams.materialCode = data.id;
console.log(this.materialCode);
this.handleQuery();
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// handleCurrent(row){
// if(row){
// this.selectedRows = row;
// }
// },
// handleRowDbClick(row){
// if(row){
// this.selectedRows = row;
// this.$emit('onSelected',this.selectedRows);
// this.showFlag = false;
// }
// },
//
handleBomSelectionChange(selection) {
this.ids = selection.map(item => item.materialCode);
this.single = selection.length!==1;
this.multiple = !selection.length;
console.log("多选框",this.ids);
},
//
// handleRowChange(row) {
// debugger;
// if(row){
// this.selectedRows = row;
// }
// },
//
// confirmSelect(){
// if(this.selectedItemId ==null || this.selectedItemId==0){
// this.$notify({
// title:'',
// type:'warning',
// message: '!'
// });
// return;
// }
// this.$emit('onSelected',this.selectedRows);
// this.showFlag = false;
// }
//
submitBomForm() {
const data = this.ids;
console.log("数据",data);
const equipmentCode = data.toString();
console.log("拆分数据",materialCode);
console.log("原来的数据",this.queryParams.itemCodeGet);
if(this.queryParams.itemCodeGet == ""){
this.queryParams.itemCodeGet = materialCode;
}else{
this.queryParams.itemCodeGet = this.queryParams.itemCodeGet + ','+ materialCode;
}
this.selectedRows = this.queryParams.itemCodeGet;
this.$emit('onSelected', this.selectedRows);
this.showFlag = false;
this.queryParams.itemCodeGet = "";
},
}
};
</script>
Loading…
Cancel
Save