productAttrValueSelect.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <template>
  2. <div class="product-select" >
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
  4. <el-form-item label="商品名称" prop="productName">
  5. <el-input
  6. style="width:200px"
  7. v-model="queryParams.productName"
  8. placeholder="请输入商品名称"
  9. clearable
  10. size="small"
  11. @keyup.enter.native="handleQuery"
  12. />
  13. </el-form-item>
  14. <el-form-item>
  15. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  16. </el-form-item>
  17. </el-form>
  18. <el-table border v-loading="loading" :data="list">
  19. <el-table-column label="商品编号" align="center" prop="barCode" />
  20. <el-table-column label="商品图片" align="center" width="100">
  21. <template slot-scope="scope">
  22. <el-popover
  23. placement="right"
  24. title=""
  25. trigger="hover"
  26. >
  27. <img slot="reference" :src="scope.row.image" width="80">
  28. <img :src="scope.row.image" style="max-width: 80px;">
  29. </el-popover>
  30. </template>
  31. </el-table-column>
  32. <el-table-column label="商品名称" show-overflow-tooltip align="center" prop="productName" />
  33. <el-table-column label="店铺名称" show-overflow-tooltip align="center" prop="storeName" />
  34. <el-table-column label="包装规格" align="center" prop="prescribeSpec" />
  35. <el-table-column label="商品规格" align="center" prop="sku" />
  36. <el-table-column label="库存" align="center" prop="stock" />
  37. <el-table-column label="单价" align="center" prop="price" />
  38. <el-table-column label="成本价" align="center" prop="costPrice" />
  39. <el-table-column label="操作" align="center" width="100px" >
  40. <template slot-scope="scope">
  41. <el-button
  42. size="mini"
  43. type="text"
  44. @click="handleSelect(scope.row)"
  45. >选择</el-button>
  46. </template>
  47. </el-table-column>
  48. </el-table>
  49. <pagination
  50. style="padding-bottom:10px;"
  51. v-show="total>0"
  52. :total="total"
  53. :page.sync="queryParams.pageNum"
  54. :limit.sync="queryParams.pageSize"
  55. @pagination="getList"
  56. />
  57. </div>
  58. </template>
  59. <script>
  60. import { getStoreProductAttrValueList,listStore } from "@/api/his/storeProduct";
  61. export default {
  62. name: "selectProduct",
  63. data() {
  64. return {
  65. loading: true,
  66. list:[],
  67. total: 0,
  68. queryParams: {
  69. productName:"",
  70. pageNum: 1,
  71. pageSize: 10,
  72. isPackage:0,
  73. storeId:null,
  74. }
  75. };
  76. },
  77. created() {
  78. },
  79. methods: {
  80. getData(isPackage){
  81. this.queryParams.isPackage=isPackage;
  82. this.getList();
  83. },
  84. handleSelect(row){
  85. this.$emit('selectProduct',row);
  86. },
  87. /** 搜索按钮操作 */
  88. handleQuery() {
  89. this.queryParams.pageNum = 1;
  90. this.getList();
  91. },
  92. getDetails(storeId){
  93. this.queryParams.storeId=storeId;
  94. this.getList();
  95. },
  96. getList(){
  97. this.loading = true;
  98. getStoreProductAttrValueList(this.queryParams).then(response => {
  99. this.list = response.rows;
  100. this.total = response.total;
  101. this.loading = false;
  102. });
  103. }
  104. }
  105. };
  106. </script>
  107. <style scoped>
  108. .product-select{
  109. padding-bottom: 15px;
  110. }
  111. </style>