Browse Source

默认仓库不可编辑删除

chenrui 4 years ago
parent
commit
1bc66af1a6

+ 3 - 2
src/views/inventoryManagement/warehouse/list.vue

@@ -31,9 +31,10 @@
       bordered>
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
+        <!-- record.sysFlag表示该仓库是否默认,为默认仓库时则不可删除不可编辑 -->
         <a-button size="small" v-if="$hasPermissions('M_inventory_warehouse_storingLocation')" type="link" @click="goStoringLocation(record)" id="warehouseList-storingLocation-btn">仓位管理</a-button>
-        <a-button size="small" v-if="$hasPermissions('B_inventory_warehouse_edit')" type="link" @click="handleEdit(record)" id="warehouseList-edit-btn">编辑</a-button>
-        <a-button size="small" v-if="$hasPermissions('B_inventory_warehouse_del')" type="link" @click="handleDel(record)" id="warehouseList-del-btn">删除</a-button>
+        <a-button size="small" v-if="$hasPermissions('B_inventory_warehouse_edit') && record.sysFlag==0" type="link" @click="handleEdit(record)" id="warehouseList-edit-btn">编辑</a-button>
+        <a-button size="small" v-if="$hasPermissions('B_inventory_warehouse_del') && record.sysFlag==0" type="link" @click="handleDel(record)" id="warehouseList-del-btn">删除</a-button>
       </template>
     </s-table>
     <!-- 新增/编辑仓库 -->

+ 3 - 2
src/views/inventoryManagement/warehouse/storingLocation/list.vue

@@ -39,8 +39,9 @@
         bordered>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
-          <a-button size="small" v-if="$hasPermissions('B_inventory_warehouse_storingLocation_edit')" type="link" @click="handleEdit(record)" id="storingLocationList-edit-btn">编辑</a-button>
-          <a-button size="small" v-if="$hasPermissions('B_inventory_warehouse_storingLocation_del')" type="link" @click="handleDel(record)" id="storingLocationList-del-btn">删除</a-button>
+          <!-- record.sysFlag表示该仓库是否默认,为默认仓库时则不可删除不可编辑 -->
+          <a-button size="small" v-if="$hasPermissions('B_inventory_warehouse_storingLocation_edit') && record.sysFlag==0" type="link" @click="handleEdit(record)" id="storingLocationList-edit-btn">编辑</a-button>
+          <a-button size="small" v-if="$hasPermissions('B_inventory_warehouse_storingLocation_del') && record.sysFlag==0" type="link" @click="handleDel(record)" id="storingLocationList-del-btn">删除</a-button>
         </template>
       </s-table>
     </a-card>