allMoreSelectInput.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. export default {
  2. data() {
  3. return {
  4. isActive: false,
  5. isFocus: false,
  6. isActiveOne: false,
  7. isFocusOne: false,
  8. };
  9. },
  10. methods: {
  11. // 计算重量
  12. countWeight(){
  13. let ratio = this.customData.ratio;
  14. let smallCount = this.customData.smallCount;
  15. let bigCount = this.customData.bigCount;
  16. let weight = this.customData.weight;
  17. this.customData.realityWeight = (smallCount * weight / ratio + bigCount * weight).toFixed(2)
  18. },
  19. // 离开全选input
  20. moveAllInput(e){
  21. this.isActive=false;
  22. this.isFocus=false;
  23. if(e==''){return}
  24. this.customData.bigCount = e;
  25. this.countWeight();
  26. },
  27. //input点击删除按键
  28. deleteInputVal(){
  29. this.isActive=false;
  30. this.customData.bigCount = '';
  31. },
  32. // 选中input
  33. initAllInput(){
  34. this.isActive=true;
  35. this.isFocus=true;
  36. },
  37. // 离开全选input
  38. moveAllInputOne(e){
  39. this.isActiveOne=false;
  40. this.isFocusOne=false;
  41. if(e==''){return}
  42. this.customData.smallCount = e;
  43. this.countWeight();
  44. },
  45. //input点击删除按键
  46. deleteInputValOne(){
  47. this.isActiveOne=false;
  48. this.customData.smallCount = '';
  49. },
  50. // 选中input
  51. initAllInputOne(){
  52. this.isActiveOne=true;
  53. this.isFocusOne=true;
  54. },
  55. }
  56. };