Browse Source
# Conflicts: # ruoyi-admin/src/main/java/com/ruoyi/aftersales/controller/AftersalesWarehouseOutController.java # ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/vo/SelectShippingDeviceVO.java # ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAftersalesWarehouseOutService.java # ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesWarehouseOutServiceImpl.java # ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesShippingInformService.java # ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesShippingInformServiceImpl.java # ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/maintenanceEquipmentOne.htmldev
zhangsiqi
4 months ago
15 changed files with 810 additions and 28 deletions
@ -0,0 +1,405 @@ |
|||||
|
<!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="${warehouseOutOrder}"> |
||||
|
<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">送货日期:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<div class="input-group date"> |
||||
|
<input name="deliveryDate" th:value="${#dates.format(warehouseOutOrder.deliveryDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text"> |
||||
|
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> |
||||
|
</div> |
||||
|
</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="col-sm-12 select-table table-striped"> |
||||
|
<h3 class="mb-4">物料信息</h3> |
||||
|
<table id="bootstrap-table"></table> |
||||
|
</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:warehouseOutOrder:addShippingDevices')}]]; |
||||
|
|
||||
|
var prefix = ctx + "aftersales/warehouseOutOrder"; |
||||
|
var warehouseOutOrder = [[${warehouseOutOrder}]]; |
||||
|
|
||||
|
$("#form-maintenanceEquipmentTwo-edit").validate({ |
||||
|
focusCleanup: true |
||||
|
}); |
||||
|
|
||||
|
$("input[name='deliveryDate']").datetimepicker({ |
||||
|
format: "yyyy-mm-dd", |
||||
|
minView: "month", |
||||
|
autoclose: true |
||||
|
}); |
||||
|
|
||||
|
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, |
||||
|
"makePhotoUrl": item.makePhotoUrl, |
||||
|
"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:'bootstrap-table', |
||||
|
url: prefix + "/getMaintenanceEquipmentTwoMaterials", |
||||
|
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: '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 + "/showAftersalesShippingDeviceListTwo", |
||||
|
method: 'post', |
||||
|
sidePagination: "server", |
||||
|
contentType: "application/x-www-form-urlencoded", |
||||
|
queryParams : { |
||||
|
// salesOrderCode: warehouseOutOrder.salesOrderCode, |
||||
|
materialNo: parentRow.materialNo |
||||
|
}, |
||||
|
columns: [ |
||||
|
{ |
||||
|
title: '出货设备ID', |
||||
|
field: 'shippingDeviceId', |
||||
|
}, |
||||
|
{ |
||||
|
title: '设备型号', |
||||
|
field: 'deviceModelCode', |
||||
|
}, |
||||
|
{ |
||||
|
title: '流水号', |
||||
|
field: 'deviceRunningNumber', |
||||
|
}, |
||||
|
{ |
||||
|
title: '设备SN号', |
||||
|
field: 'snCode', |
||||
|
align: 'center', |
||||
|
editable:true |
||||
|
}, |
||||
|
{ |
||||
|
title: '出库日期', |
||||
|
field: 'factoryDate', |
||||
|
align: 'center', |
||||
|
editable:{ |
||||
|
type:'date', |
||||
|
title: '出库日期', |
||||
|
clear: false,//隐藏clear按钮 |
||||
|
placement: 'center',//居中显示 |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
title: '保修期', |
||||
|
field: 'guaranteePeriod', |
||||
|
align: 'center', |
||||
|
editable:true |
||||
|
}, |
||||
|
{ |
||||
|
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',//居中显示 |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
title: '操作', |
||||
|
align: 'center', |
||||
|
formatter: function (value, row, index) { |
||||
|
return '<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="deleteRow(\'' + row.shippingDeviceId + '\')"><i class="fa fa-remove"></i>删除</a>'; |
||||
|
} |
||||
|
} |
||||
|
], |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
|
||||
|
function queryParams(params) { |
||||
|
var curParams = { |
||||
|
// 传递参数查询参数 |
||||
|
outOrderCode: warehouseOutOrder.outOrderCode |
||||
|
}; |
||||
|
return curParams; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
// 获取所有子表数据的函数 |
||||
|
// 获取所有子表数据的函数 |
||||
|
function getAllSubTablesData() { |
||||
|
var allSubData = []; |
||||
|
// 获取所有被展开的行 |
||||
|
var parentLength = $("#bootstrap-table").bootstrapTable("getData").length; |
||||
|
for (let i = 0; i < parentLength; i++) { |
||||
|
var sonData = $('#'+"child_table_" + i).bootstrapTable("getData"); |
||||
|
//循环获取子表中存在的行数据,每个行数据转换添加到allSubData数组中 |
||||
|
allSubData = allSubData.concat(sonData); |
||||
|
} |
||||
|
return allSubData; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
function deleteRow(shippingDeviceId) { |
||||
|
// 弹出确认框询问用户是否确定删除 |
||||
|
if (confirm("确定要删除这条记录吗?")) { |
||||
|
// 发送删除请求到服务器 |
||||
|
$.ajax({ |
||||
|
url: prefix + "/deleteRow", // 请根据实际API路径调整 |
||||
|
type: 'POST', |
||||
|
data: { |
||||
|
shippingDeviceId: shippingDeviceId, // 传递需要删除的记录的ID |
||||
|
}, |
||||
|
success: function(result) { |
||||
|
if (result.success) { // 假设result是一个对象,包含success属性来表示操作是否成功 |
||||
|
// 删除操作成功,从表格中移除这一行 |
||||
|
$('#child_table_' + index).bootstrapTable('remove', { |
||||
|
field: 'shippingDeviceId', |
||||
|
values: [shippingDeviceId] |
||||
|
}); |
||||
|
toastr.success("删除成功!"); // 显示成功提示信息,这里使用toastr作为示例,确保已引入相关库 |
||||
|
} else { |
||||
|
toastr.error("删除失败: " + result.message); // 显示失败原因,同样确保已引入toastr库 |
||||
|
} |
||||
|
}, |
||||
|
error: function() { |
||||
|
toastr.error("发生错误,删除失败!"); // 网络错误或后端错误处理 |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
}; |
||||
|
|
||||
|
|
||||
|
|
||||
|
</script> |
||||
|
</body> |
||||
|
</html> |
@ -0,0 +1,35 @@ |
|||||
|
<!DOCTYPE html> |
||||
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
||||
|
<head> |
||||
|
<th:block th:include="include :: header('取消发货')" /> |
||||
|
<th:block th:include="include :: datetimepicker-css" /> |
||||
|
</head> |
||||
|
<body class="white-bg"> |
||||
|
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
||||
|
<form class="form-horizontal m" id="form-cancelShipping-add"> |
||||
|
<input name="outOrderCode" th:field="*{outOrderCode}" type="hidden"> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">备注:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<textarea name="remark" class="form-control"></textarea> |
||||
|
</div> |
||||
|
</div> |
||||
|
</form> |
||||
|
</div> |
||||
|
<th:block th:include="include :: footer" /> |
||||
|
<th:block th:include="include :: datetimepicker-js" /> |
||||
|
<script th:inline="javascript"> |
||||
|
var prefix = ctx + "system/salesShippingInform" |
||||
|
$("#form-cancelShipping-add").validate({ |
||||
|
focusCleanup: true |
||||
|
}); |
||||
|
|
||||
|
function submitHandler() { |
||||
|
if ($.validate.form()) { |
||||
|
$.operate.save(prefix + "/cancelShipping", $('#form-cancelShipping-add').serialize()); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
</body> |
||||
|
</html> |
@ -0,0 +1,49 @@ |
|||||
|
<!DOCTYPE html> |
||||
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
||||
|
<head> |
||||
|
<th:block th:include="include :: header('确认发货')" /> |
||||
|
<th:block th:include="include :: datetimepicker-css" /> |
||||
|
</head> |
||||
|
<body class="white-bg"> |
||||
|
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
||||
|
<form class="form-horizontal" id="form-confirmShipping-add" th:object="${sysSalesShippingInform}"> |
||||
|
<input name="outOrderCode" th:field="*{outOrderCode}" type="hidden"> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">送货日期:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<div class="input-group date"> |
||||
|
<input name="deliverTime" th:value="${#dates.format(sysSalesShippingInform.deliverTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text"> |
||||
|
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">备注:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<textarea name="remark" th:field="*{remark}" class="form-control"></textarea> |
||||
|
</div> |
||||
|
</div> |
||||
|
</form> |
||||
|
</div> |
||||
|
<th:block th:include="include :: footer" /> |
||||
|
<th:block th:include="include :: datetimepicker-js" /> |
||||
|
<script th:inline="javascript"> |
||||
|
var prefix = ctx + "system/salesShippingInform" |
||||
|
$("#form-confirmShipping-add").validate({ |
||||
|
focusCleanup: true |
||||
|
}); |
||||
|
|
||||
|
function submitHandler() { |
||||
|
if ($.validate.form()) { |
||||
|
$.operate.save(prefix + "/confirmShipping", $('#form-confirmShipping-add').serialize()); |
||||
|
} |
||||
|
} |
||||
|
$("input[name='deliverTime']").datetimepicker({ |
||||
|
format: "yyyy-mm-dd", |
||||
|
minView: "month", |
||||
|
autoclose: true |
||||
|
}); |
||||
|
</script> |
||||
|
</body> |
||||
|
</html> |
Loading…
Reference in new issue