Pārlūkot izejas kodu

视图管理-1.增加了点击库位弹窗操作功能(占用,锁定,查看库存,清空库存)2.根据库区搜索功能

(cherry picked from commit 08f2a9f54e47324d5ef7222a4b6efdeb9380bb6a)
LZH 2 gadi atpakaļ
vecāks
revīzija
110a57a414

+ 24 - 29
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warewms/ams/LocationViewController.java

@@ -1,19 +1,20 @@
 package com.ruoyi.web.controller.warewms.ams;
 
 import com.ruoyi.ams.inv.mapper.InvLotLocIdMapper;
+import com.ruoyi.ams.inv.service.IInvLotLocIdService;
 import com.ruoyi.ams.locationView.domain.form.LocationViewForm;
 import com.ruoyi.ams.locationView.domain.vo.LocationViewVO;
 import com.ruoyi.ams.locationView.service.LocationViewService;
+import com.ruoyi.base.constant.Constant;
 import com.ruoyi.base.domain.BaseLocationInfo;
 import com.ruoyi.base.domain.dto.BasLocationGuiExtDTO;
 import com.ruoyi.base.service.IBaseLocationInfoService;
+import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
 
@@ -32,6 +33,8 @@ public class LocationViewController extends BaseController {
     private IBaseLocationInfoService baseLocationInfoService;
     @Autowired
     private InvLotLocIdMapper invLotLocIdMapper;
+    @Autowired
+    private IInvLotLocIdService invLotLocIdService;
 
     @GetMapping(value = "/view")
     public AjaxResult getInfo(LocationViewForm locationViewForm) {
@@ -47,34 +50,26 @@ public class LocationViewController extends BaseController {
 
     @GetMapping(value = "/lockLoc/{id}")
     public AjaxResult lockLoc(@PathVariable("id") Long id) {
-        BaseLocationInfo baseLocationInfo = baseLocationInfoService.selectBaseLocationInfoById(id);
-        if (baseLocationInfo != null) {
-            if (baseLocationInfo.getStockStatus().equals("00")) {
-                baseLocationInfoService.updateLocationStockStatus(id, "10");
-                return AjaxResult.success("锁定成功");
-            } else {
-                baseLocationInfoService.updateLocationStockStatus(id, "00");
-                return AjaxResult.success("解锁成功");
-            }
-        } else {
-            return AjaxResult.error("查询不到对应的库位");
-        }
+        return invLotLocIdService.adjLocationStockStatus(id.toString(), Constant.WAREHOUSE_ID
+                , logger.getName());
     }
 
     @GetMapping(value = "/clearLoc/{id}")
     public AjaxResult clearLoc(@PathVariable("id") Long id) {
-        BaseLocationInfo baseLocationInfo = baseLocationInfoService.selectBaseLocationInfoById(id);
-        if (baseLocationInfo != null) {
-            if (baseLocationInfo.getStockStatus().equals("00")) {
-                baseLocationInfo.setIsEmpty("Y");
-                baseLocationInfoService.updateBaseLocationInfo(baseLocationInfo);
-                invLotLocIdMapper.deleteInvLotLocIdByLocationId(baseLocationInfo.getId());
-                return AjaxResult.success("清空成功");
-            } else {
-                return AjaxResult.error("锁定中的库位无法清空");
-            }
-        } else {
-            return AjaxResult.error("查询不到对应的库位");
-        }
+        return invLotLocIdService.clear(id.toString(),Constant.WAREHOUSE_ID, logger.getName());
+    }
+
+    /**
+     * 库存是否有货状态调整
+     *
+     * @param locationId
+     * @return
+     */
+    @Log(title = "PDA库存状态调整", businessType = BusinessType.UPDATE)
+
+    @GetMapping(value = "/setIsEmpty/{id}")
+    public AjaxResult adjLocationIsEmpty(@PathVariable("id") Long id) {
+
+        return invLotLocIdService.adjLocationIsEmpty(id.toString(), Constant.WAREHOUSE_ID, logger.getName());
     }
 }

+ 7 - 0
ruoyi-ui/src/api/ams/locationView.js

@@ -29,3 +29,10 @@ export function clearLocRequest(id) {
     method: 'get'
   })
 }
+
+export function occupyLocRequest(id) {
+  return request({
+    url: '/ams/locationView/setIsEmpty/'+id,
+    method: 'get'
+  })
+}

+ 160 - 4
ruoyi-ui/src/views/ams/inv/locationView/index.vue

@@ -19,6 +19,32 @@
           </div>
         </div>
       </el-header>
+      <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="600px" label-position="right">
+        <el-form-item label="仓库" prop="warehouseId" v-show="false">
+          <el-select v-model="queryParams.warehouseId" placeholder="请选择所属仓库" clearable size="small" style="width: 100%" >
+            <el-option
+              v-for="dict in this.warehouseCombo"
+              :key="dict.warehouseId"
+              :label="dict.warehouseName"
+              :value="dict.warehouseId"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="区域" prop="zoneId">
+          <el-select v-model="queryParams.zoneId" placeholder="请选择库区" clearable size="small" style="width: 100%">
+            <el-option
+              v-for="dict in this.locationZoneCombo"
+              :key="dict.zoneId"
+              :label="dict.zoneName"
+              :value="dict.zoneId"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item>
+          <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+          <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+        </el-form-item>
+      </el-form>
       <el-main>
         <el-card v-for="zone in locationZoneList" v-bind:key="zone.zoneName" class="box-card">
           <div slot="header" class="clearfix">
@@ -50,14 +76,48 @@
           </div>
         </el-card>
       </el-main>
+      <!-- 点击库位弹出展示框做修改  -->
+      <el-dialog title="操作" :visible.sync="open" width="1000px" append-to-body>
+        <el-form>
+          <el-form-item>
+            <el-button type="primary" @click="lockLoc()">锁定/解锁</el-button>
+            <el-button type="primary" @click="occupyLoc()">有货/无货</el-button>
+            <el-button type="primary" @click="clearLoc()">清空</el-button>
+            <!--<el-button type="primary" @click="submitForm">初始化一个空托盘</el-button>-->
+          </el-form-item>
+        </el-form>
+        <el-divider content-position="center">批次属性信息</el-divider>
+        <el-table v-loading="loading" :data="form.lotattList">
+          <el-table-column label="物料" align="center" prop="sku" width="200"/>
+          <el-table-column label="物料名称" align="center" prop="skuName" width="200"/>
+          <el-table-column label="库位" align="center" prop="locationNo" width="200"/>
+          <el-table-column label="库存数量" align="center" prop="qty"/>
+          <el-table-column label="已分配数量" align="center" prop="qtyallocated" width="200"/>
+          <el-table-column
+            v-for="(item, index) in itemOption"
+            :key="index_back"
+            :label="item.label"
+            align="center" :prop="item.prop" width="200">
+          </el-table-column>
+        </el-table>
+        <!--<el-descriptions title="批次属性" :column="2" border>
+          <el-descriptions-item v-for="(item, index) in itemOption" :label="item.label">{{form[`${item.prop}`]}}</el-descriptions-item>
+        </el-descriptions>-->
+      </el-dialog>
     </el-container>
 </template>
 <script>
-import { locationInvView } from "@/api/ams/locationView";
+import {clearLocRequest, locationInvView, lockLocRequest, occupyLocRequest} from "@/api/ams/locationView";
+import {lotattInfo} from "@/api/ams/invLotLocId";
+import {lotattConfigList} from "@/api/ams/config";
+import {queryWarehouseDict} from "@/api/base/warehouse";
+import {queryLocationZoneDict} from "@/api/base/locationZone";
 
   export default {
     data () {
       return {
+        open: false,
+        showSearch: true,
         dataForm: {
           zoneId: ''
         },
@@ -67,7 +127,30 @@ import { locationInvView } from "@/api/ams/locationView";
         },
         locationZoneList: [],
         locationList: {'a': [1, 2, 3]},
-        locationClearVisible: false
+        locationClearVisible: false,
+        // 表单参数
+        form: {
+          lotatt01: '',
+          lotatt02: '',
+          lotatt03: '',
+          lotatt04: '',
+          lotatt05: '',
+          lotatt06: '',
+          lotatt07: '',
+          lotatt08: '',
+          lotatt09: '',
+          lotatt10: '',
+          lotatt11: '',
+          lotatt12: '',
+          lotatt13: '',
+          lotatt14: '',
+          lotatt15: '',
+          lotatt16: '',
+          lotatt17: '',
+          lotatt18: '',
+          lotattList: null
+        },
+        itemOption: []
       }
     },
     mounted () {
@@ -84,14 +167,87 @@ import { locationInvView } from "@/api/ams/locationView";
     methods: {
       getDataList () {
         this.dataListLoading = true
+        queryWarehouseDict().then(response => {
+          this.warehouseCombo = response.data
+        });
+        queryLocationZoneDict().then(response => {
+          this.locationZoneCombo = response.data
+        })
         locationInvView(this.queryParams).then(response => {
           this.locationZoneList = response.data
         })
         this.dataListLoading = false
       },
       changeLocation(o){
+        this.selected(o)
         // alert(o.locationNo);
-      }
+      },
+      resetQuery() {//重置搜索
+        this.resetForm("queryForm");
+        this.getDataList();
+        this.handleQuery();
+      },
+      selected(item) {
+        if (item.locationNo) {
+          this.currentSelect = parseInt(item.id)
+          this.open = true;
+          lotattInfo(this.currentSelect).then(response => {
+            this.form.lotattList = response.data
+            this.loading = false;
+          })
+        }
+        lotattConfigList().then(response => {
+          let data = response.data
+          for(let i=0;i<data.length;i++) {
+            let obj = new Object();
+            obj.label = data[i].lotattName
+            obj.prop = data[i].lotattId
+            this.itemOption.push(obj)
+          }
+        })
+      },
+      lockLoc() {
+        let that = this
+        this.$modal.confirm('是否确认要锁定/解锁?').then(function() {
+          lockLocRequest(that.currentSelect).then(response => {
+            if (response.code === 200) {
+              that.open = false;
+              that.$modal.msgSuccess(response.msg);
+              that.search();
+            } else {
+              that.$modal.msgError(response.msg);
+            }
+          });
+        });
+      },
+      occupyLoc() {
+        let that = this
+        this.$modal.confirm('是否确认要修改库位状态?').then(function() {
+        occupyLocRequest(that.currentSelect).then(response => {
+          if (response.code === 200) {
+            that.open = false;
+            that.$modal.msgSuccess(response.msg);
+            that.search();
+          } else {
+            that.$modal.msgError(response.msg);
+          }
+          });
+        });
+      },
+      clearLoc() {
+        let that = this
+        this.$modal.confirm('是否确认要清空库存?').then(function() {
+          clearLocRequest(that.currentSelect).then(response => {
+            if (response.code === 200) {
+              that.open = false;
+              that.$modal.msgSuccess(response.msg);
+              that.search();
+            } else {
+              that.$modal.msgError(response.msg);
+            }
+          });
+        });
+      },
     }
   }
 </script>
@@ -163,7 +319,7 @@ import { locationInvView } from "@/api/ams/locationView";
   height: 30px;
   width: 80px;
   text-align: center;
-  margin-top: 10px;
+  margin-top: 42.5px;
   padding-top: 5px;
 }