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

master
A0010407 1 year ago
parent aa148fcafe
commit 703951a9c1

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

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

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

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

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

Loading…
Cancel
Save