afa 4 місяців тому
батько
коміт
ea384b4079

+ 2 - 2
app/admin/controller/shop/ShopList.php

@@ -44,9 +44,9 @@ class ShopList extends Backend
         if($this->request->isAjax()){
             $ids = $this->request->post('ids/d', 0);
             $params = $this->request->post('');
-            if(empty($params['all_data']) || empty($ids)) return resp_json(0, '参数错误');
+            if(empty($ids)) return resp_json(0, '请选择店铺规格');
             $this->model->where('id', $ids)->save([
-                'type_spec'  => json_encode($params['all_data'], JSON_UNESCAPED_UNICODE),
+                'type_spec'  => isset($params['all_data'])?json_encode($params['all_data'], JSON_UNESCAPED_UNICODE):null,
             ]);
             return resp_json(200,'操作成功');
         }else{

+ 4 - 6
app/admin/view/shop/customer_spec/add.html

@@ -8,7 +8,7 @@
             </el-tab-pane>
 
             <el-table :data="tableData" style="width: 100%" border :ref="'multipleTable_' + tabValue" stripe
-                @selection-change="handleSelectionChange">
+                @select="handleSelectionChange">
                 <el-table-column type="selection" width="55">
                 </el-table-column>
                 <el-table-column prop="name" label="规格" align="center">
@@ -80,9 +80,9 @@
 
             },
             handleSelectionChange(e) {
-                if (e.length > 0) {
-                    this.allData[this.tabValue] = e || []
-                }
+                // if (e.length > 0) {
+                this.allData[this.tabValue] = e || []
+                // }
             },
             handleClick(data, row) {
                 // 品种切换事件 可以在这里请求规格接口
@@ -138,7 +138,6 @@
                                         }
 
                                     });
-                                    console.log(matched, "type2matched");
                                     if (matched) {
                                         // this.tableData[index] = { name: 'kam', value: 3, price: '111', type_id: '4', packet: '3' }
                                         if (matched.product_id) {
@@ -182,7 +181,6 @@
                 if (!acc[key]) {
                     acc[key] = [];
                 }
-                console.log(item)
                 item.value = item.product_id
                 item.packet = item.box_id
                 acc[key].push(item);

+ 3 - 3
app/admin/view/shop/shop_list/specs.html

@@ -4,7 +4,7 @@
             <el-tab-pane v-for="(item,index) in tabData" :label="item.label" :name="item.value">
             </el-tab-pane>
             <el-table :data="tableData" style="width: 100%" border :ref="'multipleTable_' + tabValue" stripe
-                @selection-change="handleSelectionChange">
+                @select="handleSelectionChange">
                 <el-table-column type="selection" width="55">
                 </el-table-column>
                 <el-table-column prop="name" label="规格" align="center">
@@ -69,9 +69,9 @@
             },
             handleSelectionChange(e) {
                 //console.log(e,"选中的数据")
-                if (e.length > 0) {
+                // if (e.length > 0) {
                     this.allData[this.tabValue] = e || []
-                }
+                // }
             },
             handleClick(data, row) {
                 // 品种切换事件 可以在这里请求规格接口