Commit f08c5cef by lixiaomin

修改原料弹框

parent a12e2740
...@@ -33,9 +33,9 @@ ...@@ -33,9 +33,9 @@
</div> </div>
</el-dialog> </el-dialog>
<el-dialog title="添加原料" :visible.sync="materialDiaLog" width="600px" append-to-body> <el-dialog title="添加原料" :visible.sync="materialDiaLog" width="600px" append-to-body>
<el-radio-group v-model="materialId" class="radioClass"> <el-checkbox-group v-model="materialId" :max="1">
<el-radio v-for="item in materialList" :key="item.id" :label="item.id">{{item.name}}</el-radio> <el-checkbox v-for="(item,index) in materialList" :key="index" :label="item.id">{{item.name}}</el-checkbox>
</el-radio-group> </el-checkbox-group>
<div slot="footer" class="dialog-footer" > <div slot="footer" class="dialog-footer" >
<el-button type="primary" @click="submitMaterial" >确定</el-button> <el-button type="primary" @click="submitMaterial" >确定</el-button>
<el-button @click="cancelMaterial">取消</el-button> <el-button @click="cancelMaterial">取消</el-button>
...@@ -61,7 +61,7 @@ export default { ...@@ -61,7 +61,7 @@ export default {
materialList:[], materialList:[],
ros_code:"", ros_code:"",
component_name:"", component_name:"",
materialId:"", materialId:[],
machineState:null, machineState:null,
// 总条数 // 总条数
total: 0, total: 0,
...@@ -112,8 +112,10 @@ export default { ...@@ -112,8 +112,10 @@ export default {
if(!b){ if(!b){
this.$message.error('暂无添加原料操作的权限!'); this.$message.error('暂无添加原料操作的权限!');
return; return;
} }
this.materialId=row.material_id; if(row.material_id && row.material_id!=0){
this.materialId.push(row.material_id);
}
this.ros_code=row.ros_code; this.ros_code=row.ros_code;
this.component_name=row.component_name; this.component_name=row.component_name;
this.materialDiaLog=true; this.materialDiaLog=true;
...@@ -132,16 +134,18 @@ export default { ...@@ -132,16 +134,18 @@ export default {
return; return;
} }
let materialName=""; let materialName="";
let materId="";
for(let i=0;i<this.materialList.length;i++){ for(let i=0;i<this.materialList.length;i++){
if(this.materialId==this.materialList[i].id){ if(this.materialId==this.materialList[i].id){
materialName=this.materialList[i].name; materialName=this.materialList[i].name;
materId=this.materialId[0]
} }
} }
let obj={ let obj={
"machine_id":this.machineId , "machine_id":this.machineId ,
"ros_code": this.ros_code, "ros_code": this.ros_code,
"component_name": this.component_name, "component_name": this.component_name,
"material_id": this.materialId, "material_id": materId,
"material": materialName "material": materialName
} }
addMaterial(obj).then(response => { addMaterial(obj).then(response => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment