优化销售出库单据,改为选择关联单据的方式

This commit is contained in:
季圣华
2020-10-23 00:03:29 +08:00
parent cc7df2b44d
commit 4ac640c59a
8 changed files with 258 additions and 17 deletions

View File

@@ -7,12 +7,18 @@
#bill .retail_back{ #bill .retail_back{
display: none; display: none;
} }
#bill .purchase_orders{
display: none;
}
#bill .purchase_in{ #bill .purchase_in{
display: none; display: none;
} }
#bill .purchase_back{ #bill .purchase_back{
display: none; display: none;
} }
#bill .sale_orders{
display: none;
}
#bill .sale_out{ #bill .sale_out{
display: none; display: none;
} }

View File

@@ -55,3 +55,9 @@
text-decoration:underline; text-decoration:underline;
cursor:pointer; cursor:pointer;
} }
#depotHeadDlgShow .n-link{
color:blue;
text-decoration:underline;
cursor:pointer;
}

View File

@@ -95,7 +95,12 @@
if(listSubType) { if(listSubType) {
listSubType = decodeURI(listSubType); listSubType = decodeURI(listSubType);
} }
if(listSubType == "采购入库") { if(listSubType == "采购订单") {
billType = "material";
$("#bill .purchase_orders").show();
tableString = $(".purchase_orders").html();
}
else if(listSubType == "采购入库") {
billType = "material"; billType = "material";
$("#bill .purchase_in").show(); $("#bill .purchase_in").show();
tableString = $(".purchase_in").html(); tableString = $(".purchase_in").html();
@@ -105,6 +110,11 @@
$("#bill .purchase_back").show(); $("#bill .purchase_back").show();
tableString = $(".purchase_back").html(); tableString = $(".purchase_back").html();
} }
else if(listSubType == "销售订单") {
billType = "material";
$("#bill .sale_orders").show();
tableString = $(".sale_orders").html();
}
else if(listSubType == "销售出库") { else if(listSubType == "销售出库") {
billType = "material"; billType = "material";
$("#bill .sale_out").show(); $("#bill .sale_out").show();
@@ -361,12 +371,18 @@
//打印table //打印table
$("#print_bill_detail").off("click").on("click",function(){ $("#print_bill_detail").off("click").on("click",function(){
var tableString = "";//打印table var tableString = "";//打印table
if(listSubType == "采购入库") { if(listSubType == "采购订单") {
tableString = $(".purchase_orders").html();
}
else if(listSubType == "采购入库") {
tableString = $(".purchase_in").html(); tableString = $(".purchase_in").html();
} }
else if(listSubType == "采购退货出库") { else if(listSubType == "采购退货出库") {
tableString = $(".purchase_back").html(); tableString = $(".purchase_back").html();
} }
else if(listSubType == "销售订单") {
tableString = $(".sale_orders").html();
}
else if(listSubType == "销售出库") { else if(listSubType == "销售出库") {
tableString = $(".sale_out").html(); tableString = $(".sale_out").html();
} }
@@ -426,7 +442,8 @@
depotHeadName = "仓库名称"; depotHeadName = "仓库名称";
} }
var isShowTaxColumn = false; //是否显示税率相关的列,true为隐藏,false为显示 var isShowTaxColumn = false; //是否显示税率相关的列,true为隐藏,false为显示
if(listSubType == "调拨出库" || listSubType == "其它出库" || listSubType == "其它入" || if(listSubType == "采购订单" || listSubType == "销售订单" || listSubType == "调拨出" ||
listSubType == "其它出库" || listSubType == "其它入库" ||
listSubType == "零售出库" || listSubType == "零售退货入库" || listSubType == "盘点复盘"){ listSubType == "零售出库" || listSubType == "零售退货入库" || listSubType == "盘点复盘"){
isShowTaxColumn = true; //隐藏 isShowTaxColumn = true; //隐藏
} }

View File

@@ -159,6 +159,41 @@
</tr> </tr>
</table> </table>
</div> </div>
<!--采购订单-->
<div class="purchase_orders" style="width:1300px;padding:10px 20px;top:20px"
closed="true" modal="true" cache="false" collapsible="false" closable="true">
<table>
<tr>
<td style="width:60px;">供应商:</td>
<td style="padding:5px;width:130px;">
<span class="OrganIdShow"></span>
</td>
<td style="width:70px;">单据日期:</td>
<td style="padding:5px;width:130px;">
<span class="OperTimeShow"></span>
</td>
<td style="width:80px;">单据编号:</td>
<td style="padding:5px;width:140px;">
<span class="NumberShow"></span>
</td>
<td style="width:70px;"></td>
<td style="padding:5px;width:130px;"></td>
<td style="width:100px;"></td>
</tr>
<tr>
<td colspan="9" style="width: 1300px;">
<!-- 商品列表table -->
<table class="materialDataShow" style="top:100px;border-bottom-color:#FFFFFF"></table>
</td>
</tr>
<tr>
<td style="width:60px;">单据备注:</td>
<td colspan="8" style="height:35px;">
<span class="RemarkShow" style="width: 1070px; height:35px;"></span>
</td>
</tr>
</table>
</div>
<!--采购入库--> <!--采购入库-->
<div class="purchase_in" style="width:1300px;padding:10px 20px;top:20px" <div class="purchase_in" style="width:1300px;padding:10px 20px;top:20px"
closed="true" modal="true" cache="false" collapsible="false" closable="true"> closed="true" modal="true" cache="false" collapsible="false" closable="true">
@@ -306,6 +341,43 @@
</tr> </tr>
</table> </table>
</div> </div>
<!--销售订单-->
<div class="sale_orders" style="width:1300px;padding:10px 20px;top:20px"
closed="true" modal="true" cache="false" collapsible="false" closable="true">
<table>
<tr>
<td style="width:60px;">客户:</td>
<td style="padding:5px;width:130px;">
<span class="OrganIdShow"></span>
</td>
<td style="width:70px;">单据日期:</td>
<td style="padding:5px;width:140px;">
<span class="OperTimeShow"></span>
</td>
<td style="width:80px;">单据编号:</td>
<td style="padding:5px;width:140px;">
<span class="NumberShow"></span>
</td>
<td style="width:70px;">销售人员:</td>
<td style="padding:5px;width:130px;">
<span class="SalesmanShow"></span>
</td>
<td style="width:100px;"></td>
</tr>
<tr>
<td colspan="9" style="width: 1300px;">
<!-- 商品列表table -->
<table class="materialDataShow" style="top:100px;border-bottom-color:#FFFFFF"></table>
</td>
</tr>
<tr>
<td style="width:60px;">单据备注:</td>
<td colspan="8" style="height:35px;">
<span class="RemarkShow" style="width: 1070px; height:35px;"></span>
</td>
</tr>
</table>
</div>
<!--销售出库--> <!--销售出库-->
<div class="sale_out" style="width:1300px;padding:10px 20px;top:20px" <div class="sale_out" style="width:1300px;padding:10px 20px;top:20px"
closed="true" modal="true" cache="false" collapsible="false" closable="true"> closed="true" modal="true" cache="false" collapsible="false" closable="true">

View File

@@ -381,7 +381,7 @@
}, },
{ title: '供应商名称', field: 'organName',width:120}, { title: '供应商名称', field: 'organName',width:120},
{ title: '单据编号',field: 'number',width:155, formatter:function (value,rec) { { title: '单据编号',field: 'number',width:155, formatter:function (value,rec) {
if(rec.linknumber) { if(rec.linkNumber) {
return value + "[]"; return value + "[]";
} else { } else {
return value; return value;
@@ -459,12 +459,13 @@
onClickButton:function(){ onClickButton:function(){
$('#linkBillDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui/themes/icons/edit_add.png"/>&nbsp;选择关联单据'); $('#linkBillDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui/themes/icons/edit_add.png"/>&nbsp;选择关联单据');
$("#linkBillDlg").panel("move",{top:$(document).scrollTop() + ($(window).height()-400) * 0.5}); $("#linkBillDlg").panel("move",{top:$(document).scrollTop() + ($(window).height()-400) * 0.5});
initLinkBillTableData(); initLinkBillTableData(1,initPageSize);
initLinkBillPager();
} }
}); });
url = '/depotHead/addDepotHeadAndDetail'; url = '/depotHead/addDepotHeadAndDetail';
} }
function initLinkBillTableData() { function initLinkBillTableData(pageNo,pageSize) {
$('#linkBillData').datagrid({ $('#linkBillData').datagrid({
height:300, height:300,
rownumbers: false, rownumbers: false,
@@ -476,7 +477,7 @@
pagination: true, pagination: true,
//交替出现背景 //交替出现背景
striped : true, striped : true,
pageSize: 10, pageSize: 2,
pageList: initPageNum, pageList: initPageNum,
columns:[[ columns:[[
{ field: 'id',width:35,align:"center",checkbox:true}, { field: 'id',width:35,align:"center",checkbox:true},
@@ -513,8 +514,8 @@
materialParam: "", materialParam: "",
depotIds: depotString depotIds: depotString
}), }),
currentPage: 1, currentPage: pageNo,
pageSize: initPageSize pageSize: pageSize
}), }),
success: function (res) { success: function (res) {
if(res && res.code === 200){ if(res && res.code === 200){
@@ -540,6 +541,26 @@
} }
}); });
} }
function initLinkBillPager() {
try {
var opts = $("#linkBillData").datagrid('options');
var pager = $("#linkBillData").datagrid('getPager');
pager.pagination({
onSelectPage:function(pageNum, pageSize) {
opts.pageNumber = pageNum;
opts.pageSize = pageSize;
pager.pagination('refresh', {
pageNumber:pageNum,
pageSize:pageSize
});
initLinkBillTableData(pageNum,pageSize);
}
});
}
catch (e) {
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
}
}
//编辑信息 //编辑信息
function editDepotHead(index) { function editDepotHead(index) {
var res = $("#tableData").datagrid("getRows")[index]; var res = $("#tableData").datagrid("getRows")[index];
@@ -634,7 +655,10 @@
} }
$("#DebtShow").text(debt); $("#DebtShow").text(debt);
$("#AccountDayShow").text(res.accountDay); //结算天数 $("#AccountDayShow").text(res.accountDay); //结算天数
$("#LinkNumberShow").text(res.linkNumber); //关联订单号 //关联订单号
$("#LinkNumberShow").text(res.linkNumber).addClass("n-link").off("click").on("click",function () {
turnBillDetailPage(res.linkNumber, "采购订单");
});
var otherMoney = res.otherMoney?res.otherMoney:0; var otherMoney = res.otherMoney?res.otherMoney:0;
if(otherMoney!=0 && res.otherMoneyList && res.otherMoneyItem){ if(otherMoney!=0 && res.otherMoneyList && res.otherMoneyItem){
var itemArr = res.otherMoneyList.split(","); //支出项目id列表 var itemArr = res.otherMoneyList.split(","); //支出项目id列表

View File

@@ -305,7 +305,7 @@
}, },
{ title: '供应商名称', field: 'organName',width:120}, { title: '供应商名称', field: 'organName',width:120},
{ title: '单据编号',field: 'number',width:155, formatter:function (value,rec) { { title: '单据编号',field: 'number',width:155, formatter:function (value,rec) {
if(rec.linknumber) { if(rec.linkNumber) {
return value + "[]"; return value + "[]";
} else { } else {
return value; return value;

View File

@@ -293,7 +293,7 @@
pageList: initPageNum, pageList: initPageNum,
columns:[[ columns:[[
{ field: 'id',width:35,align:"center",checkbox:true}, { field: 'id',width:35,align:"center",checkbox:true},
{ title: '操作',field: 'op',align:"center", width:120, { title: '操作',field: 'op',align:"center", width:90,
formatter:function(value,rec,index) { formatter:function(value,rec,index) {
var str = ''; var str = '';
var orgId = rec.organId? rec.organId:0; var orgId = rec.organId? rec.organId:0;
@@ -302,13 +302,12 @@
str += '<img title="编辑" src="/js/easyui/themes/icons/pencil.png" style="cursor: pointer;" onclick="editDepotHead(\'' + index + '\');"/>&nbsp;&nbsp;&nbsp;'; str += '<img title="编辑" src="/js/easyui/themes/icons/pencil.png" style="cursor: pointer;" onclick="editDepotHead(\'' + index + '\');"/>&nbsp;&nbsp;&nbsp;';
str += '<img title="删除" src="/js/easyui/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="inOutService.deleteDepotHead('+ rec.id +',' + orgId +',' + rec.totalPrice+',' + rec.status + ');"/>'; str += '<img title="删除" src="/js/easyui/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="inOutService.deleteDepotHead('+ rec.id +',' + orgId +',' + rec.totalPrice+',' + rec.status + ');"/>';
} }
str += '&nbsp;&nbsp;&nbsp;<img title="转销售出库" src="/js/easyui/themes/icons/redo.png" style="cursor: pointer;" onclick="skipDepotHead(\'' + index + '\');"/>';
return str; return str;
} }
}, },
{ title: '客户名称', field: 'organName',width:120}, { title: '客户名称', field: 'organName',width:120},
{ title: '单据编号',field: 'number',width:155, formatter:function (value,rec) { { title: '单据编号',field: 'number',width:155, formatter:function (value,rec) {
if(rec.linknumber) { if(rec.linkNumber) {
return value + "[]"; return value + "[]";
} else { } else {
return value; return value;

View File

@@ -82,7 +82,7 @@
</td> </td>
<td style="width:70px;">关联订单</td> <td style="width:70px;">关联订单</td>
<td style="padding:5px"> <td style="padding:5px">
<input name="LinkNumber" id="LinkNumber" class="easyui-validatebox radius-ui" style="width: 150px;" readonly/> <input name="LinkNumber" id="LinkNumber" class="easyui-textbox" data-options="buttonText:'选择',editable:false" style="width: 185px;"/>
</td> </td>
<td style="width:100px;"></td> <td style="width:100px;"></td>
</tr> </tr>
@@ -288,6 +288,15 @@
<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="linkBillDlg" class="easyui-dialog" style="width:880px;padding:10px 20px;"
closed="true" modal="true" buttons="#linkBillDlgBtn" cache="false" collapsible="false" closable="true">
<table id="linkBillData" style="top:100px;border-bottom-color:#FFFFFF"></table>
</div>
<div id="linkBillDlgBtn">
<a href="javascript:void(0)" id="saveLinkBill" class="easyui-linkbutton" iconCls="icon-ok">选择</a>
<a href="javascript:void(0)" id="cancelLinkBill" class="easyui-linkbutton" iconCls="icon-cancel"
onclick="javascript:$('#linkBillDlg').dialog('close')">取消</a>
</div>
<div id="supplier"></div> <div id="supplier"></div>
<div id="depot"></div> <div id="depot"></div>
<div id="account"></div> <div id="account"></div>
@@ -374,7 +383,7 @@
}, },
{ title: '客户名称', field: 'organName',width:120}, { title: '客户名称', field: 'organName',width:120},
{ title: '单据编号',field: 'number',width:155, formatter:function (value,rec) { { title: '单据编号',field: 'number',width:155, formatter:function (value,rec) {
if(rec.linknumber) { if(rec.linkNumber) {
return value + "[]"; return value + "[]";
} else { } else {
return value; return value;
@@ -457,8 +466,113 @@
$('#accountFM').form('clear'); $('#accountFM').form('clear');
bindAccountEvent(); bindAccountEvent();
}); });
//关联订单的选择事件
$('#LinkNumber').textbox({
onClickButton:function(){
$('#linkBillDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui/themes/icons/edit_add.png"/>&nbsp;选择关联单据');
$("#linkBillDlg").panel("move",{top:$(document).scrollTop() + ($(window).height()-400) * 0.5});
initLinkBillTableData(1,initPageSize);
initLinkBillPager();
}
});
url = '/depotHead/addDepotHeadAndDetail'; url = '/depotHead/addDepotHeadAndDetail';
} }
function initLinkBillTableData(pageNo,pageSize) {
$('#linkBillData').datagrid({
height:300,
rownumbers: false,
//动画效果
animate:false,
//选中单行
singleSelect: true,
collapsible: false,
pagination: true,
//交替出现背景
striped : true,
pageSize: 10,
pageList: initPageNum,
columns:[[
{ field: 'id',width:35,align:"center",checkbox:true},
{ title: '供应商名称', field: 'organName',width:120},
{ title: '单据编号',field: 'number',width:155},
{ title: '商品信息',field: 'materialsList',width:200,formatter:function(value){
if(value) {
return value.replace(",","");
}
}
},
{ title: '单据日期',field: 'operTimeStr',width:145},
{ title: '操作员',field: 'userName',width:60},
{ title: '金额合计',field: 'totalPrice',width:70}
]],
onLoadError:function() {
$.messager.alert('页面加载提示','页面加载异常,请稍后再试!','error');
return;
}
});
$.ajax({
type: "get",
url: "/depotHead/list",
dataType: "json",
data: ({
search: JSON.stringify({
type: "其它",
subType: "销售订单",
roleType: roleType,
status: "1",
number: "",
beginTime: "",
endTime: "",
materialParam: "",
depotIds: depotString
}),
currentPage: 1,
pageSize: initPageSize
}),
success: function (res) {
if(res && res.code === 200){
if(res.data && res.data.page) {
$("#linkBillData").datagrid('loadData', res.data.page);
$("#saveLinkBill").off("click").on("click", function(){
var res = $('#linkBillData').datagrid('getChecked')[0];
$('#OrganId').combobox('setValue', res.organId);
$("#LinkNumber").textbox("setValue",res.number); //关联订单号
$("#DiscountLastMoney").val(res.totalPrice); //优惠后金额
$("#ChangeAmount").val(res.totalPrice).attr("data-changeamount", res.totalPrice);
depotHeadID = res.id;
initTableData_material("edit",res.totalPrice); //商品列表
$('#linkBillDlg').dialog('close');
});
}
}
},
//此处添加错误处理
error: function () {
$.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
return;
}
});
}
function initLinkBillPager() {
try {
var opts = $("#linkBillData").datagrid('options');
var pager = $("#linkBillData").datagrid('getPager');
pager.pagination({
onSelectPage:function(pageNum, pageSize) {
opts.pageNumber = pageNum;
opts.pageSize = pageSize;
pager.pagination('refresh', {
pageNumber:pageNum,
pageSize:pageSize
});
initLinkBillTableData(pageNum,pageSize);
}
});
}
catch (e) {
$.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error');
}
}
//编辑信息 //编辑信息
function editDepotHead(index) { function editDepotHead(index) {
var res = $("#tableData").datagrid("getRows")[index]; var res = $("#tableData").datagrid("getRows")[index];
@@ -579,7 +693,10 @@
} }
$("#DebtShow").text(debt); $("#DebtShow").text(debt);
$("#AccountDayShow").text(res.accountDay); //结算天数 $("#AccountDayShow").text(res.accountDay); //结算天数
$("#LinkNumberShow").text(res.linkNumber); //关联订单号 //关联订单号
$("#LinkNumberShow").text(res.linkNumber).addClass("n-link").off("click").on("click",function () {
turnBillDetailPage(res.linkNumber, "销售订单");
});
var otherMoney = res.otherMoney?res.otherMoney:0; var otherMoney = res.otherMoney?res.otherMoney:0;
if(otherMoney!=0 && res.otherMoneyList && res.otherMoneyItem){ if(otherMoney!=0 && res.otherMoneyList && res.otherMoneyItem){
var itemArr = res.otherMoneyList.split(","); //支出项目id列表 var itemArr = res.otherMoneyList.split(","); //支出项目id列表