Răsfoiți Sursa

换电脑前提交

wenjie 1 lună în urmă
părinte
comite
7d9e0bdfb2

BIN
dist.zip


+ 39 - 0
src/views/modules/platform/auditShop.vue

@@ -52,6 +52,14 @@
           v-if="isAuth('shop:shopAuditing:audit')"
           @click="shopAccountHandle(scope.row.shopId)"
         >账号管理</el-button>
+
+         <el-button
+          icon="el-icon-paperclip"
+          size="small"
+          type="primary"
+          v-if="scope.row.status !== 0&&scope.row.status !== -1"
+          @click="handleBind(scope.row.shopId)"
+        >绑定配送方</el-button>
         <!-- <el-button
           type="danger"
           icon="el-icon-bottom"
@@ -92,6 +100,25 @@
     ></ShopAudit>
     <!-- 账号管理 -->
     <ShopAccount v-if="shopAccountVisible" ref="shopAccount" @refreshDataList="refreshChange"></ShopAccount>
+
+
+    <el-dialog
+    title="绑定/解绑配送方"
+    :visible.sync="DialogVisible"
+    width="300px"
+    >
+    <div class="box">
+      <div class="item">
+        <div class="title">顺丰</div>
+        <el-button
+          size="mini"
+          type="primary"
+          @click="handleBindType(scope.row.shopId)"
+        >绑定</el-button>
+      </div>
+    </div>
+  </el-dialog>
+
   </div>
 </template>
 
@@ -104,6 +131,7 @@ import ShopAccount from './shop-account.vue'
 export default {
   data () {
     return {
+      DialogVisible: false,
       dataList: [],
       page: {
         total: 0, // 总页数
@@ -130,6 +158,11 @@ export default {
   mounted () {
   },
   methods: {
+    // 绑定配送方
+    handleBind(){
+      this.DialogVisible = true
+    },
+    handleBindType(){},
     getDataList (page, params) {
       params = this.searchForm
       console.log(params)
@@ -232,5 +265,11 @@ export default {
 </script>
 <style lang="scss">
 .mod-seckill-shopAuditing {
+  .box{
+    .item{
+      display: flex;
+      justify-content: space-between;
+    }
+  }
 }
 </style>

+ 32 - 17
src/views/modules/prod/category.vue

@@ -32,23 +32,23 @@
         >新增</el-button>
       </el-form-item>
     </el-form>
-    <el-table :data="dataList" border row-key="categoryId" style="width: 100%;">
+    <el-table :data="dataList" border row-key="categoryID" style="width: 100%;" @row-click="handleRelated">
        <el-table-column
         prop="shopName"
         header-align="center"
-        treeKey="categoryId"
+        treeKey="categoryID"
         label="店铺名称"
       ></el-table-column>
       <el-table-column
         prop="categoryName"
         header-align="center"
-        treeKey="categoryId"
+        treeKey="categoryID"
         width="150"
         label="分类名称"
       ></el-table-column>
-      <el-table-column prop="pic" header-align="center" align="center" label="图片">
+      <el-table-column prop="icon" header-align="center" align="center" label="图片">
         <template slot-scope="scope">
-          <img :src="resourcesUrl + scope.row.pic " />
+          <img :src="resourcesUrl + scope.row.icon " />
         </template>
       </el-table-column>
       <el-table-column prop="status" header-align="center" align="center" label="状态">
@@ -58,22 +58,22 @@
         </template>
       </el-table-column>
       <el-table-column prop="seq" header-align="center" align="center" label="排序号"></el-table-column>
-      <el-table-column fixed="right" header-align="center" align="center" label="操作">
+      <!-- <el-table-column fixed="right" header-align="center" align="center" label="操作">
         <template slot-scope="scope">
           <el-button
             v-if="isAuth('prod:category:update')"
             type="primary"
             size="small"
-            @click="addOrUpdateHandle(scope.row.categoryId)"
+            @click="addOrUpdateHandle(scope.row.categoryID)"
           >修改</el-button>
           <el-button
             v-if="isAuth('prod:category:delete')"
             type="danger"
             size="small"
-            @click="deleteHandle(scope.row.categoryId)"
+            @click="deleteHandle(scope.row.categoryID)"
           >删除</el-button>
         </template>
-      </el-table-column>
+      </el-table-column> -->
     </el-table>
     <el-pagination
       @size-change="handleSizeChange"
@@ -87,16 +87,21 @@
 
     <!-- 弹窗, 新增 / 修改 -->
     <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
+
+    <!-- 关联商品 -->
+    <relate-goods v-if="relatedVisible" ref="related" @close="relatedVisible = false"></relate-goods>
   </div>
 </template>
 
 <script>
 import AddOrUpdate from './category-add-or-update'
 import { treeDataTranslate } from '@/utils'
+import relateGoods from './relateGoods';
 
 export default {
   data () {
     return {
+      relatedVisible:true,
       options: [],
       total:0,
       searchForm:{shopId:undefined,current:1,size:10},
@@ -108,13 +113,19 @@ export default {
     }
   },
   components: {
-    AddOrUpdate
+    AddOrUpdate,
+    relateGoods
   },
   created () {
+    
     this.getDataList()
     this.getShopByName()
   },
   methods: {
+    handleRelated(row){
+        this.relatedVisible = true;
+        this.$refs.related.open(row.categoryID)
+    },
     handleSearch(){
       this.searchForm.current = 1;
       this.getDataList();
@@ -148,14 +159,18 @@ export default {
       this.dataListLoading = true
       this.searchForm.shopId = this.searchForm.shopId || undefined;
       this.$http({
-        url: this.$http.adornUrl('/prod/category/listCategory'),
-        method: 'get',
-        params: this.$http.adornParams({
-          maxGrade: 2,
-          ...this.searchForm
-        })
+        // url: this.$http.adornUrl('/prod/category/listCategory'),
+        url: this.$http.adornUrl('/prod/category/listCategoryNew'),
+        method: 'post',
+        // params: this.$http.adornParams({
+        //   maxGrade: 2,
+        //   ...this.searchForm
+        // })
+        data: this.$http.adornData(
+          this.searchForm
+        )
       }).then(({ data }) => {
-        // this.dataList = treeDataTranslate(data, 'categoryId', 'parentId')
+        // this.dataList = treeDataTranslate(data, 'categoryID', 'parentId')
         this.dataList = data.records
         this.total = data.total;
         this.dataListLoading = false

+ 215 - 0
src/views/modules/prod/relateGoods.vue

@@ -0,0 +1,215 @@
+<template>
+<div>
+
+  <el-dialog
+    title="已关联商品"
+    :close-on-click-modal="false"
+    :visible.sync="visible"
+    width="800px"
+  >
+  <div class="content">
+    <el-form :inline="true" :model="searchForm">
+      <el-form-item label="产品名称">
+        <el-input
+          v-model="searchForm.prodName"
+          size="small"
+          placeholder="请输入产品名称"
+        ></el-input>
+      </el-form-item>
+      <el-form-item>
+        <el-button
+          type="primary"
+          icon="el-icon-search"
+          size="small"
+          @click="search()"
+          >搜索</el-button
+        >
+      </el-form-item>
+    </el-form>
+
+    <el-button
+      type="primary"
+      icon="el-icon-plus"
+      size="small"
+      @click="handleRelated()"
+      >关联商品</el-button
+    >
+    <el-table
+      :data="dataList"
+      border
+      style="width: 100%"
+    >
+      <el-table-column
+        prop="prodName"
+        header-align="center"
+        align="center"
+        label="产品名称"
+      >
+      </el-table-column>
+      <el-table-column
+        prop="status"
+        header-align="center"
+        align="center"
+        label="上下线状态"
+      >
+      <template slot-scope="scope">
+        {{scope.row.status==1?'上线':'下线'}}
+      </template>
+      </el-table-column>
+   
+      <!-- <el-table-column
+        fixed="right"
+        header-align="center"
+        align="center"
+        label="操作"
+      >
+        <template slot-scope="scope">
+          <el-button
+            type="primary"
+            size="small"
+            @click="handle(scope.row.prodId)"
+            >取消关联</el-button
+          >
+        </template>
+      </el-table-column> -->
+    </el-table>
+    <el-pagination
+      @size-change="handleSizeChange"
+      @current-change="handleCurrentChange"
+      :current-page="searchForm.current"
+      :page-sizes="[10, 20]"
+      :page-size="searchForm.size"
+      layout="total, sizes, prev, pager, next, jumper"
+      :total="total"
+    >
+    </el-pagination>
+   
+  </div>
+   
+  </el-dialog>
+
+
+</div>
+</template>
+<script>
+
+export default {
+  components: {
+  },
+  data () {
+    return {
+      visible: false,
+      relatedVisible:true,
+      dataList: [],
+      searchForm: {
+        prodName:'',
+        shopCategoryId:'',
+        current: 1,
+        size: 10,
+      },
+      total:0
+     
+    }
+  },
+ 
+  methods: {
+     handleRelated(){
+      this.relatedVisible = true;
+      this.$refs.related.open(this.searchForm.shopCategoryId)
+      
+    },
+    open(id){
+      this.visible = true
+      this.searchForm.shopCategoryId = id;
+      this.getDataList()
+    },
+    close(){
+      this.relatedVisible = false
+      this.getDataList()
+    },
+    submit () {
+       this.visible = false
+      this.$emit('close')
+      //  this.$http({
+      //       url: this.$http.adornUrl(`/prod/category`),
+      //       method: this.dataForm.categoryId ? 'put' : 'post',
+      //       data: this.$http.adornData({
+      //         'categoryId': this.dataForm.categoryId || undefined,
+      //         'categoryName': this.dataForm.categoryName,
+      //         'status': this.dataForm.status,
+      //         'seq': this.dataForm.seq,
+      //         'grade': this.dataForm.grade,
+      //         'parentId': this.dataForm.parentId,
+      //         'pic': this.dataForm.pic
+      //       })
+      //     }).then(({ data }) => {
+      //       this.$message({
+      //         message: '操作成功',
+      //         type: 'success',
+      //         duration: 1500,
+      //         onClose: () => {
+      //           this.visible = false
+      //           this.$emit('close')
+      //         }
+      //       })
+      //     })
+    },
+    // 获取数据列表
+    getDataList() {
+      this.dataListLoading = true;
+      this.$http({
+        url: this.$http.adornUrl("/prod/prod/listRelatedProducts"),
+        method: "post",
+        data: this.$http.adornParams(this.searchForm),
+      }).then(({ data }) => {
+        // this.dataList = treeDataTranslate(data, 'categoryId', 'parentId')
+        this.dataList = data.records;
+        this.total = data.total;
+        this.dataListLoading = false;
+      });
+    },
+    handle(id){
+      this.$confirm('确定取消关联?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.$http({
+          url: this.$http.adornUrl("/prod/prod/cancelRelatedProducts/"+id),
+          method: "get",
+        }).then(({ data }) => {
+          this.$message({
+            message: '操作成功',
+            type: 'success',
+            duration: 1500,
+            onClose: () => {
+              this.getDataList();
+            }
+          })
+        });
+      }).catch(() => {});
+    },
+    search(){
+      this.searchForm.current = 1;
+      this.getDataList()
+    },
+    handleSizeChange(val) {
+      this.searchForm.size = val;
+      this.searchForm.current = 1;
+      this.getDataList();
+    },
+    handleCurrentChange(val) {
+      this.searchForm.current = val;
+      this.getDataList();
+    },
+   
+  }
+}
+</script>
+
+<style lang="scss">
+
+  .content{
+ 
+  }
+</style>