瀏覽代碼

2024.10.18 - 优化爆品列表以及更改搜索商品的方式

GuYun-D 5 月之前
父節點
當前提交
0c372b1409

+ 4 - 4
src/views/active/hot/AddExplosiveProductsSubsidiary.vue

@@ -1,16 +1,17 @@
 <template>
-  <el-dialog append-to-body :title="dialogTitle" :visible.sync="addExplosiveProductsSubsidiaryVisible" width="30%" :before-close="handleBeforeClose">
+  <el-dialog :close-on-click-modal="false" append-to-body :title="dialogTitle" :visible.sync="addExplosiveProductsSubsidiaryVisible" width="30%" :before-close="handleBeforeClose">
     <div class="add-explosive-productsSubsidiary-container">
       <el-form ref="formRef" :model="form" :rules="rules" label-width="auto">
         <el-form-item label="配销商品" prop="subsidiaryProductId">
           <el-select
+          :disabled="!!this.form.id"
             @change="handleSelectGoods"
             style="width: 100%"
             v-model="form.subsidiaryProductId"
             filterable
             remote
             reserve-keyword
-            placeholder="请输入商品ID"
+            placeholder="请输入商品名称"
             :remote-method="handleSearchGoods"
             :loading="searchGoodsLoading"
           >
@@ -96,7 +97,6 @@ export default {
         this.form.subsidiaryPrice = Number(item.subsidiaryPrice) || 0
         this.form.subsidiaryProductId = Number(item.subsidiaryProductId)
         this.form.subsidiaryName = item.subsidiaryName
-        this.handleSearchGoods(item.subsidiaryProductId)
         this.dialogTitle = '编辑配销产品'
       }
       this.form.explosiveId = pid
@@ -117,7 +117,7 @@ export default {
       if (query !== '') {
         this.searchGoodsLoading = true
         try {
-          const queryData = { productId: query, page: 1, pageSize: 100 }
+          const queryData = { productName: query, page: 1, pageSize: 100 }
           const res = await getClassifyGetAll(queryData)
           this.goodsList = res.data.list
         } catch (error) {

+ 1 - 1
src/views/active/hot/ExplosiveProductsSubsidiary.vue

@@ -1,5 +1,5 @@
 <template>
-  <el-dialog title="配销产品" :visible.sync="explosiveProductsSubsidiaryVisible" width="30%" :before-close="handleBeforeClose">
+  <el-dialog :close-on-click-modal="false" title="配销产品" :visible.sync="explosiveProductsSubsidiaryVisible" width="30%" :before-close="handleBeforeClose">
     <div class="explosive-productsSubsidiary-container">
       <div class="header" style="display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px">
         <h4 style="font-size: 18px; font-weight: bold">配销产品列表</h4>

+ 4 - 4
src/views/active/hot/HotGoodsAdd.vue

@@ -1,15 +1,16 @@
 <template>
-  <el-dialog :title="dialogTitle" :visible.sync="hotGoodsAddVisible" width="30%" :before-close="handleBeforeClose">
+  <el-dialog :close-on-click-modal="false" :title="dialogTitle" :visible.sync="hotGoodsAddVisible" width="30%" :before-close="handleBeforeClose">
     <el-form :model="form" :rules="rules" ref="formRef" label-width="120px">
       <el-form-item label="产品" prop="productId">
         <el-select
+          :disabled="!!this.form.id"
           @change="handleSelectGoods"
           style="width: 100%"
           v-model="form.productId"
           filterable
           remote
           reserve-keyword
-          placeholder="请输入商品ID"
+          placeholder="请输入商品名称"
           :remote-method="handleSearchGoods"
           :loading="searchGoodsLoading"
         >
@@ -97,7 +98,6 @@ export default {
       if (row && typeof row === 'object') {
         this.form.id = row.id
         this.form.productId = row.productId
-        this.handleSearchGoods(this.form.productId)
         this.form.productName = row.productName
         this.form.productImage = row.productImage
         this.form.productPrice = row.productPrice
@@ -117,7 +117,7 @@ export default {
         this.searchGoodsLoading = true
         try {
           const queryData = {
-            productId: query,
+            productName: query,
             page: 1,
             pageSize: 20
           }