报表和单据中商品信息的'扩展信息'的优化

This commit is contained in:
码农的春天
2017-10-23 00:37:35 +08:00
parent 4a3c169276
commit 26c4950b10
8 changed files with 257 additions and 99 deletions

View File

@@ -35,10 +35,7 @@
<td>
<input name="searchModel" id="searchModel" style="width:80px;"/>
</td>
<td>颜色:</td>
<td>
<input name="searchColor" id="searchColor" style="width:80px;"/>
</td>
<td>&nbsp;</td>
<td>类别:</td>
<td>
<select name="searchCategoryId_f" id="searchCategoryId_f" style="width:100px;"></select>
@@ -253,6 +250,7 @@
var cid=1;
var multiple = 0; //倍数
var mPropertyList = null; //商品属性列表
var mPropertyListShort = ""; //商品属性列表-传值
//初始化界面
$(function()
{
@@ -263,6 +261,7 @@
initSelectInfo("edit_first");
manyUnitFun();
priceKeyUp();//价格触发事件
initMPropertyShort(); //初始化商品属性
initTableData();
ininPager();
initForm();
@@ -529,6 +528,34 @@
});
}
//初始化商品属性
function initMPropertyShort(){
$.ajax({
type: "post",
url: "<%=path %>/materialProperty/findBy.action",
dataType: "json",
async: false,
success: function (res) {
if (res && res.rows) {
var thisRows = res.rows;
for(var i=0; i < thisRows.length; i++) {
if(thisRows[i].enabled){
mPropertyListShort += thisRows[i].nativeName +",";
}
}
if(mPropertyListShort){
mPropertyListShort = mPropertyListShort.substring(0,mPropertyListShort.length-1);
}
}
},
//此处添加错误处理
error:function() {
$.messager.alert('查询提示','查询信息异常,请稍后再试!','error');
return;
}
});
}
//初始化表格数据
function initTableData() {
//改变宽度和高度
@@ -550,7 +577,6 @@
//fitColumns:true,
//单击行是否选中
//checkOnSelect : false,
url:'<%=path %>/material/findBy.action?pageSize=' + initPageSize+'&CategoryIds='+setCategoryId+'&CategoryId='+cid,
pagination: true,
//交替出现背景
striped : true,
@@ -576,8 +602,7 @@
},
{ title: '品名',field: 'Name',width:80},
{ title: '型号',field: 'Model',width:80},
{ title: '颜色',field: 'Color',width:80},
{ title: '规格',field: 'Standard',width:80},
{ title: '扩展信息',field: 'MaterialOther',width:150},
{ title: '单位',field: 'Unit',width:60},
{ title: '安全存量',field: 'SafetyStock',width:90},
{ title: '零售价',field: 'RetailPrice',width:60},
@@ -651,6 +676,7 @@
return;
}
});
showMaterialDetails(1,initPageSize);
}
//初始化键盘enter事件
@@ -1384,8 +1410,7 @@
});
function showMaterialDetails(pageNo,pageSize)
{
function showMaterialDetails(pageNo,pageSize) {
if(setCategoryId!="1") {
cid = 2;
}
@@ -1402,6 +1427,7 @@
Color: $.trim($("#searchColor").val()),
CategoryId:cid,
CategoryIds:setCategoryId,
mpList: mPropertyListShort,
pageNo:pageNo,
pageSize:pageSize
}),

View File

@@ -48,24 +48,50 @@
</div>
<script type="text/javascript">
var mPropertyList = ""; //商品属性列表
//初始化界面
$(function()
{
var thisDate = getNowFormatMonth(); //当前月份
$("#searchMonth").val(thisDate);
initMProperty(); //初始化商品属性
initTableData();
ininPager();
search();
print();
});
});
//初始化商品属性
function initMProperty(){
$.ajax({
type: "post",
url: "<%=path %>/materialProperty/findBy.action",
dataType: "json",
success: function (res) {
if (res && res.rows) {
var thisRows = res.rows;
for(var i=0; i < thisRows.length; i++) {
if(thisRows[i].enabled){
mPropertyList += thisRows[i].nativeName +",";
}
}
if(mPropertyList){
mPropertyList = mPropertyList.substring(0,mPropertyList.length-1);
}
}
},
//此处添加错误处理
error:function() {
$.messager.alert('查询提示','查询信息异常,请稍后再试!','error');
return;
}
});
}
//初始化表格数据
function initTableData()
{
$('#tableData').datagrid({
//title:'列表',
//iconCls:'icon-save',
//width:700,
height:heightInfo,
nowrap: false,
rownumbers: true,
@@ -82,8 +108,7 @@
columns:[[
{ title: '名称',field: 'MaterialName',width:60},
{ title: '型号',field: 'MaterialModel',width:80},
{ title: '规格',field: 'MaterialStandard',width:80},
{ title: '颜色',field: 'MaterialColor',width:80,hidden:true},
{ title: '扩展信息',field: 'MaterialOther',width:150},
{ title: '单位',field: 'MaterialUnit',width:80},
{ title: '进货数量',field: 'InSum',width:60},
{ title: '进货金额',field: 'InSumPrice',width:60},
@@ -146,11 +171,10 @@
var pager = $("#tableData").datagrid('getPager');
opts.pageNumber = 1;
opts.pageSize = initPageSize;
pager.pagination('refresh',
{
pageNumber:1,
pageSize:initPageSize
});
pager.pagination('refresh', {
pageNumber:1,
pageSize:initPageSize
});
}
//搜索处理
$("#searchBtn").unbind().bind({
@@ -182,7 +206,7 @@
var MIds = resNew.mIds;
if(MIds) {
$.ajax({
type:"get",
type:"post",
url: "<%=path %>/depotItem/buyIn.action",
dataType: "json",
data: ({
@@ -190,7 +214,8 @@
pageSize:pageSize,
MonthTime:$("#searchMonth").val(),
HeadIds:HeadIds,
MaterialIds:MIds
MaterialIds:MIds,
mpList: mPropertyList
}),
success: function (data)
{

View File

@@ -44,11 +44,13 @@
</div>
<script type="text/javascript">
var mPropertyList = ""; //商品属性列表
//初始化界面
$(function(){
var userBusinessList=null;
var userdepot=null;
initGift();
initMProperty(); //初始化商品属性
initTableData();
ininPager();
});
@@ -73,6 +75,33 @@
});
}
//初始化商品属性
function initMProperty(){
$.ajax({
type: "post",
url: "<%=path %>/materialProperty/findBy.action",
dataType: "json",
success: function (res) {
if (res && res.rows) {
var thisRows = res.rows;
for(var i=0; i < thisRows.length; i++) {
if(thisRows[i].enabled){
mPropertyList += thisRows[i].nativeName +",";
}
}
if(mPropertyList){
mPropertyList = mPropertyList.substring(0,mPropertyList.length-1);
}
}
},
//此处添加错误处理
error:function() {
$.messager.alert('查询提示','查询信息异常,请稍后再试!','error');
return;
}
});
}
//初始化表格数据
function initTableData(){
$('#tableData').datagrid({
@@ -91,8 +120,7 @@
columns:[[
{ title: '名称',field: 'MaterialName',width:60},
{ title: '型号',field: 'MaterialModel',width:80},
{ title: '规格',field: 'MaterialStandard',width:80},
{ title: '颜色',field: 'MaterialColor',width:80,hidden:true},
{ title: '扩展信息',field: 'MaterialOther',width:150},
{ title: '单位',field: 'MaterialUnit',width:80},
{ title: '结存数量',field: 'thisSum',width:80}
]],
@@ -186,7 +214,7 @@
var MIds = resNew.mIds;
if(MIds) {
$.ajax({
type:"get",
type:"post",
url: "<%=path %>/depotItem/findGiftByAll.action",
dataType: "json",
data: ({
@@ -194,7 +222,8 @@
pageSize:pageSize,
ProjectId: searchGiftId,
HeadIds: HeadIds,
MaterialIds: MIds
MaterialIds: MIds,
mpList: mPropertyList
}),
success: function (data) {
$("#tableData").datagrid('loadData',data);

View File

@@ -60,6 +60,7 @@
<script type="text/javascript">
var depotList = null;
var depotID = null;
var mPropertyList = ""; //商品属性列表
//初始化界面
$(function()
{
@@ -71,6 +72,7 @@
initSelectInfo_UB();
initSystemData_depot();
initSelectInfo_depot();
initMProperty(); //初始化商品属性
initTableData();
ininPager();
search();
@@ -180,14 +182,38 @@
$("#searchProjectId").empty().append('<option value="">全部</option>').append(options);
}
}
//初始化商品属性
function initMProperty(){
$.ajax({
type: "post",
url: "<%=path %>/materialProperty/findBy.action",
dataType: "json",
success: function (res) {
if (res && res.rows) {
var thisRows = res.rows;
for(var i=0; i < thisRows.length; i++) {
if(thisRows[i].enabled){
mPropertyList += thisRows[i].nativeName +",";
}
}
if(mPropertyList){
mPropertyList = mPropertyList.substring(0,mPropertyList.length-1);
}
}
},
//此处添加错误处理
error:function() {
$.messager.alert('查询提示','查询信息异常,请稍后再试!','error');
return;
}
});
}
//初始化表格数据
function initTableData()
{
$('#tableData').datagrid({
//title:'列表',
//iconCls:'icon-save',
//width:700,
height:heightInfo,
nowrap: false,
rownumbers: true,
@@ -204,8 +230,7 @@
columns:[[
{ title: '名称',field: 'MaterialName',width:60},
{ title: '型号',field: 'MaterialModel',width:80},
{ title: '规格',field: 'MaterialStandard',width:80},
{ title: '颜色',field: 'MaterialColor',width:80,hidden:true},
{ title: '扩展信息',field: 'MaterialOther',width:150},
{ title: '单位',field: 'MaterialUnit',width:80},
{ title: '单价',field: 'UnitPrice',width:60,formatter: function(value,row,index){
return value.toFixed(2);
@@ -328,7 +353,7 @@
}
else {
$.ajax({
type:"get",
type:"post",
url: "<%=path %>/depotItem/findByAll.action",
dataType: "json",
data: ({
@@ -337,7 +362,8 @@
ProjectId: $.trim($("#searchProjectId").val()),
MonthTime:$("#searchMonth").val(),
HeadIds:HeadIds,
MaterialIds:MIds
MaterialIds:MIds,
mpList: mPropertyList
}),
success: function (data)
{

View File

@@ -49,25 +49,51 @@
</div>
<script type="text/javascript">
var mPropertyList = ""; //商品属性列表
//初始化界面
$(function()
{
$("#searchTable .tip").css("padding-left","15px").css("color","red");
var thisDate = getNowFormatMonth(); //当前月份
$("#searchMonth").val(thisDate);
initMProperty(); //初始化商品属性
initTableData();
ininPager();
search();
print();
});
});
//初始化商品属性
function initMProperty(){
$.ajax({
type: "post",
url: "<%=path %>/materialProperty/findBy.action",
dataType: "json",
success: function (res) {
if (res && res.rows) {
var thisRows = res.rows;
for(var i=0; i < thisRows.length; i++) {
if(thisRows[i].enabled){
mPropertyList += thisRows[i].nativeName +",";
}
}
if(mPropertyList){
mPropertyList = mPropertyList.substring(0,mPropertyList.length-1);
}
}
},
//此处添加错误处理
error:function() {
$.messager.alert('查询提示','查询信息异常,请稍后再试!','error');
return;
}
});
}
//初始化表格数据
function initTableData()
{
$('#tableData').datagrid({
//title:'列表',
//iconCls:'icon-save',
//width:700,
height:heightInfo,
nowrap: false,
rownumbers: true,
@@ -84,8 +110,7 @@
columns:[[
{ title: '名称',field: 'MaterialName',width:60},
{ title: '型号',field: 'MaterialModel',width:80},
{ title: '规格',field: 'MaterialStandard',width:80},
{ title: '颜色',field: 'MaterialColor',width:80,hidden:true},
{ title: '扩展信息',field: 'MaterialOther',width:150},
{ title: '单位',field: 'MaterialUnit',width:80},
{ title: '销售数量',field: 'OutSum',width:60},
{ title: '销售金额',field: 'OutSumPrice',width:60},
@@ -184,7 +209,7 @@
var MIds = resNew.mIds;
if(MIds) {
$.ajax({
type:"get",
type:"post",
url: "<%=path %>/depotItem/saleOut.action",
dataType: "json",
data: ({
@@ -192,7 +217,8 @@
pageSize:pageSize,
MonthTime:$("#searchMonth").val(),
HeadIds:HeadIds,
MaterialIds:MIds
MaterialIds:MIds,
mpList: mPropertyList
}),
success: function (data)
{