9
0

2 Revīzijas 6cab197fd2 ... 4860e042fe

Autors SHA1 Ziņojums Datums
  肖路 4860e042fe Merge remote-tracking branch 'origin/master' into master 3 dienas atpakaļ
  肖路 65aaf7ee4f feat(product): 更新产品名称自动拼接逻辑和商品描述字段 3 dienas atpakaļ

+ 13 - 6
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>
 
             <!-- 商品描述 -->
@@ -1546,14 +1546,21 @@ 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 || '').trim();
+  const unit = unitOptions.value.find((u: any) => Number(u.id) === Number(productForm.unitId));
+  const unitName = unit?.unitName || '';
+
+  const parts: string[] = [];
+  if (brandName.trim()) parts.push(brandName.trim());
+  if (specificationsCode.trim()) parts.push(specificationsCode.trim());
+  if (description) parts.push(`【${description}】`);
+  if (unitName.trim()) parts.push(`(单位:${unitName.trim()})`);
+  return parts.join(' ');
 });
 
 // 格式化价格为两位小数(不允许负数)

+ 15 - 11
src/views/product/baseAudit/add.vue

@@ -169,9 +169,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>
 
             <!-- 商品描述 -->
@@ -233,7 +233,7 @@
               </el-col>
 
               <el-col :span="12">
-                <el-form-item label="单位:" disabled>
+                <el-form-item label="单位:" >
                   <el-select
                     v-model="productForm.unitId"
                     placeholder="请选择"
@@ -1521,14 +1521,21 @@ 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 || '').trim();
+  const unit = unitOptions.value.find((u: any) => Number(u.id) === Number(productForm.unitId));
+  const unitName = unit?.unitName || '';
+
+  const parts: string[] = [];
+  if (brandName.trim()) parts.push(brandName.trim());
+  if (specificationsCode.trim()) parts.push(specificationsCode.trim());
+  if (description) parts.push(`【${description}】`);
+  if (unitName.trim()) parts.push(`(单位:${unitName.trim()})`);
+  return parts.join(' ');
 });
 
 // 格式化价格为两位小数(不允许负数)
@@ -2032,10 +2039,7 @@ const restoreCategorySelection = async () => {
         if (level3) {
           categoryForm.bottomCategoryId = level3.id;
           selectedLevel3Name.value = level3.label;
-          console.log('设置三级分类名称:', selectedLevel3Name.value);
-          await loadCategoryAttributes(level3.id);
-        }
-      }
+          console.log('设置三级分类名称:', selectedLevel3Name.value); 
     }
   }
 };

+ 64 - 27
src/views/product/baseAudit/view.vue

@@ -1,6 +1,6 @@
 <template>
-  <div class="app-container">
-    <el-card shadow="never" class="mb-3">
+  <div class="app-container view-scroll-container">
+    <el-card shadow="never" class="mb-3 view-header-card">
       <div class="flex items-center justify-between">
         <div class="flex items-center">
           <el-button icon="ArrowLeft" @click="handleBack">返回</el-button>
@@ -38,9 +38,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)条码 -->
@@ -159,9 +170,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>
 
 
@@ -417,18 +428,8 @@
 
             <!-- 商品详情 -->
             <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>
+              <div class="pc-detail-content" v-if="productForm.pcDetail" v-html="productForm.pcDetail"></div>
+              <div v-else class="text-gray-400">暂无详情</div>
             </el-form-item>
           </el-form>
         </el-card>
@@ -534,7 +535,6 @@ import { ref, reactive, computed, onMounted, watch, nextTick } from 'vue';
 import { useRoute, useRouter } from 'vue-router';
 import { ElMessage } from 'element-plus';
 import { Warning, ArrowRight, Check, Plus, CircleCheck, Search } from '@element-plus/icons-vue';
-import Editor from '@/components/Editor/index.vue';
 import UploadImage from '@/components/upload-image/index.vue';
 import TaxCodeSelect from '@/components/TaxCodeSelect/index.vue';
 import { categoryTreeVO, CategoryVO } from '@/api/product/category/types';
@@ -579,9 +579,6 @@ const productFormRef = ref();
 const serviceGuarantees = ref<(string | number)[]>([]);
 const installationServices = ref<string[]>([]);
 
-// 商品详情选项卡
-const activeDetailTab = ref('pc');
-
 // 轮播图URL数组(UI管理用)
 const carouselImages = ref<string[]>([]);
 
@@ -1176,14 +1173,21 @@ 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 || '').trim();
+  const unit = unitOptions.value.find((u: any) => Number(u.id) === Number(productForm.unitId));
+  const unitName = unit?.unitName || '';
+
+  const parts: string[] = [];
+  if (brandName.trim()) parts.push(brandName.trim());
+  if (specificationsCode.trim()) parts.push(specificationsCode.trim());
+  if (description) parts.push(`【${description}】`);
+  if (unitName.trim()) parts.push(`(单位:${unitName.trim()})`);
+  return parts.join(' ');
 });
 
 // 格式化价格为两位小数(不允许负数)
@@ -1672,6 +1676,18 @@ onMounted(async () => {
 </script>
 
 <style scoped lang="scss">
+.view-scroll-container {
+  height: calc(100vh - 84px);
+  overflow-y: auto;
+  overflow-x: hidden;
+}
+
+.view-header-card {
+  position: sticky;
+  top: 0;
+  z-index: 10;
+}
+
 .product-wizard-page {
   .category-selection {
     margin-top: 12px;
@@ -1777,5 +1793,26 @@ onMounted(async () => {
     opacity: 0.9;
     width: 100%;
   }
+
+  .pc-detail-content {
+    width: 100%;
+    line-height: 1.6;
+    color: #303133;
+    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;
+    }
+  }
 }
 </style>

+ 14 - 8
src/views/report/order/index.vue

@@ -293,13 +293,13 @@
 
       <el-table :data="availableProducts" border @selection-change="handleProductSelectionChange" max-height="750">
         <el-table-column type="selection" width="55" align="center" />
-        <el-table-column label="合作项目/平台" align="center" prop="cooperationCode" width="120" />
+        <!-- <el-table-column label="合作项目/平台" align="center" prop="cooperationCode" width="120" /> -->
         <el-table-column label="商品编号" align="center" prop="productNo" width="120">
           <template #default="scope">
             <span style="color: #409eff">{{ scope.row.productNo }}</span>
           </template>
         </el-table-column>
-        <el-table-column label="平台编号" align="center" prop="platformNo" width="100" />
+        <!-- <el-table-column label="平台编号" align="center" prop="platformNo" width="100" /> -->
         <el-table-column label="商品图片" align="center" prop="productImage" width="80">
           <template #default="scope">
             <el-image v-if="scope.row.productImage" :src="scope.row.productImage" style="width: 50px; height: 50px" fit="cover" />
@@ -314,7 +314,7 @@
             <div style="text-align: left; line-height: 1.8">
               <div style="color: #909399; font-size: 12px">市场价:¥{{ scope.row.marketPrice }}</div>
               <div style="color: #f56c6c; font-size: 12px">会员价:¥{{ scope.row.memberPrice }}</div>
-              <div style="color: #67c23a; font-size: 12px">价:¥{{ scope.row.basePrice }}</div>
+              <div style="color: #67c23a; font-size: 12px">最低价:¥{{ scope.row.basePrice }}</div>
             </div>
           </template>
         </el-table-column>
@@ -396,6 +396,7 @@ import {
   delPartnerPreparedProduct,
   listSiteProducts
 } from '@/api/partner/prepared';
+import { listBase } from '@/api/product/base';
 import { getCurrentPartnerInfo } from '@/api/partner';
 import { PartnerPreparedVO, PartnerPreparedForm, PartnerPreparedQuery } from '@/api/partner/prepared/types';
 import { listByIds } from '@/api/system/oss';
@@ -847,16 +848,21 @@ function handleImportProduct() {
 }
 
 function searchProducts() {
-  listSiteProducts(productQuery.value)
+  listBase({
+    pageNum: productQuery.value.pageNum,
+    pageSize: productQuery.value.pageSize,
+    productNo: productQuery.value.productNo || undefined,
+    productStatus: 1 // 只查询已上架的商品
+  })
     .then((res: any) => {
-      availableProducts.value = (res.data?.rows || []).map((item: any) => ({
+      availableProducts.value = (res.rows || []).map((item: any) => ({
         id: item.id,
         cooperationCode: '--',
         productNo: item.productNo,
         platformNo: '--',
         productImage: item.productImage,
-        productName: item.productName,
-        category: item.isSelf === 1 ? '自营商品' : '非自营商品',
+        productName: item.itemName || '',
+        category: +item.isSelf === 1 ? '自营商品' : '非自营商品',
         unit: item.unitName || '包',
         marketPrice: item.marketPrice,
         memberPrice: item.memberPrice,
@@ -866,7 +872,7 @@ function searchProducts() {
         stockCost: item.virtualInventory || 0,
         shelfStatus: item.productStatus
       }));
-      productTotal.value = res.data?.total || 0;
+      productTotal.value = res.total || 0;
     })
     .catch(() => {
       availableProducts.value = [];