diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityRefundsExchangesServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityRefundsExchangesServiceImpl.java index e82dc68d..c9f0b5dd 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityRefundsExchangesServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityRefundsExchangesServiceImpl.java @@ -198,12 +198,6 @@ public class QualityRefundsExchangesServiceImpl implements IQualityRefundsExchan refundsExchangesDetail.setRefundsExchangesCode(qualityRefundsExchanges.getRefundsExchangesCode()); refundsExchangesDetail.setDeliveryInspectionTime(qualityRefundsExchanges.getDeliveryInspectionTime()); refundsExchangesDetail.setQualityRemark(qualityRefundsExchanges.getQualityRemark()); -// refundsExchangesDetail.setSupplierCode(tempRefundsExchangesDetail.getSupplierCode()); -// refundsExchangesDetail.setSupplierName(tempRefundsExchangesDetail.getSupplierName()); -// refundsExchangesDetail.setCustomerContact(tempRefundsExchangesDetail.getCustomerContact()); -// refundsExchangesDetail.setContactNumber(tempRefundsExchangesDetail.getContactNumber()); -// refundsExchangesDetail.setSupplierAddress(tempRefundsExchangesDetail.getSupplierAddress()); -// refundsExchangesDetail.setQualityUnqualifiedNum(tempRefundsExchangesDetail.getQualityUnqualifiedNum()); refundsExchangesDetail.setUpdateBy(loginName); refundsExchangesDetail.setUpdateTime(new Date()); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSupplierController.java b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSupplierController.java index d544f2b7..e40fbc50 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSupplierController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSupplierController.java @@ -265,5 +265,25 @@ public class SysSupplierController extends BaseController return Result.getSuccessResult(sysSupplierService.getId()); } + /** + * 关联退换货 入库后退货-选择供应商-无供应商 + * */ + @PostMapping("/getSupplierName") + @ResponseBody + public List getSupplierName(String supplierCode){ + + List list = sysSupplierService.getSupplierNameByCode(supplierCode); + return list; + } + + /** + * 关联退换货 入库后退货-选择供应商-无供应商 + * */ + @PostMapping("/getSupplierCodes") + @ResponseBody + public List getSupplierCodes(){ + List list = sysSupplierService.getSupplierCodes(); + return list; + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSupplierMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSupplierMapper.java index 83b34635..d9b7f5b6 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSupplierMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSupplierMapper.java @@ -66,4 +66,14 @@ public interface SysSupplierMapper * 新增物料信息的时候查关联应商信息 */ public List selectSysSupplierWithMaterial(); + + /** + * 关联退换货 入库后退货-选择供应商-无供应商 + * */ + List getSupplierNameByCode(String supplierCode); + + /** + * 关联退换货 入库后退货-选择供应商-无供应商 + * */ + List getSupplierCodes(); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSupplierService.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSupplierService.java index d3c388e5..54dc5d59 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSupplierService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSupplierService.java @@ -72,4 +72,16 @@ public interface ISysSupplierService Object getId(); public List selectSysSupplierListAll(); + + /** + * 关联退换货 入库后退货-选择供应商-无供应商 + * */ + List getSupplierNameByCode(String supplierCode); + + + /** + * 关联退换货 入库后退货-选择供应商-无供应商 + * */ + List getSupplierCodes(); + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSupplierServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSupplierServiceImpl.java index 6523aaeb..07525158 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSupplierServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSupplierServiceImpl.java @@ -163,4 +163,25 @@ public class SysSupplierServiceImpl implements ISysSupplierService sysSupplier.setAuditStatus("1"); return sysSupplierMapper.selectSysSupplierList(sysSupplier); } + + /** + * 关联退换货 入库后退货-选择供应商-无供应商 + * */ + @Override + public List getSupplierNameByCode(String supplierCode) { + + List list = sysSupplierMapper.getSupplierNameByCode(supplierCode); + return list; + } + + + /** + * 关联退换货 入库后退货-选择供应商-无供应商 + * */ + @Override + public List getSupplierCodes() { + + List list = sysSupplierMapper.getSupplierCodes(); + return list; + } } diff --git a/ruoyi-admin/src/main/resources/mapper/system/SysSupplierMapper.xml b/ruoyi-admin/src/main/resources/mapper/system/SysSupplierMapper.xml index 8dcde90e..30226714 100644 --- a/ruoyi-admin/src/main/resources/mapper/system/SysSupplierMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/system/SysSupplierMapper.xml @@ -130,6 +130,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + + + + insert into sys_supplier diff --git a/ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/afterNoConfirmSupplier.html b/ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/afterNoConfirmSupplier.html index 69a6270f..d4d8e1a9 100644 --- a/ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/afterNoConfirmSupplier.html +++ b/ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/afterNoConfirmSupplier.html @@ -43,6 +43,8 @@ var qualityRefundsExchanges = [[${qualityRefundsExchanges}]]; + var $table = $("#bootstrap-table"); + var prefix = ctx + "quality/refundsExchanges"; $("#form-qualityRefundsExchanges-edit").validate({ focusCleanup: true @@ -79,10 +81,15 @@ "materialUnit": item.materialUnit, "materialBrand": item.materialBrand, "materialDescribe": item.materialDescribe, - "snCode": item.snCode, - "complaintProblem": item.complaintProblem, - // "emergencyDegree": item.emergencyDegree, - "adverseReportUrl": item.adverseReportUrl, + "makeTotal":item.makeTotal, + "qualityHasqualifiedNum":item.qualityHasqualifiedNum, + "thisArrivedNum":item.thisArrivedNum, + "qualityUnqualifiedNum":item.qualityUnqualifiedNum, + "supplierCode":item.supplierCode, + "supplierName":item.supplierName, + "customerContact":item.customerContact, + "contactNumber":item.contactNumber, + "supplierAddress":item.supplierAddress, // ...其他字段 }; }); @@ -180,13 +187,15 @@ title: '品质不合格数', field: 'qualityUnqualifiedNum', }, - { - title: '选择供应商ID', - field: 'supplierCode', + {title: '选择供应商ID',field: 'supplierCode', + formatter:function (value, row, index) { + return supplierCodeAsyncFormatter(value,row,index); + } }, - { - title: '选择供应商名称', - field: 'supplierName', + {title: '选择供应商名称',field: 'supplierName', + formatter:function(value, row, index){ + return getSupplierNameType(value,row,index) + } }, { title: '退货联系人', @@ -215,6 +224,78 @@ } + // 自定义供应商代码列的格式化函数,异步获取供应商代码 + function supplierCodeAsyncFormatter(value, row, index) { + var selectHtml = ''; + loadSupplierCodes(selectHtml, index); // 异步加载供应商代码 + return selectHtml; + } + + // 加载供应商代码的函数 + function loadSupplierCodes(selectHtml, index) { + $.ajax({ + url: ctx + 'system/supplier/getSupplierCodes', // 获取所有供应商代码 + type: 'POST', + dataType: 'json', + success: function (codes) { + var selectElement = $('.supplier-code:eq(' + index + ')'); + codes.forEach(function (code) { + selectElement.append(''); + }); + // 设置默认值(如果存在) + var rowData = $table.bootstrapTable('getData')[index]; + if (rowData && rowData.supplierCode) { + selectElement.val(rowData.supplierCode); + } + } + }); + } + + // 列中获取成本类型的下拉改变数据 + function supplierCodeChange(selectElement, rowIndex) { + var newSupplierCode = $(selectElement).val(); + var tableData = $table.bootstrapTable('getData'); + var newRow = tableData[rowIndex]; + newRow.supplierCode = newSupplierCode; + // getSupplierNameType(newRow.supplierCode,newRow,rowIndex); + $table.bootstrapTable('updateRow', {index: rowIndex, row: newRow}); + + } + + function getSupplierNameType(value, row, index) { + var selectHtml = ''; + return selectHtml; + } + } + + // 供应商名称改变时的处理函数 + function onSupplierNameChange(selectElement, rowIndex) { + var newSupplierName = $(selectElement).val(); + var tableData = $table.bootstrapTable('getData'); + var newRow = tableData[rowIndex]; // 获取当前行数据 + newRow.supplierName = newSupplierName; + // 更新行数据 + $table.bootstrapTable('updateRow', {index: rowIndex, row: newRow}); + } \ No newline at end of file