|
|
|
@ -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("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;
|
|
|
|
|
// },
|
|
|
|
|
handleSelectBom(){
|
|
|
|
|
this.$refs.itemSelectBom.showFlag = true;
|
|
|
|
|
},
|
|
|
|
|
/** 查询生产工序内容列表 */
|
|
|
|
|
getList() {
|
|
|
|
|
this.loading = true;
|
|
|
|
|