parent
1e1e5f6ed5
commit
693a7558ba
108
README.md
108
README.md
@ -1,56 +1,54 @@
|
||||
# 华夏ERP完整开源版J2EE代码
|
||||
* 很多人说华夏ERP(英文名:jshERP)是目前唯一完整开源的进销存系统
|
||||
* 虽然目前只有进销存+财务的功能,但后面将会推出ERP的全部功能,大家一起努力吧
|
||||
* 系统初始账号:jsh,密码:123456,部署如有问题请联系QQ:752718920,欢迎加入华夏ERP交流群,群号码:120725710
|
||||
* 部署如遇到困难请参考Wiki文档 **https://gitee.com/jishenghua/JSH_ERP/wikis/pages**
|
||||
* **本系统演示地址:[http://120.78.214.220:8080](http://120.78.214.220:8080),账号:jsh,密码:123456,都是测试数据,欢迎随意试用**
|
||||
|
||||
# 开发初衷
|
||||
* 华夏ERP立志为中小企业提供开源好用的ERP软件,降低企业的信息化成本
|
||||
* 个人开发者也可以使用华夏ERP进行二次开发,承接外包ERP项目
|
||||
* 初学JAVA的小伙伴可以下载源代码来进行学习交流
|
||||
|
||||
# 技术框架
|
||||
* 核心框架:SpringBoot 1.5.1
|
||||
* 持久层框架:Mybatis 1.3.2
|
||||
* 日志管理:Log4j 1.2.16
|
||||
* JS框架:Jquery 1.8.0
|
||||
* UI框架: EasyUI 1.3.5
|
||||
* 桌面框架: HoorayOS
|
||||
* 项目管理框架: Maven3.2.3
|
||||
|
||||
# 开发环境
|
||||
建议开发者使用以下环境,可以避免版本带来的问题
|
||||
* IDE: MyEclipse8.5+/Eclipse4.4+
|
||||
* DB: Mysql5.1
|
||||
* JDK: JDK1.7+
|
||||
* WEB: Tomcat6.0+
|
||||
* Maven: Maven3.2.3+
|
||||
* 为方便大家搭建开发环境,分享了下载地址 **http://pan.baidu.com/s/1nuKnlNV**
|
||||
|
||||
# 运行环境
|
||||
* WEB服务器:Tomcat6.0+
|
||||
* 数据库服务器:Mysql5.1
|
||||
* JAVA平台: JRE1.7+
|
||||
* 操作系统:Windows、Linux等
|
||||
|
||||
# 开源说明
|
||||
* 本系统100%开源,遵守Apache2.0协议
|
||||
|
||||
# 系统美图
|
||||
* 零售管理
|
||||

|
||||
* 采购管理
|
||||

|
||||
* 销售管理
|
||||

|
||||
* 仓库管理
|
||||

|
||||
* 财务管理
|
||||

|
||||
* 报表查询
|
||||

|
||||
* 基础数据
|
||||

|
||||
* 系统管理
|
||||
# 华夏ERP完整开源版J2EE代码
|
||||
* 很多人说华夏ERP(英文名:jshERP)是目前唯一完整开源的进销存系统
|
||||
* 虽然目前只有进销存+财务的功能,但后面将会推出ERP的全部功能,大家一起努力吧
|
||||
* 系统初始账号:jsh,密码:123456,部署如有问题请联系QQ:752718920,欢迎加入华夏ERP交流群,群号码:120725710
|
||||
* 部署如遇到困难请参考Wiki文档 **https://gitee.com/jishenghua/JSH_ERP/wikis/pages**
|
||||
* **本系统演示地址:[http://120.78.214.220:8080](http://120.78.214.220:8080),账号:jsh,密码:123456,都是测试数据,欢迎随意试用**
|
||||
|
||||
# 开发初衷
|
||||
* 华夏ERP立志为中小企业提供开源好用的ERP软件,降低企业的信息化成本
|
||||
* 个人开发者也可以使用华夏ERP进行二次开发,承接外包ERP项目
|
||||
* 初学JAVA的小伙伴可以下载源代码来进行学习交流
|
||||
|
||||
# 技术框架
|
||||
* 核心框架:SpringBoot 1.5.1
|
||||
* 持久层框架:Mybatis 1.3.2
|
||||
* 日志管理:Log4j 1.2.16
|
||||
* JS框架:Jquery 1.8.0
|
||||
* UI框架: EasyUI 1.3.5
|
||||
* 桌面框架: HoorayOS 2.0.0
|
||||
* 项目管理框架: Maven 3.2.3
|
||||
|
||||
# 开发环境
|
||||
建议开发者使用以下环境,可以避免版本带来的问题
|
||||
* IDE: IntelliJ IDEA 2017+
|
||||
* DB: Mysql5.7.4
|
||||
* JDK: JDK1.8
|
||||
* Maven: Maven3.2.3+
|
||||
* 为方便大家搭建开发环境,分享了下载地址 **http://pan.baidu.com/s/1nuKnlNV**
|
||||
|
||||
# 运行环境
|
||||
* 数据库服务器:Mysql5.7.4
|
||||
* JAVA平台: JRE1.8
|
||||
* 操作系统:Windows、Linux等
|
||||
|
||||
# 开源说明
|
||||
* 本系统100%开源,遵守Apache2.0协议
|
||||
|
||||
# 系统美图
|
||||
* 零售管理
|
||||

|
||||
* 采购管理
|
||||

|
||||
* 销售管理
|
||||

|
||||
* 仓库管理
|
||||

|
||||
* 财务管理
|
||||

|
||||
* 报表查询
|
||||

|
||||
* 基础数据
|
||||

|
||||
* 系统管理
|
||||

|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,112 +1,118 @@
|
||||
// strPrintName 打印任务名
|
||||
// printDatagrid 要打印的datagrid
|
||||
function CreateFormPage(strPrintName, printDatagrid, path) {
|
||||
var beginDate= $("#searchBeginTime").val();
|
||||
var endDate= $("#searchEndTime").val();
|
||||
var getMonth= $("#searchMonth").val();
|
||||
var listTitle = $("#tablePanel").prev().text();
|
||||
listTitle = listTitle.replace("列表","");
|
||||
var companyName = "";
|
||||
//加载公司信息
|
||||
$.ajax({
|
||||
type:"get",
|
||||
url: path + "/systemConfig/findBy.action",
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function (res) {
|
||||
if(res && res.rows) {
|
||||
var array = res.rows;
|
||||
for(var i=0; i<array.length; i++){
|
||||
var name = array[i].name;
|
||||
if(name === "company_name") {
|
||||
companyName = array[i].value;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function() {
|
||||
$.messager.alert('查询失败','查询系统配置信息异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
var tableString = '<div class="div-title">' + companyName + "-" + listTitle + '\n</div>';
|
||||
if(beginDate && endDate) {
|
||||
tableString+='\n<div class="div-time">日期:' + beginDate + ' 至 ' + endDate + ' \n</div>';
|
||||
}
|
||||
if(getMonth) {
|
||||
tableString += '\n<div class="div-time">月份:' + getMonth + ' \n</div>';
|
||||
}
|
||||
tableString+='\n<table cellspacing="0" class="pb">';
|
||||
var frozenColumns = printDatagrid.datagrid("options").frozenColumns; // 得到frozenColumns对象
|
||||
var columns = printDatagrid.datagrid("options").columns; // 得到columns对象
|
||||
var nameList = '';
|
||||
|
||||
// 载入title
|
||||
if (typeof columns != 'undefined' && columns != '') {
|
||||
$(columns).each(function (index) {
|
||||
tableString += '\n<tr>';
|
||||
if (typeof frozenColumns != 'undefined' && typeof frozenColumns[index] != 'undefined') {
|
||||
for (var i = 0; i < frozenColumns[index].length; ++i) {
|
||||
if (!frozenColumns[index][i].hidden) {
|
||||
tableString += '\n<th width="' + frozenColumns[index][i].width + '"';
|
||||
if (typeof frozenColumns[index][i].rowspan != 'undefined' && frozenColumns[index][i].rowspan > 1) {
|
||||
tableString += ' rowspan="' + frozenColumns[index][i].rowspan + '"';
|
||||
}
|
||||
if (typeof frozenColumns[index][i].colspan != 'undefined' && frozenColumns[index][i].colspan > 1) {
|
||||
tableString += ' colspan="' + frozenColumns[index][i].colspan + '"';
|
||||
}
|
||||
if (typeof frozenColumns[index][i].field != 'undefined' && frozenColumns[index][i].field != '') {
|
||||
nameList += ',{"f":"' + frozenColumns[index][i].field + '", "a":"' + frozenColumns[index][i].align + '"}';
|
||||
}
|
||||
tableString += '>' + frozenColumns[0][i].title + '</th>';
|
||||
}
|
||||
}
|
||||
}
|
||||
for (var i = 0; i < columns[index].length; ++i) {
|
||||
if (!columns[index][i].hidden) {
|
||||
tableString += '\n<th width="' + columns[index][i].width + '"';
|
||||
if (typeof columns[index][i].rowspan != 'undefined' && columns[index][i].rowspan > 1) {
|
||||
tableString += ' rowspan="' + columns[index][i].rowspan + '"';
|
||||
}
|
||||
if (typeof columns[index][i].colspan != 'undefined' && columns[index][i].colspan > 1) {
|
||||
tableString += ' colspan="' + columns[index][i].colspan + '"';
|
||||
}
|
||||
if (typeof columns[index][i].field != 'undefined' && columns[index][i].field != '') {
|
||||
nameList += ',{"f":"' + columns[index][i].field + '", "a":"' + columns[index][i].align + '"}';
|
||||
}
|
||||
tableString += '>' + columns[index][i].title + '</th>';
|
||||
}
|
||||
}
|
||||
tableString += '\n</tr>';
|
||||
});
|
||||
}
|
||||
// 载入内容
|
||||
var rows = printDatagrid.datagrid("getRows"); // 这段代码是获取当前页的所有行
|
||||
var nl = eval('([' + nameList.substring(1) + '])');
|
||||
for (var i = 0; i < rows.length; ++i) {
|
||||
tableString += '\n<tr>';
|
||||
$(nl).each(function (j) {
|
||||
var e = nl[j].f.lastIndexOf('_0');
|
||||
|
||||
tableString += '\n<td';
|
||||
if (nl[j].a != 'undefined' && nl[j].a != '') {
|
||||
tableString += ' style="text-align:' + nl[j].a + ';"';
|
||||
}
|
||||
tableString += '>';
|
||||
if (e + 2 == nl[j].f.length) {
|
||||
tableString += rows[i][nl[j].f.substring(0, e)];
|
||||
}
|
||||
else
|
||||
tableString += rows[i][nl[j].f];
|
||||
tableString += '</td>';
|
||||
});
|
||||
tableString += '\n</tr>';
|
||||
}
|
||||
tableString += '\n</table>';
|
||||
|
||||
localStorage.setItem("tableString",tableString);
|
||||
|
||||
window.open("../../js/print/print.html","location:No;status:No;help:No;dialogWidth:800px;dialogHeight:600px;scroll:auto;");
|
||||
// strPrintName 打印任务名
|
||||
// printDatagrid 要打印的datagrid
|
||||
function CreateFormPage(strPrintName, printDatagrid) {
|
||||
var beginDate= $("#searchBeginTime").val();
|
||||
var endDate= $("#searchEndTime").val();
|
||||
var getMonth= $("#searchMonth").val();
|
||||
var listTitle = $("#tablePanel").prev().text();
|
||||
listTitle = listTitle.replace("列表","");
|
||||
var companyName = "";
|
||||
//加载公司信息
|
||||
$.ajax({
|
||||
type:"get",
|
||||
url: "/systemConfig/list",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
currentPage: 1,
|
||||
pageSize: 100
|
||||
}),
|
||||
async: false,
|
||||
success: function (res) {
|
||||
if (res && res.code === 200) {
|
||||
if(res.data && res.data.page) {
|
||||
var array = res.data.page.rows;
|
||||
for (var i = 0; i < array.length; i++) {
|
||||
var name = array[i].name;
|
||||
if (name === "company_name") {
|
||||
companyName = array[i].value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error:function() {
|
||||
$.messager.alert('查询失败','查询系统配置信息异常,请稍后再试!','error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
var tableString = '<div class="div-title">' + companyName + "-" + listTitle + '\n</div>';
|
||||
if(beginDate && endDate) {
|
||||
tableString+='\n<div class="div-time">日期:' + beginDate + ' 至 ' + endDate + ' \n</div>';
|
||||
}
|
||||
if(getMonth) {
|
||||
tableString += '\n<div class="div-time">月份:' + getMonth + ' \n</div>';
|
||||
}
|
||||
tableString+='\n<table cellspacing="0" class="pb">';
|
||||
var frozenColumns = printDatagrid.datagrid("options").frozenColumns; // 得到frozenColumns对象
|
||||
var columns = printDatagrid.datagrid("options").columns; // 得到columns对象
|
||||
var nameList = '';
|
||||
|
||||
// 载入title
|
||||
if (typeof columns != 'undefined' && columns != '') {
|
||||
$(columns).each(function (index) {
|
||||
tableString += '\n<tr>';
|
||||
if (typeof frozenColumns != 'undefined' && typeof frozenColumns[index] != 'undefined') {
|
||||
for (var i = 0; i < frozenColumns[index].length; ++i) {
|
||||
if (!frozenColumns[index][i].hidden) {
|
||||
tableString += '\n<th width="' + frozenColumns[index][i].width + '"';
|
||||
if (typeof frozenColumns[index][i].rowspan != 'undefined' && frozenColumns[index][i].rowspan > 1) {
|
||||
tableString += ' rowspan="' + frozenColumns[index][i].rowspan + '"';
|
||||
}
|
||||
if (typeof frozenColumns[index][i].colspan != 'undefined' && frozenColumns[index][i].colspan > 1) {
|
||||
tableString += ' colspan="' + frozenColumns[index][i].colspan + '"';
|
||||
}
|
||||
if (typeof frozenColumns[index][i].field != 'undefined' && frozenColumns[index][i].field != '') {
|
||||
nameList += ',{"f":"' + frozenColumns[index][i].field + '", "a":"' + frozenColumns[index][i].align + '"}';
|
||||
}
|
||||
tableString += '>' + frozenColumns[0][i].title + '</th>';
|
||||
}
|
||||
}
|
||||
}
|
||||
for (var i = 0; i < columns[index].length; ++i) {
|
||||
if (!columns[index][i].hidden) {
|
||||
tableString += '\n<th width="' + columns[index][i].width + '"';
|
||||
if (typeof columns[index][i].rowspan != 'undefined' && columns[index][i].rowspan > 1) {
|
||||
tableString += ' rowspan="' + columns[index][i].rowspan + '"';
|
||||
}
|
||||
if (typeof columns[index][i].colspan != 'undefined' && columns[index][i].colspan > 1) {
|
||||
tableString += ' colspan="' + columns[index][i].colspan + '"';
|
||||
}
|
||||
if (typeof columns[index][i].field != 'undefined' && columns[index][i].field != '') {
|
||||
nameList += ',{"f":"' + columns[index][i].field + '", "a":"' + columns[index][i].align + '"}';
|
||||
}
|
||||
tableString += '>' + columns[index][i].title + '</th>';
|
||||
}
|
||||
}
|
||||
tableString += '\n</tr>';
|
||||
});
|
||||
}
|
||||
// 载入内容
|
||||
var rows = printDatagrid.datagrid("getRows"); // 这段代码是获取当前页的所有行
|
||||
var nl = eval('([' + nameList.substring(1) + '])');
|
||||
for (var i = 0; i < rows.length; ++i) {
|
||||
tableString += '\n<tr>';
|
||||
$(nl).each(function (j) {
|
||||
var e = nl[j].f.lastIndexOf('_0');
|
||||
|
||||
tableString += '\n<td';
|
||||
if (nl[j].a != 'undefined' && nl[j].a != '') {
|
||||
tableString += ' style="text-align:' + nl[j].a + ';"';
|
||||
}
|
||||
tableString += '>';
|
||||
if (e + 2 == nl[j].f.length) {
|
||||
tableString += rows[i][nl[j].f.substring(0, e)];
|
||||
}
|
||||
else
|
||||
tableString += rows[i][nl[j].f];
|
||||
tableString += '</td>';
|
||||
});
|
||||
tableString += '\n</tr>';
|
||||
}
|
||||
tableString += '\n</table>';
|
||||
|
||||
localStorage.setItem("tableString",tableString);
|
||||
|
||||
window.open("../../js/print/print.html","location:No;status:No;help:No;dialogWidth:800px;dialogHeight:600px;scroll:auto;");
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,187 +1,186 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>客户信息</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="/css/common.css"/>
|
||||
<script type="text/javascript" src="/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="/js/common/common.js"></script>
|
||||
<script src="/js/pages/manage/supplier.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 查询 -->
|
||||
<div id="searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true"
|
||||
closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>名 称:</td>
|
||||
<td>
|
||||
<input type="text" name="searchSupplier" id="searchSupplier" style="width:100px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>手机号码:</td>
|
||||
<td>
|
||||
<input type="text" name="searchTelephone" id="searchTelephone" style="width:100px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>联系电话:</td>
|
||||
<td>
|
||||
<input type="text" name="searchPhonenum" id="searchPhonenum" style="width:100px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td id="searchDescLabel">备 注:</td>
|
||||
<td>
|
||||
<input type="text" name="searchDesc" id="searchDesc" style="width:100px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" id="searchResetBtn">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id="tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="客户信息列表" iconCls="icon-list"
|
||||
collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
<div id="supplierDlg" class="easyui-dialog" style="width:580px;padding:10px 20px"
|
||||
closed="true" buttons="#dlg-buttons" modal="true" collapsible="false" closable="true">
|
||||
<form id="supplierFM">
|
||||
<table>
|
||||
<tr>
|
||||
<td style="width: 80px;height: 20px">名称</td>
|
||||
<td style="width: 180px;padding:1px">
|
||||
<input name="supplier" id="supplier" class="easyui-validatebox"
|
||||
data-options="required:true,validType:'length[2,30]'" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td style="width: 60px;height: 20px">联系人</td>
|
||||
<td style="width:180px;padding:1px;">
|
||||
<input name="contacts" id="contacts" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>手机号码</td>
|
||||
<td style="padding:1px;">
|
||||
<input name="telephone" id="telephone" class="easyui-validatebox"
|
||||
style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>电子邮箱</td>
|
||||
<td style="padding:1px">
|
||||
<input name="email" id="email" class="easyui-validatebox" validType="email"
|
||||
style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>联系电话</td>
|
||||
<td style="padding:1px;">
|
||||
<input name="phonenum" id="phonenum" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>传真</td>
|
||||
<td style="padding:1px">
|
||||
<input name="fax" id="fax" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>期初应收</td>
|
||||
<td style="padding:1px">
|
||||
<input name="BeginNeedGet" id="BeginNeedGet" type="text" class="easyui-numberbox"
|
||||
data-options="min:0,precision:2" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>期初应付</td>
|
||||
<td style="padding:1px">
|
||||
<input name="BeginNeedPay" id="BeginNeedPay" type="text" class="easyui-numberbox"
|
||||
data-options="min:0,precision:2" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>累计应收</td>
|
||||
<td style="padding:1px">
|
||||
<input name="AllNeedGet" id="AllNeedGet" type="text" style="width: 160px;height: 20px"
|
||||
readonly="readonly"/>
|
||||
</td>
|
||||
<td>累计应付</td>
|
||||
<td style="padding:1px">
|
||||
<input name="AllNeedPay" id="AllNeedPay" type="text" style="width: 160px;height: 20px"
|
||||
readonly="readonly"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>纳税人识别号</td>
|
||||
<td style="padding:1px">
|
||||
<input name="taxNum" id="taxNum" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>税率</td>
|
||||
<td style="padding:1px">
|
||||
<input name="taxRate" id="taxRate" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>开户行</td>
|
||||
<td style="padding:1px">
|
||||
<input name="bankName" id="bankName" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>账号</td>
|
||||
<td style="padding:1px">
|
||||
<input name="accountNumber" id="accountNumber" class="easyui-validatebox"
|
||||
style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>地址</td>
|
||||
<td style="padding:1px" colspan="3">
|
||||
<input name="address" id="address" class="easyui-validatebox" style="width: 408px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>备注</td>
|
||||
<td style="padding:1px" colspan="3">
|
||||
<textarea name="description" id="description" rows="2" cols="2" style="width: 408px;"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<div id="dlg-buttons">
|
||||
<a href="javascript:void(0)" id="saveSupplier" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
|
||||
<a href="javascript:void(0)" id="cancelSupplier" class="easyui-linkbutton" iconCls="icon-cancel"
|
||||
onclick="javascript:$('#supplierDlg').dialog('close')">取消</a>
|
||||
</div>
|
||||
|
||||
<!-- 导入excel表格 -->
|
||||
<div id="importExcelDlg" style="padding:10px 20px">
|
||||
<form id="importExcelFM" method="post" enctype="multipart/form-data"
|
||||
action="/supplier/importExcelCustomer.action">
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label>文件名称 </label>
|
||||
<input name="supplierFile" id="supplierFile" type="file" style="width: 230px;height: 20px"/>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label><b>导入注意</b> </label><span>(预收款、期初应收、期初应付、税率均为数值且要大于0;另外期初应收、期初应付不能同时输入)</span>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px;display: none;">
|
||||
<label>是否审查 </label>
|
||||
<select id="isCheck" name="isCheck" style="width: 230px;height: 20px">
|
||||
<option value="0">是</option>
|
||||
<option value="1" selected="selected">否</option>
|
||||
</select>
|
||||
</div>
|
||||
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
|
||||
<div id="dlg-buttons5">
|
||||
<a href="javascript:void(0)" id="saveimport" class="easyui-linkbutton" iconCls="icon-ok">导入</a>
|
||||
<a href="javascript:void(0)" id="cancelimport" class="easyui-linkbutton" iconCls="icon-cancel"
|
||||
onclick="javascript:$('#importExcelDlg').dialog('close')">取消</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>客户信息</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="/css/common.css"/>
|
||||
<script type="text/javascript" src="/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="/js/common/common.js"></script>
|
||||
<script src="/js/pages/manage/supplier.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 查询 -->
|
||||
<div id="searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true"
|
||||
closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>名 称:</td>
|
||||
<td>
|
||||
<input type="text" name="searchSupplier" id="searchSupplier" style="width:100px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>手机号码:</td>
|
||||
<td>
|
||||
<input type="text" name="searchTelephone" id="searchTelephone" style="width:100px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>联系电话:</td>
|
||||
<td>
|
||||
<input type="text" name="searchPhonenum" id="searchPhonenum" style="width:100px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td id="searchDescLabel">备 注:</td>
|
||||
<td>
|
||||
<input type="text" name="searchDesc" id="searchDesc" style="width:100px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" id="searchResetBtn">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id="tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="客户信息列表" iconCls="icon-list"
|
||||
collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
<div id="supplierDlg" class="easyui-dialog" style="width:580px;padding:10px 20px"
|
||||
closed="true" buttons="#dlg-buttons" modal="true" collapsible="false" closable="true">
|
||||
<form id="supplierFM">
|
||||
<table>
|
||||
<tr>
|
||||
<td style="width: 80px;height: 20px">名称</td>
|
||||
<td style="width: 180px;padding:1px">
|
||||
<input name="supplier" id="supplier" class="easyui-validatebox"
|
||||
data-options="required:true,validType:'length[2,30]'" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td style="width: 60px;height: 20px">联系人</td>
|
||||
<td style="width:180px;padding:1px;">
|
||||
<input name="contacts" id="contacts" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>手机号码</td>
|
||||
<td style="padding:1px;">
|
||||
<input name="telephone" id="telephone" class="easyui-validatebox"
|
||||
style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>电子邮箱</td>
|
||||
<td style="padding:1px">
|
||||
<input name="email" id="email" class="easyui-validatebox" validType="email"
|
||||
style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>联系电话</td>
|
||||
<td style="padding:1px;">
|
||||
<input name="phonenum" id="phonenum" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>传真</td>
|
||||
<td style="padding:1px">
|
||||
<input name="fax" id="fax" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>期初应收</td>
|
||||
<td style="padding:1px">
|
||||
<input name="BeginNeedGet" id="BeginNeedGet" type="text" class="easyui-numberbox"
|
||||
data-options="min:0,precision:2" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>期初应付</td>
|
||||
<td style="padding:1px">
|
||||
<input name="BeginNeedPay" id="BeginNeedPay" type="text" class="easyui-numberbox"
|
||||
data-options="min:0,precision:2" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>累计应收</td>
|
||||
<td style="padding:1px">
|
||||
<input name="AllNeedGet" id="AllNeedGet" type="text" style="width: 160px;height: 20px"
|
||||
readonly="readonly"/>
|
||||
</td>
|
||||
<td>累计应付</td>
|
||||
<td style="padding:1px">
|
||||
<input name="AllNeedPay" id="AllNeedPay" type="text" style="width: 160px;height: 20px"
|
||||
readonly="readonly"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>纳税人识别号</td>
|
||||
<td style="padding:1px">
|
||||
<input name="taxNum" id="taxNum" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>税率</td>
|
||||
<td style="padding:1px">
|
||||
<input name="taxRate" id="taxRate" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>开户行</td>
|
||||
<td style="padding:1px">
|
||||
<input name="bankName" id="bankName" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>账号</td>
|
||||
<td style="padding:1px">
|
||||
<input name="accountNumber" id="accountNumber" class="easyui-validatebox"
|
||||
style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>地址</td>
|
||||
<td style="padding:1px" colspan="3">
|
||||
<input name="address" id="address" class="easyui-validatebox" style="width: 408px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>备注</td>
|
||||
<td style="padding:1px" colspan="3">
|
||||
<textarea name="description" id="description" rows="2" cols="2" style="width: 408px;"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<div id="dlg-buttons">
|
||||
<a href="javascript:void(0)" id="saveSupplier" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
|
||||
<a href="javascript:void(0)" id="cancelSupplier" class="easyui-linkbutton" iconCls="icon-cancel"
|
||||
onclick="javascript:$('#supplierDlg').dialog('close')">取消</a>
|
||||
</div>
|
||||
|
||||
<!-- 导入excel表格 -->
|
||||
<div id="importExcelDlg" style="padding:10px 20px">
|
||||
<form id="importExcelFM" method="post" enctype="multipart/form-data"
|
||||
action="/supplier/importExcelCustomer">
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label>文件名称 </label>
|
||||
<input name="supplierFile" id="supplierFile" type="file" style="width: 230px;height: 20px"/>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label><b>导入注意</b> </label><span>(预收款、期初应收、期初应付、税率均为数值且要大于0;另外期初应收、期初应付不能同时输入)</span>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px;display: none;">
|
||||
<label>是否审查 </label>
|
||||
<select id="isCheck" name="isCheck" style="width: 230px;height: 20px">
|
||||
<option value="0">是</option>
|
||||
<option value="1" selected="selected">否</option>
|
||||
</select>
|
||||
</div>
|
||||
<div id="dlg-buttons5">
|
||||
<a href="javascript:void(0)" id="saveimport" class="easyui-linkbutton" iconCls="icon-ok">导入</a>
|
||||
<a href="javascript:void(0)" id="cancelimport" class="easyui-linkbutton" iconCls="icon-cancel"
|
||||
onclick="javascript:$('#importExcelDlg').dialog('close')">取消</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,187 +1,186 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>会员信息</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="/css/common.css"/>
|
||||
<script type="text/javascript" src="/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="/js/common/common.js"></script>
|
||||
<script src="/js/pages/manage/supplier.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 查询 -->
|
||||
<div id="searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true"
|
||||
closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>名 称:</td>
|
||||
<td>
|
||||
<input type="text" name="searchSupplier" id="searchSupplier" style="width:100px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>手机号码:</td>
|
||||
<td>
|
||||
<input type="text" name="searchTelephone" id="searchTelephone" style="width:100px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>联系电话:</td>
|
||||
<td>
|
||||
<input type="text" name="searchPhonenum" id="searchPhonenum" style="width:100px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td id="searchDescLabel">备 注:</td>
|
||||
<td>
|
||||
<input type="text" name="searchDesc" id="searchDesc" style="width:100px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" id="searchResetBtn">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id="tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="会员信息列表" iconCls="icon-list"
|
||||
collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
<div id="supplierDlg" class="easyui-dialog" style="width:600px;padding:10px 20px"
|
||||
closed="true" buttons="#dlg-buttons" modal="true" collapsible="false" closable="true">
|
||||
<form id="supplierFM">
|
||||
<table>
|
||||
<tr>
|
||||
<td style="width: 80px;height: 20px">名称</td>
|
||||
<td style="width: 180px;padding:1px">
|
||||
<input name="supplier" id="supplier" class="easyui-validatebox"
|
||||
data-options="required:true,validType:'length[2,30]'" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td style="width: 60px;height: 20px">联系人</td>
|
||||
<td style="width:180px;padding:1px;">
|
||||
<input name="contacts" id="contacts" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>手机号码</td>
|
||||
<td style="padding:1px;">
|
||||
<input name="telephone" id="telephone" class="easyui-validatebox"
|
||||
style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>电子邮箱</td>
|
||||
<td style="padding:1px">
|
||||
<input name="email" id="email" class="easyui-validatebox" validType="email"
|
||||
style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>联系电话</td>
|
||||
<td style="padding:1px;">
|
||||
<input name="phonenum" id="phonenum" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>传真</td>
|
||||
<td style="padding:1px">
|
||||
<input name="fax" id="fax" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>期初应收</td>
|
||||
<td style="padding:1px">
|
||||
<input name="BeginNeedGet" id="BeginNeedGet" type="text" class="easyui-numberbox"
|
||||
data-options="min:0,precision:2" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>期初应付</td>
|
||||
<td style="padding:1px">
|
||||
<input name="BeginNeedPay" id="BeginNeedPay" type="text" class="easyui-numberbox"
|
||||
data-options="min:0,precision:2" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>累计应收</td>
|
||||
<td style="padding:1px">
|
||||
<input name="AllNeedGet" id="AllNeedGet" type="text" style="width: 160px;height: 20px"
|
||||
readonly="readonly"/>
|
||||
</td>
|
||||
<td>累计应付</td>
|
||||
<td style="padding:1px">
|
||||
<input name="AllNeedPay" id="AllNeedPay" type="text" style="width: 160px;height: 20px"
|
||||
readonly="readonly"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>纳税人识别号</td>
|
||||
<td style="padding:1px">
|
||||
<input name="taxNum" id="taxNum" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>税率</td>
|
||||
<td style="padding:1px">
|
||||
<input name="taxRate" id="taxRate" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>开户行</td>
|
||||
<td style="padding:1px">
|
||||
<input name="bankName" id="bankName" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>账号</td>
|
||||
<td style="padding:1px">
|
||||
<input name="accountNumber" id="accountNumber" class="easyui-validatebox"
|
||||
style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>地址</td>
|
||||
<td style="padding:1px" colspan="3">
|
||||
<input name="address" id="address" class="easyui-validatebox" style="width: 408px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>备注</td>
|
||||
<td style="padding:1px" colspan="3">
|
||||
<textarea name="description" id="description" rows="2" cols="2" style="width: 408px;"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<div id="dlg-buttons">
|
||||
<a href="javascript:void(0)" id="saveSupplier" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
|
||||
<a href="javascript:void(0)" id="cancelSupplier" class="easyui-linkbutton" iconCls="icon-cancel"
|
||||
onclick="javascript:$('#supplierDlg').dialog('close')">取消</a>
|
||||
</div>
|
||||
|
||||
<!-- 导入excel表格 -->
|
||||
<div id="importExcelDlg" style="padding:10px 20px">
|
||||
<form id="importExcelFM" method="post" enctype="multipart/form-data"
|
||||
action="/supplier/importExcelMember.action">
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label>文件名称 </label>
|
||||
<input name="supplierFile" id="supplierFile" type="file" style="width: 230px;height: 20px"/>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label><b>导入注意</b> </label><span>(预收款、期初应收、期初应付、税率均为数值且要大于0;另外期初应收、期初应付不能同时输入)</span>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px;display: none;">
|
||||
<label>是否审查 </label>
|
||||
<select id="isCheck" name="isCheck" style="width: 230px;height: 20px">
|
||||
<option value="0">是</option>
|
||||
<option value="1" selected="selected">否</option>
|
||||
</select>
|
||||
</div>
|
||||
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
|
||||
<div id="dlg-buttons5">
|
||||
<a href="javascript:void(0)" id="saveimport" class="easyui-linkbutton" iconCls="icon-ok">导入</a>
|
||||
<a href="javascript:void(0)" id="cancelimport" class="easyui-linkbutton" iconCls="icon-cancel"
|
||||
onclick="javascript:$('#importExcelDlg').dialog('close')">取消</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>会员信息</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="/css/common.css"/>
|
||||
<script type="text/javascript" src="/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="/js/common/common.js"></script>
|
||||
<script src="/js/pages/manage/supplier.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 查询 -->
|
||||
<div id="searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true"
|
||||
closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>名 称:</td>
|
||||
<td>
|
||||
<input type="text" name="searchSupplier" id="searchSupplier" style="width:100px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>手机号码:</td>
|
||||
<td>
|
||||
<input type="text" name="searchTelephone" id="searchTelephone" style="width:100px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>联系电话:</td>
|
||||
<td>
|
||||
<input type="text" name="searchPhonenum" id="searchPhonenum" style="width:100px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td id="searchDescLabel">备 注:</td>
|
||||
<td>
|
||||
<input type="text" name="searchDesc" id="searchDesc" style="width:100px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" id="searchResetBtn">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id="tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="会员信息列表" iconCls="icon-list"
|
||||
collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
<div id="supplierDlg" class="easyui-dialog" style="width:600px;padding:10px 20px"
|
||||
closed="true" buttons="#dlg-buttons" modal="true" collapsible="false" closable="true">
|
||||
<form id="supplierFM">
|
||||
<table>
|
||||
<tr>
|
||||
<td style="width: 80px;height: 20px">名称</td>
|
||||
<td style="width: 180px;padding:1px">
|
||||
<input name="supplier" id="supplier" class="easyui-validatebox"
|
||||
data-options="required:true,validType:'length[2,30]'" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td style="width: 60px;height: 20px">联系人</td>
|
||||
<td style="width:180px;padding:1px;">
|
||||
<input name="contacts" id="contacts" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>手机号码</td>
|
||||
<td style="padding:1px;">
|
||||
<input name="telephone" id="telephone" class="easyui-validatebox"
|
||||
style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>电子邮箱</td>
|
||||
<td style="padding:1px">
|
||||
<input name="email" id="email" class="easyui-validatebox" validType="email"
|
||||
style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>联系电话</td>
|
||||
<td style="padding:1px;">
|
||||
<input name="phonenum" id="phonenum" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>传真</td>
|
||||
<td style="padding:1px">
|
||||
<input name="fax" id="fax" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>期初应收</td>
|
||||
<td style="padding:1px">
|
||||
<input name="BeginNeedGet" id="BeginNeedGet" type="text" class="easyui-numberbox"
|
||||
data-options="min:0,precision:2" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>期初应付</td>
|
||||
<td style="padding:1px">
|
||||
<input name="BeginNeedPay" id="BeginNeedPay" type="text" class="easyui-numberbox"
|
||||
data-options="min:0,precision:2" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>累计应收</td>
|
||||
<td style="padding:1px">
|
||||
<input name="AllNeedGet" id="AllNeedGet" type="text" style="width: 160px;height: 20px"
|
||||
readonly="readonly"/>
|
||||
</td>
|
||||
<td>累计应付</td>
|
||||
<td style="padding:1px">
|
||||
<input name="AllNeedPay" id="AllNeedPay" type="text" style="width: 160px;height: 20px"
|
||||
readonly="readonly"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>纳税人识别号</td>
|
||||
<td style="padding:1px">
|
||||
<input name="taxNum" id="taxNum" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>税率</td>
|
||||
<td style="padding:1px">
|
||||
<input name="taxRate" id="taxRate" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>开户行</td>
|
||||
<td style="padding:1px">
|
||||
<input name="bankName" id="bankName" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>账号</td>
|
||||
<td style="padding:1px">
|
||||
<input name="accountNumber" id="accountNumber" class="easyui-validatebox"
|
||||
style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>地址</td>
|
||||
<td style="padding:1px" colspan="3">
|
||||
<input name="address" id="address" class="easyui-validatebox" style="width: 408px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>备注</td>
|
||||
<td style="padding:1px" colspan="3">
|
||||
<textarea name="description" id="description" rows="2" cols="2" style="width: 408px;"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<div id="dlg-buttons">
|
||||
<a href="javascript:void(0)" id="saveSupplier" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
|
||||
<a href="javascript:void(0)" id="cancelSupplier" class="easyui-linkbutton" iconCls="icon-cancel"
|
||||
onclick="javascript:$('#supplierDlg').dialog('close')">取消</a>
|
||||
</div>
|
||||
|
||||
<!-- 导入excel表格 -->
|
||||
<div id="importExcelDlg" style="padding:10px 20px">
|
||||
<form id="importExcelFM" method="post" enctype="multipart/form-data"
|
||||
action="/supplier/importExcelMember">
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label>文件名称 </label>
|
||||
<input name="supplierFile" id="supplierFile" type="file" style="width: 230px;height: 20px"/>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label><b>导入注意</b> </label><span>(预收款、期初应收、期初应付、税率均为数值且要大于0;另外期初应收、期初应付不能同时输入)</span>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px;display: none;">
|
||||
<label>是否审查 </label>
|
||||
<select id="isCheck" name="isCheck" style="width: 230px;height: 20px">
|
||||
<option value="0">是</option>
|
||||
<option value="1" selected="selected">否</option>
|
||||
</select>
|
||||
</div>
|
||||
<div id="dlg-buttons5">
|
||||
<a href="javascript:void(0)" id="saveimport" class="easyui-linkbutton" iconCls="icon-ok">导入</a>
|
||||
<a href="javascript:void(0)" id="cancelimport" class="easyui-linkbutton" iconCls="icon-cancel"
|
||||
onclick="javascript:$('#importExcelDlg').dialog('close')">取消</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@ -1,188 +1,187 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>供应商信息</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="/css/common.css"/>
|
||||
<script type="text/javascript" src="/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="/js/common/common.js"></script>
|
||||
<script src="/js/pages/manage/supplier.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 查询 -->
|
||||
<div id="searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true"
|
||||
closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>名 称:</td>
|
||||
<td>
|
||||
<input type="text" name="searchSupplier" id="searchSupplier" style="width:100px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>手机号码:</td>
|
||||
<td>
|
||||
<input type="text" name="searchTelephone" id="searchTelephone" style="width:100px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>联系电话:</td>
|
||||
<td>
|
||||
<input type="text" name="searchPhonenum" id="searchPhonenum" style="width:100px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td id="searchDescLabel">备 注:</td>
|
||||
<td>
|
||||
<input type="text" name="searchDesc" id="searchDesc" style="width:100px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" id="searchResetBtn">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id="tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="供应商信息列表" iconCls="icon-list"
|
||||
collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
<div id="supplierDlg" class="easyui-dialog" style="width:580px;padding:10px 20px"
|
||||
closed="true" buttons="#dlg-buttons" modal="true" collapsible="false" closable="true">
|
||||
<form id="supplierFM">
|
||||
<table>
|
||||
<tr>
|
||||
<td style="width: 80px;height: 20px">名称</td>
|
||||
<td style="width: 180px;padding:1px">
|
||||
<input name="supplier" id="supplier" class="easyui-validatebox"
|
||||
data-options="required:true,validType:'length[2,30]'" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td style="width: 60px;height: 20px">联系人</td>
|
||||
<td style="width:180px;padding:1px;">
|
||||
<input name="contacts" id="contacts" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>手机号码</td>
|
||||
<td style="padding:1px;">
|
||||
<input name="telephone" id="telephone" class="easyui-validatebox"
|
||||
style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>电子邮箱</td>
|
||||
<td style="padding:1px">
|
||||
<input name="email" id="email" class="easyui-validatebox" validType="email"
|
||||
style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>联系电话</td>
|
||||
<td style="padding:1px;">
|
||||
<input name="phonenum" id="phonenum" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>传真</td>
|
||||
<td style="padding:1px">
|
||||
<input name="fax" id="fax" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>期初应收</td>
|
||||
<td style="padding:1px">
|
||||
<input name="BeginNeedGet" id="BeginNeedGet" type="text" class="easyui-numberbox"
|
||||
data-options="min:0,precision:2" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>期初应付</td>
|
||||
<td style="padding:1px">
|
||||
<input name="BeginNeedPay" id="BeginNeedPay" type="text" class="easyui-numberbox"
|
||||
data-options="min:0,precision:2" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>累计应收</td>
|
||||
<td style="padding:1px">
|
||||
<input name="AllNeedGet" id="AllNeedGet" type="text" style="width: 160px;height: 20px"
|
||||
readonly="readonly"/>
|
||||
</td>
|
||||
<td>累计应付</td>
|
||||
<td style="padding:1px">
|
||||
<input name="AllNeedPay" id="AllNeedPay" type="text" style="width: 160px;height: 20px"
|
||||
readonly="readonly"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>纳税人识别号</td>
|
||||
<td style="padding:1px">
|
||||
<input name="taxNum" id="taxNum" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>税率</td>
|
||||
<td style="padding:1px">
|
||||
<input name="taxRate" id="taxRate" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>开户行</td>
|
||||
<td style="padding:1px">
|
||||
<input name="bankName" id="bankName" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>账号</td>
|
||||
<td style="padding:1px">
|
||||
<input name="accountNumber" id="accountNumber" class="easyui-validatebox"
|
||||
style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>地址</td>
|
||||
<td style="padding:1px" colspan="3">
|
||||
<input name="address" id="address" class="easyui-validatebox" style="width: 408px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>备注</td>
|
||||
<td style="padding:1px" colspan="3">
|
||||
<textarea name="description" id="description" rows="2" cols="2" style="width: 408px;"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<div id="dlg-buttons">
|
||||
<a href="javascript:void(0)" id="saveSupplier" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
|
||||
<a href="javascript:void(0)" id="cancelSupplier" class="easyui-linkbutton" iconCls="icon-cancel"
|
||||
onclick="javascript:$('#supplierDlg').dialog('close')">取消</a>
|
||||
</div>
|
||||
|
||||
<!-- 导入excel表格 -->
|
||||
<div id="importExcelDlg" style="padding:10px 20px">
|
||||
<form id="importExcelFM" method="post" enctype="multipart/form-data"
|
||||
action="/supplier/importExcelVendor.action">
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label>文件名称 </label>
|
||||
<input name="supplierFile" id="supplierFile" type="file" style="width: 230px;height: 20px"/>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label><b>导入注意</b> </label><span>(预收款、期初应收、期初应付、税率均为数值且要大于0;另外期初应收、期初应付不能同时输入)</span>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px;display: none;">
|
||||
<label>是否审查 </label>
|
||||
<select id="isCheck" name="isCheck" style="width: 230px;height: 20px">
|
||||
<option value="0">是</option>
|
||||
<option value="1" selected="selected">否</option>
|
||||
</select>
|
||||
</div>
|
||||
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
|
||||
<div id="dlg-buttons5">
|
||||
<a href="javascript:void(0)" id="saveimport" class="easyui-linkbutton" iconCls="icon-ok">导入</a>
|
||||
<a href="javascript:void(0)" id="cancelimport" class="easyui-linkbutton" iconCls="icon-cancel"
|
||||
onclick="javascript:$('#importExcelDlg').dialog('close')">取消</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>供应商信息</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="/css/common.css"/>
|
||||
<script type="text/javascript" src="/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="/js/common/common.js"></script>
|
||||
<script src="/js/pages/manage/supplier.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 查询 -->
|
||||
<div id="searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true"
|
||||
closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>名 称:</td>
|
||||
<td>
|
||||
<input type="text" name="searchSupplier" id="searchSupplier" style="width:100px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>手机号码:</td>
|
||||
<td>
|
||||
<input type="text" name="searchTelephone" id="searchTelephone" style="width:100px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>联系电话:</td>
|
||||
<td>
|
||||
<input type="text" name="searchPhonenum" id="searchPhonenum" style="width:100px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td id="searchDescLabel">备 注:</td>
|
||||
<td>
|
||||
<input type="text" name="searchDesc" id="searchDesc" style="width:100px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" id="searchResetBtn">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id="tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="供应商信息列表" iconCls="icon-list"
|
||||
collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
<div id="supplierDlg" class="easyui-dialog" style="width:580px;padding:10px 20px"
|
||||
closed="true" buttons="#dlg-buttons" modal="true" collapsible="false" closable="true">
|
||||
<form id="supplierFM">
|
||||
<table>
|
||||
<tr>
|
||||
<td style="width: 80px;height: 20px">名称</td>
|
||||
<td style="width: 180px;padding:1px">
|
||||
<input name="supplier" id="supplier" class="easyui-validatebox"
|
||||
data-options="required:true,validType:'length[2,30]'" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td style="width: 60px;height: 20px">联系人</td>
|
||||
<td style="width:180px;padding:1px;">
|
||||
<input name="contacts" id="contacts" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>手机号码</td>
|
||||
<td style="padding:1px;">
|
||||
<input name="telephone" id="telephone" class="easyui-validatebox"
|
||||
style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>电子邮箱</td>
|
||||
<td style="padding:1px">
|
||||
<input name="email" id="email" class="easyui-validatebox" validType="email"
|
||||
style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>联系电话</td>
|
||||
<td style="padding:1px;">
|
||||
<input name="phonenum" id="phonenum" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>传真</td>
|
||||
<td style="padding:1px">
|
||||
<input name="fax" id="fax" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>期初应收</td>
|
||||
<td style="padding:1px">
|
||||
<input name="BeginNeedGet" id="BeginNeedGet" type="text" class="easyui-numberbox"
|
||||
data-options="min:0,precision:2" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>期初应付</td>
|
||||
<td style="padding:1px">
|
||||
<input name="BeginNeedPay" id="BeginNeedPay" type="text" class="easyui-numberbox"
|
||||
data-options="min:0,precision:2" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>累计应收</td>
|
||||
<td style="padding:1px">
|
||||
<input name="AllNeedGet" id="AllNeedGet" type="text" style="width: 160px;height: 20px"
|
||||
readonly="readonly"/>
|
||||
</td>
|
||||
<td>累计应付</td>
|
||||
<td style="padding:1px">
|
||||
<input name="AllNeedPay" id="AllNeedPay" type="text" style="width: 160px;height: 20px"
|
||||
readonly="readonly"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>纳税人识别号</td>
|
||||
<td style="padding:1px">
|
||||
<input name="taxNum" id="taxNum" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>税率</td>
|
||||
<td style="padding:1px">
|
||||
<input name="taxRate" id="taxRate" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>开户行</td>
|
||||
<td style="padding:1px">
|
||||
<input name="bankName" id="bankName" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>账号</td>
|
||||
<td style="padding:1px">
|
||||
<input name="accountNumber" id="accountNumber" class="easyui-validatebox"
|
||||
style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>地址</td>
|
||||
<td style="padding:1px" colspan="3">
|
||||
<input name="address" id="address" class="easyui-validatebox" style="width: 408px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>备注</td>
|
||||
<td style="padding:1px" colspan="3">
|
||||
<textarea name="description" id="description" rows="2" cols="2" style="width: 408px;"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<div id="dlg-buttons">
|
||||
<a href="javascript:void(0)" id="saveSupplier" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
|
||||
<a href="javascript:void(0)" id="cancelSupplier" class="easyui-linkbutton" iconCls="icon-cancel"
|
||||
onclick="javascript:$('#supplierDlg').dialog('close')">取消</a>
|
||||
</div>
|
||||
|
||||
<!-- 导入excel表格 -->
|
||||
<div id="importExcelDlg" style="padding:10px 20px">
|
||||
<form id="importExcelFM" method="post" enctype="multipart/form-data"
|
||||
action="/supplier/importExcelVendor">
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label>文件名称 </label>
|
||||
<input name="supplierFile" id="supplierFile" type="file" style="width: 230px;height: 20px"/>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label><b>导入注意</b> </label><span>(预收款、期初应收、期初应付、税率均为数值且要大于0;另外期初应收、期初应付不能同时输入)</span>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px;display: none;">
|
||||
<label>是否审查 </label>
|
||||
<select id="isCheck" name="isCheck" style="width: 230px;height: 20px">
|
||||
<option value="0">是</option>
|
||||
<option value="1" selected="selected">否</option>
|
||||
</select>
|
||||
</div>
|
||||
<div id="dlg-buttons5">
|
||||
<a href="javascript:void(0)" id="saveimport" class="easyui-linkbutton" iconCls="icon-ok">导入</a>
|
||||
<a href="javascript:void(0)" id="cancelimport" class="easyui-linkbutton" iconCls="icon-cancel"
|
||||
onclick="javascript:$('#importExcelDlg').dialog('close')">取消</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,382 +1,382 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>采购入库</title>
|
||||
<meta charset="utf-8">
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="/css/common.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="/css/in_out.css"/>
|
||||
<script src="/js/jquery-1.8.0.min.js"></script>
|
||||
<script src="/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script src="/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script src="/js/My97DatePicker/WdatePicker.js"></script>
|
||||
<script src="/js/common/common.js"></script>
|
||||
<script src="/js/pages/materials/in_out.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 查询 -->
|
||||
<div id="searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true"
|
||||
closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>单据编号:</td>
|
||||
<td>
|
||||
<input type="text" name="searchNumber" id="searchNumber" style="width:100px;"/>
|
||||
</td>
|
||||
<td>商品信息:</td>
|
||||
<td>
|
||||
<input type="text" name="searchMaterial" id="searchMaterial" placeholder="名称,型号" style="width:100px;"/>
|
||||
</td>
|
||||
<td>单据日期:</td>
|
||||
<td>
|
||||
<input type="text" name="searchBeginTime" id="searchBeginTime"
|
||||
onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/>
|
||||
</td>
|
||||
<td>-</td>
|
||||
<td>
|
||||
<input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})"
|
||||
class="txt Wdate" style="width:100px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" id="searchResetBtn">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id="tablePanel" class="easyui-panel" style="padding:1px; top:300px;" title="采购入库列表" iconCls="icon-list"
|
||||
collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
|
||||
<div id="depotHeadDlg" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px"
|
||||
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
|
||||
<form id="depotHeadFM" method="post" novalidate>
|
||||
<table>
|
||||
<tr>
|
||||
<td style="width:60px;">供应商:</td>
|
||||
<td style="padding:5px;width:170px;">
|
||||
<div class="org-list">
|
||||
<input id="OrganId" name="OrganId" style="width:130px;"/>
|
||||
</div>
|
||||
<div class="add-org-btn">
|
||||
<img id="addOrgan" src="/js/easyui-1.3.5/themes/icons/edit_add.png"
|
||||
style="cursor: pointer;" alt="增加供应商" title="增加供应商"/>
|
||||
</div>
|
||||
</td>
|
||||
<td style="width:70px;">单据日期:</td>
|
||||
<td style="padding:5px">
|
||||
<input type="text" name="OperTime" id="OperTime"
|
||||
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate"
|
||||
style="width:140px;"/>
|
||||
</td>
|
||||
<td style="width:80px;">单据编号:</td>
|
||||
<td style="padding:5px">
|
||||
<input name="Number" id="Number" class="easyui-validatebox"
|
||||
data-options="required:true,validType:'length[2,30]'" style="width: 140px;"/>
|
||||
</td>
|
||||
<td style="width:70px;"></td>
|
||||
<td style="padding:5px">
|
||||
</td>
|
||||
<td style="width:100px;"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="9">
|
||||
<!-- 商品列表table -->
|
||||
<table id="materialData" style="top:100px;border-bottom-color:#FFFFFF"></table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="9">
|
||||
<textarea name="Remark" id="Remark" rows="2" cols="2" placeholder="暂无备注信息"
|
||||
style="width: 1130px; height:35px;"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>优惠率:</td>
|
||||
<td style="padding:5px">
|
||||
<input id="Discount" name="Discount" style="width:110px;"/>
|
||||
%
|
||||
</td>
|
||||
<td>付款优惠:</td>
|
||||
<td style="padding:5px">
|
||||
<input id="DiscountMoney" name="DiscountMoney" style="width:120px;"/>
|
||||
</td>
|
||||
<td>优惠后金额:</td>
|
||||
<td style="padding:5px">
|
||||
<input id="DiscountLastMoney" name="DiscountLastMoney" readonly="readonly" style="width:120px;"/>
|
||||
</td>
|
||||
<td>本次付款:</td>
|
||||
<td style="padding:5px">
|
||||
<input id="ChangeAmount" name="ChangeAmount" data-changeamount="0" style="width:120px;"/>
|
||||
</td>
|
||||
<td style="width:100px;"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>结算账户:</td>
|
||||
<td style="padding:5px">
|
||||
<select name="AccountId" id="AccountId" style="width:110px;"></select>
|
||||
<img class="many-account-ico" src="/js/easyui-1.3.5/themes/icons/filelist.jpg"
|
||||
style="display: none;"/>
|
||||
</td>
|
||||
<td>本次欠款:</td>
|
||||
<td style="padding:5px">
|
||||
<input id="Debt" name="Debt" readonly="readonly" style="width:120px;"/>
|
||||
</td>
|
||||
<td>采购费用:</td>
|
||||
<td style="padding:5px">
|
||||
<input id="OtherMoney" name="OtherMoney" style="width:120px;" readonly="readonly"/>
|
||||
<img class="other-money-ico" src="/js/easyui-1.3.5/themes/icons/filelist.jpg"/>
|
||||
</td>
|
||||
<td>结算天数:</td>
|
||||
<td style="padding:5px">
|
||||
<input id="AccountDay" name="AccountDay" class="easyui-validatebox"
|
||||
data-options="validType:'length[1,3]'" style="width:120px;"/>
|
||||
</td>
|
||||
<td style="width:100px;"></td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
|
||||
</form>
|
||||
</div>
|
||||
<div id="dlg-buttons">
|
||||
<a href="javascript:void(0)" id="saveDepotHead" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
|
||||
<a href="javascript:void(0)" id="cancelDepotHead" class="easyui-linkbutton" iconCls="icon-cancel"
|
||||
onclick="javascript:$('#depotHeadDlg').dialog('close')">取消</a>
|
||||
</div>
|
||||
<div id="depotHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px"
|
||||
closed="true" modal="true" cache="false" collapsible="false" closable="true">
|
||||
<table>
|
||||
<tr>
|
||||
<td style="width:60px;">供应商:</td>
|
||||
<td style="padding:5px;width:130px;">
|
||||
<span id="OrganIdShow"></span>
|
||||
</td>
|
||||
<td style="width:70px;">单据日期:</td>
|
||||
<td style="padding:5px;width:130px;">
|
||||
<span id="OperTimeShow"></span>
|
||||
</td>
|
||||
<td style="width:80px;">单据编号:</td>
|
||||
<td style="padding:5px;width:140px;">
|
||||
<span id="NumberShow"></span>
|
||||
</td>
|
||||
<td style="width:70px;"></td>
|
||||
<td style="padding:5px;width:140px;"></td>
|
||||
<td style="width:100px;"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="9" style="width: 1130px;">
|
||||
<!-- 商品列表table -->
|
||||
<table id="materialDataShow" style="top:100px;border-bottom-color:#FFFFFF"></table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:60px;">单据备注:</td>
|
||||
<td colspan="8" style="height:35px;">
|
||||
<span id="RemarkShow" style="width: 1070px; height:35px;"></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>优惠率:</td>
|
||||
<td>
|
||||
<span id="DiscountShow" style="width: 110px;"></span>
|
||||
%
|
||||
</td>
|
||||
<td>付款优惠:</td>
|
||||
<td>
|
||||
<span id="DiscountMoneyShow" style="width: 120px;"></span>
|
||||
</td>
|
||||
<td>优惠后金额:</td>
|
||||
<td>
|
||||
<span id="DiscountLastMoneyShow" style="width: 120px;"></span>
|
||||
</td>
|
||||
<td>本次付款:</td>
|
||||
<td style="padding:5px">
|
||||
<span id="ChangeAmountShow"></span>
|
||||
</td>
|
||||
<td style="width:100px;"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>结算账户:</td>
|
||||
<td style="padding:5px">
|
||||
<span id="AccountIdShow"></span>
|
||||
</td>
|
||||
<td>本次欠款:</td>
|
||||
<td style="padding:5px">
|
||||
<span id="DebtShow"></span>
|
||||
</td>
|
||||
<td>采购费用:</td>
|
||||
<td style="padding:5px">
|
||||
<span id="OtherMoneyShow"></span>
|
||||
</td>
|
||||
<td>结算天数:</td>
|
||||
<td style="padding:5px">
|
||||
<span id="AccountDayShow"></span>
|
||||
</td>
|
||||
<td style="width:100px;"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="depotHeadAccountDlg" class="easyui-dialog" style="width:380px;padding:10px 20px;top:80px"
|
||||
closed="true" modal="true" buttons="#accountDlgButtons" cache="false" collapsible="false" closable="true">
|
||||
<table class="account-dlg">
|
||||
<tr class="account-head-tmp">
|
||||
<td style="width:30px;"></td>
|
||||
<td style="width:140px; padding:5px;">结算账户</td>
|
||||
<td style="width:100px; padding:5px;">金额</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:30px;"></td>
|
||||
<td style="width:140px;text-align: center;">合计:</td>
|
||||
<td style="width:100px;"><span id="accountMoneyTotalDlg"></span></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table class="tabs-tmp">
|
||||
<tr class="account-content-tmp">
|
||||
<td style="width:30px;"></td>
|
||||
<td style="width:140px; padding:3px;"><select class="account-id-dlg" style="width:140px;"></select></td>
|
||||
<td style="width:100px; padding:3px;"><input class="account-money-dlg" style="width:100px;"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="accountDlgButtons">
|
||||
<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="otherMoneyDlg" class="easyui-dialog" style="width:380px;padding:10px 20px;top:80px"
|
||||
closed="true" modal="true" buttons="#otherMoneyDlgBtn" cache="false" collapsible="false" closable="true">
|
||||
<table class="money-dlg">
|
||||
<tr class="money-head-tmp">
|
||||
<td style="width:30px;"></td>
|
||||
<td style="width:140px; padding:5px;">结算账户</td>
|
||||
<td style="width:100px; padding:5px;">金额</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:30px;"></td>
|
||||
<td style="width:140px;text-align: center;">合计:</td>
|
||||
<td style="width:100px;"><span id="otherMoneyTotalDlg"></span></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table class="tabs-tmp">
|
||||
<tr class="money-content-tmp">
|
||||
<td style="width:30px;"></td>
|
||||
<td style="width:140px; padding:3px;"><select class="money-id-dlg" style="width:140px;"></select></td>
|
||||
<td style="width:100px; padding:3px;"><input class="other-money-dlg" style="width:100px;"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="otherMoneyDlgBtn">
|
||||
<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="supplierDlg" class="easyui-dialog" style="width:580px;padding:10px 20px"
|
||||
closed="true" buttons="#supplierDlgBtn" modal="true" collapsible="false" closable="true">
|
||||
<form id="supplierFM">
|
||||
<table>
|
||||
<tr>
|
||||
<td style="width: 80px;height: 20px">名称</td>
|
||||
<td style="width: 180px;padding:1px">
|
||||
<input name="supplier" id="supplier" class="easyui-validatebox"
|
||||
data-options="required:true,validType:'length[2,30]'" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td style="width: 60px;height: 20px">联系人</td>
|
||||
<td style="width:180px;padding:1px;">
|
||||
<input name="contacts" id="contacts" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>联系电话</td>
|
||||
<td style="padding:1px;">
|
||||
<input name="phonenum" id="phonenum" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>手机</td>
|
||||
<td style="padding:1px;">
|
||||
<input name="telephone" id="telephone" class="easyui-validatebox"
|
||||
style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>电子邮箱</td>
|
||||
<td style="padding:1px">
|
||||
<input name="email" id="email" class="easyui-validatebox" validType="email"
|
||||
style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>传真</td>
|
||||
<td style="padding:1px">
|
||||
<input name="fax" id="fax" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>期初应收</td>
|
||||
<td style="padding:1px">
|
||||
<input name="BeginNeedGet" id="BeginNeedGet" type="text" class="easyui-numberbox"
|
||||
data-options="min:0,precision:2" style="width: 160px;height: 20px"></input>
|
||||
</td>
|
||||
<td>期初应付</td>
|
||||
<td style="padding:1px">
|
||||
<input name="BeginNeedPay" id="BeginNeedPay" type="text" class="easyui-numberbox"
|
||||
data-options="min:0,precision:2" style="width: 160px;height: 20px"></input>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>累计应收</td>
|
||||
<td style="padding:1px">
|
||||
<input name="AllNeedGet" id="AllNeedGet" type="text" class="easyui-numberbox"
|
||||
data-options="min:0,precision:2" style="width: 160px;height: 20px" disabled="true"></input>
|
||||
</td>
|
||||
<td>累计应付</td>
|
||||
<td style="padding:1px">
|
||||
<input name="AllNeedPay" id="AllNeedPay" type="text" class="easyui-numberbox"
|
||||
data-options="min:0,precision:2" style="width: 160px;height: 20px" disabled="true"></input>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>纳税人识别号</td>
|
||||
<td style="padding:1px">
|
||||
<input name="taxNum" id="taxNum" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>税率</td>
|
||||
<td style="padding:1px">
|
||||
<input name="taxRate" id="taxRate" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>开户行</td>
|
||||
<td style="padding:1px">
|
||||
<input name="bankName" id="bankName" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>账号</td>
|
||||
<td style="padding:1px">
|
||||
<input name="accountNumber" id="accountNumber" class="easyui-validatebox"
|
||||
style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>地址</td>
|
||||
<td style="padding:1px" colspan="3">
|
||||
<input name="address" id="address" class="easyui-validatebox" style="width: 408px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>备注</td>
|
||||
<td style="padding:1px" colspan="3">
|
||||
<textarea name="description" id="description" rows="2" cols="2" style="width: 408px;"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<div id="supplierDlgBtn">
|
||||
<a href="javascript:void(0)" id="saveSupplier" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
|
||||
<a href="javascript:void(0)" id="cancelSupplier" class="easyui-linkbutton" iconCls="icon-cancel"
|
||||
onclick="javascript:$('#supplierDlg').dialog('close')">取消</a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>采购入库</title>
|
||||
<meta charset="utf-8">
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="/css/common.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="/css/in_out.css"/>
|
||||
<script src="/js/jquery-1.8.0.min.js"></script>
|
||||
<script src="/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script src="/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script src="/js/My97DatePicker/WdatePicker.js"></script>
|
||||
<script src="/js/common/common.js"></script>
|
||||
<script src="/js/pages/materials/in_out.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 查询 -->
|
||||
<div id="searchPanel" class="easyui-panel" style="padding:3px;" title="查询窗口" iconCls="icon-search" collapsible="true"
|
||||
closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>单据编号:</td>
|
||||
<td>
|
||||
<input type="text" name="searchNumber" id="searchNumber" style="width:100px;"/>
|
||||
</td>
|
||||
<td>商品信息:</td>
|
||||
<td>
|
||||
<input type="text" name="searchMaterial" id="searchMaterial" placeholder="名称,型号" style="width:100px;"/>
|
||||
</td>
|
||||
<td>单据日期:</td>
|
||||
<td>
|
||||
<input type="text" name="searchBeginTime" id="searchBeginTime"
|
||||
onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="txt Wdate" style="width:100px;"/>
|
||||
</td>
|
||||
<td>-</td>
|
||||
<td>
|
||||
<input type="text" name="searchEndTime" id="searchEndTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})"
|
||||
class="txt Wdate" style="width:100px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" id="searchResetBtn">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id="tablePanel" class="easyui-panel" style="padding:1px; top:300px;" title="采购入库列表" iconCls="icon-list"
|
||||
collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
|
||||
<div id="depotHeadDlg" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px"
|
||||
closed="true" buttons="#dlg-buttons" modal="true" cache="false" collapsible="false" closable="true">
|
||||
<form id="depotHeadFM" method="post" novalidate>
|
||||
<table>
|
||||
<tr>
|
||||
<td style="width:60px;">供应商:</td>
|
||||
<td style="padding:5px;width:170px;">
|
||||
<div class="org-list">
|
||||
<input id="OrganId" name="OrganId" style="width:130px;"/>
|
||||
</div>
|
||||
<div class="add-org-btn">
|
||||
<img id="addOrgan" src="/js/easyui-1.3.5/themes/icons/edit_add.png"
|
||||
style="cursor: pointer;" alt="增加供应商" title="增加供应商"/>
|
||||
</div>
|
||||
</td>
|
||||
<td style="width:70px;">单据日期:</td>
|
||||
<td style="padding:5px">
|
||||
<input type="text" name="OperTime" id="OperTime"
|
||||
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate"
|
||||
style="width:140px;"/>
|
||||
</td>
|
||||
<td style="width:80px;">单据编号:</td>
|
||||
<td style="padding:5px">
|
||||
<input name="Number" id="Number" class="easyui-validatebox"
|
||||
data-options="required:true,validType:'length[2,30]'" style="width: 140px;"/>
|
||||
</td>
|
||||
<td style="width:70px;"></td>
|
||||
<td style="padding:5px">
|
||||
</td>
|
||||
<td style="width:100px;"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="9">
|
||||
<!-- 商品列表table -->
|
||||
<table id="materialData" style="top:100px;border-bottom-color:#FFFFFF"></table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="9">
|
||||
<textarea name="Remark" id="Remark" rows="2" cols="2" placeholder="暂无备注信息"
|
||||
style="width: 1130px; height:35px;"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>优惠率:</td>
|
||||
<td style="padding:5px">
|
||||
<input id="Discount" name="Discount" style="width:110px;"/>
|
||||
%
|
||||
</td>
|
||||
<td>付款优惠:</td>
|
||||
<td style="padding:5px">
|
||||
<input id="DiscountMoney" name="DiscountMoney" style="width:120px;"/>
|
||||
</td>
|
||||
<td>优惠后金额:</td>
|
||||
<td style="padding:5px">
|
||||
<input id="DiscountLastMoney" name="DiscountLastMoney" readonly="readonly" style="width:120px;"/>
|
||||
</td>
|
||||
<td>本次付款:</td>
|
||||
<td style="padding:5px">
|
||||
<input id="ChangeAmount" name="ChangeAmount" data-changeamount="0" style="width:120px;"/>
|
||||
</td>
|
||||
<td style="width:100px;"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>结算账户:</td>
|
||||
<td style="padding:5px">
|
||||
<select name="AccountId" id="AccountId" style="width:110px;"></select>
|
||||
<img class="many-account-ico" src="/js/easyui-1.3.5/themes/icons/filelist.jpg"
|
||||
style="display: none;"/>
|
||||
</td>
|
||||
<td>本次欠款:</td>
|
||||
<td style="padding:5px">
|
||||
<input id="Debt" name="Debt" readonly="readonly" style="width:120px;"/>
|
||||
</td>
|
||||
<td>采购费用:</td>
|
||||
<td style="padding:5px">
|
||||
<input id="OtherMoney" name="OtherMoney" style="width:120px;" readonly="readonly"/>
|
||||
<img class="other-money-ico" src="/js/easyui-1.3.5/themes/icons/filelist.jpg"/>
|
||||
</td>
|
||||
<td>结算天数:</td>
|
||||
<td style="padding:5px">
|
||||
<input id="AccountDay" name="AccountDay" class="easyui-validatebox"
|
||||
data-options="validType:'length[1,3]'" style="width:120px;"/>
|
||||
</td>
|
||||
<td style="width:100px;"></td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="hidden" name="clientIp" id="clientIp" value="<%=clientIp %>"/>
|
||||
</form>
|
||||
</div>
|
||||
<div id="dlg-buttons">
|
||||
<a href="javascript:void(0)" id="saveDepotHead" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
|
||||
<a href="javascript:void(0)" id="cancelDepotHead" class="easyui-linkbutton" iconCls="icon-cancel"
|
||||
onclick="javascript:$('#depotHeadDlg').dialog('close')">取消</a>
|
||||
</div>
|
||||
<div id="depotHeadDlgShow" class="easyui-dialog" style="width:1200px;padding:10px 20px;top:20px"
|
||||
closed="true" modal="true" cache="false" collapsible="false" closable="true">
|
||||
<table>
|
||||
<tr>
|
||||
<td style="width:60px;">供应商:</td>
|
||||
<td style="padding:5px;width:130px;">
|
||||
<span id="OrganIdShow"></span>
|
||||
</td>
|
||||
<td style="width:70px;">单据日期:</td>
|
||||
<td style="padding:5px;width:130px;">
|
||||
<span id="OperTimeShow"></span>
|
||||
</td>
|
||||
<td style="width:80px;">单据编号:</td>
|
||||
<td style="padding:5px;width:140px;">
|
||||
<span id="NumberShow"></span>
|
||||
</td>
|
||||
<td style="width:70px;"></td>
|
||||
<td style="padding:5px;width:140px;"></td>
|
||||
<td style="width:100px;"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="9" style="width: 1130px;">
|
||||
<!-- 商品列表table -->
|
||||
<table id="materialDataShow" style="top:100px;border-bottom-color:#FFFFFF"></table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:60px;">单据备注:</td>
|
||||
<td colspan="8" style="height:35px;">
|
||||
<span id="RemarkShow" style="width: 1070px; height:35px;"></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>优惠率:</td>
|
||||
<td>
|
||||
<span id="DiscountShow" style="width: 110px;"></span>
|
||||
%
|
||||
</td>
|
||||
<td>付款优惠:</td>
|
||||
<td>
|
||||
<span id="DiscountMoneyShow" style="width: 120px;"></span>
|
||||
</td>
|
||||
<td>优惠后金额:</td>
|
||||
<td>
|
||||
<span id="DiscountLastMoneyShow" style="width: 120px;"></span>
|
||||
</td>
|
||||
<td>本次付款:</td>
|
||||
<td style="padding:5px">
|
||||
<span id="ChangeAmountShow"></span>
|
||||
</td>
|
||||
<td style="width:100px;"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>结算账户:</td>
|
||||
<td style="padding:5px">
|
||||
<span id="AccountIdShow"></span>
|
||||
</td>
|
||||
<td>本次欠款:</td>
|
||||
<td style="padding:5px">
|
||||
<span id="DebtShow"></span>
|
||||
</td>
|
||||
<td>采购费用:</td>
|
||||
<td style="padding:5px">
|
||||
<span id="OtherMoneyShow"></span>
|
||||
</td>
|
||||
<td>结算天数:</td>
|
||||
<td style="padding:5px">
|
||||
<span id="AccountDayShow"></span>
|
||||
</td>
|
||||
<td style="width:100px;"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="depotHeadAccountDlg" class="easyui-dialog" style="width:380px;padding:10px 20px;top:80px"
|
||||
closed="true" modal="true" buttons="#accountDlgButtons" cache="false" collapsible="false" closable="true">
|
||||
<table class="account-dlg">
|
||||
<tr class="account-head-tmp">
|
||||
<td style="width:30px;"></td>
|
||||
<td style="width:140px; padding:5px;">结算账户</td>
|
||||
<td style="width:100px; padding:5px;">金额</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:30px;"></td>
|
||||
<td style="width:140px;text-align: center;">合计:</td>
|
||||
<td style="width:100px;"><span id="accountMoneyTotalDlg"></span></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table class="tabs-tmp">
|
||||
<tr class="account-content-tmp">
|
||||
<td style="width:30px;"></td>
|
||||
<td style="width:140px; padding:3px;"><select class="account-id-dlg" style="width:140px;"></select></td>
|
||||
<td style="width:100px; padding:3px;"><input class="account-money-dlg" style="width:100px;"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="accountDlgButtons">
|
||||
<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="otherMoneyDlg" class="easyui-dialog" style="width:380px;padding:10px 20px;top:80px"
|
||||
closed="true" modal="true" buttons="#otherMoneyDlgBtn" cache="false" collapsible="false" closable="true">
|
||||
<table class="money-dlg">
|
||||
<tr class="money-head-tmp">
|
||||
<td style="width:30px;"></td>
|
||||
<td style="width:140px; padding:5px;">结算账户</td>
|
||||
<td style="width:100px; padding:5px;">金额</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:30px;"></td>
|
||||
<td style="width:140px;text-align: center;">合计:</td>
|
||||
<td style="width:100px;"><span id="otherMoneyTotalDlg"></span></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table class="tabs-tmp">
|
||||
<tr class="money-content-tmp">
|
||||
<td style="width:30px;"></td>
|
||||
<td style="width:140px; padding:3px;"><select class="money-id-dlg" style="width:140px;"></select></td>
|
||||
<td style="width:100px; padding:3px;"><input class="other-money-dlg" style="width:100px;"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="otherMoneyDlgBtn">
|
||||
<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="supplierDlg" class="easyui-dialog" style="width:580px;padding:10px 20px"
|
||||
closed="true" buttons="#supplierDlgBtn" modal="true" collapsible="false" closable="true">
|
||||
<form id="supplierFM">
|
||||
<table>
|
||||
<tr>
|
||||
<td style="width: 80px;height: 20px">名称</td>
|
||||
<td style="width: 180px;padding:1px">
|
||||
<input name="supplier" id="supplier" class="easyui-validatebox"
|
||||
data-options="required:true,validType:'length[2,30]'" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td style="width: 60px;height: 20px">联系人</td>
|
||||
<td style="width:180px;padding:1px;">
|
||||
<input name="contacts" id="contacts" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>手机号码</td>
|
||||
<td style="padding:1px;">
|
||||
<input name="telephone" id="telephone" class="easyui-validatebox"
|
||||
style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>电子邮箱</td>
|
||||
<td style="padding:1px">
|
||||
<input name="email" id="email" class="easyui-validatebox" validType="email"
|
||||
style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>联系电话</td>
|
||||
<td style="padding:1px;">
|
||||
<input name="phonenum" id="phonenum" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>传真</td>
|
||||
<td style="padding:1px">
|
||||
<input name="fax" id="fax" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>期初应收</td>
|
||||
<td style="padding:1px">
|
||||
<input name="BeginNeedGet" id="BeginNeedGet" type="text" class="easyui-numberbox"
|
||||
data-options="min:0,precision:2" style="width: 160px;height: 20px"></input>
|
||||
</td>
|
||||
<td>期初应付</td>
|
||||
<td style="padding:1px">
|
||||
<input name="BeginNeedPay" id="BeginNeedPay" type="text" class="easyui-numberbox"
|
||||
data-options="min:0,precision:2" style="width: 160px;height: 20px"></input>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>累计应收</td>
|
||||
<td style="padding:1px">
|
||||
<input name="AllNeedGet" id="AllNeedGet" type="text" class="easyui-numberbox"
|
||||
data-options="min:0,precision:2" style="width: 160px;height: 20px" disabled="true"></input>
|
||||
</td>
|
||||
<td>累计应付</td>
|
||||
<td style="padding:1px">
|
||||
<input name="AllNeedPay" id="AllNeedPay" type="text" class="easyui-numberbox"
|
||||
data-options="min:0,precision:2" style="width: 160px;height: 20px" disabled="true"></input>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>纳税人识别号</td>
|
||||
<td style="padding:1px">
|
||||
<input name="taxNum" id="taxNum" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>税率</td>
|
||||
<td style="padding:1px">
|
||||
<input name="taxRate" id="taxRate" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>开户行</td>
|
||||
<td style="padding:1px">
|
||||
<input name="bankName" id="bankName" class="easyui-validatebox" style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
<td>账号</td>
|
||||
<td style="padding:1px">
|
||||
<input name="accountNumber" id="accountNumber" class="easyui-validatebox"
|
||||
style="width: 160px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>地址</td>
|
||||
<td style="padding:1px" colspan="3">
|
||||
<input name="address" id="address" class="easyui-validatebox" style="width: 408px;height: 20px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>备注</td>
|
||||
<td style="padding:1px" colspan="3">
|
||||
<textarea name="description" id="description" rows="2" cols="2" style="width: 408px;"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<div id="supplierDlgBtn">
|
||||
<a href="javascript:void(0)" id="saveSupplier" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
|
||||
<a href="javascript:void(0)" id="cancelSupplier" class="easyui-linkbutton" iconCls="icon-cancel"
|
||||
onclick="javascript:$('#supplierDlg').dialog('close')">取消</a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@ -1,320 +1,319 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>结算账户查询</title>
|
||||
<meta charset="utf-8">
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon"/>
|
||||
<script type="text/javascript" src="/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="/js/print/print.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="/css/common.css"/>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="/js/common/outlook_in.js"></script>
|
||||
<script type="text/javascript" src="/js/My97DatePicker/WdatePicker.js"></script>
|
||||
<script type="text/javascript" src="/js/common/common.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 查询 -->
|
||||
<div id="searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true"
|
||||
closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>名称:</td>
|
||||
<td>
|
||||
<input type="text" name="searchName" id="searchName" style="width:70px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>编号:</td>
|
||||
<td>
|
||||
<input type="text" name="searchSerialNo" id="searchSerialNo" style="width:70px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-print" id="printBtn">打印</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id="tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="结算账户列表" iconCls="icon-list"
|
||||
collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
|
||||
<div id="accountDetailListDlg" class="easyui-dialog" style="width:900px;height:500px;padding:10px 20px" closed="true"
|
||||
modal="true" collapsible="false" closable="true">
|
||||
<table id="accountTableData" style="top:50px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
//初始化界面
|
||||
$(function () {
|
||||
initTableData();
|
||||
ininPager();
|
||||
print();
|
||||
});
|
||||
|
||||
//初始化表格数据
|
||||
function initTableData() {
|
||||
$('#tableData').datagrid({
|
||||
//iconCls:'icon-save',
|
||||
//width:700,
|
||||
height: heightInfo,
|
||||
nowrap: false,
|
||||
rownumbers: true,
|
||||
//动画效果
|
||||
animate: false,
|
||||
//选中单行
|
||||
singleSelect: true,
|
||||
collapsible: false,
|
||||
selectOnCheck: false,
|
||||
//fitColumns:true,
|
||||
//单击行是否选中
|
||||
checkOnSelect: false,
|
||||
//交替出现背景
|
||||
striped: true,
|
||||
pagination: true,
|
||||
//自动截取数据
|
||||
//nowrap : true,
|
||||
//loadFilter: pagerFilter,
|
||||
pageSize: initPageSize,
|
||||
pageList: initPageNum,
|
||||
columns: [[
|
||||
{title: '名称', field: 'name', width: 100},
|
||||
{title: '编号', field: 'serialno', width: 150, align: "center"},
|
||||
{title: '期初金额', field: 'initialamount', width: 100, align: "center"},
|
||||
{title: '本月发生额', field: 'thismonthamount', width: 100, align: "center"},
|
||||
{title: '当前余额', field: 'currentamount', width: 100, align: "center"},
|
||||
{
|
||||
title: '操作', field: 'op', width: 100, align: "center", formatter: function (value, rec) {
|
||||
var str = '';
|
||||
var rowInfo = rec.id + 'AaBb' + rec.name + 'AaBb' + rec.serialno + 'AaBb' + rec.initialamount + 'AaBb' + rec.currentamount;
|
||||
str += '<img src="/js/easyui-1.3.5/themes/icons/list.png" style="cursor: pointer;" onclick="showAccountInOutList(\'' + rowInfo + '\');"/> <a onclick="showAccountInOutList(\'' + rowInfo + '\');" style="text-decoration:none;color:black;" href="javascript:void(0)">流水</a> ';
|
||||
return str;
|
||||
}
|
||||
}
|
||||
]],
|
||||
onLoadError: function () {
|
||||
$.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
showAccountDetails(1, initPageSize);
|
||||
}
|
||||
|
||||
//初始化键盘enter事件
|
||||
$(document).keydown(function (event) {
|
||||
//兼容 IE和firefox 事件
|
||||
var e = window.event || event;
|
||||
var k = e.keyCode || e.which || e.charCode;
|
||||
//兼容 IE,firefox 兼容
|
||||
var obj = e.srcElement ? e.srcElement : e.target;
|
||||
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
|
||||
//搜索按钮添加快捷键
|
||||
if (k == "13" && (obj.id == "searchName" || obj.id == "searchSerialNo")) {
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
|
||||
//分页信息处理
|
||||
function ininPager() {
|
||||
try {
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
pager.pagination({
|
||||
onSelectPage: function (pageNum, pageSize) {
|
||||
opts.pageNumber = pageNum;
|
||||
opts.pageSize = pageSize;
|
||||
pager.pagination('refresh', {
|
||||
pageNumber: pageNum,
|
||||
pageSize: pageSize
|
||||
});
|
||||
showAccountDetails(pageNum, pageSize);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
$.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
|
||||
}
|
||||
}
|
||||
|
||||
//搜索处理
|
||||
$("#searchBtn").unbind().bind({
|
||||
click: function () {
|
||||
showAccountDetails(1, initPageSize);
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
opts.pageNumber = 1;
|
||||
opts.pageSize = initPageSize;
|
||||
pager.pagination('refresh',
|
||||
{
|
||||
pageNumber: 1,
|
||||
pageSize: initPageSize
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function showAccountDetails(pageNo, pageSize) {
|
||||
var name = $.trim($("#searchName").val());
|
||||
var serialNo = $.trim($("#searchSerialNo").val());
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/account/list",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
search: JSON.stringify({
|
||||
name: name,
|
||||
serialNo: serialNo,
|
||||
remark: ""
|
||||
}),
|
||||
currentPage: pageNo,
|
||||
pageSize: pageSize
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200){
|
||||
if(res.data && res.data.page) {
|
||||
$("#tableData").datagrid('loadData', res.data.page);
|
||||
}
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function showAccountInOutList(accountInfo) {
|
||||
var info = accountInfo.split("AaBb");
|
||||
var accountId = info[0];
|
||||
var initialAmount = info[3];
|
||||
$('#accountDetailListDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui-1.3.5/themes/icons/pencil.png"/> 查看账户流水');
|
||||
$(".window-mask").css({width: webW, height: webH});
|
||||
initAccountDetailData(accountId);
|
||||
getAccountInOutList(accountId, initialAmount, 1, initPageSize);
|
||||
ininAccountDetailPager(accountId, initialAmount);
|
||||
}
|
||||
|
||||
//初始化表格数据
|
||||
function initAccountDetailData(accountId) {
|
||||
$('#accountTableData').datagrid({
|
||||
height: heightInfo,
|
||||
nowrap: false,
|
||||
rownumbers: false,
|
||||
//动画效果
|
||||
animate: false,
|
||||
//选中单行
|
||||
singleSelect: true,
|
||||
collapsible: false,
|
||||
selectOnCheck: false,
|
||||
//单击行是否选中
|
||||
checkOnSelect: false,
|
||||
//交替出现背景
|
||||
striped: true,
|
||||
pagination: true,
|
||||
pageSize: initPageSize,
|
||||
pageList: initPageNum,
|
||||
columns: [[
|
||||
{
|
||||
title: '单据编号', field: 'number', width: 150,
|
||||
formatter: function (value, row) {
|
||||
return "<a class='n-link' onclick=\"newTab('" + row.number + "','../materials/bill_detail.html?n=" + row.number + "&type=" + row.type + "','')\">"
|
||||
+ row.number + "</a>";
|
||||
}
|
||||
},
|
||||
{title: '类型', field: 'type', width: 100},
|
||||
{title: '单位信息', field: 'supplierName', width: 150},
|
||||
{
|
||||
title: '金额', field: 'changeAmount', width: 80,
|
||||
formatter: function (value, row) {
|
||||
if (row.aList && row.amList) {
|
||||
var aListArr = row.aList.toString().split(",");
|
||||
var amListArr = row.amList.toString().split(",");
|
||||
var res = "";
|
||||
for (var i = 0; i < aListArr.length; i++) {
|
||||
if (aListArr[i] == accountId) {
|
||||
res = amListArr[i];
|
||||
}
|
||||
}
|
||||
return res + "[多账户]";
|
||||
}
|
||||
else {
|
||||
return row.changeAmount;
|
||||
}
|
||||
}
|
||||
},
|
||||
{title: '余额', field: 'balance', width: 80},
|
||||
{title: '入库出库日期', field: 'operTime', width: 180}
|
||||
]],
|
||||
onLoadError: function () {
|
||||
$.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//分页信息处理
|
||||
function ininAccountDetailPager(accountId, initialAmount) {
|
||||
try {
|
||||
var opts = $("#accountTableData").datagrid('options');
|
||||
var pager = $("#accountTableData").datagrid('getPager');
|
||||
pager.pagination({
|
||||
onSelectPage: function (pageNum, pageSize) {
|
||||
opts.pageNumber = pageNum;
|
||||
opts.pageSize = pageSize;
|
||||
pager.pagination('refresh', {
|
||||
pageNumber: pageNum,
|
||||
pageSize: pageSize
|
||||
});
|
||||
getAccountInOutList(accountId, initialAmount, pageNum, pageSize);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
$.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
|
||||
}
|
||||
}
|
||||
|
||||
function getAccountInOutList(accountId, initialAmount, pageNo, pageSize) {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/account/findAccountInOutList",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
currentPage: pageNo,
|
||||
pageSize: pageSize,
|
||||
accountId: accountId,
|
||||
initialAmount: initialAmount
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200) {
|
||||
$("#accountTableData").datagrid('loadData', res.data);
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//报表打印
|
||||
function print() {
|
||||
$("#printBtn").off("click").on("click", function () {
|
||||
var path = "<%=path %>";
|
||||
CreateFormPage('打印报表', $('#tableData'), path);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>结算账户查询</title>
|
||||
<meta charset="utf-8">
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon"/>
|
||||
<script type="text/javascript" src="/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="/js/print/print.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="/css/common.css"/>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="/js/common/outlook_in.js"></script>
|
||||
<script type="text/javascript" src="/js/My97DatePicker/WdatePicker.js"></script>
|
||||
<script type="text/javascript" src="/js/common/common.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 查询 -->
|
||||
<div id="searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true"
|
||||
closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>名称:</td>
|
||||
<td>
|
||||
<input type="text" name="searchName" id="searchName" style="width:70px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>编号:</td>
|
||||
<td>
|
||||
<input type="text" name="searchSerialNo" id="searchSerialNo" style="width:70px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-print" id="printBtn">打印</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id="tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="结算账户列表" iconCls="icon-list"
|
||||
collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
|
||||
<div id="accountDetailListDlg" class="easyui-dialog" style="width:900px;height:500px;padding:10px 20px" closed="true"
|
||||
modal="true" collapsible="false" closable="true">
|
||||
<table id="accountTableData" style="top:50px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
//初始化界面
|
||||
$(function () {
|
||||
initTableData();
|
||||
ininPager();
|
||||
print();
|
||||
});
|
||||
|
||||
//初始化表格数据
|
||||
function initTableData() {
|
||||
$('#tableData').datagrid({
|
||||
//iconCls:'icon-save',
|
||||
//width:700,
|
||||
height: heightInfo,
|
||||
nowrap: false,
|
||||
rownumbers: true,
|
||||
//动画效果
|
||||
animate: false,
|
||||
//选中单行
|
||||
singleSelect: true,
|
||||
collapsible: false,
|
||||
selectOnCheck: false,
|
||||
//fitColumns:true,
|
||||
//单击行是否选中
|
||||
checkOnSelect: false,
|
||||
//交替出现背景
|
||||
striped: true,
|
||||
pagination: true,
|
||||
//自动截取数据
|
||||
//nowrap : true,
|
||||
//loadFilter: pagerFilter,
|
||||
pageSize: initPageSize,
|
||||
pageList: initPageNum,
|
||||
columns: [[
|
||||
{title: '名称', field: 'name', width: 100},
|
||||
{title: '编号', field: 'serialno', width: 150, align: "center"},
|
||||
{title: '期初金额', field: 'initialamount', width: 100, align: "center"},
|
||||
{title: '本月发生额', field: 'thismonthamount', width: 100, align: "center"},
|
||||
{title: '当前余额', field: 'currentamount', width: 100, align: "center"},
|
||||
{
|
||||
title: '操作', field: 'op', width: 100, align: "center", formatter: function (value, rec) {
|
||||
var str = '';
|
||||
var rowInfo = rec.id + 'AaBb' + rec.name + 'AaBb' + rec.serialno + 'AaBb' + rec.initialamount + 'AaBb' + rec.currentamount;
|
||||
str += '<img src="/js/easyui-1.3.5/themes/icons/list.png" style="cursor: pointer;" onclick="showAccountInOutList(\'' + rowInfo + '\');"/> <a onclick="showAccountInOutList(\'' + rowInfo + '\');" style="text-decoration:none;color:black;" href="javascript:void(0)">流水</a> ';
|
||||
return str;
|
||||
}
|
||||
}
|
||||
]],
|
||||
onLoadError: function () {
|
||||
$.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
showAccountDetails(1, initPageSize);
|
||||
}
|
||||
|
||||
//初始化键盘enter事件
|
||||
$(document).keydown(function (event) {
|
||||
//兼容 IE和firefox 事件
|
||||
var e = window.event || event;
|
||||
var k = e.keyCode || e.which || e.charCode;
|
||||
//兼容 IE,firefox 兼容
|
||||
var obj = e.srcElement ? e.srcElement : e.target;
|
||||
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
|
||||
//搜索按钮添加快捷键
|
||||
if (k == "13" && (obj.id == "searchName" || obj.id == "searchSerialNo")) {
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
|
||||
//分页信息处理
|
||||
function ininPager() {
|
||||
try {
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
pager.pagination({
|
||||
onSelectPage: function (pageNum, pageSize) {
|
||||
opts.pageNumber = pageNum;
|
||||
opts.pageSize = pageSize;
|
||||
pager.pagination('refresh', {
|
||||
pageNumber: pageNum,
|
||||
pageSize: pageSize
|
||||
});
|
||||
showAccountDetails(pageNum, pageSize);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
$.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
|
||||
}
|
||||
}
|
||||
|
||||
//搜索处理
|
||||
$("#searchBtn").unbind().bind({
|
||||
click: function () {
|
||||
showAccountDetails(1, initPageSize);
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
opts.pageNumber = 1;
|
||||
opts.pageSize = initPageSize;
|
||||
pager.pagination('refresh',
|
||||
{
|
||||
pageNumber: 1,
|
||||
pageSize: initPageSize
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function showAccountDetails(pageNo, pageSize) {
|
||||
var name = $.trim($("#searchName").val());
|
||||
var serialNo = $.trim($("#searchSerialNo").val());
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/account/list",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
search: JSON.stringify({
|
||||
name: name,
|
||||
serialNo: serialNo,
|
||||
remark: ""
|
||||
}),
|
||||
currentPage: pageNo,
|
||||
pageSize: pageSize
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200){
|
||||
if(res.data && res.data.page) {
|
||||
$("#tableData").datagrid('loadData', res.data.page);
|
||||
}
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function showAccountInOutList(accountInfo) {
|
||||
var info = accountInfo.split("AaBb");
|
||||
var accountId = info[0];
|
||||
var initialAmount = info[3];
|
||||
$('#accountDetailListDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui-1.3.5/themes/icons/pencil.png"/> 查看账户流水');
|
||||
$(".window-mask").css({width: webW, height: webH});
|
||||
initAccountDetailData(accountId);
|
||||
getAccountInOutList(accountId, initialAmount, 1, initPageSize);
|
||||
ininAccountDetailPager(accountId, initialAmount);
|
||||
}
|
||||
|
||||
//初始化表格数据
|
||||
function initAccountDetailData(accountId) {
|
||||
$('#accountTableData').datagrid({
|
||||
height: heightInfo,
|
||||
nowrap: false,
|
||||
rownumbers: false,
|
||||
//动画效果
|
||||
animate: false,
|
||||
//选中单行
|
||||
singleSelect: true,
|
||||
collapsible: false,
|
||||
selectOnCheck: false,
|
||||
//单击行是否选中
|
||||
checkOnSelect: false,
|
||||
//交替出现背景
|
||||
striped: true,
|
||||
pagination: true,
|
||||
pageSize: initPageSize,
|
||||
pageList: initPageNum,
|
||||
columns: [[
|
||||
{
|
||||
title: '单据编号', field: 'number', width: 150,
|
||||
formatter: function (value, row) {
|
||||
return "<a class='n-link' onclick=\"newTab('" + row.number + "','../materials/bill_detail.html?n=" + row.number + "&type=" + row.type + "','')\">"
|
||||
+ row.number + "</a>";
|
||||
}
|
||||
},
|
||||
{title: '类型', field: 'type', width: 100},
|
||||
{title: '单位信息', field: 'supplierName', width: 150},
|
||||
{
|
||||
title: '金额', field: 'changeAmount', width: 80,
|
||||
formatter: function (value, row) {
|
||||
if (row.aList && row.amList) {
|
||||
var aListArr = row.aList.toString().split(",");
|
||||
var amListArr = row.amList.toString().split(",");
|
||||
var res = "";
|
||||
for (var i = 0; i < aListArr.length; i++) {
|
||||
if (aListArr[i] == accountId) {
|
||||
res = amListArr[i];
|
||||
}
|
||||
}
|
||||
return res + "[多账户]";
|
||||
}
|
||||
else {
|
||||
return row.changeAmount;
|
||||
}
|
||||
}
|
||||
},
|
||||
{title: '余额', field: 'balance', width: 80},
|
||||
{title: '入库出库日期', field: 'operTime', width: 180}
|
||||
]],
|
||||
onLoadError: function () {
|
||||
$.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//分页信息处理
|
||||
function ininAccountDetailPager(accountId, initialAmount) {
|
||||
try {
|
||||
var opts = $("#accountTableData").datagrid('options');
|
||||
var pager = $("#accountTableData").datagrid('getPager');
|
||||
pager.pagination({
|
||||
onSelectPage: function (pageNum, pageSize) {
|
||||
opts.pageNumber = pageNum;
|
||||
opts.pageSize = pageSize;
|
||||
pager.pagination('refresh', {
|
||||
pageNumber: pageNum,
|
||||
pageSize: pageSize
|
||||
});
|
||||
getAccountInOutList(accountId, initialAmount, pageNum, pageSize);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
$.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
|
||||
}
|
||||
}
|
||||
|
||||
function getAccountInOutList(accountId, initialAmount, pageNo, pageSize) {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/account/findAccountInOutList",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
currentPage: pageNo,
|
||||
pageSize: pageSize,
|
||||
accountId: accountId,
|
||||
initialAmount: initialAmount
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200) {
|
||||
$("#accountTableData").datagrid('loadData', res.data);
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//报表打印
|
||||
function print() {
|
||||
$("#printBtn").off("click").on("click", function () {
|
||||
CreateFormPage('打印报表', $('#tableData'));
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@ -1,261 +1,260 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>进货统计</title>
|
||||
<meta charset="utf-8">
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon"/>
|
||||
<script type="text/javascript" src="/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="/js/print/print.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="/css/common.css"/>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="/js/My97DatePicker/WdatePicker.js"></script>
|
||||
<script type="text/javascript" src="/js/common/common.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 查询 -->
|
||||
<div id="searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true"
|
||||
closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>月份:</td>
|
||||
<td>
|
||||
<input type="text" name="searchMonth" id="searchMonth" onClick="WdatePicker({dateFmt:'yyyy-MM'})"
|
||||
class="txt Wdate" style="width:180px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-print" id="printBtn">打印</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id="tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="进货统计列表" iconCls="icon-list"
|
||||
collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var mPropertyList = ""; //商品属性列表
|
||||
//初始化界面
|
||||
$(function () {
|
||||
var thisDate = getNowFormatMonth(); //当前月份
|
||||
$("#searchMonth").val(thisDate);
|
||||
initMProperty(); //初始化商品属性
|
||||
initTableData();
|
||||
ininPager();
|
||||
search();
|
||||
print();
|
||||
});
|
||||
|
||||
//初始化商品属性
|
||||
function initMProperty() {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/materialProperty/list",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
search: JSON.stringify({
|
||||
name: ""
|
||||
}),
|
||||
currentPage: 1,
|
||||
pageSize: 100
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200){
|
||||
var thisRows = res.data.page.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({
|
||||
height: heightInfo,
|
||||
nowrap: false,
|
||||
rownumbers: true,
|
||||
//动画效果
|
||||
animate: false,
|
||||
//选中单行
|
||||
singleSelect: true,
|
||||
pagination: true,
|
||||
//交替出现背景
|
||||
striped: true,
|
||||
//loadFilter: pagerFilter,
|
||||
pageSize: 10,
|
||||
pageList: [10, 50, 100],
|
||||
columns: [[
|
||||
{title: '名称', field: 'MaterialName', width: 60},
|
||||
{title: '型号', field: 'MaterialModel', width: 80},
|
||||
{title: '扩展信息', field: 'MaterialOther', width: 150},
|
||||
{title: '单位', field: 'MaterialUnit', width: 80},
|
||||
{title: '进货数量', field: 'InSum', width: 60},
|
||||
{title: '进货金额', field: 'InSumPrice', width: 60},
|
||||
{title: '退货数量', field: 'OutSum', width: 60},
|
||||
{title: '退货金额', field: 'OutSumPrice', width: 60}
|
||||
]],
|
||||
onLoadError: function () {
|
||||
$.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化键盘enter事件
|
||||
$(document).keydown(function (event) {
|
||||
//兼容 IE和firefox 事件
|
||||
var e = window.event || event;
|
||||
var k = e.keyCode || e.which || e.charCode;
|
||||
//兼容 IE,firefox 兼容
|
||||
var obj = e.srcElement ? e.srcElement : e.target;
|
||||
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
|
||||
//搜索按钮添加快捷键
|
||||
if (k == "13" && (obj.id == "searchMonth")) {
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
|
||||
//分页信息处理
|
||||
function ininPager() {
|
||||
try {
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
pager.pagination({
|
||||
onSelectPage: function (pageNum, pageSize) {
|
||||
opts.pageNumber = pageNum;
|
||||
opts.pageSize = pageSize;
|
||||
pager.pagination('refresh', {
|
||||
pageNumber: pageNum,
|
||||
pageSize: pageSize
|
||||
});
|
||||
showDetails(pageNum, pageSize);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
$.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
|
||||
}
|
||||
}
|
||||
|
||||
function search() {
|
||||
showDetails(1, initPageSize);
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
opts.pageNumber = 1;
|
||||
opts.pageSize = initPageSize;
|
||||
pager.pagination('refresh', {
|
||||
pageNumber: 1,
|
||||
pageSize: initPageSize
|
||||
});
|
||||
}
|
||||
|
||||
//搜索处理
|
||||
$("#searchBtn").unbind().bind({
|
||||
click: function () {
|
||||
search();
|
||||
}
|
||||
});
|
||||
|
||||
function showDetails(pageNo, pageSize) {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/depotHead/findByMonth",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
monthTime: $("#searchMonth").val()
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200 && res.data) {
|
||||
var HeadIds = res.data.HeadIds;
|
||||
if (HeadIds) {
|
||||
//获取排序后的产品ID
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/material/findByOrder",
|
||||
dataType: "json",
|
||||
success: function (res) {
|
||||
if(res && res.code === 200 && res.data) {
|
||||
var mIds = res.data.mIds;
|
||||
if (mIds) {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/depotItem/buyIn",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
currentPage: pageNo,
|
||||
pageSize: pageSize,
|
||||
monthTime: $("#searchMonth").val(),
|
||||
headIds: HeadIds,
|
||||
materialIds: mIds,
|
||||
mpList: mPropertyList
|
||||
}),
|
||||
success: function (res) {
|
||||
if (res && res.code === 200 && res.data) {
|
||||
$("#tableData").datagrid('loadData', res.data.rows);
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
$.messager.alert('查询提示', '本月无数据!', 'error');
|
||||
}
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
$.messager.alert('查询提示', '本月无数据!', 'error');
|
||||
}
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//报表打印
|
||||
function print() {
|
||||
$("#printBtn").off("click").on("click", function () {
|
||||
var path = "<%=path %>";
|
||||
CreateFormPage('打印报表', $('#tableData'), path);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>进货统计</title>
|
||||
<meta charset="utf-8">
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon"/>
|
||||
<script type="text/javascript" src="/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="/js/print/print.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="/css/common.css"/>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="/js/My97DatePicker/WdatePicker.js"></script>
|
||||
<script type="text/javascript" src="/js/common/common.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 查询 -->
|
||||
<div id="searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true"
|
||||
closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>月份:</td>
|
||||
<td>
|
||||
<input type="text" name="searchMonth" id="searchMonth" onClick="WdatePicker({dateFmt:'yyyy-MM'})"
|
||||
class="txt Wdate" style="width:180px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-print" id="printBtn">打印</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id="tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="进货统计列表" iconCls="icon-list"
|
||||
collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var mPropertyList = ""; //商品属性列表
|
||||
//初始化界面
|
||||
$(function () {
|
||||
var thisDate = getNowFormatMonth(); //当前月份
|
||||
$("#searchMonth").val(thisDate);
|
||||
initMProperty(); //初始化商品属性
|
||||
initTableData();
|
||||
ininPager();
|
||||
search();
|
||||
print();
|
||||
});
|
||||
|
||||
//初始化商品属性
|
||||
function initMProperty() {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/materialProperty/list",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
search: JSON.stringify({
|
||||
name: ""
|
||||
}),
|
||||
currentPage: 1,
|
||||
pageSize: 100
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200){
|
||||
var thisRows = res.data.page.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({
|
||||
height: heightInfo,
|
||||
nowrap: false,
|
||||
rownumbers: true,
|
||||
//动画效果
|
||||
animate: false,
|
||||
//选中单行
|
||||
singleSelect: true,
|
||||
pagination: true,
|
||||
//交替出现背景
|
||||
striped: true,
|
||||
//loadFilter: pagerFilter,
|
||||
pageSize: 10,
|
||||
pageList: [10, 50, 100],
|
||||
columns: [[
|
||||
{title: '名称', field: 'MaterialName', width: 60},
|
||||
{title: '型号', field: 'MaterialModel', width: 80},
|
||||
{title: '扩展信息', field: 'MaterialOther', width: 150},
|
||||
{title: '单位', field: 'MaterialUnit', width: 80},
|
||||
{title: '进货数量', field: 'InSum', width: 60},
|
||||
{title: '进货金额', field: 'InSumPrice', width: 60},
|
||||
{title: '退货数量', field: 'OutSum', width: 60},
|
||||
{title: '退货金额', field: 'OutSumPrice', width: 60}
|
||||
]],
|
||||
onLoadError: function () {
|
||||
$.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化键盘enter事件
|
||||
$(document).keydown(function (event) {
|
||||
//兼容 IE和firefox 事件
|
||||
var e = window.event || event;
|
||||
var k = e.keyCode || e.which || e.charCode;
|
||||
//兼容 IE,firefox 兼容
|
||||
var obj = e.srcElement ? e.srcElement : e.target;
|
||||
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
|
||||
//搜索按钮添加快捷键
|
||||
if (k == "13" && (obj.id == "searchMonth")) {
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
|
||||
//分页信息处理
|
||||
function ininPager() {
|
||||
try {
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
pager.pagination({
|
||||
onSelectPage: function (pageNum, pageSize) {
|
||||
opts.pageNumber = pageNum;
|
||||
opts.pageSize = pageSize;
|
||||
pager.pagination('refresh', {
|
||||
pageNumber: pageNum,
|
||||
pageSize: pageSize
|
||||
});
|
||||
showDetails(pageNum, pageSize);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
$.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
|
||||
}
|
||||
}
|
||||
|
||||
function search() {
|
||||
showDetails(1, initPageSize);
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
opts.pageNumber = 1;
|
||||
opts.pageSize = initPageSize;
|
||||
pager.pagination('refresh', {
|
||||
pageNumber: 1,
|
||||
pageSize: initPageSize
|
||||
});
|
||||
}
|
||||
|
||||
//搜索处理
|
||||
$("#searchBtn").unbind().bind({
|
||||
click: function () {
|
||||
search();
|
||||
}
|
||||
});
|
||||
|
||||
function showDetails(pageNo, pageSize) {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/depotHead/findByMonth",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
monthTime: $("#searchMonth").val()
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200 && res.data) {
|
||||
var HeadIds = res.data.HeadIds;
|
||||
if (HeadIds) {
|
||||
//获取排序后的产品ID
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/material/findByOrder",
|
||||
dataType: "json",
|
||||
success: function (res) {
|
||||
if(res && res.code === 200 && res.data) {
|
||||
var mIds = res.data.mIds;
|
||||
if (mIds) {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/depotItem/buyIn",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
currentPage: pageNo,
|
||||
pageSize: pageSize,
|
||||
monthTime: $("#searchMonth").val(),
|
||||
headIds: HeadIds,
|
||||
materialIds: mIds,
|
||||
mpList: mPropertyList
|
||||
}),
|
||||
success: function (res) {
|
||||
if (res && res.code === 200 && res.data) {
|
||||
$("#tableData").datagrid('loadData', res.data.rows);
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
$.messager.alert('查询提示', '本月无数据!', 'error');
|
||||
}
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
$.messager.alert('查询提示', '本月无数据!', 'error');
|
||||
}
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//报表打印
|
||||
function print() {
|
||||
$("#printBtn").off("click").on("click", function () {
|
||||
CreateFormPage('打印报表', $('#tableData'));
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@ -344,8 +344,7 @@
|
||||
//报表打印
|
||||
function print() {
|
||||
$("#printBtn").off("click").on("click", function () {
|
||||
var path = "<%=path %>";
|
||||
CreateFormPage('打印报表', $('#tableData'), path);
|
||||
CreateFormPage('打印报表', $('#tableData'));
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -1,315 +1,314 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>入库明细</title>
|
||||
<meta charset="utf-8">
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon"/>
|
||||
<script type="text/javascript" src="/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="/js/print/print.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="/css/common.css"/>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="/js/common/outlook_in.js"></script>
|
||||
<script type="text/javascript" src="/js/My97DatePicker/WdatePicker.js"></script>
|
||||
<script type="text/javascript" src="/js/common/common.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 查询 -->
|
||||
<div id="searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true"
|
||||
closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>供应商:</td>
|
||||
<td>
|
||||
<input id="OrganId" name="OrganId" style="width:120px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>仓库:</td>
|
||||
<td>
|
||||
<select name="searchProjectId" id="searchProjectId" style="width:100px;"></select>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>单据日期:</td>
|
||||
<td>
|
||||
<input type="text" name="searchBeginTime" id="searchBeginTime"
|
||||
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/>
|
||||
</td>
|
||||
<td>-</td>
|
||||
<td>
|
||||
<input type="text" name="searchEndTime" id="searchEndTime"
|
||||
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-print" id="printBtn">打印</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id="tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="入库明细列表" iconCls="icon-list"
|
||||
collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var depotList = null;
|
||||
var depotID = null;
|
||||
var depotString = ""; //仓库列表
|
||||
var uid = sessionStorage.getItem("userId");
|
||||
var supUrl = "/supplier/findBySelect_sup"; //供应商接口
|
||||
//初始化界面
|
||||
$(function () {
|
||||
var thisDate = getNowFormatMonth(); //当前月份
|
||||
var thisDateTime = getNowFormatDateTime(); //当前时间
|
||||
$("#searchBeginTime").val(thisDate + "-01 00:00:00");
|
||||
$("#searchEndTime").val(thisDateTime);
|
||||
var userBusinessList = null;
|
||||
var userdepot = null;
|
||||
initSupplier(); //初始化供应商信息
|
||||
initSystemData_UB();
|
||||
initSelectInfo_UB();
|
||||
initSystemData_depot();
|
||||
initSelectInfo_depot();
|
||||
initTableData();
|
||||
ininPager();
|
||||
search();
|
||||
print();
|
||||
});
|
||||
|
||||
//初始化供应商
|
||||
function initSupplier() {
|
||||
$('#OrganId').combobox({
|
||||
url: supUrl,
|
||||
valueField: 'id',
|
||||
textField: 'supplier',
|
||||
filter: function (q, row) {
|
||||
var opts = $(this).combobox('options');
|
||||
return row[opts.textField].indexOf(q) > -1;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化系统基础信息
|
||||
function initSystemData_UB() {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/userBusiness/getBasicData",
|
||||
data: ({
|
||||
KeyId: uid,
|
||||
Type: "UserDepot"
|
||||
}),
|
||||
//设置为同步
|
||||
async: false,
|
||||
dataType: "json",
|
||||
success: function (res) {
|
||||
if (res && res.code === 200) {
|
||||
if(res.data) {
|
||||
userBusinessList = res.data.userBusinessList;
|
||||
}
|
||||
}
|
||||
else {
|
||||
userBusinessList = null;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
//初始化页面选项卡
|
||||
function initSelectInfo_UB() {
|
||||
|
||||
if (userBusinessList != null) {
|
||||
if (userBusinessList.length > 0) {
|
||||
//用户对应的仓库列表 [1][2][3]...
|
||||
userdepot = userBusinessList[0].value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//初始化系统基础信息
|
||||
function initSystemData_depot() {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/depot/getAllList",
|
||||
//设置为同步
|
||||
async: false,
|
||||
dataType: "json",
|
||||
success: function (res) {
|
||||
if(res && res.code === 200) {
|
||||
depotList = res.data;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化页面选项卡
|
||||
function initSelectInfo_depot() {
|
||||
var options = "";
|
||||
|
||||
if (depotList != null) {
|
||||
options = "";
|
||||
for (var i = 0; i < depotList.length; i++) {
|
||||
var depot = depotList[i];
|
||||
|
||||
if (userdepot != null) {
|
||||
if (userdepot.indexOf("[" + depot.id + "]") != -1) {
|
||||
options += '<option value="' + depot.id + '">' + depot.name + '</option>';
|
||||
depotString = depotString + depot.id + ",";
|
||||
}
|
||||
}
|
||||
}
|
||||
depotString = depotString.substring(0, depotString.length - 1);
|
||||
$("#searchProjectId").empty().append('<option value="">全部</option>').append(options);
|
||||
}
|
||||
}
|
||||
|
||||
//初始化表格数据
|
||||
function initTableData() {
|
||||
$('#tableData').datagrid({
|
||||
height: heightInfo,
|
||||
nowrap: false,
|
||||
rownumbers: true,
|
||||
//动画效果
|
||||
animate: false,
|
||||
//选中单行
|
||||
singleSelect: true,
|
||||
pagination: true,
|
||||
//交替出现背景
|
||||
striped: true,
|
||||
pageSize: 10,
|
||||
pageList: [10, 50, 100],
|
||||
columns: [[
|
||||
{
|
||||
title: '单据编号', field: 'number', width: 140,
|
||||
formatter: function (value, row) {
|
||||
return "<a class='n-link' onclick=\"newTab('" + row.number + "','../materials/bill_detail.html?n=" + row.number + "&type=" + row.newType + "','')\">"
|
||||
+ row.number + "</a>";
|
||||
}
|
||||
},
|
||||
{title: '商品名称', field: 'mname', width: 120},
|
||||
{title: '商品型号', field: 'model', width: 100},
|
||||
{title: '单价', field: 'unitPrice', width: 60},
|
||||
{title: '入库数量', field: 'operNumber', width: 60},
|
||||
{title: '金额', field: 'allPrice', width: 60},
|
||||
{title: '供应商', field: 'sname', width: 200},
|
||||
{title: '仓库', field: 'dname', width: 120},
|
||||
{title: '入库日期', field: 'operTime', width: 80},
|
||||
]],
|
||||
onLoadError: function () {
|
||||
$.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化键盘enter事件
|
||||
$(document).keydown(function (event) {
|
||||
//兼容 IE和firefox 事件
|
||||
var e = window.event || event;
|
||||
var k = e.keyCode || e.which || e.charCode;
|
||||
//兼容 IE,firefox 兼容
|
||||
var obj = e.srcElement ? e.srcElement : e.target;
|
||||
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
|
||||
if (k == "13" && (obj.id == "Type" || obj.id == "Name")) {
|
||||
$("#savePerson").click();
|
||||
}
|
||||
//搜索按钮添加快捷键
|
||||
if (k == "13" && (obj.id == "searchType")) {
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
|
||||
//分页信息处理
|
||||
function ininPager() {
|
||||
try {
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
pager.pagination({
|
||||
onSelectPage: function (pageNum, pageSize) {
|
||||
opts.pageNumber = pageNum;
|
||||
opts.pageSize = pageSize;
|
||||
pager.pagination('refresh', {
|
||||
pageNumber: pageNum,
|
||||
pageSize: pageSize
|
||||
});
|
||||
showDetails(pageNum, pageSize);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
$.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
|
||||
}
|
||||
}
|
||||
|
||||
//增加
|
||||
var url;
|
||||
var personID = 0;
|
||||
//保存编辑前的名称
|
||||
var orgPerson = "";
|
||||
|
||||
//搜索处理
|
||||
function search() {
|
||||
showDetails(1, initPageSize);
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
opts.pageNumber = 1;
|
||||
opts.pageSize = initPageSize;
|
||||
pager.pagination('refresh', {
|
||||
pageNumber: 1,
|
||||
pageSize: initPageSize
|
||||
});
|
||||
}
|
||||
|
||||
$("#searchBtn").unbind().bind({
|
||||
click: function () {
|
||||
search();
|
||||
}
|
||||
});
|
||||
|
||||
function showDetails(pageNo, pageSize) {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/depotHead/findInDetail",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
currentPage: pageNo,
|
||||
pageSize: pageSize,
|
||||
organId: $('#OrganId').combobox('getValue'),
|
||||
projectId: $.trim($("#searchProjectId").val()),
|
||||
depotIds: depotString,
|
||||
beginTime: $("#searchBeginTime").val(),
|
||||
endTime: $("#searchEndTime").val(),
|
||||
type: "入库"
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200 && res.data) {
|
||||
$("#tableData").datagrid('loadData', res.data.rows);
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//报表打印
|
||||
function print() {
|
||||
$("#printBtn").off("click").on("click", function () {
|
||||
var path = "<%=path %>";
|
||||
CreateFormPage('打印报表', $('#tableData'), path);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>入库明细</title>
|
||||
<meta charset="utf-8">
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon"/>
|
||||
<script type="text/javascript" src="/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="/js/print/print.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="/css/common.css"/>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="/js/common/outlook_in.js"></script>
|
||||
<script type="text/javascript" src="/js/My97DatePicker/WdatePicker.js"></script>
|
||||
<script type="text/javascript" src="/js/common/common.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 查询 -->
|
||||
<div id="searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true"
|
||||
closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>供应商:</td>
|
||||
<td>
|
||||
<input id="OrganId" name="OrganId" style="width:120px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>仓库:</td>
|
||||
<td>
|
||||
<select name="searchProjectId" id="searchProjectId" style="width:100px;"></select>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>单据日期:</td>
|
||||
<td>
|
||||
<input type="text" name="searchBeginTime" id="searchBeginTime"
|
||||
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/>
|
||||
</td>
|
||||
<td>-</td>
|
||||
<td>
|
||||
<input type="text" name="searchEndTime" id="searchEndTime"
|
||||
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-print" id="printBtn">打印</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id="tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="入库明细列表" iconCls="icon-list"
|
||||
collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var depotList = null;
|
||||
var depotID = null;
|
||||
var depotString = ""; //仓库列表
|
||||
var uid = sessionStorage.getItem("userId");
|
||||
var supUrl = "/supplier/findBySelect_sup"; //供应商接口
|
||||
//初始化界面
|
||||
$(function () {
|
||||
var thisDate = getNowFormatMonth(); //当前月份
|
||||
var thisDateTime = getNowFormatDateTime(); //当前时间
|
||||
$("#searchBeginTime").val(thisDate + "-01 00:00:00");
|
||||
$("#searchEndTime").val(thisDateTime);
|
||||
var userBusinessList = null;
|
||||
var userdepot = null;
|
||||
initSupplier(); //初始化供应商信息
|
||||
initSystemData_UB();
|
||||
initSelectInfo_UB();
|
||||
initSystemData_depot();
|
||||
initSelectInfo_depot();
|
||||
initTableData();
|
||||
ininPager();
|
||||
search();
|
||||
print();
|
||||
});
|
||||
|
||||
//初始化供应商
|
||||
function initSupplier() {
|
||||
$('#OrganId').combobox({
|
||||
url: supUrl,
|
||||
valueField: 'id',
|
||||
textField: 'supplier',
|
||||
filter: function (q, row) {
|
||||
var opts = $(this).combobox('options');
|
||||
return row[opts.textField].indexOf(q) > -1;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化系统基础信息
|
||||
function initSystemData_UB() {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/userBusiness/getBasicData",
|
||||
data: ({
|
||||
KeyId: uid,
|
||||
Type: "UserDepot"
|
||||
}),
|
||||
//设置为同步
|
||||
async: false,
|
||||
dataType: "json",
|
||||
success: function (res) {
|
||||
if (res && res.code === 200) {
|
||||
if(res.data) {
|
||||
userBusinessList = res.data.userBusinessList;
|
||||
}
|
||||
}
|
||||
else {
|
||||
userBusinessList = null;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
//初始化页面选项卡
|
||||
function initSelectInfo_UB() {
|
||||
|
||||
if (userBusinessList != null) {
|
||||
if (userBusinessList.length > 0) {
|
||||
//用户对应的仓库列表 [1][2][3]...
|
||||
userdepot = userBusinessList[0].value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//初始化系统基础信息
|
||||
function initSystemData_depot() {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/depot/getAllList",
|
||||
//设置为同步
|
||||
async: false,
|
||||
dataType: "json",
|
||||
success: function (res) {
|
||||
if(res && res.code === 200) {
|
||||
depotList = res.data;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化页面选项卡
|
||||
function initSelectInfo_depot() {
|
||||
var options = "";
|
||||
|
||||
if (depotList != null) {
|
||||
options = "";
|
||||
for (var i = 0; i < depotList.length; i++) {
|
||||
var depot = depotList[i];
|
||||
|
||||
if (userdepot != null) {
|
||||
if (userdepot.indexOf("[" + depot.id + "]") != -1) {
|
||||
options += '<option value="' + depot.id + '">' + depot.name + '</option>';
|
||||
depotString = depotString + depot.id + ",";
|
||||
}
|
||||
}
|
||||
}
|
||||
depotString = depotString.substring(0, depotString.length - 1);
|
||||
$("#searchProjectId").empty().append('<option value="">全部</option>').append(options);
|
||||
}
|
||||
}
|
||||
|
||||
//初始化表格数据
|
||||
function initTableData() {
|
||||
$('#tableData').datagrid({
|
||||
height: heightInfo,
|
||||
nowrap: false,
|
||||
rownumbers: true,
|
||||
//动画效果
|
||||
animate: false,
|
||||
//选中单行
|
||||
singleSelect: true,
|
||||
pagination: true,
|
||||
//交替出现背景
|
||||
striped: true,
|
||||
pageSize: 10,
|
||||
pageList: [10, 50, 100],
|
||||
columns: [[
|
||||
{
|
||||
title: '单据编号', field: 'number', width: 140,
|
||||
formatter: function (value, row) {
|
||||
return "<a class='n-link' onclick=\"newTab('" + row.number + "','../materials/bill_detail.html?n=" + row.number + "&type=" + row.newType + "','')\">"
|
||||
+ row.number + "</a>";
|
||||
}
|
||||
},
|
||||
{title: '商品名称', field: 'mname', width: 120},
|
||||
{title: '商品型号', field: 'model', width: 100},
|
||||
{title: '单价', field: 'unitPrice', width: 60},
|
||||
{title: '入库数量', field: 'operNumber', width: 60},
|
||||
{title: '金额', field: 'allPrice', width: 60},
|
||||
{title: '供应商', field: 'sname', width: 200},
|
||||
{title: '仓库', field: 'dname', width: 120},
|
||||
{title: '入库日期', field: 'operTime', width: 80},
|
||||
]],
|
||||
onLoadError: function () {
|
||||
$.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化键盘enter事件
|
||||
$(document).keydown(function (event) {
|
||||
//兼容 IE和firefox 事件
|
||||
var e = window.event || event;
|
||||
var k = e.keyCode || e.which || e.charCode;
|
||||
//兼容 IE,firefox 兼容
|
||||
var obj = e.srcElement ? e.srcElement : e.target;
|
||||
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
|
||||
if (k == "13" && (obj.id == "Type" || obj.id == "Name")) {
|
||||
$("#savePerson").click();
|
||||
}
|
||||
//搜索按钮添加快捷键
|
||||
if (k == "13" && (obj.id == "searchType")) {
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
|
||||
//分页信息处理
|
||||
function ininPager() {
|
||||
try {
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
pager.pagination({
|
||||
onSelectPage: function (pageNum, pageSize) {
|
||||
opts.pageNumber = pageNum;
|
||||
opts.pageSize = pageSize;
|
||||
pager.pagination('refresh', {
|
||||
pageNumber: pageNum,
|
||||
pageSize: pageSize
|
||||
});
|
||||
showDetails(pageNum, pageSize);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
$.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
|
||||
}
|
||||
}
|
||||
|
||||
//增加
|
||||
var url;
|
||||
var personID = 0;
|
||||
//保存编辑前的名称
|
||||
var orgPerson = "";
|
||||
|
||||
//搜索处理
|
||||
function search() {
|
||||
showDetails(1, initPageSize);
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
opts.pageNumber = 1;
|
||||
opts.pageSize = initPageSize;
|
||||
pager.pagination('refresh', {
|
||||
pageNumber: 1,
|
||||
pageSize: initPageSize
|
||||
});
|
||||
}
|
||||
|
||||
$("#searchBtn").unbind().bind({
|
||||
click: function () {
|
||||
search();
|
||||
}
|
||||
});
|
||||
|
||||
function showDetails(pageNo, pageSize) {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/depotHead/findInDetail",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
currentPage: pageNo,
|
||||
pageSize: pageSize,
|
||||
organId: $('#OrganId').combobox('getValue'),
|
||||
projectId: $.trim($("#searchProjectId").val()),
|
||||
depotIds: depotString,
|
||||
beginTime: $("#searchBeginTime").val(),
|
||||
endTime: $("#searchEndTime").val(),
|
||||
type: "入库"
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200 && res.data) {
|
||||
$("#tableData").datagrid('loadData', res.data.rows);
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//报表打印
|
||||
function print() {
|
||||
$("#printBtn").off("click").on("click", function () {
|
||||
CreateFormPage('打印报表', $('#tableData'));
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@ -1,304 +1,303 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>入库汇总</title>
|
||||
<meta charset="utf-8">
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon"/>
|
||||
<script type="text/javascript" src="/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="/js/print/print.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="/css/common.css"/>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="/js/My97DatePicker/WdatePicker.js"></script>
|
||||
<script type="text/javascript" src="/js/common/common.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 查询 -->
|
||||
<div id="searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true"
|
||||
closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>供应商:</td>
|
||||
<td>
|
||||
<input id="OrganId" name="OrganId" style="width:120px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>仓库:</td>
|
||||
<td>
|
||||
<select name="searchProjectId" id="searchProjectId" style="width:100px;"></select>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>单据日期:</td>
|
||||
<td>
|
||||
<input type="text" name="searchBeginTime" id="searchBeginTime"
|
||||
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/>
|
||||
</td>
|
||||
<td>-</td>
|
||||
<td>
|
||||
<input type="text" name="searchEndTime" id="searchEndTime"
|
||||
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-print" id="printBtn">打印</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id="tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="入库汇总列表" iconCls="icon-list"
|
||||
collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var depotList = null;
|
||||
var depotID = null;
|
||||
var depotString = ""; //仓库列表
|
||||
var kid = sessionStorage.getItem("userId");
|
||||
var supUrl = "/supplier/findBySelect_sup"; //供应商接口
|
||||
//初始化界面
|
||||
$(function () {
|
||||
var thisDate = getNowFormatMonth(); //当前月份
|
||||
var thisDateTime = getNowFormatDateTime(); //当前时间
|
||||
$("#searchBeginTime").val(thisDate + "-01 00:00:00");
|
||||
$("#searchEndTime").val(thisDateTime);
|
||||
var userBusinessList = null;
|
||||
var userdepot = null;
|
||||
initSupplier(); //初始化供应商信息
|
||||
initSystemData_UB();
|
||||
initSelectInfo_UB();
|
||||
initSystemData_depot();
|
||||
initSelectInfo_depot();
|
||||
initTableData();
|
||||
ininPager();
|
||||
search();
|
||||
print();
|
||||
});
|
||||
|
||||
//初始化供应商
|
||||
function initSupplier() {
|
||||
$('#OrganId').combobox({
|
||||
url: supUrl,
|
||||
valueField: 'id',
|
||||
textField: 'supplier',
|
||||
filter: function (q, row) {
|
||||
var opts = $(this).combobox('options');
|
||||
return row[opts.textField].indexOf(q) > -1;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化系统基础信息
|
||||
function initSystemData_UB() {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/userBusiness/getBasicData",
|
||||
data: ({
|
||||
KeyId: kid,
|
||||
Type: "UserDepot"
|
||||
}),
|
||||
//设置为同步
|
||||
async: false,
|
||||
dataType: "json",
|
||||
success: function (res) {
|
||||
if (res && res.code === 200) {
|
||||
if(res.data) {
|
||||
userBusinessList = res.data.userBusinessList;
|
||||
}
|
||||
}
|
||||
else {
|
||||
userBusinessList = null;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
//初始化页面选项卡
|
||||
function initSelectInfo_UB() {
|
||||
|
||||
if (userBusinessList != null) {
|
||||
if (userBusinessList.length > 0) {
|
||||
//用户对应的仓库列表 [1][2][3]...
|
||||
userdepot = userBusinessList[0].value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//初始化系统基础信息
|
||||
function initSystemData_depot() {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/depot/getAllList",
|
||||
//设置为同步
|
||||
async: false,
|
||||
dataType: "json",
|
||||
success: function (res) {
|
||||
if(res && res.code === 200) {
|
||||
depotList = res.data;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化页面选项卡
|
||||
function initSelectInfo_depot() {
|
||||
var options = "";
|
||||
|
||||
if (depotList != null) {
|
||||
options = "";
|
||||
for (var i = 0; i < depotList.length; i++) {
|
||||
var depot = depotList[i];
|
||||
|
||||
if (userdepot != null) {
|
||||
if (userdepot.indexOf("[" + depot.id + "]") != -1) {
|
||||
options += '<option value="' + depot.id + '">' + depot.name + '</option>';
|
||||
depotString = depotString + depot.id + ",";
|
||||
}
|
||||
}
|
||||
}
|
||||
depotString = depotString.substring(0, depotString.length - 1);
|
||||
$("#searchProjectId").empty().append('<option value="">全部</option>').append(options);
|
||||
}
|
||||
}
|
||||
|
||||
//初始化表格数据
|
||||
function initTableData() {
|
||||
$('#tableData').datagrid({
|
||||
height: heightInfo,
|
||||
nowrap: false,
|
||||
rownumbers: true,
|
||||
//动画效果
|
||||
animate: false,
|
||||
//选中单行
|
||||
singleSelect: true,
|
||||
pagination: true,
|
||||
//交替出现背景
|
||||
striped: true,
|
||||
pageSize: 10,
|
||||
pageList: [10, 50, 100],
|
||||
columns: [[
|
||||
{title: '商品名称', field: 'mName', width: 150},
|
||||
{title: '商品型号', field: 'model', width: 150},
|
||||
{title: '商品类型', field: 'categoryName', width: 120},
|
||||
{title: '入库数量', field: 'numSum', width: 120},
|
||||
{title: '入库金额', field: 'priceSum', width: 120}
|
||||
]],
|
||||
onLoadError: function () {
|
||||
$.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化键盘enter事件
|
||||
$(document).keydown(function (event) {
|
||||
//兼容 IE和firefox 事件
|
||||
var e = window.event || event;
|
||||
var k = e.keyCode || e.which || e.charCode;
|
||||
//兼容 IE,firefox 兼容
|
||||
var obj = e.srcElement ? e.srcElement : e.target;
|
||||
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
|
||||
if (k == "13" && (obj.id == "Type" || obj.id == "Name")) {
|
||||
$("#savePerson").click();
|
||||
}
|
||||
//搜索按钮添加快捷键
|
||||
if (k == "13" && (obj.id == "searchType")) {
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
|
||||
//分页信息处理
|
||||
function ininPager() {
|
||||
try {
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
pager.pagination({
|
||||
onSelectPage: function (pageNum, pageSize) {
|
||||
opts.pageNumber = pageNum;
|
||||
opts.pageSize = pageSize;
|
||||
pager.pagination('refresh', {
|
||||
pageNumber: pageNum,
|
||||
pageSize: pageSize
|
||||
});
|
||||
showDetails(pageNum, pageSize);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
$.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
|
||||
}
|
||||
}
|
||||
|
||||
//增加
|
||||
var url;
|
||||
var personID = 0;
|
||||
//保存编辑前的名称
|
||||
var orgPerson = "";
|
||||
|
||||
//搜索处理
|
||||
function search() {
|
||||
showDetails(1, initPageSize);
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
opts.pageNumber = 1;
|
||||
opts.pageSize = initPageSize;
|
||||
pager.pagination('refresh', {
|
||||
pageNumber: 1,
|
||||
pageSize: initPageSize
|
||||
});
|
||||
}
|
||||
|
||||
$("#searchBtn").unbind().bind({
|
||||
click: function () {
|
||||
search();
|
||||
}
|
||||
});
|
||||
|
||||
function showDetails(pageNo, pageSize) {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/depotHead/findInOutMaterialCount",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
currentPage: pageNo,
|
||||
pageSize: pageSize,
|
||||
organId: $('#OrganId').combobox('getValue'),
|
||||
projectId: $.trim($("#searchProjectId").val()),
|
||||
depotIds: depotString,
|
||||
beginTime: $("#searchBeginTime").val(),
|
||||
endTime: $("#searchEndTime").val(),
|
||||
type: "入库"
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200 && res.data) {
|
||||
$("#tableData").datagrid('loadData', res.data.rows);
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//报表打印
|
||||
function print() {
|
||||
$("#printBtn").off("click").on("click", function () {
|
||||
var path = "<%=path %>";
|
||||
CreateFormPage('打印报表', $('#tableData'), path);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>入库汇总</title>
|
||||
<meta charset="utf-8">
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon"/>
|
||||
<script type="text/javascript" src="/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="/js/print/print.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="/css/common.css"/>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="/js/My97DatePicker/WdatePicker.js"></script>
|
||||
<script type="text/javascript" src="/js/common/common.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 查询 -->
|
||||
<div id="searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true"
|
||||
closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>供应商:</td>
|
||||
<td>
|
||||
<input id="OrganId" name="OrganId" style="width:120px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>仓库:</td>
|
||||
<td>
|
||||
<select name="searchProjectId" id="searchProjectId" style="width:100px;"></select>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>单据日期:</td>
|
||||
<td>
|
||||
<input type="text" name="searchBeginTime" id="searchBeginTime"
|
||||
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/>
|
||||
</td>
|
||||
<td>-</td>
|
||||
<td>
|
||||
<input type="text" name="searchEndTime" id="searchEndTime"
|
||||
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-print" id="printBtn">打印</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id="tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="入库汇总列表" iconCls="icon-list"
|
||||
collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var depotList = null;
|
||||
var depotID = null;
|
||||
var depotString = ""; //仓库列表
|
||||
var kid = sessionStorage.getItem("userId");
|
||||
var supUrl = "/supplier/findBySelect_sup"; //供应商接口
|
||||
//初始化界面
|
||||
$(function () {
|
||||
var thisDate = getNowFormatMonth(); //当前月份
|
||||
var thisDateTime = getNowFormatDateTime(); //当前时间
|
||||
$("#searchBeginTime").val(thisDate + "-01 00:00:00");
|
||||
$("#searchEndTime").val(thisDateTime);
|
||||
var userBusinessList = null;
|
||||
var userdepot = null;
|
||||
initSupplier(); //初始化供应商信息
|
||||
initSystemData_UB();
|
||||
initSelectInfo_UB();
|
||||
initSystemData_depot();
|
||||
initSelectInfo_depot();
|
||||
initTableData();
|
||||
ininPager();
|
||||
search();
|
||||
print();
|
||||
});
|
||||
|
||||
//初始化供应商
|
||||
function initSupplier() {
|
||||
$('#OrganId').combobox({
|
||||
url: supUrl,
|
||||
valueField: 'id',
|
||||
textField: 'supplier',
|
||||
filter: function (q, row) {
|
||||
var opts = $(this).combobox('options');
|
||||
return row[opts.textField].indexOf(q) > -1;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化系统基础信息
|
||||
function initSystemData_UB() {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/userBusiness/getBasicData",
|
||||
data: ({
|
||||
KeyId: kid,
|
||||
Type: "UserDepot"
|
||||
}),
|
||||
//设置为同步
|
||||
async: false,
|
||||
dataType: "json",
|
||||
success: function (res) {
|
||||
if (res && res.code === 200) {
|
||||
if(res.data) {
|
||||
userBusinessList = res.data.userBusinessList;
|
||||
}
|
||||
}
|
||||
else {
|
||||
userBusinessList = null;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
//初始化页面选项卡
|
||||
function initSelectInfo_UB() {
|
||||
|
||||
if (userBusinessList != null) {
|
||||
if (userBusinessList.length > 0) {
|
||||
//用户对应的仓库列表 [1][2][3]...
|
||||
userdepot = userBusinessList[0].value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//初始化系统基础信息
|
||||
function initSystemData_depot() {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/depot/getAllList",
|
||||
//设置为同步
|
||||
async: false,
|
||||
dataType: "json",
|
||||
success: function (res) {
|
||||
if(res && res.code === 200) {
|
||||
depotList = res.data;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化页面选项卡
|
||||
function initSelectInfo_depot() {
|
||||
var options = "";
|
||||
|
||||
if (depotList != null) {
|
||||
options = "";
|
||||
for (var i = 0; i < depotList.length; i++) {
|
||||
var depot = depotList[i];
|
||||
|
||||
if (userdepot != null) {
|
||||
if (userdepot.indexOf("[" + depot.id + "]") != -1) {
|
||||
options += '<option value="' + depot.id + '">' + depot.name + '</option>';
|
||||
depotString = depotString + depot.id + ",";
|
||||
}
|
||||
}
|
||||
}
|
||||
depotString = depotString.substring(0, depotString.length - 1);
|
||||
$("#searchProjectId").empty().append('<option value="">全部</option>').append(options);
|
||||
}
|
||||
}
|
||||
|
||||
//初始化表格数据
|
||||
function initTableData() {
|
||||
$('#tableData').datagrid({
|
||||
height: heightInfo,
|
||||
nowrap: false,
|
||||
rownumbers: true,
|
||||
//动画效果
|
||||
animate: false,
|
||||
//选中单行
|
||||
singleSelect: true,
|
||||
pagination: true,
|
||||
//交替出现背景
|
||||
striped: true,
|
||||
pageSize: 10,
|
||||
pageList: [10, 50, 100],
|
||||
columns: [[
|
||||
{title: '商品名称', field: 'mName', width: 150},
|
||||
{title: '商品型号', field: 'model', width: 150},
|
||||
{title: '商品类型', field: 'categoryName', width: 120},
|
||||
{title: '入库数量', field: 'numSum', width: 120},
|
||||
{title: '入库金额', field: 'priceSum', width: 120}
|
||||
]],
|
||||
onLoadError: function () {
|
||||
$.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化键盘enter事件
|
||||
$(document).keydown(function (event) {
|
||||
//兼容 IE和firefox 事件
|
||||
var e = window.event || event;
|
||||
var k = e.keyCode || e.which || e.charCode;
|
||||
//兼容 IE,firefox 兼容
|
||||
var obj = e.srcElement ? e.srcElement : e.target;
|
||||
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
|
||||
if (k == "13" && (obj.id == "Type" || obj.id == "Name")) {
|
||||
$("#savePerson").click();
|
||||
}
|
||||
//搜索按钮添加快捷键
|
||||
if (k == "13" && (obj.id == "searchType")) {
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
|
||||
//分页信息处理
|
||||
function ininPager() {
|
||||
try {
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
pager.pagination({
|
||||
onSelectPage: function (pageNum, pageSize) {
|
||||
opts.pageNumber = pageNum;
|
||||
opts.pageSize = pageSize;
|
||||
pager.pagination('refresh', {
|
||||
pageNumber: pageNum,
|
||||
pageSize: pageSize
|
||||
});
|
||||
showDetails(pageNum, pageSize);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
$.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
|
||||
}
|
||||
}
|
||||
|
||||
//增加
|
||||
var url;
|
||||
var personID = 0;
|
||||
//保存编辑前的名称
|
||||
var orgPerson = "";
|
||||
|
||||
//搜索处理
|
||||
function search() {
|
||||
showDetails(1, initPageSize);
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
opts.pageNumber = 1;
|
||||
opts.pageSize = initPageSize;
|
||||
pager.pagination('refresh', {
|
||||
pageNumber: 1,
|
||||
pageSize: initPageSize
|
||||
});
|
||||
}
|
||||
|
||||
$("#searchBtn").unbind().bind({
|
||||
click: function () {
|
||||
search();
|
||||
}
|
||||
});
|
||||
|
||||
function showDetails(pageNo, pageSize) {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/depotHead/findInOutMaterialCount",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
currentPage: pageNo,
|
||||
pageSize: pageSize,
|
||||
organId: $('#OrganId').combobox('getValue'),
|
||||
projectId: $.trim($("#searchProjectId").val()),
|
||||
depotIds: depotString,
|
||||
beginTime: $("#searchBeginTime").val(),
|
||||
endTime: $("#searchEndTime").val(),
|
||||
type: "入库"
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200 && res.data) {
|
||||
$("#tableData").datagrid('loadData', res.data.rows);
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//报表打印
|
||||
function print() {
|
||||
$("#printBtn").off("click").on("click", function () {
|
||||
CreateFormPage('打印报表', $('#tableData'));
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@ -1,420 +1,419 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>库存状况</title>
|
||||
<meta charset="utf-8">
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon"/>
|
||||
<script type="text/javascript" src="/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="/js/print/print.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="/css/common.css"/>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="/js/My97DatePicker/WdatePicker.js"></script>
|
||||
<script type="text/javascript" src="/js/common/common.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 查询 -->
|
||||
<div id="searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true"
|
||||
closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>仓库:</td>
|
||||
<td>
|
||||
<select name="searchProjectId" id="searchProjectId" style="width:80px;"></select>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>月份:</td>
|
||||
<td>
|
||||
<input type="text" name="searchMonth" id="searchMonth" onClick="WdatePicker({dateFmt:'yyyy-MM'})"
|
||||
class="txt Wdate" style="width:180px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" id="exprotBtn">导出</a>
|
||||
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-print" id="printBtn">打印</a>
|
||||
<span class="total-count"></span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id="tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="库存状况列表" iconCls="icon-list"
|
||||
collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var depotList = null;
|
||||
var depotID = null;
|
||||
var mPropertyList = ""; //商品属性列表
|
||||
var kid = sessionStorage.getItem("userId");
|
||||
//初始化界面
|
||||
$(function () {
|
||||
var thisDate = getNowFormatMonth(); //当前月份
|
||||
$("#searchMonth").val(thisDate);
|
||||
var userBusinessList = null;
|
||||
var userdepot = null;
|
||||
initSystemData_UB();
|
||||
initSelectInfo_UB();
|
||||
initSystemData_depot();
|
||||
initSelectInfo_depot();
|
||||
initMProperty(); //初始化商品属性
|
||||
initTableData();
|
||||
ininPager();
|
||||
search();
|
||||
exportExcel();
|
||||
print();
|
||||
});
|
||||
|
||||
//导出EXCEL
|
||||
function exportExcel() {
|
||||
$("#exprotBtn").off("click").on("click", function () {
|
||||
if (!$("#searchPanel .total-count").text()) {
|
||||
$.messager.alert('导出提示', '请先选择月份再进行查询!', 'error');
|
||||
}
|
||||
else {
|
||||
showEachDetails(1, 3000);
|
||||
//此处直接去做get请求,用下面的查询每月统计的方法,去获取list,参数长度虽长,但还是可以用get
|
||||
//window.location.href = "/depotItem/exportExcel.action?browserType=" + getOs();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化系统基础信息
|
||||
function initSystemData_UB() {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/userBusiness/getBasicData",
|
||||
data: ({
|
||||
KeyId: kid,
|
||||
Type: "UserDepot"
|
||||
}),
|
||||
//设置为同步
|
||||
async: false,
|
||||
dataType: "json",
|
||||
success: function (res) {
|
||||
if (res && res.code === 200) {
|
||||
if(res.data) {
|
||||
userBusinessList = res.data.userBusinessList;
|
||||
}
|
||||
}
|
||||
else {
|
||||
userBusinessList = null;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
//初始化页面选项卡
|
||||
function initSelectInfo_UB() {
|
||||
|
||||
if (userBusinessList != null) {
|
||||
if (userBusinessList.length > 0) {
|
||||
//用户对应的仓库列表 [1][2][3]...
|
||||
userdepot = userBusinessList[0].value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//初始化系统基础信息
|
||||
function initSystemData_depot() {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/depot/getAllList",
|
||||
//设置为同步
|
||||
async: false,
|
||||
dataType: "json",
|
||||
success: function (res) {
|
||||
if(res && res.code === 200) {
|
||||
depotList = res.data;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化页面选项卡
|
||||
function initSelectInfo_depot() {
|
||||
var options = "";
|
||||
|
||||
if (depotList != null) {
|
||||
options = "";
|
||||
for (var i = 0; i < depotList.length; i++) {
|
||||
var depot = depotList[i];
|
||||
|
||||
if (userdepot != null) {
|
||||
if (userdepot.indexOf("[" + depot.id + "]") != -1) {
|
||||
options += '<option value="' + depot.id + '">' + depot.name + '</option>';
|
||||
}
|
||||
}
|
||||
}
|
||||
$("#searchProjectId").empty().append(options);
|
||||
}
|
||||
}
|
||||
|
||||
//初始化商品属性
|
||||
function initMProperty() {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/materialProperty/list",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
search: JSON.stringify({
|
||||
name: ""
|
||||
}),
|
||||
currentPage: 1,
|
||||
pageSize: 100
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200){
|
||||
var thisRows = res.data.page.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({
|
||||
height: heightInfo,
|
||||
nowrap: false,
|
||||
rownumbers: true,
|
||||
//动画效果
|
||||
animate: false,
|
||||
//选中单行
|
||||
singleSelect: true,
|
||||
pagination: true,
|
||||
//交替出现背景
|
||||
striped: true,
|
||||
//loadFilter: pagerFilter,
|
||||
pageSize: 10,
|
||||
pageList: [10, 50, 100],
|
||||
columns: [[
|
||||
{title: '名称', field: 'MaterialName', width: 60},
|
||||
{title: '型号', field: 'MaterialModel', width: 80},
|
||||
{title: '扩展信息', field: 'MaterialOther', width: 150},
|
||||
{title: '单位', field: 'MaterialUnit', width: 80},
|
||||
{
|
||||
title: '单价', field: 'UnitPrice', width: 60, formatter: function (value, row, index) {
|
||||
return value.toFixed(2);
|
||||
}
|
||||
},
|
||||
{title: '上月结存数量', field: 'prevSum', width: 80},
|
||||
{title: '入库数量', field: 'InSum', width: 60},
|
||||
{title: '出库数量', field: 'OutSum', width: 60},
|
||||
{title: '本月结存数量', field: 'thisSum', width: 80},
|
||||
{
|
||||
title: '结存金额', field: 'thisAllPrice', width: 60,
|
||||
formatter: function (value, row, index) {
|
||||
return value.toFixed(2);
|
||||
}
|
||||
}
|
||||
]],
|
||||
onLoadError: function () {
|
||||
$.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化键盘enter事件
|
||||
$(document).keydown(function (event) {
|
||||
//兼容 IE和firefox 事件
|
||||
var e = window.event || event;
|
||||
var k = e.keyCode || e.which || e.charCode;
|
||||
//兼容 IE,firefox 兼容
|
||||
var obj = e.srcElement ? e.srcElement : e.target;
|
||||
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
|
||||
if (k == "13" && (obj.id == "Type" || obj.id == "Name")) {
|
||||
$("#savePerson").click();
|
||||
}
|
||||
//搜索按钮添加快捷键
|
||||
if (k == "13" && (obj.id == "searchType")) {
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
|
||||
//分页信息处理
|
||||
function ininPager() {
|
||||
try {
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
pager.pagination({
|
||||
onSelectPage: function (pageNum, pageSize) {
|
||||
opts.pageNumber = pageNum;
|
||||
opts.pageSize = pageSize;
|
||||
pager.pagination('refresh', {
|
||||
pageNumber: pageNum,
|
||||
pageSize: pageSize
|
||||
});
|
||||
showEachDetails(pageNum, pageSize);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
$.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
|
||||
}
|
||||
}
|
||||
|
||||
//增加
|
||||
var url;
|
||||
var personID = 0;
|
||||
//保存编辑前的名称
|
||||
var orgPerson = "";
|
||||
|
||||
//搜索处理
|
||||
function search() {
|
||||
showEachDetails(1, initPageSize);
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
opts.pageNumber = 1;
|
||||
opts.pageSize = initPageSize;
|
||||
pager.pagination('refresh', {
|
||||
pageNumber: 1,
|
||||
pageSize: initPageSize
|
||||
});
|
||||
}
|
||||
|
||||
$("#searchBtn").unbind().bind({
|
||||
click: function () {
|
||||
search();
|
||||
}
|
||||
});
|
||||
|
||||
function showEachDetails(pageNo, pageSize) {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/depotHead/findByMonth",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
monthTime: $("#searchMonth").val()
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200 && res.data) {
|
||||
var HeadIds = res.data.HeadIds;
|
||||
if (HeadIds) {
|
||||
//获取排序后的产品ID
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/material/findByOrder",
|
||||
dataType: "json",
|
||||
success: function (res) {
|
||||
if(res && res.code === 200 && res.data) {
|
||||
var mIds = res.data.mIds;
|
||||
if (mIds) {
|
||||
if (pageSize === 3000) {
|
||||
window.location.href = "/depotItem/exportExcel.action?browserType=" + getOs() + "&pageNo=" + pageNo + "&pageSize=" + pageSize + "&ProjectId=" + $.trim($("#searchProjectId").val()) + "&MonthTime=" + $("#searchMonth").val() + "&HeadIds=" + HeadIds + "&MaterialIds=" + MIds;
|
||||
}
|
||||
else {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/depotItem/findByAll",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
currentPage: pageNo,
|
||||
pageSize: pageSize,
|
||||
projectId: $.trim($("#searchProjectId").val()),
|
||||
monthTime: $("#searchMonth").val(),
|
||||
headIds: HeadIds,
|
||||
materialIds: mIds,
|
||||
mpList: mPropertyList
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200) {
|
||||
$("#tableData").datagrid('loadData', res.data);
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
//总金额
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/depotItem/totalCountMoney",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
projectId: $.trim($("#searchProjectId").val()),
|
||||
monthTime: $("#searchMonth").val(),
|
||||
headIds: HeadIds,
|
||||
materialIds: mIds
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200) {
|
||||
if(res.data && res.data.totalCount) {
|
||||
var count = res.data.totalCount.toString();
|
||||
if (count.lastIndexOf('.') > -1) {
|
||||
count = count.substring(0, count.lastIndexOf('.') + 3);
|
||||
}
|
||||
$("#searchPanel .total-count").text("本月合计金额:" + count + "元");//本月合计金额
|
||||
}
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
else {
|
||||
$.messager.alert('查询提示', '本月无数据!', 'error');
|
||||
}
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
$.messager.alert('查询提示', '本月无数据!', 'error');
|
||||
}
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//报表打印
|
||||
function print() {
|
||||
$("#printBtn").off("click").on("click", function () {
|
||||
var path = "<%=path %>";
|
||||
CreateFormPage('打印报表', $('#tableData'), path);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>库存状况</title>
|
||||
<meta charset="utf-8">
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon"/>
|
||||
<script type="text/javascript" src="/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="/js/print/print.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="/css/common.css"/>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="/js/My97DatePicker/WdatePicker.js"></script>
|
||||
<script type="text/javascript" src="/js/common/common.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 查询 -->
|
||||
<div id="searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true"
|
||||
closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>仓库:</td>
|
||||
<td>
|
||||
<select name="searchProjectId" id="searchProjectId" style="width:80px;"></select>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>月份:</td>
|
||||
<td>
|
||||
<input type="text" name="searchMonth" id="searchMonth" onClick="WdatePicker({dateFmt:'yyyy-MM'})"
|
||||
class="txt Wdate" style="width:180px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" id="exprotBtn">导出</a>
|
||||
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-print" id="printBtn">打印</a>
|
||||
<span class="total-count"></span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id="tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="库存状况列表" iconCls="icon-list"
|
||||
collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var depotList = null;
|
||||
var depotID = null;
|
||||
var mPropertyList = ""; //商品属性列表
|
||||
var kid = sessionStorage.getItem("userId");
|
||||
//初始化界面
|
||||
$(function () {
|
||||
var thisDate = getNowFormatMonth(); //当前月份
|
||||
$("#searchMonth").val(thisDate);
|
||||
var userBusinessList = null;
|
||||
var userdepot = null;
|
||||
initSystemData_UB();
|
||||
initSelectInfo_UB();
|
||||
initSystemData_depot();
|
||||
initSelectInfo_depot();
|
||||
initMProperty(); //初始化商品属性
|
||||
initTableData();
|
||||
ininPager();
|
||||
search();
|
||||
exportExcel();
|
||||
print();
|
||||
});
|
||||
|
||||
//导出EXCEL
|
||||
function exportExcel() {
|
||||
$("#exprotBtn").off("click").on("click", function () {
|
||||
if (!$("#searchPanel .total-count").text()) {
|
||||
$.messager.alert('导出提示', '请先选择月份再进行查询!', 'error');
|
||||
}
|
||||
else {
|
||||
showEachDetails(1, 3000);
|
||||
//此处直接去做get请求,用下面的查询每月统计的方法,去获取list,参数长度虽长,但还是可以用get
|
||||
//window.location.href = "/depotItem/exportExcel.action?browserType=" + getOs();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化系统基础信息
|
||||
function initSystemData_UB() {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/userBusiness/getBasicData",
|
||||
data: ({
|
||||
KeyId: kid,
|
||||
Type: "UserDepot"
|
||||
}),
|
||||
//设置为同步
|
||||
async: false,
|
||||
dataType: "json",
|
||||
success: function (res) {
|
||||
if (res && res.code === 200) {
|
||||
if(res.data) {
|
||||
userBusinessList = res.data.userBusinessList;
|
||||
}
|
||||
}
|
||||
else {
|
||||
userBusinessList = null;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
//初始化页面选项卡
|
||||
function initSelectInfo_UB() {
|
||||
|
||||
if (userBusinessList != null) {
|
||||
if (userBusinessList.length > 0) {
|
||||
//用户对应的仓库列表 [1][2][3]...
|
||||
userdepot = userBusinessList[0].value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//初始化系统基础信息
|
||||
function initSystemData_depot() {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/depot/getAllList",
|
||||
//设置为同步
|
||||
async: false,
|
||||
dataType: "json",
|
||||
success: function (res) {
|
||||
if(res && res.code === 200) {
|
||||
depotList = res.data;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化页面选项卡
|
||||
function initSelectInfo_depot() {
|
||||
var options = "";
|
||||
|
||||
if (depotList != null) {
|
||||
options = "";
|
||||
for (var i = 0; i < depotList.length; i++) {
|
||||
var depot = depotList[i];
|
||||
|
||||
if (userdepot != null) {
|
||||
if (userdepot.indexOf("[" + depot.id + "]") != -1) {
|
||||
options += '<option value="' + depot.id + '">' + depot.name + '</option>';
|
||||
}
|
||||
}
|
||||
}
|
||||
$("#searchProjectId").empty().append(options);
|
||||
}
|
||||
}
|
||||
|
||||
//初始化商品属性
|
||||
function initMProperty() {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/materialProperty/list",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
search: JSON.stringify({
|
||||
name: ""
|
||||
}),
|
||||
currentPage: 1,
|
||||
pageSize: 100
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200){
|
||||
var thisRows = res.data.page.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({
|
||||
height: heightInfo,
|
||||
nowrap: false,
|
||||
rownumbers: true,
|
||||
//动画效果
|
||||
animate: false,
|
||||
//选中单行
|
||||
singleSelect: true,
|
||||
pagination: true,
|
||||
//交替出现背景
|
||||
striped: true,
|
||||
//loadFilter: pagerFilter,
|
||||
pageSize: 10,
|
||||
pageList: [10, 50, 100],
|
||||
columns: [[
|
||||
{title: '名称', field: 'MaterialName', width: 60},
|
||||
{title: '型号', field: 'MaterialModel', width: 80},
|
||||
{title: '扩展信息', field: 'MaterialOther', width: 150},
|
||||
{title: '单位', field: 'MaterialUnit', width: 80},
|
||||
{
|
||||
title: '单价', field: 'UnitPrice', width: 60, formatter: function (value, row, index) {
|
||||
return value.toFixed(2);
|
||||
}
|
||||
},
|
||||
{title: '上月结存数量', field: 'prevSum', width: 80},
|
||||
{title: '入库数量', field: 'InSum', width: 60},
|
||||
{title: '出库数量', field: 'OutSum', width: 60},
|
||||
{title: '本月结存数量', field: 'thisSum', width: 80},
|
||||
{
|
||||
title: '结存金额', field: 'thisAllPrice', width: 60,
|
||||
formatter: function (value, row, index) {
|
||||
return value.toFixed(2);
|
||||
}
|
||||
}
|
||||
]],
|
||||
onLoadError: function () {
|
||||
$.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化键盘enter事件
|
||||
$(document).keydown(function (event) {
|
||||
//兼容 IE和firefox 事件
|
||||
var e = window.event || event;
|
||||
var k = e.keyCode || e.which || e.charCode;
|
||||
//兼容 IE,firefox 兼容
|
||||
var obj = e.srcElement ? e.srcElement : e.target;
|
||||
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
|
||||
if (k == "13" && (obj.id == "Type" || obj.id == "Name")) {
|
||||
$("#savePerson").click();
|
||||
}
|
||||
//搜索按钮添加快捷键
|
||||
if (k == "13" && (obj.id == "searchType")) {
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
|
||||
//分页信息处理
|
||||
function ininPager() {
|
||||
try {
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
pager.pagination({
|
||||
onSelectPage: function (pageNum, pageSize) {
|
||||
opts.pageNumber = pageNum;
|
||||
opts.pageSize = pageSize;
|
||||
pager.pagination('refresh', {
|
||||
pageNumber: pageNum,
|
||||
pageSize: pageSize
|
||||
});
|
||||
showEachDetails(pageNum, pageSize);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
$.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
|
||||
}
|
||||
}
|
||||
|
||||
//增加
|
||||
var url;
|
||||
var personID = 0;
|
||||
//保存编辑前的名称
|
||||
var orgPerson = "";
|
||||
|
||||
//搜索处理
|
||||
function search() {
|
||||
showEachDetails(1, initPageSize);
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
opts.pageNumber = 1;
|
||||
opts.pageSize = initPageSize;
|
||||
pager.pagination('refresh', {
|
||||
pageNumber: 1,
|
||||
pageSize: initPageSize
|
||||
});
|
||||
}
|
||||
|
||||
$("#searchBtn").unbind().bind({
|
||||
click: function () {
|
||||
search();
|
||||
}
|
||||
});
|
||||
|
||||
function showEachDetails(pageNo, pageSize) {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/depotHead/findByMonth",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
monthTime: $("#searchMonth").val()
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200 && res.data) {
|
||||
var HeadIds = res.data.HeadIds;
|
||||
if (HeadIds) {
|
||||
//获取排序后的产品ID
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/material/findByOrder",
|
||||
dataType: "json",
|
||||
success: function (res) {
|
||||
if(res && res.code === 200 && res.data) {
|
||||
var mIds = res.data.mIds;
|
||||
if (mIds) {
|
||||
if (pageSize === 3000) {
|
||||
window.location.href = "/depotItem/exportExcel?browserType=" + getOs() + "¤tPage=" + pageNo + "&pageSize=" + pageSize + "&projectId=" + $.trim($("#searchProjectId").val()) + "&monthTime=" + $("#searchMonth").val() + "&headIds=" + HeadIds + "&materialIds=" + mIds;
|
||||
}
|
||||
else {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/depotItem/findByAll",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
currentPage: pageNo,
|
||||
pageSize: pageSize,
|
||||
projectId: $.trim($("#searchProjectId").val()),
|
||||
monthTime: $("#searchMonth").val(),
|
||||
headIds: HeadIds,
|
||||
materialIds: mIds,
|
||||
mpList: mPropertyList
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200) {
|
||||
$("#tableData").datagrid('loadData', res.data);
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
//总金额
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/depotItem/totalCountMoney",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
projectId: $.trim($("#searchProjectId").val()),
|
||||
monthTime: $("#searchMonth").val(),
|
||||
headIds: HeadIds,
|
||||
materialIds: mIds
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200) {
|
||||
if(res.data && res.data.totalCount) {
|
||||
var count = res.data.totalCount.toString();
|
||||
if (count.lastIndexOf('.') > -1) {
|
||||
count = count.substring(0, count.lastIndexOf('.') + 3);
|
||||
}
|
||||
$("#searchPanel .total-count").text("本月合计金额:" + count + "元");//本月合计金额
|
||||
}
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
else {
|
||||
$.messager.alert('查询提示', '本月无数据!', 'error');
|
||||
}
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
$.messager.alert('查询提示', '本月无数据!', 'error');
|
||||
}
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//报表打印
|
||||
function print() {
|
||||
$("#printBtn").off("click").on("click", function () {
|
||||
CreateFormPage('打印报表', $('#tableData'));
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@ -1,315 +1,314 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>出库明细</title>
|
||||
<meta charset="utf-8">
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon"/>
|
||||
<script type="text/javascript" src="/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="/js/print/print.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="/css/common.css"/>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="/js/common/outlook_in.js"></script>
|
||||
<script type="text/javascript" src="/js/My97DatePicker/WdatePicker.js"></script>
|
||||
<script type="text/javascript" src="/js/common/common.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 查询 -->
|
||||
<div id="searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true"
|
||||
closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>客户:</td>
|
||||
<td>
|
||||
<input id="OrganId" name="OrganId" style="width:120px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>仓库:</td>
|
||||
<td>
|
||||
<select name="searchProjectId" id="searchProjectId" style="width:100px;"></select>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>单据日期:</td>
|
||||
<td>
|
||||
<input type="text" name="searchBeginTime" id="searchBeginTime"
|
||||
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/>
|
||||
</td>
|
||||
<td>-</td>
|
||||
<td>
|
||||
<input type="text" name="searchEndTime" id="searchEndTime"
|
||||
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-print" id="printBtn">打印</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id="tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="出库明细列表" iconCls="icon-list"
|
||||
collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var depotList = null;
|
||||
var depotID = null;
|
||||
var depotString = ""; //仓库列表
|
||||
var uid = sessionStorage.getItem("userId");
|
||||
var cusUrl = "/supplier/findBySelect_cus?UBType=UserCustomer&UBKeyId=" + uid; //客户接口
|
||||
//初始化界面
|
||||
$(function () {
|
||||
var thisDate = getNowFormatMonth(); //当前月份
|
||||
var thisDateTime = getNowFormatDateTime(); //当前时间
|
||||
$("#searchBeginTime").val(thisDate + "-01 00:00:00");
|
||||
$("#searchEndTime").val(thisDateTime);
|
||||
var userBusinessList = null;
|
||||
var userdepot = null;
|
||||
initSupplier(); //初始化客户信息
|
||||
initSystemData_UB();
|
||||
initSelectInfo_UB();
|
||||
initSystemData_depot();
|
||||
initSelectInfo_depot();
|
||||
initTableData();
|
||||
ininPager();
|
||||
search();
|
||||
print();
|
||||
});
|
||||
|
||||
//初始化客户
|
||||
function initSupplier() {
|
||||
$('#OrganId').combobox({
|
||||
url: cusUrl,
|
||||
valueField: 'id',
|
||||
textField: 'supplier',
|
||||
filter: function (q, row) {
|
||||
var opts = $(this).combobox('options');
|
||||
return row[opts.textField].indexOf(q) > -1;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化系统基础信息
|
||||
function initSystemData_UB() {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/userBusiness/getBasicData",
|
||||
data: ({
|
||||
KeyId: uid,
|
||||
Type: "UserDepot"
|
||||
}),
|
||||
//设置为同步
|
||||
async: false,
|
||||
dataType: "json",
|
||||
success: function (res) {
|
||||
if (res && res.code === 200) {
|
||||
if(res.data) {
|
||||
userBusinessList = res.data.userBusinessList;
|
||||
}
|
||||
}
|
||||
else {
|
||||
userBusinessList = null;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
//初始化页面选项卡
|
||||
function initSelectInfo_UB() {
|
||||
|
||||
if (userBusinessList != null) {
|
||||
if (userBusinessList.length > 0) {
|
||||
//用户对应的仓库列表 [1][2][3]...
|
||||
userdepot = userBusinessList[0].value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//初始化系统基础信息
|
||||
function initSystemData_depot() {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/depot/getAllList",
|
||||
//设置为同步
|
||||
async: false,
|
||||
dataType: "json",
|
||||
success: function (res) {
|
||||
if(res && res.code === 200) {
|
||||
depotList = res.data;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化页面选项卡
|
||||
function initSelectInfo_depot() {
|
||||
var options = "";
|
||||
|
||||
if (depotList != null) {
|
||||
options = "";
|
||||
for (var i = 0; i < depotList.length; i++) {
|
||||
var depot = depotList[i];
|
||||
|
||||
if (userdepot != null) {
|
||||
if (userdepot.indexOf("[" + depot.id + "]") != -1) {
|
||||
options += '<option value="' + depot.id + '">' + depot.name + '</option>';
|
||||
depotString = depotString + depot.id + ",";
|
||||
}
|
||||
}
|
||||
}
|
||||
depotString = depotString.substring(0, depotString.length - 1);
|
||||
$("#searchProjectId").empty().append('<option value="">全部</option>').append(options);
|
||||
}
|
||||
}
|
||||
|
||||
//初始化表格数据
|
||||
function initTableData() {
|
||||
$('#tableData').datagrid({
|
||||
height: heightInfo,
|
||||
nowrap: false,
|
||||
rownumbers: true,
|
||||
//动画效果
|
||||
animate: false,
|
||||
//选中单行
|
||||
singleSelect: true,
|
||||
pagination: true,
|
||||
//交替出现背景
|
||||
striped: true,
|
||||
pageSize: 10,
|
||||
pageList: [10, 50, 100],
|
||||
columns: [[
|
||||
{
|
||||
title: '单据编号', field: 'number', width: 140,
|
||||
formatter: function (value, row) {
|
||||
return "<a class='n-link' onclick=\"newTab('" + row.number + "','../materials/bill_detail.html?n=" + row.number + "&type=" + row.newType + "','')\">"
|
||||
+ row.number + "</a>";
|
||||
}
|
||||
},
|
||||
{title: '商品名称', field: 'mname', width: 120},
|
||||
{title: '商品型号', field: 'model', width: 100},
|
||||
{title: '单价', field: 'unitPrice', width: 60},
|
||||
{title: '出库数量', field: 'operNumber', width: 60},
|
||||
{title: '金额', field: 'allPrice', width: 60},
|
||||
{title: '客户', field: 'sname', width: 200},
|
||||
{title: '仓库', field: 'dname', width: 120},
|
||||
{title: '出库日期', field: 'operTime', width: 80}
|
||||
]],
|
||||
onLoadError: function () {
|
||||
$.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化键盘enter事件
|
||||
$(document).keydown(function (event) {
|
||||
//兼容 IE和firefox 事件
|
||||
var e = window.event || event;
|
||||
var k = e.keyCode || e.which || e.charCode;
|
||||
//兼容 IE,firefox 兼容
|
||||
var obj = e.srcElement ? e.srcElement : e.target;
|
||||
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
|
||||
if (k == "13" && (obj.id == "Type" || obj.id == "Name")) {
|
||||
$("#savePerson").click();
|
||||
}
|
||||
//搜索按钮添加快捷键
|
||||
if (k == "13" && (obj.id == "searchType")) {
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
|
||||
//分页信息处理
|
||||
function ininPager() {
|
||||
try {
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
pager.pagination({
|
||||
onSelectPage: function (pageNum, pageSize) {
|
||||
opts.pageNumber = pageNum;
|
||||
opts.pageSize = pageSize;
|
||||
pager.pagination('refresh', {
|
||||
pageNumber: pageNum,
|
||||
pageSize: pageSize
|
||||
});
|
||||
showDetails(pageNum, pageSize);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
$.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
|
||||
}
|
||||
}
|
||||
|
||||
//增加
|
||||
var url;
|
||||
var personID = 0;
|
||||
//保存编辑前的名称
|
||||
var orgPerson = "";
|
||||
|
||||
//搜索处理
|
||||
function search() {
|
||||
showDetails(1, initPageSize);
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
opts.pageNumber = 1;
|
||||
opts.pageSize = initPageSize;
|
||||
pager.pagination('refresh', {
|
||||
pageNumber: 1,
|
||||
pageSize: initPageSize
|
||||
});
|
||||
}
|
||||
|
||||
$("#searchBtn").unbind().bind({
|
||||
click: function () {
|
||||
search();
|
||||
}
|
||||
});
|
||||
|
||||
function showDetails(pageNo, pageSize) {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/depotHead/findInDetail",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
currentPage: pageNo,
|
||||
pageSize: pageSize,
|
||||
organId: $('#OrganId').combobox('getValue'),
|
||||
projectId: $.trim($("#searchProjectId").val()),
|
||||
depotIds: depotString,
|
||||
beginTime: $("#searchBeginTime").val(),
|
||||
endTime: $("#searchEndTime").val(),
|
||||
type: "出库"
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200 && res.data) {
|
||||
$("#tableData").datagrid('loadData', res.data.rows);
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//报表打印
|
||||
function print() {
|
||||
$("#printBtn").off("click").on("click", function () {
|
||||
var path = "<%=path %>";
|
||||
CreateFormPage('打印报表', $('#tableData'), path);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>出库明细</title>
|
||||
<meta charset="utf-8">
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon"/>
|
||||
<script type="text/javascript" src="/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="/js/print/print.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="/css/common.css"/>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="/js/common/outlook_in.js"></script>
|
||||
<script type="text/javascript" src="/js/My97DatePicker/WdatePicker.js"></script>
|
||||
<script type="text/javascript" src="/js/common/common.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 查询 -->
|
||||
<div id="searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true"
|
||||
closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>客户:</td>
|
||||
<td>
|
||||
<input id="OrganId" name="OrganId" style="width:120px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>仓库:</td>
|
||||
<td>
|
||||
<select name="searchProjectId" id="searchProjectId" style="width:100px;"></select>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>单据日期:</td>
|
||||
<td>
|
||||
<input type="text" name="searchBeginTime" id="searchBeginTime"
|
||||
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/>
|
||||
</td>
|
||||
<td>-</td>
|
||||
<td>
|
||||
<input type="text" name="searchEndTime" id="searchEndTime"
|
||||
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-print" id="printBtn">打印</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id="tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="出库明细列表" iconCls="icon-list"
|
||||
collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var depotList = null;
|
||||
var depotID = null;
|
||||
var depotString = ""; //仓库列表
|
||||
var uid = sessionStorage.getItem("userId");
|
||||
var cusUrl = "/supplier/findBySelect_cus?UBType=UserCustomer&UBKeyId=" + uid; //客户接口
|
||||
//初始化界面
|
||||
$(function () {
|
||||
var thisDate = getNowFormatMonth(); //当前月份
|
||||
var thisDateTime = getNowFormatDateTime(); //当前时间
|
||||
$("#searchBeginTime").val(thisDate + "-01 00:00:00");
|
||||
$("#searchEndTime").val(thisDateTime);
|
||||
var userBusinessList = null;
|
||||
var userdepot = null;
|
||||
initSupplier(); //初始化客户信息
|
||||
initSystemData_UB();
|
||||
initSelectInfo_UB();
|
||||
initSystemData_depot();
|
||||
initSelectInfo_depot();
|
||||
initTableData();
|
||||
ininPager();
|
||||
search();
|
||||
print();
|
||||
});
|
||||
|
||||
//初始化客户
|
||||
function initSupplier() {
|
||||
$('#OrganId').combobox({
|
||||
url: cusUrl,
|
||||
valueField: 'id',
|
||||
textField: 'supplier',
|
||||
filter: function (q, row) {
|
||||
var opts = $(this).combobox('options');
|
||||
return row[opts.textField].indexOf(q) > -1;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化系统基础信息
|
||||
function initSystemData_UB() {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/userBusiness/getBasicData",
|
||||
data: ({
|
||||
KeyId: uid,
|
||||
Type: "UserDepot"
|
||||
}),
|
||||
//设置为同步
|
||||
async: false,
|
||||
dataType: "json",
|
||||
success: function (res) {
|
||||
if (res && res.code === 200) {
|
||||
if(res.data) {
|
||||
userBusinessList = res.data.userBusinessList;
|
||||
}
|
||||
}
|
||||
else {
|
||||
userBusinessList = null;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
//初始化页面选项卡
|
||||
function initSelectInfo_UB() {
|
||||
|
||||
if (userBusinessList != null) {
|
||||
if (userBusinessList.length > 0) {
|
||||
//用户对应的仓库列表 [1][2][3]...
|
||||
userdepot = userBusinessList[0].value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//初始化系统基础信息
|
||||
function initSystemData_depot() {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/depot/getAllList",
|
||||
//设置为同步
|
||||
async: false,
|
||||
dataType: "json",
|
||||
success: function (res) {
|
||||
if(res && res.code === 200) {
|
||||
depotList = res.data;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化页面选项卡
|
||||
function initSelectInfo_depot() {
|
||||
var options = "";
|
||||
|
||||
if (depotList != null) {
|
||||
options = "";
|
||||
for (var i = 0; i < depotList.length; i++) {
|
||||
var depot = depotList[i];
|
||||
|
||||
if (userdepot != null) {
|
||||
if (userdepot.indexOf("[" + depot.id + "]") != -1) {
|
||||
options += '<option value="' + depot.id + '">' + depot.name + '</option>';
|
||||
depotString = depotString + depot.id + ",";
|
||||
}
|
||||
}
|
||||
}
|
||||
depotString = depotString.substring(0, depotString.length - 1);
|
||||
$("#searchProjectId").empty().append('<option value="">全部</option>').append(options);
|
||||
}
|
||||
}
|
||||
|
||||
//初始化表格数据
|
||||
function initTableData() {
|
||||
$('#tableData').datagrid({
|
||||
height: heightInfo,
|
||||
nowrap: false,
|
||||
rownumbers: true,
|
||||
//动画效果
|
||||
animate: false,
|
||||
//选中单行
|
||||
singleSelect: true,
|
||||
pagination: true,
|
||||
//交替出现背景
|
||||
striped: true,
|
||||
pageSize: 10,
|
||||
pageList: [10, 50, 100],
|
||||
columns: [[
|
||||
{
|
||||
title: '单据编号', field: 'number', width: 140,
|
||||
formatter: function (value, row) {
|
||||
return "<a class='n-link' onclick=\"newTab('" + row.number + "','../materials/bill_detail.html?n=" + row.number + "&type=" + row.newType + "','')\">"
|
||||
+ row.number + "</a>";
|
||||
}
|
||||
},
|
||||
{title: '商品名称', field: 'mname', width: 120},
|
||||
{title: '商品型号', field: 'model', width: 100},
|
||||
{title: '单价', field: 'unitPrice', width: 60},
|
||||
{title: '出库数量', field: 'operNumber', width: 60},
|
||||
{title: '金额', field: 'allPrice', width: 60},
|
||||
{title: '客户', field: 'sname', width: 200},
|
||||
{title: '仓库', field: 'dname', width: 120},
|
||||
{title: '出库日期', field: 'operTime', width: 80}
|
||||
]],
|
||||
onLoadError: function () {
|
||||
$.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化键盘enter事件
|
||||
$(document).keydown(function (event) {
|
||||
//兼容 IE和firefox 事件
|
||||
var e = window.event || event;
|
||||
var k = e.keyCode || e.which || e.charCode;
|
||||
//兼容 IE,firefox 兼容
|
||||
var obj = e.srcElement ? e.srcElement : e.target;
|
||||
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
|
||||
if (k == "13" && (obj.id == "Type" || obj.id == "Name")) {
|
||||
$("#savePerson").click();
|
||||
}
|
||||
//搜索按钮添加快捷键
|
||||
if (k == "13" && (obj.id == "searchType")) {
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
|
||||
//分页信息处理
|
||||
function ininPager() {
|
||||
try {
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
pager.pagination({
|
||||
onSelectPage: function (pageNum, pageSize) {
|
||||
opts.pageNumber = pageNum;
|
||||
opts.pageSize = pageSize;
|
||||
pager.pagination('refresh', {
|
||||
pageNumber: pageNum,
|
||||
pageSize: pageSize
|
||||
});
|
||||
showDetails(pageNum, pageSize);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
$.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
|
||||
}
|
||||
}
|
||||
|
||||
//增加
|
||||
var url;
|
||||
var personID = 0;
|
||||
//保存编辑前的名称
|
||||
var orgPerson = "";
|
||||
|
||||
//搜索处理
|
||||
function search() {
|
||||
showDetails(1, initPageSize);
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
opts.pageNumber = 1;
|
||||
opts.pageSize = initPageSize;
|
||||
pager.pagination('refresh', {
|
||||
pageNumber: 1,
|
||||
pageSize: initPageSize
|
||||
});
|
||||
}
|
||||
|
||||
$("#searchBtn").unbind().bind({
|
||||
click: function () {
|
||||
search();
|
||||
}
|
||||
});
|
||||
|
||||
function showDetails(pageNo, pageSize) {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/depotHead/findInDetail",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
currentPage: pageNo,
|
||||
pageSize: pageSize,
|
||||
organId: $('#OrganId').combobox('getValue'),
|
||||
projectId: $.trim($("#searchProjectId").val()),
|
||||
depotIds: depotString,
|
||||
beginTime: $("#searchBeginTime").val(),
|
||||
endTime: $("#searchEndTime").val(),
|
||||
type: "出库"
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200 && res.data) {
|
||||
$("#tableData").datagrid('loadData', res.data.rows);
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//报表打印
|
||||
function print() {
|
||||
$("#printBtn").off("click").on("click", function () {
|
||||
CreateFormPage('打印报表', $('#tableData'));
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@ -1,304 +1,303 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>出库汇总</title>
|
||||
<meta charset="utf-8">
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon"/>
|
||||
<script type="text/javascript" src="/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="/js/print/print.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="/css/common.css"/>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="/js/My97DatePicker/WdatePicker.js"></script>
|
||||
<script type="text/javascript" src="/js/common/common.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 查询 -->
|
||||
<div id="searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true"
|
||||
closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>客户:</td>
|
||||
<td>
|
||||
<input id="OrganId" name="OrganId" style="width:120px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>仓库:</td>
|
||||
<td>
|
||||
<select name="searchProjectId" id="searchProjectId" style="width:100px;"></select>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>单据日期:</td>
|
||||
<td>
|
||||
<input type="text" name="searchBeginTime" id="searchBeginTime"
|
||||
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/>
|
||||
</td>
|
||||
<td>-</td>
|
||||
<td>
|
||||
<input type="text" name="searchEndTime" id="searchEndTime"
|
||||
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-print" id="printBtn">打印</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id="tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="出库汇总列表" iconCls="icon-list"
|
||||
collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var depotList = null;
|
||||
var depotID = null;
|
||||
var depotString = ""; //仓库列表
|
||||
var uid = sessionStorage.getItem("userId");
|
||||
var cusUrl = "/supplier/findBySelect_cus?UBType=UserCustomer&UBKeyId=" + uid; //客户接口
|
||||
//初始化界面
|
||||
$(function () {
|
||||
var thisDate = getNowFormatMonth(); //当前月份
|
||||
var thisDateTime = getNowFormatDateTime(); //当前时间
|
||||
$("#searchBeginTime").val(thisDate + "-01 00:00:00");
|
||||
$("#searchEndTime").val(thisDateTime);
|
||||
var userBusinessList = null;
|
||||
var userdepot = null;
|
||||
initSupplier(); //初始化客户信息
|
||||
initSystemData_UB();
|
||||
initSelectInfo_UB();
|
||||
initSystemData_depot();
|
||||
initSelectInfo_depot();
|
||||
initTableData();
|
||||
ininPager();
|
||||
search();
|
||||
print();
|
||||
});
|
||||
|
||||
//初始化客户
|
||||
function initSupplier() {
|
||||
$('#OrganId').combobox({
|
||||
url: cusUrl,
|
||||
valueField: 'id',
|
||||
textField: 'supplier',
|
||||
filter: function (q, row) {
|
||||
var opts = $(this).combobox('options');
|
||||
return row[opts.textField].indexOf(q) > -1;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化系统基础信息
|
||||
function initSystemData_UB() {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/userBusiness/getBasicData",
|
||||
data: ({
|
||||
KeyId: uid,
|
||||
Type: "UserDepot"
|
||||
}),
|
||||
//设置为同步
|
||||
async: false,
|
||||
dataType: "json",
|
||||
success: function (res) {
|
||||
if (res && res.code === 200) {
|
||||
if(res.data) {
|
||||
userBusinessList = res.data.userBusinessList;
|
||||
}
|
||||
}
|
||||
else {
|
||||
userBusinessList = null;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
//初始化页面选项卡
|
||||
function initSelectInfo_UB() {
|
||||
|
||||
if (userBusinessList != null) {
|
||||
if (userBusinessList.length > 0) {
|
||||
//用户对应的仓库列表 [1][2][3]...
|
||||
userdepot = userBusinessList[0].value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//初始化系统基础信息
|
||||
function initSystemData_depot() {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/depot/getAllList",
|
||||
//设置为同步
|
||||
async: false,
|
||||
dataType: "json",
|
||||
success: function (res) {
|
||||
if(res && res.code === 200) {
|
||||
depotList = res.data;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化页面选项卡
|
||||
function initSelectInfo_depot() {
|
||||
var options = "";
|
||||
|
||||
if (depotList != null) {
|
||||
options = "";
|
||||
for (var i = 0; i < depotList.length; i++) {
|
||||
var depot = depotList[i];
|
||||
|
||||
if (userdepot != null) {
|
||||
if (userdepot.indexOf("[" + depot.id + "]") != -1) {
|
||||
options += '<option value="' + depot.id + '">' + depot.name + '</option>';
|
||||
depotString = depotString + depot.id + ",";
|
||||
}
|
||||
}
|
||||
}
|
||||
depotString = depotString.substring(0, depotString.length - 1);
|
||||
$("#searchProjectId").empty().append('<option value="">全部</option>').append(options);
|
||||
}
|
||||
}
|
||||
|
||||
//初始化表格数据
|
||||
function initTableData() {
|
||||
$('#tableData').datagrid({
|
||||
height: heightInfo,
|
||||
nowrap: false,
|
||||
rownumbers: true,
|
||||
//动画效果
|
||||
animate: false,
|
||||
//选中单行
|
||||
singleSelect: true,
|
||||
pagination: true,
|
||||
//交替出现背景
|
||||
striped: true,
|
||||
pageSize: 10,
|
||||
pageList: [10, 50, 100],
|
||||
columns: [[
|
||||
{title: '商品名称', field: 'mName', width: 150},
|
||||
{title: '商品型号', field: 'model', width: 150},
|
||||
{title: '商品类型', field: 'categoryName', width: 120},
|
||||
{title: '出库数量', field: 'numSum', width: 120},
|
||||
{title: '出库金额', field: 'priceSum', width: 120}
|
||||
]],
|
||||
onLoadError: function () {
|
||||
$.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化键盘enter事件
|
||||
$(document).keydown(function (event) {
|
||||
//兼容 IE和firefox 事件
|
||||
var e = window.event || event;
|
||||
var k = e.keyCode || e.which || e.charCode;
|
||||
//兼容 IE,firefox 兼容
|
||||
var obj = e.srcElement ? e.srcElement : e.target;
|
||||
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
|
||||
if (k == "13" && (obj.id == "Type" || obj.id == "Name")) {
|
||||
$("#savePerson").click();
|
||||
}
|
||||
//搜索按钮添加快捷键
|
||||
if (k == "13" && (obj.id == "searchType")) {
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
|
||||
//分页信息处理
|
||||
function ininPager() {
|
||||
try {
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
pager.pagination({
|
||||
onSelectPage: function (pageNum, pageSize) {
|
||||
opts.pageNumber = pageNum;
|
||||
opts.pageSize = pageSize;
|
||||
pager.pagination('refresh', {
|
||||
pageNumber: pageNum,
|
||||
pageSize: pageSize
|
||||
});
|
||||
showDetails(pageNum, pageSize);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
$.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
|
||||
}
|
||||
}
|
||||
|
||||
//增加
|
||||
var url;
|
||||
var personID = 0;
|
||||
//保存编辑前的名称
|
||||
var orgPerson = "";
|
||||
|
||||
//搜索处理
|
||||
function search() {
|
||||
showDetails(1, initPageSize);
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
opts.pageNumber = 1;
|
||||
opts.pageSize = initPageSize;
|
||||
pager.pagination('refresh', {
|
||||
pageNumber: 1,
|
||||
pageSize: initPageSize
|
||||
});
|
||||
}
|
||||
|
||||
$("#searchBtn").unbind().bind({
|
||||
click: function () {
|
||||
search();
|
||||
}
|
||||
});
|
||||
|
||||
function showDetails(pageNo, pageSize) {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/depotHead/findInOutMaterialCount",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
currentPage: pageNo,
|
||||
pageSize: pageSize,
|
||||
organId: $('#OrganId').combobox('getValue'),
|
||||
projectId: $.trim($("#searchProjectId").val()),
|
||||
depotIds: depotString,
|
||||
beginTime: $("#searchBeginTime").val(),
|
||||
endTime: $("#searchEndTime").val(),
|
||||
type: "出库"
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200 && res.data) {
|
||||
$("#tableData").datagrid('loadData', res.data.rows);
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//报表打印
|
||||
function print() {
|
||||
$("#printBtn").off("click").on("click", function () {
|
||||
var path = "<%=path %>";
|
||||
CreateFormPage('打印报表', $('#tableData'), path);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>出库汇总</title>
|
||||
<meta charset="utf-8">
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon"/>
|
||||
<script type="text/javascript" src="/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="/js/print/print.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="/css/common.css"/>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="/js/My97DatePicker/WdatePicker.js"></script>
|
||||
<script type="text/javascript" src="/js/common/common.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 查询 -->
|
||||
<div id="searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true"
|
||||
closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>客户:</td>
|
||||
<td>
|
||||
<input id="OrganId" name="OrganId" style="width:120px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>仓库:</td>
|
||||
<td>
|
||||
<select name="searchProjectId" id="searchProjectId" style="width:100px;"></select>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>单据日期:</td>
|
||||
<td>
|
||||
<input type="text" name="searchBeginTime" id="searchBeginTime"
|
||||
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/>
|
||||
</td>
|
||||
<td>-</td>
|
||||
<td>
|
||||
<input type="text" name="searchEndTime" id="searchEndTime"
|
||||
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate" style="width:140px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-print" id="printBtn">打印</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id="tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="出库汇总列表" iconCls="icon-list"
|
||||
collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var depotList = null;
|
||||
var depotID = null;
|
||||
var depotString = ""; //仓库列表
|
||||
var uid = sessionStorage.getItem("userId");
|
||||
var cusUrl = "/supplier/findBySelect_cus?UBType=UserCustomer&UBKeyId=" + uid; //客户接口
|
||||
//初始化界面
|
||||
$(function () {
|
||||
var thisDate = getNowFormatMonth(); //当前月份
|
||||
var thisDateTime = getNowFormatDateTime(); //当前时间
|
||||
$("#searchBeginTime").val(thisDate + "-01 00:00:00");
|
||||
$("#searchEndTime").val(thisDateTime);
|
||||
var userBusinessList = null;
|
||||
var userdepot = null;
|
||||
initSupplier(); //初始化客户信息
|
||||
initSystemData_UB();
|
||||
initSelectInfo_UB();
|
||||
initSystemData_depot();
|
||||
initSelectInfo_depot();
|
||||
initTableData();
|
||||
ininPager();
|
||||
search();
|
||||
print();
|
||||
});
|
||||
|
||||
//初始化客户
|
||||
function initSupplier() {
|
||||
$('#OrganId').combobox({
|
||||
url: cusUrl,
|
||||
valueField: 'id',
|
||||
textField: 'supplier',
|
||||
filter: function (q, row) {
|
||||
var opts = $(this).combobox('options');
|
||||
return row[opts.textField].indexOf(q) > -1;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化系统基础信息
|
||||
function initSystemData_UB() {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/userBusiness/getBasicData",
|
||||
data: ({
|
||||
KeyId: uid,
|
||||
Type: "UserDepot"
|
||||
}),
|
||||
//设置为同步
|
||||
async: false,
|
||||
dataType: "json",
|
||||
success: function (res) {
|
||||
if (res && res.code === 200) {
|
||||
if(res.data) {
|
||||
userBusinessList = res.data.userBusinessList;
|
||||
}
|
||||
}
|
||||
else {
|
||||
userBusinessList = null;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
//初始化页面选项卡
|
||||
function initSelectInfo_UB() {
|
||||
|
||||
if (userBusinessList != null) {
|
||||
if (userBusinessList.length > 0) {
|
||||
//用户对应的仓库列表 [1][2][3]...
|
||||
userdepot = userBusinessList[0].value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//初始化系统基础信息
|
||||
function initSystemData_depot() {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/depot/getAllList",
|
||||
//设置为同步
|
||||
async: false,
|
||||
dataType: "json",
|
||||
success: function (res) {
|
||||
if(res && res.code === 200) {
|
||||
depotList = res.data;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化页面选项卡
|
||||
function initSelectInfo_depot() {
|
||||
var options = "";
|
||||
|
||||
if (depotList != null) {
|
||||
options = "";
|
||||
for (var i = 0; i < depotList.length; i++) {
|
||||
var depot = depotList[i];
|
||||
|
||||
if (userdepot != null) {
|
||||
if (userdepot.indexOf("[" + depot.id + "]") != -1) {
|
||||
options += '<option value="' + depot.id + '">' + depot.name + '</option>';
|
||||
depotString = depotString + depot.id + ",";
|
||||
}
|
||||
}
|
||||
}
|
||||
depotString = depotString.substring(0, depotString.length - 1);
|
||||
$("#searchProjectId").empty().append('<option value="">全部</option>').append(options);
|
||||
}
|
||||
}
|
||||
|
||||
//初始化表格数据
|
||||
function initTableData() {
|
||||
$('#tableData').datagrid({
|
||||
height: heightInfo,
|
||||
nowrap: false,
|
||||
rownumbers: true,
|
||||
//动画效果
|
||||
animate: false,
|
||||
//选中单行
|
||||
singleSelect: true,
|
||||
pagination: true,
|
||||
//交替出现背景
|
||||
striped: true,
|
||||
pageSize: 10,
|
||||
pageList: [10, 50, 100],
|
||||
columns: [[
|
||||
{title: '商品名称', field: 'mName', width: 150},
|
||||
{title: '商品型号', field: 'model', width: 150},
|
||||
{title: '商品类型', field: 'categoryName', width: 120},
|
||||
{title: '出库数量', field: 'numSum', width: 120},
|
||||
{title: '出库金额', field: 'priceSum', width: 120}
|
||||
]],
|
||||
onLoadError: function () {
|
||||
$.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化键盘enter事件
|
||||
$(document).keydown(function (event) {
|
||||
//兼容 IE和firefox 事件
|
||||
var e = window.event || event;
|
||||
var k = e.keyCode || e.which || e.charCode;
|
||||
//兼容 IE,firefox 兼容
|
||||
var obj = e.srcElement ? e.srcElement : e.target;
|
||||
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
|
||||
if (k == "13" && (obj.id == "Type" || obj.id == "Name")) {
|
||||
$("#savePerson").click();
|
||||
}
|
||||
//搜索按钮添加快捷键
|
||||
if (k == "13" && (obj.id == "searchType")) {
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
|
||||
//分页信息处理
|
||||
function ininPager() {
|
||||
try {
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
pager.pagination({
|
||||
onSelectPage: function (pageNum, pageSize) {
|
||||
opts.pageNumber = pageNum;
|
||||
opts.pageSize = pageSize;
|
||||
pager.pagination('refresh', {
|
||||
pageNumber: pageNum,
|
||||
pageSize: pageSize
|
||||
});
|
||||
showDetails(pageNum, pageSize);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
$.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
|
||||
}
|
||||
}
|
||||
|
||||
//增加
|
||||
var url;
|
||||
var personID = 0;
|
||||
//保存编辑前的名称
|
||||
var orgPerson = "";
|
||||
|
||||
//搜索处理
|
||||
function search() {
|
||||
showDetails(1, initPageSize);
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
opts.pageNumber = 1;
|
||||
opts.pageSize = initPageSize;
|
||||
pager.pagination('refresh', {
|
||||
pageNumber: 1,
|
||||
pageSize: initPageSize
|
||||
});
|
||||
}
|
||||
|
||||
$("#searchBtn").unbind().bind({
|
||||
click: function () {
|
||||
search();
|
||||
}
|
||||
});
|
||||
|
||||
function showDetails(pageNo, pageSize) {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/depotHead/findInOutMaterialCount",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
currentPage: pageNo,
|
||||
pageSize: pageSize,
|
||||
organId: $('#OrganId').combobox('getValue'),
|
||||
projectId: $.trim($("#searchProjectId").val()),
|
||||
depotIds: depotString,
|
||||
beginTime: $("#searchBeginTime").val(),
|
||||
endTime: $("#searchEndTime").val(),
|
||||
type: "出库"
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200 && res.data) {
|
||||
$("#tableData").datagrid('loadData', res.data.rows);
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//报表打印
|
||||
function print() {
|
||||
$("#printBtn").off("click").on("click", function () {
|
||||
CreateFormPage('打印报表', $('#tableData'));
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@ -1,264 +1,263 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>销售统计</title>
|
||||
<meta charset="utf-8">
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon"/>
|
||||
<script type="text/javascript" src="/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="/js/print/print.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="/css/common.css"/>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="/js/My97DatePicker/WdatePicker.js"></script>
|
||||
<script type="text/javascript" src="/js/common/common.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 查询 -->
|
||||
<div id="searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true"
|
||||
closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>月份:</td>
|
||||
<td>
|
||||
<input type="text" name="searchMonth" id="searchMonth" onClick="WdatePicker({dateFmt:'yyyy-MM'})"
|
||||
class="txt Wdate" style="width:180px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-print" id="printBtn">打印</a>
|
||||
</td>
|
||||
<td><span class="tip">注:此处包含零售+批发销售</span></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id="tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="销售统计列表" iconCls="icon-list"
|
||||
collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</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: "get",
|
||||
url: "/materialProperty/list",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
search: JSON.stringify({
|
||||
name: ""
|
||||
}),
|
||||
currentPage: 1,
|
||||
pageSize: 100
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200){
|
||||
var thisRows = res.data.page.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({
|
||||
height: heightInfo,
|
||||
nowrap: false,
|
||||
rownumbers: true,
|
||||
//动画效果
|
||||
animate: false,
|
||||
//选中单行
|
||||
singleSelect: true,
|
||||
pagination: true,
|
||||
//交替出现背景
|
||||
striped: true,
|
||||
//loadFilter: pagerFilter,
|
||||
pageSize: 10,
|
||||
pageList: [10, 50, 100],
|
||||
columns: [[
|
||||
{title: '名称', field: 'MaterialName', width: 60},
|
||||
{title: '型号', field: 'MaterialModel', width: 80},
|
||||
{title: '扩展信息', field: 'MaterialOther', width: 150},
|
||||
{title: '单位', field: 'MaterialUnit', width: 80},
|
||||
{title: '销售数量', field: 'OutSum', width: 60},
|
||||
{title: '销售金额', field: 'OutSumPrice', width: 60},
|
||||
{title: '退货数量', field: 'InSum', width: 60},
|
||||
{title: '退货金额', field: 'InSumPrice', width: 60}
|
||||
]],
|
||||
onLoadError: function () {
|
||||
$.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化键盘enter事件
|
||||
$(document).keydown(function (event) {
|
||||
//兼容 IE和firefox 事件
|
||||
var e = window.event || event;
|
||||
var k = e.keyCode || e.which || e.charCode;
|
||||
//兼容 IE,firefox 兼容
|
||||
var obj = e.srcElement ? e.srcElement : e.target;
|
||||
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
|
||||
//搜索按钮添加快捷键
|
||||
if (k == "13" && (obj.id == "searchMonth")) {
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
|
||||
//分页信息处理
|
||||
function ininPager() {
|
||||
try {
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
pager.pagination({
|
||||
onSelectPage: function (pageNum, pageSize) {
|
||||
opts.pageNumber = pageNum;
|
||||
opts.pageSize = pageSize;
|
||||
pager.pagination('refresh', {
|
||||
pageNumber: pageNum,
|
||||
pageSize: pageSize
|
||||
});
|
||||
showDetails(pageNum, pageSize);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
$.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
|
||||
}
|
||||
}
|
||||
|
||||
//搜索处理
|
||||
function search() {
|
||||
showDetails(1, initPageSize);
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
opts.pageNumber = 1;
|
||||
opts.pageSize = initPageSize;
|
||||
pager.pagination('refresh',
|
||||
{
|
||||
pageNumber: 1,
|
||||
pageSize: initPageSize
|
||||
});
|
||||
}
|
||||
|
||||
$("#searchBtn").unbind().bind({
|
||||
click: function () {
|
||||
search();
|
||||
}
|
||||
});
|
||||
|
||||
function showDetails(pageNo, pageSize) {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/depotHead/findByMonth",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
monthTime: $("#searchMonth").val()
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200 && res.data) {
|
||||
var HeadIds = res.data.HeadIds;
|
||||
if (HeadIds) {
|
||||
//获取排序后的产品ID
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/material/findByOrder",
|
||||
dataType: "json",
|
||||
success: function (res) {
|
||||
if (res && res.code === 200 && res.data) {
|
||||
var mIds = res.data.mIds;
|
||||
if (mIds) {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/depotItem/saleOut",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
currentPage: pageNo,
|
||||
pageSize: pageSize,
|
||||
monthTime: $("#searchMonth").val(),
|
||||
headIds: HeadIds,
|
||||
materialIds: mIds,
|
||||
mpList: mPropertyList
|
||||
}),
|
||||
success: function (res) {
|
||||
if (res && res.code === 200 && res.data) {
|
||||
$("#tableData").datagrid('loadData', res.data.rows);
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
$.messager.alert('查询提示', '本月无数据!', 'error');
|
||||
}
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
$.messager.alert('查询提示', '本月无数据!', 'error');
|
||||
}
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//报表打印
|
||||
function print() {
|
||||
$("#printBtn").off("click").on("click", function () {
|
||||
var path = "<%=path %>";
|
||||
CreateFormPage('打印报表', $('#tableData'), path);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>销售统计</title>
|
||||
<meta charset="utf-8">
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon"/>
|
||||
<script type="text/javascript" src="/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="/js/print/print.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="/css/common.css"/>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="/js/My97DatePicker/WdatePicker.js"></script>
|
||||
<script type="text/javascript" src="/js/common/common.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 查询 -->
|
||||
<div id="searchPanel" class="easyui-panel" style="padding:10px;" title="查询窗口" iconCls="icon-search" collapsible="true"
|
||||
closable="false">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>月份:</td>
|
||||
<td>
|
||||
<input type="text" name="searchMonth" id="searchMonth" onClick="WdatePicker({dateFmt:'yyyy-MM'})"
|
||||
class="txt Wdate" style="width:180px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-print" id="printBtn">打印</a>
|
||||
</td>
|
||||
<td><span class="tip">注:此处包含零售+批发销售</span></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 数据显示table -->
|
||||
<div id="tablePanel" class="easyui-panel" style="padding:1px;top:300px;" title="销售统计列表" iconCls="icon-list"
|
||||
collapsible="true" closable="false">
|
||||
<table id="tableData" style="top:300px;border-bottom-color:#FFFFFF"></table>
|
||||
</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: "get",
|
||||
url: "/materialProperty/list",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
search: JSON.stringify({
|
||||
name: ""
|
||||
}),
|
||||
currentPage: 1,
|
||||
pageSize: 100
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200){
|
||||
var thisRows = res.data.page.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({
|
||||
height: heightInfo,
|
||||
nowrap: false,
|
||||
rownumbers: true,
|
||||
//动画效果
|
||||
animate: false,
|
||||
//选中单行
|
||||
singleSelect: true,
|
||||
pagination: true,
|
||||
//交替出现背景
|
||||
striped: true,
|
||||
//loadFilter: pagerFilter,
|
||||
pageSize: 10,
|
||||
pageList: [10, 50, 100],
|
||||
columns: [[
|
||||
{title: '名称', field: 'MaterialName', width: 60},
|
||||
{title: '型号', field: 'MaterialModel', width: 80},
|
||||
{title: '扩展信息', field: 'MaterialOther', width: 150},
|
||||
{title: '单位', field: 'MaterialUnit', width: 80},
|
||||
{title: '销售数量', field: 'OutSum', width: 60},
|
||||
{title: '销售金额', field: 'OutSumPrice', width: 60},
|
||||
{title: '退货数量', field: 'InSum', width: 60},
|
||||
{title: '退货金额', field: 'InSumPrice', width: 60}
|
||||
]],
|
||||
onLoadError: function () {
|
||||
$.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化键盘enter事件
|
||||
$(document).keydown(function (event) {
|
||||
//兼容 IE和firefox 事件
|
||||
var e = window.event || event;
|
||||
var k = e.keyCode || e.which || e.charCode;
|
||||
//兼容 IE,firefox 兼容
|
||||
var obj = e.srcElement ? e.srcElement : e.target;
|
||||
//绑定键盘事件为 id是指定的输入框才可以触发键盘事件 13键盘事件 ---遗留问题 enter键效验 对话框会关闭问题
|
||||
//搜索按钮添加快捷键
|
||||
if (k == "13" && (obj.id == "searchMonth")) {
|
||||
$("#searchBtn").click();
|
||||
}
|
||||
});
|
||||
|
||||
//分页信息处理
|
||||
function ininPager() {
|
||||
try {
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
pager.pagination({
|
||||
onSelectPage: function (pageNum, pageSize) {
|
||||
opts.pageNumber = pageNum;
|
||||
opts.pageSize = pageSize;
|
||||
pager.pagination('refresh', {
|
||||
pageNumber: pageNum,
|
||||
pageSize: pageSize
|
||||
});
|
||||
showDetails(pageNum, pageSize);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
$.messager.alert('异常处理提示', "分页信息异常 : " + e.name + ": " + e.message, 'error');
|
||||
}
|
||||
}
|
||||
|
||||
//搜索处理
|
||||
function search() {
|
||||
showDetails(1, initPageSize);
|
||||
var opts = $("#tableData").datagrid('options');
|
||||
var pager = $("#tableData").datagrid('getPager');
|
||||
opts.pageNumber = 1;
|
||||
opts.pageSize = initPageSize;
|
||||
pager.pagination('refresh',
|
||||
{
|
||||
pageNumber: 1,
|
||||
pageSize: initPageSize
|
||||
});
|
||||
}
|
||||
|
||||
$("#searchBtn").unbind().bind({
|
||||
click: function () {
|
||||
search();
|
||||
}
|
||||
});
|
||||
|
||||
function showDetails(pageNo, pageSize) {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/depotHead/findByMonth",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
monthTime: $("#searchMonth").val()
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code === 200 && res.data) {
|
||||
var HeadIds = res.data.HeadIds;
|
||||
if (HeadIds) {
|
||||
//获取排序后的产品ID
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/material/findByOrder",
|
||||
dataType: "json",
|
||||
success: function (res) {
|
||||
if (res && res.code === 200 && res.data) {
|
||||
var mIds = res.data.mIds;
|
||||
if (mIds) {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/depotItem/saleOut",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
currentPage: pageNo,
|
||||
pageSize: pageSize,
|
||||
monthTime: $("#searchMonth").val(),
|
||||
headIds: HeadIds,
|
||||
materialIds: mIds,
|
||||
mpList: mPropertyList
|
||||
}),
|
||||
success: function (res) {
|
||||
if (res && res.code === 200 && res.data) {
|
||||
$("#tableData").datagrid('loadData', res.data.rows);
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
$.messager.alert('查询提示', '本月无数据!', 'error');
|
||||
}
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
$.messager.alert('查询提示', '本月无数据!', 'error');
|
||||
}
|
||||
}
|
||||
},
|
||||
//此处添加错误处理
|
||||
error: function () {
|
||||
$.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//报表打印
|
||||
function print() {
|
||||
$("#printBtn").off("click").on("click", function () {
|
||||
CreateFormPage('打印报表', $('#tableData'));
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@ -343,8 +343,7 @@
|
||||
//报表打印
|
||||
function print() {
|
||||
$("#printBtn").off("click").on("click", function () {
|
||||
var path = "<%=path %>";
|
||||
CreateFormPage('打印报表', $('#tableData'), path);
|
||||
CreateFormPage('打印报表', $('#tableData'));
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
12
pom.xml
12
pom.xml
@ -42,7 +42,7 @@
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<java.version>1.7</java.version>
|
||||
<java.version>1.8</java.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
@ -96,6 +96,11 @@
|
||||
<artifactId>commons-httpclient</artifactId>
|
||||
<version>3.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.sourceforge.jexcelapi</groupId>
|
||||
<artifactId>jxl</artifactId>
|
||||
<version>2.6.3</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<repositories>
|
||||
@ -174,9 +179,10 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.7.0</version>
|
||||
<configuration>
|
||||
<source>1.7</source>
|
||||
<target>1.7</target>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
||||
1
src/main/conf/start.sh
Normal file
1
src/main/conf/start.sh
Normal file
@ -0,0 +1 @@
|
||||
nohup ./jshERPStart.sh &
|
||||
@ -5,13 +5,18 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.jsh.erp.datasource.entities.App;
|
||||
import com.jsh.erp.service.app.AppService;
|
||||
import com.jsh.erp.service.userBusiness.UserBusinessService;
|
||||
import com.jsh.erp.utils.BaseResponseInfo;
|
||||
import com.jsh.erp.utils.FileUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.*;
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
* @author ji_sheng_hua 752*718*920
|
||||
@ -26,14 +31,7 @@ public class AppController {
|
||||
|
||||
@Resource
|
||||
private UserBusinessService userBusinessService;
|
||||
/**
|
||||
* create by: cjl
|
||||
* description:
|
||||
* 桌面菜单按钮初始化
|
||||
* create time: 2019/1/11 17:01
|
||||
* @Param: request
|
||||
* @return com.alibaba.fastjson.JSONObject
|
||||
*/
|
||||
|
||||
@GetMapping(value = "/findDesk")
|
||||
public JSONObject findDesk(HttpServletRequest request) {
|
||||
JSONObject obj = new JSONObject();
|
||||
@ -123,4 +121,38 @@ public class AppController {
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传图片
|
||||
* @param fileInfo
|
||||
* @param request
|
||||
*/
|
||||
@PostMapping(value = "/uploadImg")
|
||||
public BaseResponseInfo uploadImg(MultipartFile fileInfo, @RequestParam("fileInfoName") String fileName,
|
||||
HttpServletRequest request) {
|
||||
BaseResponseInfo res = new BaseResponseInfo();
|
||||
try {
|
||||
if (fileInfo != null) {
|
||||
String basePath = request.getSession().getServletContext().getRealPath("/"); //默认windows文件路径,linux环境下生成的目录与项目同级,而不是下级
|
||||
String path = basePath + "upload/images/deskIcon/"; //windows环境下的路径
|
||||
Properties pro = System.getProperties();
|
||||
String osName = pro.getProperty("os.name");//获得当前操作系统的名称
|
||||
if("Linux".equals(osName) || "linux".equals(osName) || "LINUX".equals(osName)){
|
||||
path = basePath + "/upload/images/deskIcon/"; //linux环境下的路径
|
||||
}
|
||||
FileUtils.SaveFileFromInputStream(fileInfo.getInputStream(), path, fileName);
|
||||
res.code = 200;
|
||||
res.data = "上传图片成功";
|
||||
}
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
res.code = 500;
|
||||
res.data = "获取图片失败";
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
res.code = 500;
|
||||
res.data = "上传图片失败";
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,11 +9,12 @@ import com.jsh.erp.utils.*;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.dao.DataAccessException;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@ -32,7 +33,8 @@ public class DepotItemController {
|
||||
@Resource
|
||||
private DepotItemService depotItemService;
|
||||
|
||||
|
||||
@Resource
|
||||
private MaterialService materialService;
|
||||
|
||||
/**
|
||||
* 根据材料信息获取
|
||||
@ -267,7 +269,26 @@ public class DepotItemController {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询计量单位信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String findUnitName(Long mId) {
|
||||
String unitName = "";
|
||||
try {
|
||||
unitName = materialService.findUnitName(mId);
|
||||
if (unitName != null) {
|
||||
unitName = unitName.substring(1, unitName.length() - 1);
|
||||
if (unitName.equals("null")) {
|
||||
unitName = "";
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return unitName;
|
||||
}
|
||||
|
||||
@GetMapping(value = "/getDetailList")
|
||||
public BaseResponseInfo getDetailList(@RequestParam("headerId") Long headerId,
|
||||
@ -403,14 +424,12 @@ public class DepotItemController {
|
||||
if (null != dataList) {
|
||||
for (DepotItemVo4WithInfoEx diEx : dataList) {
|
||||
JSONObject item = new JSONObject();
|
||||
Double prevSum = sumNumber("入库", pid, diEx.getMaterialid(), monthTime, true) - sumNumber("出库", pid, diEx.getMaterialid(), monthTime, true);
|
||||
Double InSum = sumNumber("入库", pid, diEx.getMaterialid(), monthTime, false);
|
||||
Double OutSum = sumNumber("出库", pid, diEx.getMaterialid(), monthTime, false);
|
||||
Double prevPrice = sumPrice("入库", pid, diEx.getMaterialid(), monthTime, true) - sumPrice("出库", pid, diEx.getMaterialid(), monthTime, true);
|
||||
Double InPrice = sumPrice("入库", pid, diEx.getMaterialid(), monthTime, false);
|
||||
Double OutPrice = sumPrice("出库", pid, diEx.getMaterialid(), monthTime, false);
|
||||
item.put("Id", diEx.getId());
|
||||
item.put("MaterialId", diEx.getMaterialid());
|
||||
Double prevSum = sumNumber("入库", pid, diEx.getMId(), monthTime, true) - sumNumber("出库", pid, diEx.getMId(), monthTime, true);
|
||||
Double InSum = sumNumber("入库", pid, diEx.getMId(), monthTime, false);
|
||||
Double OutSum = sumNumber("出库", pid, diEx.getMId(), monthTime, false);
|
||||
Double prevPrice = sumPrice("入库", pid, diEx.getMId(), monthTime, true) - sumPrice("出库", pid, diEx.getMId(), monthTime, true);
|
||||
Double InPrice = sumPrice("入库", pid, diEx.getMId(), monthTime, false);
|
||||
Double OutPrice = sumPrice("出库", pid, diEx.getMId(), monthTime, false);
|
||||
item.put("MaterialName", diEx.getMName());
|
||||
item.put("MaterialModel", diEx.getMColor());
|
||||
//扩展信息
|
||||
@ -464,9 +483,9 @@ public class DepotItemController {
|
||||
Double thisAllPrice = 0.0;
|
||||
if (null != dataList) {
|
||||
for (DepotItemVo4WithInfoEx diEx : dataList) {
|
||||
Double prevPrice = sumPrice("入库", pid, diEx.getMaterialid(), monthTime, true) - sumPrice("出库", pid, diEx.getMaterialid(), monthTime, true);
|
||||
Double InPrice = sumPrice("入库", pid, diEx.getMaterialid(), monthTime, false);
|
||||
Double OutPrice = sumPrice("出库", pid, diEx.getMaterialid(), monthTime, false);
|
||||
Double prevPrice = sumPrice("入库", pid, diEx.getMId(), monthTime, true) - sumPrice("出库", pid, diEx.getMId(), monthTime, true);
|
||||
Double InPrice = sumPrice("入库", pid, diEx.getMId(), monthTime, false);
|
||||
Double OutPrice = sumPrice("出库", pid, diEx.getMId(), monthTime, false);
|
||||
thisAllPrice = thisAllPrice + (prevPrice + InPrice - OutPrice);
|
||||
}
|
||||
}
|
||||
@ -512,12 +531,10 @@ public class DepotItemController {
|
||||
if (null != dataList) {
|
||||
for (DepotItemVo4WithInfoEx diEx : dataList) {
|
||||
JSONObject item = new JSONObject();
|
||||
Double InSum = sumNumberBuyOrSale("入库", "采购", diEx.getMaterialid(), monthTime);
|
||||
Double OutSum = sumNumberBuyOrSale("出库", "采购退货", diEx.getMaterialid(), monthTime);
|
||||
Double InSumPrice = sumPriceBuyOrSale("入库", "采购", diEx.getMaterialid(), monthTime);
|
||||
Double OutSumPrice = sumPriceBuyOrSale("出库", "采购退货", diEx.getMaterialid(), monthTime);
|
||||
item.put("Id", diEx.getId());
|
||||
item.put("MaterialId", diEx.getMaterialid());
|
||||
Double InSum = sumNumberBuyOrSale("入库", "采购", diEx.getMId(), monthTime);
|
||||
Double OutSum = sumNumberBuyOrSale("出库", "采购退货", diEx.getMId(), monthTime);
|
||||
Double InSumPrice = sumPriceBuyOrSale("入库", "采购", diEx.getMId(), monthTime);
|
||||
Double OutSumPrice = sumPriceBuyOrSale("出库", "采购退货", diEx.getMId(), monthTime);
|
||||
item.put("MaterialName", diEx.getMName());
|
||||
item.put("MaterialModel", diEx.getMModel());
|
||||
//扩展信息
|
||||
@ -574,16 +591,14 @@ public class DepotItemController {
|
||||
if (null != dataList) {
|
||||
for (DepotItemVo4WithInfoEx diEx : dataList) {
|
||||
JSONObject item = new JSONObject();
|
||||
Double OutSumRetail = sumNumberBuyOrSale("出库", "零售", diEx.getMaterialid(), monthTime);
|
||||
Double OutSum = sumNumberBuyOrSale("出库", "销售", diEx.getMaterialid(), monthTime);
|
||||
Double InSumRetail = sumNumberBuyOrSale("入库", "零售退货", diEx.getMaterialid(), monthTime);
|
||||
Double InSum = sumNumberBuyOrSale("入库", "销售退货", diEx.getMaterialid(), monthTime);
|
||||
Double OutSumRetailPrice = sumPriceBuyOrSale("出库", "零售", diEx.getMaterialid(), monthTime);
|
||||
Double OutSumPrice = sumPriceBuyOrSale("出库", "销售", diEx.getMaterialid(), monthTime);
|
||||
Double InSumRetailPrice = sumPriceBuyOrSale("入库", "零售退货", diEx.getMaterialid(), monthTime);
|
||||
Double InSumPrice = sumPriceBuyOrSale("入库", "销售退货", diEx.getMaterialid(), monthTime);
|
||||
item.put("Id", diEx.getId());
|
||||
item.put("MaterialId", diEx.getMaterialid());
|
||||
Double OutSumRetail = sumNumberBuyOrSale("出库", "零售", diEx.getMId(), monthTime);
|
||||
Double OutSum = sumNumberBuyOrSale("出库", "销售", diEx.getMId(), monthTime);
|
||||
Double InSumRetail = sumNumberBuyOrSale("入库", "零售退货", diEx.getMId(), monthTime);
|
||||
Double InSum = sumNumberBuyOrSale("入库", "销售退货", diEx.getMId(), monthTime);
|
||||
Double OutSumRetailPrice = sumPriceBuyOrSale("出库", "零售", diEx.getMId(), monthTime);
|
||||
Double OutSumPrice = sumPriceBuyOrSale("出库", "销售", diEx.getMId(), monthTime);
|
||||
Double InSumRetailPrice = sumPriceBuyOrSale("入库", "零售退货", diEx.getMId(), monthTime);
|
||||
Double InSumPrice = sumPriceBuyOrSale("入库", "销售退货", diEx.getMId(), monthTime);
|
||||
item.put("MaterialName", diEx.getMName());
|
||||
item.put("MaterialModel", diEx.getMModel());
|
||||
//扩展信息
|
||||
@ -640,10 +655,8 @@ public class DepotItemController {
|
||||
if (null != dataList) {
|
||||
for (DepotItemVo4WithInfoEx diEx : dataList) {
|
||||
JSONObject item = new JSONObject();
|
||||
Double InSum = sumNumberGift("礼品充值", pid, diEx.getMaterialid(), "in");
|
||||
Double OutSum = sumNumberGift("礼品销售", pid, diEx.getMaterialid(), "out");
|
||||
item.put("Id", diEx.getId());
|
||||
item.put("MaterialId", diEx.getMaterialid());
|
||||
Double InSum = sumNumberGift("礼品充值", pid, diEx.getMId(), "in");
|
||||
Double OutSum = sumNumberGift("礼品销售", pid, diEx.getMId(), "out");
|
||||
item.put("MaterialName", diEx.getMName());
|
||||
item.put("MaterialModel", diEx.getMModel());
|
||||
//扩展信息
|
||||
@ -666,6 +679,77 @@ public class DepotItemController {
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel表格
|
||||
* @param currentPage
|
||||
* @param pageSize
|
||||
* @param projectId
|
||||
* @param monthTime
|
||||
* @param headIds
|
||||
* @param materialIds
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/exportExcel")
|
||||
public BaseResponseInfo exportExcel(@RequestParam("currentPage") Integer currentPage,
|
||||
@RequestParam("pageSize") Integer pageSize,
|
||||
@RequestParam("projectId") Integer projectId,
|
||||
@RequestParam("monthTime") String monthTime,
|
||||
@RequestParam("headIds") String headIds,
|
||||
@RequestParam("materialIds") String materialIds,
|
||||
HttpServletRequest request, HttpServletResponse response) {
|
||||
BaseResponseInfo res = new BaseResponseInfo();
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String message = "成功";
|
||||
try {
|
||||
List<DepotItemVo4WithInfoEx> dataList = depotItemService.findByAll(headIds, materialIds, currentPage, pageSize);
|
||||
//存放数据json数组
|
||||
Integer pid = projectId;
|
||||
String[] names = {"名称", "型号", "单位", "单价", "上月结存数量", "入库数量", "出库数量", "本月结存数量", "结存金额"};
|
||||
String title = "库存报表";
|
||||
List<String[]> objects = new ArrayList<String[]>();
|
||||
if (null != dataList) {
|
||||
for (DepotItemVo4WithInfoEx diEx : dataList) {
|
||||
String[] objs = new String[9];
|
||||
Double prevSum = sumNumber("入库", pid, diEx.getMId(), monthTime, true) - sumNumber("出库", pid, diEx.getMId(), monthTime, true);
|
||||
Double InSum = sumNumber("入库", pid, diEx.getMId(), monthTime, false);
|
||||
Double OutSum = sumNumber("出库", pid, diEx.getMId(), monthTime, false);
|
||||
Double prevPrice = sumPrice("入库", pid, diEx.getMId(), monthTime, true) - sumPrice("出库", pid, diEx.getMId(), monthTime, true);
|
||||
Double InPrice = sumPrice("入库", pid, diEx.getMId(), monthTime, false);
|
||||
Double OutPrice = sumPrice("出库", pid, diEx.getMId(), monthTime, false);
|
||||
Double unitPrice = 0.0;
|
||||
if (prevSum + InSum - OutSum != 0.0) {
|
||||
unitPrice = (prevPrice + InPrice - OutPrice) / (prevSum + InSum - OutSum);
|
||||
}
|
||||
Double thisSum = prevSum + InSum - OutSum;
|
||||
Double thisAllPrice = prevPrice + InPrice - OutPrice;
|
||||
objs[0] = diEx.getMName().toString();
|
||||
objs[1] = diEx.getMModel().toString();
|
||||
objs[2] = diEx.getMaterialUnit().toString();
|
||||
objs[3] = unitPrice.toString();
|
||||
objs[4] = prevSum.toString();
|
||||
objs[5] = InSum.toString();
|
||||
objs[6] = OutSum.toString();
|
||||
objs[7] = thisSum.toString();
|
||||
objs[8] = thisAllPrice.toString();
|
||||
objects.add(objs);
|
||||
}
|
||||
}
|
||||
File file = ExcelUtils.exportObjectsWithoutTitle(title, names, title, objects);
|
||||
ExportExecUtil.showExec(file, file.getName() + "-" + monthTime, response);
|
||||
res.code = 200;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
message = "导出失败";
|
||||
res.code = 500;
|
||||
} finally {
|
||||
map.put("message", message);
|
||||
res.data = map;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 数量合计
|
||||
*
|
||||
|
||||
@ -1,180 +1,309 @@
|
||||
package com.jsh.erp.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jsh.erp.datasource.entities.Material;
|
||||
import com.jsh.erp.datasource.entities.MaterialVo4Unit;
|
||||
import com.jsh.erp.service.material.MaterialService;
|
||||
import com.jsh.erp.utils.BaseResponseInfo;
|
||||
import com.jsh.erp.utils.ErpInfo;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
|
||||
|
||||
/**
|
||||
* @author ji|sheng|hua 华夏ERP
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(value = "/material")
|
||||
public class MaterialController {
|
||||
private Logger logger = LoggerFactory.getLogger(MaterialController.class);
|
||||
|
||||
@Resource
|
||||
private MaterialService materialService;
|
||||
|
||||
@GetMapping(value = "/checkIsExist")
|
||||
public String checkIsExist(@RequestParam("id") Long id, @RequestParam("name") String name,
|
||||
@RequestParam("model") String model, @RequestParam("color") String color,
|
||||
@RequestParam("standard") String standard, @RequestParam("mfrs") String mfrs,
|
||||
@RequestParam("otherField1") String otherField1, @RequestParam("otherField2") String otherField2,
|
||||
@RequestParam("otherField3") String otherField3, @RequestParam("unit") String unit,@RequestParam("unitId") Long unitId,
|
||||
HttpServletRequest request) {
|
||||
Map<String, Object> objectMap = new HashMap<String, Object>();
|
||||
int exist = materialService.checkIsExist(id, name, model, color, standard, mfrs,
|
||||
otherField1, otherField2, otherField3, unit, unitId);
|
||||
if(exist > 0) {
|
||||
objectMap.put("status", true);
|
||||
} else {
|
||||
objectMap.put("status", false);
|
||||
}
|
||||
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量设置状态-启用或者禁用
|
||||
* @param enabled
|
||||
* @param materialIDs
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/batchSetEnable")
|
||||
public String batchSetEnable(@RequestParam("enabled") Boolean enabled,
|
||||
@RequestParam("materialIDs") String materialIDs,
|
||||
HttpServletRequest request) {
|
||||
Map<String, Object> objectMap = new HashMap<String, Object>();
|
||||
int res = materialService.batchSetEnable(enabled, materialIDs);
|
||||
if(res > 0) {
|
||||
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
|
||||
} else {
|
||||
return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id来查询商品名称
|
||||
* @param id
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/findById")
|
||||
public BaseResponseInfo findById(@RequestParam("id") Long id, HttpServletRequest request) {
|
||||
BaseResponseInfo res = new BaseResponseInfo();
|
||||
try {
|
||||
List<MaterialVo4Unit> list = materialService.findById(id);
|
||||
res.code = 200;
|
||||
res.data = list;
|
||||
} catch(Exception e){
|
||||
e.printStackTrace();
|
||||
res.code = 500;
|
||||
res.data = "获取数据失败";
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查找商品信息-下拉框
|
||||
* @param mpList
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/findBySelect")
|
||||
public JSONArray findBySelect(@RequestParam("mpList") String mpList, HttpServletRequest request) {
|
||||
JSONArray dataArray = new JSONArray();
|
||||
try {
|
||||
List<MaterialVo4Unit> dataList = materialService.findBySelect();
|
||||
String[] mpArr = mpList.split(",");
|
||||
//存放数据json数组
|
||||
if (null != dataList) {
|
||||
for (MaterialVo4Unit material : dataList) {
|
||||
JSONObject item = new JSONObject();
|
||||
item.put("Id", material.getId());
|
||||
String ratio; //比例
|
||||
if (material.getUnitid() == null || material.getUnitid().equals("")) {
|
||||
ratio = "";
|
||||
} else {
|
||||
ratio = material.getUnitName();
|
||||
ratio = ratio.substring(ratio.indexOf("("));
|
||||
}
|
||||
//品名/型号/扩展信息/包装
|
||||
String MaterialName = material.getName() + ((material.getModel() == null || material.getModel().equals("")) ? "" : "(" + material.getModel() + ")");
|
||||
for (int i = 0; i < mpArr.length; i++) {
|
||||
if (mpArr[i].equals("颜色")) {
|
||||
MaterialName = MaterialName + ((material.getColor() == null || material.getColor().equals("")) ? "" : "(" + material.getColor() + ")");
|
||||
}
|
||||
if (mpArr[i].equals("规格")) {
|
||||
MaterialName = MaterialName + ((material.getStandard() == null || material.getStandard().equals("")) ? "" : "(" + material.getStandard() + ")");
|
||||
}
|
||||
if (mpArr[i].equals("制造商")) {
|
||||
MaterialName = MaterialName + ((material.getMfrs() == null || material.getMfrs().equals("")) ? "" : "(" + material.getMfrs() + ")");
|
||||
}
|
||||
if (mpArr[i].equals("自定义1")) {
|
||||
MaterialName = MaterialName + ((material.getOtherfield1() == null || material.getOtherfield1().equals("")) ? "" : "(" + material.getOtherfield1() + ")");
|
||||
}
|
||||
if (mpArr[i].equals("自定义2")) {
|
||||
MaterialName = MaterialName + ((material.getOtherfield2() == null || material.getOtherfield2().equals("")) ? "" : "(" + material.getOtherfield2() + ")");
|
||||
}
|
||||
if (mpArr[i].equals("自定义3")) {
|
||||
MaterialName = MaterialName + ((material.getOtherfield3() == null || material.getOtherfield3().equals("")) ? "" : "(" + material.getOtherfield3() + ")");
|
||||
}
|
||||
}
|
||||
MaterialName = MaterialName + ((material.getUnit() == null || material.getUnit().equals("")) ? "" : "(" + material.getUnit() + ")") + ratio;
|
||||
item.put("MaterialName", MaterialName);
|
||||
dataArray.add(item);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return dataArray;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查找商品信息-统计排序
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/findByOrder")
|
||||
public BaseResponseInfo findByOrder(HttpServletRequest request) {
|
||||
BaseResponseInfo res = new BaseResponseInfo();
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
try {
|
||||
List<Material> dataList = materialService.findByOrder();
|
||||
String mId = "";
|
||||
if (null != dataList) {
|
||||
for (Material material : dataList) {
|
||||
mId = mId + material.getId() + ",";
|
||||
}
|
||||
}
|
||||
if (mId != "") {
|
||||
mId = mId.substring(0, mId.lastIndexOf(","));
|
||||
}
|
||||
map.put("mIds", mId);
|
||||
res.code = 200;
|
||||
res.data = map;
|
||||
} catch(Exception e){
|
||||
e.printStackTrace();
|
||||
res.code = 500;
|
||||
res.data = "获取数据失败";
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
package com.jsh.erp.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jsh.erp.datasource.entities.Material;
|
||||
import com.jsh.erp.datasource.entities.MaterialVo4Unit;
|
||||
import com.jsh.erp.service.material.MaterialService;
|
||||
import com.jsh.erp.utils.*;
|
||||
import jxl.Sheet;
|
||||
import jxl.Workbook;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
|
||||
|
||||
/**
|
||||
* @author ji|sheng|hua 华夏ERP
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(value = "/material")
|
||||
public class MaterialController {
|
||||
private Logger logger = LoggerFactory.getLogger(MaterialController.class);
|
||||
|
||||
@Resource
|
||||
private MaterialService materialService;
|
||||
|
||||
@GetMapping(value = "/checkIsExist")
|
||||
public String checkIsExist(@RequestParam("id") Long id, @RequestParam("name") String name,
|
||||
@RequestParam("model") String model, @RequestParam("color") String color,
|
||||
@RequestParam("standard") String standard, @RequestParam("mfrs") String mfrs,
|
||||
@RequestParam("otherField1") String otherField1, @RequestParam("otherField2") String otherField2,
|
||||
@RequestParam("otherField3") String otherField3, @RequestParam("unit") String unit,@RequestParam("unitId") Long unitId,
|
||||
HttpServletRequest request) {
|
||||
Map<String, Object> objectMap = new HashMap<String, Object>();
|
||||
int exist = materialService.checkIsExist(id, name, model, color, standard, mfrs,
|
||||
otherField1, otherField2, otherField3, unit, unitId);
|
||||
if(exist > 0) {
|
||||
objectMap.put("status", true);
|
||||
} else {
|
||||
objectMap.put("status", false);
|
||||
}
|
||||
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量设置状态-启用或者禁用
|
||||
* @param enabled
|
||||
* @param materialIDs
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/batchSetEnable")
|
||||
public String batchSetEnable(@RequestParam("enabled") Boolean enabled,
|
||||
@RequestParam("materialIDs") String materialIDs,
|
||||
HttpServletRequest request) {
|
||||
Map<String, Object> objectMap = new HashMap<String, Object>();
|
||||
int res = materialService.batchSetEnable(enabled, materialIDs);
|
||||
if(res > 0) {
|
||||
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
|
||||
} else {
|
||||
return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id来查询商品名称
|
||||
* @param id
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/findById")
|
||||
public BaseResponseInfo findById(@RequestParam("id") Long id, HttpServletRequest request) {
|
||||
BaseResponseInfo res = new BaseResponseInfo();
|
||||
try {
|
||||
List<MaterialVo4Unit> list = materialService.findById(id);
|
||||
res.code = 200;
|
||||
res.data = list;
|
||||
} catch(Exception e){
|
||||
e.printStackTrace();
|
||||
res.code = 500;
|
||||
res.data = "获取数据失败";
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查找商品信息-下拉框
|
||||
* @param mpList
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/findBySelect")
|
||||
public JSONArray findBySelect(@RequestParam("mpList") String mpList, HttpServletRequest request) {
|
||||
JSONArray dataArray = new JSONArray();
|
||||
try {
|
||||
List<MaterialVo4Unit> dataList = materialService.findBySelect();
|
||||
String[] mpArr = mpList.split(",");
|
||||
//存放数据json数组
|
||||
if (null != dataList) {
|
||||
for (MaterialVo4Unit material : dataList) {
|
||||
JSONObject item = new JSONObject();
|
||||
item.put("Id", material.getId());
|
||||
String ratio; //比例
|
||||
if (material.getUnitid() == null || material.getUnitid().equals("")) {
|
||||
ratio = "";
|
||||
} else {
|
||||
ratio = material.getUnitName();
|
||||
ratio = ratio.substring(ratio.indexOf("("));
|
||||
}
|
||||
//品名/型号/扩展信息/包装
|
||||
String MaterialName = material.getName() + ((material.getModel() == null || material.getModel().equals("")) ? "" : "(" + material.getModel() + ")");
|
||||
for (int i = 0; i < mpArr.length; i++) {
|
||||
if (mpArr[i].equals("颜色")) {
|
||||
MaterialName = MaterialName + ((material.getColor() == null || material.getColor().equals("")) ? "" : "(" + material.getColor() + ")");
|
||||
}
|
||||
if (mpArr[i].equals("规格")) {
|
||||
MaterialName = MaterialName + ((material.getStandard() == null || material.getStandard().equals("")) ? "" : "(" + material.getStandard() + ")");
|
||||
}
|
||||
if (mpArr[i].equals("制造商")) {
|
||||
MaterialName = MaterialName + ((material.getMfrs() == null || material.getMfrs().equals("")) ? "" : "(" + material.getMfrs() + ")");
|
||||
}
|
||||
if (mpArr[i].equals("自定义1")) {
|
||||
MaterialName = MaterialName + ((material.getOtherfield1() == null || material.getOtherfield1().equals("")) ? "" : "(" + material.getOtherfield1() + ")");
|
||||
}
|
||||
if (mpArr[i].equals("自定义2")) {
|
||||
MaterialName = MaterialName + ((material.getOtherfield2() == null || material.getOtherfield2().equals("")) ? "" : "(" + material.getOtherfield2() + ")");
|
||||
}
|
||||
if (mpArr[i].equals("自定义3")) {
|
||||
MaterialName = MaterialName + ((material.getOtherfield3() == null || material.getOtherfield3().equals("")) ? "" : "(" + material.getOtherfield3() + ")");
|
||||
}
|
||||
}
|
||||
MaterialName = MaterialName + ((material.getUnit() == null || material.getUnit().equals("")) ? "" : "(" + material.getUnit() + ")") + ratio;
|
||||
item.put("MaterialName", MaterialName);
|
||||
dataArray.add(item);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return dataArray;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查找商品信息-统计排序
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/findByOrder")
|
||||
public BaseResponseInfo findByOrder(HttpServletRequest request) {
|
||||
BaseResponseInfo res = new BaseResponseInfo();
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
try {
|
||||
List<Material> dataList = materialService.findByOrder();
|
||||
String mId = "";
|
||||
if (null != dataList) {
|
||||
for (Material material : dataList) {
|
||||
mId = mId + material.getId() + ",";
|
||||
}
|
||||
}
|
||||
if (mId != "") {
|
||||
mId = mId.substring(0, mId.lastIndexOf(","));
|
||||
}
|
||||
map.put("mIds", mId);
|
||||
res.code = 200;
|
||||
res.data = map;
|
||||
} catch(Exception e){
|
||||
e.printStackTrace();
|
||||
res.code = 500;
|
||||
res.data = "获取数据失败";
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成excel表格
|
||||
* @param name
|
||||
* @param model
|
||||
* @param categoryId
|
||||
* @param categoryIds
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/exportExcel")
|
||||
public BaseResponseInfo exportExcel(@RequestParam("name") String name,
|
||||
@RequestParam("model") String model,
|
||||
@RequestParam("categoryId") Long categoryId,
|
||||
@RequestParam("categoryIds") String categoryIds,
|
||||
HttpServletRequest request, HttpServletResponse response) {
|
||||
BaseResponseInfo res = new BaseResponseInfo();
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String message = "成功";
|
||||
try {
|
||||
List<MaterialVo4Unit> dataList = materialService.findByAll(name, model, categoryId, categoryIds);
|
||||
String[] names = {"品名", "类型", "型号", "安全存量", "单位", "零售价", "最低售价", "预计采购价", "批发价", "备注", "状态"};
|
||||
String title = "商品信息";
|
||||
List<String[]> objects = new ArrayList<String[]>();
|
||||
if (null != dataList) {
|
||||
for (MaterialVo4Unit m : dataList) {
|
||||
String[] objs = new String[11];
|
||||
objs[0] = m.getName();
|
||||
objs[1] = m.getCategoryName();
|
||||
objs[2] = m.getModel();
|
||||
objs[3] = m.getSafetystock() == null? "" : m.getSafetystock().toString();
|
||||
objs[4] = m.getUnit();
|
||||
objs[5] = m.getRetailprice() == null ? "" : m.getRetailprice().toString();
|
||||
objs[6] = m.getLowprice() == null ? "" : m.getLowprice().toString();
|
||||
objs[7] = m.getPresetpriceone() == null ? "" : m.getPresetpriceone().toString();
|
||||
objs[8] = m.getPresetpricetwo() == null ? "" : m.getPresetpricetwo().toString();
|
||||
objs[9] = m.getRemark();
|
||||
objs[10] = m.getEnabled() ? "启用" : "禁用";
|
||||
objects.add(objs);
|
||||
}
|
||||
}
|
||||
File file = ExcelUtils.exportObjectsWithoutTitle(title, names, title, objects);
|
||||
ExportExecUtil.showExec(file, file.getName(), response);
|
||||
res.code = 200;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
message = "导出失败";
|
||||
res.code = 500;
|
||||
} finally {
|
||||
map.put("message", message);
|
||||
res.data = map;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* excel表格导入
|
||||
* @param materialFile
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/importExcel")
|
||||
public void importExcel(MultipartFile materialFile,
|
||||
HttpServletRequest request, HttpServletResponse response) throws Exception{
|
||||
BaseResponseInfo info = new BaseResponseInfo();
|
||||
Map<String, Object> data = new HashMap<String, Object>();
|
||||
String message = "成功";
|
||||
try {
|
||||
Sheet src = null;
|
||||
//文件合法性校验
|
||||
try {
|
||||
Workbook workbook = Workbook.getWorkbook(materialFile.getInputStream());
|
||||
src = workbook.getSheet(0);
|
||||
} catch (Exception e) {
|
||||
message = "导入文件不合法,请检查";
|
||||
data.put("message", message);
|
||||
info.code = 400;
|
||||
info.data = data;
|
||||
}
|
||||
//读取所有的摄像机编码
|
||||
//每行中数据顺序 "品名","类型","型号","安全存量","单位","零售价","最低售价","预计采购价","批发价","备注","状态"
|
||||
List<Material> mList = new ArrayList<Material>();
|
||||
for (int i = 1; i < src.getRows(); i++) {
|
||||
Material m = new Material();
|
||||
m.setName(ExcelUtils.getContent(src, i, 0));
|
||||
m.setCategoryid(1l); //根目录
|
||||
m.setModel(ExcelUtils.getContent(src, i, 2));
|
||||
String safetyStock = ExcelUtils.getContent(src, i, 3);
|
||||
m.setSafetystock(parseDoubleEx(safetyStock));
|
||||
m.setUnit(ExcelUtils.getContent(src, i, 4));
|
||||
String retailprice = ExcelUtils.getContent(src, i, 5);
|
||||
m.setRetailprice(parseDoubleEx(retailprice));
|
||||
String lowPrice = ExcelUtils.getContent(src, i, 6);
|
||||
m.setLowprice(parseDoubleEx(lowPrice));
|
||||
String presetpriceone = ExcelUtils.getContent(src, i, 7);
|
||||
m.setPresetpriceone(parseDoubleEx(presetpriceone));
|
||||
String presetpricetwo = ExcelUtils.getContent(src, i, 8);
|
||||
m.setPresetpricetwo(parseDoubleEx(presetpricetwo));
|
||||
m.setRemark(ExcelUtils.getContent(src, i, 9));
|
||||
String enabled = ExcelUtils.getContent(src, i, 10);
|
||||
m.setEnabled(enabled.equals("启用")? true: false);
|
||||
mList.add(m);
|
||||
}
|
||||
info = materialService.importExcel(mList);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
message = "导入失败";
|
||||
info.code = 500;
|
||||
data.put("message", message);
|
||||
info.data = data;
|
||||
}
|
||||
response.sendRedirect("../pages/materials/material.html");
|
||||
}
|
||||
|
||||
public Double parseDoubleEx(String str){
|
||||
if(!StringUtil.isEmpty(str)) {
|
||||
return Double.parseDouble(str);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,262 +1,434 @@
|
||||
package com.jsh.erp.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jsh.erp.datasource.entities.Supplier;
|
||||
import com.jsh.erp.service.supplier.SupplierService;
|
||||
import com.jsh.erp.service.userBusiness.UserBusinessService;
|
||||
import com.jsh.erp.utils.BaseResponseInfo;
|
||||
import com.jsh.erp.utils.ErpInfo;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.dao.DataAccessException;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
|
||||
|
||||
/**
|
||||
* @author ji|sheng|hua 华夏erp
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(value = "/supplier")
|
||||
public class SupplierController {
|
||||
private Logger logger = LoggerFactory.getLogger(SupplierController.class);
|
||||
|
||||
@Resource
|
||||
private SupplierService supplierService;
|
||||
|
||||
@Resource
|
||||
private UserBusinessService userBusinessService;
|
||||
|
||||
/**
|
||||
* 更新供应商-只更新预付款,其余用原来的值
|
||||
* @param supplierId
|
||||
* @param advanceIn
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/updateAdvanceIn")
|
||||
public String updateAdvanceIn(@RequestParam("supplierId") Long supplierId,
|
||||
@RequestParam("advanceIn") Double advanceIn,
|
||||
HttpServletRequest request) {
|
||||
Map<String, Object> objectMap = new HashMap<String, Object>();
|
||||
int res = supplierService.updateAdvanceIn(supplierId, advanceIn);
|
||||
if(res > 0) {
|
||||
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
|
||||
} else {
|
||||
return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查找客户信息-下拉框
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/findBySelect_cus")
|
||||
public JSONArray findBySelectCus(HttpServletRequest request) {
|
||||
JSONArray arr = new JSONArray();
|
||||
try {
|
||||
List<Supplier> supplierList = supplierService.findBySelectCus();
|
||||
JSONArray dataArray = new JSONArray();
|
||||
if (null != supplierList) {
|
||||
for (Supplier supplier : supplierList) {
|
||||
JSONObject item = new JSONObject();
|
||||
//勾选判断1
|
||||
Boolean flag = false;
|
||||
try {
|
||||
flag = userBusinessService.checkIsUserBusinessExist(null, null, "[" + supplier.getId().toString() + "]");
|
||||
} catch (DataAccessException e) {
|
||||
logger.error(">>>>>>>>>>>>>>>>>查询用户对应的客户:存在异常!");
|
||||
}
|
||||
if (flag == true) {
|
||||
item.put("id", supplier.getId());
|
||||
item.put("supplier", supplier.getSupplier()); //客户名称
|
||||
dataArray.add(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
arr = dataArray;
|
||||
} catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查找供应商信息-下拉框
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/findBySelect_sup")
|
||||
public JSONArray findBySelectSup(HttpServletRequest request) {
|
||||
JSONArray arr = new JSONArray();
|
||||
try {
|
||||
List<Supplier> supplierList = supplierService.findBySelectSup();
|
||||
JSONArray dataArray = new JSONArray();
|
||||
if (null != supplierList) {
|
||||
for (Supplier supplier : supplierList) {
|
||||
JSONObject item = new JSONObject();
|
||||
item.put("id", supplier.getId());
|
||||
//供应商名称
|
||||
item.put("supplier", supplier.getSupplier());
|
||||
dataArray.add(item);
|
||||
}
|
||||
}
|
||||
arr = dataArray;
|
||||
} catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查找会员信息-下拉框
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/findBySelect_retail")
|
||||
public JSONArray findBySelectRetail(HttpServletRequest request) {
|
||||
JSONArray arr = new JSONArray();
|
||||
try {
|
||||
List<Supplier> supplierList = supplierService.findBySelectRetail();
|
||||
JSONArray dataArray = new JSONArray();
|
||||
if (null != supplierList) {
|
||||
for (Supplier supplier : supplierList) {
|
||||
JSONObject item = new JSONObject();
|
||||
item.put("id", supplier.getId());
|
||||
//客户名称
|
||||
item.put("supplier", supplier.getSupplier());
|
||||
item.put("advanceIn", supplier.getAdvancein()); //预付款金额
|
||||
dataArray.add(item);
|
||||
}
|
||||
}
|
||||
arr = dataArray;
|
||||
} catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查找信息
|
||||
* @param supplierId
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/findById")
|
||||
public BaseResponseInfo findById(@RequestParam("supplierId") Long supplierId,
|
||||
HttpServletRequest request) {
|
||||
BaseResponseInfo res = new BaseResponseInfo();
|
||||
try {
|
||||
JSONArray dataArray = new JSONArray();
|
||||
List<Supplier> dataList = supplierService.findById(supplierId);
|
||||
if (null != dataList) {
|
||||
for (Supplier supplier : dataList) {
|
||||
JSONObject item = new JSONObject();
|
||||
item.put("id", supplier.getId());
|
||||
//名称
|
||||
item.put("supplier", supplier.getSupplier());
|
||||
item.put("type", supplier.getType());
|
||||
item.put("contacts", supplier.getContacts());
|
||||
item.put("phonenum", supplier.getPhonenum());
|
||||
item.put("email", supplier.getEmail());
|
||||
item.put("AdvanceIn", supplier.getAdvancein());
|
||||
item.put("BeginNeedGet", supplier.getBeginneedget());
|
||||
item.put("BeginNeedPay", supplier.getBeginneedpay());
|
||||
item.put("isystem", supplier.getIsystem() == (short) 0 ? "是" : "否");
|
||||
item.put("description", supplier.getDescription());
|
||||
item.put("fax", supplier.getFax());
|
||||
item.put("telephone", supplier.getTelephone());
|
||||
item.put("address", supplier.getAddress());
|
||||
item.put("taxNum", supplier.getTaxnum());
|
||||
item.put("bankName", supplier.getBankname());
|
||||
item.put("accountNumber", supplier.getAccountnumber());
|
||||
item.put("taxRate", supplier.getTaxrate());
|
||||
item.put("enabled", supplier.getEnabled());
|
||||
dataArray.add(item);
|
||||
}
|
||||
res.code = 200;
|
||||
res.data = dataArray;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
res.code = 500;
|
||||
res.data = "获取数据失败";
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量设置状态-启用或者禁用
|
||||
* @param enabled
|
||||
* @param supplierIDs
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/batchSetEnable")
|
||||
public String batchSetEnable(@RequestParam("enabled") Boolean enabled,
|
||||
@RequestParam("supplierIDs") String supplierIDs,
|
||||
HttpServletRequest request) {
|
||||
Map<String, Object> objectMap = new HashMap<String, Object>();
|
||||
int res = supplierService.batchSetEnable(enabled, supplierIDs);
|
||||
if(res > 0) {
|
||||
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
|
||||
} else {
|
||||
return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户对应客户显示
|
||||
* @param type
|
||||
* @param keyId
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/findUserCustomer")
|
||||
public JSONArray findUserCustomer(@RequestParam("UBType") String type, @RequestParam("UBKeyId") String keyId,
|
||||
HttpServletRequest request) {
|
||||
JSONArray arr = new JSONArray();
|
||||
try {
|
||||
List<Supplier> dataList = supplierService.findUserCustomer();
|
||||
//开始拼接json数据
|
||||
JSONObject outer = new JSONObject();
|
||||
outer.put("id", 1);
|
||||
outer.put("text", "客户列表");
|
||||
outer.put("state", "open");
|
||||
//存放数据json数组
|
||||
JSONArray dataArray = new JSONArray();
|
||||
if (null != dataList) {
|
||||
for (Supplier supplier : dataList) {
|
||||
JSONObject item = new JSONObject();
|
||||
item.put("id", supplier.getId());
|
||||
item.put("text", supplier.getSupplier());
|
||||
//勾选判断1
|
||||
Boolean flag = false;
|
||||
try {
|
||||
flag = userBusinessService.checkIsUserBusinessExist(type, keyId, "[" + supplier.getId().toString() + "]");
|
||||
} catch (Exception e) {
|
||||
logger.error(">>>>>>>>>>>>>>>>>设置用户对应的客户:类型" + type + " KeyId为: " + keyId + " 存在异常!");
|
||||
}
|
||||
if (flag == true) {
|
||||
item.put("checked", true);
|
||||
}
|
||||
//结束
|
||||
dataArray.add(item);
|
||||
}
|
||||
}
|
||||
outer.put("children", dataArray);
|
||||
arr.add(outer);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
}
|
||||
package com.jsh.erp.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jsh.erp.datasource.entities.Supplier;
|
||||
import com.jsh.erp.service.supplier.SupplierService;
|
||||
import com.jsh.erp.service.userBusiness.UserBusinessService;
|
||||
import com.jsh.erp.utils.*;
|
||||
import jxl.Sheet;
|
||||
import jxl.Workbook;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.dao.DataAccessException;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
|
||||
|
||||
/**
|
||||
* @author ji|sheng|hua 华夏erp
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(value = "/supplier")
|
||||
public class SupplierController {
|
||||
private Logger logger = LoggerFactory.getLogger(SupplierController.class);
|
||||
|
||||
@Resource
|
||||
private SupplierService supplierService;
|
||||
|
||||
@Resource
|
||||
private UserBusinessService userBusinessService;
|
||||
|
||||
/**
|
||||
* 更新供应商-只更新预付款,其余用原来的值
|
||||
* @param supplierId
|
||||
* @param advanceIn
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/updateAdvanceIn")
|
||||
public String updateAdvanceIn(@RequestParam("supplierId") Long supplierId,
|
||||
@RequestParam("advanceIn") Double advanceIn,
|
||||
HttpServletRequest request) {
|
||||
Map<String, Object> objectMap = new HashMap<String, Object>();
|
||||
int res = supplierService.updateAdvanceIn(supplierId, advanceIn);
|
||||
if(res > 0) {
|
||||
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
|
||||
} else {
|
||||
return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查找客户信息-下拉框
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/findBySelect_cus")
|
||||
public JSONArray findBySelectCus(HttpServletRequest request) {
|
||||
JSONArray arr = new JSONArray();
|
||||
try {
|
||||
List<Supplier> supplierList = supplierService.findBySelectCus();
|
||||
JSONArray dataArray = new JSONArray();
|
||||
if (null != supplierList) {
|
||||
for (Supplier supplier : supplierList) {
|
||||
JSONObject item = new JSONObject();
|
||||
//勾选判断1
|
||||
Boolean flag = false;
|
||||
try {
|
||||
flag = userBusinessService.checkIsUserBusinessExist(null, null, "[" + supplier.getId().toString() + "]");
|
||||
} catch (DataAccessException e) {
|
||||
logger.error(">>>>>>>>>>>>>>>>>查询用户对应的客户:存在异常!");
|
||||
}
|
||||
if (flag == true) {
|
||||
item.put("id", supplier.getId());
|
||||
item.put("supplier", supplier.getSupplier()); //客户名称
|
||||
dataArray.add(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
arr = dataArray;
|
||||
} catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查找供应商信息-下拉框
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/findBySelect_sup")
|
||||
public JSONArray findBySelectSup(HttpServletRequest request) {
|
||||
JSONArray arr = new JSONArray();
|
||||
try {
|
||||
List<Supplier> supplierList = supplierService.findBySelectSup();
|
||||
JSONArray dataArray = new JSONArray();
|
||||
if (null != supplierList) {
|
||||
for (Supplier supplier : supplierList) {
|
||||
JSONObject item = new JSONObject();
|
||||
item.put("id", supplier.getId());
|
||||
//供应商名称
|
||||
item.put("supplier", supplier.getSupplier());
|
||||
dataArray.add(item);
|
||||
}
|
||||
}
|
||||
arr = dataArray;
|
||||
} catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查找会员信息-下拉框
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/findBySelect_retail")
|
||||
public JSONArray findBySelectRetail(HttpServletRequest request) {
|
||||
JSONArray arr = new JSONArray();
|
||||
try {
|
||||
List<Supplier> supplierList = supplierService.findBySelectRetail();
|
||||
JSONArray dataArray = new JSONArray();
|
||||
if (null != supplierList) {
|
||||
for (Supplier supplier : supplierList) {
|
||||
JSONObject item = new JSONObject();
|
||||
item.put("id", supplier.getId());
|
||||
//客户名称
|
||||
item.put("supplier", supplier.getSupplier());
|
||||
item.put("advanceIn", supplier.getAdvancein()); //预付款金额
|
||||
dataArray.add(item);
|
||||
}
|
||||
}
|
||||
arr = dataArray;
|
||||
} catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查找信息
|
||||
* @param supplierId
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/findById")
|
||||
public BaseResponseInfo findById(@RequestParam("supplierId") Long supplierId,
|
||||
HttpServletRequest request) {
|
||||
BaseResponseInfo res = new BaseResponseInfo();
|
||||
try {
|
||||
JSONArray dataArray = new JSONArray();
|
||||
List<Supplier> dataList = supplierService.findById(supplierId);
|
||||
if (null != dataList) {
|
||||
for (Supplier supplier : dataList) {
|
||||
JSONObject item = new JSONObject();
|
||||
item.put("id", supplier.getId());
|
||||
//名称
|
||||
item.put("supplier", supplier.getSupplier());
|
||||
item.put("type", supplier.getType());
|
||||
item.put("contacts", supplier.getContacts());
|
||||
item.put("phonenum", supplier.getPhonenum());
|
||||
item.put("email", supplier.getEmail());
|
||||
item.put("AdvanceIn", supplier.getAdvancein());
|
||||
item.put("BeginNeedGet", supplier.getBeginneedget());
|
||||
item.put("BeginNeedPay", supplier.getBeginneedpay());
|
||||
item.put("isystem", supplier.getIsystem() == (short) 0 ? "是" : "否");
|
||||
item.put("description", supplier.getDescription());
|
||||
item.put("fax", supplier.getFax());
|
||||
item.put("telephone", supplier.getTelephone());
|
||||
item.put("address", supplier.getAddress());
|
||||
item.put("taxNum", supplier.getTaxnum());
|
||||
item.put("bankName", supplier.getBankname());
|
||||
item.put("accountNumber", supplier.getAccountnumber());
|
||||
item.put("taxRate", supplier.getTaxrate());
|
||||
item.put("enabled", supplier.getEnabled());
|
||||
dataArray.add(item);
|
||||
}
|
||||
res.code = 200;
|
||||
res.data = dataArray;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
res.code = 500;
|
||||
res.data = "获取数据失败";
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量设置状态-启用或者禁用
|
||||
* @param enabled
|
||||
* @param supplierIDs
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/batchSetEnable")
|
||||
public String batchSetEnable(@RequestParam("enabled") Boolean enabled,
|
||||
@RequestParam("supplierIDs") String supplierIDs,
|
||||
HttpServletRequest request) {
|
||||
Map<String, Object> objectMap = new HashMap<String, Object>();
|
||||
int res = supplierService.batchSetEnable(enabled, supplierIDs);
|
||||
if(res > 0) {
|
||||
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
|
||||
} else {
|
||||
return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户对应客户显示
|
||||
* @param type
|
||||
* @param keyId
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/findUserCustomer")
|
||||
public JSONArray findUserCustomer(@RequestParam("UBType") String type, @RequestParam("UBKeyId") String keyId,
|
||||
HttpServletRequest request) {
|
||||
JSONArray arr = new JSONArray();
|
||||
try {
|
||||
List<Supplier> dataList = supplierService.findUserCustomer();
|
||||
//开始拼接json数据
|
||||
JSONObject outer = new JSONObject();
|
||||
outer.put("id", 1);
|
||||
outer.put("text", "客户列表");
|
||||
outer.put("state", "open");
|
||||
//存放数据json数组
|
||||
JSONArray dataArray = new JSONArray();
|
||||
if (null != dataList) {
|
||||
for (Supplier supplier : dataList) {
|
||||
JSONObject item = new JSONObject();
|
||||
item.put("id", supplier.getId());
|
||||
item.put("text", supplier.getSupplier());
|
||||
//勾选判断1
|
||||
Boolean flag = false;
|
||||
try {
|
||||
flag = userBusinessService.checkIsUserBusinessExist(type, keyId, "[" + supplier.getId().toString() + "]");
|
||||
} catch (Exception e) {
|
||||
logger.error(">>>>>>>>>>>>>>>>>设置用户对应的客户:类型" + type + " KeyId为: " + keyId + " 存在异常!");
|
||||
}
|
||||
if (flag == true) {
|
||||
item.put("checked", true);
|
||||
}
|
||||
//结束
|
||||
dataArray.add(item);
|
||||
}
|
||||
}
|
||||
outer.put("children", dataArray);
|
||||
arr.add(outer);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成excel表格
|
||||
* @param supplier
|
||||
* @param type
|
||||
* @param phonenum
|
||||
* @param telephone
|
||||
* @param description
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/exportExcel")
|
||||
public BaseResponseInfo exportExcel(@RequestParam("supplier") String supplier,
|
||||
@RequestParam("type") String type,
|
||||
@RequestParam("phonenum") String phonenum,
|
||||
@RequestParam("telephone") String telephone,
|
||||
@RequestParam("description") String description,
|
||||
HttpServletRequest request, HttpServletResponse response) {
|
||||
BaseResponseInfo res = new BaseResponseInfo();
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String message = "成功";
|
||||
try {
|
||||
List<Supplier> dataList = supplierService.findByAll(supplier, type, phonenum, telephone, description);
|
||||
String[] names = {"名称", "类型", "联系人", "电话", "电子邮箱", "预收款", "期初应收", "期初应付", "备注", "传真", "手机", "地址", "纳税人识别号", "开户行", "账号", "税率", "状态"};
|
||||
String title = "信息报表";
|
||||
List<String[]> objects = new ArrayList<String[]>();
|
||||
if (null != dataList) {
|
||||
for (Supplier s : dataList) {
|
||||
String[] objs = new String[17];
|
||||
objs[0] = s.getSupplier();
|
||||
objs[1] = s.getType();
|
||||
objs[2] = s.getContacts();
|
||||
objs[3] = s.getPhonenum();
|
||||
objs[4] = s.getEmail();
|
||||
objs[5] = s.getAdvancein() == null? "" : s.getAdvancein().toString();
|
||||
objs[6] = s.getBeginneedget() == null? "" : s.getBeginneedget().toString();
|
||||
objs[7] = s.getBeginneedpay() == null? "" : s.getBeginneedpay().toString();
|
||||
objs[8] = s.getDescription();
|
||||
objs[9] = s.getFax();
|
||||
objs[10] = s.getTelephone();
|
||||
objs[11] = s.getAddress();
|
||||
objs[12] = s.getTaxnum();
|
||||
objs[13] = s.getBankname();
|
||||
objs[14] = s.getAccountnumber();
|
||||
objs[15] = s.getTaxrate() == null? "" : s.getTaxrate().toString();
|
||||
objs[16] = s.getEnabled() ? "启用" : "禁用";
|
||||
objects.add(objs);
|
||||
}
|
||||
}
|
||||
File file = ExcelUtils.exportObjectsWithoutTitle(title, names, title, objects);
|
||||
ExportExecUtil.showExec(file, file.getName(), response);
|
||||
res.code = 200;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
message = "导出失败";
|
||||
res.code = 500;
|
||||
} finally {
|
||||
map.put("message", message);
|
||||
res.data = map;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入excel表格-供应商
|
||||
* @param supplierFile
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/importExcelVendor")
|
||||
public void importExcelVendor(MultipartFile supplierFile,
|
||||
HttpServletRequest request, HttpServletResponse response) throws Exception{
|
||||
importFun(supplierFile);
|
||||
response.sendRedirect("../pages/manage/vendor.html");
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入excel表格-客户
|
||||
* @param supplierFile
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/importExcelCustomer")
|
||||
public void importExcelCustomer(MultipartFile supplierFile,
|
||||
HttpServletRequest request, HttpServletResponse response) throws Exception{
|
||||
importFun(supplierFile);
|
||||
response.sendRedirect("../pages/manage/customer.html");
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入excel表格-会员
|
||||
* @param supplierFile
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/importExcelMember")
|
||||
public void importExcelMember(MultipartFile supplierFile,
|
||||
HttpServletRequest request, HttpServletResponse response) throws Exception{
|
||||
importFun(supplierFile);
|
||||
response.sendRedirect("../pages/manage/member.html");
|
||||
}
|
||||
|
||||
public String importFun(MultipartFile supplierFile){
|
||||
BaseResponseInfo info = new BaseResponseInfo();
|
||||
Map<String, Object> data = new HashMap<String, Object>();
|
||||
String message = "成功";
|
||||
try {
|
||||
Sheet src = null;
|
||||
//文件合法性校验
|
||||
try {
|
||||
Workbook workbook = Workbook.getWorkbook(supplierFile.getInputStream());
|
||||
src = workbook.getSheet(0);
|
||||
} catch (Exception e) {
|
||||
message = "导入文件不合法,请检查";
|
||||
data.put("message", message);
|
||||
info.code = 400;
|
||||
info.data = data;
|
||||
}
|
||||
//读取所有的摄像机编码
|
||||
//每行中数据顺序 "名称","类型","联系人","电话","电子邮箱","预收款","期初应收","期初应付","备注","传真","手机","地址","纳税人识别号","开户行","账号","税率","状态"
|
||||
List<Supplier> sList = new ArrayList<Supplier>();
|
||||
for (int i = 1; i < src.getRows(); i++) {
|
||||
Supplier s = new Supplier();
|
||||
s.setSupplier(ExcelUtils.getContent(src, i, 0));
|
||||
s.setType(ExcelUtils.getContent(src, i, 1));
|
||||
s.setContacts(ExcelUtils.getContent(src, i, 2));
|
||||
s.setPhonenum(ExcelUtils.getContent(src, i, 3));
|
||||
s.setEmail(ExcelUtils.getContent(src, i, 4));
|
||||
s.setAdvancein(parseDoubleEx(ExcelUtils.getContent(src, i, 5)));
|
||||
s.setBeginneedget(parseDoubleEx(ExcelUtils.getContent(src, i, 6)));
|
||||
s.setBeginneedpay(parseDoubleEx(ExcelUtils.getContent(src, i, 7)));
|
||||
s.setDescription(ExcelUtils.getContent(src, i, 8));
|
||||
s.setFax(ExcelUtils.getContent(src, i, 9));
|
||||
s.setTelephone(ExcelUtils.getContent(src, i, 10));
|
||||
s.setAddress(ExcelUtils.getContent(src, i, 11));
|
||||
s.setTaxnum(ExcelUtils.getContent(src, i, 12));
|
||||
s.setBankname(ExcelUtils.getContent(src, i, 13));
|
||||
s.setAccountnumber(ExcelUtils.getContent(src, i, 14));
|
||||
s.setTaxrate(parseDoubleEx(ExcelUtils.getContent(src, i, 15)));
|
||||
String enabled = ExcelUtils.getContent(src, i, 16);
|
||||
s.setEnabled(enabled.equals("启用")? true: false);
|
||||
s.setIsystem(Byte.parseByte("1"));
|
||||
sList.add(s);
|
||||
}
|
||||
info = supplierService.importExcel(sList);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
message = "导入失败";
|
||||
info.code = 500;
|
||||
data.put("message", message);
|
||||
info.data = data;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Double parseDoubleEx(String str){
|
||||
if(!StringUtil.isEmpty(str)) {
|
||||
return Double.parseDouble(str);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,364 +1,374 @@
|
||||
package com.jsh.erp.datasource.entities;
|
||||
|
||||
public class DepotItemVo4WithInfoEx {
|
||||
|
||||
private Long id;
|
||||
|
||||
private Long headerid;
|
||||
|
||||
private Long materialid;
|
||||
|
||||
private String munit;
|
||||
|
||||
private Double opernumber;
|
||||
|
||||
private Double basicnumber;
|
||||
|
||||
private Double unitprice;
|
||||
|
||||
private Double taxunitprice;
|
||||
|
||||
private Double allprice;
|
||||
|
||||
private String remark;
|
||||
|
||||
private String img;
|
||||
|
||||
private Double incidentals;
|
||||
|
||||
private Long depotid;
|
||||
|
||||
private Long anotherdepotid;
|
||||
|
||||
private Double taxrate;
|
||||
|
||||
private Double taxmoney;
|
||||
|
||||
private Double taxlastmoney;
|
||||
|
||||
private String otherfield1;
|
||||
|
||||
private String otherfield2;
|
||||
|
||||
private String otherfield3;
|
||||
|
||||
private String otherfield4;
|
||||
|
||||
private String otherfield5;
|
||||
|
||||
private String mtype;
|
||||
|
||||
private String MName;
|
||||
|
||||
private String MModel;
|
||||
|
||||
private String MaterialUnit;
|
||||
|
||||
private String MColor;
|
||||
|
||||
private String MStandard;
|
||||
|
||||
private String MMfrs;
|
||||
|
||||
private String MOtherField1;
|
||||
|
||||
private String MOtherField2;
|
||||
|
||||
private String MOtherField3;
|
||||
|
||||
private String DepotName;
|
||||
|
||||
private String AnotherDepotName;
|
||||
|
||||
private Long UnitId;
|
||||
|
||||
private String UName;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getHeaderid() {
|
||||
return headerid;
|
||||
}
|
||||
|
||||
public void setHeaderid(Long headerid) {
|
||||
this.headerid = headerid;
|
||||
}
|
||||
|
||||
public Long getMaterialid() {
|
||||
return materialid;
|
||||
}
|
||||
|
||||
public void setMaterialid(Long materialid) {
|
||||
this.materialid = materialid;
|
||||
}
|
||||
|
||||
public String getMunit() {
|
||||
return munit;
|
||||
}
|
||||
|
||||
public void setMunit(String munit) {
|
||||
this.munit = munit;
|
||||
}
|
||||
|
||||
public Double getOpernumber() {
|
||||
return opernumber;
|
||||
}
|
||||
|
||||
public void setOpernumber(Double opernumber) {
|
||||
this.opernumber = opernumber;
|
||||
}
|
||||
|
||||
public Double getBasicnumber() {
|
||||
return basicnumber;
|
||||
}
|
||||
|
||||
public void setBasicnumber(Double basicnumber) {
|
||||
this.basicnumber = basicnumber;
|
||||
}
|
||||
|
||||
public Double getUnitprice() {
|
||||
return unitprice;
|
||||
}
|
||||
|
||||
public void setUnitprice(Double unitprice) {
|
||||
this.unitprice = unitprice;
|
||||
}
|
||||
|
||||
public Double getTaxunitprice() {
|
||||
return taxunitprice;
|
||||
}
|
||||
|
||||
public void setTaxunitprice(Double taxunitprice) {
|
||||
this.taxunitprice = taxunitprice;
|
||||
}
|
||||
|
||||
public Double getAllprice() {
|
||||
return allprice;
|
||||
}
|
||||
|
||||
public void setAllprice(Double allprice) {
|
||||
this.allprice = allprice;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public String getImg() {
|
||||
return img;
|
||||
}
|
||||
|
||||
public void setImg(String img) {
|
||||
this.img = img;
|
||||
}
|
||||
|
||||
public Double getIncidentals() {
|
||||
return incidentals;
|
||||
}
|
||||
|
||||
public void setIncidentals(Double incidentals) {
|
||||
this.incidentals = incidentals;
|
||||
}
|
||||
|
||||
public Long getDepotid() {
|
||||
return depotid;
|
||||
}
|
||||
|
||||
public void setDepotid(Long depotid) {
|
||||
this.depotid = depotid;
|
||||
}
|
||||
|
||||
public Long getAnotherdepotid() {
|
||||
return anotherdepotid;
|
||||
}
|
||||
|
||||
public void setAnotherdepotid(Long anotherdepotid) {
|
||||
this.anotherdepotid = anotherdepotid;
|
||||
}
|
||||
|
||||
public Double getTaxrate() {
|
||||
return taxrate;
|
||||
}
|
||||
|
||||
public void setTaxrate(Double taxrate) {
|
||||
this.taxrate = taxrate;
|
||||
}
|
||||
|
||||
public Double getTaxmoney() {
|
||||
return taxmoney;
|
||||
}
|
||||
|
||||
public void setTaxmoney(Double taxmoney) {
|
||||
this.taxmoney = taxmoney;
|
||||
}
|
||||
|
||||
public Double getTaxlastmoney() {
|
||||
return taxlastmoney;
|
||||
}
|
||||
|
||||
public void setTaxlastmoney(Double taxlastmoney) {
|
||||
this.taxlastmoney = taxlastmoney;
|
||||
}
|
||||
|
||||
public String getOtherfield1() {
|
||||
return otherfield1;
|
||||
}
|
||||
|
||||
public void setOtherfield1(String otherfield1) {
|
||||
this.otherfield1 = otherfield1;
|
||||
}
|
||||
|
||||
public String getOtherfield2() {
|
||||
return otherfield2;
|
||||
}
|
||||
|
||||
public void setOtherfield2(String otherfield2) {
|
||||
this.otherfield2 = otherfield2;
|
||||
}
|
||||
|
||||
public String getOtherfield3() {
|
||||
return otherfield3;
|
||||
}
|
||||
|
||||
public void setOtherfield3(String otherfield3) {
|
||||
this.otherfield3 = otherfield3;
|
||||
}
|
||||
|
||||
public String getOtherfield4() {
|
||||
return otherfield4;
|
||||
}
|
||||
|
||||
public void setOtherfield4(String otherfield4) {
|
||||
this.otherfield4 = otherfield4;
|
||||
}
|
||||
|
||||
public String getOtherfield5() {
|
||||
return otherfield5;
|
||||
}
|
||||
|
||||
public void setOtherfield5(String otherfield5) {
|
||||
this.otherfield5 = otherfield5;
|
||||
}
|
||||
|
||||
public String getMtype() {
|
||||
return mtype;
|
||||
}
|
||||
|
||||
public void setMtype(String mtype) {
|
||||
this.mtype = mtype;
|
||||
}
|
||||
|
||||
public String getMName() {
|
||||
return MName;
|
||||
}
|
||||
|
||||
public void setMName(String MName) {
|
||||
this.MName = MName;
|
||||
}
|
||||
|
||||
public String getMModel() {
|
||||
return MModel;
|
||||
}
|
||||
|
||||
public void setMModel(String MModel) {
|
||||
this.MModel = MModel;
|
||||
}
|
||||
|
||||
public String getMaterialUnit() {
|
||||
return MaterialUnit;
|
||||
}
|
||||
|
||||
public void setMaterialUnit(String materialUnit) {
|
||||
MaterialUnit = materialUnit;
|
||||
}
|
||||
|
||||
public String getMColor() {
|
||||
return MColor;
|
||||
}
|
||||
|
||||
public void setMColor(String MColor) {
|
||||
this.MColor = MColor;
|
||||
}
|
||||
|
||||
public String getMStandard() {
|
||||
return MStandard;
|
||||
}
|
||||
|
||||
public void setMStandard(String MStandard) {
|
||||
this.MStandard = MStandard;
|
||||
}
|
||||
|
||||
public String getMMfrs() {
|
||||
return MMfrs;
|
||||
}
|
||||
|
||||
public void setMMfrs(String MMfrs) {
|
||||
this.MMfrs = MMfrs;
|
||||
}
|
||||
|
||||
public String getMOtherField1() {
|
||||
return MOtherField1;
|
||||
}
|
||||
|
||||
public void setMOtherField1(String MOtherField1) {
|
||||
this.MOtherField1 = MOtherField1;
|
||||
}
|
||||
|
||||
public String getMOtherField2() {
|
||||
return MOtherField2;
|
||||
}
|
||||
|
||||
public void setMOtherField2(String MOtherField2) {
|
||||
this.MOtherField2 = MOtherField2;
|
||||
}
|
||||
|
||||
public String getMOtherField3() {
|
||||
return MOtherField3;
|
||||
}
|
||||
|
||||
public void setMOtherField3(String MOtherField3) {
|
||||
this.MOtherField3 = MOtherField3;
|
||||
}
|
||||
|
||||
public String getDepotName() {
|
||||
return DepotName;
|
||||
}
|
||||
|
||||
public void setDepotName(String depotName) {
|
||||
DepotName = depotName;
|
||||
}
|
||||
|
||||
public String getAnotherDepotName() {
|
||||
return AnotherDepotName;
|
||||
}
|
||||
|
||||
public void setAnotherDepotName(String anotherDepotName) {
|
||||
AnotherDepotName = anotherDepotName;
|
||||
}
|
||||
|
||||
public Long getUnitId() {
|
||||
return UnitId;
|
||||
}
|
||||
|
||||
public void setUnitId(Long unitId) {
|
||||
UnitId = unitId;
|
||||
}
|
||||
|
||||
public String getUName() {
|
||||
return UName;
|
||||
}
|
||||
|
||||
public void setUName(String UName) {
|
||||
this.UName = UName;
|
||||
}
|
||||
package com.jsh.erp.datasource.entities;
|
||||
|
||||
public class DepotItemVo4WithInfoEx {
|
||||
|
||||
private Long id;
|
||||
|
||||
private Long headerid;
|
||||
|
||||
private Long materialid;
|
||||
|
||||
private String munit;
|
||||
|
||||
private Double opernumber;
|
||||
|
||||
private Double basicnumber;
|
||||
|
||||
private Double unitprice;
|
||||
|
||||
private Double taxunitprice;
|
||||
|
||||
private Double allprice;
|
||||
|
||||
private String remark;
|
||||
|
||||
private String img;
|
||||
|
||||
private Double incidentals;
|
||||
|
||||
private Long depotid;
|
||||
|
||||
private Long anotherdepotid;
|
||||
|
||||
private Double taxrate;
|
||||
|
||||
private Double taxmoney;
|
||||
|
||||
private Double taxlastmoney;
|
||||
|
||||
private String otherfield1;
|
||||
|
||||
private String otherfield2;
|
||||
|
||||
private String otherfield3;
|
||||
|
||||
private String otherfield4;
|
||||
|
||||
private String otherfield5;
|
||||
|
||||
private String mtype;
|
||||
|
||||
private Long MId;
|
||||
|
||||
private String MName;
|
||||
|
||||
private String MModel;
|
||||
|
||||
private String MaterialUnit;
|
||||
|
||||
private String MColor;
|
||||
|
||||
private String MStandard;
|
||||
|
||||
private String MMfrs;
|
||||
|
||||
private String MOtherField1;
|
||||
|
||||
private String MOtherField2;
|
||||
|
||||
private String MOtherField3;
|
||||
|
||||
private String DepotName;
|
||||
|
||||
private String AnotherDepotName;
|
||||
|
||||
private Long UnitId;
|
||||
|
||||
private String UName;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getHeaderid() {
|
||||
return headerid;
|
||||
}
|
||||
|
||||
public void setHeaderid(Long headerid) {
|
||||
this.headerid = headerid;
|
||||
}
|
||||
|
||||
public Long getMaterialid() {
|
||||
return materialid;
|
||||
}
|
||||
|
||||
public void setMaterialid(Long materialid) {
|
||||
this.materialid = materialid;
|
||||
}
|
||||
|
||||
public String getMunit() {
|
||||
return munit;
|
||||
}
|
||||
|
||||
public void setMunit(String munit) {
|
||||
this.munit = munit;
|
||||
}
|
||||
|
||||
public Double getOpernumber() {
|
||||
return opernumber;
|
||||
}
|
||||
|
||||
public void setOpernumber(Double opernumber) {
|
||||
this.opernumber = opernumber;
|
||||
}
|
||||
|
||||
public Double getBasicnumber() {
|
||||
return basicnumber;
|
||||
}
|
||||
|
||||
public void setBasicnumber(Double basicnumber) {
|
||||
this.basicnumber = basicnumber;
|
||||
}
|
||||
|
||||
public Double getUnitprice() {
|
||||
return unitprice;
|
||||
}
|
||||
|
||||
public void setUnitprice(Double unitprice) {
|
||||
this.unitprice = unitprice;
|
||||
}
|
||||
|
||||
public Double getTaxunitprice() {
|
||||
return taxunitprice;
|
||||
}
|
||||
|
||||
public void setTaxunitprice(Double taxunitprice) {
|
||||
this.taxunitprice = taxunitprice;
|
||||
}
|
||||
|
||||
public Double getAllprice() {
|
||||
return allprice;
|
||||
}
|
||||
|
||||
public void setAllprice(Double allprice) {
|
||||
this.allprice = allprice;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public String getImg() {
|
||||
return img;
|
||||
}
|
||||
|
||||
public void setImg(String img) {
|
||||
this.img = img;
|
||||
}
|
||||
|
||||
public Double getIncidentals() {
|
||||
return incidentals;
|
||||
}
|
||||
|
||||
public void setIncidentals(Double incidentals) {
|
||||
this.incidentals = incidentals;
|
||||
}
|
||||
|
||||
public Long getDepotid() {
|
||||
return depotid;
|
||||
}
|
||||
|
||||
public void setDepotid(Long depotid) {
|
||||
this.depotid = depotid;
|
||||
}
|
||||
|
||||
public Long getAnotherdepotid() {
|
||||
return anotherdepotid;
|
||||
}
|
||||
|
||||
public void setAnotherdepotid(Long anotherdepotid) {
|
||||
this.anotherdepotid = anotherdepotid;
|
||||
}
|
||||
|
||||
public Double getTaxrate() {
|
||||
return taxrate;
|
||||
}
|
||||
|
||||
public void setTaxrate(Double taxrate) {
|
||||
this.taxrate = taxrate;
|
||||
}
|
||||
|
||||
public Double getTaxmoney() {
|
||||
return taxmoney;
|
||||
}
|
||||
|
||||
public void setTaxmoney(Double taxmoney) {
|
||||
this.taxmoney = taxmoney;
|
||||
}
|
||||
|
||||
public Double getTaxlastmoney() {
|
||||
return taxlastmoney;
|
||||
}
|
||||
|
||||
public void setTaxlastmoney(Double taxlastmoney) {
|
||||
this.taxlastmoney = taxlastmoney;
|
||||
}
|
||||
|
||||
public String getOtherfield1() {
|
||||
return otherfield1;
|
||||
}
|
||||
|
||||
public void setOtherfield1(String otherfield1) {
|
||||
this.otherfield1 = otherfield1;
|
||||
}
|
||||
|
||||
public String getOtherfield2() {
|
||||
return otherfield2;
|
||||
}
|
||||
|
||||
public void setOtherfield2(String otherfield2) {
|
||||
this.otherfield2 = otherfield2;
|
||||
}
|
||||
|
||||
public String getOtherfield3() {
|
||||
return otherfield3;
|
||||
}
|
||||
|
||||
public void setOtherfield3(String otherfield3) {
|
||||
this.otherfield3 = otherfield3;
|
||||
}
|
||||
|
||||
public String getOtherfield4() {
|
||||
return otherfield4;
|
||||
}
|
||||
|
||||
public void setOtherfield4(String otherfield4) {
|
||||
this.otherfield4 = otherfield4;
|
||||
}
|
||||
|
||||
public String getOtherfield5() {
|
||||
return otherfield5;
|
||||
}
|
||||
|
||||
public void setOtherfield5(String otherfield5) {
|
||||
this.otherfield5 = otherfield5;
|
||||
}
|
||||
|
||||
public String getMtype() {
|
||||
return mtype;
|
||||
}
|
||||
|
||||
public void setMtype(String mtype) {
|
||||
this.mtype = mtype;
|
||||
}
|
||||
|
||||
public Long getMId() {
|
||||
return MId;
|
||||
}
|
||||
|
||||
public void setMId(Long MId) {
|
||||
this.MId = MId;
|
||||
}
|
||||
|
||||
public String getMName() {
|
||||
return MName;
|
||||
}
|
||||
|
||||
public void setMName(String MName) {
|
||||
this.MName = MName;
|
||||
}
|
||||
|
||||
public String getMModel() {
|
||||
return MModel;
|
||||
}
|
||||
|
||||
public void setMModel(String MModel) {
|
||||
this.MModel = MModel;
|
||||
}
|
||||
|
||||
public String getMaterialUnit() {
|
||||
return MaterialUnit;
|
||||
}
|
||||
|
||||
public void setMaterialUnit(String materialUnit) {
|
||||
MaterialUnit = materialUnit;
|
||||
}
|
||||
|
||||
public String getMColor() {
|
||||
return MColor;
|
||||
}
|
||||
|
||||
public void setMColor(String MColor) {
|
||||
this.MColor = MColor;
|
||||
}
|
||||
|
||||
public String getMStandard() {
|
||||
return MStandard;
|
||||
}
|
||||
|
||||
public void setMStandard(String MStandard) {
|
||||
this.MStandard = MStandard;
|
||||
}
|
||||
|
||||
public String getMMfrs() {
|
||||
return MMfrs;
|
||||
}
|
||||
|
||||
public void setMMfrs(String MMfrs) {
|
||||
this.MMfrs = MMfrs;
|
||||
}
|
||||
|
||||
public String getMOtherField1() {
|
||||
return MOtherField1;
|
||||
}
|
||||
|
||||
public void setMOtherField1(String MOtherField1) {
|
||||
this.MOtherField1 = MOtherField1;
|
||||
}
|
||||
|
||||
public String getMOtherField2() {
|
||||
return MOtherField2;
|
||||
}
|
||||
|
||||
public void setMOtherField2(String MOtherField2) {
|
||||
this.MOtherField2 = MOtherField2;
|
||||
}
|
||||
|
||||
public String getMOtherField3() {
|
||||
return MOtherField3;
|
||||
}
|
||||
|
||||
public void setMOtherField3(String MOtherField3) {
|
||||
this.MOtherField3 = MOtherField3;
|
||||
}
|
||||
|
||||
public String getDepotName() {
|
||||
return DepotName;
|
||||
}
|
||||
|
||||
public void setDepotName(String depotName) {
|
||||
DepotName = depotName;
|
||||
}
|
||||
|
||||
public String getAnotherDepotName() {
|
||||
return AnotherDepotName;
|
||||
}
|
||||
|
||||
public void setAnotherDepotName(String anotherDepotName) {
|
||||
AnotherDepotName = anotherDepotName;
|
||||
}
|
||||
|
||||
public Long getUnitId() {
|
||||
return UnitId;
|
||||
}
|
||||
|
||||
public void setUnitId(Long unitId) {
|
||||
UnitId = unitId;
|
||||
}
|
||||
|
||||
public String getUName() {
|
||||
return UName;
|
||||
}
|
||||
|
||||
public void setUName(String UName) {
|
||||
this.UName = UName;
|
||||
}
|
||||
}
|
||||
@ -1,124 +1,130 @@
|
||||
package com.jsh.erp.datasource.mappers;
|
||||
|
||||
import com.jsh.erp.datasource.entities.Material;
|
||||
import com.jsh.erp.datasource.entities.MaterialExample;
|
||||
import java.util.List;
|
||||
|
||||
import com.jsh.erp.datasource.entities.MaterialVo4Unit;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface MaterialMapper {
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_material
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int countByExample(MaterialExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_material
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int deleteByExample(MaterialExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_material
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_material
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int insert(Material record);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_material
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int insertSelective(Material record);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_material
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
List<Material> selectByExample(MaterialExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_material
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
Material selectByPrimaryKey(Long id);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_material
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int updateByExampleSelective(@Param("record") Material record, @Param("example") MaterialExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_material
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int updateByExample(@Param("record") Material record, @Param("example") MaterialExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_material
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int updateByPrimaryKeySelective(Material record);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_material
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int updateByPrimaryKey(Material record);
|
||||
|
||||
List<MaterialVo4Unit> selectByConditionMaterial(
|
||||
@Param("name") String name,
|
||||
@Param("model") String model,
|
||||
@Param("categoryId") Long categoryId,
|
||||
@Param("categoryIds") String categoryIds,
|
||||
@Param("mpList") String mpList,
|
||||
@Param("offset") Integer offset,
|
||||
@Param("rows") Integer rows);
|
||||
|
||||
int countsByMaterial(
|
||||
@Param("name") String name,
|
||||
@Param("model") String model,
|
||||
@Param("categoryId") Long categoryId,
|
||||
@Param("categoryIds") String categoryIds,
|
||||
@Param("mpList") String mpList);
|
||||
|
||||
String findUnitName(@Param("mId") Long mId);
|
||||
|
||||
List<MaterialVo4Unit> findById(@Param("id") Long id);
|
||||
|
||||
List<MaterialVo4Unit> findBySelect();
|
||||
|
||||
int updatePriceNullByPrimaryKey(Long id);
|
||||
|
||||
int updateUnitIdNullByPrimaryKey(Long id);
|
||||
package com.jsh.erp.datasource.mappers;
|
||||
|
||||
import com.jsh.erp.datasource.entities.Material;
|
||||
import com.jsh.erp.datasource.entities.MaterialExample;
|
||||
import java.util.List;
|
||||
|
||||
import com.jsh.erp.datasource.entities.MaterialVo4Unit;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface MaterialMapper {
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_material
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int countByExample(MaterialExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_material
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int deleteByExample(MaterialExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_material
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_material
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int insert(Material record);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_material
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int insertSelective(Material record);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_material
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
List<Material> selectByExample(MaterialExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_material
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
Material selectByPrimaryKey(Long id);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_material
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int updateByExampleSelective(@Param("record") Material record, @Param("example") MaterialExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_material
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int updateByExample(@Param("record") Material record, @Param("example") MaterialExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_material
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int updateByPrimaryKeySelective(Material record);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_material
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int updateByPrimaryKey(Material record);
|
||||
|
||||
List<MaterialVo4Unit> selectByConditionMaterial(
|
||||
@Param("name") String name,
|
||||
@Param("model") String model,
|
||||
@Param("categoryId") Long categoryId,
|
||||
@Param("categoryIds") String categoryIds,
|
||||
@Param("mpList") String mpList,
|
||||
@Param("offset") Integer offset,
|
||||
@Param("rows") Integer rows);
|
||||
|
||||
int countsByMaterial(
|
||||
@Param("name") String name,
|
||||
@Param("model") String model,
|
||||
@Param("categoryId") Long categoryId,
|
||||
@Param("categoryIds") String categoryIds,
|
||||
@Param("mpList") String mpList);
|
||||
|
||||
String findUnitName(@Param("mId") Long mId);
|
||||
|
||||
List<MaterialVo4Unit> findById(@Param("id") Long id);
|
||||
|
||||
List<MaterialVo4Unit> findBySelect();
|
||||
|
||||
int updatePriceNullByPrimaryKey(Long id);
|
||||
|
||||
int updateUnitIdNullByPrimaryKey(Long id);
|
||||
|
||||
List<MaterialVo4Unit> findByAll(
|
||||
@Param("name") String name,
|
||||
@Param("model") String model,
|
||||
@Param("categoryId") Long categoryId,
|
||||
@Param("categoryIds") String categoryIds);
|
||||
}
|
||||
@ -1,112 +1,119 @@
|
||||
package com.jsh.erp.datasource.mappers;
|
||||
|
||||
import com.jsh.erp.datasource.entities.Supplier;
|
||||
import com.jsh.erp.datasource.entities.SupplierExample;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface SupplierMapper {
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_supplier
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int countByExample(SupplierExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_supplier
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int deleteByExample(SupplierExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_supplier
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_supplier
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int insert(Supplier record);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_supplier
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int insertSelective(Supplier record);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_supplier
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
List<Supplier> selectByExample(SupplierExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_supplier
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
Supplier selectByPrimaryKey(Long id);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_supplier
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int updateByExampleSelective(@Param("record") Supplier record, @Param("example") SupplierExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_supplier
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int updateByExample(@Param("record") Supplier record, @Param("example") SupplierExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_supplier
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int updateByPrimaryKeySelective(Supplier record);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_supplier
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int updateByPrimaryKey(Supplier record);
|
||||
|
||||
List<Supplier> selectByConditionSupplier(
|
||||
@Param("supplier") String supplier,
|
||||
@Param("type") String type,
|
||||
@Param("phonenum") String phonenum,
|
||||
@Param("telephone") String telephone,
|
||||
@Param("description") String description,
|
||||
@Param("offset") Integer offset,
|
||||
@Param("rows") Integer rows);
|
||||
|
||||
int countsBySupplier(
|
||||
@Param("supplier") String supplier,
|
||||
@Param("type") String type,
|
||||
@Param("phonenum") String phonenum,
|
||||
@Param("telephone") String telephone,
|
||||
@Param("description") String description);
|
||||
package com.jsh.erp.datasource.mappers;
|
||||
|
||||
import com.jsh.erp.datasource.entities.Supplier;
|
||||
import com.jsh.erp.datasource.entities.SupplierExample;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface SupplierMapper {
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_supplier
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int countByExample(SupplierExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_supplier
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int deleteByExample(SupplierExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_supplier
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_supplier
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int insert(Supplier record);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_supplier
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int insertSelective(Supplier record);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_supplier
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
List<Supplier> selectByExample(SupplierExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_supplier
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
Supplier selectByPrimaryKey(Long id);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_supplier
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int updateByExampleSelective(@Param("record") Supplier record, @Param("example") SupplierExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_supplier
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int updateByExample(@Param("record") Supplier record, @Param("example") SupplierExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_supplier
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int updateByPrimaryKeySelective(Supplier record);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table jsh_supplier
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
int updateByPrimaryKey(Supplier record);
|
||||
|
||||
List<Supplier> selectByConditionSupplier(
|
||||
@Param("supplier") String supplier,
|
||||
@Param("type") String type,
|
||||
@Param("phonenum") String phonenum,
|
||||
@Param("telephone") String telephone,
|
||||
@Param("description") String description,
|
||||
@Param("offset") Integer offset,
|
||||
@Param("rows") Integer rows);
|
||||
|
||||
int countsBySupplier(
|
||||
@Param("supplier") String supplier,
|
||||
@Param("type") String type,
|
||||
@Param("phonenum") String phonenum,
|
||||
@Param("telephone") String telephone,
|
||||
@Param("description") String description);
|
||||
|
||||
List<Supplier> findByAll(
|
||||
@Param("supplier") String supplier,
|
||||
@Param("type") String type,
|
||||
@Param("phonenum") String phonenum,
|
||||
@Param("telephone") String telephone,
|
||||
@Param("description") String description);
|
||||
}
|
||||
@ -84,14 +84,18 @@ public class DepotHeadService {
|
||||
}
|
||||
depotHead.setCreatetime(new Timestamp(System.currentTimeMillis()));
|
||||
depotHead.setStatus(false);
|
||||
return depotHeadMapper.insertSelective(depotHead);
|
||||
return depotHeadMapper.insert(depotHead);
|
||||
}
|
||||
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public int updateDepotHead(String beanJson, Long id) {
|
||||
DepotHead dh = depotHeadMapper.selectByPrimaryKey(id);
|
||||
DepotHead depotHead = JSONObject.parseObject(beanJson, DepotHead.class);
|
||||
depotHead.setId(id);
|
||||
return depotHeadMapper.updateByPrimaryKeySelective(depotHead);
|
||||
depotHead.setStatus(dh.getStatus());
|
||||
depotHead.setCreatetime(dh.getCreatetime());
|
||||
depotHead.setOperpersonname(dh.getOperpersonname());
|
||||
return depotHeadMapper.updateByPrimaryKey(depotHead);
|
||||
}
|
||||
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
|
||||
@ -5,6 +5,7 @@ import com.jsh.erp.datasource.entities.Material;
|
||||
import com.jsh.erp.datasource.entities.MaterialExample;
|
||||
import com.jsh.erp.datasource.entities.MaterialVo4Unit;
|
||||
import com.jsh.erp.datasource.mappers.MaterialMapper;
|
||||
import com.jsh.erp.utils.BaseResponseInfo;
|
||||
import com.jsh.erp.utils.StringUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -14,7 +15,9 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
public class MaterialService {
|
||||
@ -160,4 +163,32 @@ public class MaterialService {
|
||||
return materialMapper.selectByExample(example);
|
||||
}
|
||||
|
||||
public List<MaterialVo4Unit> findByAll(String name, String model, Long categoryId, String categoryIds) {
|
||||
List<MaterialVo4Unit> resList = new ArrayList<MaterialVo4Unit>();
|
||||
List<MaterialVo4Unit> list = materialMapper.findByAll(name, model, categoryId, categoryIds);
|
||||
if (null != list) {
|
||||
for (MaterialVo4Unit m : list) {
|
||||
resList.add(m);
|
||||
}
|
||||
}
|
||||
return resList;
|
||||
}
|
||||
|
||||
public BaseResponseInfo importExcel(List<Material> mList) throws Exception {
|
||||
BaseResponseInfo info = new BaseResponseInfo();
|
||||
Map<String, Object> data = new HashMap<String, Object>();
|
||||
try {
|
||||
for(Material m: mList) {
|
||||
materialMapper.insertSelective(m);
|
||||
}
|
||||
info.code = 200;
|
||||
data.put("message", "成功");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
info.code = 500;
|
||||
data.put("message", e.getMessage());
|
||||
}
|
||||
info.data = data;
|
||||
return info;
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.jsh.erp.datasource.entities.Supplier;
|
||||
import com.jsh.erp.datasource.entities.SupplierExample;
|
||||
import com.jsh.erp.datasource.mappers.SupplierMapper;
|
||||
import com.jsh.erp.utils.BaseResponseInfo;
|
||||
import com.jsh.erp.utils.StringUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -12,7 +13,9 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
public class SupplierService {
|
||||
@ -123,4 +126,26 @@ public class SupplierService {
|
||||
List<Supplier> list = supplierMapper.selectByExample(example);
|
||||
return list;
|
||||
}
|
||||
|
||||
public List<Supplier> findByAll(String supplier, String type, String phonenum, String telephone, String description) {
|
||||
return supplierMapper.findByAll(supplier, type, phonenum, telephone, description);
|
||||
}
|
||||
|
||||
public BaseResponseInfo importExcel(List<Supplier> mList) throws Exception {
|
||||
BaseResponseInfo info = new BaseResponseInfo();
|
||||
Map<String, Object> data = new HashMap<String, Object>();
|
||||
try {
|
||||
for(Supplier s: mList) {
|
||||
supplierMapper.insertSelective(s);
|
||||
}
|
||||
info.code = 200;
|
||||
data.put("message", "成功");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
info.code = 500;
|
||||
data.put("message", e.getMessage());
|
||||
}
|
||||
info.data = data;
|
||||
return info;
|
||||
}
|
||||
}
|
||||
|
||||
240
src/main/java/com/jsh/erp/utils/ExcelUtils.java
Normal file
240
src/main/java/com/jsh/erp/utils/ExcelUtils.java
Normal file
@ -0,0 +1,240 @@
|
||||
package com.jsh.erp.utils;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import com.alibaba.druid.util.StringUtils;
|
||||
import jxl.Cell;
|
||||
import jxl.Sheet;
|
||||
import jxl.Workbook;
|
||||
import jxl.format.*;
|
||||
import jxl.write.Label;
|
||||
import jxl.write.WritableCellFormat;
|
||||
import jxl.write.WritableFont;
|
||||
import jxl.write.WritableSheet;
|
||||
import jxl.write.WritableWorkbook;
|
||||
|
||||
public class ExcelUtils {
|
||||
|
||||
public static WritableFont arial14font = null;
|
||||
|
||||
public static File exportObjects(String fileName, String[] names,
|
||||
String title, List<String[]> objects) throws Exception {
|
||||
File excelFile = new File("fileName.xls");
|
||||
WritableWorkbook wtwb = Workbook.createWorkbook(excelFile);
|
||||
WritableSheet sheet = wtwb.createSheet(title, 0);
|
||||
sheet.getSettings().setDefaultColumnWidth(20);
|
||||
WritableFont wfont = new WritableFont(WritableFont.createFont("楷书"), 15);
|
||||
WritableCellFormat format = new WritableCellFormat(wfont);
|
||||
WritableFont wfc = new WritableFont(WritableFont.ARIAL, 20,
|
||||
WritableFont.BOLD, false, UnderlineStyle.NO_UNDERLINE,
|
||||
jxl.format.Colour.BLACK);
|
||||
WritableCellFormat wcfFC = new WritableCellFormat(wfc);
|
||||
wcfFC.setAlignment(Alignment.CENTRE);
|
||||
wcfFC.setVerticalAlignment(VerticalAlignment.CENTRE);
|
||||
// CellView cellView = new CellView();
|
||||
// cellView.setAutosize(true); //设置自动大小
|
||||
format.setAlignment(Alignment.LEFT);
|
||||
format.setVerticalAlignment(VerticalAlignment.TOP);
|
||||
sheet.mergeCells(0, 0, names.length - 1, 0);
|
||||
sheet.addCell(new Label(0, 0, title, wcfFC));
|
||||
int rowNum = 2;
|
||||
for (int i = 0; i < names.length; i++) {
|
||||
sheet.addCell(new Label(i, 1, names[i], format));
|
||||
}
|
||||
for (int j = 0; j < objects.size(); j++) {
|
||||
String[] obj = objects.get(j);
|
||||
for (int h = 0; h < obj.length; h++) {
|
||||
sheet.addCell(new Label(h, rowNum, obj[h], format));
|
||||
}
|
||||
rowNum = rowNum + 1;
|
||||
|
||||
}
|
||||
wtwb.write();
|
||||
wtwb.close();
|
||||
return excelFile;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel,不需要第一行的title
|
||||
*
|
||||
* @param fileName
|
||||
* @param names
|
||||
* @param title
|
||||
* @param objects
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public static File exportObjectsWithoutTitle(String fileName,
|
||||
String[] names, String title, List<String[]> objects)
|
||||
throws Exception {
|
||||
File excelFile = new File(fileName);
|
||||
WritableWorkbook wtwb = Workbook.createWorkbook(excelFile);
|
||||
WritableSheet sheet = wtwb.createSheet(title, 0);
|
||||
sheet.getSettings().setDefaultColumnWidth(20);
|
||||
|
||||
// 第一行的格式
|
||||
WritableFont wfc = new WritableFont(WritableFont.ARIAL, 15,
|
||||
WritableFont.BOLD, false, UnderlineStyle.NO_UNDERLINE,
|
||||
jxl.format.Colour.BLACK);
|
||||
WritableCellFormat wcfFC = new WritableCellFormat(wfc);
|
||||
wcfFC.setVerticalAlignment(VerticalAlignment.CENTRE);
|
||||
|
||||
// 设置字体以及单元格格式
|
||||
WritableFont wfont = new WritableFont(WritableFont.createFont("楷书"), 15);
|
||||
WritableCellFormat format = new WritableCellFormat(wfont);
|
||||
format.setAlignment(Alignment.LEFT);
|
||||
format.setVerticalAlignment(VerticalAlignment.TOP);
|
||||
|
||||
// 第一行写入标题
|
||||
for (int i = 0; i < names.length; i++) {
|
||||
sheet.addCell(new Label(i, 0, names[i], wcfFC));
|
||||
}
|
||||
|
||||
// 其余行依次写入数据
|
||||
int rowNum = 1;
|
||||
for (int j = 0; j < objects.size(); j++) {
|
||||
String[] obj = objects.get(j);
|
||||
for (int h = 0; h < obj.length; h++) {
|
||||
sheet.addCell(new Label(h, rowNum, obj[h], format));
|
||||
}
|
||||
rowNum = rowNum + 1;
|
||||
}
|
||||
wtwb.write();
|
||||
wtwb.close();
|
||||
return excelFile;
|
||||
}
|
||||
|
||||
public static String createTempFile(String[] names, String title, List<String[]> objects) throws Exception {
|
||||
File excelFile = File.createTempFile(System.currentTimeMillis() + "", ".xls");
|
||||
WritableWorkbook wtwb = Workbook.createWorkbook(excelFile);
|
||||
WritableSheet sheet = wtwb.createSheet(title, 0);
|
||||
sheet.getSettings().setDefaultColumnWidth(20);
|
||||
WritableFont wfont = new WritableFont(WritableFont.createFont("楷书"), 15);
|
||||
WritableCellFormat format = new WritableCellFormat(wfont);
|
||||
WritableFont wfc = new WritableFont(WritableFont.ARIAL, 20,
|
||||
WritableFont.BOLD, false, UnderlineStyle.NO_UNDERLINE,
|
||||
jxl.format.Colour.BLACK);
|
||||
WritableCellFormat wcfFC = new WritableCellFormat(wfc);
|
||||
wcfFC.setAlignment(Alignment.CENTRE);
|
||||
wcfFC.setVerticalAlignment(VerticalAlignment.CENTRE);
|
||||
// CellView cellView = new CellView();
|
||||
// cellView.setAutosize(true); //设置自动大小
|
||||
format.setAlignment(Alignment.LEFT);
|
||||
format.setVerticalAlignment(VerticalAlignment.TOP);
|
||||
sheet.mergeCells(0, 0, names.length - 1, 0);
|
||||
sheet.addCell(new Label(0, 0, title, wcfFC));
|
||||
int rowNum = 2;
|
||||
for (int i = 0; i < names.length; i++) {
|
||||
sheet.addCell(new Label(i, 1, names[i], format));
|
||||
}
|
||||
for (int j = 0; j < objects.size(); j++) {
|
||||
String[] obj = objects.get(j);
|
||||
for (int h = 0; h < obj.length; h++) {
|
||||
sheet.addCell(new Label(h, rowNum, obj[h], format));
|
||||
}
|
||||
rowNum = rowNum + 1;
|
||||
}
|
||||
wtwb.write();
|
||||
wtwb.close();
|
||||
return excelFile.getName();
|
||||
}
|
||||
|
||||
public static String createCheckRandomTempFile(String[] names, String title, List<String[]> objects,Map<String,String> infoMap) throws Exception {
|
||||
File excelFile = File.createTempFile(System.currentTimeMillis() + "", ".xls");
|
||||
WritableWorkbook wtwb = Workbook.createWorkbook(excelFile);
|
||||
WritableSheet sheet = wtwb.createSheet(title, 0);
|
||||
sheet.getSettings().setDefaultColumnWidth(20);
|
||||
WritableFont wfont = new WritableFont(WritableFont.createFont("楷书"), 14);
|
||||
|
||||
WritableCellFormat format = new WritableCellFormat(wfont);
|
||||
format.setBorder(Border.ALL, BorderLineStyle.THIN);
|
||||
format.setAlignment(Alignment.CENTRE);
|
||||
format.setVerticalAlignment(VerticalAlignment.CENTRE);
|
||||
|
||||
WritableFont wfc = new WritableFont(WritableFont.ARIAL, 20,
|
||||
WritableFont.BOLD, false, UnderlineStyle.NO_UNDERLINE,
|
||||
jxl.format.Colour.BLACK);
|
||||
WritableCellFormat wcfFC = new WritableCellFormat(wfc);
|
||||
wcfFC.setAlignment(Alignment.LEFT);
|
||||
wcfFC.setVerticalAlignment(VerticalAlignment.CENTRE);
|
||||
|
||||
WritableFont nameWfc = new WritableFont(WritableFont.ARIAL, 14,
|
||||
WritableFont.BOLD, false, UnderlineStyle.NO_UNDERLINE,
|
||||
jxl.format.Colour.BLACK);
|
||||
WritableCellFormat nameFormat = new WritableCellFormat(nameWfc);
|
||||
nameFormat.setBorder(Border.ALL, BorderLineStyle.THIN);
|
||||
nameFormat.setAlignment(Alignment.CENTRE);
|
||||
nameFormat.setVerticalAlignment(VerticalAlignment.CENTRE);
|
||||
|
||||
WritableCellFormat infoFormat = new WritableCellFormat(wfont);
|
||||
infoFormat.setAlignment(Alignment.LEFT);
|
||||
infoFormat.setVerticalAlignment(VerticalAlignment.CENTRE);
|
||||
|
||||
|
||||
sheet.mergeCells(0, 0, names.length - 1, 0);
|
||||
sheet.addCell(new Label(0, 0, infoMap.get("title"), wcfFC));
|
||||
|
||||
sheet.addCell(new Label(0, 2, infoMap.get("info"), infoFormat));
|
||||
sheet.addCell(new Label(2, 2, infoMap.get("dvrnvr"), infoFormat));
|
||||
sheet.addCell(new Label(4, 2, infoMap.get("char"), infoFormat));
|
||||
sheet.addCell(new Label(0, 3, infoMap.get("infoPercent"), infoFormat));
|
||||
sheet.addCell(new Label(2, 3, infoMap.get("dvrnvrPercent"), infoFormat));
|
||||
sheet.addCell(new Label(4, 3, infoMap.get("charPercent"), infoFormat));
|
||||
|
||||
int rowNum = 5;
|
||||
for (int i = 0; i < names.length; i++) {
|
||||
sheet.addCell(new Label(i, 4, names[i], nameFormat));
|
||||
}
|
||||
for (int j = 0; j < objects.size(); j++) {
|
||||
String[] obj = objects.get(j);
|
||||
for (int h = 0; h < obj.length; h++) {
|
||||
sheet.addCell(new Label(h, rowNum, obj[h], format));
|
||||
}
|
||||
rowNum = rowNum + 1;
|
||||
}
|
||||
wtwb.write();
|
||||
wtwb.close();
|
||||
return excelFile.getName();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static String getContent(Sheet src, int rowNum, int colNum) {
|
||||
return src.getRow(rowNum)[colNum].getContents().trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* 从第i行开始到最后检测指定列的唯一性
|
||||
*
|
||||
* @param src
|
||||
* @param colNum
|
||||
* @param fromRow
|
||||
* 起始行
|
||||
* @return
|
||||
*/
|
||||
public static Boolean checkUnique(Sheet src, int colNum, int fromRow) {
|
||||
Cell[] colCells = src.getColumn(colNum);
|
||||
Set<String> set = new HashSet<String>();
|
||||
for (int i = fromRow; i < colCells.length; i++) {
|
||||
if (!StringUtils.isEmpty(colCells[i].getContents())
|
||||
&& !set.add(colCells[i].getContents())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static File getTempFile(String fileName) {
|
||||
String dir = System.getProperty("java.io.tmpdir"); // 获取系统临时目录
|
||||
return new File(dir + File.separator + fileName);
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
String msg = "12345";
|
||||
System.out.println(msg.indexOf("@"));
|
||||
}
|
||||
}
|
||||
28
src/main/java/com/jsh/erp/utils/ExportExecUtil.java
Normal file
28
src/main/java/com/jsh/erp/utils/ExportExecUtil.java
Normal file
@ -0,0 +1,28 @@
|
||||
package com.jsh.erp.utils;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.OutputStream;
|
||||
|
||||
public class ExportExecUtil {
|
||||
|
||||
public static void showExec(File excelFile,String fileName,HttpServletResponse response) throws Exception{
|
||||
response.setContentType("application/octet-stream");
|
||||
fileName = new String(fileName.getBytes("gbk"),"ISO8859_1");
|
||||
response.setHeader("Content-Disposition", "attachment;filename=\"" + fileName + ".xls" + "\"");
|
||||
FileInputStream fis = new FileInputStream(excelFile);
|
||||
OutputStream out = response.getOutputStream();
|
||||
|
||||
int SIZE = 1024 * 1024;
|
||||
byte[] bytes = new byte[SIZE];
|
||||
int LENGTH = -1;
|
||||
while((LENGTH = fis.read(bytes)) != -1){
|
||||
out.write(bytes,0,LENGTH);
|
||||
}
|
||||
|
||||
out.flush();
|
||||
fis.close();
|
||||
}
|
||||
|
||||
}
|
||||
334
src/main/java/com/jsh/erp/utils/FileUtils.java
Normal file
334
src/main/java/com/jsh/erp/utils/FileUtils.java
Normal file
@ -0,0 +1,334 @@
|
||||
package com.jsh.erp.utils;
|
||||
|
||||
import com.alibaba.druid.util.StringUtils;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* 文件处理工具类
|
||||
*
|
||||
*/
|
||||
public class FileUtils {
|
||||
|
||||
/**
|
||||
* 功 能: 创建文件夹
|
||||
*
|
||||
* @param path
|
||||
* 参 数:要创建的文件夹名称
|
||||
* @return 返回值: 如果成功true;否则false 如:FileUtils.mkdir("/usr/apps/upload/");
|
||||
*/
|
||||
public static boolean makedir(String path) {
|
||||
File file = new File(path);
|
||||
if (!file.exists())
|
||||
return file.mkdirs();
|
||||
else
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存文件
|
||||
*
|
||||
* @param stream
|
||||
* @param path
|
||||
* 存放路径
|
||||
* @param filename
|
||||
* 文件名
|
||||
* @throws IOException
|
||||
*/
|
||||
public static void SaveFileFromInputStream(InputStream stream, String path, String filename)
|
||||
throws IOException {
|
||||
File file = new File(path);
|
||||
boolean flag=true;
|
||||
if(!file.exists()){
|
||||
flag=file.mkdirs();
|
||||
}
|
||||
if(flag){
|
||||
FileOutputStream fs = new FileOutputStream(new File(path+filename));
|
||||
byte[] buffer = new byte[1024 * 1024];
|
||||
int byteread = 0;
|
||||
while ((byteread = stream.read(buffer)) != -1) {
|
||||
fs.write(buffer, 0, byteread);
|
||||
fs.flush();
|
||||
}
|
||||
fs.close();
|
||||
stream.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 列出某个目录下的所有文件,子目录不列出
|
||||
* @param folderPath:文件夹路径
|
||||
* @return
|
||||
*/
|
||||
public static List<String> listFile(String folderPath){
|
||||
List<String> fileList = new ArrayList<String>(); //FileViewer.getListFiles(destPath, null, false);
|
||||
File f = new File(folderPath);
|
||||
File[] t = f.listFiles();
|
||||
for(int i = 0; i < t.length; i++){
|
||||
fileList.add(t[i].getAbsolutePath());
|
||||
}
|
||||
return fileList;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 判断文件是否存在
|
||||
*
|
||||
* @param fileName
|
||||
* @return
|
||||
*/
|
||||
public static boolean exists(String fileName) {
|
||||
File file = new File(fileName);
|
||||
if (file.exists()) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 取当前路径
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static String getCurrentPath() {
|
||||
File directory = new File(".");
|
||||
String nowPath = "";
|
||||
try {
|
||||
nowPath = directory.getCanonicalFile().toString();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return nowPath;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文件扩展名
|
||||
*
|
||||
* @param fileName
|
||||
* @return
|
||||
* */
|
||||
public static String getFileExtendName(String fileName) {
|
||||
if (fileName == null) {
|
||||
return "";
|
||||
} else {
|
||||
return fileName.substring(fileName.lastIndexOf(".") + 1, fileName
|
||||
.length());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建一个新文件,如果存在则报错
|
||||
*
|
||||
* @param filePath
|
||||
* @param fileName
|
||||
* @return
|
||||
*/
|
||||
public static void createFile(String filePath, String fileName)
|
||||
throws RuntimeException {
|
||||
String file = null;
|
||||
if (filePath == null) {
|
||||
file = fileName;
|
||||
} else {
|
||||
file = filePath + File.separator + fileName;
|
||||
}
|
||||
createFile(file);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建一个新文件(含路径),如果存在则报错
|
||||
*
|
||||
* @param fileName
|
||||
* 含有路径的文件名
|
||||
* @return
|
||||
*/
|
||||
public static void createFile(String fileName) throws RuntimeException {
|
||||
File f = new File(fileName);
|
||||
if (f.exists()) {
|
||||
throw new RuntimeException("FILE_EXIST_ERROR");
|
||||
} else {
|
||||
try {
|
||||
File fileFolder = f.getParentFile();
|
||||
if (!fileFolder.exists())
|
||||
fileFolder.mkdirs();
|
||||
f.createNewFile();
|
||||
} catch (IOException ie) {
|
||||
System.out.println("文件" + fileName + "创建失败:" + ie.getMessage());
|
||||
throw new RuntimeException("FILE_CREATE_ERROR");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 创建目录,如果存在则不创建
|
||||
*
|
||||
* @param path
|
||||
* @return 返回结果null则创建成功,否则返回的是错误信息
|
||||
* @return
|
||||
*/
|
||||
public static String createDir(String path, boolean isCreateSubPah) {
|
||||
String msg = null;
|
||||
File dir = new File(path);
|
||||
|
||||
if (dir == null) {
|
||||
msg = "不能创建空目录";
|
||||
return msg;
|
||||
}
|
||||
if (dir.isFile()) {
|
||||
msg = "已有同名文件存在";
|
||||
return msg;
|
||||
}
|
||||
if (!dir.exists()) {
|
||||
if (isCreateSubPah && !dir.mkdirs()) {
|
||||
msg = "目录创建失败,原因不明";
|
||||
} else if (!dir.mkdir()) {
|
||||
msg = "目录创建失败,原因不明";
|
||||
}
|
||||
}
|
||||
return msg;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除指定目录或文件。 如果要删除是目录,同时删除子目录下所有的文件
|
||||
*
|
||||
* @file:File 目录
|
||||
* */
|
||||
public static void delFileOrFolder(String fileName) {
|
||||
if (!exists(fileName))
|
||||
return;
|
||||
File file = new File(fileName);
|
||||
delFileOrFolder(file);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除指定目录或文件。 如果要删除是目录,同时删除子目录下所有的文件
|
||||
*
|
||||
* @file:File 目录
|
||||
* */
|
||||
public static void delFileOrFolder(File file) {
|
||||
if (!file.exists())
|
||||
return;
|
||||
if (file.isFile()) {
|
||||
file.delete();
|
||||
} else {
|
||||
File[] sub = file.listFiles();
|
||||
if (sub == null || sub.length <= 0) {
|
||||
file.delete();
|
||||
} else {
|
||||
for (int i = 0; i < sub.length; i++) {
|
||||
delFileOrFolder(sub[i]);
|
||||
}
|
||||
file.delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 从Properties格式配置文件中获取所有参数并保存到HashMap中。
|
||||
* 配置中的key值即map表中的key值,如果配置文件保存时用的中文,则返回结果也会转成中文。
|
||||
*
|
||||
* @param file
|
||||
* @return
|
||||
* @throws IOException
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static HashMap readPropertyFile(String file, String charsetName) throws IOException {
|
||||
if (charsetName==null || charsetName.trim().length()==0){
|
||||
charsetName="gbk";
|
||||
}
|
||||
HashMap map = new HashMap();
|
||||
InputStream is =null;
|
||||
if(file.startsWith("file:"))
|
||||
is=new FileInputStream(new File(file.substring(5)));
|
||||
else
|
||||
is=FileUtils.class.getClassLoader().getResourceAsStream(file);
|
||||
Properties properties = new Properties();
|
||||
properties.load(is);
|
||||
Enumeration en = properties.propertyNames();
|
||||
while (en.hasMoreElements()) {
|
||||
String key = (String) en.nextElement();
|
||||
String code = new String(properties.getProperty(key).getBytes(
|
||||
"ISO-8859-1"), charsetName);
|
||||
map.put(key, code);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param path
|
||||
* 文件路径
|
||||
* @param suffix
|
||||
* 后缀名
|
||||
* @param isdepth
|
||||
* 是否遍历子目录
|
||||
* @return
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static List getListFiles(String path, String suffix, boolean isdepth) {
|
||||
File file = new File(path);
|
||||
return FileUtils.listFile(file, suffix, isdepth);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param f
|
||||
* @param suffix:后缀名
|
||||
* @param isdepth:是否遍历子目录
|
||||
* @return
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static List listFile(File f, String suffix, boolean isdepth) {
|
||||
// 是目录,同时需要遍历子目录
|
||||
List<String> fileList = new ArrayList<String>();
|
||||
if (f.isDirectory() && isdepth == true) {
|
||||
File[] t = f.listFiles();
|
||||
for (int i = 0; i < t.length; i++) {
|
||||
listFile(t[i], suffix, isdepth);
|
||||
}
|
||||
} else {
|
||||
String filePath = f.getAbsolutePath();
|
||||
|
||||
if (suffix != null) {
|
||||
int begIndex = filePath.lastIndexOf(".");// 最后一个.(即后缀名前面的.)的索引
|
||||
String tempsuffix = "";
|
||||
|
||||
if (begIndex != -1)// 防止是文件但却没有后缀名结束的文件
|
||||
{
|
||||
tempsuffix = filePath.substring(begIndex + 1, filePath
|
||||
.length());
|
||||
}
|
||||
|
||||
if (tempsuffix.equals(suffix)) {
|
||||
fileList.add(filePath);
|
||||
}
|
||||
} else {
|
||||
// 后缀名为null则为所有文件
|
||||
fileList.add(filePath);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return fileList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 方法追加文件:使用FileWriter
|
||||
*
|
||||
* @param fileName
|
||||
* @param content
|
||||
*/
|
||||
public static void appendMethod(String fileName, String content) {
|
||||
try {
|
||||
// 打开一个写文件器,构造函数中的第二个参数true表示以追加形式写文件
|
||||
FileWriter writer = new FileWriter(fileName, true);
|
||||
writer.write(content + "\r\n");
|
||||
writer.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -33,6 +33,14 @@
|
||||
<result column="UName" jdbcType="VARCHAR" property="UName" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap extends="BaseResultMap" id="ResultByMaterial" type="com.jsh.erp.datasource.entities.DepotItemVo4WithInfoEx">
|
||||
<result column="MId" jdbcType="VARCHAR" property="MId" />
|
||||
<result column="MName" jdbcType="VARCHAR" property="MName" />
|
||||
<result column="MModel" jdbcType="VARCHAR" property="MModel" />
|
||||
<result column="MaterialUnit" jdbcType="VARCHAR" property="MaterialUnit" />
|
||||
<result column="MColor" jdbcType="VARCHAR" property="MColor" />
|
||||
</resultMap>
|
||||
|
||||
<select id="selectByConditionDepotItem" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="BaseResultMap">
|
||||
select *
|
||||
FROM jsh_depotitem
|
||||
@ -125,40 +133,40 @@
|
||||
from jsh_depotitem di left join jsh_material m on di.MaterialId=m.id
|
||||
left join jsh_unit u on m.UnitId = u.id
|
||||
left join jsh_depot dp1 on di.DepotId=dp1.id
|
||||
left join jsh_depot dp2 on di.AnotherDepotId=dp1.id
|
||||
left join jsh_depot dp2 on di.AnotherDepotId=dp2.id
|
||||
where di.HeaderId = ${headerId}
|
||||
order by di.id asc
|
||||
</select>
|
||||
|
||||
<select id="findByAll" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultWithInfoExMap">
|
||||
select di.*, m.Name MName, m.Model MModel, m.Unit MaterialUnit, m.Color MColor
|
||||
<select id="findByAll" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultByMaterial">
|
||||
select m.id MId, m.Name MName, m.Model MModel, m.Unit MaterialUnit, m.Color MColor
|
||||
from jsh_depotitem di
|
||||
inner join jsh_material m on di.MaterialId=m.id
|
||||
where 1=1
|
||||
<if test="headIds != null">
|
||||
and HeaderId in (${headIds})
|
||||
and di.HeaderId in (${headIds})
|
||||
</if>
|
||||
<if test="materialIds != null">
|
||||
and MaterialId in (${materialIds})
|
||||
and di.MaterialId in (${materialIds})
|
||||
</if>
|
||||
group by MaterialId
|
||||
group by m.id,m.Name, m.Model, m.Unit, m.Color
|
||||
<if test="offset != null and rows != null">
|
||||
limit #{offset},#{rows}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="findByAllCount" resultType="java.lang.Integer">
|
||||
select count(1) from (select di.Id
|
||||
select count(1) from (select m.id
|
||||
from jsh_depotitem di
|
||||
inner join jsh_material m on di.MaterialId=m.id
|
||||
where 1=1
|
||||
<if test="headIds != null">
|
||||
and HeaderId in (${headIds})
|
||||
and di.HeaderId in (${headIds})
|
||||
</if>
|
||||
<if test="materialIds != null">
|
||||
and MaterialId in (${materialIds})
|
||||
and di.MaterialId in (${materialIds})
|
||||
</if>
|
||||
group by MaterialId) cc
|
||||
group by m.id) cc
|
||||
</select>
|
||||
|
||||
<select id="findByTypeInIsPrev" resultType="java.lang.Double">
|
||||
|
||||
@ -77,4 +77,22 @@
|
||||
UnitId = null
|
||||
where Id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
|
||||
<select id="findByAll" parameterType="com.jsh.erp.datasource.entities.MaterialExample" resultMap="ResultMapList">
|
||||
select m.*,u.uname unitName, mc.name categoryName
|
||||
FROM jsh_material m
|
||||
left JOIN jsh_unit u on m.UnitId = u.id
|
||||
left JOIN jsh_materialcategory mc on m.CategoryId = mc.id
|
||||
where 1=1
|
||||
<if test="name != null">
|
||||
and m.name like '%${name}%'
|
||||
</if>
|
||||
<if test="model != null">
|
||||
and m.model like '%${model}%'
|
||||
</if>
|
||||
<if test="categoryId != 1">
|
||||
and m.CategoryId in (${categoryIds})
|
||||
</if>
|
||||
order by m.id asc
|
||||
</select>
|
||||
</mapper>
|
||||
@ -45,4 +45,25 @@
|
||||
and description like '%${description}%'
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="findByAll" parameterType="com.jsh.erp.datasource.entities.SupplierExample" resultMap="BaseResultMap">
|
||||
select *
|
||||
FROM jsh_supplier
|
||||
where 1=1
|
||||
<if test="supplier != null">
|
||||
and supplier like '%${supplier}%'
|
||||
</if>
|
||||
<if test="type != null">
|
||||
and type='${type}'
|
||||
</if>
|
||||
<if test="phonenum != null">
|
||||
and phonenum like '%${phonenum}%'
|
||||
</if>
|
||||
<if test="telephone != null">
|
||||
and telephone like '%${telephone}%'
|
||||
</if>
|
||||
<if test="description != null">
|
||||
and description like '%${description}%'
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue
Block a user