Commit f08c5cef by lixiaomin

修改原料弹框

parent a12e2740
......@@ -33,9 +33,9 @@
</div>
</el-dialog>
<el-dialog title="添加原料" :visible.sync="materialDiaLog" width="600px" append-to-body>
<el-radio-group v-model="materialId" class="radioClass">
<el-radio v-for="item in materialList" :key="item.id" :label="item.id">{{item.name}}</el-radio>
</el-radio-group>
<el-checkbox-group v-model="materialId" :max="1">
<el-checkbox v-for="(item,index) in materialList" :key="index" :label="item.id">{{item.name}}</el-checkbox>
</el-checkbox-group>
<div slot="footer" class="dialog-footer" >
<el-button type="primary" @click="submitMaterial" >确定</el-button>
<el-button @click="cancelMaterial">取消</el-button>
......@@ -61,7 +61,7 @@ export default {
materialList:[],
ros_code:"",
component_name:"",
materialId:"",
materialId:[],
machineState:null,
// 总条数
total: 0,
......@@ -112,8 +112,10 @@ export default {
if(!b){
this.$message.error('暂无添加原料操作的权限!');
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.component_name=row.component_name;
this.materialDiaLog=true;
......@@ -132,16 +134,18 @@ export default {
return;
}
let materialName="";
let materId="";
for(let i=0;i<this.materialList.length;i++){
if(this.materialId==this.materialList[i].id){
materialName=this.materialList[i].name;
materId=this.materialId[0]
}
}
let obj={
"machine_id":this.machineId ,
"ros_code": this.ros_code,
"component_name": this.component_name,
"material_id": this.materialId,
"material_id": materId,
"material": materialName
}
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