|
|
|
@ -110,18 +110,13 @@
|
|
|
|
|
<ItemSelect ref="itemSelect" @onSelected="onItemSelectedEquipment" > </ItemSelect>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<!-- <el-col :span="12">
|
|
|
|
|
<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>
|
|
|
|
@ -174,12 +169,16 @@
|
|
|
|
|
<script>
|
|
|
|
|
import { listProcesscontent, getProcesscontent, delProcesscontent, addProcesscontent, updateProcesscontent } from "@/api/technology/recipecontent";
|
|
|
|
|
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 {
|
|
|
|
|
checkMaterial :null,
|
|
|
|
|
checkDevice :null,
|
|
|
|
|
// 遮罩层
|
|
|
|
|
loading: true,
|
|
|
|
|
// 选中数组
|
|
|
|
@ -312,44 +311,63 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
//新增 设备选择弹出框
|
|
|
|
|
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;
|
|
|
|
|
},
|
|
|
|
|
/** 删除按钮操作 */
|
|
|
|
|
handleDelete(row) {
|
|
|
|
|
const contentIds = row.contentId || this.ids;
|
|
|
|
|