Quellcode durchsuchen

Merge branch 'master' into 2.0

wenjie vor 1 Jahr
Ursprung
Commit
c779c69ef6

+ 1 - 1
src/views/operationManage/advertisingManage/addAdv.vue

@@ -111,7 +111,7 @@ export default {
           "sort": 0,
           "showSort":0,
           "status":1,
-          "belongType":2
+          "belongType":'2'
         },
       options:[
         {

+ 18 - 8
src/views/operationManage/goodsManage/goodsDetail.vue

@@ -52,10 +52,10 @@
             <el-cascader
               class="item-width-300"
               v-model="setQuery.goodsCateId"
-              show-all-levels
+              :show-all-levels="false"
+              placeholder=""
               :options="typeOptions"
-              :props="{ value: 'id', label: 'cateName', children: 'child' }"
-              clearable
+              :props="{ value: 'id', label: 'cateName', children: 'child', emitPath: false }"
             ></el-cascader>
           </el-form-item>
 
@@ -736,9 +736,21 @@ export default Vue.extend({
     getData() {
       getData().then((res) => {
         if (res.state == "Success") {
-          this.typeOptions = res.content;
+          this.typeOptions = res.content.map(e=>{
+            try{
+              e.child.map(
+              r=>{
+                delete r.child
+                return r
+              }
+            )
+            }catch(e){
+              console.log(e);
+            }
+            return e
+          });
         }
-      });
+      })
     },
     // 规则
     getRuleList() {
@@ -765,9 +777,7 @@ export default Vue.extend({
         this.loading = false;
         if (res.state == "Success") {
           this.setQuery = res.content;
-          this.setQuery.goodsCateId = this.setQuery.goodsCateId
-            .split(",")
-            .map((item) => Number(item));
+          this.setQuery.goodsCateId = Number(this.setQuery.goodsCateId);
             // 初始化购买设置
             if (!this.setQuery.goodsSets.length) {
                 this.setQuery.goodsSets = [];

+ 18 - 3
src/views/studyManage/menuManage/addMenu.vue

@@ -80,14 +80,16 @@
           </el-option>
         </el-select>
       </el-form-item>
-       <el-form-item label="商品分类:" v-if="setQuery.parentId" prop="goodsCateId">
+       <el-form-item label="商品分类:"  prop="goodsCateId">
        <el-cascader
        class="item-width-300"
         v-model="setQuery.goodsCateId"
         :options="typeOptions"
+        :show-all-levels="false"
         :props="{
           value:'id',
           label:'cateName',
+          emitPath: false,
           children:'child'
         }"
         ></el-cascader>
@@ -247,7 +249,19 @@ export default {
     getData(){
       getData().then(res=>{
         if(res.state == 'Success'){
-          this.typeOptions = res.content
+          this.typeOptions = res.content.map(e=>{
+            try{
+              e.child.map(
+              r=>{
+                delete r.child
+                return r
+              }
+            )
+            }catch(e){
+              console.log(e);
+            }
+            return e
+          });
         }
       })
     },
@@ -269,9 +283,10 @@ export default {
         this.setQuery.sort = menuInfo.sort
         this.setQuery.colour = menuInfo.colour
         this.setQuery.status = menuInfo.status
+        this.setQuery.belongType = menuInfo.belongType
         this.setQuery.templateType = menuInfo.templateType
         this.setQuery.secondaryImg = menuInfo.secondaryImg
-        this.setQuery.goodsCateId = menuInfo.goodsCateId.split(',')
+        this.setQuery.goodsCateId = +menuInfo.goodsCateId
 
     }
       this.setQuery.parentId = this.$route.query.parentId