guangFoInventory.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. <template>
  2. <div class="app-container">
  3. <div>
  4. <!-- 筛选条件 -->
  5. <Collapse :screen-form="searchForm">
  6. <template #right_btn>
  7. <el-button size="mini" @click="clearFn">清空</el-button>
  8. <el-button size="mini" type="primary" @click="searchFn">搜索</el-button>
  9. </template>
  10. <template #search>
  11. <el-form ref="searchForm" :model="searchForm" label-width="100px" size="mini" label-position="left">
  12. <el-row :gutter="20">
  13. <el-col :xs="24" :sm="12" :lg="6">
  14. <el-form-item label="仓库名称" prop="correspondName">
  15. <el-input v-model="searchForm.correspondName" placeholder="请输入经销商名称"></el-input>
  16. </el-form-item>
  17. </el-col>
  18. <el-col :xs="24" :sm="12" :lg="6">
  19. <el-form-item label="物料名称" prop="materialName">
  20. <el-input v-model="searchForm.materialName" placeholder="请输入经销商名称"></el-input>
  21. </el-form-item>
  22. </el-col>
  23. <el-col :xs="24" :sm="12" :lg="6">
  24. <el-form-item label="物料编码" prop="materialNumber">
  25. <el-input v-model="searchForm.materialNumber" placeholder="请输入经销商名称"></el-input>
  26. </el-form-item>
  27. </el-col>
  28. <el-col :xs="24" :sm="12" :lg="6">
  29. <el-form-item label="规格型号" prop="specification">
  30. <el-input v-model="searchForm.specification" placeholder="请输入经销商名称"></el-input>
  31. </el-form-item>
  32. </el-col>
  33. </el-row>
  34. </el-form>
  35. </template>
  36. </Collapse>
  37. <!-- 按钮 -->
  38. <div class="btn-group clearfix">
  39. <div class="fl"></div>
  40. <div class="fr">
  41. <div style="display: flex;">
  42. <ExportButton :exUrl="'stock/startAcc/stockExport'" :exParams="exParams" exText="导出一" />
  43. <div style="width:10px"></div>
  44. <ExportButton :exUrl="'stock/startAcc/stockExport2'" :exParams="exParams" exText="导出二" />
  45. <div style="width:10px"></div>
  46. <ExportButton :exUrl="'stock/startAcc/stockExport3'" :exParams="exParams" exText="导出三" />
  47. </div>
  48. </div>
  49. </div>
  50. <div class="mymain-container">
  51. <!-- 列表 -->
  52. <div class="table">
  53. <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit
  54. highlight-current-row stripe show-summary :summary-method="getSummaries">
  55. <el-table-column align="left" label="仓库名称" prop="stockName" min-width="160" show-overflow-tooltip>
  56. </el-table-column>
  57. <el-table-column align="left" label="存货类别" prop="categoryName" min-width="160" show-overflow-tooltip>
  58. </el-table-column>
  59. <el-table-column align="left" label="物料编码" prop="materialNumber" min-width="160" show-overflow-tooltip>
  60. </el-table-column>
  61. <el-table-column align="left" label="产品编码" prop="materialOldNumber" min-width="160" show-overflow-tooltip>
  62. </el-table-column>
  63. <el-table-column align="left" label="物料名称" prop="materialName" min-width="160" show-overflow-tooltip>
  64. </el-table-column>
  65. <el-table-column align="left" label="规格型号" prop="spec" min-width="160" show-overflow-tooltip>
  66. </el-table-column>
  67. <el-table-column align="left" label="广州可用数量" prop="gzOnNumber" min-width="160" show-overflow-tooltip>
  68. </el-table-column>
  69. <el-table-column align="left" label="佛山可用数量" prop="fsOnNumber" min-width="160" show-overflow-tooltip>
  70. </el-table-column>
  71. <el-table-column align="left" label="总可用数量" prop="allOnNumber" min-width="160" show-overflow-tooltip>
  72. </el-table-column>
  73. <el-table-column align="left" label="广州开单未提数量" prop="gzNeverNumber" min-width="160" show-overflow-tooltip>
  74. </el-table-column>
  75. <el-table-column align="left" label="佛山开单未提数量" prop="fsNeverNumber" min-width="160" show-overflow-tooltip>
  76. </el-table-column>
  77. <el-table-column align="left" label="总开单未提数量" prop="allNeverNumber" min-width="160" show-overflow-tooltip>
  78. </el-table-column>
  79. <el-table-column align="left" label="广州结存数量" prop="gzNumber" min-width="160" show-overflow-tooltip>
  80. </el-table-column>
  81. <el-table-column align="left" label="佛山结存数量" prop="fsNumber" min-width="160" show-overflow-tooltip>
  82. </el-table-column>
  83. <el-table-column align="left" label="总结存数量" prop="allNumber" min-width="160" show-overflow-tooltip>
  84. </el-table-column>
  85. </el-table>
  86. </div>
  87. <!-- 分页 -->
  88. <div class="fr">
  89. <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
  90. :current-page="currentPage" :page-sizes="[10, 20, 30, 50]" :page-size="pageSize"
  91. layout="total, sizes, prev, pager, next, jumper" :total="listTotal">
  92. </el-pagination>
  93. </div>
  94. </div>
  95. </div>
  96. </div>
  97. </template>
  98. <script>
  99. import { stockStartAccStock } from '@/api/guangFoInventory'
  100. export default {
  101. components: {},
  102. data() {
  103. return {
  104. currentPage: 1, // 当前页码
  105. pageSize: 10, // 每页数量
  106. listTotal: 0, // 列表
  107. listLoading: false, // 列表加载loading
  108. searchForm: {
  109. correspondName: '',
  110. materialName: '',
  111. materialNumber: '',
  112. specification: ''
  113. },
  114. dataList: [],
  115. statusList: [],
  116. currentStatus: ''
  117. }
  118. },
  119. computed: {
  120. exParams() {
  121. return {
  122. ...this.searchForm
  123. }
  124. }
  125. },
  126. async created() {
  127. await this.getList({ pageNumber: 1, pageSize: 10 })
  128. },
  129. methods: {
  130. // 更改每页数量
  131. handleSizeChange(val) {
  132. this.pageSize = val
  133. this.currentPage = 1
  134. this.getList({
  135. ...this.searchForm,
  136. pageNumber: this.currentPage,
  137. pageSize: this.pageSize
  138. })
  139. },
  140. // 更改当前页
  141. handleCurrentChange(val) {
  142. this.currentPage = val
  143. this.getList({
  144. ...this.searchForm,
  145. pageNumber: this.currentPage,
  146. pageSize: this.pageSize
  147. })
  148. },
  149. //搜索功能
  150. async searchFn() {
  151. this.currentPage = 1
  152. await this.getList({
  153. ...this.searchForm,
  154. pageNumber: this.currentPage,
  155. pageSize: this.pageSize
  156. })
  157. },
  158. //重置
  159. clearFn() {
  160. this.$refs.searchForm.resetFields()
  161. },
  162. //获取列表数据
  163. async getList(data) {
  164. const res = await stockStartAccStock(data)
  165. this.dataList = res.data.records
  166. this.listTotal = res.data.total
  167. },
  168. getSummaries(param) {
  169. const { columns, data } = param;
  170. const sums = [];
  171. columns.forEach((column, index) => {
  172. if (index < 6) {
  173. return;
  174. }
  175. const values = data.map(item => Number(item[column.property]));
  176. if (!values.every(value => isNaN(value))) {
  177. sums[index] = values.reduce((prev, curr) => {
  178. const value = Number(curr);
  179. if (!isNaN(value)) {
  180. return prev + curr;
  181. } else {
  182. return prev;
  183. }
  184. }, 0);
  185. sums[index];
  186. }
  187. });
  188. return sums;
  189. }
  190. }
  191. }
  192. </script>
  193. <style lang="scss" scoped>
  194. .selectStyle {
  195. width: 100%;
  196. }
  197. ::v-deep .el-textarea__inner {
  198. resize: none;
  199. }
  200. ::v-deep .el-form {
  201. .inputStyle {
  202. width: 80%;
  203. }
  204. }
  205. ::v-deep .dialog-footer {
  206. display: flex;
  207. justify-content: center;
  208. }
  209. ::v-deep .el-dialog__header {
  210. background-color: #dddddd;
  211. }
  212. .inp {
  213. margin: 0 12px;
  214. }
  215. .right {
  216. margin-top: 12px;
  217. float: right;
  218. }
  219. .table {
  220. margin-top: 12px;
  221. }
  222. .search {
  223. display: flex;
  224. margin-top: 12px;
  225. ::v-deep .el-input {
  226. width: 50%;
  227. margin-right: 12px;
  228. }
  229. }
  230. .import-btn {
  231. display: inline-block;
  232. margin-left: 10px;
  233. }
  234. </style>