searchCompanyModal.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <template>
  2. <el-dialog :visible.sync="innerVisible" append-to-body title="业务渠道" width="1024px" center>
  3. <ex-table
  4. v-loading="loading"
  5. :table="table"
  6. :data="tableData"
  7. :columns="columns"
  8. :page="pageInfo"
  9. :size="size"
  10. @selection="({list}) => selectedRows = list"
  11. @page-curr-change="handlePageChange"
  12. @page-size-change="handleSizeChange"
  13. @screen-reset="
  14. pageInfo.curr = 1;
  15. parmValue.page = 1;
  16. searchList();
  17. "
  18. @screen-submit="
  19. pageInfo.curr = 1;
  20. parmValue.page = 1;
  21. searchList();
  22. "
  23. >
  24. <template #table-header>
  25. <div style="width: 100%">
  26. <el-row gutter="10">
  27. <el-col :span="6">
  28. <search-work-company
  29. :value="parmValue.companyNo"
  30. size="mini"
  31. :placeholder="'业务公司'"
  32. @searchChange="companyNosearchChange"
  33. />
  34. </el-col>
  35. <el-col :span="6">
  36. <el-input
  37. v-model="parmValue.channel_name"
  38. placeholder="支付渠道名称"
  39. clearable
  40. size="mini"
  41. @change=" pageInfo.curr = 1;
  42. parmValue.page = 1;
  43. searchList();"
  44. />
  45. </el-col>
  46. </el-row>
  47. </div>
  48. </template>
  49. </ex-table>
  50. <div class="fr">
  51. <el-button size="mini" type="primary" @click="onSave">保存</el-button>
  52. </div>
  53. <div style="clear:both;" />
  54. </el-dialog>
  55. </template>
  56. <script>
  57. import asyncRequest from '@/apis/service/serviceParam/terrace'
  58. export default {
  59. props: ['visible'],
  60. data() {
  61. return {
  62. loading: false,
  63. selectedRows: [],
  64. tableData: [],
  65. table: {
  66. stripe: true,
  67. border: true
  68. },
  69. columns: [
  70. {
  71. type: 'selection'
  72. },
  73. {
  74. prop: 'channel_name',
  75. label: '渠道名称'
  76. },
  77. {
  78. prop: 'companyName',
  79. label: '业务公司名称'
  80. }
  81. ],
  82. pageInfo: {
  83. size: 15,
  84. curr: 1,
  85. total: 0
  86. },
  87. parmValue: {
  88. }
  89. }
  90. },
  91. computed: {
  92. innerVisible: {
  93. get() {
  94. return this.visible
  95. },
  96. set(newValue) {
  97. this.$emit('update:visible', newValue)
  98. }
  99. }
  100. },
  101. watch: {
  102. visible() {
  103. if (this.visible) {
  104. this.searchList()
  105. } else {
  106. this.tableData = []
  107. }
  108. }
  109. },
  110. methods: {
  111. onSave() {
  112. this.$emit('updatePaymentChannel', this.selectedRows)
  113. this.innerVisible = false
  114. },
  115. async companyNosearchChange(e) {
  116. const { id, code, label } = e
  117. this.parmValue['companyNo'] = code || ''
  118. this.pageInfo.curr = 1
  119. this.parmValue.page = 1
  120. this.searchList()
  121. },
  122. async searchList() {
  123. if (
  124. (this.parmValue.start !== '' && this.parmValue.end === '') ||
  125. (this.parmValue.start == '' && this.parmValue.end != '')
  126. ) {
  127. this.$message.warning('开始时间和结束时间不能为空')
  128. return
  129. }
  130. this.loading = true
  131. const res = await asyncRequest.paymentChannelist(this.parmValue)
  132. if (res && res.code === 0 && res.data) {
  133. this.tableData = res.data.list
  134. this.pageInfo.total = Number(res.data.count)
  135. } else if (res && res.code >= 100 && res.code <= 104) {
  136. await this.logout()
  137. } else {
  138. this.tableData = []
  139. this.pageInfo.total = 0
  140. }
  141. this.loading = false
  142. }
  143. }
  144. }
  145. </script>
  146. <style lang="scss" scoped>
  147. /deep/ .Pagination{
  148. .el-pagination{
  149. float: left;
  150. }
  151. }
  152. </style>