supply-capacity-table.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. <template>
  2. <!-- 供应商产能报表 -->
  3. <div id="supplyCapacityTable">
  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-input placeholder="请输入订单号" v-model="queryParam.csrccode"></a-input>
  12. </a-form-item>
  13. </a-col>
  14. <a-col :md="6" :sm="8">
  15. <a-form-item label="开始日期">
  16. <a-date-picker
  17. placeholder="请选择开始日期"
  18. style="width: 100%"
  19. format="YYYY-MM"
  20. v-model="queryParam.startDate"
  21. ></a-date-picker>
  22. </a-form-item>
  23. </a-col>
  24. <a-col :md="6" :sm="8">
  25. <a-form-item label="结束日期">
  26. <a-date-picker
  27. placeholder="请选择结束日期"
  28. style="width: 100%"
  29. format="YYYY-MM"
  30. v-model="queryParam.endDate"
  31. ></a-date-picker>
  32. </a-form-item>
  33. </a-col>
  34. <template v-if="toggleSearchStatus">
  35. <a-col :md="6" :sm="8">
  36. <a-form-item label="订单类型">
  37. <a-input placeholder="请输入订单类型" v-model="queryParam.iOrderType"></a-input>
  38. </a-form-item>
  39. </a-col>
  40. <a-col :md="6" :sm="8">
  41. <a-form-item label="供应商">
  42. <a-input placeholder="请输入供应商" v-model="queryParam.cVenCode"></a-input>
  43. </a-form-item>
  44. </a-col>
  45. <a-col :md="6" :sm="8">
  46. <a-form-item label="计划单号">
  47. <a-input placeholder="请输入计划单号" v-model="queryParam.cPlanLotNumber"></a-input>
  48. </a-form-item>
  49. </a-col>
  50. </template>
  51. <a-col :md="6" :sm="8">
  52. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  53. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  54. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  55. <a @click="handleToggleSearch" style="margin-left: 8px">
  56. {{ toggleSearchStatus ? '收起' : '展开' }}
  57. <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
  58. </a>
  59. </span>
  60. </a-col>
  61. </a-row>
  62. </a-form>
  63. </div>
  64. </a-card>
  65. <!-- 操作按钮区域 -->
  66. <a-card :bordered="false" style="marginTop:10px;">
  67. <div class="table-operator">
  68. <a-button type="primary" @click="handleExportXls('供应链产能报表')" icon="download">合并导出</a-button>
  69. <a-button type="primary" @click="monthSupplyExport" icon="download">月份供应商合计导出</a-button>
  70. <a-button type="primary" @click="monthDepartExport" icon="download">月份部门合计导出</a-button>
  71. </div>
  72. <!-- 合计 table rowKey="id" :scroll="{ x: 1500 }" :pagination="ipagination -->
  73. <a-table
  74. bordered
  75. :row-key="record => record.id"
  76. :columns="supplyCapacityColumns"
  77. :data-source="supplyCapacityData"
  78. :loading="loading"
  79. :pagination="pagination"
  80. @change="handleTableChange"
  81. >
  82. </a-table>
  83. </a-card>
  84. </div>
  85. </template>
  86. <script>
  87. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  88. import JEllipsis from '@/components/jeecg/JEllipsis'
  89. import moment from 'moment'
  90. import { supplyCapList, handleXls, monthSupplyXls, monthDepartXls } from '@api/reportForms/supply-capacity-table'
  91. export default {
  92. name: 'SupplyCapacityTable', // 供应商产能报表
  93. mixins: [JeecgListMixin],
  94. components: { JEllipsis, moment },
  95. data() {
  96. // let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} /> // 省略
  97. return {
  98. description: '供应商产能报表',
  99. supplyCapacityColumns: [
  100. {
  101. title: '订单号',
  102. width: 120,
  103. dataIndex: 'csrccode',
  104. className: 'replacecolor'
  105. },
  106. {
  107. title: '计划单号',
  108. width: 120,
  109. dataIndex: 'cPlanLotNumber',
  110. className: 'replacecolor'
  111. },
  112. { title: '部门', width: 120, dataIndex: 'cDepCode', className: 'replacecolor' },
  113. { title: '业务员', width: 120, dataIndex: 'cPersonCode', className: 'replacecolor' },
  114. { title: '供应商', width: 120, dataIndex: 'cVenCode', className: 'replacecolor' },
  115. // customRender: function(text) {
  116. // if (text == '1') {
  117. // return '销售类型1'
  118. // }
  119. // if (text == '2') {
  120. // return '销售类型2'
  121. // }
  122. // if (text == '3') {
  123. // return '销售类型3'
  124. // }
  125. // if (text == '4') {
  126. // return '销售类型4'
  127. // }
  128. // }
  129. { title: '供应商类型', width: 120, dataIndex: 'cVenCodeType', className: 'replacecolor' },
  130. { title: '订单类型', width: 120, dataIndex: 'iOrderType', className: 'replacecolor' },
  131. {
  132. title: '数量',
  133. width: 120,
  134. dataIndex: 'iQuantity',
  135. className: 'replacecolor'
  136. },
  137. { title: '累计入库数量', width: 120, dataIndex: 'iReceivedQTY', className: 'replacecolor' },
  138. { title: '单位', width: 100, dataIndex: 'unit', className: 'replacecolor' },
  139. {
  140. title: '计划到货月份',
  141. width: 120,
  142. dataIndex: 'arriveMonth',
  143. // customRender: text => {
  144. // return moment(text).format('YYYY-MM')
  145. // },
  146. className: 'replacecolor'
  147. },
  148. {
  149. title: '计划到货日期',
  150. width: 120,
  151. dataIndex: 'planDeliveryData',
  152. // customRender: text => {
  153. // return moment(text).format('YYYY-MM-DD')
  154. // },
  155. className: 'replacecolor'
  156. },
  157. { title: '系数', width: 100, dataIndex: 'coefficient', className: 'replacecolor' }
  158. ],
  159. supplyCapacityData: [],
  160. loading: false, // 表格加载
  161. // 查询条件
  162. queryParam: {
  163. csrccode: '',
  164. startDate: '',
  165. endDate: '',
  166. iOrderType: '',
  167. cVenCode: '',
  168. cPlanLotNumber: '',
  169. pageNo: '' // 当前页
  170. },
  171. // 分页
  172. pagination: {
  173. // total: '',
  174. // current: 0,
  175. // pageSize: 0
  176. },
  177. dateFormat: 'YYYY-MM-DD'
  178. }
  179. },
  180. created() {
  181. this.getSupplyCapList() // 渲染 供应链产能报表
  182. console.log('000')
  183. },
  184. methods: {
  185. // 供应商产能数据
  186. getSupplyCapList() {
  187. this.$nextTick(() => {
  188. supplyCapList(this.queryParam).then(res => {
  189. console.log('111')
  190. if (res.success) {
  191. console.log('222')
  192. this.supplyCapacityData = res.result.records
  193. console.log('【供应商产能报表数据】:', this.supplyCapacityData)
  194. this.pagination = {
  195. total: res.result.total,
  196. current: res.result.current,
  197. pageSize: res.result.size
  198. }
  199. }
  200. })
  201. })
  202. },
  203. //合并导出
  204. handleExportXls() {
  205. handleXls().then(res => {
  206. console.log('合并导出ok')
  207. })
  208. },
  209. // 月份供应链合计导出
  210. monthSupplyExport() {
  211. monthSupplyXls().then(res => {
  212. console.log('月份供应链合计导出ok')
  213. })
  214. },
  215. // 月份部门合计导出
  216. monthDepartExport() {
  217. monthDepartXls().then(res => {
  218. console.log('月份部门合计导出ok')
  219. })
  220. },
  221. // 查询按钮
  222. searchQuery() {
  223. this.getSupplyCapList()
  224. },
  225. searchReset() {
  226. this.queryParam = {}
  227. this.getSupplyCapList()
  228. },
  229. // 分页变化时触发
  230. handleTableChange(pagination, filters, sorter) {
  231. console.log('分页器信息', pagination)
  232. if (Object.keys(sorter).length > 0) {
  233. this.isorter.column = sorter.field
  234. this.isorter.order = sorter.order == 'ascend' ? 'asc' : 'desc'
  235. }
  236. this.queryParam.pageNo = pagination.current
  237. this.getSupplyCapList()
  238. }
  239. }
  240. }
  241. </script>
  242. <style lang="less" scoped>
  243. @import '~@assets/less/common.less';
  244. @import '~@assets/less/overwriter.less';
  245. /deep/ .ant-table-thead > tr > th {
  246. text-align: center;
  247. // font-weight: 700;
  248. }
  249. /deep/ .ant-table-tbody {
  250. text-align: center;
  251. }
  252. // /deep/ th.replacecolor {
  253. // background-color: #ccc;
  254. // }
  255. /deep/ .ant-table-footer .ant-table.body {
  256. // overflow: hidden !important;
  257. }
  258. /deep/ .ant-table.ant-table-bordered .ant-table-footer {
  259. border: none;
  260. padding: 0;
  261. }
  262. </style>