tax_rate.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <template>
  2. <div class="app-container">
  3. <div>
  4. <div class="setting_title">税率设置</div>
  5. <el-divider></el-divider>
  6. <el-card shadow="never" class="my-card">
  7. <el-form
  8. class="my-form"
  9. ref="mainForm"
  10. :model="mainForm"
  11. label-width="120px"
  12. label-position="right"
  13. >
  14. <el-form-item label="仓存费税率" prop="">
  15. <el-input
  16. v-model="mainForm.storageFeeTax"
  17. autocomplete="off"
  18. placeholder="请输入"
  19. ><i class="el-input__icon" slot="suffix">% </i></el-input
  20. >
  21. </el-form-item>
  22. <el-form-item label="工程价差税率" prop="">
  23. <el-input
  24. v-model="mainForm.enginPriceDifTax"
  25. autocomplete="off"
  26. placeholder="请输入"
  27. ><i class="el-input__icon" slot="suffix">% </i></el-input
  28. >
  29. </el-form-item>
  30. <el-form-item label="运输费税率" prop="">
  31. <el-input
  32. v-model="mainForm.transportTax"
  33. autocomplete="off"
  34. placeholder="请输入"
  35. ><i class="el-input__icon" slot="suffix">% </i></el-input
  36. >
  37. </el-form-item>
  38. <el-form-item label="安装费税率" prop="">
  39. <el-input
  40. v-model="mainForm.installTax"
  41. autocomplete="off"
  42. placeholder="请输入"
  43. ><i class="el-input__icon" slot="suffix">% </i></el-input
  44. >
  45. </el-form-item>
  46. <el-form-item label="库存商品税率" prop="">
  47. <el-input
  48. v-model="mainForm.stockTax"
  49. autocomplete="off"
  50. placeholder="请输入"
  51. ><i class="el-input__icon" slot="suffix">% </i></el-input
  52. >
  53. </el-form-item>
  54. <el-form-item label="押金通用比例" prop="">
  55. <el-input
  56. v-model="mainForm.depositTax"
  57. autocomplete="off"
  58. placeholder="请输入"
  59. ><i class="el-input__icon" slot="suffix">% </i></el-input
  60. >
  61. </el-form-item>
  62. </el-form>
  63. </el-card>
  64. </div>
  65. <div class="page-footer">
  66. <div class="footer">
  67. <el-button type="primary" @click="editFn">修改</el-button>
  68. <el-button type="primary">确定</el-button>
  69. </div>
  70. </div>
  71. </div>
  72. </template>
  73. <script>
  74. import { getCommonTaxGet, getCommonTaxConfig } from "@/api/finance/tax_rate";
  75. export default {
  76. data() {
  77. return {
  78. mainForm: {
  79. storageFeeTax: null,
  80. enginPriceDifTax: null,
  81. transportTax: null,
  82. installTax: null,
  83. stockTax: null,
  84. depositTax: null,
  85. },
  86. };
  87. },
  88. created() {
  89. this.getData();
  90. },
  91. methods: {
  92. //修改
  93. async editFn() {
  94. await getCommonTaxConfig({
  95. storageFeeTax: Number((this.mainForm.storageFeeTax / 100).toFixed(2)),
  96. enginPriceDifTax: Number(
  97. (this.mainForm.enginPriceDifTax / 100).toFixed(2)
  98. ),
  99. transportTax: Number((this.mainForm.transportTax / 100).toFixed(2)),
  100. installTax: Number((this.mainForm.installTax / 100).toFixed(2)),
  101. stockTax: Number((this.mainForm.stockTax / 100).toFixed(2)),
  102. depositTax: Number((this.mainForm.depositTax / 100).toFixed(2)),
  103. });
  104. this.$message.success("修改成功");
  105. this.getData();
  106. },
  107. //获取税率数据
  108. async getData() {
  109. const res = await getCommonTaxGet();
  110. console.log(res);
  111. this.mainForm = {
  112. storageFeeTax: res.data.storageFeeTax * 100,
  113. enginPriceDifTax: res.data.enginPriceDifTax * 100,
  114. transportTax: res.data.transportTax * 100,
  115. installTax: res.data.installTax * 100,
  116. stockTax: res.data.stockTax * 100,
  117. depositTax: res.data.depositTax * 100,
  118. };
  119. },
  120. },
  121. };
  122. </script>
  123. <style lang="scss" scoped>
  124. .setting_title {
  125. padding-left: 0;
  126. }
  127. .tips {
  128. font-size: 14px;
  129. }
  130. .my-card {
  131. margin-top: 20px;
  132. .box {
  133. background: rgb(235, 240, 249);
  134. padding: 10px;
  135. font-size: 14px;
  136. margin: 20px 0;
  137. line-height: 18px;
  138. ::v-deep .el-link {
  139. vertical-align: unset;
  140. }
  141. }
  142. }
  143. .my-form {
  144. width: 450px;
  145. margin: 0 auto;
  146. }
  147. .show-pwd {
  148. position: absolute;
  149. right: 15px;
  150. top: 0;
  151. font-size: 16px;
  152. cursor: pointer;
  153. user-select: none;
  154. }
  155. .question {
  156. position: absolute;
  157. right: -30px;
  158. top: 0;
  159. font-size: 20px;
  160. cursor: pointer;
  161. user-select: none;
  162. }
  163. </style>