no commit message

This commit is contained in:
季圣华
2017-08-30 00:12:14 +08:00
parent 7907b729b9
commit 0c917016d3
40 changed files with 6538 additions and 2449 deletions

View File

@@ -38,7 +38,7 @@ var windowTemp = template(
'<a class="ha-revert" btn="revert" href="javascript:;" title="还原" <% if(!isopenmax){ %>style="display:none"<% } %>><b class="revert-b"></b><b class="revert-t"></b></a>'+
'<% } %>'+
'<% if(istitlebarFullscreen){ %>'+
'<a class="ha-fullscreen" btn="fullscreen" href="javascript:;" title="全屏">+</a>'+
'<a class="ha-fullscreen" btn="fullscreen" href="javascript:;" title="全屏" style="display: none;">+</a>'+
'<% } %>'+
'<a class="ha-close" btn="close" href="javascript:;" title="关闭">×</a>'+
'</div>'+

View File

@@ -84,6 +84,29 @@ function getUrlParam(name) {
if (r != null) return unescape(r[2]); return null; //返回参数值
}
/**
* 获取按钮的权限
*/
function getBtnStr() {
var funId = window.parent.window.funId; //功能id
var btnStrList = window.parent.window.winBtnStrList; //按钮功能列表 JSON字符串
var btnEnableList =""; //按钮列表
if(funId && btnStrList) {
btnStrList = JSON.parse(btnStrList);
for(var i=0; i<btnStrList.length; i++){
if(btnStrList[i].funId ==funId){
if(btnStrList[i].btnStr) {
btnEnableList = btnEnableList + btnStrList[i].btnStr + ",";
}
}
}
if(btnEnableList) {
btnEnableList = btnEnableList.substring(0,btnEnableList.length-1);
}
}
return btnEnableList;
}
/**
* js获取当前时间 格式“yyyy-MM-dd HH:MM:SS”
*/
@@ -93,15 +116,27 @@ function getNowFormatDateTime() {
var seperator2 = ":";
var month = date.getMonth() + 1;
var strDate = date.getDate();
var strHours = date.getHours();
var strMinutes = date.getMinutes();
var strSeconds = date.getSeconds();
if (month >= 1 && month <= 9) {
month = "0" + month;
}
if (strDate >= 0 && strDate <= 9) {
strDate = "0" + strDate;
}
if (strHours >= 0 && strHours <= 9) {
strHours = "0" + strHours;
}
if (strMinutes >= 0 && strMinutes <= 9) {
strMinutes = "0" + strMinutes;
}
if (strSeconds >= 0 && strSeconds <= 9) {
strSeconds = "0" + strSeconds;
}
var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate
+ " " + date.getHours() + seperator2 + date.getMinutes()
+ seperator2 + date.getSeconds();
+ " " + strHours + seperator2 + strMinutes
+ seperator2 + strSeconds;
return currentdate;
}
@@ -138,6 +173,23 @@ function getNowFormatDate() {
return currentdate;
}
/**
* js获取当前时间 格式“yyyyMMdd”
*/
function getNowFormatDateTwo() {
var date = new Date();
var month = date.getMonth() + 1;
var strDate = date.getDate();
if (month >= 1 && month <= 9) {
month = "0" + month;
}
if (strDate >= 0 && strDate <= 9) {
strDate = "0" + strDate;
}
var currentdate = date.getFullYear() + month + strDate;
return currentdate;
}
/**
* js根据时间生成编号 格式“yyyyMMddHHMMSS”
*/
@@ -156,4 +208,8 @@ function getNowFormatDateNum() {
var currentdate = date.getFullYear() + month + strDate + date.getHours()
+ date.getMinutes() + date.getSeconds();
return currentdate;
}
function encode(name){
return encodeURI(encodeURI(name));
}

View File

@@ -171,9 +171,9 @@ function tabCloseEven() {
return false;
});
//退出
$("#mm-exit").click(function () {
$('#mm').menu('hide');
//显示版权信息
$("#mm-version").click(function () {
window.open("https://gitee.com/jishenghua/JSH_ERP");
})
}

View File

@@ -55,8 +55,6 @@
.icon-filter{
background:url('icons/filter.png') no-repeat center center;
}
.icon-mini-add{
background:url('icons/mini_add.png') no-repeat center center;
}
@@ -92,4 +90,10 @@
}
.icon-excel{
background:url('icons/receipt-excel.png') no-repeat center center;
}
.icon-excel-new{
background:url('icons/excel1.png') no-repeat center center;
}
.icon-page-excel{
background:url('icons/page_excel.png') no-repeat center center;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -221,28 +221,27 @@
pageSize: 5,
pageList: initPageNum,
columns:[[
{ field: 'Id',width:35,align:"center",checkbox:true},
{field: 'OrganId',width:5, hidden:true},
{ title: '单据编号',field: 'BillNo',width:140},
{ title: '单据时间 ',field: 'BillTime',width:100},
{ title: '合计',field: 'TotalPrice',width:80},
{ title: '备注',field: 'Remark',width:100},
{ title: '操作',field: 'op',align:"center",width:180,formatter:function(value,rec)
{
var str = '';
var rowInfo = rec.Id + 'AaBb' + rec.BillNo+ 'AaBb' + rec.BillTime+ 'AaBb' + rec.Remark
+ 'AaBb' + rec.AccountId+ 'AaBb' + rec.AccountName + 'AaBb' + rec.OrganId + 'AaBb' + rec.OrganName
+ 'AaBb' + rec.HandsPersonId + 'AaBb' + rec.HandsPersonName + 'AaBb' + rec.ChangeAmount + 'AaBb' + rec.TotalPrice;
if(1 == value)
{
var orgId = rec.OrganId ? rec.OrganId : 0;
str += '<a onclick="showAccountHead(\'' + rowInfo + '\');" style="text-decoration:none;color:black;" href="javascript:void(0)"><span class="action-show">查看</span></a>';
str += '<a onclick="editAccountHead(\'' + rowInfo + '\');" style="text-decoration:none;color:black;" href="javascript:void(0)"><span class="action-edit">编辑</span></a>';
str += '<a onclick="deleteAccountHead('+ rec.Id +',' + orgId +',' + rec.TotalPrice +');" style="text-decoration:none;color:black;" href="javascript:void(0)"><span class="action-delete">删除</span></a>';
{ field: 'Id',width:35,align:"center",checkbox:true},
{ title: '操作',field: 'op',align:"center",width:90,formatter:function(value,rec) {
var str = '';
var rowInfo = rec.Id + 'AaBb' + rec.BillNo+ 'AaBb' + rec.BillTime+ 'AaBb' + rec.Remark
+ 'AaBb' + rec.AccountId+ 'AaBb' + rec.AccountName + 'AaBb' + rec.OrganId + 'AaBb' + rec.OrganName
+ 'AaBb' + rec.HandsPersonId + 'AaBb' + rec.HandsPersonName + 'AaBb' + rec.ChangeAmount + 'AaBb' + rec.TotalPrice;
if(1 == value)
{
var orgId = rec.OrganId ? rec.OrganId : 0;
str += '<img title="查看" src=' + path + '"/js/easyui-1.3.5/themes/icons/list.png" style="cursor: pointer;" onclick="showAccountHead(\'' + rowInfo + '\');"/>&nbsp;&nbsp;&nbsp;';
str += '<img title="编辑" src=' + path + '"/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editAccountHead(\'' + rowInfo + '\''+',' + rec.Status + ');"/>&nbsp;&nbsp;&nbsp;';
str += '<img title="删除" src=' + path + '"/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteAccountHead('+ rec.Id +',' + orgId +',' + rec.TotalPrice + ');"/>';
}
return str;
}
return str;
}
}
},
{ field: 'OrganId',width:5, hidden:true},
{ title: '单据编号',field: 'BillNo',width:140},
{ title: '单据时间 ',field: 'BillTime',width:100},
{ title: '合计',field: 'TotalPrice',width:80},
{ title: '备注',field: 'Remark',width:100}
]],
toolbar:[
{

View File

@@ -0,0 +1,22 @@
[
{
"id": 1,
"text": "导入导出"
},
{
"id": 2,
"text": "启用禁用"
},
{
"id": 3,
"text": "审核反审核"
},
{
"id": 4,
"text": "打印"
},
{
"id": 5,
"text": "作废"
}
]

View File

@@ -0,0 +1,746 @@
//初始化界面
$(function() {
var listTitle = ""; //单据标题
var listType = ""; //类型
var listTypeEn = ""; //英文类型
getType();
getPersonList(); //获取业务员
initTableData();
ininPager();
bindEvent();
});
//根据名称获取类型
function getType(){
listTitle = $("#tablePanel").prev().text();
if(listTitle === "供应商信息列表"){
listType = "供应商";
listTypeEn = "Vendor";
}
else if(listTitle === "客户信息列表"){
listType = "客户";
listTypeEn = "Customer";
}
else if(listTitle === "会员信息列表"){
listType = "会员";
listTypeEn = "Member";
}
}
//获取业务员
function getPersonList(){
$.ajax({
type:"post",
url: path + "/person/getBasicData.action",
dataType: "json",
success: function (systemInfo)
{
var msgTip = systemInfo.showModel.msgTip;
if(msgTip !== "exceptoin"){
var personList = systemInfo.showModel.map.personList;
var personID,options;
if(personList !=null)
{
for(var i = 0 ;i < personList.length;i++)
{
var person = personList[i];
if(0 == i)
{
personID = person.id;
}
if(person.type=="仓管员")
{
options += '<option value="' + person.id + '">' + person.name + '</option>';
}
}
$("#personId").empty().append('<option>不关联业务员</option>').append(options);
}
}
else {
$.messager.alert('提示','查找系统基础信息异常,请与管理员联系!','error');
return;
}
}
});
}
//初始化表格数据
function initTableData() {
//改变宽度和高度
$("#searchPanel").panel({width:webW-2});
$("#tablePanel").panel({width:webW-2});
$('#tableData').datagrid({
//title:'单位列表',
//iconCls:'icon-save',
//width:700,
height:heightInfo,
nowrap: false,
rownumbers: false,
//动画效果
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:[[
{ field: 'id',width:35,align:"center",checkbox:true},
{ title: '操作',field: 'op',align:"center",width:60,formatter:function(value,rec)
{
var str = '';
var rowInfo = rec.id + 'AaBb' + rec.supplier +'AaBb' + rec.contacts + 'AaBb'+ rec.phonenum + 'AaBb'+ rec.email + 'AaBb'+ rec.BeginNeedGet + 'AaBb'+ rec.BeginNeedPay + 'AaBb' + rec.isystem + 'AaBb' + rec.description+ 'AaBb' + rec.type
+ 'AaBb' + rec.fax + 'AaBb' + rec.telephone + 'AaBb' + rec.address + 'AaBb' + rec.taxNum + 'AaBb' + rec.bankName + 'AaBb' + rec.accountNumber + 'AaBb' + rec.taxRate;
if(1 == value)
{
str += '<img title="编辑" src="' + path + '/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editSupplier(\'' + rowInfo + '\');"/>&nbsp;&nbsp;&nbsp;';
str += '<img title="删除" src="' + path + '/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteSupplier(\'' + rowInfo + '\');"/>';
}
return str;
}
},
{ title: '名称',field: 'supplier',width:150},
{ title: '联系人', field: 'contacts',width:50,align:"center"},
{ title: '手机号码', field: 'telephone',width:100,align:"center"},
{ title: '电子邮箱',field: 'email',width:80,align:"center"},
{ title: '联系电话', field: 'phonenum',width:100,align:"center"},
{ title: '传真', field: 'fax',width:100,align:"center"},
{ title: '预付款',field: 'AdvanceIn',width:70,align:"center"},
{ title: '期初应收',field: 'BeginNeedGet',width:70,align:"center"},
{ title: '期初应付',field: 'BeginNeedPay',width:70,align:"center"},
{ title: '税率', field: 'taxRate',width:50,align:"center"},
{ title: '状态',field: 'enabled',width:70,align:"center",formatter:function(value){
return value? "启用":"禁用";
}}
]],
toolbar:[
{
id:'addSupplier',
text:'增加',
iconCls:'icon-add',
handler:function() {
addSuppler();
}
},'-',
{
id:'deleteSupplier',
text:'删除',
iconCls:'icon-remove',
handler:function() {
batDeleteSupplier();
}
},'-',
{
id:'setEnable',
text:'启用',
iconCls:'icon-ok',
handler:function() {
setEnableFun();
}
},'-',
{
id:'setDisEnable',
text:'禁用',
iconCls:'icon-no',
handler:function() {
setDisEnableFun();
}
},'-',
{
id:'setInput',
text:'导入',
iconCls:'icon-excel',
handler:function() {
setInputFun();
}
},'-',
{
id:'setOutput',
text:'导出',
iconCls:'icon-excel',
handler:function() {
setOutputFun();
}
}
],
onLoadError:function()
{
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
return;
}
});
}
//分页信息处理
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
});
showSupplierDetails(pageNum,pageSize);
}
});
}
catch (e)
{
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
}
}
//删除信息
function deleteSupplier(supplierInfo) {
$.messager.confirm('删除确认','确定要删除此条信息吗?',function(r)
{
if (r)
{
var supplierTotalInfo = supplierInfo.split("AaBb");
$.ajax({
type:"post",
url: path + "/supplier/delete.action",
dataType: "json",
data: ({
supplierID : supplierTotalInfo[0],
supplier:supplierTotalInfo[1],
clientIp: clientIp
}),
success: function (tipInfo)
{
var msg = tipInfo.showModel.msgTip;
if(msg == '成功')
//加载完以后重新初始化
$("#searchBtn").click();
else
$.messager.alert('删除提示','删除信息失败,请稍后再试!','error');
},
//此处添加错误处理
error:function()
{
$.messager.alert('删除提示','删除信息异常,请稍后再试!','error');
return;
}
});
}
});
}
//批量删除单位
function batDeleteSupplier() {
var row = $('#tableData').datagrid('getChecked');
if(row.length == 0)
{
$.messager.alert('删除提示','没有记录被选中!','info');
return;
}
if(row.length > 0)
{
$.messager.confirm('删除确认','确定要删除选中的' + row.length + '条信息吗?',function(r)
{
if (r)
{
var ids = "";
for(var i = 0;i < row.length; i ++)
{
if(i == row.length-1)
{
ids += row[i].id;
break;
}
ids += row[i].id + ",";
}
$.ajax({
type:"post",
url: path + "/supplier/batchDelete.action",
dataType: "json",
async : false,
data: ({
supplierIDs : ids,
clientIp: clientIp
}),
success: function (tipInfo)
{
var msg = tipInfo.showModel.msgTip;
if(msg == '成功')
{
//加载完以后重新初始化
$("#searchBtn").click();
$(":checkbox").attr("checked",false);
}
else
$.messager.alert('删除提示','删除信息失败,请稍后再试!','error');
},
//此处添加错误处理
error:function()
{
$.messager.alert('删除提示','删除信息异常,请稍后再试!','error');
return;
}
});
}
});
}
}
//批量启用
function setEnableFun() {
var row = $('#tableData').datagrid('getChecked');
if(row.length == 0)
{
$.messager.alert('启用提示','没有记录被选中!','info');
return;
}
if(row.length > 0)
{
$.messager.confirm('启用确认','确定要启用选中的' + row.length + '条信息吗?',function(r)
{
if (r)
{
var ids = "";
for(var i = 0;i < row.length; i ++)
{
if(i == row.length-1)
{
ids += row[i].id;
break;
}
ids += row[i].id + ",";
}
$.ajax({
type:"post",
url: path + "/supplier/batchSetEnable.action",
dataType: "json",
async : false,
data: ({
enabled: true,
supplierIDs : ids,
clientIp: clientIp
}),
success: function (tipInfo)
{
var msg = tipInfo.showModel.msgTip;
if(msg == '成功')
{
//加载完以后重新初始化
$("#searchBtn").click();
$(":checkbox").attr("checked",false);
}
else
$.messager.alert('启用提示','启用信息失败,请稍后再试!','error');
},
//此处添加错误处理
error:function()
{
$.messager.alert('启用提示','启用信息异常,请稍后再试!','error');
return;
}
});
}
});
}
}
//批量禁用
function setDisEnableFun() {
var row = $('#tableData').datagrid('getChecked');
if(row.length == 0)
{
$.messager.alert('禁用提示','没有记录被选中!','info');
return;
}
if(row.length > 0)
{
$.messager.confirm('禁用确认','确定要禁用选中的' + row.length + '条信息吗?',function(r)
{
if (r)
{
var ids = "";
for(var i = 0;i < row.length; i ++)
{
if(i == row.length-1)
{
ids += row[i].id;
break;
}
ids += row[i].id + ",";
}
$.ajax({
type:"post",
url: path + "/supplier/batchSetEnable.action",
dataType: "json",
async : false,
data: ({
enabled: false,
supplierIDs : ids,
clientIp: clientIp
}),
success: function (tipInfo)
{
var msg = tipInfo.showModel.msgTip;
if(msg == '成功')
{
//加载完以后重新初始化
$("#searchBtn").click();
$(":checkbox").attr("checked",false);
}
else
$.messager.alert('禁用提示','禁用信息失败,请稍后再试!','error');
},
//此处添加错误处理
error:function()
{
$.messager.alert('禁用提示','禁用信息异常,请稍后再试!','error');
return;
}
});
}
});
}
}
//导入数据
function setInputFun(){
//IE下不允许编辑 input=file的值 解决思路重新克隆input=file把这个input元素复制一个然后将原来的删除。
//在IE下复制元素的时候其中的值是不会被复制的所以就达到了清空文件域的目的了。
//而在Firefox下其中的值也会被一同复制清空一下就做到兼容
var fileUploadInput = $("#supplierFile");
fileUploadInput.after(fileUploadInput.clone().val(""));
fileUploadInput.remove();
$("#isCheck").val(1);
$('#importExcelDlg').dialog('open').dialog('setTitle','导入' + listType + '信息');
$(".window-mask").css({ width: webW-20 ,height: webH});
$("#supplierFile").focus();
}
//导出数据
function setOutputFun(){
window.location.href = path + "/supplier/exportExcel.action?browserType=" + getOs() + "&type=" + listTypeEn;
}
//增加单位
var url;
var supplierID = 0;
//保存编辑前的名称
var orgSupplier = "";
function addSuppler() {
$('#supplierDlg').dialog('open').dialog('setTitle','<img src="' + path + '/js/easyui-1.3.5/themes/icons/edit_add.png"/>&nbsp;增加'+listType+"信息");
$(".window-mask").css({ width: webW ,height: webH});
$("#supplier").focus();
$('#supplierFM').form('clear');
orgSupplier = "";
supplierID = 0;
url = path + '/supplier/create.action';
}
function bindEvent(){
//导入excel对话框
$('#importExcelDlg').dialog({
width: 400,
closed: true,
cache: false,
modal: true,
collapsible:false,
closable: true,
buttons:'#dlg-buttons5'
});
//导入excel表格
$("#saveimport").unbind().bind({
click:function()
{
if($("#supplierFile").val().length == 0)
{
$.messager.alert('提示','请选择文件!','info');
return;
}
$("#importExcelFM").submit();
$('#importExcelDlg').dialog('close');
$.messager.progress({
title:'请稍候',
msg:'数据处理ing...'
});
setTimeout(function(){
$.messager.progress('close');
var opts = $("#tableData").datagrid('options');
showSupplierDetails(opts.pageNumber,opts.pageSize);
},3300);
}
});
//保存信息
$("#saveSupplier").off("click").on("click",function() {
if(!$('#supplierFM').form('validate')){
return;
}
else if(checkSupplierName()){
return;
}
var reg = /^([0-9])+$/;
var phonenum = $.trim($("#phonenum").val());
if(phonenum.length>0 && !reg.test(phonenum)) {
$.messager.alert('提示','电话号码只能是数字','info');
$("#phonenum").val("").focus();
return;
}
var beginNeedGet = $.trim($("#BeginNeedGet").val());
var beginNeedPay = $.trim($("#BeginNeedPay").val());
if(beginNeedGet && beginNeedPay) {
$.messager.alert('提示','期初应收和期初应付不能同时输入','info');
return;
}
$.ajax({
url: url,
type:"post",
dataType: "json",
data:{
supplier:$("#supplier").val(),
type: listType,
contacts:$("#contacts").val(),
phonenum:$("#phonenum").val(),
telephone:$("#telephone").val(),
email:$("#email").val(),
address:$("#address").val(),
fax:$("#fax").val(),
BeginNeedGet:$("#BeginNeedGet").val(),
BeginNeedPay:$("#BeginNeedPay").val(),
taxNum:$("#taxNum").val(),
taxRate:$("#taxRate").val(),
bankName:$("#bankName").val(),
accountNumber:$("#accountNumber").val(),
description:$("#description").val(),
enabled:1,
clientIp: clientIp
},
success: function(res) {
if (res) {
$('#supplierDlg').dialog('close');
var opts = $("#tableData").datagrid('options');
showSupplierDetails(opts.pageNumber,opts.pageSize);
}
}
});
});
//初始化键盘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键盘事件
if(k == "13"&&(obj.id=="supplier" || obj.id=="contacts"|| obj.id=="phonenum"
|| obj.id=="email" || obj.id=="description" ))
{
$("#saveSupplier").click();
}
//搜索按钮添加快捷键
if(k == "13"&&(obj.id=="searchSupplier" || obj.id=="searchContacts"|| obj.id=="searchPhonenum"
|| obj.id=="searchEmail" || obj.id=="searchDesc" ))
{
$("#searchBtn").click();
}
});
//搜索处理
$("#searchBtn").unbind().bind({
click:function()
{
showSupplierDetails(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").click();
//重置按钮
$("#searchResetBtn").unbind().bind({
click:function(){
$("#searchSupplier").val("");
$("#searchType").val("");
$("#searchPhonenum").val("");
$("#searchTelephone").val("");
$("#searchDesc").val("");
//加载完以后重新初始化
$("#searchBtn").click();
}
});
}
//编辑信息
function editSupplier(supplierTotalInfo) {
var supplierInfo = supplierTotalInfo.split("AaBb");
var row = {
supplier : supplierInfo[1],
contacts : supplierInfo[2].replace("undefined",""),
phonenum : supplierInfo[3].replace("undefined",""),
email : supplierInfo[4].replace("undefined",""),
BeginNeedGet : supplierInfo[5],
BeginNeedPay : supplierInfo[6],
description : supplierInfo[8].replace("undefined",""),
type : supplierInfo[9],
fax : supplierInfo[10].replace("undefined",""),
telephone : supplierInfo[11].replace("undefined",""),
address : supplierInfo[12].replace("undefined",""),
taxNum : supplierInfo[13].replace("undefined",""),
bankName : supplierInfo[14].replace("undefined",""),
accountNumber : supplierInfo[15].replace("undefined",""),
taxRate : supplierInfo[16].replace("undefined",""),
clientIp: clientIp
};
orgSupplier = supplierInfo[1];
$('#supplierDlg').dialog('open').dialog('setTitle','<img src="' + path + '/js/easyui-1.3.5/themes/icons/pencil.png"/>&nbsp;编辑'+listType +"信息");
$(".window-mask").css({ width: webW ,height: webH});
$('#supplierFM').form('load',row);
supplierID = supplierInfo[0];
//焦点在名称输入框==定焦在输入文字后面
$("#supplier").val("").focus().val(supplierInfo[1]);
url = path + '/supplier/update.action?supplierID=' + supplierInfo[0];
//显示累计应收和累计应付
$.ajax({
type:"post",
url: path + "/depotHead/findTotalPay.action",
dataType: "json",
async: false,
data: ({
supplierId: supplierInfo[0]
}),
success: function(res){
if(res) {
var moneyA = res.getAllMoney.toFixed(2)-0;
$.ajax({
type:"post",
url: path +"/accountHead/findTotalPay.action",
dataType: "json",
async: false,
data: ({
supplierId: supplierInfo[0]
}),
success: function(res){
if(res) {
var moneyB = res.getAllMoney.toFixed(2)-0;
var money = moneyA+moneyB;
var moneyBeginNeedGet = $("#BeginNeedGet").val()-0; //期初应收
var moneyBeginNeedPay = $("#BeginNeedPay").val()-0; //期初应付
money = money + moneyBeginNeedPay - moneyBeginNeedGet;
if(money>0) {
$("#AllNeedPay").val(money); //累计应付
}
else {
$("#AllNeedGet").val(-money); //累计应收
}
}
},
error: function(){
$.messager.alert('提示','网络异常请稍后再试!','error');
return;
}
});
}
},
error: function(){
$.messager.alert('提示','网络异常请稍后再试!','error');
return;
}
})
}
//检查单位名称是否存在 ++ 重名无法提示问题需要跟进
function checkSupplierName() {
var supplierName = $.trim($("#supplier").val());
//表示是否存在 true == 存在 false = 不存在
var flag = false;
//开始ajax名称检验不能重名
if(supplierName.length > 0 &&( orgSupplier.length ==0 || supplierName != orgSupplier))
{
$.ajax({
type:"post",
url: path + "/supplier/checkIsNameExist.action",
dataType: "json",
async : false,
data: ({
supplierID : supplierID,
supplier : supplierName
}),
success: function (tipInfo)
{
flag = tipInfo;
if(tipInfo)
{
$.messager.alert('提示','单位名称已经存在','info');
return;
}
},
//此处添加错误处理
error:function()
{
$.messager.alert('提示','检查单位名称是否存在异常,请稍后再试!','error');
return;
}
});
}
return flag;
}
function showSupplierDetails(pageNo,pageSize) {
$.ajax({
type:"post",
url: path + "/supplier/findBy.action",
dataType: "json",
data: ({
supplier:$.trim($("#searchSupplier").val()),
type: listType,
phonenum:$.trim($("#searchPhonenum").val()),
telephone:$.trim($("#searchTelephone").val()),
description:$.trim($("#searchDesc").val()),
pageNo:pageNo,
pageSize:pageSize
}),
success: function (data)
{
$("#tableData").datagrid('loadData',data);
//$('#tableData').datagrid('reload');
},
//此处添加错误处理
error:function()
{
$.messager.alert('查询提示','查询数据后台异常,请稍后再试!','error');
return;
}
});
}

File diff suppressed because it is too large Load Diff