From 0d1234bce1cad6e6fafd2f99c4ad644bf06fd10e Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Tue, 21 May 2024 17:05:26 +0800 Subject: [PATCH] =?UTF-8?q?[feat]=E5=93=81=E8=B4=A8=E7=AE=A1=E7=90=86:=20?= =?UTF-8?q?=E5=93=81=E8=B4=A8=E5=8D=95=20=E6=96=B0=E5=A2=9E=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=93=81=E8=B4=A8=E5=8D=95=E6=8A=A5=E5=91=8A=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=20=E6=96=B0=E5=A2=9E=E4=BF=AE=E6=94=B9=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E5=93=81=E8=B4=A8=E5=8D=95=E6=8A=A5=E5=91=8A=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=20=E4=BF=AE=E6=94=B9startingQuality.html=20=E5=93=81?= =?UTF-8?q?=E8=B4=A8=E5=8D=95=E6=8A=A5=E5=91=8A=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/QualityOrderController.java | 32 +++++++++++++++++++ .../quality/qualityOrder/startingQuality.html | 25 ++++++++++++--- 2 files changed, 52 insertions(+), 5 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityOrderController.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityOrderController.java index 42a0732c..c725cbbc 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityOrderController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityOrderController.java @@ -5,7 +5,9 @@ import java.util.Map; import java.util.stream.Collectors; import com.ruoyi.quality.domain.QualityOrderDetail; +import com.ruoyi.quality.domain.QualityOrderReport; import com.ruoyi.quality.service.IQualityOrderDetailService; +import com.ruoyi.quality.service.IQualityOrderReportService; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -38,6 +40,9 @@ public class QualityOrderController extends BaseController @Autowired private IQualityOrderDetailService detailService; + @Autowired + private IQualityOrderReportService orderReportService; + @RequiresPermissions("quality:qualityOrder:view") @GetMapping() public String qualityOrder() @@ -150,4 +155,31 @@ public class QualityOrderController extends BaseController .collect(Collectors.groupingBy(QualityOrderDetail::getSupplierCode)); return groupedDetails; } + + + + /** + * 修改品质单报告 + */ + @GetMapping("/qualityReport") + public String qualityReport( @RequestParam("materialNo") String materialNo, + @RequestParam("supplierCode") String supplierCode, ModelMap mmap) + { +// QualityOrder qualityOrder = qualityOrderService.selectQualityOrderById(qualityOrderId); + QualityOrderReport qualityOrderReport = orderReportService.selectQualityOrderReportByNoAndCode(materialNo,supplierCode); + mmap.put("qualityOrderReport", qualityOrderReport); + return prefix + "/qualityOrderReport"; + } + + /** + * 修改保存品质单报告 + */ + @RequiresPermissions("quality:qualityOrder:qualityReport") + @Log(title = "品质管理品质单", businessType = BusinessType.UPDATE) + @PostMapping("/qualityReport") + @ResponseBody + public AjaxResult orderReportSave(@RequestBody QualityOrderReport qualityOrderReport) + { + return toAjax(orderReportService.updateQualityOrderReport(qualityOrderReport)); + } } diff --git a/ruoyi-admin/src/main/resources/templates/quality/qualityOrder/startingQuality.html b/ruoyi-admin/src/main/resources/templates/quality/qualityOrder/startingQuality.html index 29c02e8f..9783c0b7 100644 --- a/ruoyi-admin/src/main/resources/templates/quality/qualityOrder/startingQuality.html +++ b/ruoyi-admin/src/main/resources/templates/quality/qualityOrder/startingQuality.html @@ -147,7 +147,13 @@ data: supplierData, columns: [{ checkbox: true - }, { + }, + { + title: '供应商ID', + field: 'supplierCode', + visible: false + }, + { title: '料号', field: 'materialNo' }, { @@ -198,8 +204,9 @@ title: '品质报告', align: 'center', formatter: function(value, row, index) { + // 这里直接使用row对象获取supplierCode,假设它是存在的 var actions = []; - actions.push('报告 '); + actions.push('报告 '); return actions.join(''); } }, @@ -219,9 +226,17 @@ /*品质报告*/ - function qualityReport(materialNo){ - var url = ctx + 'quality/qualityOrder/qualityReport/'+materialNo; - $.modal.open("品质报告",url); + // function qualityReport(materialNo, supplierCode){ + // var url = ctx + 'quality/qualityOrder/qualityReport/' + materialNo + '?supplierCode=' + encodeURIComponent(supplierCode); + // $.modal.open("品质报告", url); + // } + function qualityReport(materialNo, supplierCode) { + var queryParams = new URLSearchParams(); + queryParams.append('materialNo', materialNo); + queryParams.append('supplierCode', encodeURIComponent(supplierCode)); + + var url = ctx + 'quality/qualityOrder/qualityReport?' + queryParams.toString(); + $.modal.open("品质报告", url); }