优化表结构

This commit is contained in:
季圣华
2020-07-21 23:09:20 +08:00
parent 70f0dae473
commit a4774016c8
53 changed files with 5771 additions and 7185 deletions

View File

@@ -234,19 +234,19 @@
{ title: '操作',field: 'op',align:"center",width:90,
formatter:function(value,rec,index) {
var str = '';
var orgId = rec.organid ? rec.organid : 0;
var orgId = rec.organId ? rec.organId : 0;
str += '<img title="查看" src="/js/easyui/themes/icons/list.png" style="cursor: pointer;" onclick="showAccountHead(\'' + index + '\');"/>&nbsp;&nbsp;&nbsp;';
str += '<img title="编辑" src="/js/easyui/themes/icons/pencil.png" style="cursor: pointer;" onclick="editAccountHead(\'' + index + '\');"/>&nbsp;&nbsp;&nbsp;';
str += '<img title="删除" src="/js/easyui/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteAccountHead('+ rec.id +',' + orgId +',' + rec.totalprice + ');"/>';
return str;
}
},
{ field: 'organid',width:5, hidden:true},
{ title: organNameTitle,field: 'organname',width:140,hidden:organNameHidden},
{ title: '单据编号',field: 'billno',width:160},
{ title: '经手人',field: 'handspersonname',width:80},
{ field: 'organId',width:5, hidden:true},
{ title: organNameTitle,field: 'organName',width:140,hidden:organNameHidden},
{ title: '单据编号',field: 'billNo',width:160},
{ title: '经手人',field: 'handsPersonName',width:80},
{ title: '单据时间 ',field: 'billTimeStr',width:160},
{ title: '合计',field: 'totalprice',width:80},
{ title: '合计',field: 'totalPrice',width:80},
{ title: '备注',field: 'remark',width:100}
]],
toolbar:[
@@ -699,15 +699,15 @@
//编辑信息
function editAccountHead(index){
var res = $("#tableData").datagrid("getRows")[index];
$("#BillNo").val(res.billno);
$("#BillTime").val(res.billtime);
$("#BillNo").val(res.billNo);
$("#BillTime").val(res.billTime);
$("#Remark").val(res.remark);
$("#AccountId").val(res.accountid);
$('#OrganId').combobox('setValue', res.organid);
$("#HandsPersonId").val(res.handspersonid);
$("#ChangeAmount").val(res.changeamount);
var TotalPrice = res.totalprice;
preTotalPrice = res.totalprice; //记录前一次合计金额,用于收预付款
$("#AccountId").val(res.accountId);
$('#OrganId').combobox('setValue', res.organId);
$("#HandsPersonId").val(res.handsPersonId);
$("#ChangeAmount").val(res.changeAmount);
var TotalPrice = res.totalPrice;
preTotalPrice = res.totalPrice; //记录前一次合计金额,用于收预付款
var editTitle = listTitle.replace("列表","信息");
$('#accountHeadDlg').dialog('open').dialog('setTitle','<img src="' + '/js/easyui/themes/icons/pencil.png"/>&nbsp;编辑' + editTitle);
$(".window-mask").css({ width: webW ,height: webH});
@@ -721,14 +721,14 @@
//查看信息
function showAccountHead(index){
var res = $("#tableData").datagrid("getRows")[index];
$("#BillNoShow").text(res.billno);
$("#BillTimeShow").text(res.billtime);
$("#BillNoShow").text(res.billNo);
$("#BillTimeShow").text(res.billTime);
$("#RemarkShow").text(res.remark);
$("#AccountIdShow").text(res.accountname);
$('#OrganIdShow').text(res.organname);
$("#HandsPersonIdShow").text(res.handspersonname);
$("#ChangeAmountShow").text(res.changeamount);
var TotalPrice = res.totalprice;
$("#AccountIdShow").text(res.accountName);
$('#OrganIdShow').text(res.organName);
$("#HandsPersonIdShow").text(res.handsPersonName);
$("#ChangeAmountShow").text(res.changeAmount);
var TotalPrice = res.totalPrice;
var showTitle = listTitle.replace("列表","信息");
$('#accountHeadDlgShow').dialog('open').dialog('setTitle','<img src="/js/easyui/themes/icons/list.png"/>&nbsp;查看' + showTitle);
$(".window-mask").css({ width: webW ,height: webH});
@@ -881,7 +881,7 @@
});
}
//保存单位信息
//保存信息
$.ajax({
type: "post",
url: url,

View File

@@ -69,14 +69,14 @@
{ 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: '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: 'allneedget',width:70,align:"center"},
{ title: '期末应付',field: 'allneedpay',width:70,align:"center"},
{ title: '税率(%)', field: 'taxrate',width:60,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: 'allNeedGet',width:70,align:"center"},
{ title: '期末应付',field: 'allNeedPay',width:70,align:"center"},
{ title: '税率(%)', field: 'taxRate',width:60,align:"center"},
{ title: '状态',field: 'enabled',width:70,align:"center",formatter:function(value){
return value? "<span style='color:green'>启用</span>":"<span style='color:red'>禁用</span>";
}}
@@ -558,12 +558,12 @@
function editSupplier(index) {
var res = $("#tableData").datagrid("getRows")[index];
var sId = res.id;
var beginNeedGet = res.beginneedget;
var beginNeedPay = res.beginneedpay;
var beginNeedGet = res.beginNeedGet;
var beginNeedPay = res.beginNeedPay;
var row = {
supplier : res.supplier,
contacts : res.contacts,
phonenum : res.phonenum,
phonenum : res.phoneNum,
email : res.email,
BeginNeedGet : beginNeedGet == "0"? "":beginNeedGet,
BeginNeedPay : beginNeedPay == "0"? "":beginNeedPay,
@@ -574,10 +574,10 @@
fax : res.fax,
telephone : res.telephone,
address : res.address,
taxNum : res.taxnum,
bankName : res.bankname,
accountNumber : res.accountnumber,
taxRate : res.taxrate
taxNum : res.taxNum,
bankName : res.bankName,
accountNumber : res.accountNumber,
taxRate : res.taxRate
};
oldSupplier = res.supplier;
$('#supplierDlg').dialog('open').dialog('setTitle','<img src="/js/easyui/themes/icons/pencil.png"/>&nbsp;编辑'+listType +"信息");

View File

@@ -219,9 +219,9 @@
if(data.accountName){
$("#bill .AccountIdShow").text(data.accountName); //结算账户
}
else if(data.accountidlist && data.accountmoneylist) {
var accountArr = data.accountidlist.split(","); //账户id列表
var accountMoneyArr = data.accountmoneylist.split(","); //账户金额列表
else if(data.accountIdList && data.accountMoneyList) {
var accountArr = data.accountIdList.split(","); //账户id列表
var accountMoneyArr = data.accountMoneyList.split(","); //账户金额列表
var accountIdShow = "";
for (var j = 0; j < accountArr.length; j++) {
if (accountList != null) {
@@ -241,22 +241,22 @@
$("#bill .AccountIdShow").text(accountIdShow);
}
$("#bill .OrganIdShow").text(data.organName);
$("#bill .OperTimeShow").text(data.opertimeStr);
$("#bill .OperTimeShow").text(data.operTimeStr);
$("#bill .NumberShow").text(data.number);
$("#bill .LinkNumberShow").text(data.linknumber? data.linknumber : "");
$("#bill .LinkNumberShow").text(data.linkNumber? data.linkNumber : "");
$("#bill .RemarkShow").text(data.remark);
$("#bill .DiscountShow").text(data.discount);
$("#bill .DiscountMoneyShow").text(data.discountmoney);
$("#bill .DiscountLastMoneyShow").text(data.discountlastmoney);
$("#bill .ChangeAmountShow").text(data.changeamount==null ? "":data.changeamount);
$("#bill .DebtShow").text((data.discountlastmoney+data.othermoney-data.changeamount).toFixed(2));
$("#bill .OtherMoneyShow").text(data.othermoney==null ? "": data.othermoney);
$("#bill .AccountDayShow").text(data.accountday==null ? "": data.accountday); //结算天数
if(data.othermoney && data.othermoneylist && data.othermoneyitem) {
var itemArr = data.othermoneylist.split(","); //支出项目id列表
$("#bill .DiscountMoneyShow").text(data.discountMoney);
$("#bill .DiscountLastMoneyShow").text(data.discountLastMoney);
$("#bill .ChangeAmountShow").text(data.changeAmount==null ? "":data.changeAmount);
$("#bill .DebtShow").text((data.discountLastMoney+data.otherMoney-data.changeAmount).toFixed(2));
$("#bill .OtherMoneyShow").text(data.otherMoney==null ? "": data.otherMoney);
$("#bill .AccountDayShow").text(data.accountDay==null ? "": data.accountDay); //结算天数
if(data.otherMoney && data.otherMoneyList && data.otherMoneyItem) {
var itemArr = data.otherMoneyList.split(","); //支出项目id列表
var itemMoneyArr = null;
if (data.othermoneyitem != null) {
itemMoneyArr = eval("([" + data.othermoneyitem + "])"); //支出项目金额列表
if (data.otherMoneyItem != null) {
itemMoneyArr = eval("([" + data.otherMoneyItem + "])"); //支出项目金额列表
}
var otherMoneyShow = "";
for(var j =0;j<itemArr.length; j++) {
@@ -277,16 +277,16 @@
}
}
}
$("#bill .OtherMoneyShow:visible").text(otherMoneyShow +"总计:"+ data.othermoney + ""); //其它费用
$("#bill .OtherMoneyShow:visible").text(otherMoneyShow +"总计:"+ data.otherMoney + ""); //其它费用
}
$("#bill .payTypeShow").text(data.payType);
var TotalPrice = data.totalprice;
var TotalPrice = data.totalPrice;
depotHeadID = data.id;
initTableData_material_show(TotalPrice,listSubType); //商品列表-查看状态
//零售单据展示数据
if(listSubType == "零售出库" || listSubType == "零售退货入库"){
$("#bill .change-amount-show").text(data.changeamount);
$("#bill .change-amount-show").text(data.changeAmount);
var changeAccount = $("#bill .change-amount-show:visible").text() - 0;
if(manyAccountMoney!==0){
$("#bill .get-amount-show").text((manyAccountMoney).toFixed(2));
@@ -298,7 +298,7 @@
}
}
if(listSubType === "销售出库" || listSubType === "销售退货"){
var salesManInfo = data.salesman;
var salesManInfo = data.salesMan;
if(salesManInfo){
var arr = salesManInfo.split(",");
var salesmanStr = "";
@@ -344,14 +344,14 @@
success: function (res) {
if(res && res.code === 200){
var data = res.data;
$("#bill .BillNoShow").text(data.billno);
$("#bill .BillTimeShow").text(data.billtime);
$("#bill .BillNoShow").text(data.billNo);
$("#bill .BillTimeShow").text(data.billTime);
$("#bill .RemarkShow").text(data.remark);
$("#bill .AccountIdShow").text(data.accountname);
$('#bill .OrganIdShow').text(data.organname);
$("#bill .HandsPersonIdShow").text(data.handspersonname);
$("#bill .ChangeAmountShow").text(data.changeamount==null ? "":data.changeamount);
var totalprice = data.totalprice;
$("#bill .AccountIdShow").text(data.accountName);
$('#bill .OrganIdShow').text(data.organName);
$("#bill .HandsPersonIdShow").text(data.handsPersonName);
$("#bill .ChangeAmountShow").text(data.changeAmount==null ? "":data.changeAmount);
var totalprice = data.totalPrice;
var accountHeadID = data.id;
initTableData_account_show(totalprice, accountHeadID); //明细列表-查看状态
}

View File

@@ -459,15 +459,15 @@
}
}
},
{ title: '单据日期',field: 'opertimeStr',width:145},
{ title: '操作员',field: 'operpersonname',width:60},
{ title: '金额合计',field: 'totalprice',width:70},
{ title: '含税合计',field: 'totaltaxlastmoney',hidden:isShowLastMoneyColumn,width:70,formatter:function(value,rec){
return (rec.discountmoney + rec.discountlastmoney).toFixed(2);
{ title: '单据日期',field: 'operTimeStr',width:145},
{ title: '操作员',field: 'operPersonName',width:60},
{ title: '金额合计',field: 'totalPrice',width:70},
{ title: '含税合计',field: 'totalTaxLastMoney',hidden:isShowLastMoneyColumn,width:70,formatter:function(value,rec){
return (rec.discountMoney + rec.discountLastMoney).toFixed(2);
}
},
{ title: '优惠后金额',field: 'discountlastmoney',hidden:isShowLastMoneyColumn,width:80},
{ title: payTypeTitle,field: 'changeamount',width:50,hidden:hideType},
{ title: '优惠后金额',field: 'discountLastMoney',hidden:isShowLastMoneyColumn,width:80},
{ title: payTypeTitle,field: 'changeAmount',width:50,hidden:hideType},
{ title: '状态',field: 'status',hidden:isHiddenStatus, width:70,align:"center",formatter:function(value){
if(value === "0") {
return "<span style='color:red;'>未审核</span>";
@@ -1334,7 +1334,7 @@
$.messager.alert('编辑提示', '已审核和已转的单据不能编辑', 'warning');
return;
}
var TotalPrice = res.totalprice; //合计金额
var TotalPrice = res.totalPrice; //合计金额
if(pageType === "skip") { //从订单跳转过来
buildNumber(); //生成单据编号
var thisDateTime = getNowFormatDateTime(); //当前时间
@@ -1345,21 +1345,21 @@
$("#ChangeAmount").val(TotalPrice).attr("data-changeamount", TotalPrice);
} else {
$("#Number").val(res.number).attr("data-defaultNumber",res.number);
$("#OperTime").val(res.opertimeStr);
$("#LinkNumber").val(res.linknumber); //关联订单号
$("#AccountId").val(res.accountid); //账户Id
$("#DiscountLastMoney").val(res.discountlastmoney); //优惠后金额
$("#ChangeAmount").val(res.changeamount).attr("data-changeamount", res.changeamount);
$("#OperTime").val(res.operTimeStr);
$("#LinkNumber").val(res.linkNumber); //关联订单号
$("#AccountId").val(res.accountId); //账户Id
$("#DiscountLastMoney").val(res.discountLastMoney); //优惠后金额
$("#ChangeAmount").val(res.changeAmount).attr("data-changeamount", res.changeAmount);
}
$('#OrganId').combobox('setValue', res.organid);
$("#HandsPersonId").val(res.handspersonid);
$('#OrganId').combobox('setValue', res.organId);
$("#HandsPersonId").val(res.handsPersonId);
$("#Remark").val(res.remark);
$("#Discount").val(res.discount?res.discount:0);
$("#DiscountMoney").val(res.discountmoney?res.discountmoney:0);
var discountlastmoney = res.discountlastmoney?res.discountlastmoney:0;
$("#Debt").val(discountlastmoney-res.changeamount);
$("#AccountDay").val(res.accountday); //结算天数
preTotalPrice = res.totalprice; //记录前一次合计金额,用于扣预付款
$("#DiscountMoney").val(res.discountMoney?res.discountMoney:0);
var discountlastmoney = res.discountLastMoney?res.discountLastMoney:0;
$("#Debt").val(discountlastmoney-res.changeAmount);
$("#AccountDay").val(res.accountDay); //结算天数
preTotalPrice = res.totalPrice; //记录前一次合计金额,用于扣预付款
oldNumber = res.number; //记录编辑前的单据编号
oldId = res.id; //记录单据Id
var editTitle = listTitle.replace("列表","信息");
@@ -1369,7 +1369,7 @@
if(listSubType == "零售"){
var option = "";
if(res.paytype === "预付款"){
if(res.payType === "预付款"){
option = '<option value="预付款">预付款</option>';
option += '<option value="现付">现付</option>';
}
@@ -1380,8 +1380,8 @@
}
if(listSubType === "销售" || listSubType === "销售退货" || listSubType === "销售订单"){
if(res.salesman){
var arr = res.salesman.split(",");
if(res.salesMan){
var arr = res.salesMan.split(",");
var salesmanArray = [];
for(var i=0;i<arr.length;i++){
if(arr[i]){
@@ -1393,10 +1393,10 @@
}
//采购入库、销售出库的多账户加载
if(res.accountidlist && res.accountmoneylist){
if(res.accountIdList && res.accountMoneyList){
$("#AccountId").val("many"); //下拉框选中多账户
var accountArr = res.accountidlist.split(",");
var accountMoneyArr = res.accountmoneylist.split(",");
var accountArr = res.accountIdList.split(",");
var accountMoneyArr = res.accountMoneyList.split(",");
accountMoneyArr = changeListFmtPlus(accountMoneyArr) //将数组单个金额中的数值转为正数
if(listSubType == "零售" || listSubType == "零售退货") {
@@ -1423,10 +1423,10 @@
}
//采购入库、销售出库的费用数据加载
if(res.othermoneylist && res.othermoneyitem){
$("#OtherMoney").val(res.othermoney); //其它费用
var itemArr = res.othermoneylist.split(",");
var itemMoneyArr = res.othermoneyitem.split(",");
if(res.otherMoneyList && res.otherMoneyItem){
$("#OtherMoney").val(res.otherMoney); //其它费用
var itemArr = res.otherMoneyList.split(",");
var itemMoneyArr = res.otherMoneyItem.split(",");
$("#OtherMoney").attr("data-itemArr",JSON.stringify(itemArr)).attr("data-itemMoneyArr",itemMoneyArr); //json数据存储
}
@@ -1439,15 +1439,15 @@
var res = $("#tableData").datagrid("getRows")[index];
var manyAccountMoney = 0; //多账户合计-零售
$("#NumberShow").text(res.number);
$("#OperTimeShow").text(res.opertimeStr);
$("#OperTimeShow").text(res.operTimeStr);
$('#OrganIdShow').text(res.organName);
$("#HandsPersonIdShow").text(res.handsPersonName);
if(res.accountName){
$("#AccountIdShow").text(res.accountName); //结算账户
} else {
if (res.accountidlist) {
var accountArr = res.accountidlist.split(","); //账户id列表
var accountMoneyArr = res.accountmoneylist.split(","); //账户金额列表
if (res.accountIdList) {
var accountArr = res.accountIdList.split(","); //账户id列表
var accountMoneyArr = res.accountMoneyList.split(","); //账户金额列表
var accountIdShow = "";
for (var j = 0; j < accountArr.length; j++) {
if (accountList != null) {
@@ -1467,26 +1467,26 @@
$("#AccountIdShow").text(accountIdShow);
}
}
$("#ChangeAmountShow").text(res.changeamount);
$("#ChangeAmountShow").text(res.changeAmount);
$("#RemarkShow").text(res.remark);
$("#DiscountShow").text(res.discount);
$("#DiscountMoneyShow").text(res.discountmoney);
$("#DiscountLastMoneyShow").text(res.discountlastmoney);
$("#DiscountMoneyShow").text(res.discountMoney);
$("#DiscountLastMoneyShow").text(res.discountLastMoney);
var debt = 0;
if(res.othermoney){
debt = (res.discountlastmoney+res.othermoney-res.changeamount).toFixed(2);
if(res.otherMoney){
debt = (res.discountLastMoney+res.otherMoney-res.changeAmount).toFixed(2);
} else {
debt = (res.discountlastmoney-res.changeamount).toFixed(2);
debt = (res.discountLastMoney-res.changeAmount).toFixed(2);
}
$("#DebtShow").text(debt);
$("#AccountDayShow").text(res.accountday); //结算天数
$("#LinkNumberShow").text(res.linknumber); //关联订单号
var otherMoney = res.othermoney?res.othermoney:0;
if(otherMoney!=0 && res.othermoneylist && res.othermoneyitem){
var itemArr = res.othermoneylist.split(","); //支出项目id列表
$("#AccountDayShow").text(res.accountDay); //结算天数
$("#LinkNumberShow").text(res.linkLumber); //关联订单号
var otherMoney = res.otherMoney?res.otherMoney:0;
if(otherMoney!=0 && res.otherMoneyList && res.otherMoneyItem){
var itemArr = res.otherMoneyList.split(","); //支出项目id列表
var itemMoneyArr = null;
if(res.othermoneyitem!=null) {
itemMoneyArr = eval ("(" + res.othermoneyitem + ")"); //支出项目金额列表
if(res.otherMoneyItem!=null) {
itemMoneyArr = eval ("(" + res.otherMoneyItem + ")"); //支出项目金额列表
}
var otherMoneyShow = "";
for(var j =0;j<itemArr.length; j++) {
@@ -1512,8 +1512,8 @@
else {
$("#OtherMoneyShow").text(otherMoney); //其它费用
}
$("#payTypeShow").text(res.paytype);
var TotalPrice = res.totalprice;
$("#payTypeShow").text(res.payType);
var TotalPrice = res.totalPrice;
var showTitle = listTitle.replace("列表","信息");
$('#depotHeadDlgShow').show().dialog('open').dialog('setTitle','<img src="/js/easyui/themes/icons/list.png"/>&nbsp;查看' + showTitle);
$(".window-mask").css({ width: webW ,height: webH});
@@ -1535,7 +1535,7 @@
}
if(listSubType === "销售" || listSubType === "销售退货" || listSubType === "销售订单"){
if(res.salesman){
var arr = res.salesman.split(",");
var arr = res.salesMan.split(",");
var salesmanStr = "";
for(var i=0;i<arr.length;i++){
if(arr[i]){