Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
冷月半明
Skyeye
提交
6ac83484
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,发现更多精彩内容 >>
提交
6ac83484
编写于
12月 20, 2022
作者:
doc_wei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
用品领用申请整改,主动注册到业务对象管理中
上级
98e09657
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
297 addition
and
617 deletion
+297
-617
admin-assistant/src/main/resources/template/js/assetArticlesUse/assetArticlesUseAdd.js
...urces/template/js/assetArticlesUse/assetArticlesUseAdd.js
+92
-169
admin-assistant/src/main/resources/template/js/assetArticlesUse/assetArticlesUseDetails.js
...s/template/js/assetArticlesUse/assetArticlesUseDetails.js
+11
-14
admin-assistant/src/main/resources/template/js/assetArticlesUse/assetArticlesUseEdit.js
...rces/template/js/assetArticlesUse/assetArticlesUseEdit.js
+118
-243
admin-assistant/src/main/resources/template/js/assetArticlesUse/assetArticlesUseList.js
...rces/template/js/assetArticlesUse/assetArticlesUseList.js
+38
-57
admin-assistant/src/main/resources/template/tpl/assetArticlesUse/assetArticlesUseAdd.html
...es/template/tpl/assetArticlesUse/assetArticlesUseAdd.html
+4
-37
admin-assistant/src/main/resources/template/tpl/assetArticlesUse/assetArticlesUseDetails.html
...emplate/tpl/assetArticlesUse/assetArticlesUseDetails.html
+5
-5
admin-assistant/src/main/resources/template/tpl/assetArticlesUse/assetArticlesUseEdit.html
...s/template/tpl/assetArticlesUse/assetArticlesUseEdit.html
+6
-40
admin-assistant/src/main/resources/template/tpl/assetArticlesUse/assetArticlesUseList.html
...s/template/tpl/assetArticlesUse/assetArticlesUseList.html
+23
-52
未找到文件。
admin-assistant/src/main/resources/template/js/assetArticlesUse/assetArticlesUseAdd.js
浏览文件 @
6ac83484
...
...
@@ -13,74 +13,95 @@ layui.config({
var
$
=
layui
.
$
,
form
=
layui
.
form
;
var
serviceClassName
=
sysServiceMation
[
"
assetArticlesUse
"
][
"
key
"
];
var
rowNum
=
1
;
//表格的序号
var
typeHtml
=
""
;
var
usetableTemplate
=
$
(
"
#usetableTemplate
"
).
html
();
var
selOption
=
getFileContent
(
'
tpl/template/select-option.tpl
'
);
skyeyeEnclosure
.
init
(
'
enclosureUpload
'
);
// 获取当前登录员工信息
systemCommonUtil
.
getSysCurrentLoginUserMation
(
function
(
data
)
{
$
(
"
#
useT
itle
"
).
html
(
"
用品领用申请单-
"
+
getYMDFormatDate
()
+
'
-
'
+
data
.
bean
.
userName
);
$
(
"
#
t
itle
"
).
html
(
"
用品领用申请单-
"
+
getYMDFormatDate
()
+
'
-
'
+
data
.
bean
.
userName
);
$
(
"
#useName
"
).
html
(
data
.
bean
.
userName
);
initTypeHtml
();
});
function
initTypeHtml
()
{
// 用品类别
sysDictDataUtil
.
queryDictDataListByDictTypeCode
(
sysDictData
[
"
admAssetArticlesType
"
][
"
key
"
],
function
(
data
)
{
typeHtml
=
getDataUseHandlebars
(
selOption
,
data
);
});
// 用品类别
sysDictDataUtil
.
queryDictDataListByDictTypeCode
(
sysDictData
[
"
admAssetArticlesType
"
][
"
key
"
],
function
(
data
)
{
typeHtml
=
getDataUseHandlebars
(
selOption
,
data
);
});
matchingLanguage
();
//渲染
form
.
render
();
//类型加载变化事件
form
.
on
(
'
select(selectTypeProperty)
'
,
function
(
data
)
{
var
thisRowNum
=
data
.
elem
.
id
.
replace
(
"
typeId
"
,
""
);
var
thisRowValue
=
data
.
value
;
if
(
!
isNull
(
thisRowValue
)
&&
thisRowValue
!=
'
请选择
'
)
{
if
(
inPointArray
(
thisRowValue
,
assetArticles
))
{
//类型对应的用品存在js对象中
var
list
=
getListPointArray
(
thisRowValue
,
assetArticles
);
resetAssetList
(
thisRowNum
,
list
);
//重置选择行的用品列表
}
else
{
//类型对应的用品不存在js对象中
AjaxPostUtil
.
request
({
url
:
flowableBasePath
+
"
assetarticles018
"
,
params
:
{
typeId
:
thisRowValue
},
type
:
'
json
'
,
method
:
'
GET
'
,
callback
:
function
(
json
)
{
assetArticles
.
push
({
id
:
thisRowValue
,
list
:
json
.
rows
});
resetAssetList
(
thisRowNum
,
json
.
rows
);
//重置选择行的用品列表
}});
}
}
});
initTableChooseUtil
.
initTable
({
id
:
"
articlesList
"
,
cols
:
[
{
id
:
'
typeId
'
,
title
:
'
类别
'
,
formType
:
'
select
'
,
width
:
'
150
'
,
verify
:
'
required
'
,
layFilter
:
'
selectTypeProperty
'
,
modelHtml
:
typeHtml
},
{
id
:
'
articleId
'
,
title
:
'
用品
'
,
formType
:
'
select
'
,
width
:
'
150
'
,
verify
:
'
required
'
,
layFilter
:
'
selectAssetarProperty
'
},
{
id
:
'
specifications
'
,
title
:
'
规格(单位)
'
,
formType
:
'
detail
'
,
width
:
'
80
'
},
{
id
:
'
residualNum
'
,
title
:
'
库存
'
,
formType
:
'
detail
'
,
width
:
'
80
'
},
{
id
:
'
applyUseNum
'
,
title
:
'
领用数量
'
,
formType
:
'
input
'
,
width
:
'
80
'
,
verify
:
'
required|number
'
,
value
:
'
1
'
},
{
id
:
'
remark
'
,
title
:
'
备注
'
,
formType
:
'
input
'
,
width
:
'
100
'
}
],
deleteRowCallback
:
function
(
trcusid
)
{
},
addRowCallback
:
function
(
trcusid
)
{
},
form
:
form
,
minData
:
1
});
//商品加载变化事件
form
.
on
(
'
select(selectAssetarProperty)
'
,
function
(
data
)
{
var
thisRowNum
=
data
.
elem
.
id
.
replace
(
"
assetarId
"
,
""
);
var
thisRowValue
=
data
.
value
;
var
thisRowTypeChooseId
=
$
(
"
#typeId
"
+
thisRowNum
).
val
();
if
(
!
isNull
(
thisRowValue
)
&&
thisRowValue
!=
'
请选择
'
)
{
var
list
=
getListPointArray
(
thisRowTypeChooseId
,
assetArticles
);
$
.
each
(
list
,
function
(
i
,
item
)
{
if
(
item
.
id
===
thisRowValue
)
{
$
(
"
#specificationsName
"
+
thisRowNum
).
html
(
item
.
specificationsName
);
$
(
"
#residualNum
"
+
thisRowNum
).
html
(
item
.
residualNum
);
return
false
;
}
});
matchingLanguage
();
form
.
render
();
// 类型加载变化事件
form
.
on
(
'
select(selectTypeProperty)
'
,
function
(
data
)
{
var
thisRowNum
=
data
.
elem
.
id
.
replace
(
"
typeId
"
,
""
);
var
thisRowValue
=
data
.
value
;
if
(
!
isNull
(
thisRowValue
)
&&
thisRowValue
!=
'
请选择
'
)
{
if
(
judgeInPoingArr
(
assetArticles
,
'
id
'
,
thisRowValue
))
{
// 类型对应的用品存在js对象中
var
list
=
getInPoingArr
(
assetArticles
,
'
id
'
,
thisRowValue
,
'
list
'
);
resetAssetList
(
thisRowNum
,
list
);
//重置选择行的用品列表
}
else
{
$
(
"
#specificationsName
"
+
thisRowNum
).
html
(
""
);
//重置规格为空
$
(
"
#residualNum
"
+
thisRowNum
).
html
(
""
);
//重置库存为空
// 类型对应的用品不存在js对象中
AjaxPostUtil
.
request
({
url
:
flowableBasePath
+
"
assetarticles018
"
,
params
:
{
typeId
:
thisRowValue
},
type
:
'
json
'
,
method
:
'
GET
'
,
callback
:
function
(
json
)
{
assetArticles
.
push
({
id
:
thisRowValue
,
list
:
json
.
rows
});
resetAssetList
(
thisRowNum
,
json
.
rows
);
}});
}
}
});
// 根据类型重置用户列表
function
resetAssetList
(
thisRowNum
,
list
)
{
var
sHtml
=
getDataUseHandlebars
(
selOption
,
{
rows
:
list
});
// 初始化一行数据
addRow
();
$
(
"
#articleId
"
+
thisRowNum
).
html
(
sHtml
);
$
(
"
#specifications
"
+
thisRowNum
).
html
(
""
);
$
(
"
#residualNum
"
+
thisRowNum
).
html
(
""
);
form
.
render
(
'
select
'
);
}
// 商品加载变化事件
form
.
on
(
'
select(selectAssetarProperty)
'
,
function
(
data
)
{
var
thisRowNum
=
data
.
elem
.
id
.
replace
(
"
articleId
"
,
""
);
var
thisRowValue
=
data
.
value
;
var
thisRowTypeChooseId
=
$
(
"
#typeId
"
+
thisRowNum
).
val
();
if
(
!
isNull
(
thisRowValue
)
&&
thisRowValue
!=
'
请选择
'
)
{
var
list
=
getInPoingArr
(
assetArticles
,
'
id
'
,
thisRowTypeChooseId
,
'
list
'
);
$
.
each
(
list
,
function
(
i
,
item
)
{
if
(
item
.
id
===
thisRowValue
)
{
$
(
"
#specifications
"
+
thisRowNum
).
html
(
item
.
specificationsName
);
$
(
"
#residualNum
"
+
thisRowNum
).
html
(
item
.
residualNum
);
return
false
;
}
});
}
else
{
$
(
"
#specifications
"
+
thisRowNum
).
html
(
""
);
$
(
"
#residualNum
"
+
thisRowNum
).
html
(
""
);
}
});
// 保存为草稿
form
.
on
(
'
submit(formAddBean)
'
,
function
(
data
)
{
if
(
winui
.
verifyForm
(
data
.
elem
))
{
...
...
@@ -100,54 +121,45 @@ layui.config({
});
function
saveData
(
subType
,
approvalId
)
{
// 获取已选用品数据
var
rowTr
=
$
(
"
#useTable tr
"
);
if
(
rowTr
.
length
==
0
)
{
winui
.
window
.
msg
(
'
请选择需要领用的用品~
'
,
{
icon
:
2
,
time
:
2000
});
var
result
=
initTableChooseUtil
.
getDataList
(
'
articlesList
'
);
if
(
!
result
.
checkResult
)
{
return
false
;
}
var
tableData
=
new
Array
();
var
noError
=
false
;
//循环遍历表格数据时,是否有其他错误信息
$
.
each
(
rowTr
,
function
(
i
,
item
)
{
var
rowNum
=
$
(
item
).
attr
(
"
trcusid
"
).
replace
(
"
tr
"
,
""
);
var
residualNum
=
parseInt
(
$
(
"
#residualNum
"
+
rowNum
).
html
());
if
(
parseInt
(
$
(
"
#useNum
"
+
rowNum
).
val
())
==
0
)
{
$
(
"
#useNum
"
+
rowNum
).
addClass
(
"
layui-form-danger
"
);
$
(
"
#useNum
"
+
rowNum
).
focus
();
var
noError
=
false
;
var
tableData
=
[];
$
.
each
(
result
.
dataList
,
function
(
i
,
item
)
{
var
rowNum
=
item
[
"
trcusid
"
].
replace
(
"
tr
"
,
""
);
if
(
parseInt
(
item
.
applyUseNum
)
==
0
)
{
$
(
"
#applyUseNum
"
+
rowNum
).
addClass
(
"
layui-form-danger
"
);
$
(
"
#applyUseNum
"
+
rowNum
).
focus
();
winui
.
window
.
msg
(
'
领用数量不能为0
'
,
{
icon
:
2
,
time
:
2000
});
noError
=
true
;
return
false
;
}
if
(
parseInt
(
$
(
"
#useNum
"
+
rowNum
).
val
())
>
residualNum
)
{
$
(
"
#
u
seNum
"
+
rowNum
).
addClass
(
"
layui-form-danger
"
);
$
(
"
#
u
seNum
"
+
rowNum
).
focus
();
if
(
parseInt
(
item
.
applyUseNum
)
>
parseInt
(
item
.
residualNum
)
)
{
$
(
"
#
applyU
seNum
"
+
rowNum
).
addClass
(
"
layui-form-danger
"
);
$
(
"
#
applyU
seNum
"
+
rowNum
).
focus
();
winui
.
window
.
msg
(
'
领用数量不能超过库存数量
'
,
{
icon
:
2
,
time
:
2000
});
noError
=
true
;
return
false
;
}
if
(
inTableDataArrayByAssetarId
(
$
(
"
#assetarId
"
+
rowNum
).
val
(),
tableData
))
{
if
(
judgeInPoingArr
(
tableData
,
'
articleId
'
,
$
(
"
#assetarId
"
+
rowNum
).
val
()))
{
winui
.
window
.
msg
(
'
领用单存在相同的用品
'
,
{
icon
:
2
,
time
:
2000
});
noError
=
true
;
return
false
;
}
var
row
=
{
typeId
:
$
(
"
#typeId
"
+
rowNum
).
val
(),
assetarId
:
$
(
"
#assetarId
"
+
rowNum
).
val
(),
useNum
:
$
(
"
#useNum
"
+
rowNum
).
val
(),
remark
:
$
(
"
#remark
"
+
rowNum
).
val
()
};
tableData
.
push
(
row
);
tableData
.
push
(
item
);
});
if
(
noError
)
{
if
(
noError
)
{
return
false
;
}
var
params
=
{
title
:
$
(
"
#
useT
itle
"
).
html
(),
title
:
$
(
"
#
t
itle
"
).
html
(),
remark
:
$
(
"
#remark
"
).
val
(),
assetArticles
Str
:
JSON
.
stringify
(
tableData
),
enclosureInfo
:
skyeyeEnclosure
.
getEnclosureIdsByBoxId
(
'
enclosureUpload
'
),
subType
:
subType
,
// 表单类型 1.保存草稿 2.提交审批
assetArticles
:
JSON
.
stringify
(
tableData
),
enclosureInfo
:
JSON
.
stringify
({
enclosureInfo
:
skyeyeEnclosure
.
getEnclosureIdsByBoxId
(
'
enclosureUpload
'
)}
),
formSubType
:
subType
,
approvalId
:
approvalId
};
AjaxPostUtil
.
request
({
url
:
flowableBasePath
+
"
writeAssetArticlesApplyUse
"
,
params
:
params
,
type
:
'
json
'
,
method
:
"
POST
"
,
callback
:
function
(
json
)
{
...
...
@@ -156,95 +168,6 @@ layui.config({
}});
}
//判断选中的用品是否也在数组中
function
inTableDataArrayByAssetarId
(
str
,
array
)
{
var
isIn
=
false
;
$
.
each
(
array
,
function
(
i
,
item
)
{
if
(
item
.
assetarId
===
str
)
{
isIn
=
true
;
return
false
;
}
});
return
isIn
;
}
//新增行
$
(
"
body
"
).
on
(
"
click
"
,
"
#addRow
"
,
function
()
{
addRow
();
});
//删除行
$
(
"
body
"
).
on
(
"
click
"
,
"
#deleteRow
"
,
function
()
{
deleteRow
();
});
//新增行
function
addRow
()
{
var
par
=
{
id
:
"
row
"
+
rowNum
.
toString
(),
//checkbox的id
trId
:
"
tr
"
+
rowNum
.
toString
(),
//行的id
typeId
:
"
typeId
"
+
rowNum
.
toString
(),
//类型id
assetarId
:
"
assetarId
"
+
rowNum
.
toString
(),
//用品id
specificationsName
:
"
specificationsName
"
+
rowNum
.
toString
(),
//规格id
residualNum
:
"
residualNum
"
+
rowNum
.
toString
(),
//库存id
useNum
:
"
useNum
"
+
rowNum
.
toString
(),
//领用数量id
remark
:
"
remark
"
+
rowNum
.
toString
()
//备注id
};
$
(
"
#useTable
"
).
append
(
getDataUseHandlebars
(
usetableTemplate
,
par
));
//赋值给用品类别
$
(
"
#
"
+
"
typeId
"
+
rowNum
.
toString
()).
html
(
typeHtml
);
form
.
render
(
'
select
'
);
form
.
render
(
'
checkbox
'
);
rowNum
++
;
}
//删除行
function
deleteRow
()
{
var
checkRow
=
$
(
"
#useTable input[type='checkbox'][name='tableCheckRow']:checked
"
);
if
(
checkRow
.
length
>
0
)
{
$
.
each
(
checkRow
,
function
(
i
,
item
)
{
$
(
item
).
parent
().
parent
().
remove
();
});
}
else
{
winui
.
window
.
msg
(
'
请选择要删除的行
'
,
{
icon
:
2
,
time
:
2000
});
}
}
//根据类型重置用户列表
function
resetAssetList
(
thisRowNum
,
list
)
{
var
sHtml
=
getDataUseHandlebars
(
selOption
,
{
rows
:
list
});
$
(
"
#assetarId
"
+
thisRowNum
).
html
(
sHtml
);
//重置商品列表下拉框
$
(
"
#specificationsName
"
+
thisRowNum
).
html
(
""
);
//重置规格为空
$
(
"
#residualNum
"
+
thisRowNum
).
html
(
""
);
//重置库存为空
form
.
render
(
'
select
'
);
}
//判断是否在数组中
function
inPointArray
(
str
,
array
)
{
var
isIn
=
false
;
$
.
each
(
array
,
function
(
i
,
item
)
{
if
(
item
.
id
===
str
)
{
isIn
=
true
;
return
false
;
}
});
return
isIn
;
}
//获取指定key对应的集合
function
getListPointArray
(
str
,
array
)
{
var
isList
=
[];
$
.
each
(
array
,
function
(
i
,
item
)
{
if
(
item
.
id
===
str
)
{
$
.
extend
(
true
,
isList
,
item
.
list
);
return
false
;
}
});
return
isList
;
}
$
(
"
body
"
).
on
(
"
click
"
,
"
#cancle
"
,
function
()
{
parent
.
layer
.
close
(
index
);
});
...
...
admin-assistant/src/main/resources/template/js/assetArticlesUse/assetArticlesUseDetails.js
浏览文件 @
6ac83484
...
...
@@ -4,21 +4,18 @@ layui.config({
version
:
skyeyeVersion
}).
extend
({
window
:
'
js/winui.window
'
}).
define
([
'
window
'
,
'
jquery
'
,
'
winui
'
],
function
(
exports
)
{
}).
define
([
'
window
'
,
'
jquery
'
,
'
winui
'
,
'
form
'
],
function
(
exports
)
{
winui
.
renderColor
();
layui
.
use
([
'
form
'
],
function
(
form
)
{
var
index
=
parent
.
layer
.
getFrameIndex
(
window
.
name
);
var
$
=
layui
.
$
;
AjaxPostUtil
.
request
({
url
:
flowableBasePath
+
"
assetarticles020
"
,
params
:
{
rowId
:
parent
.
rowId
},
type
:
'
json
'
,
callback
:
function
(
json
)
{
json
.
bean
.
stateName
=
activitiUtil
.
showStateName2
(
json
.
bean
.
state
,
1
);
var
index
=
parent
.
layer
.
getFrameIndex
(
window
.
name
);
var
$
=
layui
.
$
,
form
=
layui
.
form
;
$
(
"
#showForm
"
).
html
(
getDataUseHandlebars
(
$
(
"
#useTemplate
"
).
html
(),
json
));
AjaxPostUtil
.
request
({
url
:
flowableBasePath
+
"
queryAssetArticlesApplyUseById
"
,
params
:
{
id
:
parent
.
rowId
},
type
:
'
json
'
,
method
:
'
GET
'
,
callback
:
function
(
json
)
{
$
(
"
#showForm
"
).
html
(
getDataUseHandlebars
(
$
(
"
#useTemplate
"
).
html
(),
json
));
// 附件回显
skyeyeEnclosure
.
showDetails
({
"
enclosureUploadBtn
"
:
json
.
bean
.
enclosureInfo
});
matchingLanguage
();
}});
});
// 附件回显
skyeyeEnclosure
.
showDetails
({
"
enclosureUploadBtn
"
:
json
.
bean
.
enclosureInfo
});
matchingLanguage
();
form
.
render
();
}});
});
\ No newline at end of file
admin-assistant/src/main/resources/template/js/assetArticlesUse/assetArticlesUseEdit.js
浏览文件 @
6ac83484
...
...
@@ -13,90 +13,125 @@ layui.config({
var
$
=
layui
.
$
,
form
=
layui
.
form
;
var
serviceClassName
=
sysServiceMation
[
"
assetArticlesUse
"
][
"
key
"
];
var
rowNum
=
1
;
//表格的序号
var
typeHtml
=
""
;
var
usetableTemplate
=
$
(
"
#usetableTemplate
"
).
html
();
var
selOption
=
getFileContent
(
'
tpl/template/select-option.tpl
'
);
var
sTableData
=
""
;
AjaxPostUtil
.
request
({
url
:
flowableBasePath
+
"
assetarticles021
"
,
params
:
{
rowId
:
parent
.
rowId
},
type
:
'
json
'
,
method
:
"
POST
"
,
callback
:
function
(
json
)
{
$
(
"
#useTitle
"
).
html
(
json
.
bean
.
title
);
$
(
"
#useName
"
).
html
(
json
.
bean
.
userName
);
AjaxPostUtil
.
request
({
url
:
flowableBasePath
+
"
queryAssetArticlesApplyUseById
"
,
params
:
{
id
:
parent
.
rowId
},
type
:
'
json
'
,
method
:
"
GET
"
,
callback
:
function
(
json
)
{
$
(
"
#title
"
).
html
(
json
.
bean
.
title
);
$
(
"
#useName
"
).
html
(
json
.
bean
.
createName
);
$
(
"
#remark
"
).
val
(
json
.
bean
.
remark
);
// 附件回显
skyeyeEnclosure
.
initTypeISData
({
'
enclosureUpload
'
:
json
.
bean
.
enclosureInfo
});
if
(
json
.
bean
.
state
==
'
1
'
){
$
(
"
.typeTwo
"
).
removeClass
(
"
layui-hide
"
);
}
else
{
$
(
"
.typeOne
"
).
removeClass
(
"
layui-hide
"
);
}
sTableData
=
json
.
bean
.
goods
;
initTypeHtml
();
matchingLanguage
();
}});
function
initTypeHtml
()
{
// 用品类别
sysDictDataUtil
.
queryDictDataListByDictTypeCode
(
sysDictData
[
"
admAssetArticlesType
"
][
"
key
"
],
function
(
data
)
{
typeHtml
=
getDataUseHandlebars
(
selOption
,
data
);
});
initTable
();
initTableChooseUtil
.
deleteAllRow
(
'
articlesList
'
);
$
.
each
(
json
.
bean
.
assetArticles
,
function
(
i
,
item
)
{
var
list
=
findArticlesByTypeId
(
item
.
assetArticles
.
typeId
);
var
params
=
{
"
typeId
"
:
{
"
value
"
:
item
.
assetArticles
.
typeId
},
"
articleId
"
:
{
"
html
"
:
getDataUseHandlebars
(
selOption
,
{
rows
:
list
}),
"
value
"
:
item
.
articleId
},
"
specifications
"
:
item
.
assetArticles
.
specifications
,
"
residualNum
"
:
item
.
assetArticles
.
residualNum
,
"
applyUseNum
"
:
item
.
applyUseNum
,
"
remark
"
:
item
.
remark
};
initTableChooseUtil
.
resetData
(
'
articlesList
'
,
params
);
});
matchingLanguage
();
form
.
render
();
//类型加载变化事件
form
.
on
(
'
select(selectTypeProperty)
'
,
function
(
data
)
{
var
thisRowNum
=
data
.
elem
.
id
.
replace
(
"
typeId
"
,
""
);
var
thisRowValue
=
data
.
value
;
if
(
!
isNull
(
thisRowValue
)
&&
thisRowValue
!=
'
请选择
'
)
{
if
(
inPointArray
(
thisRowValue
,
assetArticles
))
{
//类型对应的用品存在js对象中
var
list
=
getListPointArray
(
thisRowValue
,
assetArticles
);
resetAssetList
(
thisRowNum
,
list
);
//重置选择行的用品列表
}
else
{
//类型对应的用品不存在js对象中
AjaxPostUtil
.
request
({
url
:
flowableBasePath
+
"
assetarticles018
"
,
params
:
{
typeId
:
thisRowValue
},
type
:
'
json
'
,
method
:
'
GET
'
,
callback
:
function
(
json
)
{
assetArticles
.
push
({
id
:
thisRowValue
,
list
:
json
.
rows
});
resetAssetList
(
thisRowNum
,
json
.
rows
);
//重置选择行的用品列表
}});
}
}
}});
function
initTable
()
{
initTableChooseUtil
.
initTable
({
id
:
"
articlesList
"
,
cols
:
[
{
id
:
'
typeId
'
,
title
:
'
类别
'
,
formType
:
'
select
'
,
width
:
'
150
'
,
verify
:
'
required
'
,
layFilter
:
'
selectTypeProperty
'
,
modelHtml
:
typeHtml
},
{
id
:
'
articleId
'
,
title
:
'
用品
'
,
formType
:
'
select
'
,
width
:
'
150
'
,
verify
:
'
required
'
,
layFilter
:
'
selectAssetarProperty
'
},
{
id
:
'
specifications
'
,
title
:
'
规格(单位)
'
,
formType
:
'
detail
'
,
width
:
'
80
'
},
{
id
:
'
residualNum
'
,
title
:
'
库存
'
,
formType
:
'
detail
'
,
width
:
'
80
'
},
{
id
:
'
applyUseNum
'
,
title
:
'
领用数量
'
,
formType
:
'
input
'
,
width
:
'
80
'
,
verify
:
'
required|number
'
,
value
:
'
1
'
},
{
id
:
'
remark
'
,
title
:
'
备注
'
,
formType
:
'
input
'
,
width
:
'
100
'
}
],
deleteRowCallback
:
function
(
trcusid
)
{
},
addRowCallback
:
function
(
trcusid
)
{
},
form
:
form
,
minData
:
1
});
}
//商品加载变化事件
form
.
on
(
'
select(selectAssetarProperty)
'
,
function
(
data
)
{
var
thisRowNum
=
data
.
elem
.
id
.
replace
(
"
assetarId
"
,
""
);
var
thisRowValue
=
data
.
value
;
var
thisRowTypeChooseId
=
$
(
"
#typeId
"
+
thisRowNum
).
val
();
if
(
!
isNull
(
thisRowValue
)
&&
thisRowValue
!=
'
请选择
'
)
{
var
list
=
getListPointArray
(
thisRowTypeChooseId
,
assetArticles
);
$
.
each
(
list
,
function
(
i
,
item
)
{
if
(
item
.
id
===
thisRowValue
)
{
$
(
"
#specificationsName
"
+
thisRowNum
).
html
(
item
.
specificationsName
);
$
(
"
#residualNum
"
+
thisRowNum
).
html
(
item
.
residualNum
);
return
false
;
}
// 类型加载变化事件
form
.
on
(
'
select(selectTypeProperty)
'
,
function
(
data
)
{
var
thisRowNum
=
data
.
elem
.
id
.
replace
(
"
typeId
"
,
""
);
var
thisRowValue
=
data
.
value
;
if
(
!
isNull
(
thisRowValue
)
&&
thisRowValue
!=
'
请选择
'
)
{
var
list
=
findArticlesByTypeId
(
thisRowValue
);
resetAssetList
(
thisRowNum
,
list
);
}
});
function
findArticlesByTypeId
(
typeId
)
{
var
list
;
if
(
judgeInPoingArr
(
assetArticles
,
'
id
'
,
typeId
))
{
// 类型对应的用品存在js对象中
list
=
getInPoingArr
(
assetArticles
,
'
id
'
,
typeId
,
'
list
'
);
}
else
{
// 类型对应的用品不存在js对象中
AjaxPostUtil
.
request
({
url
:
flowableBasePath
+
"
assetarticles018
"
,
params
:
{
typeId
:
typeId
},
type
:
'
json
'
,
method
:
'
GET
'
,
callback
:
function
(
json
)
{
assetArticles
.
push
({
id
:
typeId
,
list
:
json
.
rows
});
}
else
{
$
(
"
#specificationsName
"
+
thisRowNum
).
html
(
""
);
//重置规格为空
$
(
"
#residualNum
"
+
thisRowNum
).
html
(
""
);
//重置库存为空
}
});
//加载表格数据
initTableAssetList
();
list
=
json
.
rows
;
},
async
:
false
});
}
return
list
;
}
//
加载表格数据
function
initTableAssetList
(
)
{
$
.
each
(
sTableData
,
function
(
i
,
item
)
{
addDataRow
(
item
);
//
根据类型重置用户列表
function
resetAssetList
(
thisRowNum
,
list
)
{
var
sHtml
=
getDataUseHandlebars
(
selOption
,
{
rows
:
list
});
$
(
"
#articleId
"
+
thisRowNum
).
html
(
sHtml
);
$
(
"
#specifications
"
+
thisRowNum
).
html
(
""
);
$
(
"
#residualNum
"
+
thisRowNum
).
html
(
""
);
form
.
render
(
'
select
'
);
}
// 商品加载变化事件
form
.
on
(
'
select(selectAssetarProperty)
'
,
function
(
data
)
{
var
thisRowNum
=
data
.
elem
.
id
.
replace
(
"
articleId
"
,
""
);
var
thisRowValue
=
data
.
value
;
var
thisRowTypeChooseId
=
$
(
"
#typeId
"
+
thisRowNum
).
val
();
if
(
!
isNull
(
thisRowValue
)
&&
thisRowValue
!=
'
请选择
'
)
{
var
list
=
getInPoingArr
(
assetArticles
,
'
id
'
,
thisRowTypeChooseId
,
'
list
'
);
$
.
each
(
list
,
function
(
i
,
item
)
{
if
(
item
.
id
===
thisRowValue
)
{
$
(
"
#specifications
"
+
thisRowNum
).
html
(
item
.
specificationsName
);
$
(
"
#residualNum
"
+
thisRowNum
).
html
(
item
.
residualNum
);
return
false
;
}
});
}
else
{
$
(
"
#specifications
"
+
thisRowNum
).
html
(
""
);
$
(
"
#residualNum
"
+
thisRowNum
).
html
(
""
);
}
});
// 保存为草稿
form
.
on
(
'
submit(formEditBean)
'
,
function
(
data
)
{
if
(
winui
.
verifyForm
(
data
.
elem
))
{
...
...
@@ -115,63 +150,47 @@ layui.config({
return
false
;
});
// 工作流中保存
form
.
on
(
'
submit(subBean)
'
,
function
(
data
)
{
if
(
winui
.
verifyForm
(
data
.
elem
))
{
saveData
(
'
3
'
,
""
);
}
return
false
;
});
function
saveData
(
subType
,
approvalId
)
{
// 获取已选用品数据
var
rowTr
=
$
(
"
#useTable tr
"
);
if
(
rowTr
.
length
==
0
)
{
winui
.
window
.
msg
(
'
请选择需要领用的用品~
'
,
{
icon
:
2
,
time
:
2000
});
var
result
=
initTableChooseUtil
.
getDataList
(
'
articlesList
'
);
if
(
!
result
.
checkResult
)
{
return
false
;
}
var
tableData
=
new
Array
();
var
noError
=
false
;
//循环遍历表格数据时,是否有其他错误信息
$
.
each
(
rowTr
,
function
(
i
,
item
)
{
var
rowNum
=
$
(
item
).
attr
(
"
trcusid
"
).
replace
(
"
tr
"
,
""
);
var
residualNum
=
parseInt
(
$
(
"
#residualNum
"
+
rowNum
).
html
());
if
(
parseInt
(
$
(
"
#useNum
"
+
rowNum
).
val
())
==
0
)
{
$
(
"
#useNum
"
+
rowNum
).
addClass
(
"
layui-form-danger
"
);
$
(
"
#useNum
"
+
rowNum
).
focus
();
var
noError
=
false
;
var
tableData
=
[];
$
.
each
(
result
.
dataList
,
function
(
i
,
item
)
{
var
rowNum
=
item
[
"
trcusid
"
].
replace
(
"
tr
"
,
""
);
if
(
parseInt
(
item
.
applyUseNum
)
==
0
)
{
$
(
"
#applyUseNum
"
+
rowNum
).
addClass
(
"
layui-form-danger
"
);
$
(
"
#applyUseNum
"
+
rowNum
).
focus
();
winui
.
window
.
msg
(
'
领用数量不能为0
'
,
{
icon
:
2
,
time
:
2000
});
noError
=
true
;
return
false
;
}
if
(
parseInt
(
$
(
"
#useNum
"
+
rowNum
).
val
())
>
residualNum
)
{
$
(
"
#
u
seNum
"
+
rowNum
).
addClass
(
"
layui-form-danger
"
);
$
(
"
#
u
seNum
"
+
rowNum
).
focus
();
if
(
parseInt
(
item
.
applyUseNum
)
>
parseInt
(
item
.
residualNum
)
)
{
$
(
"
#
applyU
seNum
"
+
rowNum
).
addClass
(
"
layui-form-danger
"
);
$
(
"
#
applyU
seNum
"
+
rowNum
).
focus
();
winui
.
window
.
msg
(
'
领用数量不能超过库存数量
'
,
{
icon
:
2
,
time
:
2000
});
noError
=
true
;
return
false
;
}
if
(
inTableDataArrayByAssetarId
(
$
(
"
#assetarId
"
+
rowNum
).
val
(),
tableData
))
{
if
(
judgeInPoingArr
(
tableData
,
'
articleId
'
,
$
(
"
#assetarId
"
+
rowNum
).
val
()))
{
winui
.
window
.
msg
(
'
领用单存在相同的用品
'
,
{
icon
:
2
,
time
:
2000
});
noError
=
true
;
return
false
;
}
var
row
=
{
typeId
:
$
(
"
#typeId
"
+
rowNum
).
val
(),
assetarId
:
$
(
"
#assetarId
"
+
rowNum
).
val
(),
useNum
:
$
(
"
#useNum
"
+
rowNum
).
val
(),
remark
:
$
(
"
#remark
"
+
rowNum
).
val
()
};
tableData
.
push
(
row
);
tableData
.
push
(
item
);
});
if
(
noError
)
{
if
(
noError
)
{
return
false
;
}
var
params
=
{
id
:
parent
.
rowId
,
title
:
$
(
"
#title
"
).
html
(),
remark
:
$
(
"
#remark
"
).
val
(),
assetArticlesStr
:
JSON
.
stringify
(
tableData
),
rowId
:
parent
.
rowId
,
enclosureInfo
:
skyeyeEnclosure
.
getEnclosureIdsByBoxId
(
'
enclosureUpload
'
),
subType
:
subType
,
// 1:保存为草稿 2.提交到工作流 3.在工作流中编辑
assetArticles
:
JSON
.
stringify
(
tableData
),
enclosureInfo
:
JSON
.
stringify
({
enclosureInfo
:
skyeyeEnclosure
.
getEnclosureIdsByBoxId
(
'
enclosureUpload
'
)}),
formSubType
:
subType
,
approvalId
:
approvalId
,
};
AjaxPostUtil
.
request
({
url
:
flowableBasePath
+
"
writeAssetArticlesApplyUse
"
,
params
:
params
,
type
:
'
json
'
,
method
:
'
POST
'
,
callback
:
function
(
json
)
{
...
...
@@ -180,150 +199,6 @@ layui.config({
}});
}
// 判断选中的用品是否也在数组中
function
inTableDataArrayByAssetarId
(
str
,
array
)
{
var
isIn
=
false
;
$
.
each
(
array
,
function
(
i
,
item
)
{
if
(
item
.
assetarId
===
str
)
{
isIn
=
true
;
return
false
;
}
});
return
isIn
;
}
//新增行
$
(
"
body
"
).
on
(
"
click
"
,
"
#addRow
"
,
function
()
{
addRow
();
});
//删除行
$
(
"
body
"
).
on
(
"
click
"
,
"
#deleteRow
"
,
function
()
{
deleteRow
();
});
//加载数据行行
function
addDataRow
(
item
)
{
var
thisRowNum
=
rowNum
.
toString
();
var
par
=
{
id
:
"
row
"
+
thisRowNum
,
//checkbox的id
trId
:
"
tr
"
+
thisRowNum
,
//行的id
typeId
:
"
typeId
"
+
thisRowNum
,
//类型id
assetarId
:
"
assetarId
"
+
thisRowNum
,
//用品id
specificationsName
:
"
specificationsName
"
+
thisRowNum
,
//规格id
residualNum
:
"
residualNum
"
+
thisRowNum
,
//库存id
useNum
:
"
useNum
"
+
thisRowNum
,
//领用数量id
remark
:
"
remark
"
+
thisRowNum
//备注id
};
$
(
"
#useTable
"
).
append
(
getDataUseHandlebars
(
usetableTemplate
,
par
));
//赋值给用品类别
$
(
"
#
"
+
"
typeId
"
+
thisRowNum
).
html
(
typeHtml
);
//数据回显
$
(
"
#typeId
"
+
thisRowNum
).
val
(
item
.
typeId
);
$
(
"
#specificationsName
"
+
thisRowNum
).
html
(
item
.
specificationsName
);
$
(
"
#remark
"
+
thisRowNum
).
val
(
item
.
remark
);
$
(
"
#residualNum
"
+
thisRowNum
).
html
(
item
.
residualNum
);
$
(
"
#useNum
"
+
thisRowNum
).
val
(
item
.
applyUseNum
);
var
thisRowValue
=
item
.
typeId
;
if
(
!
isNull
(
thisRowValue
)
&&
thisRowValue
!=
'
请选择
'
)
{
if
(
inPointArray
(
thisRowValue
,
assetArticles
))
{
//类型对应的用品存在js对象中
var
list
=
getListPointArray
(
thisRowValue
,
assetArticles
);
//重置选择行的用品列表
var
sHtml
=
getDataUseHandlebars
(
selOption
,
{
rows
:
list
});
$
(
"
#assetarId
"
+
thisRowNum
).
html
(
sHtml
);
//重置商品列表下拉框
$
(
"
#assetarId
"
+
thisRowNum
).
val
(
item
.
articleId
);
form
.
render
(
'
select
'
);
}
else
{
//类型对应的用品不存在js对象中
AjaxPostUtil
.
request
({
url
:
flowableBasePath
+
"
assetarticles018
"
,
params
:
{
typeId
:
thisRowValue
},
type
:
'
json
'
,
method
:
'
GET
'
,
callback
:
function
(
json
)
{
assetArticles
.
push
({
id
:
thisRowValue
,
list
:
json
.
rows
});
//重置选择行的用品列表
var
sHtml
=
getDataUseHandlebars
(
selOption
,
json
);
$
(
"
#assetarId
"
+
thisRowNum
).
html
(
sHtml
);
//重置商品列表下拉框
$
(
"
#assetarId
"
+
thisRowNum
).
val
(
item
.
articleId
);
form
.
render
(
'
select
'
);
},
async
:
false
});
}
}
form
.
render
(
'
select
'
);
form
.
render
(
'
checkbox
'
);
rowNum
++
;
}
//新增行
function
addRow
()
{
var
par
=
{
id
:
"
row
"
+
rowNum
.
toString
(),
//checkbox的id
trId
:
"
tr
"
+
rowNum
.
toString
(),
//行的id
typeId
:
"
typeId
"
+
rowNum
.
toString
(),
//类型id
assetarId
:
"
assetarId
"
+
rowNum
.
toString
(),
//用品id
specificationsName
:
"
specificationsName
"
+
rowNum
.
toString
(),
//规格id
residualNum
:
"
residualNum
"
+
rowNum
.
toString
(),
//库存id
useNum
:
"
useNum
"
+
rowNum
.
toString
(),
//领用数量id
remark
:
"
remark
"
+
rowNum
.
toString
()
//备注id
};
$
(
"
#useTable
"
).
append
(
getDataUseHandlebars
(
usetableTemplate
,
par
));
//赋值给用品类别
$
(
"
#
"
+
"
typeId
"
+
rowNum
.
toString
()).
html
(
typeHtml
);
form
.
render
(
'
select
'
);
form
.
render
(
'
checkbox
'
);
rowNum
++
;
}
//删除行
function
deleteRow
()
{
var
checkRow
=
$
(
"
#useTable input[type='checkbox'][name='tableCheckRow']:checked
"
);
if
(
checkRow
.
length
>
0
)
{
$
.
each
(
checkRow
,
function
(
i
,
item
)
{
$
(
item
).
parent
().
parent
().
remove
();
});
}
else
{
winui
.
window
.
msg
(
'
请选择要删除的行
'
,
{
icon
:
2
,
time
:
2000
});
}
}
//根据类型重置用户列表
function
resetAssetList
(
thisRowNum
,
list
)
{
var
sHtml
=
getDataUseHandlebars
(
selOption
,
{
rows
:
list
});
$
(
"
#assetarId
"
+
thisRowNum
).
html
(
sHtml
);
//重置商品列表下拉框
$
(
"
#specificationsName
"
+
thisRowNum
).
html
(
""
);
//重置规格为空
$
(
"
#residualNum
"
+
thisRowNum
).
html
(
""
);
//重置库存为空
form
.
render
(
'
select
'
);
}
//判断是否在数组中
function
inPointArray
(
str
,
array
)
{
var
isIn
=
false
;
$
.
each
(
array
,
function
(
i
,
item
)
{
if
(
item
.
id
===
str
)
{
isIn
=
true
;
return
false
;
}
});
return
isIn
;
}
//获取指定key对应的集合
function
getListPointArray
(
str
,
array
)
{
var
isList
=
[];
$
.
each
(
array
,
function
(
i
,
item
)
{
if
(
item
.
id
===
str
)
{
$
.
extend
(
true
,
isList
,
item
.
list
);
return
false
;
}
});
return
isList
;
}
$
(
"
body
"
).
on
(
"
click
"
,
"
#cancle
"
,
function
()
{
parent
.
layer
.
close
(
index
);
});
...
...
admin-assistant/src/main/resources/template/js/assetArticlesUse/assetArticlesUseList.js
浏览文件 @
6ac83484
...
...
@@ -5,21 +5,16 @@ layui.config({
version
:
skyeyeVersion
}).
extend
({
window
:
'
js/winui.window
'
}).
define
([
'
window
'
,
'
table
'
,
'
jquery
'
,
'
winui
'
,
'
form
'
,
'
laydate
'
],
function
(
exports
)
{
}).
define
([
'
window
'
,
'
table
'
,
'
jquery
'
,
'
winui
'
,
'
form
'
],
function
(
exports
)
{
winui
.
renderColor
();
var
$
=
layui
.
$
,
form
=
layui
.
form
,
laydate
=
layui
.
laydate
,
table
=
layui
.
table
;
var
serviceClassName
=
sysServiceMation
[
"
assetArticlesUse
"
][
"
key
"
];
// 新增用品领用
authBtn
(
'
1596957289917
'
);
// '用品领用'页面的选取时间段表格
laydate
.
render
({
elem
:
'
#createTime
'
,
range
:
'
~
'
});
// 展示用品领用列表
// 用品领用列表
table
.
render
({
id
:
'
lingyongTable
'
,
elem
:
'
#lingyongTable
'
,
...
...
@@ -33,44 +28,49 @@ layui.config({
cols
:
[[
{
title
:
systemLanguage
[
"
com.skyeye.serialNumber
"
][
languageType
],
type
:
'
numbers
'
},
{
field
:
'
title
'
,
title
:
'
标题
'
,
width
:
300
,
templet
:
function
(
d
)
{
return
'
<a lay-event="
lingyongDed
ails" class="notice-title-click">
'
+
d
.
title
+
'
</a>
'
;
return
'
<a lay-event="
det
ails" class="notice-title-click">
'
+
d
.
title
+
'
</a>
'
;
}},
{
field
:
'
oddNum
'
,
title
:
'
单号
'
,
width
:
200
,
align
:
'
center
'
},
{
field
:
'
oddNum
ber
'
,
title
:
'
单号
'
,
width
:
200
,
align
:
'
center
'
},
{
field
:
'
processInstanceId
'
,
title
:
'
流程ID
'
,
width
:
80
,
align
:
'
center
'
,
templet
:
function
(
d
)
{
return
'
<a lay-event="
lingyongP
rocessDetails" class="notice-title-click">
'
+
d
.
processInstanceId
+
'
</a>
'
;
return
'
<a lay-event="
p
rocessDetails" class="notice-title-click">
'
+
d
.
processInstanceId
+
'
</a>
'
;
}},
{
field
:
'
state
'
,
title
:
'
状态
'
,
width
:
90
,
align
:
'
center
'
,
templet
:
function
(
d
)
{
return
activitiUtil
.
showStateName2
(
d
.
state
,
1
);
}},
{
field
:
'
createName
'
,
title
:
systemLanguage
[
"
com.skyeye.createName
"
][
languageType
],
width
:
120
},
{
field
:
'
createTime
'
,
title
:
systemLanguage
[
"
com.skyeye.createTime
"
][
languageType
],
align
:
'
center
'
,
width
:
150
},
{
title
:
systemLanguage
[
"
com.skyeye.operation
"
][
languageType
],
fixed
:
'
right
'
,
align
:
'
center
'
,
width
:
257
,
toolbar
:
'
#lingyongTableBar
'
}
{
field
:
'
lastUpdateName
'
,
title
:
systemLanguage
[
"
com.skyeye.lastUpdateName
"
][
languageType
],
align
:
'
left
'
,
width
:
120
},
{
field
:
'
lastUpdateTime
'
,
title
:
systemLanguage
[
"
com.skyeye.lastUpdateTime
"
][
languageType
],
align
:
'
center
'
,
width
:
150
},
{
title
:
systemLanguage
[
"
com.skyeye.operation
"
][
languageType
],
fixed
:
'
right
'
,
align
:
'
center
'
,
width
:
257
,
toolbar
:
'
#lingyongTableBar
'
}
]],
done
:
function
(
json
)
{
matchingLanguage
();
initTableSearchUtil
.
initAdvancedSearch
(
this
,
json
.
searchFilter
,
form
,
"
请输入单号,标题
"
,
function
()
{
table
.
reloadData
(
"
lingyongTable
"
,
{
page
:
{
curr
:
1
},
where
:
getTableParams
()});
});
}
});
// 用品领用的操作事件
table
.
on
(
'
tool(lingyongTable)
'
,
function
(
obj
)
{
var
data
=
obj
.
data
;
var
layEvent
=
obj
.
event
;
if
(
layEvent
===
'
lingyongDed
ails
'
)
{
//领用详情
lingyongDed
ails
(
data
);
if
(
layEvent
===
'
det
ails
'
)
{
//领用详情
det
ails
(
data
);
}
else
if
(
layEvent
===
'
edit
'
)
{
//编辑领用申请
use
edit
(
data
);
edit
(
data
);
}
else
if
(
layEvent
===
'
subApproval
'
)
{
//提交审批
subApproval
(
data
);
}
else
if
(
layEvent
===
'
cancellation
'
)
{
//领用作废
cancellation
(
data
);
}
else
if
(
layEvent
===
'
lingyongP
rocessDetails
'
)
{
//领用流程详情
}
else
if
(
layEvent
===
'
p
rocessDetails
'
)
{
//领用流程详情
activitiUtil
.
activitiDetails
(
data
);
}
else
if
(
layEvent
===
'
revoke
'
)
{
//撤销领用申请
revoke
(
data
);
}
});
// 添加
用品领用
$
(
"
body
"
).
on
(
"
click
"
,
"
#add
Use
Bean
"
,
function
()
{
// 添加
$
(
"
body
"
).
on
(
"
click
"
,
"
#addBean
"
,
function
()
{
_openNewWindows
({
url
:
"
../../tpl/assetArticlesUse/assetArticlesUseAdd.html
"
,
title
:
"
添加用品领用申请
"
,
...
...
@@ -78,24 +78,24 @@ layui.config({
area
:
[
'
90vw
'
,
'
90vh
'
],
callBack
:
function
(
refreshCode
)
{
winui
.
window
.
msg
(
systemLanguage
[
"
com.skyeye.successfulOperation
"
][
languageType
],
{
icon
:
1
,
time
:
2000
});
load
Lingyong
Table
();
loadTable
();
}});
});
// 撤销
用品领用
// 撤销
function
revoke
(
data
)
{
var
msg
=
'
确认撤销该用品领用申请吗?
'
;
layer
.
confirm
(
msg
,
{
icon
:
3
,
title
:
'
撤销操作
'
},
function
(
index
)
{
layer
.
close
(
index
);
AjaxPostUtil
.
request
({
url
:
flowableBasePath
+
"
assetarticles034
"
,
params
:
{
processInstanceId
:
data
.
processInstanceId
},
type
:
'
json
'
,
method
:
"
PUT
"
,
callback
:
function
(
json
)
{
winui
.
window
.
msg
(
"
提交成功
"
,
{
icon
:
1
,
time
:
2000
});
load
Lingyong
Table
();
loadTable
();
}});
});
}
// 编辑
用品领用申请
function
use
edit
(
data
)
{
// 编辑
function
edit
(
data
)
{
rowId
=
data
.
id
;
_openNewWindows
({
url
:
"
../../tpl/assetArticlesUse/assetArticlesUseEdit.html
"
,
...
...
@@ -104,7 +104,7 @@ layui.config({
area
:
[
'
90vw
'
,
'
90vh
'
],
callBack
:
function
(
refreshCode
)
{
winui
.
window
.
msg
(
systemLanguage
[
"
com.skyeye.successfulOperation
"
][
languageType
],
{
icon
:
1
,
time
:
2000
});
load
Lingyong
Table
();
loadTable
();
}
});
}
...
...
@@ -115,12 +115,12 @@ layui.config({
layer
.
close
(
index
);
activitiUtil
.
startProcess
(
serviceClassName
,
null
,
function
(
approvalId
)
{
var
params
=
{
rowI
d
:
data
.
id
,
i
d
:
data
.
id
,
approvalId
:
approvalId
};
AjaxPostUtil
.
request
({
url
:
flowableBasePath
+
"
assetarticles023
"
,
params
:
params
,
type
:
'
json
'
,
callback
:
function
(
json
)
{
AjaxPostUtil
.
request
({
url
:
flowableBasePath
+
"
assetarticles023
"
,
params
:
params
,
type
:
'
json
'
,
method
:
'
POST
'
,
callback
:
function
(
json
)
{
winui
.
window
.
msg
(
"
提交成功
"
,
{
icon
:
1
,
time
:
2000
});
load
Lingyong
Table
();
loadTable
();
}});
});
});
...
...
@@ -131,15 +131,15 @@ layui.config({
var
msg
=
'
确认作废该条领用申请吗?
'
;
layer
.
confirm
(
msg
,
{
icon
:
3
,
title
:
'
作废操作
'
},
function
(
index
)
{
layer
.
close
(
index
);
AjaxPostUtil
.
request
({
url
:
flowableBasePath
+
"
assetarticles030
"
,
params
:
{
rowId
:
data
.
id
},
type
:
'
json
'
,
callback
:
function
(
json
)
{
AjaxPostUtil
.
request
({
url
:
flowableBasePath
+
"
assetarticles030
"
,
params
:
{
id
:
data
.
id
},
type
:
'
json
'
,
method
:
'
POST
'
,
callback
:
function
(
json
)
{
winui
.
window
.
msg
(
systemLanguage
[
"
com.skyeye.successfulOperation
"
][
languageType
],
{
icon
:
1
,
time
:
2000
});
load
Lingyong
Table
();
loadTable
();
}});
});
}
// 用品领用详情
function
lingyongDed
ails
(
data
)
{
function
det
ails
(
data
)
{
rowId
=
data
.
id
;
_openNewWindows
({
url
:
"
../../tpl/assetArticlesUse/assetArticlesUseDetails.html
"
,
...
...
@@ -152,35 +152,16 @@ layui.config({
}
form
.
render
();
form
.
on
(
'
submit(formSearch)
'
,
function
(
data
)
{
if
(
winui
.
verifyForm
(
data
.
elem
))
{
table
.
reloadData
(
"
lingyongTable
"
,
{
page
:
{
curr
:
1
},
where
:
getTableParams
()});
}
return
false
;
$
(
"
body
"
).
on
(
"
click
"
,
"
#reloadTable
"
,
function
()
{
loadTable
();
});
function
loadTable
()
{
table
.
reloadData
(
"
lingyongTable
"
,
{
where
:
getTableParams
()});
}
// 刷新领用数据
$
(
"
body
"
).
on
(
"
click
"
,
"
#reloadLingyongTable
"
,
function
()
{
loadLingyongTable
();
});
// 刷新领用列表数据
function
loadLingyongTable
(){
table
.
reloadData
(
"
lingyongTable
"
,
{
where
:
getTableParams
()});
}
function
getTableParams
()
{
var
startTime
=
""
,
endTime
=
""
;
if
(
!
isNull
(
$
(
"
#createTime
"
).
val
()))
{
startTime
=
$
(
"
#createTime
"
).
val
().
split
(
'
~
'
)[
0
].
trim
()
+
'
00:00:00
'
;
endTime
=
$
(
"
#createTime
"
).
val
().
split
(
'
~
'
)[
1
].
trim
()
+
'
23:59:59
'
;
}
return
{
state
:
$
(
"
#state
"
).
val
(),
startTime
:
startTime
,
endTime
:
endTime
};
}
function
getTableParams
()
{
return
$
.
extend
(
true
,
{},
initTableSearchUtil
.
getSearchValue
(
"
lingyongTable
"
));
}
exports
(
'
assetArticlesUseList
'
,
{});
});
admin-assistant/src/main/resources/template/tpl/assetArticlesUse/assetArticlesUseAdd.html
浏览文件 @
6ac83484
...
...
@@ -11,7 +11,7 @@
<form
class=
"layui-form"
action=
""
id=
"showForm"
>
<div
class=
"layui-form-item layui-col-xs12"
>
<label
class=
"layui-form-label"
>
标题
<i
class=
"red"
>
*
</i></label>
<div
class=
"layui-input-block ver-center"
id=
"
useT
itle"
>
<div
class=
"layui-input-block ver-center"
id=
"
t
itle"
>
</div>
</div>
...
...
@@ -29,29 +29,9 @@
</div>
<div
class=
"layui-form-item layui-col-xs12"
>
<label
class=
"layui-form-label"
>
用品
<i
class=
"red"
>
*
</i></label>
<div
class=
"layui-input-block"
>
<div
class=
"winui-toolbar"
>
<div
class=
"winui-tool"
style=
"text-align: left;"
>
<button
id=
"addRow"
class=
"winui-toolbtn"
type=
"button"
><i
class=
"fa fa-plus"
aria-hidden=
"true"
></i>
新增行
</button>
<button
id=
"deleteRow"
class=
"winui-toolbtn"
type=
"button"
><i
class=
"fa fa-trash-o"
aria-hidden=
"true"
></i>
删除行
</button>
</div>
</div>
<table
class=
"layui-table"
>
<thead>
<tr>
<th></th>
<th>
用品类别
<i
class=
"red"
>
*
</i></th>
<th>
用品名称
<i
class=
"red"
>
*
</i></th>
<th
style=
"min-width: 100px;"
>
规格(单位)
</th>
<th
style=
"min-width: 50px;"
>
库存
</th>
<th
style=
"min-width: 50px;"
>
领用数量
<i
class=
"red"
>
*
</i></th>
<th>
备注
</th>
</tr>
</thead>
<tbody
id=
"useTable"
class=
"insurance-table"
>
</tbody>
</table>
</div>
<div
class=
"layui-input-block"
id=
"articlesList"
>
</div>
</div>
<div
class=
"layui-form-item layui-col-xs12"
>
<label
class=
"layui-form-label"
>
相关描述
</label>
...
...
@@ -74,19 +54,6 @@
</form>
</div>
<!-- usetableTemplate -->
<script
type=
"text/x-handlebars-template"
id=
"usetableTemplate"
>
<
tr
trcusid
=
"
{{trId}}
"
>
<
td
><
input
type
=
"
checkbox
"
rowId
=
"
{{id}}
"
lay
-
filter
=
"
checkboxProperty
"
name
=
"
tableCheckRow
"
/><
/td
>
<
td
><
select
id
=
"
{{typeId}}
"
lay
-
filter
=
"
selectTypeProperty
"
win
-
verify
=
"
required
"
><
/select></
td
>
<
td
><
select
id
=
"
{{assetarId}}
"
lay
-
filter
=
"
selectAssetarProperty
"
win
-
verify
=
"
required
"
><
/select></
td
>
<
td
id
=
"
{{specificationsName}}
"
><
/td
>
<
td
id
=
"
{{residualNum}}
"
><
/td
>
<
td
><
input
type
=
"
text
"
class
=
"
layui-input
"
value
=
"
1
"
id
=
"
{{useNum}}
"
win
-
verify
=
"
required|number
"
/><
/td
>
<
td
><
input
type
=
"
text
"
class
=
"
layui-input
"
id
=
"
{{remark}}
"
/><
/td
>
<
/tr
>
</script>
<script
src=
"../../assets/lib/layui/layui.js"
></script>
<script
src=
"../../assets/lib/layui/custom.js"
></script>
<script
type=
"text/javascript"
>
...
...
admin-assistant/src/main/resources/template/tpl/assetArticlesUse/assetArticlesUseDetails.html
浏览文件 @
6ac83484
...
...
@@ -43,7 +43,7 @@
<
div
class
=
"
layui-form-item layui-col-xs6
"
>
<
label
class
=
"
layui-form-label
"
>
责任人
:
<
/label
>
<
div
class
=
"
layui-input-block ver-center
"
>
{{
user
Name
}}
{{
create
Name
}}
<
/div
>
<
/div
>
<
div
class
=
"
layui-form-item layui-col-xs12
"
>
...
...
@@ -62,11 +62,11 @@
<
/tr
>
<
/thead
>
<
tbody
id
=
"
useTable
"
class
=
"
insurance-table
"
>
{{
#
each
good
s
}}
{{
#
each
assetArticle
s
}}
<
tr
>
<
td
>
{{
typeName
}}
<
/td
>
<
td
>
{{
a
rticleN
ame
}}
<
/td
>
<
td
>
{{
specificationsName
}}
<
/td
>
<
td
>
{{
assetArticles
.
typeName
}}
<
/td
>
<
td
>
{{
a
ssetArticles
.
n
ame
}}
<
/td
>
<
td
>
{{
assetArticles
.
specifications
}}
<
/td
>
<
td
>
{{
applyUseNum
}}
<
/td
>
<
td
>
{{
actualUseNum
}}
<
/td
>
<
td
>
{{
stateName
}}
<
/td
>
...
...
admin-assistant/src/main/resources/template/tpl/assetArticlesUse/assetArticlesUseEdit.html
浏览文件 @
6ac83484
...
...
@@ -11,7 +11,7 @@
<form
class=
"layui-form"
action=
""
id=
"showForm"
>
<div
class=
"layui-form-item layui-col-xs12"
>
<label
class=
"layui-form-label"
>
标题
<i
class=
"red"
>
*
</i></label>
<div
class=
"layui-input-block ver-center"
id=
"
useT
itle"
>
<div
class=
"layui-input-block ver-center"
id=
"
t
itle"
>
</div>
</div>
...
...
@@ -29,29 +29,9 @@
</div>
<div
class=
"layui-form-item layui-col-xs12"
>
<label
class=
"layui-form-label"
>
用品
<i
class=
"red"
>
*
</i></label>
<div
class=
"layui-input-block"
>
<div
class=
"winui-toolbar"
>
<div
class=
"winui-tool"
style=
"text-align: left;"
>
<button
id=
"addRow"
class=
"winui-toolbtn"
type=
"button"
><i
class=
"fa fa-plus"
aria-hidden=
"true"
></i>
新增行
</button>
<button
id=
"deleteRow"
class=
"winui-toolbtn"
type=
"button"
><i
class=
"fa fa-trash-o"
aria-hidden=
"true"
></i>
删除行
</button>
</div>
</div>
<table
class=
"layui-table"
>
<thead>
<tr>
<th></th>
<th>
用品类别
<i
class=
"red"
>
*
</i></th>
<th>
用品名称
<i
class=
"red"
>
*
</i></th>
<th
style=
"min-width: 100px;"
>
规格(单位)
</th>
<th
style=
"min-width: 50px;"
>
库存
</th>
<th
style=
"min-width: 50px;"
>
领用数量
<i
class=
"red"
>
*
</i></th>
<th>
备注
</th>
</tr>
</thead>
<tbody
id=
"useTable"
class=
"insurance-table"
>
</tbody>
</table>
</div>
<div
class=
"layui-input-block"
id=
"articlesList"
>
</div>
</div>
<div
class=
"layui-form-item layui-col-xs12"
>
<label
class=
"layui-form-label"
>
相关描述
</label>
...
...
@@ -68,27 +48,13 @@
<div
class=
"layui-form-item layui-col-xs12"
>
<div
class=
"layui-input-block"
>
<button
class=
"winui-btn"
id=
"cancle"
><language
showName=
"com.skyeye.cancel"
></language></button>
<button
class=
"winui-btn typeOne layui-hide"
lay-submit
lay-filter=
"formEditBean"
>
保存为草稿
</button>
<button
class=
"winui-btn typeOne layui-hide"
lay-submit
lay-filter=
"formSubBean"
>
提交审批
</button>
<button
class=
"winui-btn typeTwo layui-hide"
lay-submit
lay-filter=
"subBean"
><language
showName=
"com.skyeye.save"
></language></button>
<button
class=
"winui-btn"
lay-submit
lay-filter=
"formEditBean"
>
保存为草稿
</button>
<button
class=
"winui-btn"
lay-submit
lay-filter=
"formSubBean"
>
提交审批
</button>
</div>
</div>
</form>
</div>
<!-- usetableTemplate -->
<script
type=
"text/x-handlebars-template"
id=
"usetableTemplate"
>
<
tr
trcusid
=
"
{{trId}}
"
>
<
td
><
input
type
=
"
checkbox
"
rowId
=
"
{{id}}
"
lay
-
filter
=
"
checkboxProperty
"
name
=
"
tableCheckRow
"
/><
/td
>
<
td
><
select
id
=
"
{{typeId}}
"
lay
-
filter
=
"
selectTypeProperty
"
win
-
verify
=
"
required
"
><
/select></
td
>
<
td
><
select
id
=
"
{{assetarId}}
"
lay
-
filter
=
"
selectAssetarProperty
"
win
-
verify
=
"
required
"
><
/select></
td
>
<
td
id
=
"
{{specificationsName}}
"
><
/td
>
<
td
id
=
"
{{residualNum}}
"
><
/td
>
<
td
><
input
type
=
"
text
"
class
=
"
layui-input
"
id
=
"
{{useNum}}
"
win
-
verify
=
"
required|number
"
/><
/td
>
<
td
><
input
type
=
"
text
"
class
=
"
layui-input
"
id
=
"
{{remark}}
"
/><
/td
>
<
/tr
>
</script>
<script
src=
"../../assets/lib/layui/layui.js"
></script>
<script
src=
"../../assets/lib/layui/custom.js"
></script>
<script
type=
"text/javascript"
>
...
...
admin-assistant/src/main/resources/template/tpl/assetArticlesUse/assetArticlesUseList.html
浏览文件 @
6ac83484
...
...
@@ -7,63 +7,34 @@
<link
href=
"../../assets/lib/winui/css/winui.css"
rel=
"stylesheet"
/>
</head>
<body>
<div
style=
"margin:0 auto; height: 100%;"
>
<div
class=
"txtcenter"
style=
"margin:0 auto; padding-top: 10px;"
>
<form
class=
"layui-form layui-form-pane"
action=
""
autocomplete=
"off"
>
<div
class=
"layui-form-item"
>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
状态
</label>
<div
class=
"layui-input-inline"
>
<select
id=
"state"
>
<option
value=
""
>
全部
</option>
<option
value=
"0"
>
草稿
</option>
<option
value=
"1"
>
审核中
</option>
<option
value=
"2"
>
审核通过
</option>
<option
value=
"3"
>
审核不通过
</option>
<option
value=
"4"
>
作废
</option>
<option
value=
"5"
>
撤销
</option>
</select>
</div>
<label
class=
"layui-form-label"
>
申请时间
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"text"
id=
"createTime"
name=
"createTime"
placeholder=
"请选择申请时间"
class=
"layui-input"
/>
</div>
<button
type=
"reset"
class=
"layui-btn layui-btn-primary list-form-search"
><language
showName=
"com.skyeye.reset"
></language></button>
<button
class=
"layui-btn list-form-search"
lay-submit
lay-filter=
"formSearch"
><language
showName=
"com.skyeye.search2"
></language></button>
</div>
</div>
</form>
<div
class=
"winui-toolbar"
>
<div
class=
"winui-tool"
style=
"text-align: left;"
>
<button
id=
"reloadTable"
class=
"winui-toolbtn search-table-btn-right"
><i
class=
"fa fa-refresh"
aria-hidden=
"true"
></i><language
showName=
"com.skyeye.refreshDataBtn"
></language></button>
<button
id=
"addBean"
class=
"winui-toolbtn search-table-btn-right"
auth=
"1596957289917"
><i
class=
"fa fa-plus"
aria-hidden=
"true"
></i>
用品领用申请
</button>
</div>
<div
class=
"winui-toolbar"
>
<div
class=
"winui-tool"
style=
"text-align: left;"
>
<button
id=
"reloadLingyongTable"
class=
"winui-toolbtn"
><i
class=
"fa fa-refresh"
aria-hidden=
"true"
></i><language
showName=
"com.skyeye.refreshDataBtn"
></language></button>
<button
id=
"addUseBean"
class=
"winui-toolbtn"
auth=
"1596957289917"
><i
class=
"fa fa-plus"
aria-hidden=
"true"
></i>
用品领用申请
</button>
</div>
</div>
<div
style=
"margin:auto 10px;"
>
<table
id=
"lingyongTable"
lay-filter=
"lingyongTable"
></table>
<script
type=
"text/html"
id=
"lingyongTableBar"
>
{{
#
if
(
d
.
editRow
==
'
1
'
){
}}
{{
#
if
(
auth
(
'
1596957208717
'
)){
}}
<
a
class
=
"
layui-btn layui-btn-xs
"
lay
-
event
=
"
subApproval
"
>
提交审批
<
/a
>
{{
#
}
}}
{{
#
if
(
auth
(
'
1596957217708
'
)){
}}
<
a
class
=
"
layui-btn layui-btn-xs layui-btn-danger
"
lay
-
event
=
"
cancellation
"
>
作废
<
/a
>
{{
#
}
}}
</div>
<div
style=
"margin:auto 10px;"
>
<table
id=
"lingyongTable"
lay-filter=
"lingyongTable"
></table>
<script
type=
"text/html"
id=
"lingyongTableBar"
>
{{
#
if
(
d
.
editRow
==
'
1
'
){
}}
{{
#
if
(
auth
(
'
1596957208717
'
)){
}}
<
a
class
=
"
layui-btn layui-btn-xs
"
lay
-
event
=
"
subApproval
"
>
提交审批
<
/a
>
{{
#
}
}}
{{
#
if
(
d
.
editRow
==
'
1
'
||
d
.
editRow
==
'
2
'
){
}}
{{
#
if
(
auth
(
'
1596957564908
'
)){
}}
<
a
class
=
"
layui-btn layui-btn-xs
"
lay
-
event
=
"
edit
"
><
language
showName
=
"
com.skyeye.editBtn
"
><
/language></
a
>
{{
#
}
}}
{{
#
if
(
auth
(
'
1596957217708
'
)){
}}
<
a
class
=
"
layui-btn layui-btn-xs layui-btn-danger
"
lay
-
event
=
"
cancellation
"
>
作废
<
/a
>
{{
#
}
}}
{{
#
if
(
d
.
editRow
==
'
2
'
){
}}
{{
#
if
(
auth
(
'
1596957196901
'
)){
}}
<
a
class
=
"
layui-btn layui-btn-xs layui-btn-danger
"
lay
-
event
=
"
revoke
"
>
撤销
<
/a
>
{{
#
}
}}
{{
#
if
(
auth
(
'
1596957289917
'
)){
}}
<
a
class
=
"
layui-btn layui-btn-xs
"
lay
-
event
=
"
edit
"
><
language
showName
=
"
com.skyeye.editBtn
"
><
/language></
a
>
{{
#
}
}}
</script>
</div>
{{
#
}
}}
{{
#
if
(
d
.
editRow
==
'
2
'
){
}}
{{
#
if
(
auth
(
'
1596957196901
'
)){
}}
<
a
class
=
"
layui-btn layui-btn-xs layui-btn-danger
"
lay
-
event
=
"
revoke
"
>
撤销
<
/a
>
{{
#
}
}}
{{
#
}
}}
</script>
</div>
<script
src=
"../../assets/lib/layui/layui.js"
></script>
<script
src=
"../../assets/lib/layui/custom.js"
></script>
<script
type=
"text/javascript"
>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录