!53 添加仓库默认及商品明细时默认显示仓库,会员、客户快捷添加方式
Merge pull request !53 from 天门溪水/master
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
//初始化界面
|
//初始化界面
|
||||||
|
var defDepotId = null;
|
||||||
var kid = sessionStorage.getItem("userId");
|
var kid = sessionStorage.getItem("userId");
|
||||||
var pageType = getUrlParam('t'); //获取页面类型传值
|
var pageType = getUrlParam('t'); //获取页面类型传值
|
||||||
var depotList = null;
|
var depotList = null;
|
||||||
@@ -228,7 +229,10 @@
|
|||||||
{
|
{
|
||||||
if(userdepot.indexOf("["+depot.id+"]")!=-1)
|
if(userdepot.indexOf("["+depot.id+"]")!=-1)
|
||||||
{
|
{
|
||||||
options += '<option value="' + depot.id + '">' + depot.name + '</option>';
|
if(depot.isdefault){
|
||||||
|
defDepotId = depot.id;
|
||||||
|
}
|
||||||
|
options += '<option value="' + depot.id + '">' + depot.name + '</option>';
|
||||||
depotString = depotString + depot.id + ",";
|
depotString = depotString + depot.id + ",";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1583,6 +1587,13 @@
|
|||||||
$("#addOrgan").off("click").on("click",function(){
|
$("#addOrgan").off("click").on("click",function(){
|
||||||
$('#supplierDlg').dialog('open').dialog('setTitle','<img src="/js/easyui-1.3.5/themes/icons/edit_add.png"/> 增加供应商信息');
|
$('#supplierDlg').dialog('open').dialog('setTitle','<img src="/js/easyui-1.3.5/themes/icons/edit_add.png"/> 增加供应商信息');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$("#addMember").off("click").on("click",function(){
|
||||||
|
$('#supplierDlg').dialog('open').dialog('setTitle','<img src="/js/easyui-1.3.5/themes/icons/edit_add.png"/> 增加会员信息');
|
||||||
|
});
|
||||||
|
$("#addCustomer").off("click").on("click",function(){
|
||||||
|
$('#supplierDlg').dialog('open').dialog('setTitle','<img src="/js/easyui-1.3.5/themes/icons/edit_add.png"/> 增加客户信息');
|
||||||
|
});
|
||||||
url = '/depotHead/addDepotHeadAndDetail';
|
url = '/depotHead/addDepotHeadAndDetail';
|
||||||
|
|
||||||
//零售单据修改收款时,自动计算找零
|
//零售单据修改收款时,自动计算找零
|
||||||
@@ -2569,7 +2580,13 @@
|
|||||||
$("#otherMoneyTotalDlg").text($("#OtherMoney").val());
|
$("#otherMoneyTotalDlg").text($("#OtherMoney").val());
|
||||||
});
|
});
|
||||||
|
|
||||||
if(listTitle === "采购入库列表" || listTitle === "其它入库列表" || listTitle === "采购订单列表"){
|
if(listTitle === "采购入库列表" || listTitle === "其它入库列表" || listTitle === "采购订单列表"|| listTitle === "零售出库列表"|| listTitle === "销售出库列表"|| listTitle === "销售订单列表"){
|
||||||
|
var supplierType = "供应商";
|
||||||
|
if(listTitle === "零售出库列表"){
|
||||||
|
supplierType = "会员";
|
||||||
|
}else if(listTitle === "销售出库列表" || listTitle === "销售订单列表"){
|
||||||
|
supplierType = "客户";
|
||||||
|
}
|
||||||
//检查单位名称是否存在 ++ 重名无法提示问题需要跟进
|
//检查单位名称是否存在 ++ 重名无法提示问题需要跟进
|
||||||
function checkSupplierName() {
|
function checkSupplierName() {
|
||||||
var supplierName = $.trim($("#supplier").val());
|
var supplierName = $.trim($("#supplier").val());
|
||||||
@@ -2608,6 +2625,7 @@
|
|||||||
}
|
}
|
||||||
return flag;
|
return flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
//保存供应商信息
|
//保存供应商信息
|
||||||
$("#saveSupplier").off("click").on("click",function() {
|
$("#saveSupplier").off("click").on("click",function() {
|
||||||
if(checkSupplierName()){
|
if(checkSupplierName()){
|
||||||
@@ -2629,7 +2647,7 @@
|
|||||||
}
|
}
|
||||||
var url = '/supplier/add';
|
var url = '/supplier/add';
|
||||||
var supObj = $("#supplierFM").serializeObject();
|
var supObj = $("#supplierFM").serializeObject();
|
||||||
supObj.type = "供应商";
|
supObj.type = supplierType;
|
||||||
supObj.enabled = 1;
|
supObj.enabled = 1;
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: url,
|
url: url,
|
||||||
@@ -2927,7 +2945,7 @@
|
|||||||
//新增
|
//新增
|
||||||
function append(){
|
function append(){
|
||||||
if (endEditing()) {
|
if (endEditing()) {
|
||||||
$('#materialData').datagrid('appendRow', {});
|
$('#materialData').datagrid('appendRow', {DepotId:defDepotId});
|
||||||
editIndex = $('#materialData').datagrid('getRows').length - 1;
|
editIndex = $('#materialData').datagrid('getRows').length - 1;
|
||||||
$('#materialData').datagrid('selectRow', editIndex).datagrid('beginEdit', editIndex);
|
$('#materialData').datagrid('selectRow', editIndex).datagrid('beginEdit', editIndex);
|
||||||
autoReckon();
|
autoReckon();
|
||||||
|
|||||||
@@ -182,7 +182,19 @@
|
|||||||
{title: '搬运费', field: 'truckage', width: 60},
|
{title: '搬运费', field: 'truckage', width: 60},
|
||||||
{title: '负责人', field: 'principalName', width: 60},
|
{title: '负责人', field: 'principalName', width: 60},
|
||||||
{title: '排序', field: 'sort', width: 60},
|
{title: '排序', field: 'sort', width: 60},
|
||||||
|
{
|
||||||
|
title: '是否默认', field: 'isdefault', width: 100, align: "center",
|
||||||
|
formatter: function (value, rec) {
|
||||||
|
if (rec.isdefault) {
|
||||||
|
return "<b style='color:green'>是</b>";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return "否";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
{title: '描述', field: 'remark', width: 120}
|
{title: '描述', field: 'remark', width: 120}
|
||||||
|
|
||||||
]],
|
]],
|
||||||
toolbar: [
|
toolbar: [
|
||||||
{
|
{
|
||||||
@@ -200,6 +212,14 @@
|
|||||||
handler: function () {
|
handler: function () {
|
||||||
batDeleteDepot();
|
batDeleteDepot();
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'setDepotIsDefault',
|
||||||
|
text: '设为默认',
|
||||||
|
iconCls: 'icon-ok',
|
||||||
|
handler: function () {
|
||||||
|
setDepotIsDefault();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
onLoadError: function () {
|
onLoadError: function () {
|
||||||
@@ -286,7 +306,53 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
//设为默认操作事件
|
||||||
|
function setDepotIsDefault() {
|
||||||
|
var allRow = $('#tableData').datagrid('getRows');
|
||||||
|
var row = $('#tableData').datagrid('getChecked');
|
||||||
|
if (row.length == 0) {
|
||||||
|
$.messager.alert('设置提示', '没有记录被选中!', 'info');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (row.length > 0) {
|
||||||
|
function setDefault(depotID, isDefault) {
|
||||||
|
$.ajax({
|
||||||
|
type: "post",
|
||||||
|
url: "/depot/updateDepotIsDefault",
|
||||||
|
dataType: "json",
|
||||||
|
async: false,
|
||||||
|
data: ({
|
||||||
|
depotID: depotID,
|
||||||
|
isDefault: isDefault
|
||||||
|
}),
|
||||||
|
success: function (res) {
|
||||||
|
if (res == "true" && isDefault) {
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//此处添加错误处理
|
||||||
|
error: function () {
|
||||||
|
$.messager.alert('提示', '设为默认账户异常,请稍后再试!', 'error');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (row.length == 1) {
|
||||||
|
setDefault(row[0].id, true); //设置默认
|
||||||
|
for (var i = 0; i < allRow.length; i++) {
|
||||||
|
if (allRow[i].id != row[0].id) {
|
||||||
|
setDefault(allRow[i].id, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
setTimeout(function () {
|
||||||
|
$("#searchBtn").click();
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
//批量删除仓库
|
//批量删除仓库
|
||||||
function batDeleteDepot() {
|
function batDeleteDepot() {
|
||||||
var row = $('#tableData').datagrid('getChecked');
|
var row = $('#tableData').datagrid('getChecked');
|
||||||
|
|||||||
@@ -63,7 +63,13 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td style="width:60px;height:50px;">会员卡号:</td>
|
<td style="width:60px;height:50px;">会员卡号:</td>
|
||||||
<td style="padding:5px;width:200px;">
|
<td style="padding:5px;width:200px;">
|
||||||
|
<div class="org-list">
|
||||||
<input id="OrganId" name="OrganId" style="width:130px;"/>
|
<input id="OrganId" name="OrganId" style="width:130px;"/>
|
||||||
|
</div>
|
||||||
|
<div class="add-org-btn">
|
||||||
|
<img id="addMember" src="/js/easyui-1.3.5/themes/icons/edit_add.png"
|
||||||
|
style="cursor: pointer;" alt="增加会员" title="增加会员"/>
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td style="width:70px;">单据日期:</td>
|
<td style="width:70px;">单据日期:</td>
|
||||||
<td style="padding:5px">
|
<td style="padding:5px">
|
||||||
@@ -243,5 +249,107 @@
|
|||||||
<a href="javascript:void(0)" id="saveDepotHeadAccountDlg" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
|
<a href="javascript:void(0)" id="saveDepotHeadAccountDlg" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
|
||||||
<a href="javascript:void(0)" id="cancelDepotHeadAccountDlg" class="easyui-linkbutton" iconCls="icon-cancel">取消</a>
|
<a href="javascript:void(0)" id="cancelDepotHeadAccountDlg" class="easyui-linkbutton" iconCls="icon-cancel">取消</a>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="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>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -63,7 +63,13 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td style="width:60px;">客户:</td>
|
<td style="width:60px;">客户:</td>
|
||||||
<td style="padding:5px">
|
<td style="padding:5px">
|
||||||
<input id="OrganId" name="OrganId" style="width:130px;"/>
|
<div class="org-list">
|
||||||
|
<input id="OrganId" name="OrganId" style="width:130px;"/>
|
||||||
|
</div>
|
||||||
|
<div class="add-org-btn">
|
||||||
|
<img id="addCustomer" src="/js/easyui-1.3.5/themes/icons/edit_add.png"
|
||||||
|
style="cursor: pointer;" alt="增加客戶" title="增加客戶"/>
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td style="width:70px;">单据日期:</td>
|
<td style="width:70px;">单据日期:</td>
|
||||||
<td style="padding:5px">
|
<td style="padding:5px">
|
||||||
@@ -195,6 +201,107 @@
|
|||||||
<a href="javascript:void(0)" id="saveOtherMoneyDlg" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
|
<a href="javascript:void(0)" id="saveOtherMoneyDlg" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
|
||||||
<a href="javascript:void(0)" id="cancelOtherMoneyDlg" class="easyui-linkbutton" iconCls="icon-cancel">取消</a>
|
<a href="javascript:void(0)" id="cancelOtherMoneyDlg" class="easyui-linkbutton" iconCls="icon-cancel">取消</a>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="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>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -63,7 +63,13 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td style="width:60px;">客户:</td>
|
<td style="width:60px;">客户:</td>
|
||||||
<td style="padding:5px">
|
<td style="padding:5px">
|
||||||
<input id="OrganId" name="OrganId" style="width:130px;"/>
|
<div class="org-list">
|
||||||
|
<input id="OrganId" name="OrganId" style="width:130px;"/>
|
||||||
|
</div>
|
||||||
|
<div class="add-org-btn">
|
||||||
|
<img id="addCustomer" src="/js/easyui-1.3.5/themes/icons/edit_add.png"
|
||||||
|
style="cursor: pointer;" alt="增加客戶" title="增加客戶"/>
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td style="width:70px;">单据日期:</td>
|
<td style="width:70px;">单据日期:</td>
|
||||||
<td style="padding:5px">
|
<td style="padding:5px">
|
||||||
@@ -276,6 +282,107 @@
|
|||||||
<a href="javascript:void(0)" id="saveOtherMoneyDlg" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
|
<a href="javascript:void(0)" id="saveOtherMoneyDlg" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
|
||||||
<a href="javascript:void(0)" id="cancelOtherMoneyDlg" class="easyui-linkbutton" iconCls="icon-cancel">取消</a>
|
<a href="javascript:void(0)" id="cancelOtherMoneyDlg" class="easyui-linkbutton" iconCls="icon-cancel">取消</a>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="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>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -39,6 +39,10 @@
|
|||||||
|
|
||||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-print" id="printBtn">打印</a>
|
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-print" id="printBtn">打印</a>
|
||||||
</td>
|
</td>
|
||||||
|
<td> </td>
|
||||||
|
<td>
|
||||||
|
当前总余额:<span class="first-total">0</span>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
@@ -182,6 +186,13 @@
|
|||||||
if(res && res.code === 200){
|
if(res && res.code === 200){
|
||||||
if(res.data && res.data.page) {
|
if(res.data && res.data.page) {
|
||||||
$("#tableData").datagrid('loadData', res.data.page);
|
$("#tableData").datagrid('loadData', res.data.page);
|
||||||
|
var total = 0;
|
||||||
|
res.data.page.rows.forEach(function(value, index, array){
|
||||||
|
//执行某些操作
|
||||||
|
total += value.currentamount;
|
||||||
|
})
|
||||||
|
|
||||||
|
$(".first-total").text(total); //当前总余额
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
333
erp_web/pages/reports/stock_warning_report.html
Normal file
333
erp_web/pages/reports/stock_warning_report.html
Normal file
@@ -0,0 +1,333 @@
|
|||||||
|
<!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>
|
||||||
|
<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(); //当前月份
|
||||||
|
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 (!$("#searchProjectId").val()) {
|
||||||
|
$.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: 'basicInNumber', width: 80},
|
||||||
|
{title: '出库数量', field: 'basicOutNumber', width: 80},
|
||||||
|
{title: '库存数量', field: 'basicNumber', width: 80},
|
||||||
|
{title: '安全库存量', field: 'safetystock', width: 80},
|
||||||
|
{title: '临界库存量', field: 'basicLinjieNumber', 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
|
||||||
|
});
|
||||||
|
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: "/depotItem/findStockWarningCount",
|
||||||
|
dataType: "json",
|
||||||
|
data: ({
|
||||||
|
currentPage: pageNo,
|
||||||
|
pageSize: pageSize,
|
||||||
|
projectId : $.trim($("#searchProjectId").val())
|
||||||
|
}),
|
||||||
|
success: function (res) {
|
||||||
|
if(res && res.code === 200 && res.data) {
|
||||||
|
var HeadIds = res.data.total;
|
||||||
|
if (HeadIds > 0) {
|
||||||
|
if (pageSize === 3000) {
|
||||||
|
window.location.href = "/depotItem/exportWarningExcel?browserType=" + getOs() + "¤tPage=" + pageNo + "&pageSize=" + pageSize + "&projectId=" + $.trim($("#searchProjectId").val()) ;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//获取排序后的产品ID
|
||||||
|
$("#tableData").datagrid('loadData', res.data.rows);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$.messager.alert('查询提示', '无数据!', 'error');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//此处添加错误处理
|
||||||
|
error: function () {
|
||||||
|
$.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//报表打印
|
||||||
|
function print() {
|
||||||
|
$("#printBtn").off("click").on("click", function () {
|
||||||
|
CreateFormPage('打印报表', $('#tableData'));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -328,6 +328,7 @@ CREATE TABLE `jsh_depot` (
|
|||||||
`type` int(10) DEFAULT NULL COMMENT '类型',
|
`type` int(10) DEFAULT NULL COMMENT '类型',
|
||||||
`sort` varchar(10) DEFAULT NULL COMMENT '排序',
|
`sort` varchar(10) DEFAULT NULL COMMENT '排序',
|
||||||
`remark` varchar(100) DEFAULT NULL COMMENT '描述',
|
`remark` varchar(100) DEFAULT NULL COMMENT '描述',
|
||||||
|
`IsDefault` bit(1) DEFAULT NULL COMMENT '是否默认',
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COMMENT='仓库表';
|
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COMMENT='仓库表';
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
@@ -207,5 +207,16 @@ public class DepotController {
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@PostMapping(value = "/updateDepotIsDefault")
|
||||||
|
public String updateDepotIsDefault(@RequestParam("isDefault") Boolean isDefault,
|
||||||
|
@RequestParam("depotID") Long depotID,
|
||||||
|
HttpServletRequest request) throws Exception{
|
||||||
|
Map<String, Object> objectMap = new HashMap<String, Object>();
|
||||||
|
int res = depotService.updateDepotIsDefault(isDefault, depotID);
|
||||||
|
if(res > 0) {
|
||||||
|
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
|
||||||
|
} else {
|
||||||
|
return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
|
|||||||
import com.jsh.erp.constants.BusinessConstants;
|
import com.jsh.erp.constants.BusinessConstants;
|
||||||
import com.jsh.erp.constants.ExceptionConstants;
|
import com.jsh.erp.constants.ExceptionConstants;
|
||||||
import com.jsh.erp.datasource.entities.*;
|
import com.jsh.erp.datasource.entities.*;
|
||||||
|
import com.jsh.erp.datasource.vo.DepotItemStockWarningCount;
|
||||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||||
import com.jsh.erp.service.depotItem.DepotItemService;
|
import com.jsh.erp.service.depotItem.DepotItemService;
|
||||||
import com.jsh.erp.service.material.MaterialService;
|
import com.jsh.erp.service.material.MaterialService;
|
||||||
@@ -448,7 +449,7 @@ public class DepotItemController {
|
|||||||
BigDecimal InPrice = sumPrice("入库", pid, diEx.getMId(), monthTime, false);
|
BigDecimal InPrice = sumPrice("入库", pid, diEx.getMId(), monthTime, false);
|
||||||
BigDecimal OutPrice = sumPrice("出库", pid, diEx.getMId(), monthTime, false);
|
BigDecimal OutPrice = sumPrice("出库", pid, diEx.getMId(), monthTime, false);
|
||||||
item.put("MaterialName", diEx.getMName());
|
item.put("MaterialName", diEx.getMName());
|
||||||
item.put("MaterialModel", diEx.getMColor());
|
item.put("MaterialModel", diEx.getMModel());
|
||||||
//扩展信息
|
//扩展信息
|
||||||
String materialOther = getOtherInfo(mpArr, diEx);
|
String materialOther = getOtherInfo(mpArr, diEx);
|
||||||
item.put("MaterialOther", materialOther);
|
item.put("MaterialOther", materialOther);
|
||||||
@@ -827,4 +828,81 @@ public class DepotItemController {
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
/**
|
||||||
|
* 库存预警报表
|
||||||
|
* @param currentPage
|
||||||
|
* @param pageSize
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping(value = "/findStockWarningCount")
|
||||||
|
public BaseResponseInfo findStockWarningCount(@RequestParam("currentPage") Integer currentPage,
|
||||||
|
@RequestParam("pageSize") Integer pageSize, @RequestParam("projectId") Integer pid )throws Exception {
|
||||||
|
BaseResponseInfo res = new BaseResponseInfo();
|
||||||
|
Map<String, Object> map = new HashMap<String, Object>();
|
||||||
|
try {
|
||||||
|
List<DepotItemStockWarningCount> resList = new ArrayList<DepotItemStockWarningCount>();
|
||||||
|
List<DepotItemStockWarningCount> list = depotItemService.findStockWarningCount((currentPage-1)*pageSize, pageSize,pid);
|
||||||
|
int total = depotItemService.findStockWarningCountTotal(pid);
|
||||||
|
map.put("total", total);
|
||||||
|
map.put("rows", list);
|
||||||
|
res.code = 200;
|
||||||
|
res.data = map;
|
||||||
|
} catch(Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
res.code = 500;
|
||||||
|
res.data = "获取数据失败";
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 导出库存预警excel表格
|
||||||
|
* @param currentPage
|
||||||
|
* @param pageSize
|
||||||
|
* @param projectId
|
||||||
|
* @param monthTime
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping(value = "/exportWarningExcel")
|
||||||
|
public BaseResponseInfo exportWarningExcel(@RequestParam("currentPage") Integer currentPage,
|
||||||
|
@RequestParam("pageSize") Integer pageSize,
|
||||||
|
@RequestParam("projectId") Integer projectId,
|
||||||
|
HttpServletRequest request, HttpServletResponse response)throws Exception {
|
||||||
|
BaseResponseInfo res = new BaseResponseInfo();
|
||||||
|
Map<String, Object> map = new HashMap<String, Object>();
|
||||||
|
String message = "成功";
|
||||||
|
try {
|
||||||
|
List<DepotItemStockWarningCount> dataList = depotItemService.findStockWarningCount((currentPage - 1) * pageSize, pageSize, projectId);
|
||||||
|
//存放数据json数组
|
||||||
|
Integer pid = projectId;
|
||||||
|
String[] names = {"名称", "型号", "扩展信息", "单位", "入库数量", "出库数量", "库存数量", "安全库存量", "临界库存量"};
|
||||||
|
String title = "库存预警报表";
|
||||||
|
List<String[]> objects = new ArrayList<String[]>();
|
||||||
|
if (null != dataList) {
|
||||||
|
for (DepotItemStockWarningCount diEx : dataList) {
|
||||||
|
String[] objs = new String[9];
|
||||||
|
|
||||||
|
objs[0] = diEx.getMaterialName().toString();
|
||||||
|
objs[1] = diEx.getMaterialModel().toString();
|
||||||
|
objs[2] = diEx.getMaterialOther().toString();
|
||||||
|
objs[3] = diEx.getMaterialUnit().toString();
|
||||||
|
objs[4] = diEx.getBasicInNumber().toString();
|
||||||
|
objs[5] = diEx.getBasicOutNumber() == null ? "0" : diEx.getBasicOutNumber().toString();
|
||||||
|
objs[6] = diEx.getBasicNumber() == null ? "0" : diEx.getBasicNumber().toString();
|
||||||
|
objs[7] = diEx.getSafetystock() == null ? "0" : diEx.getSafetystock().toString();
|
||||||
|
objs[8] = diEx.getBasicLinjieNumber() == null ? "0" : diEx.getBasicLinjieNumber().toString();
|
||||||
|
objects.add(objs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
File file = ExcelUtils.exportObjectsWithoutTitle(title+pid, names, title, objects);
|
||||||
|
ExportExecUtil.showExec(file, file.getName(), response);
|
||||||
|
res.code = 200;
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
message = "导出失败";
|
||||||
|
res.code = 500;
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -90,6 +90,15 @@ public class Depot {
|
|||||||
* @mbggenerated
|
* @mbggenerated
|
||||||
*/
|
*/
|
||||||
private String deleteFlag;
|
private String deleteFlag;
|
||||||
|
private Boolean isdefault;
|
||||||
|
|
||||||
|
public Boolean getIsdefault() {
|
||||||
|
return isdefault;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsdefault(Boolean isdefault) {
|
||||||
|
this.isdefault = isdefault;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method was generated by MyBatis Generator.
|
* This method was generated by MyBatis Generator.
|
||||||
|
|||||||
@@ -235,6 +235,7 @@ public class DepotExample {
|
|||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Criteria andIdIn(List<Long> values) {
|
public Criteria andIdIn(List<Long> values) {
|
||||||
addCriterion("id in", values, "id");
|
addCriterion("id in", values, "id");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
@@ -664,7 +665,65 @@ public class DepotExample {
|
|||||||
addCriterion("remark <>", value, "remark");
|
addCriterion("remark <>", value, "remark");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
public Criteria andIsdefaultIsNull() {
|
||||||
|
addCriterion("IsDefault is null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andIsdefaultIsNotNull() {
|
||||||
|
addCriterion("IsDefault is not null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andIsdefaultEqualTo(Boolean value) {
|
||||||
|
addCriterion("IsDefault =", value, "isdefault");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andIsdefaultNotEqualTo(Boolean value) {
|
||||||
|
addCriterion("IsDefault <>", value, "isdefault");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andIsdefaultGreaterThan(Boolean value) {
|
||||||
|
addCriterion("IsDefault >", value, "isdefault");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andIsdefaultGreaterThanOrEqualTo(Boolean value) {
|
||||||
|
addCriterion("IsDefault >=", value, "isdefault");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andIsdefaultLessThan(Boolean value) {
|
||||||
|
addCriterion("IsDefault <", value, "isdefault");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andIsdefaultLessThanOrEqualTo(Boolean value) {
|
||||||
|
addCriterion("IsDefault <=", value, "isdefault");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andIsdefaultIn(List<Boolean> values) {
|
||||||
|
addCriterion("IsDefault in", values, "isdefault");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andIsdefaultNotIn(List<Boolean> values) {
|
||||||
|
addCriterion("IsDefault not in", values, "isdefault");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andIsdefaultBetween(Boolean value1, Boolean value2) {
|
||||||
|
addCriterion("IsDefault between", value1, value2, "isdefault");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andIsdefaultNotBetween(Boolean value1, Boolean value2) {
|
||||||
|
addCriterion("IsDefault not between", value1, value2, "isdefault");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
public Criteria andRemarkGreaterThan(String value) {
|
public Criteria andRemarkGreaterThan(String value) {
|
||||||
addCriterion("remark >", value, "remark");
|
addCriterion("remark >", value, "remark");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.jsh.erp.datasource.mappers;
|
package com.jsh.erp.datasource.mappers;
|
||||||
|
|
||||||
import com.jsh.erp.datasource.entities.*;
|
import com.jsh.erp.datasource.entities.*;
|
||||||
|
import com.jsh.erp.datasource.vo.DepotItemStockWarningCount;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
@@ -172,4 +173,10 @@ public interface DepotItemMapperEx {
|
|||||||
List<DepotItem> getDepotItemListListByDepotIds(@Param("depotIds") String[] depotIds);
|
List<DepotItem> getDepotItemListListByDepotIds(@Param("depotIds") String[] depotIds);
|
||||||
|
|
||||||
List<DepotItem> getDepotItemListListByMaterialIds(@Param("materialIds") String[] materialIds);
|
List<DepotItem> getDepotItemListListByMaterialIds(@Param("materialIds") String[] materialIds);
|
||||||
|
|
||||||
|
|
||||||
|
List<DepotItemStockWarningCount> findStockWarningCount(@Param("offset") Integer offset,
|
||||||
|
@Param("rows") Integer rows, @Param("pid") Integer pid);
|
||||||
|
|
||||||
|
int findStockWarningCountTotal( @Param("pid") Integer pid);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,109 @@
|
|||||||
|
package com.jsh.erp.datasource.vo;
|
||||||
|
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
public class DepotItemStockWarningCount {
|
||||||
|
|
||||||
|
|
||||||
|
private String MaterialName;
|
||||||
|
|
||||||
|
private String MaterialModel;
|
||||||
|
|
||||||
|
private String categoryName;
|
||||||
|
|
||||||
|
private String MaterialOther;
|
||||||
|
|
||||||
|
private String MaterialUnit;
|
||||||
|
|
||||||
|
private BigDecimal safetystock;//安全库存量
|
||||||
|
|
||||||
|
private BigDecimal BasicInNumber;//入库量
|
||||||
|
|
||||||
|
private BigDecimal BasicOutNumber;//出库量
|
||||||
|
|
||||||
|
|
||||||
|
private BigDecimal BasicNumber;//库存
|
||||||
|
|
||||||
|
private BigDecimal BasicLinjieNumber;//临界库存
|
||||||
|
|
||||||
|
public String getMaterialName() {
|
||||||
|
return MaterialName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaterialName(String materialName) {
|
||||||
|
MaterialName = materialName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMaterialModel() {
|
||||||
|
return MaterialModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaterialModel(String materialModel) {
|
||||||
|
MaterialModel = materialModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCategoryName() {
|
||||||
|
return categoryName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCategoryName(String categoryName) {
|
||||||
|
this.categoryName = categoryName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMaterialOther() {
|
||||||
|
return MaterialOther;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaterialOther(String materialOther) {
|
||||||
|
MaterialOther = materialOther;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMaterialUnit() {
|
||||||
|
return MaterialUnit;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaterialUnit(String materialUnit) {
|
||||||
|
MaterialUnit = materialUnit;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getSafetystock() {
|
||||||
|
return safetystock;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSafetystock(BigDecimal safetystock) {
|
||||||
|
this.safetystock = safetystock;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getBasicInNumber() {
|
||||||
|
return BasicInNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBasicInNumber(BigDecimal basicInNumber) {
|
||||||
|
BasicInNumber = basicInNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getBasicOutNumber() {
|
||||||
|
return BasicOutNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBasicOutNumber(BigDecimal basicOutNumber) {
|
||||||
|
BasicOutNumber = basicOutNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getBasicNumber() {
|
||||||
|
return BasicNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBasicNumber(BigDecimal basicNumber) {
|
||||||
|
BasicNumber = basicNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getBasicLinjieNumber() {
|
||||||
|
return BasicLinjieNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBasicLinjieNumber(BigDecimal basicLinjieNumber) {
|
||||||
|
BasicLinjieNumber = basicLinjieNumber;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -316,4 +316,24 @@ public class DepotService {
|
|||||||
return deleteTotal;
|
return deleteTotal;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
|
public int updateDepotIsDefault(Boolean isDefault, Long depotID) throws Exception{
|
||||||
|
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_DEPOT,BusinessConstants.LOG_OPERATION_TYPE_EDIT+depotID,
|
||||||
|
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||||
|
Depot depot = new Depot();
|
||||||
|
depot.setIsdefault(isDefault);
|
||||||
|
DepotExample example = new DepotExample();
|
||||||
|
example.createCriteria().andIdEqualTo(depotID);
|
||||||
|
int result=0;
|
||||||
|
try{
|
||||||
|
result = depotMapper.updateByExampleSelective(depot, example);
|
||||||
|
}catch(Exception e){
|
||||||
|
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||||
|
ExceptionConstants.DATA_WRITE_FAIL_CODE,ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
|
||||||
|
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
|
||||||
|
ExceptionConstants.DATA_WRITE_FAIL_MSG);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,17 +9,16 @@ import com.jsh.erp.datasource.mappers.DepotHeadMapper;
|
|||||||
import com.jsh.erp.datasource.mappers.DepotItemMapper;
|
import com.jsh.erp.datasource.mappers.DepotItemMapper;
|
||||||
import com.jsh.erp.datasource.mappers.DepotItemMapperEx;
|
import com.jsh.erp.datasource.mappers.DepotItemMapperEx;
|
||||||
import com.jsh.erp.datasource.mappers.SerialNumberMapperEx;
|
import com.jsh.erp.datasource.mappers.SerialNumberMapperEx;
|
||||||
|
import com.jsh.erp.datasource.vo.DepotItemStockWarningCount;
|
||||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||||
import com.jsh.erp.service.log.LogService;
|
import com.jsh.erp.service.log.LogService;
|
||||||
import com.jsh.erp.service.material.MaterialService;
|
import com.jsh.erp.service.material.MaterialService;
|
||||||
import com.jsh.erp.service.serialNumber.SerialNumberService;
|
import com.jsh.erp.service.serialNumber.SerialNumberService;
|
||||||
import com.jsh.erp.service.user.UserService;
|
import com.jsh.erp.service.user.UserService;
|
||||||
import com.jsh.erp.utils.ErpInfo;
|
|
||||||
import com.jsh.erp.utils.QueryUtils;
|
import com.jsh.erp.utils.QueryUtils;
|
||||||
import com.jsh.erp.utils.StringUtil;
|
import com.jsh.erp.utils.StringUtil;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.dao.DataAccessException;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.context.request.RequestContextHolder;
|
import org.springframework.web.context.request.RequestContextHolder;
|
||||||
@@ -32,8 +31,6 @@ import java.util.Date;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class DepotItemService {
|
public class DepotItemService {
|
||||||
private Logger logger = LoggerFactory.getLogger(DepotItemService.class);
|
private Logger logger = LoggerFactory.getLogger(DepotItemService.class);
|
||||||
@@ -795,4 +792,32 @@ public class DepotItemService {
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
|
public List<DepotItemStockWarningCount> findStockWarningCount(int offset, Integer rows, Integer pid) {
|
||||||
|
|
||||||
|
List<DepotItemStockWarningCount> list = null;
|
||||||
|
try{
|
||||||
|
list =depotItemMapperEx.findStockWarningCount( offset, rows, pid);
|
||||||
|
}catch(Exception e){
|
||||||
|
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||||
|
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||||
|
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||||
|
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||||
|
public int findStockWarningCountTotal(Integer pid) {
|
||||||
|
int result = 0;
|
||||||
|
try{
|
||||||
|
result =depotItemMapperEx.findStockWarningCountTotal(pid);
|
||||||
|
}catch(Exception e){
|
||||||
|
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||||
|
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||||
|
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
|
||||||
|
ExceptionConstants.DATA_READ_FAIL_MSG);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,6 +41,18 @@
|
|||||||
<result column="MaterialUnit" jdbcType="VARCHAR" property="MaterialUnit" />
|
<result column="MaterialUnit" jdbcType="VARCHAR" property="MaterialUnit" />
|
||||||
<result column="MColor" jdbcType="VARCHAR" property="MColor" />
|
<result column="MColor" jdbcType="VARCHAR" property="MColor" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
<resultMap id="ResultStockWarningCount" type="com.jsh.erp.datasource.vo.DepotItemStockWarningCount">
|
||||||
|
<result column="MaterialName" jdbcType="VARCHAR" property="MaterialName" />
|
||||||
|
<result column="MaterialModel" jdbcType="VARCHAR" property="MaterialModel" />
|
||||||
|
<result column="categoryName" jdbcType="VARCHAR" property="categoryName" />
|
||||||
|
<result column="MaterialOther" jdbcType="VARCHAR" property="MaterialOther" />
|
||||||
|
<result column="MaterialUnit" jdbcType="VARCHAR" property="MaterialUnit" />
|
||||||
|
<result column="safetystock" jdbcType="DECIMAL" property="safetystock" />
|
||||||
|
<result column="BasicInNumber" jdbcType="DECIMAL" property="BasicInNumber" />
|
||||||
|
<result column="BasicOutNumber" jdbcType="DECIMAL" property="BasicOutNumber" />
|
||||||
|
<result column="BasicNumber" jdbcType="DECIMAL" property="BasicNumber" />
|
||||||
|
<result column="BasicLinjieNumber" jdbcType="DECIMAL" property="BasicLinjieNumber" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
<select id="selectByConditionDepotItem" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="com.jsh.erp.datasource.mappers.DepotItemMapper.BaseResultMap">
|
<select id="selectByConditionDepotItem" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="com.jsh.erp.datasource.mappers.DepotItemMapper.BaseResultMap">
|
||||||
select *
|
select *
|
||||||
@@ -438,5 +450,95 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<select id="findStockWarningCount" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultStockWarningCount">
|
||||||
|
SELECT
|
||||||
|
m. NAME MaterialName,
|
||||||
|
m.Model MaterialModel,
|
||||||
|
mc.`Name` categoryName,
|
||||||
|
CONCAT(
|
||||||
|
'(',
|
||||||
|
m.Standard,
|
||||||
|
')',
|
||||||
|
'(',
|
||||||
|
m.Color,
|
||||||
|
')'
|
||||||
|
) AS MaterialOther,
|
||||||
|
m.unit MaterialUnit,
|
||||||
|
ifnull(m.safetystock,0) safetystock,
|
||||||
|
IFNULL(intype.BasicInNumber ,0) BasicInNumber,
|
||||||
|
IFNULL(outtype.BasicOutNumber ,0) BasicOutNumber,
|
||||||
|
(
|
||||||
|
IFNULL(intype.BasicInNumber ,0) - IFNULL(outtype.BasicOutNumber ,0)
|
||||||
|
) BasicNumber,
|
||||||
|
(IFNULL(intype.BasicInNumber ,0) - IFNULL(outtype.BasicOutNumber ,0) - ifnull(m.safetystock,0)) BasicLinjieNumber
|
||||||
|
FROM
|
||||||
|
jsh_material m
|
||||||
|
LEFT JOIN jsh_materialcategory mc ON mc.Id = m.CategoryId
|
||||||
|
LEFT JOIN (
|
||||||
|
SELECT
|
||||||
|
di.MaterialId,
|
||||||
|
ifnull(sum(BasicNumber), 0) AS BasicInNumber
|
||||||
|
FROM
|
||||||
|
jsh_depothead dh
|
||||||
|
INNER JOIN jsh_depotitem di ON dh.id = di.HeaderId
|
||||||
|
AND ifnull(di.delete_Flag, '0') != '1'
|
||||||
|
WHERE
|
||||||
|
dh.type = '入库'
|
||||||
|
<if test="pid != null">
|
||||||
|
and di.DepotId= ${pid}
|
||||||
|
</if>
|
||||||
|
AND ifnull(dh.delete_Flag, '0') != '1' group by di.MaterialId
|
||||||
|
) intype ON intype.MaterialId = m.id
|
||||||
|
LEFT JOIN (
|
||||||
|
SELECT
|
||||||
|
di.MaterialId,
|
||||||
|
ifnull(sum(BasicNumber), 0) AS BasicOutNumber
|
||||||
|
FROM
|
||||||
|
jsh_depothead dh
|
||||||
|
INNER JOIN jsh_depotitem di ON dh.id = di.HeaderId
|
||||||
|
AND ifnull(di.delete_Flag, '0') != '1'
|
||||||
|
WHERE
|
||||||
|
dh.type = '出库'
|
||||||
|
AND dh.SubType != '调拨'
|
||||||
|
<if test="pid != null">
|
||||||
|
and di.DepotId= ${pid}
|
||||||
|
</if>
|
||||||
|
AND ifnull(dh.delete_Flag, '0') != '1' group by di.MaterialId
|
||||||
|
) outtype ON outtype.MaterialId = m.id
|
||||||
|
WHERE
|
||||||
|
1 = 1
|
||||||
|
AND ifnull(m.delete_Flag, '0') != '1'
|
||||||
|
AND intype.BasicInNumber > 0
|
||||||
|
ORDER BY
|
||||||
|
(IFNULL(intype.BasicInNumber ,0) - IFNULL(outtype.BasicOutNumber ,0) - ifnull(m.safetystock,0))
|
||||||
|
<if test="offset != null and rows != null">
|
||||||
|
limit #{offset},#{rows}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="findStockWarningCountTotal" resultType="java.lang.Integer">
|
||||||
|
select count(1) from
|
||||||
|
jsh_material m
|
||||||
|
LEFT JOIN (
|
||||||
|
SELECT
|
||||||
|
di.MaterialId,
|
||||||
|
ifnull(sum(BasicNumber), 0) AS BasicInNumber
|
||||||
|
FROM
|
||||||
|
jsh_depothead dh
|
||||||
|
INNER JOIN jsh_depotitem di ON dh.id = di.HeaderId
|
||||||
|
AND ifnull(di.delete_Flag, '0') != '1'
|
||||||
|
WHERE
|
||||||
|
dh.type = '入库'
|
||||||
|
<if test="pid != null">
|
||||||
|
and di.DepotId= ${pid}
|
||||||
|
</if>
|
||||||
|
AND ifnull(dh.delete_Flag, '0') != '1' group by di.MaterialId
|
||||||
|
) intype ON intype.MaterialId = m.id
|
||||||
|
|
||||||
|
WHERE
|
||||||
|
1 = 1
|
||||||
|
AND ifnull(m.delete_Flag, '0') != '1'
|
||||||
|
AND intype.BasicInNumber > 0
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -17,6 +17,7 @@
|
|||||||
<result column="principal" jdbcType="BIGINT" property="principal" />
|
<result column="principal" jdbcType="BIGINT" property="principal" />
|
||||||
<result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
|
<result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
|
||||||
<result column="delete_Flag" jdbcType="VARCHAR" property="deleteFlag" />
|
<result column="delete_Flag" jdbcType="VARCHAR" property="deleteFlag" />
|
||||||
|
<result column="IsDefault" jdbcType="BIT" property="isdefault" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<sql id="Example_Where_Clause">
|
<sql id="Example_Where_Clause">
|
||||||
<!--
|
<!--
|
||||||
@@ -90,7 +91,7 @@
|
|||||||
This element is automatically generated by MyBatis Generator, do not modify.
|
This element is automatically generated by MyBatis Generator, do not modify.
|
||||||
-->
|
-->
|
||||||
id, name, address, warehousing, truckage, type, sort, remark, principal, tenant_id,
|
id, name, address, warehousing, truckage, type, sort, remark, principal, tenant_id,
|
||||||
delete_Flag
|
delete_Flag,IsDefault
|
||||||
</sql>
|
</sql>
|
||||||
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.DepotExample" resultMap="BaseResultMap">
|
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.DepotExample" resultMap="BaseResultMap">
|
||||||
<!--
|
<!--
|
||||||
@@ -279,6 +280,9 @@
|
|||||||
<if test="record.deleteFlag != null">
|
<if test="record.deleteFlag != null">
|
||||||
delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR},
|
delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="record.isdefault != null">
|
||||||
|
IsDefault = #{record.isdefault,jdbcType=BIT},
|
||||||
|
</if>
|
||||||
</set>
|
</set>
|
||||||
<if test="_parameter != null">
|
<if test="_parameter != null">
|
||||||
<include refid="Update_By_Example_Where_Clause" />
|
<include refid="Update_By_Example_Where_Clause" />
|
||||||
|
|||||||
Reference in New Issue
Block a user