payLeBao.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <template>
  2. <div class="teamCourseList">
  3. <p class="coreTitle">
  4. 乐保
  5. <el-form-item
  6. label="是否展示"
  7. prop="isShowMusicInsuranceForPay"
  8. v-if="allCourseCurrentPrice == 0"
  9. class="titleFormItem"
  10. >
  11. <el-select
  12. style="width: 100% !important"
  13. v-model="form.isShowMusicInsuranceForPay"
  14. placeholder="请选择是否展乐保费用"
  15. size="mini"
  16. >
  17. <el-option label="是" :value="true"> </el-option>
  18. <el-option label="否" :value="false"> </el-option>
  19. </el-select>
  20. </el-form-item>
  21. </p>
  22. <el-table
  23. class="courseTable"
  24. :data="form.leBaoList"
  25. style="width: 100% !important; background: #f9f9f9"
  26. :header-cell-style="{ background: '#F9F9F9', color: '#444' }"
  27. >
  28. <el-table-column width="170px" label="乐器保养">
  29. <template slot-scope="scope">
  30. <p>乐器保养</p>
  31. </template>
  32. </el-table-column>
  33. <el-table-column label="年限" prop="num" key="num" width="170px">
  34. <template slot-scope="scope">
  35. <el-form-item
  36. :prop="'leBaoList.' + scope.$index + '.num'"
  37. :rules="[
  38. {
  39. required: true,
  40. message: '请输入年限',
  41. trigger: 'blur',
  42. },
  43. ]"
  44. >
  45. <!-- @change="
  46. $listeners.priceChange(scope.row, scope.$index)
  47. " -->
  48. <el-input-number
  49. style="width: 90% !important"
  50. class="number-input"
  51. v-model="form.leBaoList[scope.$index].num"
  52. :controls="false"
  53. :precision="0"
  54. :min="0"
  55. @change="changeYear"
  56. placeholder="请输入年限"
  57. />
  58. </el-form-item>
  59. </template>
  60. </el-table-column>
  61. <el-table-column
  62. label="售价(元)"
  63. prop="actualAmount"
  64. key="actualAmount"
  65. width="170px"
  66. >
  67. <template slot-scope="scope">
  68. <el-form-item
  69. :prop="'leBaoList.' + scope.$index + '.actualAmount'"
  70. :rules="{
  71. required: true,
  72. message: '请输入售价',
  73. trigger: 'blur',
  74. }"
  75. >
  76. <!-- $listeners.moneyChange -->
  77. <el-input-number
  78. style="width: 90% !important"
  79. class="number-input"
  80. v-model="form.leBaoList[scope.$index].actualAmount"
  81. :controls="false"
  82. :precision="0"
  83. :min="0"
  84. @change="change"
  85. :disabled="true"
  86. placeholder="请输入售价"
  87. />
  88. </el-form-item>
  89. </template>
  90. </el-table-column>
  91. <el-table-column
  92. prop="originalAmount"
  93. key="originalAmount"
  94. label="原价(元)"
  95. width="170px"
  96. >
  97. <template slot-scope="scope">
  98. <el-form-item
  99. :prop="'leBaoList.' + scope.$index + '.originalAmount'"
  100. :rules="{
  101. required: true,
  102. message: '请输入原价',
  103. trigger: 'blur',
  104. }"
  105. >
  106. <el-input-number
  107. style="width: 90% !important"
  108. class="number-input"
  109. v-model="form.leBaoList[scope.$index].originalAmount"
  110. :controls="false"
  111. :precision="0"
  112. :min="0"
  113. :disabled="true"
  114. placeholder="请输入原价"
  115. />
  116. </el-form-item>
  117. </template>
  118. </el-table-column>
  119. <el-table-column prop="close" key="close">
  120. <template slot-scope="scope"> </template>
  121. </el-table-column>
  122. </el-table>
  123. <!-- v-if="!isCommon && $listeners.create" @click="$listeners.create"-->
  124. <!-- <el-button icon="el-icon-plus" plain class="addBtn">新增课程类型</el-button> -->
  125. </div>
  126. </template>
  127. <script>
  128. export default {
  129. props: ["form", "leBaoInfo"],
  130. data() {
  131. return {
  132. charges: [],
  133. clearable: false,
  134. isDisabled: false,
  135. courseUnitPriceSettingsByType: [],
  136. boolOptionsOptions: [],
  137. };
  138. },
  139. methods: {
  140. changeYear(val) {
  141. this.leBaoInfo.forEach((element) => {
  142. if (element.id == "189") {
  143. this.$set(
  144. this.form.leBaoList[0],
  145. "actualAmount",
  146. val * element.paranValue
  147. );
  148. }
  149. if (element.id == "202") {
  150. this.$set(
  151. this.form.leBaoList[0],
  152. "originalAmount",
  153. val * element.paranValue
  154. );
  155. }
  156. });
  157. },
  158. change() {},
  159. },
  160. computed: {
  161. allCourseCurrentPrice() {
  162. let price = 0;
  163. this.form.leBaoList.forEach((element) => {
  164. price += element.actualAmount;
  165. });
  166. if (price > 0) {
  167. this.form.isShowMusicInsuranceForPay = true;
  168. }
  169. return price;
  170. },
  171. },
  172. };
  173. </script>
  174. <style lang="scss" scoped>
  175. @import "~@/views/resetTeaming/modals/pay.scss";
  176. </style>