From 3f009eacfd8e1366d702dea83fbbc930fb76e5a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=99=93=E8=BF=AA?= <2596750866@qq.com> Date: Tue, 27 Aug 2024 09:12:35 +0800 Subject: [PATCH] =?UTF-8?q?[feat]=20=E5=93=81=E8=B4=A8=E7=AE=A1=E7=90=86?= =?UTF-8?q?=20=E5=85=A5=E5=BA=93=E5=89=8D=E9=80=80=E6=8D=A2=E8=B4=A7=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=85=A5=E5=BA=93=E5=89=8D=E9=80=80=E6=8D=A2?= =?UTF-8?q?=E8=B4=A7=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2=EF=BC=8C=E8=A1=A8?= =?UTF-8?q?=E5=8D=95=E5=85=83=E7=B4=A0=E8=AE=BE=E4=B8=BA=E5=8F=AF=E8=AF=BB?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E6=94=B9=E8=A1=A8=E6=A0=BC=E5=88=97=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E7=BB=93=E6=9E=84=EF=BC=9B=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=93=81=E8=B4=A8=E6=8A=A5=E5=91=8A=E6=8C=89=E9=92=AE=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E6=96=B9=E6=B3=95=EF=BC=9B=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=85=A5=E5=BA=93=E5=89=8D=E5=93=81=E8=B4=A8=E6=8A=A5=E5=91=8A?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=EF=BC=8C=E8=A1=A8=E5=8D=95=E5=85=83=E7=B4=A0?= =?UTF-8?q?=E8=AE=BE=E4=B8=BA=E5=8F=AF=E8=AF=BB=EF=BC=8C=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E8=A1=A8=E6=A0=BC=E5=88=97=E6=98=BE=E7=A4=BA=E7=BB=93=E6=9E=84?= =?U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=B9=E5=93=81?= =?UTF-8?q?=E8=B4=A8=E6=8A=A5=E5=91=8A=E6=8C=89=E9=92=AE=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E6=96=B9=E6=B3=95=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../afterQualityReportDetail.html | 8 +- .../beforeConfirmDelivery.html | 34 +-- .../beforeHasConfirmSupplier.html | 40 +-- .../beforeQualityReportDetail.html | 262 +++++------------- .../returnBeforeStorageDetail.html | 54 ++-- 5 files changed, 139 insertions(+), 259 deletions(-) diff --git a/ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/afterQualityReportDetail.html b/ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/afterQualityReportDetail.html index e517000a..857d3875 100644 --- a/ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/afterQualityReportDetail.html +++ b/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, diff --git a/ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/beforeConfirmDelivery.html b/ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/beforeConfirmDelivery.html index beb720a7..e9fa65d1 100644 --- a/ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/beforeConfirmDelivery.html +++ b/ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/beforeConfirmDelivery.html @@ -50,7 +50,11 @@ diff --git a/ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/beforeQualityReportDetail.html b/ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/beforeQualityReportDetail.html index 4a5339d1..57f71a96 100644 --- a/ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/beforeQualityReportDetail.html +++ b/ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/beforeQualityReportDetail.html @@ -4,32 +4,38 @@ +
-
- + +
- +
- +
- +
- +
@@ -39,22 +45,25 @@

合格数

- - + +
-
- - +
+ + + +
- - + +
- - + + +
@@ -63,9 +72,6 @@
不合格数 - - 添加 -
@@ -82,7 +88,7 @@
- +
@@ -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: '品质报告单id', - field: 'qualityOrderReportId', - visible: false - }, - - {title: '不良分类',field: 'processBadClassification', - formatter:function (value, row, index) { - return processBadClassificationFormatter(value,row,index); - } - }, - - {title: '不良等级',field: 'processBadGrade', - formatter:function (value, row, index) { - return processBadGradeFormatter(value,row,index); - } - }, - { - 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 '数量必须是正整数'; - } - } - }, - { - title: '报告', - field: 'unqualifiedReportUrl', - editable: { - mode:'inline', - type: 'text', // 表示该列可以被编辑为文本 - }, - }, - { - title: '操作', - align: 'center', - formatter: function(value, row, index) { - var actions = []; - actions.push('删除 '); - return actions.join(''); - } + { + title: '不良分类', + field: 'processBadClassification', + align: 'center', + formatter: function(value, row, index) { + return $.table.selectDictLabel(processBadClassificationDatas, value); + } + }, + { + title: '不良等级', + field: 'processBadGrade', + align: 'center', + formatter: function(value, row, index) { + return $.table.selectDictLabel(processBadGradeDatas, value); } + }, + { + title: '数量', + field: 'processBadNum', + align: 'center', + }, + { + title: '报告', + field: 'unqualifiedReportUrl', + align: 'center', + formatter: function(value, row, index) { + var actions = []; + actions.push('报告 '); + return actions.join(''); + } + }, ] }; $.table.init(options); }); - - // 逻辑删除不合格数前端的一行数据 - function removeRow(qualityOrderReportId){ - console.log(qualityOrderReportId); - // 直接使用 receivablesRecordsId 值进行删除操作 - $("#bootstrap-unqualified-table").bootstrapTable('remove', { - field: 'qualityOrderReportId', - values: qualityOrderReportId - }); - } - - - // 列中获取不良分类的下拉改变数据 - 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}); - } - - // 自定义不良分类的格式化函数 - function processBadClassificationFormatter(value, row, index) { - var selectHtml = ''; - 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 = ''; - return selectHtml; + function queryParams(params) { + var curParams = { + //传递查询参数 + materialNo: materialNo, + refundsExchangesCode: refundsExchangesCode + } + return curParams; } - \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/returnBeforeStorageDetail.html b/ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/returnBeforeStorageDetail.html index 39fdd039..ecc882e4 100644 --- a/ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/returnBeforeStorageDetail.html +++ b/ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/returnBeforeStorageDetail.html @@ -27,19 +27,19 @@
- +
- +
-
@@ -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('报告 '); + actions.push('报告 '); 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); }