手持机部分

This commit is contained in:
张怡蓉
2025-07-16 08:50:33 +08:00
parent 9011cdd938
commit 1c444e5282
16 changed files with 730 additions and 20 deletions

View File

@@ -70,5 +70,13 @@ public class OutMydoJobController extends BaseController {
return mydoJobService.OuthandInvalidation(jobIds); return mydoJobService.OuthandInvalidation(jobIds);
} }
@PreAuthorize("@ss.hasPermi('job:outmydoJob:pointOut')")
@Log(title = "指定货位出库", businessType = BusinessType.INSERT)
@RequestMapping("/pointOut")
public AjaxResult pointOut(@RequestParam("stockIds")String[] stockIds)
{
return mydoJobService.pointOut(stockIds);
}
} }

View File

@@ -1,6 +1,9 @@
package com.ruoyi.job.mydojob.mapper; package com.ruoyi.job.mydojob.mapper;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import com.ruoyi.job.mydojob.domain.MydoJob; import com.ruoyi.job.mydojob.domain.MydoJob;
/** /**
@@ -66,4 +69,6 @@ public interface MydoJobMapper
public int deleteMydoJobByJobIds(String[] jobIds); public int deleteMydoJobByJobIds(String[] jobIds);
void insertHistory(String jobId); void insertHistory(String jobId);
void pointOut(HashMap<String, Object> map);
} }

View File

@@ -83,4 +83,6 @@ public interface IMydoJobService
* 出库手动作废 * 出库手动作废
*/ */
AjaxResult OuthandInvalidation(String [] jobIds); AjaxResult OuthandInvalidation(String [] jobIds);
AjaxResult pointOut(String [] stockIds);
} }

View File

@@ -1,6 +1,7 @@
package com.ruoyi.job.mydojob.service.impl; package com.ruoyi.job.mydojob.service.impl;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.*;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@@ -353,4 +354,24 @@ public class MydoJobServiceImpl implements IMydoJobService {
return AjaxResult.error("任务处理异常"); return AjaxResult.error("任务处理异常");
} }
} }
@Override
public AjaxResult pointOut(String[] stockIds) {
HashMap<String, Object> map = new HashMap<>();
String msg = "";
String Stringbuilder = "";
for(String stockId:stockIds){
map.put("stockId",stockId);
mydoJobMapper.pointOut(map);
String result = map.get("result").toString();
if("10".equals(result)){
msg="操作成功!";
}else{
msg=map.get("v_resultmsg").toString();
}
Stringbuilder+=stockId+msg+"<br/>";
}
return AjaxResult.success(Stringbuilder.toString());
}
} }

View File

@@ -4,10 +4,7 @@ import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.kpi.service.KpiService; import com.ruoyi.kpi.service.KpiService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/** /**
* KPI 统计分析 * KPI 统计分析
@@ -128,4 +125,5 @@ public class KpiController extends BaseController {
@RequestParam("thePlatoon") String thePlatoon){ @RequestParam("thePlatoon") String thePlatoon){
return success(kpiService.getChartMag(warehouseId,theColumn,theFloor,thePlatoon)); return success(kpiService.getChartMag(warehouseId,theColumn,theFloor,thePlatoon));
} }
} }

View File

@@ -42,4 +42,6 @@ public interface KpiService {
Map<String,Object> getChartData(String warehouseId, String roadwayId, String thePlatoon); Map<String,Object> getChartData(String warehouseId, String roadwayId, String thePlatoon);
Map<String,Object> getChartMag(String warehouseId, String theColumn, String theFloor, String thePlatoon); Map<String,Object> getChartMag(String warehouseId, String theColumn, String theFloor, String thePlatoon);
} }

View File

@@ -1,6 +1,6 @@
package com.ruoyi.kpi.service.impl; package com.ruoyi.kpi.service.impl;
import java.util.List; import java.util.*;
import com.ruoyi.bas.cargoSpace.domain.BasCargoSpace; import com.ruoyi.bas.cargoSpace.domain.BasCargoSpace;
import com.ruoyi.bas.cargoSpace.mapper.BasCargoSpaceMapper; import com.ruoyi.bas.cargoSpace.mapper.BasCargoSpaceMapper;
@@ -9,13 +9,6 @@ import com.ruoyi.job.mydojobfinish.mapper.MydoJobFinishMapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
import com.ruoyi.kpi.service.KpiService; import com.ruoyi.kpi.service.KpiService;
/** /**
@@ -448,7 +441,6 @@ public class KpiServiceImpl implements KpiService
return response; return response;
} }
} }

View File

@@ -405,6 +405,14 @@ public class PdaController extends BaseController {
return pdaService.agvRequest(basContainer); return pdaService.agvRequest(basContainer);
} }
/**
* 手持机获取货位分析数据
*/
@RequestMapping("/cargoSpaceAnalysis")
@ResponseBody
public AjaxResult cargoSpaceAnalysis(@RequestParam("warehouseId") String warehouseId){
return success(pdaService.cargoSpaceAnalysis(warehouseId));
}
/** /**
@@ -417,5 +425,13 @@ public class PdaController extends BaseController {
public AjaxResult bindContainer(@RequestBody TrayCodeMakeSure trayCodeMakeSure) { public AjaxResult bindContainer(@RequestBody TrayCodeMakeSure trayCodeMakeSure) {
return pdaService.bindContainer(trayCodeMakeSure); return pdaService.bindContainer(trayCodeMakeSure);
} }
/**
* 手持机获取入出库作业数量
*/
@RequestMapping("/getAisleStatisticsData")
@ResponseBody
public AjaxResult getAisleStatisticsData(@RequestParam("warehouseId") String warehouseId){
return success(pdaService.getAisleStatisticsData(warehouseId));
}
} }

View File

@@ -8,6 +8,7 @@ import org.apache.poi.ss.formula.functions.T;
import org.aspectj.weaver.loadtime.Aj; import org.aspectj.weaver.loadtime.Aj;
import java.util.List; import java.util.List;
import java.util.Map;
public interface PdaService { public interface PdaService {
@@ -36,5 +37,9 @@ public interface PdaService {
AjaxResult agvRequest(BasContainer basContainer); AjaxResult agvRequest(BasContainer basContainer);
Map<String,Object> cargoSpaceAnalysis(String warehouseId);
Map<String,Object> getAisleStatisticsData(String warehouseId);
AjaxResult bindContainer(TrayCodeMakeSure trayCodeMakeSure); AjaxResult bindContainer(TrayCodeMakeSure trayCodeMakeSure);
} }

View File

@@ -22,6 +22,8 @@ import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.in.stockin.service.IInStockinService; import com.ruoyi.in.stockin.service.IInStockinService;
import com.ruoyi.in.stockindetail.domain.InStockinDetail; import com.ruoyi.in.stockindetail.domain.InStockinDetail;
import com.ruoyi.in.stockindetail.service.IInStockinDetailService; import com.ruoyi.in.stockindetail.service.IInStockinDetailService;
import com.ruoyi.job.mydojobfinish.domain.MydoJobFinish;
import com.ruoyi.job.mydojobfinish.mapper.MydoJobFinishMapper;
import com.ruoyi.out.outStockout.domain.OutStockout; import com.ruoyi.out.outStockout.domain.OutStockout;
import com.ruoyi.out.outStockout.service.IOutStockoutService; import com.ruoyi.out.outStockout.service.IOutStockoutService;
import com.ruoyi.out.outStockoutDetail.domain.OutStockoutDetail; import com.ruoyi.out.outStockoutDetail.domain.OutStockoutDetail;
@@ -43,10 +45,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.*;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Service @Service
@@ -81,6 +80,8 @@ public class PdaServiceImp implements PdaService {
@Autowired @Autowired
private IBasStockService basStockService; private IBasStockService basStockService;
@Autowired @Autowired
private MydoJobFinishMapper mydoJobFinishMapper;
@Autowired
private IOutPickSubmitService outPickSubmitService; private IOutPickSubmitService outPickSubmitService;
@Autowired @Autowired
private ITagTaskService tagTaskService; private ITagTaskService tagTaskService;
@@ -533,6 +534,71 @@ public class PdaServiceImp implements PdaService {
return null; return null;
} }
@Override
public Map<String, Object> cargoSpaceAnalysis(String warehouseId) {
BasCargoSpace queryParams = new BasCargoSpace();
queryParams.setWarehouseId(warehouseId);
List<BasCargoSpace> list = basCargoSpaceService.selectBasCargoSpaceList(queryParams);
// 初始化所有可能的状态,默认值为0
Map<String, Integer> statusCount = new LinkedHashMap<>();
statusCount.put("空货位", 0);
statusCount.put("满货位", 0);
statusCount.put("入库分配", 0);
statusCount.put("出库分配", 0);
statusCount.put("入库需盘点", 0);
statusCount.put("出库需盘点", 0);
// 统计实际存在的状态数量
for (BasCargoSpace space : list) {
if (space.getStatus() != null) {
String statusName;
switch (Integer.parseInt(space.getStatus())) {
case 1: statusName = "空货位"; break;
case 2: statusName = "满货位"; break;
case 3: statusName = "入库分配"; break;
case 4: statusName = "出库分配"; break;
case 5: statusName = "入库需盘点"; break;
case 6: statusName = "出库需盘点"; break;
default: continue;
}
statusCount.put(statusName, statusCount.getOrDefault(statusName, 0) + 1);
}
}
// 转换为要求的格式
List<Map<String, Object>> result = new ArrayList<>();
for (Map.Entry<String, Integer> entry : statusCount.entrySet()) {
Map<String, Object> item = new HashMap<>();
item.put("name", entry.getKey());
item.put("value", entry.getValue());
result.add(item);
}
Map<String, Object> response = new HashMap<>();
response.put("data", result);
return response;
}
@Override
public Map<String, Object> getAisleStatisticsData(String warehouseId) {
Map<String, Object> map = new HashMap<>();
MydoJob mydoJob = new MydoJob();
mydoJob.setWarehouseId(warehouseId);
mydoJob.setInOut("1");
List<MydoJob> mydoJobs = mydoJobFinishMapper.selectMydoJobFinishListByMydoJob(mydoJob);
MydoJob mydoJob1 = new MydoJob();
mydoJob1.setWarehouseId(warehouseId);
mydoJob1.setInOut("2");
List<MydoJob> mydoJobs1 = mydoJobFinishMapper.selectMydoJobFinishListByMydoJob(mydoJob1);
map.put("in",mydoJobs.size());
map.put("out",mydoJobs1.size());
return map;
}
@Override @Override
public AjaxResult bindContainer(TrayCodeMakeSure trayCodeMakeSure) { public AjaxResult bindContainer(TrayCodeMakeSure trayCodeMakeSure) {
if (CollUtil.isEmpty(trayCodeMakeSure.getMydoJobDetailList())){ if (CollUtil.isEmpty(trayCodeMakeSure.getMydoJobDetailList())){

View File

@@ -207,4 +207,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectMydoJobVo"/> <include refid="selectMydoJobVo"/>
where mj.status = '3' where mj.status = '3'
</select> </select>
<select id="pointOut" parameterType="java.util.Map" statementType="CALLABLE">
{call point_out(
#{stockId,jdbcType=VARCHAR,mode=IN},
#{exitId,jdbcType=VARCHAR,mode=IN},
#{v_result,mode=OUT,jdbcType=INTEGER},
#{v_resultmsg,mode=OUT,jdbcType=VARCHAR}
)}
</select>
</mapper> </mapper>

View File

@@ -2,7 +2,7 @@
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.out.mapper.OutExceptionRecordMapper"> <mapper namespace="com.ruoyi.out.exception.mapper.OutExceptionRecordMapper">
<resultMap type="OutExceptionRecord" id="OutExceptionRecordResult"> <resultMap type="OutExceptionRecord" id="OutExceptionRecordResult">
<result property="outGuid" column="out_guid" /> <result property="outGuid" column="out_guid" />

View File

@@ -27,3 +27,13 @@ export function hangInvalidJob(jobIds) {
params: { jobIds: jobIds } params: { jobIds: jobIds }
}) })
} }
export function pointOut(stockIds) {
return request({
url: '/job/outmydoJob/pointOut',
method: 'get',
params: {
stockIds: stockIds.join(',') // 将数组转换为逗号分隔的字符串
}
})
}

View File

@@ -677,7 +677,8 @@ export default {
productId:'物料编码', productId:'物料编码',
cargoSpaceStatus: '锁定状态', cargoSpaceStatus: '锁定状态',
cargoSpaceStockStatus: '货位状态', cargoSpaceStockStatus: '货位状态',
deleteConfirm:"删除库存" deleteConfirm:"删除库存",
designatedStorageLocationForOutboundShipment:"指定货位出库"
}, },

View File

@@ -0,0 +1,575 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item :label="$t('stockManagement.stockId')" prop="stockId"><!-- 库存id -->
<el-input
v-model="queryParams.stockId"
:placeholder="$t('stockManagement.inputStockId')"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item :label="$t('stockManagement.cargoSpaceId')" prop="cargoSpaceId"><!-- 货位id -->
<el-input
v-model="queryParams.cargoSpaceId"
:placeholder="$t('stockManagement.inputCargoSpaceId')"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item :label="$t('stockManagement.stockStatus')" prop="stockStatus"><!-- 库存状态 -->
<el-select v-model="queryParams.stockStatus" :placeholder="$t('stockManagement.stockStatus')" clearable>
<el-option
v-for="dict in dict.type.stock_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('stockManagement.cargoSpaceStockStatus')" prop="cargoSpaceStockStatus"><!-- 货位状态 -->
<el-select v-model="queryParams.cargoSpaceStockStatus" :placeholder="$t('stockManagement.cargoSpaceStockStatus')" clearable>
<el-option
v-for="dict in dict.type.cargo_space_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('stockManagement.productStatus')" prop="productStatus"><!-- 物料状态 -->
<el-select v-model="queryParams.productStatus" :placeholder="$t('stockManagement.selectProductStatus')" clearable>
<el-option
v-for="dict in dict.type.product_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('stockManagement.inDate')" prop="startDate"><!-- 入库时间 -->
<el-date-picker clearable
v-model="queryParams.inDate"
type="date"
value-format="yyyy-MM-dd"
:placeholder="$t('stockManagement.inputInDate')">
</el-date-picker>
</el-form-item>
<!-- <el-form-item label="回流时间" prop="backDate">
<el-input
v-model="queryParams.backDate"
placeholder="请输入回流时间"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="物料GUID" prop="productGuid">
<el-input
v-model="queryParams.productGuid"
placeholder="请输入物料GUID"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="库存数量" prop="quantity">
<el-input
v-model="queryParams.quantity"
placeholder="请输入库存数量"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="作业ID" prop="jobId">
<el-input
v-model="queryParams.jobId"
placeholder="请输入作业ID"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>-->
<el-form-item :label="$t('stockManagement.trayCode')" prop="trayCode"><!-- 托盘条码 -->
<el-input
v-model="queryParams.trayCode"
:placeholder="$t('stockManagement.inputTrayCode')"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item :label="$t('stockManagement.materialDesc')" prop="productName"><!-- 物料描述 -->
<el-input
v-model="queryParams.productName"
:placeholder="$t('stockManagement.materialDesc')"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<!-- <el-form-item label="出库数量" prop="outQuantity">
<el-input
v-model="queryParams.outQuantity"
placeholder="请输入出库数量"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="入库子单id" prop="stockinDetailId">
<el-input
v-model="queryParams.stockinDetailId"
placeholder="请输入入库子单id"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="入库主单" prop="stockinId">
<el-input
v-model="queryParams.stockinId"
placeholder="请输入入库主单"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="入库班组ID" prop="inClassId">
<el-input
v-model="queryParams.inClassId"
placeholder="请输入入库班组ID"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>-->
<el-form-item :label="$t('stockManagement.warehouseId')" prop="warehouseId"><!-- 仓库id -->
<el-select v-model="queryParams.warehouseId" :placeholder="$t('stockManagement.warehouseId')">
<el-option
v-for="item in warehouseOptions"
:key="item.warehouseId"
:label="item.warehouseName"
:value="item.warehouseId"
/>
</el-select>
</el-form-item>
<!-- <el-form-item label="备用字段1" prop="spare1">
<el-input
v-model="queryParams.spare1"
placeholder="请输入备用字段1"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="备用字段2" prop="spare2">
<el-input
v-model="queryParams.spare2"
placeholder="请输入备用字段2"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="备用字段3" prop="spare3">
<el-input
v-model="queryParams.spare3"
placeholder="请输入备用字段3"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="备用字段4" prop="spare4">
<el-input
v-model="queryParams.spare4"
placeholder="请输入备用字段4"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="备用字段5" prop="spare5">
<el-input
v-model="queryParams.spare5"
placeholder="请输入备用字段5"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="备用字段6" prop="spare6">
<el-input
v-model="queryParams.spare6"
placeholder="请输入备用字段6"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>-->
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">{{$t('stockManagement.search')}}</el-button><!-- 搜索 -->
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{$t('stockManagement.reset')}}</el-button><!-- 重置 -->
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<!-- <el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['stock:management:add']"
>{{$t('stockManagement.add')}} &lt;!&ndash; 新增 &ndash;&gt;</el-button>
</el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="success"-->
<!-- plain-->
<!-- icon="el-icon-edit"-->
<!-- size="mini"-->
<!-- :disabled="single"-->
<!-- @click="handleUpdate"-->
<!-- v-hasPermi="['stock:management:edit']"-->
<!-- >{{$t('stockManagement.edit')}} &lt;!&ndash; 修改 &ndash;&gt;</el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="danger"-->
<!-- plain-->
<!-- icon="el-icon-delete"-->
<!-- size="mini"-->
<!-- :disabled="multiple"-->
<!-- @click="handleDelete"-->
<!-- v-hasPermi="['stock:management:remove']"-->
<!-- >{{$t('stockManagement.delete')}} &lt;!&ndash; 删除 &ndash;&gt;</el-button>-->
<!-- </el-col>-->
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="pointOut"
v-hasPermi="['job:outmydoJob:pointOut']"
>{{$t('stockManagement.designatedStorageLocationForOutboundShipment')}} <!-- 指定货位出库 --></el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="managementList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column :label="$t('stockManagement.stockId')" align="left" prop="stockId" /> <!-- 库存id -->
<el-table-column :label="$t('stockManagement.cargoSpaceId')" align="left" prop="cargoSpaceId" /> <!-- 货位id -->
<el-table-column :label="$t('stockManagement.cargoSpaceName')" align="left" prop="cargoSpaceName" /> <!-- 货位id -->
<el-table-column :label="$t('stockManagement.stockStatus')" align="left" prop="stockStatus" ><!-- 库存状态 -->
<template slot-scope="scope">
<dict-tag :options="dict.type.stock_status" :value="scope.row.stockStatus"/>
</template>
</el-table-column>
<el-table-column :label="$t('stockManagement.cargoSpaceStockStatus')" align="left" prop="cargoSpaceStockStatus"> <!-- 货位状态 -->
<template slot-scope="scope">
<dict-tag :options="dict.type.cargo_space_status" :value="scope.row.cargoSpaceStockStatus"/>
</template>
</el-table-column>
<el-table-column :label="$t('stockManagement.cargoSpaceStatus')" align="left" prop="cargoSpaceStatus" ><!--货位状态-->
<template slot-scope="scope">
<dict-tag :options="dict.type.cargo_space_lock_status" :value="scope.row.cargoSpaceStatus"/>
</template>
</el-table-column><!-- 货位状态 -->
<el-table-column :label="$t('stockManagement.productStatus')" align="left" width="120" prop="productStatus"> <!-- 物料状态 -->
<template slot-scope="scope">
<dict-tag :options="dict.type.product_status" :value="scope.row.productStatus"/>
</template>
</el-table-column>
<el-table-column :label="$t('stockManagement.productId')" align="left" prop="extraField.productId" /> <!-- 物料Id -->
<el-table-column :label="$t('stockManagement.materialDesc')" align="left" prop="extraField.materialDesc" /> <!-- 物料描述 -->
<el-table-column :label="$t('stockManagement.englishDesc')" align="left" prop="extraField.englishDesc" /> <!-- 物料英文描述 -->
<el-table-column :label="$t('stockManagement.netWeight')" align="right" prop="extraField.netWeight" width="120" /> <!-- 净重 -->
<el-table-column :label="$t('stockManagement.length')" align="right" prop="extraField.length" width="100"/> <!-- 长 -->
<el-table-column :label="$t('stockManagement.width')" align="right" prop="extraField.width" width="100"/> <!-- 宽 -->
<el-table-column :label="$t('stockManagement.height')" align="right" prop="extraField.height" width="100"/> <!-- 高 -->
<el-table-column :label="$t('stockManagement.volume')" align="right" prop="extraField.volume" width="100"/> <!-- 体积 -->
<el-table-column :label="$t('stockManagement.quantity')" align="right" prop="quantity" width="100"/> <!-- 库存数量 -->
<el-table-column :label="$t('stockManagement.jobId')" align="left" prop="jobId" /> <!-- 作业ID -->
<el-table-column :label="$t('stockManagement.trayCode')" align="left" prop="trayCode" /> <!-- 托盘条码 -->
<el-table-column :label="$t('stockManagement.stockinId')" align="left" prop="stockinId" /> <!-- 入库主单 -->
<el-table-column :label="$t('stockManagement.stockinDetailId')" align="left" prop="stockinDetailId" /> <!-- 入库子单id -->
<el-table-column :label="$t('stockManagement.inType')" align="left" prop="inType" /> <!-- 入库类型 -->
<el-table-column :label="$t('stockManagement.warehouseId')" align="left" prop="warehouseName" /> <!-- 仓库 -->
<el-table-column :label="$t('stockManagement.inDate')" align="left" prop="inDate" /> <!-- 入库时间 -->
<el-table-column :label="$t('stockManagement.operation')" align="center" class-name="small-padding fixed-width"> <!-- 操作 -->
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['stock:management:edit']"
>{{$t('stockManagement.edit')}} <!-- 修改 --></el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['stock:management:remove']"
>{{$t('stockManagement.delete')}} <!-- 删除 --></el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改库存信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item :label="$t('stockManagement.stockId')" prop="stockId"> <!-- 库存id -->
<el-input v-model="form.stockId" :placeholder="$t('stockManagement.inputStockId')" />
</el-form-item>
<el-form-item :label="$t('stockManagement.cargoSpaceId')" prop="cargoSpaceId"> <!-- 货位id -->
<el-input v-model="form.cargoSpaceId" :placeholder="$t('stockManagement.inputCargoSpaceId')" />
</el-form-item>
<el-form-item :label="$t('stockManagement.stockStatus')" prop="stockStatus"> <!-- 库存状态 -->
<el-select v-model="form.stockStatus" :placeholder="$t('stockManagement.selectStockStatus')">
<el-option
v-for="dict in dict.type.stock_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('stockManagement.quantity')" prop="quantity"> <!-- 库存数量 -->
<el-input v-model="form.quantity" :placeholder="$t('stockManagement.inputQuantity')" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">{{$t('stockManagement.confirm')}} <!-- 确定 --></el-button>
<el-button @click="cancel">{{$t('stockManagement.cancel')}} <!-- 取消 --></el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listManagement, getManagement, delManagement, addManagement, updateManagement } from "@/api/stock/management"
import {listWarehouse} from "@/api/bas/warehouse"
import {pointOut} from "@/api/job/OutmydoJob"
export default {
name: "Management",
dicts: ['product_status', 'stock_status','cargo_space_status','cargo_space_lock_status'],
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 库存信息表格数据
managementList: [],
// 仓库选项
warehouseOptions: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
stockId: null,
cargoSpaceId: null,
stockStatus: null,
productStatus: null,
lotNo: null,
inDate: null,
backDate: null,
productGuid: null,
quantity: null,
jobId: null,
trayCode: null,
outQuantity: null,
stockinDetailId: null,
stockinId: null,
inType: null,
inClassId: null,
warehouseId: null,
stackingId: null,
spare1: null,
spare2: null,
spare3: null,
spare4: null,
spare5: null,
spare6: null
},
// 表单参数
form: {},
// 表单校验
rules: {
/*stockId: [
{ required: true, message: this.$t('stockManagement.stockIdRequired'), trigger: "blur" } // 库存id不能为空
]*/
}
}
},
created() {
this.getList()
this.getWarehouseList();
},
methods: {
/** 获取仓库列表 */
getWarehouseList() {
listWarehouse().then(response => {
this.warehouseOptions = response.rows;
});
},
/** 查询库存信息列表 */
getList() {
this.loading = true
listManagement(this.queryParams).then(response => {
this.managementList = response.rows
this.total = response.total
this.loading = false
})
},
// 取消按钮
cancel() {
this.open = false
this.reset()
},
// 表单重置
reset() {
this.form = {
stockId: null,
cargoSpaceId: null,
stockStatus: null,
productStatus: null,
lotNo: null,
inDate: null,
backDate: null,
productGuid: null,
quantity: null,
jobId: null,
trayCode: null,
outQuantity: null,
stockinDetailId: null,
stockinId: null,
inType: null,
inClassId: null,
warehouseId: null,
stackingId: null,
spare1: null,
spare2: null,
spare3: null,
spare4: null,
spare5: null,
spare6: null
}
this.resetForm("form")
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm")
this.handleQuery()
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.stockId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset()
this.open = true
this.title = this.$t('stockManagement.addTitle') // 添加库存信息
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
const stockId = row.stockId || this.ids
getManagement(stockId).then(response => {
this.form = response.data
this.open = true
this.title = this.$t('stockManagement.editTitle') // 修改库存信息
})
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.stockId != null) {
updateManagement(this.form).then(response => {
this.$modal.msgSuccess(this.$t('stockManagement.editSuccess')) // 修改成功
this.open = false
this.getList()
})
} else {
addManagement(this.form).then(response => {
this.$modal.msgSuccess(this.$t('stockManagement.addSuccess')) // 新增成功
this.open = false
this.getList()
})
}
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
const stockIds = row.stockId || this.ids
this.$modal.confirm(this.$t('stockManagement.confirmDelete', { stockIds: stockIds })).then(function() { // 是否确认删除库存信息编号为
return delManagement(stockIds)
}).then(() => {
this.getList()
this.$modal.msgSuccess(this.$t('stockManagement.deleteSuccess')) // 删除成功
}).catch(() => {})
},
/** 指定货位出库按钮操作 */
pointOut() {
if (this.ids.length === 0) {
this.$modal.msgError(this.$t('stockManagement.selectAtLeastOneRow')); // 请至少选择一行数据
return;
}
const stockIds = this.ids;
// 这里调用API将stockIds数组传给后端
// 示例: pointOutApi(stockIds).then(response => {
// this.$modal.msgSuccess("出库成功");
// this.getList();
// });
console.log('Selected stockIds:', stockIds);
this.$modal.confirm(this.$t('stockManagement.confirmPointOut')).then(() => {
// 实际API调用需要根据后端接口进行调整
pointOut(stockIds).then(response => {
this.$modal.msgSuccess(response.msg);
this.getList();
});
// this.$modal.msgSuccess(this.$t('stockManagement.pointOutSuccess')); // 出库成功
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('stock/management/export', {
...this.queryParams
}, `management_${new Date().getTime()}.xlsx`)
}
}
}
</script>
<style>
.no-wrap {
white-space: nowrap;
}
</style>

View File

@@ -9,7 +9,7 @@ const CompressionPlugin = require('compression-webpack-plugin')
const name = process.env.VUE_APP_TITLE || '若依管理系统' // 网页标题 const name = process.env.VUE_APP_TITLE || '若依管理系统' // 网页标题
const baseUrl = 'http://localhost:8080' // 后端接口 const baseUrl = 'http://localhost:8081' // 后端接口
const port = process.env.port || process.env.npm_config_port || 80 // 端口 const port = process.env.port || process.env.npm_config_port || 80 // 端口