工艺管理-生产工序-设备判断物料判断

master
A0010407 1 year ago
parent aa148fcafe
commit 703951a9c1

@ -72,7 +72,7 @@ export function getEquipment(equipmentId) {
// 查询BOM物料管理列表
export function listBom(query) {
return request({
url: '/technology/pro/process/bomList',
url: '/technology/pro/process/bomComponentList',
method: 'get',
params: query
});

@ -98,7 +98,7 @@
</el-col>-->
</el-row>
<el-row>
<el-col :span="12">
<el-col :span="24">
<el-form-item label="辅助设备" prop="device">
<el-input v-model="form.device" placeholder="请选择辅助设备" >
<el-button slot="append" @click="handleSelectEquipment" icon="el-icon-search"></el-button>
@ -106,19 +106,16 @@
<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="请选择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-col :span="12">
<el-form-item label="BOM材料" prop="material">
<el-input v-model="form.material" placeholder="请BOM材料" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="BOM材料" prop="material">
<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>
<el-row>
<el-col :span="24">
@ -146,10 +143,12 @@
<script>
import { listProcesscontent, getProcesscontent, delProcesscontent, addProcesscontent, updateProcesscontent } from "@/api/technology/processcontent";
import ItemSelect from "./single.vue";
// import ItemSelectBom from "./singleBom.vue";
import ItemSelectBom from "./singleBom.vue";
import { Message } from 'element-ui'
export default {
name: "Processcontent",
components: {ItemSelect},
components: {ItemSelect,ItemSelectBom},
data() {
return {
//
@ -171,6 +170,8 @@ export default {
//
open: false,
//
checkMaterial :null,
checkDevice :null,
queryParams: {
pageNum: 1,
pageSize: 10,
@ -201,43 +202,61 @@ export default {
methods: {
//
onItemSelectedEquipment(obj){
if(obj != undefined && obj != null){
console.log('返回',obj);
if(this.form.device == null){
//obj = obj.slice(1);
console.log("if获取的",obj);
console.log("if获取的device",this.form.device);
console.log("device是空if获取的obj",obj);
console.log("device是空if获取的device",this.form.device);
this.form.device = obj;
}else{
console.log("else获取的",obj);
console.log("else获取的device",this.form.device);
this.form.device = this.form.device +","+obj;
if(obj != undefined && obj != null){
const a = obj.split(',');
const len = obj.split(',').length;
console.log('切割的数组',obj.split(','));
a.forEach(item => {
this.checkDevice = this.form.device.search(item) != -1;
console.log("check的值",this.checkDevice);
if(this.checkDevice == true){
console.log("重复添加",true);
Message.warning('您已经添加过该设备,请勿重复添加!!!');
}else if(this.checkDevice == false){
this.form.device = this.form.device +","+item;
}
})
}
}
},
//
onItemSelectedBom(obj){
if(this.form.material == null){
console.log("material是空if获取的obj",obj);
console.log("material是空if获取的material",this.form.material);
this.form.material = obj;
}else{
if(obj != undefined && obj != null){
const a = obj.split(',');
const len = obj.split(',').length;
console.log('切割的数组',obj.split(','));
a.forEach(item => {
this.checkMaterial = this.form.material.search(item) != -1;
console.log("check的值",this.check);
if(this.checkMaterial == true){
console.log("重复添加",true);
Message.warning('您已经添加过该物料Bom,请勿重复添加!!!');
}else if(this.checkMaterial == false){
this.form.material = this.form.material +","+item;
}
})
}
}
}
},
// 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("ifmaterial",this.form.material);
// this.form.material = obj;
// }else{
// console.log("else",obj);
// console.log("elsematerial",this.form.material);
// this.form.material = this.form.material +","+obj;
// }
// }
// },
//
handleSelectEquipment(){
this.$refs.itemSelect.showFlag = true;
},
// //
// handleSelectBom(){
// this.$refs.itemSelectBom.showFlag = true;
// },
handleSelectBom(){
this.$refs.itemSelectBom.showFlag = true;
},
/** 查询生产工序内容列表 */
getList() {
this.loading = true;

@ -269,82 +269,6 @@
<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>
@ -352,6 +276,7 @@
import { listProcess, getProcess, delProcess, addProcess, updateProcess ,listEquipment,getEquipment} from "@/api/technology/process";
import Processcontent from "./content.vue";
import ItemSelect from "./single.vue";
import { Message } from 'element-ui'
export default {
name: "Process",
@ -359,27 +284,7 @@ export default {
components: {Processcontent,ItemSelect},
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: '包装线'
}
]
}],
checkEquipment:null,
//
autoGenFlag:false,
optType: undefined,
@ -689,30 +594,30 @@ export default {
return strs != '' ? strs.substr(0, strs.length - 1) : '';
},
//
onItemSelectedEquipment(obj){
if(obj != undefined && obj != null){
console.log('返回',obj);
console.log(this.form.equipment);
if(this.form.equipment == null){
console.log("else获取的",obj);
console.log("else获取的equipment",this.form.equipment);
this.form.equipment = obj;
console.log("赋值以后的equipment",this.form.equipment);
}else{
if(this.form.equipment.length > 0){
console.log("if获取的",obj);
console.log("if获取的equipment",this.form.equipment);
this.form.equipment = this.form.equipment +","+obj;
}else{
console.log("else获取的",obj);
console.log("else获取的equipment",this.form.equipment);
this.form.equipment = obj;
console.log("赋值以后的equipment",this.form.equipment);
//
onItemSelectedEquipment(obj){
if(this.form.equipment == null){
console.log("equipment是空if获取的obj",obj);
console.log("device是空if获取的equipment",this.form.equipment);
this.form.equipment = obj;
}else{
if(obj != undefined && obj != null){
const a = obj.split(',');
const len = obj.split(',').length;
console.log('切割的数组',obj.split(','));
a.forEach(item => {
this.checkEquipment = this.form.equipment.search(item) != -1;
console.log("check的值",this.checkEquipment);
if(this.checkEquipment == true){
console.log("重复添加",true);
Message.warning('您已经添加过该设备,请勿重复添加!!!');
}else if(this.checkEquipment == false){
this.form.equipment = this.form.equipment +","+item;
}
}
}
},
})
}
}
},
//
handleSelectEquipment(){

@ -84,6 +84,7 @@ import { listProcess, getProcess, delProcess, addProcess, updateProcess ,listEqu
import { treeselect } from "@/api/wms/equipment";
// import Treeselect from "@riophae/vue-treeselect";
// import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import { Message } from 'element-ui'
export default {
name: "MdItemSingle",
@ -108,6 +109,9 @@ export default {
}, {
id: 'equ_type_bzx',
label: '包装线'
},{
id: 'equ_type_dsj',
label: '吊筛机'
}
]
}],

@ -3,8 +3,7 @@
v-if="showFlag"
:visible.sync="showFlag"
:modal= false
width="1100px"
center
width="1000px"
>
<el-row :gutter="20">
<!--分类数据-->
@ -23,8 +22,8 @@
</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-col :span="24" :xs="24">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="105px" align="center">
<el-form-item label="BOM物料编码" prop="itemCode">
<el-input
v-model="queryParams.itemCode"
@ -48,7 +47,7 @@
<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 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>
@ -56,9 +55,9 @@
</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 label="BOM物料编码" align="center" key="itemCode" prop="bomCode" 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-column label="BOM物料名称" align="left" key="itemName" prop="bomName" v-if="columns[1].visible" :show-overflow-tooltip="true" />
</el-table>
<pagination
@ -71,9 +70,9 @@
</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-button type="primary" @click="submitBomForm"> </el-button>
<el-button @click="showFlag=false"> </el-button>
</div>
</el-dialog>
</template>
@ -122,7 +121,7 @@ export default {
//
itemTypeOptions: undefined,
//
materialCode: undefined,
bomCode: undefined,
defaultProps: {
id: "id",
label: "label"
@ -132,7 +131,7 @@ export default {
pageNum: 1,
pageSize: 10,
itemName: undefined,
materialCode: undefined,
bomCode: undefined,
itemTypeId: 0,
itemCodeGet: '',
},
@ -201,8 +200,8 @@ export default {
//
handleNodeClick(data) {
this.queryParams.materialCode = data.id;
console.log(this.materialCode);
this.queryParams.bomCode = data.id;
console.log(this.bomCode);
this.handleQuery();
},
@ -234,7 +233,7 @@ export default {
//
handleBomSelectionChange(selection) {
this.ids = selection.map(item => item.materialCode);
this.ids = selection.map(item => item.bomCode);
this.single = selection.length!==1;
this.multiple = !selection.length;
console.log("多选框",this.ids);
@ -265,13 +264,13 @@ export default {
submitBomForm() {
const data = this.ids;
console.log("数据",data);
const equipmentCode = data.toString();
console.log("拆分数据",materialCode);
const bomCode = data.toString();
console.log("拆分数据",bomCode);
console.log("原来的数据",this.queryParams.itemCodeGet);
if(this.queryParams.itemCodeGet == ""){
this.queryParams.itemCodeGet = materialCode;
this.queryParams.itemCodeGet = bomCode;
}else{
this.queryParams.itemCodeGet = this.queryParams.itemCodeGet + ','+ materialCode;
this.queryParams.itemCodeGet = this.queryParams.itemCodeGet + ','+ bomCode;
}
this.selectedRows = this.queryParams.itemCodeGet;
this.$emit('onSelected', this.selectedRows);

Loading…
Cancel
Save