Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
冷月半明
Skyeye
提交
6139b93d
S
Skyeye
项目概览
冷月半明
/
Skyeye
与 Fork 源项目一致
Fork自
doc_wei / Skyeye
通知
1
Star
1
Fork
0
代码
文件
提交
分支
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
6139b93d
编写于
10月 23, 2022
作者:
doc_wei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ERP商品详情修改
上级
36539bf6
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
384 addition
and
222 deletion
+384
-222
erp/src/main/resources/template/js/material/materialDetails.js
...rc/main/resources/template/js/material/materialDetails.js
+49
-27
erp/src/main/resources/template/tpl/material/materialDetails.html
...main/resources/template/tpl/material/materialDetails.html
+85
-126
erp/src/main/resources/template/tpl/material/materialDetailsTemplate.tpl
...sources/template/tpl/material/materialDetailsTemplate.tpl
+0
-66
web/src/main/resources/template/assets/lib/layui/customer/systemCommonUtil.js
...es/template/assets/lib/layui/customer/systemCommonUtil.js
+6
-0
web/src/main/resources/template/assets/lib/layui/lay/modules/skuTable/skuTable.js
...emplate/assets/lib/layui/lay/modules/skuTable/skuTable.js
+244
-3
未找到文件。
erp/src/main/resources/template/js/material/materialDetails.js
浏览文件 @
6139b93d
...
...
@@ -6,46 +6,68 @@ layui.config({
version
:
skyeyeVersion
}).
extend
({
window
:
'
js/winui.window
'
}).
define
([
'
window
'
,
'
table
'
,
'
jquery
'
,
'
winui
'
],
function
(
exports
)
{
}).
define
([
'
window
'
,
'
table
'
,
'
jquery
'
,
'
winui
'
,
'
skuTable
'
],
function
(
exports
)
{
winui
.
renderColor
();
layui
.
use
([
'
form
'
],
function
(
form
)
{
var
index
=
parent
.
layer
.
getFrameIndex
(
window
.
name
);
var
$
=
layui
.
$
;
var
simpleTemplate
=
$
(
"
#simpleTemplate
"
).
html
();
var
manyTemplate
=
$
(
"
#manyTemplate
"
).
html
();
var
extendsTemplate
=
$
(
"
#extendsTemplate
"
).
html
();
var
$
=
layui
.
$
,
skuTable
=
layui
.
skuTable
;
showGrid
({
id
:
"
showForm
"
,
url
:
flowableBasePath
+
"
material007
"
,
params
:
{
id
:
parent
.
rowId
},
pagination
:
false
,
method
:
'
GET
'
,
template
:
getFileContent
(
'
tpl/material/materialDetailsTemplate.tpl
'
),
template
:
$
(
"
#beanTemplate
"
).
html
(),
ajaxSendLoadBefore
:
function
(
hdb
,
json
)
{
json
.
bean
.
enabled
=
systemCommonUtil
.
getEnumDataNameByClassName
(
'
commonEnable
'
,
'
id
'
,
json
.
bean
.
enabled
,
'
name
'
);
json
.
bean
.
fromType
=
systemCommonUtil
.
getEnumDataNameByClassName
(
'
materialFromType
'
,
'
id
'
,
json
.
bean
.
fromType
,
'
name
'
);
json
.
bean
.
type
=
systemCommonUtil
.
getEnumDataNameByClassName
(
'
materialType
'
,
'
id
'
,
json
.
bean
.
type
,
'
name
'
);
},
ajaxSendAfter
:
function
(
json
)
{
if
(
json
.
bean
.
unit
==
'
1
'
)
{
//非多单位
var
item
=
json
.
bean
.
norms
[
0
];
item
.
unitName
=
json
.
bean
.
unitName
;
$
(
"
#showForm
"
).
append
(
getDataUseHandlebars
(
simpleTemplate
,
item
));
var
str
=
""
;
$
.
each
(
json
.
bean
.
norms
[
0
].
normStock
,
function
(
i
,
item
)
{
str
+=
'
<span class="layui-badge layui-bg-blue" style="height: 25px !important; line-height: 25px !important; margin: 5px 0px;">
'
+
item
.
depotName
+
'
<span class="layui-badge layui-bg-gray">
'
+
item
.
stock
+
'
</span></span><br>
'
;
});
$
(
"
#initialTock
"
).
html
(
str
);
}
else
{
//多单位
var
item
=
new
Array
();
item
.
unitGroupName
=
json
.
bean
.
unitGroupName
;
item
.
firstInUnit
=
json
.
bean
.
firstInUnit
;
item
.
firstOutUnit
=
json
.
bean
.
firstOutUnit
;
item
.
norms
=
json
.
bean
.
norms
;
$
(
"
#showForm
"
).
append
(
getDataUseHandlebars
(
manyTemplate
,
item
));
}
var
skuData
=
{};
$
.
each
(
json
.
bean
.
norms
,
function
(
index
,
item
)
{
skuData
[
item
.
tableNum
]
=
item
;
});
var
enableData
=
systemCommonUtil
.
getEnumDataListByClassName
(
"
commonEnable
"
);
skuTable
.
render
({
boxId
:
'
skuTableBox
'
,
specTableElemId
:
'
fairy-spec-table
'
,
skuTableElemId
:
'
fairy-sku-table
'
,
// 是否开启sku表行合并
rowspan
:
true
,
edit
:
false
,
// 多规格SKU表配置
multipleSkuTableConfig
:
{
thead
:
[
{
title
:
'
图片
'
,
icon
:
''
},
{
title
:
'
安全库存
'
,
icon
:
'
layui-icon-cols
'
},
{
title
:
'
初始库存
'
,
width
:
'
150px
'
},
{
title
:
'
零售价(元)
'
,
icon
:
'
layui-icon-cols
'
},
{
title
:
'
最低售价(元)
'
,
icon
:
'
layui-icon-cols
'
},
{
title
:
'
采购价/成本价(元)
'
,
icon
:
'
layui-icon-cols
'
},
{
title
:
'
销售价(元)
'
,
icon
:
'
layui-icon-cols
'
},
{
title
:
'
状态
'
,
icon
:
''
},
],
tbody
:
[
{
type
:
'
image
'
,
field
:
'
logo
'
,
value
:
''
,
verify
:
'
required
'
,
reqtext
:
''
},
{
type
:
'
input
'
,
field
:
'
safetyTock
'
,
value
:
'
0
'
,
verify
:
'
required|number
'
},
{
type
:
'
btn
'
,
field
:
'
normsStock
'
},
{
type
:
'
input
'
,
field
:
'
retailPrice
'
,
value
:
'
0
'
,
verify
:
'
required|money
'
},
{
type
:
'
input
'
,
field
:
'
lowPrice
'
,
value
:
'
0
'
,
verify
:
'
required|money
'
},
{
type
:
'
input
'
,
field
:
'
estimatePurchasePrice
'
,
value
:
'
0
'
,
verify
:
'
required|money
'
},
{
type
:
'
input
'
,
field
:
'
salePrice
'
,
value
:
'
0
'
,
verify
:
'
required|money
'
},
{
type
:
'
select
'
,
field
:
'
enable
'
,
option
:
enableData
.
rows
},
]
},
specData
:
JSON
.
parse
(
json
.
bean
.
normsSpec
),
skuData
:
skuData
,
otherMationData
:
json
.
bean
});
// 附件回显
skyeyeEnclosure
.
showDetails
({
"
enclosureUploadBtn
"
:
json
.
bean
.
enclosureInfo
});
$
(
"
#showForm
"
).
append
(
getDataUseHandlebars
(
extendsTemplate
,
{
'
extends
'
:
json
.
bean
.
extends
}));
matchingLanguage
();
form
.
render
();
}
...
...
erp/src/main/resources/template/tpl/material/materialDetails.html
浏览文件 @
6139b93d
...
...
@@ -11,134 +11,93 @@
<form
class=
"layui-form"
action=
""
id=
"showForm"
>
</form>
<script
type=
"text/x-handlebars-template"
id=
"simpleTemplate"
>
<
div
class
=
"
layui-form-item layui-col-xs12
"
>
<
label
class
=
"
layui-form-label
"
>
当前存量
:
<
/label
>
<
div
class
=
"
layui-input-block ver-center
"
>
<
a
class
=
"
notice-title-click
"
rowid
=
"
{{id}}
"
>
{{
allStock
}}
<
/a
>
<
/div
>
<
/div
>
<
div
class
=
"
layui-form-item layui-col-xs6
"
>
<
label
class
=
"
layui-form-label
"
>
安全存量
:
<
/label
>
<
div
class
=
"
layui-input-block ver-center
"
>
{{
safetyTock
}}
<
/div
>
<
/div
>
<
div
class
=
"
layui-form-item layui-col-xs6
"
>
<
label
class
=
"
layui-form-label
"
>
初始库存
:
<
/label
>
<
div
class
=
"
layui-input-block
"
id
=
"
initialTock
"
>
<
/div
>
<
/div
>
<
div
class
=
"
layui-form-item layui-col-xs6
"
>
<
label
class
=
"
layui-form-label
"
>
单位
:
<
/label
>
<
div
class
=
"
layui-input-block ver-center
"
>
{{
unitName
}}
<
/div
>
<
/div
>
<
div
class
=
"
layui-form-item layui-col-xs6
"
>
<
label
class
=
"
layui-form-label
"
>
零售价
:
<
/label
>
<
div
class
=
"
layui-input-block ver-center
"
>
{{
retailPrice
}}
<
/div
>
<
/div
>
<
div
class
=
"
layui-form-item layui-col-xs6
"
>
<
label
class
=
"
layui-form-label
"
>
最低售价
:
<
/label
>
<
div
class
=
"
layui-input-block ver-center
"
>
{{
lowPrice
}}
<
/div
>
<
/div
>
<
div
class
=
"
layui-form-item layui-col-xs6
"
>
<
label
class
=
"
layui-form-label
"
>
采购价
/
成本价
:
<
/label
>
<
div
class
=
"
layui-input-block ver-center
"
>
{{
estimatePurchasePrice
}}
<
/div
>
<
/div
>
<
div
class
=
"
layui-form-item layui-col-xs6
"
>
<
label
class
=
"
layui-form-label
"
>
销售价
:
<
/label
>
<
div
class
=
"
layui-input-block ver-center
"
>
{{
salePrice
}}
<
/div
>
<
/div
>
</script>
<script
type=
"text/x-handlebars-template"
id=
"manyTemplate"
>
<
div
class
=
"
layui-form-item layui-col-xs12
"
>
<
label
class
=
"
layui-form-label
"
>
单位
:
<
/label
>
<
div
class
=
"
layui-input-block ver-center
"
>
{{
unitGroupName
}}
<
/div
>
<
/div
>
<
div
class
=
"
layui-form-item layui-col-xs6
"
>
<
label
class
=
"
layui-form-label
"
>
首选入库单位
:
<
/label
>
<
div
class
=
"
layui-input-block ver-center
"
>
{{
firstInUnit
}}
<
/div
>
<
/div
>
<
div
class
=
"
layui-form-item layui-col-xs6
"
>
<
label
class
=
"
layui-form-label
"
>
首选出库单位
:
<
/label
>
<
div
class
=
"
layui-input-block ver-center
"
>
{{
firstOutUnit
}}
<
/div
>
<
/div
>
<
div
class
=
"
layui-form-item layui-col-xs12
"
>
<
label
class
=
"
layui-form-label
"
>
价格表
:
<
/label
>
<
div
class
=
"
layui-input-block ver-center
"
>
<
table
class
=
"
layui-table
"
>
<
thead
>
<
tr
>
<
th
style
=
"
width: 60px;
"
>
单位类型
<
/th
>
<
th
style
=
"
width: 60px;
"
>
计量单位
<
/th
>
<
th
style
=
"
width: 80px;
"
>
安全存量
<
/th
>
<
th
style
=
"
width: 150px;
"
>
初始库存
<
/th
>
<
th
>
当前存量
<
/th
>
<
th
>
零售价
<
/th
>
<
th
>
最低售价
<
/th
>
<
th
>
采购价
/
成本价
<
/th
>
<
th
>
销售价
<
/th
>
<
/tr
>
<
/thead
>
<
tbody
id
=
"
useTable
"
class
=
"
insurance-table
"
>
{{
#
each
norms
}}
<
tr
>
<
td
>
{{
baseUnit
}}
<
/td
>
<
td
>
{{
unitName
}}
<
/td
>
<
td
>
{{
safetyTock
}}
<
/td
>
<
td
>
{{
#
each
normStock
}}
<
span
class
=
"
layui-badge layui-bg-blue
"
style
=
"
height: 25px !important; line-height: 25px !important; margin: 5px 0px;
"
>
{{
depotName
}}
<
span
class
=
"
layui-badge layui-bg-gray
"
>
{{
stock
}}
<
/span></
span
><
br
>
{{
/
each
}}
<
/td
>
<
td
><
a
class
=
"
notice-title-click
"
rowid
=
"
{{id}}
"
>
{{
allStock
}}
<
/a></
td
>
<
td
>
{{
retailPrice
}}
<
/td
>
<
td
>
{{
lowPrice
}}
<
/td
>
<
td
>
{{
estimatePurchasePrice
}}
<
/td
>
<
td
>
{{
salePrice
}}
<
/td
>
<
/tr
>
{{
/
each
}}
<
/tbody
>
<
/table
>
<
/div
>
<
/div
>
</script>
<script
type=
"text/x-handlebars-template"
id=
"extendsTemplate"
>
<
div
class
=
"
layui-form-item layui-col-xs12
"
>
<
span
class
=
"
hr-title
"
>
扩展信息
<
/span><hr
>
<
/div
>
{{
#
each
extends
}}
<
div
class
=
"
layui-form-item layui-col-xs6 extendMation
"
>
<
label
class
=
"
layui-form-label
"
>
<
font
>
{{
lableName
}}
:
<
/font
>
<
/label
>
<
div
class
=
"
layui-input-block ver-center
"
>
{{
content
}}
<
/div
>
</div>
<script
type=
"text/x-handlebars-template"
id=
"beanTemplate"
>
{{
#
bean
}}
<
div
class
=
"
layui-form-item layui-col-xs12
"
>
<
span
class
=
"
hr-title
"
>
基础信息
<
/span><hr
>
<
/div
>
<
div
class
=
"
layui-form-item layui-col-xs6
"
>
<
label
class
=
"
layui-form-label
"
>
商品名称
:
<
/label
>
<
div
class
=
"
layui-input-block ver-center
"
>
{{
materialName
}}
<
/div
>
<
/div
>
<
div
class
=
"
layui-form-item layui-col-xs6
"
>
<
label
class
=
"
layui-form-label
"
>
型号
:
<
/label
>
<
div
class
=
"
layui-input-block ver-center
"
>
{{
model
}}
<
/div
>
<
/div
>
<
div
class
=
"
layui-form-item layui-col-xs6
"
>
<
label
class
=
"
layui-form-label
"
>
所属类型
:
<
/label
>
<
div
class
=
"
layui-input-block ver-center
"
>
{{
categoryName
}}
<
/div
>
<
/div
>
<
div
class
=
"
layui-form-item layui-col-xs6
"
>
<
label
class
=
"
layui-form-label
"
>
状态
:
<
/label
>
<
div
class
=
"
layui-input-block ver-center
"
>
{{
enabled
}}
<
/div
>
<
/div
>
<
div
class
=
"
layui-form-item layui-col-xs6
"
>
<
label
class
=
"
layui-form-label
"
>
商品来源
:
<
/label
>
<
div
class
=
"
layui-input-block ver-center
"
>
{{
fromType
}}
<
/div
>
<
/div
>
<
div
class
=
"
layui-form-item layui-col-xs6
"
>
<
label
class
=
"
layui-form-label
"
>
商品类型
:
<
/label
>
<
div
class
=
"
layui-input-block ver-center
"
>
{{
type
}}
<
/div
>
<
/div
>
<
div
class
=
"
layui-form-item layui-col-xs6
"
>
<
label
class
=
"
layui-form-label
"
>
工序资料
:
<
/label
>
<
div
class
=
"
layui-input-block ver-center
"
id
=
"
procedureShowBox
"
>
{{
#
each
procedureMationList
}}
<
span
class
=
"
layui-badge layui-bg-blue
"
style
=
"
height: 25px !important; line-height: 25px !important; margin: 5px 0px;
"
>
{{
procedureName
}}
<
span
class
=
"
layui-badge layui-bg-gray
"
>
{{
number
}}
<
/span
>
<
/span
>
<
br
>
{{
/
each
}}
<
/div
>
<
/div
>
<
div
class
=
"
layui-form-item layui-col-xs12
"
>
<
label
class
=
"
layui-form-label
"
>
备注
:
<
/label
>
<
div
class
=
"
layui-input-block ver-center
"
>
{{
remark
}}
<
/div
>
<
/div
>
<
div
class
=
"
layui-form-item layui-col-xs6
"
>
<
label
class
=
"
layui-form-label
"
>
附件资料
:
<
/label
>
<
div
class
=
"
layui-input-block ver-center
"
id
=
"
enclosureUploadBtn
"
>
<
/div
>
<
/div
>
<
div
class
=
"
layui-form-item layui-col-xs12
"
>
<
span
class
=
"
hr-title
"
>
规格信息
<
/span><hr
>
<
/div
>
<
div
class
=
"
layui-form-item layui-col-xs12
"
id
=
"
skuTableBox
"
>
<
/div
>
<
div
class
=
"
layui-form-item layui-col-xs12
"
>
<
span
class
=
"
hr-title
"
>
扩展信息
<
/span><hr
>
<
/div
>
{{
#
each
extends
}}
<
div
class
=
"
layui-form-item layui-col-xs6 extendMation
"
>
<
label
class
=
"
layui-form-label
"
>
<
font
>
{{
lableName
}}
:
<
/font
>
<
/label
>
<
div
class
=
"
layui-input-block ver-center
"
>
{{
content
}}
<
/div
>
<
/div
>
{{
/
each
}}
</script>
</div>
{{
/
bean
}}
</script>
<script
src=
"../../assets/lib/layui/layui.js"
></script>
<script
src=
"../../assets/lib/layui/custom.js"
></script>
<script
type=
"text/javascript"
>
...
...
erp/src/main/resources/template/tpl/material/materialDetailsTemplate.tpl
已删除
100644 → 0
浏览文件 @
36539bf6
{{
#
bean
}}
<div
class=
"layui-form-item layui-col-xs12"
>
<span
class=
"hr-title"
>
基础信息
</span><hr>
</div>
<div
class=
"layui-form-item layui-col-xs6"
>
<label
class=
"layui-form-label"
>
商品名称:
</label>
<div
class=
"layui-input-block ver-center"
>
{
{
materialName
}
}
</div>
</div>
<div
class=
"layui-form-item layui-col-xs6"
>
<label
class=
"layui-form-label"
>
型号:
</label>
<div
class=
"layui-input-block ver-center"
>
{
{
model
}
}
</div>
</div>
<div
class=
"layui-form-item layui-col-xs6"
>
<label
class=
"layui-form-label"
>
所属类型:
</label>
<div
class=
"layui-input-block ver-center"
>
{
{
categoryName
}
}
</div>
</div>
<div
class=
"layui-form-item layui-col-xs6"
>
<label
class=
"layui-form-label"
>
状态:
</label>
<div
class=
"layui-input-block ver-center"
>
{
{
enabled
}
}
</div>
</div>
<div
class=
"layui-form-item layui-col-xs6"
>
<label
class=
"layui-form-label"
>
商品来源:
</label>
<div
class=
"layui-input-block ver-center"
>
{
{
typeName
}
}
</div>
</div>
<div
class=
"layui-form-item layui-col-xs6"
>
<label
class=
"layui-form-label"
>
工序资料:
</label>
<div
class=
"layui-input-block ver-center"
id=
"procedureShowBox"
>
{
{
#
each
procedureMationList
}
}
<span
class=
"layui-badge layui-bg-blue"
style=
"height: 25px !important; line-height: 25px !important; margin: 5px 0px;"
>
{
{
procedureName
}
}
<span
class=
"layui-badge layui-bg-gray"
>
{
{
number
}
}
</span>
</span>
<br>
{
{/
each
}
}
</div>
</div>
<div
class=
"layui-form-item layui-col-xs12"
>
<label
class=
"layui-form-label"
>
备注:
</label>
<div
class=
"layui-input-block ver-center"
>
{
{
remark
}
}
</div>
</div>
<div
class=
"layui-form-item layui-col-xs6"
>
<label
class=
"layui-form-label"
>
附件资料:
</label>
<div
class=
"layui-input-block ver-center"
id=
"enclosureUploadBtn"
>
</div>
</div>
<div
class=
"layui-form-item layui-col-xs12"
>
<span
class=
"hr-title"
>
规格信息
</span><hr>
</div>
<div
class=
"layui-form-item layui-col-xs12"
>
<label
class=
"layui-form-label"
>
规格类型:
</label>
<div
class=
"layui-input-block ver-center"
>
{
{
unitType
}
}
</div>
</div>
{
{/
bean
}
}
\ No newline at end of file
web/src/main/resources/template/assets/lib/layui/customer/systemCommonUtil.js
浏览文件 @
6139b93d
...
...
@@ -670,6 +670,12 @@ var systemCommonUtil = {
}
},
getEnumDataNameByClassName
:
function
(
code
,
key
,
value
,
getKey
)
{
var
json
=
systemCommonUtil
.
getEnumDataListByClassName
(
code
);
var
result
=
getInPoingArr
(
json
.
rows
,
key
,
value
,
getKey
);
return
isNull
(
result
)
?
''
:
result
;
},
getEnumDataListByClassName
:
function
(
code
)
{
var
params
=
{
className
:
encodeURIComponent
(
skyeyeClassEnum
[
code
][
"
className
"
])
...
...
web/src/main/resources/template/assets/lib/layui/lay/modules/skuTable/skuTable.js
浏览文件 @
6139b93d
...
...
@@ -114,6 +114,7 @@ layui.define(['jquery', 'form', 'upload', 'layer', 'sortable'], function (export
},
]
},
edit
:
true
,
rowspan
:
false
,
skuIcon
:
'
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMDY3IDc5LjE1Nzc0NywgMjAxNS8wMy8zMC0yMzo0MDo0MiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjczN0RFNzU1MTk1RTExRTlBMEQ5OEEwMEM5NDNFOEE4IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjczN0RFNzU2MTk1RTExRTlBMEQ5OEEwMEM5NDNFOEE4Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6NzM3REU3NTMxOTVFMTFFOUEwRDk4QTAwQzk0M0U4QTgiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NzM3REU3NTQxOTVFMTFFOUEwRDk4QTAwQzk0M0U4QTgiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5NHmJUAAAA+0lEQVR42pySPwsBYRzH7zk3KIP34CVIKSOrELLJdpuymyzew90kIwMZvACDsCldWZTFn5WQpPN5rlPXlXJ39en7/J57fn+fR9i2rYT5NNM0B2gC3n/6qHBQDMOwZNYg4LOQ3vcQld40/w6lC13Xbd/eHElC3G1JqL4DFWSNprz7BMpAFJ6YkW+jThaosuxAD/rY6R9lCmeq8IAmtKBA1A1OW9YjtIS9QvPYRZkcXo43EzqjF/mDQ5an7ALShTFk4eQOsgFTWeoNKl4nt68J0oYc1LHLbmtDp1IyLgPe4QCuMkIsyAWSuYbs5HD29DML8OTkHR9F2Ef+EWAAdwmkvBAtw94AAAAASUVORK5CYII=
'
,
specData
:
[],
...
...
@@ -127,10 +128,13 @@ layui.define(['jquery', 'form', 'upload', 'layer', 'sortable'], function (export
this
.
data
.
specData
=
isNull
(
this
.
options
.
specData
)
?
[]
:
this
.
options
.
specData
;
this
.
data
.
skuData
=
isNull
(
this
.
options
.
skuData
)
?
{}
:
this
.
options
.
skuData
;
this
.
data
.
otherMationData
=
isNull
(
this
.
options
.
otherMationData
)
?
{}
:
this
.
options
.
otherMationData
;
// 编辑到时候在这里做分支
this
.
css
();
this
.
render
();
this
.
listen
();
if
(
this
.
options
.
edit
)
{
this
.
render
();
this
.
listen
();
}
else
{
this
.
renderDetails
();
}
}
css
()
{
...
...
@@ -195,6 +199,50 @@ layui.define(['jquery', 'form', 'upload', 'layer', 'sortable'], function (export
}
}
}
renderDetails
()
{
var
that
=
this
;
var
_html
=
`<div id="
${
this
.
options
.
otherElemId
}
">`
+
`<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">规格类型:</label>
<div class="layui-input-block ver-center">
${
that
.
data
.
otherMationData
.
unitType
}
</div>
</div>`
+
`</div>`
+
`<div id="
${
this
.
options
.
otherMationElemId
}
"></div>`
+
`<div id="
${
this
.
options
.
specTableElemId
}
"></div>`
+
`<div id="
${
this
.
options
.
skuTableElemId
}
"></div>`
;
$
(
`#
${
that
.
options
.
boxId
}
`
).
html
(
_html
);
form
.
render
();
if
(
that
.
data
.
otherMationData
.
unit
==
1
)
{
// 单规格
$
(
`#
${
this
.
options
.
specTableElemId
}
`
).
html
(
that
.
loadSimpleSkuConfigDetails
());
}
else
{
// 多规格
var
str
=
`<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">计量单位:</label>
<div class="layui-input-block ver-center">
${
that
.
data
.
otherMationData
.
unitGroupName
}
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">首选入库单位:</label>
<div class="layui-input-block ver-center">
${
that
.
data
.
otherMationData
.
firstInUnitName
}
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">首选出库单位:</label>
<div class="layui-input-block ver-center">
${
that
.
data
.
otherMationData
.
firstOutUnitName
}
</div>
</div>`
;
$
(
`#
${
this
.
options
.
otherMationElemId
}
`
).
html
(
str
);
that
.
renderMultipleSkuTableDetails
();
}
that
.
picShow
();
}
// 初始化html界面
initHtml
()
{
...
...
@@ -405,7 +453,10 @@ layui.define(['jquery', 'form', 'upload', 'layer', 'sortable'], function (export
});
}
});
that
.
picShow
();
}
picShow
()
{
/**
* 图片移入放大/移出恢复
*/
...
...
@@ -816,6 +867,196 @@ layui.define(['jquery', 'form', 'upload', 'layer', 'sortable'], function (export
return
div
;
}
/**
* 渲染sku表
*/
renderMultipleSkuTableDetails
()
{
var
tableId
=
this
.
options
.
skuTableElemId
+
'
-id
'
;
var
that
=
this
,
table
=
`<table class="layui-table" id="
${
tableId
}
">`
;
var
prependThead
=
[],
prependTbody
=
[];
// 加载计量单位作为其中的一个规格
AjaxPostUtil
.
request
({
url
:
flowableBasePath
+
"
materialunit006
"
,
params
:
{},
type
:
'
json
'
,
method
:
"
POST
"
,
callback
:
function
(
json
)
{
var
prependTbodyItem
=
[];
$
.
each
(
json
.
rows
,
function
(
i
,
item
)
{
if
(
item
.
id
==
that
.
data
.
otherMationData
.
unitGroupId
)
{
$
.
each
(
item
.
unitList
,
function
(
j
,
bean
)
{
prependTbodyItem
.
push
({
rowNum
:
bean
.
id
,
title
:
bean
.
name
});
});
return
false
;
}
});
prependThead
.
push
(
'
计量单位
'
);
prependTbody
.
push
(
prependTbodyItem
);
},
async
:
false
});
$
.
each
(
that
.
data
.
specData
,
function
(
index
,
item
)
{
var
isShow
=
item
.
options
.
some
(
function
(
option
,
index
,
array
)
{
return
item
.
value
.
includes
(
option
.
rowNum
);
});
if
(
isShow
)
{
prependThead
.
push
(
item
.
title
);
var
prependTbodyItem
=
[];
$
.
each
(
item
.
options
,
function
(
key
,
option
)
{
if
(
item
.
value
.
includes
(
option
.
rowNum
))
{
prependTbodyItem
.
push
({
rowNum
:
option
.
rowNum
,
title
:
option
.
title
});
}
});
prependTbody
.
push
(
prependTbodyItem
);
}
});
table
+=
'
<colgroup>
'
+
'
<col width="70">
'
.
repeat
(
prependThead
.
length
+
1
)
+
'
</colgroup>
'
;
table
+=
'
<thead>
'
;
var
theadTr
=
'
<tr>
'
;
theadTr
+=
prependThead
.
map
(
function
(
t
,
i
,
a
)
{
return
'
<th class="fairy-spec-name">
'
+
t
+
'
</th>
'
;
}).
join
(
''
);
this
.
options
.
multipleSkuTableConfig
.
thead
.
forEach
(
function
(
item
)
{
if
(
isNull
(
item
.
width
))
{
theadTr
+=
'
<th>
'
+
item
.
title
+
(
item
.
icon
?
'
<i class="layui-icon
'
+
item
.
icon
+
'
"></i>
'
:
''
)
+
'
</th>
'
;
}
else
{
theadTr
+=
'
<th style="width:
'
+
item
.
width
+
'
">
'
+
item
.
title
+
'
</th>
'
;
}
});
theadTr
+=
'
</tr>
'
;
table
+=
theadTr
;
table
+=
'
</thead>
'
;
if
(
this
.
options
.
rowspan
)
{
var
skuRowspanArr
=
[];
prependTbody
.
forEach
(
function
(
v
,
i
,
a
)
{
var
num
=
1
,
index
=
i
;
while
(
index
<
a
.
length
-
1
)
{
num
*=
a
[
index
+
1
].
length
;
index
++
;
}
skuRowspanArr
.
push
(
num
);
});
}
var
prependTbodyTrs
=
[];
prependTbody
.
reduce
(
function
(
prev
,
cur
,
index
,
array
)
{
var
tmp
=
[];
prev
.
forEach
(
function
(
a
)
{
cur
.
forEach
(
function
(
b
)
{
tmp
.
push
({
rowNum
:
a
.
rowNum
+
that
.
options
.
skuNameDelimiter
+
b
.
rowNum
,
title
:
a
.
title
+
that
.
options
.
skuNameDelimiter
+
b
.
title
});
});
});
return
tmp
;
}).
forEach
(
function
(
item
,
index
,
array
)
{
var
tr
=
`<tr id="
${
item
.
rowNum
}
" row="
${
index
}
">`
;
tr
+=
item
.
title
.
split
(
that
.
options
.
skuNameDelimiter
).
map
(
function
(
t
,
i
,
a
)
{
if
(
that
.
options
.
rowspan
)
{
if
(
index
%
skuRowspanArr
[
i
]
===
0
&&
skuRowspanArr
[
i
]
>
1
)
{
return
'
<td class="fairy-spec-value" rowspan="
'
+
skuRowspanArr
[
i
]
+
'
">
'
+
t
+
'
</td>
'
;
}
else
if
(
skuRowspanArr
[
i
]
===
1
)
{
return
'
<td class="fairy-spec-value">
'
+
t
+
'
</td>
'
;
}
else
{
return
''
;
}
}
else
{
return
'
<td>
'
+
t
+
'
</td>
'
;
}
}).
join
(
''
);
tr
+=
that
.
loadMultipleSkuTableConfigDetail
(
item
,
index
);
tr
+=
'
</tr>
'
;
prependTbodyTrs
.
push
(
tr
);
});
table
+=
'
<tbody>
'
;
if
(
prependTbodyTrs
.
length
>
0
)
{
table
+=
prependTbodyTrs
.
join
(
''
);
}
table
+=
'
</tbody>
'
;
table
+=
'
</table>
'
;
this
.
renderFormItem
(
'
商品库存
'
,
table
,
this
.
options
.
skuTableElemId
);
form
.
render
();
}
loadMultipleSkuTableConfigDetail
(
item
,
index
)
{
var
that
=
this
;
var
tr
=
''
;
that
.
options
.
multipleSkuTableConfig
.
tbody
.
forEach
(
function
(
c
)
{
var
key
=
item
.
rowNum
;
var
type
=
c
.
field
;
var
value
=
(
!
isNull
(
key
)
&&
!
isNull
(
that
.
data
.
skuData
[
key
]))
?
that
.
data
.
skuData
[
key
][
type
]
:
c
.
value
;
tr
+=
'
<td>
'
;
switch
(
c
.
type
)
{
case
"
image
"
:
value
=
isNull
(
value
)
?
''
:
value
;
tr
+=
'
<img class="fairy-sku-img skyeye-img" src="
'
+
value
+
'
">
'
;
break
;
case
"
select
"
:
c
.
option
.
forEach
(
function
(
o
)
{
if
(
!
isNull
(
value
)
&&
o
.
id
==
value
)
{
tr
+=
o
.
name
;
}
});
break
;
case
"
btn
"
:
value
=
isNull
(
value
)
?
[]
:
JSON
.
parse
(
value
);
$
.
each
(
value
,
function
(
i
,
item
)
{
tr
+=
'
<span class="layui-badge layui-bg-blue" style="height: 25px !important; line-height: 25px !important; margin: 5px 0px;">
'
+
item
.
depotName
+
'
【
'
+
item
.
stock
+
'
】</span><br>
'
;
});
break
;
case
"
input
"
:
default
:
tr
+=
value
;
break
;
}
tr
+=
'
</td>
'
;
});
return
tr
;
}
loadSimpleSkuConfigDetails
()
{
var
that
=
this
;
var
div
=
`<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">计量单位:</label>
<div class="layui-input-block ver-center">
${
that
.
data
.
otherMationData
.
unitName
}
</div>
</div>`
;
that
.
options
.
multipleSkuTableConfig
.
tbody
.
forEach
(
function
(
item
,
index
)
{
var
type
=
item
.
field
;
var
value
=
(
!
isNull
(
that
.
data
.
skuData
[
"
simpleNorms
"
]))
?
that
.
data
.
skuData
[
"
simpleNorms
"
][
type
]
:
item
.
value
;
var
id
=
item
.
field
;
var
title
=
that
.
options
.
multipleSkuTableConfig
.
thead
[
index
].
title
;
div
+=
`<div class="layui-form-item layui-col-xs6">`
+
`<label class="layui-form-label">
${
title
}
:</label>`
+
`<div class="layui-input-block ver-center">`
;
switch
(
item
.
type
)
{
case
"
image
"
:
value
=
isNull
(
value
)
?
''
:
value
;
div
+=
'
<img class="fairy-sku-img skyeye-img" src="
'
+
value
+
'
">
'
;
break
;
case
"
select
"
:
item
.
option
.
forEach
(
function
(
o
)
{
if
(
!
isNull
(
value
)
&&
o
.
id
==
value
)
{
div
+=
o
.
name
;
}
});
break
;
case
"
btn
"
:
value
=
isNull
(
value
)
?
[]
:
JSON
.
parse
(
value
);
$
.
each
(
value
,
function
(
i
,
item
)
{
div
+=
'
<span class="layui-badge layui-bg-blue" style="height: 25px !important; line-height: 25px !important; margin: 5px 0px;">
'
+
item
.
depotName
+
'
【
'
+
item
.
stock
+
'
】</span><br>
'
;
});
break
;
case
"
input
"
:
default
:
div
+=
value
;
break
;
}
div
+=
'
</div></div>
'
;
});
return
div
;
}
getFormSkuData
()
{
var
skuData
=
{};
var
that
=
this
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录