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); }