Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
warehouse
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
胡懿
warehouse
Commits
9b9b257b
Commit
9b9b257b
authored
Feb 14, 2023
by
zhanglt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
物资领用模块
parent
2d68aa17
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
1390 additions
and
5 deletions
+1390
-5
MaterialRequisition.java
...house/materialrequisition/entity/MaterialRequisition.java
+92
-0
MaterialRequisitionInfo.java
...e/materialrequisition/entity/MaterialRequisitionInfo.java
+48
-0
MaterialRequisitionInfoMapper.java
...rialrequisition/mapper/MaterialRequisitionInfoMapper.java
+19
-0
MaterialRequisitionMapper.java
...materialrequisition/mapper/MaterialRequisitionMapper.java
+19
-0
MaterialRequisitionInfoMapper.xml
...lrequisition/mapper/xml/MaterialRequisitionInfoMapper.xml
+123
-0
MaterialRequisitionMapper.xml
...erialrequisition/mapper/xml/MaterialRequisitionMapper.xml
+145
-0
MaterialRequisitionService.java
...terialrequisition/service/MaterialRequisitionService.java
+74
-0
MaterialRequisitionController.java
...aterialrequisition/web/MaterialRequisitionController.java
+234
-0
materialRequisitionForm.jsp
...warehouse/materialrequisition/materialRequisitionForm.jsp
+196
-0
materialRequisitionList.js
.../warehouse/materialrequisition/materialRequisitionList.js
+333
-0
materialRequisitionList.jsp
...warehouse/materialrequisition/materialRequisitionList.jsp
+99
-0
materialTypeList.js
...ebpage/modules/warehouse/materialtype/materialTypeList.js
+8
-5
No files found.
src/main/java/com/jeeplus/modules/warehouse/materialrequisition/entity/MaterialRequisition.java
0 → 100644
View file @
9b9b257b
/**
* Copyright © 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
*/
package
com
.
jeeplus
.
modules
.
warehouse
.
materialrequisition
.
entity
;
import
com.jeeplus.modules.sys.entity.Office
;
import
java.util.Date
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
java.util.List
;
import
com.google.common.collect.Lists
;
import
com.jeeplus.core.persistence.DataEntity
;
import
com.jeeplus.common.utils.excel.annotation.ExcelField
;
/**
* 物资领用Entity
* @author zhanglt
* @version 2023-02-13
*/
public
class
MaterialRequisition
extends
DataEntity
<
MaterialRequisition
>
{
private
static
final
long
serialVersionUID
=
1L
;
private
String
number
;
// 领用单号
private
String
operator
;
// 操作人
private
String
receiver
;
// 领用人
private
Office
office
;
// 领用机构
private
Date
time
;
// 领用时间
private
List
<
MaterialRequisitionInfo
>
materialRequisitionInfoList
=
Lists
.
newArrayList
();
// 子表列表
public
MaterialRequisition
()
{
super
();
}
public
MaterialRequisition
(
String
id
){
super
(
id
);
}
@ExcelField
(
title
=
"领用单号"
,
align
=
2
,
sort
=
1
)
public
String
getNumber
()
{
return
number
;
}
public
void
setNumber
(
String
number
)
{
this
.
number
=
number
;
}
@ExcelField
(
title
=
"操作人"
,
align
=
2
,
sort
=
2
)
public
String
getOperator
()
{
return
operator
;
}
public
void
setOperator
(
String
operator
)
{
this
.
operator
=
operator
;
}
@ExcelField
(
title
=
"领用人"
,
align
=
2
,
sort
=
3
)
public
String
getReceiver
()
{
return
receiver
;
}
public
void
setReceiver
(
String
receiver
)
{
this
.
receiver
=
receiver
;
}
@ExcelField
(
title
=
"领用机构"
,
fieldType
=
Office
.
class
,
value
=
""
,
align
=
2
,
sort
=
4
)
public
Office
getOffice
()
{
return
office
;
}
public
void
setOffice
(
Office
office
)
{
this
.
office
=
office
;
}
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@ExcelField
(
title
=
"领用时间"
,
align
=
2
,
sort
=
5
)
public
Date
getTime
()
{
return
time
;
}
public
void
setTime
(
Date
time
)
{
this
.
time
=
time
;
}
public
List
<
MaterialRequisitionInfo
>
getMaterialRequisitionInfoList
()
{
return
materialRequisitionInfoList
;
}
public
void
setMaterialRequisitionInfoList
(
List
<
MaterialRequisitionInfo
>
materialRequisitionInfoList
)
{
this
.
materialRequisitionInfoList
=
materialRequisitionInfoList
;
}
}
\ No newline at end of file
src/main/java/com/jeeplus/modules/warehouse/materialrequisition/entity/MaterialRequisitionInfo.java
0 → 100644
View file @
9b9b257b
/**
* Copyright © 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
*/
package
com
.
jeeplus
.
modules
.
warehouse
.
materialrequisition
.
entity
;
import
com.jeeplus.core.persistence.DataEntity
;
import
com.jeeplus.common.utils.excel.annotation.ExcelField
;
/**
* 领用明细表Entity
* @author zhanglt
* @version 2023-02-13
*/
public
class
MaterialRequisitionInfo
extends
DataEntity
<
MaterialRequisitionInfo
>
{
private
static
final
long
serialVersionUID
=
1L
;
private
MaterialRequisition
materialRequisition
;
// 物资领用主表ID
private
String
ledgerInfo
;
// 物资台账明细ID
public
MaterialRequisitionInfo
()
{
super
();
}
public
MaterialRequisitionInfo
(
String
id
){
super
(
id
);
}
@ExcelField
(
title
=
"物资领用主表ID"
,
align
=
2
,
sort
=
1
)
public
MaterialRequisition
getMaterialRequisition
()
{
return
materialRequisition
;
}
public
void
setMaterialRequisition
(
MaterialRequisition
materialRequisition
)
{
this
.
materialRequisition
=
materialRequisition
;
}
@ExcelField
(
title
=
"物资台账明细ID"
,
align
=
2
,
sort
=
2
)
public
String
getLedgerInfo
()
{
return
ledgerInfo
;
}
public
void
setLedgerInfo
(
String
ledgerInfo
)
{
this
.
ledgerInfo
=
ledgerInfo
;
}
}
\ No newline at end of file
src/main/java/com/jeeplus/modules/warehouse/materialrequisition/mapper/MaterialRequisitionInfoMapper.java
0 → 100644
View file @
9b9b257b
/**
* Copyright © 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
*/
package
com
.
jeeplus
.
modules
.
warehouse
.
materialrequisition
.
mapper
;
import
com.jeeplus.core.persistence.BaseMapper
;
import
com.jeeplus.core.persistence.annotation.MyBatisMapper
;
import
com.jeeplus.modules.warehouse.materialrequisition.entity.MaterialRequisitionInfo
;
/**
* 领用明细表MAPPER接口
* @author zhanglt
* @version 2023-02-13
*/
@MyBatisMapper
public
interface
MaterialRequisitionInfoMapper
extends
BaseMapper
<
MaterialRequisitionInfo
>
{
}
\ No newline at end of file
src/main/java/com/jeeplus/modules/warehouse/materialrequisition/mapper/MaterialRequisitionMapper.java
0 → 100644
View file @
9b9b257b
/**
* Copyright © 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
*/
package
com
.
jeeplus
.
modules
.
warehouse
.
materialrequisition
.
mapper
;
import
com.jeeplus.core.persistence.BaseMapper
;
import
com.jeeplus.core.persistence.annotation.MyBatisMapper
;
import
com.jeeplus.modules.warehouse.materialrequisition.entity.MaterialRequisition
;
/**
* 物资领用MAPPER接口
* @author zhanglt
* @version 2023-02-13
*/
@MyBatisMapper
public
interface
MaterialRequisitionMapper
extends
BaseMapper
<
MaterialRequisition
>
{
}
\ No newline at end of file
src/main/java/com/jeeplus/modules/warehouse/materialrequisition/mapper/xml/MaterialRequisitionInfoMapper.xml
0 → 100644
View file @
9b9b257b
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.jeeplus.modules.warehouse.materialrequisition.mapper.MaterialRequisitionInfoMapper"
>
<sql
id=
"materialRequisitionInfoColumns"
>
a.id AS "id",
a.material_requisition_id AS "materialRequisition.id",
a.ledger_info_id AS "ledgerInfo.id",
a.create_by AS "createBy.id",
a.create_date AS "createDate",
a.update_by AS "updateBy.id",
a.update_date AS "updateDate",
a.remarks AS "remarks",
a.del_flag AS "delFlag"
</sql>
<sql
id=
"materialRequisitionInfoJoins"
>
</sql>
<select
id=
"get"
resultType=
"MaterialRequisitionInfo"
>
SELECT
<include
refid=
"materialRequisitionInfoColumns"
/>
FROM t_wh_material_requisition_info a
<include
refid=
"materialRequisitionInfoJoins"
/>
WHERE a.id = #{id}
</select>
<select
id=
"findList"
resultType=
"MaterialRequisitionInfo"
>
SELECT
<include
refid=
"materialRequisitionInfoColumns"
/>
FROM t_wh_material_requisition_info a
<include
refid=
"materialRequisitionInfoJoins"
/>
<where>
a.del_flag = #{DEL_FLAG_NORMAL}
${dataScope}
</where>
<choose>
<when
test=
"page !=null and page.orderBy != null and page.orderBy != ''"
>
ORDER BY ${page.orderBy}
</when>
<otherwise>
ORDER BY a.update_date DESC
</otherwise>
</choose>
</select>
<select
id=
"findAllList"
resultType=
"MaterialRequisitionInfo"
>
SELECT
<include
refid=
"materialRequisitionInfoColumns"
/>
FROM t_wh_material_requisition_info a
<include
refid=
"materialRequisitionInfoJoins"
/>
<where>
a.del_flag = #{DEL_FLAG_NORMAL}
${dataScope}
</where>
<choose>
<when
test=
"page !=null and page.orderBy != null and page.orderBy != ''"
>
ORDER BY ${page.orderBy}
</when>
<otherwise>
ORDER BY a.update_date DESC
</otherwise>
</choose>
</select>
<insert
id=
"insert"
>
INSERT INTO t_wh_material_requisition_info(
id,
material_requisition_id,
ledger_info_id,
create_by,
create_date,
update_by,
update_date,
remarks,
del_flag
) VALUES (
#{id},
#{materialRequisition.id},
#{ledgerInfo.id},
#{createBy.id},
#{createDate},
#{updateBy.id},
#{updateDate},
#{remarks},
#{delFlag}
)
</insert>
<update
id=
"update"
>
UPDATE t_wh_material_requisition_info SET
material_requisition_id = #{materialRequisition.id},
ledger_info_id = #{ledgerInfo.id},
update_by = #{updateBy.id},
update_date = #{updateDate},
remarks = #{remarks}
WHERE id = #{id}
</update>
<!--物理删除-->
<update
id=
"delete"
>
DELETE FROM t_wh_material_requisition_info
WHERE id = #{id}
</update>
<!--逻辑删除-->
<update
id=
"deleteByLogic"
>
UPDATE t_wh_material_requisition_info SET
del_flag = #{DEL_FLAG_DELETE}
WHERE id = #{id}
</update>
<!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
<select
id=
"findUniqueByProperty"
resultType=
"MaterialRequisitionInfo"
statementType=
"STATEMENT"
>
select * FROM t_wh_material_requisition_info where ${propertyName} = '${value}'
</select>
</mapper>
\ No newline at end of file
src/main/java/com/jeeplus/modules/warehouse/materialrequisition/mapper/xml/MaterialRequisitionMapper.xml
0 → 100644
View file @
9b9b257b
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.jeeplus.modules.warehouse.materialrequisition.mapper.MaterialRequisitionMapper"
>
<sql
id=
"materialRequisitionColumns"
>
a.id AS "id",
a.number AS "number",
a.operator AS "operator",
a.receiver AS "receiver",
a.collecting_office_id AS "office.id",
a.time AS "time",
a.create_by AS "createBy.id",
a.create_date AS "createDate",
a.update_by AS "updateBy.id",
a.update_date AS "updateDate",
a.del_flag AS "delFlag",
a.remarks AS "remarks"
</sql>
<sql
id=
"materialRequisitionJoins"
>
LEFT JOIN sys_office office ON office.id = a.collecting_office_id
</sql>
<select
id=
"get"
resultType=
"MaterialRequisition"
>
SELECT
<include
refid=
"materialRequisitionColumns"
/>
FROM t_wh_material_requisition a
<include
refid=
"materialRequisitionJoins"
/>
WHERE a.id = #{id}
</select>
<select
id=
"findList"
resultType=
"MaterialRequisition"
>
SELECT
<include
refid=
"materialRequisitionColumns"
/>
FROM t_wh_material_requisition a
<include
refid=
"materialRequisitionJoins"
/>
<where>
a.del_flag = #{DEL_FLAG_NORMAL}
${dataScope}
<if
test=
"number != null and number != ''"
>
AND a.number = #{number}
</if>
<if
test=
"operator != null and operator != ''"
>
AND a.operator = #{operator}
</if>
<if
test=
"receiver != null and receiver != ''"
>
AND a.receiver = #{receiver}
</if>
</where>
<choose>
<when
test=
"page !=null and page.orderBy != null and page.orderBy != ''"
>
ORDER BY ${page.orderBy}
</when>
<otherwise>
ORDER BY a.update_date DESC
</otherwise>
</choose>
</select>
<select
id=
"findAllList"
resultType=
"MaterialRequisition"
>
SELECT
<include
refid=
"materialRequisitionColumns"
/>
FROM t_wh_material_requisition a
<include
refid=
"materialRequisitionJoins"
/>
<where>
a.del_flag = #{DEL_FLAG_NORMAL}
${dataScope}
</where>
<choose>
<when
test=
"page !=null and page.orderBy != null and page.orderBy != ''"
>
ORDER BY ${page.orderBy}
</when>
<otherwise>
ORDER BY a.update_date DESC
</otherwise>
</choose>
</select>
<insert
id=
"insert"
>
INSERT INTO t_wh_material_requisition(
id,
number,
operator,
receiver,
collecting_office_id,
time,
create_by,
create_date,
update_by,
update_date,
del_flag,
remarks
) VALUES (
#{id},
#{number},
#{operator},
#{receiver},
#{office.id},
#{time},
#{createBy.id},
#{createDate},
#{updateBy.id},
#{updateDate},
#{delFlag},
#{remarks}
)
</insert>
<update
id=
"update"
>
UPDATE t_wh_material_requisition SET
number = #{number},
operator = #{operator},
receiver = #{receiver},
collecting_office_id = #{office.id},
time = #{time},
update_by = #{updateBy.id},
update_date = #{updateDate},
remarks = #{remarks}
WHERE id = #{id}
</update>
<!--物理删除-->
<update
id=
"delete"
>
DELETE FROM t_wh_material_requisition
WHERE id = #{id}
</update>
<!--逻辑删除-->
<update
id=
"deleteByLogic"
>
UPDATE t_wh_material_requisition SET
del_flag = #{DEL_FLAG_DELETE}
WHERE id = #{id}
</update>
<!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
<select
id=
"findUniqueByProperty"
resultType=
"MaterialRequisition"
statementType=
"STATEMENT"
>
select * FROM t_wh_material_requisition where ${propertyName} = '${value}'
</select>
</mapper>
\ No newline at end of file
src/main/java/com/jeeplus/modules/warehouse/materialrequisition/service/MaterialRequisitionService.java
0 → 100644
View file @
9b9b257b
/**
* Copyright © 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
*/
package
com
.
jeeplus
.
modules
.
warehouse
.
materialrequisition
.
service
;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
com.jeeplus.core.persistence.Page
;
import
com.jeeplus.core.service.CrudService
;
import
com.jeeplus.common.utils.StringUtils
;
import
com.jeeplus.modules.warehouse.materialrequisition.entity.MaterialRequisition
;
import
com.jeeplus.modules.warehouse.materialrequisition.mapper.MaterialRequisitionMapper
;
import
com.jeeplus.modules.warehouse.materialrequisition.entity.MaterialRequisitionInfo
;
import
com.jeeplus.modules.warehouse.materialrequisition.mapper.MaterialRequisitionInfoMapper
;
/**
* 物资领用Service
* @author zhanglt
* @version 2023-02-13
*/
@Service
@Transactional
(
readOnly
=
true
)
public
class
MaterialRequisitionService
extends
CrudService
<
MaterialRequisitionMapper
,
MaterialRequisition
>
{
@Autowired
private
MaterialRequisitionInfoMapper
materialRequisitionInfoMapper
;
public
MaterialRequisition
get
(
String
id
)
{
MaterialRequisition
materialRequisition
=
super
.
get
(
id
);
materialRequisition
.
setMaterialRequisitionInfoList
(
materialRequisitionInfoMapper
.
findList
(
new
MaterialRequisitionInfo
(
materialRequisition
.
getId
())));
return
materialRequisition
;
}
public
List
<
MaterialRequisition
>
findList
(
MaterialRequisition
materialRequisition
)
{
return
super
.
findList
(
materialRequisition
);
}
public
Page
<
MaterialRequisition
>
findPage
(
Page
<
MaterialRequisition
>
page
,
MaterialRequisition
materialRequisition
)
{
return
super
.
findPage
(
page
,
materialRequisition
);
}
@Transactional
(
readOnly
=
false
)
public
void
save
(
MaterialRequisition
materialRequisition
)
{
super
.
save
(
materialRequisition
);
for
(
MaterialRequisitionInfo
materialRequisitionInfo
:
materialRequisition
.
getMaterialRequisitionInfoList
()){
if
(
materialRequisitionInfo
.
getId
()
==
null
){
continue
;
}
if
(
MaterialRequisitionInfo
.
DEL_FLAG_NORMAL
.
equals
(
materialRequisitionInfo
.
getDelFlag
())){
if
(
StringUtils
.
isBlank
(
materialRequisitionInfo
.
getId
())){
materialRequisitionInfo
.
preInsert
();
materialRequisitionInfoMapper
.
insert
(
materialRequisitionInfo
);
}
else
{
materialRequisitionInfo
.
preUpdate
();
materialRequisitionInfoMapper
.
update
(
materialRequisitionInfo
);
}
}
else
{
materialRequisitionInfoMapper
.
delete
(
materialRequisitionInfo
);
}
}
}
@Transactional
(
readOnly
=
false
)
public
void
delete
(
MaterialRequisition
materialRequisition
)
{
super
.
delete
(
materialRequisition
);
materialRequisitionInfoMapper
.
delete
(
new
MaterialRequisitionInfo
(
materialRequisition
.
getId
()));
}
}
\ No newline at end of file
src/main/java/com/jeeplus/modules/warehouse/materialrequisition/web/MaterialRequisitionController.java
0 → 100644
View file @
9b9b257b
/**
* Copyright © 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
*/
package
com
.
jeeplus
.
modules
.
warehouse
.
materialrequisition
.
web
;
import
java.util.List
;
import
java.util.Map
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.validation.ConstraintViolationException
;
import
org.apache.shiro.authz.annotation.Logical
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.ModelAttribute
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.multipart.MultipartFile
;
import
com.google.common.collect.Lists
;
import
com.jeeplus.common.utils.DateUtils
;
import
com.jeeplus.common.config.Global
;
import
com.jeeplus.common.json.AjaxJson
;
import
com.jeeplus.core.persistence.Page
;
import
com.jeeplus.core.web.BaseController
;
import
com.jeeplus.common.utils.StringUtils
;
import
com.jeeplus.common.utils.excel.ExportExcel
;
import
com.jeeplus.common.utils.excel.ImportExcel
;
import
com.jeeplus.modules.warehouse.materialrequisition.entity.MaterialRequisition
;
import
com.jeeplus.modules.warehouse.materialrequisition.service.MaterialRequisitionService
;
/**
* 物资领用Controller
* @author zhanglt
* @version 2023-02-13
*/
@Controller
@RequestMapping
(
value
=
"${adminPath}/warehouse/materialrequisition/materialRequisition"
)
public
class
MaterialRequisitionController
extends
BaseController
{
@Autowired
private
MaterialRequisitionService
materialRequisitionService
;
@ModelAttribute
public
MaterialRequisition
get
(
@RequestParam
(
required
=
false
)
String
id
)
{
MaterialRequisition
entity
=
null
;
if
(
StringUtils
.
isNotBlank
(
id
)){
entity
=
materialRequisitionService
.
get
(
id
);
}
if
(
entity
==
null
){
entity
=
new
MaterialRequisition
();
}
return
entity
;
}
/**
* 物资领用列表页面
*/
@RequiresPermissions
(
"warehouse:materialrequisition:materialRequisition:list"
)
@RequestMapping
(
value
=
{
"list"
,
""
})
public
String
list
(
MaterialRequisition
materialRequisition
,
Model
model
)
{
model
.
addAttribute
(
"materialRequisition"
,
materialRequisition
);
return
"modules/warehouse/materialrequisition/materialRequisitionList"
;
}
/**
* 物资领用列表数据
*/
@ResponseBody
@RequiresPermissions
(
"warehouse:materialrequisition:materialRequisition:list"
)
@RequestMapping
(
value
=
"data"
)
public
Map
<
String
,
Object
>
data
(
MaterialRequisition
materialRequisition
,
HttpServletRequest
request
,
HttpServletResponse
response
,
Model
model
)
{
Page
<
MaterialRequisition
>
page
=
materialRequisitionService
.
findPage
(
new
Page
<
MaterialRequisition
>(
request
,
response
),
materialRequisition
);
return
getBootstrapData
(
page
);
}
/**
* 查看,增加,编辑物资领用表单页面
*/
@RequiresPermissions
(
value
={
"warehouse:materialrequisition:materialRequisition:view"
,
"warehouse:materialrequisition:materialRequisition:add"
,
"warehouse:materialrequisition:materialRequisition:edit"
},
logical
=
Logical
.
OR
)
@RequestMapping
(
value
=
"form/{mode}"
)
public
String
form
(
@PathVariable
String
mode
,
MaterialRequisition
materialRequisition
,
Model
model
)
{
model
.
addAttribute
(
"materialRequisition"
,
materialRequisition
);
model
.
addAttribute
(
"mode"
,
mode
);
return
"modules/warehouse/materialrequisition/materialRequisitionForm"
;
}
/**
* 保存物资领用
*/
@ResponseBody
@RequiresPermissions
(
value
={
"warehouse:materialrequisition:materialRequisition:add"
,
"warehouse:materialrequisition:materialRequisition:edit"
},
logical
=
Logical
.
OR
)
@RequestMapping
(
value
=
"save"
)
public
AjaxJson
save
(
MaterialRequisition
materialRequisition
,
Model
model
)
throws
Exception
{
AjaxJson
j
=
new
AjaxJson
();
/**
* 后台hibernate-validation插件校验
*/
String
errMsg
=
beanValidator
(
materialRequisition
);
if
(
StringUtils
.
isNotBlank
(
errMsg
)){
j
.
setSuccess
(
false
);
j
.
setMsg
(
errMsg
);
return
j
;
}
//新增或编辑表单保存
materialRequisitionService
.
save
(
materialRequisition
);
//保存
j
.
setSuccess
(
true
);
j
.
setMsg
(
"保存物资领用成功"
);
return
j
;
}
/**
* 删除物资领用
*/
@ResponseBody
@RequiresPermissions
(
"warehouse:materialrequisition:materialRequisition:del"
)
@RequestMapping
(
value
=
"delete"
)
public
AjaxJson
delete
(
MaterialRequisition
materialRequisition
)
{
AjaxJson
j
=
new
AjaxJson
();
materialRequisitionService
.
delete
(
materialRequisition
);
j
.
setMsg
(
"删除物资领用成功"
);
return
j
;
}
/**
* 批量删除物资领用
*/
@ResponseBody
@RequiresPermissions
(
"warehouse:materialrequisition:materialRequisition:del"
)
@RequestMapping
(
value
=
"deleteAll"
)
public
AjaxJson
deleteAll
(
String
ids
)
{
AjaxJson
j
=
new
AjaxJson
();
String
idArray
[]
=
ids
.
split
(
","
);
for
(
String
id
:
idArray
){
materialRequisitionService
.
delete
(
materialRequisitionService
.
get
(
id
));
}
j
.
setMsg
(
"删除物资领用成功"
);
return
j
;
}
/**
* 导出excel文件
*/
@ResponseBody
@RequiresPermissions
(
"warehouse:materialrequisition:materialRequisition:export"
)
@RequestMapping
(
value
=
"export"
)
public
AjaxJson
exportFile
(
MaterialRequisition
materialRequisition
,
HttpServletRequest
request
,
HttpServletResponse
response
)
{
AjaxJson
j
=
new
AjaxJson
();
try
{
String
fileName
=
"物资领用"
+
DateUtils
.
getDate
(
"yyyyMMddHHmmss"
)+
".xlsx"
;
Page
<
MaterialRequisition
>
page
=
materialRequisitionService
.
findPage
(
new
Page
<
MaterialRequisition
>(
request
,
response
,
-
1
),
materialRequisition
);
new
ExportExcel
(
"物资领用"
,
MaterialRequisition
.
class
).
setDataList
(
page
.
getList
()).
write
(
response
,
fileName
).
dispose
();
j
.
setSuccess
(
true
);
j
.
setMsg
(
"导出成功!"
);
return
j
;
}
catch
(
Exception
e
)
{
j
.
setSuccess
(
false
);
j
.
setMsg
(
"导出物资领用记录失败!失败信息:"
+
e
.
getMessage
());
}
return
j
;
}
@ResponseBody
@RequestMapping
(
value
=
"detail"
)
public
MaterialRequisition
detail
(
String
id
)
{
return
materialRequisitionService
.
get
(
id
);
}
/**
* 导入Excel数据
*/
@ResponseBody
@RequiresPermissions
(
"warehouse:materialrequisition:materialRequisition:import"
)
@RequestMapping
(
value
=
"import"
)
public
AjaxJson
importFile
(
@RequestParam
(
"file"
)
MultipartFile
file
,
HttpServletResponse
response
,
HttpServletRequest
request
)
{
AjaxJson
j
=
new
AjaxJson
();
try
{
int
successNum
=
0
;
int
failureNum
=
0
;
StringBuilder
failureMsg
=
new
StringBuilder
();
ImportExcel
ei
=
new
ImportExcel
(
file
,
1
,
0
);
List
<
MaterialRequisition
>
list
=
ei
.
getDataList
(
MaterialRequisition
.
class
);
for
(
MaterialRequisition
materialRequisition
:
list
){
try
{
materialRequisitionService
.
save
(
materialRequisition
);
successNum
++;
}
catch
(
ConstraintViolationException
ex
){
failureNum
++;
}
catch
(
Exception
ex
)
{
failureNum
++;
}
}
if
(
failureNum
>
0
){
failureMsg
.
insert
(
0
,
",失败 "
+
failureNum
+
" 条物资领用记录。"
);
}
j
.
setMsg
(
"已成功导入 "
+
successNum
+
" 条物资领用记录"
+
failureMsg
);
}
catch
(
Exception
e
)
{
j
.
setSuccess
(
false
);
j
.
setMsg
(
"导入物资领用失败!失败信息:"
+
e
.
getMessage
());
}
return
j
;
}
/**
* 下载导入物资领用数据模板
*/
@ResponseBody
@RequiresPermissions
(
"warehouse:materialrequisition:materialRequisition:import"
)
@RequestMapping
(
value
=
"import/template"
)
public
AjaxJson
importFileTemplate
(
HttpServletResponse
response
)
{
AjaxJson
j
=
new
AjaxJson
();
try
{
String
fileName
=
"物资领用数据导入模板.xlsx"
;
List
<
MaterialRequisition
>
list
=
Lists
.
newArrayList
();
new
ExportExcel
(
"物资领用数据"
,
MaterialRequisition
.
class
,
1
).
setDataList
(
list
).
write
(
response
,
fileName
).
dispose
();
return
null
;
}
catch
(
Exception
e
)
{
j
.
setSuccess
(
false
);
j
.
setMsg
(
"导入模板下载失败!失败信息:"
+
e
.
getMessage
());
}
return
j
;
}
}
\ No newline at end of file
src/main/webapp/webpage/modules/warehouse/materialrequisition/materialRequisitionForm.jsp
0 → 100644
View file @
9b9b257b
<
%@
page
contentType=
"text/html;charset=UTF-8"
%
>
<
%@
include
file=
"/webpage/include/taglib.jsp"
%
>
<html>
<head>
<title>
物资领用管理
</title>
<meta
name=
"decorator"
content=
"ani"
/>
<script
type=
"text/javascript"
>
$
(
document
).
ready
(
function
()
{
jp
.
ajaxForm
(
"#inputForm"
,
function
(
data
){
if
(
data
.
success
){
jp
.
success
(
data
.
msg
);
jp
.
go
(
"${ctx}/warehouse/materialrequisition/materialRequisition"
);
}
else
{
jp
.
error
(
data
.
msg
);
$
(
"#inputForm"
).
find
(
"button:submit"
).
button
(
"reset"
);
}
});
$
(
'#time'
).
datetimepicker
({
format
:
"YYYY-MM-DD HH:mm:ss"
});
});
function
addRow
(
list
,
idx
,
tpl
,
row
){
$
(
list
).
append
(
Mustache
.
render
(
tpl
,
{
idx
:
idx
,
delBtn
:
true
,
row
:
row
}));
$
(
list
+
idx
).
find
(
"select"
).
each
(
function
(){
$
(
this
).
val
(
$
(
this
).
attr
(
"data-value"
));
});
$
(
list
+
idx
).
find
(
"input[type='checkbox'], input[type='radio']"
).
each
(
function
(){
var
ss
=
$
(
this
).
attr
(
"data-value"
).
split
(
','
);
for
(
var
i
=
0
;
i
<
ss
.
length
;
i
++
){
if
(
$
(
this
).
val
()
==
ss
[
i
]){
$
(
this
).
attr
(
"checked"
,
"checked"
);
}
}
});
$
(
list
+
idx
).
find
(
".form_datetime"
).
each
(
function
(){
$
(
this
).
datetimepicker
({
format
:
"YYYY-MM-DD HH:mm:ss"
});
});
}
function
delRow
(
obj
,
prefix
){
var
id
=
$
(
prefix
+
"_id"
);
var
delFlag
=
$
(
prefix
+
"_delFlag"
);
if
(
id
.
val
()
==
""
){
$
(
obj
).
parent
().
parent
().
remove
();
}
else
if
(
delFlag
.
val
()
==
"0"
){
delFlag
.
val
(
"1"
);
$
(
obj
).
html
(
"÷"
).
attr
(
"title"
,
"撤销删除"
);
$
(
obj
).
parent
().
parent
().
addClass
(
"error"
);
}
else
if
(
delFlag
.
val
()
==
"1"
){
delFlag
.
val
(
"0"
);
$
(
obj
).
html
(
"×"
).
attr
(
"title"
,
"删除"
);
$
(
obj
).
parent
().
parent
().
removeClass
(
"error"
);
}
}
</script>
</head>
<body>
<div
class=
"wrapper wrapper-content"
>
<div
class=
"row"
>
<div
class=
"col-md-12"
>
<div
class=
"panel panel-primary"
>
<div
class=
"panel-heading"
>
<h3
class=
"panel-title"
>
<a
class=
"panelButton"
href=
"${ctx}/warehouse/materialrequisition/materialRequisition"
><i
class=
"ti-angle-left"
></i>
返回
</a>
</h3>
</div>
<div
class=
"panel-body"
>
<form:form
id=
"inputForm"
modelAttribute=
"materialRequisition"
action=
"${ctx}/warehouse/materialrequisition/materialRequisition/save"
method=
"post"
class=
"form-horizontal"
>
<form:hidden
path=
"id"
/>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
>
领用单号:
</label>
<div
class=
"col-sm-10"
>
<form:input
path=
"number"
htmlEscape=
"false"
class=
"form-control "
/>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
>
操作人:
</label>
<div
class=
"col-sm-10"
>
<form:input
path=
"operator"
htmlEscape=
"false"
class=
"form-control "
/>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
>
领用人:
</label>
<div
class=
"col-sm-10"
>
<form:input
path=
"receiver"
htmlEscape=
"false"
class=
"form-control "
/>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
>
领用机构:
</label>
<div
class=
"col-sm-10"
>
<sys:treeselect
id=
"office"
name=
"office.id"
value=
"${materialRequisition.office.id}"
labelName=
""
labelValue=
"${materialRequisition.office.id}"
title=
"部门"
url=
"/sys/office/treeData?type=2"
cssClass=
"form-control "
allowClear=
"true"
notAllowSelectParent=
"true"
/>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
>
领用时间:
</label>
<div
class=
"col-sm-10"
>
<div
class=
'input-group form_datetime'
id=
'time'
>
<input
type=
'text'
name=
"time"
class=
"form-control "
value=
"<fmt:formatDate value="
${
materialRequisition
.
time
}"
pattern=
"yyyy-MM-dd HH:mm:ss"
/>
"/>
<span
class=
"input-group-addon"
>
<span
class=
"glyphicon glyphicon-calendar"
></span>
</span>
</div>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
>
备注信息:
</label>
<div
class=
"col-sm-10"
>
<form:textarea
path=
"remarks"
htmlEscape=
"false"
rows=
"4"
class=
"form-control "
/>
</div>
</div>
<div
class=
"tabs-container"
>
<ul
class=
"nav nav-tabs"
>
<li
class=
"active"
><a
data-toggle=
"tab"
href=
"#tab-1"
aria-expanded=
"true"
>
领用明细表:
</a>
</li>
</ul>
<div
class=
"tab-content"
>
<div
id=
"tab-1"
class=
"tab-pane fade in active"
>
<a
class=
"btn btn-white btn-sm"
onclick=
"addRow('#materialRequisitionInfoList', materialRequisitionInfoRowIdx, materialRequisitionInfoTpl);materialRequisitionInfoRowIdx = materialRequisitionInfoRowIdx + 1;"
title=
"新增"
><i
class=
"fa fa-plus"
></i>
新增
</a>
<table
class=
"table table-striped table-bordered table-condensed"
>
<thead>
<tr>
<th
class=
"hide"
></th>
<th>
物资领用主表ID
</th>
<th>
物资台账明细ID
</th>
<th>
备注信息
</th>
<th
width=
"10"
>
</th>
</tr>
</thead>
<tbody
id=
"materialRequisitionInfoList"
>
</tbody>
</table>
<script
type=
"text/template"
id=
"materialRequisitionInfoTpl"
>
//
<!--
<
tr
id
=
"materialRequisitionInfoList{{idx}}"
>
<
td
class
=
"hide"
>
<
input
id
=
"materialRequisitionInfoList{{idx}}_id"
name
=
"materialRequisitionInfoList[{{idx}}].id"
type
=
"hidden"
value
=
"{{row.id}}"
/>
<
input
id
=
"materialRequisitionInfoList{{idx}}_delFlag"
name
=
"materialRequisitionInfoList[{{idx}}].delFlag"
type
=
"hidden"
value
=
"0"
/>
<
/td
>
<
td
>
<
input
id
=
"materialRequisitionInfoList{{idx}}_materialRequisition"
name
=
"materialRequisitionInfoList[{{idx}}].materialRequisition.id"
type
=
"text"
value
=
"{{row.materialRequisition.id}}"
class
=
"form-control "
/>
<
/td
>
<
td
>
<
input
id
=
"materialRequisitionInfoList{{idx}}_ledgerInfo"
name
=
"materialRequisitionInfoList[{{idx}}].ledgerInfo.id"
type
=
"text"
value
=
"{{row.ledgerInfo.id}}"
class
=
"form-control "
/>
<
/td
>
<
td
>
<
textarea
id
=
"materialRequisitionInfoList{{idx}}_remarks"
name
=
"materialRequisitionInfoList[{{idx}}].remarks"
rows
=
"4"
class
=
"form-control "
>
{{
row
.
remarks
}}
<
/textarea
>
<
/td
>
<
td
class
=
"text-center"
width
=
"10"
>
{{
#
delBtn
}}
<
span
class
=
"close"
onclick
=
"delRow(this, '#materialRequisitionInfoList{{idx}}')"
title
=
"删除"
>&
times
;
<
/span>{{/
delBtn
}}
<
/td
>
<
/tr>/
/-->
</script>
<script
type=
"text/javascript"
>
var
materialRequisitionInfoRowIdx
=
0
,
materialRequisitionInfoTpl
=
$
(
"#materialRequisitionInfoTpl"
).
html
().
replace
(
/
(\/\/
\<!
\-\-)
|
(\/\/\-\-
>
)
/g
,
""
);
$
(
document
).
ready
(
function
()
{
var
data
=
$
{
fns
:
toJson
(
materialRequisition
.
materialRequisitionInfoList
)};
for
(
var
i
=
0
;
i
<
data
.
length
;
i
++
){
addRow
(
'#materialRequisitionInfoList'
,
materialRequisitionInfoRowIdx
,
materialRequisitionInfoTpl
,
data
[
i
]);
materialRequisitionInfoRowIdx
=
materialRequisitionInfoRowIdx
+
1
;
}
});
</script>
</div>
</div>
</div>
<c:if
test=
"${mode == 'add' || mode=='edit'}"
>
<div
class=
"col-lg-3"
></div>
<div
class=
"col-lg-6"
>
<div
class=
"form-group text-center"
>
<div>
<button
class=
"btn btn-primary btn-block btn-lg btn-parsley"
data-loading-text=
"正在提交..."
>
提 交
</button>
</div>
</div>
</div>
</c:if>
</form:form>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
src/main/webapp/webpage/modules/warehouse/materialrequisition/materialRequisitionList.js
0 → 100644
View file @
9b9b257b
<%
@
page
contentType
=
"text/html;charset=UTF-8"
%>
<
script
>
$
(
document
).
ready
(
function
()
{
$
(
'#materialRequisitionTable'
).
bootstrapTable
({
//请求方法
method
:
'post'
,
//类型json
dataType
:
"json"
,
contentType
:
"application/x-www-form-urlencoded"
,
//显示检索按钮
showSearch
:
true
,
//显示刷新按钮
showRefresh
:
true
,
//显示切换手机试图按钮
showToggle
:
true
,
//显示 内容列下拉框
showColumns
:
true
,
//显示到处按钮
showExport
:
true
,
//显示切换分页按钮
showPaginationSwitch
:
true
,
//显示详情按钮
detailView
:
true
,
//显示详细内容函数
detailFormatter
:
"detailFormatter"
,
//最低显示2行
minimumCountColumns
:
2
,
//是否显示行间隔色
striped
:
true
,
//是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
cache
:
false
,
//是否显示分页(*)
pagination
:
true
,
//排序方式
sortOrder
:
"asc"
,
//初始化加载第一页,默认第一页
pageNumber
:
1
,
//每页的记录行数(*)
pageSize
:
10
,
//可供选择的每页的行数(*)
pageList
:
[
10
,
25
,
50
,
100
],
//这个接口需要处理bootstrap table传递的固定参数,并返回特定格式的json数据
url
:
"${ctx}/warehouse/materialrequisition/materialRequisition/data"
,
//默认值为 'limit',传给服务端的参数为:limit, offset, search, sort, order Else
//queryParamsType:'',
////查询参数,每次调用是会带上这个参数,可自定义
queryParams
:
function
(
params
)
{
var
searchParam
=
$
(
"#searchForm"
).
serializeJSON
();
searchParam
.
pageNo
=
params
.
limit
===
undefined
?
"1"
:
params
.
offset
/
params
.
limit
+
1
;
searchParam
.
pageSize
=
params
.
limit
===
undefined
?
-
1
:
params
.
limit
;
searchParam
.
orderBy
=
params
.
sort
===
undefined
?
""
:
params
.
sort
+
" "
+
params
.
order
;
return
searchParam
;
},
//分页方式:client客户端分页,server服务端分页(*)
sidePagination
:
"server"
,
contextMenuTrigger
:
"right"
,
//pc端 按右键弹出菜单
contextMenuTriggerMobile
:
"press"
,
//手机端 弹出菜单,click:单击, press:长按。
contextMenu
:
'#context-menu'
,
onContextMenuItem
:
function
(
row
,
$el
){
if
(
$el
.
data
(
"item"
)
==
"edit"
){
edit
(
row
.
id
);
}
else
if
(
$el
.
data
(
"item"
)
==
"view"
){
view
(
row
.
id
);
}
else
if
(
$el
.
data
(
"item"
)
==
"delete"
){
jp
.
confirm
(
'确认要删除该物资领用记录吗?'
,
function
(){
jp
.
loading
();
jp
.
get
(
"${ctx}/warehouse/materialrequisition/materialRequisition/delete?id="
+
row
.
id
,
function
(
data
){
if
(
data
.
success
){
$
(
'#materialRequisitionTable'
).
bootstrapTable
(
'refresh'
);
jp
.
success
(
data
.
msg
);
}
else
{
jp
.
error
(
data
.
msg
);
}
})
});
}
},
onClickRow
:
function
(
row
,
$el
){
},
onShowSearch
:
function
()
{
$
(
"#search-collapse"
).
slideToggle
();
},
columns
:
[{
checkbox
:
true
}
,{
field
:
'number'
,
title
:
'领用单号'
,
sortable
:
true
,
sortName
:
'number'
,
formatter
:
function
(
value
,
row
,
index
){
value
=
jp
.
unescapeHTML
(
value
);
<
c
:
choose
>
<
c
:
when
test
=
"${fns:hasPermission('warehouse:materialrequisition:materialRequisition:edit')}"
>
return
"<a href='javascript:edit(
\"
"
+
row
.
id
+
"
\"
)'>"
+
value
+
"</a>"
;
<
/c:when
>
<
c
:
when
test
=
"${fns:hasPermission('warehouse:materialrequisition:materialRequisition:view')}"
>
return
"<a href='javascript:view(
\"
"
+
row
.
id
+
"
\"
)'>"
+
value
+
"</a>"
;
<
/c:when
>
<
c
:
otherwise
>
return
value
;
<
/c:otherwise
>
<
/c:choose
>
}
}
,{
field
:
'operator'
,
title
:
'操作人'
,
sortable
:
true
,
sortName
:
'operator'
}
,{
field
:
'receiver'
,
title
:
'领用人'
,
sortable
:
true
,
sortName
:
'receiver'
}
,{
field
:
''
,
title
:
'领用机构'
,
sortable
:
true
,
sortName
:
''
}
,{
field
:
'time'
,
title
:
'领用时间'
,
sortable
:
true
,
sortName
:
'time'
}
,{
field
:
'remarks'
,
title
:
'备注信息'
,
sortable
:
true
,
sortName
:
'remarks'
}
]
});
if
(
navigator
.
userAgent
.
match
(
/
(
iPhone|iPod|Android|ios
)
/i
)){
//如果是移动端
$
(
'#materialRequisitionTable'
).
bootstrapTable
(
"toggleView"
);
}
$
(
'#materialRequisitionTable'
).
on
(
'check.bs.table uncheck.bs.table load-success.bs.table '
+
'check-all.bs.table uncheck-all.bs.table'
,
function
()
{
$
(
'#remove'
).
prop
(
'disabled'
,
!
$
(
'#materialRequisitionTable'
).
bootstrapTable
(
'getSelections'
).
length
);
$
(
'#view,#edit'
).
prop
(
'disabled'
,
$
(
'#materialRequisitionTable'
).
bootstrapTable
(
'getSelections'
).
length
!=
1
);
});
$
(
"#btnImport"
).
click
(
function
(){
jp
.
open
({
type
:
2
,
area
:
[
500
,
200
],
auto
:
true
,
title
:
"导入数据"
,
content
:
"${ctx}/tag/importExcel"
,
btn
:
[
'下载模板'
,
'确定'
,
'关闭'
],
btn1
:
function
(
index
,
layero
){
jp
.
downloadFile
(
'${ctx}/warehouse/materialrequisition/materialRequisition/import/template'
);
},
btn2
:
function
(
index
,
layero
){
var
iframeWin
=
layero
.
find
(
'iframe'
)[
0
];
//得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
iframeWin
.
contentWindow
.
importExcel
(
'${ctx}/warehouse/materialrequisition/materialRequisition/import'
,
function
(
data
)
{
if
(
data
.
success
){
jp
.
success
(
data
.
msg
);
refresh
();
}
else
{
jp
.
error
(
data
.
msg
);
}
jp
.
close
(
index
);
});
//调用保存事件
return
false
;
},
btn3
:
function
(
index
){
jp
.
close
(
index
);
}
});
});
$
(
"#export"
).
click
(
function
(){
//导出Excel文件
var
searchParam
=
$
(
"#searchForm"
).
serializeJSON
();
searchParam
.
pageNo
=
1
;
searchParam
.
pageSize
=
-
1
;
var
sortName
=
$
(
'#materialRequisitionTable'
).
bootstrapTable
(
"getOptions"
,
"none"
).
sortName
;
var
sortOrder
=
$
(
'#materialRequisitionTable'
).
bootstrapTable
(
"getOptions"
,
"none"
).
sortOrder
;
var
values
=
""
;
for
(
var
key
in
searchParam
){
values
=
values
+
key
+
"="
+
searchParam
[
key
]
+
"&"
;
}
if
(
sortName
!=
undefined
&&
sortOrder
!=
undefined
){
values
=
values
+
"orderBy="
+
sortName
+
" "
+
sortOrder
;
}
jp
.
downloadFile
(
'${ctx}/warehouse/materialrequisition/materialRequisition/export?'
+
values
);
})
$
(
"#search"
).
click
(
"click"
,
function
()
{
// 绑定查询按扭
$
(
'#materialRequisitionTable'
).
bootstrapTable
(
'refresh'
);
});
$
(
"#reset"
).
click
(
"click"
,
function
()
{
// 绑定查询按扭
$
(
"#searchForm input"
).
val
(
""
);
$
(
"#searchForm select"
).
val
(
""
);
$
(
"#searchForm .select-item"
).
html
(
""
);
$
(
'#materialRequisitionTable'
).
bootstrapTable
(
'refresh'
);
});
});
function
getIdSelections
()
{
return
$
.
map
(
$
(
"#materialRequisitionTable"
).
bootstrapTable
(
'getSelections'
),
function
(
row
)
{
return
row
.
id
});
}
function
deleteAll
(){
jp
.
confirm
(
'确认要删除该物资领用记录吗?'
,
function
(){
jp
.
loading
();
jp
.
get
(
"${ctx}/warehouse/materialrequisition/materialRequisition/deleteAll?ids="
+
getIdSelections
(),
function
(
data
){
if
(
data
.
success
){
$
(
'#materialRequisitionTable'
).
bootstrapTable
(
'refresh'
);
jp
.
success
(
data
.
msg
);
}
else
{
jp
.
error
(
data
.
msg
);
}
})
})
}
//刷新列表
function
refresh
(){
$
(
'#materialRequisitionTable'
).
bootstrapTable
(
'refresh'
);
}
function
add
(){
jp
.
go
(
"${ctx}/warehouse/materialrequisition/materialRequisition/form/add"
);
}
function
edit
(
id
){
if
(
id
==
undefined
){
id
=
getIdSelections
();
}
jp
.
go
(
"${ctx}/warehouse/materialrequisition/materialRequisition/form/edit?id="
+
id
);
}
function
view
(
id
){
//没有权限时,不显示确定按钮
if
(
id
==
undefined
){
id
=
getIdSelections
();
}
jp
.
go
(
"${ctx}/warehouse/materialrequisition/materialRequisition/form/view?id="
+
id
);
}
function
detailFormatter
(
index
,
row
)
{
var
htmltpl
=
$
(
"#materialRequisitionChildrenTpl"
).
html
().
replace
(
/
(\/\/\<
!
\-\-)
|
(\/\/\-\-
>
)
/g
,
""
);
var
html
=
Mustache
.
render
(
htmltpl
,
{
idx
:
row
.
id
});
$
.
get
(
"${ctx}/warehouse/materialrequisition/materialRequisition/detail?id="
+
row
.
id
,
function
(
materialRequisition
){
var
materialRequisitionChild1RowIdx
=
0
,
materialRequisitionChild1Tpl
=
$
(
"#materialRequisitionChild1Tpl"
).
html
().
replace
(
/
(\/\/\<
!
\-\-)
|
(\/\/\-\-
>
)
/g
,
""
);
var
data1
=
materialRequisition
.
materialRequisitionInfoList
;
for
(
var
i
=
0
;
i
<
data1
.
length
;
i
++
){
data1
[
i
].
dict
=
{};
addRow
(
'#materialRequisitionChild-'
+
row
.
id
+
'-1-List'
,
materialRequisitionChild1RowIdx
,
materialRequisitionChild1Tpl
,
data1
[
i
]);
materialRequisitionChild1RowIdx
=
materialRequisitionChild1RowIdx
+
1
;
}
})
return
html
;
}
function
addRow
(
list
,
idx
,
tpl
,
row
){
$
(
list
).
append
(
Mustache
.
render
(
tpl
,
{
idx
:
idx
,
delBtn
:
true
,
row
:
row
}));
}
<
/script
>
<
script
type
=
"text/template"
id
=
"materialRequisitionChildrenTpl"
>
//<!--
<
div
class
=
"tabs-container"
>
<
ul
class
=
"nav nav-tabs"
>
<
li
class
=
"active"
><
a
data
-
toggle
=
"tab"
href
=
"#tab-{{idx}}-1"
aria
-
expanded
=
"true"
>
领用明细表
<
/a></
li
>
<
/ul
>
<
div
class
=
"tab-content"
>
<
div
id
=
"tab-{{idx}}-1"
class
=
"tab-pane fade in active"
>
<
table
class
=
"ani table"
>
<
thead
>
<
tr
>
<
th
>
物资领用主表
ID
<
/th
>
<
th
>
物资台账明细
ID
<
/th
>
<
th
>
备注信息
<
/th
>
<
/tr
>
<
/thead
>
<
tbody
id
=
"materialRequisitionChild-{{idx}}-1-List"
>
<
/tbody
>
<
/table
>
<
/div
>
<
/div>/
/-->
<
/script
>
<
script
type
=
"text/template"
id
=
"materialRequisitionChild1Tpl"
>
//<!--
<
tr
>
<
td
>
{{
row
.
materialRequisition
.
id
}}
<
/td
>
<
td
>
{{
row
.
ledgerInfo
.
id
}}
<
/td
>
<
td
>
{{
row
.
remarks
}}
<
/td
>
<
/tr>/
/-->
<
/script
>
src/main/webapp/webpage/modules/warehouse/materialrequisition/materialRequisitionList.jsp
0 → 100644
View file @
9b9b257b
<
%@
page
contentType=
"text/html;charset=UTF-8"
%
>
<
%@
include
file=
"/webpage/include/taglib.jsp"
%
>
<html>
<head>
<title>
物资领用管理
</title>
<meta
http-equiv=
"Content-type"
content=
"text/html; charset=utf-8"
>
<meta
name=
"decorator"
content=
"ani"
/>
<
%@
include
file=
"/webpage/include/bootstraptable.jsp"
%
>
<
%@
include
file=
"/webpage/include/treeview.jsp"
%
>
<
%@
include
file=
"materialRequisitionList.js"
%
>
</head>
<body>
<div
class=
"wrapper wrapper-content"
>
<div
class=
"panel panel-primary"
>
<div
class=
"panel-heading"
>
<h3
class=
"panel-title"
>
物资领用列表
</h3>
</div>
<div
class=
"panel-body"
>
<!-- 搜索 -->
<div
id=
"search-collapse"
class=
"collapse"
>
<div
class=
"accordion-inner"
>
<form:form
id=
"searchForm"
modelAttribute=
"materialRequisition"
class=
"form form-horizontal well clearfix"
>
<div
class=
"col-xs-12 col-sm-6 col-md-4"
>
<label
class=
"label-item single-overflow pull-left"
title=
"领用单号:"
>
领用单号:
</label>
<form:input
path=
"number"
htmlEscape=
"false"
maxlength=
"64"
class=
" form-control"
/>
</div>
<div
class=
"col-xs-12 col-sm-6 col-md-4"
>
<label
class=
"label-item single-overflow pull-left"
title=
"操作人:"
>
操作人:
</label>
<form:input
path=
"operator"
htmlEscape=
"false"
maxlength=
"64"
class=
" form-control"
/>
</div>
<div
class=
"col-xs-12 col-sm-6 col-md-4"
>
<label
class=
"label-item single-overflow pull-left"
title=
"领用人:"
>
领用人:
</label>
<form:input
path=
"receiver"
htmlEscape=
"false"
maxlength=
"64"
class=
" form-control"
/>
</div>
<div
class=
"col-xs-12 col-sm-6 col-md-4"
>
<div
style=
"margin-top:26px"
>
<a
id=
"search"
class=
"btn btn-primary btn-rounded btn-bordered btn-sm"
><i
class=
"fa fa-search"
></i>
查询
</a>
<a
id=
"reset"
class=
"btn btn-primary btn-rounded btn-bordered btn-sm"
><i
class=
"fa fa-refresh"
></i>
重置
</a>
</div>
</div>
</form:form>
</div>
</div>
<!-- 工具栏 -->
<div
id=
"toolbar"
>
<shiro:hasPermission
name=
"warehouse:materialrequisition:materialRequisition:add"
>
<button
id=
"add"
class=
"btn btn-primary"
onclick=
"add()"
>
<i
class=
"glyphicon glyphicon-plus"
></i>
新建
</button>
</shiro:hasPermission>
<shiro:hasPermission
name=
"warehouse:materialrequisition:materialRequisition:edit"
>
<button
id=
"edit"
class=
"btn btn-success"
disabled
onclick=
"edit()"
>
<i
class=
"glyphicon glyphicon-edit"
></i>
修改
</button>
</shiro:hasPermission>
<shiro:hasPermission
name=
"warehouse:materialrequisition:materialRequisition:del"
>
<button
id=
"remove"
class=
"btn btn-danger"
disabled
onclick=
"deleteAll()"
>
<i
class=
"glyphicon glyphicon-remove"
></i>
删除
</button>
</shiro:hasPermission>
<shiro:hasPermission
name=
"warehouse:materialrequisition:materialRequisition:import"
>
<button
id=
"btnImport"
class=
"btn btn-info"
><i
class=
"fa fa-folder-open-o"
></i>
导入
</button>
</shiro:hasPermission>
<shiro:hasPermission
name=
"warehouse:materialrequisition:materialRequisition:export"
>
<button
id=
"export"
class=
"btn btn-warning"
>
<i
class=
"fa fa-file-excel-o"
></i>
导出
</button>
</shiro:hasPermission>
<shiro:hasPermission
name=
"warehouse:materialrequisition:materialRequisition:view"
>
<button
id=
"view"
class=
"btn btn-default"
disabled
onclick=
"view()"
>
<i
class=
"fa fa-search-plus"
></i>
查看
</button>
</shiro:hasPermission>
</div>
<!-- 表格 -->
<table
id=
"materialRequisitionTable"
data-toolbar=
"#toolbar"
></table>
<!-- context menu -->
<ul
id=
"context-menu"
class=
"dropdown-menu"
>
<shiro:hasPermission
name=
"warehouse:materialrequisition:materialRequisition:view"
>
<li
data-item=
"view"
><a>
查看
</a></li>
</shiro:hasPermission>
<shiro:hasPermission
name=
"warehouse:materialrequisition:materialRequisition:edit"
>
<li
data-item=
"edit"
><a>
编辑
</a></li>
</shiro:hasPermission>
<shiro:hasPermission
name=
"warehouse:materialrequisition:materialRequisition:del"
>
<li
data-item=
"delete"
><a>
删除
</a></li>
</shiro:hasPermission>
<li
data-item=
"action1"
><a>
取消
</a></li>
</ul>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
src/main/webapp/webpage/modules/warehouse/materialtype/materialTypeList.js
View file @
9b9b257b
...
...
@@ -72,24 +72,27 @@
<
c
:
choose
>
<
c
:
when
test
=
"${fns:hasPermission('warehouse:materialtype:materialType:edit')}"
>
<
a
href
=
"${ctx}/warehouse/materialtype/materialType/form/edit?id={{d.row.id}}"
>
{{
d
.
row
.
remarks
===
undefined
?
""
:
d
.
row
.
remarks
}}
{{
d
.
row
.
name
===
undefined
?
""
:
d
.
row
.
name
}}
<
/a>
<
/c:when
>
<
c
:
when
test
=
"${fns:hasPermission('warehouse:materialtype:materialType:view')}"
>
<
a
href
=
"${ctx}/warehouse/materialtype/materialType/form/view?id={{d.row.id}}"
>
{{
d
.
row
.
remarks
===
undefined
?
""
:
d
.
row
.
remarks
}}
{{
d
.
row
.
name
===
undefined
?
""
:
d
.
row
.
name
}}
<
/a>
<
/c:when
>
<
c
:
otherwise
>
{{
d
.
row
.
remarks
===
undefined
?
""
:
d
.
row
.
remarks
}}
{{
d
.
row
.
name
===
undefined
?
""
:
d
.
row
.
name
}}
<
/c:otherwise
>
<
/c:choose
>
<
/td
>
<
td
>
{{
d
.
row
.
name
===
undefined
?
""
:
d
.
row
.
nam
e
}}
{{
d
.
row
.
code
===
undefined
?
""
:
d
.
row
.
cod
e
}}
<
/td
>
<
td
>
{{
d
.
row
.
code
===
undefined
?
""
:
d
.
row
.
code
}}
{{
d
.
row
.
remarks
===
undefined
?
""
:
d
.
row
.
remarks
}}
<
/td
>
<
td
>
<
div
class
=
"btn-group"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment