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

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

View File

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

View File

@@ -1,6 +1,8 @@
package com.ruoyi.stock.maintain.service.impl; package com.ruoyi.stock.maintain.service.impl;
import java.util.List; import java.util.List;
import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -10,19 +12,19 @@ import com.ruoyi.stock.maintain.service.IBasStockMaintainRecordService;
/** /**
* 库存操作记录Service业务层处理 * 库存操作记录Service业务层处理
* *
* @author ruoyi * @author ruoyi
* @date 2025-05-26 * @date 2025-05-26
*/ */
@Service @Service
public class BasStockMaintainRecordServiceImpl implements IBasStockMaintainRecordService public class BasStockMaintainRecordServiceImpl implements IBasStockMaintainRecordService
{ {
@Autowired @Autowired
private BasStockMaintainRecordMapper basStockMaintainRecordMapper; private BasStockMaintainRecordMapper basStockMaintainRecordMapper;
/** /**
* 查询库存操作记录 * 查询库存操作记录
* *
* @param whGuid 库存操作记录主键 * @param whGuid 库存操作记录主键
* @return 库存操作记录 * @return 库存操作记录
*/ */
@@ -34,11 +36,12 @@ public class BasStockMaintainRecordServiceImpl implements IBasStockMaintainRecor
/** /**
* 查询库存操作记录列表 * 查询库存操作记录列表
* *
* @param basStockMaintainRecord 库存操作记录 * @param basStockMaintainRecord 库存操作记录
* @return 库存操作记录 * @return 库存操作记录
*/ */
@Override @Override
@DataScope(warehouseAlias = "bw")
public List<BasStockMaintainRecord> selectBasStockMaintainRecordList(BasStockMaintainRecord basStockMaintainRecord) public List<BasStockMaintainRecord> selectBasStockMaintainRecordList(BasStockMaintainRecord basStockMaintainRecord)
{ {
return basStockMaintainRecordMapper.selectBasStockMaintainRecordList(basStockMaintainRecord); return basStockMaintainRecordMapper.selectBasStockMaintainRecordList(basStockMaintainRecord);
@@ -46,7 +49,7 @@ public class BasStockMaintainRecordServiceImpl implements IBasStockMaintainRecor
/** /**
* 新增库存操作记录 * 新增库存操作记录
* *
* @param basStockMaintainRecord 库存操作记录 * @param basStockMaintainRecord 库存操作记录
* @return 结果 * @return 结果
*/ */
@@ -59,7 +62,7 @@ public class BasStockMaintainRecordServiceImpl implements IBasStockMaintainRecor
/** /**
* 修改库存操作记录 * 修改库存操作记录
* *
* @param basStockMaintainRecord 库存操作记录 * @param basStockMaintainRecord 库存操作记录
* @return 结果 * @return 结果
*/ */
@@ -71,7 +74,7 @@ public class BasStockMaintainRecordServiceImpl implements IBasStockMaintainRecor
/** /**
* 批量删除库存操作记录 * 批量删除库存操作记录
* *
* @param whGuids 需要删除的库存操作记录主键 * @param whGuids 需要删除的库存操作记录主键
* @return 结果 * @return 结果
*/ */
@@ -83,7 +86,7 @@ public class BasStockMaintainRecordServiceImpl implements IBasStockMaintainRecor
/** /**
* 删除库存操作记录信息 * 删除库存操作记录信息
* *
* @param whGuid 库存操作记录主键 * @param whGuid 库存操作记录主键
* @return 结果 * @return 结果
*/ */

View File

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

View File

@@ -1,54 +1,74 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!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.check.difference.mapper.CheckDifferenceRecordMapper"> <mapper namespace="com.ruoyi.check.difference.mapper.CheckDifferenceRecordMapper">
<resultMap type="CheckDifferenceRecord" id="CheckDifferenceRecordResult"> <resultMap type="CheckDifferenceRecord" id="CheckDifferenceRecordResult">
<result property="checkGuid" column="check_guid" /> <result property="checkGuid" column="check_guid"/>
<result property="checkStockDetailId" column="check_stock_detail_id" /> <result property="checkStockDetailId" column="check_stock_detail_id"/>
<result property="stockId" column="stock_id" /> <result property="stockId" column="stock_id"/>
<result property="trayCode" column="tray_code" /> <result property="trayCode" column="tray_code"/>
<result property="cargoSpaceId" column="cargo_space_id" /> <result property="cargoSpaceId" column="cargo_space_id"/>
<result property="cargoSpaceName" column="cargo_space_name" /> <result property="cargoSpaceName" column="cargo_space_name"/>
<result property="productId" column="product_id" /> <result property="productId" column="product_id"/>
<result property="lotNo" column="lot_no" /> <result property="lotNo" column="lot_no"/>
<result property="supplier" column="supplier" /> <result property="supplier" column="supplier"/>
<result property="customer" column="customer" /> <result property="customer" column="customer"/>
<result property="oldQuantity" column="old_quantity" /> <result property="oldQuantity" column="old_quantity"/>
<result property="newQuantity" column="new_quantity" /> <result property="newQuantity" column="new_quantity"/>
<result property="recordType" column="record_type" /> <result property="recordType" column="record_type"/>
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time"/>
<result property="productGuid" column="product_guid" /> <result property="productGuid" column="product_guid"/>
<result property="status" column="status" /> <result property="status" column="status"/>
<result property="warehouseId" column="warehouse_id" /> <result property="warehouseId" column="warehouse_id"/>
<result property="warehouseName" column="warehouse_name" /> <result property="warehouseName" column="warehouse_name"/>
<association property="extraField" javaType="ExtraField"> <association property="extraField" javaType="ExtraField">
<result property="productId" column="product_id" /> <result property="productId" column="product_id"/>
<result property="materialDesc" column="product_name" /> <result property="materialDesc" column="product_name"/>
<result property="englishDesc" column="englishDesc" /> <result property="englishDesc" column="englishDesc"/>
<result property="length" column="length" /> <result property="length" column="length"/>
<result property="width" column="width" /> <result property="width" column="width"/>
<result property="height" column="height" /> <result property="height" column="height"/>
<result property="volume" column="volume" /> <result property="volume" column="volume"/>
<result property="netWeight" column="netWeight" /> <result property="netWeight" column="netWeight"/>
</association> </association>
</resultMap> </resultMap>
<sql id="selectCheckDifferenceRecordVo"> <sql id="selectCheckDifferenceRecordVo">
select r.check_guid, r.check_stock_detail_id, r.stock_id, r.tray_code, r.cargo_space_id, select r.check_guid,
r.product_id, r.lot_no, r.supplier, r.customer, r.old_quantity, r.new_quantity, r.check_stock_detail_id,
r.record_type, r.create_time, r.product_guid, r.status, r.warehouse_id, r.stock_id,
w.warehouse_name,bp.product_name,bp.spare1 as englishDesc, r.tray_code,
bp.spare2 as netWeight,bp.spare5 as length,bp.spare6 as width,bp.spare7 as height,bp.spare8 as volume, 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 bcs.cargo_space_name
from check_difference_record r from check_difference_record r
left join bas_warehouse w on r.warehouse_id = w.warehouse_id left join bas_warehouse w on r.warehouse_id = w.warehouse_id
left join bas_product bp on r.product_id = bp.product_id left join bas_product bp on r.product_id = bp.product_id
left join bas_cargo_space bcs on r.cargo_space_id = bcs.cargo_space_id left join bas_cargo_space bcs on r.cargo_space_id = bcs.cargo_space_id
</sql> </sql>
<select id="selectCheckDifferenceRecordList" parameterType="CheckDifferenceRecord" resultMap="CheckDifferenceRecordResult"> <select id="selectCheckDifferenceRecordList" parameterType="CheckDifferenceRecord"
resultMap="CheckDifferenceRecordResult">
<include refid="selectCheckDifferenceRecordVo"/> <include refid="selectCheckDifferenceRecordVo"/>
<where> <where>
<if test="checkStockDetailId != null and checkStockDetailId != ''"> <if test="checkStockDetailId != null and checkStockDetailId != ''">
@@ -93,6 +113,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="warehouseId != null and warehouseId != ''"> <if test="warehouseId != null and warehouseId != ''">
and r.warehouse_id = #{warehouseId} and r.warehouse_id = #{warehouseId}
</if> </if>
<if test="params.warehouseDataScope != null and params.warehouseDataScope !=''">
${params.warehouseDataScope}
</if>
</where> </where>
order by r.create_time desc order by r.create_time desc
</select> </select>
@@ -121,7 +144,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="productGuid != null">product_guid,</if> <if test="productGuid != null">product_guid,</if>
<if test="status != null">status,</if> <if test="status != null">status,</if>
<if test="warehouseId != null">warehouse_id,</if> <if test="warehouseId != null">warehouse_id,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="checkGuid != null">#{checkGuid},</if> <if test="checkGuid != null">#{checkGuid},</if>
<if test="checkStockDetailId != null">#{checkStockDetailId},</if> <if test="checkStockDetailId != null">#{checkStockDetailId},</if>
@@ -139,7 +162,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="productGuid != null">#{productGuid},</if> <if test="productGuid != null">#{productGuid},</if>
<if test="status != null">#{status},</if> <if test="status != null">#{status},</if>
<if test="warehouseId != null">#{warehouseId},</if> <if test="warehouseId != null">#{warehouseId},</if>
</trim> </trim>
</insert> </insert>
<update id="updateCheckDifferenceRecord" parameterType="CheckDifferenceRecord"> <update id="updateCheckDifferenceRecord" parameterType="CheckDifferenceRecord">
@@ -165,7 +188,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update> </update>
<delete id="deleteCheckDifferenceRecordByCheckGuid" parameterType="String"> <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>
<delete id="deleteCheckDifferenceRecordByCheckGuids" parameterType="String"> <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="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="barCodeQuantity != null and barCodeQuantity != ''"> and bar_code_quantity = #{barCodeQuantity}</if>
<if test="productGuid != null and productGuid != ''"> and product_guid = #{productGuid}</if> <if test="productGuid != null and productGuid != ''"> and product_guid = #{productGuid}</if>
<if test="params.warehouseDataScope != null and params.warehouseDataScope !=''">
${params.warehouseDataScope}
</if>
</where> </where>
order by create_time desc order by create_time desc
</select> </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="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="barCodeQuantity != null and barCodeQuantity != ''"> and bar_code_quantity = #{barCodeQuantity}</if>
<if test="productGuid != null and productGuid != ''"> and product_guid = #{productGuid}</if> <if test="productGuid != null and productGuid != ''"> and product_guid = #{productGuid}</if>
<if test="params.warehouseDataScope != null and params.warehouseDataScope !=''">
${params.warehouseDataScope}
</if>
</where> </where>
order by create_time desc order by create_time desc
</select> </select>

View File

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

View File

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

View File

@@ -298,12 +298,6 @@
<el-table-column type="selection" width="55" align="center" /> <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.jobDetailId')" align="left" prop="jobDetailId" /> <!--子任务ID-->
<el-table-column :label="$t('checkJobIn.jobId')" align="left" prop="jobId" /> <!--任务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.inOrOutId')" align="left" prop="inOrOutId" /> <!--单据ID-->
<el-table-column :label="$t('checkJobIn.inOrOutDId')" align="left" prop="inOrOutDId" /> <!--子单据ID--> <el-table-column :label="$t('checkJobIn.inOrOutDId')" align="left" prop="inOrOutDId" /> <!--子单据ID-->
<el-table-column :label="$t('checkJobIn.productId')" align="left" prop="productId" /> <!--物料编码--> <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.englishDesc')" align="left" prop="extraField.englishDesc" /> <!-- 英文描述 -->
<el-table-column :label="$t('checkJobIn.netWeight')" align="right" prop="extraField.netWeight" /> <!-- 净重 --> <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.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> </el-table>
<pagination <pagination

View File

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