From 3cd95f7857bf4aa1ebb345eec516396d60332281 Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Fri, 27 Sep 2024 14:28:25 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=20=E9=94=80=E5=94=AE=E7=AE=A1=E7=90=86=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AE=A2=E6=88=B7=E6=8A=A5=E4=BB=B7=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E9=A1=B5=E9=9D=A2=E7=9A=84url=EF=BC=8C=E9=87=87?= =?UTF-8?q?=E7=94=A8=E7=BB=9F=E4=B8=80base=20=E4=BF=AE=E6=94=B9=E5=AE=A2?= =?UTF-8?q?=E6=88=B7=E6=8A=A5=E4=BB=B7=E4=BF=AE=E6=94=B9=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E7=9A=84url=EF=BC=8C=E9=87=87=E7=94=A8=E7=BB=9F=E4=B8=80base?= =?UTF-8?q?=20=E4=BF=AE=E6=94=B9=E5=AE=A2=E6=88=B7=E6=8A=A5=E4=BB=B7?= =?UTF-8?q?=E9=A9=B3=E5=9B=9E=E8=B0=83=E6=95=B4=E9=A1=B5=E9=9D=A2=E7=9A=84?= =?UTF-8?q?url=EF=BC=8C=E9=87=87=E7=94=A8=E7=BB=9F=E4=B8=80base=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=94=80=E5=94=AE=E8=AE=A2=E5=8D=95=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E9=A1=B5=E9=9D=A2=E7=9A=84url=EF=BC=8C=E9=87=87?= =?UTF-8?q?=E7=94=A8=E7=BB=9F=E4=B8=80base=20=E9=94=80=E5=94=AE=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=EF=BC=9A=E6=9C=80=E6=96=B0=E6=8A=A5=E4=BB=B7(RMB)=E3=80=81?= =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=E9=9C=80=E6=B1=82?= =?UTF-8?q?=EF=BC=9B=E6=96=B0=E5=A2=9E=E6=9F=A5=E6=89=BE=E6=9C=80=E6=96=B0?= =?UTF-8?q?=E7=9A=84=E6=8A=A5=E4=BB=B7=E6=95=B0=E6=8D=AE=E5=89=8D=E7=AB=AF?= =?UTF-8?q?js=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/system/customerQuote/add.html | 2 +- .../templates/system/customerQuote/edit.html | 2 +- .../system/customerQuote/taskModifyApply.html | 2 +- .../templates/system/salesOrder/add.html | 4 +- .../templates/system/salesOrder/detail.html | 26 +++- .../templates/system/salesOrder/edit.html | 6 +- .../system/salesOrder/taskModifyApply.html | 146 ++++++++++++------ .../system/salesOrder/taskYwjlVerify.html | 22 +++ .../system/salesOrder/taskYwzgVerify.html | 23 +++ .../system/salesOrder/taskZozjVerify.html | 22 +++ 10 files changed, 205 insertions(+), 50 deletions(-) diff --git a/ruoyi-admin/src/main/resources/templates/system/customerQuote/add.html b/ruoyi-admin/src/main/resources/templates/system/customerQuote/add.html index 9ff58600..3d58390d 100644 --- a/ruoyi-admin/src/main/resources/templates/system/customerQuote/add.html +++ b/ruoyi-admin/src/main/resources/templates/system/customerQuote/add.html @@ -732,7 +732,7 @@ return new Promise((resolve, reject) => { // 使用AJAX请求从服务器获取最近的报价信息 $.ajax({ - url: prefix + '/queryLatestRecentQuotation', // 假设这是你的API路径 + url: prefix + '/queryLatestRecentQuotation', type: 'GET', data: { materialNo: materialNo, customerCode: $("#customerCode").val() }, success: function (data) { diff --git a/ruoyi-admin/src/main/resources/templates/system/customerQuote/edit.html b/ruoyi-admin/src/main/resources/templates/system/customerQuote/edit.html index 5cf6f49d..580f4825 100644 --- a/ruoyi-admin/src/main/resources/templates/system/customerQuote/edit.html +++ b/ruoyi-admin/src/main/resources/templates/system/customerQuote/edit.html @@ -502,7 +502,7 @@ return new Promise((resolve, reject) => { // 使用AJAX请求从服务器获取最近的报价信息 $.ajax({ - url: prefix + '/queryLatestRecentQuotation', // 假设这是你的API路径 + url: prefix + '/queryLatestRecentQuotation', type: 'GET', data: { materialNo: materialNo, customerCode: $("#customerCode").val() }, success: function (data) { diff --git a/ruoyi-admin/src/main/resources/templates/system/customerQuote/taskModifyApply.html b/ruoyi-admin/src/main/resources/templates/system/customerQuote/taskModifyApply.html index 532f4474..c09d3a44 100644 --- a/ruoyi-admin/src/main/resources/templates/system/customerQuote/taskModifyApply.html +++ b/ruoyi-admin/src/main/resources/templates/system/customerQuote/taskModifyApply.html @@ -563,7 +563,7 @@ return new Promise((resolve, reject) => { // 使用AJAX请求从服务器获取最近的报价信息 $.ajax({ - url: prefix + '/queryLatestRecentQuotation', // 假设这是你的API路径 + url: prefix + '/queryLatestRecentQuotation', type: 'GET', data: { materialNo: materialNo, customerCode: $("#customerCode").val() }, success: function (data) { diff --git a/ruoyi-admin/src/main/resources/templates/system/salesOrder/add.html b/ruoyi-admin/src/main/resources/templates/system/salesOrder/add.html index 4e962ad2..ae29ab92 100644 --- a/ruoyi-admin/src/main/resources/templates/system/salesOrder/add.html +++ b/ruoyi-admin/src/main/resources/templates/system/salesOrder/add.html @@ -332,7 +332,7 @@ id:'bootstrap-sub-table-order', pagination: false, sidePagination: "client", - model: "物料报价信息", + model: "物料信息", fixedColumns: true, // 启用冻结列 fixedRightNumber: 1, // 冻结右列个数 columns: [ @@ -994,7 +994,7 @@ return new Promise((resolve, reject) => { // 使用AJAX请求从服务器获取最近的报价信息 $.ajax({ - url: ctx + 'system/customerQuote/queryLatestRecentQuotation', // 假设这是你的API路径 + url: ctx + 'system/customerQuote/queryLatestRecentQuotation', type: 'GET', data: { materialNo: materialNo, customerCode: $("#enterpriseCode").val() }, success: function (data) { diff --git a/ruoyi-admin/src/main/resources/templates/system/salesOrder/detail.html b/ruoyi-admin/src/main/resources/templates/system/salesOrder/detail.html index b6a9e32b..3527f379 100644 --- a/ruoyi-admin/src/main/resources/templates/system/salesOrder/detail.html +++ b/ruoyi-admin/src/main/resources/templates/system/salesOrder/detail.html @@ -338,7 +338,7 @@ showToggle: false, showColumns: false, pagination: false, // 设置不分页 - model: "物料报价信息", + model: "物料信息", columns: [ {checkbox: true}, {field: 'index',align: 'center', title: "序号", @@ -356,6 +356,17 @@ { title: '单位',field: 'unit',align: 'center', formatter: function(value, row, index) {return $.table.selectDictLabel(sysUnitClassDatas, value);}}, {title: '半成品类型',field: 'processMethod',align: 'center',formatter: function(value, row, index) {return $.table.selectDictLabel(processMethodDatas, value);}}, { title: '对外售价',field: 'materialSole'}, + { title: '最新报价(RMB)',field: 'recentQuotationRMB',align: 'center',}, + { title: '最新报价(美元)',field: 'recentQuotationUSD',align: 'center',}, + { title: '最新报价历史',align: 'center', + + formatter: function (value, row, index) { + var actions = []; + actions.push('最新报价历史 '); + return actions.join(''); + } + }, + {title: '国内税率',field: 'countTax',align: 'center'}, { title: '美元汇率',field: 'usdTax', align: 'center'}, { title: '物料的不含税单价(RMB)', @@ -629,6 +640,19 @@ autoclose: true }); // 结算金额 + + + //最新报价历史 + function recentQuotationHistory(materialCode){ + var customerCode = $("#enterpriseCode").val(); + var queryParams = new URLSearchParams(); + queryParams.append("materialCode", materialCode); + queryParams.append("customerCode", encodeURIComponent(customerCode)); + var url = ctx +'system/customerQuote/recentQuotationHistory?'+queryParams.toString(); + + $.modal.open("最新报价历史", url); + } + diff --git a/ruoyi-admin/src/main/resources/templates/system/salesOrder/edit.html b/ruoyi-admin/src/main/resources/templates/system/salesOrder/edit.html index 542852a9..3c58ff1f 100644 --- a/ruoyi-admin/src/main/resources/templates/system/salesOrder/edit.html +++ b/ruoyi-admin/src/main/resources/templates/system/salesOrder/edit.html @@ -348,7 +348,7 @@ queryParams: queryParams, sidePagination: "client", uniqueId: "index", - model: "物料报价信息", + model: "物料信息", fixedColumns: true, // 启用冻结列 rightFixedColumns:1, fixedRightNumber: 1, // 冻结右列个数 @@ -748,6 +748,10 @@ } layer.close(index); } + + + + function insertRow() { var url = ctx + "erp/material/select"; var options = { diff --git a/ruoyi-admin/src/main/resources/templates/system/salesOrder/taskModifyApply.html b/ruoyi-admin/src/main/resources/templates/system/salesOrder/taskModifyApply.html index c4694bc6..359b4342 100644 --- a/ruoyi-admin/src/main/resources/templates/system/salesOrder/taskModifyApply.html +++ b/ruoyi-admin/src/main/resources/templates/system/salesOrder/taskModifyApply.html @@ -372,6 +372,16 @@ } }, { title: '对外售价',field: 'materialSole',editable: true}, + { title: '最新报价(RMB)',field: 'recentQuotationRMB',align: 'center',}, + { title: '最新报价(美元)',field: 'recentQuotationUSD',align: 'center',}, + { title: '最新报价历史',align: 'center', + + formatter: function (value, row, index) { + var actions = []; + actions.push('最新报价历史 '); + return actions.join(''); + } + }, {title: '国内税率',field: 'countTax',align: 'center',editable: true}, { title: '美元汇率',field: 'usdTax', align: 'center',editable: true}, {field: 'materialNum',align: 'center',title: '物料的数量',editable: true}, @@ -546,51 +556,88 @@ } function doSubmit(index, layero,uniqueId){ var iframeWin = window[layero.find('iframe')[0]['name']]; - var rowData = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections')[0]; - console.log("rowData:"+rowData); - var totalNum = $("#bootstrap-select-table").bootstrapTable('getData').length; - var rmb1 = $("#taxRate_edit").val(); - if (rmb1 =='' || rmb1== null){ - rmb1 = 0; - }else{ - rmb1 = $("#taxRate_edit").val(); - } - var rmb = Number(rmb1).toFixed(2) / 100; - var usd = $("#usdTax_edit").val(); - if (usd =='' || usd== null){ - usd = 0; - }else{ - usd = Number(usd).toFixed(2); + var selectedRows = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections'); + + if (selectedRows.length == 0){ + $.modal.alertWarning("请选择至少一条物料信息"); + return; } - $("#bootstrap-sub-table-editOrder4").bootstrapTable('insertRow', { - index: 1, - row: { - id:'', - materialId:rowData.id, - materialCode: rowData.materialNo, - materialName: rowData.materialName, - materialType: rowData.materialType, - describe: rowData.describe, - brand: rowData.brand, - photoUrl: rowData.photoUrl, - unit: rowData.unit, - processMethod: rowData.processMethod, - countTax:rmb, - usdTax: usd, - materialSole: rowData.materialSole, - materialNum: 0, - materialNoRmb: 0.0, - materialNoUsd: 0.0, - materialRmb: 0.0, - materialNoRmbSum: 0.0, - materialRmbSum: 0, - materialUsd: 0.0, - materialUsdSum: 0.0, - materialNoUsdSum: 0.0, - remark: "", + + var existingData = $("#bootstrap-sub-table-order").bootstrapTable('getData'); + var materialCodesSet = new Set(); //使用Set来存储物料号 + + + //存储所有现有的物料号 + existingData.forEach(function(row){ + materialCodesSet.add(row.materialCode); + }); + + //存储所有即将插入的料号 + var newMaterialCodesSet = new Set(); + + var promises = selectedRows.map(rowData =>{ + //检查是否已经存在相同的料号 + if (materialCodesSet.has(rowData.materialNo) || newMaterialCodesSet.has(rowData.materialNo)){ + $.modal.alertError("不能选择已添加过的相同料号" + rowData.materialNo); + return Promise.reject("Duplicate material number: " + rowData.materialNo); } - }) - layer.close(index); + + //表记即将插入的物料号 + newMaterialCodesSet.add(rowData.materialNo); + + return queryRecentQuotation(rowData.materialNo) + .then(function(quotationData){ + return { + materialId: rowData.id, + materialCode: rowData.materialNo, + materialName: rowData.materialName, + materialType: rowData.materialType, + describe: rowData.describe, + brand: rowData.brand, + unit: rowData.unit, + processMethod: rowData.processMethod, + photoUrl: rowData.photoUrl, + warehouseDept: rowData.warehouseDept, + countTax: $("#taxRate_add").val(), + usdTax: $("#usdTax_add").val(), + materialSole: 0, + recentQuotationRMB: quotationData.data.materialRmb || '', + recentQuotationUSD: quotationData.data.materialUsd || '', + materialNum: "", + materialNoRmb: 0.00, + materialNoUsd: 0.00, + materialRmb: 0.00, + materialNoRmbSum: 0.00, + materialRmbSum: 0.00, + materialUsd: 0.00, + materialUsdSum: 0.00, + materialNoUsdSum: 0.00, + createBy: "", + createTime: "", + updateBy: "", + updateTime: "", + remark: "", + } + }) + + }); + + //使用promise.all来等待所有请求完成, 并将结果直接存入newRows + Promise.all(promises) + .then(function(newRows){ + + + //批量插入新行 + newRows.forEach(function(row){ + $("#bootstrap-sub-table-order").bootstrapTable('insertRow', {index: 1, row: row}); + }); + + layer.close(index); + }) + .catch(function(error){ + console.error('Some requests failed:', error); + layer.close(index); + }); } function insertRow() { var url = ctx + "erp/material/select"; @@ -685,6 +732,19 @@ } } } + + + //最新报价历史 + function recentQuotationHistory(materialCode){ + var customerCode = $("#enterpriseCode").val(); + var queryParams = new URLSearchParams(); + queryParams.append("materialCode", materialCode); + queryParams.append("customerCode", encodeURIComponent(customerCode)); + var url = ctx +'system/customerQuote/recentQuotationHistory?'+queryParams.toString(); + + $.modal.open("最新报价历史", url); + } + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/salesOrder/taskYwjlVerify.html b/ruoyi-admin/src/main/resources/templates/system/salesOrder/taskYwjlVerify.html index a8cb64e0..e0dd02b3 100644 --- a/ruoyi-admin/src/main/resources/templates/system/salesOrder/taskYwjlVerify.html +++ b/ruoyi-admin/src/main/resources/templates/system/salesOrder/taskYwjlVerify.html @@ -356,6 +356,17 @@ { title: '单位',field: 'unit',align: 'center', formatter: function(value, row, index) {return $.table.selectDictLabel(sysUnitClassDatas, value);}}, {title: '半成品类型',field: 'processMethod',align: 'center',formatter: function(value, row, index) {return $.table.selectDictLabel(processMethodDatas, value);}}, { title: '对外售价',field: 'materialSole'}, + { title: '最新报价(RMB)',field: 'recentQuotationRMB',align: 'center',}, + { title: '最新报价(美元)',field: 'recentQuotationUSD',align: 'center',}, + { title: '最新报价历史',align: 'center', + + formatter: function (value, row, index) { + var actions = []; + actions.push('最新报价历史 '); + return actions.join(''); + } + }, + {title: '国内税率',field: 'countTax',align: 'center'}, { title: '美元汇率',field: 'usdTax', align: 'center'}, { title: '物料的不含税单价(RMB)', @@ -512,6 +523,17 @@ $.operate.save(prefix + "/complete/" + taskId,formData); } } + + //最新报价历史 + function recentQuotationHistory(materialCode){ + var customerCode = $("#enterpriseCode").val(); + var queryParams = new URLSearchParams(); + queryParams.append("materialCode", materialCode); + queryParams.append("customerCode", encodeURIComponent(customerCode)); + var url = ctx +'system/customerQuote/recentQuotationHistory?'+queryParams.toString(); + + $.modal.open("最新报价历史", url); + } \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/salesOrder/taskYwzgVerify.html b/ruoyi-admin/src/main/resources/templates/system/salesOrder/taskYwzgVerify.html index 3a05c3b0..08713791 100644 --- a/ruoyi-admin/src/main/resources/templates/system/salesOrder/taskYwzgVerify.html +++ b/ruoyi-admin/src/main/resources/templates/system/salesOrder/taskYwzgVerify.html @@ -355,6 +355,18 @@ { title: '单位',field: 'unit',align: 'center', formatter: function(value, row, index) {return $.table.selectDictLabel(sysUnitClassDatas, value);}}, {title: '半成品类型',field: 'processMethod',align: 'center',formatter: function(value, row, index) {return $.table.selectDictLabel(processMethodDatas, value);}}, { title: '对外售价',field: 'materialSole'}, + { title: '最新报价(RMB)',field: 'recentQuotationRMB',align: 'center',}, + { title: '最新报价(美元)',field: 'recentQuotationUSD',align: 'center',}, + { title: '最新报价历史',align: 'center', + + formatter: function (value, row, index) { + var actions = []; + actions.push('最新报价历史 '); + return actions.join(''); + } + }, + + {title: '国内税率',field: 'countTax',align: 'center'}, { title: '美元汇率',field: 'usdTax', align: 'center'}, { title: '物料的不含税单价(RMB)', @@ -530,6 +542,17 @@ } } + //最新报价历史 + function recentQuotationHistory(materialCode){ + var customerCode = $("#enterpriseCode").val(); + var queryParams = new URLSearchParams(); + queryParams.append("materialCode", materialCode); + queryParams.append("customerCode", encodeURIComponent(customerCode)); + var url = ctx +'system/customerQuote/recentQuotationHistory?'+queryParams.toString(); + + $.modal.open("最新报价历史", url); + } + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/salesOrder/taskZozjVerify.html b/ruoyi-admin/src/main/resources/templates/system/salesOrder/taskZozjVerify.html index 5b6873d4..86727c4a 100644 --- a/ruoyi-admin/src/main/resources/templates/system/salesOrder/taskZozjVerify.html +++ b/ruoyi-admin/src/main/resources/templates/system/salesOrder/taskZozjVerify.html @@ -356,6 +356,17 @@ { title: '单位',field: 'unit',align: 'center', formatter: function(value, row, index) {return $.table.selectDictLabel(sysUnitClassDatas, value);}}, {title: '半成品类型',field: 'processMethod',align: 'center',formatter: function(value, row, index) {return $.table.selectDictLabel(processMethodDatas, value);}}, { title: '对外售价',field: 'materialSole'}, + { title: '最新报价(RMB)',field: 'recentQuotationRMB',align: 'center',}, + { title: '最新报价(美元)',field: 'recentQuotationUSD',align: 'center',}, + { title: '最新报价历史',align: 'center', + + formatter: function (value, row, index) { + var actions = []; + actions.push('最新报价历史 '); + return actions.join(''); + } + }, + {title: '国内税率',field: 'countTax',align: 'center'}, { title: '美元汇率',field: 'usdTax', align: 'center'}, { title: '物料的不含税单价(RMB)', @@ -532,6 +543,17 @@ } } + //最新报价历史 + function recentQuotationHistory(materialCode){ + var customerCode = $("#enterpriseCode").val(); + var queryParams = new URLSearchParams(); + queryParams.append("materialCode", materialCode); + queryParams.append("customerCode", encodeURIComponent(customerCode)); + var url = ctx +'system/customerQuote/recentQuotationHistory?'+queryParams.toString(); + + $.modal.open("最新报价历史", url); + } + \ No newline at end of file