interior-statistics.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  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: 'cDepName',
  104. className: 'replacecolor'
  105. },
  106. {
  107. title: '供应商分类',
  108. width: 120,
  109. dataIndex: 'cCusCode',
  110. className: 'replacecolor'
  111. // customRender: function(text) {
  112. // if (text == '1') {
  113. // return '销售类型1'
  114. // }
  115. // if (text == '2') {
  116. // return '销售类型2'
  117. // }
  118. // if (text == '3') {
  119. // return '销售类型3'
  120. // }
  121. // if (text == '4') {
  122. // return '销售类型4'
  123. // }
  124. // }
  125. },
  126. {
  127. title: '供应商',
  128. width: 140,
  129. dataIndex: 'cVenAbbName',
  130. className: 'replacecolor'
  131. },
  132. {
  133. title: '计划到货月份',
  134. width: 120,
  135. dataIndex: 'yearMonth',
  136. customRender: text => {
  137. return moment(text).format('YYYY-MM')
  138. },
  139. className: 'replacecolor'
  140. },
  141. { title: '含税单价', width: 120, dataIndex: 'iNatUnitPrice', className: 'replacecolor' },
  142. {
  143. title: '实际数量',
  144. width: 120,
  145. dataIndex: 'iQuantity',
  146. className: 'replacecolor'
  147. },
  148. { title: '本币金额', width: 150, dataIndex: 'iNatMoney', className: 'replacecolor' }
  149. ],
  150. interiorData: [
  151. {
  152. department: '业务八部',
  153. supplierType: '成衣厂',
  154. supplier: '国云森',
  155. planDeliveryMonth: '2021-04',
  156. priceInTax: '87.89',
  157. realQuantity: '90,120,0000',
  158. LocalMoney: '301,929,04'
  159. }
  160. ],
  161. loading: false, // 表格加载
  162. // 查询条件
  163. queryParam: {
  164. vendorType: '内部',
  165. startYearMonth: '',
  166. endYearMonth: '',
  167. department: '',
  168. customer: ''
  169. },
  170. pagination: {
  171. // total: '', //总条数
  172. // current: '', //当前页
  173. // pageSize: '' //一页多少
  174. },
  175. mode2: ['month', 'month'],
  176. value: [], //起始月份
  177. dateFormat: 'YYYY-MM-DD'
  178. }
  179. },
  180. created() {
  181. this.getInteriorData()
  182. },
  183. methods: {
  184. getInteriorData() {
  185. this.$nextTick(() => {
  186. // external(this.queryParam).then(res => {
  187. // if (res.success) {
  188. // this.interiorData = res.result.records
  189. // console.log('订单外部列表', this.interiorData)
  190. // this.pagination = {
  191. // total: res.result.total,
  192. // current: 1,
  193. // pageSize: res.result.size
  194. // }
  195. // // console.log('分页器赋值:', this.pagination.total, this.pagination.current, this.pagination.pageSize)
  196. // }
  197. // })
  198. })
  199. },
  200. // 日期面板变化时的回调
  201. handlePanelChange(value, mode) {
  202. this.value = value
  203. this.mode2 = [mode[0] === 'date' ? 'month' : mode[0], mode[1] === 'date' ? 'month' : mode[1]]
  204. // console.log('this.mode2', this.mode2)
  205. this.queryParam.startYearMonth = value[0].format('YYYY-MM')
  206. this.queryParam.endYearMonth = value[1].format('YYYY-MM')
  207. console.log('开始年月:', this.queryParam.startYearMonth)
  208. console.log('结束年月:', this.queryParam.endYearMonth)
  209. setFieldsValue({
  210. timeRange: value
  211. })
  212. },
  213. // 时间发生变化的回调,发生在用户选择时间时
  214. monthChange(value) {
  215. this.value = value
  216. console.log('what------monthChange')
  217. },
  218. searchQuery() {
  219. this.getInteriorData()
  220. },
  221. searchReset() {
  222. this.queryParam = {}
  223. this.value = [] //起始年月重置
  224. this.getInteriorData()
  225. },
  226. handleTableChange(pagination, filters, sorter) {
  227. this.queryParam.pageNo = pagination.current
  228. this.getInteriorData()
  229. }
  230. },
  231. computed: {},
  232. mounted() {}
  233. }
  234. </script>
  235. <style lang="less" scoped>
  236. @import '~@assets/less/common.less';
  237. @import '~@assets/less/overwriter.less';
  238. /deep/ .ant-table-thead > tr > th {
  239. text-align: center;
  240. // font-weight: 700;
  241. }
  242. /deep/ .ant-table-tbody {
  243. text-align: center;
  244. }
  245. // /deep/ th.replacecolor {
  246. // background-color: #ccc;
  247. // }
  248. .departmentChart {
  249. margin-bottom: 20px;
  250. }
  251. </style>