| | |
| | | <!-- 物料清单 --> |
| | | <div v-if="typeselect == 2"> |
| | | <el-form :model="materialForm" label-position="right" |
| | | :rules="materialRules" ref="materialForm" label-width="80px"> |
| | | <el-row> |
| | | :rules="materialRules" ref="materialForm" label-width="90px"> |
| | | <el-row :gutter="100"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="规格型号:" width="250"> |
| | | <el-input style="width:200px;" v-model="materialForm.pname" placeholder="请输入单位"/> |
| | | </el-form-item> |
| | | <el-form-item label="工序:" prop="mfather"> |
| | | <el-select placeholder="请选择工序" @change="changeMName" |
| | | style="width:100%;" v-model="materialForm.mfather"> |
| | | <el-option v-for="(item,index) in materialFormList" :key="index" |
| | | :label="item.name" :value="item.name" ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12" style="text-align: right;"> |
| | | <el-form-item label="产品大类:" width="250"> |
| | | <el-select placeholder="请选择产品大类" |
| | | style="width:240px;" v-model="materialForm.dg"> |
| | | <el-option value="1">1</el-option> |
| | | <el-option value="2">2</el-option> |
| | | <el-option value="3">3</el-option> |
| | | <el-option value="4">4</el-option> |
| | | <el-col :span="12"> |
| | | <el-form-item label="工艺名称:" prop="mtechnologyId"> |
| | | <el-select placeholder="请选择工艺名称" style="width:100%;" |
| | | v-model="materialForm.mtechnologyId"> |
| | | <el-option v-for="(item,index) in mIdList" :key="index" |
| | | :value="item.id" :label="item.name"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="材料信息"></el-form-item> |
| | | <el-form-item label="材料信息" style="font-weight: bold;"></el-form-item> |
| | | </el-col> |
| | | <el-col :span="12" style="text-align: right;"> |
| | | <el-button size="mini" style="text-align: right;">添加行</el-button> |
| | | <el-button size="mini" @click="addRowByMaterial">添加行</el-button> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-table > |
| | | <el-table-column label="材料名称"></el-table-column> |
| | | <el-table-column label="规格型号"></el-table-column> |
| | | <el-table-column label="单位"></el-table-column> |
| | | <el-table-column label="数量"></el-table-column> |
| | | <el-table :data="materialForm.tableList" border max-height="470" |
| | | style="width:100%;text-align: left;margin: 0;padding: 0;" |
| | | :cell-style="{height:'20px',textAlign:'left'}" |
| | | :header-cell-style="{height:'20px'}"> |
| | | <el-table-column label="供应商名称"> |
| | | <template slot-scope="scope"> |
| | | <el-input size="mini" v-model="scope.row.supplier" |
| | | placeholder="请输入"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="质量追溯号"> |
| | | <template slot-scope="scope"> |
| | | <el-input size="mini" v-model="scope.row.qualityTraceability" |
| | | placeholder="请输入"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="原材料名称"> |
| | | <template slot-scope="scope"> |
| | | <el-input size="mini" v-model="scope.row.name" |
| | | placeholder="请输入"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="规格型号"> |
| | | <template slot-scope="scope"> |
| | | <el-input size="mini" v-model="scope.row.specifications" |
| | | placeholder="请输入"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="单位"> |
| | | <template slot-scope="scope"> |
| | | <el-input size="mini" v-model="scope.row.unit" |
| | | placeholder="请输入"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="数量"> |
| | | <template slot-scope="scope"> |
| | | <el-input size="mini" v-model="scope.row.num" |
| | | placeholder="请输入"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <div style="width:100%;text-align: right;"> |
| | | <div style="width:100%;margin-top: 20px;margin-left:75%"> |
| | | <span slot="footer" class="dialog-footer" > |
| | | <el-button type="primary" @click="confirmAdd('materialForm')">确 定</el-button> |
| | | <el-button @click="bomAddModelVisible = false">取 消</el-button> |
| | |
| | | <!-- 生产工艺 --> |
| | | <div v-if="typeselect == 3"> |
| | | <el-form :model="productForm" :inline="true" label-position="right" |
| | | label-width="80px"> |
| | | <el-form-item label="工序:" width="250"> |
| | | <el-select v-model="productForm.father" |
| | | style="width:200px;" |
| | | placeholder="请输入或选择生产定额"> |
| | | <el-option value="1">1</el-option> |
| | | <el-option value="2">2</el-option> |
| | | <el-option value="3">3</el-option> |
| | | <el-option value="4">4</el-option> |
| | | :rules="productRules" ref="productForm" label-width="90px"> |
| | | <el-form-item label="工序:" prop="profather"> |
| | | <el-select v-model="productForm.profather" |
| | | style="width:200px;" @change="changeProduct" |
| | | placeholder="请选择工序"> |
| | | <el-option v-for="(item,index) in productFormList" :key="index" |
| | | :value="item.name" :label="item.name"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="工艺名称:" width="250"> |
| | | <el-select placeholder="请输入或选择工艺名称" |
| | | style="width:200px;" |
| | | v-model="productForm.name"> |
| | | <el-option value="1">1</el-option> |
| | | <el-option value="2">2</el-option> |
| | | <el-option value="3">3</el-option> |
| | | <el-option value="4">4</el-option> |
| | | <el-form-item label="工艺名称:" prop="protechnologyId"> |
| | | <el-select placeholder="请选择工艺名称" |
| | | style="width:200px;" @change="getProductDeviceList" |
| | | v-model="productForm.protechnologyId"> |
| | | <el-option v-for="(item,index) in proIdList" :key="index" |
| | | :value="item.id" :label="item.name"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="设备:" width="250"> |
| | | <el-form-item label="设备:" prop="device"> |
| | | <el-select placeholder="请选择设备" |
| | | style="width:200px;" |
| | | v-model="productForm.dg"> |
| | | <el-option value="1">1</el-option> |
| | | <el-option value="2">2</el-option> |
| | | <el-option value="3">3</el-option> |
| | | <el-option value="4">4</el-option> |
| | | v-model="productForm.device"> |
| | | <el-option v-for="(item,index) in productDeviceList" :key="index" |
| | | :value="item.device" :label="item.device"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="项目:" width="250"> |
| | | <el-form-item label="项目:" prop="productFather"> |
| | | <el-select placeholder="请选择项目" |
| | | style="width:200px;" |
| | | v-model="productForm.dg"> |
| | | <el-option value="1">1</el-option> |
| | | <el-option value="2">2</el-option> |
| | | <el-option value="3">3</el-option> |
| | | <el-option value="4">4</el-option> |
| | | style="width:200px;" @change="changeProductFather" |
| | | v-model="productForm.productFather"> |
| | | <el-option v-for="(item,index) in productProjectList" :key="index" |
| | | :value="item.name" :label="item.name"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="单位:" width="250"> |
| | | <el-input style="width:200px;" v-model="productForm.unit" placeholder="请输入单位"/> |
| | | <el-form-item label="指标:" prop="product"> |
| | | <el-select placeholder="请选择指标" |
| | | style="width:200px;" @change="changeProProduct" |
| | | v-model="productForm.product"> |
| | | <el-option v-for="(item,index) in proProductList" :key="index" |
| | | :value="item.name" :label="item.name"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="指标:" width="250"> |
| | | <el-input style="width:200px;" v-model="productForm.pq" placeholder="请输入指标" /> |
| | | <el-form-item label="单位:" prop="unit"> |
| | | <el-input style="width:200px;" disabled v-model="productForm.unit"/> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div style="width:100%;text-align: right;"> |
| | |
| | | callback(); |
| | | }; |
| | | return { |
| | | //技术指标-新增-工序,工艺下拉框数据 |
| | | targetFormList:[], |
| | | technologyIdList:[], |
| | | //技术指标-新增-项目下拉框数据 |
| | | projectList:[], |
| | | //工序列表 |
| | | technologyIdList:[], |
| | | fatherList:[], |
| | | //设备组列表 |
| | | deviceList:[], |
| | | technologyForm:{ |
| | | tefather:'', |
| | |
| | | deviceGroup:'', |
| | | productionQuota:'' |
| | | }, |
| | | technologyRules:{ |
| | | tefather:{required:true,message:'工序不能为空',trigger:'change'}, |
| | | tename:{required:true,message:'工艺名称不能为空',trigger:'blur'}, |
| | | deviceGroup:{required:true,message:'设备组不能为空',trigger:'change'}, |
| | | productionQuota:{validator:checkPq,trigger:'change'} |
| | | }, |
| | | //技术指标 |
| | | targetFormList:[], |
| | | projectList:[], |
| | | targetForm:{ |
| | | pfather:'', |
| | | father: '', |
| | |
| | | unit:'', |
| | | internal:'', |
| | | required: '' |
| | | }, |
| | | materialForm:{}, |
| | | productForm:{}, |
| | | technologyRules:{ |
| | | tefather:{required:true,message:'工序不能为空',trigger:'change'}, |
| | | tename:{required:true,message:'工艺名称不能为空',trigger:'blur'}, |
| | | deviceGroup:{required:true,message:'设备组不能为空',trigger:'change'}, |
| | | productionQuota:{validator:checkPq,trigger:'change'} |
| | | }, |
| | | targetRules:{ |
| | | pfather:{required:true,message:'工序不能为空',trigger:'change'}, |
| | |
| | | internal:{validator:checkVal,trigger:'change'}, |
| | | required:{validator:checkVal,trigger:'change'} |
| | | }, |
| | | //物料清单 |
| | | materialForm:{ |
| | | mfather: '', |
| | | mtechnologyId:'', |
| | | tableList:[] |
| | | }, |
| | | materialFormList:[], |
| | | mIdList:[], |
| | | materialRules:{ |
| | | |
| | | mfather:{required:true,message:'工序不能为空',trigger:'change'}, |
| | | mtechnologyId:{required:true,message:'工艺名称不能为空',trigger:'change'}, |
| | | }, |
| | | //生产工艺 |
| | | productForm:{ |
| | | profather:'', |
| | | protechnologyId:'', |
| | | productFather:'', |
| | | product:'', |
| | | unit:'', |
| | | device:'' |
| | | }, |
| | | //设备列表 |
| | | productDeviceList:[], |
| | | //工艺名称列表 |
| | | proIdList:[], |
| | | //项目列表 |
| | | productProjectList:[], |
| | | //指标列表 |
| | | proProductList:[], |
| | | productRules:{ |
| | | |
| | | profather:{required:true,message:'工序不能为空',trigger:'change'}, |
| | | protechnologyId:{required:true,message:'工艺名称不能为空',trigger:'change'}, |
| | | productFather:{required:true,message:'项目不能为空',trigger:'change'}, |
| | | product:{required:true,message:'指标不能为空',trigger:'change'}, |
| | | device:{required:true,message:'设备不能为空',trigger:'change'} |
| | | }, |
| | | productFormList:[], |
| | | // BOM树数据结构 |
| | | list: [], |
| | | search: null, |
| | |
| | | leftAddBom(){ |
| | | |
| | | }, |
| | | //右侧bom,确认新增 |
| | | confirmAdd(formName){ |
| | | this.$refs[formName].validate(valid=>{ |
| | | if(valid){ |
| | |
| | | this.submitBomAdd(this.$api.url.addTechnology,obj); |
| | | }else if(type == 1){ |
| | | this.submitBomAdd(this.$api.url.addProductByStandard,this.targetForm); |
| | | }else if(type == 2){ |
| | | obj = { |
| | | mbomDto2List:this.materialForm.tableList, |
| | | technologyId:this.materialForm.mtechnologyId |
| | | } |
| | | this.submitBomAdd(this.$api.url.addMBomByStandard,obj); |
| | | }else if(type == 3){ |
| | | let form = this.productForm; |
| | | obj = { |
| | | device: form.device, |
| | | product: form.product, |
| | | productFather: form.productFather, |
| | | technologyId: form.protechnologyId, |
| | | unit: form.unit |
| | | } |
| | | this.submitBomAdd(this.$api.url.addTechniqueByStandard,obj); |
| | | }else{ |
| | | return |
| | | } |
| | | |
| | | } |
| | | }) |
| | | }, |
| | |
| | | this.technologyIdList = arr[0].children; |
| | | } |
| | | }, |
| | | //获取工序,工艺列表 |
| | | //物料清单--添加行 |
| | | addRowByMaterial(){ |
| | | let obj = { |
| | | "name": "", |
| | | "num": null, |
| | | "qualityTraceability": "", |
| | | "specifications": "", |
| | | "supplier": "", |
| | | "unit": "" |
| | | } |
| | | this.materialForm.tableList.push(obj); |
| | | }, |
| | | //物料清单--获取工序,工艺列表 |
| | | getMaterialFormList(){ |
| | | this.$axios.get(this.$api.url.chooseTechByMBom,{ |
| | | params:{specificationsId : this.returntree.id} |
| | | }).then(res=>{ |
| | | this.materialFormList = res.data; |
| | | }).catch(error=>{ |
| | | this.$message.error(error.message); |
| | | }) |
| | | }, |
| | | changeMName(val){ |
| | | let arr = this.materialFormList.filter(item=>{ |
| | | return item.name == val; |
| | | }) |
| | | this.mIdList = arr[0].children; |
| | | }, |
| | | //技术指标--获取工序,工艺列表 |
| | | getTargetFormList(){ |
| | | this.$axios.get(this.$api.url.chooseTechByStandard,{ |
| | | params:{specificationsId : this.returntree.id} |
| | |
| | | this.$message.error(error.message); |
| | | }) |
| | | }, |
| | | //获取项目列表 |
| | | getProjectFormList(){ |
| | | |
| | | //1.生产工艺-->选择工序,工艺 |
| | | getProductFormList(){ |
| | | this.$axios.get(this.$api.url.chooseTechByProduct,{ |
| | | params:{specificationsId : this.returntree.id} |
| | | }).then(res=>{ |
| | | this.productFormList = res.data; |
| | | }).catch(error=>{ |
| | | this.$message.error(error.message); |
| | | }) |
| | | }, |
| | | //获取工序列表 |
| | | //2.选择工序,获取工艺名称 |
| | | changeProduct(val){ |
| | | let arr = this.productFormList.filter(item=>{ |
| | | return item.name == val |
| | | }); |
| | | this.proIdList = arr[0].children; |
| | | }, |
| | | //3.生产工艺-->选择设备 |
| | | getProductDeviceList(val){ |
| | | this.$axios.get(this.$api.url.chooseDevByProduct,{ |
| | | params:{technologyId : val} |
| | | }).then(res=>{ |
| | | this.productDeviceList = res.data; |
| | | this.getProjectFormList(val); |
| | | }).catch(error=>{ |
| | | this.$message.error(error.message); |
| | | }) |
| | | }, |
| | | //4.生产工艺--获取项目列表 |
| | | getProjectFormList(val){ |
| | | this.$axios.get(this.$api.url.chooseProByProduct,{ |
| | | params:{technologyId : val} |
| | | }).then(res=>{ |
| | | this.productProjectList = res.data; |
| | | }).catch(error=>{ |
| | | this.$message.error(error.message); |
| | | }) |
| | | }, |
| | | //5.选择项目列表,获取指标 |
| | | changeProductFather(val){ |
| | | let arr = this.productProjectList.filter(item=>{ |
| | | return item.name == val; |
| | | }) |
| | | this.proProductList = arr[0].children; |
| | | }, |
| | | //选择指标列表 |
| | | changeProProduct(val){ |
| | | let arr = this.proProductList.filter(item=>{ |
| | | return item.name == val; |
| | | }) |
| | | this.productForm.unit = arr[0].unit; |
| | | }, |
| | | //工艺路线--获取工序列表 |
| | | getFatherList(){ |
| | | this.$axios.get(this.$api.url.chooseFather,{ |
| | | params:{specificationsId : this.returntree.id} |
| | |
| | | this.$message.error(error.message); |
| | | }) |
| | | }, |
| | | //获取设备组列表 |
| | | //工艺路线--获取设备组列表 |
| | | getDeviceList(){ |
| | | this.$axios.get(this.$api.url.chooseDevice).then(res=>{ |
| | | this.deviceList = res.data; |
| | |
| | | this.getFatherList(); |
| | | this.getDeviceList(); |
| | | this.getTargetFormList(); |
| | | this.getMaterialFormList(); |
| | | this.getProductFormList(); |
| | | this.bomAddModelVisible = true |
| | | }, |
| | | startLeftAdd(){ |