Browse Source

优化位置修改

LinWuTai 1 year ago
parent
commit
26b0006ff4

+ 9 - 1
ruoyi-admin/src/main/java/com/ruoyi/asset/service/impl/TbLocationServiceImpl.java

@@ -183,7 +183,15 @@ public class TbLocationServiceImpl implements ITbLocationService
 
         String sequence = getSequence(parentId, tbLocation.getId());
         tbLocation.setSequence(sequence);
-        return tbLocationMapper.updateTbLocation(tbLocation);
+        int result = tbLocationMapper.updateTbLocation(tbLocation);
+        if (result > 0) {
+            String fileUrl = getFileUrl(tbLocation.getNumber());
+            File file = new File(fileUrl);
+            if (file.isFile() && file.exists()) {
+                file.delete();
+            }
+        }
+        return result;
     }
 
     private String getSequence(Long parentId, Long locationId) {

+ 0 - 8
ruoyi-ui/src/views/inventory/inventory/index.vue

@@ -224,14 +224,6 @@
           </el-date-picker>
         </el-form-item>
         <el-form-item label="盘点位置" prop="inventoryLocation">
-          <!-- <el-select v-model="form.inventoryLocation" placeholder="请选择盘点位置">
-            <el-option
-              v-for="item in locationList"
-              :key="item.number"
-              :label="item.name"
-              :value="item.number"
-            ></el-option>
-          </el-select> -->
           <treeselect v-model="form.inventoryLocation" :options="locationOption" :normalizer="tenantIdnormalizer" placeholder="选择位置" />
         </el-form-item>
         <el-form-item label="备注" prop="remark">