payMent.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <template>
  2. <div>
  3. <BaseDialog
  4. width="500px"
  5. :isShow.sync="isShow"
  6. title="成本支付"
  7. @submit="submitForm"
  8. @close="close"
  9. confirmName="确定支付"
  10. >
  11. <div class="box" v-for="(item, index) in formList" :key="index">
  12. <div class="title">{{ item.label ? item.label + ":" : "" }}</div>
  13. <template v-if="item.scope === 'select'">
  14. <template v-for="(items, indexs) in item.options">
  15. <div v-if="formData[item.value] == items.value" class="text">
  16. {{ items.label }}
  17. </div>
  18. </template>
  19. </template>
  20. <div
  21. class="text"
  22. v-else-if="item.scope === 'money'"
  23. style="color: red; font-size: 16px"
  24. >
  25. ¥{{ formData[item.value] }}
  26. </div>
  27. <div v-else class="text">{{ formData[item.value] }}</div>
  28. </div>
  29. </BaseDialog>
  30. </div>
  31. </template>
  32. <script>
  33. export default {
  34. name: "",
  35. props: {
  36. dialogVisible: {
  37. type: Boolean,
  38. default: false,
  39. },
  40. activeData: {
  41. type: Object,
  42. default: () => {
  43. return {};
  44. },
  45. },
  46. },
  47. data() {
  48. return {
  49. formList: [
  50. {
  51. label: "添加时间",
  52. value: "title",
  53. },
  54. {
  55. label: "结算方式",
  56. value: "settleType",
  57. scope: "select",
  58. options: [
  59. {
  60. label: "数量结算",
  61. value: 1,
  62. },
  63. {
  64. label: "时间结算",
  65. value: 2,
  66. },
  67. ],
  68. },
  69. {
  70. label: "成本分类",
  71. value: "costCatName",
  72. },
  73. {
  74. label: "教育类型",
  75. value: "educationName",
  76. },
  77. {
  78. label: "培训项目",
  79. value: "businessName",
  80. },
  81. {
  82. label: "结算金额",
  83. value: "settleMoney",
  84. scope: "money",
  85. },
  86. {
  87. label: "供应商",
  88. value: "instName",
  89. },
  90. {
  91. label: "收款信息",
  92. value: "bankName",
  93. },
  94. {
  95. label: "",
  96. value: "bank",
  97. },
  98. {
  99. label: "",
  100. value: "bankAccount",
  101. },
  102. ],
  103. formData: {},
  104. };
  105. },
  106. methods: {
  107. init() {
  108. this.formData = Object.assign({}, this.activeData);
  109. },
  110. close() {},
  111. submitForm() {},
  112. },
  113. computed: {
  114. isShow: {
  115. get() {
  116. if (this.dialogVisible) {
  117. this.init();
  118. }
  119. return this.dialogVisible;
  120. },
  121. set(val) {
  122. this.$emit("update:dialogVisible", false);
  123. },
  124. },
  125. },
  126. };
  127. </script>
  128. <style lang="scss" scoped>
  129. .box {
  130. display: flex;
  131. align-items: center;
  132. margin-bottom: 10px;
  133. font-size: 14px;
  134. .title {
  135. width: 100px;
  136. text-align: end;
  137. }
  138. .text {
  139. flex: 1;
  140. font-weight: bold;
  141. }
  142. }
  143. </style>