shippingUninvoiceAnalysis.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. <template>
  2. <div class="div-new-box-new">
  3. <div class="content-new-content">
  4. <div class="div-line"></div>
  5. <div class="title"> 出货未开票分析</div>
  6. <div style="float: right;">
  7. <departmentSalesperson ref="departmentSalesperson" class="inline-16" @depSelect="depSelect" @personSelect="personSelect"></departmentSalesperson>
  8. </div>
  9. </div>
  10. <div class="chart">
  11. <div id="shippingUninvoiceAnalysisChart" style="height: 400px;"></div>
  12. </div>
  13. <div style="height:400px">
  14. <tableTemplate ref="table" :layout="tablecols" :data="list" :opwidth="200" :custom="true" height="356px" fixedName="operation">
  15. <template v-slot:customcol="scope">
  16. <p v-if="scope.column.columnname === 'total'">
  17. <span v-if="scope.column.data[scope.column.columnname]">
  18. ¥{{tool.formatAmount(scope.column.data[scope.column.columnname],2)}}
  19. </span>
  20. <span v-else>--</span>
  21. </p>
  22. <p v-else-if="scope.column.columnname === 'zerotothree'">
  23. <span v-if="scope.column.data[scope.column.columnname]">
  24. ¥{{tool.formatAmount(scope.column.data[scope.column.columnname],2)}}
  25. </span>
  26. <span v-else>--</span>
  27. </p>
  28. <p v-else-if="scope.column.columnname === 'threetosix'">
  29. <span v-if="scope.column.data[scope.column.columnname]">
  30. ¥{{tool.formatAmount(scope.column.data[scope.column.columnname],2)}}
  31. </span>
  32. <span v-else>--</span>
  33. </p>
  34. <p v-else-if="scope.column.columnname === 'sixtotwelve'">
  35. <span v-if="scope.column.data[scope.column.columnname]">
  36. ¥{{tool.formatAmount(scope.column.data[scope.column.columnname],2)}}
  37. </span>
  38. <span v-else>--</span>
  39. </p>
  40. <p v-else-if="scope.column.columnname === 'twelveup'">
  41. <span v-if="scope.column.data[scope.column.columnname]">
  42. ¥{{tool.formatAmount(scope.column.data[scope.column.columnname],2)}}
  43. </span>
  44. <span v-else>--</span>
  45. </p>
  46. <p v-else-if="scope.column.columnname === 'operation'"></p>
  47. <p v-else>{{scope.column.data[scope.column.columnname]?scope.column.data[scope.column.columnname]:'--'}}</p>
  48. </template>
  49. <template v-slot:opreation="scope">
  50. <shippingUninvoiceDetail :dataid="param.content.dataid" :type="param.content.type" :sys_enterpriseid="scope.data.sys_enterpriseid" :data="scope.data"></shippingUninvoiceDetail>
  51. </template>
  52. </tableTemplate>
  53. <div class="container normal-panel" style="text-align:right;float: right;">
  54. <el-pagination
  55. background
  56. @size-change="handleSizeChange"
  57. @current-change="handleCurrentChange"
  58. :current-page="currentPage"
  59. :pager-count="7"
  60. :page-sizes="[20, 50,100, 200]"
  61. :page-size="20"
  62. layout="total,sizes, prev, pager, next, jumper"
  63. :total="total">
  64. </el-pagination>
  65. </div>
  66. </div>
  67. </div>
  68. </template>
  69. <script>
  70. import departmentSalesperson from "@/views/salesData/components/departmentSalesperson";
  71. import tableTemplate from '@/views/salesData/components/table';
  72. import shippingUninvoiceDetail from "@/views/salesData/components/shippingUninvoiceDetail";
  73. import {Bar} from "@antv/g2plot";
  74. export default {
  75. name: "shippingUninvoiceAnalysis",
  76. components:{tableTemplate,departmentSalesperson,shippingUninvoiceDetail},
  77. data(){
  78. return {
  79. chartBar:null,
  80. param:{
  81. "id": 20231016163904,
  82. "content": {
  83. "type": 0,
  84. "dataid": 54,
  85. "pageNumber": 1,
  86. "pageSize": 20,
  87. "where": {
  88. "uninvicetype":""
  89. }
  90. }
  91. },
  92. tablecols:[],
  93. list:[],
  94. currentPage:0,
  95. total:0,
  96. chartData:[],
  97. hoverData:[],
  98. }
  99. },
  100. methods:{
  101. async listData(val){
  102. this.renderPie(val)
  103. },
  104. async queryModel(val){
  105. this.param.content.dataid = val || this.dataid
  106. const res = await this.$api.requested(this.param)
  107. if (res.data.length === 1){
  108. if (res.data[0].isEmpty == '1'){
  109. this.list = []
  110. this.total = 0
  111. this.currentPage = 0
  112. }else {
  113. this.list = res.data
  114. this.total = res.total
  115. this.currentPage = res.pageNumber
  116. }
  117. }else {
  118. this.list = res.data
  119. this.total = res.total
  120. this.currentPage = res.pageNumber
  121. }
  122. this.chartData = res.data[0].Trend
  123. this.chartData = this.chartData.map(item=>{
  124. return {
  125. "value": Math.round(((item.value)*100)/100),
  126. "key": item.key,
  127. "type":"出货未开票金额"
  128. }
  129. })
  130. this.chartBar.changeData(this.chartData)
  131. },
  132. renderPie(val){
  133. this.chartBar = new Bar('shippingUninvoiceAnalysisChart',{
  134. data:this.chartData,
  135. xField: 'value',
  136. yField: 'key',
  137. seriesField: 'type',
  138. legend: {
  139. position: 'top-left',
  140. },
  141. tooltip: {
  142. formatter: (datum) => {
  143. return {
  144. name:datum.key,
  145. value:'¥'+this.tool.formatAmount(datum.value,2)
  146. }
  147. }
  148. }
  149. })
  150. /*this.chartBar.on('plot:click',ev=>{
  151. const states = this.chartBar.getStates()
  152. this.param.content.where.uninvicetype = states.length === 0 ? '': ev.data.data.key
  153. this.param.content.pageNumber = 1
  154. this.queryTable(this.param.content.dataid)
  155. })*/
  156. this.chartBar.render()
  157. this.queryModel(val)
  158. },
  159. async queryTable(val){
  160. this.param.content.dataid = val || this.dataid
  161. const res = await this.$api.requested(this.param)
  162. this.list = res.data
  163. this.total = res.total
  164. this.currentPage = res.pageNumber
  165. },
  166. /*选择部门*/
  167. depSelect(val){
  168. this.param.content.type = 1
  169. this.param.content.dataid = val
  170. this.queryModel(val)
  171. },
  172. /*选择业务员*/
  173. personSelect(val){
  174. this.param.content.type = 0
  175. this.param.content.dataid = val
  176. this.queryModel(val)
  177. },
  178. handleSizeChange(val) {
  179. // console.log(`每页 ${val} 条`);
  180. this.param.content.pageSize = val
  181. this.queryTable(this.param.content.dataid)
  182. },
  183. handleCurrentChange(val) {
  184. // console.log(`当前页: ${val}`);
  185. this.param.content.pageNumber = val
  186. this.queryTable(this.param.content.dataid)
  187. },
  188. },
  189. created() {
  190. this.tablecols = this.tool.tabelCol(this.$route.name).shipmentUninvoicedTable.tablecols
  191. }
  192. }
  193. </script>
  194. <style scoped>
  195. </style>