Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
doc_wei
Skyeye
提交
8c0856e7
S
Skyeye
项目概览
doc_wei
/
Skyeye
通知
1195
Star
154
Fork
127
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Skyeye
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
8c0856e7
编写于
11月 12, 2022
作者:
doc_wei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
BOM清单商品选择修改,删除多余接口的调用
上级
95e2dabf
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
257 addition
and
244 deletion
+257
-244
erp-produce/src/main/resources/template/js/erpBom/erpBomAdd.js
...roduce/src/main/resources/template/js/erpBom/erpBomAdd.js
+21
-21
erp-produce/src/main/resources/template/js/erpBom/erpBomEdit.js
...oduce/src/main/resources/template/js/erpBom/erpBomEdit.js
+22
-22
erp/src/main/resources/template/js/material/materialChooseToProduce.js
...resources/template/js/material/materialChooseToProduce.js
+42
-53
erp/src/main/resources/template/tpl/material/materialChooseToProduce.html
...ources/template/tpl/material/materialChooseToProduce.html
+8
-8
web/src/main/resources/template/assets/lib/layui/lay/modules/tableCheckBoxUtil/tableCheckBoxUtil.js
.../layui/lay/modules/tableCheckBoxUtil/tableCheckBoxUtil.js
+164
-140
未找到文件。
erp-produce/src/main/resources/template/js/erpBom/erpBomAdd.js
浏览文件 @
8c0856e7
//bom表商品选择必备参数
var
productMationList
=
[];
//选择的商品列表
//
bom表商品选择必备参数
var
materialMationList
=
[];
//工序选择必备参数
var
procedureCheckType
=
2
;
//工序选择类型:1.单选procedureMation;2.多选procedureMationList
...
...
@@ -34,12 +34,12 @@ layui.config({
var
childObject
=
new
Array
();
var
wheatherError
=
false
;
$
.
each
(
ztreeNode
,
function
(
i
,
item
)
{
item
.
needNum
=
$
(
"
#needNum
"
+
item
.
product
Id
).
val
();
item
.
type
=
$
(
"
#type
"
+
item
.
product
Id
).
val
();
item
.
wastagePrice
=
$
(
"
#wastage
"
+
item
.
product
Id
).
val
();
item
.
remark
=
$
(
"
#remark
"
+
item
.
product
Id
).
val
();
item
.
needNum
=
$
(
"
#needNum
"
+
item
.
material
Id
).
val
();
item
.
type
=
$
(
"
#type
"
+
item
.
material
Id
).
val
();
item
.
wastagePrice
=
$
(
"
#wastage
"
+
item
.
material
Id
).
val
();
item
.
remark
=
$
(
"
#remark
"
+
item
.
material
Id
).
val
();
childObject
.
push
(
item
);
if
(
item
.
productId
==
erpOrderUtil
.
chooseProductMation
.
product
Id
){
if
(
item
.
materialId
==
erpOrderUtil
.
chooseProductMation
.
material
Id
){
winui
.
window
.
msg
(
'
子件清单中不能包含父件信息。
'
,
{
icon
:
2
,
time
:
2000
});
wheatherError
=
true
;
return
false
;
...
...
@@ -109,7 +109,7 @@ layui.config({
},
simpleData
:
{
enable
:
true
,
idKey
:
'
product
Id
'
,
idKey
:
'
material
Id
'
,
pIdKey
:
'
pId
'
,
rootPId
:
0
}
...
...
@@ -147,7 +147,7 @@ layui.config({
}
//刷新节点数据重置金额
$
.
each
(
ztreeNode
,
function
(
i
,
item
)
{
$
(
"
#allPrice
"
+
item
.
product
Id
).
html
(
parseInt
(
item
.
needNum
)
*
parseFloat
(
item
.
unitPrice
));
$
(
"
#allPrice
"
+
item
.
material
Id
).
html
(
parseInt
(
item
.
needNum
)
*
parseFloat
(
item
.
unitPrice
));
});
}
...
...
@@ -166,7 +166,7 @@ layui.config({
var
nodesIndex
=
-
1
;
//拖拽节点所在索引
$
.
each
(
ztreeNode
,
function
(
i
,
item
)
{
//拖拽节点
if
(
item
.
productId
==
treeNodes
[
0
].
product
Id
){
if
(
item
.
materialId
==
treeNodes
[
0
].
material
Id
){
nodesIndex
=
i
;
return
false
;
}
...
...
@@ -177,7 +177,7 @@ layui.config({
if
(
'
inner
'
==
moveType
){
//依然为父节点
if
(
nodesIndex
>=
0
){
ztreeNode
[
nodesIndex
].
pId
=
targetNode
.
product
Id
;
ztreeNode
[
nodesIndex
].
pId
=
targetNode
.
material
Id
;
}
}
}
...
...
@@ -205,7 +205,7 @@ layui.config({
//删除节点操作
function
deleteNode
(
treeNode
){
$
.
each
(
ztreeNode
,
function
(
i
,
item
)
{
if
(
item
.
productId
==
treeNode
.
product
Id
){
if
(
item
.
materialId
==
treeNode
.
material
Id
){
treeNodeIndex
=
i
;
return
false
;
}
...
...
@@ -251,7 +251,7 @@ layui.config({
switchObj
.
before
(
spaceStr
);
aObj
.
append
(
getDataUseHandlebars
(
$
(
"
#tableBody
"
).
html
(),
treeNode
));
//设置商品来源选中
$
(
"
#type
"
+
treeNode
.
product
Id
).
val
(
treeNode
.
type
);
$
(
"
#type
"
+
treeNode
.
material
Id
).
val
(
treeNode
.
type
);
form
.
render
(
"
select
"
);
}
...
...
@@ -262,15 +262,15 @@ layui.config({
//新增子件
$
(
"
body
"
).
on
(
"
click
"
,
"
#addRow
"
,
function
(
e
)
{
product
MationList
=
[];
material
MationList
=
[];
_openNewWindows
({
url
:
"
../../tpl/material/materialChooseToProduce.html
"
,
title
:
"
选择商品
"
,
pageId
:
"
materialChooseToProduce
"
,
area
:
[
'
90vw
'
,
'
90vh
'
],
callBack
:
function
(
refreshCode
)
{
$
.
each
(
product
MationList
,
function
(
i
,
item
)
{
if
(
!
inZtreeNode
(
item
.
product
Id
)){
$
.
each
(
material
MationList
,
function
(
i
,
item
)
{
if
(
!
inZtreeNode
(
item
.
material
Id
)){
ztreeNode
.
push
(
item
);
}
});
...
...
@@ -284,7 +284,7 @@ layui.config({
var
proId
=
$
(
this
).
attr
(
"
id
"
).
replace
(
"
procedureSel
"
,
""
);
var
selIndex
=
-
1
;
$
.
each
(
ztreeNode
,
function
(
i
,
item
)
{
if
(
item
.
product
Id
==
proId
){
if
(
item
.
material
Id
==
proId
){
selIndex
=
i
;
return
false
;
}
...
...
@@ -326,10 +326,10 @@ layui.config({
/**
* 判断该商品是否在树节点里面
*/
function
inZtreeNode
(
product
Id
){
function
inZtreeNode
(
material
Id
){
var
inNodeIndex
=
-
1
;
$
.
each
(
ztreeNode
,
function
(
i
,
item
)
{
if
(
item
.
productId
==
product
Id
){
if
(
item
.
materialId
==
material
Id
){
inNodeIndex
=
i
;
return
false
;
}
...
...
@@ -355,7 +355,7 @@ layui.config({
function
calculatedTotalPrice
(
proId
,
needNum
){
var
inNodeIndex
=
-
1
;
$
.
each
(
ztreeNode
,
function
(
i
,
item
)
{
if
(
item
.
product
Id
==
proId
){
if
(
item
.
material
Id
==
proId
){
inNodeIndex
=
i
;
return
false
;
}
...
...
@@ -365,7 +365,7 @@ layui.config({
$
(
"
#allPrice
"
+
proId
).
html
(
needNum
*
parseFloat
(
ztreeNode
[
inNodeIndex
].
unitPrice
));
//修改节点信息
var
zTree
=
$
.
fn
.
zTree
.
getZTreeObj
(
"
treeDemo
"
);
var
node
=
zTree
.
getNodeByParam
(
"
product
Id
"
,
proId
);
var
node
=
zTree
.
getNodeByParam
(
"
material
Id
"
,
proId
);
node
.
needNum
=
needNum
;
zTree
.
updateNode
(
node
);
}
...
...
erp-produce/src/main/resources/template/js/erpBom/erpBomEdit.js
浏览文件 @
8c0856e7
//bom表商品选择必备参数
var
productMationList
=
[];
//选择的商品列表
//
bom表商品选择必备参数
var
materialMationList
=
[];
//工序选择必备参数
var
procedureCheckType
=
2
;
//工序选择类型:1.单选procedureMation;2.多选procedureMationList
...
...
@@ -28,7 +28,7 @@ layui.config({
// 初始化父件商品信息
erpOrderUtil
.
chooseProductMation
=
{
materialId
:
json
.
bean
.
product
Id
,
materialId
:
json
.
bean
.
material
Id
,
materialName
:
json
.
bean
.
productName
,
materialModel
:
json
.
bean
.
productModel
,
unitList
:
json
.
bean
.
unitList
...
...
@@ -55,12 +55,12 @@ layui.config({
var
childObject
=
new
Array
();
var
wheatherError
=
false
;
$
.
each
(
ztreeNode
,
function
(
i
,
item
)
{
item
.
needNum
=
$
(
"
#needNum
"
+
item
.
product
Id
).
val
();
item
.
type
=
$
(
"
#type
"
+
item
.
product
Id
).
val
();
item
.
wastagePrice
=
$
(
"
#wastage
"
+
item
.
product
Id
).
val
();
item
.
remark
=
$
(
"
#remark
"
+
item
.
product
Id
).
val
();
item
.
needNum
=
$
(
"
#needNum
"
+
item
.
material
Id
).
val
();
item
.
type
=
$
(
"
#type
"
+
item
.
material
Id
).
val
();
item
.
wastagePrice
=
$
(
"
#wastage
"
+
item
.
material
Id
).
val
();
item
.
remark
=
$
(
"
#remark
"
+
item
.
material
Id
).
val
();
childObject
.
push
(
item
);
if
(
item
.
productId
==
erpOrderUtil
.
chooseProductMation
.
product
Id
){
if
(
item
.
materialId
==
erpOrderUtil
.
chooseProductMation
.
material
Id
){
winui
.
window
.
msg
(
'
子件清单中不能包含父件信息。
'
,
{
icon
:
2
,
time
:
2000
});
wheatherError
=
true
;
return
false
;
...
...
@@ -129,7 +129,7 @@ layui.config({
},
simpleData
:
{
enable
:
true
,
idKey
:
'
product
Id
'
,
idKey
:
'
material
Id
'
,
pIdKey
:
'
pId
'
,
rootPId
:
0
}
...
...
@@ -165,7 +165,7 @@ layui.config({
}
//刷新节点数据重置金额
$
.
each
(
ztreeNode
,
function
(
i
,
item
)
{
$
(
"
#allPrice
"
+
item
.
product
Id
).
html
(
parseInt
(
item
.
needNum
)
*
parseFloat
(
item
.
unitPrice
));
$
(
"
#allPrice
"
+
item
.
material
Id
).
html
(
parseInt
(
item
.
needNum
)
*
parseFloat
(
item
.
unitPrice
));
});
}
...
...
@@ -184,7 +184,7 @@ layui.config({
var
nodesIndex
=
-
1
;
//拖拽节点所在索引
$
.
each
(
ztreeNode
,
function
(
i
,
item
)
{
//拖拽节点
if
(
item
.
productId
==
treeNodes
[
0
].
product
Id
){
if
(
item
.
materialId
==
treeNodes
[
0
].
material
Id
){
nodesIndex
=
i
;
return
false
;
}
...
...
@@ -195,7 +195,7 @@ layui.config({
if
(
'
inner
'
==
moveType
){
//依然为父节点
if
(
nodesIndex
>=
0
){
ztreeNode
[
nodesIndex
].
pId
=
targetNode
.
product
Id
;
ztreeNode
[
nodesIndex
].
pId
=
targetNode
.
material
Id
;
}
}
}
...
...
@@ -223,7 +223,7 @@ layui.config({
//删除节点操作
function
deleteNode
(
treeNode
){
$
.
each
(
ztreeNode
,
function
(
i
,
item
)
{
if
(
item
.
productId
==
treeNode
.
product
Id
){
if
(
item
.
materialId
==
treeNode
.
material
Id
){
treeNodeIndex
=
i
;
return
false
;
}
...
...
@@ -269,7 +269,7 @@ layui.config({
switchObj
.
before
(
spaceStr
);
aObj
.
append
(
getDataUseHandlebars
(
$
(
"
#tableBody
"
).
html
(),
treeNode
));
//设置商品来源选中
$
(
"
#type
"
+
treeNode
.
product
Id
).
val
(
treeNode
.
type
);
$
(
"
#type
"
+
treeNode
.
material
Id
).
val
(
treeNode
.
type
);
form
.
render
(
"
select
"
);
}
...
...
@@ -280,15 +280,15 @@ layui.config({
//新增子件
$
(
"
body
"
).
on
(
"
click
"
,
"
#addRow
"
,
function
(
e
)
{
product
MationList
=
[];
material
MationList
=
[];
_openNewWindows
({
url
:
"
../../tpl/material/materialChooseToProduce.html
"
,
title
:
"
选择商品
"
,
pageId
:
"
materialChooseToProduce
"
,
area
:
[
'
90vw
'
,
'
90vh
'
],
callBack
:
function
(
refreshCode
)
{
$
.
each
(
product
MationList
,
function
(
i
,
item
)
{
if
(
!
inZtreeNode
(
item
.
product
Id
)){
$
.
each
(
material
MationList
,
function
(
i
,
item
)
{
if
(
!
inZtreeNode
(
item
.
material
Id
)){
ztreeNode
.
push
(
item
);
}
});
...
...
@@ -302,7 +302,7 @@ layui.config({
var
proId
=
$
(
this
).
attr
(
"
id
"
).
replace
(
"
procedureSel
"
,
""
);
var
selIndex
=
-
1
;
$
.
each
(
ztreeNode
,
function
(
i
,
item
)
{
if
(
item
.
product
Id
==
proId
){
if
(
item
.
material
Id
==
proId
){
selIndex
=
i
;
return
false
;
}
...
...
@@ -343,10 +343,10 @@ layui.config({
/**
* 判断该商品是否在树节点里面
*/
function
inZtreeNode
(
product
Id
){
function
inZtreeNode
(
material
Id
){
var
inNodeIndex
=
-
1
;
$
.
each
(
ztreeNode
,
function
(
i
,
item
)
{
if
(
item
.
productId
==
product
Id
){
if
(
item
.
materialId
==
material
Id
){
inNodeIndex
=
i
;
return
false
;
}
...
...
@@ -372,7 +372,7 @@ layui.config({
function
calculatedTotalPrice
(
proId
,
needNum
){
var
inNodeIndex
=
-
1
;
$
.
each
(
ztreeNode
,
function
(
i
,
item
)
{
if
(
item
.
product
Id
==
proId
){
if
(
item
.
material
Id
==
proId
){
inNodeIndex
=
i
;
return
false
;
}
...
...
@@ -382,7 +382,7 @@ layui.config({
$
(
"
#allPrice
"
+
proId
).
html
(
needNum
*
parseFloat
(
ztreeNode
[
inNodeIndex
].
unitPrice
));
//修改节点信息
var
zTree
=
$
.
fn
.
zTree
.
getZTreeObj
(
"
treeDemo
"
);
var
node
=
zTree
.
getNodeByParam
(
"
product
Id
"
,
proId
);
var
node
=
zTree
.
getNodeByParam
(
"
material
Id
"
,
proId
);
node
.
needNum
=
needNum
;
zTree
.
updateNode
(
node
);
}
...
...
erp/src/main/resources/template/js/material/materialChooseToProduce.js
浏览文件 @
8c0856e7
...
...
@@ -14,7 +14,7 @@ layui.config({
tableCheckBoxUtil
=
layui
.
tableCheckBoxUtil
;
// 选择的多商品列表
productMationList
=
parent
.
product
MationList
;
materialMationList
=
parent
.
material
MationList
;
// 设置提示信息
var
s
=
"
商品选择规则:1.多选;如没有查到要选择的商品,请检查商品信息是否满足当前规则。
"
;
...
...
@@ -30,18 +30,14 @@ layui.config({
function
initTable
(){
var
ids
=
[];
$
.
each
(
productMationList
,
function
(
i
,
item
)
{
ids
.
push
(
item
.
productId
);
});
tableCheckBoxUtil
.
setIds
({
gridId
:
'
messageTable
'
,
fieldName
:
'
materialId
'
,
ids
:
ids
$
.
each
(
materialMationList
,
function
(
i
,
item
)
{
ids
.
push
(
item
.
materialId
);
});
tableCheckBoxUtil
.
init
({
gridId
:
'
messageTable
'
,
filterId
:
'
messageTable
'
,
fieldName
:
'
materialId
'
fieldName
:
'
materialId
'
,
ids
:
ids
});
table
.
render
({
...
...
@@ -67,13 +63,12 @@ layui.config({
str
+=
'
<span class="layui-badge layui-bg-gray">
'
+
item
.
number
+
'
</span>
'
+
item
.
procedureName
+
'
<br>
'
;
});
return
str
;
}},
{
field
:
'
createTime
'
,
title
:
systemLanguage
[
"
com.skyeye.createTime
"
][
languageType
],
align
:
'
center
'
,
width
:
150
}
}}
]],
done
:
function
(
json
,
curr
,
count
)
{
matchingLanguage
();
// 设置选中
tableCheckBoxUtil
.
checkedDefault
({
done
:
function
(
json
,
curr
,
count
)
{
matchingLanguage
();
// 设置选中
tableCheckBoxUtil
.
checkedDefault
({
gridId
:
'
messageTable
'
,
fieldName
:
'
materialId
'
});
...
...
@@ -81,7 +76,7 @@ layui.config({
initTableSearchUtil
.
initAdvancedSearch
(
this
,
json
.
searchFilter
,
form
,
"
请输入商品名称,型号
"
,
function
()
{
table
.
reloadData
(
"
messageTable
"
,
{
page
:
{
curr
:
1
},
where
:
getTableParams
()});
});
}
}
});
form
.
render
();
...
...
@@ -96,51 +91,45 @@ layui.config({
// 下一步
$
(
"
body
"
).
on
(
"
click
"
,
"
#nextTab
"
,
function
()
{
var
selectedData
=
tableCheckBoxUtil
.
getValue
({
var
selectedData
=
tableCheckBoxUtil
.
getValue
List
({
gridId
:
'
messageTable
'
});
if
(
selectedData
.
length
==
0
){
winui
.
window
.
msg
(
"
请选择商品
"
,
{
icon
:
2
,
time
:
2000
});
return
false
;
}
AjaxPostUtil
.
request
({
url
:
flowableBasePath
+
"
material014
"
,
params
:
{
ids
:
selectedData
.
toString
()},
type
:
'
json
'
,
callback
:
function
(
json
)
{
productMationList
=
json
.
rows
;
$step
.
nextStep
();
$
(
"
#firstTab
"
).
hide
();
$
(
"
#secondTab
"
).
show
();
$
(
"
#tBody
"
).
html
(
getDataUseHandlebars
(
$
(
"
#tableBody
"
).
html
(),
{
rows
:
productMationList
}));
//设置商品来源选中
$
.
each
(
productMationList
,
function
(
i
,
item
)
{
$
(
"
#type
"
+
item
.
productId
).
val
(
item
.
typeId
);
});
form
.
render
();
}});
materialMationList
=
[].
concat
(
selectedData
);
$step
.
nextStep
();
$
(
"
#firstTab
"
).
hide
();
$
(
"
#secondTab
"
).
show
();
$
(
"
#tBody
"
).
html
(
getDataUseHandlebars
(
$
(
"
#tableBody
"
).
html
(),
{
rows
:
materialMationList
}));
// 设置商品来源选中
$
.
each
(
materialMationList
,
function
(
i
,
item
)
{
$
(
"
#type
"
+
item
.
materialId
).
val
(
item
.
typeId
);
});
form
.
render
();
});
// 保存
$
(
"
body
"
).
on
(
"
click
"
,
"
#saveChoose
"
,
function
()
{
var
rows
=
$
(
"
#tBody tr
"
);
if
(
rows
.
length
==
0
){
winui
.
window
.
msg
(
"
请选择商品
"
,
{
icon
:
2
,
time
:
2000
});
return
false
;
}
var
proList
=
new
Array
();
$
.
each
(
rows
,
function
(
i
,
item
)
{
var
_object
=
$
(
item
);
var
product
Id
=
_object
.
attr
(
"
rowid
"
);
var
material
Id
=
_object
.
attr
(
"
rowid
"
);
proList
.
push
({
productId
:
product
Id
,
productName
:
$
(
"
#name
"
+
product
Id
).
html
(),
productModel
:
$
(
"
#model
"
+
product
Id
).
html
(),
bomId
:
$
(
"
#bom
"
+
product
Id
).
val
(),
normsId
:
$
(
"
#norms
"
+
product
Id
).
val
(),
unitName
:
$
(
"
#norms
"
+
product
Id
).
find
(
"
option:selected
"
).
text
(),
procedureMationList
:
getProcedureMationList
(
product
Id
),
materialId
:
material
Id
,
materialName
:
$
(
"
#name
"
+
material
Id
).
html
(),
materialModel
:
$
(
"
#model
"
+
material
Id
).
html
(),
bomId
:
$
(
"
#bom
"
+
material
Id
).
val
(),
normsId
:
$
(
"
#norms
"
+
material
Id
).
val
(),
unitName
:
$
(
"
#norms
"
+
material
Id
).
find
(
"
option:selected
"
).
text
(),
procedureMationList
:
getProcedureMationList
(
material
Id
),
pId
:
'
0
'
,
needNum
:
'
1
'
,
unitPrice
:
getNormsPrice
(
productId
,
$
(
"
#norms
"
+
product
Id
).
val
()),
unitPrice
:
getNormsPrice
(
materialId
,
$
(
"
#norms
"
+
material
Id
).
val
()),
wastagePrice
:
'
0.00
'
,
type
:
$
(
"
#type
"
+
product
Id
).
val
(),
type
:
$
(
"
#type
"
+
material
Id
).
val
(),
remark
:
''
,
open
:
'
true
'
,
isParent
:
1
...
...
@@ -150,7 +139,7 @@ layui.config({
proList
:
JSON
.
stringify
(
proList
)
};
AjaxPostUtil
.
request
({
url
:
flowableBasePath
+
"
material015
"
,
params
:
params
,
type
:
'
json
'
,
callback
:
function
(
json
)
{
parent
.
product
MationList
=
[].
concat
(
json
.
rows
);
parent
.
material
MationList
=
[].
concat
(
json
.
rows
);
parent
.
layer
.
close
(
index
);
parent
.
refreshCode
=
'
0
'
;
}});
...
...
@@ -159,16 +148,16 @@ layui.config({
/**
* 获取商品工序
*/
function
getProcedureMationList
(
productId
)
{
function
getProcedureMationList
(
materialId
)
{
var
proIndex
=
-
1
;
$
.
each
(
productMationList
,
function
(
i
,
item
)
{
if
(
productId
==
item
.
productId
)
{
$
.
each
(
materialMationList
,
function
(
i
,
item
)
{
if
(
materialId
==
item
.
materialId
)
{
proIndex
=
i
;
return
false
;
}
});
if
(
proIndex
>=
0
)
{
return
product
MationList
[
proIndex
].
procedureMationList
;
if
(
proIndex
>=
0
)
{
return
material
MationList
[
proIndex
].
procedureMationList
;
}
else
{
return
new
Array
();
}
...
...
@@ -177,13 +166,13 @@ layui.config({
/**
* 获取指定规格的采购价/成本价
*/
function
getNormsPrice
(
product
Id
,
normsId
){
function
getNormsPrice
(
material
Id
,
normsId
){
//项目索引
var
proIndex
=
-
1
;
//规格索引
var
normsIndex
=
-
1
;
$
.
each
(
product
MationList
,
function
(
i
,
item
)
{
if
(
productId
==
item
.
product
Id
){
$
.
each
(
material
MationList
,
function
(
i
,
item
)
{
if
(
materialId
==
item
.
material
Id
){
proIndex
=
i
;
$
.
each
(
item
.
unitList
,
function
(
j
,
bean
){
normsIndex
=
j
;
...
...
@@ -193,7 +182,7 @@ layui.config({
}
});
if
(
proIndex
>=
0
&&
normsIndex
>=
0
){
return
product
MationList
[
proIndex
].
unitList
[
normsIndex
].
estimatePurchasePrice
;
return
material
MationList
[
proIndex
].
unitList
[
normsIndex
].
estimatePurchasePrice
;
}
else
{
return
new
Array
();
}
...
...
erp/src/main/resources/template/tpl/material/materialChooseToProduce.html
浏览文件 @
8c0856e7
...
...
@@ -44,10 +44,10 @@
<div
id=
"secondTab"
style=
"display: none;"
>
<form
class=
"layui-form"
action=
""
id=
"showForm"
autocomplete=
"off"
>
<table
class=
"layui-table"
>
<table
class=
"layui-table"
style=
"margin: 0px 10px;"
>
<thead>
<tr>
<th>
商品名称
</th>
<th
style=
"width: 100px"
>
商品名称
</th>
<th>
型号
</th>
<th>
所属类型
</th>
<th>
商品来源
</th>
...
...
@@ -71,25 +71,25 @@
<script
type=
"text/html"
id=
"tableBody"
>
{{
#
each
rows
}}
<
tr
rowid
=
"
{{
product
Id}}
"
>
<
td
id
=
"
name{{
productId}}
"
>
{{
product
Name
}}
<
/td
>
<
td
id
=
"
model{{
productId}}
"
>
{{
product
Model
}}
<
/td
>
<
tr
rowid
=
"
{{
material
Id}}
"
>
<
td
id
=
"
name{{
materialId}}
"
>
{{
material
Name
}}
<
/td
>
<
td
id
=
"
model{{
materialId}}
"
>
{{
material
Model
}}
<
/td
>
<
td
>
{{
categoryName
}}
<
/td
>
<
td
>
<
select
lay
-
filter
=
"
typeId
"
lay
-
search
=
""
id
=
"
type{{
product
Id}}
"
disabled
>
<
select
lay
-
filter
=
"
typeId
"
lay
-
search
=
""
id
=
"
type{{
material
Id}}
"
disabled
>
<
option
value
=
"
1
"
>
自产
<
/option
>
<
option
value
=
"
2
"
>
外购
<
/option
>
<
/select
>
<
/td
>
<
td
>
<
select
lay
-
filter
=
"
unitListChoose
"
lay
-
search
=
""
id
=
"
norms{{
product
Id}}
"
>
<
select
lay
-
filter
=
"
unitListChoose
"
lay
-
search
=
""
id
=
"
norms{{
material
Id}}
"
>
{{
#
each
unitList
}}
<
option
value
=
"
{{id}}
"
>
{{
name
}}
<
/option
>
{{
/
each
}}
<
/select
>
<
/td
>
<
td
>
<
select
lay
-
filter
=
"
bomListChoose
"
lay
-
search
=
""
id
=
"
bom{{
product
Id}}
"
>
<
select
lay
-
filter
=
"
bomListChoose
"
lay
-
search
=
""
id
=
"
bom{{
material
Id}}
"
>
<
option
value
=
""
>
全部
<
/option
>
{{
#
each
bomList
}}
<
option
value
=
"
{{id}}
"
>
{{
name
}}
<
/option
>
...
...
web/src/main/resources/template/assets/lib/layui/lay/modules/tableCheckBoxUtil/tableCheckBoxUtil.js
浏览文件 @
8c0856e7
//表格分页复选框
layui
.
define
([
'
jquery
'
,
'
table
'
],
function
(
exports
)
{
var
$
=
layui
.
jquery
,
table
=
layui
.
table
;
//记录选中表格记录编号
var
checkedList
=
{};
var
tableCheckBoxUtil
=
{
/*初始化分页设置*/
init
:
function
(
settings
)
{
var
param
=
{
//表格id
gridId
:
''
,
//表格lay-filter值
filterId
:
''
,
//表格主键字段名
fieldName
:
''
};
$
.
extend
(
param
,
settings
);
//设置当前保存数据参数
if
(
checkedList
[
param
.
gridId
]
==
null
)
{
checkedList
[
param
.
gridId
]
=
[];
}
//监听选中行
table
.
on
(
'
checkbox(
'
+
param
.
filterId
+
'
)
'
,
function
(
obj
)
{
var
type
=
obj
.
type
;
var
checked
=
obj
.
checked
;
//当前页数据
var
currentPageData
=
table
.
cache
[
param
.
gridId
];
//当前选中数据
var
checkRowData
=
[];
//当前取消选中的数据
var
cacelCheckedRowData
=
[];
//debugger;
//选中
if
(
checked
)
{
checkRowData
=
table
.
checkStatus
(
param
.
gridId
).
data
;
}
// 取消选中
else
{
if
(
type
==
'
all
'
)
{
cacelCheckedRowData
=
currentPageData
;
}
else
{
cacelCheckedRowData
.
push
(
obj
.
data
);
}
}
//debugger;
//清除数据
$
.
each
(
cacelCheckedRowData
,
function
(
index
,
item
)
{
var
itemValue
=
item
[
param
.
fieldName
];
checkedList
[
param
.
gridId
]
=
checkedList
[
param
.
gridId
].
filter
(
function
(
fItem
,
fIndex
)
{
return
fItem
!=
itemValue
;
})
});
//添加选中数据
$
.
each
(
checkRowData
,
function
(
index
,
item
)
{
var
itemValue
=
item
[
param
.
fieldName
];
if
(
checkedList
[
param
.
gridId
].
indexOf
(
itemValue
)
<
0
)
{
checkedList
[
param
.
gridId
].
push
(
itemValue
);
}
});
});
},
//设置页面默认选中(在表格加载完成之后调用)
checkedDefault
:
function
(
settings
)
{
var
param
=
{
//表格id
gridId
:
''
,
//表格主键字段名
fieldName
:
''
};
$
.
extend
(
param
,
settings
);
//当前页数据
var
currentPageData
=
table
.
cache
[
param
.
gridId
];
if
(
checkedList
[
param
.
gridId
]
!=
null
&&
checkedList
[
param
.
gridId
].
length
>
0
)
{
$
.
each
(
currentPageData
,
function
(
index
,
item
)
{
var
itemValue
=
item
[
param
.
fieldName
];
if
(
checkedList
[
param
.
gridId
].
indexOf
(
itemValue
)
>=
0
)
{
//设置选中状态
item
.
LAY_CHECKED
=
true
;
var
rowIndex
=
item
[
'
LAY_TABLE_INDEX
'
];
updateRowCheckStatus
(
param
.
gridId
,
'
tr[data-index=
'
+
rowIndex
+
'
] input[type="checkbox"]
'
);
}
});
}
//判断当前页是否全选
var
currentPageCheckedAll
=
table
.
checkStatus
(
param
.
gridId
).
isAll
;
if
(
currentPageCheckedAll
)
{
updateRowCheckStatus
(
param
.
gridId
,
'
thead tr input[type="checkbox"]
'
);
}
},
//获取当前获取的所有集合值
getValue
:
function
(
settings
)
{
var
param
=
{
//表格id
gridId
:
''
};
$
.
extend
(
param
,
settings
);
return
checkedList
[
param
.
gridId
];
},
//设置选中的id(一般在编辑时候调用初始化选中值)
setIds
:
function
(
settings
)
{
var
param
=
{
gridId
:
''
,
//数据集合
ids
:
[]
};
$
.
extend
(
param
,
settings
);
checkedList
[
param
.
gridId
]
=
[];
$
.
each
(
param
.
ids
,
function
(
index
,
item
)
{
checkedList
[
param
.
gridId
].
push
(
item
);
});
}
};
var
updateRowCheckStatus
=
function
(
gridId
,
ele
)
{
var
layTableView
=
$
(
'
.layui-table-view
'
);
//一个页面多个表格,这里防止更新表格错误
$
.
each
(
layTableView
,
function
(
index
,
item
)
{
if
(
$
(
item
).
attr
(
'
lay-id
'
)
==
gridId
)
{
$
(
item
).
find
(
ele
).
prop
(
'
checked
'
,
true
);
$
(
item
).
find
(
ele
).
next
().
addClass
(
'
layui-form-checked
'
);
}
});
}
//输出
exports
(
'
tableCheckBoxUtil
'
,
tableCheckBoxUtil
);
layui
.
define
([
'
jquery
'
,
'
table
'
],
function
(
exports
)
{
var
$
=
layui
.
jquery
,
table
=
layui
.
table
;
//记录选中表格记录编号
var
checkedList
=
{};
var
checkedDataMap
=
{};
var
tableCheckBoxUtil
=
{
init
:
function
(
settings
)
{
var
param
=
{
// 表格id
gridId
:
''
,
// 表格lay-filter值
filterId
:
''
,
// 表格主键字段名
fieldName
:
''
,
// 默认回显的数据
ids
:
[]
};
$
.
extend
(
param
,
settings
);
// 设置当前保存数据参数
if
(
checkedList
[
param
.
gridId
]
==
null
)
{
checkedList
[
param
.
gridId
]
=
[];
}
if
(
checkedDataMap
[
param
.
gridId
]
==
null
)
{
checkedDataMap
[
param
.
gridId
]
=
[];
}
if
(
!
isNull
(
param
.
ids
)
&&
param
.
ids
.
length
>
0
)
{
this
.
setIds
(
settings
);
}
// 监听选中行
table
.
on
(
'
checkbox(
'
+
param
.
filterId
+
'
)
'
,
function
(
obj
)
{
var
type
=
obj
.
type
;
var
checked
=
obj
.
checked
;
// 当前页数据
var
currentPageData
=
table
.
cache
[
param
.
gridId
];
// 当前选中数据
var
checkRowData
=
[];
// 当前取消选中的数据
var
cacelCheckedRowData
=
[];
if
(
checked
)
{
// 选中
checkRowData
=
table
.
checkStatus
(
param
.
gridId
).
data
;
}
else
{
// 取消选中
if
(
type
==
'
all
'
)
{
cacelCheckedRowData
=
currentPageData
;
}
else
{
cacelCheckedRowData
.
push
(
obj
.
data
);
}
}
// 清除数据
$
.
each
(
cacelCheckedRowData
,
function
(
index
,
item
)
{
var
itemValue
=
item
[
param
.
fieldName
];
checkedList
[
param
.
gridId
]
=
checkedList
[
param
.
gridId
].
filter
(
function
(
fItem
,
fIndex
)
{
return
fItem
!=
itemValue
;
});
checkedDataMap
[
param
.
gridId
]
=
checkedDataMap
[
param
.
gridId
].
filter
(
function
(
fItem
,
fIndex
)
{
return
fItem
[
param
.
fieldName
]
!=
itemValue
;
})
});
// 添加选中数据
$
.
each
(
checkRowData
,
function
(
index
,
item
)
{
var
itemValue
=
item
[
param
.
fieldName
];
if
(
checkedList
[
param
.
gridId
].
indexOf
(
itemValue
)
<
0
)
{
checkedList
[
param
.
gridId
].
push
(
itemValue
);
checkedDataMap
[
param
.
gridId
].
push
(
item
);
}
});
});
},
//设置页面默认选中(在表格加载完成之后调用)
checkedDefault
:
function
(
settings
)
{
var
param
=
{
//表格id
gridId
:
''
,
//表格主键字段名
fieldName
:
''
};
$
.
extend
(
param
,
settings
);
// 当前页数据
var
currentPageData
=
table
.
cache
[
param
.
gridId
];
if
(
checkedList
[
param
.
gridId
]
!=
null
&&
checkedList
[
param
.
gridId
].
length
>
0
)
{
$
.
each
(
currentPageData
,
function
(
index
,
item
)
{
var
itemValue
=
item
[
param
.
fieldName
];
if
(
checkedList
[
param
.
gridId
].
indexOf
(
itemValue
)
>=
0
)
{
//设置选中状态
item
.
LAY_CHECKED
=
true
;
var
rowIndex
=
item
[
'
LAY_TABLE_INDEX
'
];
updateRowCheckStatus
(
param
.
gridId
,
'
tr[data-index=
'
+
rowIndex
+
'
] input[type="checkbox"]
'
);
var
tmpBean
=
getInPoingArr
(
checkedDataMap
[
param
.
gridId
],
param
.
fieldName
,
itemValue
);
if
(
tmpBean
==
null
)
{
checkedDataMap
[
param
.
gridId
].
push
(
item
);
}
}
});
}
//判断当前页是否全选
var
currentPageCheckedAll
=
table
.
checkStatus
(
param
.
gridId
).
isAll
;
if
(
currentPageCheckedAll
)
{
updateRowCheckStatus
(
param
.
gridId
,
'
thead tr input[type="checkbox"]
'
);
}
},
//获取当前获取的所有集合值
getValue
:
function
(
settings
)
{
var
param
=
{
//表格id
gridId
:
''
};
$
.
extend
(
param
,
settings
);
return
checkedList
[
param
.
gridId
];
},
// 获取当前选中的数据
getValueList
:
function
(
settings
)
{
var
param
=
{
//表格id
gridId
:
''
};
$
.
extend
(
param
,
settings
);
return
checkedDataMap
[
param
.
gridId
];
},
//设置选中的id(一般在编辑时候调用初始化选中值)
setIds
:
function
(
settings
)
{
var
param
=
{
gridId
:
''
,
//数据集合
ids
:
[]
};
$
.
extend
(
param
,
settings
);
checkedList
[
param
.
gridId
]
=
[];
$
.
each
(
param
.
ids
,
function
(
index
,
item
)
{
checkedList
[
param
.
gridId
].
push
(
item
);
});
}
};
var
updateRowCheckStatus
=
function
(
gridId
,
ele
)
{
var
layTableView
=
$
(
'
.layui-table-view
'
);
// 一个页面多个表格,这里防止更新表格错误
$
.
each
(
layTableView
,
function
(
index
,
item
)
{
if
(
$
(
item
).
attr
(
'
lay-id
'
)
==
gridId
)
{
$
(
item
).
find
(
ele
).
prop
(
'
checked
'
,
true
);
$
(
item
).
find
(
ele
).
next
().
addClass
(
'
layui-form-checked
'
);
}
});
}
//输出
exports
(
'
tableCheckBoxUtil
'
,
tableCheckBoxUtil
);
});
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录