chenrui 9 hónapja
szülő
commit
f89f206666

+ 11 - 5
src/views/easyPassManagement/shoppingManagement/list.vue

@@ -15,7 +15,7 @@
         :columns="columns"
         :pagination="false"
         :dataSource="loadDataList"
-        :scroll="{ y: tableHeight }"
+        :scroll="{ y: tableHeight+70 }"
         @expand="expandChild"
         bordered>
         <!-- 图片 -->
@@ -43,12 +43,12 @@
             class="button-info"
             @click="handleEdit(record,'edit')"
             :id="'shoppingManagementList-edit-btn'+record.id">编辑</a-button>
-          <!-- v-if="record.type && record.type == 'root'" -->
           <a-button
             size="small"
             type="link"
             class="button-info"
             @click="handleEdit(record,'addChild')"
+            v-if="record.type && record.type == 'root'"
             :id="'shoppingManagementList-addChild-btn'+record.id">添加子类目</a-button>
           <a-button
             size="small"
@@ -167,7 +167,6 @@ export default {
     },
     // 添加产品
     handleAddProduct (row) {
-      debugger
       this.$router.push({ name: 'chooseProductList', params: { sn: row.categorySn } })
     },
     // 删除
@@ -182,7 +181,14 @@ export default {
           shopCategoryDel({ categorySn: row.categorySn }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
-              _this.$refs.table.refresh()
+              if (row.type === 'root') {
+                const pos = _this.loadDataList.findIndex(item => item.categorySn === row.categorySn)
+                _this.loadDataList.splice(pos, 1)
+              } else {
+                const pos = _this.loadDataList.findIndex(item => item.categorySn === row.parentSn)
+                const indexNum = _this.loadDataList[pos].children.findIndex(con => { con.categorySn === row.categorySn })
+                _this.loadDataList[pos].children.splice(indexNum, 1)
+              }
               _this.spinning = false
             } else {
               _this.spinning = false
@@ -249,7 +255,7 @@ export default {
 </script>
 <style lang="less">
   .shoppingManagementList-wrap{
-    height: 100%;
+    height: 99%;
     .addType-img{
       img{
         object-fit: cover;

+ 1 - 0
src/views/easyPassManagement/shoppingProducts/list.vue

@@ -141,6 +141,7 @@ export default {
       },
       chooseTypeList: [],
       showProModal: false,
+      productType: [],
       queryParam: {
         productName: '', // 产品名称
         queryWord: '', // 产品编码/原厂编码