Browse Source
新增销售发起售后选择设备Vo类 新增销售订单发起售后前端页面 新增销售订单发起售后物料选择前端页面 销售订单新增售后选择设备Vo类集合成员变量 修改根据销售订单查询销售子表数据集合后端接口 销售订单新增发起售后后端接口 销售订单新增发起售后加载销售单号有关的物料信息弹窗后端接口 销售发起售后通知新增修改保存发起售后后端接口 销售发起售后通知新增查找与销售订单号有关的物料信息后端接口 销售订单前端页面新增 出货和售后权限注解dev
liuxiaoxu
4 months ago
10 changed files with 585 additions and 8 deletions
@ -0,0 +1,88 @@ |
|||
package com.ruoyi.system.domain.Vo; |
|||
|
|||
import com.ruoyi.common.annotation.Excel; |
|||
import lombok.Data; |
|||
|
|||
@Data |
|||
/*销售发起售后选择设备*/ |
|||
public class SelectAftersalesNoticeVO { |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** 售后通知单详情ID */ |
|||
private Long aftersalesNoticeDetailId; |
|||
|
|||
/** 售后通知单号 */ |
|||
@Excel(name = "售后通知单号") |
|||
private String aftersalesNoticeCode; |
|||
|
|||
/** 关联生产订单号 */ |
|||
private String makeNo; |
|||
|
|||
/** 关联销售订单编号 */ |
|||
private String salesOrderCode; |
|||
|
|||
/** 用户ID */ |
|||
private Long userId; |
|||
|
|||
/** 紧急程度(0一般、1紧急) */ |
|||
@Excel(name = "紧急程度", readConverterExp = "0=一般、1紧急") |
|||
private String emergencyDegree; |
|||
|
|||
/** 售后问题 */ |
|||
@Excel(name = "售后问题") |
|||
private String aftersalesProblem; |
|||
|
|||
/** 报告问题 */ |
|||
@Excel(name = "报告问题") |
|||
private String aftersalesReportUrl; |
|||
|
|||
/** 客户ID */ |
|||
private String customerId; |
|||
|
|||
/** 客户名称 */ |
|||
private String customerName; |
|||
|
|||
/** SN号(产品序列号) */ |
|||
@Excel(name = "SN号", readConverterExp = "产=品序列号") |
|||
private String snCode; |
|||
|
|||
/** 设备流水号 */ |
|||
@Excel(name = "设备流水号") |
|||
private String deviceRunningNumber; |
|||
|
|||
/** 物料名称 */ |
|||
@Excel(name = "物料名称") |
|||
private String materialName; |
|||
|
|||
/** 物料类型 */ |
|||
@Excel(name = "物料类型") |
|||
private String materialType; |
|||
|
|||
/** 物料图片地址 */ |
|||
@Excel(name = "物料图片地址") |
|||
private String materialPhotourl; |
|||
|
|||
/** 料号 */ |
|||
@Excel(name = "料号") |
|||
private String materialNo; |
|||
|
|||
/** 物料品牌 */ |
|||
@Excel(name = "物料品牌") |
|||
private String materialBrand; |
|||
|
|||
/** 物料单位 */ |
|||
@Excel(name = "物料单位") |
|||
private String materialUnit; |
|||
|
|||
/** 物料描述 */ |
|||
@Excel(name = "物料描述") |
|||
private String materialDescribe; |
|||
|
|||
/** 物料加工方式 */ |
|||
@Excel(name = "物料加工方式") |
|||
private String materialProcessMethod; |
|||
|
|||
/** 已出库数量 */ |
|||
@Excel(name = "已出库数量") |
|||
private Integer shippedGoodsSum; |
|||
} |
@ -0,0 +1,283 @@ |
|||
<!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-startAftersales-edit" th:object="${sysSalesOrder}"> |
|||
<input name="salesOrderId" th:field="*{salesOrderId}" type="hidden"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">订单类型:</label> |
|||
<div class="col-sm-8"> |
|||
<select name="salesOrderType" class="form-control m-b" th:with="type=${@dict.getType('sys_order_type')}" disabled> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{salesOrderType}"></option> |
|||
</select> |
|||
</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" readonly> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">客户ID:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="enterpriseCode" th:field="*{enterpriseCode}" class="form-control" type="text" readonly> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">客户名称:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="enterpriseName" th:field="*{enterpriseName}" class="form-control" type="text" readonly> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">收货联系人:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="customerDelivery" th:field="*{customerDelivery}" class="form-control" type="text" disabled> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">收货电话:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="deliveryPhone" th:field="*{deliveryPhone}" class="form-control" type="text" disabled> |
|||
</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" disabled> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">备注:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="remark" th:field="*{remark}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
<!--物料信息--> |
|||
<div class="container"> |
|||
<div class="form-row"> |
|||
<div class="btn-group-sm" id="toolbar" role="group"> |
|||
<span>选择物料</span> |
|||
<a class="btn btn-success" onclick="insertRow()"> |
|||
<i class="fa fa-plus"></i> 选择物料 |
|||
</a> |
|||
</div> |
|||
</div> |
|||
<div class="row"> |
|||
<div class="col-sm-12 select-table table-striped"> |
|||
<table id="bootstrap-table"></table> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</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 sysSalesOrder = [[${sysSalesOrder}]]; |
|||
|
|||
var prefix = ctx + "sales/afterSalesNotice"; |
|||
$("#form-startAftersales-edit").validate({ |
|||
focusCleanup: true |
|||
}); |
|||
|
|||
// 新增提交 |
|||
function submitHandler() { |
|||
// 获取表单数据 |
|||
const salesOrderData = $("#form-startAftersales-edit").serializeArray().reduce((obj, item) => { |
|||
obj[item.name] = item.value; |
|||
return obj; |
|||
}, {}); |
|||
// 获取bootstrap-table的数据,这里假设你使用bootstrap-table的API获取所有数据 |
|||
var table = $('#bootstrap-table').bootstrapTable('getData'); |
|||
|
|||
// 将表数据转换成与complaintNoticeData格式一致的数组 |
|||
var materialDataList = table.map(function(item) { |
|||
// 根据实际字段名调整 |
|||
return { |
|||
materialNo:item.materialNo, |
|||
materialPhotourl:item.materialPhotourl, |
|||
materialName: item.materialName, |
|||
materialType: item.materialType, |
|||
materialDescribe: item.materialDescribe, |
|||
materialBrand: item.materialBrand, |
|||
materialUnit: item.materialUnit, |
|||
materialProcessMethod: item.materialProcessMethod, |
|||
shippedGoodsSum: item.shippedGoodsSum, |
|||
snCode:item.snCode, |
|||
aftersalesProblem:item.aftersalesProblem, |
|||
emergencyDegree:item.emergencyDegree, |
|||
aftersalesReportUrl:item.aftersalesReportUrl, |
|||
// ...其他字段 |
|||
}; |
|||
}); |
|||
|
|||
const combinedData = Object.assign({}, salesOrderData, { |
|||
selectAftersalesNoticeVOList: materialDataList, |
|||
}); |
|||
// 合并表单数据和表格数据 |
|||
console.log(combinedData) |
|||
// 使用 JSON.stringify() 序列化数据 |
|||
const jsonData = JSON.stringify(combinedData); |
|||
// 发送 AJAX 请求到后端接口 |
|||
$.operate.saveJson(prefix + "/startAftersales", jsonData); |
|||
} |
|||
|
|||
|
|||
|
|||
/*选择物料按钮*/ |
|||
function insertRow() { |
|||
var selectedSalesOrderCode = $("#salesOrderCode").val(); |
|||
var encodedSalesOrderCode = encodeURIComponent(selectedSalesOrderCode); |
|||
var url = ctx + 'system/salesOrder/startAftersalesMaterialSelect?salesOrderCode=' + encodedSalesOrderCode; |
|||
var options = { |
|||
title: '选择物料', |
|||
url: url, |
|||
callBack: doSubmit |
|||
}; |
|||
$.modal.openOptions(options); |
|||
} |
|||
|
|||
|
|||
function doSubmit(index, layero,uniqueId){ |
|||
console.log(uniqueId); |
|||
var iframeWin = window[layero.find('iframe')[0]['name']]; |
|||
var rowData = iframeWin.$('#bootstrap-startAftersalesMaterialSelect-table').bootstrapTable('getSelections')[0]; |
|||
|
|||
//判断是否重复 |
|||
var rows = $("#bootstrap-table").bootstrapTable('getData').length; |
|||
for(var i=0;i<rows;i++){ |
|||
var data = $("#bootstrap-table").bootstrapTable('getData')[i]; |
|||
if(data.materialNo==rowData.materialNo){ |
|||
$.modal.alertError("不能选择已添加过的相同料号"); |
|||
return; |
|||
} |
|||
} |
|||
|
|||
console.log("rowData: "+rowData); |
|||
$("#bootstrap-table").bootstrapTable('insertRow', { |
|||
index:1, |
|||
row: { |
|||
materialNo:rowData.materialNo, |
|||
materialPhotourl:rowData.materialPhotourl, |
|||
materialName: rowData.materialName, |
|||
materialType: rowData.materialType, |
|||
materialDescribe: rowData.materialDescribe, |
|||
materialBrand: rowData.materialBrand, |
|||
materialUnit: rowData.materialUnit, |
|||
materialProcessMethod: rowData.materialProcessMethod, |
|||
shippedGoodsSum: rowData.shippedGoodsSum, |
|||
snCode:"", |
|||
aftersalesProblem:"", |
|||
emergencyDegree:"", |
|||
aftersalesReportUrl:"", |
|||
} |
|||
}) |
|||
layer.close(index); |
|||
} |
|||
|
|||
|
|||
|
|||
//物料信息展示列表 |
|||
$(function() { |
|||
var options = { |
|||
modalName: "选择物料", |
|||
queryParams: queryParams, |
|||
showSearch: false, |
|||
showRefresh: false, |
|||
showToggle: false, |
|||
showColumns: false, |
|||
pagination: false, // 设置不分页 |
|||
columns: [{ |
|||
checkbox: true |
|||
}, |
|||
{ |
|||
title: '料号', |
|||
field: 'materialNo', |
|||
}, |
|||
{ |
|||
title: '图片', |
|||
field: 'materialPhotourl', |
|||
}, |
|||
{ |
|||
title: '物料名称', |
|||
field: 'materialName', |
|||
}, |
|||
{ |
|||
title: '物料类型', |
|||
field: 'materialType', |
|||
}, |
|||
{ |
|||
title: '单位', |
|||
field: 'materialUnit', |
|||
}, |
|||
{ |
|||
title: '品牌', |
|||
field: 'materialBrand', |
|||
}, |
|||
{ |
|||
title: '描述', |
|||
field: 'materialDescribe', |
|||
}, |
|||
{ |
|||
title: '已出库数量', |
|||
field: 'shippedGoodsSum', |
|||
}, |
|||
{ |
|||
title: '设备SN', |
|||
field: 'snCode', |
|||
editable: { |
|||
type: 'text', // 表示该列可以被编辑为文本 |
|||
}, |
|||
}, |
|||
{ |
|||
title: '售后问题', |
|||
field: 'aftersalesProblem', |
|||
editable: { |
|||
type: 'text', |
|||
}, |
|||
}, |
|||
{ |
|||
title: '紧急程度', |
|||
field: 'emergencyDegree', |
|||
editable: { |
|||
type: 'select', |
|||
title: '紧急程度', |
|||
source:[{value:"0",text:"一般"},{value:"1",text:"紧急"}] |
|||
}, |
|||
}, |
|||
|
|||
|
|||
{ |
|||
title: '操作', |
|||
align: 'center', |
|||
formatter: function(value, row, index) { |
|||
var actions = []; |
|||
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="removeRow(\'' + row.materialNo + '\')"><i class="fa fa-remove"></i>删除</a> '); |
|||
return actions.join(''); |
|||
} |
|||
} |
|||
] |
|||
}; |
|||
$.table.init(options); |
|||
}) |
|||
|
|||
function queryParams(params) { |
|||
var curParams = { |
|||
// 传递参数查询参数 |
|||
salesOrderCode: sysSalesOrder.salesOrderCode |
|||
}; |
|||
return curParams; |
|||
} |
|||
|
|||
</script> |
|||
</body> |
|||
</html> |
@ -0,0 +1,86 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="zh" xmlns:th="http://www.thymeleaf.org"> |
|||
<head> |
|||
<th:block th:include="include :: header('发起售后选择物料信息列表')" /> |
|||
</head> |
|||
<body class="gray-bg"> |
|||
<div class="container-div"> |
|||
<div class="row"> |
|||
<div class="col-sm-12 select-table table-striped"> |
|||
<table id="bootstrap-startAftersalesMaterialSelect-table"></table> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<script th:inline="javascript"> |
|||
var prefix = ctx + "sales/afterSalesNotice"; |
|||
// 从后端拿到传入的makeNo |
|||
var salesOrderCode = /*[[${salesOrderCode}]]*/ ''; |
|||
$(function() { |
|||
var options = { |
|||
id: 'bootstrap-startAftersalesMaterialSelect-table', |
|||
clickToSelect: true, // 点击选中行 |
|||
singleSelect: true, // 单选 |
|||
showSearch: false, |
|||
showRefresh: false, |
|||
showToggle: false, |
|||
showColumns: false, |
|||
pagination: false, // 设置不分页 |
|||
url: prefix + "/getMaterialInfoBySalesOrderCode", |
|||
queryParams:queryParams, |
|||
modalName: "物料信息", |
|||
columns: [{ |
|||
checkbox: true |
|||
}, |
|||
{ |
|||
title: '料号', |
|||
field: 'materialNo', |
|||
}, |
|||
{ |
|||
title: '图片', |
|||
field: 'materialPhotourl', |
|||
}, |
|||
{ |
|||
title: '物料名称', |
|||
field: 'materialName', |
|||
}, |
|||
{ |
|||
title: '类型', |
|||
field: 'materialType', |
|||
}, |
|||
{ |
|||
title: '描述', |
|||
field: 'materialDescribe', |
|||
}, |
|||
{ |
|||
title: '品牌', |
|||
field: 'materialBrand', |
|||
}, |
|||
{ |
|||
title: '单位', |
|||
field: 'materialUnit', |
|||
}, |
|||
{ |
|||
title: '半成品类型', |
|||
field: 'materialProcessMethod', |
|||
}, |
|||
{ |
|||
title: '已出库数量', |
|||
field: 'shippedGoodsSum' |
|||
} |
|||
] |
|||
}; |
|||
$.table.init(options); |
|||
|
|||
}); |
|||
|
|||
function queryParams(params) { |
|||
var curParams = { |
|||
// 现在使用从Thymeleaf传过来的makeNo |
|||
salesOrderCode: salesOrderCode |
|||
}; |
|||
return curParams; |
|||
} |
|||
</script> |
|||
</body> |
|||
</html> |
Loading…
Reference in new issue