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
0e5411cf
Commit
0e5411cf
authored
May 31, 2024
by
江和松
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面计算逻辑处理
parent
1427b410
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
173 additions
and
41 deletions
+173
-41
ServiceHGKC008A.java
...java/com/baosight/hggp/hg/kc/service/ServiceHGKC008A.java
+11
-8
ServiceHGKC010.java
.../java/com/baosight/hggp/hg/kc/service/ServiceHGKC010.java
+43
-0
HGKC008.js
src/main/webapp/HG/KC/HGKC008.js
+6
-3
HGKC008.jsp
src/main/webapp/HG/KC/HGKC008.jsp
+1
-1
HGKC008A.js
src/main/webapp/HG/KC/HGKC008A.js
+102
-21
HGKC008A.jsp
src/main/webapp/HG/KC/HGKC008A.jsp
+10
-8
No files found.
src/main/java/com/baosight/hggp/hg/kc/service/ServiceHGKC008A.java
View file @
0e5411cf
...
@@ -3,10 +3,11 @@ package com.baosight.hggp.hg.kc.service;
...
@@ -3,10 +3,11 @@ package com.baosight.hggp.hg.kc.service;
import
com.baosight.hggp.common.DdynamicEnum
;
import
com.baosight.hggp.common.DdynamicEnum
;
import
com.baosight.hggp.core.dao.DaoUtils
;
import
com.baosight.hggp.core.dao.DaoUtils
;
import
com.baosight.hggp.core.security.UserSessionUtils
;
import
com.baosight.hggp.core.security.UserSessionUtils
;
import
com.baosight.hggp.hg.kc.domain.HGKC004
;
import
com.baosight.hggp.hg.kc.domain.HGKC008
;
import
com.baosight.hggp.hg.kc.domain.HGKC008
;
import
com.baosight.hggp.hg.kc.domain.HGKC008A
;
import
com.baosight.hggp.hg.kc.domain.HGKC008A
;
import
com.baosight.hggp.hg.sc.domain.HGSC003
;
import
com.baosight.hggp.util.*
;
import
com.baosight.hggp.util.*
;
import
com.baosight.hggp.util.contants.ACConstants
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
import
com.baosight.iplat4j.core.ei.EiInfo
;
import
com.baosight.iplat4j.core.ei.EiInfo
;
import
com.baosight.iplat4j.core.exception.PlatException
;
import
com.baosight.iplat4j.core.exception.PlatException
;
...
@@ -24,10 +25,12 @@ public class ServiceHGKC008A extends ServiceBase {
...
@@ -24,10 +25,12 @@ public class ServiceHGKC008A extends ServiceBase {
public
EiInfo
initLoad
(
EiInfo
inInfo
)
{
public
EiInfo
initLoad
(
EiInfo
inInfo
)
{
try
{
try
{
inInfo
=
super
.
query
(
inInfo
,
HGKC008A
.
QUERY
,
new
HGKC008A
());
inInfo
=
super
.
query
(
inInfo
,
HGKC008A
.
QUERY
,
new
HGKC008A
());
String
whCode
=
inInfo
.
getCellStr
(
EiConstant
.
queryBlock
,
ACConstants
.
ROW_CODE_0
,
HGKC008A
.
FIELD_WH_CODE
);
Map
map
=
new
HashMap
();
Map
map
=
new
HashMap
();
map
.
put
(
HGKC008A
.
FIELD_ACCOUNT_CODE
,
UserSessionUtils
.
getAccountCode
());
map
.
put
(
HGKC008A
.
FIELD_ACCOUNT_CODE
,
UserSessionUtils
.
getAccountCode
());
map
.
put
(
HGKC008A
.
FIELD_WH_CODE
,
whCode
);
CommonMethod
.
initBlock
(
inInfo
,
CommonMethod
.
initBlock
(
inInfo
,
Arrays
.
asList
(
DdynamicEnum
.
INVENT_TYPE_BOX_BLOCK_ID
,
DdynamicEnum
.
INVENT_
RECORD
_BOX_BLOCK_ID
),
map
,
false
Arrays
.
asList
(
DdynamicEnum
.
INVENT_TYPE_BOX_BLOCK_ID
,
DdynamicEnum
.
INVENT_
CODE_BOX_BLOCK_ID
,
DdynamicEnum
.
SPEC
_BOX_BLOCK_ID
),
map
,
false
);
);
}
catch
(
PlatException
e
)
{
}
catch
(
PlatException
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"初始化失败"
);
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"初始化失败"
);
...
@@ -38,10 +41,12 @@ public class ServiceHGKC008A extends ServiceBase {
...
@@ -38,10 +41,12 @@ public class ServiceHGKC008A extends ServiceBase {
public
EiInfo
query
(
EiInfo
inInfo
)
{
public
EiInfo
query
(
EiInfo
inInfo
)
{
try
{
try
{
inInfo
=
super
.
query
(
inInfo
,
HGKC008A
.
QUERY
,
new
HGKC008A
());
inInfo
=
super
.
query
(
inInfo
,
HGKC008A
.
QUERY
,
new
HGKC008A
());
String
whCode
=
inInfo
.
getCellStr
(
EiConstant
.
queryBlock
,
ACConstants
.
ROW_CODE_0
,
HGKC008A
.
FIELD_WH_CODE
);
Map
map
=
new
HashMap
();
Map
map
=
new
HashMap
();
map
.
put
(
HGKC008A
.
FIELD_ACCOUNT_CODE
,
UserSessionUtils
.
getAccountCode
());
map
.
put
(
HGKC008A
.
FIELD_ACCOUNT_CODE
,
UserSessionUtils
.
getAccountCode
());
map
.
put
(
HGKC008A
.
FIELD_WH_CODE
,
whCode
);
CommonMethod
.
initBlock
(
inInfo
,
CommonMethod
.
initBlock
(
inInfo
,
Arrays
.
asList
(
DdynamicEnum
.
INVENT_TYPE_BOX_BLOCK_ID
,
DdynamicEnum
.
INVENT_
RECORD
_BOX_BLOCK_ID
),
map
,
false
Arrays
.
asList
(
DdynamicEnum
.
INVENT_TYPE_BOX_BLOCK_ID
,
DdynamicEnum
.
INVENT_
CODE_BOX_BLOCK_ID
,
DdynamicEnum
.
SPEC
_BOX_BLOCK_ID
),
map
,
false
);
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
}
catch
(
PlatException
e
)
{
}
catch
(
PlatException
e
)
{
...
@@ -105,14 +110,12 @@ public class ServiceHGKC008A extends ServiceBase {
...
@@ -105,14 +110,12 @@ public class ServiceHGKC008A extends ServiceBase {
/**
/**
* 校验保存的数据
* 校验保存的数据
*
*
* @param hgkc008
* @param hgkc008
a
*/
*/
private
void
checkSaveData
(
HGKC008A
hgkc008
)
{
private
void
checkSaveData
(
HGKC008A
hgkc008
a
)
{
AssertUtils
.
isEmpty
(
UserSessionUtils
.
getAccountCode
(),
"当前用户未绑定公司,无法操作数据,请联系管理员!"
);
AssertUtils
.
isEmpty
(
UserSessionUtils
.
getAccountCode
(),
"当前用户未绑定公司,无法操作数据,请联系管理员!"
);
AssertUtils
.
isEmpty
(
UserSessionUtils
.
getOrgId
(),
"当前用户未绑定部门,无法操作数据,请联系管理员!"
);
AssertUtils
.
isEmpty
(
UserSessionUtils
.
getOrgId
(),
"当前用户未绑定部门,无法操作数据,请联系管理员!"
);
AssertUtils
.
isEmpty
(
hgkc008
.
getCompanyCode
(),
"请选择公司!"
);
AssertUtils
.
isNull
(
hgkc008a
.
getReceiveId
(),
"未获取到生产领料单ID信息"
);
AssertUtils
.
isEmpty
(
hgkc008
.
getWhCode
(),
"请选择仓库信息!"
);
AssertUtils
.
isEmpty
(
hgkc008
.
getWhName
(),
"请选择仓库信息!"
);
}
}
}
}
...
...
src/main/java/com/baosight/hggp/hg/kc/service/ServiceHGKC010.java
View file @
0e5411cf
...
@@ -2,16 +2,20 @@ package com.baosight.hggp.hg.kc.service;
...
@@ -2,16 +2,20 @@ package com.baosight.hggp.hg.kc.service;
import
com.baosight.hggp.aspect.annotation.OperationLogAnnotation
;
import
com.baosight.hggp.aspect.annotation.OperationLogAnnotation
;
import
com.baosight.hggp.common.DdynamicEnum
;
import
com.baosight.hggp.common.DdynamicEnum
;
import
com.baosight.hggp.core.security.UserSessionUtils
;
import
com.baosight.hggp.hg.kc.domain.HGKC010
;
import
com.baosight.hggp.hg.kc.domain.HGKC010
;
import
com.baosight.hggp.hg.sc.domain.HGSC001
;
import
com.baosight.hggp.util.CommonMethod
;
import
com.baosight.hggp.util.CommonMethod
;
import
com.baosight.hggp.util.EiInfoUtils
;
import
com.baosight.hggp.util.EiInfoUtils
;
import
com.baosight.hggp.util.LogUtils
;
import
com.baosight.hggp.util.LogUtils
;
import
com.baosight.hggp.util.MapUtils
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
import
com.baosight.iplat4j.core.ei.EiInfo
;
import
com.baosight.iplat4j.core.ei.EiInfo
;
import
com.baosight.iplat4j.core.exception.PlatException
;
import
com.baosight.iplat4j.core.exception.PlatException
;
import
com.baosight.iplat4j.core.service.impl.ServiceBase
;
import
com.baosight.iplat4j.core.service.impl.ServiceBase
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Map
;
/**
/**
...
@@ -60,4 +64,43 @@ public class ServiceHGKC010 extends ServiceBase {
...
@@ -60,4 +64,43 @@ public class ServiceHGKC010 extends ServiceBase {
return
inInfo
;
return
inInfo
;
}
}
/**
* 实时库存下拉框
* @param inInfo
* @return
*/
public
EiInfo
queryInventCodeBox
(
EiInfo
inInfo
){
Map
queryMap
=
EiInfoUtils
.
getFirstRow
(
inInfo
);
String
whCode
=
MapUtils
.
getString
(
queryMap
,
HGKC010
.
FIELD_WH_CODE
);
String
inventType
=
MapUtils
.
getString
(
queryMap
,
HGKC010
.
FIELD_INVENT_TYPE
);
Map
map
=
new
HashMap
();
map
.
put
(
HGKC010
.
FIELD_ACCOUNT_CODE
,
UserSessionUtils
.
getAccountCode
());
map
.
put
(
HGKC010
.
FIELD_WH_CODE
,
whCode
);
map
.
put
(
HGKC010
.
FIELD_INVENT_TYPE
,
inventType
);
CommonMethod
.
initBlock
(
inInfo
,
Arrays
.
asList
(
DdynamicEnum
.
INVENT_CODE_BOX_BLOCK_ID
),
map
,
false
);
return
inInfo
;
}
/**
* 实时库存规格下拉框
* @param inInfo
* @return
*/
public
EiInfo
querySpecBox
(
EiInfo
inInfo
){
Map
queryMap
=
EiInfoUtils
.
getFirstRow
(
inInfo
);
String
whCode
=
MapUtils
.
getString
(
queryMap
,
HGKC010
.
FIELD_WH_CODE
);
String
inventType
=
MapUtils
.
getString
(
queryMap
,
HGKC010
.
FIELD_INVENT_TYPE
);
String
inventCode
=
MapUtils
.
getString
(
queryMap
,
HGKC010
.
FIELD_INVENT_CODE
);
Map
map
=
new
HashMap
();
map
.
put
(
HGKC010
.
FIELD_ACCOUNT_CODE
,
UserSessionUtils
.
getAccountCode
());
map
.
put
(
HGKC010
.
FIELD_WH_CODE
,
whCode
);
map
.
put
(
HGKC010
.
FIELD_INVENT_TYPE
,
inventType
);
map
.
put
(
HGKC010
.
FIELD_INVENT_CODE
,
inventCode
);
CommonMethod
.
initBlock
(
inInfo
,
Arrays
.
asList
(
DdynamicEnum
.
SPEC_BOX_BLOCK_ID
),
map
,
false
);
return
inInfo
;
}
}
}
src/main/webapp/HG/KC/HGKC008.js
View file @
0e5411cf
...
@@ -30,7 +30,7 @@ $(function (){
...
@@ -30,7 +30,7 @@ $(function (){
let
template
=
''
;
let
template
=
''
;
if
(
item
.
id
){
if
(
item
.
id
){
template
+=
'<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
template
+=
'<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+
'onclick="showDetail('
+
item
.
id
+
')" >领料详情</a>'
;
+
'onclick="showDetail('
+
item
.
id
+
'
,
\'
'
+
item
.
whCode
+
'
\'
)" >领料详情</a>'
;
if
(
status
==
0
)
{
if
(
status
==
0
)
{
template
+=
'<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
template
+=
'<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+
'onclick="updateStatus('
+
item
.
id
+
',1)" >提交</a>'
;
+
'onclick="updateStatus('
+
item
.
id
+
',1)" >提交</a>'
;
...
@@ -136,6 +136,9 @@ $(function (){
...
@@ -136,6 +136,9 @@ $(function (){
e
.
items
[
0
].
projName
=
""
;
e
.
items
[
0
].
projName
=
""
;
e
.
items
[
0
].
whCode
=
""
;
e
.
items
[
0
].
whCode
=
""
;
e
.
items
[
0
].
whName
=
""
;
e
.
items
[
0
].
whName
=
""
;
loadChange
(
grid
,
e
,
"projName"
);
loadChange
(
grid
,
e
,
"whCode"
);
loadChange
(
grid
,
e
,
"whName"
);
loadChange
(
grid
,
e
,
"projCode"
);
loadChange
(
grid
,
e
,
"projCode"
);
}
}
if
(
e
.
field
==
"whCode"
)
{
if
(
e
.
field
==
"whCode"
)
{
...
@@ -221,9 +224,9 @@ function updateStatus(id,status) {
...
@@ -221,9 +224,9 @@ function updateStatus(id,status) {
/**
/**
* 显示详情
* 显示详情
*/
*/
function
showDetail
(
id
)
{
function
showDetail
(
id
,
whCode
)
{
JSColorbox
.
open
({
JSColorbox
.
open
({
href
:
"HGKC008A?methodName=initLoad&inqu_status-0-receiveId="
+
id
,
href
:
"HGKC008A?methodName=initLoad&inqu_status-0-receiveId="
+
id
+
"&inqu_status-0-whCode="
+
whCode
,
title
:
"<div style='text-align: center;'>领料详情</div>"
,
title
:
"<div style='text-align: center;'>领料详情</div>"
,
width
:
"80%"
,
width
:
"80%"
,
height
:
"80%"
,
height
:
"80%"
,
...
...
src/main/webapp/HG/KC/HGKC008.jsp
View file @
0e5411cf
...
@@ -35,7 +35,7 @@
...
@@ -35,7 +35,7 @@
<EF:EFOptions
blockId=
"companyBox_block_id"
textField=
"textField"
valueField=
"valueField"
/>
<EF:EFOptions
blockId=
"companyBox_block_id"
textField=
"textField"
valueField=
"valueField"
/>
</EF:EFComboColumn>
</EF:EFComboColumn>
<EF:EFColumn
ename=
"companyName"
cname=
"公司名称"
hidden=
"true"
/>
<EF:EFColumn
ename=
"companyName"
cname=
"公司名称"
hidden=
"true"
/>
<EF:EFColumn
ename=
"projCode"
cname=
"项目编码"
enable=
"true"
width=
"1
2
0"
align=
"center"
required=
"true"
/>
<EF:EFColumn
ename=
"projCode"
cname=
"项目编码"
enable=
"true"
width=
"1
3
0"
align=
"center"
required=
"true"
/>
<EF:EFColumn
ename=
"projName"
cname=
"项目名称"
width=
"120"
align=
"center"
enable=
"false"
required=
"true"
/>
<EF:EFColumn
ename=
"projName"
cname=
"项目名称"
width=
"120"
align=
"center"
enable=
"false"
required=
"true"
/>
<EF:EFColumn
ename=
"applyCode"
cname=
"生产领料单号"
enable=
"false"
width=
"120"
align=
"center"
/>
<EF:EFColumn
ename=
"applyCode"
cname=
"生产领料单号"
enable=
"false"
width=
"120"
align=
"center"
/>
<EF:EFColumn
ename=
"receiptDate"
cname=
"单据日期"
width=
"120"
align=
"center"
editType=
"date"
<EF:EFColumn
ename=
"receiptDate"
cname=
"单据日期"
width=
"120"
align=
"center"
editType=
"date"
...
...
src/main/webapp/HG/KC/HGKC008A.js
View file @
0e5411cf
$
(
function
(){
$
(
function
(){
var
inventRecordBoxBlocks
=
__eiInfo
.
getBlock
(
"invent_record_box_block_id"
).
getMappedRows
();
var
inventRecordBoxBlocks
=
__eiInfo
.
getBlock
(
"invent_code_box_block_id"
).
getMappedRows
();
var
specBoxBlocks
=
__eiInfo
.
getBlock
(
"spec_box_block_id"
).
getMappedRows
();
$
(
".row"
).
children
().
attr
(
"class"
,
"col-md-3"
);
$
(
".row"
).
children
().
attr
(
"class"
,
"col-md-3"
);
...
@@ -27,7 +28,6 @@ $(function (){
...
@@ -27,7 +28,6 @@ $(function (){
if
(
item
.
inventCode
){
if
(
item
.
inventCode
){
for
(
let
i
=
0
;
i
<
inventRecordBoxBlocks
.
length
;
i
++
){
for
(
let
i
=
0
;
i
<
inventRecordBoxBlocks
.
length
;
i
++
){
if
(
item
.
inventCode
===
inventRecordBoxBlocks
[
i
][
'valueField'
]){
if
(
item
.
inventCode
===
inventRecordBoxBlocks
[
i
][
'valueField'
]){
item
[
'inventName'
]
=
inventRecordBoxBlocks
[
i
][
'textField'
];
template
=
inventRecordBoxBlocks
[
i
][
'valueField'
];
template
=
inventRecordBoxBlocks
[
i
][
'valueField'
];
}
}
}
}
...
@@ -36,13 +36,13 @@ $(function (){
...
@@ -36,13 +36,13 @@ $(function (){
},
},
editor
:
function
(
container
,
options
)
{
editor
:
function
(
container
,
options
)
{
let
inInfo
=
new
EiInfo
();
let
inInfo
=
new
EiInfo
();
inInfo
.
set
(
"inqu_status-0-whCode"
,
options
.
model
[
"whCode"
]);
inInfo
.
set
(
"inqu_status-0-inventType"
,
options
.
model
[
"inventType"
]);
inInfo
.
set
(
"inqu_status-0-inventType"
,
options
.
model
[
"inventType"
]);
inInfo
.
set
(
"inqu_status-0-isSplicingSymbol"
,
false
);
inInfo
.
set
(
"field"
,
options
.
field
);
inInfo
.
set
(
"field"
,
options
.
field
);
let
dataSource
;
let
dataSource
;
EiCommunicator
.
send
(
"HG
PZ005"
,
"queryCombo
Box"
,
inInfo
,
{
EiCommunicator
.
send
(
"HG
KC010"
,
"queryInventCode
Box"
,
inInfo
,
{
onSuccess
:
function
(
ei
)
{
onSuccess
:
function
(
ei
)
{
dataSource
=
ei
.
getBlock
(
"invent_
record
_block_id"
).
getMappedRows
();
dataSource
=
ei
.
getBlock
(
"invent_
code_box
_block_id"
).
getMappedRows
();
},
},
onFail
:
function
(
ei
)
{
onFail
:
function
(
ei
)
{
}
}
...
@@ -64,27 +64,49 @@ $(function (){
...
@@ -64,27 +64,49 @@ $(function (){
}
}
},
},
{
{
field
:
"invQty"
,
field
:
"invSpec"
,
title
:
"数量"
,
template
:
function
(
item
)
{
template
:
function
(
item
)
{
if
(
item
.
invQty
&&
item
.
invUnitWeight
){
let
template
=
""
;
let
totalWeight
=
item
.
invQty
*
item
.
invUnitWeight
;
if
(
item
.
invSpec
){
item
[
'invWeight'
]
=
totalWeight
;
for
(
let
i
=
0
;
i
<
specBoxBlocks
.
length
;
i
++
){
if
(
item
.
invSpec
===
specBoxBlocks
[
i
][
'valueField'
]){
template
=
specBoxBlocks
[
i
][
'valueField'
];
}
}
}
return
item
.
invQty
;
}
}
return
template
;
},
},
{
editor
:
function
(
container
,
options
)
{
field
:
"price"
,
let
inInfo
=
new
EiInfo
();
title
:
"单价"
,
inInfo
.
set
(
"inqu_status-0-whCode"
,
options
.
model
[
"whCode"
]);
template
:
function
(
item
)
{
inInfo
.
set
(
"inqu_status-0-inventType"
,
options
.
model
[
"inventType"
]);
if
(
item
.
price
&&
item
.
invQty
){
inInfo
.
set
(
"inqu_status-0-inventCode"
,
options
.
model
[
"inventCode"
]);
let
totalAmount
=
item
.
price
*
item
.
invQty
;
inInfo
.
set
(
"field"
,
options
.
field
);
item
[
'amount'
]
=
totalAmount
;
let
dataSource
;
EiCommunicator
.
send
(
"HGKC010"
,
"querySpecBox"
,
inInfo
,
{
onSuccess
:
function
(
ei
)
{
dataSource
=
ei
.
getBlock
(
"spec_box_block_id"
).
getMappedRows
();
},
onFail
:
function
(
ei
)
{
}
}
return
item
.
invQty
;
},
{
async
:
false
});
var
input
=
$
(
'<input />'
);
input
.
attr
(
"name"
,
options
.
field
);
input
.
attr
(
"id"
,
options
.
field
);
input
.
appendTo
(
container
);
input
.
kendoDropDownList
({
dataSource
:
dataSource
,
minLength
:
0
,
dataTextField
:
"textField"
,
dataValueField
:
"valueField"
,
optionLabelTemplate
:
"[#:valueField#]#:textField#"
,
valueTemplate
:
"[#:valueField#]#:textField#"
,
template
:
"[#:valueField#]#:textField#"
,
filter
:
"contains"
});
}
}
},{
},
{
field
:
"receiveId"
,
field
:
"receiveId"
,
template
:
function
(
item
)
{
template
:
function
(
item
)
{
item
[
'receiveId'
]
=
$
(
"#inqu_status-0-receiveId"
).
val
();
item
[
'receiveId'
]
=
$
(
"#inqu_status-0-receiveId"
).
val
();
...
@@ -96,6 +118,65 @@ $(function (){
...
@@ -96,6 +118,65 @@ $(function (){
// 此 grid 对象
// 此 grid 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
grid
.
dataSource
.
bind
(
"change"
,
function
(
e
)
{
grid
.
dataSource
.
bind
(
"change"
,
function
(
e
)
{
var
item
=
e
.
items
[
0
];
//数量计算
if
(
e
.
field
==
"invQty"
)
{
if
(
item
.
invQty
&&
item
.
invUnitWeight
){
let
totalWeight
=
item
.
invQty
*
item
.
invUnitWeight
;
resultGrid
.
setCellValue
(
item
,
'invWeight'
,
totalWeight
)
}
}
//单价计算
if
(
e
.
field
==
"price"
)
{
if
(
item
.
price
&&
item
.
invQty
){
let
totalAmount
=
item
.
price
*
item
.
invQty
;
resultGrid
.
setCellValue
(
item
,
'amount'
,
totalAmount
)
}
}
if
(
e
.
field
==
"inventType"
)
{
resultGrid
.
setCellValue
(
item
,
'inventCode'
,
""
)
resultGrid
.
setCellValue
(
item
,
'inventName'
,
""
)
resultGrid
.
setCellValue
(
item
,
'invSpec'
,
""
)
resultGrid
.
setCellValue
(
item
,
'invLength'
,
""
)
resultGrid
.
setCellValue
(
item
,
'invWidth'
,
""
)
resultGrid
.
setCellValue
(
item
,
'invThick'
,
""
)
resultGrid
.
setCellValue
(
item
,
'invQty'
,
""
)
resultGrid
.
setCellValue
(
item
,
'invUnitWeight'
,
""
)
resultGrid
.
setCellValue
(
item
,
'invWeight'
,
""
)
loadChange
(
grid
,
e
,
"inventCode"
);
}
if
(
e
.
field
==
"inventCode"
)
{
for
(
let
i
=
0
;
i
<
inventRecordBoxBlocks
.
length
;
i
++
){
if
(
item
.
inventCode
===
inventRecordBoxBlocks
[
i
][
'valueField'
]){
resultGrid
.
setCellValue
(
item
,
'inventName'
,
inventRecordBoxBlocks
[
i
][
'textField'
])
}
}
resultGrid
.
setCellValue
(
item
,
'invSpec'
,
""
)
resultGrid
.
setCellValue
(
item
,
'invLength'
,
""
)
resultGrid
.
setCellValue
(
item
,
'invWidth'
,
""
)
resultGrid
.
setCellValue
(
item
,
'invThick'
,
""
)
resultGrid
.
setCellValue
(
item
,
'invQty'
,
""
)
resultGrid
.
setCellValue
(
item
,
'invUnitWeight'
,
""
)
resultGrid
.
setCellValue
(
item
,
'invWeight'
,
""
)
loadChange
(
grid
,
e
,
"invSpec"
);
}
if
(
e
.
field
==
"invSpec"
)
{
for
(
let
i
=
0
;
i
<
specBoxBlocks
.
length
;
i
++
){
if
(
item
.
invSpec
===
specBoxBlocks
[
i
][
'valueField'
]){
resultGrid
.
setCellValue
(
item
,
'invLength'
,
specBoxBlocks
[
i
][
'param1Field'
])
resultGrid
.
setCellValue
(
item
,
'invWidth'
,
specBoxBlocks
[
i
][
'param2Field'
])
resultGrid
.
setCellValue
(
item
,
'invThick'
,
specBoxBlocks
[
i
][
'param3Field'
])
resultGrid
.
setCellValue
(
item
,
'invQty'
,
specBoxBlocks
[
i
][
'param4Field'
])
resultGrid
.
setCellValue
(
item
,
'invUnitWeight'
,
specBoxBlocks
[
i
][
'param5Field'
])
resultGrid
.
setCellValue
(
item
,
'invWeight'
,
specBoxBlocks
[
i
][
'param6Field'
])
template
=
specBoxBlocks
[
i
][
'valueField'
];
}
}
resultGrid
.
setCellValue
(
item
,
'price'
,
""
)
resultGrid
.
setCellValue
(
item
,
'amount'
,
""
)
loadChange
(
grid
,
e
,
"invQty"
);
}
});
});
},
},
afterEdit
:
function
(
e
)
{
afterEdit
:
function
(
e
)
{
...
@@ -147,7 +228,7 @@ let save = function (btnNode) {
...
@@ -147,7 +228,7 @@ let save = function (btnNode) {
if
(
flag
)
{
if
(
flag
)
{
JSUtils
.
confirm
(
"确定对勾选中的["
+
rows
.
length
+
"]条数据做
\"
保存
\"
操作? "
,
{
JSUtils
.
confirm
(
"确定对勾选中的["
+
rows
.
length
+
"]条数据做
\"
保存
\"
操作? "
,
{
ok
:
function
()
{
ok
:
function
()
{
JSUtils
.
submitGridsData
(
"result"
,
"HGKC008"
,
"save"
,
true
);
JSUtils
.
submitGridsData
(
"result"
,
"HGKC008
A
"
,
"save"
,
true
);
btnNode
.
attr
(
"disabled"
,
false
);
btnNode
.
attr
(
"disabled"
,
false
);
}
}
});
});
...
...
src/main/webapp/HG/KC/HGKC008A.jsp
View file @
0e5411cf
...
@@ -13,18 +13,21 @@
...
@@ -13,18 +13,21 @@
<EF:EFPage
title=
"生产领料详情"
>
<EF:EFPage
title=
"生产领料详情"
>
<EF:EFRegion
id=
"inqu"
title=
"查询条件"
>
<EF:EFRegion
id=
"inqu"
title=
"查询条件"
>
<EF:EFInput
ename=
"inqu_status-0-receiveId"
cname=
"领料单id"
colWidth=
"3"
type=
"hidden"
/>
<EF:EFInput
ename=
"inqu_status-0-receiveId"
cname=
"领料单id"
colWidth=
"3"
type=
"hidden"
/>
<EF:EFInput
ename=
"inqu_status-0-whCode"
cname=
"仓库编码"
colWidth=
"3"
type=
"hidden"
/>
<div
class=
"row"
>
<div
class=
"row"
>
<EF:EFSelect
cname=
"存货类型"
ename=
"inqu_status-0-inventType"
colWidth=
"3"
filter=
"contains"
>
<EF:EFSelect
cname=
"存货类型"
ename=
"inqu_status-0-inventType"
colWidth=
"3"
filter=
"contains"
>
<EF:EFOption
label=
"全部"
value=
""
/>
<EF:EFOption
label=
"全部"
value=
""
/>
<EF:EFOptions
blockId=
"invent_type_box_block_id"
textField=
"textField"
valueField=
"valueField"
/>
<EF:EFOptions
blockId=
"invent_type_box_block_id"
textField=
"textField"
valueField=
"valueField"
/>
</EF:EFSelect>
</EF:EFSelect>
<EF:EFInput
ename=
"inqu_status-0-inventCode"
cname=
"存货编码"
colWidth=
"3"
/>
<EF:EFInput
ename=
"inqu_status-0-inventCode"
cname=
"存货编码"
colWidth=
"3"
/>
<EF:EFInput
ename=
"inqu_status-0-inventName"
cname=
"存货名称"
colWidth=
"3"
/>
</div>
</div>
</EF:EFRegion>
</EF:EFRegion>
<EF:EFRegion
id=
"result"
title=
"记录集"
>
<EF:EFRegion
id=
"result"
title=
"记录集"
>
<EF:EFGrid
blockId=
"result"
autoDraw=
"no"
isFloat=
"true"
copyToAdd=
"false"
>
<EF:EFGrid
blockId=
"result"
autoDraw=
"no"
isFloat=
"true"
copyToAdd=
"false"
>
<EF:EFColumn
ename=
"id"
cname=
"主键"
hidden=
"true"
/>
<EF:EFColumn
ename=
"id"
cname=
"主键"
hidden=
"true"
/>
<EF:EFColumn
ename=
"receiveId"
cname=
"领料单id"
hidden=
"true"
/>
<EF:EFColumn
ename=
"receiveId"
cname=
"领料单id"
hidden=
"true"
/>
<EF:EFColumn
ename=
"whCode"
cname=
"仓库编码"
hidden=
"true"
/>
<EF:EFComboColumn
ename=
"inventType"
cname=
"存货类型"
width=
"120"
align=
"center"
required=
"true"
<EF:EFComboColumn
ename=
"inventType"
cname=
"存货类型"
width=
"120"
align=
"center"
required=
"true"
blockName=
"invent_type_box_block_id"
textField=
"textField"
valueField=
"valueField"
blockName=
"invent_type_box_block_id"
textField=
"textField"
valueField=
"valueField"
columnTemplate=
"#=textField#"
itemTemplate=
"#=textField#"
readonly=
"false"
columnTemplate=
"#=textField#"
itemTemplate=
"#=textField#"
readonly=
"false"
...
@@ -32,25 +35,24 @@
...
@@ -32,25 +35,24 @@
</EF:EFComboColumn>
</EF:EFComboColumn>
<EF:EFColumn
ename=
"inventCode"
cname=
"存货编码"
enable=
"true"
width=
"120"
align=
"center"
required=
"true"
/>
<EF:EFColumn
ename=
"inventCode"
cname=
"存货编码"
enable=
"true"
width=
"120"
align=
"center"
required=
"true"
/>
<EF:EFColumn
ename=
"inventName"
cname=
"存货名称"
width=
"120"
align=
"center"
enable=
"false"
required=
"true"
/>
<EF:EFColumn
ename=
"inventName"
cname=
"存货名称"
width=
"120"
align=
"center"
enable=
"false"
required=
"true"
/>
<EF:EFColumn
ename=
"invSpec"
cname=
"规格"
width=
"120"
align=
"center"
enable=
"fals
e"
/>
<EF:EFColumn
ename=
"invSpec"
cname=
"规格"
width=
"120"
align=
"center"
required=
"tru
e"
/>
<EF:EFColumn
ename=
"invLength"
cname=
"长度(MM)"
width=
"120"
align=
"center"
enable=
"false"
/>
<EF:EFColumn
ename=
"invLength"
cname=
"长度(MM)"
width=
"120"
align=
"center"
enable=
"false"
/>
<EF:EFColumn
ename=
"invWidth"
cname=
"宽度(MM)"
width=
"120"
align=
"center"
enable=
"false"
/>
<EF:EFColumn
ename=
"invWidth"
cname=
"宽度(MM)"
width=
"120"
align=
"center"
enable=
"false"
/>
<EF:EFColumn
ename=
"invThick"
cname=
"厚度(MM)"
width=
"120"
align=
"center"
enable=
"false"
/>
<EF:EFColumn
ename=
"invThick"
cname=
"厚度(MM)"
width=
"120"
align=
"center"
enable=
"false"
/>
<EF:EFColumn
ename=
"invQty"
cname=
"数量"
enable=
"false"
width=
"120"
align=
"right"
format=
"{0:N0}"
<EF:EFColumn
ename=
"invQty"
cname=
"数量"
width=
"120"
align=
"right"
format=
"{0:N0}"
enable=
"true"
required=
"true"
/>
hidden=
"true"
/>
<EF:EFColumn
ename=
"invUnitWeight"
cname=
"单重"
width=
"100"
enable=
"false"
readonly=
"true"
format=
"{0:N3}"
editType=
"text"
<EF:EFColumn
ename=
"invUnitWeight"
cname=
"单重"
width=
"100"
enable=
"true"
readonly=
"true"
format=
"{0:N3}"
editType=
"text"
displayType=
"0.000"
sort=
"true"
align=
"right"
maxLength=
"17"
required=
"true"
defaultValue=
"0"
displayType=
"0.000"
sort=
"true"
align=
"right"
maxLength=
"17"
required=
"false"
defaultValue=
"0"
data-regex=
"/^-?[0-9]{1,17}([.][0-9]{1,3})?$/"
data-regex=
"/^-?[0-9]{1,17}([.][0-9]{1,3})?$/"
data-errorprompt=
"请输入数字,该值最大可设置17位整数和3位小数!"
/>
data-errorprompt=
"请输入数字,该值最大可设置17位整数和3位小数!"
/>
<EF:EFColumn
ename=
"invWeight"
cname=
"重量"
width=
"100"
enable=
"
tru
e"
readonly=
"true"
format=
"{0:N3}"
editType=
"text"
<EF:EFColumn
ename=
"invWeight"
cname=
"重量"
width=
"100"
enable=
"
fals
e"
readonly=
"true"
format=
"{0:N3}"
editType=
"text"
displayType=
"0.000"
sort=
"true"
align=
"right"
maxLength=
"17"
required=
"false"
defaultValue=
"0"
displayType=
"0.000"
sort=
"true"
align=
"right"
maxLength=
"17"
required=
"false"
defaultValue=
"0"
data-regex=
"/^-?[0-9]{1,17}([.][0-9]{1,3})?$/"
data-regex=
"/^-?[0-9]{1,17}([.][0-9]{1,3})?$/"
data-errorprompt=
"请输入数字,该值最大可设置17位整数和3位小数!"
/>
data-errorprompt=
"请输入数字,该值最大可设置17位整数和3位小数!"
/>
<EF:EFColumn
ename=
"price"
cname=
"单价"
width=
"100"
enable=
"true"
format=
"{0:N3}"
editType=
"text"
<EF:EFColumn
ename=
"price"
cname=
"单价"
width=
"100"
enable=
"true"
format=
"{0:N3}"
editType=
"text"
displayType=
"0.000"
sort=
"true"
align=
"right"
maxLength=
"17"
required=
"
fals
e"
defaultValue=
"0"
displayType=
"0.000"
sort=
"true"
align=
"right"
maxLength=
"17"
required=
"
tru
e"
defaultValue=
"0"
data-regex=
"/^-?[0-9]{1,17}([.][0-9]{1,3})?$/"
data-regex=
"/^-?[0-9]{1,17}([.][0-9]{1,3})?$/"
data-errorprompt=
"请输入数字,该值最大可设置17位整数和3位小数!"
/>
data-errorprompt=
"请输入数字,该值最大可设置17位整数和3位小数!"
/>
<EF:EFColumn
ename=
"amount"
cname=
"金额"
width=
"100"
enable=
"
tru
e"
format=
"{0:N3}"
editType=
"text"
<EF:EFColumn
ename=
"amount"
cname=
"金额"
width=
"100"
enable=
"
fals
e"
format=
"{0:N3}"
editType=
"text"
displayType=
"0.000"
sort=
"true"
align=
"right"
maxLength=
"17"
required=
"false"
defaultValue=
"0"
displayType=
"0.000"
sort=
"true"
align=
"right"
maxLength=
"17"
required=
"false"
defaultValue=
"0"
data-regex=
"/^-?[0-9]{1,17}([.][0-9]{1,3})?$/"
data-regex=
"/^-?[0-9]{1,17}([.][0-9]{1,3})?$/"
data-errorprompt=
"请输入数字,该值最大可设置17位整数和3位小数!"
/>
data-errorprompt=
"请输入数字,该值最大可设置17位整数和3位小数!"
/>
...
...
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