reserved_stock.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. <template>
  2. <div class="app-container">
  3. <!-- 筛选条件 -->
  4. <div class="screen-container">
  5. <el-form ref="screenForm" :model="screenForm" label-width="90px" size="small" label-position="left">
  6. <el-row :gutter="20">
  7. <el-col :xs="24" :sm="12" :lg="6">
  8. <el-form-item label="产品大类" prop="type">
  9. <el-select v-model="screenForm.type" placeholder="请选择产品大类" clearable>
  10. <el-option v-for="item in typeList" :key="item.dictCode" :label="item.dictValue" :value="item.dictCode"></el-option>
  11. </el-select>
  12. </el-form-item>
  13. </el-col>
  14. <el-col :xs="24" :sm="12" :lg="6">
  15. <el-form-item label="产品名称" prop="goodsName">
  16. <el-input v-model="screenForm.goodsName" placeholder="请输入产品名称"></el-input>
  17. </el-form-item>
  18. </el-col>
  19. <el-col :xs="24" :sm="12" :lg="6">
  20. <el-form-item label="产品编码" prop="goodsNum">
  21. <el-input v-model="screenForm.goodsNum" placeholder="请输入产品编码"></el-input>
  22. </el-form-item>
  23. </el-col>
  24. <el-col :xs="24" :sm="12" :lg="6">
  25. <el-form-item label="规格型号" prop="model">
  26. <el-input v-model="screenForm.model" placeholder="请输入规格型号"></el-input>
  27. </el-form-item>
  28. </el-col>
  29. <el-col :xs="24" :sm="12" :lg="6">
  30. <el-form-item label="经销商编号" prop="jxsNum">
  31. <el-input v-model="screenForm.jxsNum" placeholder="请输入经销商编号"></el-input>
  32. </el-form-item>
  33. </el-col>
  34. <el-col :xs="24" :sm="12" :lg="6">
  35. <el-form-item label="经销商名称" prop="jxsName">
  36. <el-input v-model="screenForm.jxsName" placeholder="请输入经销商名称"></el-input>
  37. </el-form-item>
  38. </el-col>
  39. <el-col :xs="24" :sm="24" :lg="12" class="tr">
  40. <el-form-item label="">
  41. <el-button size="small" @click="resetScreenForm">清空</el-button>
  42. <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
  43. </el-form-item>
  44. </el-col>
  45. </el-row>
  46. </el-form>
  47. </div>
  48. <div class="mymain-container">
  49. <div class="btn-group clearfix">
  50. <div class="fr">
  51. <ExportButton :exUrl="'stock/manager/export'" :exParams="exParams" />
  52. </div>
  53. </div>
  54. <div class="table">
  55. <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
  56. <el-table-column align="left" label="经销商编码" prop="customerNumber" min-width="100" show-overflow-tooltip>
  57. <template slot-scope="scope">
  58. <CopyButton :copyText="scope.row.customerNumber" />
  59. <span>{{scope.row.customerNumber}}</span>
  60. </template>
  61. </el-table-column>
  62. <el-table-column align="left" label="经销商名称" prop="customerName" min-width="160" show-overflow-tooltip>
  63. <template slot-scope="scope">
  64. <CopyButton :copyText="scope.row.customerName" />
  65. <span>{{scope.row.customerName}}</span>
  66. </template>
  67. </el-table-column>
  68. <el-table-column align="left" label="产品品类" prop="categoryName" min-width="100" show-overflow-tooltip></el-table-column>
  69. <el-table-column align="left" label="物料编码" prop="materialNumber" min-width="120" show-overflow-tooltip>
  70. <template slot-scope="scope">
  71. <CopyButton :copyText="scope.row.materialNumber" />
  72. <span>{{scope.row.materialNumber}}</span>
  73. </template>
  74. </el-table-column>
  75. <el-table-column align="left" label="产品编码" prop="materialOldNumber" min-width="140" show-overflow-tooltip>
  76. <template slot-scope="scope">
  77. <CopyButton :copyText="scope.row.materialOldNumber" />
  78. <span>{{scope.row.materialOldNumber}}</span>
  79. </template>
  80. </el-table-column>
  81. <el-table-column align="left" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip>
  82. <template slot-scope="scope">
  83. <CopyButton :copyText="scope.row.materialName" />
  84. <span>{{scope.row.materialName}}</span>
  85. </template>
  86. </el-table-column>
  87. <el-table-column align="left" label="规格型号" prop="specification" min-width="180" show-overflow-tooltip>
  88. <template slot-scope="scope">
  89. <CopyButton :copyText="scope.row.specification" />
  90. <span>{{scope.row.specification}}</span>
  91. </template>
  92. </el-table-column>
  93. <el-table-column align="left" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
  94. <el-table-column align="left" label="经销商预留库存" prop="reservedNum" min-width="140" show-overflow-tooltip></el-table-column>
  95. <el-table-column align="left" label="经销商暂扣库存" prop="temporaryNum" min-width="140" show-overflow-tooltip></el-table-column>
  96. </el-table>
  97. </div>
  98. </div>
  99. <div class="pagination clearfix">
  100. <div class="fr">
  101. <el-pagination
  102. @size-change="handleSizeChange"
  103. @current-change="handleCurrentChange"
  104. :current-page="currentPage"
  105. :page-sizes="[10, 20, 30, 50]"
  106. :page-size="10"
  107. layout="total, sizes, prev, pager, next, jumper"
  108. :total="listTotal">
  109. </el-pagination>
  110. </div>
  111. </div>
  112. </div>
  113. </template>
  114. <script>
  115. import { getReservedList } from "@/api/stock";
  116. import { getDictList } from '@/api/common'
  117. export default {
  118. data() {
  119. return {
  120. currentPage: 1, // 当前页码
  121. pageSize: 10, // 每页数量
  122. listTotal: 0, // 列表总数
  123. dataList: null, // 列表数据
  124. listLoading: false, // 列表加载loading
  125. screenForm: { // 筛选表单数据
  126. type: '',
  127. goodsName: '',
  128. goodsNum: '',
  129. model: '',
  130. jxsName: '',
  131. jxsNum: '',
  132. },
  133. typeList: [],
  134. }
  135. },
  136. computed: {
  137. exParams() {
  138. return {
  139. materialName: this.screenForm.goodsName,
  140. materialNumber: this.screenForm.goodsNum,
  141. specification: this.screenForm.model,
  142. mainNumber: this.screenForm.type,
  143. customerName: this.screenForm.jxsName,
  144. customerNumber: this.screenForm.jxsNum,
  145. }
  146. },
  147. },
  148. created() {
  149. this.getDictList();
  150. this.getList();
  151. },
  152. methods: {
  153. // 查询按钮权限
  154. checkBtnRole(value) {
  155. // let btnRole = this.$route.meta.roles;
  156. // if(!btnRole) {return true}
  157. // let index = btnRole.indexOf(value);
  158. // return index >= 0;
  159. return true
  160. },
  161. getDictList() {
  162. getDictList({sysDictEnum: 'PRODUCT_TYPE'}).then(res => {
  163. this.typeList = res.data;
  164. })
  165. },
  166. // 查询列表
  167. getList() {
  168. this.listLoading = true;
  169. let params = {
  170. pageNum: this.currentPage,
  171. pageSize: this.pageSize,
  172. materialName: this.screenForm.goodsName,
  173. materialNumber: this.screenForm.goodsNum,
  174. specification: this.screenForm.model,
  175. mainNumber: this.screenForm.type,
  176. customerName: this.screenForm.jxsName,
  177. customerNumber: this.screenForm.jxsNum,
  178. };
  179. getReservedList(params).then((res) => {
  180. this.dataList = res.data.records;
  181. this.listTotal = res.data.total;
  182. this.listLoading = false;
  183. })
  184. },
  185. // 提交筛选表单
  186. submitScreenForm() {
  187. this.currentPage = 1;
  188. this.getList();
  189. },
  190. // 重置筛选表单
  191. resetScreenForm() {
  192. this.$refs.screenForm.resetFields();
  193. this.currentPage = 1;
  194. this.getList();
  195. },
  196. // 更改每页数量
  197. handleSizeChange(val) {
  198. this.pageSize = val;
  199. this.currentPage = 1;
  200. this.getList();
  201. },
  202. // 更改当前页
  203. handleCurrentChange(val) {
  204. this.currentPage = val;
  205. this.getList();
  206. },
  207. }
  208. }
  209. </script>
  210. <style lang="scss" scoped>
  211. </style>