Browse Source

[feat]品质管理:

品质单
新增修改品质单报告接口
新增修改保存品质单报告接口
修改startingQuality.html 品质单报告页面
dev
liuxiaoxu 6 months ago
parent
commit
0d1234bce1
  1. 32
      ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityOrderController.java
  2. 25
      ruoyi-admin/src/main/resources/templates/quality/qualityOrder/startingQuality.html

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

25
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('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="qualityReport(\'' + row.materialNo + '\')"><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.supplierCode + '\')"><i class="fa fa-plus"></i>报告</a> ');
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);
}
</script>
</body>

Loading…
Cancel
Save