Browse Source

[fix]

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

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

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

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

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

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

@ -6,8 +6,29 @@
<body class="gray-bg"> <body class="gray-bg">
<div class="container-div"> <div class="container-div">
<div class="row"> <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"> <div class="col-sm-12 select-table table-striped">
<table id="bootstrap-materialSelect-table"></table> <table id="bootstrap-select-table"></table>
</div> </div>
</div> </div>
</div> </div>
@ -22,14 +43,19 @@
$(function() { $(function() {
var materialList = [[${materialList}]]; var materialList = [[${materialList}]];
materialList.forEach(function (data){
data.describe = data.materialDescribe;
data.brand = data.materialBrand;
data.unit = data.materialUnit;
})
var formattedData = { var formattedData = {
total: materialList.length, // 总记录数 total: materialList.length, // 总记录数
rows: materialList // 数据行 rows: materialList // 数据行
}; };
var options = { var options = {
id: 'bootstrap-materialSelect-table', id: 'bootstrap-select-table',
clickToSelect: true, // 点击选中行 clickToSelect: true, // 点击选中行
singleSelect: true, // 单选 // singleSelect: true, // 单选
// url: prefix + "/getAllMaterialInfo", // url: prefix + "/getAllMaterialInfo",
data: formattedData, data: formattedData,
pagination: true, pagination: true,
@ -64,15 +90,15 @@
}, },
{ {
title: '描述', title: '描述',
field: 'materialDescribe', field: 'describe',
}, },
{ {
title: '品牌', title: '品牌',
field: 'materialBrand', field: 'brand',
}, },
{ {
title: '单位', title: '单位',
field: 'materialUnit', field: 'unit',
}, },
{ title: '加工方式', { title: '加工方式',
field: 'processMethod', field: 'processMethod',

Loading…
Cancel
Save