chenrui 9 mesiacov pred
rodič
commit
88689f8c83

+ 10 - 2
src/views/easyPassManagement/shoppingManagement/list.vue

@@ -72,7 +72,7 @@
             type="link"
             class="button-error"
             @click="handleDel(record)"
-            v-if="$hasPermissions('B_delCategory')&&((record.type=='root'&&(record.shopCategoryCount==0&&record.shopProductCount==0))||record.type!='root')"
+            v-if="$hasPermissions('B_delCategory')"
             :id="'shoppingManagementList-del-btn'+record.id">删除</a-button>
         </template>
       </a-table>
@@ -198,9 +198,17 @@ export default {
     // 删除
     handleDel (row) {
       const _this = this
+      if (row.shopCategoryCount > 0) {
+        _this.$message.warning('请先删除子类目!')
+        return
+      }
+      if (row.shopProductCount > 0) {
+        _this.$message.warning('请先删除关联产品!')
+        return
+      }
       this.$confirm({
         title: '提示',
-        content: '删除后,关联的产品会同步删除,确认删除吗?',
+        content: '删除后数据不可恢复,确认删除吗?',
         centered: true,
         onOk () {
           _this.spinning = true