Explorar o código

Merge branch '03/03Lebao' into test

lex-xin %!s(int64=4) %!d(string=hai) anos
pai
achega
2019309d23

+ 16 - 39
src/views/businessManager/shopManager/shopList.vue

@@ -49,7 +49,7 @@
       >
       <el-button
         class="btn-primary"
-        permission="'goods/update'"
+        v-permission="'goods/add/commonAdd'"
         @click="onShopComAdd"
         >添加组合商品</el-button
       >
@@ -190,7 +190,7 @@
           </el-table-column>
           <el-table-column align="center" prop="brand" label="品牌">
           </el-table-column>
-          <el-table-column align="center" prop="name" label="商品名称">
+          <el-table-column align="center" prop="name" label="商品名称" width="150px">
             <template slot-scope="scope">
               <overflow-text :text="scope.row.name" width="100%" />
             </template>
@@ -330,14 +330,6 @@
                 type="text"
                 >进货清单</el-button
               >
-              <!-- <el-popconfirm title="你是否上架该商品?"
-                             @confirm="onUpdate(scope.row)"
-                             v-if="scope.row.status == 0"
-                             v-permission="'goods/updateGoodsStatus'">
-                <el-button slot="reference"
-                           type="text">上架</el-button>
-              </el-popconfirm> -->
-              <!-- v-permission="'goods/updateGoodsStatus'" -->
               <el-button
                 v-if="
                   scope.row.status == 0 && permission('goods/updateGoodsStatus')
@@ -348,28 +340,14 @@
               >
               <el-button
                 v-if="
-                  scope.row.status == 1 && permission('goods/updateGoodsStatus')
+                  scope.row.status == 1 && permission('goods/updateGoodsStatus/downGoods')
                 "
                 @click="onUpdate(scope.row, 1)"
                 type="text"
                 >下架</el-button
               >
-              <!-- <el-popconfirm title="你是否下架该商品?"
-                             @confirm="onUpdate(scope.row)"
-                             v-if="scope.row.status == 1"
-                             v-permission="'goods/updateGoodsStatus'">
-                <el-button slot="reference"
-                           type="text">下架</el-button>
-              </el-popconfirm> -->
-              <!-- {{ scope.row.status }} -->
-              <!-- v-permission="scope.row.complementGoodsIdList ? 'goods/update' : '/shopOperation'" -->
               <el-button
-                v-if="
-                  scope.row.status == 0 &&
-                  (scope.row.complementGoodsIdList
-                    ? 'goods/update'
-                    : '/shopOperation')
-                "
+                v-if="scope.row.status == 0 && permission('/shopOperation/updateShop')"
                 @click="onShopOperation('update', scope.row)"
                 type="text"
                 >修改</el-button
@@ -377,16 +355,13 @@
               <el-button
                 v-if="
                   scope.row.status == 1 &&
-                  permission(
-                    scope.row.complementGoodsIdList
-                      ? 'goods/update'
-                      : '/shopOperation'
-                  )
+                  permission('/shopOperation/shopLook')
                 "
                 @click="onShopOperation('look', scope.row)"
                 type="text"
-                >查看</el-button
-              >
+                >查看</el-button>
+
+              <el-button v-if="permission('/shopOperation/copyShop')" @click="onShopOperation('copy', scope.row)" type="text" >复制</el-button>
               <!-- <el-button v-if="scope.row.status == 0"
                          v-permission="'goods/del'"
                          @click="onDelete(scope.row)"
@@ -711,7 +686,7 @@ import { getToken } from "@/utils/auth";
 import { goodsType } from "@/utils/searchArray";
 import load from "@/utils/loading";
 import { permission } from "@/utils/directivePage";
-import courseEvaluateVue from '@/views/teamDetail/componentCourse/courseEvaluate.vue';
+// import courseEvaluateVue from '@/views/teamDetail/componentCourse/courseEvaluate.vue';
 let validPrice = (rule, value, callback) => {
   if ((value == "" && typeof value == "string") || value == null) {
     callback(new Error("请输入金额"));
@@ -780,6 +755,7 @@ export default {
         create: "添加",
         update: "修改",
         look: "查看",
+        copy: "复制"
       },
       addDisabled: false,
       form: {
@@ -1056,7 +1032,6 @@ export default {
       params.page = this.pageInfo.page;
       goodsQuery(params).then((res) => {
         if (res.code == 200 && res.data) {
-          
           this.tableList = res.data.rows;
           this.pageInfo.total = res.data.total;
         }
@@ -1148,7 +1123,7 @@ export default {
       this.addType = type;
       this.addDisabled = type == "look" ? true : false;
       // 判断是否是修改组合商品
-      if ((type == "update" || type == "look") && row.complementGoodsIdList) {
+      if ((type == "update" || type == "look" || type == 'copy') && row.complementGoodsIdList) {
         this.routeShopStatus = true;
 
         let form = this.form;
@@ -1177,6 +1152,8 @@ export default {
           pageTitle = "修改";
         } else if (type == "look") {
           pageTitle = "查看";
+        } else if(type == 'copy') {
+          pageTitle = '复制'
         }
         this.$router.push(
           {
@@ -1292,18 +1269,18 @@ export default {
           form.complementGoodsIdList = tempIds.join(",");
           form.courseViewType = form.courseViewType.join(',')
           form.goodsList = null;
-          if (this.addType == "create") {
+          if (this.addType == "create" || this.addType == "copy") {
             if (this.form.id) {
               // 判断有没有Id,如果有则删除
               delete this.form.id;
             }
             form.status = "NO"; // 默认上架
             goodsAdd(cleanDeep(form)).then((res) => {
-              this.messageTips("添加", res);
+              this.messageTips("保存", res);
             });
           } else if (this.addType == "update") {
             goodsUpdate(cleanDeep(form)).then((res) => {
-              this.messageTips("修改", res);
+              this.messageTips("保存", res);
             });
           }
         } else {

+ 5 - 4
src/views/businessManager/shopManager/shopOperation.vue

@@ -239,7 +239,7 @@
         </el-form-item>
         <el-form-item v-if="!pageDisabled">
           <el-button @click="onSubmit('form')" type="primary"
-            >立即{{ pageType == "create" ? "创建" : "修改" }}</el-button
+            >保存</el-button
           >
           <el-button @click="onReSet('form')">重置</el-button>
         </el-form-item>
@@ -288,6 +288,7 @@ export default {
         create: "添加",
         update: "修改",
         look: "查看",
+        copy: "复制"
       },
       pageDisabled: false,
       headers: {
@@ -476,18 +477,18 @@ export default {
         if (valid) {
           let tempForm = JSON.parse(JSON.stringify(this.form))
           tempForm.courseViewType = tempForm.courseViewType.join(',')
-          if (this.pageType == "create") {
+          if (this.pageType == "create" || this.pageType == 'copy') {
             if (tempForm.id) {
               // 判断有没有Id,如果有则删除
               delete tempForm.id;
             }
             tempForm.status = "NO"; // 默认上架
             goodsAdd(tempForm).then((res) => {
-              this.messageTips("添加", res);
+              this.messageTips("保存", res);
             });
           } else if (this.pageType == "update") {
             goodsUpdate(tempForm).then((res) => {
-              this.messageTips("修改", res);
+              this.messageTips("保存", res);
             });
           }
         } else {