Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hg-smart
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
platform
hg-smart
Commits
6a702e44
Commit
6a702e44
authored
May 10, 2024
by
liuyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2024-05-09 设备计划
parent
28720284
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
369 additions
and
63 deletions
+369
-63
DdynamicEnum.java
src/main/java/com/baosight/hggp/common/DdynamicEnum.java
+3
-2
HGSB002.java
src/main/java/com/baosight/hggp/hg/sb/domain/HGSB002.java
+4
-4
ServiceHGSB002A.java
...java/com/baosight/hggp/hg/sb/service/ServiceHGSB002A.java
+18
-1
HGSB001.xml
src/main/java/com/baosight/hggp/hg/sb/sql/HGSB001.xml
+9
-0
HGSB002.xml
src/main/java/com/baosight/hggp/hg/sb/sql/HGSB002.xml
+1
-1
HGSB002A.xml
src/main/java/com/baosight/hggp/hg/sb/sql/HGSB002A.xml
+1
-1
HGSB002.js
src/main/webapp/HG/SB/HGSB002.js
+58
-30
HGSB002.jsp
src/main/webapp/HG/SB/HGSB002.jsp
+16
-17
HGSB002A.js
src/main/webapp/HG/SB/HGSB002A.js
+199
-0
HGSB002A.jsp
src/main/webapp/HG/SB/HGSB002A.jsp
+60
-7
No files found.
src/main/java/com/baosight/hggp/common/DdynamicEnum.java
View file @
6a702e44
...
...
@@ -168,8 +168,8 @@ public enum DdynamicEnum {
*/
PROCESS_CODE_BLOCK_ID
(
"processCode_block_id"
,
"processCode"
,
"processName"
,
"factoryCode"
,
"factoryName"
,
"unit"
,
"HGSJ001.queryProcessCode"
),
/**
* 模块:
工序
编码
* 用途:
工序编码
下拉框
* 模块:
设备台账
编码
* 用途:
设备区域
下拉框
* 编写:ly
*/
GROUP_CODE_BOX_BLOCK_ID
(
"groupCodeBox_block_id"
,
"orgEname"
,
"orgCname"
,
"factoryCode"
,
"factoryName"
,
"companyCode"
,
"companyName"
,
"HGSB001.queryGroupCodeBox"
,
...
...
@@ -179,6 +179,7 @@ public enum DdynamicEnum {
put
(
"orgTypes"
,
new
String
[]{
OrgTypeEnum
.
COMPANY
.
getCode
(),
OrgTypeEnum
.
FACTORY
.
getCode
()});
}}
),
DEVICE_CODE_BOX_BLOCK_ID
(
"deviceCodeBox_block_id"
,
"deviceCode"
,
"deviceName"
,
"deviceType"
,
"HGSB001.queryDeviceCodeBox"
),
;
...
...
src/main/java/com/baosight/hggp/hg/sb/domain/HGSB002.java
View file @
6a702e44
...
...
@@ -71,10 +71,10 @@ public class HGSB002 extends DaoEPBase {
public
static
final
String
COL_PLAN_USER_NAME
=
"PLAN_USER_NAME"
;
/* 计划人名称*/
public
static
final
String
COL_PLAN_STATUS
=
"PLAN_STATUS"
;
/* 审批状态 0-停止 1-启用*/
public
static
final
String
QUERY
=
"
hgsb
002.query"
;
public
static
final
String
COUNT
=
"
hgsb
002.count"
;
public
static
final
String
INSERT
=
"
hgsb
002.insert"
;
public
static
final
String
UPDATE
=
"
hgsb
002.update"
;
public
static
final
String
QUERY
=
"
HGSB
002.query"
;
public
static
final
String
COUNT
=
"
HGSB
002.count"
;
public
static
final
String
INSERT
=
"
HGSB
002.insert"
;
public
static
final
String
UPDATE
=
"
HGSB
002.update"
;
public
static
final
String
UPDATE_STATUS
=
"HGSB002.updateStatus"
;
public
static
final
String
DELETE
=
"HGSB002.delete"
;
public
static
final
String
DELETE_FLAG
=
"HGSB002.deleteFlag"
;
...
...
src/main/java/com/baosight/hggp/hg/sb/service/ServiceHGSB002A.java
View file @
6a702e44
package
com
.
baosight
.
hggp
.
hg
.
sb
.
service
;
import
com.baosight.hggp.aspect.annotation.OperationLogAnnotation
;
import
com.baosight.hggp.common.DdynamicEnum
;
import
com.baosight.hggp.core.constant.CommonConstant
;
import
com.baosight.hggp.core.dao.DaoUtils
;
import
com.baosight.hggp.hg.sb.domain.HGSB001
;
import
com.baosight.hggp.hg.sb.domain.HGSB002A
;
import
com.baosight.hggp.util.CommonMethod
;
import
com.baosight.hggp.util.ErrorCodeUtils
;
import
com.baosight.hggp.util.LogUtils
;
import
com.baosight.hggp.util.contants.ACConstants
;
...
...
@@ -15,6 +18,8 @@ import com.baosight.iplat4j.core.resource.I18nMessages;
import
com.baosight.iplat4j.core.service.impl.ServiceEPBase
;
import
com.baosight.iplat4j.ed.util.SequenceGenerator
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -26,7 +31,18 @@ public class ServiceHGSB002A extends ServiceEPBase {
@Override
public
EiInfo
initLoad
(
EiInfo
inInfo
)
{
return
super
.
initLoad
(
inInfo
);
inInfo
.
setCell
(
EiConstant
.
queryBlock
,
ACConstants
.
ROW_CODE_0
,
HGSB002A
.
FIELD_DELETE_FLAG
,
CommonConstant
.
YesNo
.
NO_0
);
String
companyCode
=
inInfo
.
getCellStr
(
EiConstant
.
queryBlock
,
ACConstants
.
ROW_CODE_0
,
HGSB001
.
FIELD_COMPANY_CODE
);
String
groupCode
=
inInfo
.
getCellStr
(
EiConstant
.
queryBlock
,
ACConstants
.
ROW_CODE_0
,
HGSB002A
.
FIELD_GROUP_CODE
);
inInfo
=
super
.
query
(
inInfo
,
HGSB002A
.
QUERY
,
new
HGSB002A
());
CommonMethod
.
initBlock
(
inInfo
,
Arrays
.
asList
(
DdynamicEnum
.
GROUP_CODE_BOX_BLOCK_ID
),
null
);
CommonMethod
.
initBlock
(
inInfo
,
Arrays
.
asList
(
DdynamicEnum
.
DEVICE_CODE_BOX_BLOCK_ID
),
new
HashMap
<
String
,
Object
>(){{
put
(
HGSB001
.
FIELD_COMPANY_CODE
,
companyCode
);
put
(
HGSB002A
.
FIELD_GROUP_CODE
,
groupCode
);
put
(
HGSB002A
.
FIELD_DELETE_FLAG
,
CommonConstant
.
YesNo
.
NO_0
);}}
);
return
inInfo
;
}
@Override
...
...
@@ -69,6 +85,7 @@ public class ServiceHGSB002A extends ServiceEPBase {
HGSB002A
hgsb002a
=
new
HGSB002A
();
hgsb002a
.
fromMap
(
resultRows
.
get
(
i
));
if
(
hgsb002a
.
getId
()
==
null
||
hgsb002a
.
getId
()
==
0
)
{
hgsb002a
.
setParentId
(
Long
.
valueOf
(
inInfo
.
getCellStr
(
EiConstant
.
queryBlock
,
ACConstants
.
ROW_CODE_0
,
HGSB002A
.
FIELD_PARENT_ID
)));
this
.
add
(
hgsb002a
);
}
else
{
this
.
modify
(
hgsb002a
);
...
...
src/main/java/com/baosight/hggp/hg/sb/sql/HGSB001.xml
View file @
6a702e44
...
...
@@ -340,6 +340,15 @@
ID = #id#
</update>
<select
id=
"queryDeviceCodeBox"
parameterClass=
"java.util.HashMap"
resultClass=
"java.util.HashMap"
>
SELECT distinct
DEVICE_CODE as "deviceCode",
<!-- 设备编码 -->
DEVICE_NAME as "deviceName",
<!-- 设备名称 -->
DEVICE_TYPE as "deviceType"
<!-- 设备类型 -->
FROM ${hggpSchema}.HGSB001 WHERE 1=1
<include
refid=
"condition"
/>
</select>
<select
id=
"queryGroupCodeBox"
parameterClass=
"java.util.HashMap"
resultClass=
"java.util.HashMap"
>
SELECT distinct
ORG_ENAME AS "orgEname",
...
...
src/main/java/com/baosight/hggp/hg/sb/sql/HGSB002.xml
View file @
6a702e44
...
...
@@ -164,7 +164,7 @@
$orderBy$
</isNotEmpty>
<isEmpty
property=
"orderBy"
>
PLAN_DATE desc,ID asc
PLAN_DATE desc,
CREATED_TIME desc ,
ID asc
</isEmpty>
</dynamic>
...
...
src/main/java/com/baosight/hggp/hg/sb/sql/HGSB002A.xml
View file @
6a702e44
...
...
@@ -140,7 +140,7 @@
$orderBy$
</isNotEmpty>
<isEmpty
property=
"orderBy"
>
CREATED_
NA
ME desc,ID asc
CREATED_
TI
ME desc,ID asc
</isEmpty>
</dynamic>
...
...
src/main/webapp/HG/SB/HGSB002.js
View file @
6a702e44
...
...
@@ -2,6 +2,7 @@ $(function () {
var
companyCodeBox
=
__eiInfo
.
getBlock
(
"companyBox_block_id"
).
getMappedRows
();
var
groupCodeBox
=
__eiInfo
.
getBlock
(
"groupCodeBox_block_id"
).
getMappedRows
();
var
userIdBox
=
__eiInfo
.
getBlock
(
"user_block_id"
).
getMappedRows
();
$
(
".row"
).
children
().
attr
(
"class"
,
"col-md-3"
);
...
...
@@ -30,9 +31,11 @@ $(function () {
field
:
"operator"
,
title
:
"操作"
,
template
:
function
(
item
)
{
let
auditStatus
=
item
.
device
Status
;
let
auditStatus
=
item
.
plan
Status
;
let
template
=
''
;
if
(
item
.
companyCode
&&
item
.
groupCode
)
{
template
+=
'<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+
'onclick="showDetail('
+
item
.
id
+
',
\'
'
+
item
.
companyCode
+
'
\'
,
\'
'
+
item
.
companyName
+
'
\'
,
\'
'
+
item
.
groupCode
+
'
\'
,
\'
'
+
item
.
groupName
+
'
\'
)" >计划详情</a>'
;
if
(
auditStatus
==
0
)
{
template
+=
'<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+
'onclick="updateStatus('
+
item
.
id
+
',1)" >启用</a>'
;
...
...
@@ -44,7 +47,7 @@ $(function () {
return
template
;
}
},{
field
:
"p
urchase
Date"
,
field
:
"p
lan
Date"
,
attributes
:
{
class
:
"i-input-readonly"
},
...
...
@@ -52,7 +55,15 @@ $(function () {
return
currShortDate
();
}
},
{
field
:
"maintainDate"
,
field
:
"planStartDate"
,
attributes
:
{
class
:
"i-input-readonly"
},
defaultValue
:
function
()
{
return
currShortDate
();
}
},
{
field
:
"planEndDate"
,
attributes
:
{
class
:
"i-input-readonly"
},
...
...
@@ -71,7 +82,7 @@ $(function () {
}
return
dataItem
[
"companyCode"
];
}
},{
},
{
field
:
"groupCode"
,
title
:
"设备区域"
,
filter
:
function
(
options
)
{
...
...
@@ -95,10 +106,18 @@ $(function () {
}
return
dataItem
[
"groupCode"
]
}
},{
field
:
"deviceCode"
,
title
:
"设备编码"
,
},
{
field
:
"planUserId"
,
title
:
"计划人"
,
template
:
function
(
dataItem
)
{
for
(
let
i
=
0
;
i
<
userIdBox
.
length
;
i
++
)
{
if
(
userIdBox
[
i
][
'valueField'
]
===
dataItem
[
'planUserId'
]){
dataItem
[
'planUserName'
]
=
userIdBox
[
i
][
'textField'
]
return
userIdBox
[
i
][
'textField'
];
}
}
return
dataItem
[
"planUserId"
];
}
}
],
loadComplete
:
function
(
grid
)
{
...
...
@@ -218,12 +237,11 @@ let save = function (btnNode) {
$
.
each
(
rows
,
function
(
index
,
item
)
{
let
companyCode
=
item
.
get
(
"companyCode"
);
let
groupCode
=
item
.
get
(
"groupCode"
);
let
deviceType
=
item
.
get
(
"deviceType"
);
let
deviceCode
=
item
.
get
(
"deviceCode"
);
let
deviceName
=
item
.
get
(
"deviceName"
);
let
deviceModel
=
item
.
get
(
"deviceModel"
);
let
purchaseDate
=
item
.
get
(
"purchaseDate"
);
let
deviceUserId
=
item
.
get
(
"deviceUserId"
);
let
planDate
=
item
.
get
(
"planDate"
);
let
planType
=
item
.
get
(
"planType"
);
let
planStartDate
=
item
.
get
(
"planStartDate"
);
let
planEndDate
=
item
.
get
(
"planEndDate"
);
let
planUserId
=
item
.
get
(
"planUserId"
);
if
(
isBlank
(
companyCode
)){
message
(
"选中的第"
+
(
index
+
1
)
+
"行
\"
公司
\"
,不能为空!"
);
flag
=
false
;
...
...
@@ -234,33 +252,28 @@ let save = function (btnNode) {
flag
=
false
;
return
false
;
}
if
(
isBlank
(
deviceTyp
e
)){
message
(
"选中的第"
+
(
index
+
1
)
+
"行
\"
设备类型
\"
,不能为空!"
);
if
(
isBlank
(
planDat
e
)){
message
(
"选中的第"
+
(
index
+
1
)
+
"行
\"
计划日期
\"
,不能为空!"
);
flag
=
false
;
return
false
;
}
if
(
isBlank
(
deviceCod
e
)){
message
(
"选中的第"
+
(
index
+
1
)
+
"行
\"
设备编码
\"
,不能为空!"
);
if
(
isBlank
(
planTyp
e
)){
message
(
"选中的第"
+
(
index
+
1
)
+
"行
\"
计划类型
\"
,不能为空!"
);
flag
=
false
;
return
false
;
}
if
(
isBlank
(
deviceNam
e
)){
message
(
"选中的第"
+
(
index
+
1
)
+
"行
\"
设备名称
\"
,不能为空!"
);
if
(
isBlank
(
planStartDat
e
)){
message
(
"选中的第"
+
(
index
+
1
)
+
"行
\"
计划开始日期
\"
,不能为空!"
);
flag
=
false
;
return
false
;
}
if
(
isBlank
(
deviceModel
)){
message
(
"选中的第"
+
(
index
+
1
)
+
"行
\"
设备型号
\"
,不能为空!"
);
if
(
isBlank
(
planEndDate
)){
message
(
"选中的第"
+
(
index
+
1
)
+
"行
\"
计划结束日期
\"
,不能为空!"
);
flag
=
false
;
return
false
;
}
if
(
isBlank
(
purchaseDate
)){
message
(
"选中的第"
+
(
index
+
1
)
+
"行
\"
购置日期
\"
,不能为空!"
);
flag
=
false
;
return
false
;
}
if
(
isBlank
(
deviceUserId
)){
message
(
"选中的第"
+
(
index
+
1
)
+
"行
\"
设备负责人
\"
,不能为空!"
);
if
(
isBlank
(
planUserId
)){
message
(
"选中的第"
+
(
index
+
1
)
+
"行
\"
计划人
\"
,不能为空!"
);
flag
=
false
;
return
false
;
}
...
...
@@ -268,7 +281,7 @@ let save = function (btnNode) {
if
(
flag
)
{
JSUtils
.
confirm
(
"确定对勾选中的["
+
rows
.
length
+
"]条数据做
\"
保存
\"
操作? "
,
{
ok
:
function
()
{
JSUtils
.
submitGridsData
(
"result"
,
"HGSB00
1
"
,
"save"
,
true
);
JSUtils
.
submitGridsData
(
"result"
,
"HGSB00
2
"
,
"save"
,
true
);
btnNode
.
attr
(
"disabled"
,
false
);
}
});
...
...
@@ -291,6 +304,21 @@ function updateStatus(id,deviceStatus) {
async
:
false
}
);
}
/**
* 显示详情
*/
function
showDetail
(
id
,
companyCode
,
companyName
,
groupCode
,
groupName
)
{
JSColorbox
.
open
({
href
:
"HGSB002A?methodName=initLoad&inqu_status-0-parentId="
+
id
+
"&inqu_status-0-companyCode="
+
companyCode
+
"&inqu_status-0-companyName="
+
companyName
+
"&inqu_status-0-groupCode="
+
groupCode
+
"&inqu_status-0-groupName="
+
groupName
,
title
:
"<div style='text-align: center;'>设备计划详情</div>"
,
width
:
"80%"
,
height
:
"80%"
,
});
}
function
loadChange
(
grid
,
e
,
field
)
{
...
...
src/main/webapp/HG/SB/HGSB002.jsp
View file @
6a702e44
...
...
@@ -24,13 +24,12 @@
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="groupCodeBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>--%>
<EF:EFSelect blockId="inqu_status" row="0" ename="
deviceType" cname="设备
类型" colWidth="3" filter="contains">
<EF:EFSelect blockId="inqu_status" row="0" ename="
planType" cname="计划
类型" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="h
pjx.hpsb.device
Type"/>
<EF:EFCodeOption codeName="h
ggp.hgsb.plan
Type"/>
</EF:EFSelect>
<EF:EFDatePicker blockId="inqu_status" row="0" ename="purchaseDate" cname="购置日期" role="date" format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="deviceCode" cname="设备编码" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="deviceName" cname="设备名称" colWidth="3"/>
<EF:EFDatePicker blockId="inqu_status" row="0" ename="planDate" cname="计划日期" role="date" format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="planUserName" cname="计划人" colWidth="3"/>
</div>
</EF:EFRegion>
...
...
@@ -39,7 +38,7 @@
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="accountCode" cname="账套" hidden="true"/>
<%--blockName="factoryCodeBox_block_id"--%>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="
8
0" align="center"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="
12
0" align="center"/>
<EF:EFComboColumn ename="companyCode" cname="公司名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
...
...
@@ -54,28 +53,28 @@
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="groupCodeBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="deviceType" cname="设备类型"
<EF:EFColumn ename="planDate" cname="计划日期" width="120" enable="true" readonly="true" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="planCode" cname="计划单号" width="100" enable="false" readonly="true" align="center" required="true"/>
<EF:EFComboColumn ename="planType" cname="计划类型"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="
8
0" readonly="true" required="true"
maxLength="16" width="
10
0" readonly="true" required="true"
align="center" filter="contains" sort="true">
<EF:EFCodeOption codeName="h
pjx.hpsb.device
Type" />
<EF:EFCodeOption codeName="h
ggp.hgsb.plan
Type" />
</EF:EFComboColumn>
<EF:EFColumn ename="deviceCode" cname="设备编码" width="100" enable="true" readonly="true" align="center" required="true"/>
<EF:EFColumn ename="deviceName" cname="设备名称" width="160" enable="true" readonly="true" align="center" required="true"/>
<EF:EFColumn ename="deviceModel" cname="设备型号" width="120" enable="true" readonly="true" align="center" required="true"/>
<EF:EFColumn ename="purchaseDate" cname="购置日期" width="120" enable="true" readonly="true" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="maintainDate" cname="保养日期" width="120" align="center" editType="date"
<EF:EFColumn ename="planStartDate" cname="计划开始日期" width="120" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" readonly="false" required="true"/>
<EF:EFColumn ename="planEndDate" cname="计划结束日期" width="120" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" readonly="false" required="true"/>
<EF:EFComboColumn ename="
deviceUserId" cname="设备负责
人"
<EF:EFComboColumn ename="
planUserId" cname="计划
人"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="100" readonly="false" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="user_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="
deviceStatus" cname="设备
状态" width="80" align="center" readonly="false" required="true" defaultValue="1">
<EF:EFComboColumn ename="
planStatus" cname="审批
状态" width="80" align="center" readonly="false" required="true" defaultValue="1">
<EF:EFCodeOption codeName="hpjx.hpjx.status"/>
</EF:EFComboColumn>
<EF:EFColumn cname="创建人" ename="createdName" align="center" width="100" readonly="true" required="false"
...
...
src/main/webapp/HG/SB/HGSB002A.js
View file @
6a702e44
$
(
function
()
{
var
deviceCodeBox
=
__eiInfo
.
getBlock
(
"deviceCodeBox_block_id"
).
getMappedRows
();
var
groupCodeBox
=
__eiInfo
.
getBlock
(
"groupCodeBox_block_id"
).
getMappedRows
();
$
(
".row"
).
children
().
attr
(
"class"
,
"col-md-3"
);
$
(
"#QUERY"
).
on
(
"click"
,
query
);
IPLATUI
.
EFAutoComplete
=
{
"inqu_status-0-deviceName"
:
{
minLength
:
1
,
dataSource
:
{
pageSize
:
10
,
serverPaging
:
true
,
serverFiltering
:
true
}
}
};
IPLATUI
.
EFGrid
=
{
"result"
:
{
pageable
:
{
pageSize
:
10
,
pageSizes
:
[
10
,
20
,
50
,
100
],
},
columns
:
[
{
field
:
"groupCode"
,
attributes
:
{
class
:
"i-input-readonly"
},
defaultValue
:
function
()
{
return
__eiInfo
.
getBlock
(
"inqu_status"
).
getMappedRows
()[
0
][
"groupCode"
];
},
template
:
function
(
dataItem
)
{
for
(
let
i
=
0
;
i
<
groupCodeBox
.
length
;
i
++
)
{
if
(
groupCodeBox
[
i
][
'valueField'
]
===
dataItem
[
'groupCode'
])
{
dataItem
[
'groupName'
]
=
groupCodeBox
[
i
][
'textField'
].
split
(
"]"
)[
1
]
return
groupCodeBox
[
i
][
'textField'
].
split
(
"]"
)[
1
];
}
}
return
dataItem
[
"groupCode"
]
}
},
{
field
:
"deviceCode"
,
filter
:
function
(
options
)
{
var
deviceType
=
options
.
model
[
'deviceType'
];
if
(
deviceType
)
{
// 返回我们过滤后的数据集
return
_
.
filter
(
deviceCodeBox
,
function
(
item
)
{
return
item
[
"param1Field"
]
==
deviceType
;
})
}
return
deviceCodeBox
;
},
template
:
function
(
dataItem
)
{
for
(
let
i
=
0
;
i
<
deviceCodeBox
.
length
;
i
++
)
{
if
(
deviceCodeBox
[
i
][
'valueField'
]
===
dataItem
[
'deviceCode'
])
{
dataItem
[
'deviceName'
]
=
deviceCodeBox
[
i
][
'textField'
]
return
deviceCodeBox
[
i
][
'textField'
];
}
}
return
dataItem
[
"deviceCode"
]
}
}
],
loadComplete
:
function
(
grid
)
{
// 此 grid 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
grid
.
dataSource
.
bind
(
"change"
,
function
(
e
)
{
// 判断父级节点是否发生变化
if
(
e
.
field
===
"deviceType"
)
{
loadChange
(
grid
,
e
,
"deviceCode"
);
}
else
if
(
e
.
field
===
"deviceCode"
)
{
if
(
e
.
items
[
0
].
deviceType
.
length
===
0
){
loadChange
(
grid
,
e
,
"deviceType"
);
}
//loadChange(grid,e,"userId");
}
});
},
afterEdit
:
function
(
e
)
{
/*if (e.field === "groupCode" && e.model["companyCode"].length === 0){
for (let i = 0; i < groupCodeBox.length; i++) {
if (e.model[e.field] === groupCodeBox[i]["valueField"]){
e.model["companyCode"]=groupCodeBox[i]["param3Field"]
break;
}
}
}else if (e.field === "userId" && e.model["groupCode"].length === 0){
for (let i = 0; i < userName.length; i++) {
if (e.model[e.field] === userName[i]["valueField"]){
//e.model["factoryCode"]=userName[i]["param1Field"]
e.model["groupCode"]=userName[i]["param2Field"]
break;
}
}
}*/
},
onSave
:
function
(
e
)
{
// 阻止默认请求,使用自定义保存
e
.
preventDefault
();
let
btnNode
=
$
(
this
);
//禁用按钮
btnNode
.
attr
(
"disabled"
,
true
);
save
(
btnNode
);
},
onDelete
:
function
(
e
)
{
// 阻止默认请求,使用自定义删除
//e.preventDefault();
//deleteFunc();
},
onSuccess
:
function
(
e
)
{
if
(
e
.
eiInfo
.
extAttr
.
methodName
==
'save'
||
e
.
eiInfo
.
extAttr
.
methodName
==
'delete'
)
{
query
();
}
},
onRowClick
:
function
(
e
)
{
}
}
}
downKeyUp
();
});
let
query
=
function
()
{
resultGrid
.
dataSource
.
page
(
1
);
}
/**
* 保存
*/
let
save
=
function
(
btnNode
)
{
let
rows
=
resultGrid
.
getCheckedRows
();
if
(
rows
.
length
<
1
)
{
message
(
"请选择数据"
);
return
;
}
let
flag
=
true
;
$
.
each
(
rows
,
function
(
index
,
item
)
{
let
groupCode
=
item
.
get
(
"groupCode"
);
let
deviceType
=
item
.
get
(
"deviceType"
);
let
deviceCode
=
item
.
get
(
"deviceCode"
);
let
checkItem
=
item
.
get
(
"checkItem"
);
if
(
isBlank
(
groupCode
)){
message
(
"选中的第"
+
(
index
+
1
)
+
"行
\"
设备区域
\"
,不能为空!"
);
flag
=
false
;
return
false
;
}
if
(
isBlank
(
deviceType
)){
message
(
"选中的第"
+
(
index
+
1
)
+
"行
\"
设备类型
\"
,不能为空!"
);
flag
=
false
;
return
false
;
}
if
(
isBlank
(
deviceCode
)){
message
(
"选中的第"
+
(
index
+
1
)
+
"行
\"
设备名称
\"
,不能为空!"
);
flag
=
false
;
return
false
;
}
if
(
isBlank
(
checkItem
)){
message
(
"选中的第"
+
(
index
+
1
)
+
"行
\"
检查项
\"
,不能为空!"
);
flag
=
false
;
return
false
;
}
});
if
(
flag
)
{
JSUtils
.
confirm
(
"确定对勾选中的["
+
rows
.
length
+
"]条数据做
\"
保存
\"
操作? "
,
{
ok
:
function
()
{
JSUtils
.
submitGridsData
(
"result"
,
"HGSB002A"
,
"save"
,
true
);
btnNode
.
attr
(
"disabled"
,
false
);
}
});
}
}
function
loadChange
(
grid
,
e
,
field
)
{
var
cell_label
=
field
,
that
=
grid
;
// locked 表示是否为固定列
var
locked
=
that
.
isCellLocked
(
cell_label
);
// tr 表示 locked 和非 locked 的行,index 表示此行的第几列
var
tr
,
index
;
// 获取此 model 元素信息
var
item
=
e
.
items
[
0
];
var
_uid
=
item
.
uid
;
if
(
locked
)
{
tr
=
$
(
".k-grid-content-locked tr[data-uid="
+
_uid
+
"]"
);
index
=
$
(
"th[data-field='"
+
cell_label
+
"']"
).
data
(
"index"
);
}
else
{
tr
=
$
(
".k-grid-content tr[data-uid="
+
_uid
+
"]"
);
index
=
parseInt
(
$
(
"th[data-field='"
+
cell_label
+
"']"
).
data
(
"index"
))
-
that
.
lockedHeader
.
find
(
"th"
).
length
;
}
// 获取子 cell(td)
var
td
=
tr
.
children
(
"td:eq("
+
index
+
")"
);
// 触发 td.click 事件,
td
.
trigger
(
"click"
);
}
\ No newline at end of file
src/main/webapp/HG/SB/HGSB002A.jsp
View file @
6a702e44
...
...
@@ -5,12 +5,65 @@
Time: 15:02
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>
Title
</title>
</head>
<body>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
</body>
</html>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="设备计划详情">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput blockId="inqu_status" row="0" ename="companyName" cname="公司名称" colWidth="3" readonly="true"/>
<EF:EFInput blockId="inqu_status" row="0" ename="companyCode" cname="公司编码" colWidth="3" type="hidden"/>
<%--<EF:EFSelect blockId="inqu_status" row="0" ename="companyCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>--%>
<EF:EFSelect blockId="inqu_status" row="0" ename="deviceType" cname="设备类型" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hpjx.hpsb.deviceType"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="deviceName" cname="设备名称" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="groupCode" cname="设备区间编码" colWidth="3" type="hidden"/>
<EF:EFInput blockId="inqu_status" row="0" ename="groupName" cname="设备区间名称" colWidth="3" type="hidden"/>
<EF:EFInput blockId="inqu_status" row="0" ename="parentId" cname="上级ID" colWidth="3" type="hidden"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="accountCode" cname="账套" hidden="true"/>
<EF:EFComboColumn ename="groupCode" cname="设备区域" enable="false"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="groupCodeBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="deviceType" cname="设备类型"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="80" readonly="true" required="true"
align="center" filter="contains" sort="true">
<EF:EFCodeOption codeName="hpjx.hpsb.deviceType" />
</EF:EFComboColumn>
<EF:EFComboColumn ename="deviceCode" cname="设备名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="deviceCodeBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="checkItem" cname="检查项" width="100" enable="true" readonly="true" align="center" required="true"/>
<EF:EFColumn ename="checkDescrip" cname="检查描述" type="textarea" width="160" align="center"/>
<EF:EFColumn cname="创建人" ename="createdName" align="center" width="100" readonly="true" required="false"
enable="false"/>
<EF:EFColumn cname="创建时间" ename="createdTime" parseFormats="['yyyyMMddHHmmss']" editType="datetime"
dateFormat="yyyy-MM-dd HH:mm:ss" align="center" width="120" readonly="true" required="false"
enable="false"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
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