detailList.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. <template>
  2. <div class="app-container">
  3. <div class="title-container">
  4. <breadcrumb id="breadcrumb-container" class="breadcrumb-container"/>
  5. </div>
  6. <y-page-list-layout :page-list="pageData" :page-para="listQuery" :get-page-list="getList">
  7. <template slot="left">
  8. <el-input
  9. v-model="listQuery.name"
  10. placeholder="回款名称"
  11. clearable
  12. style="margin-left: 20px;width: 320px;float: left;">
  13. </el-input>
  14. <el-button
  15. class="filter-item"
  16. style="margin-left: 10px;float: left;"
  17. type="primary"
  18. @click="searchList"
  19. round
  20. >搜索
  21. </el-button>
  22. <el-button
  23. class="filter-item"
  24. style="float: left;"
  25. round
  26. type="warning"
  27. @click="resetSearch()"
  28. >重置
  29. </el-button>
  30. </template>
  31. <parentTable
  32. v-loading="listLoading"
  33. :data="pageData.records"
  34. slot="table"
  35. style="width: 100%;"
  36. >
  37. <el-table-column label="项目名称" align="center" width="310">
  38. <template slot-scope="{row}">
  39. <span>{{ row.itemName }}</span>
  40. </template>
  41. </el-table-column>
  42. <el-table-column label="回款名称" align="center" width="310">
  43. <template slot-scope="{row}">
  44. <span>{{ row.name }}</span>
  45. </template>
  46. </el-table-column>
  47. <el-table-column label="回款金额" align="center" width="310">
  48. <template slot-scope="{row}">
  49. <span>{{ row.amount }}</span>
  50. </template>
  51. </el-table-column>
  52. <el-table-column label="回款日期" align="center" width="310">
  53. <template slot-scope="{row}">
  54. <span>{{ row.paymentDate }}</span>
  55. </template>
  56. </el-table-column>
  57. <el-table-column label="操作" align="center" >
  58. <template slot-scope="{row}">
  59. <el-button
  60. class="filter-item download-button"
  61. style="margin-left: 10px;"
  62. icon="el-icon-delete-solid"
  63. type="danger"
  64. @click="deleteInfo(row.id)"
  65. >
  66. 删除
  67. </el-button>
  68. </template>
  69. </el-table-column>
  70. </parentTable>
  71. </y-page-list-layout>
  72. </div>
  73. </template>
  74. <script>
  75. import YPageListLayout from '@/components/YPageListLayout'
  76. import Breadcrumb from '@/components/Breadcrumb'
  77. import PermissionButton from '@/components/PermissionButton/PermissionButton'
  78. export default {
  79. name: 'ViewsMarketPaymentDetailList',
  80. components: {
  81. Breadcrumb,
  82. YPageListLayout,
  83. PermissionButton,
  84. },
  85. filters: {
  86. statusFilter(status) {
  87. const statusMap = {
  88. published: 'success',
  89. draft: 'info',
  90. deleted: 'danger',
  91. }
  92. return statusMap[status]
  93. },
  94. },
  95. data() {
  96. return {
  97. tableKey: 0,
  98. pageData: { records: [] },
  99. total: 20,
  100. listLoading: true,
  101. listQuery: {
  102. page: 1,
  103. size: 10,
  104. descs: 'id',
  105. itemId : this.$route.query.id
  106. },
  107. listQueryKey: 'keyword'
  108. }
  109. },
  110. created() {
  111. if (this.$route.query.year) {
  112. this.listQuery.year = this.$route.query.year;
  113. }
  114. if (this.$route.query.month) {
  115. this.listQuery.month = this.$route.query.month;
  116. }
  117. this.getList();
  118. },
  119. methods: {
  120. resetSearch() {
  121. this.listQuery = {
  122. current: 1,
  123. size: 10,
  124. descs: 'id',
  125. itemId: this.$route.query.id
  126. }
  127. this.getList()
  128. },
  129. searchList() {
  130. // 重置分页
  131. this.listQuery.page = 1
  132. this.listQuery.size = 10
  133. this.getList()
  134. },
  135. getList() {
  136. const that = this;
  137. this.listLoading = true;
  138. // console.log(that.listQuery)
  139. const key = {}
  140. key[this.listQueryKey] = this.listQuery.description;
  141. this.$api.payment
  142. .list(Object.assign({}, that.listQuery, key))
  143. .then((res) => {
  144. that.pageData = res.data
  145. setTimeout(() => {
  146. that.listLoading = false
  147. }, 200)
  148. })
  149. .catch(() => {
  150. that.listLoading = false
  151. })
  152. },
  153. deleteInfo(id) {
  154. const that = this
  155. that.$confirm('请确认是否删除该数据?', '提示', {
  156. confirmButtonText: '确定',
  157. cancelButtonText: '取消',
  158. type: 'warning',
  159. center: true
  160. }).then(() => {
  161. that.$api.payment.delete(id).then(data => {
  162. that.loading = false
  163. if (data.code === 200) {
  164. that.getList()
  165. } else {
  166. this.$message({
  167. type: 'error',
  168. message: data.msg
  169. })
  170. }
  171. })
  172. }).catch(() => {
  173. })
  174. }
  175. },
  176. }
  177. </script>
  178. <style lang="scss" scoped>
  179. .right {
  180. flex: 1;
  181. .title {
  182. font-size: 16px;
  183. font-weight: 500;
  184. color: rgba(51, 51, 51, 1);
  185. line-height: 35px;
  186. margin-bottom: 8px;
  187. }
  188. .menu-2-box {
  189. display: flex;
  190. flex-wrap: wrap;
  191. width: 100%;
  192. }
  193. .menu-2-item {
  194. display: flex;
  195. align-items: center;
  196. color: #656565;
  197. font-size: 12px;
  198. width: 230px;
  199. height: 101px;
  200. background: rgb(255, 185, 129);
  201. border-radius: 3px;
  202. padding-left: 20px;
  203. margin-right: 10px;
  204. margin-bottom: 10px;
  205. cursor: pointer;
  206. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);
  207. .text {
  208. margin-left: 16px;
  209. }
  210. }
  211. }
  212. </style>