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
564d3b17
Commit
564d3b17
authored
Aug 18, 2024
by
江和松
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
采购计划增加功能和采购合同增加功能
parent
0c22f8b2
Show whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
814 additions
and
136 deletions
+814
-136
ServiceHGCG001.java
.../java/com/baosight/hggp/hg/cg/service/ServiceHGCG001.java
+69
-28
ServiceHGCG001A.java
...java/com/baosight/hggp/hg/cg/service/ServiceHGCG001A.java
+8
-5
ServiceHGCG002.java
.../java/com/baosight/hggp/hg/cg/service/ServiceHGCG002.java
+73
-28
ServiceHGCG002A.java
...java/com/baosight/hggp/hg/cg/service/ServiceHGCG002A.java
+2
-2
ServiceHGCG002B.java
...java/com/baosight/hggp/hg/cg/service/ServiceHGCG002B.java
+45
-6
HGCG001A.xml
src/main/java/com/baosight/hggp/hg/cg/sql/HGCG001A.xml
+3
-0
HGCG002.xml
src/main/java/com/baosight/hggp/hg/cg/sql/HGCG002.xml
+1
-0
HGCGTools.java
src/main/java/com/baosight/hggp/hg/cg/tools/HGCGTools.java
+13
-0
HGPZ005.java
src/main/java/com/baosight/hggp/hg/pz/domain/HGPZ005.java
+39
-0
ServiceHGSC009A.java
...java/com/baosight/hggp/hg/sc/service/ServiceHGSC009A.java
+19
-0
HGCG001.js
src/main/webapp/HG/CG/HGCG001.js
+116
-10
HGCG001.jsp
src/main/webapp/HG/CG/HGCG001.jsp
+22
-9
HGCG001A.js
src/main/webapp/HG/CG/HGCG001A.js
+112
-2
HGCG001A.jsp
src/main/webapp/HG/CG/HGCG001A.jsp
+10
-7
HGCG002.js
src/main/webapp/HG/CG/HGCG002.js
+112
-5
HGCG002.jsp
src/main/webapp/HG/CG/HGCG002.jsp
+27
-12
HGCG002B.js
src/main/webapp/HG/CG/HGCG002B.js
+122
-3
HGCG002B.jsp
src/main/webapp/HG/CG/HGCG002B.jsp
+13
-11
HGCG003.js
src/main/webapp/HG/CG/HGCG003.js
+1
-1
HGCG003.jsp
src/main/webapp/HG/CG/HGCG003.jsp
+1
-1
HGSC009A.jsp
src/main/webapp/HG/SC/HGSC009A.jsp
+6
-6
No files found.
src/main/java/com/baosight/hggp/hg/cg/service/ServiceHGCG001.java
View file @
564d3b17
...
...
@@ -6,28 +6,30 @@ import com.baosight.hggp.core.dao.DaoUtils;
import
com.baosight.hggp.core.enums.DeleteFlagEnum
;
import
com.baosight.hggp.core.security.UserSessionUtils
;
import
com.baosight.hggp.hg.cg.domain.HGCG001
;
import
com.baosight.hggp.hg.cg.domain.HGCG001A
;
import
com.baosight.hggp.hg.cg.domain.HGCG003
;
import
com.baosight.hggp.hg.cg.tools.HGCGTools
;
import
com.baosight.hggp.hg.cg.utils.HGCGUtils
;
import
com.baosight.hggp.hg.constant.HGConstant
;
import
com.baosight.hggp.hg.constant.HGSqlConstant
;
import
com.baosight.hggp.hg.pz.domain.HGPZ005
;
import
com.baosight.hggp.hg.pz.tools.HGPZTools
;
import
com.baosight.hggp.hg.sb.tools.HGSBTools
;
import
com.baosight.hggp.hg.sc.domain.HGSC009
;
import
com.baosight.hggp.hg.sc.domain.HGSC009A
;
import
com.baosight.hggp.hg.xs.domain.Company
;
import
com.baosight.hggp.util.AssertUtils
;
import
com.baosight.hggp.util.CommonMethod
;
import
com.baosight.hggp.util.DateUtils
;
import
com.baosight.hggp.util.EiInfoUtils
;
import
com.baosight.hggp.util.LogUtils
;
import
com.baosight.hggp.util.MapUtils
;
import
com.baosight.hggp.util.ObjectUtils
;
import
com.baosight.hggp.util.*
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
import
com.baosight.iplat4j.core.ei.EiInfo
;
import
com.baosight.iplat4j.core.exception.PlatException
;
import
com.baosight.iplat4j.core.service.impl.ServiceBase
;
import
com.baosight.iplat4j.ed.util.SequenceGenerator
;
import
org.apache.commons.collections.CollectionUtils
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
* @author:songx
...
...
@@ -52,6 +54,11 @@ public class ServiceHGCG001 extends ServiceBase {
CommonMethod
.
objConvertComboBox
(
resultList
,
inInfo
,
DdynamicEnum
.
SPEC_NAME_BLOCK_ID
.
getBlockId
(),
HGCG001
.
FIELD_SPEC
,
HGCG001
.
FIELD_SPEC
);
CommonMethod
.
distinctTextField
(
inInfo
,
DdynamicEnum
.
SPEC_NAME_BLOCK_ID
.
getBlockId
());
EiInfoUtils
.
addBlock
(
inInfo
,
"roleCompany"
,
UserSessionUtils
.
getRoleCompany
(),
Company
.
class
);
Map
qarma
=
new
HashMap
();
Map
userCompany
=
HGSBTools
.
getUserCompany
();
qarma
.
put
(
HGSC009
.
FIELD_COMPANY_CODE
,
userCompany
.
get
(
HGSC009
.
FIELD_COMPANY_CODE
));
CommonMethod
.
initBlock
(
inInfo
,
Arrays
.
asList
(
DdynamicEnum
.
PROJ_RECORD_BY_ROLE_BLOCK_ID
),
qarma
);
qarma
.
clear
();
inInfo
.
addBlock
(
EiConstant
.
resultBlock
).
addBlockMeta
(
new
HGCG001
().
eiMetadata
);
}
catch
(
Exception
e
)
{
...
...
@@ -89,12 +96,18 @@ public class ServiceHGCG001 extends ServiceBase {
public
EiInfo
save
(
EiInfo
inInfo
)
{
try
{
List
<
HGCG001
>
fCg001s
=
MapUtils
.
toDaoEPBase
(
inInfo
,
HGCG001
.
class
);
// db数据
Map
<
String
,
HGCG001
>
dbCg001Map
=
this
.
lockGetData
(
fCg001s
);
// 数据校验
this
.
checkSaveData
(
fCg001s
,
dbCg001Map
);
// 保存数据
this
.
saveData
(
fCg001s
);
this
.
checkSaveData
(
fCg001s
);
// 写入数据
for
(
int
i
=
0
;
i
<
fCg001s
.
size
();
i
++)
{
HGCG001
hgcg001
=
fCg001s
.
get
(
i
);
if
(
hgcg001
.
getId
()
==
null
||
hgcg001
.
getId
()
==
0
)
{
// 修改数据
this
.
saveData
(
hgcg001
);
}
else
{
DaoUtils
.
update
(
HGCG001
.
UPDATE
,
hgcg001
);
}
}
inInfo
=
this
.
query
(
inInfo
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setMsg
(
"操作成功!本次对["
+
fCg001s
.
size
()
+
"]条数据保存成功!"
);
...
...
@@ -108,30 +121,30 @@ public class ServiceHGCG001 extends ServiceBase {
* 数据校验
*
* @param fCg001s
* @param dbCg001Map
*/
private
void
checkSaveData
(
List
<
HGCG001
>
fCg001s
,
Map
<
String
,
HGCG001
>
dbCg001Map
)
{
private
void
checkSaveData
(
List
<
HGCG001
>
fCg001s
)
{
for
(
HGCG001
fCg001
:
fCg001s
)
{
String
planNo
=
fCg001
.
getPlanNo
();
HGCG001
dbCg001
=
dbCg001Map
.
get
(
planNo
);
AssertUtils
.
isNull
(
dbCg001
,
String
.
format
(
"计划[%s]不存在"
,
planNo
));
AssertUtils
.
isNotEquals
(
HGConstant
.
CgPlanStatus
.
S_0
,
dbCg001
.
getStatus
(),
String
.
format
(
"计划[%s]状态不是\"待审核\",不允许操作"
,
planNo
));
AssertUtils
.
isGe
(
BigDecimal
.
ZERO
,
fCg001
.
getPurQty
(),
String
.
format
(
"计划[%s]采购数量必须大于0"
,
planNo
));
AssertUtils
.
isGe
(
BigDecimal
.
ZERO
,
fCg001
.
getPurWeight
(),
String
.
format
(
"计划[%s]采购重量必须大于0"
,
planNo
));
AssertUtils
.
isNotEquals
(
HGConstant
.
CgPlanStatus
.
S_0
,
fCg001
.
getStatus
(),
String
.
format
(
"计划[%s]状态不是\"待审核\",不允许操作"
,
fCg001
.
getPlanNo
()));
}
}
/**
* 数据保存
*
* @param fCg001
s
* @param fCg001
*/
private
void
saveData
(
List
<
HGCG001
>
fCg001s
)
{
for
(
HGCG001
fCg001
:
fCg001s
)
{
private
void
saveData
(
HGCG001
fCg001
)
{
if
(
fCg001
.
getPurWeight
().
compareTo
(
BigDecimal
.
ZERO
)
>
0
&&
fCg001
.
getPurQty
().
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
fCg001
.
setPurUnitWeight
(
fCg001
.
getPurWeight
().
divide
(
fCg001
.
getPurQty
(),
3
,
RoundingMode
.
HALF_UP
));
DaoUtils
.
update
(
HGSqlConstant
.
HgCg001
.
UPDATE_PUR
,
fCg001
);
}
else
{
fCg001
.
setPurUnitWeight
(
BigDecimal
.
ZERO
);
}
fCg001
.
setStatus
(
HGConstant
.
CgPlanStatus
.
S_0
);
fCg001
.
setPlanNo
(
SequenceGenerator
.
getNextSequence
(
HGConstant
.
SequenceId
.
CG_PLAN_NO
));
fCg001
.
setPlanDate
(
DateUtils
.
formatShort
(
DateUtils
.
date
()));
fCg001
.
setSource
(
HGConstant
.
CgSource
.
SDLR
);
DaoUtils
.
insert
(
HGCG001
.
INSERT
,
fCg001
);
}
/**
...
...
@@ -247,6 +260,34 @@ public class ServiceHGCG001 extends ServiceBase {
//子表修改
DaoUtils
.
update
(
HGSqlConstant
.
HgCg001A
.
UPDATE_STATUS_BY_PLAN_NO
,
fCg001
);
}
List
<
Long
>
primaryIds
=
fCg001s
.
stream
().
map
(
HGCG001:
:
getId
).
collect
(
Collectors
.
toList
());
List
<
HGCG001A
>
hgcg001AList
=
HGCGTools
.
HgCg001A
.
listByPrimaryIds
(
primaryIds
);
List
<
String
>
inventCodes
=
Optional
.
ofNullable
(
hgcg001AList
).
orElse
(
new
ArrayList
<>()).
stream
().
map
(
HGCG001A:
:
getInventCode
).
collect
(
Collectors
.
toList
());
Map
<
String
,
HGPZ005
>
pz005Map
=
new
HashMap
<>();
if
(
CollectionUtils
.
isNotEmpty
(
inventCodes
)){
List
<
HGPZ005
>
hgpz005List
=
HGPZTools
.
HgPz005
.
listByInventCodes
(
inventCodes
);
if
(
CollectionUtils
.
isNotEmpty
(
hgpz005List
)){
pz005Map
=
hgpz005List
.
stream
().
collect
(
Collectors
.
toMap
(
HGPZ005:
:
getInventCode
,
item
->
item
));
pz005MapComparison
(
pz005Map
,
hgcg001AList
);
}
}
}
private
void
pz005MapComparison
(
Map
<
String
,
HGPZ005
>
pz005Map
,
List
<
HGCG001A
>
hgcg001AList
)
{
hgcg001AList
.
forEach
(
hgcg001A
->
{
HGPZ005
oldHgpz005
=
pz005Map
.
get
(
hgcg001A
.
getInventCode
());
HGPZ005
newHgpz005
=
new
HGPZ005
();
BeanUtils
.
copyProperties
(
hgcg001A
,
newHgpz005
,
"id"
,
"createdBy"
,
"createdName"
,
"createdTime"
,
"updatedBy"
,
"updatedName"
,
"updatedTime"
);
//存在名称、材质、规格、长宽厚不一致的,则新增一条物料数据库数据
if
(!
oldHgpz005
.
equals
(
newHgpz005
)){
oldHgpz005
.
setInventCode
(
SequenceGenerator
.
getNextSequence
(
HGConstant
.
SequenceId
.
INVENT_CODE
));
oldHgpz005
.
setEntityValue
(
newHgpz005
);
oldHgpz005
.
setId
(
null
);
DaoUtils
.
insert
(
HGPZ005
.
INSERT
,
oldHgpz005
);
hgcg001A
.
setInventCode
(
oldHgpz005
.
getInventCode
());
pz005Map
.
put
(
oldHgpz005
.
getInventCode
(),
oldHgpz005
);
}
});
}
/**
...
...
src/main/java/com/baosight/hggp/hg/cg/service/ServiceHGCG001A.java
View file @
564d3b17
...
...
@@ -115,13 +115,10 @@ public class ServiceHGCG001A extends ServiceBase {
*/
private
void
checkSaveData
(
List
<
HGCG001A
>
fCg001As
,
Map
<
Long
,
HGCG001A
>
dbCg001Map
,
HGCG001
cg001
)
{
for
(
HGCG001A
fCg001a
:
fCg001As
)
{
Long
id
=
fCg001a
.
getId
();
HGCG001A
dbCg001A
=
dbCg001Map
.
get
(
id
);
AssertUtils
.
isNull
(
dbCg001A
,
String
.
format
(
"计划明细[%s]不存在"
,
id
));
AssertUtils
.
isNotEquals
(
HGConstant
.
CgPlanStatus
.
S_0
,
cg001
.
getStatus
(),
String
.
format
(
"计划[%s]状态不是\"待审核\",不允许操作"
,
cg001
.
getPlanNo
()));
AssertUtils
.
isGe
(
BigDecimal
.
ZERO
,
fCg001a
.
getPurQty
(),
String
.
format
(
"计划明细[%s]采购数量必须大于0"
,
dbCg001A
.
getInventCode
()));
AssertUtils
.
isGe
(
BigDecimal
.
ZERO
,
fCg001a
.
getPurWeight
(),
String
.
format
(
"计划明细[%s]采购重量必须大于0"
,
dbCg001A
.
getInventCode
()));
AssertUtils
.
isGe
(
BigDecimal
.
ZERO
,
fCg001a
.
getPurQty
(),
String
.
format
(
"计划明细[%s]采购数量必须大于0"
,
fCg001a
.
getInventCode
()));
AssertUtils
.
isGe
(
BigDecimal
.
ZERO
,
fCg001a
.
getPurWeight
(),
String
.
format
(
"计划明细[%s]采购重量必须大于0"
,
fCg001a
.
getInventCode
()));
}
}
...
...
@@ -133,8 +130,14 @@ public class ServiceHGCG001A extends ServiceBase {
private
void
saveData
(
List
<
HGCG001A
>
fCg001s
,
HGCG001
cg001
)
{
for
(
HGCG001A
fCg001a
:
fCg001s
)
{
fCg001a
.
setPurUnitWeight
(
fCg001a
.
getPurWeight
().
divide
(
fCg001a
.
getPurQty
(),
3
,
RoundingMode
.
HALF_UP
));
if
(
fCg001a
.
getId
()
==
null
||
fCg001a
.
getId
()
==
0
){
BeanUtils
.
copyProperties
(
cg001
,
fCg001a
,
"id"
,
"createdBy"
,
"createdName"
,
"createdTime"
,
"updatedBy"
,
"updatedName"
,
"updatedTime"
,
"inventType"
,
"inventTypeDetail"
,
"inventCode"
,
"inventName"
,
"spec"
,
"material"
,
"unit"
,
"length"
,
"width"
,
"thick"
,
"purQty"
,
"purUnitWeight"
,
"purWeight"
);
DaoUtils
.
insert
(
HGCG001A
.
INSERT
,
fCg001a
);
}
else
{
DaoUtils
.
update
(
HGCG001A
.
UPDATE
,
fCg001a
);
}
}
//修改主表数量
updateCg001Pur
(
cg001
);
}
...
...
src/main/java/com/baosight/hggp/hg/cg/service/ServiceHGCG002.java
View file @
564d3b17
...
...
@@ -10,25 +10,23 @@ import com.baosight.hggp.hg.cg.tools.HGCGTools;
import
com.baosight.hggp.hg.cg.utils.HGCGUtils
;
import
com.baosight.hggp.hg.constant.HGConstant
;
import
com.baosight.hggp.hg.constant.HGSqlConstant
;
import
com.baosight.hggp.hg.pz.domain.HGPZ005
;
import
com.baosight.hggp.hg.pz.tools.HGPZTools
;
import
com.baosight.hggp.hg.sb.tools.HGSBTools
;
import
com.baosight.hggp.hg.sc.domain.HGSC009
;
import
com.baosight.hggp.hg.xs.domain.Company
;
import
com.baosight.hggp.hg.xs.domain.User
;
import
com.baosight.hggp.hg.xs.tools.HGXSTools
;
import
com.baosight.hggp.util.AssertUtils
;
import
com.baosight.hggp.util.CommonMethod
;
import
com.baosight.hggp.util.DateUtils
;
import
com.baosight.hggp.util.EiInfoUtils
;
import
com.baosight.hggp.util.LogUtils
;
import
com.baosight.hggp.util.MapUtils
;
import
com.baosight.hggp.util.*
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
import
com.baosight.iplat4j.core.ei.EiInfo
;
import
com.baosight.iplat4j.core.exception.PlatException
;
import
com.baosight.iplat4j.core.service.impl.ServiceBase
;
import
com.baosight.iplat4j.ed.util.SequenceGenerator
;
import
org.apache.commons.collections.CollectionUtils
;
import
java.math.BigDecimal
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Objects
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -52,6 +50,11 @@ public class ServiceHGCG002 extends ServiceBase {
CommonMethod
.
initBlock
(
inInfo
,
Arrays
.
asList
(
DdynamicEnum
.
INVENT_RECORD_BLOCK_ID
));
CommonMethod
.
initBlock
(
inInfo
,
Arrays
.
asList
(
DdynamicEnum
.
SPEC_NAME_BLOCK_ID
));
EiInfoUtils
.
addBlock
(
inInfo
,
"roleCompany"
,
UserSessionUtils
.
getRoleCompany
(),
Company
.
class
);
Map
qarma
=
new
HashMap
();
Map
userCompany
=
HGSBTools
.
getUserCompany
();
qarma
.
put
(
HGSC009
.
FIELD_COMPANY_CODE
,
userCompany
.
get
(
HGSC009
.
FIELD_COMPANY_CODE
));
CommonMethod
.
initBlock
(
inInfo
,
Arrays
.
asList
(
DdynamicEnum
.
PROJ_RECORD_BY_ROLE_BLOCK_ID
),
qarma
);
qarma
.
clear
();
EiInfoUtils
.
addBlock
(
inInfo
,
"userByCompany"
,
HGXSTools
.
XsUser
.
listAll
(
UserSessionUtils
.
getAccountCode
()),
User
.
class
);
inInfo
.
addBlock
(
EiConstant
.
resultBlock
).
addBlockMeta
(
new
HGCG002
().
eiMetadata
);
}
catch
(
Exception
e
)
{
...
...
@@ -89,12 +92,18 @@ public class ServiceHGCG002 extends ServiceBase {
public
EiInfo
save
(
EiInfo
inInfo
)
{
try
{
List
<
HGCG002
>
fCg002s
=
MapUtils
.
toDaoEPBase
(
inInfo
,
HGCG002
.
class
);
// db数据
Map
<
String
,
HGCG002A
>
dbCg002AMap
=
HGCGUtils
.
HgCg002
.
lockGetDataEp
(
fCg002s
);
// 写入数据
for
(
int
i
=
0
;
i
<
fCg002s
.
size
();
i
++)
{
HGCG002
hgcg002
=
fCg002s
.
get
(
i
);
// 数据校验
this
.
checkSaveData
(
fCg002s
,
dbCg002AMap
);
// 保存数据
this
.
saveData
(
fCg002s
);
this
.
checkSaveData
(
fCg002s
);
if
(
hgcg002
.
getId
()
==
null
||
hgcg002
.
getId
()
==
0
)
{
// 修改数据
this
.
saveData
(
hgcg002
);
}
else
{
DaoUtils
.
update
(
HGSqlConstant
.
HgCg002
.
UPDATE_PUR
,
hgcg002
);
}
}
inInfo
=
this
.
query
(
inInfo
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setMsg
(
"操作成功!本次对["
+
fCg002s
.
size
()
+
"]条数据保存成功!"
);
...
...
@@ -108,27 +117,32 @@ public class ServiceHGCG002 extends ServiceBase {
* 数据校验
*
* @param fCg002s
* @param dbCg002AMap
*/
private
void
checkSaveData
(
List
<
HGCG002
>
fCg002s
,
Map
<
String
,
HGCG002A
>
dbCg002AMap
)
{
private
void
checkSaveData
(
List
<
HGCG002
>
fCg002s
)
{
for
(
HGCG002
fCg002
:
fCg002s
)
{
String
contractNo
=
fCg002
.
getContractNo
();
HGCG002
dbCg002
=
dbCg002AMap
.
get
(
contractNo
);
AssertUtils
.
isNull
(
dbCg002
,
String
.
format
(
"合同[%s]不存在"
,
contractNo
));
AssertUtils
.
is
NotEquals
(
HGConstant
.
CgPlanStatus
.
S_0
,
dbCg002
.
getStatus
(),
String
.
format
(
"合同[%s]状态不是\"待审核\",不允许操作"
,
contractNo
)
);
AssertUtils
.
isTrue
(
fCg002
.
getAmount
().
compareTo
(
BigDecimal
.
ZERO
)
<
=
0
,
String
.
format
(
"合同[%s]不含税金额小于等于0,不允许操作"
,
contractNo
)
);
AssertUtils
.
isTrue
(
fCg002
.
getTaxIncludeAmount
().
compareTo
(
BigDecimal
.
ZERO
)
<
=
0
,
String
.
format
(
"合同[%s]含税金额小于等于0,不允许操作"
,
contractNo
)
);
AssertUtils
.
isTrue
(
fCg002
.
getStatus
().
intValue
()
==
HGConstant
.
CgContractStatus
.
S_4
||
fCg002
.
getStatus
().
intValue
()
==
HGConstant
.
CgContractStatus
.
S_5
,
String
.
format
(
"合同[%s]已生成收货单,不允许操作"
,
fCg002
.
getContractNo
()
));
AssertUtils
.
is
Empty
(
fCg002
.
getContractDate
(),
"合同日期不能为空"
);
AssertUtils
.
isTrue
(
fCg002
.
getAmount
().
compareTo
(
BigDecimal
.
ZERO
)
<
0
,
"合同不含税金额小于等于0,不允许操作"
);
AssertUtils
.
isTrue
(
fCg002
.
getTaxIncludeAmount
().
compareTo
(
BigDecimal
.
ZERO
)
<
0
,
"合同[%s]含税金额小于等于0,不允许操作"
);
}
}
/**
* 数据保存
*
* @param fCg002
s
* @param fCg002
*/
private
void
saveData
(
List
<
HGCG002
>
fCg002s
)
{
for
(
HGCG002
fCg002
:
fCg002s
)
{
DaoUtils
.
update
(
HGSqlConstant
.
HgCg002
.
UPDATE_PUR
,
fCg002
);
private
void
saveData
(
HGCG002
fCg002
)
{
if
(
fCg002
.
getId
()
==
null
||
fCg002
.
getId
()
==
0
)
{
fCg002
.
setSource
(
HGConstant
.
CgSource
.
SDLR
);
fCg002
.
setContractDate
(
StringUtils
.
isNotBlank
(
fCg002
.
getContractDate
())
?
fCg002
.
getContractDate
()
:
DateUtils
.
formatShort
(
DateUtils
.
date
()));
fCg002
.
setContractNo
(
SequenceGenerator
.
getNextSequence
(
HGConstant
.
SequenceId
.
CG_CONTRACT_NO
));
fCg002
.
setStatus
(
HGConstant
.
CgContractStatus
.
S_0
);
fCg002
.
setContractDate
(
DateUtils
.
formatShort
(
fCg002
.
getContractDate
()));
fCg002
.
setId
(
null
);
DaoUtils
.
insert
(
HGCG002
.
INSERT
,
fCg002
);
}
}
...
...
@@ -190,7 +204,7 @@ public class ServiceHGCG002 extends ServiceBase {
dbCg002
.
setDeleteFlag
(
DeleteFlagEnum
.
REMOVE
.
getCode
());
DaoUtils
.
update
(
HGCG002
.
DELETE
,
dbCg002
);
// 更新计划状态
HGCGTools
.
HgCg001
.
updateStatus
(
dbCg002
.
getPlanNo
(),
HGConstant
.
Cg
Plan
Status
.
S_2
);
HGCGTools
.
HgCg001
.
updateStatus
(
dbCg002
.
getPlanNo
(),
HGConstant
.
Cg
Contract
Status
.
S_2
);
}
List
<
Long
>
primaryIds
=
fCg002s
.
stream
().
map
(
o
->
o
.
getId
()).
collect
(
Collectors
.
toList
());
...
...
@@ -239,6 +253,8 @@ public class ServiceHGCG002 extends ServiceBase {
String
contractNo
=
fCg002
.
getContractNo
();
HGCG002
dbCg002
=
dbCg002AMap
.
get
(
contractNo
);
AssertUtils
.
isNull
(
dbCg002
,
String
.
format
(
"合同[%s]不存在"
,
contractNo
));
AssertUtils
.
isTrue
(
StringUtils
.
isBlank
(
dbCg002
.
getSupName
()),
String
.
format
(
"合同[%s]供应商为空"
,
contractNo
));
AssertUtils
.
isTrue
(
StringUtils
.
isBlank
(
dbCg002
.
getPurUserName
()),
String
.
format
(
"合同[%s]采购员为空"
,
contractNo
));
AssertUtils
.
isNotEquals
(
HGConstant
.
CgContractStatus
.
S_0
,
dbCg002
.
getStatus
(),
String
.
format
(
"合同[%s]状态不是\"待审核\",不允许操作"
,
contractNo
));
AssertUtils
.
isTrue
(
fCg002
.
getAmount
().
compareTo
(
BigDecimal
.
ZERO
)
<=
0
,
String
.
format
(
"合同[%s]不含税金额小于等于0,不允许操作"
,
contractNo
));
...
...
@@ -262,6 +278,35 @@ public class ServiceHGCG002 extends ServiceBase {
DaoUtils
.
update
(
HGSqlConstant
.
HgCg002
.
UPDATE_AUDIT
,
fCg002
);
HGCGTools
.
HgCg002B
.
updateStatus
(
fCg002
.
getId
(),
HGConstant
.
CgContractStatus
.
S_2
);
}
List
<
Long
>
primaryIds
=
fCg002s
.
stream
().
map
(
HGCG002:
:
getId
).
collect
(
Collectors
.
toList
());
List
<
HGCG002B
>
hgcg002BList
=
HGCGTools
.
HgCg002B
.
listByPrimaryIds
(
primaryIds
);
List
<
String
>
inventCodes
=
Optional
.
ofNullable
(
hgcg002BList
).
orElse
(
new
ArrayList
<>()).
stream
().
map
(
HGCG002B:
:
getInventCode
).
collect
(
Collectors
.
toList
());
Map
<
String
,
HGPZ005
>
pz005Map
=
new
HashMap
<>();
if
(
CollectionUtils
.
isNotEmpty
(
inventCodes
)){
List
<
HGPZ005
>
hgpz005List
=
HGPZTools
.
HgPz005
.
listByInventCodes
(
inventCodes
);
if
(
CollectionUtils
.
isNotEmpty
(
hgpz005List
)){
pz005Map
=
hgpz005List
.
stream
().
collect
(
Collectors
.
toMap
(
HGPZ005:
:
getInventCode
,
item
->
item
));
pz005MapComparison
(
pz005Map
,
hgcg002BList
);
}
}
DaoUtils
.
updateBatch
(
HGCG002B
.
UPDATE
,
hgcg002BList
);
}
private
void
pz005MapComparison
(
Map
<
String
,
HGPZ005
>
pz005Map
,
List
<
HGCG002B
>
hgcg002BList
)
{
hgcg002BList
.
forEach
(
hgcg002B
->
{
HGPZ005
oldHgpz005
=
pz005Map
.
get
(
hgcg002B
.
getInventCode
());
HGPZ005
newHgpz005
=
new
HGPZ005
();
BeanUtils
.
copyProperties
(
hgcg002B
,
newHgpz005
,
"id"
,
"createdBy"
,
"createdName"
,
"createdTime"
,
"updatedBy"
,
"updatedName"
,
"updatedTime"
);
//存在名称、材质、规格、长宽厚不一致的,则新增一条物料数据库数据
if
(!
oldHgpz005
.
equals
(
newHgpz005
)){
oldHgpz005
.
setInventCode
(
SequenceGenerator
.
getNextSequence
(
HGConstant
.
SequenceId
.
INVENT_CODE
));
oldHgpz005
.
setEntityValue
(
newHgpz005
);
oldHgpz005
.
setId
(
null
);
DaoUtils
.
insert
(
HGPZ005
.
INSERT
,
oldHgpz005
);
hgcg002B
.
setInventCode
(
oldHgpz005
.
getInventCode
());
pz005Map
.
put
(
oldHgpz005
.
getInventCode
(),
oldHgpz005
);
}
});
}
}
src/main/java/com/baosight/hggp/hg/cg/service/ServiceHGCG002A.java
View file @
564d3b17
...
...
@@ -123,8 +123,8 @@ public class ServiceHGCG002A extends ServiceBase {
Long
id
=
fCg001A
.
getId
();
HGCG001A
dbCg001A
=
dbCg001AMap
.
get
(
id
);
AssertUtils
.
isNull
(
dbCg001A
,
String
.
format
(
"计划明细[%s]不存在"
,
id
));
AssertUtils
.
isTrue
(
fCg001A
.
getTaxRate
().
compareTo
(
BigDecimal
.
ZERO
)
<=
0
,
"税率不能小于等于"
);
AssertUtils
.
isTrue
(
fCg001A
.
getPrice
().
compareTo
(
BigDecimal
.
ZERO
)
<=
0
,
"单价不能小于等于"
);
AssertUtils
.
isTrue
(
fCg001A
.
getTaxRate
().
compareTo
(
BigDecimal
.
ZERO
)
<=
0
,
"税率不能小于等于
0
"
);
AssertUtils
.
isTrue
(
fCg001A
.
getPrice
().
compareTo
(
BigDecimal
.
ZERO
)
<=
0
,
"单价不能小于等于
0
"
);
}
}
...
...
src/main/java/com/baosight/hggp/hg/cg/service/ServiceHGCG002B.java
View file @
564d3b17
...
...
@@ -2,6 +2,7 @@ package com.baosight.hggp.hg.cg.service;
import
com.baosight.hggp.aspect.annotation.OperationLogAnnotation
;
import
com.baosight.hggp.common.DdynamicEnum
;
import
com.baosight.hggp.common.InventTypeDetailEnum
;
import
com.baosight.hggp.core.dao.DaoUtils
;
import
com.baosight.hggp.core.enums.DeleteFlagEnum
;
import
com.baosight.hggp.core.security.UserSessionUtils
;
...
...
@@ -10,6 +11,8 @@ import com.baosight.hggp.hg.cg.tools.HGCGTools;
import
com.baosight.hggp.hg.cg.utils.HGCGUtils
;
import
com.baosight.hggp.hg.constant.HGConstant
;
import
com.baosight.hggp.hg.constant.HGSqlConstant
;
import
com.baosight.hggp.hg.pz.domain.HGPZ004
;
import
com.baosight.hggp.hg.pz.domain.HGPZ005
;
import
com.baosight.hggp.hg.xs.domain.Company
;
import
com.baosight.hggp.hg.xs.domain.User
;
import
com.baosight.hggp.hg.xs.tools.HGXSTools
;
...
...
@@ -20,6 +23,7 @@ import com.baosight.iplat4j.core.service.impl.ServiceBase;
import
java.math.BigDecimal
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -45,6 +49,11 @@ public class ServiceHGCG002B extends ServiceBase {
CommonMethod
.
initBlock
(
inInfo
,
Arrays
.
asList
(
DdynamicEnum
.
SPEC_NAME_BLOCK_ID
));
CommonMethod
.
initBlock
(
inInfo
,
Arrays
.
asList
(
DdynamicEnum
.
INVENT_TYPE_BOX_BLOCK_ID
),
null
,
false
);
EiInfoUtils
.
addBlock
(
inInfo
,
"userByCompany"
,
HGXSTools
.
XsUser
.
listAll
(
UserSessionUtils
.
getAccountCode
()),
User
.
class
);
CommonMethod
.
initBlock
(
inInfo
,
Arrays
.
asList
(
DdynamicEnum
.
INVENT_RECORD_BOX_BLOCK_ID
),
new
HashMap
<
String
,
Object
>(){{
put
(
HGPZ005
.
FIELD_STATUS
,
1
);
put
(
HGPZ004
.
FIELD_INVENT_TYPE_DETAILS
,
InventTypeDetailEnum
.
getInentTypeThree
());
}},
false
);
inInfo
.
addBlock
(
EiConstant
.
resultBlock
).
addBlockMeta
(
new
HGCG002B
().
eiMetadata
);
}
catch
(
Exception
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"初始化失败"
);
...
...
@@ -79,13 +88,32 @@ public class ServiceHGCG002B extends ServiceBase {
public
EiInfo
save
(
EiInfo
inInfo
)
{
try
{
List
<
HGCG002B
>
fCg002Bs
=
MapUtils
.
toDaoEPBase
(
inInfo
,
HGCG002B
.
class
);
HGCG002
cg002
=
HGCGTools
.
HgCg002
.
get
(
fCg002Bs
.
get
(
0
).
getPrimaryId
());
if
(
cg002
.
getSource
().
intValue
()
==
HGConstant
.
CgSource
.
DEFAULT
){
// db数据
Map
<
Long
,
HGCG002B
>
dbCg002AMap
=
HGCGUtils
.
HgCg002B
.
lockGetDataEp
(
fCg002Bs
);
HGCG002
cg001
=
HGCGTools
.
HgCg002
.
get
(
fCg002Bs
.
get
(
0
).
getPrimaryId
());
// 数据校验
this
.
checkSaveData
(
fCg002Bs
,
dbCg002AMap
,
cg001
);
this
.
checkSaveData
(
fCg002Bs
,
dbCg002AMap
,
cg002
);
// 保存数据
this
.
saveData
(
fCg002Bs
,
cg001
);
this
.
editData
(
fCg002Bs
,
cg002
);
}
else
{
// 写入数据
for
(
int
i
=
0
;
i
<
fCg002Bs
.
size
();
i
++)
{
HGCG002B
hgcg002B
=
fCg002Bs
.
get
(
i
);
if
(
hgcg002B
.
getId
()
==
null
||
hgcg002B
.
getId
()
==
0
)
{
// 修改数据
this
.
saveData
(
hgcg002B
,
cg002
);
}
else
{
// 新增数据
hgcg002B
.
setStatus
(
HGConstant
.
CgContractStatus
.
S_0
);
DaoUtils
.
update
(
HGCG002B
.
UPDATE
,
hgcg002B
);
}
}
//修改主表信息
cg002
.
setStatus
(
HGConstant
.
CgContractStatus
.
S_0
);
HGCGTools
.
HgCg002
.
updateCg002Pur
(
cg002
);
}
inInfo
=
this
.
query
(
inInfo
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setMsg
(
"操作成功!本次对["
+
fCg002Bs
.
size
()
+
"]条数据保存成功!"
);
...
...
@@ -95,18 +123,26 @@ public class ServiceHGCG002B extends ServiceBase {
return
inInfo
;
}
private
void
saveData
(
HGCG002B
hgcg002B
,
HGCG002
cg002
)
{
BeanUtils
.
copyProperties
(
hgcg002B
,
cg002
,
"id"
,
"createdBy"
,
"createdName"
,
"createdTime"
,
"updatedBy"
,
"updatedName"
,
"updatedTime"
,
"inventType"
,
"inventTypeDetail"
,
"inventCode"
,
"inventName"
,
"spec"
,
"material"
,
"unit"
,
"length"
,
"width"
,
"thick"
,
"purQty"
,
"purUnitWeight"
,
"purWeight"
);
DaoUtils
.
insert
(
HGCG002B
.
INSERT
,
hgcg002B
);
}
/**
* 数据校验
*
* @param fCg002Bs
* @param dbCg002BMap
*/
private
void
checkSaveData
(
List
<
HGCG002B
>
fCg002Bs
,
Map
<
Long
,
HGCG002B
>
dbCg002BMap
,
HGCG002
cg00
1
)
{
private
void
checkSaveData
(
List
<
HGCG002B
>
fCg002Bs
,
Map
<
Long
,
HGCG002B
>
dbCg002BMap
,
HGCG002
cg00
2
)
{
for
(
HGCG002B
fCg002B
:
fCg002Bs
)
{
Long
id
=
fCg002B
.
getId
();
HGCG002B
dbCg002B
=
dbCg002BMap
.
get
(
id
);
AssertUtils
.
isNull
(
dbCg002B
,
String
.
format
(
"合同明细[%s]不存在"
,
id
));
AssertUtils
.
isNotEquals
(
HGConstant
.
CgPlanStatus
.
S_0
,
cg001
.
getStatus
(),
String
.
format
(
"合同[%s]状态不是\"待审核\",不允许操作"
,
cg001
.
getContractNo
()));
AssertUtils
.
isTrue
(
cg002
.
getStatus
().
intValue
()
==
HGConstant
.
CgContractStatus
.
S_4
||
cg002
.
getStatus
().
intValue
()
==
HGConstant
.
CgContractStatus
.
S_5
,
String
.
format
(
"合同[%s]已生成收货单,不允许操作"
,
cg002
.
getContractNo
()));
AssertUtils
.
isTrue
(
fCg002B
.
getPrice
().
compareTo
(
BigDecimal
.
ZERO
)
<=
0
,
String
.
format
(
"存货[%s]单价小于等于0,不允许操作"
,
dbCg002B
.
getInventCode
()));
AssertUtils
.
isTrue
(
fCg002B
.
getTaxRate
().
compareTo
(
BigDecimal
.
ZERO
)
<=
0
,
String
.
format
(
"存货[%s]税率小于等于0,不允许操作"
,
dbCg002B
.
getInventCode
()));
}
...
...
@@ -118,11 +154,13 @@ public class ServiceHGCG002B extends ServiceBase {
* @param fCg002Bs
* @param cg002
*/
private
void
save
Data
(
List
<
HGCG002B
>
fCg002Bs
,
HGCG002
cg002
)
{
private
void
edit
Data
(
List
<
HGCG002B
>
fCg002Bs
,
HGCG002
cg002
)
{
for
(
HGCG002B
fCg002B
:
fCg002Bs
)
{
fCg002B
.
setStatus
(
HGConstant
.
CgContractStatus
.
S_0
);
DaoUtils
.
update
(
HGCG002B
.
UPDATE
,
fCg002B
);
}
//修改主表信息
cg002
.
setStatus
(
HGConstant
.
CgContractStatus
.
S_0
);
HGCGTools
.
HgCg002
.
updateCg002Pur
(
cg002
);
}
...
...
@@ -185,6 +223,7 @@ public class ServiceHGCG002B extends ServiceBase {
DaoUtils
.
update
(
HGCG002B
.
DELETE
,
dbCg002B
);
}
//修改主表信息
cg002
.
setStatus
(
HGConstant
.
CgContractStatus
.
S_0
);
HGCGTools
.
HgCg002
.
updateCg002Pur
(
cg002
);
}
...
...
src/main/java/com/baosight/hggp/hg/cg/sql/HGCG001A.xml
View file @
564d3b17
...
...
@@ -230,6 +230,9 @@
<isNotEmpty
prepend=
" AND "
property=
"projName"
>
a.PROJ_NAME LIKE CONCAT('%', #projName# ,'%')
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"primaryIds"
>
a.PRIMARY_ID IN
<iterate
open=
"("
close=
")"
conjunction=
","
property=
"primaryIds"
>
#primaryIds[]#
</iterate>
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"source"
>
b.SOURCE = #source#
</isNotEmpty>
...
...
src/main/java/com/baosight/hggp/hg/cg/sql/HGCG002.xml
View file @
564d3b17
...
...
@@ -267,6 +267,7 @@
TAX_AMOUNT = #taxAmount#,
<!-- 税额 -->
PUR_QTY = #purQty#,
PUR_WEIGHT = #purWeight#,
STATUS = #status#,
<!-- 状态:0-未审批,1-审核通过,2-审核未通过 -->
<include
refid=
"updateRevise"
/>
WHERE CONTRACT_NO = #contractNo#
</update>
...
...
src/main/java/com/baosight/hggp/hg/cg/tools/HGCGTools.java
View file @
564d3b17
...
...
@@ -194,6 +194,19 @@ public class HGCGTools {
paramMap
.
put
(
"primaryId"
,
primaryId
);
return
DaoBase
.
getInstance
().
query
(
HGCG001A
.
QUERY
,
paramMap
);
}
/**
* 查询
*
* @param primaryIds
* @return
*/
public
static
List
<
HGCG001A
>
listByPrimaryIds
(
List
<
Long
>
primaryIds
)
{
AssertUtils
.
isEmpty
(
primaryIds
,
"计划id不能为空"
);
Map
<
String
,
Object
>
paramMap
=
new
HashMap
();
paramMap
.
put
(
"primaryIds"
,
primaryIds
);
return
DaoBase
.
getInstance
().
query
(
HGCG001A
.
QUERY
,
paramMap
);
}
/**
* 查询
*
...
...
src/main/java/com/baosight/hggp/hg/pz/domain/HGPZ005.java
View file @
564d3b17
...
...
@@ -7,6 +7,8 @@ import com.baosight.iplat4j.core.ei.EiColumn;
import
com.baosight.iplat4j.core.data.DaoEPBase
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Objects
;
import
com.baosight.iplat4j.core.util.StringUtils
;
/**
...
...
@@ -584,6 +586,43 @@ public class HGPZ005 extends DaoEPBase {
}
/**
* 用于材料计划对比物料数据库是否存在不同,存在时就新录入一条
* @param o
* @return
*/
@Override
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
return
true
;
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
return
false
;
HGPZ005
hgpz005
=
(
HGPZ005
)
o
;
return
Objects
.
equals
(
inventName
,
hgpz005
.
inventName
)
&&
Objects
.
equals
(
spec
,
hgpz005
.
spec
)
&&
Objects
.
equals
(
length
,
hgpz005
.
length
)
&&
Objects
.
equals
(
width
,
hgpz005
.
width
)
&&
Objects
.
equals
(
thick
,
hgpz005
.
thick
)
&&
Objects
.
equals
(
material
,
hgpz005
.
material
);
}
@Override
public
int
hashCode
()
{
return
Objects
.
hash
(
inventName
,
spec
,
length
,
width
,
thick
,
material
);
}
/**
* 用于不同的字段生成新的实体后,赋值
* @param newEntity
* @return
*/
public
void
setEntityValue
(
HGPZ005
newEntity
)
{
this
.
setInventName
(
newEntity
.
getInventName
());
this
.
setSpec
(
newEntity
.
getSpec
());
this
.
setLength
(
newEntity
.
getLength
());
this
.
setWidth
(
newEntity
.
getWidth
());
this
.
setThick
(
newEntity
.
getThick
());
this
.
setMaterial
(
newEntity
.
getMaterial
());
}
/**
* get the value from Map.
*
* @param map - source data map
...
...
src/main/java/com/baosight/hggp/hg/sc/service/ServiceHGSC009A.java
View file @
564d3b17
...
...
@@ -3,6 +3,7 @@ package com.baosight.hggp.hg.sc.service;
import
com.baosight.hggp.aspect.annotation.OperationLogAnnotation
;
import
com.baosight.hggp.common.DdynamicEnum
;
import
com.baosight.hggp.common.InventTypeDetailEnum
;
import
com.baosight.hggp.core.dao.DaoBase
;
import
com.baosight.hggp.core.dao.DaoUtils
;
import
com.baosight.hggp.hg.cg.domain.HGCG001
;
import
com.baosight.hggp.hg.cg.domain.HGCG001A
;
...
...
@@ -230,6 +231,7 @@ public class ServiceHGSC009A extends ServiceBase {
List
<
HGPZ005
>
hgpz005List
=
HGPZTools
.
HgPz005
.
listByInventCodes
(
inventCodes
);
if
(
CollectionUtils
.
isNotEmpty
(
hgpz005List
)){
pz005Map
=
hgpz005List
.
stream
().
collect
(
Collectors
.
toMap
(
HGPZ005:
:
getInventCode
,
item
->
item
));
pz005MapComparison
(
pz005Map
,
hgsc009AList
);
}
}
// 数据校验
...
...
@@ -280,6 +282,23 @@ public class ServiceHGSC009A extends ServiceBase {
return
inInfo
;
}
private
void
pz005MapComparison
(
Map
<
String
,
HGPZ005
>
pz005Map
,
List
<
HGSC009A
>
hgsc009AList
)
{
hgsc009AList
.
forEach
(
hgsc009A
->
{
HGPZ005
oldHgpz005
=
pz005Map
.
get
(
hgsc009A
.
getInventCode
());
HGPZ005
newHgpz005
=
new
HGPZ005
();
BeanUtils
.
copyProperties
(
hgsc009A
,
newHgpz005
,
"id"
,
"createdBy"
,
"createdName"
,
"createdTime"
,
"updatedBy"
,
"updatedName"
,
"updatedTime"
);
//存在名称、材质、规格、长宽厚不一致的,则新增一条物料数据库数据
if
(!
oldHgpz005
.
equals
(
newHgpz005
)){
oldHgpz005
.
setInventCode
(
SequenceGenerator
.
getNextSequence
(
HGConstant
.
SequenceId
.
INVENT_CODE
));
oldHgpz005
.
setEntityValue
(
newHgpz005
);
oldHgpz005
.
setId
(
null
);
DaoUtils
.
insert
(
HGPZ005
.
INSERT
,
oldHgpz005
);
hgsc009A
.
setInventCode
(
oldHgpz005
.
getInventCode
());
pz005Map
.
put
(
oldHgpz005
.
getInventCode
(),
oldHgpz005
);
}
});
}
private
void
checkInsertcgData
(
List
<
HGSC009
>
hgsc009List
)
{
List
<
Long
>
materialPlanIds
=
hgsc009List
.
stream
().
map
(
HGSC009:
:
getId
).
collect
(
Collectors
.
toList
());
List
<
HGCG001
>
hgcg001List
=
HGCGTools
.
HgCg001
.
listByMaterialPlanIds
(
materialPlanIds
);
...
...
src/main/webapp/HG/CG/HGCG001.js
View file @
564d3b17
$
(
function
()
{
var
companyCodeBox
=
__eiInfo
.
getBlock
(
"roleCompany"
).
getMappedRows
();
var
projCodeBox
=
__eiInfo
.
getBlock
(
"projRecordByRole_block_id"
).
getMappedRows
();
IPLATUI
.
EFGrid
=
{
"result"
:
{
exportGrid
:
false
,
// 隐藏右侧自定义导出按钮
...
...
@@ -15,21 +16,126 @@ $(function () {
let
template
=
''
;
if
(
!
isBlank
(
item
.
id
)){
template
+=
'<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+
'onclick="showDetail('
+
item
.
id
+
', '
+
item
.
status
+
')" >详情</a>'
;
+
'onclick="showDetail('
+
item
.
id
+
', '
+
item
.
status
+
'
, '
+
item
.
source
+
'
)" >详情</a>'
;
}
return
template
;
}
},
{
field
:
"companyCode"
,
title
:
"公司编码"
,
template
:
function
(
dataItem
)
{
for
(
let
i
=
0
;
i
<
companyCodeBox
.
length
;
i
++
)
{
if
(
companyCodeBox
[
i
][
'companyCode'
]
===
dataItem
[
'companyCode'
])
{
return
companyCodeBox
[
i
][
'companyCode'
];
}
}
return
dataItem
[
"companyCode"
];
}
},
{
field
:
"projCode"
,
title
:
"项目编码"
,
template
:
function
(
dataItem
)
{
for
(
let
i
=
0
;
i
<
projCodeBox
.
length
;
i
++
)
{
if
(
projCodeBox
[
i
][
'valueField'
]
===
dataItem
[
'projCode'
])
{
dataItem
[
'projName'
]
=
projCodeBox
[
i
][
'textField'
]
return
projCodeBox
[
i
][
'valueField'
];
}
}
return
dataItem
[
"projCode"
];
},
editor
:
function
(
container
,
options
)
{
let
inInfo
=
new
EiInfo
();
inInfo
.
set
(
"inqu_status-0-companyCode"
,
options
.
model
[
"companyCode"
]);
inInfo
.
set
(
"inqu_status-0-approvalStatus"
,
2
);
inInfo
.
set
(
"field"
,
options
.
field
);
EiCommunicator
.
send
(
"HGSC003"
,
"projComboBox"
,
inInfo
,
{
onSuccess
:
function
(
ei
)
{
projCodeBox
=
ei
.
getBlock
(
"projRecordByRole_block_id"
).
getMappedRows
();
},
onFail
:
function
(
ei
)
{
}
},
{
async
:
false
});
var
input
=
$
(
'<input />'
);
input
.
attr
(
"name"
,
options
.
field
);
input
.
attr
(
"id"
,
options
.
field
);
input
.
appendTo
(
container
);
input
.
kendoDropDownList
({
dataSource
:
projCodeBox
,
minLength
:
0
,
dataTextField
:
"textField"
,
dataValueField
:
"valueField"
,
optionLabelTemplate
:
"[#:valueField#]#:textField#"
,
valueTemplate
:
"[#:valueField#]#:textField#"
,
template
:
"[#:valueField#]#:textField#"
,
filter
:
"contains"
});
}
}
],
beforeEdit
:
function
(
e
)
{
let
item
=
e
.
model
;
if
(
item
.
status
!=
'0'
){
e
.
preventDefault
();
//只有生成的不能编辑
if
(
item
.
source
===
'0'
){
//选择指定列不让修改
for
(
let
i
=
0
;
i
<
e
.
sender
.
columns
.
length
;
i
++
)
{
//指定的列不让修改
if
(
e
.
sender
.
columns
[
i
][
"name"
]
===
"companyCode"
)
{
e
.
sender
.
columns
[
i
][
"enable"
]
=
false
;
e
.
sender
.
columns
[
i
][
"readonly"
]
=
true
;
}
if
(
e
.
sender
.
columns
[
i
][
"name"
]
===
"projCode"
)
{
e
.
sender
.
columns
[
i
][
"enable"
]
=
false
;
e
.
sender
.
columns
[
i
][
"readonly"
]
=
true
;
}
if
(
e
.
sender
.
columns
[
i
][
"name"
]
===
"planDate"
)
{
e
.
sender
.
columns
[
i
][
"enable"
]
=
false
;
e
.
sender
.
columns
[
i
][
"readonly"
]
=
true
;
}
}
}
else
{
//手动添加的需要修改
for
(
let
i
=
0
;
i
<
e
.
sender
.
columns
.
length
;
i
++
)
{
//指定的列不让修改
if
(
e
.
sender
.
columns
[
i
][
"name"
]
===
"companyCode"
)
{
e
.
sender
.
columns
[
i
][
"enable"
]
=
true
;
e
.
sender
.
columns
[
i
][
"readonly"
]
=
false
;
}
if
(
e
.
sender
.
columns
[
i
][
"name"
]
===
"projCode"
)
{
e
.
sender
.
columns
[
i
][
"enable"
]
=
true
;
e
.
sender
.
columns
[
i
][
"readonly"
]
=
false
;
}
if
(
e
.
sender
.
columns
[
i
][
"name"
]
===
"planDate"
)
{
e
.
sender
.
columns
[
i
][
"enable"
]
=
true
;
e
.
sender
.
columns
[
i
][
"readonly"
]
=
false
;
}
}
}
},
loadComplete
:
function
(
grid
)
{
// 提交
$
(
document
.
body
).
on
(
"click"
,
"#SUBMIT"
,
submit
);
// change事件
grid
.
dataSource
.
bind
(
"change"
,
function
(
e
)
{
if
(
e
.
field
==
"companyCode"
)
{
for
(
let
i
=
0
;
i
<
companyCodeBox
.
length
;
i
++
)
{
if
(
companyCodeBox
[
i
][
'companyCode'
]
===
e
.
items
[
0
][
'companyCode'
])
{
resultGrid
.
setCellValue
(
e
.
items
[
0
],
"companyName"
,
companyCodeBox
[
i
][
'companyName'
]);
}
}
}
if
(
e
.
field
==
"projCode"
)
{
for
(
let
i
=
0
;
i
<
projCodeBox
.
length
;
i
++
)
{
if
(
projCodeBox
[
i
][
'valueField'
]
===
e
.
items
[
0
][
'projCode'
])
{
resultGrid
.
setCellValue
(
e
.
items
[
0
],
"projName"
,
projCodeBox
[
i
][
'textField'
]);
}
}
}
});
},
onAdd
:
function
(
e
)
{
$
.
each
(
e
.
items
,
function
(
index
,
item
)
{
item
[
'status'
]
=
0
;
});
},
onSave
:
function
(
e
)
{
// 阻止后台请求,使用自定义
...
...
@@ -76,12 +182,12 @@ let save = function () {
return
;
}
for
(
let
i
=
0
;
i
<
rows
.
length
;
i
++
)
{
if
(
!
isPositiveNumber
(
rows
[
i
][
'purQty
'
]))
{
message
(
"勾选的第"
+
(
i
+
1
)
+
"行
采购数量必须是大于0的数字
"
);
if
(
isBlank
(
rows
[
i
][
'companyCode
'
]))
{
message
(
"勾选的第"
+
(
i
+
1
)
+
"行
公司编号不能为空
"
);
return
;
}
if
(
!
isPositiveNumber
(
rows
[
i
][
'purWeight
'
]))
{
message
(
"勾选的第"
+
(
i
+
1
)
+
"行
采购重量必须是大于0的数字
"
);
if
(
isBlank
(
rows
[
i
][
'projCode
'
]))
{
message
(
"勾选的第"
+
(
i
+
1
)
+
"行
项目编号不能为空
"
);
return
;
}
if
(
rows
[
i
][
'status'
]
!=
'0'
)
{
...
...
@@ -155,9 +261,9 @@ function windowCallback() {
/**
* 显示详情
*/
function
showDetail
(
id
,
status
)
{
function
showDetail
(
id
,
status
,
source
)
{
JSColorbox
.
open
({
href
:
"HGCG001A?methodName=initLoad&inqu_status-0-primaryId="
+
id
+
"&inqu_status-0-status="
+
status
,
href
:
"HGCG001A?methodName=initLoad&inqu_status-0-primaryId="
+
id
+
"&inqu_status-0-status="
+
status
+
"&source="
+
source
,
title
:
"<div style='text-align: center;'>详情</div>"
,
width
:
"80%"
,
height
:
"80%"
,
...
...
src/main/webapp/HG/CG/HGCG001.jsp
View file @
564d3b17
...
...
@@ -21,6 +21,10 @@
</EF:EFSelect>
</div>
<div
class=
"row"
>
<EF:EFSelect
cname=
"数据来源"
blockId=
"inqu_status"
ename=
"source"
row=
"0"
colWidth=
"3"
optionLabel=
"全部"
defultValue=
""
>
<EF:EFCodeOption
codeName=
"hggp.hpcg.receiveSource"
/>
</EF:EFSelect>
<EF:EFDateSpan
startCname=
"创建时间(从)"
endCname=
"至"
blockId=
"inqu_status"
startName=
"createdTimeFrom"
endName=
"createdTimeTo"
row=
"0"
role=
"datetime"
format=
"yyyy-MM-dd HH:mm:ss"
ratio=
"3:3"
satrtRatio=
"4:8"
endRatio=
"4:8"
readonly=
"true"
>
...
...
@@ -32,19 +36,28 @@
<EF:EFGrid
blockId=
"result"
autoDraw=
"override"
isFloat=
"true"
checkMode=
"row"
>
<EF:EFColumn
ename=
"id"
cname=
"内码"
hidden=
"true"
/>
<EF:EFColumn
ename=
"operator"
cname=
"操作"
locked=
"true"
enable=
"false"
width=
"80"
align=
"center"
/>
<EF:EFColumn
ename=
"companyCode"
cname=
"公司编码"
enable=
"false"
width=
"100"
align=
"center"
hidden=
"true"
/>
<EF:EFColumn
ename=
"companyName"
cname=
"公司名称"
enable=
"false"
width=
"130"
align=
"center"
/>
<EF:EFColumn
ename=
"projCode"
cname=
"项目编码"
enable=
"false"
width=
"100"
align=
"center"
hidden=
"true"
/>
<EF:EFColumn
ename=
"projName"
cname=
"项目名称"
enable=
"false"
width=
"130"
align=
"center"
/>
<EF:EFColumn
ename=
"planDate"
cname=
"计划日期"
enable=
"false"
width=
"100"
align=
"center"
editType=
"date"
dateFormat=
"yyyy-MM-dd"
parseFormats=
"['yyyyMMdd']"
/>
<EF:EFComboColumn
ename=
"source"
cname=
"数据来源"
enable=
"false"
width=
"80"
align=
"center"
>
<EF:EFCodeOption
codeName=
"hggp.hpcg.receiveSource"
/>
</EF:EFComboColumn>
<EF:EFComboColumn
ename=
"companyCode"
cname=
"公司编码"
columnTemplate=
"#=companyName#"
itemTemplate=
"#=companyName#"
textField=
"companyName"
valueField=
"companyCode"
maxLength=
"16"
readonly=
"false"
width=
"100"
required=
"true"
align=
"center"
filter=
"contains"
sort=
"true"
>
<EF:EFOptions
blockId=
"roleCompany"
textField=
"companyName"
valueField=
"companyCode"
/>
</EF:EFComboColumn>
<EF:EFColumn
ename=
"companyName"
cname=
"公司名称"
width=
"120"
enable=
"false"
readonly=
"true"
align=
"center"
/>
<EF:EFColumn
ename=
"projCode"
cname=
"项目编码"
enable=
"true"
width=
"120"
align=
"center"
required=
"true"
/>
<EF:EFColumn
ename=
"projName"
cname=
"项目名称"
width=
"120"
align=
"center"
enable=
"false"
/>
<EF:EFColumn
ename=
"planDate"
cname=
"计划日期"
width=
"100"
align=
"center"
editType=
"date"
dateFormat=
"yyyy-MM-dd"
parseFormats=
"['yyyyMMdd']"
required=
"true"
/>
<EF:EFColumn
ename=
"planNo"
cname=
"计划单号"
enable=
"false"
width=
"120"
align=
"center"
/>
<EF:EFComboColumn
ename=
"status"
cname=
"状态"
enable=
"false"
width=
"80"
align=
"center"
>
<EF:EFCodeOption
codeName=
"hggp.hgcg.planStatus"
/>
</EF:EFComboColumn>
<EF:EFColumn
ename=
"purQty"
cname=
"采购数量"
enable=
"false"
width=
"120"
align=
"right"
format=
"{0:N3}"
/>
<EF:EFColumn
ename=
"purWeight"
cname=
"采购重量"
enable=
"false"
width=
"120"
align=
"right"
format=
"{0:N3}"
/>
<EF:EFColumn
ename=
"planWeight"
cname=
"计划重量"
enable=
"false"
width=
"120"
align=
"right"
format=
"{0:N3}"
/>
<EF:EFColumn
ename=
"purQty"
cname=
"采购数量"
enable=
"false"
width=
"120"
align=
"right"
format=
"{0:N3}"
defaultValue=
"0"
/>
<EF:EFColumn
ename=
"purWeight"
cname=
"采购重量"
enable=
"false"
width=
"120"
align=
"right"
format=
"{0:N3}"
defaultValue=
"0"
/>
<EF:EFColumn
ename=
"planWeight"
cname=
"计划重量"
enable=
"false"
width=
"120"
align=
"right"
format=
"{0:N3}"
defaultValue=
"0"
/>
<EF:EFColumn
ename=
"createdName"
cname=
"创建人"
enable=
"false"
width=
"100"
align=
"center"
/>
<EF:EFColumn
ename=
"createdTime"
cname=
"创建时间"
enable=
"false"
width=
"140"
align=
"center"
editType=
"datetime"
parseFormats=
"['yyyyMMddHHmmss']"
/>
...
...
src/main/webapp/HG/CG/HGCG001A.js
View file @
564d3b17
$
(
function
()
{
var
inventRecordBoxBlockId
=
__eiInfo
.
getBlock
(
"invent_record_box_block_id"
).
getMappedRows
();
IPLATUI
.
EFGrid
=
{
"result"
:
{
exportGrid
:
false
,
// 隐藏右侧自定义导出按钮
...
...
@@ -8,15 +8,103 @@ $(function () {
pageSizes
:
[
20
,
50
,
70
,
100
],
},
columns
:
[
{
field
:
"inventCode"
,
template
:
function
(
item
)
{
let
template
=
item
.
inventCode
;
if
(
item
.
inventCode
){
for
(
let
i
=
0
;
i
<
inventRecordBoxBlockId
.
length
;
i
++
){
if
(
item
.
inventCode
===
inventRecordBoxBlockId
[
i
][
'valueField'
]){
template
=
inventRecordBoxBlockId
[
i
][
'valueField'
];
}
else
{
template
=
item
.
inventCode
;
}
}
}
return
template
;
},
editor
:
function
(
container
,
options
)
{
let
inInfo
=
new
EiInfo
();
inInfo
.
set
(
"field"
,
options
.
field
);
let
dataSource
=
inventRecordBoxBlockId
;
EiCommunicator
.
send
(
"HGPZ005"
,
"queryInventCodeProdTypeFourBox"
,
inInfo
,
{
onSuccess
:
function
(
ei
)
{
dataSource
=
ei
.
getBlock
(
"invent_record_box_block_id"
).
getMappedRows
();
},
onFail
:
function
(
ei
)
{
}
},
{
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#|#:param4Field#"
,
filter
:
"contains"
});
}
},
{
field
:
"primaryId"
,
template
:
function
(
item
)
{
item
[
'primaryId'
]
=
$
(
"#inqu_status-0-primaryId"
).
val
();
return
$
(
"#inqu_status-0-primaryId"
).
val
();
}
}
],
beforeEdit
:
function
(
e
)
{
var
status
=
$
(
"#inqu_status-0-status"
).
val
();
if
(
status
!=
'0'
){
e
.
preventDefault
();
}
let
item
=
e
.
model
;
//只有合同生成的不能编辑
if
(
item
.
source
===
'0'
){
//选择收货的指定列不让修改
for
(
let
i
=
0
;
i
<
e
.
sender
.
columns
.
length
;
i
++
)
{
//指定的列不让修改
if
(
e
.
sender
.
columns
[
i
][
"name"
]
===
"inventCode"
)
{
e
.
sender
.
columns
[
i
][
"enable"
]
=
false
;
e
.
sender
.
columns
[
i
][
"readonly"
]
=
true
;
}
}
}
else
{
//手动添加的需要修改
for
(
let
i
=
0
;
i
<
e
.
sender
.
columns
.
length
;
i
++
)
{
//指定的列不让修改
if
(
e
.
sender
.
columns
[
i
][
"name"
]
===
"inventCode"
)
{
e
.
sender
.
columns
[
i
][
"enable"
]
=
true
;
e
.
sender
.
columns
[
i
][
"readonly"
]
=
false
;
}
}
}
},
loadComplete
:
function
(
grid
)
{
// 此grid对象
grid
.
dataSource
.
bind
(
"change"
,
function
(
e
)
{
if
(
e
.
field
===
"inventCode"
)
{
for
(
let
i
=
0
;
i
<
inventRecordBoxBlockId
.
length
;
i
++
)
{
if
(
inventRecordBoxBlockId
[
i
][
'valueField'
]
===
e
.
items
[
0
].
inventCode
)
{
resultGrid
.
setCellValue
(
e
.
items
[
0
],
'inventName'
,
inventRecordBoxBlockId
[
i
][
'textField'
])
resultGrid
.
setCellValue
(
e
.
items
[
0
],
'inventTypeDetail'
,
inventRecordBoxBlockId
[
i
][
'param1Field'
])
resultGrid
.
setCellValue
(
e
.
items
[
0
],
'inventType'
,
inventRecordBoxBlockId
[
i
][
'param3Field'
])
resultGrid
.
setCellValue
(
e
.
items
[
0
],
'spec'
,
inventRecordBoxBlockId
[
i
][
'param4Field'
])
resultGrid
.
setCellValue
(
e
.
items
[
0
],
'material'
,
inventRecordBoxBlockId
[
i
][
'param5Field'
])
resultGrid
.
setCellValue
(
e
.
items
[
0
],
'unit'
,
inventRecordBoxBlockId
[
i
][
'param6Field'
])
resultGrid
.
setCellValue
(
e
.
items
[
0
],
'length'
,
inventRecordBoxBlockId
[
i
][
'param7Field'
])
resultGrid
.
setCellValue
(
e
.
items
[
0
],
'width'
,
inventRecordBoxBlockId
[
i
][
'param8Field'
])
resultGrid
.
setCellValue
(
e
.
items
[
0
],
'thick'
,
inventRecordBoxBlockId
[
i
][
'param9Field'
])
break
}
}
}
})
},
onSave
:
function
(
e
)
{
// 阻止后台请求,使用自定义
...
...
@@ -45,6 +133,28 @@ $(window).load(function () {
query
();
//存货编号查询条件
initInventCode
();
let
status
=
$
(
"#inqu_status-0-status"
).
val
();
if
(
status
!=
'0'
){
$
(
".k-grid-add"
).
hide
();
$
(
".k-grid-save-changes"
).
hide
();
$
(
".k-grid-cancel-changes"
).
hide
();
$
(
".k-grid-delete"
).
hide
();
}
else
{
//合同选择的存货不让新增、删除
var
source
=
$
(
"#source"
).
val
();
if
(
source
===
'0'
){
$
(
".k-grid-save-changes"
).
hide
();
$
(
".k-grid-delete"
).
hide
();
}
}
//合同选择的存货不让新增、删除
var
source
=
$
(
"#source"
).
val
();
if
(
source
===
'0'
){
$
(
".k-grid-add"
).
hide
();
$
(
".k-grid-delete"
).
hide
();
}
});
/**
...
...
src/main/webapp/HG/CG/HGCG001A.jsp
View file @
564d3b17
...
...
@@ -13,6 +13,7 @@
<EF:EFInput
ename=
"inqu_status-0-status"
cname=
"状态"
colWidth=
"3"
type=
"hidden"
/>
<EF:EFInput
ename=
"inqu_status-0-planDate"
cname=
"计划日期"
colWidth=
"3"
type=
"hidden"
/>
<EF:EFInput
ename=
"inqu_status-0-planNo"
cname=
"计划单号"
colWidth=
"3"
type=
"hidden"
/>
<EF:EFInput
ename=
"source"
cname=
"数据来源"
colWidth=
"3"
type=
"hidden"
/>
<div
class=
"row"
>
<EF:EFSelect
cname=
"存货编号"
blockId=
"inqu_status"
ename=
"inventCode"
row=
"0"
colWidth=
"3"
filter=
"contains"
optionLabel=
"全部"
defultValue=
""
template=
"[#=valueField#]#=textField#"
>
...
...
@@ -34,22 +35,23 @@
dateFormat=
"yyyy-MM-dd"
parseFormats=
"['yyyyMMdd']"
hidden=
"true"
/>
<EF:EFColumn
ename=
"planNo"
cname=
"计划单号"
enable=
"false"
width=
"120"
align=
"center"
hidden=
"true"
/>
<EF:EFColumn
ename=
"inventCode"
cname=
"存货编码"
enable=
"false"
width=
"100"
align=
"center"
/>
<EF:EFColumn
ename=
"inventName"
cname=
"存货名称"
enable=
"false"
width=
"100"
align=
"center
"
/>
<EF:EFColumn
ename=
"inventCode"
required=
"true"
cname=
"存货编号"
/>
<EF:EFColumn
ename=
"inventName"
cname=
"存货名称"
width=
"120"
align=
"center"
required=
"true
"
/>
<EF:EFComboColumn
ename=
"inventType"
cname=
"存货类型"
width=
"120"
align=
"center"
required=
"false"
blockName=
"invent_type_box_block_id"
textField=
"textField"
valueField=
"valueField"
columnTemplate=
"#=textField#"
itemTemplate=
"#=textField#"
readonly=
"true"
filter=
"contains"
enable=
"false"
>
</EF:EFComboColumn>
<EF:EFColumn
ename=
"spec"
cname=
"规格"
enable=
"false"
width=
"120"
align=
"center"
/>
<EF:EFColumn
ename=
"inventTypeDetail"
cname=
"存货类型大类"
hidden=
"true"
/>
<EF:EFColumn
ename=
"spec"
cname=
"规格"
width=
"120"
align=
"center"
required=
"true"
/>
<EF:EFColumn
ename=
"purQty"
cname=
"采购数量"
width=
"120"
align=
"right"
format=
"{0:N3}"
required=
"true"
/>
<EF:EFColumn
ename=
"purWeight"
cname=
"采购重量"
width=
"120"
align=
"right"
format=
"{0:N3}"
required=
"true"
/>
<EF:EFColumn
ename=
"planWeight"
cname=
"计划重量"
enable=
"false"
width=
"120"
align=
"right"
format=
"{0:N3}"
/>
<EF:EFColumn
ename=
"material"
cname=
"材质"
enable=
"false"
width=
"80"
align=
"center
"
/>
<EF:EFColumn
ename=
"material"
cname=
"材质"
width=
"80"
align=
"center"
required=
"true
"
/>
<EF:EFColumn
ename=
"unit"
cname=
"单位"
enable=
"false"
width=
"80"
align=
"center"
/>
<EF:EFColumn
ename=
"length"
cname=
"长(MM)"
enable=
"false"
width=
"80"
align=
"right"
format=
"{0:N3}
"
/>
<EF:EFColumn
ename=
"width"
cname=
"宽(MM)"
enable=
"false"
width=
"80"
align=
"right"
format=
"{0:N3}
"
/>
<EF:EFColumn
ename=
"thick"
cname=
"厚(MM)"
enable=
"false"
width=
"80"
align=
"right"
format=
"{0:N3}
"
/>
<EF:EFColumn
ename=
"length"
cname=
"长(MM)"
width=
"80"
align=
"right"
format=
"{0:N3}"
required=
"true
"
/>
<EF:EFColumn
ename=
"width"
cname=
"宽(MM)"
width=
"80"
align=
"right"
format=
"{0:N3}"
required=
"true
"
/>
<EF:EFColumn
ename=
"thick"
cname=
"厚(MM)"
width=
"80"
align=
"right"
format=
"{0:N3}"
required=
"true
"
/>
<EF:EFColumn
ename=
"remarks"
cname=
"备注"
width=
"150"
enable=
"false"
/>
<EF:EFComboColumn
ename=
"status"
cname=
"状态"
enable=
"false"
width=
"80"
align=
"center"
>
<EF:EFCodeOption
codeName=
"hggp.hgcg.planStatus"
/>
...
...
@@ -57,6 +59,7 @@
<EF:EFColumn
ename=
"createdName"
cname=
"创建人"
enable=
"false"
width=
"100"
align=
"center"
/>
<EF:EFColumn
ename=
"createdTime"
cname=
"创建时间"
enable=
"false"
width=
"140"
align=
"center"
editType=
"datetime"
parseFormats=
"['yyyyMMddHHmmss']"
/>
<EF:EFColumn
ename=
"primaryId"
cname=
"主表id"
enable=
"false"
width=
"100"
align=
"center"
hidden=
"true"
/>
</EF:EFGrid>
</EF:EFRegion>
...
...
src/main/webapp/HG/CG/HGCG002.js
View file @
564d3b17
$
(
function
()
{
var
userByCompany
=
__eiInfo
.
getBlock
(
"userByCompany"
).
getMappedRows
();
var
companyCodeBox
=
__eiInfo
.
getBlock
(
"roleCompany"
).
getMappedRows
();
var
projCodeBox
=
__eiInfo
.
getBlock
(
"projRecordByRole_block_id"
).
getMappedRows
();
IPLATUI
.
EFGrid
=
{
"result"
:
{
exportGrid
:
false
,
// 隐藏右侧自定义导出按钮
...
...
@@ -12,16 +13,72 @@ $(function () {
{
field
:
"operator"
,
title
:
"操作"
,
width
:
120
,
template
:
function
(
item
)
{
let
template
=
''
;
if
(
!
isBlank
(
item
.
id
)){
template
+=
'<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+
'onclick="showDetail('
+
item
.
id
+
', '
+
item
.
status
+
')" >详情</a>'
;
+
'onclick="showDetail('
+
item
.
id
+
', '
+
item
.
status
+
',0, '
+
item
.
source
+
')" >详情</a>'
;
}
if
(
!
isBlank
(
item
.
id
)){
//待审核、审核通过的,可以进行合同变更
if
(
item
.
status
==
0
||
item
.
status
==
2
)
template
+=
'<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+
'onclick="showDetail('
+
item
.
id
+
', '
+
item
.
status
+
', 1, '
+
item
.
source
+
')" >合同变更</a>'
;
}
return
template
;
}
},
{
field
:
"companyCode"
,
title
:
"公司编码"
,
template
:
function
(
dataItem
)
{
for
(
let
i
=
0
;
i
<
companyCodeBox
.
length
;
i
++
)
{
if
(
companyCodeBox
[
i
][
'companyCode'
]
===
dataItem
[
'companyCode'
])
{
return
companyCodeBox
[
i
][
'companyCode'
];
}
}
return
dataItem
[
"companyCode"
];
}
},
{
field
:
"projCode"
,
title
:
"项目编码"
,
template
:
function
(
dataItem
)
{
for
(
let
i
=
0
;
i
<
projCodeBox
.
length
;
i
++
)
{
if
(
projCodeBox
[
i
][
'valueField'
]
===
dataItem
[
'projCode'
])
{
dataItem
[
'projName'
]
=
projCodeBox
[
i
][
'textField'
]
return
projCodeBox
[
i
][
'valueField'
];
}
}
return
dataItem
[
"projCode"
];
},
{
editor
:
function
(
container
,
options
)
{
let
inInfo
=
new
EiInfo
();
inInfo
.
set
(
"inqu_status-0-companyCode"
,
options
.
model
[
"companyCode"
]);
inInfo
.
set
(
"inqu_status-0-approvalStatus"
,
2
);
inInfo
.
set
(
"field"
,
options
.
field
);
EiCommunicator
.
send
(
"HGSC003"
,
"projComboBox"
,
inInfo
,
{
onSuccess
:
function
(
ei
)
{
projCodeBox
=
ei
.
getBlock
(
"projRecordByRole_block_id"
).
getMappedRows
();
},
onFail
:
function
(
ei
)
{
}
},
{
async
:
false
});
var
input
=
$
(
'<input />'
);
input
.
attr
(
"name"
,
options
.
field
);
input
.
attr
(
"id"
,
options
.
field
);
input
.
appendTo
(
container
);
input
.
kendoDropDownList
({
dataSource
:
projCodeBox
,
minLength
:
0
,
dataTextField
:
"textField"
,
dataValueField
:
"valueField"
,
optionLabelTemplate
:
"[#:valueField#]#:textField#"
,
valueTemplate
:
"[#:valueField#]#:textField#"
,
template
:
"[#:valueField#]#:textField#"
,
filter
:
"contains"
});
}
},{
field
:
"purUserName"
,
template
:
function
(
dataItem
)
{
for
(
let
i
=
0
;
i
<
userByCompany
.
length
;
i
++
)
{
...
...
@@ -67,6 +124,42 @@ $(function () {
if
(
item
.
status
!=
'0'
){
e
.
preventDefault
();
}
//只有生成的不能编辑
if
(
item
.
source
===
'0'
){
//选择指定列不让修改
for
(
let
i
=
0
;
i
<
e
.
sender
.
columns
.
length
;
i
++
)
{
//指定的列不让修改
if
(
e
.
sender
.
columns
[
i
][
"name"
]
===
"companyCode"
)
{
e
.
sender
.
columns
[
i
][
"enable"
]
=
false
;
e
.
sender
.
columns
[
i
][
"readonly"
]
=
true
;
}
if
(
e
.
sender
.
columns
[
i
][
"name"
]
===
"projCode"
)
{
e
.
sender
.
columns
[
i
][
"enable"
]
=
false
;
e
.
sender
.
columns
[
i
][
"readonly"
]
=
true
;
}
if
(
e
.
sender
.
columns
[
i
][
"name"
]
===
"contractDate"
)
{
e
.
sender
.
columns
[
i
][
"enable"
]
=
false
;
e
.
sender
.
columns
[
i
][
"readonly"
]
=
true
;
}
}
}
else
{
//手动添加的需要修改
for
(
let
i
=
0
;
i
<
e
.
sender
.
columns
.
length
;
i
++
)
{
//指定的列不让修改
if
(
e
.
sender
.
columns
[
i
][
"name"
]
===
"companyCode"
)
{
e
.
sender
.
columns
[
i
][
"enable"
]
=
true
;
e
.
sender
.
columns
[
i
][
"readonly"
]
=
false
;
}
if
(
e
.
sender
.
columns
[
i
][
"name"
]
===
"projCode"
)
{
e
.
sender
.
columns
[
i
][
"enable"
]
=
true
;
e
.
sender
.
columns
[
i
][
"readonly"
]
=
false
;
}
if
(
e
.
sender
.
columns
[
i
][
"name"
]
===
"contractDate"
)
{
e
.
sender
.
columns
[
i
][
"enable"
]
=
true
;
e
.
sender
.
columns
[
i
][
"readonly"
]
=
false
;
}
}
}
},
loadComplete
:
function
(
grid
)
{
// 提交
...
...
@@ -81,6 +174,20 @@ $(function () {
if
(
e
.
field
==
"taxRate"
)
{
calAmount
(
item
);
}
if
(
e
.
field
===
"companyCode"
)
{
for
(
let
i
=
0
;
i
<
companyCodeBox
.
length
;
i
++
)
{
if
(
companyCodeBox
[
i
][
'companyCode'
]
===
e
.
items
[
0
][
'companyCode'
])
{
resultGrid
.
setCellValue
(
e
.
items
[
0
],
"companyName"
,
companyCodeBox
[
i
][
'companyName'
]);
}
}
}
if
(
e
.
field
===
"projCode"
)
{
for
(
let
i
=
0
;
i
<
projCodeBox
.
length
;
i
++
)
{
if
(
projCodeBox
[
i
][
'valueField'
]
===
e
.
items
[
0
][
'projCode'
])
{
resultGrid
.
setCellValue
(
e
.
items
[
0
],
"projName"
,
projCodeBox
[
i
][
'textField'
]);
}
}
}
});
},
onSave
:
function
(
e
)
{
...
...
@@ -292,9 +399,9 @@ let selectPlanCallback = function () {
/**
* 显示详情
*/
function
showDetail
(
id
,
status
)
{
function
showDetail
(
id
,
status
,
updateFlag
,
source
)
{
JSColorbox
.
open
({
href
:
"HGCG002B?methodName=initLoad&inqu_status-0-primaryId="
+
id
+
"&inqu_status-0-status="
+
status
,
href
:
"HGCG002B?methodName=initLoad&inqu_status-0-primaryId="
+
id
+
"&inqu_status-0-status="
+
status
+
"&updateFlag="
+
updateFlag
+
"&source="
+
source
,
title
:
"<div style='text-align: center;'>详情</div>"
,
width
:
"80%"
,
height
:
"80%"
,
...
...
src/main/webapp/HG/CG/HGCG002.jsp
View file @
564d3b17
...
...
@@ -31,21 +31,36 @@
format=
"yyyy-MM-dd HH:mm:ss"
ratio=
"3:3"
satrtRatio=
"4:8"
endRatio=
"4:8"
readonly=
"true"
>
</EF:EFDateSpan>
</div>
<div
class=
"row"
>
<EF:EFSelect
cname=
"数据来源"
blockId=
"inqu_status"
ename=
"source"
row=
"0"
colWidth=
"3"
optionLabel=
"全部"
defultValue=
""
>
<EF:EFCodeOption
codeName=
"hggp.hpcg.receiveSource"
/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion
id=
"result"
title=
"明细信息"
>
<EF:EFGrid
blockId=
"result"
autoDraw=
"override"
isFloat=
"true"
checkMode=
"row"
>
<EF:EFColumn
ename=
"id"
cname=
"内码"
hidden=
"true"
/>
<EF:EFColumn
ename=
"operator"
cname=
"操作"
locked=
"true"
enable=
"false"
width=
"80"
align=
"center"
/>
<EF:EFColumn
ename=
"companyCode"
cname=
"公司编码"
enable=
"false"
width=
"100"
align=
"center"
hidden=
"true"
/>
<EF:EFColumn
ename=
"companyName"
cname=
"公司名称"
enable=
"false"
width=
"130"
align=
"center"
/>
<EF:EFColumn
ename=
"projCode"
cname=
"项目编码"
enable=
"false"
width=
"100"
align=
"center"
hidden=
"true"
/>
<EF:EFComboColumn
ename=
"source"
cname=
"数据来源"
enable=
"false"
width=
"80"
align=
"center"
defaultValue=
"1"
>
<EF:EFCodeOption
codeName=
"hggp.hpcg.receiveSource"
/>
</EF:EFComboColumn>
<EF:EFComboColumn
ename=
"companyCode"
cname=
"公司编码"
columnTemplate=
"#=companyName#"
itemTemplate=
"#=companyName#"
textField=
"companyName"
valueField=
"companyCode"
maxLength=
"16"
readonly=
"false"
width=
"100"
required=
"true"
align=
"center"
filter=
"contains"
sort=
"true"
>
<EF:EFOptions
blockId=
"roleCompany"
textField=
"companyName"
valueField=
"companyCode"
/>
</EF:EFComboColumn>
<EF:EFColumn
ename=
"companyName"
cname=
"公司名称"
width=
"120"
enable=
"false"
readonly=
"true"
align=
"center"
/>
<EF:EFColumn
ename=
"projCode"
cname=
"项目编码"
width=
"100"
align=
"center"
required=
"true"
/>
<EF:EFColumn
ename=
"projName"
cname=
"项目名称"
enable=
"false"
width=
"130"
align=
"center"
/>
<EF:EFColumn
ename=
"contractDate"
cname=
"合同日期"
enable=
"false"
width=
"100"
align=
"center"
editType=
"date"
dateFormat=
"yyyy-MM-dd"
parseFormats=
"['yyyyMMdd']"
/>
<EF:EFColumn
ename=
"contractDate"
cname=
"合同日期"
width=
"100"
align=
"center"
editType=
"date"
dateFormat=
"yyyy-MM-dd"
parseFormats=
"['yyyyMMdd']"
required=
"true"
/>
<EF:EFColumn
ename=
"contractNo"
cname=
"合同号"
enable=
"false"
width=
"120"
align=
"center"
/>
<
%
--
<
EF:EFColumn
ename=
"planNo"
cname=
"计划单号"
enable=
"false"
width=
"120"
align=
"center"
/>
--%>
<EF:EFComboColumn
ename=
"status"
cname=
"状态"
enable=
"false"
width=
"80"
align=
"center"
>
<EF:EFComboColumn
ename=
"status"
cname=
"状态"
enable=
"false"
width=
"80"
align=
"center"
defaultValue=
"0"
>
<EF:EFCodeOption
codeName=
"hggp.hgcg.contractStatus"
condition=
"ITEM_CODE IN ('0','2','4','5')"
/>
</EF:EFComboColumn>
<EF:EFComboColumn
ename=
"supCode"
cname=
"供应商名称"
width=
"120"
align=
"left"
defaultValue=
""
...
...
@@ -54,12 +69,12 @@
</EF:EFComboColumn>
<EF:EFColumn
ename=
"supName"
cname=
"供应商名称"
enable=
"false"
width=
"120"
align=
"center"
hidden=
"true"
/>
<EF:EFColumn
ename=
"purUserName"
cname=
"采购员"
width=
"120"
align=
"center"
required=
"true"
/>
<EF:EFColumn
ename=
"purQty"
cname=
"采购数量"
width=
"120"
align=
"right"
format=
"{0:N3}"
enable=
"false"
/>
<EF:EFColumn
ename=
"purWeight"
cname=
"采购重量"
width=
"120"
align=
"right"
format=
"{0:N3}"
enable=
"false"
/>
<EF:EFColumn
ename=
"receiveQty"
cname=
"已收货数量"
enable=
"false"
width=
"120"
align=
"right"
format=
"{0:N3}"
/>
<EF:EFColumn
ename=
"amount"
cname=
"不含税金额"
enable=
"false"
width=
"80"
align=
"right"
format=
"{0:N3}"
/>
<EF:EFColumn
ename=
"taxAmount"
cname=
"税额"
enable=
"false"
width=
"80"
align=
"right"
format=
"{0:N3}"
/>
<EF:EFColumn
ename=
"taxIncludeAmount"
cname=
"含税金额"
enable=
"false"
width=
"80"
align=
"right"
format=
"{0:N3}"
/>
<EF:EFColumn
ename=
"purQty"
cname=
"采购数量"
width=
"120"
align=
"right"
format=
"{0:N3}"
enable=
"false"
defaultValue=
"0"
/>
<EF:EFColumn
ename=
"purWeight"
cname=
"采购重量"
width=
"120"
align=
"right"
format=
"{0:N3}"
enable=
"false"
defaultValue=
"0"
/>
<EF:EFColumn
ename=
"receiveQty"
cname=
"已收货数量"
enable=
"false"
width=
"120"
align=
"right"
format=
"{0:N3}"
defaultValue=
"0"
/>
<EF:EFColumn
ename=
"amount"
cname=
"不含税金额"
enable=
"false"
width=
"80"
align=
"right"
format=
"{0:N3}"
defaultValue=
"0"
/>
<EF:EFColumn
ename=
"taxAmount"
cname=
"税额"
enable=
"false"
width=
"80"
align=
"right"
format=
"{0:N3}"
defaultValue=
"0"
/>
<EF:EFColumn
ename=
"taxIncludeAmount"
cname=
"含税金额"
enable=
"false"
width=
"80"
align=
"right"
format=
"{0:N3}"
defaultValue=
"0"
/>
<EF:EFColumn
ename=
"createdName"
cname=
"创建人"
enable=
"false"
width=
"100"
align=
"center"
/>
<EF:EFColumn
ename=
"createdTime"
cname=
"创建时间"
enable=
"false"
width=
"140"
align=
"center"
editType=
"datetime"
parseFormats=
"['yyyyMMddHHmmss']"
/>
...
...
src/main/webapp/HG/CG/HGCG002B.js
View file @
564d3b17
$
(
function
()
{
var
userByCompany
=
__eiInfo
.
getBlock
(
"userByCompany"
).
getMappedRows
();
var
inventRecordBoxBlockId
=
__eiInfo
.
getBlock
(
"invent_record_box_block_id"
).
getMappedRows
();
IPLATUI
.
EFGrid
=
{
"result"
:
{
exportGrid
:
false
,
// 隐藏右侧自定义导出按钮
...
...
@@ -10,6 +10,55 @@ $(function () {
},
columns
:
[
{
field
:
"inventCode"
,
template
:
function
(
item
)
{
let
template
=
item
.
inventCode
;
if
(
item
.
inventCode
){
for
(
let
i
=
0
;
i
<
inventRecordBoxBlockId
.
length
;
i
++
){
if
(
item
.
inventCode
===
inventRecordBoxBlockId
[
i
][
'valueField'
]){
template
=
inventRecordBoxBlockId
[
i
][
'valueField'
];
}
else
{
template
=
item
.
inventCode
;
}
}
}
return
template
;
},
editor
:
function
(
container
,
options
)
{
let
inInfo
=
new
EiInfo
();
inInfo
.
set
(
"field"
,
options
.
field
);
let
dataSource
=
inventRecordBoxBlockId
;
EiCommunicator
.
send
(
"HGPZ005"
,
"queryInventCodeProdTypeFourBox"
,
inInfo
,
{
onSuccess
:
function
(
ei
)
{
dataSource
=
ei
.
getBlock
(
"invent_record_box_block_id"
).
getMappedRows
();
},
onFail
:
function
(
ei
)
{
}
},
{
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#|#:param4Field#"
,
filter
:
"contains"
});
}
},
{
field
:
"primaryId"
,
template
:
function
(
item
)
{
item
[
'primaryId'
]
=
$
(
"#inqu_status-0-primaryId"
).
val
();
return
$
(
"#inqu_status-0-primaryId"
).
val
();
}
},
{
field
:
"purUserName"
,
template
:
function
(
dataItem
)
{
for
(
let
i
=
0
;
i
<
userByCompany
.
length
;
i
++
)
{
...
...
@@ -52,9 +101,47 @@ $(function () {
],
beforeEdit
:
function
(
e
)
{
var
status
=
$
(
"#inqu_status-0-status"
).
val
();
if
(
status
!=
'0'
){
let
updateFlag
=
$
(
"#updateFlag"
).
val
();
if
(
updateFlag
==
0
){
e
.
preventDefault
();
}
let
item
=
e
.
model
;
//只有生成的不能编辑
if
(
item
.
source
===
'0'
){
//选择指定列不让修改
for
(
let
i
=
0
;
i
<
e
.
sender
.
columns
.
length
;
i
++
)
{
//指定的列不让修改
if
(
e
.
sender
.
columns
[
i
][
"name"
]
===
"inventCode"
)
{
e
.
sender
.
columns
[
i
][
"enable"
]
=
false
;
e
.
sender
.
columns
[
i
][
"readonly"
]
=
true
;
}
if
(
e
.
sender
.
columns
[
i
][
"name"
]
===
"purWeight"
)
{
e
.
sender
.
columns
[
i
][
"enable"
]
=
false
;
e
.
sender
.
columns
[
i
][
"readonly"
]
=
true
;
}
if
(
e
.
sender
.
columns
[
i
][
"name"
]
===
"purQty"
)
{
e
.
sender
.
columns
[
i
][
"enable"
]
=
false
;
e
.
sender
.
columns
[
i
][
"readonly"
]
=
true
;
}
}
}
else
{
//手动添加的需要修改
for
(
let
i
=
0
;
i
<
e
.
sender
.
columns
.
length
;
i
++
)
{
//指定的列可以修改
if
(
e
.
sender
.
columns
[
i
][
"name"
]
===
"inventCode"
)
{
e
.
sender
.
columns
[
i
][
"enable"
]
=
true
;
e
.
sender
.
columns
[
i
][
"readonly"
]
=
false
;
}
if
(
e
.
sender
.
columns
[
i
][
"name"
]
===
"purWeight"
)
{
e
.
sender
.
columns
[
i
][
"enable"
]
=
true
;
e
.
sender
.
columns
[
i
][
"readonly"
]
=
false
;
}
if
(
e
.
sender
.
columns
[
i
][
"name"
]
===
"purQty"
)
{
e
.
sender
.
columns
[
i
][
"enable"
]
=
true
;
e
.
sender
.
columns
[
i
][
"readonly"
]
=
false
;
}
}
}
},
loadComplete
:
function
(
grid
)
{
// change事件
...
...
@@ -66,6 +153,22 @@ $(function () {
if
(
e
.
field
==
"taxRate"
)
{
calAmount
(
item
);
}
if
(
e
.
field
===
"inventCode"
)
{
for
(
let
i
=
0
;
i
<
inventRecordBoxBlockId
.
length
;
i
++
)
{
if
(
inventRecordBoxBlockId
[
i
][
'valueField'
]
===
e
.
items
[
0
].
inventCode
)
{
resultGrid
.
setCellValue
(
e
.
items
[
0
],
'inventName'
,
inventRecordBoxBlockId
[
i
][
'textField'
])
resultGrid
.
setCellValue
(
e
.
items
[
0
],
'inventTypeDetail'
,
inventRecordBoxBlockId
[
i
][
'param1Field'
])
resultGrid
.
setCellValue
(
e
.
items
[
0
],
'inventType'
,
inventRecordBoxBlockId
[
i
][
'param3Field'
])
resultGrid
.
setCellValue
(
e
.
items
[
0
],
'spec'
,
inventRecordBoxBlockId
[
i
][
'param4Field'
])
resultGrid
.
setCellValue
(
e
.
items
[
0
],
'material'
,
inventRecordBoxBlockId
[
i
][
'param5Field'
])
resultGrid
.
setCellValue
(
e
.
items
[
0
],
'unit'
,
inventRecordBoxBlockId
[
i
][
'param6Field'
])
resultGrid
.
setCellValue
(
e
.
items
[
0
],
'length'
,
inventRecordBoxBlockId
[
i
][
'param7Field'
])
resultGrid
.
setCellValue
(
e
.
items
[
0
],
'width'
,
inventRecordBoxBlockId
[
i
][
'param8Field'
])
resultGrid
.
setCellValue
(
e
.
items
[
0
],
'thick'
,
inventRecordBoxBlockId
[
i
][
'param9Field'
])
break
}
}
}
});
},
onSave
:
function
(
e
)
{
...
...
@@ -135,6 +238,22 @@ $(window).load(function () {
query
();
initInventCode
();
let
status
=
$
(
"#inqu_status-0-status"
).
val
();
let
updateFlag
=
$
(
"#updateFlag"
).
val
();
//只有审核的、合同变更的可以修改
if
(
updateFlag
==
0
){
$
(
".k-grid-add"
).
hide
();
$
(
".k-grid-save-changes"
).
hide
();
$
(
".k-grid-cancel-changes"
).
hide
();
$
(
".k-grid-delete"
).
hide
();
}
else
{
//如果不是手动录入的,并且没生成收款单的,不能新增、删除
let
source
=
$
(
"#source"
).
val
();
if
(
source
==
0
){
$
(
".k-grid-add"
).
hide
();
$
(
".k-grid-delete"
).
hide
();
}
}
});
...
...
@@ -191,7 +310,7 @@ let save = function () {
}
JSUtils
.
confirm
(
"确定对勾选中的["
+
rows
.
length
+
"]条数据做
\"
保存
\"
操作? "
,
{
ok
:
function
()
{
JSUtils
.
submitGridsData
(
"result"
,
save
,
"remo
ve"
,
JSUtils
.
submitGridsData
(
"result"
,
"HGCG002B"
,
"sa
ve"
,
true
,
function
(
e
)
{
var
status
=
e
.
getStatus
();
if
(
status
!==
-
1
)
{
...
...
src/main/webapp/HG/CG/HGCG002B.jsp
View file @
564d3b17
...
...
@@ -9,6 +9,8 @@
<EF:EFRegion
id=
"inqu"
title=
"查询条件"
>
<EF:EFInput
ename=
"inqu_status-0-primaryId"
cname=
"主表id"
colWidth=
"3"
type=
"hidden"
/>
<EF:EFInput
ename=
"inqu_status-0-status"
cname=
"状态"
colWidth=
"3"
type=
"hidden"
/>
<EF:EFInput
ename=
"updateFlag"
cname=
"合同变更标记"
colWidth=
"3"
type=
"hidden"
/>
<EF:EFInput
ename=
"source"
cname=
"数据来源"
colWidth=
"3"
type=
"hidden"
/>
<div
class=
"row"
>
<EF:EFSelect
cname=
"存货编号"
blockId=
"inqu_status"
ename=
"inventCode"
row=
"0"
colWidth=
"3"
filter=
"contains"
optionLabel=
"全部"
defultValue=
""
template=
"[#=valueField#]#=textField#"
>
...
...
@@ -24,17 +26,18 @@
<EF:EFRegion
id=
"result"
title=
"明细信息"
>
<EF:EFGrid
blockId=
"result"
autoDraw=
"override"
isFloat=
"true"
checkMode=
"row"
>
<EF:EFColumn
ename=
"id"
cname=
"内码"
hidden=
"true"
/>
<EF:EFColumn
ename=
"inventCode"
cname=
"存货编码"
enable=
"false"
width=
"100"
align=
"center"
/>
<EF:EFColumn
ename=
"inventName"
cname=
"存货名称"
enable=
"false"
width=
"100"
align=
"center
"
/>
<EF:EFColumn
ename=
"inventCode"
required=
"true"
cname=
"存货编号"
/>
<EF:EFColumn
ename=
"inventName"
cname=
"存货名称"
width=
"120"
align=
"center"
required=
"true
"
/>
<EF:EFComboColumn
ename=
"inventType"
cname=
"存货类型"
width=
"120"
align=
"center"
required=
"false"
blockName=
"invent_type_box_block_id"
textField=
"textField"
valueField=
"valueField"
columnTemplate=
"#=textField#"
itemTemplate=
"#=textField#"
readonly=
"true"
filter=
"contains"
enable=
"false"
>
</EF:EFComboColumn>
<EF:EFColumn
ename=
"spec"
cname=
"规格"
enable=
"false"
width=
"120"
align=
"center"
/>
<EF:EFColumn
ename=
"purQty"
cname=
"采购数量"
width=
"120"
align=
"right"
format=
"{0:N3}"
enable=
"false"
/>
<EF:EFColumn
ename=
"purWeight"
cname=
"采购重量"
width=
"120"
align=
"right"
format=
"{0:N3}"
enable=
"false"
/>
<EF:EFColumn
ename=
"receiveQty"
cname=
"已收货数量"
enable=
"false"
width=
"120"
align=
"right"
format=
"{0:N3}"
/>
<EF:EFColumn
ename=
"inventTypeDetail"
cname=
"存货类型大类"
hidden=
"true"
/>
<EF:EFColumn
ename=
"spec"
cname=
"规格"
width=
"120"
align=
"center"
required=
"true"
/>
<EF:EFColumn
ename=
"purQty"
cname=
"采购数量"
width=
"120"
align=
"right"
format=
"{0:N3}"
required=
"true"
defaultValue=
"0"
/>
<EF:EFColumn
ename=
"purWeight"
cname=
"采购重量"
width=
"120"
align=
"right"
format=
"{0:N3}"
required=
"true"
defaultValue=
"0"
/>
<EF:EFColumn
ename=
"receiveQty"
cname=
"已收货数量"
enable=
"false"
width=
"120"
align=
"right"
format=
"{0:N3}"
defaultValue=
"0"
/>
<EF:EFColumn
ename=
"price"
cname=
"单价"
width=
"80"
align=
"right"
format=
"{0:N3}"
required=
"true"
/>
<EF:EFComboColumn
ename=
"taxRate"
cname=
"税率(%)"
enable=
"true"
width=
"80"
align=
"center"
required=
"true"
>
<EF:EFCodeOption
codeName=
"hggp.cw.taxPoints"
/>
...
...
@@ -42,16 +45,15 @@
<EF:EFColumn
ename=
"amount"
cname=
"不含税金额"
enable=
"false"
width=
"80"
align=
"right"
format=
"{0:N3}"
/>
<EF:EFColumn
ename=
"taxAmount"
cname=
"税额"
enable=
"false"
width=
"80"
align=
"right"
format=
"{0:N3}"
/>
<EF:EFColumn
ename=
"taxIncludeAmount"
cname=
"含税金额"
enable=
"false"
width=
"80"
align=
"right"
format=
"{0:N3}"
/>
<EF:EFColumn
ename=
"material"
cname=
"材质"
enable=
"false"
width=
"80"
align=
"center
"
/>
<EF:EFColumn
ename=
"material"
cname=
"材质"
width=
"80"
align=
"center"
required=
"true
"
/>
<EF:EFColumn
ename=
"unit"
cname=
"单位"
enable=
"false"
width=
"80"
align=
"center"
/>
<EF:EFColumn
ename=
"length"
cname=
"长(MM)"
enable=
"false"
width=
"80"
align=
"right"
format=
"{0:N3}
"
/>
<EF:EFColumn
ename=
"width"
cname=
"宽(MM)"
enable=
"false"
width=
"80"
align=
"right"
format=
"{0:N3}
"
/>
<EF:EFColumn
ename=
"thick"
cname=
"厚(MM)"
enable=
"false"
width=
"80"
align=
"right"
format=
"{0:N3}
"
/>
<EF:EFColumn
ename=
"length"
cname=
"长(MM)"
width=
"80"
align=
"right"
format=
"{0:N3}"
required=
"true
"
/>
<EF:EFColumn
ename=
"width"
cname=
"宽(MM)"
width=
"80"
align=
"right"
format=
"{0:N3}"
required=
"true
"
/>
<EF:EFColumn
ename=
"thick"
cname=
"厚(MM)"
width=
"80"
align=
"right"
format=
"{0:N3}"
required=
"true
"
/>
<EF:EFColumn
ename=
"createdName"
cname=
"创建人"
enable=
"false"
width=
"100"
align=
"center"
/>
<EF:EFColumn
ename=
"createdTime"
cname=
"创建时间"
enable=
"false"
width=
"140"
align=
"center"
editType=
"datetime"
parseFormats=
"['yyyyMMddHHmmss']"
/>
<
%
--
隐藏字段
--
%
>
<EF:EFColumn
ename=
"inventTypeDetail"
cname=
"存货类型明细"
enable=
"false"
width=
"100"
align=
"center"
hidden=
"true"
/>
<EF:EFColumn
ename=
"companyCode"
cname=
"公司编码"
enable=
"false"
width=
"100"
align=
"center"
hidden=
"true"
/>
<EF:EFColumn
ename=
"companyName"
cname=
"公司名称"
enable=
"false"
width=
"130"
align=
"center"
hidden=
"true"
/>
<EF:EFColumn
ename=
"contractDate"
cname=
"合同日期"
enable=
"false"
width=
"100"
align=
"center"
editType=
"date"
...
...
src/main/webapp/HG/CG/HGCG003.js
View file @
564d3b17
...
...
@@ -262,7 +262,7 @@ let save = function () {
}
for
(
let
i
=
0
;
i
<
rows
.
length
;
i
++
)
{
if
(
isBlank
(
rows
[
i
][
'companyCode'
]))
{
message
(
"勾选的第"
+
(
i
+
1
)
+
"行公司编号
名称
不能为空"
);
message
(
"勾选的第"
+
(
i
+
1
)
+
"行公司编号不能为空"
);
return
;
}
if
(
isBlank
(
rows
[
i
][
'supCode'
]))
{
...
...
src/main/webapp/HG/CG/HGCG003.jsp
View file @
564d3b17
...
...
@@ -55,7 +55,7 @@
<EF:EFOptions
blockId=
"roleCompany"
textField=
"companyName"
valueField=
"companyCode"
/>
</EF:EFComboColumn>
<EF:EFColumn
ename=
"companyName"
cname=
"公司名称"
width=
"120"
enable=
"false"
readonly=
"true"
align=
"center"
/>
<EF:EFColumn
ename=
"projCode"
cname=
"项目编码"
enable=
"true"
width=
"120"
align=
"center"
/>
<EF:EFColumn
ename=
"projCode"
cname=
"项目编码"
enable=
"true"
width=
"120"
align=
"center"
required=
"true"
/>
<EF:EFColumn
ename=
"projName"
cname=
"项目名称"
width=
"120"
align=
"center"
enable=
"false"
/>
<EF:EFColumn
ename=
"receiveDate"
cname=
"收货日期"
width=
"100"
align=
"center"
editType=
"date"
dateFormat=
"yyyy-MM-dd"
parseFormats=
"['yyyyMMdd']"
required=
"true"
/>
...
...
src/main/webapp/HG/SC/HGSC009A.jsp
View file @
564d3b17
...
...
@@ -44,17 +44,17 @@
<
%
--
</
EF:EFComboColumn
>
--%>
<EF:EFColumn
ename=
"inventCode"
required=
"true"
cname=
"产品编号"
/>
<EF:EFColumn
ename=
"inventTypeDetail"
cname=
"存货类型大类"
hidden=
"true"
/>
<EF:EFColumn
ename=
"inventName"
cname=
"存货名称"
width=
"120"
align=
"center"
enable=
"false"
readonly=
"true"
required=
"true"
/>
<EF:EFColumn
ename=
"inventName"
cname=
"存货名称"
width=
"120"
align=
"center"
required=
"true"
/>
<EF:EFComboColumn
ename=
"inventType"
cname=
"存货类型"
width=
"120"
align=
"center"
required=
"false"
blockName=
"invent_type_box_block_id"
textField=
"textField"
valueField=
"valueField"
columnTemplate=
"#=textField#"
itemTemplate=
"#=textField#"
readonly=
"true"
filter=
"contains"
enable=
"false"
>
</EF:EFComboColumn>
<EF:EFColumn
ename=
"material"
cname=
"材质"
width=
"120"
align=
"center"
enable=
"false"
readonly=
"true"
required=
"true"
/>
<EF:EFColumn
ename=
"spec"
cname=
"规格"
width=
"120"
align=
"center"
required=
"true"
readonly=
"true"
enable=
"false"
/>
<EF:EFColumn
ename=
"length"
cname=
"长(MM)"
enable=
"false"
width=
"80"
align=
"right"
format=
"{0:N3}
"
/>
<EF:EFColumn
ename=
"width"
cname=
"宽(MM)"
enable=
"false"
width=
"80"
align=
"right"
format=
"{0:N3}
"
/>
<EF:EFColumn
ename=
"thick"
cname=
"厚(MM)"
enable=
"false"
width=
"80"
align=
"right"
format=
"{0:N3}
"
/>
<EF:EFColumn
ename=
"material"
cname=
"材质"
width=
"120"
align=
"center"
required=
"true"
/>
<EF:EFColumn
ename=
"spec"
cname=
"规格"
width=
"120"
align=
"center"
required=
"true"
/>
<EF:EFColumn
ename=
"length"
cname=
"长(MM)"
width=
"80"
align=
"right"
format=
"{0:N3}"
required=
"true
"
/>
<EF:EFColumn
ename=
"width"
cname=
"宽(MM)"
width=
"80"
align=
"right"
format=
"{0:N3}"
required=
"true
"
/>
<EF:EFColumn
ename=
"thick"
cname=
"厚(MM)"
width=
"80"
align=
"right"
format=
"{0:N3}"
required=
"true
"
/>
<EF:EFColumn
ename=
"quantity"
cname=
"数量"
width=
"120"
align=
"right"
format=
"{0:N3}"
defaultValue=
"0"
data-regex=
"/^-?[0-9]{1,17}([.][0-9]{1,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