Browse Source

产品类别和产品的列表修改

zhuliu 1 year ago
parent
commit
d6cc83a4f1

+ 1 - 0
src/styles/index.scss

@@ -70,6 +70,7 @@ a:hover {
 
 .operate-container .btn-add {
   float: right;
+  margin-left: 10px;
 }
 
 //表格栏样式

+ 1 - 0
src/views/pms/product/components/ProductDetail.vue

@@ -60,6 +60,7 @@
         }
         this.$api.queryHotProductDetail(params).then(response=>{
           this.productParam=response.data.data;
+          
         });
       },
       //提交信息

+ 7 - 1
src/views/pms/product/components/ProductInfoDetail.vue

@@ -12,7 +12,7 @@
       <el-form-item label="产品名称:" prop="name">
         <el-input v-model="value.name" placeholder="请输入产品名称"></el-input>
       </el-form-item>
-      <el-form-item label="是否上架:" prop="name">
+      <el-form-item label="是否上架:">
         <el-switch
           :active-value="true"
           :inactive-value="false"
@@ -104,8 +104,14 @@
           this.value.productCategoryId = null;
           this.value.productCategoryName=null;
         }
+      },
+      value(){
+        this.files = this.value.systemFileList
       }
     },
+    mounted(){
+      this.files = this.value.systemFileList
+    },
     methods: {
       //获取文件
       onChange(file, fileList){

+ 21 - 28
src/views/pms/product/index.vue

@@ -51,6 +51,12 @@
       <span>数据列表</span>
       <el-button
         class="btn-add"
+        @click="handleImportProduct()"
+        size="mini">
+        导入
+      </el-button>
+      <el-button
+        class="btn-add"
         @click="handleAddProduct()"
         size="mini">
         添加
@@ -69,7 +75,7 @@
         </el-table-column>
         <el-table-column label="产品图片" width="120" align="center">
           <template slot-scope="scope">
-            <el-image v-if="scope.row.systemFileList && scope.row.systemFileList.length>0" style="height: 80px" :src="$commonJS.getFile(scope.row.systemFileList[0].guid)"/>
+            <el-image v-if="scope.row.systemFileList && scope.row.systemFileList.length>0" style="height: 80px" :preview-src-list="scope.row.systemFileList.map(item=>{return $commonJS.getFile(item.guid)})" :src="$commonJS.getFile(scope.row.systemFileList[0].guid)"/>
           </template>
         </el-table-column>
         <el-table-column label="产品名称/销冠品牌" align="center">
@@ -94,51 +100,36 @@
                 v-model="scope.row.publishStatus">
               </el-switch>
             </p>
-            <!-- <p>新品:
-              <el-switch
-                @change="handleNewStatusChange(scope.$index, scope.row)"
-                :active-value="1"
-                :inactive-value="0"
-                v-model="scope.row.newStatus">
-              </el-switch>
-            </p> -->
-            <!-- <p>推荐:
-              <el-switch
-                @change="handleRecommendStatusChange(scope.$index, scope.row)"
-                :active-value="1"
-                :inactive-value="0"
-                v-model="scope.row.recommandStatus">
-              </el-switch>
-            </p> -->
           </template>
         </el-table-column>
-        <el-table-column label="排序" width="100" align="center">
+        <!-- <el-table-column label="排序" width="100" align="center">
           <template slot-scope="scope">{{scope.row.sort}}</template>
-        </el-table-column>
-        <el-table-column label="销量" width="100" align="center">
-          <template slot-scope="scope">{{scope.row.sale}}</template>
+        </el-table-column> -->
+        <el-table-column label="售卖平台/平台链接" align="center">
+          <template slot-scope="scope">
+            <p v-if="scope.row.sellPlatform">售卖平台:{{ scope.row.sellPlatform }}</p>
+            <p v-if="scope.row.platformLink">平台链接:{{ scope.row.platformLink }}</p>
+          </template>
         </el-table-column>
 
         <el-table-column label="操作" width="160" align="center">
           <template slot-scope="scope">
             <p>
-              <el-button
+              <!-- <el-button
                 size="mini"
                 @click="handleShowProduct(scope.$index, scope.row)">查看
-              </el-button>
+              </el-button> -->
               <el-button
                 size="mini"
                 @click="handleUpdateProduct(scope.$index, scope.row)">编辑
               </el-button>
-            </p>
-            <p>
-
               <el-button
                 size="mini"
                 type="danger"
                 @click="handleDelete(scope.$index, scope.row)">删除
               </el-button>
             </p>
+
           </template>
         </el-table-column>
       </el-table>
@@ -297,6 +288,8 @@
       handleAddProduct() {
         this.$router.push({path:'/pms/addProduct'});
       },
+      //导入爆款产品
+      handleImportProduct(){},
       //批量操作
       handleBatchOperate() {
         if(this.operateType==null){
@@ -368,7 +361,7 @@
           ids:ids,
           ifShow:publishStatus
         }
-        updatePublishStatus(params).then(response => {
+        this.$api.updateProductIfShow(params).then(response => {
           this.$message({
             message: '修改成功',
             type: 'success',
@@ -400,7 +393,7 @@
         var params = {
           ids:ids
         }
-        updateDeleteStatus(params).then(response => {
+        this.$api.deleteHotProduct(params).then(response => {
           this.$message({
             message: '删除成功',
             type: 'success',

+ 1 - 0
src/views/pms/productCate/components/ProductCateDetail.vue

@@ -102,6 +102,7 @@
         }
         this.$api.selectCategoryDetail(params).then(response => {
           this.productCate = response.data.data;
+          this.files = response.data.data.systemFileList
         });
       },
       //获取文件

+ 30 - 13
src/views/pms/productCate/index.vue

@@ -5,6 +5,12 @@
       <span style="margin-top: 5px">数据列表</span>
       <el-button
         class="btn-add"
+        @click="handleImportProductCate()"
+        size="mini">
+        导入
+      </el-button>
+      <el-button
+        class="btn-add"
         @click="handleAddProductCate()"
         size="mini">
         添加
@@ -15,15 +21,29 @@
                 style="width: 100%"
                 :data="list"
                 v-loading="listLoading" border>
-        <el-table-column label="号" width="100" align="center">
+        <el-table-column label="号" width="100" align="center">
           <template slot-scope="scope">{{ scope.$index + 1 + (listQuery.current - 1) * listQuery.size }}</template>
         </el-table-column>
-        <el-table-column label="分类名称" align="center">
+        <el-table-column label="产品类别图" width="120" align="center">
+          <template slot-scope="scope">
+            <el-image v-if="scope.row.systemFileList && scope.row.systemFileList.length>0" style="height: 80px" :preview-src-list="scope.row.systemFileList.map(item=>{return $commonJS.getFile(item.guid)})" :src="$commonJS.getFile(scope.row.systemFileList[0].guid)"/>
+          </template>
+        </el-table-column>
+        <el-table-column label="类别名称" align="center">
           <template slot-scope="scope">{{scope.row.name}}</template>
         </el-table-column>
         <el-table-column label="级别" width="100" align="center">
           <template slot-scope="scope">{{scope.row.level | levelFilter}}</template>
         </el-table-column>
+        <el-table-column label="路径" align="center">
+          <template slot-scope="scope">{{scope.row.path}}</template>
+        </el-table-column>
+        <el-table-column label="关键词" align="center">
+          <template slot-scope="scope">{{scope.row.searchCondition}}</template>
+        </el-table-column>
+        <el-table-column label="描述" align="center">
+          <template slot-scope="scope">{{scope.row.description}}</template>
+        </el-table-column>
         <!-- <el-table-column label="是否显示" width="100" align="center">
           <template slot-scope="scope">
             <el-switch
@@ -34,14 +54,14 @@
             </el-switch>
           </template>
         </el-table-column> -->
-        <el-table-column label="排序" width="100" align="center">
+        <!-- <el-table-column label="排序" width="100" align="center">
           <template slot-scope="scope">{{scope.row.sort }}</template>
-        </el-table-column>
-        <el-table-column label="设置" width="200" align="center">
+        </el-table-column> -->
+        <el-table-column label="设置" width="120" align="center">
           <template slot-scope="scope">
             <el-button
               size="mini"
-              :disabled="scope.row.level | disableNextLevel"
+              :disabled="!scope.row.ifChild"
               @click="handleShowNextLevel(scope.$index, scope.row)">查看下级
             </el-button>
           </template>
@@ -115,6 +135,9 @@
       handleAddProductCate() {
         this.$router.push('/pms/addProductCate');
       },
+      //导入产品类别
+      handleImportProductCate(){},
+      
       //获取产品类别列表
       getList() {
         var params = {
@@ -191,13 +214,7 @@
           return '二级';
         }
       },
-      disableNextLevel(value) {
-        if (value === 0) {
-          return false;
-        } else {
-          return true;
-        }
-      }
+
     }
   }
 </script>