优化单据中商品条码的搜索方式
This commit is contained in:
@@ -178,7 +178,7 @@
|
|||||||
var thisRows = res.data.page.rows;
|
var thisRows = res.data.page.rows;
|
||||||
for (var i = 0; i < thisRows.length; i++) {
|
for (var i = 0; i < thisRows.length; i++) {
|
||||||
if (thisRows[i].enabled) {
|
if (thisRows[i].enabled) {
|
||||||
mPropertyList += thisRows[i].nativename + ",";
|
mPropertyList += thisRows[i].nativeName + ",";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (mPropertyList) {
|
if (mPropertyList) {
|
||||||
@@ -240,7 +240,8 @@
|
|||||||
type: "get",
|
type: "get",
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
data: {
|
data: {
|
||||||
meId: meId
|
meId: meId,
|
||||||
|
mpList: mPropertyList
|
||||||
},
|
},
|
||||||
success: function (rec) {
|
success: function (rec) {
|
||||||
if(rec && rec.code === 200) {
|
if(rec && rec.code === 200) {
|
||||||
@@ -309,6 +310,27 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
getInfoByBarCode: function(barCode){
|
||||||
|
var materialExtendId = "";
|
||||||
|
$.ajax({
|
||||||
|
type: "get",
|
||||||
|
url: '/materialsExtend/getInfoByBarCode',
|
||||||
|
data:{
|
||||||
|
barCode: barCode
|
||||||
|
},
|
||||||
|
async:false,
|
||||||
|
dataType: "json",
|
||||||
|
success: function (res) {
|
||||||
|
if(res && res.code === 200) {
|
||||||
|
materialExtendId = res.data.id;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function () {
|
||||||
|
$.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return materialExtendId;
|
||||||
|
},
|
||||||
//优惠率、合计的统计方法
|
//优惠率、合计的统计方法
|
||||||
statisticsFun: function (body,UnitPrice,OperNumber,footer,taxRate) {
|
statisticsFun: function (body,UnitPrice,OperNumber,footer,taxRate) {
|
||||||
var TotalPrice = 0;
|
var TotalPrice = 0;
|
||||||
@@ -1041,8 +1063,8 @@
|
|||||||
});
|
});
|
||||||
body.find("[field='MaterialExtendId']").find(".textbox-text").focus().select(); //默认选择商品框
|
body.find("[field='MaterialExtendId']").find(".textbox-text").focus().select(); //默认选择商品框
|
||||||
//点击商品下拉框,自动加载数量、单价、金额
|
//点击商品下拉框,自动加载数量、单价、金额
|
||||||
body.find("[field='Stock']").find(input).prop("readonly","readonly");
|
body.find("[field='name'],[field='standard'],[field='model'],[field='materialOther'],[field='Stock'],[field='Unit']")
|
||||||
body.find("[field='Unit']").find(input).prop("readonly","readonly");
|
.find(input).prop("readonly","readonly");
|
||||||
//点击商品名称
|
//点击商品名称
|
||||||
body.find("[field='MaterialExtendId']").find(input).next().off("mouseup").on("mouseup",function(){
|
body.find("[field='MaterialExtendId']").find(input).next().off("mouseup").on("mouseup",function(){
|
||||||
var that = $(this);
|
var that = $(this);
|
||||||
@@ -1065,7 +1087,7 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//单行删除按钮
|
//单击删除按钮
|
||||||
body.find("[field='op']").find("img").off("click").on("click",function() {
|
body.find("[field='op']").find("img").off("click").on("click",function() {
|
||||||
$(this).closest(".datagrid-cell").click(); //点击操作
|
$(this).closest(".datagrid-cell").click(); //点击操作
|
||||||
var row = $('#materialData').datagrid('getChecked');
|
var row = $('#materialData').datagrid('getChecked');
|
||||||
@@ -1218,7 +1240,7 @@
|
|||||||
}
|
}
|
||||||
var totalRowNum = "";
|
var totalRowNum = "";
|
||||||
for (var i = 0; i < row.length; i++) {
|
for (var i = 0; i < row.length; i++) {
|
||||||
if (row[i].DepotId == "" || row[i].MaterialExtendId == "" || row[i].OperNumber == "" || row[i].UnitPrice === "" || row[i].AllPrice === "") {
|
if (row[i].DepotId == "" || row[i].barCode == "" || row[i].OperNumber == "" || row[i].UnitPrice === "" || row[i].AllPrice === "") {
|
||||||
totalRowNum += (i + 1) + "、";
|
totalRowNum += (i + 1) + "、";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1229,6 +1251,112 @@
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
//商品选择列表
|
||||||
|
initMaterialSelectData: function(){
|
||||||
|
var self = this;
|
||||||
|
$('#materialSelectData').datagrid({
|
||||||
|
height: 390,
|
||||||
|
rownumbers: false,
|
||||||
|
//动画效果
|
||||||
|
animate: false,
|
||||||
|
pagination: true,
|
||||||
|
//选中单行
|
||||||
|
singleSelect: true,
|
||||||
|
collapsible: false,
|
||||||
|
//交替出现背景
|
||||||
|
striped: true,
|
||||||
|
pageSize: 10,
|
||||||
|
pageList: initPageNum,
|
||||||
|
columns: [[
|
||||||
|
{field: 'id',width:35,align:"center",checkbox:true},
|
||||||
|
{field: 'mBarCode', title: '条码', width: 120},
|
||||||
|
{field: 'name', title: '名称', width: 140},
|
||||||
|
{field: 'standard', title: '规格', width: 80},
|
||||||
|
{field: 'model', title: '型号', width: 80},
|
||||||
|
{field: 'unit', title: '单位', width: 60},
|
||||||
|
{field: 'stock', title: '库存', width: 50},
|
||||||
|
{field: 'expand', title: '扩展信息', width: 80}
|
||||||
|
]],
|
||||||
|
onBeforeLoad: function(param){
|
||||||
|
param.mpList = mPropertyList; //商品属性
|
||||||
|
},
|
||||||
|
onDblClickRow: function (index, row) {
|
||||||
|
var monthTime = getNowFormatMonth();
|
||||||
|
$('#materialSelectDlg').dialog('close');
|
||||||
|
self.materialSelect(row,monthTime);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//商品选择列表-分页
|
||||||
|
initMaterialSelectPager: function(depotId){
|
||||||
|
var self = this;
|
||||||
|
try {
|
||||||
|
var opts = $("#materialSelectData").datagrid('options');
|
||||||
|
var pager = $("#materialSelectData").datagrid('getPager');
|
||||||
|
pager.pagination({
|
||||||
|
onSelectPage: function (pageNum, pageSize) {
|
||||||
|
opts.pageNumber = pageNum;
|
||||||
|
opts.pageSize = pageSize;
|
||||||
|
pager.pagination('refresh', {
|
||||||
|
pageNumber: pageNum,
|
||||||
|
pageSize: pageSize
|
||||||
|
});
|
||||||
|
self.showMaterialSelect(depotId, pageNum, pageSize);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
$.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//商品选择列表-查询
|
||||||
|
showMaterialSelect: function(depotId, pageNo, pageSize){
|
||||||
|
$.ajax({
|
||||||
|
type: "get",
|
||||||
|
url: "/material/findBySelect",
|
||||||
|
dataType: "json",
|
||||||
|
data: ({
|
||||||
|
q: $("#searchBarCode").textbox("getValue"),
|
||||||
|
mpList: mPropertyList,
|
||||||
|
depotId: depotId,
|
||||||
|
page: pageNo,
|
||||||
|
rows: pageSize
|
||||||
|
}),
|
||||||
|
success: function (res) {
|
||||||
|
if(res) {
|
||||||
|
$("#materialSelectData").datagrid('loadData', res);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//此处添加错误处理
|
||||||
|
error: function () {
|
||||||
|
$.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//商品选择列表-事件
|
||||||
|
materialSelectFun: function(depotId){
|
||||||
|
var self = this;
|
||||||
|
var monthTime = getNowFormatMonth();
|
||||||
|
$("#searchBarCode").textbox("setValue","");
|
||||||
|
$("#searchMaterialBtn").off("click").on("click",function(){
|
||||||
|
self.showMaterialSelect(depotId,1,initPageSize);
|
||||||
|
var opts = $("#materialSelectData").datagrid('options');
|
||||||
|
var pager = $("#materialSelectData").datagrid('getPager');
|
||||||
|
opts.pageNumber = 1;
|
||||||
|
opts.pageSize = initPageSize;
|
||||||
|
pager.pagination('refresh', {
|
||||||
|
pageNumber: 1,
|
||||||
|
pageSize: initPageSize
|
||||||
|
});
|
||||||
|
});
|
||||||
|
$("#checkMaterial").off("click").on("click",function(){
|
||||||
|
var rowData = $("#materialSelectData").datagrid('getChecked')[0];
|
||||||
|
$('#materialSelectDlg').dialog('close');
|
||||||
|
self.materialSelect(rowData,monthTime);
|
||||||
|
});
|
||||||
|
$("#searchMaterialBtn").click();
|
||||||
|
},
|
||||||
//选择商品
|
//选择商品
|
||||||
materialSelect: function(rec,monthTime) {
|
materialSelect: function(rec,monthTime) {
|
||||||
var self = this;
|
var self = this;
|
||||||
@@ -1242,7 +1370,8 @@
|
|||||||
type: "get",
|
type: "get",
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
data: {
|
data: {
|
||||||
meId: meId
|
meId: meId,
|
||||||
|
mpList: mPropertyList
|
||||||
},
|
},
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
if(res && res.code === 200) {
|
if(res && res.code === 200) {
|
||||||
@@ -1256,6 +1385,11 @@
|
|||||||
footer =$("#depotHeadFM .datagrid-view2 .datagrid-footer");
|
footer =$("#depotHeadFM .datagrid-view2 .datagrid-footer");
|
||||||
input = "input[type=text]";
|
input = "input[type=text]";
|
||||||
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
|
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
|
||||||
|
currentRowDom.find("[field='barCode']").find(".datagrid-editable-input").textbox("setValue",info.mBarCode).prop("readonly","readonly");
|
||||||
|
currentRowDom.find("[field='name']").find(input).val(info.name).prop("readonly","readonly");
|
||||||
|
currentRowDom.find("[field='standard']").find(input).val(info.standard).prop("readonly","readonly");
|
||||||
|
currentRowDom.find("[field='model']").find(input).val(info.model).prop("readonly","readonly");
|
||||||
|
currentRowDom.find("[field='materialOther']").find(input).val(info.materialOther).prop("readonly","readonly");
|
||||||
currentRowDom.find("[field='Unit']").find(input).prop("readonly","readonly"); //设置计量单位为只读
|
currentRowDom.find("[field='Unit']").find(input).prop("readonly","readonly"); //设置计量单位为只读
|
||||||
currentRowDom.find("[field='Unit']").find(input).val(commodityUnit); //设置单位
|
currentRowDom.find("[field='Unit']").find(input).val(commodityUnit); //设置单位
|
||||||
if(info.unit){ //如果存在计量单位信息
|
if(info.unit){ //如果存在计量单位信息
|
||||||
|
|||||||
@@ -134,6 +134,26 @@
|
|||||||
<a href="javascript:void(0)" id="cancelDepotHeadShow" class="easyui-linkbutton" iconCls="icon-cancel"
|
<a href="javascript:void(0)" id="cancelDepotHeadShow" class="easyui-linkbutton" iconCls="icon-cancel"
|
||||||
onclick="javascript:$('#depotHeadDlgShow').dialog('close')">取消</a>
|
onclick="javascript:$('#depotHeadDlgShow').dialog('close')">取消</a>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="materialSelectDlg" class="easyui-dialog" style="width:880px;padding:10px 20px;"
|
||||||
|
closed="true" modal="true" buttons="#materialSelectDlgBtn" cache="false" collapsible="false" closable="true">
|
||||||
|
<div class="box-body form-inline">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label">条码:</label>
|
||||||
|
<div class="control-inline">
|
||||||
|
<input type="text" id="searchBarCode" name="searchBarCode" value="" maxlength="100" class="easyui-textbox width-90"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchMaterialBtn">查询</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<table id="materialSelectData" style="top:100px;border-bottom-color:#FFFFFF"></table>
|
||||||
|
</div>
|
||||||
|
<div id="materialSelectDlgBtn">
|
||||||
|
<a href="javascript:void(0)" id="checkMaterial" class="easyui-linkbutton" iconCls="icon-ok">选择</a>
|
||||||
|
<a href="javascript:void(0)" id="cancelMaterial" class="easyui-linkbutton" iconCls="icon-cancel"
|
||||||
|
onclick="javascript:$('#materialSelectDlg').dialog('close')">取消</a>
|
||||||
|
</div>
|
||||||
<div id="depot"></div>
|
<div id="depot"></div>
|
||||||
<script>
|
<script>
|
||||||
$(function(){
|
$(function(){
|
||||||
@@ -475,8 +495,9 @@
|
|||||||
footer =$("#depotHeadFM .datagrid-view2 .datagrid-footer");
|
footer =$("#depotHeadFM .datagrid-view2 .datagrid-footer");
|
||||||
input = "input[type=text]";
|
input = "input[type=text]";
|
||||||
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
|
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
|
||||||
var mId = currentRowDom.find("[field='MaterialExtendId']").find(".textbox-value").val();
|
var barCode = currentRowDom.find("[field='barCode']").find(".textbox-value").val();
|
||||||
if(mId){
|
if(barCode){
|
||||||
|
var mId = inOutService.getInfoByBarCode(barCode);
|
||||||
var type = "select"; //type 类型:点击 click,选择 select
|
var type = "select"; //type 类型:点击 click,选择 select
|
||||||
inOutService.findStockNumById(depotId, mId, monthTime, currentRowDom, input, ratioDepot, type);
|
inOutService.findStockNumById(depotId, mId, monthTime, currentRowDom, input, ratioDepot, type);
|
||||||
}
|
}
|
||||||
@@ -484,53 +505,35 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ title: '条码_名称(规格)(型号)(扩展信息)(单位)',field: 'MaterialExtendId',width:270,
|
{ title: '条码',field: 'barCode', editor:'validatebox', width:120,
|
||||||
formatter:function(value,row,index){
|
editor: {
|
||||||
return row.MaterialName;
|
type: 'textbox',
|
||||||
},
|
options: {
|
||||||
editor:{
|
buttonText:'...',
|
||||||
type:'combogrid',
|
editable:false,
|
||||||
options:{
|
onClickButton: function(){
|
||||||
url: "/material/findBySelect",
|
var rowDom = $(this).closest(".datagrid-row").find("[field='op']").find("img");
|
||||||
idField:'Id',
|
rowDom.closest(".datagrid-cell").click(); //点击操作
|
||||||
textField:'MaterialName',
|
var row = $('#materialData').datagrid('getChecked');
|
||||||
method:'get',
|
editIndex = $('#materialData').datagrid("getRowIndex", row[0]);
|
||||||
pagination: true,
|
var depotId;
|
||||||
mode: 'remote',
|
|
||||||
hasDownArrow: false,
|
|
||||||
panelWidth: 630, //下拉框的宽度
|
|
||||||
panelHeight: 380,//下拉框的高度
|
|
||||||
columns:[[
|
|
||||||
{field:'mBarCode',title:'条码',width:120},
|
|
||||||
{field:'name',title:'名称',width:140},
|
|
||||||
{field:'standard',title:'规格',width:80},
|
|
||||||
{field:'model',title:'型号',width:80},
|
|
||||||
{field:'unit',title:'单位',width:60},
|
|
||||||
{field:'stock',title:'库存',width:50},
|
|
||||||
{field:'expand',title:'扩展信息',width:80}
|
|
||||||
]],
|
|
||||||
onBeforeLoad: function(param){
|
|
||||||
var edDepot = $('#materialData').datagrid('getEditor', {index:editIndex,field:'DepotId'});
|
var edDepot = $('#materialData').datagrid('getEditor', {index:editIndex,field:'DepotId'});
|
||||||
if(edDepot) {
|
if(edDepot) {
|
||||||
param.depotId = $(edDepot.target).combobox('getValue');
|
depotId = $(edDepot.target).combobox('getValue');
|
||||||
}
|
}
|
||||||
param.mpList = mPropertyList; //商品属性
|
$('#materialSelectDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui/themes/icons/edit_add.png"/> 选择商品');
|
||||||
},
|
$("#materialSelectDlg").panel("move",{top:$(document).scrollTop() + ($(window).height()-500) * 0.5});
|
||||||
onLoadSuccess: function (rec) {
|
inOutService.initMaterialSelectData();
|
||||||
if(rec && rec.total==1) {
|
inOutService.initMaterialSelectPager(depotId);
|
||||||
$(".datagrid-body [field='mBarCode']").click(); //在只有单个商品的时候自动选中
|
inOutService.materialSelectFun(depotId);
|
||||||
var body =$("#depotHeadFM .datagrid-view2 .datagrid-body");
|
|
||||||
input = "input[type=text]";
|
|
||||||
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
|
|
||||||
currentRowDom.find("[field='OperNumber']").find(input).focus().select();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onSelect:function(index, rowData){
|
|
||||||
inOutService.materialSelect(rowData,monthTime);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{ title: '名称', field: 'name', editor: 'validatebox', width: 100},
|
||||||
|
{ title: '规格', field: 'standard', editor: 'validatebox', width: 60},
|
||||||
|
{ title: '型号', field: 'model', editor: 'validatebox', width: 60},
|
||||||
|
{ title: '扩展信息', field: 'materialOther', editor: 'validatebox', width: 70},
|
||||||
{ title: '库存',field: 'Stock',editor:'validatebox',width:50},
|
{ title: '库存',field: 'Stock',editor:'validatebox',width:50},
|
||||||
{ title: '调入仓库', field: 'AnotherDepotId',editor:'validatebox',width:90,
|
{ title: '调入仓库', field: 'AnotherDepotId',editor:'validatebox',width:90,
|
||||||
formatter: function (value, row, index) {
|
formatter: function (value, row, index) {
|
||||||
@@ -613,6 +616,7 @@
|
|||||||
if(type === "add") {
|
if(type === "add") {
|
||||||
$("#depotHeadDlg #append").click(); //新增行
|
$("#depotHeadDlg #append").click(); //新增行
|
||||||
} else if(type === "edit") {
|
} else if(type === "edit") {
|
||||||
|
editIndex = 0;
|
||||||
for(var i=0;i<data.rows.length;i++){
|
for(var i=0;i<data.rows.length;i++){
|
||||||
$('#materialData').datagrid('selectRow', i).datagrid('beginEdit', i);
|
$('#materialData').datagrid('selectRow', i).datagrid('beginEdit', i);
|
||||||
inOutService.autoReckon();
|
inOutService.autoReckon();
|
||||||
@@ -643,7 +647,11 @@
|
|||||||
showFooter: true,
|
showFooter: true,
|
||||||
columns:[[
|
columns:[[
|
||||||
{ title: '仓库名称',field: 'DepotName',editor:'validatebox',width:90},
|
{ title: '仓库名称',field: 'DepotName',editor:'validatebox',width:90},
|
||||||
{ title: '条码_名称(规格)(型号)(扩展信息)(单位)',field: 'MaterialName',width:270},
|
{ title: '条码',field: 'barCode', editor:'validatebox', width:120},
|
||||||
|
{ title: '名称', field: 'name', editor: 'validatebox', width: 100},
|
||||||
|
{ title: '规格', field: 'standard', editor: 'validatebox', width: 60},
|
||||||
|
{ title: '型号', field: 'model', editor: 'validatebox', width: 60},
|
||||||
|
{ title: '扩展信息', field: 'materialOther', editor: 'validatebox', width: 70},
|
||||||
{ title: '库存',field: 'Stock',width:50},
|
{ title: '库存',field: 'Stock',width:50},
|
||||||
{ title: '调入仓库',field: 'AnotherDepotName',width:90},
|
{ title: '调入仓库',field: 'AnotherDepotName',width:90},
|
||||||
{ title: '单位',field: 'Unit',editor:'validatebox',width:60},
|
{ title: '单位',field: 'Unit',editor:'validatebox',width:60},
|
||||||
|
|||||||
@@ -133,6 +133,26 @@
|
|||||||
<a href="javascript:void(0)" id="cancelDepotHeadShow" class="easyui-linkbutton" iconCls="icon-cancel"
|
<a href="javascript:void(0)" id="cancelDepotHeadShow" class="easyui-linkbutton" iconCls="icon-cancel"
|
||||||
onclick="javascript:$('#depotHeadDlgShow').dialog('close')">取消</a>
|
onclick="javascript:$('#depotHeadDlgShow').dialog('close')">取消</a>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="materialSelectDlg" class="easyui-dialog" style="width:880px;padding:10px 20px;"
|
||||||
|
closed="true" modal="true" buttons="#materialSelectDlgBtn" cache="false" collapsible="false" closable="true">
|
||||||
|
<div class="box-body form-inline">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label">条码:</label>
|
||||||
|
<div class="control-inline">
|
||||||
|
<input type="text" id="searchBarCode" name="searchBarCode" value="" maxlength="100" class="easyui-textbox width-90"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchMaterialBtn">查询</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<table id="materialSelectData" style="top:100px;border-bottom-color:#FFFFFF"></table>
|
||||||
|
</div>
|
||||||
|
<div id="materialSelectDlgBtn">
|
||||||
|
<a href="javascript:void(0)" id="checkMaterial" class="easyui-linkbutton" iconCls="icon-ok">选择</a>
|
||||||
|
<a href="javascript:void(0)" id="cancelMaterial" class="easyui-linkbutton" iconCls="icon-cancel"
|
||||||
|
onclick="javascript:$('#materialSelectDlg').dialog('close')">取消</a>
|
||||||
|
</div>
|
||||||
<div id="depot"></div>
|
<div id="depot"></div>
|
||||||
<script>
|
<script>
|
||||||
$(function(){
|
$(function(){
|
||||||
@@ -455,7 +475,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ title: '商品类型',field: 'MType',editor:'validatebox',width:80},
|
{ title: '商品类型',field: 'MType',editor:'validatebox',width:80},
|
||||||
{ title: '仓库名称', field: 'DepotId', editor:'validatebox', width: 90,
|
{ title: '仓库名称', field: 'DepotId', editor: 'validatebox', width: 90,
|
||||||
formatter: function (value, row, index) {
|
formatter: function (value, row, index) {
|
||||||
return row.DepotName;
|
return row.DepotName;
|
||||||
},
|
},
|
||||||
@@ -473,8 +493,9 @@
|
|||||||
footer =$("#depotHeadFM .datagrid-view2 .datagrid-footer");
|
footer =$("#depotHeadFM .datagrid-view2 .datagrid-footer");
|
||||||
input = "input[type=text]";
|
input = "input[type=text]";
|
||||||
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
|
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
|
||||||
var mId = currentRowDom.find("[field='MaterialExtendId']").find(".textbox-value").val();
|
var barCode = currentRowDom.find("[field='barCode']").find(".textbox-value").val();
|
||||||
if(mId){
|
if(barCode){
|
||||||
|
var mId = inOutService.getInfoByBarCode(barCode);
|
||||||
var type = "select"; //type 类型:点击 click,选择 select
|
var type = "select"; //type 类型:点击 click,选择 select
|
||||||
inOutService.findStockNumById(depotId, mId, monthTime, currentRowDom, input, ratioDepot, type);
|
inOutService.findStockNumById(depotId, mId, monthTime, currentRowDom, input, ratioDepot, type);
|
||||||
}
|
}
|
||||||
@@ -482,53 +503,35 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ title: '条码_名称(规格)(型号)(扩展信息)(单位)',field: 'MaterialExtendId',width:270,
|
{ title: '条码',field: 'barCode', editor:'validatebox', width:120,
|
||||||
formatter:function(value,row,index){
|
editor: {
|
||||||
return row.MaterialName;
|
type: 'textbox',
|
||||||
},
|
options: {
|
||||||
editor:{
|
buttonText:'...',
|
||||||
type:'combogrid',
|
editable:false,
|
||||||
options:{
|
onClickButton: function(){
|
||||||
url: "/material/findBySelect",
|
var rowDom = $(this).closest(".datagrid-row").find("[field='op']").find("img");
|
||||||
idField:'Id',
|
rowDom.closest(".datagrid-cell").click(); //点击操作
|
||||||
textField:'MaterialName',
|
var row = $('#materialData').datagrid('getChecked');
|
||||||
method:'get',
|
editIndex = $('#materialData').datagrid("getRowIndex", row[0]);
|
||||||
pagination: true,
|
var depotId;
|
||||||
mode: 'remote',
|
|
||||||
hasDownArrow: false,
|
|
||||||
panelWidth: 630, //下拉框的宽度
|
|
||||||
panelHeight: 380,//下拉框的高度
|
|
||||||
columns:[[
|
|
||||||
{field:'mBarCode',title:'条码',width:120},
|
|
||||||
{field:'name',title:'名称',width:140},
|
|
||||||
{field:'standard',title:'规格',width:80},
|
|
||||||
{field:'model',title:'型号',width:80},
|
|
||||||
{field:'unit',title:'单位',width:60},
|
|
||||||
{field:'stock',title:'库存',width:50},
|
|
||||||
{field:'expand',title:'扩展信息',width:80}
|
|
||||||
]],
|
|
||||||
onBeforeLoad: function(param){
|
|
||||||
var edDepot = $('#materialData').datagrid('getEditor', {index:editIndex,field:'DepotId'});
|
var edDepot = $('#materialData').datagrid('getEditor', {index:editIndex,field:'DepotId'});
|
||||||
if(edDepot) {
|
if(edDepot) {
|
||||||
param.depotId = $(edDepot.target).combobox('getValue');
|
depotId = $(edDepot.target).combobox('getValue');
|
||||||
}
|
}
|
||||||
param.mpList = mPropertyList; //商品属性
|
$('#materialSelectDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui/themes/icons/edit_add.png"/> 选择商品');
|
||||||
},
|
$("#materialSelectDlg").panel("move",{top:$(document).scrollTop() + ($(window).height()-500) * 0.5});
|
||||||
onLoadSuccess: function (rec) {
|
inOutService.initMaterialSelectData();
|
||||||
if(rec && rec.total==1) {
|
inOutService.initMaterialSelectPager(depotId);
|
||||||
$(".datagrid-body [field='mBarCode']").click(); //在只有单个商品的时候自动选中
|
inOutService.materialSelectFun(depotId);
|
||||||
var body =$("#depotHeadFM .datagrid-view2 .datagrid-body");
|
|
||||||
input = "input[type=text]";
|
|
||||||
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
|
|
||||||
currentRowDom.find("[field='OperNumber']").find(input).focus().select();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onSelect:function(index, rowData){
|
|
||||||
inOutService.materialSelect(rowData,monthTime);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{ title: '名称', field: 'name', editor: 'validatebox', width: 100},
|
||||||
|
{ title: '规格', field: 'standard', editor: 'validatebox', width: 60},
|
||||||
|
{ title: '型号', field: 'model', editor: 'validatebox', width: 60},
|
||||||
|
{ title: '扩展信息', field: 'materialOther', editor: 'validatebox', width: 70},
|
||||||
{ title: '库存',field: 'Stock',editor:'validatebox',width:50},
|
{ title: '库存',field: 'Stock',editor:'validatebox',width:50},
|
||||||
{ title: '单位',field: 'Unit',editor:'validatebox',width:60},
|
{ title: '单位',field: 'Unit',editor:'validatebox',width:60},
|
||||||
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
|
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
|
||||||
@@ -597,6 +600,7 @@
|
|||||||
if(type === "add") {
|
if(type === "add") {
|
||||||
$("#depotHeadDlg #append").click(); //新增行
|
$("#depotHeadDlg #append").click(); //新增行
|
||||||
} else if(type === "edit") {
|
} else if(type === "edit") {
|
||||||
|
editIndex = 0;
|
||||||
for(var i=0;i<data.rows.length;i++){
|
for(var i=0;i<data.rows.length;i++){
|
||||||
$('#materialData').datagrid('selectRow', i).datagrid('beginEdit', i);
|
$('#materialData').datagrid('selectRow', i).datagrid('beginEdit', i);
|
||||||
inOutService.autoReckon();
|
inOutService.autoReckon();
|
||||||
@@ -628,7 +632,11 @@
|
|||||||
columns:[[
|
columns:[[
|
||||||
{ title: '商品类型',field: 'MType',width:80},
|
{ title: '商品类型',field: 'MType',width:80},
|
||||||
{ title: '仓库名称',field: 'DepotName',editor:'validatebox',width:90},
|
{ title: '仓库名称',field: 'DepotName',editor:'validatebox',width:90},
|
||||||
{ title: '条码_名称(规格)(型号)(扩展信息)(单位)',field: 'MaterialName',width:270},
|
{ title: '条码',field: 'barCode', editor:'validatebox', width:120},
|
||||||
|
{ title: '名称', field: 'name', editor: 'validatebox', width: 100},
|
||||||
|
{ title: '规格', field: 'standard', editor: 'validatebox', width: 60},
|
||||||
|
{ title: '型号', field: 'model', editor: 'validatebox', width: 60},
|
||||||
|
{ title: '扩展信息', field: 'materialOther', editor: 'validatebox', width: 70},
|
||||||
{ title: '库存',field: 'Stock',width:50},
|
{ title: '库存',field: 'Stock',width:50},
|
||||||
{ title: '单位',field: 'Unit',editor:'validatebox',width:60},
|
{ title: '单位',field: 'Unit',editor:'validatebox',width:60},
|
||||||
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
|
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
|
||||||
|
|||||||
@@ -133,6 +133,26 @@
|
|||||||
<a href="javascript:void(0)" id="cancelDepotHeadShow" class="easyui-linkbutton" iconCls="icon-cancel"
|
<a href="javascript:void(0)" id="cancelDepotHeadShow" class="easyui-linkbutton" iconCls="icon-cancel"
|
||||||
onclick="javascript:$('#depotHeadDlgShow').dialog('close')">取消</a>
|
onclick="javascript:$('#depotHeadDlgShow').dialog('close')">取消</a>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="materialSelectDlg" class="easyui-dialog" style="width:880px;padding:10px 20px;"
|
||||||
|
closed="true" modal="true" buttons="#materialSelectDlgBtn" cache="false" collapsible="false" closable="true">
|
||||||
|
<div class="box-body form-inline">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label">条码:</label>
|
||||||
|
<div class="control-inline">
|
||||||
|
<input type="text" id="searchBarCode" name="searchBarCode" value="" maxlength="100" class="easyui-textbox width-90"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchMaterialBtn">查询</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<table id="materialSelectData" style="top:100px;border-bottom-color:#FFFFFF"></table>
|
||||||
|
</div>
|
||||||
|
<div id="materialSelectDlgBtn">
|
||||||
|
<a href="javascript:void(0)" id="checkMaterial" class="easyui-linkbutton" iconCls="icon-ok">选择</a>
|
||||||
|
<a href="javascript:void(0)" id="cancelMaterial" class="easyui-linkbutton" iconCls="icon-cancel"
|
||||||
|
onclick="javascript:$('#materialSelectDlg').dialog('close')">取消</a>
|
||||||
|
</div>
|
||||||
<div id="depot"></div>
|
<div id="depot"></div>
|
||||||
<script>
|
<script>
|
||||||
$(function(){
|
$(function(){
|
||||||
@@ -474,8 +494,9 @@
|
|||||||
footer =$("#depotHeadFM .datagrid-view2 .datagrid-footer");
|
footer =$("#depotHeadFM .datagrid-view2 .datagrid-footer");
|
||||||
input = "input[type=text]";
|
input = "input[type=text]";
|
||||||
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
|
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
|
||||||
var mId = currentRowDom.find("[field='MaterialExtendId']").find(".textbox-value").val();
|
var barCode = currentRowDom.find("[field='barCode']").find(".textbox-value").val();
|
||||||
if(mId){
|
if(barCode){
|
||||||
|
var mId = inOutService.getInfoByBarCode(barCode);
|
||||||
var type = "select"; //type 类型:点击 click,选择 select
|
var type = "select"; //type 类型:点击 click,选择 select
|
||||||
inOutService.findStockNumById(depotId, mId, monthTime, currentRowDom, input, ratioDepot, type);
|
inOutService.findStockNumById(depotId, mId, monthTime, currentRowDom, input, ratioDepot, type);
|
||||||
}
|
}
|
||||||
@@ -483,53 +504,35 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ title: '条码_名称(规格)(型号)(扩展信息)(单位)',field: 'MaterialExtendId',width:270,
|
{ title: '条码',field: 'barCode', editor:'validatebox', width:120,
|
||||||
formatter:function(value,row,index){
|
editor: {
|
||||||
return row.MaterialName;
|
type: 'textbox',
|
||||||
},
|
options: {
|
||||||
editor:{
|
buttonText:'...',
|
||||||
type:'combogrid',
|
editable:false,
|
||||||
options:{
|
onClickButton: function(){
|
||||||
url: "/material/findBySelect",
|
var rowDom = $(this).closest(".datagrid-row").find("[field='op']").find("img");
|
||||||
idField:'Id',
|
rowDom.closest(".datagrid-cell").click(); //点击操作
|
||||||
textField:'MaterialName',
|
var row = $('#materialData').datagrid('getChecked');
|
||||||
method:'get',
|
editIndex = $('#materialData').datagrid("getRowIndex", row[0]);
|
||||||
pagination: true,
|
var depotId;
|
||||||
mode: 'remote',
|
|
||||||
hasDownArrow: false,
|
|
||||||
panelWidth: 630, //下拉框的宽度
|
|
||||||
panelHeight: 380,//下拉框的高度
|
|
||||||
columns:[[
|
|
||||||
{field:'mBarCode',title:'条码',width:120},
|
|
||||||
{field:'name',title:'名称',width:140},
|
|
||||||
{field:'standard',title:'规格',width:80},
|
|
||||||
{field:'model',title:'型号',width:80},
|
|
||||||
{field:'unit',title:'单位',width:60},
|
|
||||||
{field:'stock',title:'库存',width:50},
|
|
||||||
{field:'expand',title:'扩展信息',width:80}
|
|
||||||
]],
|
|
||||||
onBeforeLoad: function(param){
|
|
||||||
var edDepot = $('#materialData').datagrid('getEditor', {index:editIndex,field:'DepotId'});
|
var edDepot = $('#materialData').datagrid('getEditor', {index:editIndex,field:'DepotId'});
|
||||||
if(edDepot) {
|
if(edDepot) {
|
||||||
param.depotId = $(edDepot.target).combobox('getValue');
|
depotId = $(edDepot.target).combobox('getValue');
|
||||||
}
|
}
|
||||||
param.mpList = mPropertyList; //商品属性
|
$('#materialSelectDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui/themes/icons/edit_add.png"/> 选择商品');
|
||||||
},
|
$("#materialSelectDlg").panel("move",{top:$(document).scrollTop() + ($(window).height()-500) * 0.5});
|
||||||
onLoadSuccess: function (rec) {
|
inOutService.initMaterialSelectData();
|
||||||
if(rec && rec.total==1) {
|
inOutService.initMaterialSelectPager(depotId);
|
||||||
$(".datagrid-body [field='mBarCode']").click(); //在只有单个商品的时候自动选中
|
inOutService.materialSelectFun(depotId);
|
||||||
var body =$("#depotHeadFM .datagrid-view2 .datagrid-body");
|
|
||||||
input = "input[type=text]";
|
|
||||||
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
|
|
||||||
currentRowDom.find("[field='OperNumber']").find(input).focus().select();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onSelect:function(index, rowData){
|
|
||||||
inOutService.materialSelect(rowData,monthTime);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{ title: '名称', field: 'name', editor: 'validatebox', width: 100},
|
||||||
|
{ title: '规格', field: 'standard', editor: 'validatebox', width: 60},
|
||||||
|
{ title: '型号', field: 'model', editor: 'validatebox', width: 60},
|
||||||
|
{ title: '扩展信息', field: 'materialOther', editor: 'validatebox', width: 70},
|
||||||
{ title: '库存',field: 'Stock',editor:'validatebox',width:50},
|
{ title: '库存',field: 'Stock',editor:'validatebox',width:50},
|
||||||
{ title: '单位',field: 'Unit',editor:'validatebox',width:60},
|
{ title: '单位',field: 'Unit',editor:'validatebox',width:60},
|
||||||
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
|
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
|
||||||
@@ -598,6 +601,7 @@
|
|||||||
if(type === "add") {
|
if(type === "add") {
|
||||||
$("#depotHeadDlg #append").click(); //新增行
|
$("#depotHeadDlg #append").click(); //新增行
|
||||||
} else if(type === "edit") {
|
} else if(type === "edit") {
|
||||||
|
editIndex = 0;
|
||||||
for(var i=0;i<data.rows.length;i++){
|
for(var i=0;i<data.rows.length;i++){
|
||||||
$('#materialData').datagrid('selectRow', i).datagrid('beginEdit', i);
|
$('#materialData').datagrid('selectRow', i).datagrid('beginEdit', i);
|
||||||
inOutService.autoReckon();
|
inOutService.autoReckon();
|
||||||
@@ -629,7 +633,11 @@
|
|||||||
columns:[[
|
columns:[[
|
||||||
{ title: '商品类型',field: 'MType',width:80},
|
{ title: '商品类型',field: 'MType',width:80},
|
||||||
{ title: '仓库名称',field: 'DepotName',editor:'validatebox',width:90},
|
{ title: '仓库名称',field: 'DepotName',editor:'validatebox',width:90},
|
||||||
{ title: '条码_名称(规格)(型号)(扩展信息)(单位)',field: 'MaterialName',width:270},
|
{ title: '条码',field: 'barCode', editor:'validatebox', width:120},
|
||||||
|
{ title: '名称', field: 'name', editor: 'validatebox', width: 100},
|
||||||
|
{ title: '规格', field: 'standard', editor: 'validatebox', width: 60},
|
||||||
|
{ title: '型号', field: 'model', editor: 'validatebox', width: 60},
|
||||||
|
{ title: '扩展信息', field: 'materialOther', editor: 'validatebox', width: 70},
|
||||||
{ title: '库存',field: 'Stock',width:50},
|
{ title: '库存',field: 'Stock',width:50},
|
||||||
{ title: '单位',field: 'Unit',editor:'validatebox',width:60},
|
{ title: '单位',field: 'Unit',editor:'validatebox',width:60},
|
||||||
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
|
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
|
||||||
|
|||||||
@@ -144,6 +144,26 @@
|
|||||||
<a href="javascript:void(0)" id="cancelDepotHeadShow" class="easyui-linkbutton" iconCls="icon-cancel"
|
<a href="javascript:void(0)" id="cancelDepotHeadShow" class="easyui-linkbutton" iconCls="icon-cancel"
|
||||||
onclick="javascript:$('#depotHeadDlgShow').dialog('close')">取消</a>
|
onclick="javascript:$('#depotHeadDlgShow').dialog('close')">取消</a>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="materialSelectDlg" class="easyui-dialog" style="width:880px;padding:10px 20px;"
|
||||||
|
closed="true" modal="true" buttons="#materialSelectDlgBtn" cache="false" collapsible="false" closable="true">
|
||||||
|
<div class="box-body form-inline">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label">条码:</label>
|
||||||
|
<div class="control-inline">
|
||||||
|
<input type="text" id="searchBarCode" name="searchBarCode" value="" maxlength="100" class="easyui-textbox width-90"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchMaterialBtn">查询</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<table id="materialSelectData" style="top:100px;border-bottom-color:#FFFFFF"></table>
|
||||||
|
</div>
|
||||||
|
<div id="materialSelectDlgBtn">
|
||||||
|
<a href="javascript:void(0)" id="checkMaterial" class="easyui-linkbutton" iconCls="icon-ok">选择</a>
|
||||||
|
<a href="javascript:void(0)" id="cancelMaterial" class="easyui-linkbutton" iconCls="icon-cancel"
|
||||||
|
onclick="javascript:$('#materialSelectDlg').dialog('close')">取消</a>
|
||||||
|
</div>
|
||||||
<div id="supplier"></div>
|
<div id="supplier"></div>
|
||||||
<div id="depot"></div>
|
<div id="depot"></div>
|
||||||
<script>
|
<script>
|
||||||
@@ -485,8 +505,9 @@
|
|||||||
footer =$("#depotHeadFM .datagrid-view2 .datagrid-footer");
|
footer =$("#depotHeadFM .datagrid-view2 .datagrid-footer");
|
||||||
input = "input[type=text]";
|
input = "input[type=text]";
|
||||||
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
|
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
|
||||||
var mId = currentRowDom.find("[field='MaterialExtendId']").find(".textbox-value").val();
|
var barCode = currentRowDom.find("[field='barCode']").find(".textbox-value").val();
|
||||||
if(mId){
|
if(barCode){
|
||||||
|
var mId = inOutService.getInfoByBarCode(barCode);
|
||||||
var type = "select"; //type 类型:点击 click,选择 select
|
var type = "select"; //type 类型:点击 click,选择 select
|
||||||
inOutService.findStockNumById(depotId, mId, monthTime, currentRowDom, input, ratioDepot, type);
|
inOutService.findStockNumById(depotId, mId, monthTime, currentRowDom, input, ratioDepot, type);
|
||||||
}
|
}
|
||||||
@@ -494,53 +515,35 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ title: '条码_名称(规格)(型号)(扩展信息)(单位)',field: 'MaterialExtendId',width:270,
|
{ title: '条码',field: 'barCode', editor:'validatebox', width:120,
|
||||||
formatter:function(value,row,index){
|
editor: {
|
||||||
return row.MaterialName;
|
type: 'textbox',
|
||||||
},
|
options: {
|
||||||
editor:{
|
buttonText:'...',
|
||||||
type:'combogrid',
|
editable:false,
|
||||||
options:{
|
onClickButton: function(){
|
||||||
url: "/material/findBySelect",
|
var rowDom = $(this).closest(".datagrid-row").find("[field='op']").find("img");
|
||||||
idField:'Id',
|
rowDom.closest(".datagrid-cell").click(); //点击操作
|
||||||
textField:'MaterialName',
|
var row = $('#materialData').datagrid('getChecked');
|
||||||
method:'get',
|
editIndex = $('#materialData').datagrid("getRowIndex", row[0]);
|
||||||
pagination: true,
|
var depotId;
|
||||||
mode: 'remote',
|
|
||||||
hasDownArrow: false,
|
|
||||||
panelWidth: 630, //下拉框的宽度
|
|
||||||
panelHeight: 380,//下拉框的高度
|
|
||||||
columns:[[
|
|
||||||
{field:'mBarCode',title:'条码',width:120},
|
|
||||||
{field:'name',title:'名称',width:140},
|
|
||||||
{field:'standard',title:'规格',width:80},
|
|
||||||
{field:'model',title:'型号',width:80},
|
|
||||||
{field:'unit',title:'单位',width:60},
|
|
||||||
{field:'stock',title:'库存',width:50},
|
|
||||||
{field:'expand',title:'扩展信息',width:80}
|
|
||||||
]],
|
|
||||||
onBeforeLoad: function(param){
|
|
||||||
var edDepot = $('#materialData').datagrid('getEditor', {index:editIndex,field:'DepotId'});
|
var edDepot = $('#materialData').datagrid('getEditor', {index:editIndex,field:'DepotId'});
|
||||||
if(edDepot) {
|
if(edDepot) {
|
||||||
param.depotId = $(edDepot.target).combobox('getValue');
|
depotId = $(edDepot.target).combobox('getValue');
|
||||||
}
|
}
|
||||||
param.mpList = mPropertyList; //商品属性
|
$('#materialSelectDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui/themes/icons/edit_add.png"/> 选择商品');
|
||||||
},
|
$("#materialSelectDlg").panel("move",{top:$(document).scrollTop() + ($(window).height()-500) * 0.5});
|
||||||
onLoadSuccess: function (rec) {
|
inOutService.initMaterialSelectData();
|
||||||
if(rec && rec.total==1) {
|
inOutService.initMaterialSelectPager(depotId);
|
||||||
$(".datagrid-body [field='mBarCode']").click(); //在只有单个商品的时候自动选中
|
inOutService.materialSelectFun(depotId);
|
||||||
var body =$("#depotHeadFM .datagrid-view2 .datagrid-body");
|
|
||||||
input = "input[type=text]";
|
|
||||||
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
|
|
||||||
currentRowDom.find("[field='OperNumber']").find(input).focus().select();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onSelect:function(index, rowData){
|
|
||||||
inOutService.materialSelect(rowData,monthTime);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{ title: '名称', field: 'name', editor: 'validatebox', width: 100},
|
||||||
|
{ title: '规格', field: 'standard', editor: 'validatebox', width: 60},
|
||||||
|
{ title: '型号', field: 'model', editor: 'validatebox', width: 60},
|
||||||
|
{ title: '扩展信息', field: 'materialOther', editor: 'validatebox', width: 70},
|
||||||
{ title: '库存',field: 'Stock',editor:'validatebox',width:50},
|
{ title: '库存',field: 'Stock',editor:'validatebox',width:50},
|
||||||
{ title: '单位',field: 'Unit',editor:'validatebox',width:60},
|
{ title: '单位',field: 'Unit',editor:'validatebox',width:60},
|
||||||
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
|
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
|
||||||
@@ -609,6 +612,7 @@
|
|||||||
if(type === "add") {
|
if(type === "add") {
|
||||||
$("#depotHeadDlg #append").click(); //新增行
|
$("#depotHeadDlg #append").click(); //新增行
|
||||||
} else if(type === "edit") {
|
} else if(type === "edit") {
|
||||||
|
editIndex = 0;
|
||||||
for(var i=0;i<data.rows.length;i++){
|
for(var i=0;i<data.rows.length;i++){
|
||||||
$('#materialData').datagrid('selectRow', i).datagrid('beginEdit', i);
|
$('#materialData').datagrid('selectRow', i).datagrid('beginEdit', i);
|
||||||
inOutService.autoReckon();
|
inOutService.autoReckon();
|
||||||
@@ -639,7 +643,11 @@
|
|||||||
showFooter: true,
|
showFooter: true,
|
||||||
columns:[[
|
columns:[[
|
||||||
{ title: '仓库名称',field: 'DepotName',editor:'validatebox',width:90},
|
{ title: '仓库名称',field: 'DepotName',editor:'validatebox',width:90},
|
||||||
{ title: '条码_名称(规格)(型号)(扩展信息)(单位)',field: 'MaterialName',width:270},
|
{ title: '条码',field: 'barCode', editor:'validatebox', width:120},
|
||||||
|
{ title: '名称', field: 'name', editor: 'validatebox', width: 100},
|
||||||
|
{ title: '规格', field: 'standard', editor: 'validatebox', width: 60},
|
||||||
|
{ title: '型号', field: 'model', editor: 'validatebox', width: 60},
|
||||||
|
{ title: '扩展信息', field: 'materialOther', editor: 'validatebox', width: 70},
|
||||||
{ title: '库存',field: 'Stock',width:50},
|
{ title: '库存',field: 'Stock',width:50},
|
||||||
{ title: '单位',field: 'Unit',editor:'validatebox',width:60},
|
{ title: '单位',field: 'Unit',editor:'validatebox',width:60},
|
||||||
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
|
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
|
||||||
|
|||||||
@@ -138,6 +138,26 @@
|
|||||||
<a href="javascript:void(0)" id="cancelDepotHeadShow" class="easyui-linkbutton" iconCls="icon-cancel"
|
<a href="javascript:void(0)" id="cancelDepotHeadShow" class="easyui-linkbutton" iconCls="icon-cancel"
|
||||||
onclick="javascript:$('#depotHeadDlgShow').dialog('close')">取消</a>
|
onclick="javascript:$('#depotHeadDlgShow').dialog('close')">取消</a>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="materialSelectDlg" class="easyui-dialog" style="width:880px;padding:10px 20px;"
|
||||||
|
closed="true" modal="true" buttons="#materialSelectDlgBtn" cache="false" collapsible="false" closable="true">
|
||||||
|
<div class="box-body form-inline">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label">条码:</label>
|
||||||
|
<div class="control-inline">
|
||||||
|
<input type="text" id="searchBarCode" name="searchBarCode" value="" maxlength="100" class="easyui-textbox width-90"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchMaterialBtn">查询</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<table id="materialSelectData" style="top:100px;border-bottom-color:#FFFFFF"></table>
|
||||||
|
</div>
|
||||||
|
<div id="materialSelectDlgBtn">
|
||||||
|
<a href="javascript:void(0)" id="checkMaterial" class="easyui-linkbutton" iconCls="icon-ok">选择</a>
|
||||||
|
<a href="javascript:void(0)" id="cancelMaterial" class="easyui-linkbutton" iconCls="icon-cancel"
|
||||||
|
onclick="javascript:$('#materialSelectDlg').dialog('close')">取消</a>
|
||||||
|
</div>
|
||||||
<div id="depot"></div>
|
<div id="depot"></div>
|
||||||
<script>
|
<script>
|
||||||
$(function(){
|
$(function(){
|
||||||
@@ -478,8 +498,9 @@
|
|||||||
footer =$("#depotHeadFM .datagrid-view2 .datagrid-footer");
|
footer =$("#depotHeadFM .datagrid-view2 .datagrid-footer");
|
||||||
input = "input[type=text]";
|
input = "input[type=text]";
|
||||||
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
|
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
|
||||||
var mId = currentRowDom.find("[field='MaterialExtendId']").find(".textbox-value").val();
|
var barCode = currentRowDom.find("[field='barCode']").find(".textbox-value").val();
|
||||||
if(mId){
|
if(barCode){
|
||||||
|
var mId = inOutService.getInfoByBarCode(barCode);
|
||||||
var type = "select"; //type 类型:点击 click,选择 select
|
var type = "select"; //type 类型:点击 click,选择 select
|
||||||
inOutService.findStockNumById(depotId, mId, monthTime, currentRowDom, input, ratioDepot, type);
|
inOutService.findStockNumById(depotId, mId, monthTime, currentRowDom, input, ratioDepot, type);
|
||||||
}
|
}
|
||||||
@@ -487,53 +508,35 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ title: '条码_名称(规格)(型号)(扩展信息)(单位)',field: 'MaterialExtendId',width:270,
|
{ title: '条码',field: 'barCode', editor:'validatebox', width:120,
|
||||||
formatter:function(value,row,index){
|
editor: {
|
||||||
return row.MaterialName;
|
type: 'textbox',
|
||||||
},
|
options: {
|
||||||
editor:{
|
buttonText:'...',
|
||||||
type:'combogrid',
|
editable:false,
|
||||||
options:{
|
onClickButton: function(){
|
||||||
url: "/material/findBySelect",
|
var rowDom = $(this).closest(".datagrid-row").find("[field='op']").find("img");
|
||||||
idField:'Id',
|
rowDom.closest(".datagrid-cell").click(); //点击操作
|
||||||
textField:'MaterialName',
|
var row = $('#materialData').datagrid('getChecked');
|
||||||
method:'get',
|
editIndex = $('#materialData').datagrid("getRowIndex", row[0]);
|
||||||
pagination: true,
|
var depotId;
|
||||||
mode: 'remote',
|
|
||||||
hasDownArrow: false,
|
|
||||||
panelWidth: 630, //下拉框的宽度
|
|
||||||
panelHeight: 380,//下拉框的高度
|
|
||||||
columns:[[
|
|
||||||
{field:'mBarCode',title:'条码',width:120},
|
|
||||||
{field:'name',title:'名称',width:140},
|
|
||||||
{field:'standard',title:'规格',width:80},
|
|
||||||
{field:'model',title:'型号',width:80},
|
|
||||||
{field:'unit',title:'单位',width:60},
|
|
||||||
{field:'stock',title:'库存',width:50},
|
|
||||||
{field:'expand',title:'扩展信息',width:80}
|
|
||||||
]],
|
|
||||||
onBeforeLoad: function(param){
|
|
||||||
var edDepot = $('#materialData').datagrid('getEditor', {index:editIndex,field:'DepotId'});
|
var edDepot = $('#materialData').datagrid('getEditor', {index:editIndex,field:'DepotId'});
|
||||||
if(edDepot) {
|
if(edDepot) {
|
||||||
param.depotId = $(edDepot.target).combobox('getValue');
|
depotId = $(edDepot.target).combobox('getValue');
|
||||||
}
|
}
|
||||||
param.mpList = mPropertyList; //商品属性
|
$('#materialSelectDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui/themes/icons/edit_add.png"/> 选择商品');
|
||||||
},
|
$("#materialSelectDlg").panel("move",{top:$(document).scrollTop() + ($(window).height()-500) * 0.5});
|
||||||
onLoadSuccess: function (rec) {
|
inOutService.initMaterialSelectData();
|
||||||
if(rec && rec.total==1) {
|
inOutService.initMaterialSelectPager(depotId);
|
||||||
$(".datagrid-body [field='mBarCode']").click(); //在只有单个商品的时候自动选中
|
inOutService.materialSelectFun(depotId);
|
||||||
var body =$("#depotHeadFM .datagrid-view2 .datagrid-body");
|
|
||||||
input = "input[type=text]";
|
|
||||||
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
|
|
||||||
currentRowDom.find("[field='OperNumber']").find(input).focus().select();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onSelect:function(index, rowData){
|
|
||||||
inOutService.materialSelect(rowData,monthTime);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{ title: '名称', field: 'name', editor: 'validatebox', width: 100},
|
||||||
|
{ title: '规格', field: 'standard', editor: 'validatebox', width: 60},
|
||||||
|
{ title: '型号', field: 'model', editor: 'validatebox', width: 60},
|
||||||
|
{ title: '扩展信息', field: 'materialOther', editor: 'validatebox', width: 70},
|
||||||
{ title: '库存',field: 'Stock',editor:'validatebox',width:50},
|
{ title: '库存',field: 'Stock',editor:'validatebox',width:50},
|
||||||
{ title: '单位',field: 'Unit',editor:'validatebox',width:60},
|
{ title: '单位',field: 'Unit',editor:'validatebox',width:60},
|
||||||
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
|
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
|
||||||
@@ -602,6 +605,7 @@
|
|||||||
if(type === "add") {
|
if(type === "add") {
|
||||||
$("#depotHeadDlg #append").click(); //新增行
|
$("#depotHeadDlg #append").click(); //新增行
|
||||||
} else if(type === "edit") {
|
} else if(type === "edit") {
|
||||||
|
editIndex = 0;
|
||||||
for(var i=0;i<data.rows.length;i++){
|
for(var i=0;i<data.rows.length;i++){
|
||||||
$('#materialData').datagrid('selectRow', i).datagrid('beginEdit', i);
|
$('#materialData').datagrid('selectRow', i).datagrid('beginEdit', i);
|
||||||
inOutService.autoReckon();
|
inOutService.autoReckon();
|
||||||
@@ -632,7 +636,11 @@
|
|||||||
showFooter: true,
|
showFooter: true,
|
||||||
columns:[[
|
columns:[[
|
||||||
{ title: '仓库名称',field: 'DepotName',editor:'validatebox',width:90},
|
{ title: '仓库名称',field: 'DepotName',editor:'validatebox',width:90},
|
||||||
{ title: '条码_名称(规格)(型号)(扩展信息)(单位)',field: 'MaterialName',width:270},
|
{ title: '条码',field: 'barCode', editor:'validatebox', width:120},
|
||||||
|
{ title: '名称', field: 'name', editor: 'validatebox', width: 100},
|
||||||
|
{ title: '规格', field: 'standard', editor: 'validatebox', width: 60},
|
||||||
|
{ title: '型号', field: 'model', editor: 'validatebox', width: 60},
|
||||||
|
{ title: '扩展信息', field: 'materialOther', editor: 'validatebox', width: 70},
|
||||||
{ title: '库存',field: 'Stock',width:50},
|
{ title: '库存',field: 'Stock',width:50},
|
||||||
{ title: '单位',field: 'Unit',editor:'validatebox',width:60},
|
{ title: '单位',field: 'Unit',editor:'validatebox',width:60},
|
||||||
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
|
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
|
||||||
|
|||||||
@@ -270,6 +270,26 @@
|
|||||||
<a href="javascript:void(0)" id="saveOtherMoneyDlg" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
|
<a href="javascript:void(0)" id="saveOtherMoneyDlg" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
|
||||||
<a href="javascript:void(0)" id="cancelOtherMoneyDlg" class="easyui-linkbutton" iconCls="icon-cancel">取消</a>
|
<a href="javascript:void(0)" id="cancelOtherMoneyDlg" class="easyui-linkbutton" iconCls="icon-cancel">取消</a>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="materialSelectDlg" class="easyui-dialog" style="width:880px;padding:10px 20px;"
|
||||||
|
closed="true" modal="true" buttons="#materialSelectDlgBtn" cache="false" collapsible="false" closable="true">
|
||||||
|
<div class="box-body form-inline">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label">条码:</label>
|
||||||
|
<div class="control-inline">
|
||||||
|
<input type="text" id="searchBarCode" name="searchBarCode" value="" maxlength="100" class="easyui-textbox width-90"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchMaterialBtn">查询</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<table id="materialSelectData" style="top:100px;border-bottom-color:#FFFFFF"></table>
|
||||||
|
</div>
|
||||||
|
<div id="materialSelectDlgBtn">
|
||||||
|
<a href="javascript:void(0)" id="checkMaterial" class="easyui-linkbutton" iconCls="icon-ok">选择</a>
|
||||||
|
<a href="javascript:void(0)" id="cancelMaterial" class="easyui-linkbutton" iconCls="icon-cancel"
|
||||||
|
onclick="javascript:$('#materialSelectDlg').dialog('close')">取消</a>
|
||||||
|
</div>
|
||||||
<div id="depot"></div>
|
<div id="depot"></div>
|
||||||
<script>
|
<script>
|
||||||
$(function(){
|
$(function(){
|
||||||
@@ -616,8 +636,9 @@
|
|||||||
footer =$("#depotHeadFM .datagrid-view2 .datagrid-footer");
|
footer =$("#depotHeadFM .datagrid-view2 .datagrid-footer");
|
||||||
input = "input[type=text]";
|
input = "input[type=text]";
|
||||||
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
|
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
|
||||||
var mId = currentRowDom.find("[field='MaterialExtendId']").find(".textbox-value").val();
|
var barCode = currentRowDom.find("[field='barCode']").find(".textbox-value").val();
|
||||||
if(mId){
|
if(barCode){
|
||||||
|
var mId = inOutService.getInfoByBarCode(barCode);
|
||||||
var type = "select"; //type 类型:点击 click,选择 select
|
var type = "select"; //type 类型:点击 click,选择 select
|
||||||
inOutService.findStockNumById(depotId, mId, monthTime, currentRowDom, input, ratioDepot, type);
|
inOutService.findStockNumById(depotId, mId, monthTime, currentRowDom, input, ratioDepot, type);
|
||||||
}
|
}
|
||||||
@@ -625,53 +646,35 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ title: '条码_名称(规格)(型号)(扩展信息)(单位)',field: 'MaterialExtendId',width:270,
|
{ title: '条码',field: 'barCode', editor:'validatebox', width:120,
|
||||||
formatter:function(value,row,index){
|
editor: {
|
||||||
return row.MaterialName;
|
type: 'textbox',
|
||||||
},
|
options: {
|
||||||
editor:{
|
buttonText:'...',
|
||||||
type:'combogrid',
|
editable:false,
|
||||||
options:{
|
onClickButton: function(){
|
||||||
url: "/material/findBySelect",
|
var rowDom = $(this).closest(".datagrid-row").find("[field='op']").find("img");
|
||||||
idField:'Id',
|
rowDom.closest(".datagrid-cell").click(); //点击操作
|
||||||
textField:'MaterialName',
|
var row = $('#materialData').datagrid('getChecked');
|
||||||
method:'get',
|
editIndex = $('#materialData').datagrid("getRowIndex", row[0]);
|
||||||
pagination: true,
|
var depotId;
|
||||||
mode: 'remote',
|
|
||||||
hasDownArrow: false,
|
|
||||||
panelWidth: 630, //下拉框的宽度
|
|
||||||
panelHeight: 380,//下拉框的高度
|
|
||||||
columns:[[
|
|
||||||
{field:'mBarCode',title:'条码',width:120},
|
|
||||||
{field:'name',title:'名称',width:140},
|
|
||||||
{field:'standard',title:'规格',width:80},
|
|
||||||
{field:'model',title:'型号',width:80},
|
|
||||||
{field:'unit',title:'单位',width:60},
|
|
||||||
{field:'stock',title:'库存',width:50},
|
|
||||||
{field:'expand',title:'扩展信息',width:80}
|
|
||||||
]],
|
|
||||||
onBeforeLoad: function(param){
|
|
||||||
var edDepot = $('#materialData').datagrid('getEditor', {index:editIndex,field:'DepotId'});
|
var edDepot = $('#materialData').datagrid('getEditor', {index:editIndex,field:'DepotId'});
|
||||||
if(edDepot) {
|
if(edDepot) {
|
||||||
param.depotId = $(edDepot.target).combobox('getValue');
|
depotId = $(edDepot.target).combobox('getValue');
|
||||||
}
|
}
|
||||||
param.mpList = mPropertyList; //商品属性
|
$('#materialSelectDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui/themes/icons/edit_add.png"/> 选择商品');
|
||||||
},
|
$("#materialSelectDlg").panel("move",{top:$(document).scrollTop() + ($(window).height()-500) * 0.5});
|
||||||
onLoadSuccess: function (rec) {
|
inOutService.initMaterialSelectData();
|
||||||
if(rec && rec.total==1) {
|
inOutService.initMaterialSelectPager(depotId);
|
||||||
$(".datagrid-body [field='mBarCode']").click(); //在只有单个商品的时候自动选中
|
inOutService.materialSelectFun(depotId);
|
||||||
var body =$("#depotHeadFM .datagrid-view2 .datagrid-body");
|
|
||||||
input = "input[type=text]";
|
|
||||||
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
|
|
||||||
currentRowDom.find("[field='OperNumber']").find(input).focus().select();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onSelect:function(index, rowData){
|
|
||||||
inOutService.materialSelect(rowData,monthTime);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{ title: '名称', field: 'name', editor: 'validatebox', width: 100},
|
||||||
|
{ title: '规格', field: 'standard', editor: 'validatebox', width: 60},
|
||||||
|
{ title: '型号', field: 'model', editor: 'validatebox', width: 60},
|
||||||
|
{ title: '扩展信息', field: 'materialOther', editor: 'validatebox', width: 70},
|
||||||
{ title: '库存',field: 'Stock',editor:'validatebox',width:50},
|
{ title: '库存',field: 'Stock',editor:'validatebox',width:50},
|
||||||
{ title: '单位',field: 'Unit',editor:'validatebox',width:60},
|
{ title: '单位',field: 'Unit',editor:'validatebox',width:60},
|
||||||
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
|
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
|
||||||
@@ -744,6 +747,7 @@
|
|||||||
if(type === "add") {
|
if(type === "add") {
|
||||||
$("#depotHeadDlg #append").click(); //新增行
|
$("#depotHeadDlg #append").click(); //新增行
|
||||||
} else if(type === "edit") {
|
} else if(type === "edit") {
|
||||||
|
editIndex = 0;
|
||||||
for(var i=0;i<data.rows.length;i++){
|
for(var i=0;i<data.rows.length;i++){
|
||||||
$('#materialData').datagrid('selectRow', i).datagrid('beginEdit', i);
|
$('#materialData').datagrid('selectRow', i).datagrid('beginEdit', i);
|
||||||
inOutService.autoReckon();
|
inOutService.autoReckon();
|
||||||
@@ -774,7 +778,11 @@
|
|||||||
showFooter: true,
|
showFooter: true,
|
||||||
columns:[[
|
columns:[[
|
||||||
{ title: '仓库名称',field: 'DepotName',editor:'validatebox',width:90},
|
{ title: '仓库名称',field: 'DepotName',editor:'validatebox',width:90},
|
||||||
{ title: '条码_名称(规格)(型号)(扩展信息)(单位)',field: 'MaterialName',width:270},
|
{ title: '条码',field: 'barCode', editor:'validatebox', width:120},
|
||||||
|
{ title: '名称', field: 'name', editor: 'validatebox', width: 100},
|
||||||
|
{ title: '规格', field: 'standard', editor: 'validatebox', width: 60},
|
||||||
|
{ title: '型号', field: 'model', editor: 'validatebox', width: 60},
|
||||||
|
{ title: '扩展信息', field: 'materialOther', editor: 'validatebox', width: 70},
|
||||||
{ title: '库存',field: 'Stock',width:50},
|
{ title: '库存',field: 'Stock',width:50},
|
||||||
{ title: '单位',field: 'Unit',editor:'validatebox',width:60},
|
{ title: '单位',field: 'Unit',editor:'validatebox',width:60},
|
||||||
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
|
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
|
||||||
|
|||||||
@@ -295,6 +295,26 @@
|
|||||||
<a href="javascript:void(0)" id="cancelLinkBill" class="easyui-linkbutton" iconCls="icon-cancel"
|
<a href="javascript:void(0)" id="cancelLinkBill" class="easyui-linkbutton" iconCls="icon-cancel"
|
||||||
onclick="javascript:$('#linkBillDlg').dialog('close')">取消</a>
|
onclick="javascript:$('#linkBillDlg').dialog('close')">取消</a>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="materialSelectDlg" class="easyui-dialog" style="width:880px;padding:10px 20px;"
|
||||||
|
closed="true" modal="true" buttons="#materialSelectDlgBtn" cache="false" collapsible="false" closable="true">
|
||||||
|
<div class="box-body form-inline">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label">条码:</label>
|
||||||
|
<div class="control-inline">
|
||||||
|
<input type="text" id="searchBarCode" name="searchBarCode" value="" maxlength="100" class="easyui-textbox width-90"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchMaterialBtn">查询</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<table id="materialSelectData" style="top:100px;border-bottom-color:#FFFFFF"></table>
|
||||||
|
</div>
|
||||||
|
<div id="materialSelectDlgBtn">
|
||||||
|
<a href="javascript:void(0)" id="checkMaterial" class="easyui-linkbutton" iconCls="icon-ok">选择</a>
|
||||||
|
<a href="javascript:void(0)" id="cancelMaterial" class="easyui-linkbutton" iconCls="icon-cancel"
|
||||||
|
onclick="javascript:$('#materialSelectDlg').dialog('close')">取消</a>
|
||||||
|
</div>
|
||||||
<div id="supplier"></div>
|
<div id="supplier"></div>
|
||||||
<div id="depot"></div>
|
<div id="depot"></div>
|
||||||
<div id="account"></div>
|
<div id="account"></div>
|
||||||
@@ -741,8 +761,9 @@
|
|||||||
footer =$("#depotHeadFM .datagrid-view2 .datagrid-footer");
|
footer =$("#depotHeadFM .datagrid-view2 .datagrid-footer");
|
||||||
input = "input[type=text]";
|
input = "input[type=text]";
|
||||||
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
|
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
|
||||||
var mId = currentRowDom.find("[field='MaterialExtendId']").find(".textbox-value").val();
|
var barCode = currentRowDom.find("[field='barCode']").find(".textbox-value").val();
|
||||||
if(mId){
|
if(barCode){
|
||||||
|
var mId = inOutService.getInfoByBarCode(barCode);
|
||||||
var type = "select"; //type 类型:点击 click,选择 select
|
var type = "select"; //type 类型:点击 click,选择 select
|
||||||
inOutService.findStockNumById(depotId, mId, monthTime, currentRowDom, input, ratioDepot, type);
|
inOutService.findStockNumById(depotId, mId, monthTime, currentRowDom, input, ratioDepot, type);
|
||||||
}
|
}
|
||||||
@@ -750,53 +771,35 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ title: '条码_名称(规格)(型号)(扩展信息)(单位)',field: 'MaterialExtendId',width:270,
|
{ title: '条码',field: 'barCode', editor:'validatebox', width:120,
|
||||||
formatter:function(value,row,index){
|
editor: {
|
||||||
return row.MaterialName;
|
type: 'textbox',
|
||||||
},
|
options: {
|
||||||
editor:{
|
buttonText:'...',
|
||||||
type:'combogrid',
|
editable:false,
|
||||||
options:{
|
onClickButton: function(){
|
||||||
url: "/material/findBySelect",
|
var rowDom = $(this).closest(".datagrid-row").find("[field='op']").find("img");
|
||||||
idField:'Id',
|
rowDom.closest(".datagrid-cell").click(); //点击操作
|
||||||
textField:'MaterialName',
|
var row = $('#materialData').datagrid('getChecked');
|
||||||
method:'get',
|
editIndex = $('#materialData').datagrid("getRowIndex", row[0]);
|
||||||
pagination: true,
|
var depotId;
|
||||||
mode: 'remote',
|
|
||||||
hasDownArrow: false,
|
|
||||||
panelWidth: 630, //下拉框的宽度
|
|
||||||
panelHeight: 380,//下拉框的高度
|
|
||||||
columns:[[
|
|
||||||
{field:'mBarCode',title:'条码',width:120},
|
|
||||||
{field:'name',title:'名称',width:140},
|
|
||||||
{field:'standard',title:'规格',width:80},
|
|
||||||
{field:'model',title:'型号',width:80},
|
|
||||||
{field:'unit',title:'单位',width:60},
|
|
||||||
{field:'stock',title:'库存',width:50},
|
|
||||||
{field:'expand',title:'扩展信息',width:80}
|
|
||||||
]],
|
|
||||||
onBeforeLoad: function(param){
|
|
||||||
var edDepot = $('#materialData').datagrid('getEditor', {index:editIndex,field:'DepotId'});
|
var edDepot = $('#materialData').datagrid('getEditor', {index:editIndex,field:'DepotId'});
|
||||||
if(edDepot) {
|
if(edDepot) {
|
||||||
param.depotId = $(edDepot.target).combobox('getValue');
|
depotId = $(edDepot.target).combobox('getValue');
|
||||||
}
|
}
|
||||||
param.mpList = mPropertyList; //商品属性
|
$('#materialSelectDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui/themes/icons/edit_add.png"/> 选择商品');
|
||||||
},
|
$("#materialSelectDlg").panel("move",{top:$(document).scrollTop() + ($(window).height()-500) * 0.5});
|
||||||
onLoadSuccess: function (rec) {
|
inOutService.initMaterialSelectData();
|
||||||
if(rec && rec.total==1) {
|
inOutService.initMaterialSelectPager(depotId);
|
||||||
$(".datagrid-body [field='mBarCode']").click(); //在只有单个商品的时候自动选中
|
inOutService.materialSelectFun(depotId);
|
||||||
var body =$("#depotHeadFM .datagrid-view2 .datagrid-body");
|
|
||||||
input = "input[type=text]";
|
|
||||||
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
|
|
||||||
currentRowDom.find("[field='OperNumber']").find(input).focus().select();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onSelect:function(index, rowData){
|
|
||||||
inOutService.materialSelect(rowData,monthTime);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{ title: '名称', field: 'name', editor: 'validatebox', width: 100},
|
||||||
|
{ title: '规格', field: 'standard', editor: 'validatebox', width: 60},
|
||||||
|
{ title: '型号', field: 'model', editor: 'validatebox', width: 60},
|
||||||
|
{ title: '扩展信息', field: 'materialOther', editor: 'validatebox', width: 70},
|
||||||
{ title: '库存',field: 'Stock',editor:'validatebox',width:50},
|
{ title: '库存',field: 'Stock',editor:'validatebox',width:50},
|
||||||
{ title: '单位',field: 'Unit',editor:'validatebox',width:60},
|
{ title: '单位',field: 'Unit',editor:'validatebox',width:60},
|
||||||
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
|
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
|
||||||
@@ -869,6 +872,7 @@
|
|||||||
if(type === "add") {
|
if(type === "add") {
|
||||||
$("#depotHeadDlg #append").click(); //新增行
|
$("#depotHeadDlg #append").click(); //新增行
|
||||||
} else if(type === "edit") {
|
} else if(type === "edit") {
|
||||||
|
editIndex = 0;
|
||||||
for(var i=0;i<data.rows.length;i++){
|
for(var i=0;i<data.rows.length;i++){
|
||||||
$('#materialData').datagrid('selectRow', i).datagrid('beginEdit', i);
|
$('#materialData').datagrid('selectRow', i).datagrid('beginEdit', i);
|
||||||
inOutService.autoReckon();
|
inOutService.autoReckon();
|
||||||
@@ -899,7 +903,11 @@
|
|||||||
showFooter: true,
|
showFooter: true,
|
||||||
columns:[[
|
columns:[[
|
||||||
{ title: '仓库名称',field: 'DepotName',editor:'validatebox',width:90},
|
{ title: '仓库名称',field: 'DepotName',editor:'validatebox',width:90},
|
||||||
{ title: '条码_名称(规格)(型号)(扩展信息)(单位)',field: 'MaterialName',width:270},
|
{ title: '条码',field: 'barCode', editor:'validatebox', width:120},
|
||||||
|
{ title: '名称', field: 'name', editor: 'validatebox', width: 100},
|
||||||
|
{ title: '规格', field: 'standard', editor: 'validatebox', width: 60},
|
||||||
|
{ title: '型号', field: 'model', editor: 'validatebox', width: 60},
|
||||||
|
{ title: '扩展信息', field: 'materialOther', editor: 'validatebox', width: 70},
|
||||||
{ title: '库存',field: 'Stock',width:50},
|
{ title: '库存',field: 'Stock',width:50},
|
||||||
{ title: '单位',field: 'Unit',editor:'validatebox',width:60},
|
{ title: '单位',field: 'Unit',editor:'validatebox',width:60},
|
||||||
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
|
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
|
||||||
|
|||||||
@@ -197,6 +197,26 @@
|
|||||||
<a href="javascript:void(0)" id="saveOtherMoneyDlg" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
|
<a href="javascript:void(0)" id="saveOtherMoneyDlg" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
|
||||||
<a href="javascript:void(0)" id="cancelOtherMoneyDlg" class="easyui-linkbutton" iconCls="icon-cancel">取消</a>
|
<a href="javascript:void(0)" id="cancelOtherMoneyDlg" class="easyui-linkbutton" iconCls="icon-cancel">取消</a>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="materialSelectDlg" class="easyui-dialog" style="width:880px;padding:10px 20px;"
|
||||||
|
closed="true" modal="true" buttons="#materialSelectDlgBtn" cache="false" collapsible="false" closable="true">
|
||||||
|
<div class="box-body form-inline">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label">条码:</label>
|
||||||
|
<div class="control-inline">
|
||||||
|
<input type="text" id="searchBarCode" name="searchBarCode" value="" maxlength="100" class="easyui-textbox width-90"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchMaterialBtn">查询</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<table id="materialSelectData" style="top:100px;border-bottom-color:#FFFFFF"></table>
|
||||||
|
</div>
|
||||||
|
<div id="materialSelectDlgBtn">
|
||||||
|
<a href="javascript:void(0)" id="checkMaterial" class="easyui-linkbutton" iconCls="icon-ok">选择</a>
|
||||||
|
<a href="javascript:void(0)" id="cancelMaterial" class="easyui-linkbutton" iconCls="icon-cancel"
|
||||||
|
onclick="javascript:$('#materialSelectDlg').dialog('close')">取消</a>
|
||||||
|
</div>
|
||||||
<div id="supplier"></div>
|
<div id="supplier"></div>
|
||||||
<div id="depot"></div>
|
<div id="depot"></div>
|
||||||
<script>
|
<script>
|
||||||
@@ -571,8 +591,9 @@
|
|||||||
footer =$("#depotHeadFM .datagrid-view2 .datagrid-footer");
|
footer =$("#depotHeadFM .datagrid-view2 .datagrid-footer");
|
||||||
input = "input[type=text]";
|
input = "input[type=text]";
|
||||||
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
|
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
|
||||||
var mId = currentRowDom.find("[field='MaterialExtendId']").find(".textbox-value").val();
|
var barCode = currentRowDom.find("[field='barCode']").find(".textbox-value").val();
|
||||||
if(mId){
|
if(barCode){
|
||||||
|
var mId = inOutService.getInfoByBarCode(barCode);
|
||||||
var type = "select"; //type 类型:点击 click,选择 select
|
var type = "select"; //type 类型:点击 click,选择 select
|
||||||
inOutService.findStockNumById(depotId, mId, monthTime, currentRowDom, input, ratioDepot, type);
|
inOutService.findStockNumById(depotId, mId, monthTime, currentRowDom, input, ratioDepot, type);
|
||||||
}
|
}
|
||||||
@@ -580,53 +601,35 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ title: '条码_名称(规格)(型号)(扩展信息)(单位)',field: 'MaterialExtendId',width:270,
|
{ title: '条码',field: 'barCode', editor:'validatebox', width:120,
|
||||||
formatter:function(value,row,index){
|
editor: {
|
||||||
return row.MaterialName;
|
type: 'textbox',
|
||||||
},
|
options: {
|
||||||
editor:{
|
buttonText:'...',
|
||||||
type:'combogrid',
|
editable:false,
|
||||||
options:{
|
onClickButton: function(){
|
||||||
url: "/material/findBySelect",
|
var rowDom = $(this).closest(".datagrid-row").find("[field='op']").find("img");
|
||||||
idField:'Id',
|
rowDom.closest(".datagrid-cell").click(); //点击操作
|
||||||
textField:'MaterialName',
|
var row = $('#materialData').datagrid('getChecked');
|
||||||
method:'get',
|
editIndex = $('#materialData').datagrid("getRowIndex", row[0]);
|
||||||
pagination: true,
|
var depotId;
|
||||||
mode: 'remote',
|
|
||||||
hasDownArrow: false,
|
|
||||||
panelWidth: 630, //下拉框的宽度
|
|
||||||
panelHeight: 380,//下拉框的高度
|
|
||||||
columns:[[
|
|
||||||
{field:'mBarCode',title:'条码',width:120},
|
|
||||||
{field:'name',title:'名称',width:140},
|
|
||||||
{field:'standard',title:'规格',width:80},
|
|
||||||
{field:'model',title:'型号',width:80},
|
|
||||||
{field:'unit',title:'单位',width:60},
|
|
||||||
{field:'stock',title:'库存',width:50},
|
|
||||||
{field:'expand',title:'扩展信息',width:80}
|
|
||||||
]],
|
|
||||||
onBeforeLoad: function(param){
|
|
||||||
var edDepot = $('#materialData').datagrid('getEditor', {index:editIndex,field:'DepotId'});
|
var edDepot = $('#materialData').datagrid('getEditor', {index:editIndex,field:'DepotId'});
|
||||||
if(edDepot) {
|
if(edDepot) {
|
||||||
param.depotId = $(edDepot.target).combobox('getValue');
|
depotId = $(edDepot.target).combobox('getValue');
|
||||||
}
|
}
|
||||||
param.mpList = mPropertyList; //商品属性
|
$('#materialSelectDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui/themes/icons/edit_add.png"/> 选择商品');
|
||||||
},
|
$("#materialSelectDlg").panel("move",{top:$(document).scrollTop() + ($(window).height()-500) * 0.5});
|
||||||
onLoadSuccess: function (rec) {
|
inOutService.initMaterialSelectData();
|
||||||
if(rec && rec.total==1) {
|
inOutService.initMaterialSelectPager(depotId);
|
||||||
$(".datagrid-body [field='mBarCode']").click(); //在只有单个商品的时候自动选中
|
inOutService.materialSelectFun(depotId);
|
||||||
var body =$("#depotHeadFM .datagrid-view2 .datagrid-body");
|
|
||||||
input = "input[type=text]";
|
|
||||||
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
|
|
||||||
currentRowDom.find("[field='OperNumber']").find(input).focus().select();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onSelect:function(index, rowData){
|
|
||||||
inOutService.materialSelect(rowData, monthTime);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{ title: '名称', field: 'name', editor: 'validatebox', width: 100},
|
||||||
|
{ title: '规格', field: 'standard', editor: 'validatebox', width: 60},
|
||||||
|
{ title: '型号', field: 'model', editor: 'validatebox', width: 60},
|
||||||
|
{ title: '扩展信息', field: 'materialOther', editor: 'validatebox', width: 70},
|
||||||
{ title: '库存',field: 'Stock',editor:'validatebox',width:50},
|
{ title: '库存',field: 'Stock',editor:'validatebox',width:50},
|
||||||
{ title: '单位',field: 'Unit',editor:'validatebox',width:60},
|
{ title: '单位',field: 'Unit',editor:'validatebox',width:60},
|
||||||
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
|
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
|
||||||
@@ -699,6 +702,7 @@
|
|||||||
if(type === "add") {
|
if(type === "add") {
|
||||||
$("#depotHeadDlg #append").click(); //新增行
|
$("#depotHeadDlg #append").click(); //新增行
|
||||||
} else if(type === "edit") {
|
} else if(type === "edit") {
|
||||||
|
editIndex = 0;
|
||||||
for(var i=0;i<data.rows.length;i++){
|
for(var i=0;i<data.rows.length;i++){
|
||||||
$('#materialData').datagrid('selectRow', i).datagrid('beginEdit', i);
|
$('#materialData').datagrid('selectRow', i).datagrid('beginEdit', i);
|
||||||
inOutService.autoReckon();
|
inOutService.autoReckon();
|
||||||
@@ -729,7 +733,11 @@
|
|||||||
showFooter: true,
|
showFooter: true,
|
||||||
columns:[[
|
columns:[[
|
||||||
{ title: '仓库名称',field: 'DepotName',editor:'validatebox',width:90},
|
{ title: '仓库名称',field: 'DepotName',editor:'validatebox',width:90},
|
||||||
{ title: '条码_名称(规格)(型号)(扩展信息)(单位)',field: 'MaterialName',width:270},
|
{ title: '条码',field: 'barCode', editor:'validatebox', width:120},
|
||||||
|
{ title: '名称', field: 'name', editor: 'validatebox', width: 100},
|
||||||
|
{ title: '规格', field: 'standard', editor: 'validatebox', width: 60},
|
||||||
|
{ title: '型号', field: 'model', editor: 'validatebox', width: 60},
|
||||||
|
{ title: '扩展信息', field: 'materialOther', editor: 'validatebox', width: 70},
|
||||||
{ title: '库存',field: 'Stock',width:50},
|
{ title: '库存',field: 'Stock',width:50},
|
||||||
{ title: '单位',field: 'Unit',editor:'validatebox',width:60},
|
{ title: '单位',field: 'Unit',editor:'validatebox',width:60},
|
||||||
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
|
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
|
||||||
|
|||||||
@@ -210,6 +210,26 @@
|
|||||||
<a href="javascript:void(0)" id="cancelDepotHeadShow" class="easyui-linkbutton" iconCls="icon-cancel"
|
<a href="javascript:void(0)" id="cancelDepotHeadShow" class="easyui-linkbutton" iconCls="icon-cancel"
|
||||||
onclick="javascript:$('#depotHeadDlgShow').dialog('close')">取消</a>
|
onclick="javascript:$('#depotHeadDlgShow').dialog('close')">取消</a>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="materialSelectDlg" class="easyui-dialog" style="width:880px;padding:10px 20px;"
|
||||||
|
closed="true" modal="true" buttons="#materialSelectDlgBtn" cache="false" collapsible="false" closable="true">
|
||||||
|
<div class="box-body form-inline">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label">条码:</label>
|
||||||
|
<div class="control-inline">
|
||||||
|
<input type="text" id="searchBarCode" name="searchBarCode" value="" maxlength="100" class="easyui-textbox width-90"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchMaterialBtn">查询</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<table id="materialSelectData" style="top:100px;border-bottom-color:#FFFFFF"></table>
|
||||||
|
</div>
|
||||||
|
<div id="materialSelectDlgBtn">
|
||||||
|
<a href="javascript:void(0)" id="checkMaterial" class="easyui-linkbutton" iconCls="icon-ok">选择</a>
|
||||||
|
<a href="javascript:void(0)" id="cancelMaterial" class="easyui-linkbutton" iconCls="icon-cancel"
|
||||||
|
onclick="javascript:$('#materialSelectDlg').dialog('close')">取消</a>
|
||||||
|
</div>
|
||||||
<div id="depot"></div>
|
<div id="depot"></div>
|
||||||
<script>
|
<script>
|
||||||
$(function(){
|
$(function(){
|
||||||
@@ -635,8 +655,9 @@
|
|||||||
footer =$("#depotHeadFM .datagrid-view2 .datagrid-footer");
|
footer =$("#depotHeadFM .datagrid-view2 .datagrid-footer");
|
||||||
input = "input[type=text]";
|
input = "input[type=text]";
|
||||||
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
|
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
|
||||||
var mId = currentRowDom.find("[field='MaterialExtendId']").find(".textbox-value").val();
|
var barCode = currentRowDom.find("[field='barCode']").find(".textbox-value").val();
|
||||||
if(mId){
|
if(barCode){
|
||||||
|
var mId = inOutService.getInfoByBarCode(barCode);
|
||||||
var type = "select"; //type 类型:点击 click,选择 select
|
var type = "select"; //type 类型:点击 click,选择 select
|
||||||
inOutService.findStockNumById(depotId, mId, monthTime, currentRowDom, input, ratioDepot, type);
|
inOutService.findStockNumById(depotId, mId, monthTime, currentRowDom, input, ratioDepot, type);
|
||||||
}
|
}
|
||||||
@@ -644,53 +665,35 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ title: '条码_名称(规格)(型号)(扩展信息)(单位)',field: 'MaterialExtendId',width:270,
|
{ title: '条码',field: 'barCode', editor:'validatebox', width:120,
|
||||||
formatter:function(value,row,index){
|
editor: {
|
||||||
return row.MaterialName;
|
type: 'textbox',
|
||||||
},
|
options: {
|
||||||
editor:{
|
buttonText:'...',
|
||||||
type:'combogrid',
|
editable:false,
|
||||||
options:{
|
onClickButton: function(){
|
||||||
url: "/material/findBySelect",
|
var rowDom = $(this).closest(".datagrid-row").find("[field='op']").find("img");
|
||||||
idField:'Id',
|
rowDom.closest(".datagrid-cell").click(); //点击操作
|
||||||
textField:'MaterialName',
|
var row = $('#materialData').datagrid('getChecked');
|
||||||
method:'get',
|
editIndex = $('#materialData').datagrid("getRowIndex", row[0]);
|
||||||
pagination: true,
|
var depotId;
|
||||||
mode: 'remote',
|
|
||||||
hasDownArrow: false,
|
|
||||||
panelWidth: 630, //下拉框的宽度
|
|
||||||
panelHeight: 380,//下拉框的高度
|
|
||||||
columns:[[
|
|
||||||
{field:'mBarCode',title:'条码',width:120},
|
|
||||||
{field:'name',title:'名称',width:140},
|
|
||||||
{field:'standard',title:'规格',width:80},
|
|
||||||
{field:'model',title:'型号',width:80},
|
|
||||||
{field:'unit',title:'单位',width:60},
|
|
||||||
{field:'stock',title:'库存',width:50},
|
|
||||||
{field:'expand',title:'扩展信息',width:80}
|
|
||||||
]],
|
|
||||||
onBeforeLoad: function(param){
|
|
||||||
var edDepot = $('#materialData').datagrid('getEditor', {index:editIndex,field:'DepotId'});
|
var edDepot = $('#materialData').datagrid('getEditor', {index:editIndex,field:'DepotId'});
|
||||||
if(edDepot) {
|
if(edDepot) {
|
||||||
param.depotId = $(edDepot.target).combobox('getValue');
|
depotId = $(edDepot.target).combobox('getValue');
|
||||||
}
|
}
|
||||||
param.mpList = mPropertyList; //商品属性
|
$('#materialSelectDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui/themes/icons/edit_add.png"/> 选择商品');
|
||||||
},
|
$("#materialSelectDlg").panel("move",{top:$(document).scrollTop() + ($(window).height()-500) * 0.5});
|
||||||
onLoadSuccess: function (rec) {
|
inOutService.initMaterialSelectData();
|
||||||
if(rec && rec.total==1) {
|
inOutService.initMaterialSelectPager(depotId);
|
||||||
$(".datagrid-body [field='mBarCode']").click(); //在只有单个商品的时候自动选中
|
inOutService.materialSelectFun(depotId);
|
||||||
var body =$("#depotHeadFM .datagrid-view2 .datagrid-body");
|
|
||||||
input = "input[type=text]";
|
|
||||||
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
|
|
||||||
currentRowDom.find("[field='OperNumber']").find(input).focus().select();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onSelect:function(index, rowData){
|
|
||||||
inOutService.materialSelect(rowData,monthTime);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{ title: '名称', field: 'name', editor: 'validatebox', width: 100},
|
||||||
|
{ title: '规格', field: 'standard', editor: 'validatebox', width: 60},
|
||||||
|
{ title: '型号', field: 'model', editor: 'validatebox', width: 60},
|
||||||
|
{ title: '扩展信息', field: 'materialOther', editor: 'validatebox', width: 70},
|
||||||
{ title: '库存',field: 'Stock',editor:'validatebox',width:50},
|
{ title: '库存',field: 'Stock',editor:'validatebox',width:50},
|
||||||
{ title: '单位',field: 'Unit',editor:'validatebox',width:60},
|
{ title: '单位',field: 'Unit',editor:'validatebox',width:60},
|
||||||
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
|
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
|
||||||
@@ -759,6 +762,7 @@
|
|||||||
if(type === "add") {
|
if(type === "add") {
|
||||||
$("#depotHeadDlg #append").click(); //新增行
|
$("#depotHeadDlg #append").click(); //新增行
|
||||||
} else if(type === "edit") {
|
} else if(type === "edit") {
|
||||||
|
editIndex = 0;
|
||||||
for(var i=0;i<data.rows.length;i++){
|
for(var i=0;i<data.rows.length;i++){
|
||||||
$('#materialData').datagrid('selectRow', i).datagrid('beginEdit', i);
|
$('#materialData').datagrid('selectRow', i).datagrid('beginEdit', i);
|
||||||
inOutService.autoReckon();
|
inOutService.autoReckon();
|
||||||
@@ -789,7 +793,11 @@
|
|||||||
showFooter: true,
|
showFooter: true,
|
||||||
columns:[[
|
columns:[[
|
||||||
{ title: '仓库名称',field: 'DepotName',editor:'validatebox',width:90},
|
{ title: '仓库名称',field: 'DepotName',editor:'validatebox',width:90},
|
||||||
{ title: '条码_名称(规格)(型号)(扩展信息)(单位)',field: 'MaterialName',width:270},
|
{ title: '条码',field: 'barCode', editor:'validatebox', width:120},
|
||||||
|
{ title: '名称', field: 'name', editor: 'validatebox', width: 100},
|
||||||
|
{ title: '规格', field: 'standard', editor: 'validatebox', width: 60},
|
||||||
|
{ title: '型号', field: 'model', editor: 'validatebox', width: 60},
|
||||||
|
{ title: '扩展信息', field: 'materialOther', editor: 'validatebox', width: 70},
|
||||||
{ title: '库存',field: 'Stock',width:50},
|
{ title: '库存',field: 'Stock',width:50},
|
||||||
{ title: '单位',field: 'Unit',editor:'validatebox',width:60},
|
{ title: '单位',field: 'Unit',editor:'validatebox',width:60},
|
||||||
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
|
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
|
||||||
|
|||||||
@@ -247,6 +247,26 @@
|
|||||||
<a href="javascript:void(0)" id="saveDepotHeadAccountDlg" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
|
<a href="javascript:void(0)" id="saveDepotHeadAccountDlg" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
|
||||||
<a href="javascript:void(0)" id="cancelDepotHeadAccountDlg" class="easyui-linkbutton" iconCls="icon-cancel">取消</a>
|
<a href="javascript:void(0)" id="cancelDepotHeadAccountDlg" class="easyui-linkbutton" iconCls="icon-cancel">取消</a>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="materialSelectDlg" class="easyui-dialog" style="width:880px;padding:10px 20px;"
|
||||||
|
closed="true" modal="true" buttons="#materialSelectDlgBtn" cache="false" collapsible="false" closable="true">
|
||||||
|
<div class="box-body form-inline">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label">条码:</label>
|
||||||
|
<div class="control-inline">
|
||||||
|
<input type="text" id="searchBarCode" name="searchBarCode" value="" maxlength="100" class="easyui-textbox width-90"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchMaterialBtn">查询</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<table id="materialSelectData" style="top:100px;border-bottom-color:#FFFFFF"></table>
|
||||||
|
</div>
|
||||||
|
<div id="materialSelectDlgBtn">
|
||||||
|
<a href="javascript:void(0)" id="checkMaterial" class="easyui-linkbutton" iconCls="icon-ok">选择</a>
|
||||||
|
<a href="javascript:void(0)" id="cancelMaterial" class="easyui-linkbutton" iconCls="icon-cancel"
|
||||||
|
onclick="javascript:$('#materialSelectDlg').dialog('close')">取消</a>
|
||||||
|
</div>
|
||||||
<div id="supplier"></div>
|
<div id="supplier"></div>
|
||||||
<div id="depot"></div>
|
<div id="depot"></div>
|
||||||
<script>
|
<script>
|
||||||
@@ -671,8 +691,9 @@
|
|||||||
footer =$("#depotHeadFM .datagrid-view2 .datagrid-footer");
|
footer =$("#depotHeadFM .datagrid-view2 .datagrid-footer");
|
||||||
input = "input[type=text]";
|
input = "input[type=text]";
|
||||||
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
|
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
|
||||||
var mId = currentRowDom.find("[field='MaterialExtendId']").find(".textbox-value").val();
|
var barCode = currentRowDom.find("[field='barCode']").find(".textbox-value").val();
|
||||||
if(mId){
|
if(barCode){
|
||||||
|
var mId = inOutService.getInfoByBarCode(barCode);
|
||||||
var type = "select"; //type 类型:点击 click,选择 select
|
var type = "select"; //type 类型:点击 click,选择 select
|
||||||
inOutService.findStockNumById(depotId, mId, monthTime, currentRowDom, input, ratioDepot, type);
|
inOutService.findStockNumById(depotId, mId, monthTime, currentRowDom, input, ratioDepot, type);
|
||||||
}
|
}
|
||||||
@@ -680,53 +701,35 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ title: '条码_名称(规格)(型号)(扩展信息)(单位)',field: 'MaterialExtendId',width:270,
|
{ title: '条码',field: 'barCode', editor:'validatebox', width:120,
|
||||||
formatter:function(value,row,index){
|
editor: {
|
||||||
return row.MaterialName;
|
type: 'textbox',
|
||||||
},
|
options: {
|
||||||
editor:{
|
buttonText:'...',
|
||||||
type:'combogrid',
|
editable:false,
|
||||||
options:{
|
onClickButton: function(){
|
||||||
url: "/material/findBySelect",
|
var rowDom = $(this).closest(".datagrid-row").find("[field='op']").find("img");
|
||||||
idField:'Id',
|
rowDom.closest(".datagrid-cell").click(); //点击操作
|
||||||
textField:'MaterialName',
|
var row = $('#materialData').datagrid('getChecked');
|
||||||
method:'get',
|
editIndex = $('#materialData').datagrid("getRowIndex", row[0]);
|
||||||
pagination: true,
|
var depotId;
|
||||||
mode: 'remote',
|
|
||||||
hasDownArrow: false,
|
|
||||||
panelWidth: 630, //下拉框的宽度
|
|
||||||
panelHeight: 380,//下拉框的高度
|
|
||||||
columns:[[
|
|
||||||
{field:'mBarCode',title:'条码',width:120},
|
|
||||||
{field:'name',title:'名称',width:140},
|
|
||||||
{field:'standard',title:'规格',width:80},
|
|
||||||
{field:'model',title:'型号',width:80},
|
|
||||||
{field:'unit',title:'单位',width:60},
|
|
||||||
{field:'stock',title:'库存',width:50},
|
|
||||||
{field:'expand',title:'扩展信息',width:80}
|
|
||||||
]],
|
|
||||||
onBeforeLoad: function(param){
|
|
||||||
var edDepot = $('#materialData').datagrid('getEditor', {index:editIndex,field:'DepotId'});
|
var edDepot = $('#materialData').datagrid('getEditor', {index:editIndex,field:'DepotId'});
|
||||||
if(edDepot) {
|
if(edDepot) {
|
||||||
param.depotId = $(edDepot.target).combobox('getValue');
|
depotId = $(edDepot.target).combobox('getValue');
|
||||||
}
|
}
|
||||||
param.mpList = mPropertyList; //商品属性
|
$('#materialSelectDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui/themes/icons/edit_add.png"/> 选择商品');
|
||||||
},
|
$("#materialSelectDlg").panel("move",{top:$(document).scrollTop() + ($(window).height()-500) * 0.5});
|
||||||
onLoadSuccess: function (rec) {
|
inOutService.initMaterialSelectData();
|
||||||
if(rec && rec.total==1) {
|
inOutService.initMaterialSelectPager(depotId);
|
||||||
$(".datagrid-body [field='mBarCode']").click(); //在只有单个商品的时候自动选中
|
inOutService.materialSelectFun(depotId);
|
||||||
var body =$("#depotHeadFM .datagrid-view2 .datagrid-body");
|
|
||||||
input = "input[type=text]";
|
|
||||||
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
|
|
||||||
currentRowDom.find("[field='OperNumber']").find(input).focus().select();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onSelect:function(index, rowData){
|
|
||||||
inOutService.materialSelect(rowData,monthTime);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{ title: '名称', field: 'name', editor: 'validatebox', width: 100},
|
||||||
|
{ title: '规格', field: 'standard', editor: 'validatebox', width: 60},
|
||||||
|
{ title: '型号', field: 'model', editor: 'validatebox', width: 60},
|
||||||
|
{ title: '扩展信息', field: 'materialOther', editor: 'validatebox', width: 70},
|
||||||
{ title: '库存',field: 'Stock',editor:'validatebox',width:50},
|
{ title: '库存',field: 'Stock',editor:'validatebox',width:50},
|
||||||
{ title: '单位',field: 'Unit',editor:'validatebox',width:60},
|
{ title: '单位',field: 'Unit',editor:'validatebox',width:60},
|
||||||
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
|
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
|
||||||
@@ -795,6 +798,7 @@
|
|||||||
if(type === "add") {
|
if(type === "add") {
|
||||||
$("#depotHeadDlg #append").click(); //新增行
|
$("#depotHeadDlg #append").click(); //新增行
|
||||||
} else if(type === "edit") {
|
} else if(type === "edit") {
|
||||||
|
editIndex = 0;
|
||||||
for(var i=0;i<data.rows.length;i++){
|
for(var i=0;i<data.rows.length;i++){
|
||||||
$('#materialData').datagrid('selectRow', i).datagrid('beginEdit', i);
|
$('#materialData').datagrid('selectRow', i).datagrid('beginEdit', i);
|
||||||
inOutService.autoReckon();
|
inOutService.autoReckon();
|
||||||
@@ -825,7 +829,11 @@
|
|||||||
showFooter: true,
|
showFooter: true,
|
||||||
columns:[[
|
columns:[[
|
||||||
{ title: '仓库名称',field: 'DepotName',editor:'validatebox',width:90},
|
{ title: '仓库名称',field: 'DepotName',editor:'validatebox',width:90},
|
||||||
{ title: '条码_名称(规格)(型号)(扩展信息)(单位)',field: 'MaterialName',width:270},
|
{ title: '条码',field: 'barCode', editor:'validatebox', width:120},
|
||||||
|
{ title: '名称', field: 'name', editor: 'validatebox', width: 100},
|
||||||
|
{ title: '规格', field: 'standard', editor: 'validatebox', width: 60},
|
||||||
|
{ title: '型号', field: 'model', editor: 'validatebox', width: 60},
|
||||||
|
{ title: '扩展信息', field: 'materialOther', editor: 'validatebox', width: 70},
|
||||||
{ title: '库存',field: 'Stock',width:50},
|
{ title: '库存',field: 'Stock',width:50},
|
||||||
{ title: '单位',field: 'Unit',editor:'validatebox',width:60},
|
{ title: '单位',field: 'Unit',editor:'validatebox',width:60},
|
||||||
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
|
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
|
||||||
|
|||||||
@@ -270,6 +270,26 @@
|
|||||||
<a href="javascript:void(0)" id="saveOtherMoneyDlg" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
|
<a href="javascript:void(0)" id="saveOtherMoneyDlg" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
|
||||||
<a href="javascript:void(0)" id="cancelOtherMoneyDlg" class="easyui-linkbutton" iconCls="icon-cancel">取消</a>
|
<a href="javascript:void(0)" id="cancelOtherMoneyDlg" class="easyui-linkbutton" iconCls="icon-cancel">取消</a>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="materialSelectDlg" class="easyui-dialog" style="width:880px;padding:10px 20px;"
|
||||||
|
closed="true" modal="true" buttons="#materialSelectDlgBtn" cache="false" collapsible="false" closable="true">
|
||||||
|
<div class="box-body form-inline">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label">条码:</label>
|
||||||
|
<div class="control-inline">
|
||||||
|
<input type="text" id="searchBarCode" name="searchBarCode" value="" maxlength="100" class="easyui-textbox width-90"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchMaterialBtn">查询</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<table id="materialSelectData" style="top:100px;border-bottom-color:#FFFFFF"></table>
|
||||||
|
</div>
|
||||||
|
<div id="materialSelectDlgBtn">
|
||||||
|
<a href="javascript:void(0)" id="checkMaterial" class="easyui-linkbutton" iconCls="icon-ok">选择</a>
|
||||||
|
<a href="javascript:void(0)" id="cancelMaterial" class="easyui-linkbutton" iconCls="icon-cancel"
|
||||||
|
onclick="javascript:$('#materialSelectDlg').dialog('close')">取消</a>
|
||||||
|
</div>
|
||||||
<div id="depot"></div>
|
<div id="depot"></div>
|
||||||
<script>
|
<script>
|
||||||
$(function(){
|
$(function(){
|
||||||
@@ -657,8 +677,9 @@
|
|||||||
footer =$("#depotHeadFM .datagrid-view2 .datagrid-footer");
|
footer =$("#depotHeadFM .datagrid-view2 .datagrid-footer");
|
||||||
input = "input[type=text]";
|
input = "input[type=text]";
|
||||||
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
|
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
|
||||||
var mId = currentRowDom.find("[field='MaterialExtendId']").find(".textbox-value").val();
|
var barCode = currentRowDom.find("[field='barCode']").find(".textbox-value").val();
|
||||||
if(mId){
|
if(barCode){
|
||||||
|
var mId = inOutService.getInfoByBarCode(barCode);
|
||||||
var type = "select"; //type 类型:点击 click,选择 select
|
var type = "select"; //type 类型:点击 click,选择 select
|
||||||
inOutService.findStockNumById(depotId, mId, monthTime, currentRowDom, input, ratioDepot, type);
|
inOutService.findStockNumById(depotId, mId, monthTime, currentRowDom, input, ratioDepot, type);
|
||||||
}
|
}
|
||||||
@@ -666,53 +687,35 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ title: '条码_名称(规格)(型号)(扩展信息)(单位)',field: 'MaterialExtendId',width:270,
|
{ title: '条码',field: 'barCode', editor:'validatebox', width:120,
|
||||||
formatter:function(value,row,index){
|
editor: {
|
||||||
return row.MaterialName;
|
type: 'textbox',
|
||||||
},
|
options: {
|
||||||
editor:{
|
buttonText:'...',
|
||||||
type:'combogrid',
|
editable:false,
|
||||||
options:{
|
onClickButton: function(){
|
||||||
url: "/material/findBySelect",
|
var rowDom = $(this).closest(".datagrid-row").find("[field='op']").find("img");
|
||||||
idField:'Id',
|
rowDom.closest(".datagrid-cell").click(); //点击操作
|
||||||
textField:'MaterialName',
|
var row = $('#materialData').datagrid('getChecked');
|
||||||
method:'get',
|
editIndex = $('#materialData').datagrid("getRowIndex", row[0]);
|
||||||
pagination: true,
|
var depotId;
|
||||||
mode: 'remote',
|
|
||||||
hasDownArrow: false,
|
|
||||||
panelWidth: 630, //下拉框的宽度
|
|
||||||
panelHeight: 380,//下拉框的高度
|
|
||||||
columns:[[
|
|
||||||
{field:'mBarCode',title:'条码',width:120},
|
|
||||||
{field:'name',title:'名称',width:140},
|
|
||||||
{field:'standard',title:'规格',width:80},
|
|
||||||
{field:'model',title:'型号',width:80},
|
|
||||||
{field:'unit',title:'单位',width:60},
|
|
||||||
{field:'stock',title:'库存',width:50},
|
|
||||||
{field:'expand',title:'扩展信息',width:80}
|
|
||||||
]],
|
|
||||||
onBeforeLoad: function(param){
|
|
||||||
var edDepot = $('#materialData').datagrid('getEditor', {index:editIndex,field:'DepotId'});
|
var edDepot = $('#materialData').datagrid('getEditor', {index:editIndex,field:'DepotId'});
|
||||||
if(edDepot) {
|
if(edDepot) {
|
||||||
param.depotId = $(edDepot.target).combobox('getValue');
|
depotId = $(edDepot.target).combobox('getValue');
|
||||||
}
|
}
|
||||||
param.mpList = mPropertyList; //商品属性
|
$('#materialSelectDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui/themes/icons/edit_add.png"/> 选择商品');
|
||||||
},
|
$("#materialSelectDlg").panel("move",{top:$(document).scrollTop() + ($(window).height()-500) * 0.5});
|
||||||
onLoadSuccess: function (rec) {
|
inOutService.initMaterialSelectData();
|
||||||
if(rec && rec.total==1) {
|
inOutService.initMaterialSelectPager(depotId);
|
||||||
$(".datagrid-body [field='mBarCode']").click(); //在只有单个商品的时候自动选中
|
inOutService.materialSelectFun(depotId);
|
||||||
var body =$("#depotHeadFM .datagrid-view2 .datagrid-body");
|
|
||||||
input = "input[type=text]";
|
|
||||||
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
|
|
||||||
currentRowDom.find("[field='OperNumber']").find(input).focus().select();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onSelect:function(index, rowData){
|
|
||||||
inOutService.materialSelect(rowData,monthTime);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{ title: '名称', field: 'name', editor: 'validatebox', width: 100},
|
||||||
|
{ title: '规格', field: 'standard', editor: 'validatebox', width: 60},
|
||||||
|
{ title: '型号', field: 'model', editor: 'validatebox', width: 60},
|
||||||
|
{ title: '扩展信息', field: 'materialOther', editor: 'validatebox', width: 70},
|
||||||
{ title: '库存',field: 'Stock',editor:'validatebox',width:50},
|
{ title: '库存',field: 'Stock',editor:'validatebox',width:50},
|
||||||
{ title: '单位',field: 'Unit',editor:'validatebox',width:60},
|
{ title: '单位',field: 'Unit',editor:'validatebox',width:60},
|
||||||
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
|
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
|
||||||
@@ -785,6 +788,7 @@
|
|||||||
if(type === "add") {
|
if(type === "add") {
|
||||||
$("#depotHeadDlg #append").click(); //新增行
|
$("#depotHeadDlg #append").click(); //新增行
|
||||||
} else if(type === "edit") {
|
} else if(type === "edit") {
|
||||||
|
editIndex = 0;
|
||||||
for(var i=0;i<data.rows.length;i++){
|
for(var i=0;i<data.rows.length;i++){
|
||||||
$('#materialData').datagrid('selectRow', i).datagrid('beginEdit', i);
|
$('#materialData').datagrid('selectRow', i).datagrid('beginEdit', i);
|
||||||
inOutService.autoReckon();
|
inOutService.autoReckon();
|
||||||
@@ -815,7 +819,11 @@
|
|||||||
showFooter: true,
|
showFooter: true,
|
||||||
columns:[[
|
columns:[[
|
||||||
{ title: '仓库名称',field: 'DepotName',editor:'validatebox',width:90},
|
{ title: '仓库名称',field: 'DepotName',editor:'validatebox',width:90},
|
||||||
{ title: '条码_名称(规格)(型号)(扩展信息)(单位)',field: 'MaterialName',width:270},
|
{ title: '条码',field: 'barCode', editor:'validatebox', width:120},
|
||||||
|
{ title: '名称', field: 'name', editor: 'validatebox', width: 100},
|
||||||
|
{ title: '规格', field: 'standard', editor: 'validatebox', width: 60},
|
||||||
|
{ title: '型号', field: 'model', editor: 'validatebox', width: 60},
|
||||||
|
{ title: '扩展信息', field: 'materialOther', editor: 'validatebox', width: 70},
|
||||||
{ title: '库存',field: 'Stock',width:50},
|
{ title: '库存',field: 'Stock',width:50},
|
||||||
{ title: '单位',field: 'Unit',editor:'validatebox',width:60},
|
{ title: '单位',field: 'Unit',editor:'validatebox',width:60},
|
||||||
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
|
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
|
||||||
|
|||||||
@@ -199,6 +199,26 @@
|
|||||||
<a href="javascript:void(0)" id="saveOtherMoneyDlg" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
|
<a href="javascript:void(0)" id="saveOtherMoneyDlg" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
|
||||||
<a href="javascript:void(0)" id="cancelOtherMoneyDlg" class="easyui-linkbutton" iconCls="icon-cancel">取消</a>
|
<a href="javascript:void(0)" id="cancelOtherMoneyDlg" class="easyui-linkbutton" iconCls="icon-cancel">取消</a>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="materialSelectDlg" class="easyui-dialog" style="width:880px;padding:10px 20px;"
|
||||||
|
closed="true" modal="true" buttons="#materialSelectDlgBtn" cache="false" collapsible="false" closable="true">
|
||||||
|
<div class="box-body form-inline">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label">条码:</label>
|
||||||
|
<div class="control-inline">
|
||||||
|
<input type="text" id="searchBarCode" name="searchBarCode" value="" maxlength="100" class="easyui-textbox width-90"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchMaterialBtn">查询</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<table id="materialSelectData" style="top:100px;border-bottom-color:#FFFFFF"></table>
|
||||||
|
</div>
|
||||||
|
<div id="materialSelectDlgBtn">
|
||||||
|
<a href="javascript:void(0)" id="checkMaterial" class="easyui-linkbutton" iconCls="icon-ok">选择</a>
|
||||||
|
<a href="javascript:void(0)" id="cancelMaterial" class="easyui-linkbutton" iconCls="icon-cancel"
|
||||||
|
onclick="javascript:$('#materialSelectDlg').dialog('close')">取消</a>
|
||||||
|
</div>
|
||||||
<div id="supplier"></div>
|
<div id="supplier"></div>
|
||||||
<div id="depot"></div>
|
<div id="depot"></div>
|
||||||
<script>
|
<script>
|
||||||
@@ -615,8 +635,9 @@
|
|||||||
footer =$("#depotHeadFM .datagrid-view2 .datagrid-footer");
|
footer =$("#depotHeadFM .datagrid-view2 .datagrid-footer");
|
||||||
input = "input[type=text]";
|
input = "input[type=text]";
|
||||||
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
|
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
|
||||||
var mId = currentRowDom.find("[field='MaterialExtendId']").find(".textbox-value").val();
|
var barCode = currentRowDom.find("[field='barCode']").find(".textbox-value").val();
|
||||||
if(mId){
|
if(barCode){
|
||||||
|
var mId = inOutService.getInfoByBarCode(barCode);
|
||||||
var type = "select"; //type 类型:点击 click,选择 select
|
var type = "select"; //type 类型:点击 click,选择 select
|
||||||
inOutService.findStockNumById(depotId, mId, monthTime, currentRowDom, input, ratioDepot, type);
|
inOutService.findStockNumById(depotId, mId, monthTime, currentRowDom, input, ratioDepot, type);
|
||||||
}
|
}
|
||||||
@@ -624,53 +645,35 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ title: '条码_名称(规格)(型号)(扩展信息)(单位)',field: 'MaterialExtendId',width:270,
|
{ title: '条码',field: 'barCode', editor:'validatebox', width:120,
|
||||||
formatter:function(value,row,index){
|
editor: {
|
||||||
return row.MaterialName;
|
type: 'textbox',
|
||||||
},
|
options: {
|
||||||
editor:{
|
buttonText:'...',
|
||||||
type:'combogrid',
|
editable:false,
|
||||||
options:{
|
onClickButton: function(){
|
||||||
url: "/material/findBySelect",
|
var rowDom = $(this).closest(".datagrid-row").find("[field='op']").find("img");
|
||||||
idField:'Id',
|
rowDom.closest(".datagrid-cell").click(); //点击操作
|
||||||
textField:'MaterialName',
|
var row = $('#materialData').datagrid('getChecked');
|
||||||
method:'get',
|
editIndex = $('#materialData').datagrid("getRowIndex", row[0]);
|
||||||
pagination: true,
|
var depotId;
|
||||||
mode: 'remote',
|
|
||||||
hasDownArrow: false,
|
|
||||||
panelWidth: 630, //下拉框的宽度
|
|
||||||
panelHeight: 380,//下拉框的高度
|
|
||||||
columns:[[
|
|
||||||
{field:'mBarCode',title:'条码',width:120},
|
|
||||||
{field:'name',title:'名称',width:140},
|
|
||||||
{field:'standard',title:'规格',width:80},
|
|
||||||
{field:'model',title:'型号',width:80},
|
|
||||||
{field:'unit',title:'单位',width:60},
|
|
||||||
{field:'stock',title:'库存',width:50},
|
|
||||||
{field:'expand',title:'扩展信息',width:80}
|
|
||||||
]],
|
|
||||||
onBeforeLoad: function(param){
|
|
||||||
var edDepot = $('#materialData').datagrid('getEditor', {index:editIndex,field:'DepotId'});
|
var edDepot = $('#materialData').datagrid('getEditor', {index:editIndex,field:'DepotId'});
|
||||||
if(edDepot) {
|
if(edDepot) {
|
||||||
param.depotId = $(edDepot.target).combobox('getValue');
|
depotId = $(edDepot.target).combobox('getValue');
|
||||||
}
|
}
|
||||||
param.mpList = mPropertyList; //商品属性
|
$('#materialSelectDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui/themes/icons/edit_add.png"/> 选择商品');
|
||||||
},
|
$("#materialSelectDlg").panel("move",{top:$(document).scrollTop() + ($(window).height()-500) * 0.5});
|
||||||
onLoadSuccess: function (rec) {
|
inOutService.initMaterialSelectData();
|
||||||
if(rec && rec.total==1) {
|
inOutService.initMaterialSelectPager(depotId);
|
||||||
$(".datagrid-body [field='mBarCode']").click(); //在只有单个商品的时候自动选中
|
inOutService.materialSelectFun(depotId);
|
||||||
var body =$("#depotHeadFM .datagrid-view2 .datagrid-body");
|
|
||||||
input = "input[type=text]";
|
|
||||||
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
|
|
||||||
currentRowDom.find("[field='OperNumber']").find(input).focus().select();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onSelect:function(index, rowData){
|
|
||||||
inOutService.materialSelect(rowData,monthTime);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{ title: '名称', field: 'name', editor: 'validatebox', width: 100},
|
||||||
|
{ title: '规格', field: 'standard', editor: 'validatebox', width: 60},
|
||||||
|
{ title: '型号', field: 'model', editor: 'validatebox', width: 60},
|
||||||
|
{ title: '扩展信息', field: 'materialOther', editor: 'validatebox', width: 70},
|
||||||
{ title: '库存',field: 'Stock',editor:'validatebox',width:50},
|
{ title: '库存',field: 'Stock',editor:'validatebox',width:50},
|
||||||
{ title: '单位',field: 'Unit',editor:'validatebox',width:60},
|
{ title: '单位',field: 'Unit',editor:'validatebox',width:60},
|
||||||
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
|
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
|
||||||
@@ -743,6 +746,7 @@
|
|||||||
if(type === "add") {
|
if(type === "add") {
|
||||||
$("#depotHeadDlg #append").click(); //新增行
|
$("#depotHeadDlg #append").click(); //新增行
|
||||||
} else if(type === "edit") {
|
} else if(type === "edit") {
|
||||||
|
editIndex = 0;
|
||||||
for(var i=0;i<data.rows.length;i++){
|
for(var i=0;i<data.rows.length;i++){
|
||||||
$('#materialData').datagrid('selectRow', i).datagrid('beginEdit', i);
|
$('#materialData').datagrid('selectRow', i).datagrid('beginEdit', i);
|
||||||
inOutService.autoReckon();
|
inOutService.autoReckon();
|
||||||
@@ -773,7 +777,11 @@
|
|||||||
showFooter: true,
|
showFooter: true,
|
||||||
columns:[[
|
columns:[[
|
||||||
{ title: '仓库名称',field: 'DepotName',editor:'validatebox',width:90},
|
{ title: '仓库名称',field: 'DepotName',editor:'validatebox',width:90},
|
||||||
{ title: '条码_名称(规格)(型号)(扩展信息)(单位)',field: 'MaterialName',width:270},
|
{ title: '条码',field: 'barCode', editor:'validatebox', width:120},
|
||||||
|
{ title: '名称', field: 'name', editor: 'validatebox', width: 100},
|
||||||
|
{ title: '规格', field: 'standard', editor: 'validatebox', width: 60},
|
||||||
|
{ title: '型号', field: 'model', editor: 'validatebox', width: 60},
|
||||||
|
{ title: '扩展信息', field: 'materialOther', editor: 'validatebox', width: 70},
|
||||||
{ title: '库存',field: 'Stock',width:50},
|
{ title: '库存',field: 'Stock',width:50},
|
||||||
{ title: '单位',field: 'Unit',editor:'validatebox',width:60},
|
{ title: '单位',field: 'Unit',editor:'validatebox',width:60},
|
||||||
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
|
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
|
||||||
|
|||||||
@@ -297,6 +297,26 @@
|
|||||||
<a href="javascript:void(0)" id="cancelLinkBill" class="easyui-linkbutton" iconCls="icon-cancel"
|
<a href="javascript:void(0)" id="cancelLinkBill" class="easyui-linkbutton" iconCls="icon-cancel"
|
||||||
onclick="javascript:$('#linkBillDlg').dialog('close')">取消</a>
|
onclick="javascript:$('#linkBillDlg').dialog('close')">取消</a>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="materialSelectDlg" class="easyui-dialog" style="width:880px;padding:10px 20px;"
|
||||||
|
closed="true" modal="true" buttons="#materialSelectDlgBtn" cache="false" collapsible="false" closable="true">
|
||||||
|
<div class="box-body form-inline">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label">条码:</label>
|
||||||
|
<div class="control-inline">
|
||||||
|
<input type="text" id="searchBarCode" name="searchBarCode" value="" maxlength="100" class="easyui-textbox width-90"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchMaterialBtn">查询</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<table id="materialSelectData" style="top:100px;border-bottom-color:#FFFFFF"></table>
|
||||||
|
</div>
|
||||||
|
<div id="materialSelectDlgBtn">
|
||||||
|
<a href="javascript:void(0)" id="checkMaterial" class="easyui-linkbutton" iconCls="icon-ok">选择</a>
|
||||||
|
<a href="javascript:void(0)" id="cancelMaterial" class="easyui-linkbutton" iconCls="icon-cancel"
|
||||||
|
onclick="javascript:$('#materialSelectDlg').dialog('close')">取消</a>
|
||||||
|
</div>
|
||||||
<div id="supplier"></div>
|
<div id="supplier"></div>
|
||||||
<div id="depot"></div>
|
<div id="depot"></div>
|
||||||
<div id="account"></div>
|
<div id="account"></div>
|
||||||
@@ -810,8 +830,9 @@
|
|||||||
footer =$("#depotHeadFM .datagrid-view2 .datagrid-footer");
|
footer =$("#depotHeadFM .datagrid-view2 .datagrid-footer");
|
||||||
input = "input[type=text]";
|
input = "input[type=text]";
|
||||||
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
|
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
|
||||||
var mId = currentRowDom.find("[field='MaterialExtendId']").find(".textbox-value").val();
|
var barCode = currentRowDom.find("[field='barCode']").find(".textbox-value").val();
|
||||||
if(mId){
|
if(barCode){
|
||||||
|
var mId = inOutService.getInfoByBarCode(barCode);
|
||||||
var type = "select"; //type 类型:点击 click,选择 select
|
var type = "select"; //type 类型:点击 click,选择 select
|
||||||
inOutService.findStockNumById(depotId, mId, monthTime, currentRowDom, input, ratioDepot, type);
|
inOutService.findStockNumById(depotId, mId, monthTime, currentRowDom, input, ratioDepot, type);
|
||||||
}
|
}
|
||||||
@@ -819,53 +840,35 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ title: '条码_名称(规格)(型号)(扩展信息)(单位)',field: 'MaterialExtendId',width:270,
|
{ title: '条码',field: 'barCode', editor:'validatebox', width:120,
|
||||||
formatter:function(value,row,index){
|
editor: {
|
||||||
return row.MaterialName;
|
type: 'textbox',
|
||||||
},
|
options: {
|
||||||
editor:{
|
buttonText:'...',
|
||||||
type:'combogrid',
|
editable:false,
|
||||||
options:{
|
onClickButton: function(){
|
||||||
url: "/material/findBySelect",
|
var rowDom = $(this).closest(".datagrid-row").find("[field='op']").find("img");
|
||||||
idField:'Id',
|
rowDom.closest(".datagrid-cell").click(); //点击操作
|
||||||
textField:'MaterialName',
|
var row = $('#materialData').datagrid('getChecked');
|
||||||
method:'get',
|
editIndex = $('#materialData').datagrid("getRowIndex", row[0]);
|
||||||
pagination: true,
|
var depotId;
|
||||||
mode: 'remote',
|
|
||||||
hasDownArrow: false,
|
|
||||||
panelWidth: 630, //下拉框的宽度
|
|
||||||
panelHeight: 380,//下拉框的高度
|
|
||||||
columns:[[
|
|
||||||
{field:'mBarCode',title:'条码',width:120},
|
|
||||||
{field:'name',title:'名称',width:140},
|
|
||||||
{field:'standard',title:'规格',width:80},
|
|
||||||
{field:'model',title:'型号',width:80},
|
|
||||||
{field:'unit',title:'单位',width:60},
|
|
||||||
{field:'stock',title:'库存',width:50},
|
|
||||||
{field:'expand',title:'扩展信息',width:80}
|
|
||||||
]],
|
|
||||||
onBeforeLoad: function(param){
|
|
||||||
var edDepot = $('#materialData').datagrid('getEditor', {index:editIndex,field:'DepotId'});
|
var edDepot = $('#materialData').datagrid('getEditor', {index:editIndex,field:'DepotId'});
|
||||||
if(edDepot) {
|
if(edDepot) {
|
||||||
param.depotId = $(edDepot.target).combobox('getValue');
|
depotId = $(edDepot.target).combobox('getValue');
|
||||||
}
|
}
|
||||||
param.mpList = mPropertyList; //商品属性
|
$('#materialSelectDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui/themes/icons/edit_add.png"/> 选择商品');
|
||||||
},
|
$("#materialSelectDlg").panel("move",{top:$(document).scrollTop() + ($(window).height()-500) * 0.5});
|
||||||
onLoadSuccess: function (rec) {
|
inOutService.initMaterialSelectData();
|
||||||
if(rec && rec.total==1) {
|
inOutService.initMaterialSelectPager(depotId);
|
||||||
$(".datagrid-body [field='mBarCode']").click(); //在只有单个商品的时候自动选中
|
inOutService.materialSelectFun(depotId);
|
||||||
var body =$("#depotHeadFM .datagrid-view2 .datagrid-body");
|
|
||||||
input = "input[type=text]";
|
|
||||||
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
|
|
||||||
currentRowDom.find("[field='OperNumber']").find(input).focus().select();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onSelect:function(index, rowData){
|
|
||||||
inOutService.materialSelect(rowData,monthTime);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{ title: '名称', field: 'name', editor: 'validatebox', width: 100},
|
||||||
|
{ title: '规格', field: 'standard', editor: 'validatebox', width: 60},
|
||||||
|
{ title: '型号', field: 'model', editor: 'validatebox', width: 60},
|
||||||
|
{ title: '扩展信息', field: 'materialOther', editor: 'validatebox', width: 70},
|
||||||
{ title: '库存',field: 'Stock',editor:'validatebox',width:50},
|
{ title: '库存',field: 'Stock',editor:'validatebox',width:50},
|
||||||
{ title: '单位',field: 'Unit',editor:'validatebox',width:60},
|
{ title: '单位',field: 'Unit',editor:'validatebox',width:60},
|
||||||
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
|
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
|
||||||
@@ -938,6 +941,7 @@
|
|||||||
if(type === "add") {
|
if(type === "add") {
|
||||||
$("#depotHeadDlg #append").click(); //新增行
|
$("#depotHeadDlg #append").click(); //新增行
|
||||||
} else if(type === "edit") {
|
} else if(type === "edit") {
|
||||||
|
editIndex = 0;
|
||||||
for(var i=0;i<data.rows.length;i++){
|
for(var i=0;i<data.rows.length;i++){
|
||||||
$('#materialData').datagrid('selectRow', i).datagrid('beginEdit', i);
|
$('#materialData').datagrid('selectRow', i).datagrid('beginEdit', i);
|
||||||
inOutService.autoReckon();
|
inOutService.autoReckon();
|
||||||
@@ -968,7 +972,11 @@
|
|||||||
showFooter: true,
|
showFooter: true,
|
||||||
columns:[[
|
columns:[[
|
||||||
{ title: '仓库名称',field: 'DepotName',editor:'validatebox',width:90},
|
{ title: '仓库名称',field: 'DepotName',editor:'validatebox',width:90},
|
||||||
{ title: '条码_名称(规格)(型号)(扩展信息)(单位)',field: 'MaterialName',width:270},
|
{ title: '条码',field: 'barCode', editor:'validatebox', width:120},
|
||||||
|
{ title: '名称', field: 'name', editor: 'validatebox', width: 100},
|
||||||
|
{ title: '规格', field: 'standard', editor: 'validatebox', width: 60},
|
||||||
|
{ title: '型号', field: 'model', editor: 'validatebox', width: 60},
|
||||||
|
{ title: '扩展信息', field: 'materialOther', editor: 'validatebox', width: 70},
|
||||||
{ title: '库存',field: 'Stock',width:50},
|
{ title: '库存',field: 'Stock',width:50},
|
||||||
{ title: '单位',field: 'Unit',editor:'validatebox',width:60},
|
{ title: '单位',field: 'Unit',editor:'validatebox',width:60},
|
||||||
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
|
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
|
||||||
|
|||||||
@@ -176,12 +176,17 @@ public class DepotItemController {
|
|||||||
ratio = ratio.substring(ratio.indexOf("("));
|
ratio = ratio.substring(ratio.indexOf("("));
|
||||||
}
|
}
|
||||||
//名称/型号/扩展信息/包装
|
//名称/型号/扩展信息/包装
|
||||||
String MaterialName = diEx.getBarCode() + "_" + ((diEx.getMName() == null || diEx.getMName().equals("")) ? "" : diEx.getMName())
|
String MaterialName = ((diEx.getMName() == null || diEx.getMName().equals("")) ? "" : diEx.getMName())
|
||||||
+ ((diEx.getMStandard() == null || diEx.getMStandard().equals("")) ? "" : "(" + diEx.getMStandard() + ")")
|
+ ((diEx.getMStandard() == null || diEx.getMStandard().equals("")) ? "" : "(" + diEx.getMStandard() + ")")
|
||||||
+ ((diEx.getMModel() == null || diEx.getMModel().equals("")) ? "" : "(" + diEx.getMModel() + ")");
|
+ ((diEx.getMModel() == null || diEx.getMModel().equals("")) ? "" : "(" + diEx.getMModel() + ")");
|
||||||
String materialOther = getOtherInfo(mpArr, diEx);
|
String materialOther = getOtherInfo(mpArr, diEx);
|
||||||
MaterialName = MaterialName + materialOther + ((diEx.getUnitName() == null || diEx.getUnitName().equals("")) ? "" : "(" + diEx.getUnitName() + ")") + ratio;
|
MaterialName = MaterialName + materialOther + ((diEx.getUnitName() == null || diEx.getUnitName().equals("")) ? "" : "(" + diEx.getUnitName() + ")") + ratio;
|
||||||
item.put("MaterialName", MaterialName == null ? "" : MaterialName);
|
item.put("MaterialName", MaterialName == null ? "" : MaterialName);
|
||||||
|
item.put("barCode", diEx.getBarCode());
|
||||||
|
item.put("name", diEx.getMName());
|
||||||
|
item.put("standard", diEx.getMStandard());
|
||||||
|
item.put("model", diEx.getMModel());
|
||||||
|
item.put("materialOther", materialOther);
|
||||||
BigDecimal stock = depotItemService.getStockByParam(diEx.getDepotId(),diEx.getMaterialId(),null,null,tenantId);
|
BigDecimal stock = depotItemService.getStockByParam(diEx.getDepotId(),diEx.getMaterialId(),null,null,tenantId);
|
||||||
item.put("Stock", stock);
|
item.put("Stock", stock);
|
||||||
item.put("Unit", diEx.getMaterialUnit());
|
item.put("Unit", diEx.getMaterialUnit());
|
||||||
@@ -200,11 +205,6 @@ public class DepotItemController {
|
|||||||
item.put("TaxRate", diEx.getTaxRate());
|
item.put("TaxRate", diEx.getTaxRate());
|
||||||
item.put("TaxMoney", diEx.getTaxMoney());
|
item.put("TaxMoney", diEx.getTaxMoney());
|
||||||
item.put("TaxLastMoney", diEx.getTaxLastMoney());
|
item.put("TaxLastMoney", diEx.getTaxLastMoney());
|
||||||
item.put("OtherField1", diEx.getOtherField1());
|
|
||||||
item.put("OtherField2", diEx.getOtherField2());
|
|
||||||
item.put("OtherField3", diEx.getOtherField3());
|
|
||||||
item.put("OtherField4", diEx.getOtherField4());
|
|
||||||
item.put("OtherField5", diEx.getOtherField5());
|
|
||||||
item.put("MType", diEx.getMaterialType());
|
item.put("MType", diEx.getMaterialType());
|
||||||
item.put("op", 1);
|
item.put("op", 1);
|
||||||
dataArray.add(item);
|
dataArray.add(item);
|
||||||
|
|||||||
@@ -108,13 +108,32 @@ public class MaterialController {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping(value = "/findByIdWithBarCode")
|
@GetMapping(value = "/findByIdWithBarCode")
|
||||||
public BaseResponseInfo findByIdWithBarCode(@RequestParam("meId") Long meId, HttpServletRequest request) throws Exception{
|
public BaseResponseInfo findByIdWithBarCode(@RequestParam("meId") Long meId,
|
||||||
|
@RequestParam("mpList") String mpList,
|
||||||
|
HttpServletRequest request) throws Exception{
|
||||||
BaseResponseInfo res = new BaseResponseInfo();
|
BaseResponseInfo res = new BaseResponseInfo();
|
||||||
try {
|
try {
|
||||||
|
String[] mpArr = mpList.split(",");
|
||||||
MaterialVo4Unit mu = new MaterialVo4Unit();
|
MaterialVo4Unit mu = new MaterialVo4Unit();
|
||||||
List<MaterialVo4Unit> list = materialService.findByIdWithBarCode(meId);
|
List<MaterialVo4Unit> list = materialService.findByIdWithBarCode(meId);
|
||||||
if(list!=null && list.size()>0) {
|
if(list!=null && list.size()>0) {
|
||||||
mu = list.get(0);
|
mu = list.get(0);
|
||||||
|
String expand = ""; //扩展信息
|
||||||
|
for (int i = 0; i < mpArr.length; i++) {
|
||||||
|
if (mpArr[i].equals("制造商")) {
|
||||||
|
expand = expand + ((mu.getMfrs() == null || mu.getMfrs().equals("")) ? "" : "(" + mu.getMfrs() + ")");
|
||||||
|
}
|
||||||
|
if (mpArr[i].equals("自定义1")) {
|
||||||
|
expand = expand + ((mu.getOtherField1() == null || mu.getOtherField1().equals("")) ? "" : "(" + mu.getOtherField1() + ")");
|
||||||
|
}
|
||||||
|
if (mpArr[i].equals("自定义2")) {
|
||||||
|
expand = expand + ((mu.getOtherField2() == null || mu.getOtherField2().equals("")) ? "" : "(" + mu.getOtherField2() + ")");
|
||||||
|
}
|
||||||
|
if (mpArr[i].equals("自定义3")) {
|
||||||
|
expand = expand + ((mu.getOtherField3() == null || mu.getOtherField3().equals("")) ? "" : "(" + mu.getOtherField3() + ")");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mu.setMaterialOther(expand);
|
||||||
}
|
}
|
||||||
res.code = 200;
|
res.code = 200;
|
||||||
res.data = mu;
|
res.data = mu;
|
||||||
@@ -194,7 +213,7 @@ public class MaterialController {
|
|||||||
item.put("model", material.getModel());
|
item.put("model", material.getModel());
|
||||||
item.put("standard", material.getStandard());
|
item.put("standard", material.getStandard());
|
||||||
item.put("unit", material.getCommodityUnit() + ratio);
|
item.put("unit", material.getCommodityUnit() + ratio);
|
||||||
if(depotId!=null&& StringUtil.isNotEmpty(q)) {
|
if(depotId!=null) {
|
||||||
BigDecimal stock = depotItemService.getStockByParam(depotId,material.getId(),null,null,tenantId);
|
BigDecimal stock = depotItemService.getStockByParam(depotId,material.getId(),null,null,tenantId);
|
||||||
item.put("stock", stock);
|
item.put("stock", stock);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.jsh.erp.controller;
|
|||||||
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.jsh.erp.datasource.entities.MaterialExtend;
|
||||||
import com.jsh.erp.datasource.vo.MaterialExtendVo4List;
|
import com.jsh.erp.datasource.vo.MaterialExtendVo4List;
|
||||||
import com.jsh.erp.service.materialExtend.MaterialExtendService;
|
import com.jsh.erp.service.materialExtend.MaterialExtendService;
|
||||||
import com.jsh.erp.utils.BaseResponseInfo;
|
import com.jsh.erp.utils.BaseResponseInfo;
|
||||||
@@ -63,4 +64,21 @@ public class MaterialExtendController {
|
|||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping(value = "/getInfoByBarCode")
|
||||||
|
public BaseResponseInfo getInfoByBarCode(@RequestParam("barCode") String barCode,
|
||||||
|
HttpServletRequest request)throws Exception {
|
||||||
|
BaseResponseInfo res = new BaseResponseInfo();
|
||||||
|
Map<String, Object> map = new HashMap<String, Object>();
|
||||||
|
try {
|
||||||
|
MaterialExtend materialExtend = materialExtendService.getInfoByBarCode(barCode);
|
||||||
|
res.code = 200;
|
||||||
|
res.data = materialExtend;
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
res.code = 500;
|
||||||
|
res.data = "获取数据失败";
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -322,10 +322,10 @@ public class DepotItemService {
|
|||||||
DepotItem depotItem = new DepotItem();
|
DepotItem depotItem = new DepotItem();
|
||||||
JSONObject rowObj = JSONObject.parseObject(rowArr.getString(i));
|
JSONObject rowObj = JSONObject.parseObject(rowArr.getString(i));
|
||||||
depotItem.setHeaderId(headerId);
|
depotItem.setHeaderId(headerId);
|
||||||
Long materialExtendId = rowObj.getLong("MaterialExtendId");
|
String barCode = rowObj.getString("barCode");
|
||||||
Long materialId = materialExtendService.getMaterialExtend(materialExtendId).getMaterialId();
|
MaterialExtend materialExtend = materialExtendService.getInfoByBarCode(barCode);
|
||||||
depotItem.setMaterialId(materialId);
|
depotItem.setMaterialId(materialExtend.getMaterialId());
|
||||||
depotItem.setMaterialExtendId(rowObj.getLong("MaterialExtendId"));
|
depotItem.setMaterialExtendId(materialExtend.getId());
|
||||||
depotItem.setMaterialUnit(rowObj.getString("Unit"));
|
depotItem.setMaterialUnit(rowObj.getString("Unit"));
|
||||||
if (StringUtil.isExist(rowObj.get("OperNumber"))) {
|
if (StringUtil.isExist(rowObj.get("OperNumber"))) {
|
||||||
depotItem.setOperNumber(rowObj.getBigDecimal("OperNumber"));
|
depotItem.setOperNumber(rowObj.getBigDecimal("OperNumber"));
|
||||||
@@ -333,7 +333,7 @@ public class DepotItemService {
|
|||||||
String Unit = rowObj.get("Unit").toString();
|
String Unit = rowObj.get("Unit").toString();
|
||||||
BigDecimal oNumber = rowObj.getBigDecimal("OperNumber");
|
BigDecimal oNumber = rowObj.getBigDecimal("OperNumber");
|
||||||
//以下进行单位换算
|
//以下进行单位换算
|
||||||
String unitName = materialService.findUnitName(materialId); //查询计量单位名称
|
String unitName = materialService.findUnitName(materialExtend.getMaterialId()); //查询计量单位名称
|
||||||
if (!StringUtil.isEmpty(unitName)) {
|
if (!StringUtil.isEmpty(unitName)) {
|
||||||
String unitList = unitName.substring(0, unitName.indexOf("("));
|
String unitList = unitName.substring(0, unitName.indexOf("("));
|
||||||
String ratioList = unitName.substring(unitName.indexOf("("));
|
String ratioList = unitName.substring(unitName.indexOf("("));
|
||||||
|
|||||||
@@ -308,4 +308,16 @@ public class MaterialExtendService {
|
|||||||
}
|
}
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public MaterialExtend getInfoByBarCode(String barCode)throws Exception {
|
||||||
|
MaterialExtend materialExtend = new MaterialExtend();
|
||||||
|
MaterialExtendExample example = new MaterialExtendExample();
|
||||||
|
example.createCriteria().andBarCodeEqualTo(barCode)
|
||||||
|
.andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
||||||
|
List<MaterialExtend> list = materialExtendMapper.selectByExample(example);
|
||||||
|
if(list!=null && list.size()>0) {
|
||||||
|
materialExtend = list.get(0);
|
||||||
|
}
|
||||||
|
return materialExtend;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -235,7 +235,7 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getMaterialByMeId" parameterType="com.jsh.erp.datasource.entities.MaterialExample" resultMap="ResultMapList">
|
<select id="getMaterialByMeId" parameterType="com.jsh.erp.datasource.entities.MaterialExample" resultMap="ResultMapList">
|
||||||
select m.*,me.bar_code m_bar_code,u.name unitName, mc.name categoryName
|
select m.*,me.bar_code,u.name unitName, mc.name categoryName
|
||||||
FROM jsh_material m
|
FROM jsh_material m
|
||||||
left join jsh_material_extend me on m.id=me.material_id and ifnull(me.delete_Flag,'0') !='1'
|
left join jsh_material_extend me on m.id=me.material_id and ifnull(me.delete_Flag,'0') !='1'
|
||||||
left JOIN jsh_unit u on m.unit_id = u.id and ifnull(u.delete_flag,'0') !='1'
|
left JOIN jsh_unit u on m.unit_id = u.id and ifnull(u.delete_flag,'0') !='1'
|
||||||
|
|||||||
Reference in New Issue
Block a user