Browse Source

[feat]

品质管理 退换货单
修改退换货单列表页面,调整表格列字段,新增入库单号列,去除编辑按钮;
修改新增退还货单按钮跳转方法;
修改退换货物料选择页面,调整列名字段,新增字典类型数据添加标签查询语句;
修改新增退换货单页面,调整表格列结构,补全字段;
修改品质报告跳转方法,新增回调函数定义;
新增处理品质报告子页面数据回调函数;
新增按料号查找更新表格数据方法;
修改逻辑删除前端的一行数据方法,删除表格数据同时删除该料号对应session存储数据;
修改添加退换货页面提交方法,循环子页面数据附加到详情信息上;
修改入库后退换货详情页面,调整表格数据结构;
修改添加品质报告页面加载方法,读取session中特定料号key值初始化页面;
dev
王晓迪 3 months ago
parent
commit
d21444dac4
  1. 125
      ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/add.html
  2. 24
      ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/materialSelect.html
  3. 60
      ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/qualityOrderReport.html
  4. 51
      ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/refundsExchanges.html
  5. 44
      ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/returnAfterStorageDetail.html

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

@ -46,8 +46,9 @@
<script th:inline="javascript">
var prefix = ctx + "quality/refundsExchanges"
var refundsExchangesCode = /*[[${refundsExchangesCode}]]*/ '';
var processMethodDatas = [[${@dict.getType('processMethod')}]];
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]];
var materialUnqualifiedList = [];
$("#form-refundsExchanges-add").validate({
focusCleanup: true
});
@ -85,6 +86,14 @@
};
});
materialDataList.forEach(function (material){
var key = 'unqualifiedDataList' + material.materialNo;
var dataString = sessionStorage.getItem(key);
if(dataString){
var refundsExchangesUnqualifieds = JSON.parse(dataString);
material.refundsExchangesUnqualifieds = refundsExchangesUnqualifieds;
}
})
// 将全局变量 refundsExchangesCode 添加到要提交的数据中
const combinedData = Object.assign({}, refundsExchangesData, {
refundsExchangesDetails: materialDataList,
@ -132,6 +141,9 @@
{
title: '图片',
field: 'materialPhotourl',
formatter: function(value, row, index) {
return $.table.imageView(value);
}
},
{
title: '物料名称',
@ -140,6 +152,9 @@
{
title: '物料类型',
field: 'materialType',
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{
title: '描述',
@ -156,6 +171,9 @@
{
title: '物料加工方式',
field: 'materialProcessMethod',
formatter: function(value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value);
}
},
{
title: '品质报告',
@ -163,7 +181,7 @@
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> ');
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="qualityReport(\'' + row.materialNo + '\', \'' + refundsExchangesCode + '\', \'' + row.hasQualifiedReport + '\')"><i class="fa fa-plus"></i>报告</a> ');
return actions.join('');
}
},
@ -171,6 +189,11 @@
title: '退换数',
field: 'refundsExchangesNum',
},
{
title: '是否含品质报告数据',
field: 'hasQuolifiedReport',
visible: false,
},
{
title: '操作',
align: 'center',
@ -209,11 +232,13 @@
materialPhotourl:rowData.materialPhotourl,
materialName: rowData.materialName,
materialType: rowData.materialType,
materialDescribe: rowData.materialDescribe,
materialBrand: rowData.materialBrand,
materialUnit: rowData.materialUnit,
materialProcessMethod: rowData.materialProcessMethod,
makeTotal:rowData.makeTotal
materialDescribe: rowData.describe,
materialBrand: rowData.brand,
materialUnit: rowData.unit,
materialProcessMethod: rowData.processMethod,
makeTotal:rowData.makeTotal,
refundsExchangesNum: '',
hasQualifiedReport: 0,
}
})
layer.close(index);
@ -225,17 +250,97 @@
field: 'materialNo',
values: materialNo
})
// 删除该物料品质报告数据
var key = 'unqualifiedDataList' + materialNo;
if (sessionStorage.getItem(key)) {
sessionStorage.removeItem(key);
}
}
// 按料号查找更新表格数据
function updateRowByMaterialNo(materialNo, newData) {
// 获取所有行的数据
var rows = $('#bootstrap-table').bootstrapTable('getData');
for (var i = 0; i < rows.length; i++) {
if (rows[i].materialNo === materialNo) {
rows[i] = Object.assign({}, rows[i], newData); // 合并新旧数据
console.log(rows[i]);
$('#bootstrap-table').bootstrapTable('updateRow', {
index: i,
row: rows[i]
});
}
}
}
// 处理品质报告子页面数据
function handleQualityReportData(index, layero){
var iframeWin = window[layero.find('iframe')[0]['name']];
var materialNo = iframeWin.$('#materialNo').val();
var inspectionTime = iframeWin.$('input[name="inspectionTime"]').val();
var remark = iframeWin.$('#remark').val();
var refundsExchangesNum = 0;
var table = iframeWin.$('#bootstrap-unqualified-table').bootstrapTable('getData');
// 检查表格数据是否为空
if (table.length===0){
$.modal.alertWarning("请至少添加一条不合格数再保存!");
return;
}
// 将表数据转换成与qualityReportData格式一致的数组
var unqualifiedDataList = table.map(function(item) {
// 根据实际字段名调整
return {
"qualityOrderReportId": item.qualityOrderReportId,
"processBadClassification": item.processBadClassification,
"processBadGrade": item.processBadGrade,
"processBadNum": item.processBadNum,
"unqualifiedReportUrl": item.unqualifiedReportUrl
// ...其他字段
};
});
unqualifiedDataList.forEach(function (index){
index.inspectionTime = inspectionTime;
index.remark = remark;
processBadNum = Number(index.processBadNum);
if (!isNaN(processBadNum) ) {
refundsExchangesNum += processBadNum;
}
})
var key = 'unqualifiedDataList' + materialNo;
if (sessionStorage.getItem(key)) {
sessionStorage.removeItem(key);
}
sessionStorage.setItem(key,JSON.stringify(unqualifiedDataList));
var newData = {
refundsExchangesNum: refundsExchangesNum,
hasQualifiedReport: '1'
};
updateRowByMaterialNo(materialNo,newData);
layer.close(index);
}
/*品质报告*/
function qualityReport(materialNo, refundsExchangesCode) {
function qualityReport(materialNo, refundsExchangesCode, hasQualifiedReport) {
var queryParams = new URLSearchParams();
queryParams.append('materialNo', materialNo);
queryParams.append('refundsExchangesCode', encodeURIComponent(refundsExchangesCode));
if(hasQualifiedReport === "0"){
// 删除该物料品质报告数据
var key = 'unqualifiedDataList' + materialNo;
if (sessionStorage.getItem(key)) {
sessionStorage.removeItem(key);
}
}
var url = ctx + 'quality/refundsExchanges/qualityReport?' + queryParams.toString();
$.modal.open("品质报告", url);
var options = {
title: '品质报告',
url: url,
callBack: handleQualityReportData
};
$.modal.openOptions(options);
}
</script>

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

@ -16,6 +16,11 @@
var prefix = ctx + "quality/refundsExchanges";
// 从后端拿到传入的makeNo
var makeNo = /*[[${makeNo}]]*/ '';
var processMethodDatas = [[${@dict.getType('processMethod')}]];
var sysUnitClassDatas = [[${@dict.getType('sysUnitClassDatas')}]];
var warehouseDeptDatas = [[${@dict.getType('warehouseDept')}]];
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]];
$(function() {
var options = {
id: 'bootstrap-materialSelect-table',
@ -38,6 +43,10 @@
{
title: '图片',
field: 'materialPhotourl',
formatter: function(value, row, index) {
return $.table.imageView(value);
}
},
{
title: '物料名称',
@ -46,18 +55,27 @@
{
title: '类型',
field: 'materialType',
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{
title: '描述',
field: 'materialDescribe',
field: 'describe',
},
{
title: '品牌',
field: 'materialBrand',
field: 'brand',
},
{
title: '单位',
field: 'materialUnit',
field: 'unit',
},
{ title: '加工方式',
field: 'processMethod',
formatter: function(value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value);
}
},
]
};

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

@ -7,7 +7,7 @@
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-qualityOrderReport-add">
<input name="materialNo" th:field="*{materialNo}" type="hidden">
<input name="materialNo" id="materialNo" th:field="*{materialNo}" type="hidden">
<div class="container">
<!--不合格数-->
<div class="col-sm-12">
@ -41,7 +41,7 @@
<div class="form-group">
<label class="col-sm-4 control-label">备注:</label>
<div class="col-sm-8">
<textarea name="remark" class="form-control" type="text"></textarea>
<textarea name="remark" id="remark" class="form-control" type="text"></textarea>
</div>
</div>
</form>
@ -52,7 +52,7 @@
<script th:inline="javascript">
var prefix = ctx + "quality/refundsExchanges";
var materialNo = /*[[${materialNo}]]*/'';
var materialNo = [[${materialNo}]];
var refundsExchangesCode = /*[[${refundsExchangesCode}]]*/'';
@ -77,7 +77,6 @@
$.modal.alertWarning("请至少添加一条不合格数再保存!");
return;
}
console.log(JSON.stringify(table));
// 将表数据转换成与qualityReportData格式一致的数组
var unqualifiedDataList = table.map(function(item) {
// 根据实际字段名调整
@ -89,19 +88,25 @@
// ...其他字段
};
});
const combinedData = Object.assign({}, qualityReportData, {
refundsExchangesUnqualifieds: unqualifiedDataList ,
materialNo:materialNo,
refundsExchangesCode:refundsExchangesCode
});
// 合并表单数据和表格数据
// const combinedData = Object.assign({}, ...complaintNoticeData.array(item => ({ [item.name]: item.value })), ...materialData);
console.log(combinedData)
// 使用 JSON.stringify() 序列化数据
const jsonData = JSON.stringify(combinedData);
// 发送 AJAX 请求到后端接口
$.operate.saveJson(prefix + "/qualityReport", jsonData);
console.log(combinedData);
var key = 'unqualifiedDataList' + materialNo;
if (localStorage.getItem(key)) {
localStorage.removeItem(key);
}
localStorage.setItem(key,JSON.stringify(unqualifiedDataList));
$.modal.close();
// // 使用 JSON.stringify() 序列化数据
// const jsonData = JSON.stringify(combinedData);
// // 发送 AJAX 请求到后端接口
// $.operate.saveJson(prefix + "/qualityReport", jsonData);
}
$("input[name='inspectionTime']").datetimepicker({
@ -131,31 +136,30 @@
}
//收款凭证table列表
$(function() {
$('#materialNo').val(materialNo);
var options = {
id:"bootstrap-unqualified-table",
modalName: "收款凭证",
modalName: "品质报告单",
showColumns: false,
pagination: false,
showToggle: false,
showRefresh:false,
showSearch:false,
singleSelect:true,
columns: [{
checkbox: false
},
columns: [
{
title: '品质报告单id',
field: 'qualityOrderReportId',
visible: false
},
{title: '不良分类',field: 'processBadClassification',
{title: '不良分类',field: 'processBadClassification',align: 'center',
formatter:function (value, row, index) {
return processBadClassificationFormatter(value,row,index);
}
},
{title: '不良等级',field: 'processBadGrade',
{title: '不良等级',field: 'processBadGrade',align: 'center',
formatter:function (value, row, index) {
return processBadGradeFormatter(value,row,index);
}
@ -163,6 +167,7 @@
{
title: '数量',
field: 'processBadNum',
align: 'center',
editable:{
type: 'text',
mode:'inline',
@ -177,10 +182,12 @@
{
title: '报告',
field: 'unqualifiedReportUrl',
editable: {
mode:'inline',
type: 'text', // 表示该列可以被编辑为文本
},
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" ><i class="fa fa-plus"></i>上传</a> ');
return actions.join('');
}
},
{
title: '操作',
@ -193,6 +200,17 @@
}
]
};
var key = 'unqualifiedDataList' + materialNo;
var dataString = sessionStorage.getItem(key);
if (dataString) {
var data = JSON.parse(dataString);
options.data = data;
$('input[name="inspectionTime"]').val(data[0].inspectionTime);
$('#remark').val(data[0].remark);
}
$.table.init(options);
});

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

@ -137,13 +137,9 @@
}
},
{
title: '关联单号',
title: '关联单号',
field: 'relatedOrderCode',
},
{
title: '入库单号',
field: 'inStorageCode',
},
{
title: '退货节点',
field: 'qualityReturnNode',
@ -152,7 +148,7 @@
}
},
{
title: '物料合计',
title: '物料合计',
field: 'materialTotal',
},
{
@ -162,14 +158,7 @@
{
title: '交付质检时间',
field: 'deliveryInspectionTime',
},
{
title: '品质备注',
field: 'qualityRemark',
},
{
title: '备注',
field: 'remark',
visible: false,
},
{
title: '录入人',
@ -192,7 +181,7 @@
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.refundsExchangesId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
// actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.refundsExchangesId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
if (row.refundsExchangesStatus == 0 && row.qualityPurchaseStatus == 4){
actions.push('<a class="btn btn-success btn-xs ' + closingProceduresFlag + '" href="javascript:void(0)" onclick="closingProcedures(\'' + row.refundsExchangesId + '\')"><i class="fa fa-edit"></i>结案</a> ');
}
@ -247,21 +236,23 @@
/*添加退货单*/
function add() {
var rows = $("#bootstrap-table").bootstrapTable('getSelections');
console.log("rows" + rows);
if (rows.length == 1){
// var curQualityReturnNode = rows[0].qualityReturnNode;
// var curRefundsExchangesCode = rows[0].refundsExchangesCode;
if (rows[0].qualityReturnNode == 1){
var url = ctx + 'quality/refundsExchanges/add/' +rows[0].refundsExchangesCode;
$.modal.open("添加退换货",url);
}else {
$.modal.msgWarning("请选择退货节点为入库后退货的数据!")
}
// $.modal.open("添加" + table.options.modalName, $.operate.addUrl(rows[0].id));
}else{
$.modal.msgWarning("只能选中一行作为添加对象!")
}
var url = ctx + 'quality/refundsExchanges/add';
$.modal.open("添加退换货",url);
// var rows = $("#bootstrap-table").bootstrapTable('getSelections');
// console.log("rows" + rows);
// if (rows.length == 1){
// // var curQualityReturnNode = rows[0].qualityReturnNode;
// // var curRefundsExchangesCode = rows[0].refundsExchangesCode;
// if (rows[0].qualityReturnNode == 1){
// var url = ctx + 'quality/refundsExchanges/add/' +rows[0].refundsExchangesCode;
// $.modal.open("添加退换货",url);
// }else {
// $.modal.msgWarning("请选择退货节点为入库后退货的数据!")
// }
// // $.modal.open("添加" + table.options.modalName, $.operate.addUrl(rows[0].id));
// }else{
// $.modal.msgWarning("只能选中一行作为添加对象!")
// }
};

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

@ -48,6 +48,9 @@
var refundsExchangesCode = /*[[${refundsExchangesCode}]]*/ '';
var qualityRefundsExchanges = [[${qualityRefundsExchanges}]];
var processMethodDatas = [[${@dict.getType('processMethod')}]];
var warehouseDeptDatas = [[${@dict.getType('warehouseDept')}]];
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]];
$("input[name='deliveryInspectionTime']").datetimepicker({
format: "yyyy-mm-dd",
@ -136,26 +139,38 @@
{
title: '物料名称',
field: 'materialName',
align: 'center',
},
{
title: '物料类型',
field: 'materialType',
align: 'center',
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{
title: '描述',
field: 'materialDescribe',
align: 'center',
},
{
title: '品牌',
field: 'materialBrand',
align: 'center',
},
{
title: '单位',
field: 'materialUnit',
align: 'center',
},
{
title: '加工方式',
field: 'materialProcessMethod',
align: 'center',
formatter: function(value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value);
}
},
{
title: '品质报告',
@ -163,13 +178,40 @@
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 + '\', \'' + row.refundsExchangesCode + '\')"><i class="fa fa-plus"></i>报告</a> ');
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="qualityReport(\'' + row.materialNo + '\', \'' + row.refundsExchangesCode + '\')">报告</a> ');
return actions.join('');
}
},
{
title: '退换数',
field: 'refundsExchangesNum',
align: 'center',
},
{
title: '供应商ID',
field: 'supplierCode',
align: 'center',
},
{
title: '供应商名称',
field: 'supplierName',
align: 'center',
},
{
title: '退货联系人',
field: 'customerContact',
align: 'center',
},
{
title: '联系人电话',
field: 'contactNumber',
align: 'center',
},
{
title: '退货地址',
field: 'supplierAddress',
align: 'center',
}
]
};

Loading…
Cancel
Save