Browse Source

[feat]品质管理:

退换货
新增入库后退换货详情页面returnAfterStorageDetail.html
新增入库后退换货详情按钮
新增入库后退换货详情接口
dev
liuxiaoxu 6 months ago
parent
commit
f6554d8e07
  1. 47
      ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityRefundsExchangesController.java
  2. 12
      ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/refundsExchanges.html
  3. 224
      ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/returnAfterStorageDetail.html

47
ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityRefundsExchangesController.java

@ -4,6 +4,8 @@ import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.ruoyi.aftersales.domain.AftersalesComplaintNoticeDetail;
import com.ruoyi.aftersales.domain.vo.AftersalesMaterialVO;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.erp.domain.ErpMaterialVo;
import com.ruoyi.erp.service.IErpMaterialService;
@ -177,7 +179,7 @@ public class QualityRefundsExchangesController extends BaseController
}
/**
* 修改品质单报告不良分类
* 新增品质单报告不合格数
*/
@GetMapping("/qualityReport")
public String qualityReport( @RequestParam("materialNo") String materialNo,
@ -195,9 +197,8 @@ public class QualityRefundsExchangesController extends BaseController
}
/**
* 新增保存品质单报告不良分类
* 新增保存品质单报告不合格数
*/
@RequiresPermissions("quality:qualityOrder:qualityReport")
@Log(title = "品质管理品质单", businessType = BusinessType.INSERT)
@PostMapping("/qualityReport")
@ResponseBody
@ -207,7 +208,7 @@ public class QualityRefundsExchangesController extends BaseController
}
/**
* 修改品质管理退换货单
* 入库前退换货单详情
*/
@GetMapping("/returnBeforeStorageDetail/{refundsExchangesId}")
public String returnBeforeStorageDetail(@PathVariable("refundsExchangesId") Long refundsExchangesId, ModelMap mmap)
@ -218,7 +219,7 @@ public class QualityRefundsExchangesController extends BaseController
}
/**
* 修改保存品质管理退换货单
* 保存入库前退换货单详情
*/
@RequiresPermissions("quality:refundsExchanges:returnBeforeStorageDetail")
@Log(title = "品质管理退换货单", businessType = BusinessType.UPDATE)
@ -243,4 +244,40 @@ public class QualityRefundsExchangesController extends BaseController
}
/**
* 入库前退换货单详情
*/
@GetMapping("/returnAfterStorageDetail/{refundsExchangesId}")
public String returnAfterStorageDetail(@PathVariable("refundsExchangesId") Long refundsExchangesId, ModelMap mmap)
{
QualityRefundsExchanges qualityRefundsExchanges = qualityRefundsExchangesService.selectQualityRefundsExchangesById(refundsExchangesId);
mmap.put("qualityRefundsExchanges", qualityRefundsExchanges);
return prefix + "/returnAfterStorageDetail";
}
/**
* 保存入库前退换货单详情
*/
@RequiresPermissions("quality:refundsExchanges:returnAfterStorageDetail")
@Log(title = "品质管理退换货单", businessType = BusinessType.UPDATE)
@PostMapping("/returnAfterStorageDetail")
@ResponseBody
public AjaxResult returnAfterStorageDetailSave(QualityRefundsExchanges qualityRefundsExchanges)
{
return toAjax(qualityRefundsExchangesService.returnBeforeStorageDetail(qualityRefundsExchanges));
}
/**
* 入库后退货详情物料信息列表
* */
@ResponseBody
@PostMapping("/getMaterialListByRefundsExchangesCode")
public TableDataInfo getMaterialListByRefundsExchangesCode(QualityRefundsExchanges qualityRefundsExchanges){
startPage();
List<QualityRefundsExchangesDetail> list = refundsExchangesDetailService.selectRefundsExchangesDetailListByCode(qualityRefundsExchanges.getRefundsExchangesCode());
return getDataTable(list);
}
}

12
ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/refundsExchanges.html

@ -82,7 +82,7 @@
var closingProceduresFlag = [[${@permission.hasPermi('quality:refundsExchanges:closingProcedures')}]];
var returnBeforeStorageDetailFlag = [[${@permission.hasPermi('quality:refundsExchanges:returnBeforeStorageDetail')}]];
var returnAfterStorageDetailFlag = [[${@permission.hasPermi('quality:refundsExchanges:returnAfterStorageDetailFlag')}]];
var refundsExchangesStatusDatas = [[${@dict.getType('refunds_exchanges_status')}]];
var qualityWarehouseStatusDatas = [[${@dict.getType('quality_warehouse_status')}]];
@ -194,6 +194,10 @@
if (row.qualityReturnNode == 0){
actions.push('<a class="btn btn-success btn-xs ' + returnBeforeStorageDetailFlag + '" href="javascript:void(0)" onclick="returnBeforeStorageDetail(\'' + row.refundsExchangesId + '\')"><i class="fa fa-edit"></i>详情</a> ');
}
/*入库后退货详情*/
if (row.qualityReturnNode == 1){
actions.push('<a class="btn btn-success btn-xs ' + returnAfterStorageDetailFlag + '" href="javascript:void(0)" onclick="returnAfterStorageDetail(\'' + row.refundsExchangesId + '\')"><i class="fa fa-edit"></i>详情</a> ');
}
return actions.join('');
}
@ -209,6 +213,12 @@
$.modal.open("入库前退货详情",url);
}
/*入库后退货详情*/
function returnAfterStorageDetail(refundsExchangesId){
var url = ctx + 'quality/refundsExchanges/returnAfterStorageDetail/' +refundsExchangesId;
$.modal.open("入库后退货详情",url);
}
/*结案*/
function closingProcedures(refundsExchangesId){
var url = ctx + 'quality/refundsExchanges/closingProcedures/' +refundsExchangesId;

224
ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/returnAfterStorageDetail.html

@ -0,0 +1,224 @@
<!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-returnAfterStorageDetail-edit" th:object="${qualityRefundsExchanges}">
<input name="refundsExchangesId" th:field="*{refundsExchangesId}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">退换货单号:</label>
<div class="col-sm-8">
<input name="refundsExchangesCode" th:field="*{refundsExchangesCode}" 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="deliveryInspectionTime" th:value="${#dates.format(qualityRefundsExchanges.deliveryInspectionTime, '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">
<input name="qualityRemark" th:field="*{qualityRemark}" class="form-control" type="text">
</div>
</div>
</form>
<!--物料信息-->
<div class="container">
<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 prefix = ctx + "quality/refundsExchanges"
var refundsExchangesCode = /*[[${refundsExchangesCode}]]*/ '';
var qualityRefundsExchanges = [[${qualityRefundsExchanges}]];
$("input[name='deliveryInspectionTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("#form-returnAfterStorageDetail-edit").validate({
focusCleanup: true
});
// 新增提交
function submitHandler() {
// 获取表单数据
const refundsExchangesData = $("#form-refundsExchanges-add").serializeArray().reduce((obj, item) => {
obj[item.name] = item.value;
return obj;
}, {});
// 获取bootstrap-table的数据,这里假设你使用bootstrap-table的API获取所有数据
var table = $('#bootstrap-table').bootstrapTable('getData');
// 检查表格数据是否为空
if (table.length===0){
$.modal.alertWarning("请至少添加一条物料数据后再保存!");
return;
}
console.log(table);
// 将表数据转换成与complaintNoticeData格式一致的数组
var materialDataList = table.map(function(item) {
// 根据实际字段名调整
return {
"materialNo": item.materialNo, // 假设id对应materialId
"materialPhotourl": item.materialPhotourl, // 假设quantity是物料数量字段
"materialName": item.materialName,
"materialType": item.materialType,
"materialDescribe": item.materialDescribe,
"materialUnit": item.materialUnit,
"materialBrand": item.materialBrand,
"materialProcessMethod":item.materialProcessMethod,
"refundsExchangesNum":item.refundsExchangesNum
// ...其他字段
};
});
// 将全局变量 refundsExchangesCode 添加到要提交的数据中
const combinedData = Object.assign({}, refundsExchangesData, {
refundsExchangesDetails: materialDataList,
refundsExchangesCode: refundsExchangesCode // 直接使用全局变量
});
// 合并表单数据和表格数据
console.log(combinedData)
// 使用 JSON.stringify() 序列化数据
const jsonData = JSON.stringify(combinedData);
// 发送 AJAX 请求到后端接口
$.operate.saveJson(prefix + "/add", jsonData);
}
//物料信息展示列表
$(function() {
var options = {
modalName: "选择物料",
url: ctx + "quality/refundsExchanges/getMaterialListByRefundsExchangesCode",
queryParams: queryParams,
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
pagination: false, // 设置不分页
columns: [{
checkbox: true
},
{
title: '退换货单号',
field: 'refundsExchangesCode',
visible: false
},
{
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: '品质报告',
align: 'center',
formatter: function(value, row, index) {
// 这里直接使用row对象获取refundsExchangesCode,假设它是存在的
var actions = [];
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="qualityReport(\'' + row.materialNo + '\', \'' + refundsExchangesCode + '\')"><i class="fa fa-plus"></i>报告</a> ');
return actions.join('');
}
},
{
title: '退换数',
field: 'refundsExchangesNum',
}
]
};
$.table.init(options);
})
function queryParams(params) {
var curParams = {
// 传递参数查询参数
refundsExchangesCode: qualityRefundsExchanges.refundsExchangesCode
};
console.log(curParams);
return curParams;
}
function doSubmit(index, layero,uniqueId){
console.log(uniqueId);
var iframeWin = window[layero.find('iframe')[0]['name']];
var rowData = iframeWin.$('#bootstrap-materialSelect-table').bootstrapTable('getSelections')[0];
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,
makeTotal:rowData.makeTotal
}
})
layer.close(index);
}
/*品质报告*/
function qualityReport(materialNo, refundsExchangesCode) {
var queryParams = new URLSearchParams();
queryParams.append('materialNo', materialNo);
queryParams.append('refundsExchangesCode', encodeURIComponent(refundsExchangesCode));
var url = ctx + 'quality/refundsExchanges/qualityReport?' + queryParams.toString();
$.modal.open("品质报告", url);
}
</script>
</body>
</html>
Loading…
Cancel
Save