Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
warehouse
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
胡懿
warehouse
Commits
c814b600
Commit
c814b600
authored
Feb 22, 2023
by
yyq1988
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
对接入库单表单,优化货品表单
parent
0ed291ec
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
170 additions
and
68 deletions
+170
-68
big.js
src/main/webapp/static/common/js/big.js
+0
-0
jeeplus.js
src/main/webapp/static/common/js/jeeplus.js
+6
-12
goodsDetail.jsp
...in/webapp/webpage/modules/warehouse/goods/goodsDetail.jsp
+61
-7
goodsForm.jsp
...main/webapp/webpage/modules/warehouse/goods/goodsForm.jsp
+8
-1
goodsList.js
src/main/webapp/webpage/modules/warehouse/goods/goodsList.js
+4
-0
qrCodeList.js
...ain/webapp/webpage/modules/warehouse/qrcode/qrCodeList.js
+0
-22
storageDetail.jsp
...ebapp/webpage/modules/warehouse/storage/storageDetail.jsp
+91
-26
No files found.
src/main/webapp/static/common/js/big.js
0 → 100644
View file @
c814b600
This diff is collapsed.
Click to expand it.
src/main/webapp/static/common/js/jeeplus.js
View file @
c814b600
...
...
@@ -176,6 +176,7 @@ function delRow(obj, prefix){
// if(width.indexOf("%")>=0 || height.indexOf("%")>=0 ){
// auto =false;
// }
// }
// top.layer.open({
// type: 2,
// area: [width, height],
...
...
@@ -325,10 +326,10 @@ function delRow(obj, prefix){
},
openStorageSelectDialog
:
function
(
isMultiSelect
,
batchNum
,
yesFuc
){
var
url
=
ctx
+
"/warehouse/storage/storage/findByPcTypeModel?goodsInfo.goods.batchNum="
+
batchNum
;
var
fieldLabels
=
"
名称|类型
"
;
var
fieldKeys
=
"
name|type.name
"
;
var
searchLabels
=
"
型号|类型
"
;
var
searchKeys
=
"goodsInfo.
model|goodsInfo.type
"
;
var
fieldLabels
=
"
物资编码|名称|类型|型号
"
;
var
fieldKeys
=
"
qrCode.code|name|type.name|model
"
;
var
searchLabels
=
"
类型|型号
"
;
var
searchKeys
=
"goodsInfo.
type|goodsInfo.model
"
;
top
.
layer
.
open
({
type
:
2
,
area
:
[
'800px'
,
'500px'
],
...
...
@@ -344,14 +345,7 @@ function delRow(obj, prefix){
jp
.
warning
(
"必须选择一条数据!"
);
return
;
}
var
ids
=
[];
var
names
=
[];
for
(
var
i
=
0
;
i
<
items
.
length
;
i
++
){
var
item
=
items
[
i
];
ids
.
push
(
item
.
id
);
names
.
push
(
item
.
enname
)
}
yesFuc
(
ids
.
join
(
","
),
names
.
join
(
","
));
yesFuc
(
items
);
top
.
layer
.
close
(
index
);
//关闭对话框。
},
cancel
:
function
(
index
){
...
...
src/main/webapp/webpage/modules/warehouse/goods/goodsDetail.jsp
View file @
c814b600
...
...
@@ -74,6 +74,16 @@
}
},
{
field: 'amount',
title: '单价',
formatter: function (value,row,index){
return Mustache.render($("#amountTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""),{
row: row,
idx: index
})
}
},
{
field: 'remarks',
title: '备注',
formatter: function (value,row,index){
...
...
@@ -105,7 +115,8 @@
name: ''
},
model: '',
num: '',
num: null,
amount: null,
remarks: ''
}
...
...
@@ -134,12 +145,50 @@
}
function onInputChange(rowIndex, elem , field){
var obj = {};
obj[field] = $(elem).val()
var timer = null;
clearTimeout(timer);
timer = setTimeout(function (){
updateRow(rowIndex, obj)
}, 0)
obj[field] = $(elem).val();
updateRow(rowIndex, obj);
// 校验数量与单价
if(field === 'num' && obj[field]){
// 正则表达式验证可以带小数点的数字
var reg = new RegExp("^[0-9]+(.[0-9]{1,2})?$");
// 不是数字
if(!reg.test(obj[field])){
jp.warning("必须是数字");
$(elem).val('')
return
}
if (Number(obj[field]) <= 0) {
jp.warning("数量不能小于等于0");
$(elem).val('');
return;
}
setSumPrice();
}
if(field === 'amount' && obj[field]) {
// 正则表达式验证可以带小数点的数字
// 不是数字
if(!/^(?:[1-9]\d*|0)(?:\.\d{1,2})?$/.test(obj[field])) {
jp.warning("输入正确的金额");
$(elem).val('')
return
}
setSumPrice();
}
}
function setSumPrice(){
var data = $(selector).bootstrapTable('getData');
var sum = data.reduce(function (sum, current){
if(current.delFlag != 1 && current.amount && current.num){
var total = new Big(current.amount).times(current.num).toNumber();
return new Big(sum).plus(total);
}
return new Big(sum);
},0)
$("#sum").val(sum);
}
function onSelectType(nodes, rowIndex){
...
...
@@ -178,6 +227,10 @@
<input id="goodsInfoList{{idx}}_num" name="goodsInfoList[{{idx}}].num" type="text" value="{{row.num}}" onchange="onInputChange('{{idx}}', this, 'num')" class="form-control "/>
</script>
<script id="amountTpl" type="text/html">
<input id="goodsInfoList{{idx}}_amount" name="goodsInfoList[{{idx}}].amount" type="text" value="{{row.amount}}" onchange="onInputChange('{{idx}}', this, 'amount')" class="form-control "/>
</script>
<script id="remarksTpl" type="text/html">
<textarea id="goodsInfoList{{idx}}_remarks" name="goodsInfoList[{{idx}}].remarks" rows="4" onchange="onInputChange('{{idx}}', this, 'remarks')" class="form-control ">{{row.remarks}}</textarea>
</script>
\ No newline at end of file
src/main/webapp/webpage/modules/warehouse/goods/goodsForm.jsp
View file @
c814b600
...
...
@@ -8,6 +8,7 @@
<link
rel=
"stylesheet"
href=
"${ctxStatic}/plugin/bootstrapTable/bootstrap-table.min.css"
>
<script
type=
"text/javascript"
src=
"${ctxStatic}/plugin/bootstrapTable/bootstrap-table.min.js"
></script>
<script
type=
"text/javascript"
src=
"${ctxStatic}/plugin/bootstrapTable/bootstrap-table-zh-CN.js"
></script>
<script
type=
"text/javascript"
src=
"${ctxStatic}/common/js/big.js"
></script>
</head>
<body>
<div
class=
"wrapper wrapper-content"
>
...
...
@@ -52,8 +53,14 @@
labelName=
"operator.name"
labelValue=
"${goods.operator.name}"
cssClass=
"form-control required"
disabled=
"disabled"
/>
</td>
<td>
备注
</td>
<td>
总价
</td>
<td>
<form:input
path=
"sum"
htmlEscape=
"false"
readonly=
"true"
class=
"form-control "
/>
</td>
</tr>
<tr>
<td>
备注
</td>
<td
colspan=
"3"
>
<form:textarea
path=
"remarks"
htmlEscape=
"false"
rows=
"4"
class=
"form-control "
/>
</td>
</tr>
...
...
src/main/webapp/webpage/modules/warehouse/goods/goodsList.js
View file @
c814b600
...
...
@@ -345,6 +345,7 @@ $(document).ready(function() {
<
th
>
类型编码
<
/th
>
<
th
>
型号
<
/th
>
<
th
>
数量
<
/th
>
<
th
>
单价
<
/th
>
<
th
>
备注信息
<
/th
>
<
th
>
操作
<
/th
>
<
/tr
>
...
...
@@ -373,6 +374,9 @@ $(document).ready(function() {
{{
row
.
num
}}
<
/td
>
<
td
>
{{
row
.
amount
}}
<
/td
>
<
td
>
{{
row
.
remarks
}}
<
/td
>
<
td
>
...
...
src/main/webapp/webpage/modules/warehouse/qrcode/qrCodeList.js
View file @
c814b600
...
...
@@ -85,32 +85,10 @@ $(document).ready(function() {
}
,{
field
:
'goodsInfo.id'
,
title
:
'货品明细外键'
,
sortable
:
true
,
sortName
:
'goodsInfo.id'
,
formatter
:
function
(
value
,
row
,
index
){
value
=
jp
.
unescapeHTML
(
value
);
<
c
:
choose
>
<
c
:
when
test
=
"${fns:hasPermission('warehouse:qrcode:qrCode:edit')}"
>
return
"<a href='javascript:edit(
\"
"
+
row
.
id
+
"
\"
)'>"
+
value
+
"</a>"
;
<
/c:when
>
<
c
:
when
test
=
"${fns:hasPermission('warehouse:qrcode:qrCode:view')}"
>
return
"<a href='javascript:view(
\"
"
+
row
.
id
+
"
\"
)'>"
+
value
+
"</a>"
;
<
/c:when
>
<
c
:
otherwise
>
return
value
;
<
/c:otherwise
>
<
/c:choose
>
}
}
,{
field
:
'code'
,
title
:
'物资编码'
,
sortable
:
true
,
sortName
:
'code'
}
,{
field
:
'url'
,
...
...
src/main/webapp/webpage/modules/warehouse/storage/storageDetail.jsp
View file @
c814b600
...
...
@@ -8,8 +8,9 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/webpage/include/taglib.jsp" %>
<div id="toolbar" class="text-left">
<a class="btn btn-primary btn-sm" onclick="addDetail('#detail_table')" title="新增"><i class="fa fa-plus"></i> 新增</a>
<a class="btn btn-primary btn-sm" disabled="true" onclick="addShelve('#detail_table')" title="新增"><i class="fa fa-plus"></i> 批量编辑货架</a>
<a class="btn btn-primary btn-sm" onclick="addDetail('#detail_table')" title="新增"><i class="fa fa-plus"></i> 手动添加</a>
<a class="btn btn-primary btn-sm" onclick="addScan('#detail_table')" title="新增"><i class="fa fa-plus"></i> 扫码添加</a>
<a id="editAll" class="btn btn-primary btn-sm" onclick="addShelve('#detail_table')" title="新增"><i class="fa fa-plus"></i> 批量编辑货架</a>
</div>
<table id="detail_table" data-toolbar="#toolbar"></table>
<script>
...
...
@@ -94,7 +95,11 @@
}
}
]
})
});
$(selector).on('check.bs.table uncheck.bs.table load-success.bs.table ' +
'check-all.bs.table uncheck-all.bs.table', function () {
$('#editAll').prop('disabled', !getSelections().length);
});
}
function getSelections(){
...
...
@@ -108,26 +113,25 @@
return;
}
jp.openStorageSelectDialog(true,$("#batchNum").val(),function (){
jp.openStorageSelectDialog(true,$("#batchNum").val(),function (items){
if(Array.isArray(items)){
var data = items.map(function (item){
if(item.goodsInfo && !item.goodsInfo.amount){
item.goodsInfo.amount = 0;
}
return {
id: '',
delFlag: 0,
remarks: '',
...item
}
})
debugger
$(selector).bootstrapTable('append', data)
}
})
// var row = {
// id: '',
// delFlag: 0,
// name: '',
// type: {
// id: '',
// name: ''
// },
// model: '',
// num: '',
// remarks: ''
// }
//
// $(selector).bootstrapTable('append', [
// row
// ])
}
function removeRow(index, rowId, rowDelFlag){
if(rowId){
...
...
@@ -172,10 +176,51 @@
}
function addShelve(){
jp.openShelvesSelectDialog(function (){
jp.openShelvesSelectDialog(function (id,name){
getSelections().forEach(function (item,index){
updateRow(index,{
shelves: {
id: id,
name: name
}
})
})
})
}
function addScan(){
layer.open({
type: 1,
title: '扫码',
auto: true,
area: ['500','300'],
content: $("#scanResultTpl").html(),
success: function (){
$("#scanResult").focus();
},
btn:['关闭']
})
}
/**
* 扫码
* 一、获取扫码结果
* 二、请求后台接口获取结果
* 三、增一条明细数据
* 四、清空扫码结果
* @param elem
*/
function onScanChange(elem){
try{
var json = JSON.parse($(elem).val());
var qrCodeId = json.code;
var goodsInfoId = json.infoId;
}catch (e){
console.log(e);
}
}
</script>
<script id="hideTpl" type="text/html">
...
...
@@ -183,25 +228,44 @@
<input id="storageInfoList{{idx}}_delFlag" name="storageInfoList[{{idx}}].delFlag" type="hidden" value="{{row.delFlag}}"/>
<input id="storageInfoList{{idx}}_goodsInfoId" name="storageInfoList[{{idx}}].goodsInfo.id" type="hidden" value="{{row.goodsInfo.id}}"/>
<input id="storageInfoList{{idx}}_goodsInfoName" name="storageInfoList[{{idx}}].goodsInfo.name" type="hidden" value="{{row.goodsInfo.name}}"/>
<input id="storageInfoList{{idx}}_goodsInfoAmount" name="storageInfoList[{{idx}}].goodsInfo.amount" type="hidden" value="{{row.goodsInfo.amount}}"/>
<input id="storageInfoList{{idx}}_shelvesId" name="storageInfoList[{{idx}}].shelves.id" type="hidden" value="{{row.shelves.id}}" readonly class="form-control" />
<input id="storageInfoList{{idx}}_amount" name="storageInfoList[{{idx}}].amount" type="hidden" value="{{row.amount}}" readonly class="form-control" />
<input id="storageInfoList{{idx}}_qrCodeId" name="storageInfoList[{{idx}}].qrCode.id" type="hidden" value="{{row.qrCode.id}}" readonly class="form-control" />
</script>
<script id="nameTpl" type="text/html">
<input id="storageInfoList{{idx}}_name" name="storageInfoList[{{idx}}].name" type="text" value="{{row.name}}" onchange="onInputChange('{{idx}}', this, 'name')" class="form-control "/>
<input id="storageInfoList{{idx}}_name" name="storageInfoList[{{idx}}].name" type="text"
readonly
value="{{row.name}}" onchange="onInputChange('{{idx}}', this, 'name')" class="form-control "/>
</script>
<script id="typeTpl" type="text/html">//<!--
<sys:treeselect id="storageInfoList{{idx}}_type" name="storageInfoList[{{idx}}].type.id" value="{{row.type.id}}" labelName="storageInfoList{{idx}}.type.name" labelValue="{{row.type.name}}"
title="类型" url="/warehouse/materialtype/materialType/treeData" cssClass="form-control " allowClear="true" allowSearch="true" callback="onSelectType" />//-->
title="类型" url="/warehouse/materialtype/materialType/treeData" cssClass="form-control "
disabled="disabled"
allowClear="true" allowSearch="true" callback="onSelectType" />//-->
</script>
<script id="modelTpl" type="text/html">
<input id="storageInfoList{{idx}}_model" name="storageInfoList[{{idx}}].model" type="text" value="{{row.model}}" onchange="onInputChange('{{idx}}', this, 'model')" class="form-control "/>
<input id="storageInfoList{{idx}}_model" name="storageInfoList[{{idx}}].model" type="text" value="{{row.model}}"
readonly
onchange="onInputChange('{{idx}}', this, 'model')" class="form-control "/>
</script>
<script id="shelvesTpl" type="text/html">
<input id="storageInfoList{{idx}}_shelvesName" name="storageInfoList[{{idx}}].shelves.name" type="text" value="{{row.shelves.name}}" readonly class="form-control" />
<input id="storageInfoList{{idx}}_shelvesName" name="storageInfoList[{{idx}}].shelves.name" type="text" value="{{row.shelves.name}}"
readonly class="form-control" />
</script>
<script id="remarksTpl" type="text/html">
<textarea id="storageInfoList{{idx}}_remarks" name="storageInfoList[{{idx}}].remarks" rows="4" onchange="onInputChange('{{idx}}', this, 'remarks')" class="form-control ">{{row.remarks}}</textarea>
</script>
<script id="scanResultTpl" type="text/html">
<br>
<div class="container-fluid">
<div class="row">
<div class="col-xs-2 text-right">
<label>扫码结果:</label>
</div>
<div class="col-xs-10">
<input type="text" id="scanResult" class="form-control" onchange="onScanChange(this)">
<span class="text-danger">请切换英文输入法</span>
</div>
</div>
</div>
<br>
</script>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment