From 5f6b4b21ede48d075df9ae02f55c5cd007989c99 Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Mon, 3 Jun 2024 16:31:59 +0800 Subject: [PATCH] =?UTF-8?q?[feat]=E5=93=81=E8=B4=A8=E7=AE=A1=E7=90=86:=20?= =?UTF-8?q?=E9=80=80=E6=8D=A2=E8=B4=A7=20=E4=BF=AE=E6=94=B9=E5=85=A5?= =?UTF-8?q?=E5=BA=93=E5=90=8E=E9=80=80=E8=B4=A7-=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E4=BE=9B=E5=BA=94=E5=95=86-=E6=97=A0=E4=BE=9B=E5=BA=94?= =?UTF-8?q?=E5=95=86afterNoConfirmSupplier.html=E9=A1=B5=E9=9D=A2=E7=9A=84?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=20afterNoConfirmSupplier.html=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E4=BE=9B=E5=BA=94=E5=95=86=E7=9B=B8=E5=85=B3=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=20=E6=96=B0=E5=A2=9E=E6=9F=A5=E8=AF=A2=E4=BE=9B?= =?UTF-8?q?=E5=BA=94=E5=95=86=E6=89=80=E6=9C=89Id=E7=9A=84=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=20=E6=96=B0=E5=A2=9E=E6=A0=B9=E6=8D=AE=E4=BE=9B?= =?UTF-8?q?=E5=BA=94=E5=95=86ID=E6=9F=A5=E6=89=BE=E4=BE=9B=E5=BA=94?= =?UTF-8?q?=E5=95=86=E5=90=8D=E7=A7=B0=E7=9A=84=E6=8E=A5=E5=8F=A3=20afterN?= =?UTF-8?q?oConfirmSupplier.html?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../QualityRefundsExchangesServiceImpl.java | 6 -- .../controller/SysSupplierController.java | 20 ++++ .../system/mapper/SysSupplierMapper.java | 10 ++ .../system/service/ISysSupplierService.java | 12 +++ .../service/impl/SysSupplierServiceImpl.java | 21 ++++ .../mapper/system/SysSupplierMapper.xml | 11 ++ .../afterNoConfirmSupplier.html | 101 ++++++++++++++++-- 7 files changed, 165 insertions(+), 16 deletions(-) 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