Browse Source

[feat]

品质管理 入库前退换货
修改入库前退换货详情页面,表单元素设为可读,修改表格列显示结构;
修改品质报告按钮跳转方法;
修改入库前品质报告页面,表单元素设为可读,修改表格列显示结构;
修改品质报告按钮跳转方法,去除多余方法;
修改入库后品质报告页面,去除编辑功能;
修改入库前确认供应商页面,修改表格列显示结构,修改品质报告按钮跳转方法;
修改入库前确认收货页面,修改表格列显示结构,修改品质报告按钮跳转方法;
dev
王晓迪 3 months ago
parent
commit
3f009eacfd
  1. 8
      ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/afterQualityReportDetail.html
  2. 34
      ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/beforeConfirmDelivery.html
  3. 40
      ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/beforeHasConfirmSupplier.html
  4. 218
      ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/beforeQualityReportDetail.html
  5. 54
      ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/returnBeforeStorageDetail.html

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

@ -58,12 +58,6 @@
var $table = $("#bootstrap-afterUnqualifiedDetail-table");
$("input[name='inspectionTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("#form-afterQualityReportDetail-edit").validate({
focusCleanup: true
@ -81,7 +75,7 @@
var options = {
id:"bootstrap-afterUnqualifiedDetail-table",
url: ctx + "quality/refundsExchanges/getAfterQualityReportDetail",
modalName: "收款凭证",
modalName: "不合格分类",
showColumns: false,
pagination: false,
showToggle: false,

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

@ -50,7 +50,11 @@
<script th:inline="javascript">
var refundsExchangesCode = [[${qualityRefundsExchanges.refundsExchangesCode}]]
var processMethodDatas = [[${@dict.getType('processMethod')}]];
var warehouseDeptDatas = [[${@dict.getType('warehouseDept')}]];
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]];
var materialNo = /*[[${materialNo}]]*/'';
var refundsExchangesCode = /*[[${refundsExchangesCode}]]*/'';
var qualityDeliveryStatusDatas = [[${@dict.getType('quality_delivery_status')}]];
var prefix = ctx + "quality/refundsExchanges";
$("#form-beforeConfirmDelivery-edit").validate({
@ -163,6 +167,10 @@
{
title: '物料类型',
field: 'materialType',
align: 'center',
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{
title: '物料图片地址',
@ -183,18 +191,10 @@
{
title: '物料加工方式',
field: 'materialProcessMethod',
},
{
title: '订单数',
field: 'makeTotal',
},
{
title: '品质已合格数',
field: 'qualityHasqualifiedNum',
},
{
title: '本次到货数',
field: 'thisArrivedNum',
align: 'center',
formatter: function(value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value);
}
},
{
title: '品质报告',
@ -202,7 +202,7 @@
formatter: function(value, row, index) {
// 这里直接使用row对象获取supplierCode,假设它是存在的
var actions = [];
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="qualityReport(\'' + row.materialNo + '\', \'' + row.supplierCode + '\')"><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 + '\')"></i>报告</a> ');
return actions.join('');
}
},
@ -227,12 +227,12 @@
/*品质报告*/
function qualityReport(materialNo, supplierCode) {
function qualityReport(materialNo, refundsExchangesCode) {
var queryParams = new URLSearchParams();
queryParams.append('materialNo', materialNo);
queryParams.append('supplierCode', encodeURIComponent(supplierCode));
queryParams.append('refundsExchangesCode', encodeURIComponent(refundsExchangesCode));
var url = ctx + 'quality/qualityOrder/qualityReport?' + queryParams.toString();
var url = ctx + 'quality/refundsExchanges/beforeQualityReportDetail?' + queryParams.toString();
$.modal.open("品质报告", url);
}

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

@ -59,7 +59,11 @@
<th:block th:include="include :: bootstrap-table-editable-js" />
<script th:inline="javascript">
var refundsExchangesCode = [[${qualityRefundsExchanges.refundsExchangesCode}]]
var processMethodDatas = [[${@dict.getType('processMethod')}]];
var warehouseDeptDatas = [[${@dict.getType('warehouseDept')}]];
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]];
var materialNo = /*[[${materialNo}]]*/'';
var refundsExchangesCode = [[${qualityRefundsExchanges.refundsExchangesCode}]];
var prefix = ctx + "quality/refundsExchanges";
$("#form-qualityRefundsExchanges-edit").validate({
@ -68,7 +72,11 @@
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/returnBeforeStorageDetail", $('#form-qualityRefundsExchanges-edit').serialize());
var refundsExchangesId = $("input[name='refundsExchangesId']").val();
var qualityRefundsExchanges = {
refundsExchangesId: refundsExchangesId,
}
$.operate.saveJson(prefix + "/beforeHasConfirmSupplier",JSON.stringify(qualityRefundsExchanges));
}
}
@ -123,6 +131,10 @@
{
title: '物料类型',
field: 'materialType',
align: 'center',
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{
title: '物料图片地址',
@ -143,18 +155,10 @@
{
title: '物料加工方式',
field: 'materialProcessMethod',
},
{
title: '订单数',
field: 'makeTotal',
},
{
title: '品质已合格数',
field: 'qualityHasqualifiedNum',
},
{
title: '本次到货数',
field: 'thisArrivedNum',
align: 'center',
formatter: function(value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value);
}
},
{
title: '品质报告',
@ -162,7 +166,7 @@
formatter: function(value, row, index) {
// 这里直接使用row对象获取supplierCode,假设它是存在的
var actions = [];
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="qualityReport(\'' + row.materialNo + '\', \'' + row.supplierCode + '\')"><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 + '\')"><i class="fa fa-plus"></i>报告</a> ');
return actions.join('');
}
},
@ -178,12 +182,12 @@
/*品质报告*/
function qualityReport(materialNo, supplierCode) {
function qualityReport(materialNo, refundsExchangesCode) {
var queryParams = new URLSearchParams();
queryParams.append('materialNo', materialNo);
queryParams.append('supplierCode', encodeURIComponent(supplierCode));
queryParams.append('refundsExchangesCode', encodeURIComponent(refundsExchangesCode));
var url = ctx + 'quality/qualityOrder/qualityReport?' + queryParams.toString();
var url = ctx + 'quality/refundsExchanges/beforeQualityReportDetail?' + queryParams.toString();
$.modal.open("品质报告", url);
}
</script>

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

@ -4,32 +4,38 @@
<th:block th:include="include :: header('入库前退货品质单报告详情')" />
<th:block th:include="include :: datetimepicker-css" />
</head>
<style>
.custom-align {
display: flex;
align-items: center;
}
</style>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-qualityOrderReport-edit" th:object="${qualityOrderReport}">
<input name="supplierCode" th:field="*{supplierCode}" type="hidden">
<form class="form-horizontal m" id="form-qualityOrderReport-edit" th:object="${qualityRefundsExchangesOrder}">
<input name="supplierCode" th:field="*{refundsExchangesCode}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">料号:</label>
<div class="col-sm-6">
<input name="materialNo" th:field="*{materialNo}" class="form-control" type="text">
<input name="materialNo" th:field="*{materialNo}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">物料名称:</label>
<div class="col-sm-6">
<input name="materialName" th:field="*{materialName}" class="form-control" type="text">
<input name="materialName" th:field="*{materialName}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">订单数:</label>
<div class="col-sm-6">
<input name="makeTotal" th:field="*{makeTotal}" class="form-control" type="text">
<input name="makeTotal" th:field="*{makeTotal}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">品质已合格数:</label>
<div class="col-sm-6">
<input name="qualityHasqualifiedNum" th:field="*{qualityHasqualifiedNum}" class="form-control" type="text">
<input name="qualityHasqualifiedNum" th:field="*{qualityHasqualifiedNum}" class="form-control" type="text" disabled>
</div>
</div>
@ -39,22 +45,25 @@
<h3>合格数</h3>
<div class="row">
<div class="form-group col-sm-6">
<label class="control-label is-required">ok允收数:</label>
<input name="okAcceptedNum" th:field="*{okAcceptedNum}" class="form-control" type="text" required>
<label class="control-label">ok允收数:</label>
<input name="okAcceptedNum" th:field="*{okAcceptedNum}" class="form-control" type="text" disabled>
</div>
<div class="form-group col-sm-6">
<label class="control-label">ok报告图片:</label>
<input name="okReportUrl" th:field="*{okReportUrl}" class="form-control" type="text">
<div class="form-group col-sm-6 d-flex flex-column align-items-start">
<label class="control-label">ok报告:</label>
<input name="okReportUrl" th:field="*{okReportUrl}" class="form-control" type="text" disabled>
<!-- <a class= 'btn btn-success btn-xs' href='javascript:void(0)' >报告</a>-->
</div>
</div>
<div class="row">
<div class="form-group col-sm-6">
<label class="control-label is-required">特采/让步数</label>
<input name="specialConcessionsNum" th:field="*{specialConcessionsNum}" class="form-control" type="text" required>
<label class="control-label">特采/让步数</label>
<input name="specialConcessionsNum" th:field="*{specialConcessionsNum}" class="form-control" type="text" disabled>
</div>
<div class="form-group col-sm-6">
<label class="control-label">特采报告图片:</label>
<input name="specialReportUrl" th:field="*{specialReportUrl}" class="form-control" type="text">
<label class="control-label">特采报告:</label>
<input name="specialReportUrl" th:field="*{specialReportUrl}" class="form-control" type="text" disabled>
<!-- <a class= 'btn btn-success btn-xs' href='javascript:void(0)' >报告</a>-->
</div>
</div>
</div>
@ -63,9 +72,6 @@
<div class="row">
<div class="col-sm-12 d-flex align-items-center">
<span style="font-weight: bold; font-family: Arial, sans-serif; font-size: 15px;">不合格数</span>
<a class="btn btn-success ml-auto" onclick="addUnqualified()">
<i class="fa fa-plus"></i> 添加
</a>
</div>
</div>
<div class="row">
@ -82,7 +88,7 @@
<label class="col-sm-4 control-label">检验完成时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="checkoutCompletionTime" th:value="${#dates.format(qualityOrderReport.checkoutCompletionTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
<input name="checkoutCompletionTime" th:value="${#dates.format(qualityRefundsExchangesOrder.checkoutCompletionTime, '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>
@ -102,6 +108,8 @@
var processBadClassificationDatas = [[${@dict.getType('process_bad_classification')}]];
var processBadGradeDatas = [[${@dict.getType('process_bad_grade')}]];
var materialNo = /*[[${materialNo}]]*/'';
var refundsExchangesCode = /*[[${refundsExchangesCode}]]*/'';
var $table = $("#bootstrap-unqualified-table");
var prefix = ctx + "quality/qualityOrder";
$("#form-qualityOrderReport-edit").validate({
@ -109,199 +117,73 @@
});
function submitHandler() {
// 获取表单数据
const qualityReportData = $("#form-qualityOrderReport-edit").serializeArray().reduce((obj, item) => {
obj[item.name] = item.value;
return obj;
}, {});
// 获取bootstrap-table的数据,这里假设你使用bootstrap-table的API获取所有数据
var table = $('#bootstrap-unqualified-table').bootstrapTable('getData');
// 检查表格数据是否为空
if (table.length===0){
$.modal.alertWarning("请至少添加一条不合格数再保存!");
return;
}
console.log(JSON.stringify(table));
// 将表数据转换成与qualityReportData格式一致的数组
var unqualifiedDataList = table.map(function(item) {
// 根据实际字段名调整
return {
"processBadClassification": item.processBadClassification,
"processBadGrade": item.processBadGrade,
"processBadNum": item.processBadNum,
"unqualifiedReportUrl": item.unqualifiedReportUrl
// ...其他字段
};
});
const combinedData = Object.assign({}, qualityReportData, { unqualifiedDataList: unqualifiedDataList });
// 合并表单数据和表格数据
// 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);
}
$("input[name='checkoutCompletionTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
//添加不合格数
function addUnqualified() {
// 生成一个简单的唯一标识,这里使用时间戳作为示例
var uniqueId = new Date().getTime();
// 创建一个新行数据模板,这里仅为示例,具体根据表格列来定义
var newRow = {
qualityOrderReportId:uniqueId,
processBadClassification: "",
processBadGrade: "",
processBadNum: "",
unqualifiedReportUrl: ""
};
// 使用Bootstrap Table的API插入新行
$('#bootstrap-unqualified-table').bootstrapTable('append', newRow);
}
//收款凭证table列表
$(function() {
var options = {
id:"bootstrap-unqualified-table",
modalName: "收款凭证",
url: ctx + "quality/refundsExchanges/getBeforeQualityReportDetail",
modalName: "不合格分类",
showColumns: false,
pagination: false,
showToggle: false,
showRefresh:false,
showSearch:false,
singleSelect:true,
columns: [{
checkbox: false
},
queryParams:queryParams,
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);
return $.table.selectDictLabel(processBadClassificationDatas, value);
}
},
{title: '不良等级',field: 'processBadGrade',
{
title: '不良等级',
field: 'processBadGrade',
align: 'center',
formatter: function(value, row, index) {
return processBadGradeFormatter(value,row,index);
return $.table.selectDictLabel(processBadGradeDatas, value);
}
},
{
title: '数量',
field: 'processBadNum',
editable:{
type: 'text',
mode:'inline',
validate: function (v) {
if (!v) return '数量不能为空';
if (isNaN(v)) return '数量必须是数字';
var processBadNum = parseInt(v);
if (processBadNum <= 0) return '数量必须是正整数';
}
}
align: 'center',
},
{
title: '报告',
field: 'unqualifiedReportUrl',
editable: {
mode:'inline',
type: '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.qualityOrderReportId + '\')"><i class="fa fa-remove"></i>删除</a> ');
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" >报告</a> ');
return actions.join('');
}
}
},
]
};
$.table.init(options);
});
// 逻辑删除不合格数前端的一行数据
function removeRow(qualityOrderReportId){
console.log(qualityOrderReportId);
// 直接使用 receivablesRecordsId 值进行删除操作
$("#bootstrap-unqualified-table").bootstrapTable('remove', {
field: 'qualityOrderReportId',
values: qualityOrderReportId
});
function queryParams(params) {
var curParams = {
//传递查询参数
materialNo: materialNo,
refundsExchangesCode: refundsExchangesCode
}
// 列中获取不良分类的下拉改变数据
function onProcessBadClassification(selectElement, rowIndex) {
var processBadClassificationValue = $(selectElement).val();
var tableData = $table.bootstrapTable('getData');
var newRow = tableData[rowIndex]; // 获取当前行数据
// 重新渲染成本小类的设备名称列
// 更新行数据
newRow.processBadClassification = processBadClassificationValue;
$table.bootstrapTable('updateRow', {index: rowIndex, row: newRow});
return curParams;
}
// 自定义不良分类的格式化函数
function processBadClassificationFormatter(value, row, index) {
var selectHtml = '<select class="form-control" onchange="onProcessBadClassification(this, ' + index + ')">';
// 添加默认选项
selectHtml += '<option value=""' + (value === undefined || value === '' ? ' selected' : '') + '>所有</option>';
processBadClassificationDatas.forEach(function (child) {
selectHtml += '<option value="' + child.dictValue + '"' + (value === child.dictValue ? ' selected' : '') + '>' + child.dictLabel + '</option>';
});
selectHtml += '</select>';
return selectHtml;
}
// 列中获取不良等级的下拉改变数据
function onProcessBadGrade(selectElement, rowIndex) {
var processBadGradeValue = $(selectElement).val();
var tableData = $table.bootstrapTable('getData');
var newRow = tableData[rowIndex]; // 获取当前行数据
// 重新渲染成本小类的设备名称列
// 更新行数据
newRow.processBadGrade = processBadGradeValue;
$table.bootstrapTable('updateRow', {index: rowIndex, row: newRow});
}
// 自定义不良等级的格式化函数
function processBadGradeFormatter(value, row, index) {
var selectHtml = '<select class="form-control" onchange="onProcessBadGrade(this, ' + index + ')">';
// 添加默认选项
selectHtml += '<option value=""' + (value === undefined || value === '' ? ' selected' : '') + '>所有</option>';
processBadGradeDatas.forEach(function (child) {
selectHtml += '<option value="' + child.dictValue + '"' + (value === child.dictValue ? ' selected' : '') + '>' + child.dictLabel + '</option>';
});
selectHtml += '</select>';
return selectHtml;
}
</script>
</body>
</html>

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

@ -27,19 +27,19 @@
<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">
<input name="refundsExchangesCode" th:field="*{refundsExchangesCode}" 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="relatedOrderCode" th:field="*{relatedOrderCode}" class="form-control" type="text">
<input name="relatedOrderCode" th:field="*{relatedOrderCode}" 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">
<select name="warehouseStorageType" class="form-control m-b" th:with="type=${@dict.getType('warehouse_storage_type')}">
<select name="warehouseStorageType" class="form-control m-b" th:with="type=${@dict.getType('warehouse_storage_type')}" disabled>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{warehouseStorageType}"></option>
</select>
</div>
@ -61,6 +61,11 @@
var refundsExchangesCode = [[${qualityRefundsExchanges.refundsExchangesCode}]]
var qualityRefundsExchanges = [[${qualityRefundsExchanges}]];
var processMethodDatas = [[${@dict.getType('processMethod')}]];
var warehouseDeptDatas = [[${@dict.getType('warehouseDept')}]];
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]];
var prefix = ctx + "quality/refundsExchanges";
$("#form-qualityRefundsExchanges-edit").validate({
focusCleanup: true
@ -105,14 +110,17 @@
$table.bootstrapTable({
data: supplierData,
columns: [{
checkbox: true
},
columns: [
{
title: '供应商ID',
field: 'supplierCode',
visible: false
},
{
title: '退换货单号',
field: 'refundsExchangesCode',
visible: false
},
{
title: '料号',
field: 'materialNo'
@ -123,9 +131,13 @@
{
title: '物料类型',
field: 'materialType',
align: 'center',
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{
title: '物料图片地址',
title: '物料图片',
field: 'materialPhotourl',
},
{
@ -143,22 +155,10 @@
{
title: '物料加工方式',
field: 'materialProcessMethod',
},
{
title: '订单数',
field: 'makeTotal',
},
{
title: '品质已合格数',
field: 'qualityHasqualifiedNum',
},
{
title: '本次到货数',
field: 'thisArrivedNum',
editable:{
type:'text'
},
required:true
align: 'center',
formatter: function(value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value);
}
},
{
title: '品质报告',
@ -166,7 +166,7 @@
formatter: function(value, row, index) {
// 这里直接使用row对象获取supplierCode,假设它是存在的
var actions = [];
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="qualityReport(\'' + row.materialNo + '\', \'' + row.supplierCode + '\')"><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('');
}
},
@ -182,12 +182,12 @@
/*品质报告*/
function qualityReport(materialNo, supplierCode) {
function qualityReport(materialNo, refundsExchangesCode) {
var queryParams = new URLSearchParams();
queryParams.append('materialNo', materialNo);
queryParams.append('supplierCode', encodeURIComponent(supplierCode));
queryParams.append('refundsExchangesCode', encodeURIComponent(refundsExchangesCode));
var url = ctx + 'quality/qualityOrder/qualityReport?' + queryParams.toString();
var url = ctx + 'quality/refundsExchanges/beforeQualityReportDetail?' + queryParams.toString();
$.modal.open("品质报告", url);
}
</script>

Loading…
Cancel
Save