interior-statistics.vue 8.4 KB

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