优化单据中商品条码的搜索方式

This commit is contained in:
季圣华 2020-11-15 20:14:38 +08:00
parent 6bafce9820
commit f2120fb0d5
20 changed files with 868 additions and 581 deletions

View File

@ -178,7 +178,7 @@
var thisRows = res.data.page.rows;
for (var i = 0; i < thisRows.length; i++) {
if (thisRows[i].enabled) {
mPropertyList += thisRows[i].nativename + ",";
mPropertyList += thisRows[i].nativeName + ",";
}
}
if (mPropertyList) {
@ -240,7 +240,8 @@
type: "get",
dataType: "json",
data: {
meId: meId
meId: meId,
mpList: mPropertyList
},
success: function (rec) {
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) {
var TotalPrice = 0;
@ -1041,8 +1063,8 @@
});
body.find("[field='MaterialExtendId']").find(".textbox-text").focus().select(); //默认选择商品框
//点击商品下拉框自动加载数量单价金额
body.find("[field='Stock']").find(input).prop("readonly","readonly");
body.find("[field='Unit']").find(input).prop("readonly","readonly");
body.find("[field='name'],[field='standard'],[field='model'],[field='materialOther'],[field='Stock'],[field='Unit']")
.find(input).prop("readonly","readonly");
//点击商品名称
body.find("[field='MaterialExtendId']").find(input).next().off("mouseup").on("mouseup",function(){
var that = $(this);
@ -1065,7 +1087,7 @@
});
}
});
//删除按钮
//删除按钮
body.find("[field='op']").find("img").off("click").on("click",function() {
$(this).closest(".datagrid-cell").click(); //点击操作
var row = $('#materialData').datagrid('getChecked');
@ -1218,7 +1240,7 @@
}
var totalRowNum = "";
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) + "";
}
}
@ -1229,6 +1251,112 @@
}
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) {
var self = this;
@ -1242,7 +1370,8 @@
type: "get",
dataType: "json",
data: {
meId: meId
meId: meId,
mpList: mPropertyList
},
success: function (res) {
if(res && res.code === 200) {
@ -1256,6 +1385,11 @@
footer =$("#depotHeadFM .datagrid-view2 .datagrid-footer");
input = "input[type=text]";
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).val(commodityUnit); //设置单位
if(info.unit){ //如果存在计量单位信息

View File

@ -134,6 +134,26 @@
<a href="javascript:void(0)" id="cancelDepotHeadShow" class="easyui-linkbutton" iconCls="icon-cancel"
onclick="javascript:$('#depotHeadDlgShow').dialog('close')">取消</a>
</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>
<script>
$(function(){
@ -475,8 +495,9 @@
footer =$("#depotHeadFM .datagrid-view2 .datagrid-footer");
input = "input[type=text]";
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
var mId = currentRowDom.find("[field='MaterialExtendId']").find(".textbox-value").val();
if(mId){
var barCode = currentRowDom.find("[field='barCode']").find(".textbox-value").val();
if(barCode){
var mId = inOutService.getInfoByBarCode(barCode);
var type = "select"; //type 类型点击 click选择 select
inOutService.findStockNumById(depotId, mId, monthTime, currentRowDom, input, ratioDepot, type);
}
@ -484,53 +505,35 @@
}
}
},
{ title: '条码_名称(规格)(型号)(扩展信息)(单位)',field: 'MaterialExtendId',width:270,
formatter:function(value,row,index){
return row.MaterialName;
},
editor:{
type:'combogrid',
options:{
url: "/material/findBySelect",
idField:'Id',
textField:'MaterialName',
method:'get',
pagination: true,
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){
{ title: '条码',field: 'barCode', editor:'validatebox', width:120,
editor: {
type: 'textbox',
options: {
buttonText:'...',
editable:false,
onClickButton: function(){
var rowDom = $(this).closest(".datagrid-row").find("[field='op']").find("img");
rowDom.closest(".datagrid-cell").click(); //点击操作
var row = $('#materialData').datagrid('getChecked');
editIndex = $('#materialData').datagrid("getRowIndex", row[0]);
var depotId;
var edDepot = $('#materialData').datagrid('getEditor', {index:editIndex,field:'DepotId'});
if(edDepot) {
param.depotId = $(edDepot.target).combobox('getValue');
depotId = $(edDepot.target).combobox('getValue');
}
param.mpList = mPropertyList; //商品属性
},
onLoadSuccess: function (rec) {
if(rec && rec.total==1) {
$(".datagrid-body [field='mBarCode']").click(); //在只有单个商品的时候自动选中
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);
$('#materialSelectDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui/themes/icons/edit_add.png"/>&nbsp;选择商品');
$("#materialSelectDlg").panel("move",{top:$(document).scrollTop() + ($(window).height()-500) * 0.5});
inOutService.initMaterialSelectData();
inOutService.initMaterialSelectPager(depotId);
inOutService.materialSelectFun(depotId);
}
}
}
},
{ 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: 'AnotherDepotId',editor:'validatebox',width:90,
formatter: function (value, row, index) {
@ -613,6 +616,7 @@
if(type === "add") {
$("#depotHeadDlg #append").click(); //新增行
} else if(type === "edit") {
editIndex = 0;
for(var i=0;i<data.rows.length;i++){
$('#materialData').datagrid('selectRow', i).datagrid('beginEdit', i);
inOutService.autoReckon();
@ -643,7 +647,11 @@
showFooter: true,
columns:[[
{ 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: 'AnotherDepotName',width:90},
{ title: '单位',field: 'Unit',editor:'validatebox',width:60},

View File

@ -133,6 +133,26 @@
<a href="javascript:void(0)" id="cancelDepotHeadShow" class="easyui-linkbutton" iconCls="icon-cancel"
onclick="javascript:$('#depotHeadDlgShow').dialog('close')">取消</a>
</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>
<script>
$(function(){
@ -455,7 +475,7 @@
}
},
{ 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) {
return row.DepotName;
},
@ -473,8 +493,9 @@
footer =$("#depotHeadFM .datagrid-view2 .datagrid-footer");
input = "input[type=text]";
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
var mId = currentRowDom.find("[field='MaterialExtendId']").find(".textbox-value").val();
if(mId){
var barCode = currentRowDom.find("[field='barCode']").find(".textbox-value").val();
if(barCode){
var mId = inOutService.getInfoByBarCode(barCode);
var type = "select"; //type 类型点击 click选择 select
inOutService.findStockNumById(depotId, mId, monthTime, currentRowDom, input, ratioDepot, type);
}
@ -482,53 +503,35 @@
}
}
},
{ title: '条码_名称(规格)(型号)(扩展信息)(单位)',field: 'MaterialExtendId',width:270,
formatter:function(value,row,index){
return row.MaterialName;
},
editor:{
type:'combogrid',
options:{
url: "/material/findBySelect",
idField:'Id',
textField:'MaterialName',
method:'get',
pagination: true,
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){
{ title: '条码',field: 'barCode', editor:'validatebox', width:120,
editor: {
type: 'textbox',
options: {
buttonText:'...',
editable:false,
onClickButton: function(){
var rowDom = $(this).closest(".datagrid-row").find("[field='op']").find("img");
rowDom.closest(".datagrid-cell").click(); //点击操作
var row = $('#materialData').datagrid('getChecked');
editIndex = $('#materialData').datagrid("getRowIndex", row[0]);
var depotId;
var edDepot = $('#materialData').datagrid('getEditor', {index:editIndex,field:'DepotId'});
if(edDepot) {
param.depotId = $(edDepot.target).combobox('getValue');
depotId = $(edDepot.target).combobox('getValue');
}
param.mpList = mPropertyList; //商品属性
},
onLoadSuccess: function (rec) {
if(rec && rec.total==1) {
$(".datagrid-body [field='mBarCode']").click(); //在只有单个商品的时候自动选中
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);
$('#materialSelectDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui/themes/icons/edit_add.png"/>&nbsp;选择商品');
$("#materialSelectDlg").panel("move",{top:$(document).scrollTop() + ($(window).height()-500) * 0.5});
inOutService.initMaterialSelectData();
inOutService.initMaterialSelectPager(depotId);
inOutService.materialSelectFun(depotId);
}
}
}
},
{ 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: 'Unit',editor:'validatebox',width:60},
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
@ -597,6 +600,7 @@
if(type === "add") {
$("#depotHeadDlg #append").click(); //新增行
} else if(type === "edit") {
editIndex = 0;
for(var i=0;i<data.rows.length;i++){
$('#materialData').datagrid('selectRow', i).datagrid('beginEdit', i);
inOutService.autoReckon();
@ -628,7 +632,11 @@
columns:[[
{ title: '商品类型',field: 'MType',width:80},
{ 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: 'Unit',editor:'validatebox',width:60},
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},

View File

@ -133,6 +133,26 @@
<a href="javascript:void(0)" id="cancelDepotHeadShow" class="easyui-linkbutton" iconCls="icon-cancel"
onclick="javascript:$('#depotHeadDlgShow').dialog('close')">取消</a>
</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>
<script>
$(function(){
@ -474,8 +494,9 @@
footer =$("#depotHeadFM .datagrid-view2 .datagrid-footer");
input = "input[type=text]";
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
var mId = currentRowDom.find("[field='MaterialExtendId']").find(".textbox-value").val();
if(mId){
var barCode = currentRowDom.find("[field='barCode']").find(".textbox-value").val();
if(barCode){
var mId = inOutService.getInfoByBarCode(barCode);
var type = "select"; //type 类型点击 click选择 select
inOutService.findStockNumById(depotId, mId, monthTime, currentRowDom, input, ratioDepot, type);
}
@ -483,53 +504,35 @@
}
}
},
{ title: '条码_名称(规格)(型号)(扩展信息)(单位)',field: 'MaterialExtendId',width:270,
formatter:function(value,row,index){
return row.MaterialName;
},
editor:{
type:'combogrid',
options:{
url: "/material/findBySelect",
idField:'Id',
textField:'MaterialName',
method:'get',
pagination: true,
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){
{ title: '条码',field: 'barCode', editor:'validatebox', width:120,
editor: {
type: 'textbox',
options: {
buttonText:'...',
editable:false,
onClickButton: function(){
var rowDom = $(this).closest(".datagrid-row").find("[field='op']").find("img");
rowDom.closest(".datagrid-cell").click(); //点击操作
var row = $('#materialData').datagrid('getChecked');
editIndex = $('#materialData').datagrid("getRowIndex", row[0]);
var depotId;
var edDepot = $('#materialData').datagrid('getEditor', {index:editIndex,field:'DepotId'});
if(edDepot) {
param.depotId = $(edDepot.target).combobox('getValue');
depotId = $(edDepot.target).combobox('getValue');
}
param.mpList = mPropertyList; //商品属性
},
onLoadSuccess: function (rec) {
if(rec && rec.total==1) {
$(".datagrid-body [field='mBarCode']").click(); //在只有单个商品的时候自动选中
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);
$('#materialSelectDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui/themes/icons/edit_add.png"/>&nbsp;选择商品');
$("#materialSelectDlg").panel("move",{top:$(document).scrollTop() + ($(window).height()-500) * 0.5});
inOutService.initMaterialSelectData();
inOutService.initMaterialSelectPager(depotId);
inOutService.materialSelectFun(depotId);
}
}
}
},
{ 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: 'Unit',editor:'validatebox',width:60},
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
@ -598,6 +601,7 @@
if(type === "add") {
$("#depotHeadDlg #append").click(); //新增行
} else if(type === "edit") {
editIndex = 0;
for(var i=0;i<data.rows.length;i++){
$('#materialData').datagrid('selectRow', i).datagrid('beginEdit', i);
inOutService.autoReckon();
@ -629,7 +633,11 @@
columns:[[
{ title: '商品类型',field: 'MType',width:80},
{ 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: 'Unit',editor:'validatebox',width:60},
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},

View File

@ -144,6 +144,26 @@
<a href="javascript:void(0)" id="cancelDepotHeadShow" class="easyui-linkbutton" iconCls="icon-cancel"
onclick="javascript:$('#depotHeadDlgShow').dialog('close')">取消</a>
</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="depot"></div>
<script>
@ -485,8 +505,9 @@
footer =$("#depotHeadFM .datagrid-view2 .datagrid-footer");
input = "input[type=text]";
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
var mId = currentRowDom.find("[field='MaterialExtendId']").find(".textbox-value").val();
if(mId){
var barCode = currentRowDom.find("[field='barCode']").find(".textbox-value").val();
if(barCode){
var mId = inOutService.getInfoByBarCode(barCode);
var type = "select"; //type 类型点击 click选择 select
inOutService.findStockNumById(depotId, mId, monthTime, currentRowDom, input, ratioDepot, type);
}
@ -494,53 +515,35 @@
}
}
},
{ title: '条码_名称(规格)(型号)(扩展信息)(单位)',field: 'MaterialExtendId',width:270,
formatter:function(value,row,index){
return row.MaterialName;
},
editor:{
type:'combogrid',
options:{
url: "/material/findBySelect",
idField:'Id',
textField:'MaterialName',
method:'get',
pagination: true,
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){
{ title: '条码',field: 'barCode', editor:'validatebox', width:120,
editor: {
type: 'textbox',
options: {
buttonText:'...',
editable:false,
onClickButton: function(){
var rowDom = $(this).closest(".datagrid-row").find("[field='op']").find("img");
rowDom.closest(".datagrid-cell").click(); //点击操作
var row = $('#materialData').datagrid('getChecked');
editIndex = $('#materialData').datagrid("getRowIndex", row[0]);
var depotId;
var edDepot = $('#materialData').datagrid('getEditor', {index:editIndex,field:'DepotId'});
if(edDepot) {
param.depotId = $(edDepot.target).combobox('getValue');
depotId = $(edDepot.target).combobox('getValue');
}
param.mpList = mPropertyList; //商品属性
},
onLoadSuccess: function (rec) {
if(rec && rec.total==1) {
$(".datagrid-body [field='mBarCode']").click(); //在只有单个商品的时候自动选中
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);
$('#materialSelectDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui/themes/icons/edit_add.png"/>&nbsp;选择商品');
$("#materialSelectDlg").panel("move",{top:$(document).scrollTop() + ($(window).height()-500) * 0.5});
inOutService.initMaterialSelectData();
inOutService.initMaterialSelectPager(depotId);
inOutService.materialSelectFun(depotId);
}
}
}
},
{ 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: 'Unit',editor:'validatebox',width:60},
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
@ -609,6 +612,7 @@
if(type === "add") {
$("#depotHeadDlg #append").click(); //新增行
} else if(type === "edit") {
editIndex = 0;
for(var i=0;i<data.rows.length;i++){
$('#materialData').datagrid('selectRow', i).datagrid('beginEdit', i);
inOutService.autoReckon();
@ -639,7 +643,11 @@
showFooter: true,
columns:[[
{ 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: 'Unit',editor:'validatebox',width:60},
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},

View File

@ -138,6 +138,26 @@
<a href="javascript:void(0)" id="cancelDepotHeadShow" class="easyui-linkbutton" iconCls="icon-cancel"
onclick="javascript:$('#depotHeadDlgShow').dialog('close')">取消</a>
</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>
<script>
$(function(){
@ -478,8 +498,9 @@
footer =$("#depotHeadFM .datagrid-view2 .datagrid-footer");
input = "input[type=text]";
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
var mId = currentRowDom.find("[field='MaterialExtendId']").find(".textbox-value").val();
if(mId){
var barCode = currentRowDom.find("[field='barCode']").find(".textbox-value").val();
if(barCode){
var mId = inOutService.getInfoByBarCode(barCode);
var type = "select"; //type 类型点击 click选择 select
inOutService.findStockNumById(depotId, mId, monthTime, currentRowDom, input, ratioDepot, type);
}
@ -487,53 +508,35 @@
}
}
},
{ title: '条码_名称(规格)(型号)(扩展信息)(单位)',field: 'MaterialExtendId',width:270,
formatter:function(value,row,index){
return row.MaterialName;
},
editor:{
type:'combogrid',
options:{
url: "/material/findBySelect",
idField:'Id',
textField:'MaterialName',
method:'get',
pagination: true,
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){
{ title: '条码',field: 'barCode', editor:'validatebox', width:120,
editor: {
type: 'textbox',
options: {
buttonText:'...',
editable:false,
onClickButton: function(){
var rowDom = $(this).closest(".datagrid-row").find("[field='op']").find("img");
rowDom.closest(".datagrid-cell").click(); //点击操作
var row = $('#materialData').datagrid('getChecked');
editIndex = $('#materialData').datagrid("getRowIndex", row[0]);
var depotId;
var edDepot = $('#materialData').datagrid('getEditor', {index:editIndex,field:'DepotId'});
if(edDepot) {
param.depotId = $(edDepot.target).combobox('getValue');
depotId = $(edDepot.target).combobox('getValue');
}
param.mpList = mPropertyList; //商品属性
},
onLoadSuccess: function (rec) {
if(rec && rec.total==1) {
$(".datagrid-body [field='mBarCode']").click(); //在只有单个商品的时候自动选中
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);
$('#materialSelectDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui/themes/icons/edit_add.png"/>&nbsp;选择商品');
$("#materialSelectDlg").panel("move",{top:$(document).scrollTop() + ($(window).height()-500) * 0.5});
inOutService.initMaterialSelectData();
inOutService.initMaterialSelectPager(depotId);
inOutService.materialSelectFun(depotId);
}
}
}
},
{ 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: 'Unit',editor:'validatebox',width:60},
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
@ -602,6 +605,7 @@
if(type === "add") {
$("#depotHeadDlg #append").click(); //新增行
} else if(type === "edit") {
editIndex = 0;
for(var i=0;i<data.rows.length;i++){
$('#materialData').datagrid('selectRow', i).datagrid('beginEdit', i);
inOutService.autoReckon();
@ -632,7 +636,11 @@
showFooter: true,
columns:[[
{ 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: 'Unit',editor:'validatebox',width:60},
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},

View File

@ -270,6 +270,26 @@
<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>
</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>
<script>
$(function(){
@ -616,8 +636,9 @@
footer =$("#depotHeadFM .datagrid-view2 .datagrid-footer");
input = "input[type=text]";
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
var mId = currentRowDom.find("[field='MaterialExtendId']").find(".textbox-value").val();
if(mId){
var barCode = currentRowDom.find("[field='barCode']").find(".textbox-value").val();
if(barCode){
var mId = inOutService.getInfoByBarCode(barCode);
var type = "select"; //type 类型点击 click选择 select
inOutService.findStockNumById(depotId, mId, monthTime, currentRowDom, input, ratioDepot, type);
}
@ -625,53 +646,35 @@
}
}
},
{ title: '条码_名称(规格)(型号)(扩展信息)(单位)',field: 'MaterialExtendId',width:270,
formatter:function(value,row,index){
return row.MaterialName;
},
editor:{
type:'combogrid',
options:{
url: "/material/findBySelect",
idField:'Id',
textField:'MaterialName',
method:'get',
pagination: true,
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){
{ title: '条码',field: 'barCode', editor:'validatebox', width:120,
editor: {
type: 'textbox',
options: {
buttonText:'...',
editable:false,
onClickButton: function(){
var rowDom = $(this).closest(".datagrid-row").find("[field='op']").find("img");
rowDom.closest(".datagrid-cell").click(); //点击操作
var row = $('#materialData').datagrid('getChecked');
editIndex = $('#materialData').datagrid("getRowIndex", row[0]);
var depotId;
var edDepot = $('#materialData').datagrid('getEditor', {index:editIndex,field:'DepotId'});
if(edDepot) {
param.depotId = $(edDepot.target).combobox('getValue');
depotId = $(edDepot.target).combobox('getValue');
}
param.mpList = mPropertyList; //商品属性
},
onLoadSuccess: function (rec) {
if(rec && rec.total==1) {
$(".datagrid-body [field='mBarCode']").click(); //在只有单个商品的时候自动选中
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);
$('#materialSelectDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui/themes/icons/edit_add.png"/>&nbsp;选择商品');
$("#materialSelectDlg").panel("move",{top:$(document).scrollTop() + ($(window).height()-500) * 0.5});
inOutService.initMaterialSelectData();
inOutService.initMaterialSelectPager(depotId);
inOutService.materialSelectFun(depotId);
}
}
}
},
{ 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: 'Unit',editor:'validatebox',width:60},
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
@ -744,6 +747,7 @@
if(type === "add") {
$("#depotHeadDlg #append").click(); //新增行
} else if(type === "edit") {
editIndex = 0;
for(var i=0;i<data.rows.length;i++){
$('#materialData').datagrid('selectRow', i).datagrid('beginEdit', i);
inOutService.autoReckon();
@ -774,7 +778,11 @@
showFooter: true,
columns:[[
{ 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: 'Unit',editor:'validatebox',width:60},
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},

View File

@ -295,6 +295,26 @@
<a href="javascript:void(0)" id="cancelLinkBill" class="easyui-linkbutton" iconCls="icon-cancel"
onclick="javascript:$('#linkBillDlg').dialog('close')">取消</a>
</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="depot"></div>
<div id="account"></div>
@ -741,8 +761,9 @@
footer =$("#depotHeadFM .datagrid-view2 .datagrid-footer");
input = "input[type=text]";
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
var mId = currentRowDom.find("[field='MaterialExtendId']").find(".textbox-value").val();
if(mId){
var barCode = currentRowDom.find("[field='barCode']").find(".textbox-value").val();
if(barCode){
var mId = inOutService.getInfoByBarCode(barCode);
var type = "select"; //type 类型点击 click选择 select
inOutService.findStockNumById(depotId, mId, monthTime, currentRowDom, input, ratioDepot, type);
}
@ -750,53 +771,35 @@
}
}
},
{ title: '条码_名称(规格)(型号)(扩展信息)(单位)',field: 'MaterialExtendId',width:270,
formatter:function(value,row,index){
return row.MaterialName;
},
editor:{
type:'combogrid',
options:{
url: "/material/findBySelect",
idField:'Id',
textField:'MaterialName',
method:'get',
pagination: true,
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){
{ title: '条码',field: 'barCode', editor:'validatebox', width:120,
editor: {
type: 'textbox',
options: {
buttonText:'...',
editable:false,
onClickButton: function(){
var rowDom = $(this).closest(".datagrid-row").find("[field='op']").find("img");
rowDom.closest(".datagrid-cell").click(); //点击操作
var row = $('#materialData').datagrid('getChecked');
editIndex = $('#materialData').datagrid("getRowIndex", row[0]);
var depotId;
var edDepot = $('#materialData').datagrid('getEditor', {index:editIndex,field:'DepotId'});
if(edDepot) {
param.depotId = $(edDepot.target).combobox('getValue');
depotId = $(edDepot.target).combobox('getValue');
}
param.mpList = mPropertyList; //商品属性
},
onLoadSuccess: function (rec) {
if(rec && rec.total==1) {
$(".datagrid-body [field='mBarCode']").click(); //在只有单个商品的时候自动选中
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);
$('#materialSelectDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui/themes/icons/edit_add.png"/>&nbsp;选择商品');
$("#materialSelectDlg").panel("move",{top:$(document).scrollTop() + ($(window).height()-500) * 0.5});
inOutService.initMaterialSelectData();
inOutService.initMaterialSelectPager(depotId);
inOutService.materialSelectFun(depotId);
}
}
}
},
{ 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: 'Unit',editor:'validatebox',width:60},
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
@ -869,6 +872,7 @@
if(type === "add") {
$("#depotHeadDlg #append").click(); //新增行
} else if(type === "edit") {
editIndex = 0;
for(var i=0;i<data.rows.length;i++){
$('#materialData').datagrid('selectRow', i).datagrid('beginEdit', i);
inOutService.autoReckon();
@ -899,7 +903,11 @@
showFooter: true,
columns:[[
{ 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: 'Unit',editor:'validatebox',width:60},
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},

View File

@ -197,6 +197,26 @@
<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>
</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="depot"></div>
<script>
@ -571,8 +591,9 @@
footer =$("#depotHeadFM .datagrid-view2 .datagrid-footer");
input = "input[type=text]";
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
var mId = currentRowDom.find("[field='MaterialExtendId']").find(".textbox-value").val();
if(mId){
var barCode = currentRowDom.find("[field='barCode']").find(".textbox-value").val();
if(barCode){
var mId = inOutService.getInfoByBarCode(barCode);
var type = "select"; //type 类型点击 click选择 select
inOutService.findStockNumById(depotId, mId, monthTime, currentRowDom, input, ratioDepot, type);
}
@ -580,53 +601,35 @@
}
}
},
{ title: '条码_名称(规格)(型号)(扩展信息)(单位)',field: 'MaterialExtendId',width:270,
formatter:function(value,row,index){
return row.MaterialName;
},
editor:{
type:'combogrid',
options:{
url: "/material/findBySelect",
idField:'Id',
textField:'MaterialName',
method:'get',
pagination: true,
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){
{ title: '条码',field: 'barCode', editor:'validatebox', width:120,
editor: {
type: 'textbox',
options: {
buttonText:'...',
editable:false,
onClickButton: function(){
var rowDom = $(this).closest(".datagrid-row").find("[field='op']").find("img");
rowDom.closest(".datagrid-cell").click(); //点击操作
var row = $('#materialData').datagrid('getChecked');
editIndex = $('#materialData').datagrid("getRowIndex", row[0]);
var depotId;
var edDepot = $('#materialData').datagrid('getEditor', {index:editIndex,field:'DepotId'});
if(edDepot) {
param.depotId = $(edDepot.target).combobox('getValue');
depotId = $(edDepot.target).combobox('getValue');
}
param.mpList = mPropertyList; //商品属性
},
onLoadSuccess: function (rec) {
if(rec && rec.total==1) {
$(".datagrid-body [field='mBarCode']").click(); //在只有单个商品的时候自动选中
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);
$('#materialSelectDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui/themes/icons/edit_add.png"/>&nbsp;选择商品');
$("#materialSelectDlg").panel("move",{top:$(document).scrollTop() + ($(window).height()-500) * 0.5});
inOutService.initMaterialSelectData();
inOutService.initMaterialSelectPager(depotId);
inOutService.materialSelectFun(depotId);
}
}
}
},
{ 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: 'Unit',editor:'validatebox',width:60},
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
@ -699,6 +702,7 @@
if(type === "add") {
$("#depotHeadDlg #append").click(); //新增行
} else if(type === "edit") {
editIndex = 0;
for(var i=0;i<data.rows.length;i++){
$('#materialData').datagrid('selectRow', i).datagrid('beginEdit', i);
inOutService.autoReckon();
@ -729,7 +733,11 @@
showFooter: true,
columns:[[
{ 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: 'Unit',editor:'validatebox',width:60},
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},

View File

@ -210,6 +210,26 @@
<a href="javascript:void(0)" id="cancelDepotHeadShow" class="easyui-linkbutton" iconCls="icon-cancel"
onclick="javascript:$('#depotHeadDlgShow').dialog('close')">取消</a>
</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>
<script>
$(function(){
@ -635,8 +655,9 @@
footer =$("#depotHeadFM .datagrid-view2 .datagrid-footer");
input = "input[type=text]";
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
var mId = currentRowDom.find("[field='MaterialExtendId']").find(".textbox-value").val();
if(mId){
var barCode = currentRowDom.find("[field='barCode']").find(".textbox-value").val();
if(barCode){
var mId = inOutService.getInfoByBarCode(barCode);
var type = "select"; //type 类型点击 click选择 select
inOutService.findStockNumById(depotId, mId, monthTime, currentRowDom, input, ratioDepot, type);
}
@ -644,53 +665,35 @@
}
}
},
{ title: '条码_名称(规格)(型号)(扩展信息)(单位)',field: 'MaterialExtendId',width:270,
formatter:function(value,row,index){
return row.MaterialName;
},
editor:{
type:'combogrid',
options:{
url: "/material/findBySelect",
idField:'Id',
textField:'MaterialName',
method:'get',
pagination: true,
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){
{ title: '条码',field: 'barCode', editor:'validatebox', width:120,
editor: {
type: 'textbox',
options: {
buttonText:'...',
editable:false,
onClickButton: function(){
var rowDom = $(this).closest(".datagrid-row").find("[field='op']").find("img");
rowDom.closest(".datagrid-cell").click(); //点击操作
var row = $('#materialData').datagrid('getChecked');
editIndex = $('#materialData').datagrid("getRowIndex", row[0]);
var depotId;
var edDepot = $('#materialData').datagrid('getEditor', {index:editIndex,field:'DepotId'});
if(edDepot) {
param.depotId = $(edDepot.target).combobox('getValue');
depotId = $(edDepot.target).combobox('getValue');
}
param.mpList = mPropertyList; //商品属性
},
onLoadSuccess: function (rec) {
if(rec && rec.total==1) {
$(".datagrid-body [field='mBarCode']").click(); //在只有单个商品的时候自动选中
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);
$('#materialSelectDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui/themes/icons/edit_add.png"/>&nbsp;选择商品');
$("#materialSelectDlg").panel("move",{top:$(document).scrollTop() + ($(window).height()-500) * 0.5});
inOutService.initMaterialSelectData();
inOutService.initMaterialSelectPager(depotId);
inOutService.materialSelectFun(depotId);
}
}
}
},
{ 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: 'Unit',editor:'validatebox',width:60},
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
@ -759,6 +762,7 @@
if(type === "add") {
$("#depotHeadDlg #append").click(); //新增行
} else if(type === "edit") {
editIndex = 0;
for(var i=0;i<data.rows.length;i++){
$('#materialData').datagrid('selectRow', i).datagrid('beginEdit', i);
inOutService.autoReckon();
@ -789,7 +793,11 @@
showFooter: true,
columns:[[
{ 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: 'Unit',editor:'validatebox',width:60},
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},

View File

@ -247,6 +247,26 @@
<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>
</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="depot"></div>
<script>
@ -671,8 +691,9 @@
footer =$("#depotHeadFM .datagrid-view2 .datagrid-footer");
input = "input[type=text]";
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
var mId = currentRowDom.find("[field='MaterialExtendId']").find(".textbox-value").val();
if(mId){
var barCode = currentRowDom.find("[field='barCode']").find(".textbox-value").val();
if(barCode){
var mId = inOutService.getInfoByBarCode(barCode);
var type = "select"; //type 类型点击 click选择 select
inOutService.findStockNumById(depotId, mId, monthTime, currentRowDom, input, ratioDepot, type);
}
@ -680,53 +701,35 @@
}
}
},
{ title: '条码_名称(规格)(型号)(扩展信息)(单位)',field: 'MaterialExtendId',width:270,
formatter:function(value,row,index){
return row.MaterialName;
},
editor:{
type:'combogrid',
options:{
url: "/material/findBySelect",
idField:'Id',
textField:'MaterialName',
method:'get',
pagination: true,
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){
{ title: '条码',field: 'barCode', editor:'validatebox', width:120,
editor: {
type: 'textbox',
options: {
buttonText:'...',
editable:false,
onClickButton: function(){
var rowDom = $(this).closest(".datagrid-row").find("[field='op']").find("img");
rowDom.closest(".datagrid-cell").click(); //点击操作
var row = $('#materialData').datagrid('getChecked');
editIndex = $('#materialData').datagrid("getRowIndex", row[0]);
var depotId;
var edDepot = $('#materialData').datagrid('getEditor', {index:editIndex,field:'DepotId'});
if(edDepot) {
param.depotId = $(edDepot.target).combobox('getValue');
depotId = $(edDepot.target).combobox('getValue');
}
param.mpList = mPropertyList; //商品属性
},
onLoadSuccess: function (rec) {
if(rec && rec.total==1) {
$(".datagrid-body [field='mBarCode']").click(); //在只有单个商品的时候自动选中
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);
$('#materialSelectDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui/themes/icons/edit_add.png"/>&nbsp;选择商品');
$("#materialSelectDlg").panel("move",{top:$(document).scrollTop() + ($(window).height()-500) * 0.5});
inOutService.initMaterialSelectData();
inOutService.initMaterialSelectPager(depotId);
inOutService.materialSelectFun(depotId);
}
}
}
},
{ 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: 'Unit',editor:'validatebox',width:60},
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
@ -795,6 +798,7 @@
if(type === "add") {
$("#depotHeadDlg #append").click(); //新增行
} else if(type === "edit") {
editIndex = 0;
for(var i=0;i<data.rows.length;i++){
$('#materialData').datagrid('selectRow', i).datagrid('beginEdit', i);
inOutService.autoReckon();
@ -825,7 +829,11 @@
showFooter: true,
columns:[[
{ 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: 'Unit',editor:'validatebox',width:60},
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},

View File

@ -270,6 +270,26 @@
<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>
</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>
<script>
$(function(){
@ -657,8 +677,9 @@
footer =$("#depotHeadFM .datagrid-view2 .datagrid-footer");
input = "input[type=text]";
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
var mId = currentRowDom.find("[field='MaterialExtendId']").find(".textbox-value").val();
if(mId){
var barCode = currentRowDom.find("[field='barCode']").find(".textbox-value").val();
if(barCode){
var mId = inOutService.getInfoByBarCode(barCode);
var type = "select"; //type 类型点击 click选择 select
inOutService.findStockNumById(depotId, mId, monthTime, currentRowDom, input, ratioDepot, type);
}
@ -666,53 +687,35 @@
}
}
},
{ title: '条码_名称(规格)(型号)(扩展信息)(单位)',field: 'MaterialExtendId',width:270,
formatter:function(value,row,index){
return row.MaterialName;
},
editor:{
type:'combogrid',
options:{
url: "/material/findBySelect",
idField:'Id',
textField:'MaterialName',
method:'get',
pagination: true,
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){
{ title: '条码',field: 'barCode', editor:'validatebox', width:120,
editor: {
type: 'textbox',
options: {
buttonText:'...',
editable:false,
onClickButton: function(){
var rowDom = $(this).closest(".datagrid-row").find("[field='op']").find("img");
rowDom.closest(".datagrid-cell").click(); //点击操作
var row = $('#materialData').datagrid('getChecked');
editIndex = $('#materialData').datagrid("getRowIndex", row[0]);
var depotId;
var edDepot = $('#materialData').datagrid('getEditor', {index:editIndex,field:'DepotId'});
if(edDepot) {
param.depotId = $(edDepot.target).combobox('getValue');
depotId = $(edDepot.target).combobox('getValue');
}
param.mpList = mPropertyList; //商品属性
},
onLoadSuccess: function (rec) {
if(rec && rec.total==1) {
$(".datagrid-body [field='mBarCode']").click(); //在只有单个商品的时候自动选中
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);
$('#materialSelectDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui/themes/icons/edit_add.png"/>&nbsp;选择商品');
$("#materialSelectDlg").panel("move",{top:$(document).scrollTop() + ($(window).height()-500) * 0.5});
inOutService.initMaterialSelectData();
inOutService.initMaterialSelectPager(depotId);
inOutService.materialSelectFun(depotId);
}
}
}
},
{ 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: 'Unit',editor:'validatebox',width:60},
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
@ -785,6 +788,7 @@
if(type === "add") {
$("#depotHeadDlg #append").click(); //新增行
} else if(type === "edit") {
editIndex = 0;
for(var i=0;i<data.rows.length;i++){
$('#materialData').datagrid('selectRow', i).datagrid('beginEdit', i);
inOutService.autoReckon();
@ -815,7 +819,11 @@
showFooter: true,
columns:[[
{ 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: 'Unit',editor:'validatebox',width:60},
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},

View File

@ -199,6 +199,26 @@
<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>
</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="depot"></div>
<script>
@ -615,8 +635,9 @@
footer =$("#depotHeadFM .datagrid-view2 .datagrid-footer");
input = "input[type=text]";
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
var mId = currentRowDom.find("[field='MaterialExtendId']").find(".textbox-value").val();
if(mId){
var barCode = currentRowDom.find("[field='barCode']").find(".textbox-value").val();
if(barCode){
var mId = inOutService.getInfoByBarCode(barCode);
var type = "select"; //type 类型点击 click选择 select
inOutService.findStockNumById(depotId, mId, monthTime, currentRowDom, input, ratioDepot, type);
}
@ -624,53 +645,35 @@
}
}
},
{ title: '条码_名称(规格)(型号)(扩展信息)(单位)',field: 'MaterialExtendId',width:270,
formatter:function(value,row,index){
return row.MaterialName;
},
editor:{
type:'combogrid',
options:{
url: "/material/findBySelect",
idField:'Id',
textField:'MaterialName',
method:'get',
pagination: true,
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){
{ title: '条码',field: 'barCode', editor:'validatebox', width:120,
editor: {
type: 'textbox',
options: {
buttonText:'...',
editable:false,
onClickButton: function(){
var rowDom = $(this).closest(".datagrid-row").find("[field='op']").find("img");
rowDom.closest(".datagrid-cell").click(); //点击操作
var row = $('#materialData').datagrid('getChecked');
editIndex = $('#materialData').datagrid("getRowIndex", row[0]);
var depotId;
var edDepot = $('#materialData').datagrid('getEditor', {index:editIndex,field:'DepotId'});
if(edDepot) {
param.depotId = $(edDepot.target).combobox('getValue');
depotId = $(edDepot.target).combobox('getValue');
}
param.mpList = mPropertyList; //商品属性
},
onLoadSuccess: function (rec) {
if(rec && rec.total==1) {
$(".datagrid-body [field='mBarCode']").click(); //在只有单个商品的时候自动选中
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);
$('#materialSelectDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui/themes/icons/edit_add.png"/>&nbsp;选择商品');
$("#materialSelectDlg").panel("move",{top:$(document).scrollTop() + ($(window).height()-500) * 0.5});
inOutService.initMaterialSelectData();
inOutService.initMaterialSelectPager(depotId);
inOutService.materialSelectFun(depotId);
}
}
}
},
{ 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: 'Unit',editor:'validatebox',width:60},
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
@ -743,6 +746,7 @@
if(type === "add") {
$("#depotHeadDlg #append").click(); //新增行
} else if(type === "edit") {
editIndex = 0;
for(var i=0;i<data.rows.length;i++){
$('#materialData').datagrid('selectRow', i).datagrid('beginEdit', i);
inOutService.autoReckon();
@ -773,7 +777,11 @@
showFooter: true,
columns:[[
{ 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: 'Unit',editor:'validatebox',width:60},
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},

View File

@ -297,6 +297,26 @@
<a href="javascript:void(0)" id="cancelLinkBill" class="easyui-linkbutton" iconCls="icon-cancel"
onclick="javascript:$('#linkBillDlg').dialog('close')">取消</a>
</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="depot"></div>
<div id="account"></div>
@ -810,8 +830,9 @@
footer =$("#depotHeadFM .datagrid-view2 .datagrid-footer");
input = "input[type=text]";
var currentRowDom = body.find(".datagrid-row").eq(editIndex);
var mId = currentRowDom.find("[field='MaterialExtendId']").find(".textbox-value").val();
if(mId){
var barCode = currentRowDom.find("[field='barCode']").find(".textbox-value").val();
if(barCode){
var mId = inOutService.getInfoByBarCode(barCode);
var type = "select"; //type 类型点击 click选择 select
inOutService.findStockNumById(depotId, mId, monthTime, currentRowDom, input, ratioDepot, type);
}
@ -819,53 +840,35 @@
}
}
},
{ title: '条码_名称(规格)(型号)(扩展信息)(单位)',field: 'MaterialExtendId',width:270,
formatter:function(value,row,index){
return row.MaterialName;
},
editor:{
type:'combogrid',
options:{
url: "/material/findBySelect",
idField:'Id',
textField:'MaterialName',
method:'get',
pagination: true,
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){
{ title: '条码',field: 'barCode', editor:'validatebox', width:120,
editor: {
type: 'textbox',
options: {
buttonText:'...',
editable:false,
onClickButton: function(){
var rowDom = $(this).closest(".datagrid-row").find("[field='op']").find("img");
rowDom.closest(".datagrid-cell").click(); //点击操作
var row = $('#materialData').datagrid('getChecked');
editIndex = $('#materialData').datagrid("getRowIndex", row[0]);
var depotId;
var edDepot = $('#materialData').datagrid('getEditor', {index:editIndex,field:'DepotId'});
if(edDepot) {
param.depotId = $(edDepot.target).combobox('getValue');
depotId = $(edDepot.target).combobox('getValue');
}
param.mpList = mPropertyList; //商品属性
},
onLoadSuccess: function (rec) {
if(rec && rec.total==1) {
$(".datagrid-body [field='mBarCode']").click(); //在只有单个商品的时候自动选中
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);
$('#materialSelectDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui/themes/icons/edit_add.png"/>&nbsp;选择商品');
$("#materialSelectDlg").panel("move",{top:$(document).scrollTop() + ($(window).height()-500) * 0.5});
inOutService.initMaterialSelectData();
inOutService.initMaterialSelectPager(depotId);
inOutService.materialSelectFun(depotId);
}
}
}
},
{ 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: 'Unit',editor:'validatebox',width:60},
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},
@ -938,6 +941,7 @@
if(type === "add") {
$("#depotHeadDlg #append").click(); //新增行
} else if(type === "edit") {
editIndex = 0;
for(var i=0;i<data.rows.length;i++){
$('#materialData').datagrid('selectRow', i).datagrid('beginEdit', i);
inOutService.autoReckon();
@ -968,7 +972,11 @@
showFooter: true,
columns:[[
{ 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: 'Unit',editor:'validatebox',width:60},
{ title: '数量',field: 'OperNumber',editor:'validatebox',width:60},

View File

@ -176,12 +176,17 @@ public class DepotItemController {
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.getMModel() == null || diEx.getMModel().equals("")) ? "" : "(" + diEx.getMModel() + ")");
String materialOther = getOtherInfo(mpArr, diEx);
MaterialName = MaterialName + materialOther + ((diEx.getUnitName() == null || diEx.getUnitName().equals("")) ? "" : "(" + diEx.getUnitName() + ")") + ratio;
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);
item.put("Stock", stock);
item.put("Unit", diEx.getMaterialUnit());
@ -200,11 +205,6 @@ public class DepotItemController {
item.put("TaxRate", diEx.getTaxRate());
item.put("TaxMoney", diEx.getTaxMoney());
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("op", 1);
dataArray.add(item);

View File

@ -108,13 +108,32 @@ public class MaterialController {
* @return
*/
@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();
try {
String[] mpArr = mpList.split(",");
MaterialVo4Unit mu = new MaterialVo4Unit();
List<MaterialVo4Unit> list = materialService.findByIdWithBarCode(meId);
if(list!=null && list.size()>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.data = mu;
@ -194,7 +213,7 @@ public class MaterialController {
item.put("model", material.getModel());
item.put("standard", material.getStandard());
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);
item.put("stock", stock);
}

View File

@ -2,6 +2,7 @@ package com.jsh.erp.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.datasource.entities.MaterialExtend;
import com.jsh.erp.datasource.vo.MaterialExtendVo4List;
import com.jsh.erp.service.materialExtend.MaterialExtendService;
import com.jsh.erp.utils.BaseResponseInfo;
@ -63,4 +64,21 @@ public class MaterialExtendController {
}
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;
}
}

View File

@ -322,10 +322,10 @@ public class DepotItemService {
DepotItem depotItem = new DepotItem();
JSONObject rowObj = JSONObject.parseObject(rowArr.getString(i));
depotItem.setHeaderId(headerId);
Long materialExtendId = rowObj.getLong("MaterialExtendId");
Long materialId = materialExtendService.getMaterialExtend(materialExtendId).getMaterialId();
depotItem.setMaterialId(materialId);
depotItem.setMaterialExtendId(rowObj.getLong("MaterialExtendId"));
String barCode = rowObj.getString("barCode");
MaterialExtend materialExtend = materialExtendService.getInfoByBarCode(barCode);
depotItem.setMaterialId(materialExtend.getMaterialId());
depotItem.setMaterialExtendId(materialExtend.getId());
depotItem.setMaterialUnit(rowObj.getString("Unit"));
if (StringUtil.isExist(rowObj.get("OperNumber"))) {
depotItem.setOperNumber(rowObj.getBigDecimal("OperNumber"));
@ -333,7 +333,7 @@ public class DepotItemService {
String Unit = rowObj.get("Unit").toString();
BigDecimal oNumber = rowObj.getBigDecimal("OperNumber");
//以下进行单位换算
String unitName = materialService.findUnitName(materialId); //查询计量单位名称
String unitName = materialService.findUnitName(materialExtend.getMaterialId()); //查询计量单位名称
if (!StringUtil.isEmpty(unitName)) {
String unitList = unitName.substring(0, unitName.indexOf("("));
String ratioList = unitName.substring(unitName.indexOf("("));

View File

@ -308,4 +308,16 @@ public class MaterialExtendService {
}
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;
}
}

View File

@ -235,7 +235,7 @@
</select>
<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
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'