Parcourir la source

feat(product): 更新产品名称自动拼接逻辑和表单字段配置

- 修改A10产品名称自动拼接规则:将"品牌名 + 规格型号 + 产品分类 + 发票规格"改为"品牌 + 规格型号 + 【描述】 + (单位:单位)"
- 在多个页面中更新产品名称输入框的占位符提示文本和帮助说明
- 调整商品描述字段的最大长度限制:从500字符减少到30字符,并保留字数限制显示功能
- 在审核查看页面新增商品描述输入字段,方便信息展示
- 将商品简介字段重命名为商品说明,并修改对应的模型绑定属性
- 简化商品详情展示方式,移除标签页切换,直接以只读模式显示电脑端详情内容
- 添加商品详情内容的样式定义,包括边框、背景色和响应式图片表格支持
肖路 il y a 2 jours
Parent
commit
e6a8f3e82f

+ 15 - 8
src/views/product/base/add.vue

@@ -183,9 +183,9 @@
                 type="textarea"
                 :rows="2"
                 disabled
-                placeholder="自动拼接:品牌名 + 规格型号 + 产品分类 + 发票规格"
+                placeholder="自动拼接:品牌 + 规格型号 + 【描述】 + (单位:单位)"
               />
-              <div class="form-item-tip">A10产品名称由系统自动拼接:品牌名 + 规格型号 + 产品分类(三级分类)+ 发票规格,无需手动填写</div>
+              <div class="form-item-tip">A10产品名称由系统自动拼接:品牌 + 规格型号 + 【描述】 + (单位:单位),无需手动填写</div>
             </el-form-item>
 
             
@@ -193,10 +193,9 @@
             <el-form-item label="商品描述:">
               <el-input
                 v-model="productForm.productDescription"
-                type="textarea"
                 :rows="3"
                 placeholder="请输入商品描述"
-                maxlength="500"
+                maxlength="30"
                 show-word-limit
               />
             </el-form-item>
@@ -1629,14 +1628,22 @@ const handleSalesVolumeInput = (val: string) => {
   }
 };
 
-// A10产品名称自动拼接(品牌名 + 规格型号 + 产品分类 + 发票规格
+// A10产品名称自动拼接(品牌 + 规格型号 + 【描述】 + (单位:单位)
 const a10ProductNameComputed = computed(() => {
   const brand = brandOptions.value.find((b) => Number(b.id) === Number(productForm.brandId));
   const brandName = brand?.brandName || '';
   const specificationsCode = productForm.specificationsCode || '';
-  const categoryName = selectedLevel3Name.value || '';
-  const invoiceSpecs = productForm.invoiceSpecs || '';
-  return [brandName, specificationsCode, categoryName, invoiceSpecs].filter((s) => s.trim()).join(' ');
+  const description = productForm.productDescription || '';
+  const unit = unitOptions.value.find((u) => Number(u.id) === Number(productForm.unitId));
+  const unitName = unit?.unitName || '';
+
+  const parts: string[] = [];
+  if (brandName.trim()) parts.push(brandName);
+  if (specificationsCode.trim()) parts.push(specificationsCode);
+  if (description.trim()) parts.push(`【${description}】`);
+  if (unitName.trim()) parts.push(`(单位:${unitName})`);
+
+  return parts.join(' ');
 });
 
 // 格式化价格为两位小数(不允许负数)

+ 16 - 8
src/views/product/baseAudit/add.vue

@@ -183,19 +183,19 @@
                 type="textarea"
                 :rows="2"
                 disabled
-                placeholder="自动拼接:品牌名 + 规格型号 + 产品分类 + 发票规格"
+                placeholder="自动拼接:品牌 + 规格型号 + 【描述】 + (单位:单位)"
               />
-              <div class="form-item-tip">A10产品名称由系统自动拼接:品牌名 + 规格型号 + 产品分类(三级分类)+ 发票规格,无需手动填写</div>
+              <div class="form-item-tip">A10产品名称由系统自动拼接:品牌 + 规格型号 + 【描述】 + (单位:单位),无需手动填写</div>
             </el-form-item>
 
              <!-- 商品描述 -->
             <el-form-item label="商品描述:">
               <el-input
                 v-model="productForm.productDescription"
-                type="textarea"
+              
                 :rows="3"
                 placeholder="请输入商品描述"
-                maxlength="500"
+                maxlength="30"
                 show-word-limit
               />
             </el-form-item>
@@ -1619,14 +1619,22 @@ const handleSalesVolumeInput = (val: string) => {
   }
 };
 
-// A10产品名称自动拼接(品牌名 + 规格型号 + 产品分类 + 发票规格
+// A10产品名称自动拼接(品牌 + 规格型号 + 【描述】 + (单位:单位)
 const a10ProductNameComputed = computed(() => {
   const brand = brandOptions.value.find((b) => Number(b.id) === Number(productForm.brandId));
   const brandName = brand?.brandName || '';
   const specificationsCode = productForm.specificationsCode || '';
-  const categoryName = selectedLevel3Name.value || '';
-  const invoiceSpecs = productForm.invoiceSpecs || '';
-  return [brandName, specificationsCode, categoryName, invoiceSpecs].filter((s) => s.trim()).join(' ');
+  const description = productForm.productDescription || '';
+  const unit = unitOptions.value.find((u) => Number(u.id) === Number(productForm.unitId));
+  const unitName = unit?.unitName || '';
+
+  const parts: string[] = [];
+  if (brandName.trim()) parts.push(brandName);
+  if (specificationsCode.trim()) parts.push(specificationsCode);
+  if (description.trim()) parts.push(`【${description}】`);
+  if (unitName.trim()) parts.push(`(单位:${unitName})`);
+
+  return parts.join(' ');
 });
 
 // 格式化价格为两位小数(不允许负数)

+ 61 - 22
src/views/product/baseAudit/view.vue

@@ -52,9 +52,20 @@
                 type="textarea"
                 :rows="2"
                 disabled
-                placeholder="自动拼接:品牌名 + 规格型号 + 产品分类 + 发票规格"
+                placeholder="自动拼接:品牌 + 规格型号 + 【描述】 + (单位:单位)"
+              />
+              <div class="form-item-tip">A10产品名称由系统自动拼接:品牌 + 规格型号 + 【描述】 + (单位:单位),无需手动填写</div>
+            </el-form-item>
+
+            <!-- 商品描述 -->
+            <el-form-item label="商品描述:">
+              <el-input
+                v-model="productForm.productDescription"
+                :rows="3"
+                placeholder="请输入商品描述"
+                maxlength="30"
+                show-word-limit
               />
-              <div class="form-item-tip">A10产品名称由系统自动拼接:品牌名 + 规格型号 + 产品分类(三级分类)+ 发票规格,无需手动填写</div>
             </el-form-item>
 
             <!-- 规格型号 和 UPC(69)条码 -->
@@ -173,9 +184,9 @@
               <el-input v-model="productForm.promotionTitle" type="textarea" :rows="3" placeholder="请输入促销标题" maxlength="300" show-word-limit />
             </el-form-item>
 
-            <!-- 商品简介 -->
-            <el-form-item label="商品简介:">
-              <el-input v-model="productForm.productDescription" type="textarea" :rows="3" placeholder="请输入商品简介" maxlength="500" show-word-limit />
+            <!-- 商品说明 -->
+            <el-form-item label="商品说明:">
+              <el-input v-model="productForm.productExplain" type="textarea" :rows="3" placeholder="请输入商品说明" maxlength="500" show-word-limit />
             </el-form-item>
 
 
@@ -524,19 +535,9 @@
             </el-form-item>
 
             <!-- 商品详情 -->
-            <el-form-item label="商品详情:" required>
-              <el-tabs v-model="activeDetailTab" type="border-card">
-                <el-tab-pane label="电脑端详情" name="pc">
-                  <div class="view-disabled-wrapper">
-                    <Editor v-model="productForm.pcDetail" :height="400" :readOnly="true" />
-                  </div>
-                </el-tab-pane>
-                <el-tab-pane label="移动端详情" name="mobile">
-                  <div class="view-disabled-wrapper">
-                    <Editor v-model="productForm.mobileDetail" :height="400" :readOnly="true" />
-                  </div>
-                </el-tab-pane>
-              </el-tabs>
+            <el-form-item label="商品详情:">
+              <div class="detail-content" v-if="productForm.pcDetail" v-html="productForm.pcDetail"></div>
+              <span v-else class="detail-empty">暂无内容</span>
             </el-form-item>
           </el-form>
         </el-card>
@@ -1281,14 +1282,22 @@ const handleSalesVolumeInput = (val: string) => {
   }
 };
 
-// A10产品名称自动拼接(品牌名 + 规格型号 + 产品分类 + 发票规格
+// A10产品名称自动拼接(品牌 + 规格型号 + 【描述】 + (单位:单位)
 const a10ProductNameComputed = computed(() => {
   const brand = brandOptions.value.find((b) => Number(b.id) === Number(productForm.brandId));
   const brandName = brand?.brandName || '';
   const specificationsCode = productForm.specificationsCode || '';
-  const categoryName = selectedLevel3Name.value || '';
-  const invoiceSpecs = productForm.invoiceSpecs || '';
-  return [brandName, specificationsCode, categoryName, invoiceSpecs].filter((s) => s.trim()).join(' ');
+  const description = productForm.productDescription || '';
+  const unit = unitOptions.value.find((u) => Number(u.id) === Number(productForm.unitId));
+  const unitName = unit?.unitName || '';
+
+  const parts: string[] = [];
+  if (brandName.trim()) parts.push(brandName);
+  if (specificationsCode.trim()) parts.push(specificationsCode);
+  if (description.trim()) parts.push(`【${description}】`);
+  if (unitName.trim()) parts.push(`(单位:${unitName})`);
+
+  return parts.join(' ');
 });
 
 // 格式化价格为两位小数(不允许负数)
@@ -1845,5 +1854,35 @@ onMounted(async () => {
     opacity: 0.9;
     width: 100%;
   }
+
+  .detail-content {
+    width: 100%;
+    padding: 12px 16px;
+    border: 1px solid #e4e7ed;
+    border-radius: 4px;
+    background-color: #fafafa;
+    color: #303133;
+    line-height: 1.6;
+    word-break: break-word;
+
+    :deep(img) {
+      max-width: 100%;
+      height: auto;
+    }
+
+    :deep(table) {
+      max-width: 100%;
+      border-collapse: collapse;
+    }
+
+    :deep(p) {
+      margin: 0 0 8px;
+    }
+  }
+
+  .detail-empty {
+    color: #909399;
+    font-size: 14px;
+  }
 }
 </style>