payMent.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  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.$api.settlepayinfodata(this.activeData.settleId).then((res) => {
  109. this.formData = res.data;
  110. });
  111. },
  112. close() {},
  113. submitForm() {
  114. this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", {
  115. confirmButtonText: "确定",
  116. cancelButtonText: "取消",
  117. type: "warning",
  118. })
  119. .then(() => {
  120. this.$api
  121. .settlepay({ settleId: this.formData.settleId })
  122. .then((res) => {
  123. this.$message({
  124. type: "success",
  125. message: "支付成功",
  126. });
  127. this.isShow = false;
  128. this.$emit("search");
  129. });
  130. })
  131. .catch(() => {});
  132. },
  133. },
  134. computed: {
  135. isShow: {
  136. get() {
  137. if (this.dialogVisible) {
  138. this.init();
  139. }
  140. return this.dialogVisible;
  141. },
  142. set(val) {
  143. this.$emit("update:dialogVisible", false);
  144. },
  145. },
  146. },
  147. };
  148. </script>
  149. <style lang="scss" scoped>
  150. .box {
  151. display: flex;
  152. align-items: center;
  153. margin-bottom: 10px;
  154. font-size: 14px;
  155. .title {
  156. width: 100px;
  157. text-align: end;
  158. }
  159. .text {
  160. flex: 1;
  161. font-weight: bold;
  162. }
  163. }
  164. </style>