|
|
@ -116,9 +116,13 @@ |
|
|
|
<a class="btn btn-success" onclick="exportSalesOrder()" shiro:hasPermission="system:salesOrder:exportSalesOrder"> |
|
|
|
<i class="fa fa-download"></i> 导出销售订单模板 |
|
|
|
</a> |
|
|
|
<a class="btn btn-success" onclick="salesDeliverGoods()" shiro:hasPermission="system:salesOrder:salesDeliverGoods"> |
|
|
|
<i class="fa fa-plus"></i> 出货 |
|
|
|
</a> |
|
|
|
<a class="btn btn-success" onclick="makeInvoice()" shiro:hasPermission="system:salesOrder:makeInvoice"> |
|
|
|
<i class="fa fa-plus"></i> 开票 |
|
|
|
</a> |
|
|
|
|
|
|
|
</div> |
|
|
|
<div class="col-sm-12 select-table table-striped"> |
|
|
|
<table id="bootstrap-table"></table> |
|
|
@ -408,11 +412,6 @@ |
|
|
|
// 进度查看 |
|
|
|
actions.push('<a href="javascript:void(0)" onclick="showProcessImgDialog(\'' + row.instanceId + '\')"><i class="fa fa-image"></i> 进度查看</a> '); |
|
|
|
} |
|
|
|
|
|
|
|
// 生产状态部分完成/全部完成 |
|
|
|
if (row.makeStatus == "5" || row.makeStatus == "6"){ |
|
|
|
actions.push('<a class=" ' + salesDeliverGoodsFlag + '" href="javascript:void(0)" onclick="salesDeliverGoods(\'' + row.salesOrderId + '\')"><i class="fa fa-edit"></i>出货</a> '); |
|
|
|
} |
|
|
|
if (row.closeStatus == 3){ |
|
|
|
actions.push('<a class=" ' + startAftersalesFlag + '" href="javascript:void(0)" onclick="startAftersales(\'' + row.salesOrderId + '\')"><i class="fa fa-edit"></i>售后</a> '); |
|
|
|
} |
|
|
@ -581,11 +580,6 @@ |
|
|
|
window.location.href =prefix + "/downloadFile?filepath="+ filepath; |
|
|
|
} |
|
|
|
|
|
|
|
//出货 |
|
|
|
function salesDeliverGoods(salesOrderId){ |
|
|
|
var url = prefix + "/salesDeliverGoods/" + salesOrderId; |
|
|
|
$.modal.open("出货",url); |
|
|
|
} |
|
|
|
|
|
|
|
//售后 |
|
|
|
function startAftersales(salesOrderId){ |
|
|
@ -593,6 +587,79 @@ |
|
|
|
$.modal.open("售后",url); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//出货 |
|
|
|
function salesDeliverGoods() { |
|
|
|
// 获取选中的行 |
|
|
|
const selectedRows = $("#bootstrap-table").bootstrapTable('getSelections'); |
|
|
|
|
|
|
|
// 定义状态码常量 |
|
|
|
const AUDIT_STATUS_APPROVED = "1";//审核通过 |
|
|
|
const DELETE_FLAG = "2"; //作废 |
|
|
|
// const ALL_SHIPPING = "6"; //全部出货 |
|
|
|
// const PART_CHECK = "7"; //部分验收 |
|
|
|
// const ALL_CHECK = "8";//全部验收 |
|
|
|
// const HAS_CLOSE= "3";//已结案 |
|
|
|
|
|
|
|
var enterpriseCode; //客户id |
|
|
|
|
|
|
|
let valid = true;//自定义验证状态 |
|
|
|
let validSalesOrderIds = []; // 存储有效的销售订单ID |
|
|
|
//检查是否有选中行 |
|
|
|
if (selectedRows.length < 1){ |
|
|
|
showWarning("请先选择一条销售订单"); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
//检查选中的订单是否同属于一个客户并且状态是否符合要求 |
|
|
|
selectedRows.forEach((row,index) =>{ |
|
|
|
if (index === 0){ |
|
|
|
enterpriseCode = row.enterpriseCode; |
|
|
|
}else if (row.enterpriseCode !== enterpriseCode){ |
|
|
|
showWarning("请先选择同一客户下的销售订单"); |
|
|
|
valid = false; |
|
|
|
return; |
|
|
|
} |
|
|
|
//检查是否作废 |
|
|
|
if (row.useStatus === DELETE_FLAG) { |
|
|
|
showWarning("该订单已作废"); |
|
|
|
valid = false; |
|
|
|
return; |
|
|
|
} |
|
|
|
//检查是否已审核 |
|
|
|
if (row.auditStatus !== AUDIT_STATUS_APPROVED){ |
|
|
|
showWarning("存在未审核的订单,请先审核"); |
|
|
|
valid = false; |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
// //检查出货状态 |
|
|
|
// if ([ALL_SHIPPING,PART_CHECK,ALL_CHECK,HAS_CLOSE].includes(row.deliveryStatus)){ |
|
|
|
// showWarning("存在已出货的订单,请先取消出货"); |
|
|
|
// valid = false; |
|
|
|
// return; |
|
|
|
// } |
|
|
|
// //检查结案状态 |
|
|
|
// if (row.closeStatus === HAS_CLOSE) { |
|
|
|
// showWarning("存在已结案的订单"); |
|
|
|
// valid = false; |
|
|
|
// return; |
|
|
|
// } |
|
|
|
// 如果所有条件都满足,将销售订单ID添加到有效列表中 |
|
|
|
validSalesOrderIds.push(row.salesOrderId); |
|
|
|
}); |
|
|
|
|
|
|
|
//如果所有验证都通过,可以出货 |
|
|
|
if (valid && validSalesOrderIds.length > 0) { |
|
|
|
var url = prefix + "/salesDeliverGoods?salesOrderIds=" + validSalesOrderIds.join(","); |
|
|
|
$.modal.open("出货", url); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//开票 |
|
|
|
function makeInvoice() { |
|
|
|
// 获取选中的行 |
|
|
|