Sfoglia il codice sorgente

库位库存查询

andy 3 anni fa
parent
commit
a611427ea1

+ 20 - 6
ruoyi-ui/src/views/ams/invLotLocId/index.vue

@@ -1,10 +1,19 @@
 <template>
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
-      <el-form-item label="跟踪号" prop="traceid">
+      <el-form-item label="物料" prop="sku">
         <el-input
-          v-model="queryParams.traceid"
-          placeholder="请输入跟踪号"
+          v-model="queryParams.sku"
+          placeholder="请输入物料"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="库位" prop="locationNo">
+        <el-input
+          v-model="queryParams.locationNo"
+          placeholder="请输入库位编号"
           clearable
           size="small"
           @keyup.enter.native="handleQuery"
@@ -63,8 +72,12 @@
     </el-row>-->
 
     <el-table v-loading="loading" :data="invLotLocIdList" @selection-change="handleSelectionChange">
-      <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="批次号" align="center" prop="lotnum" width="200"/>
+      <el-table-column label="lotnum" align="center" prop="lotnum" width="200"/>
+      <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 tableOption"
         :key="index"
@@ -178,7 +191,8 @@ export default {
       queryParams: {
         pageNum: 1,
         pageSize: 10,
-        traceid: null,
+        sku: null,
+        locationNo: null
       },
       // 表单参数
       form: {},

+ 265 - 0
ruoyi-ui/src/views/ams/inv/locationView/index.vue

@@ -0,0 +1,265 @@
+<template>
+  <div class="app-container">
+  </div>
+</template>
+
+<script>
+  import {
+    listFlowConfig,
+    getFlowConfig,
+    updateFlowConfig,
+    listLotattConfig,
+    flowConfigLotatt
+  } from "@/api/ams/flowConfig";
+  import {choseFlow, exec} from "@/api/ams/lineCall";
+  import {querySkuDict} from "@/api/base/baseSku";
+  import {querySupplierDict} from "@/api/base/supplier";
+  import {treeselect} from "@/api/base/locationInfo";
+  import {inputTag} from "@/utils/combo/dict";
+
+  export default {
+    name: "FlowConfig",
+    dicts: ['sys_yes_no', 'ams_inv_quality'],
+    data() {
+      return {
+        // 遮罩层
+        loading: true,
+        // 选中数组
+        ids: [],
+        // 子表选中数据
+        checkedFlowConfigDetails: [],
+        // 非单个禁用
+        single: true,
+        // 非多个禁用
+        multiple: true,
+        // 显示搜索条件
+        showSearch: true,
+        // 总条数
+        total: 0,
+        // 流程配置头表格数据
+        flowConfigList: [],
+        // 流程配置体表格数据
+        flowConfigDetailsList: [],
+        // 弹出层标题
+        title: "",
+        // 是否显示弹出层
+        open: false,
+        // 查询参数
+        queryParams: {
+          pageNum: 1,
+          pageSize: 10,
+          flowName: null,
+        },
+        // 表单参数
+        form: {},
+        // 表单校验
+        rules: {
+          flowName: [
+            {required: true, message: "流程名称不能为空", trigger: "blur"}
+          ],
+        },
+        defaultProps: {
+          children: "children",
+          label: "label"
+        },
+        inputTagCombo: inputTag,
+        supplierCombo: [],
+        skuTypeCombo: undefined,
+        locationFromOptions: undefined,
+        locationToOptions: undefined,
+        locationFromCombo: undefined,
+        locationToCombo: undefined
+      };
+    },
+    created() {
+      this.init();
+      this.getList();
+    },
+    methods: {
+      /** 查询流程配置头列表 */
+      getList() {
+        this.loading = true;
+        listFlowConfig(this.queryParams).then(response => {
+          this.flowConfigList = response.rows;
+          this.total = response.total;
+          this.loading = false;
+        });
+      },
+      // 取消按钮
+      cancel() {
+        this.open = false;
+        this.reset();
+      },
+      // 表单重置
+      reset() {
+        this.form = {
+          id: null,
+          flowName: null,
+          sku: '',
+          skuTypeFlag: 'Choice',
+          qty: null,
+          qtyFlag: 'Choice',
+          weight: null,
+          weightFlag: 'Choice',
+          supplier: '',
+          supplierFlag: 'Choice',
+          locationFrom: null,
+          locationFromFlag: null,
+          locationTo: null,
+          locationToFlag: null,
+          createBy: null,
+          createTime: null,
+          updateBy: null,
+          updateTime: null,
+          remark: null,
+          lineCallDetailsFormList: null
+        };
+        this.flowConfigDetailsList = [];
+        this.resetForm("form");
+      },
+      /** 搜索按钮操作 */
+      handleQuery() {
+        this.queryParams.pageNum = 1;
+        this.getList();
+      },
+      /** 重置按钮操作 */
+      resetQuery() {
+        this.resetForm("queryForm");
+        this.handleQuery();
+      },
+      // 多选框选中数据
+      handleSelectionChange(selection) {
+        this.ids = selection.map(item => item.id)
+        this.single = selection.length !== 1
+        this.multiple = !selection.length
+      },
+      /** 新增按钮操作 */
+      handleAdd() {
+        this.reset();
+        this.open = true;
+        this.title = "添加流程配置";
+      },
+      /** 修改按钮操作 */
+      handleUpdate(row) {
+        this.reset();
+        const id = row.id || this.ids
+        // 加载批次属性明细
+        flowConfigLotatt(id).then(response => {
+          this.flowConfigDetailsList = response.data;
+        });
+        choseFlow(id).then(response => {
+          this.locationFromCombo = response.locationFrom
+          this.locationToCombo = response.locationTo
+          this.form.skuTypeFlag = response.skuTypeFlag
+          this.form.qtyFlag = response.qtyFlag
+          this.form.weightFlag = response.weightFlag
+          this.form.supplierFlag = response.supplierFlag
+          this.form.locationFromFlag = response.locationFromFlag
+          this.form.locationToFlag = response.locationToFlag
+          this.skuTypeCombo = response.skuList;
+          this.open = true;
+          this.title = "线边呼叫";
+        });
+      },
+      /** 提交按钮 */
+      submitForm() {
+        this.$refs["form"].validate(valid => {
+          if (valid) {
+            if (this.form.skuTypeFlag === 'Required' && this.form.skuType === '') {
+              this.$modal.msgError("物料必须选择");
+              return
+            }
+            if (this.form.qtyFlag === 'Required' && this.form.qty === null) {
+              this.$modal.msgError("数量必须输入");
+              return
+            }
+            if (this.form.weightFlag === 'Required' && this.form.weight === null) {
+              this.$modal.msgError("重量必须输入");
+              return
+            }
+            if (this.form.supplierFlag === 'Required' && this.form.supplier === null) {
+              this.$modal.msgError("供应商必须输入");
+              return
+            }
+            if (this.form.locationFromFlag === 'Required' && this.form.locationFrom === null) {
+              this.$modal.msgError("必须选择起点位置");
+              return
+            }
+            if (this.form.locationToFlag === 'Required' && this.form.locationTo === null) {
+              this.$modal.msgError("必须选择终点位置");
+              return
+            }
+
+            if (this.flowConfigDetailsList.length > 0) {
+              for (let i = 0; i < this.flowConfigDetailsList.length; i++) {
+                if (this.flowConfigDetailsList[i].lotattFlag === 'Required') {
+                  if(this.flowConfigDetailsList[i].lotattValue === '' || this.flowConfigDetailsList[i].lotattValue === null) {
+                    this.$modal.msgError(this.flowConfigDetailsList[i].lotattName+"必须输入");
+                    return
+                  }
+                }
+              }
+            }
+
+            let lineCallDetailsFormList = new Array();
+            for (let i = 0; i < this.flowConfigDetailsList.length; i++) {
+              let obj = new Object();
+              obj.lotattId = this.flowConfigDetailsList[i].lotattId
+              obj.lotattValue = this.flowConfigDetailsList[i].lotattValue
+              lineCallDetailsFormList.push(obj)
+            }
+            this.form.lineCallDetailsFormList = lineCallDetailsFormList
+            console.log(this.form)
+            exec(this.form).then(response => {
+              if (response.code === 200) {
+                this.$modal.msgSuccess("执行成功");
+                this.open = false;
+              } else {
+                this.$modal.msgError(response.msg);
+              }
+            });
+          }
+        });
+      },
+      /** 流程配置体序号 */
+      rowFlowConfigDetailsIndex({row, rowIndex}) {
+        row.index = rowIndex + 1;
+      },
+      /** 流程配置体添加按钮操作 */
+      handleAddFlowConfigDetails() {
+        let obj = {};
+        obj.lotattId = "";
+        obj.lotattFlag = "";
+        obj.remark = "";
+        this.flowConfigDetailsList.push(obj);
+      },
+      /** 流程配置体删除按钮操作 */
+      handleDeleteFlowConfigDetails() {
+        if (this.checkedFlowConfigDetails.length == 0) {
+          this.$modal.msgError("请先选择要删除的流程配置体数据");
+        } else {
+          const flowConfigDetailsList = this.flowConfigDetailsList;
+          const checkedFlowConfigDetails = this.checkedFlowConfigDetails;
+          this.flowConfigDetailsList = flowConfigDetailsList.filter(function (item) {
+            return checkedFlowConfigDetails.indexOf(item.index) == -1
+          });
+        }
+      },
+      /** 复选框选中数据 */
+      handleFlowConfigDetailsSelectionChange(selection) {
+        this.checkedFlowConfigDetails = selection.map(item => item.index)
+      },
+      // 筛选节点
+      filterNode(value, data) {
+        if (!value) return true;
+        return data.label.indexOf(value) !== -1;
+      },
+      init() {
+        // 初始化供应商
+        querySupplierDict().then(response => {
+          this.supplierCombo = response.data;
+        });
+      }
+    }
+  };
+</script>

+ 6 - 6
warewms-ams/src/main/java/com/ruoyi/ams/inv/domain/vo/InvLotLocIdLotattVO.java

@@ -13,8 +13,8 @@ public class InvLotLocIdLotattVO {
     private String sku;
     private String skuName;
     private String locationNo;
-    private String qty;
-    private String qtyallocated;
+    private Double qty;
+    private Double qtyallocated;
     private String lotatt01;
     private String lotatt02;
     private String lotatt03;
@@ -202,19 +202,19 @@ public class InvLotLocIdLotattVO {
         this.locationNo = locationNo;
     }
 
-    public String getQty() {
+    public Double getQty() {
         return qty;
     }
 
-    public void setQty(String qty) {
+    public void setQty(Double qty) {
         this.qty = qty;
     }
 
-    public String getQtyallocated() {
+    public Double getQtyallocated() {
         return qtyallocated;
     }
 
-    public void setQtyallocated(String qtyallocated) {
+    public void setQtyallocated(Double qtyallocated) {
         this.qtyallocated = qtyallocated;
     }
 

+ 2 - 1
warewms-ams/src/main/resources/mapper/ams/InvLotLocIdMapper.xml

@@ -258,7 +258,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         left join base_sku_type skt on sk.sku_type = skt.item_code
         <where>
             <if test="zoneId != null  and zoneId != ''"> and b.zone_id = #{zoneId}</if>
-            <if test="sku != null  and sku != ''"> and sk.sku = #{sku}</if>
+            <if test="sku != null  and sku != ''"> and (sk.sku like concat('%', #{sku}, '%') or sk.desc1 like concat('%', #{sku}, '%'))</if>
+            <if test="locationNo != null  and locationNo != ''"> and b.location_no like concat('%', #{locationNo}, '%')</if>
         </where>
         order by lpad(b.row_no, 11, '0'),b.row_index,lpad(b.shift_no, 11, '0'),b.shift_index,lpad(b.col_no, 11, '0'),b.col_index desc
     </select>