You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

164 lines
5.4 KiB

2 weeks ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <template>
  2. <div class="mod-config supplier-new-product-history">
  3. <el-form :inline="true" label-position="top" class="history-search-form" :model="searchData">
  4. <el-form-item label="ShortOffice">
  5. <el-input v-model.trim="searchData.shortOffice" clearable placeholder="ShortOffice" @keyup.enter.native="handleSearch" />
  6. </el-form-item>
  7. <el-form-item label="ShortNpc">
  8. <el-input v-model.trim="searchData.shortNpc" clearable placeholder="ShortNpc" @keyup.enter.native="handleSearch" />
  9. </el-form-item>
  10. <el-form-item label="基准料号">
  11. <el-input v-model.trim="searchData.basePartNo" clearable placeholder="基准料号" @keyup.enter.native="handleSearch" />
  12. </el-form-item>
  13. <el-form-item label="SKU">
  14. <el-input v-model.trim="searchData.sku" clearable placeholder="SKU" @keyup.enter.native="handleSearch" />
  15. </el-form-item>
  16. <el-form-item label="订单日期">
  17. <span class="history-date-pair">
  18. <el-date-picker v-model="searchData.orderDateStart" type="date" placeholder="Start Date"
  19. value-format="yyyy-MM-dd" style="width:130px" />
  20. <span class="history-date-sep">-</span>
  21. <el-date-picker v-model="searchData.orderDateEnd" type="date" placeholder="End Date"
  22. value-format="yyyy-MM-dd" style="width:130px" />
  23. </span>
  24. </el-form-item>
  25. <el-form-item label=" ">
  26. <el-button type="primary" :loading="loading" @click="handleSearch">查询</el-button>
  27. <el-button @click="resetSearch">重置</el-button>
  28. </el-form-item>
  29. </el-form>
  30. <el-table :data="rows" :height="tableHeight" border stripe v-loading="loading" style="width:100%">
  31. <el-table-column prop="shortOffice" label="ShortOffice" min-width="135" show-overflow-tooltip />
  32. <el-table-column prop="shortNpc" label="ShortNpc" min-width="135" show-overflow-tooltip />
  33. <el-table-column prop="basePartNo" label="基准料号" min-width="155" show-overflow-tooltip />
  34. <el-table-column prop="sku" label="SKU" min-width="155" show-overflow-tooltip />
  35. <el-table-column prop="partNo" label="物料号" min-width="175" show-overflow-tooltip />
  36. <el-table-column prop="firstOrderNo" label="首次订单号" min-width="145" show-overflow-tooltip />
  37. <el-table-column prop="itemNo" label="行号" min-width="70" align="center" />
  38. <el-table-column prop="oriOrderDate" label="订单日期" min-width="115" align="center" />
  39. <el-table-column prop="createTime" label="系统计算日期" min-width="175" align="center" />
  40. </el-table>
  41. <el-pagination
  42. :current-page="pageIndex"
  43. :page-size="pageSize"
  44. :page-sizes="[20, 50, 100, 200, 500]"
  45. :total="totalCount"
  46. layout="total, sizes, prev, pager, next, jumper"
  47. @size-change="sizeChangeHandle"
  48. @current-change="currentChangeHandle" />
  49. </div>
  50. </template>
  51. <script>
  52. import { searchSupplierNewProductHistoryPage } from '@/api/order/supplierNewProductHistory.js'
  53. const emptySearch = () => ({
  54. shortOffice: '',
  55. shortNpc: '',
  56. basePartNo: '',
  57. sku: '',
  58. orderDateStart: '',
  59. orderDateEnd: ''
  60. })
  61. export default {
  62. name: 'supplierNewProductHistory',
  63. data () {
  64. return {
  65. searchData: emptySearch(),
  66. rows: [],
  67. loading: false,
  68. pageIndex: 1,
  69. pageSize: 20,
  70. totalCount: 0,
  71. tableHeight: 400
  72. }
  73. },
  74. mounted () {
  75. this.updateTableHeight()
  76. window.addEventListener('resize', this.updateTableHeight)
  77. this.getDataList()
  78. },
  79. beforeDestroy () {
  80. window.removeEventListener('resize', this.updateTableHeight)
  81. },
  82. methods: {
  83. updateTableHeight () {
  84. this.tableHeight = Math.max(300, window.innerHeight - 250)
  85. },
  86. handleSearch () {
  87. const { orderDateStart, orderDateEnd } = this.searchData
  88. if (orderDateStart && orderDateEnd && orderDateStart > orderDateEnd) {
  89. this.$message.warning('订单日期开始不能晚于结束')
  90. return
  91. }
  92. this.pageIndex = 1
  93. this.getDataList()
  94. },
  95. resetSearch () {
  96. this.searchData = emptySearch()
  97. this.pageIndex = 1
  98. this.getDataList()
  99. },
  100. getDataList () {
  101. this.loading = true
  102. searchSupplierNewProductHistoryPage({
  103. ...this.searchData,
  104. page: this.pageIndex,
  105. limit: this.pageSize
  106. }).then(({ data }) => {
  107. if (!data || data.code !== 0) {
  108. this.$message.error((data && data.msg) || '查询失败')
  109. this.rows = []
  110. this.totalCount = 0
  111. return
  112. }
  113. const page = data.page || {}
  114. this.rows = page.list || []
  115. this.totalCount = page.totalCount || 0
  116. }).catch(err => {
  117. this.rows = []
  118. this.totalCount = 0
  119. this.$message.error((err && err.message) || '查询失败')
  120. }).finally(() => {
  121. this.loading = false
  122. })
  123. },
  124. sizeChangeHandle (size) {
  125. this.pageSize = size
  126. this.pageIndex = 1
  127. this.getDataList()
  128. },
  129. currentChangeHandle (page) {
  130. this.pageIndex = page
  131. this.getDataList()
  132. }
  133. }
  134. }
  135. </script>
  136. <style scoped>
  137. .history-search-form {
  138. display: flex;
  139. flex-wrap: wrap;
  140. align-items: flex-start;
  141. gap: 2px 12px;
  142. margin-bottom: 12px;
  143. }
  144. .history-search-form /deep/ .el-form-item {
  145. margin: 0;
  146. }
  147. .history-search-form /deep/ .el-input {
  148. width: 130px;
  149. }
  150. .history-date-pair {
  151. display: inline-flex;
  152. align-items: center;
  153. }
  154. .history-date-sep {
  155. width: 12px;
  156. text-align: center;
  157. }
  158. </style>