interior-statistics.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. <template>
  2. <!-- 订单内部统计表-->
  3. <div id="interiorStatistics">
  4. <!-- 查询区域 -->
  5. <a-card :bordered="false">
  6. <div class="table-page-search-wrapper">
  7. <a-form layout="inline" @keyup.enter.native="searchQuery">
  8. <a-row :gutter="24">
  9. <a-col :md="6" :sm="8">
  10. <a-form-item label="开始年月">
  11. <!-- :disabled-date="disabledDate" 不可选择的日期 -->
  12. <a-month-picker
  13. placeholder="请选择开始年月"
  14. format="YYYY-MM"
  15. style="width:100%;"
  16. v-model="queryParam.startYearMonth"
  17. />
  18. </a-form-item>
  19. </a-col>
  20. <a-col :md="6" :sm="8">
  21. <a-form-item label="结束年月">
  22. <a-month-picker
  23. placeholder="请选择结束年月"
  24. format="YYYY-MM"
  25. style="width:100%;"
  26. v-model="queryParam.endYearMonth"
  27. />
  28. </a-form-item>
  29. </a-col>
  30. <a-col :md="6" :sm="8">
  31. <a-form-item label="部门">
  32. <a-input placeholder="请输入订单号" v-model="queryParam.department"></a-input>
  33. <!-- <a-select placeholder="请选择部门" v-model="queryParam.department">
  34. <a-select-option :value="''">请选择</a-select-option>
  35. <a-select-option :value="0">业务一部</a-select-option>
  36. <a-select-option :value="1">业务二部</a-select-option>
  37. <a-select-option :value="2">业务三部</a-select-option>
  38. <a-select-option :value="2">业务四部</a-select-option>
  39. </a-select> -->
  40. </a-form-item>
  41. </a-col>
  42. <template v-if="toggleSearchStatus">
  43. <a-col :md="6" :sm="8">
  44. <a-form-item label="客户">
  45. <a-select placeholder="请选择客户" v-model="queryParam.customer">
  46. <a-select-option :value="''">请选择</a-select-option>
  47. <a-select-option :value="0">FD</a-select-option>
  48. <a-select-option :value="1">PMK</a-select-option>
  49. <a-select-option :value="2">AUCHAN</a-select-option>
  50. <a-select-option :value="2">BIOWORLD</a-select-option>
  51. </a-select>
  52. </a-form-item>
  53. </a-col>
  54. </template>
  55. <a-col :md="6" :sm="8">
  56. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  57. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  58. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  59. <a @click="handleToggleSearch" style="margin-left: 8px">
  60. {{ toggleSearchStatus ? '收起' : '展开' }}
  61. <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
  62. </a>
  63. </span>
  64. </a-col>
  65. </a-row>
  66. </a-form>
  67. </div>
  68. </a-card>
  69. <!-- 引入 echarts -->
  70. <a-card :bordered="false" style="marginTop:10px;">
  71. <div class="chart">
  72. <!-- 部门 "-->
  73. <div class="departmentChart" style="background:rgba(255, 165, 0,.08);">
  74. <departmentChart />
  75. </div>
  76. <!-- 客户 -->
  77. <div class="customerChart" style="background:rgba(134, 151, 201,.08);">
  78. <customerChart />
  79. </div>
  80. </div>
  81. </a-card>
  82. <!-- table rowKey="id" :scroll="{ x: 1500 }"-->
  83. <a-card :bordered="false" style="marginTop:10px;">
  84. <a-table
  85. bordered
  86. :row-key="record => record.id"
  87. :columns="interiorColumns"
  88. :data-source="interiorData"
  89. :loading="loading"
  90. :pagination="pagination"
  91. @change="handleTableChange"
  92. >
  93. </a-table>
  94. </a-card>
  95. </div>
  96. </template>
  97. <script>
  98. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  99. import JEllipsis from '@/components/jeecg/JEllipsis'
  100. import moment from 'moment'
  101. import departmentChart from '@views/reportForms/order-statistics/chart/interior/departmentChart'
  102. import customerChart from '@views/reportForms/order-statistics/chart/interior/customerChart.vue'
  103. // import { external } from '@api/reportForms/order-statistics.js'
  104. export default {
  105. name: 'InteriorStatistics', // 订单内部统计表
  106. mixins: [JeecgListMixin],
  107. components: { JEllipsis, moment, departmentChart, customerChart },
  108. data() {
  109. // let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} /> // 省略
  110. return {
  111. interiorColumns: [
  112. {
  113. title: '部门',
  114. width: 140,
  115. dataIndex: 'department',
  116. // fixed: 'left',
  117. className: 'replacecolor'
  118. },
  119. {
  120. title: '供应商分类',
  121. width: 120,
  122. dataIndex: 'supplierType',
  123. className: 'replacecolor'
  124. // customRender: function(text) {
  125. // if (text == '1') {
  126. // return '销售类型1'
  127. // }
  128. // if (text == '2') {
  129. // return '销售类型2'
  130. // }
  131. // if (text == '3') {
  132. // return '销售类型3'
  133. // }
  134. // if (text == '4') {
  135. // return '销售类型4'
  136. // }
  137. // }
  138. },
  139. {
  140. title: '供应商',
  141. width: 140,
  142. dataIndex: 'supplier',
  143. className: 'replacecolor'
  144. },
  145. {
  146. title: '计划到货月份',
  147. width: 120,
  148. dataIndex: 'planDeliveryMonth',
  149. customRender: text => {
  150. return moment(text).format('YYYY-MM')
  151. },
  152. className: 'replacecolor'
  153. },
  154. { title: '含税单价', width: 120, dataIndex: 'priceInTax', className: 'replacecolor' },
  155. {
  156. title: '实际数量',
  157. width: 120,
  158. dataIndex: 'realQuantity',
  159. className: 'replacecolor'
  160. },
  161. { title: '本币金额', width: 150, dataIndex: 'LocalMoney', className: 'replacecolor' }
  162. ],
  163. interiorData: [
  164. {
  165. department: '业务八部',
  166. supplierType: '成衣厂',
  167. supplier: '国云森',
  168. planDeliveryMonth: '2021-04',
  169. priceInTax: '87.89',
  170. realQuantity: '90,120,0000',
  171. LocalMoney: '301,929,04'
  172. }
  173. ],
  174. loading: false, // 表格加载
  175. // 查询条件
  176. queryParam: {
  177. vendorType: '内部',
  178. startYearMonth: '',
  179. endYearMonth: '',
  180. department: '',
  181. customer: ''
  182. },
  183. pagination: {
  184. // total: '', //总条数
  185. // current: '', //当前页
  186. // pageSize: '' //一页多少
  187. },
  188. dateFormat: 'YYYY-MM-DD'
  189. }
  190. },
  191. created() {
  192. this.getInteriorData()
  193. },
  194. methods: {
  195. getInteriorData() {
  196. this.$nextTick(() => {
  197. // external(this.queryParam).then(res => {
  198. // if (res.success) {
  199. // this.interiorData = res.result.records
  200. // console.log('订单外部列表', this.interiorData)
  201. // this.pagination = {
  202. // total: res.result.total,
  203. // current: res.result.current,
  204. // pageSize: res.result.size
  205. // }
  206. // // console.log('分页器赋值:', this.pagination.total, this.pagination.current, this.pagination.pageSize)
  207. // }
  208. // })
  209. })
  210. },
  211. searchQuery() {
  212. this.getInteriorData()
  213. },
  214. searchReset() {
  215. this.queryParam = {}
  216. this.getInteriorData()
  217. },
  218. handleTableChange(pagination, filters, sorter) {
  219. this.queryParam.pageNo = pagination.current
  220. this.getInteriorData()
  221. }
  222. },
  223. computed: {},
  224. mounted() {}
  225. }
  226. </script>
  227. <style lang="less" scoped>
  228. @import '~@assets/less/common.less';
  229. @import '~@assets/less/overwriter.less';
  230. /deep/ .ant-table-thead > tr > th {
  231. text-align: center;
  232. // font-weight: 700;
  233. }
  234. /deep/ .ant-table-tbody {
  235. text-align: center;
  236. }
  237. // /deep/ th.replacecolor {
  238. // background-color: #ccc;
  239. // }
  240. .departmentChart {
  241. margin-bottom: 20px;
  242. }
  243. </style>