deduction.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  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.records" :page-para="listQuery" :get-page-list="getList">
  7. <template slot="left">
  8. <el-input
  9. v-model="listQuery.userName"
  10. placeholder="人员名称"
  11. clearable
  12. style="margin-left: 20px;width: 320px;float: left;"
  13. >
  14. </el-input>
  15. <el-select
  16. v-model="listQuery.cate"
  17. placeholder="结算类型"
  18. clearable
  19. filterable
  20. style="margin-left: 20px;width: 150px;float: left;"
  21. class="filter-item"
  22. >
  23. <el-option label="项目结算" value="ITEM_SETTLE"/>
  24. <el-option label="默认预提" value="DEFAULT_AHEAD"/>
  25. </el-select>
  26. <el-button
  27. class="filter-item"
  28. style="margin-left: 10px;float: left;"
  29. type="primary"
  30. @click="getList"
  31. round
  32. >搜索
  33. </el-button>
  34. <el-button
  35. class="filter-item"
  36. style="float: left;"
  37. round
  38. type="warning"
  39. @click="resetSearch()"
  40. >重置
  41. </el-button>
  42. </template>
  43. <parentTable
  44. v-loading="listLoading"
  45. :data="pageData"
  46. slot="table"
  47. style="width: 100%;"
  48. :showSummary="true"
  49. :summary-method="getSummaries"
  50. >
  51. <el-table-column label="人员名称" align="center">
  52. <template slot-scope="{row}">
  53. <span>{{ row.userName }}</span>
  54. </template>
  55. </el-table-column>
  56. <el-table-column label="结算总金额(元)" align="center">
  57. <template slot-scope="{row}">
  58. <p v-html="getAmount(row)"></p>
  59. </template>
  60. </el-table-column>
  61. <el-table-column label="结算类型" align="center">
  62. <template slot-scope="{row}">
  63. <span>{{settleCate(row.cate)}}</span>
  64. </template>
  65. </el-table-column>
  66. <el-table-column label="提成体现" align="center">
  67. <template slot-scope="{row}">
  68. <span>{{ row.embody}}</span>
  69. </template>
  70. </el-table-column>
  71. <el-table-column label="结算时间" align="center">
  72. <template slot-scope="{row}">
  73. <span>{{ row.created}}</span>
  74. </template>
  75. </el-table-column>
  76. </parentTable>
  77. </y-page-list-layout>
  78. </div>
  79. </template>
  80. <script>
  81. import YPageListLayout from '@/components/YPageListLayout'
  82. import Breadcrumb from '@/components/Breadcrumb'
  83. export default {
  84. name: 'ViewsBrokerageDeduction',
  85. components: {
  86. Breadcrumb,
  87. YPageListLayout,
  88. },
  89. filters: {
  90. statusFilter(status) {
  91. const statusMap = {
  92. published: 'success',
  93. draft: 'info',
  94. deleted: 'danger',
  95. }
  96. return statusMap[status]
  97. },
  98. },
  99. data() {
  100. return {
  101. isDisable:false,
  102. tableKey: 0,
  103. pageData: { records: [] },
  104. details:[],
  105. total: 20,
  106. listLoading: true,
  107. listQuery: {
  108. page: 1,
  109. size: 10,
  110. descs: 'id',
  111. },
  112. listQueryKey: 'keyword',
  113. }
  114. },
  115. created() {
  116. this.getList()
  117. },
  118. methods: {
  119. getAmount(row){
  120. const amount = row.brokerageAmount;
  121. if (row.brokerageAmount<0){
  122. return '<span style="color: red">'+amount+'</span>'
  123. }else{
  124. return '<span style="color: green">'+amount+'</span>'
  125. }
  126. },
  127. getSummaries(){
  128. const param = this.pageData;
  129. const sums = [];
  130. param.forEach((column, index) => {
  131. if (index === 0) {
  132. sums[index] = '合计';
  133. return;
  134. }
  135. if (index === 1){
  136. const values = param.map(item => Number(item.brokerageAmount));
  137. if (!values.every(value => isNaN(value))) {
  138. sums[index] = values.reduce((prev, curr) => {
  139. const value = Number(curr);
  140. if (!isNaN(value)) {
  141. return prev + curr;
  142. } else {
  143. return prev;
  144. }
  145. }, 0);
  146. sums[index] += '';
  147. } else {
  148. sums[index] = 'N/A';
  149. }
  150. }else {
  151. sums[index] = '-';
  152. }
  153. });
  154. return sums;
  155. },
  156. brokerageRule(val){
  157. if (val === 'LAND_OTHER_RULE'){
  158. return '参与人员规则';
  159. }
  160. if (val === 'LAND_MARKETER_RULE'){
  161. return '市场人员规则';
  162. }
  163. },
  164. brokerageMode(val){
  165. if (val === 'PERSONAL'){
  166. return '个人提成';
  167. }
  168. if (val === 'TEAM_SHARE'){
  169. return '团队抽成';
  170. }
  171. },
  172. itemCate(val){
  173. if (val === 'AHEAD'){
  174. return '预提';
  175. }
  176. if (val === 'SETTLE'){
  177. return '结算';
  178. }
  179. },
  180. resetSearch() {
  181. this.listQuery = {
  182. current: 1,
  183. size: 10,
  184. descs: 'id',
  185. };
  186. this.getList()
  187. },
  188. settleCate(val){
  189. if (val === 'DEFAULT_AHEAD'){
  190. return '默认预提';
  191. }
  192. if (val === 'ITEM_SETTLE'){
  193. return '项目结算';
  194. }
  195. },
  196. getList() {
  197. const that = this;
  198. this.listLoading = true;
  199. this.$api.itemBrokerageSequence.deduction(Object.assign({}, that.listQuery)).then((res) => {
  200. that.pageData = res.data;
  201. setTimeout(() => {
  202. that.listLoading = false
  203. }, 200);
  204. })
  205. .catch(() => {
  206. that.listLoading = false
  207. })
  208. },
  209. }
  210. }
  211. </script>
  212. <style lang="scss" scoped>
  213. .right {
  214. flex: 1;
  215. .title {
  216. font-size: 16px;
  217. font-weight: 500;
  218. color: rgba(51, 51, 51, 1);
  219. line-height: 35px;
  220. margin-bottom: 8px;
  221. }
  222. .menu-2-box {
  223. display: flex;
  224. flex-wrap: wrap;
  225. width: 100%;
  226. }
  227. .menu-2-item {
  228. display: flex;
  229. align-items: center;
  230. color: #656565;
  231. font-size: 12px;
  232. width: 230px;
  233. height: 101px;
  234. background: rgb(255, 185, 129);
  235. border-radius: 3px;
  236. padding-left: 20px;
  237. margin-right: 10px;
  238. margin-bottom: 10px;
  239. cursor: pointer;
  240. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);
  241. .text {
  242. margin-left: 16px;
  243. }
  244. }
  245. }
  246. /deep/ .el-table{
  247. display: flex;
  248. flex-direction: column;
  249. }
  250. /deep/ .el-table__body-wrapper{
  251. order: 1;
  252. }
  253. </style>