rebatesettlement.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. <template>
  2. <div>
  3. <el-tabs v-if="rebHeadData.length > 0" v-model="activeName" type="border-card" @tab-click="handleClick">
  4. <el-tab-pane v-for="item in rebHeadData" :key="item.index" :label="item.billno_contract + '_' + item.title" :name="item.billno_contract + '_' + item.title">
  5. <el-button size="small" style="margin-bottom: 10px" @click="detailGO(item)">查看合同</el-button>
  6. <div>
  7. <el-descriptions class="margin-top mt-10" title="居间明细" :column="2" size="small" border>
  8. <el-descriptions-item :labelStyle="{width:'120px'}" label="订单金额比例">{{item.calculatemodel == 1?Math.round((item.orderratio * 100)*100)/100 + '%':'--'}}</el-descriptions-item>
  9. <el-descriptions-item :labelStyle="{width:'120px'}" label="订单金额">{{item.amount?tool.formatAmount(item.amount,2):''}}</el-descriptions-item>
  10. <el-descriptions-item :labelStyle="{width:'120px'}" label="居间产品折扣">{{item.calculatemodel == 2?Math.round((item.productdiscount * 100)*100)/100 + '%':'--'}}</el-descriptions-item>
  11. <el-descriptions-item :labelStyle="{width:'120px'}" label="居间费">{{tool.formatAmount(item.rebate,2)}}</el-descriptions-item>
  12. <el-descriptions-item :labelStyle="{width:'120px'}" label="结算经销商">{{item.enterprisename?item.enterprisename:'--'}}</el-descriptions-item>
  13. </el-descriptions>
  14. </div>
  15. <table-new-layout :layout="tablecols" :data="tableData" :custom="true" :width="true" height="calc(100vh - 750px)" minHeight="400px">
  16. <template v-slot:customcol="scope">
  17. <div v-if="scope.column.columnname === 'price'">
  18. {{tool.formatAmount(scope.column.data[scope.column.columnname],2)}}
  19. </div>
  20. <div v-else-if="scope.column.columnname === 'marketprice'">
  21. {{tool.formatAmount(scope.column.data[scope.column.columnname],2)}}
  22. </div>
  23. <div v-else-if="scope.column.columnname === 'amount'">
  24. {{tool.formatAmount(scope.column.data[scope.column.columnname],2)}}
  25. </div>
  26. <div v-else-if="scope.column.columnname === 'rebate_price'">
  27. {{tool.formatAmount(scope.column.data[scope.column.columnname],2)}}
  28. </div>
  29. <div v-else-if="scope.column.columnname === 'rebate_unit_price'">
  30. {{tool.formatAmount(scope.column.data[scope.column.columnname],2)}}
  31. </div>
  32. <div v-else-if="scope.column.columnname === 'rebate'">
  33. {{tool.formatAmount(scope.column.data[scope.column.columnname],2)}}
  34. </div>
  35. <div v-else-if="scope.column.columnname === 'discountrate'">
  36. {{Math.round((scope.column.data[scope.column.columnname] * 100)*100)/100 + '%'}}
  37. </div>
  38. <div v-else-if="scope.column.columnname === 'rebate_discountrate'">
  39. {{Math.round((scope.column.data[scope.column.columnname] * 100)*100)/100 + '%'}}
  40. </div>
  41. <p v-else>{{scope.column.data[scope.column.columnname] || '--'}}</p>
  42. </template>
  43. </table-new-layout>
  44. <div class="container normal-panel" style="text-align:right;padding-bottom: 0">
  45. <el-pagination
  46. background
  47. @size-change="handleSizeChange"
  48. @current-change="handleCurrentChange"
  49. :current-page="currentPage"
  50. :page-sizes="[20, 50, 100, 200]"
  51. layout="total,sizes, prev, pager, next, jumper"
  52. :total="total">
  53. </el-pagination>
  54. </div>
  55. </el-tab-pane>
  56. </el-tabs>
  57. <el-empty v-else description="暂无数据"></el-empty>
  58. </div>
  59. </template>
  60. <script>
  61. export default {
  62. data () {
  63. return {
  64. rebHeadData:[],
  65. tableData:[],
  66. param:{
  67. "pageNumber": 1,
  68. "pageSize": 20,
  69. },
  70. total:0,
  71. currentPage:0,
  72. activeName:'',
  73. tablecols:[],
  74. sa_rebatesettlementid:''
  75. }
  76. },
  77. methods:{
  78. async headData () {
  79. const res = await this.$api.requested({
  80. "id": "20230105194402",
  81. "content": {
  82. "sa_orderid": this.$route.query.id
  83. },
  84. })
  85. this.rebHeadData = res.data
  86. this.activeName = res.data.length > 0? res.data[0].billno_contract + '_' + res.data[0].title:''
  87. this.sa_rebatesettlementid = res.data.length > 0?res.data[0].sa_rebatesettlementid:''
  88. this.sa_rebatesettlementid?this.listData():''
  89. },
  90. async listData () {
  91. const res = await this.$api.requested({
  92. "id": "20230105194902",
  93. "content": {
  94. "sa_rebatesettlementid": this.sa_rebatesettlementid,
  95. "pageNumber": this.param.pageNumber,
  96. "pageSize": this.param.pageSize,
  97. "where": {
  98. "condition": ""
  99. }
  100. },
  101. })
  102. this.tableData = res.data
  103. this.total = res.total
  104. this.currentPage = res.pageNumber
  105. },
  106. handleSizeChange(val) {
  107. this.param.pageSize = val
  108. this.listData()
  109. },
  110. handleCurrentChange(val) {
  111. this.param.pageNumber = val
  112. this.listData()
  113. },
  114. handleClick(tab){
  115. console.log(tab.index)
  116. this.sa_rebatesettlementid = this.rebHeadData[tab.index].sa_rebatesettlementid
  117. this.listData(this.param.pageNumber = 1)
  118. },
  119. detailGO(row){
  120. let type = '居间'
  121. let route = this.$route
  122. if (route.path !== '/contractDetail') {
  123. this.oldRoute = {path:route.path,query:route.query}
  124. this.$store.dispatch('setHistoryRouter',this.oldRoute)
  125. }
  126. // sessionStorage.setItem('listqueryid',this.listqueryid)
  127. // sessionStorage.setItem('isGo','1')
  128. this.$router.push({
  129. path:'/contractDetail',
  130. query:{
  131. id:row.sa_contractid,
  132. rowindex:row.rowindex,
  133. type:type,
  134. }
  135. })
  136. }
  137. },
  138. mounted () {
  139. this.headData()
  140. },
  141. created() {
  142. this.tablecols = this.tool.tabelCol(this.$route.name).intermediaryFeeTable.tablecols
  143. }
  144. }
  145. </script>
  146. <style>
  147. </style>