Browse Source

[fix]

仓库管理 库存盘点
修改添加、编辑库存盘点页面,修改选择物料回调函数;
修改物料选择页面;
dev
王晓迪 1 month ago
parent
commit
ae4aeefb97
  1. 38
      ruoyi-admin/src/main/resources/templates/warehouse/inventoryCheck/add.html
  2. 37
      ruoyi-admin/src/main/resources/templates/warehouse/inventoryCheck/edit.html
  3. 38
      ruoyi-admin/src/main/resources/templates/warehouse/inventoryCheck/materialSelect.html

38
ruoyi-admin/src/main/resources/templates/warehouse/inventoryCheck/add.html

@ -124,7 +124,7 @@
//添加物料信息
function insertRow() {
var url = ctx + 'warehouse/inventoryCheck/materialSelect';
var url = ctx + "erp/material/select";
var options = {
title: '选择物料',
url: url,
@ -168,27 +168,41 @@
})
function doSubmit(index, layero,uniqueId){
console.log(uniqueId);
var iframeWin = window[layero.find('iframe')[0]['name']];
var rowData = iframeWin.$('#bootstrap-materialSelect-table').bootstrapTable('getSelections')[0];
console.log("rowData: "+rowData);
$("#bootstrap-table").bootstrapTable('insertRow', {
index:1,
row: {
var rowData = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections');
//判断是否重复
var data = $("#bootstrap-table").bootstrapTable('getData');
var rows = data.length;
if(rows > 0){
for(var i=0;i<rows;i++){
for(var j=0;j<rowData.length;j++){
if(data[i].materialNo===rowData[j].materialNo){
$.modal.alertError("不能选择已添加过的相同物料");
rowData.split(j,1);
break;
}
}
};
}
for(i=0;i<rowData.length;i++){
insertTable(rowData[i]);
}
layer.close(index);
}
function insertTable(rowData){
var newRow = {
materialNo:rowData.materialNo,
materialName: rowData.materialName,
materialDescribe: rowData.materialDescribe,
materialUnit: rowData.materialUnit,
materialDescribe: rowData.describe,
materialUnit: rowData.unit,
inventoryCheckNum : "",
inventoryAccountNum : "",
warehouseStoreAddress : "",
batchNumber : "",
remark : ""
}
})
layer.close(index);
$("#bootstrap-table").bootstrapTable('append',newRow);
}
// 逻辑删除前端的一行数据
function removeRow(materialNo){
$("#bootstrap-table").bootstrapTable('remove', {field: 'materialNo', values: materialNo})

37
ruoyi-admin/src/main/resources/templates/warehouse/inventoryCheck/edit.html

@ -134,7 +134,7 @@
//添加物料信息
function insertRow() {
var url = ctx + 'warehouse/inventoryCheck/materialSelect';
var url = ctx + "erp/material/select";
var options = {
title: '选择物料',
url: url,
@ -189,25 +189,40 @@
return curParams;
}
function doSubmit(index, layero,uniqueId){
console.log(uniqueId);
var iframeWin = window[layero.find('iframe')[0]['name']];
var rowData = iframeWin.$('#bootstrap-materialSelect-table').bootstrapTable('getSelections')[0];
console.log("rowData: "+rowData);
$("#bootstrap-table").bootstrapTable('insertRow', {
index:1,
row: {
var rowData = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections');
//判断是否重复
var data = $("#bootstrap-table").bootstrapTable('getData');
var rows = data.length;
if(rows > 0){
for(var i=0;i<rows;i++){
for(var j=0;j<rowData.length;j++){
if(data[i].materialNo===rowData[j].materialNo){
$.modal.alertError("不能选择已添加过的相同物料");
rowData.split(j,1);
break;
}
}
};
}
for(i=0;i<rowData.length;i++){
insertTable(rowData[i]);
}
layer.close(index);
}
function insertTable(rowData){
var newRow = {
materialNo:rowData.materialNo,
materialName: rowData.materialName,
materialDescribe: rowData.materialDescribe,
materialUnit: rowData.materialUnit,
materialDescribe: rowData.describe,
materialUnit: rowData.unit,
inventoryCheckNum : "",
inventoryAccountNum : "",
warehouseStoreAddress : "",
batchNumber : "",
remark : ""
}
})
layer.close(index);
$("#bootstrap-table").bootstrapTable('append',newRow);
}
// 逻辑删除前端的一行数据
function removeRow(materialNo){

38
ruoyi-admin/src/main/resources/templates/warehouse/inventoryCheck/materialSelect.html

@ -6,8 +6,29 @@
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
<label>料号:</label>
<input type="text" name="materialNo"/>
</li>
<li>
<label>物料名称:</label>
<input type="text" name="materialName"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-materialSelect-table"></table>
<table id="bootstrap-select-table"></table>
</div>
</div>
</div>
@ -22,14 +43,19 @@
$(function() {
var materialList = [[${materialList}]];
materialList.forEach(function (data){
data.describe = data.materialDescribe;
data.brand = data.materialBrand;
data.unit = data.materialUnit;
})
var formattedData = {
total: materialList.length, // 总记录数
rows: materialList // 数据行
};
var options = {
id: 'bootstrap-materialSelect-table',
id: 'bootstrap-select-table',
clickToSelect: true, // 点击选中行
singleSelect: true, // 单选
// singleSelect: true, // 单选
// url: prefix + "/getAllMaterialInfo",
data: formattedData,
pagination: true,
@ -64,15 +90,15 @@
},
{
title: '描述',
field: 'materialDescribe',
field: 'describe',
},
{
title: '品牌',
field: 'materialBrand',
field: 'brand',
},
{
title: '单位',
field: 'materialUnit',
field: 'unit',
},
{ title: '加工方式',
field: 'processMethod',

Loading…
Cancel
Save