增加订单转采购和销售的功能

This commit is contained in:
季圣华
2019-03-10 20:06:11 +08:00
parent 49df4bad73
commit 2195b8bf25
18 changed files with 3596 additions and 3359 deletions

View File

@@ -210,6 +210,7 @@
$("#bill .OrganIdShow").text(data.organName);
$("#bill .OperTimeShow").text(data.opertimeStr);
$("#bill .NumberShow").text(data.number);
$("#bill .LinkNumberShow").text(data.linknumber? data.linknumber : "");
$("#bill .RemarkShow").text(data.remark);
$("#bill .DiscountShow").text(data.discount);
$("#bill .DiscountMoneyShow").text(data.discountmoney);

View File

@@ -1,5 +1,6 @@
//初始化界面
var kid = sessionStorage.getItem("userId");
var pageType = getUrlParam('t'); //获取页面类型传值
var depotList = null;
var depotID = null;
var supplierList = null;
@@ -447,6 +448,10 @@
//初始化表格数据
function initTableData(){
if(pageType === "skip") {
var oldRowInfo = sessionStorage.getItem("rowInfo");
editDepotHead(oldRowInfo); //自动弹出编辑框,带缓存数据
}
var hideType = undefined;
var isHiddenStatus = true;
if(payTypeTitle === "隐藏"){
@@ -515,6 +520,18 @@
organNameTitle = "会员卡号";
}
}
var opWidth = 90; //操作宽度
var isShowSkip = false; //是否显示跳转按钮
var opTitle = ""; //跳转按钮的标题
if(listTitle == "采购订单列表") {
opWidth = 120;
isShowSkip = true;
opTitle = "转采购入库";
} else if(listTitle == "销售订单列表") {
opWidth = 120;
isShowSkip = true;
opTitle = "转销售出库";
}
$('#tableData').datagrid({
height:heightInfo,
rownumbers: false,
@@ -531,7 +548,7 @@
pageList: initPageNum,
columns:[[
{ field: 'id',width:35,align:"center",checkbox:true},
{ title: '操作',field: 'op',align:"center",width:90,
{ title: '操作',field: 'op',align:"center",width:opWidth,
formatter:function(value,rec) {
var str = '';
var rowInfo = rec.id + 'AaBb' + rec.projectid+ 'AaBb' + rec.number+ 'AaBb' + rec.operpersonname
@@ -542,18 +559,29 @@
+ 'AaBb' + rec.allocationProjectName + 'AaBb' + rec.paytype + 'AaBb' + rec.salesman
+ 'AaBb' + rec.discount + 'AaBb' + rec.discountmoney + 'AaBb' + rec.discountlastmoney
+ 'AaBb' + rec.accountidlist + 'AaBb' + rec.accountmoneylist
+ 'AaBb' + rec.othermoney + 'AaBb' + rec.othermoneylist + 'AaBb' + rec.othermoneyitem + 'AaBb' + rec.accountday;
+ 'AaBb' + rec.othermoney + 'AaBb' + rec.othermoneylist + 'AaBb' + rec.othermoneyitem
+ 'AaBb' + rec.accountday + 'AaBb' + rec.linknumber;
rowInfo = rowInfo.replace(/\"/g, "");
rowInfo = rowInfo.replace(/\[|]/g,"");
var orgId = rec.organid? rec.organid:0;
str += '<img title="查看" src="/js/easyui-1.3.5/themes/icons/list.png" style="cursor: pointer;" onclick="showDepotHead(\'' + rowInfo + '\');"/>&nbsp;&nbsp;&nbsp;';
str += '<img title="编辑" src="/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editDepotHead(\'' + rowInfo + '\''+',' + rec.status + ');"/>&nbsp;&nbsp;&nbsp;';
str += '<img title="删除" src="/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteDepotHead('+ rec.id +',' + orgId +',' + rec.totalprice+',' + rec.status + ');"/>';
if(isShowSkip) {
str += '&nbsp;&nbsp;&nbsp;<img title="' + opTitle + '" src="/js/easyui-1.3.5/themes/icons/redo.png" style="cursor: pointer;" onclick="skipDepotHead(\'' + rowInfo + '\''+',' + rec.status + ');"/>';
}
return str;
}
},
{ title: organNameTitle, field: 'organName',width:120, hidden:isShowOrganNameColumn},
{ title: '单据编号',field: 'number',width:125},
{ title: '单据编号',field: 'number',width:135, formatter:function (value,rec) {
if(rec.linknumber) {
return value + "[转]";
} else {
return value;
}
}
},
{ title: '商品信息',field: 'materialsList',width:180,formatter:function(value){
if(value) {
return value.replace(",","");
@@ -570,7 +598,17 @@
{ 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){
return value? "<span style='color:green;'>已审核</span>":"<span style='color:red;'>未审核</span>";
if(value === "0") {
return "<span style='color:red;'>未审核</span>";
} else if(value === "1") {
return "<span style='color:green;'>已审核</span>";
} else if(value === "2") {
if(listTitle == "采购订单列表") {
return "<span style='color:blue;'>已转采购</span>";
} else if(listTitle == "销售订单列表") {
return "<span style='color:blue;'>已转销售</span>";
}
}
}
}
]],
@@ -1110,6 +1148,16 @@
});
data.footer = array;
$("#materialData").datagrid('loadData',data);
//如果是订单跳转到采购或销售
if(pageType === "skip") {
var skipList = $("#depotHeadFM .datagrid-body tr");
//逐条自动点击每行数据
skipList.each(function (i) {
setTimeout(function () {
skipList.eq(i).find("[field='Stock']").click();
},(i+1)*1000);
});
}
}
},
error:function() {
@@ -1232,8 +1280,8 @@
//删除单据信息
function deleteDepotHead(depotHeadID, thisOrganId, totalPrice, status){
if(status) {
$.messager.alert('删除提示','已审核的单据不能删除!','warning');
if(status == "1" || status == "2") {
$.messager.alert('删除提示','已审核和已转的单据不能删除!','warning');
return;
}
$.messager.confirm('删除确认','确定要删除此单据信息吗?',function(r) {
@@ -1285,6 +1333,20 @@
});
}
//订单转采购或销售
function skipDepotHead(rowInfo, status){
if(status == "0" || status == "2") {
$.messager.alert('提示','未审核和已转的单据禁止操作!','warning');
} else {
sessionStorage.setItem("rowInfo", rowInfo); //将单据信息存入缓存中
if(listTitle == "采购订单列表") {
parent.addTab("订单转采购", "../materials/purchase_in_list.html?t=skip", "");
} else if(listTitle == "销售订单列表") {
parent.addTab("订单转销售", "../materials/sale_out_list.html?t=skip", "");
}
}
}
//批量删除单据信息
function batDeleteDepotHead(){
var row = $('#tableData').datagrid('getChecked');
@@ -1297,67 +1359,69 @@
{
$.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;
}
//alert(row[i].id);
ids += row[i].id + ",";
}
//批量更新会员的预收款信息
for(var i = 0;i < row.length; i ++) {
if(listSubType === "零售") {
$.ajax({
type:"post",
url: "/supplier/updateAdvanceIn",
dataType: "json",
data:{
supplierId: row[i].organid, //会员id
advanceIn: row[i].totalprice //删除时同时返还用户的预付款
},
success: function(res){
if(res && res.code === 200) {
//保存会员预收款成功
}
},
error: function(){
$.messager.alert('提示','保存信息异常,请稍后再试!','error');
return;
}
});
}
}
//批量删除
$.ajax({
type:"post",
// url: "/depotHead/batchDelete",
url: "/depotHead/batchDeleteDepotHeadAndDetail",
dataType: "json",
async : false,
data: ({
ids : ids
}),
success: function (res) {
if(res && res.code === 200) {
$("#searchBtn").click();
$(":checkbox").attr("checked", false);
} else {
$.messager.alert('删除提示', '删除单据信息失败,请稍后再试!', 'error');
if (r) {
var ids = "";
for (var i = 0; i < row.length; i++) {
if (i == row.length - 1) {
if (row[i].status == 0) {
ids += row[i].id;
}
},
//此处添加错误处理
error:function() {
$.messager.alert('删除提示','删除单据信息异常,请稍后再试!','error');
return;
}
});
}
break;
}
ids += row[i].id + ",";
}
if (ids) {
//批量更新会员的预收款信息
for (var i = 0; i < row.length; i++) {
if (listSubType === "零售") {
$.ajax({
type: "post",
url: "/supplier/updateAdvanceIn",
dataType: "json",
data: {
supplierId: row[i].organid, //会员id
advanceIn: row[i].totalprice //删除时同时返还用户的预付款
},
success: function (res) {
if (res && res.code === 200) {
//保存会员预收款成功
}
},
error: function () {
$.messager.alert('提示', '保存信息异常,请稍后再试!', 'error');
return;
}
});
}
}
//批量删除
$.ajax({
type: "post",
// url: "/depotHead/batchDelete",
url: "/depotHead/batchDeleteDepotHeadAndDetail",
dataType: "json",
async: false,
data: ({
ids: ids
}),
success: function (res) {
if (res && res.code === 200) {
$("#searchBtn").click();
$(":checkbox").attr("checked", false);
} else {
$.messager.alert('删除提示', '删除单据信息失败,请稍后再试!', 'error');
}
},
//此处添加错误处理
error: function () {
$.messager.alert('删除提示', '删除单据信息异常,请稍后再试!', 'error');
return;
}
});
} else {
$.messager.alert('删除提示','没有能删除的单据!','warning');
}
}
});
}
}
@@ -1379,34 +1443,40 @@
{
if(i == row.length-1)
{
ids += row[i].id;
if(row[i].status != "2") {
ids += row[i].id;
}
break;
}
ids += row[i].id + ",";
}
$.ajax({
type:"post",
url: "/depotHead/batchSetStatus",
dataType: "json",
async : false,
data: ({
status: true,
depotHeadIDs : ids
}),
success: function (res) {
if(res && res.code === 200) {
$("#searchBtn").click();
$(":checkbox").attr("checked", false);
} else {
$.messager.alert('审核提示', '审核信息失败,请稍后再试!', 'error');
if(ids) {
$.ajax({
type:"post",
url: "/depotHead/batchSetStatus",
dataType: "json",
async : false,
data: ({
status: "1",
depotHeadIDs : ids
}),
success: function (res) {
if(res && res.code === 200) {
$("#searchBtn").click();
$(":checkbox").attr("checked", false);
} else {
$.messager.alert('审核提示', '审核信息失败,请稍后再试!', 'error');
}
},
//此处添加错误处理
error:function() {
$.messager.alert('审核提示','审核信息异常,请稍后再试!','error');
return;
}
},
//此处添加错误处理
error:function() {
$.messager.alert('审核提示','审核信息异常,请稍后再试!','error');
return;
}
});
});
} else {
$.messager.alert('审核提示','没有能审核的单据!','warning');
}
}
});
}
@@ -1431,70 +1501,70 @@
{
if(i == row.length-1)
{
ids += row[i].id;
if(row[i].status != "2") {
ids += row[i].id;
}
break;
}
ids += row[i].id + ",";
}
$.ajax({
type:"post",
url: "/depotHead/batchSetStatus",
dataType: "json",
async : false,
data: ({
status: false,
depotHeadIDs : ids
}),
success: function (res) {
if(res && res.code === 200) {
$("#searchBtn").click();
$(":checkbox").attr("checked", false);
} else {
$.messager.alert('反审核提示', '反审核信息失败,请稍后再试!', 'error');
if(ids) {
$.ajax({
type: "post",
url: "/depotHead/batchSetStatus",
dataType: "json",
async: false,
data: ({
status: "0",
depotHeadIDs: ids
}),
success: function (res) {
if (res && res.code === 200) {
$("#searchBtn").click();
$(":checkbox").attr("checked", false);
} else {
$.messager.alert('反审核提示', '反审核信息失败,请稍后再试!', 'error');
}
},
//此处添加错误处理
error: function () {
$.messager.alert('反审核提示', '反审核信息异常,请稍后再试!', 'error');
return;
}
},
//此处添加错误处理
error:function() {
$.messager.alert('反审核提示','反审核信息异常,请稍后再试!','error');
return;
}
});
});
} else {
$.messager.alert('反审核提示','没有能反审核的单据!','warning');
}
}
});
}
}
//生成单据编号
function buildNumber() {
$.ajax({
type: "get",
url: "/depotHead/buildNumber",
success:function(res){
if(res && res.code === 200){
var obj = res.data;
var defaultNumber = obj.DefaultNumber;
var newNumber = amountNum + defaultNumber;
$("#Number").val(newNumber).attr("data-defaultNumber",newNumber);
}
},
error:function(){
$.messager.alert('提示','生成单据编号失败!','error');
}
});
}
//新增信息
function addDepotHead(){
$('#depotHeadFM').form('clear');
var thisDateTime = getNowFormatDateTime(); //当前时间
$("#OperTime").val(thisDateTime);
var thisNumber = getNowFormatDateNum(); //根据时间生成编号
var thisDate = getNowFormatDate(); //当前日期
var beginTime = thisDate + " 00:00:00";
var endTime = thisDate + " 23:59:59";
//生成单据编号
$.ajax({
type: "get",
url: "/depotHead/buildNumber",
data: {
type: listType,
subType: listSubType,
beginTime: beginTime,
endTime: endTime
},
success:function(res){
if(res && res.code === 200){
var obj = res.data;
var defaultNumber = obj.DefaultNumber;
var newNumber = amountNum + defaultNumber
$("#Number").val(newNumber).attr("data-defaultNumber",newNumber);
}
},
error:function(){
$.messager.alert('提示','生成单据编号失败!','error');
}
});
buildNumber(); //生成单据编号
//初始化优惠率、优惠金额、优惠后金额、本次付|收款、本次欠款 为0
$("#Discount").val(0);
$("#DiscountMoney").val(0);
@@ -1561,8 +1631,8 @@
//编辑信息
function editDepotHead(depotHeadTotalInfo, status){
if(status) {
$.messager.alert('编辑提示','已审核的单据不能编辑!','warning');
if(status == "1" || status == "2") {
$.messager.alert('编辑提示','已审核和已转的单据不能编辑!','warning');
return;
}
var depotHeadInfo = depotHeadTotalInfo.split("AaBb");
@@ -1572,20 +1642,30 @@
initSystemData_person(ProjectId);
initSelectInfo_person();
}
$("#Number").val(depotHeadInfo[2]).attr("data-defaultNumber",depotHeadInfo[2]);
$("#OperTime").val(depotHeadInfo[4]);
var TotalPrice = depotHeadInfo[14]; //合计金额
if(pageType === "skip") { //从订单跳转过来
buildNumber(); //生成单据编号
var thisDateTime = getNowFormatDateTime(); //当前时间
$("#OperTime").val(thisDateTime);
$("#LinkNumber").val(depotHeadInfo[2]); //关联订单号
$("#AccountId").val(defaultAccountId); //初始化默认的账户Id
$("#DiscountLastMoney").val(TotalPrice); //优惠后金额
$("#ChangeAmount").val(TotalPrice).attr("data-changeamount", TotalPrice);
} else {
$("#Number").val(depotHeadInfo[2]).attr("data-defaultNumber",depotHeadInfo[2]);
$("#OperTime").val(depotHeadInfo[4]);
$("#LinkNumber").val(depotHeadInfo[28].replace("undefined","")); //关联订单号
$("#AccountId").val(depotHeadInfo[7]); //账户Id
$("#DiscountLastMoney").val(depotHeadInfo[21].replace("undefined","0.00")); //优惠后金额
$("#ChangeAmount").val(depotHeadInfo[8]).attr("data-changeamount", depotHeadInfo[8]);
}
$('#OrganId').combobox('setValue', depotHeadInfo[5]=='undefined'?'':depotHeadInfo[5]);
$("#HandsPersonId").val(depotHeadInfo[6]);
$("#AccountId").val(depotHeadInfo[7]);
$("#ChangeAmount").val(depotHeadInfo[8]);
$("#ChangeAmount").attr("data-changeamount", depotHeadInfo[8]);
$("#Remark").val(depotHeadInfo[9]);
$("#Discount").val(depotHeadInfo[19]);
$("#DiscountMoney").val(depotHeadInfo[20]);
$("#DiscountLastMoney").val(depotHeadInfo[21]);
$("#Debt").val((depotHeadInfo[21]-depotHeadInfo[8]).toFixed(2));
$("#Discount").val(depotHeadInfo[19].replace("undefined","0"));
$("#DiscountMoney").val(depotHeadInfo[20].replace("undefined","0.00"));
$("#Debt").val((depotHeadInfo[21].replace("undefined","0.00")-depotHeadInfo[8]).toFixed(2));
$("#AccountDay").val(depotHeadInfo[27].replace("undefined","")); //结算天数
var TotalPrice = depotHeadInfo[14];
preTotalPrice = depotHeadInfo[14]; //记录前一次合计金额,用于扣预付款
$("#AllocationProjectId").val(depotHeadInfo[15]);
oldNumber = depotHeadInfo[2]; //记录编辑前的单据编号
@@ -1657,8 +1737,14 @@
}
initTableData_material("edit",TotalPrice); //商品列表
reject(); //撤销下、刷新商品列表
url = '/depotHead/updateDepotHeadAndDetail?id=' + depotHeadInfo[0];
reject(); //撤销下、刷新商品列表
if(pageType === "skip") {
url = '/depotHead/addDepotHeadAndDetail'; //如果是从订单跳转过来,则此处为新增的接口
//jshjshjsh
$("#depotHeadFM .datagrid-body").find("[field='DepotId']").click();
} else {
url = '/depotHead/updateDepotHeadAndDetail?id=' + depotHeadInfo[0]; //更新接口
}
}
//查看信息
@@ -1700,6 +1786,7 @@
$("#DiscountLastMoneyShow").text(depotHeadInfo[21]);
$("#DebtShow").text((depotHeadInfo[21]-depotHeadInfo[8]).toFixed(2));
$("#AccountDayShow").text(depotHeadInfo[27].replace("undefined","")); //结算天数
$("#LinkNumberShow").text(depotHeadInfo[28].replace("undefined","")); //关联订单号
if(depotHeadInfo[25] && depotHeadInfo[26]){
var itemArr = depotHeadInfo[25].split(","); //支出项目id列表
var itemMoneyArr = depotHeadInfo[26].split(","); //支出项目金额列表
@@ -2027,6 +2114,7 @@
AllocationProjectId: AllocationProjectId,
DefaultNumber: $.trim($("#Number").attr("data-defaultNumber")),//初始编号
Number: $.trim($("#Number").val()),
LinkNumber: $.trim($("#LinkNumber").val()),
OperTime: $("#OperTime").val(),
OrganId: OrganId,
HandsPersonId: $.trim($("#HandsPersonId").val()),
@@ -2970,7 +3058,12 @@
* 新增单据主表及单据子表
* */
function addDepotHeadAndDetail(url,infoStr){
var inserted = $("#materialData").datagrid('getChanges', "inserted");
var inserted = null;
if(pageType === "skip") {
inserted = $("#materialData").datagrid('getChanges', "updated");
} else {
inserted = $("#materialData").datagrid('getChanges', "inserted");
}
var deleted = $("#materialData").datagrid('getChanges', "deleted");
var updated = $("#materialData").datagrid('getChanges', "updated");
$.ajax({

View File

@@ -173,8 +173,10 @@
<td style="padding:5px;width:140px;">
<span class="NumberShow"></span>
</td>
<td style="width:70px;"></td>
<td style="padding:5px;width:140px;"></td>
<td style="width:70px;">关联订单:</td>
<td style="padding:5px;width:130px;">
<span class="LinkNumberShow"></span>
</td>
<td style="width:100px;"></td>
</tr>
<tr>
@@ -222,10 +224,8 @@
<td style="padding:5px">
<span class="OtherMoneyShow"></span>
</td>
<td>结算天数:</td>
<td style="padding:5px">
<span class="AccountDayShow"></span>
</td>
<td></td>
<td style="padding:5px"></td>
<td style="width:100px;"></td>
</tr>
</table>
@@ -312,18 +312,18 @@
<td style="padding:5px;width:130px;">
<span class="OrganIdShow"></span>
</td>
<td style="width:70px;">销售人员</td>
<td style="padding:5px;width:130px;">
<span class="SalesmanShow"></span>
</td>
<td style="width:80px;">单据日期:</td>
<td style="width:70px;">单据日期</td>
<td style="padding:5px;width:140px;">
<span class="OperTimeShow"></span>
</td>
<td style="width:70px;">单据编号:</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="LinkNumberShow"></span>
</td>
<td style="width:100px;"></td>
</tr>
<tr>
@@ -371,9 +371,9 @@
<td style="padding:5px">
<span class="OtherMoneyShow"></span>
</td>
<td>结算天数</td>
<td>销售人员</td>
<td style="padding:5px">
<span class="AccountDayShow"></span>
<span class="SalesmanShow"></span>
</td>
<td style="width:100px;"></td>
</tr>
@@ -388,10 +388,6 @@
<td style="padding:5px;width:130px;">
<span class="OrganIdShow"></span>
</td>
<td style="width:70px;">销售人员:</td>
<td style="padding:5px;width:130px;">
<span class="SalesmanShow"></span>
</td>
<td style="width:80px;">单据日期:</td>
<td style="padding:5px;width:140px;">
<span class="OperTimeShow"></span>
@@ -400,6 +396,8 @@
<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>
@@ -447,8 +445,9 @@
<td style="padding:5px">
<span class="OtherMoneyShow"></span>
</td>
<td></td>
<td>销售人员:</td>
<td style="padding:5px">
<span class="SalesmanShow"></span>
</td>
<td style="width:100px;"></td>
</tr>

View File

@@ -82,8 +82,9 @@
<input name="Number" id="Number" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width: 150px;" readonly/>
</td>
<td style="width:70px;"></td>
<td style="width:70px;">关联订单:</td>
<td style="padding:5px">
<input name="LinkNumber" id="LinkNumber" class="easyui-validatebox" style="width: 150px;" readonly/>
</td>
<td style="width:100px;"></td>
</tr>
@@ -135,10 +136,8 @@
<input id="OtherMoney" name="OtherMoney" style="width:120px;" readonly="readonly"/>
<img class="other-money-ico" src="/js/easyui-1.3.5/themes/icons/filelist.jpg"/>
</td>
<td>结算天数:</td>
<td></td>
<td style="padding:5px">
<input id="AccountDay" name="AccountDay" class="easyui-validatebox"
data-options="validType:'length[1,3]'" style="width:120px;"/>
</td>
<td style="width:100px;"></td>
</tr>
@@ -167,8 +166,10 @@
<td style="padding:5px;width:140px;">
<span id="NumberShow"></span>
</td>
<td style="width:70px;"></td>
<td style="padding:5px;width:140px;"></td>
<td style="width:70px;">关联订单:</td>
<td style="padding:5px;width:140px;">
<span id="LinkNumberShow"></span>
</td>
<td style="width:100px;"></td>
</tr>
<tr>
@@ -216,10 +217,8 @@
<td style="padding:5px">
<span id="OtherMoneyShow"></span>
</td>
<td>结算天数:</td>
<td style="padding:5px">
<span id="AccountDayShow"></span>
</td>
<td></td>
<td style="padding:5px"></td>
<td style="width:100px;"></td>
</tr>
</table>

View File

@@ -65,10 +65,6 @@
<td style="padding:5px">
<input id="OrganId" name="OrganId" style="width:110px;"/>
</td>
<td style="width:70px;">销售人员:</td>
<td style="padding:5px">
<input id="Salesman" name="Salesman" style="width:130px;"/>
</td>
<td>单据日期:</td>
<td style="padding:5px">
<input type="text" name="OperTime" id="OperTime"
@@ -80,6 +76,8 @@
<input name="Number" id="Number" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width: 150px;" readonly/>
</td>
<td style="width:70px;"></td>
<td style="padding:5px"></td>
<td style="width:100px;"></td>
</tr>
<tr>
@@ -130,8 +128,9 @@
<input id="OtherMoney" name="OtherMoney" style="width:120px;" readonly="readonly"/>
<img class="other-money-ico" src="/js/easyui-1.3.5/themes/icons/filelist.jpg"/>
</td>
<td></td>
<td>销售人员:</td>
<td style="padding:5px">
<input id="Salesman" name="Salesman" style="width:130px;"/>
</td>
<td style="width:100px;"></td>
</tr>
@@ -151,10 +150,6 @@
<td style="padding:5px;width:130px;">
<span id="OrganIdShow"></span>
</td>
<td style="width:70px;">销售人员:</td>
<td style="padding:5px;width:130px;">
<span id="SalesmanShow"></span>
</td>
<td style="width:80px;">单据日期:</td>
<td style="padding:5px;width:140px;">
<span id="OperTimeShow"></span>
@@ -163,6 +158,8 @@
<td style="padding:5px;width:140px;">
<span id="NumberShow"></span>
</td>
<td style="width:70px;"></td>
<td style="padding:5px;width:130px;"></td>
<td style="width:100px;"></td>
</tr>
<tr>
@@ -210,8 +207,9 @@
<td style="padding:5px">
<span id="OtherMoneyShow"></span>
</td>
<td></td>
<td>销售人员:</td>
<td style="padding:5px">
<span id="SalesmanShow"></span>
</td>
<td style="width:100px;"></td>
</tr>

View File

@@ -65,21 +65,21 @@
<td style="padding:5px">
<input id="OrganId" name="OrganId" style="width:130px;"/>
</td>
<td style="width:70px;">销售人员</td>
<td style="padding:5px">
<input id="Salesman" name="Salesman" style="width:130px;"/>
</td>
<td style="width:80px;">单据日期:</td>
<td style="width:70px;">单据日期</td>
<td style="padding:5px">
<input type="text" name="OperTime" id="OperTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate"
style="width:140px;" readonly/>
</td>
<td style="width:70px;">单据编号:</td>
<td style="width:80px;">单据编号:</td>
<td style="padding:5px">
<input name="Number" id="Number" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width: 150px;" readonly/>
</td>
<td style="width:70px;">销售人员:</td>
<td style="padding:5px">
<input id="Salesman" name="Salesman" style="width:130px;"/>
</td>
<td style="width:100px;"></td>
</tr>
<tr>
@@ -110,18 +110,18 @@
<td style="padding:5px;width:130px;">
<span id="OrganIdShow"></span>
</td>
<td style="width:70px;">销售人员</td>
<td style="padding:5px;width:130px;">
<span id="SalesmanShow"></span>
</td>
<td style="width:80px;">单据日期:</td>
<td style="width:70px;">单据日期</td>
<td style="padding:5px;width:140px;">
<span id="OperTimeShow"></span>
</td>
<td style="width:70px;">单据编号:</td>
<td style="width:80px;">单据编号:</td>
<td style="padding:5px;width:140px;">
<span id="NumberShow"></span>
</td>
<td style="width:70px;">销售人员:</td>
<td style="padding:5px;width:130px;">
<span id="SalesmanShow"></span>
</td>
<td style="width:100px;"></td>
</tr>
<tr>

View File

@@ -65,21 +65,21 @@
<td style="padding:5px">
<input id="OrganId" name="OrganId" style="width:130px;"/>
</td>
<td style="width:70px;">销售人员</td>
<td style="padding:5px">
<input id="Salesman" name="Salesman" style="width:130px;"/>
</td>
<td style="width:80px;">单据日期:</td>
<td style="width:70px;">单据日期</td>
<td style="padding:5px">
<input type="text" name="OperTime" id="OperTime"
onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="txt Wdate"
style="width:140px;" readonly/>
</td>
<td style="width:70px;">单据编号:</td>
<td style="width:80px;">单据编号:</td>
<td style="padding:5px">
<input name="Number" id="Number" class="easyui-validatebox"
data-options="required:true,validType:'length[2,30]'" style="width: 150px;" readonly/>
</td>
<td style="width:70px;">关联订单:</td>
<td style="padding:5px">
<input name="LinkNumber" id="LinkNumber" class="easyui-validatebox" style="width: 150px;" readonly/>
</td>
<td style="width:100px;"></td>
</tr>
<tr>
@@ -130,10 +130,9 @@
<input id="OtherMoney" name="OtherMoney" style="width:120px;" readonly="readonly"/>
<img class="other-money-ico" src="/js/easyui-1.3.5/themes/icons/filelist.jpg"/>
</td>
<td>结算天数</td>
<td>销售人员</td>
<td style="padding:5px">
<input id="AccountDay" name="AccountDay" class="easyui-numberbox"
data-options="validType:'length[1,3]'" style="width:120px;"/>
<input id="Salesman" name="Salesman" style="width:130px;"/>
</td>
<td style="width:100px;"></td>
</tr>
@@ -153,18 +152,18 @@
<td style="padding:5px;width:130px;">
<span id="OrganIdShow"></span>
</td>
<td style="width:70px;">销售人员</td>
<td style="padding:5px;width:130px;">
<span id="SalesmanShow"></span>
</td>
<td style="width:80px;">单据日期:</td>
<td style="width:70px;">单据日期</td>
<td style="padding:5px;width:140px;">
<span id="OperTimeShow"></span>
</td>
<td style="width:70px;">单据编号:</td>
<td style="width:80px;">单据编号:</td>
<td style="padding:5px;width:140px;">
<span id="NumberShow"></span>
</td>
<td style="width:70px;">关联订单:</td>
<td style="padding:5px;width:130px;">
<span id="LinkNumberShow"></span>
</td>
<td style="width:100px;"></td>
</tr>
<tr>
@@ -212,9 +211,9 @@
<td style="padding:5px">
<span id="OtherMoneyShow"></span>
</td>
<td>结算天数</td>
<td>销售人员</td>
<td style="padding:5px">
<span id="AccountDayShow"></span>
<span id="SalesmanShow"></span>
</td>
<td style="width:100px;"></td>
</tr>

View File

@@ -1345,4 +1345,12 @@ update jsh_functions SET PushBtn = '3' where Number = '060301' and PNumber = '06
-- ----------------------------
update jsh_userbusiness SET
BtnStr = '[{"funId":"25","btnStr":"1"},{"funId":"217","btnStr":"1"},{"funId":"218","btnStr":"1"},{"funId":"241","btnStr":"3"},{"funId":"242","btnStr":"3"}]'
where Id = 5;
where Id = 5;
-- ----------------------------
-- 时间2019年3月10日
-- version1.0.8
-- 改状态字段的类型,增加关联单据字段
-- ----------------------------
alter table jsh_depothead change Status Status varchar(1) DEFAULT '0' COMMENT '状态0未审核、1已审核、2已转采购|销售';
alter table jsh_depothead add `LinkNumber` varchar(50) DEFAULT null COMMENT '关联订单号';

View File

@@ -51,6 +51,12 @@ public class BusinessConstants {
* */
public static final String ENABLE_SERIAL_NUMBER_ENABLED = "1";
public static final String ENABLE_SERIAL_NUMBER_NOT_ENABLED = "0";
/**
* 单据状态 billsStatus '0'未审核 '1'审核 '2'已转采购|销售
* */
public static final String BILLS_STATUS_UN_AUDIT = "0";
public static final String BILLS_STATUS_AUDIT = "1";
public static final String BILLS_STATUS_SKIP = "2";
/**
* 出入库分类
*采购、采购退货、其它、零售、销售、调拨

View File

@@ -51,7 +51,7 @@ public class DepotHeadController {
* @return
*/
@PostMapping(value = "/batchSetStatus")
public String batchSetStatus(@RequestParam("status") Boolean status,
public String batchSetStatus(@RequestParam("status") String status,
@RequestParam("depotHeadIDs") String depotHeadIDs,
HttpServletRequest request) {
Map<String, Object> objectMap = new HashMap<String, Object>();
@@ -64,20 +64,12 @@ public class DepotHeadController {
}
/**
* 单据编号生成接口规则查找当前类型单据下的当天最大的单据号并加1
* @param type
* @param subType
* @param beginTime
* @param endTime
* 单据编号生成接口
* @param request
* @return
*/
@GetMapping(value = "/buildNumber")
public BaseResponseInfo buildNumber(@RequestParam("type") String type,
@RequestParam("subType") String subType,
@RequestParam("beginTime") String beginTime,
@RequestParam("endTime") String endTime,
HttpServletRequest request) {
public BaseResponseInfo buildNumber(HttpServletRequest request) {
BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>();
try {

File diff suppressed because it is too large Load Diff

View File

@@ -1,103 +1,96 @@
package com.jsh.erp.datasource.mappers;
import com.jsh.erp.datasource.entities.DepotHead;
import com.jsh.erp.datasource.entities.DepotHeadExample;
import java.math.BigDecimal;
import java.util.List;
import com.jsh.erp.datasource.vo.DepotHeadVo4InDetail;
import com.jsh.erp.datasource.vo.DepotHeadVo4InOutMCount;
import com.jsh.erp.datasource.vo.DepotHeadVo4List;
import com.jsh.erp.datasource.vo.DepotHeadVo4StatementAccount;
import org.apache.ibatis.annotations.Param;
public interface DepotHeadMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_depothead
*
* @mbggenerated
*/
int countByExample(DepotHeadExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_depothead
*
* @mbggenerated
*/
int deleteByExample(DepotHeadExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_depothead
*
* @mbggenerated
*/
int deleteByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_depothead
*
* @mbggenerated
*/
int insert(DepotHead record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_depothead
*
* @mbggenerated
*/
int insertSelective(DepotHead record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_depothead
*
* @mbggenerated
*/
List<DepotHead> selectByExample(DepotHeadExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_depothead
*
* @mbggenerated
*/
DepotHead selectByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_depothead
*
* @mbggenerated
*/
int updateByExampleSelective(@Param("record") DepotHead record, @Param("example") DepotHeadExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_depothead
*
* @mbggenerated
*/
int updateByExample(@Param("record") DepotHead record, @Param("example") DepotHeadExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_depothead
*
* @mbggenerated
*/
int updateByPrimaryKeySelective(DepotHead record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_depothead
*
* @mbggenerated
*/
int updateByPrimaryKey(DepotHead record);
package com.jsh.erp.datasource.mappers;
import com.jsh.erp.datasource.entities.DepotHead;
import com.jsh.erp.datasource.entities.DepotHeadExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface DepotHeadMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_depothead
*
* @mbggenerated
*/
int countByExample(DepotHeadExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_depothead
*
* @mbggenerated
*/
int deleteByExample(DepotHeadExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_depothead
*
* @mbggenerated
*/
int deleteByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_depothead
*
* @mbggenerated
*/
int insert(DepotHead record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_depothead
*
* @mbggenerated
*/
int insertSelective(DepotHead record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_depothead
*
* @mbggenerated
*/
List<DepotHead> selectByExample(DepotHeadExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_depothead
*
* @mbggenerated
*/
DepotHead selectByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_depothead
*
* @mbggenerated
*/
int updateByExampleSelective(@Param("record") DepotHead record, @Param("example") DepotHeadExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_depothead
*
* @mbggenerated
*/
int updateByExample(@Param("record") DepotHead record, @Param("example") DepotHeadExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_depothead
*
* @mbggenerated
*/
int updateByPrimaryKeySelective(DepotHead record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_depothead
*
* @mbggenerated
*/
int updateByPrimaryKey(DepotHead record);
}

View File

@@ -59,7 +59,9 @@ public class DepotHeadVo4List {
private Integer accountday;
private Boolean status;
private String status;
private String linknumber;
private String projectName;
@@ -291,14 +293,22 @@ public class DepotHeadVo4List {
this.accountday = accountday;
}
public Boolean getStatus() {
public String getStatus() {
return status;
}
public void setStatus(Boolean status) {
public void setStatus(String status) {
this.status = status;
}
public String getLinknumber() {
return linknumber;
}
public void setLinknumber(String linknumber) {
this.linknumber = linknumber;
}
public String getProjectName() {
return projectName;
}

View File

@@ -106,7 +106,7 @@ public class DepotHeadService {
depotHead.setOperpersonname(uName);
}
depotHead.setCreatetime(new Timestamp(System.currentTimeMillis()));
depotHead.setStatus(false);
depotHead.setStatus(BusinessConstants.BILLS_STATUS_UN_AUDIT);
return depotHeadMapper.insert(depotHead);
}
@@ -142,7 +142,7 @@ public class DepotHeadService {
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int batchSetStatus(Boolean status, String depotHeadIDs) {
public int batchSetStatus(String status, String depotHeadIDs) {
List<Long> ids = StringUtil.strToLongList(depotHeadIDs);
DepotHead depotHead = new DepotHead();
depotHead.setStatus(status);
@@ -275,7 +275,7 @@ public class DepotHeadService {
User userInfo=userService.getCurrentUser();
depotHead.setOperpersonname(userInfo==null?null:userInfo.getUsername());
depotHead.setCreatetime(new Timestamp(System.currentTimeMillis()));
depotHead.setStatus(false);
depotHead.setStatus(BusinessConstants.BILLS_STATUS_UN_AUDIT);
depotHeadMapperEx.adddepotHead(depotHead);
/**入库和出库处理预付款信息*/
if(BusinessConstants.PAY_TYPE_PREPAID.equals(depotHead.getPaytype())){
@@ -285,6 +285,14 @@ public class DepotHeadService {
}
/**入库和出库处理单据子表信息*/
depotItemService.saveDetials(inserted,deleted,updated,depotHead.getId());
/**如果关联单据号非空则更新订单的状态为2 */
if(depotHead.getLinknumber()!=null) {
DepotHead depotHeadOrders = new DepotHead();
depotHeadOrders.setStatus(BusinessConstants.BILLS_STATUS_SKIP);
DepotHeadExample example = new DepotHeadExample();
example.createCriteria().andNumberEqualTo(depotHead.getLinknumber());
depotHeadMapper.updateByExampleSelective(depotHeadOrders, example);
}
}
/**
* create by: cjl

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jsh.erp.datasource.mappers.DepotHeadMapper">
<resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.DepotHead">
<!--
@@ -33,7 +33,8 @@
<result column="OtherMoneyList" jdbcType="VARCHAR" property="othermoneylist" />
<result column="OtherMoneyItem" jdbcType="VARCHAR" property="othermoneyitem" />
<result column="AccountDay" jdbcType="INTEGER" property="accountday" />
<result column="Status" jdbcType="BIT" property="status" />
<result column="Status" jdbcType="VARCHAR" property="status" />
<result column="LinkNumber" jdbcType="VARCHAR" property="linknumber" />
</resultMap>
<sql id="Example_Where_Clause">
<!--
@@ -109,7 +110,8 @@
Id, Type, SubType, ProjectId, DefaultNumber, Number, OperPersonName, CreateTime,
OperTime, OrganId, HandsPersonId, AccountId, ChangeAmount, AllocationProjectId, TotalPrice,
PayType, Remark, Salesman, AccountIdList, AccountMoneyList, Discount, DiscountMoney,
DiscountLastMoney, OtherMoney, OtherMoneyList, OtherMoneyItem, AccountDay, Status
DiscountLastMoney, OtherMoney, OtherMoneyList, OtherMoneyItem, AccountDay, Status,
LinkNumber
</sql>
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.DepotHeadExample" resultMap="BaseResultMap">
<!--
@@ -171,7 +173,7 @@
AccountIdList, AccountMoneyList, Discount,
DiscountMoney, DiscountLastMoney, OtherMoney,
OtherMoneyList, OtherMoneyItem, AccountDay,
Status)
Status, LinkNumber)
values (#{id,jdbcType=BIGINT}, #{type,jdbcType=VARCHAR}, #{subtype,jdbcType=VARCHAR},
#{projectid,jdbcType=BIGINT}, #{defaultnumber,jdbcType=VARCHAR}, #{number,jdbcType=VARCHAR},
#{operpersonname,jdbcType=VARCHAR}, #{createtime,jdbcType=TIMESTAMP}, #{opertime,jdbcType=TIMESTAMP},
@@ -181,7 +183,7 @@
#{accountidlist,jdbcType=VARCHAR}, #{accountmoneylist,jdbcType=VARCHAR}, #{discount,jdbcType=DECIMAL},
#{discountmoney,jdbcType=DECIMAL}, #{discountlastmoney,jdbcType=DECIMAL}, #{othermoney,jdbcType=DECIMAL},
#{othermoneylist,jdbcType=VARCHAR}, #{othermoneyitem,jdbcType=VARCHAR}, #{accountday,jdbcType=INTEGER},
#{status,jdbcType=BIT})
#{status,jdbcType=VARCHAR}, #{linknumber,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.DepotHead">
<!--
@@ -274,6 +276,9 @@
<if test="status != null">
Status,
</if>
<if test="linknumber != null">
LinkNumber,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@@ -358,7 +363,10 @@
#{accountday,jdbcType=INTEGER},
</if>
<if test="status != null">
#{status,jdbcType=BIT},
#{status,jdbcType=VARCHAR},
</if>
<if test="linknumber != null">
#{linknumber,jdbcType=VARCHAR},
</if>
</trim>
</insert>
@@ -461,7 +469,10 @@
AccountDay = #{record.accountday,jdbcType=INTEGER},
</if>
<if test="record.status != null">
Status = #{record.status,jdbcType=BIT},
Status = #{record.status,jdbcType=VARCHAR},
</if>
<if test="record.linknumber != null">
LinkNumber = #{record.linknumber,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
@@ -501,7 +512,8 @@
OtherMoneyList = #{record.othermoneylist,jdbcType=VARCHAR},
OtherMoneyItem = #{record.othermoneyitem,jdbcType=VARCHAR},
AccountDay = #{record.accountday,jdbcType=INTEGER},
Status = #{record.status,jdbcType=BIT}
Status = #{record.status,jdbcType=VARCHAR},
LinkNumber = #{record.linknumber,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@@ -592,7 +604,10 @@
AccountDay = #{accountday,jdbcType=INTEGER},
</if>
<if test="status != null">
Status = #{status,jdbcType=BIT},
Status = #{status,jdbcType=VARCHAR},
</if>
<if test="linknumber != null">
LinkNumber = #{linknumber,jdbcType=VARCHAR},
</if>
</set>
where Id = #{id,jdbcType=BIGINT}
@@ -629,7 +644,8 @@
OtherMoneyList = #{othermoneylist,jdbcType=VARCHAR},
OtherMoneyItem = #{othermoneyitem,jdbcType=VARCHAR},
AccountDay = #{accountday,jdbcType=INTEGER},
Status = #{status,jdbcType=BIT}
Status = #{status,jdbcType=VARCHAR},
LinkNumber = #{linknumber,jdbcType=VARCHAR}
where Id = #{id,jdbcType=BIGINT}
</update>
</mapper>

View File

@@ -293,7 +293,7 @@
AccountIdList, AccountMoneyList, Discount,
DiscountMoney, DiscountLastMoney, OtherMoney,
OtherMoneyList, OtherMoneyItem, AccountDay,
Status)
Status, LinkNumber)
values (#{type,jdbcType=VARCHAR}, #{subtype,jdbcType=VARCHAR},
#{projectid,jdbcType=BIGINT}, #{defaultnumber,jdbcType=VARCHAR}, #{number,jdbcType=VARCHAR},
#{operpersonname,jdbcType=VARCHAR}, #{createtime,jdbcType=TIMESTAMP}, #{opertime,jdbcType=TIMESTAMP},
@@ -303,7 +303,7 @@
#{accountidlist,jdbcType=VARCHAR}, #{accountmoneylist,jdbcType=VARCHAR}, #{discount,jdbcType=DECIMAL},
#{discountmoney,jdbcType=DECIMAL}, #{discountlastmoney,jdbcType=DECIMAL}, #{othermoney,jdbcType=DECIMAL},
#{othermoneylist,jdbcType=VARCHAR}, #{othermoneyitem,jdbcType=VARCHAR}, #{accountday,jdbcType=INTEGER},
#{status,jdbcType=BIT})
#{status,jdbcType=VARCHAR}, #{linknumber,jdbcType=VARCHAR})
</insert>
<update id="updatedepotHead" parameterType="com.jsh.erp.datasource.entities.DepotHead">
update jsh_depothead
@@ -384,7 +384,10 @@
AccountDay = #{accountday,jdbcType=INTEGER},
</if>
<if test="status != null">
Status = #{status,jdbcType=BIT},
Status = #{status,jdbcType=VARCHAR},
</if>
<if test="linknumber != null">
LinkNumber = #{linknumber,jdbcType=VARCHAR},
</if>
</set>
where Id = #{id,jdbcType=BIGINT}