Browse Source

[fix]

仓库管理 库存查询
修改库存判断列表页面、mapper,实现搜索栏模糊搜索;
修改库存查询、详情实体类,修改字段类型;
修改库存查询controller、service接口;
修改库存查询mapper方法;
修改库存历史页面表格显示顺序;
dev
王晓迪 2 months ago
parent
commit
5b0eb6c770
  1. 17
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/controller/WarehouseInventoryInquiryController.java
  2. 104
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/domain/WarehouseInventoryInquiry.java
  3. 50
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/domain/WarehouseInventoryInquiryDetail.java
  4. 2
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/mapper/WarehouseInventoryInquiryMapper.java
  5. 2
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/IWarehouseInventoryInquiryService.java
  6. 5
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseInventoryInquiryServiceImpl.java
  7. 10
      ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseInventoryCheckMapper.xml
  8. 9
      ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseInventoryInquiryMapper.xml
  9. 2
      ruoyi-admin/src/main/resources/templates/warehouse/inventoryCheck/inventoryCheck.html
  10. 21
      ruoyi-admin/src/main/resources/templates/warehouse/inventoryInquiry/inventoryHistory.html
  11. 73
      ruoyi-admin/src/main/resources/templates/warehouse/inventoryInquiry/inventoryInquiry.html

17
ruoyi-admin/src/main/java/com/ruoyi/warehouse/controller/WarehouseInventoryInquiryController.java

@ -2,6 +2,7 @@ package com.ruoyi.warehouse.controller;
import java.util.List;
import com.ruoyi.system.domain.OutsourceQuoteChild;
import com.ruoyi.warehouse.domain.WarehouseInventoryInquiryDetail;
import com.ruoyi.warehouse.domain.WarehouseInventoryReportDamage;
import com.ruoyi.warehouse.service.IWarehouseInventoryInquiryDetailService;
@ -9,6 +10,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
@ -68,11 +70,18 @@ public class WarehouseInventoryInquiryController extends BaseController
@Log(title = "仓库库存查询", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(WarehouseInventoryInquiry warehouseInventoryInquiry)
public AjaxResult export(WarehouseInventoryInquiry warehouseInventoryInquiry,String ids)
{
List<WarehouseInventoryInquiry> list = warehouseInventoryInquiryService.selectWarehouseInventoryInquiryList(warehouseInventoryInquiry);
ExcelUtil<WarehouseInventoryInquiry> util = new ExcelUtil<WarehouseInventoryInquiry>(WarehouseInventoryInquiry.class);
return util.exportExcel(list, "仓库库存查询数据");
if (StringUtils.isEmpty(ids)){
List<WarehouseInventoryInquiry> inventoryInquiries = warehouseInventoryInquiryService.selectWarehouseInventoryInquiryList(warehouseInventoryInquiry);
ExcelUtil<WarehouseInventoryInquiry> util = new ExcelUtil<WarehouseInventoryInquiry>(WarehouseInventoryInquiry.class);
return util.exportExcel(inventoryInquiries, "仓库库存查询数据");
}else {
String[] materialNos = ids.split(",");
List<WarehouseInventoryInquiry> inventoryInquiries = warehouseInventoryInquiryService.selectWarehouseInventoryInquiryListByNos(materialNos);
ExcelUtil<WarehouseInventoryInquiry> util = new ExcelUtil<WarehouseInventoryInquiry>(WarehouseInventoryInquiry.class);
return util.exportExcel(inventoryInquiries, ids);
}
}
/**

104
ruoyi-admin/src/main/java/com/ruoyi/warehouse/domain/WarehouseInventoryInquiry.java

@ -5,6 +5,10 @@ import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import javax.xml.crypto.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* 仓库库存查询对象 warehouse_inventory_inquiry
*
@ -19,76 +23,84 @@ public class WarehouseInventoryInquiry extends BaseEntity
private Long inventoryInquiryId;
/** 料号 */
@Excel(name = "料号")
@Excel(name = "料号", sort = 1)
private String materialNo;
/** 物料名称 */
@Excel(name = "物料名称")
@Excel(name = "物料名称", sort = 2)
private String materialName;
/** 物料类型 */
@Excel(name = "物料类型")
// @Excel(name = "物料类型")
private String materialType;
/** 物料图片地址 */
@Excel(name = "物料图片地址")
@Excel(name = "图片", sort = 3)
private String materialPhotourl;
/** 物料品牌 */
@Excel(name = "物料品牌")
@Excel(name = "品牌", sort = 4)
private String materialBrand;
/** 物料单位 */
@Excel(name = "物料单位")
@Excel(name = "单位", sort = 5)
private String materialUnit;
/** 物料描述 */
@Excel(name = "物料描述")
@Excel(name = "描述", sort = 6)
private String materialDescribe;
/** 物料加工方式 */
@Excel(name = "物料加工方式")
@Excel(name = "加工方式", sort = 7,dictType = "processMethod")
private String materialProcessMethod;
@Excel(name = "入库部门",sort = 9,dictType = "warehouseDept")
// @Excel(name = "入库部门",sort = 8,dictType = "warehouseDept")
private String warehouseDept;
/** 物料型号 */
@Excel(name = "物料型号")
// @Excel(name = "物料型号")
private String materialModel;
/** 物料规格 */
@Excel(name = "物料规格")
// @Excel(name = "物料规格")
private String materialSpecification;
/** 物料历史总数量 */
@Excel(name = "物料历史总数量")
private Double historicalTotal;
@Excel(name = "物料历史总数量", sort = 8)
private BigDecimal historicalTotal;
/** 可用库存数 */
@Excel(name = "可用库存数")
private Double availableStockNum;
@Excel(name = "可用库存数", sort = 9)
private BigDecimal availableStockNum;
/** 物料归属可用库存数 */
@Excel(name = "物料归属可用库存数")
private Double attributionAvailableStockNum;
// @Excel(name = "物料归属可用库存数")
private BigDecimal attributionAvailableStockNum;
/** 物料无归属可用库存数 */
@Excel(name = "物料无归属可用库存数")
private Double noattributionAvailableStockNum;
// @Excel(name = "物料无归属可用库存数")
private BigDecimal noattributionAvailableStockNum;
/** 物料使用数 */
@Excel(name = "物料使用数")
private Double useNum;
@Excel(name = "使用数", sort = 10)
private BigDecimal useNum;
/** 物料报损数 */
@Excel(name = "物料报损数")
private Double reportDamageNum;
@Excel(name = "报损数", sort = 11)
private BigDecimal reportDamageNum;
/** 物料使用状态(0 使用中、1 已作废) */
@Excel(name = "物料使用状态", readConverterExp = "0=,使=用中、1,已=作废")
@Excel(name = "使用状态", sort = 12, dictType = "useStatus")
private String materialUseStatus;
/** 物料使用数 */
@Excel(name = "更新人", sort = 13)
private String updateBy;
/** 物料使用数 */
@Excel(name = "上次更新时间", sort = 14, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
public void setInventoryInquiryId(Long inventoryInquiryId)
{
this.inventoryInquiryId = inventoryInquiryId;
@ -188,57 +200,57 @@ public class WarehouseInventoryInquiry extends BaseEntity
{
return materialSpecification;
}
public void setHistoricalTotal(Double historicalTotal)
public void setHistoricalTotal(BigDecimal historicalTotal)
{
this.historicalTotal = historicalTotal;
}
public Double getHistoricalTotal()
public BigDecimal getHistoricalTotal()
{
return historicalTotal;
}
public void setAvailableStockNum(Double availableStockNum)
public void setAvailableStockNum(BigDecimal availableStockNum)
{
this.availableStockNum = availableStockNum;
}
public Double getAvailableStockNum()
public BigDecimal getAvailableStockNum()
{
return availableStockNum;
}
public void setAttributionAvailableStockNum(Double attributionAvailableStockNum)
public void setAttributionAvailableStockNum(BigDecimal attributionAvailableStockNum)
{
this.attributionAvailableStockNum = attributionAvailableStockNum;
}
public Double getAttributionAvailableStockNum()
public BigDecimal getAttributionAvailableStockNum()
{
return attributionAvailableStockNum;
}
public void setNoattributionAvailableStockNum(Double noattributionAvailableStockNum)
public void setNoattributionAvailableStockNum(BigDecimal noattributionAvailableStockNum)
{
this.noattributionAvailableStockNum = noattributionAvailableStockNum;
}
public Double getNoattributionAvailableStockNum()
public BigDecimal getNoattributionAvailableStockNum()
{
return noattributionAvailableStockNum;
}
public void setUseNum(Double useNum)
public void setUseNum(BigDecimal useNum)
{
this.useNum = useNum;
}
public Double getUseNum()
public BigDecimal getUseNum()
{
return useNum;
}
public void setReportDamageNum(Double reportDamageNum)
public void setReportDamageNum(BigDecimal reportDamageNum)
{
this.reportDamageNum = reportDamageNum;
}
public Double getReportDamageNum()
public BigDecimal getReportDamageNum()
{
return reportDamageNum;
}
@ -260,6 +272,26 @@ public class WarehouseInventoryInquiry extends BaseEntity
this.warehouseDept = warehouseDept;
}
@Override
public String getUpdateBy() {
return updateBy;
}
@Override
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy;
}
@Override
public Date getUpdateTime() {
return updateTime;
}
@Override
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

50
ruoyi-admin/src/main/java/com/ruoyi/warehouse/domain/WarehouseInventoryInquiryDetail.java

@ -52,22 +52,22 @@ public class WarehouseInventoryInquiryDetail extends BaseEntity
private String materialSpecification;
/** 物料历史总数量 */
private Double historicalTotal;
private BigDecimal historicalTotal;
/** 可用库存数 */
private Double availableStockNum;
private BigDecimal availableStockNum;
/** 物料归属可用库存数 */
private Double attributionAvailableStockNum;
private BigDecimal attributionAvailableStockNum;
/** 物料无归属可用库存数 */
private Double noattributionAvailableStockNum;
private BigDecimal noattributionAvailableStockNum;
/** 物料使用数 */
private Double useNum;
private BigDecimal useNum;
/** 物料报损数 */
private Double reportDamageNum;
private BigDecimal reportDamageNum;
/** 物料使用状态 */
private String materialUseStatus;
@ -81,8 +81,8 @@ public class WarehouseInventoryInquiryDetail extends BaseEntity
private String inventoryUseCode;
/** 库存历史时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "库存历史时间", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@Excel(name = "库存历史时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date inventoryHistoricalTime;
/** 库存历史类型 */
@ -95,14 +95,14 @@ public class WarehouseInventoryInquiryDetail extends BaseEntity
/** 库存历史数量 */
@Excel(name = "库存历史数量")
private Double inventoryHistoricalNum;
private BigDecimal inventoryHistoricalNum;
/** 不含税采购总价 */
@Excel(name = "不含税采购总价")
@Excel(name = "不含税价")
private BigDecimal purchasePriceExcludingTax;
/** 含税总价 */
@Excel(name = "含税价")
@Excel(name = "含税价")
private BigDecimal purchasePriceIncludesTax;
/** 采购单号 */
@ -216,57 +216,57 @@ public class WarehouseInventoryInquiryDetail extends BaseEntity
{
return materialSpecification;
}
public void setHistoricalTotal(Double historicalTotal)
public void setHistoricalTotal(BigDecimal historicalTotal)
{
this.historicalTotal = historicalTotal;
}
public Double getHistoricalTotal()
public BigDecimal getHistoricalTotal()
{
return historicalTotal;
}
public void setAvailableStockNum(Double availableStockNum)
public void setAvailableStockNum(BigDecimal availableStockNum)
{
this.availableStockNum = availableStockNum;
}
public Double getAvailableStockNum()
public BigDecimal getAvailableStockNum()
{
return availableStockNum;
}
public void setAttributionAvailableStockNum(Double attributionAvailableStockNum)
public void setAttributionAvailableStockNum(BigDecimal attributionAvailableStockNum)
{
this.attributionAvailableStockNum = attributionAvailableStockNum;
}
public Double getAttributionAvailableStockNum()
public BigDecimal getAttributionAvailableStockNum()
{
return attributionAvailableStockNum;
}
public void setNoattributionAvailableStockNum(Double noattributionAvailableStockNum)
public void setNoattributionAvailableStockNum(BigDecimal noattributionAvailableStockNum)
{
this.noattributionAvailableStockNum = noattributionAvailableStockNum;
}
public Double getNoattributionAvailableStockNum()
public BigDecimal getNoattributionAvailableStockNum()
{
return noattributionAvailableStockNum;
}
public void setUseNum(Double useNum)
public void setUseNum(BigDecimal useNum)
{
this.useNum = useNum;
}
public Double getUseNum()
public BigDecimal getUseNum()
{
return useNum;
}
public void setReportDamageNum(Double reportDamageNum)
public void setReportDamageNum(BigDecimal reportDamageNum)
{
this.reportDamageNum = reportDamageNum;
}
public Double getReportDamageNum()
public BigDecimal getReportDamageNum()
{
return reportDamageNum;
}
@ -324,12 +324,12 @@ public class WarehouseInventoryInquiryDetail extends BaseEntity
{
return inventoryIncreaseDecrease;
}
public void setInventoryHistoricalNum(Double inventoryHistoricalNum)
public void setInventoryHistoricalNum(BigDecimal inventoryHistoricalNum)
{
this.inventoryHistoricalNum = inventoryHistoricalNum;
}
public Double getInventoryHistoricalNum()
public BigDecimal getInventoryHistoricalNum()
{
return inventoryHistoricalNum;
}

2
ruoyi-admin/src/main/java/com/ruoyi/warehouse/mapper/WarehouseInventoryInquiryMapper.java

@ -79,4 +79,6 @@ public interface WarehouseInventoryInquiryMapper
* 根据物料号查询库存查询信息
* */
WarehouseInventoryInquiry selectWarehouseInventoryInquiryByMaterialNo(String materialNo);
List<WarehouseInventoryInquiry> selectWarehouseInventoryInquiryListByNos(String[] materialNos);
}

2
ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/IWarehouseInventoryInquiryService.java

@ -27,6 +27,8 @@ public interface IWarehouseInventoryInquiryService
*/
public List<WarehouseInventoryInquiry> selectWarehouseInventoryInquiryList(WarehouseInventoryInquiry warehouseInventoryInquiry);
List<WarehouseInventoryInquiry> selectWarehouseInventoryInquiryListByNos(String[] inquiryIds);
/**
* 新增仓库库存查询
*

5
ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseInventoryInquiryServiceImpl.java

@ -46,6 +46,11 @@ public class WarehouseInventoryInquiryServiceImpl implements IWarehouseInventory
return warehouseInventoryInquiryMapper.selectWarehouseInventoryInquiryList(warehouseInventoryInquiry);
}
@Override
public List<WarehouseInventoryInquiry> selectWarehouseInventoryInquiryListByNos(String[] materialNos)
{
return warehouseInventoryInquiryMapper.selectWarehouseInventoryInquiryListByNos(materialNos);
}
/**
* 新增仓库库存查询
*

10
ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseInventoryCheckMapper.xml

@ -30,8 +30,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectWarehouseInventoryCheckVo"/>
<where>
<if test="inventoryCheckCode != null and inventoryCheckCode != ''"> and inventory_check_code = #{inventoryCheckCode}</if>
<if test="materialNo != null and materialNo != ''"> and material_no = #{materialNo}</if>
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
<!-- <if test="materialNo != null and materialNo != ''"> and material_no = #{materialNo}</if>-->
<!-- <if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>-->
<if test="materialNo != null and materialNo != ''">
and inventory_check_code in ( select inventory_check_code from warehouse_inventory_check_detail where material_no like concat('%', #{materialNo}, '%') )
</if>
<if test="materialName != null and materialName != ''">
and inventory_check_code in ( select inventory_check_code from warehouse_inventory_check_detail where material_name like concat('%', #{materialName}, '%') )
</if>
<if test="warehouseCode != null and warehouseCode != ''"> and warehouse_code = #{warehouseCode}</if>
<if test="warehouseName != null and warehouseName != ''"> and warehouse_name like concat('%', #{warehouseName}, '%')</if>
<if test="params.beginInventoryCheckDate != null and params.beginInventoryCheckDate != '' and params.endInventoryCheckDate != null and params.endInventoryCheckDate != ''"> and inventory_check_date between #{params.beginInventoryCheckDate} and #{params.endInventoryCheckDate}</if>

9
ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseInventoryInquiryMapper.xml

@ -44,7 +44,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectWarehouseInventoryInquiryList" parameterType="WarehouseInventoryInquiry" resultMap="WarehouseInventoryInquiryResult">
<include refid="selectWarehouseInventoryInquiryVo"/>
<where>
<if test="materialNo != null and materialNo != ''"> and material_no = #{materialNo}</if>
<if test="materialNo != null and materialNo != ''"> and material_no like concat('%', #{materialNo}, '%')</if>
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
</where>
@ -55,6 +55,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where inventory_inquiry_id = #{inventoryInquiryId}
</select>
<select id="selectWarehouseInventoryInquiryListByNos" parameterType="Long" resultMap="WarehouseInventoryInquiryResult">
<include refid="selectWarehouseInventoryInquiryVo"/>
where material_no in
<foreach item="materialNo" collection="array" open="(" separator="," close=")">
#{materialNo}
</foreach>
</select>
<select id="selectWarehouseInventoryInquiryByMaterialNo" parameterType="String" resultMap="WarehouseInventoryInquiryResult">
<include refid="selectWarehouseInventoryInquiryVo"/>

2
ruoyi-admin/src/main/resources/templates/warehouse/inventoryCheck/inventoryCheck.html

@ -163,8 +163,8 @@
tipMsg = `确定导出 ${ids} 数据吗?`;
dataParam.push({ "name": "ids", "value": ids });
}
$.modal.loading("正在导出数据,请稍后...");
$.modal.confirm(tipMsg, function () {
$.modal.loading("正在导出数据,请稍后...");
$.post( prefix + "/export", dataParam, function (result) {
if (result.code === web_status.SUCCESS) {
window.location.href = ctx + "common/download?fileName="+ encodeURI(result.msg) + "&delete=" + true;

21
ruoyi-admin/src/main/resources/templates/warehouse/inventoryInquiry/inventoryHistory.html

@ -58,6 +58,8 @@
var prefix = ctx + "warehouse/inventoryInquiry";
var warehouseInventoryInquiry = [[${warehouseInventoryInquiry}]];
var inventoryHistoricalType = [[${@dict.getType('inventory_historical_type')}]];
var inventoryIncreaseDecrease = [[${@dict.getType('inventory_increase_decrease')}]];
$("#form-inventoryHistory-edit").validate({
focusCleanup: true
@ -82,13 +84,22 @@
showColumns: false,
pagination: false, // 设置不分页
columns: [
{checkbox: true},
// {checkbox: true},
{title: '库存查询详情id', field: 'inventoryInquiryDetailId', visible: false},
{title: '物料号', field: 'materialNo', visible: false},
{title: '库存历史时间', field: 'inventoryHistoricalTime',},
{title: '库存历史类型', field: 'inventoryHistoricalType',},
{title: '库存增减', field: 'inventoryIncreaseDecrease',},
{title: '库存历史数量', field: 'inventoryHistoricalNum',},
{title: '时间', field: 'inventoryHistoricalTime',},
{title: '类型', field: 'inventoryHistoricalType',
formatter: function(value, row, index) {
return $.table.selectDictLabel(inventoryHistoricalType, value);
}
},
{title: '库存增减', field: 'inventoryIncreaseDecrease',
formatter: function(value, row, index) {
return $.table.selectDictLabel(inventoryIncreaseDecrease, value);
}
},
{title: '数量', field: 'availableStockNum'},
{title: '库存历史数量', field: 'inventoryHistoricalNum',visible: false},
{title: '不含税采购总价', field: 'purchasePriceExcludingTax',},
{title: '含税总价', field: 'purchasePriceIncludesTax',},
{title: '采购单号', field: 'purchaseOrderCode',},

73
ruoyi-admin/src/main/resources/templates/warehouse/inventoryInquiry/inventoryInquiry.html

@ -37,7 +37,7 @@
<a id="addRefundsButton" class="btn btn-success" onclick="add()" shiro:hasPermission="quality:refundsExchanges:add">
<i class="fa fa-plus"></i> 库存历史
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="warehouse:inventoryInquiry:export">
<a class="btn btn-warning" onclick="exportExcel()" shiro:hasPermission="warehouse:inventoryInquiry:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
@ -49,7 +49,7 @@
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('warehouse:inventoryInquiry:edit')}]];
var materialUseStatusDatas = [[${@dict.getType('material_use_status')}]];
var materialUseStatusDatas = [[${@dict.getType('useStatus')}]];
var auditStatusDatas = [[${@dict.getType('auditStatus')}]];
var useStatusDatas = [[${@dict.getType('useStatus')}]];
var processMethodDatas = [[${@dict.getType('processMethod')}]];
@ -69,56 +69,56 @@
updateUrl: prefix + "/edit/{id}",
exportUrl: prefix + "/export",
modalName: "仓库库存查询",
height: $(window).height() - 200,
height: $(window).height() - 20,
modalWidth: 1200,
fixedColumns:true,
fixedNumber: 1,
fixedRightNumber: 1,
// fixedColumns:true,
// fixedNumber: 1,
// fixedRightNumber: 1,
search: false,
showExport: true,
columns: [
{checkbox: true},
{title: '库存查询id', field: 'inventoryInquiryId', visible: false},
{title: '料号', field: 'materialNo',},
{title: '图片', field: 'materialPhotourl',
formatter: function(value, row, index) {
return $.table.imageView(value);
}
},
{title: '物料名称', field: 'materialName',},
{title: '物料类型', field: 'materialType',
formatter: function( value, row,index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{title: '物料图片地址', field: 'materialPhotourl',
formatter: function(value, row, index) {
return $.table.imageView(value);
}
},
{title: '物料品牌', field: 'materialBrand',},
{title: '物料单位', field: 'materialUnit',},
{title: '物料描述', field: 'materialDescribe',},
{title: '物料加工方式', field: 'materialProcessMethod',
{title: '单位', field: 'materialUnit',},
{title: '品牌', field: 'materialBrand',},
{title: '描述', field: 'materialDescribe',},
{title: '加工方式', field: 'materialProcessMethod',
formatter: function(value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value);
}
},
{title: '物料型号', field: 'materialModel',},
{title: '物料规格', field: 'materialSpecification',},
{title: '物料型号', field: 'materialModel',visible: false},
{title: '物料规格', field: 'materialSpecification',visible: false},
{title: '物料入库部门', field: 'warehouseDept',visible: false,
formatter: function(value, row, index) {
return $.table.selectDictLabel(warehouseDeptDatas, value);
}
},
{title: '物料历史总数量', field: 'historicalTotal',},
{title: '历史总数量', field: 'historicalTotal',},
{title: '可用库存数', field: 'availableStockNum',},
{title: '物料归属可用库存数', field: 'attributionAvailableStockNum',},
{title: '物料无归属可用库存数', field: 'noattributionAvailableStockNum',},
{title: '物料使用数', field: 'useNum',},
{title: '物料报损数', field: 'reportDamageNum',},
{title: '物料使用状态', field: 'materialUseStatus',
{title: '归属可用库存数', field: 'attributionAvailableStockNum',visible: false},
{title: '无归属可用库存数', field: 'noattributionAvailableStockNum',visible: false},
{title: '使用数', field: 'useNum',},
{title: '报损数', field: 'reportDamageNum',},
{title: '使用状态', field: 'materialUseStatus',
formatter: function(value, row, index) {
return $.table.selectDictLabel(materialUseStatusDatas, value);
}
},
{title: '录入时间', field: 'createTime',},
{title: '录入人', field: 'createBy',},
{title: '录入时间', field: 'createTime',visible: false},
{title: '录入人', field: 'createBy',visible: false},
{title: '更新人', field: 'updateBy',},
{title: '上次更新时间', field: 'updateTime',},
// {title: '操作', align: 'center',
@ -144,8 +144,29 @@
}else{
$.modal.msgWarning("只能查看一种物料的库存历史!")
}
};
// 导出
function exportExcel() {
var ids = $.table.selectColumns("materialNo");
var dataParam = $("#formId").serializeArray();
let tipMsg = "确定导出当前所有数据吗?";
if ($.common.isNotEmpty(ids)) {
tipMsg = `确定导出 ${ids} 库存数据吗?`;
dataParam.push({ "name": "ids", "value": ids });
}
$.modal.confirm(tipMsg, function () {
$.modal.loading("正在导出数据,请稍后...");
$.post( prefix + "/export", dataParam, function (result) {
if (result.code === web_status.SUCCESS) {
window.location.href = ctx + "common/download?fileName="+ encodeURI(result.msg) + "&delete=" + true;
} else {
$.modal.alertError(result.msg);
}
$.modal.closeLoading();
});
});
}
</script>
</body>
</html>
Loading…
Cancel
Save