优化销售出库单据,改为选择关联单据的方式
This commit is contained in:
@@ -159,6 +159,41 @@
|
||||
</tr>
|
||||
</table>
|
||||
</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"
|
||||
closed="true" modal="true" cache="false" collapsible="false" closable="true">
|
||||
@@ -306,6 +341,43 @@
|
||||
</tr>
|
||||
</table>
|
||||
</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"
|
||||
closed="true" modal="true" cache="false" collapsible="false" closable="true">
|
||||
|
||||
@@ -381,7 +381,7 @@
|
||||
},
|
||||
{ title: '供应商名称', field: 'organName',width:120},
|
||||
{ title: '单据编号',field: 'number',width:155, formatter:function (value,rec) {
|
||||
if(rec.linknumber) {
|
||||
if(rec.linkNumber) {
|
||||
return value + "[转]";
|
||||
} else {
|
||||
return value;
|
||||
@@ -459,12 +459,13 @@
|
||||
onClickButton:function(){
|
||||
$('#linkBillDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui/themes/icons/edit_add.png"/> 选择关联单据');
|
||||
$("#linkBillDlg").panel("move",{top:$(document).scrollTop() + ($(window).height()-400) * 0.5});
|
||||
initLinkBillTableData();
|
||||
initLinkBillTableData(1,initPageSize);
|
||||
initLinkBillPager();
|
||||
}
|
||||
});
|
||||
url = '/depotHead/addDepotHeadAndDetail';
|
||||
}
|
||||
function initLinkBillTableData() {
|
||||
function initLinkBillTableData(pageNo,pageSize) {
|
||||
$('#linkBillData').datagrid({
|
||||
height:300,
|
||||
rownumbers: false,
|
||||
@@ -476,7 +477,7 @@
|
||||
pagination: true,
|
||||
//交替出现背景
|
||||
striped : true,
|
||||
pageSize: 10,
|
||||
pageSize: 2,
|
||||
pageList: initPageNum,
|
||||
columns:[[
|
||||
{ field: 'id',width:35,align:"center",checkbox:true},
|
||||
@@ -513,8 +514,8 @@
|
||||
materialParam: "",
|
||||
depotIds: depotString
|
||||
}),
|
||||
currentPage: 1,
|
||||
pageSize: initPageSize
|
||||
currentPage: pageNo,
|
||||
pageSize: pageSize
|
||||
}),
|
||||
success: function (res) {
|
||||
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) {
|
||||
var res = $("#tableData").datagrid("getRows")[index];
|
||||
@@ -634,7 +655,10 @@
|
||||
}
|
||||
$("#DebtShow").text(debt);
|
||||
$("#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;
|
||||
if(otherMoney!=0 && res.otherMoneyList && res.otherMoneyItem){
|
||||
var itemArr = res.otherMoneyList.split(","); //支出项目id列表
|
||||
|
||||
@@ -305,7 +305,7 @@
|
||||
},
|
||||
{ title: '供应商名称', field: 'organName',width:120},
|
||||
{ title: '单据编号',field: 'number',width:155, formatter:function (value,rec) {
|
||||
if(rec.linknumber) {
|
||||
if(rec.linkNumber) {
|
||||
return value + "[转]";
|
||||
} else {
|
||||
return value;
|
||||
|
||||
@@ -293,7 +293,7 @@
|
||||
pageList: initPageNum,
|
||||
columns:[[
|
||||
{ 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) {
|
||||
var str = '';
|
||||
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 + '\');"/> ';
|
||||
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/redo.png" style="cursor: pointer;" onclick="skipDepotHead(\'' + index + '\');"/>';
|
||||
return str;
|
||||
}
|
||||
},
|
||||
{ title: '客户名称', field: 'organName',width:120},
|
||||
{ title: '单据编号',field: 'number',width:155, formatter:function (value,rec) {
|
||||
if(rec.linknumber) {
|
||||
if(rec.linkNumber) {
|
||||
return value + "[转]";
|
||||
} else {
|
||||
return value;
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
</td>
|
||||
<td style="width:70px;">关联订单</td>
|
||||
<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 style="width:100px;"></td>
|
||||
</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="cancelOtherMoneyDlg" class="easyui-linkbutton" iconCls="icon-cancel">取消</a>
|
||||
</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="depot"></div>
|
||||
<div id="account"></div>
|
||||
@@ -374,7 +383,7 @@
|
||||
},
|
||||
{ title: '客户名称', field: 'organName',width:120},
|
||||
{ title: '单据编号',field: 'number',width:155, formatter:function (value,rec) {
|
||||
if(rec.linknumber) {
|
||||
if(rec.linkNumber) {
|
||||
return value + "[转]";
|
||||
} else {
|
||||
return value;
|
||||
@@ -457,8 +466,113 @@
|
||||
$('#accountFM').form('clear');
|
||||
bindAccountEvent();
|
||||
});
|
||||
//关联订单的选择事件
|
||||
$('#LinkNumber').textbox({
|
||||
onClickButton:function(){
|
||||
$('#linkBillDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui/themes/icons/edit_add.png"/> 选择关联单据');
|
||||
$("#linkBillDlg").panel("move",{top:$(document).scrollTop() + ($(window).height()-400) * 0.5});
|
||||
initLinkBillTableData(1,initPageSize);
|
||||
initLinkBillPager();
|
||||
}
|
||||
});
|
||||
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) {
|
||||
var res = $("#tableData").datagrid("getRows")[index];
|
||||
@@ -579,7 +693,10 @@
|
||||
}
|
||||
$("#DebtShow").text(debt);
|
||||
$("#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;
|
||||
if(otherMoney!=0 && res.otherMoneyList && res.otherMoneyItem){
|
||||
var itemArr = res.otherMoneyList.split(","); //支出项目id列表
|
||||
|
||||
Reference in New Issue
Block a user