添加分页 添加仓库数据权限

This commit is contained in:
liuhanqing
2025-07-24 11:33:24 +08:00
parent 10bcc1f2af
commit d2c10acb43
11 changed files with 137 additions and 60 deletions

View File

@@ -6,6 +6,7 @@ import java.util.List;
import cn.hutool.core.util.IdUtil;
import com.ruoyi.bas.cargoSpace.domain.BasCargoSpace;
import com.ruoyi.bas.cargoSpace.service.IBasCargoSpaceService;
import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.stock.stock.domain.BasStock;
@@ -52,6 +53,7 @@ public class CheckDifferenceRecordServiceImpl implements ICheckDifferenceRecordS
* @return 盘点差异
*/
@Override
@DataScope(warehouseAlias = "w")
public List<CheckDifferenceRecord> selectCheckDifferenceRecordList(CheckDifferenceRecord checkDifferenceRecord)
{
return checkDifferenceRecordMapper.selectCheckDifferenceRecordList(checkDifferenceRecord);

View File

@@ -3,6 +3,7 @@ package com.ruoyi.stock.freeze.service.impl;
import java.util.List;
import cn.hutool.core.util.IdUtil;
import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -41,6 +42,7 @@ public class BasStockFreezeRecordServiceImpl implements IBasStockFreezeRecordSer
* @return 库存冻结记录
*/
@Override
@DataScope(warehouseAlias = "bw")
public List<BasStockFreezeRecord> selectBasStockFreezeRecordList(BasStockFreezeRecord basStockFreezeRecord)
{
return basStockFreezeRecordMapper.selectBasStockFreezeRecordList(basStockFreezeRecord);

View File

@@ -1,6 +1,8 @@
package com.ruoyi.stock.maintain.service.impl;
import java.util.List;
import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -39,6 +41,7 @@ public class BasStockMaintainRecordServiceImpl implements IBasStockMaintainRecor
* @return 库存操作记录
*/
@Override
@DataScope(warehouseAlias = "bw")
public List<BasStockMaintainRecord> selectBasStockMaintainRecordList(BasStockMaintainRecord basStockMaintainRecord)
{
return basStockMaintainRecordMapper.selectBasStockMaintainRecordList(basStockMaintainRecord);

View File

@@ -61,6 +61,7 @@ public class BasStockServiceImpl implements IBasStockService
* @return 库存信息
*/
@Override
@DataScope(warehouseAlias = "bw")
public List<BasStock> selectBasStockList(BasStock basStock)
{
return basStockMapper.selectBasStockList(basStock);

View File

@@ -36,11 +36,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectCheckDifferenceRecordVo">
select r.check_guid, r.check_stock_detail_id, r.stock_id, r.tray_code, r.cargo_space_id,
r.product_id, r.lot_no, r.supplier, r.customer, r.old_quantity, r.new_quantity,
r.record_type, r.create_time, r.product_guid, r.status, r.warehouse_id,
w.warehouse_name,bp.product_name,bp.spare1 as englishDesc,
bp.spare2 as netWeight,bp.spare5 as length,bp.spare6 as width,bp.spare7 as height,bp.spare8 as volume,
select r.check_guid,
r.check_stock_detail_id,
r.stock_id,
r.tray_code,
r.cargo_space_id,
r.product_id,
r.lot_no,
r.supplier,
r.customer,
r.old_quantity,
r.new_quantity,
r.record_type,
r.create_time,
r.product_guid,
r.status,
r.warehouse_id,
w.warehouse_name,
bp.product_name,
bp.spare1 as englishDesc,
bp.spare2 as netWeight,
bp.spare5 as length,
bp.spare6 as width,
bp.spare7 as height,
bp.spare8 as volume,
bcs.cargo_space_name
from check_difference_record r
left join bas_warehouse w on r.warehouse_id = w.warehouse_id
@@ -48,7 +67,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join bas_cargo_space bcs on r.cargo_space_id = bcs.cargo_space_id
</sql>
<select id="selectCheckDifferenceRecordList" parameterType="CheckDifferenceRecord" resultMap="CheckDifferenceRecordResult">
<select id="selectCheckDifferenceRecordList" parameterType="CheckDifferenceRecord"
resultMap="CheckDifferenceRecordResult">
<include refid="selectCheckDifferenceRecordVo"/>
<where>
<if test="checkStockDetailId != null and checkStockDetailId != ''">
@@ -93,6 +113,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="warehouseId != null and warehouseId != ''">
and r.warehouse_id = #{warehouseId}
</if>
<if test="params.warehouseDataScope != null and params.warehouseDataScope !=''">
${params.warehouseDataScope}
</if>
</where>
order by r.create_time desc
</select>
@@ -165,7 +188,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<delete id="deleteCheckDifferenceRecordByCheckGuid" parameterType="String">
delete from check_difference_record where check_guid = #{checkGuid}
delete
from check_difference_record
where check_guid = #{checkGuid}
</delete>
<delete id="deleteCheckDifferenceRecordByCheckGuids" parameterType="String">

View File

@@ -53,6 +53,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="barCodeOldQuantity != null and barCodeOldQuantity != ''"> and bar_code_old_quantity = #{barCodeOldQuantity}</if>
<if test="barCodeQuantity != null and barCodeQuantity != ''"> and bar_code_quantity = #{barCodeQuantity}</if>
<if test="productGuid != null and productGuid != ''"> and product_guid = #{productGuid}</if>
<if test="params.warehouseDataScope != null and params.warehouseDataScope !=''">
${params.warehouseDataScope}
</if>
</where>
order by create_time desc
</select>

View File

@@ -53,6 +53,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="barCodeOldQuantity != null and barCodeOldQuantity != ''"> and bar_code_old_quantity = #{barCodeOldQuantity}</if>
<if test="barCodeQuantity != null and barCodeQuantity != ''"> and bar_code_quantity = #{barCodeQuantity}</if>
<if test="productGuid != null and productGuid != ''"> and product_guid = #{productGuid}</if>
<if test="params.warehouseDataScope != null and params.warehouseDataScope !=''">
${params.warehouseDataScope}
</if>
</where>
order by create_time desc
</select>

View File

@@ -94,6 +94,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{item}
</foreach>
</if>
<if test="params.warehouseDataScope != null and params.warehouseDataScope !=''">
${params.warehouseDataScope}
</if>
</where>
</select>

View File

@@ -90,13 +90,21 @@
<el-table v-loading="materialLoading" :data="materialOptions" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column :label="$t('checkCreate.materialCode')" align="left" prop="productId" /> <!-- 物资编码 -->
<el-table-column :label="$t('checkCreate.materialName')" align="left" prop="productName" /> <!-- 物资名称 -->
<el-table-column :label="$t('checkCreate.quantity')" align="right" prop="quantity" /> <!-- 数量 -->
<el-table-column :label="$t('checkCreate.lotNo')" align="left" prop="lotNo" /> <!-- 批次 -->
<el-table-column :label="$t('checkCreate.warehouse')" align="left" prop="warehouseName" /> <!-- 仓库 -->
<el-table-column :label="$t('checkCreate.materialCode')" align="left" prop="productId" />
<el-table-column :label="$t('checkCreate.materialName')" align="left" prop="productName" />
<el-table-column :label="$t('checkCreate.quantity')" align="right" prop="quantity" />
<el-table-column :label="$t('checkCreate.lotNo')" align="left" prop="lotNo" />
<el-table-column :label="$t('checkCreate.warehouse')" align="left" prop="warehouseName" />
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getMaterialList"
/>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="confirmSelectMaterials">{{ $t('checkCreate.confirm') }}</el-button> <!-- 确定 -->
<el-button @click="cancelSelectMaterials">{{ $t('checkCreate.cancel') }}</el-button> <!-- 取消 -->
@@ -145,6 +153,14 @@
<el-table-column :label="$t('checkCreate.warehouse')" align="left" prop="warehouseName" />
</el-table>
<pagination
v-show="trayTotal > 0"
:total="trayTotal"
:page.sync="trayQueryParams.pageNum"
:limit.sync="trayQueryParams.pageSize"
@pagination="getMaterialByTrayCodeList"
/>
<!-- 托盘详情弹窗 -->
<el-dialog
:title="$t('checkCreate.trayDetail')"
@@ -188,6 +204,10 @@
loading: false,
materialLoading: false,
trayLoading: false,
// 总条数
total: 0,
// 托盘总条数
trayTotal: 0,
// 表单验证规则
rules: {
warehouseId: [
@@ -288,6 +308,7 @@
if (this.formData.checkType==='1'){
listProductAndStock(this.queryParams).then(response => {
this.materialOptions = response.rows;
this.total = response.total;
this.materialLoading = false;
});
}
@@ -300,6 +321,7 @@
this.trayQueryParams.status = 2;
listCargoSpace(this.trayQueryParams).then(response => {
this.trayOptions = response.rows;
this.trayTotal = response.total;
this.trayLoading = false;
});
}

View File

@@ -298,12 +298,6 @@
<el-table-column type="selection" width="55" align="center" />
<el-table-column :label="$t('checkJobIn.jobDetailId')" align="left" prop="jobDetailId" /> <!--子任务ID-->
<el-table-column :label="$t('checkJobIn.jobId')" align="left" prop="jobId" /> <!--任务ID-->
<el-table-column :label="$t('checkJobIn.lotNo')" align="left" prop="lotNo" /> <!--批次号-->
<el-table-column :label="$t('checkJobIn.inDate')" align="left" prop="inDate" width="180"> <!--入库时间-->
<template slot-scope="scope">
<span>{{ parseTime(scope.row.inDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('checkJobIn.inOrOutId')" align="left" prop="inOrOutId" /> <!--单据ID-->
<el-table-column :label="$t('checkJobIn.inOrOutDId')" align="left" prop="inOrOutDId" /> <!--子单据ID-->
<el-table-column :label="$t('checkJobIn.productId')" align="left" prop="productId" /> <!--物料编码-->
@@ -311,6 +305,11 @@
<el-table-column :label="$t('checkJobIn.englishDesc')" align="left" prop="extraField.englishDesc" /> <!-- 英文描述 -->
<el-table-column :label="$t('checkJobIn.netWeight')" align="right" prop="extraField.netWeight" /> <!-- 净重 -->
<el-table-column :label="$t('checkJobIn.inQuantity')" align="right" prop="inQuantity" /> <!--入库数量-->
<el-table-column :label="$t('checkJobIn.inDate')" align="left" prop="inDate" width="180"> <!--入库时间-->
<template slot-scope="scope">
<span>{{ parseTime(scope.row.inDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
</el-table>
<pagination

View File

@@ -88,11 +88,18 @@
<el-table-column type="selection" width="55" align="center" />
<el-table-column :label="$t('addOutStockout.materialCode')" align="left" prop="productId" /><!--物资编码-->
<el-table-column :label="$t('addOutStockout.materialName')" align="left" prop="productName" /><!--物资名称-->
<!-- <el-table-column :label="$t('addOutStockout.batchNo')" align="left" prop="lotNo" />&lt;!&ndash;批号&ndash;&gt;-->
<el-table-column :label="$t('addOutStockout.quantity')" align="right" prop="quantity" /><!--数量-->
<el-table-column :label="$t('addOutStockout.warehouse')" align="left" prop="warehouseId" /><!--仓库-->
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getMaterialList"
/>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="confirmSelectMaterials">{{$t('addOutStockout.confirm')}}<!--确 定--></el-button>
<el-button @click="cancelSelectMaterials">{{$t('addOutStockout.cancel')}}<!--取 消--></el-button>
@@ -104,15 +111,21 @@
<script>
import { listProductAndStock,saveOutStock } from "@/api/out/outStockout";
import {listWarehouse} from "@/api/bas/warehouse";
import Pagination from "@/components/Pagination";
export default {
name: "AddOutStock",
dicts: ['out_bill_type', 'bill_status'],
components: {
Pagination
},
data() {
return {
// 遮罩层
loading: false,
materialLoading: false,
// 总条数
total: 0,
// 表单验证规则
rules: {
warehouseId: [
@@ -183,6 +196,7 @@ export default {
this.materialLoading = true;
listProductAndStock(this.queryParams).then(response => {
this.materialOptions = response.rows;
this.total = response.total;
this.materialLoading = false;
});
},