productItem.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <template>
  2. <div class="bgcolor">
  3. <div class="navBarTOP" >
  4. <van-nav-bar class="navBar" title="产品列表" left-arrow @click-left="onClickLeft">
  5. <template #right>
  6. </template>
  7. </van-nav-bar>
  8. </div>
  9. <div class="lineGrey"></div>
  10. <div class="lineGrey"></div>
  11. <div class="lineGrey"></div>
  12. <div class="lineGrey"></div>
  13. <div class="lineGrey"></div>
  14. <div class="container" style="width: 100%; margin: 0 auto;">
  15. <div v-for="item in list">
  16. <p style="font-weight: bold;font-size: 14px">&nbsp;&nbsp;&nbsp;{{item.m01Name}}</p>
  17. <el-table :data="item.productDetailList" border style="width: 100%" >
  18. <el-table-column label="物料名称" prop="productName" />
  19. <el-table-column label="规格" prop="productSku" />
  20. </el-table>
  21. </div>
  22. </div>
  23. </div>
  24. </template>
  25. <script>
  26. import {getItemList} from "@/api";
  27. export default {
  28. data() {
  29. return {
  30. list: []
  31. }
  32. },
  33. created() {
  34. this.getMyInventoryList()
  35. },
  36. watch: {
  37. $route(to, from) {
  38. if (to.path == "/pItem") {
  39. this.getMyInventoryList()
  40. }
  41. }
  42. },
  43. methods: {
  44. onSelect(action) {
  45. this.$router.push({path: "/material", query: {
  46. tabVal:action
  47. }
  48. })
  49. },
  50. getMyInventoryList() {
  51. let loading1 = this.$toast.loading({
  52. duration: 0,
  53. message: '加载中...',
  54. forbidClick: true,
  55. });
  56. getItemList({storeCode:this.$route.query.id}).then(res => {
  57. loading1.clear()
  58. if (res.code == 200) {
  59. this.loading = false;
  60. this.list = res.data
  61. } else {
  62. this.$toast.fail(res.msg)
  63. }
  64. })
  65. },
  66. onClickLeft() {
  67. this.$router.go(-1)
  68. },
  69. }
  70. }
  71. </script>