shippingUninvoiceAnalysis.vue 7.8 KB

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