Elizabeth's proactive approach involves introducing urinal toilet attachment , an ingenious concept that optimizes space and functionality.

index_1.vue 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <template>
  2. <div>
  3. <div style="margin-top: 10px">合计: {{ new_total || total_money }}元</div>
  4. <div style="margin-top: 10px">
  5. <span
  6. >优惠率:<el-input
  7. style="width: 100px"
  8. v-model="rate_of_concession"
  9. @input="addressChange"
  10. ></el-input
  11. >%</span
  12. >
  13. <span
  14. >优惠金额:<el-input
  15. style="width: 100px"
  16. v-model="discount_amount"
  17. @input="count_discount"
  18. ></el-input
  19. ></span>
  20. <span
  21. >本次付款:<el-input
  22. style="width: 100px"
  23. v-model="payment"
  24. @input="count_payment"
  25. ></el-input
  26. ></span>
  27. <span
  28. >本次欠款:<el-input
  29. style="width: 100px"
  30. v-model="arrearage"
  31. @input="count_arrearage"
  32. ></el-input
  33. ></span>
  34. </div>
  35. </div>
  36. </template>
  37. <script>
  38. export default {
  39. props: {
  40. total_price: {
  41. type: Number,
  42. default: 1000,
  43. },
  44. },
  45. data() {
  46. return {
  47. rate_of_concession: 0,
  48. discount_amount: 0,
  49. total_money: this.$props.total_price,
  50. new_total: 0,
  51. payment:0,
  52. arrearage:0
  53. };
  54. },
  55. created() {
  56. this.addressChange();
  57. },
  58. methods: {
  59. addressChange() {
  60. this.new_total = (
  61. this.total_money *
  62. (100 - this.rate_of_concession) *
  63. 0.01
  64. ).toFixed(2);
  65. this.discount_amount = (this.total_money - this.new_total).toFixed(2);
  66. console.log(this.discount_amount);
  67. },
  68. count_discount() {
  69. this.rate_of_concession = (
  70. this.discount_amount /
  71. (this.total_money * 0.01)
  72. ).toFixed(2);
  73. this.new_total = this.total_money - this.discount_amount;
  74. },
  75. count_payment() {
  76. if(this.new_total){
  77. this.arrearage = this.new_total - this.payment
  78. }
  79. },
  80. count_arrearage() {
  81. if(this.new_total){
  82. this.payment = this.new_total - this.arrearage
  83. }
  84. },
  85. },
  86. };
  87. </script>
  88. <style scoped>
  89. </style>