Browse Source

[feat]售后管理

修改售后第一次维护设备出库前端页面:设置设备SN号不能为空的校验
按照万材需求:新增设备第二次维护设备出库前端页面
售后维护设备出库前端页面:新增售后维护设备2按钮和前端接口
添加出货设备时新增出货设备列表后端实体类:所有Date时间相关的数据都加上@JsonFormat(pattern = "yyyy-MM-dd")注解
售后维护设备出库Controller层新增:售后第二次维护设备打开前端接口、修改保存售后第二次维护设备接口;
修改售后第一次维护设备出库后端方法,所有处理表的操作都加上修改时间和修改人
新增 修改保存售后第二次维护设备出库后端方法:实现维护设备的时间和同时更新 销售出库表、出库单、售后维护设备出库表的出库状态为待出库
dev
liuxiaoxu 2 weeks ago
parent
commit
2988017af3
  1. 25
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/controller/AftersalesOutOrderController.java
  2. 5
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/vo/SelectShippingDeviceVO.java
  3. 7
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAftersalesOutOrderService.java
  4. 116
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesOutOrderServiceImpl.java
  5. 8
      ruoyi-admin/src/main/resources/templates/aftersales/aftersalesOutOrder/aftersalesOutOrder.html
  6. 2
      ruoyi-admin/src/main/resources/templates/aftersales/aftersalesOutOrder/maintenanceEquipmentOne.html
  7. 486
      ruoyi-admin/src/main/resources/templates/aftersales/aftersalesOutOrder/maintenanceEquipmentTwo.html

25
ruoyi-admin/src/main/java/com/ruoyi/aftersales/controller/AftersalesOutOrderController.java

@ -359,4 +359,29 @@ public String addShippingDevicesOne(@RequestParam("outOrderDetailId") Long outOr
/**
* 售后第二次维护设备
*/
@GetMapping("/maintenanceEquipmentTwo/{outOrderId}")
public String maintenanceEquipmentTwo(@PathVariable("outOrderId") Long outOrderId, ModelMap mmap)
{
AftersalesOutOrder aftersalesOutOrder = aftersalesOutOrderService.selectAftersalesOutOrderById(outOrderId);
mmap.put("aftersalesOutOrder", aftersalesOutOrder);
return prefix + "/maintenanceEquipmentTwo";
}
/**
* 修改保存售后第二次维护设备
*/
@RequiresPermissions("aftersales:aftersalesOutOrder:maintenanceEquipmentTwo")
@Log(title = "售后维护设备出库", businessType = BusinessType.UPDATE)
@PostMapping("/maintenanceEquipmentTwo")
@ResponseBody
public AjaxResult maintenanceEquipmentTwoSave(@RequestBody AftersalesOutOrder aftersalesOutOrder)
{
return toAjax(aftersalesOutOrderService.updateMaintenanceEquipmentTwo(aftersalesOutOrder));
}
} }

5
ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/vo/SelectShippingDeviceVO.java

@ -26,24 +26,29 @@ public class SelectShippingDeviceVO {
private String snCode; private String snCode;
/** 出厂日期 */ /** 出厂日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
private Date factoryDate; private Date factoryDate;
/** 保修期 */ /** 保修期 */
private String guaranteePeriod; private String guaranteePeriod;
/** 锁机时间 */ /** 锁机时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
private Date lockDate; private Date lockDate;
/** 是否有锁机时间 */ /** 是否有锁机时间 */
private String lockDateFlag; private String lockDateFlag;
/** 损耗品到期时间 */ /** 损耗品到期时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
private Date wastageExpireDate; private Date wastageExpireDate;
/** 二次维修后部件质保时间 */ /** 二次维修后部件质保时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
private Date componentGuaranteeDate; private Date componentGuaranteeDate;
/** 是否添加出货设备(0代表是 1代表否)*/ /** 是否添加出货设备(0代表是 1代表否)*/
private String addShippingDeviceFlag; private String addShippingDeviceFlag;
} }

7
ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAftersalesOutOrderService.java

@ -121,4 +121,11 @@ public interface IAftersalesOutOrderService
* 逻辑删除出货设备也就是取消关联 * 逻辑删除出货设备也就是取消关联
* */ * */
int deleteAftersalesShippingDeviceById(String shippingDeviceId); int deleteAftersalesShippingDeviceById(String shippingDeviceId);
/**
* 修改保存售后第二次维护设备出库
* @param aftersalesOutOrder
* @return
*/
int updateMaintenanceEquipmentTwo(AftersalesOutOrder aftersalesOutOrder);
} }

116
ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesOutOrderServiceImpl.java

@ -162,7 +162,7 @@ public class AftersalesOutOrderServiceImpl implements IAftersalesOutOrderService
public int updateMaintenanceEquipmentOne(AftersalesOutOrder aftersalesOutOrder) { public int updateMaintenanceEquipmentOne(AftersalesOutOrder aftersalesOutOrder) {
String outOrderCode = aftersalesOutOrder.getOutOrderCode(); String outOrderCode = aftersalesOutOrder.getOutOrderCode();
String loginName = ShiroUtils.getLoginName();
// 定义一个StringBuilder来收集所有缺少SN号的设备ID // 定义一个StringBuilder来收集所有缺少SN号的设备ID
StringBuilder missingSnIds = new StringBuilder(); StringBuilder missingSnIds = new StringBuilder();
//物料信息主表的数据 //物料信息主表的数据
@ -204,7 +204,8 @@ public class AftersalesOutOrderServiceImpl implements IAftersalesOutOrderService
AfterSalesShippingDevice tempShippingDevice = new AfterSalesShippingDevice(); AfterSalesShippingDevice tempShippingDevice = new AfterSalesShippingDevice();
tempShippingDevice.setShippingDeviceId(shippingDeviceId); tempShippingDevice.setShippingDeviceId(shippingDeviceId);
tempShippingDevice.setSnCode(selectShippingDeviceVO.getSnCode()); tempShippingDevice.setSnCode(selectShippingDeviceVO.getSnCode());
tempShippingDevice.setUpdateBy(loginName);
tempShippingDevice.setUpdateTime(new Date());
int updateShippingDeviceResult = afterSalesShippingDeviceMapper.updateAfterSalesShippingDevice(tempShippingDevice); int updateShippingDeviceResult = afterSalesShippingDeviceMapper.updateAfterSalesShippingDevice(tempShippingDevice);
if (updateShippingDeviceResult <= 0){ if (updateShippingDeviceResult <= 0){
throw new BusinessException("更新设备数据失败"); throw new BusinessException("更新设备数据失败");
@ -217,6 +218,8 @@ public class AftersalesOutOrderServiceImpl implements IAftersalesOutOrderService
//更改状态未待确认发货 //更改状态未待确认发货
warehouseOutOrder.setOutOrderCode(outOrderCode); warehouseOutOrder.setOutOrderCode(outOrderCode);
warehouseOutOrder.setWarehouseOutStatus("2"); warehouseOutOrder.setWarehouseOutStatus("2");
warehouseOutOrder.setUpdateBy(loginName);
warehouseOutOrder.setUpdateTime(new Date());
int updateWarehouseResult = warehouseOutOrderMapper.updateWarehouseOutOrderByCode(warehouseOutOrder); int updateWarehouseResult = warehouseOutOrderMapper.updateWarehouseOutOrderByCode(warehouseOutOrder);
if (updateWarehouseResult <= 0){ if (updateWarehouseResult <= 0){
throw new BusinessException("更新销售售后通知单数据失败"); throw new BusinessException("更新销售售后通知单数据失败");
@ -226,6 +229,8 @@ public class AftersalesOutOrderServiceImpl implements IAftersalesOutOrderService
SysSalesShippingInform sysSalesShippingInform = new SysSalesShippingInform(); SysSalesShippingInform sysSalesShippingInform = new SysSalesShippingInform();
sysSalesShippingInform.setOutOrderCode(outOrderCode); sysSalesShippingInform.setOutOrderCode(outOrderCode);
sysSalesShippingInform.setWarehouseOutStatus("2"); sysSalesShippingInform.setWarehouseOutStatus("2");
sysSalesShippingInform.setUpdateBy(loginName);
sysSalesShippingInform.setUpdateTime(new Date());
int updateShippingInformResult = shippingInformMapper.updateSysSalesShippingInformByOutOrderCode(sysSalesShippingInform); int updateShippingInformResult = shippingInformMapper.updateSysSalesShippingInformByOutOrderCode(sysSalesShippingInform);
if (updateShippingInformResult <= 0){ if (updateShippingInformResult <= 0){
throw new BusinessException("更新销售出货通知单数据失败"); throw new BusinessException("更新销售出货通知单数据失败");
@ -234,6 +239,8 @@ public class AftersalesOutOrderServiceImpl implements IAftersalesOutOrderService
//更新售后维护设备出库单 //更新售后维护设备出库单
aftersalesOutOrder.setWarehouseOutStatus("2"); aftersalesOutOrder.setWarehouseOutStatus("2");
aftersalesOutOrder.setUpdateBy(loginName);
aftersalesOutOrder.setUpdateTime(new Date());
int result = aftersalesOutOrderMapper.updateAftersalesOutOrder(aftersalesOutOrder); int result = aftersalesOutOrderMapper.updateAftersalesOutOrder(aftersalesOutOrder);
return result; return result;
@ -412,4 +419,109 @@ public class AftersalesOutOrderServiceImpl implements IAftersalesOutOrderService
int updateAfterSalesShippingDevice = afterSalesShippingDeviceMapper.updateAfterSalesShippingDevice(tempShippingDevice); int updateAfterSalesShippingDevice = afterSalesShippingDeviceMapper.updateAfterSalesShippingDevice(tempShippingDevice);
return updateAfterSalesShippingDevice; return updateAfterSalesShippingDevice;
} }
/**
* 修改保存售后第二次维护设备出库
* @param aftersalesOutOrder
* @return
*/
@Transactional(rollbackFor = Exception.class)
@Override
public int updateMaintenanceEquipmentTwo(AftersalesOutOrder aftersalesOutOrder) {
String outOrderCode = aftersalesOutOrder.getOutOrderCode();
String loginName = ShiroUtils.getLoginName();
//物料信息主表的数据
List<AftersalesOutOrderDetail> needShippingDeviceMaterialsOne = this.getNeedShippingDeviceMaterialsOne(aftersalesOutOrder);
if (!CollectionUtils.isEmpty(needShippingDeviceMaterialsOne)){
List<SelectShippingDeviceVO> selectShippingDeviceVOList = aftersalesOutOrder.getSelectShippingDeviceVOList();
if (CollectionUtils.isEmpty(selectShippingDeviceVOList)){
throw new BusinessException("请展开物料详情并维护要出货的设备");
}
boolean anyNullFactoryDate = selectShippingDeviceVOList.stream().anyMatch(item -> item.getFactoryDate() == null);
if (anyNullFactoryDate){
throw new BusinessException("请展开物料详情并填写每个设备的出库日期");
}
boolean anyNullGuaranteePeriod = selectShippingDeviceVOList.stream().anyMatch(item -> item.getGuaranteePeriod() == null);
if (anyNullGuaranteePeriod){
throw new BusinessException("请展开物料详情并填写每个设备的保修期");
}
boolean anyNullLockDateFlag = selectShippingDeviceVOList.stream().anyMatch(item -> item.getLockDateFlag() == null);
if (anyNullLockDateFlag){
throw new BusinessException("请展开物料详情并填写每个设备的是否有锁机时间");
}
boolean anyNullWastageExpireDate = selectShippingDeviceVOList.stream().anyMatch(item -> item.getWastageExpireDate() == null);
if (anyNullWastageExpireDate){
throw new BusinessException("请展开物料详情并填写每个设备的是否有损耗品到期时间");
}
boolean anyNullComponentGuaranteeDate = selectShippingDeviceVOList.stream().anyMatch(item -> item.getComponentGuaranteeDate() == null);
if (anyNullComponentGuaranteeDate){
throw new BusinessException("请展开物料详情并填写每个设备的是否有二次维护部件质保时间");
}
/* 缺少校验规则后续补充
* 2.1已选出货设备是否可用(状态:可用即未被其他出库单添加或报损)若不可用则弹窗提示CHSB20240808004CHSB20240808005.不可用请重新添加
* */
for (SelectShippingDeviceVO selectShippingDeviceVO : selectShippingDeviceVOList) {
String shippingDeviceId = selectShippingDeviceVO.getShippingDeviceId();
AfterSalesShippingDevice tempShippingDevice = new AfterSalesShippingDevice();
tempShippingDevice.setShippingDeviceId(shippingDeviceId);
tempShippingDevice.setSnCode(selectShippingDeviceVO.getSnCode());
tempShippingDevice.setFactoryDate(selectShippingDeviceVO.getFactoryDate());
tempShippingDevice.setGuaranteePeriod(selectShippingDeviceVO.getGuaranteePeriod());
tempShippingDevice.setLockDateFlag(selectShippingDeviceVO.getLockDateFlag());
if ("0".equals(selectShippingDeviceVO.getLockDateFlag())){
tempShippingDevice.setLockDate(selectShippingDeviceVO.getLockDate());
}
tempShippingDevice.setWastageExpireDate(selectShippingDeviceVO.getWastageExpireDate());
tempShippingDevice.setComponentGuaranteeDate(selectShippingDeviceVO.getComponentGuaranteeDate());
tempShippingDevice.setUpdateBy(loginName);
tempShippingDevice.setUpdateTime(new Date());
int updateShippingDeviceResult = afterSalesShippingDeviceMapper.updateAfterSalesShippingDevice(tempShippingDevice);
if (updateShippingDeviceResult <= 0){
throw new BusinessException("更新设备数据失败");
}
}
}
//更新出库单
WarehouseOutOrder warehouseOutOrder = new WarehouseOutOrder();
//更改状态未待确认发货
warehouseOutOrder.setOutOrderCode(outOrderCode);
warehouseOutOrder.setWarehouseOutStatus("4");//为待出库
warehouseOutOrder.setUpdateBy(loginName);
warehouseOutOrder.setUpdateTime(new Date());
int updateWarehouseResult = warehouseOutOrderMapper.updateWarehouseOutOrderByCode(warehouseOutOrder);
if (updateWarehouseResult <= 0){
throw new BusinessException("更新销售售后通知单数据失败");
}
//更新销售出货通知单
SysSalesShippingInform sysSalesShippingInform = new SysSalesShippingInform();
sysSalesShippingInform.setOutOrderCode(outOrderCode);
sysSalesShippingInform.setWarehouseOutStatus("4");//为待出库
sysSalesShippingInform.setUpdateTime(new Date());
sysSalesShippingInform.setUpdateBy(loginName);
int updateShippingInformResult = shippingInformMapper.updateSysSalesShippingInformByOutOrderCode(sysSalesShippingInform);
if (updateShippingInformResult <= 0){
throw new BusinessException("更新销售出货通知单数据失败");
}
//更新售后维护设备出库单 为待出库
aftersalesOutOrder.setWarehouseOutStatus("4");
aftersalesOutOrder.setUpdateBy(loginName);
aftersalesOutOrder.setUpdateTime(new Date());
int result = aftersalesOutOrderMapper.updateAftersalesOutOrder(aftersalesOutOrder);
return result;
}
} }

8
ruoyi-admin/src/main/resources/templates/aftersales/aftersalesOutOrder/aftersalesOutOrder.html

@ -219,6 +219,14 @@
$.modal.open("售后第一次维护设备",url); $.modal.open("售后第一次维护设备",url);
} }
/*售后第二次维护设备*/
function maintenanceEquipmentTwo(outOrderId) {
var url = ctx + 'aftersales/aftersalesOutOrder/maintenanceEquipmentTwo/'+outOrderId;
$.modal.open("售后第二次维护设备",url);
}
</script> </script>
</body> </body>
</html> </html>

2
ruoyi-admin/src/main/resources/templates/aftersales/aftersalesOutOrder/maintenanceEquipmentOne.html

@ -294,7 +294,7 @@
editable: { editable: {
validate: function(value) { validate: function(value) {
if ($.trim(value) === '') { if ($.trim(value) === '') {
return '本次收货数不能为空'; return '设备SN号不能为空';
} }
}, },
}, },

486
ruoyi-admin/src/main/resources/templates/aftersales/aftersalesOutOrder/maintenanceEquipmentTwo.html

@ -0,0 +1,486 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('售后维护设备2')" />
<th:block th:include="include :: datetimepicker-css" />
<th:block th:include="include :: bootstrap-editable-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-maintenanceEquipmentTwo-edit" th:object="${aftersalesOutOrder}">
<input name="outOrderId" th:field="*{outOrderId}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">出库单号:</label>
<div class="col-sm-8">
<input name="outOrderCode" th:field="*{outOrderCode}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">出库对象:</label>
<div class="col-sm-8">
<input name="outOrderName" th:field="*{outOrderName}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">销售单号:</label>
<div class="col-sm-8">
<input name="salesOrderCode" th:field="*{salesOrderCode}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">申请人员:</label>
<div class="col-sm-8">
<input name="applyName" th:field="*{applyName}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">生产单号:</label>
<div class="col-sm-8">
<input name="makeNo" th:field="*{makeNo}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">客户ID:</label>
<div class="col-sm-8">
<input name="customerId" th:field="*{customerId}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">客户名称:</label>
<div class="col-sm-8">
<input name="customerName" th:field="*{customerName}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">收货联系人:</label>
<div class="col-sm-8">
<input name="deliveryName" th:field="*{deliveryName}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">收货电话:</label>
<div class="col-sm-8">
<input name="deliveryNumber" th:field="*{deliveryNumber}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">收货地址:</label>
<div class="col-sm-8">
<input name="deliveryAddress" th:field="*{deliveryAddress}" class="form-control" type="text">
</div>
</div>
<div class="container">
<div class="row">
<h4 class="font-weight-bold">需要维护出货设备信息</h4>
</div>
<div class="row">
<div class="col-sm-12 select-table table-striped">
<table id="needShippingDevice-table"></table>
</div>
</div>
</div>
<div class="container">
<div class="row">
<h4 class="font-weight-bold">无需维护出货设备信息</h4>
</div>
<div class="row">
<div class="col-sm-12 select-table table-striped">
<table id="noShippingDevice-table"></table>
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<!--用于可以修改列表字段的插件-->
<th:block th:include="include :: bootstrap-table-editable-js" />
<script th:inline="javascript">
var addFlag = [[${@permission.hasPermi('aftersales:aftersalesOutOrder:addShippingDevices')}]];
var prefix = ctx + "aftersales/aftersalesOutOrder";
var aftersalesOutOrder = [[${aftersalesOutOrder}]];
$("#form-maintenanceEquipmentTwo-edit").validate({
focusCleanup: true
});
// function submitHandler() {
// if ($.validate.form()) {
// $.operate.save(prefix + "/maintenanceEquipmentTwo", $('#form-maintenanceEquipmentTwo-edit').serialize());
// }
// }
function submitHandler() {
// 获取表单数据
const shippingDevicesData = $("#form-maintenanceEquipmentTwo-edit").serializeArray().reduce((obj, item) => {
obj[item.name] = item.value;
return obj;
}, {});
// 在需要收集所有子表数据的地方调用此函数
var allSubData = getAllSubTablesData();
// 将表数据转换成与complaintNoticeData格式一致的数组
var equipDetailDataList = allSubData.map(function(item) {
// 根据实际字段名调整
return {
"shippingDeviceId": item.shippingDeviceId,
"deviceModelCode": item.deviceModelCode,
"deviceRunningNumber": item.deviceRunningNumber,
"snCode": item.snCode,
"factoryDate": item.factoryDate,
"guaranteePeriod": item.guaranteePeriod,
"lockDateFlag": item.lockDateFlag,
"lockDate": item.lockDate,
"wastageExpireDate": item.wastageExpireDate,
"componentGuaranteeDate": item.componentGuaranteeDate
// ...其他字段
};
});
// 合并表单数据和表格数据
const combinedData = Object.assign({}, shippingDevicesData, { selectShippingDeviceVOList: equipDetailDataList });
console.log(combinedData)
// 使用 JSON.stringify() 序列化数据
const jsonData = JSON.stringify(combinedData);
// 发送 AJAX 请求到后端接口
$.operate.saveJson(prefix + "/maintenanceEquipmentTwo", jsonData);
}
$("input[name='outOrderTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("input[name='planDeliveryTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
//需要维护出货物料信息
$(function() {
var options = {
id:'needShippingDevice-table',
url: prefix + "/getNeedShippingDeviceMaterialsOne",
modalName: "物料信息",
showColumns: false,
pagination: false,
showToggle: false,
showRefresh:false,
showSearch:false,
queryParams:queryParams,
detailView: true,
onExpandRow : function(index, row, $detail) {
initChildTable(index, row, $detail);
},
columns: [{
checkbox: true
},
{ title:'销售订单号',
field:'quoteId',
visible: false
},
{
title:'出库单详情Id',
field:'outOrderDetailId',
visible: false
},
{
title: '料号',
field: 'materialNo',
},
{
title: '图片',
field: 'photoUrl',
},
{
title: '物料名称',
field: 'materialName',
},
{
title: '物料类型',
field: 'materialType',
},
{
title: '单位',
field: 'materialUnit',
},
{
title: '型号',
field: 'materialModel',
},
{
title: '品牌',
field: 'brand',
},
{
title: '描述',
field: 'describe',
},
{
title: '订单数量',
field: 'makeNum',
},
{
title: '已出库数',
field: 'hasOutOrderSum',
},
{
title: '申请出库数',
field: 'applyOutOrderSum',
},
{
title: '准备出库数',
field: 'prepareOutOrderSum',
},
]
};
$.table.init(options);
})
initChildTable = function(index, row, $detail) {
var parentRow = row;
var childTableId = 'child_table_'+index;
$detail.html('<table id="'+childTableId+'"></table>');
$('#'+childTableId).bootstrapTable({
url: prefix + "/showAddShippingDevicesOne",
method: 'post',
sidePagination: "server",
contentType: "application/x-www-form-urlencoded",
queryParams : {
outOrderCode: aftersalesOutOrder.outOrderCode,
materialNo: parentRow.materialNo,
// salesOrderCode:aftersalesOutOrder.salesOrderCode,
// makeNo:aftersalesOutOrder.makeNo
},
columns: [
{
title: '出货设备ID',
field: 'shippingDeviceId',
},
{
title: '设备型号',
field: 'deviceModelCode',
},
{
title: '追踪码',
field: 'deviceRunningNumber',
},
{
title: '设备SN号',
field: 'snCode',
},
{
title: '出库日期',
field: 'factoryDate',
align: 'center',
editable:{
type:'date',
title: '出库日期',
clear: false,//隐藏clear按钮
placement: 'center',//居中显示
}
},
{
title: '保修期',
field: 'guaranteePeriod',
align: 'center',
editable: {
type: 'text',
title: '保修期',
placement: 'center',//居中显示
},
formatter: function (value, row) {
// 检查 guaranteePeriod 是否存在
if (row.guaranteePeriod === undefined || row.guaranteePeriod === null) {
return "";
}
// 根据 guaranteePeriod 的值决定返回值
if (row.guaranteePeriod) {
return row.guaranteePeriod;
} else {
return value;
}
}
},
{
title: '是否有锁机时间',
field: 'lockDateFlag',
align: 'center',
editable: {
type: 'select',
title: '是否有锁机时间',
source:[{value:"0",text:"是"},{value:"1",text:"否"}]
}
},
{
title: '锁机时间',
field: 'lockDate',
align: 'center',
editable:{
type:'date',
title: '锁机时间',
clear: false,//隐藏clear按钮
placement: 'center',//居中显示
}
},
{
title: '损耗品到期时间',
field: 'wastageExpireDate',
align: 'center',
editable:{
type:'date',
title: '损耗品到期时间',
clear: false,//隐藏clear按钮
placement: 'center',//居中显示
}
},
{
title: '二次维修后部件质保时间',
field: 'componentGuaranteeDate',
align: 'center',
editable:{
type:'date',
title: '二次维修后部件质保时间',
clear: false,//隐藏clear按钮
placement: 'center',//居中显示
}
},
],
});
};
function queryParams(params) {
var curParams = {
// 传递参数查询参数
outOrderCode: aftersalesOutOrder.outOrderCode
};
return curParams;
}
//不需要维护出货物料信息
$(function() {
var options = {
id:'noShippingDevice-table',
url: prefix + "/getNoShippingDeviceMaterialsOne",
modalName: "物料信息",
showColumns: false,
pagination: false,
showToggle: false,
showRefresh:false,
showSearch:false,
queryParams:queryParams,
columns: [
{ title:'销售订单号',
field:'quoteId',
visible: false
},
{
title:'出库单详情Id',
field:'outOrderDetailId',
visible: false
},
{
title: '料号',
field: 'materialNo',
},
{
title: '图片',
field: 'photoUrl',
},
{
title: '物料名称',
field: 'materialName',
},
{
title: '物料类型',
field: 'materialType',
},
{
title: '单位',
field: 'materialUnit',
},
{
title: '型号',
field: 'materialModel',
},
{
title: '品牌',
field: 'brand',
},
{
title: '描述',
field: 'describe',
},
{
title: '订单数量',
field: 'makeNum',
},
{
title: '已出库数',
field: 'hasOutOrderSum',
},
{
title: '申请出库数',
field: 'applyOutOrderSum',
},
{
title: '准备出库数',
field: 'prepareOutOrderSum',
},
]
};
$.table.init(options);
})
// 获取所有子表数据的函数
function getAllSubTablesData() {
var allSubData = [];
var parentData = $("#needShippingDevice-table").bootstrapTable("getData");
var parentLength = parentData.length;
if (parentLength !== 0) {
for (let i = 0; i < parentLength; i++) {
var sonData = $("#" + "child_table_" + i).bootstrapTable("getData");
for (let j = 0; j < sonData.length; j++) {
var row = sonData[j];
if (row.lockDateFlag === '0' && !row.lockDate) {
$.modal.alertWarning(`第 ${i + 1} 行出货信息,第 ${j + 1} 子行的锁机时间未填写`);
return ;
}
}
allSubData = allSubData.concat(sonData);
}
}
return allSubData;
}
</script>
</body>
</html>
Loading…
Cancel
Save