contract-statistics.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. <!-- 合同统计 -->
  2. <template>
  3. <div class="contract">
  4. <template v-if="!annualReportVisible">
  5. <el-form :inline="true" :model="dataForm" @keyup.enter.native="search()">
  6. <el-form-item label="名称">
  7. <el-input v-model="dataForm.customerName" placeholder="客户名称" clearable/>
  8. </el-form-item>
  9. <el-form-item>
  10. <el-button @click="search()">查询</el-button>
  11. <el-button v-if="isAuth('cus:contractCensus:info')" type="primary" @click="annualReportHandle()">年度合同统计</el-button>
  12. </el-form-item>
  13. </el-form>
  14. <el-table
  15. :data="dataList"
  16. border
  17. v-loading="dataListLoading"
  18. style="width: 100%;">
  19. <el-table-column
  20. label="序号"
  21. type="index"
  22. width="50"
  23. align="center">
  24. </el-table-column>
  25. <el-table-column
  26. prop="customerName"
  27. header-align="center"
  28. align="center"
  29. min-width="140"
  30. :show-tooltip-when-overflow="true"
  31. label="客户名称">
  32. </el-table-column>
  33. <el-table-column
  34. prop="bizManagerName"
  35. header-align="center"
  36. align="center"
  37. min-width="120"
  38. :show-tooltip-when-overflow="true"
  39. label="业务员">
  40. </el-table-column>
  41. <el-table-column
  42. prop="monthNum"
  43. header-align="center"
  44. align="center"
  45. min-width="140"
  46. :show-overflow-tooltip="true"
  47. label="本月合同总数">
  48. </el-table-column>
  49. <el-table-column
  50. prop="monthTotalAmount"
  51. header-align="center"
  52. align="center"
  53. min-width="140"
  54. :show-overflow-tooltip="true"
  55. label="本月合同总金额">
  56. </el-table-column>
  57. <el-table-column
  58. prop="historyNum"
  59. header-align="center"
  60. align="center"
  61. min-width="100"
  62. label="历史合同总数">
  63. </el-table-column>
  64. <el-table-column
  65. prop="historyTotalAmount"
  66. header-align="center"
  67. align="center"
  68. min-width="120"
  69. label="历史任务单合同总金额">
  70. </el-table-column>
  71. <el-table-column
  72. prop="notes"
  73. header-align="center"
  74. align="center"
  75. min-width="180"
  76. :show-overflow-tooltip="true"
  77. label="备注">
  78. </el-table-column>
  79. </el-table>
  80. <el-pagination
  81. @size-change="sizeChangeHandle"
  82. @current-change="currentChangeHandle"
  83. :current-page="pageIndex"
  84. :page-sizes="[10, 20, 50, 100]"
  85. :page-size="pageSize"
  86. :total="totalPage"
  87. layout="total, sizes, prev, pager, next, jumper">
  88. </el-pagination>
  89. </template>
  90. <report v-if="annualReportVisible" ref="reportPage" @onChose="onChose"/>
  91. </div>
  92. </template>
  93. <script>
  94. import Report from './contract-statistics-annual-report'
  95. import { getStatList } from '@/api/cus'
  96. export default {
  97. name: 'contract-statistics',
  98. components: {
  99. Report
  100. },
  101. data () {
  102. return {
  103. annualReportVisible: false,
  104. dataForm: {},
  105. dataList: [],
  106. pageIndex: 1,
  107. pageSize: 10,
  108. totalPage: 0,
  109. dataListLoading: false,
  110. dataListSelections: []
  111. }
  112. },
  113. created () {
  114. this.getDataList()
  115. },
  116. methods: {
  117. onChose () {
  118. this.annualReportVisible = false
  119. },
  120. // 查询
  121. search () {
  122. this.pageIndex = 1
  123. this.getDataList()
  124. },
  125. // 获取数据列表
  126. getDataList () {
  127. this.dataListLoading = true
  128. let params = {
  129. 'current': this.pageIndex,
  130. 'size': this.pageSize,
  131. 'customerName': this.dataForm.customerName ? this.dataForm.customerName : null
  132. }
  133. getStatList(params).then(({data}) => {
  134. if (data && data.code === '200') {
  135. this.dataList = data.data.records
  136. this.totalPage = Number(data.data.total)
  137. } else {
  138. this.dataList = []
  139. this.totalPage = 0
  140. }
  141. this.dataListLoading = false
  142. })
  143. },
  144. // 每页数
  145. sizeChangeHandle (val) {
  146. this.pageSize = val
  147. this.pageIndex = 1
  148. this.getDataList()
  149. },
  150. // 当前页
  151. currentChangeHandle (val) {
  152. this.pageIndex = val
  153. this.getDataList()
  154. },
  155. // 多选
  156. selectionChangeHandle (val) {
  157. this.dataListSelections = val
  158. },
  159. // 年度合同统计
  160. annualReportHandle () {
  161. this.annualReportVisible = true
  162. this.$nextTick(() => {
  163. this.$refs.reportPage.init()
  164. })
  165. }
  166. }
  167. }
  168. </script>
  169. <style scoped>
  170. </style>