reserved_stock.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. <template>
  2. <div class="app-container">
  3. <!-- 筛选条件 -->
  4. <div class="screen-container">
  5. <div class="top clearfix">
  6. <div class="title fl">条件筛选</div>
  7. </div>
  8. <el-form ref="screenForm" :model="screenForm" label-width="70px" size="small" label-position="left">
  9. <el-row :gutter="20">
  10. <el-col :xs="24" :sm="12" :lg="6">
  11. <el-form-item label="品类" prop="category">
  12. <el-select v-model="screenForm.category" placeholder="全部">
  13. <el-option label="全部" value=""></el-option>
  14. <el-option :label="item.label" :value="item.value" v-for="(item, index) in select_status" :key="index"></el-option>
  15. </el-select>
  16. </el-form-item>
  17. </el-col>
  18. <el-col :xs="24" :sm="12" :lg="6">
  19. <el-form-item label="销售类型" prop="saleType">
  20. <el-select v-model="screenForm.saleType" placeholder="全部">
  21. <el-option label="全部" value=""></el-option>
  22. <el-option :label="item.label" :value="item.value" v-for="(item, index) in select_status" :key="index"></el-option>
  23. </el-select>
  24. </el-form-item>
  25. </el-col>
  26. <el-col :xs="24" :sm="12" :lg="6">
  27. <el-form-item label="产品名称" prop="name">
  28. <el-input v-model="screenForm.name" placeholder="请输入产品名称"></el-input>
  29. </el-form-item>
  30. </el-col>
  31. <el-col :xs="24" :sm="12" :lg="6">
  32. <el-form-item label="产品编码" prop="code">
  33. <el-input v-model="screenForm.code" placeholder="请输入产品编码"></el-input>
  34. </el-form-item>
  35. </el-col>
  36. <el-col :xs="24" :sm="12" :lg="6">
  37. <el-form-item label="规格型号" prop="model">
  38. <el-input v-model="screenForm.model" placeholder="请输入规格型号"></el-input>
  39. </el-form-item>
  40. </el-col>
  41. <el-col :xs="24" :sm="12" :lg="18" class="tr">
  42. <el-form-item label="">
  43. <el-button size="small" @click="resetScreenForm">清空</el-button>
  44. <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
  45. </el-form-item>
  46. </el-col>
  47. </el-row>
  48. </el-form>
  49. </div>
  50. <div class="mymain-container">
  51. <div class="btn-group clearfix">
  52. <div class="fr">
  53. <el-button size="small" type="primary" icon="el-icon-download" @click="handleExport">导出数据</el-button>
  54. </div>
  55. </div>
  56. <div class="table">
  57. <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
  58. <el-table-column align="center" label="经销商编码" prop="aaa" min-width="160" show-overflow-tooltip></el-table-column>
  59. <el-table-column align="center" label="经销商名称" prop="aaa" min-width="160" show-overflow-tooltip></el-table-column>
  60. <el-table-column align="center" label="产品品类" prop="aaa" min-width="160" show-overflow-tooltip></el-table-column>
  61. <el-table-column align="center" label="销售类型" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
  62. <el-table-column align="center" label="产品编码" prop="aaa" min-width="160" show-overflow-tooltip></el-table-column>
  63. <el-table-column align="center" label="产品名称" prop="aaa" min-width="160" show-overflow-tooltip></el-table-column>
  64. <el-table-column align="center" label="规格型号" prop="aaa" min-width="160" show-overflow-tooltip></el-table-column>
  65. <el-table-column align="center" label="销售类型" prop="aaa" min-width="160" show-overflow-tooltip></el-table-column>
  66. <el-table-column align="center" label="计量单位" prop="aaa" min-width="160" show-overflow-tooltip></el-table-column>
  67. <el-table-column align="center" label="单价" prop="aaa" min-width="200" show-overflow-tooltip></el-table-column>
  68. <el-table-column align="center" label="经销商预留库存" prop="aaa" min-width="200" show-overflow-tooltip></el-table-column>
  69. <el-table-column align="center" label="经销商暂扣库存" prop="aaa" min-width="200" show-overflow-tooltip></el-table-column>
  70. </el-table>
  71. </div>
  72. </div>
  73. <div class="pagination clearfix">
  74. <div class="fr">
  75. <el-pagination
  76. @size-change="handleSizeChange"
  77. @current-change="handleCurrentChange"
  78. :current-page="currentPage"
  79. :page-sizes="[10, 20, 30, 50]"
  80. :page-size="10"
  81. layout="total, sizes, prev, pager, next, jumper"
  82. :total="listTotal">
  83. </el-pagination>
  84. </div>
  85. </div>
  86. </div>
  87. </template>
  88. <script>
  89. import { COMMON_SELECT } from '@/utils/select_data'
  90. import { getStockList } from "@/api/stock";
  91. import { downloadFiles } from '@/utils/util'
  92. export default {
  93. data() {
  94. return {
  95. currentPage: 1, // 当前页码
  96. pageSize: 10, // 每页数量
  97. listTotal: 0, // 列表总数
  98. dataList: null, // 列表数据
  99. listLoading: false, // 列表加载loading
  100. screenForm: { // 筛选表单数据
  101. warehouse: '',
  102. name: '',
  103. code: '',
  104. model: '',
  105. category: '',
  106. saleType: '',
  107. },
  108. select_status: [ // 筛选字段 - 状态
  109. { label: '正常', value: true },
  110. { label: '冻结', value: false }
  111. ],
  112. }
  113. },
  114. created() {
  115. this.getList();
  116. },
  117. methods: {
  118. // 查询按钮权限
  119. checkBtnRole(value) {
  120. // let btnRole = this.$route.meta.roles;
  121. // if(!btnRole) {return true}
  122. // let index = btnRole.indexOf(value);
  123. // return index >= 0;
  124. return true
  125. },
  126. // 查询列表
  127. getList() {
  128. this.listLoading = true;
  129. let params = {
  130. pageNum: this.currentPage,
  131. pageSize: this.pageSize,
  132. userName: this.screenForm.account,
  133. nickName: this.screenForm.nickName,
  134. linkPhone: this.screenForm.phone,
  135. email: this.screenForm.email,
  136. status: this.screenForm.status,
  137. };
  138. getStockList(params).then((res) => {
  139. this.dataList = res.data.records;
  140. this.listTotal = res.data.total;
  141. this.listLoading = false;
  142. })
  143. },
  144. // 提交筛选表单
  145. submitScreenForm() {
  146. this.currentPage = 1;
  147. this.getList();
  148. },
  149. // 重置筛选表单
  150. resetScreenForm() {
  151. this.$refs.screenForm.resetFields();
  152. this.currentPage = 1;
  153. this.getList();
  154. },
  155. // 更改每页数量
  156. handleSizeChange(val) {
  157. this.pageSize = val;
  158. this.currentPage = 1;
  159. this.getList();
  160. },
  161. // 更改当前页
  162. handleCurrentChange(val) {
  163. this.currentPage = val;
  164. this.getList();
  165. },
  166. // 导出
  167. handleExport() {
  168. let screenData = {
  169. userName: this.screenForm.account,
  170. nickName: this.screenForm.nickName,
  171. linkPhone: this.screenForm.phone,
  172. email: this.screenForm.email,
  173. status: this.screenForm.status,
  174. };
  175. downloadFiles('admin/user/mch/export', screenData);
  176. },
  177. }
  178. }
  179. </script>
  180. <style lang="scss" scoped>
  181. </style>