plan_list.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. <template>
  2. <div class="app-container">
  3. <!-- 筛选条件 -->
  4. <div class="screen-container">
  5. <el-form ref="screenForm" :model="screenForm" label-width="100px" 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="orderNum">
  9. <el-input v-model="screenForm.orderNum" placeholder="请输入采购计划单号"></el-input>
  10. </el-form-item>
  11. </el-col>
  12. <el-col :xs="24" :sm="12" :lg="6">
  13. <el-form-item label="产品名称" prop="chName">
  14. <el-input v-model="screenForm.chName" placeholder="请输入产品名称"></el-input>
  15. </el-form-item>
  16. </el-col>
  17. <el-col :xs="24" :sm="12" :lg="6">
  18. <el-form-item label="产品编码" prop="chNum">
  19. <el-input v-model="screenForm.chNum" placeholder="请输入产品编码"></el-input>
  20. </el-form-item>
  21. </el-col>
  22. <el-col :xs="24" :sm="12" :lg="6">
  23. <el-form-item label="规格型号" prop="model">
  24. <el-input v-model="screenForm.model" placeholder="请输入规格型号"></el-input>
  25. </el-form-item>
  26. </el-col>
  27. <el-col :xs="24" :sm="12" :lg="6">
  28. <el-form-item label="品类" prop="type">
  29. <el-select v-model="screenForm.type" placeholder="全部">
  30. <el-option label="全部" value=""></el-option>
  31. <el-option v-for="item in typeList" :key="item.dictCode" :label="item.dictValue" :value="item.dictCode"></el-option>
  32. </el-select>
  33. </el-form-item>
  34. </el-col>
  35. <el-col :xs="24" :sm="12" :lg="18" class="tr">
  36. <el-form-item label="">
  37. <el-button size="small" @click="resetScreenForm">清空</el-button>
  38. <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
  39. </el-form-item>
  40. </el-col>
  41. </el-row>
  42. </el-form>
  43. </div>
  44. <div class="mymain-container">
  45. <div class="btn-group clearfix">
  46. <div class="fr">
  47. <ExportButton :exUrl="'admin/user/mch/export'" :exParams="exParams" />
  48. </div>
  49. </div>
  50. <div class="table">
  51. <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
  52. <el-table-column align="center" label="单据号" prop="billNo" min-width="160" show-overflow-tooltip></el-table-column>
  53. <el-table-column align="center" label="销售类型" prop="saleName" min-width="160" show-overflow-tooltip></el-table-column>
  54. <el-table-column align="center" label="产品编码" prop="materialNumber" min-width="160" show-overflow-tooltip></el-table-column>
  55. <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
  56. <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
  57. <el-table-column align="center" label="计量单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
  58. <el-table-column align="center" label="数量" prop="number" min-width="100" show-overflow-tooltip></el-table-column>
  59. <el-table-column align="center" label="单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
  60. <el-table-column align="center" label="金额" prop="amount" min-width="100" show-overflow-tooltip></el-table-column>
  61. <el-table-column align="center" label="状态" prop="status" min-width="100" show-overflow-tooltip>
  62. <template slot-scope="scope">
  63. {{scope.row.status | statusFilter}}
  64. </template>
  65. </el-table-column>
  66. </el-table>
  67. </div>
  68. </div>
  69. <div class="pagination clearfix">
  70. <div class="fr">
  71. <el-pagination
  72. @size-change="handleSizeChange"
  73. @current-change="handleCurrentChange"
  74. :current-page="currentPage"
  75. :page-sizes="[10, 20, 30, 50]"
  76. :page-size="10"
  77. layout="total, sizes, prev, pager, next, jumper"
  78. :total="listTotal">
  79. </el-pagination>
  80. </div>
  81. </div>
  82. </div>
  83. </template>
  84. <script>
  85. import { getPlanList } from "@/api/supply/purchase";
  86. import { getDictList } from '@/api/common'
  87. export default {
  88. filters: {
  89. statusFilter(val) {
  90. const MAP = {
  91. 0: '待采购',
  92. 1: '已采购',
  93. }
  94. return MAP[val]
  95. }
  96. },
  97. data() {
  98. return {
  99. currentPage: 1, // 当前页码
  100. pageSize: 10, // 每页数量
  101. listTotal: 0, // 列表总数
  102. dataList: null, // 列表数据
  103. listLoading: false, // 列表加载loading
  104. screenForm: { // 筛选表单数据
  105. orderNum: '',
  106. chName: '',
  107. chNum: '',
  108. model: '',
  109. type: '',
  110. },
  111. typeList: [],
  112. }
  113. },
  114. computed: {
  115. exParams() {
  116. return {
  117. billNo: this.screenForm.orderNum,
  118. materialName: this.screenForm.chName,
  119. materialNumber: this.screenForm.chNum,
  120. specification: this.screenForm.model,
  121. materialType: this.screenForm.type,
  122. }
  123. },
  124. },
  125. created() {
  126. this.getDictList();
  127. this.getList();
  128. },
  129. methods: {
  130. // 查询按钮权限
  131. checkBtnRole(value) {
  132. // let btnRole = this.$route.meta.roles;
  133. // if(!btnRole) {return true}
  134. // let index = btnRole.indexOf(value);
  135. // return index >= 0;
  136. return true
  137. },
  138. getDictList() {
  139. getDictList({sysDictEnum: 'PRODUCT_TYPE'}).then(res => {
  140. this.typeList = res.data;
  141. })
  142. },
  143. // 查询列表
  144. getList() {
  145. this.listLoading = true;
  146. let params = {
  147. pageNum: this.currentPage,
  148. pageSize: this.pageSize,
  149. billNo: this.screenForm.orderNum,
  150. materialName: this.screenForm.chName,
  151. materialNumber: this.screenForm.chNum,
  152. specification: this.screenForm.model,
  153. materialType: this.screenForm.type,
  154. };
  155. getPlanList(params).then((res) => {
  156. this.dataList = res.data.records;
  157. this.listTotal = res.data.total;
  158. this.listLoading = false;
  159. })
  160. },
  161. // 提交筛选表单
  162. submitScreenForm() {
  163. this.currentPage = 1;
  164. this.getList();
  165. },
  166. // 重置筛选表单
  167. resetScreenForm() {
  168. this.$refs.screenForm.resetFields();
  169. this.currentPage = 1;
  170. this.getList();
  171. },
  172. // 更改每页数量
  173. handleSizeChange(val) {
  174. this.pageSize = val;
  175. this.currentPage = 1;
  176. this.getList();
  177. },
  178. // 更改当前页
  179. handleCurrentChange(val) {
  180. this.currentPage = val;
  181. this.getList();
  182. },
  183. }
  184. }
  185. </script>
  186. <style lang="scss" scoped>
  187. </style>