Commit 0f505479 by lixiaomin

退款金额显示、机型列表组件添加

parent e210b5cc
......@@ -333,15 +333,35 @@ export default {
return list;
},
handleSelectionChange(selectList){
let sum=null;
let amount=[];
this.ids=[];
if(selectList.length>0){
for(let i=0;i<selectList.length;i++){
sum+=selectList[i].realAmount;
amount.push(selectList[i].realAmount);
this.ids.push(selectList[i].id);
}
}
let sum=this.add(amount);
this.refundForm.refundAmount=sum;
},
add(arr){
let fieldArr=[]
for(var i=0;i<arr.length;i++){
var m, field
try{
field=arr[i].toString().split(".")[1].length
}catch(e){
field=0
}
fieldArr.push(field)
}
m=Math.pow(10,Math.max(...fieldArr))
let add=0;
arr.forEach(function(item) {
add=add+item*m
});
let sum=Math.round(add)/m
return sum;
}
}
};
......
......@@ -99,7 +99,7 @@ service.interceptors.response.use(res => {
type: 'error'
})
return Promise.reject(new Error(msg))
} else if (code !== 200) {
} else if (code !== 200 && code !=21001) {
Notification.error({
title: msg
})
......
......@@ -282,8 +282,10 @@ export default {
if(response.code==0){
this.$modal.msgSuccess("添加组件成功!");
this.getModelComponentList();
}else if(response.code==21001){
this.$message.error('该机型已有机器绑定,请重新填写!');
}
});
})
},
//获取组件属性列表
getComponentPropertyList(model_id,ros_code){
......
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