Browse Source

[fix] 基础资料模块

修改仓库信息前端列表页面:
修改公司信息列表页面表头的按钮,去掉之前的修改按钮,和删除按钮、其他按钮采用统一样式;新增操作栏,操作栏引用$.table.dropdownToggle方法;仓库备注和仓库地址引用$.table.tooltip方法,隐藏部分内容
仓库后端实体类和get、set方法去掉多余的:defalt_itemclass字段
mapper.xml对应的方法去掉defalt_itemclass字段
修复仓库新增报错问题:修改仓库新增的mapper.xml方法,修改仓库管理人字段不一致问题
dev
liuxiaoxu 1 month ago
parent
commit
36da757e6b
  1. 25
      ruoyi-admin/src/main/java/com/ruoyi/stock/domain/StockInfo.java
  2. 21
      ruoyi-admin/src/main/resources/mapper/stock/StockInfoMapper.xml
  3. 83
      ruoyi-admin/src/main/resources/templates/stock/stockInfo/stockInfo.html

25
ruoyi-admin/src/main/java/com/ruoyi/stock/domain/StockInfo.java

@ -37,15 +37,11 @@ public class StockInfo extends BaseEntity
@Excel(name = "仓库管理人") @Excel(name = "仓库管理人")
private String stockManager; private String stockManager;
@Excel(name = "仓库管理人电话")
private String stockManagerPhone;
/** 仓库备注 */ /** 仓库备注 */
@Excel(name = "仓库备注") @Excel(name = "仓库备注")
private String stockMemo; private String stockMemo;
/** */
private String defaltItemclass;
/** 录入时间 */ /** 录入时间 */
@Excel(name = "录入时间",dateFormat = "yyyy-MM-dd HH:mm:ss") @Excel(name = "录入时间",dateFormat = "yyyy-MM-dd HH:mm:ss")
@ -105,16 +101,6 @@ public class StockInfo extends BaseEntity
this.stockMemo = stockMemo; this.stockMemo = stockMemo;
} }
public void setDefaltItemclass(String defaltItemclass)
{
this.defaltItemclass = defaltItemclass;
}
public String getDefaltItemclass()
{
return defaltItemclass;
}
public Date getFirstAddTime() { public Date getFirstAddTime() {
return firstAddTime; return firstAddTime;
} }
@ -131,13 +117,6 @@ public class StockInfo extends BaseEntity
this.updateInfoTime = updateInfoTime; this.updateInfoTime = updateInfoTime;
} }
public String getStockManagerPhone() {
return stockManagerPhone;
}
public void setStockManagerPhone(String stockManagerPhone) {
this.stockManagerPhone = stockManagerPhone;
}
@Override @Override
public String toString() { public String toString() {
@ -146,10 +125,8 @@ public class StockInfo extends BaseEntity
.append("stockNO", getStockNO()) .append("stockNO", getStockNO())
.append("stockName", getStockName()) .append("stockName", getStockName())
.append("stockAddr", getStockAddr()) .append("stockAddr", getStockAddr())
.append("stockmanager", getStockManager()) .append("stockManager", getStockManager())
.append("stockManagerPhone", getStockManagerPhone())
.append("stockmemo", getStockMemo()) .append("stockmemo", getStockMemo())
.append("defaltItemclass", getDefaltItemclass())
.append("firstAddTime", getFirstAddTime()) .append("firstAddTime", getFirstAddTime())
.append("updateInfoTime", getUpdateInfoTime()) .append("updateInfoTime", getUpdateInfoTime())
.toString(); .toString();

21
ruoyi-admin/src/main/resources/mapper/stock/StockInfoMapper.xml

@ -11,15 +11,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="stockAddr" column="stockAddr" /> <result property="stockAddr" column="stockAddr" />
<result property="stockManager" column="stockmanager" /> <result property="stockManager" column="stockmanager" />
<result property="stockMemo" column="stockmemo" /> <result property="stockMemo" column="stockmemo" />
<result property="stockManagerPhone" column="stock_manager_phone" />
<result property="defaltItemclass" column="defalt_itemclass" />
<result property="firstAddTime" column="first_add_time" /> <result property="firstAddTime" column="first_add_time" />
<result property="updateInfoTime" column="update_info_time" /> <result property="updateInfoTime" column="update_info_time" />
</resultMap> </resultMap>
<sql id="selectStockInfoVo"> <sql id="selectStockInfoVo">
select stock_id,StockNo, Stockname, stockAddr, stockmanager,stock_manager_phone, stockmemo, select stock_id,
defalt_itemclass, first_add_time, update_info_time from stock_info StockNo,
Stockname,
stockAddr,
stockmanager,
stockmemo,
first_add_time,
update_info_time
from stock_info
</sql> </sql>
<select id="selectStockInfoList" parameterType="StockInfo" resultMap="StockInfoResult"> <select id="selectStockInfoList" parameterType="StockInfo" resultMap="StockInfoResult">
@ -55,19 +60,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="stockName != null and stockName != ''">Stockname,</if> <if test="stockName != null and stockName != ''">Stockname,</if>
<if test="stockAddr != null and stockAddr != ''">stockAddr,</if> <if test="stockAddr != null and stockAddr != ''">stockAddr,</if>
<if test="stockManager != null">stockmanager,</if> <if test="stockManager != null">stockmanager,</if>
<if test="stockManagerPhone != null">stock_manager_phone,</if>
<if test="stockMemo != null">stockmemo,</if> <if test="stockMemo != null">stockmemo,</if>
<if test="defaltItemclass != null">defalt_itemclass,</if>
<if test="firstAddTime != null">first_add_time,</if> <if test="firstAddTime != null">first_add_time,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="stockNO != null and stockNO != ''">#{stockNO},</if> <if test="stockNO != null and stockNO != ''">#{stockNO},</if>
<if test="stockName != null and stockName != ''">#{stockName},</if> <if test="stockName != null and stockName != ''">#{stockName},</if>
<if test="stockAddr != null and stockAddr != ''">#{stockAddr},</if> <if test="stockAddr != null and stockAddr != ''">#{stockAddr},</if>
<if test="stockManager != null">#{stockmanager},</if> <if test="stockManager != null">#{stockManager},</if>
<if test="stockManagerPhone != null">#{stockManagerPhone},</if>
<if test="stockMemo != null">#{stockMemo},</if> <if test="stockMemo != null">#{stockMemo},</if>
<if test="defaltItemclass != null">#{defaltItemclass},</if>
<if test="firstAddTime != null">#{firstAddTime},</if> <if test="firstAddTime != null">#{firstAddTime},</if>
</trim> </trim>
</insert> </insert>
@ -79,9 +80,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="stockName != null and stockName != ''">Stockname = #{stockName},</if> <if test="stockName != null and stockName != ''">Stockname = #{stockName},</if>
<if test="stockAddr != null and stockAddr != ''">StockAddr = #{stockAddr},</if> <if test="stockAddr != null and stockAddr != ''">StockAddr = #{stockAddr},</if>
<if test="stockManager != null">stockmanager = #{stockManager},</if> <if test="stockManager != null">stockmanager = #{stockManager},</if>
<if test="stockManagerPhone != null">stock_manager_phone = #{stockManagerPhone},</if>
<if test="stockMemo != null">stockmemo = #{stockMemo},</if> <if test="stockMemo != null">stockmemo = #{stockMemo},</if>
<if test="defaltItemclass != null">defalt_itemclass = #{defaltItemclass},</if>
<if test="updateInfoTime != null">update_info_time = #{updateInfoTime},</if> <if test="updateInfoTime != null">update_info_time = #{updateInfoTime},</if>
</trim> </trim>
where stock_id = #{stockId} where stock_id = #{stockId}

83
ruoyi-admin/src/main/resources/templates/stock/stockInfo/stockInfo.html

@ -39,13 +39,13 @@
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="stock:stockInfo:add"> <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="stock:stockInfo:add">
<i class="fa fa-plus"></i> 添加 <i class="fa fa-plus"></i> 添加
</a> </a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="stock:stockInfo:edit"> <!-- <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="stock:stockInfo:edit">-->
<i class="fa fa-edit"></i> 修改 <!-- <i class="fa fa-edit"></i> 修改-->
</a> <!-- </a>-->
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="stock:stockInfo:remove"> <!-- <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="stock:stockInfo:remove">-->
<i class="fa fa-remove"></i> 删除 <!-- <i class="fa fa-remove"></i> 删除-->
</a> <!-- </a>-->
<a class="btn btn-warning" onclick="exportExcel()" shiro:hasPermission="stock:stockInfo:export"> <a class="btn btn-success" onclick="exportExcel()" shiro:hasPermission="stock:stockInfo:export">
<i class="fa fa-download"></i> 导出 <i class="fa fa-download"></i> 导出
</a> </a>
</div> </div>
@ -72,38 +72,47 @@
columns: [ columns: [
{checkbox: true}, {checkbox: true},
{title: '仓库id',field: 'stockId',visible: false}, {title: '仓库id',field: 'stockId',visible: false},
{title: '仓库编号',field: 'stockNO',}, {title: '仓库编号',field: 'stockNO', align: 'center',},
{title: '仓库名',field: 'stockName',}, {title: '仓库名',field: 'stockName',align: 'center',},
{title: '仓库地址',field: 'stockAddr',}, {title: '仓库地址',field: 'stockAddr',align: 'center',
{title: '仓库管理人',field: 'stockManager',}, formatter: function (value, row, index) {
{title: '仓库管理人电话',field: 'stockManagerPhone',}, return $.table.tooltip(value,5,"open");
{title: '仓库备注',field: 'stockMemo',}, }
{title: '录入时间',field: 'firstAddTime', },
formatter: function (value, row, index) { {title: '仓库管理人',field: 'stockManager',align: 'center',},
// console.log(row) // {title: '仓库管理人电话',field: 'stockManagerPhone',align: 'center',},
if (value == null) {return " ";} {title: '仓库备注',field: 'stockMemo',align: 'center',
else {return value;} formatter: function (value, row, index){
} return $.table.tooltip(value,5,"open")
}
}, },
{title: '上次修改时间',field: 'updateInfoTime', {title: '录入时间',field: 'firstAddTime',align: 'center',
formatter: function (value, row, index) { // formatter: function (value, row, index) {
if (value == null) {return " ";} // // console.log(row)
else { // if (value == null) {return " ";}
var vArr = value.split(',') // else {return value;}
return vArr[0]; // }
} },
} {title: '上次修改时间',field: 'updateInfoTime',align: 'center',
// formatter: function (value, row, index) {
// if (value == null) {return " ";}
// else {
// var vArr = value.split(',')
// return vArr[0];
// }
// }
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.stockId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.stockId + '\')"><i class="fa fa-remove"></i>删除</a>');
var actionLinks = actions.join('');
return $.table.dropdownToggle(actionLinks);
}
} }
// {
// title: '操作',
// align: 'center',
// formatter: function(value, row, index) {
// var actions = [];
// actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.stockNO + '\')"><i class="fa fa-edit"></i>编辑</a> ');
// actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.stockNO + '\')"><i class="fa fa-remove"></i>删除</a>');
// return actions.join('');
// }
// }
] ]
}; };
$.table.init(options); $.table.init(options);

Loading…
Cancel
Save