diff --git a/ruoyi-admin/src/main/resources/templates/system/customerQuote/detail.html b/ruoyi-admin/src/main/resources/templates/system/customerQuote/detail.html index 70db2877..7d11c970 100644 --- a/ruoyi-admin/src/main/resources/templates/system/customerQuote/detail.html +++ b/ruoyi-admin/src/main/resources/templates/system/customerQuote/detail.html @@ -196,92 +196,28 @@ } }, { title: '对外售价',field: 'materialSole', - editable: { - type: 'number', - mode: 'inline', - title: '对外售价', - validate: function (value) { - if (!value) { - return '对外售价不能为空'; - } - if (isNaN(value)) { - return '对外售价必须为数字'; - } - } + }, + { 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',}, {field: 'materialNum',align: 'center',title: '物料的数量', - editable:{ - type : 'text', - mode: 'inline', - title : '物料的数量', - validate : function(value) { - if (!value) { - return '用量不能为空'; - } - if (isNaN(value)) { - return '用量必须为数字'; - } - } - }, }, { title: '物料的不含税单价(RMB)', field: 'materialNoRmb', align: 'center', - editable:{ - type: 'text', // 使用'text'类型,因为我们需自定义验证小数 - mode: 'inline', - enabled: function() { - return ($("#commonCurrency_add").val() === '1'); // 当货币类型为2时启用 - }, - title: '物料的不含税单价(RMB)', - validate: function(value) { - // 验证是否为空 - if (!value) { - return '金额不能为空'; - } - // 尝试转换为浮点数并检查是否成功 - var num = parseFloat(value); - if (isNaN(num)) { - return '请输入有效的数字'; - } - // 检查小数点后是否有超过两位的数字 - var decimalPart = num.toString().split('.')[1]; // 获取小数部分 - if (decimalPart && decimalPart.length > 2) { - return '请输入精确到小数点后两位的数字'; - } - } - } }, {title: '物料的不含税单价(美元)', field: 'materialNoUsd', align: 'center', - editable: { - type: 'text', // 使用'text'类型,因为我们需自定义验证小数 - mode: 'inline', - enabled: function() { - return ($("#commonCurrency_add").val() === '2'); // 当货币类型为2时启用 - }, - title: '物料的不含税单价(美元)', - validate: function(value) { - // 验证是否为空 - if (!value) { - return '金额不能为空'; - } - // 尝试转换为浮点数并检查是否成功 - var num = parseFloat(value); - if (isNaN(num)) { - return '请输入有效的数字'; - } - // 检查小数点后是否有超过两位的数字 - var decimalPart = num.toString().split('.')[1]; // 获取小数部分 - if (decimalPart && decimalPart.length > 2) { - return '请输入精确到小数点后两位的数字'; - } - } - } }, {title: '物料的含税单价(RMB)',field: 'materialRmb',align: 'center'}, {title: '物料的含税总价(RMB)',field: 'materialNoRmbSum',align: 'center'}, @@ -373,6 +309,16 @@ $("#noUsdSum_detail").val(noUsdSum); $("#usdSum_detail").val(usdSum); } + + function recentQuotationHistory(materialCode){ + var customerCode = $("#customerCode").val(); + var queryParams = new URLSearchParams(); + queryParams.append("materialCode", materialCode); + queryParams.append("customerCode", encodeURIComponent(customerCode)); + var url = prefix + '/recentQuotationHistory?'+queryParams.toString(); + + $.modal.open("最新报价历史", url); + } \ No newline at end of file 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 609553aa..a9fa7f8f 100644 --- a/ruoyi-admin/src/main/resources/templates/system/customerQuote/edit.html +++ b/ruoyi-admin/src/main/resources/templates/system/customerQuote/edit.html @@ -251,6 +251,16 @@ } } }, + { 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',}, {field: 'materialNum',align: 'center',title: '物料的数量', @@ -404,46 +414,139 @@ } } } - function doSubmit(index, layero,uniqueId){ + function doSubmit(index, layero, uniqueId) { console.log(uniqueId); var iframeWin = window[layero.find('iframe')[0]['name']]; - var rowData = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections')[0]; - console.log("rowData: "+rowData); - let enterpriseSum = $("#enterpriseSum").val(); - $("#enterpriseSum").val((enterpriseSum==''?0:enterpriseSum) + 1); - var timestamp = new Date().getTime(); - var totalNum = $("#bootstrap-table-Quote-child-edit1").bootstrapTable('getData').length; - $("#bootstrap-table-Quote-child-edit1").bootstrapTable('insertRow', { - index: totalNum, - row: { - id:'', - quoteId:$("#supplierCode").val(), - 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: '', - usdTax: '', - materialSole: "", - materialRmb: "", - materialNum: "", - materialNoRmb: "", - materialNoUsd: "", - materialRmb: "", - materialNoRmbSum: "", - materialRmbSum: "", - materialUsd: "", - materialUsdSum: "", - materialNoUsdSum: "", - remark: "", + var selectedRows = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections'); + + if (selectedRows.length === 0) { + $.modal.alertError("请选择至少一条物料信息"); + return; + } + + var existingData = $("#bootstrap-sub-table-quoteChild").bootstrapTable('getData'); + var promises = []; + + // 存储要插入的新行 + var newRows = []; + + // 遍历选中的每一行物料信息 + for (var i = 0; i < selectedRows.length; i++) { + var rowData = selectedRows[i]; + + // 检查是否已经存在相同的物料 + var isDuplicate = false; + for (var j = 0; j < existingData.length; j++) { + if (existingData[j].materialCode === rowData.materialNo) { + isDuplicate = true; + break; + } + } + + if (!isDuplicate) { + // 如果不存在,则准备插入新行,并发起查询请求 + promises.push(queryRecentQuotation(rowData.materialNo).then(function (quotationData) { + // 将查询结果赋值给 newRows 中的相应字段 + 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, + countTax: '', + usdTax: '', + materialNum: "", + materialSole: "", + recentQuotationRMB: quotationData.data.materialRmb || '', + recentQuotationUSD: quotationData.data.materialUsd || '', + materialRmb: "", + materialNoRmb: "", + materialNoUsd: "", + materialUsd: "", + materialUsdSum: "", + materialNoUsdSum: "", + materialNoRmbSum: "", + materialRmbSum: "", + createBy: "", + createTime: "", + updateBy: "", + updateTime: "", + remark: "", + }; + }).catch(function (error) { + // 返回一个默认对象以保证数据结构一致 + 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, + countTax: '', + usdTax: '', + materialNum: "", + materialSole: "", + recentQuotationRMB: '', + recentQuotationUSD: '', + materialRmb: "", + materialNoRmb: "", + materialNoUsd: "", + materialUsd: "", + materialUsdSum: "", + materialNoUsdSum: "", + materialNoRmbSum: "", + materialRmbSum: "", + createBy: "", + createTime: "", + updateBy: "", + updateTime: "", + remark: "", + }; + })); + } else { + $.modal.alertError("不能选择已添加过的相同料号"); } - }) - layer.close(index); + } + + // 使用Promise.all等待所有查询完成 + Promise.all(promises).then(function (rows) { + newRows = rows.filter(row => !!row); // 清除可能的null或undefined + if (newRows.length > 0) { + // 批量插入新行 + for (var k = 0; k < newRows.length; k++) { + $("#bootstrap-sub-table-quoteChild").bootstrapTable('insertRow', { index: 1, row: newRows[k] }); + } + } + layer.close(index); + }).catch(function (error) { + console.error('Some requests failed:', error); + layer.close(index); + }); + } + + // 查找最新的报价数据 + function queryRecentQuotation(materialNo) { + return new Promise((resolve, reject) => { + // 使用AJAX请求从服务器获取最近的报价信息 + $.ajax({ + url: prefix + '/queryLatestRecentQuotation', // 假设这是你的API路径 + type: 'GET', + data: { materialNo: materialNo, customerCode: $("#customerCode").val() }, + success: function (data) { + resolve(data); // 成功时解析数据 + }, + error: function (jqXHR, textStatus, errorThrown) { + reject(new Error('查找最新报价数据失败')); // 失败时抛出错误 + } + }); + }); } function insertRow() { var url = ctx + "erp/material/select"; @@ -502,6 +605,19 @@ function toPercentage(numerator, denominator) { return (numerator / denominator) * 100 + '%'; } + + + //最新报价历史 + function recentQuotationHistory(materialCode){ + var customerCode = $("#customerCode").val(); + var queryParams = new URLSearchParams(); + queryParams.append("materialCode", materialCode); + queryParams.append("customerCode", encodeURIComponent(customerCode)); + var url = prefix + '/recentQuotationHistory?'+queryParams.toString(); + + $.modal.open("最新报价历史", url); + } + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/customerQuote/recentQuotationHistory.html b/ruoyi-admin/src/main/resources/templates/system/customerQuote/recentQuotationHistory.html index d27fcc3e..9048c2b3 100644 --- a/ruoyi-admin/src/main/resources/templates/system/customerQuote/recentQuotationHistory.html +++ b/ruoyi-admin/src/main/resources/templates/system/customerQuote/recentQuotationHistory.html @@ -24,6 +24,9 @@ var options = { url: prefix + "/recentQuotationHistoryList", modalName: "客户报价历史", + showSearch: false, + showRefresh: false, + showToggle: false, queryParams: { materialCode: materialCode, customerCode: customerCode 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 375f1517..532f4474 100644 --- a/ruoyi-admin/src/main/resources/templates/system/customerQuote/taskModifyApply.html +++ b/ruoyi-admin/src/main/resources/templates/system/customerQuote/taskModifyApply.html @@ -269,6 +269,8 @@ } } }, + { title: '最新报价(RMB)',field: 'recentQuotationRMB',align: 'center',}, + { title: '最新报价(美元)',field: 'recentQuotationUSD',align: 'center',}, {title: '国内税率',field: 'countTax',align: 'center',}, { title: '美元汇率',field: 'usdTax', align: 'center',}, {field: 'materialNum',align: 'center',title: '物料的数量', @@ -439,46 +441,143 @@ } } - function doSubmit(index, layero,uniqueId){ + function doSubmit(index, layero, uniqueId) { console.log(uniqueId); var iframeWin = window[layero.find('iframe')[0]['name']]; - var rowData = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections')[0]; - console.log("rowData: "+rowData); - let enterpriseSum = $("#enterpriseSum").val(); - $("#enterpriseSum").val((enterpriseSum==''?0:enterpriseSum) + 1); - var timestamp = new Date().getTime(); - var totalNum = $("#bootstrap-table-Quote-child2").bootstrapTable('getData').length; - $("#bootstrap-table-Quote-child2").bootstrapTable('insertRow', { - index: totalNum, - row: { - id:'', - quoteId:$("#supplierCode").val(), - 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: '', - usdTax: '', - materialSole: "", - materialNum: "", - materialNoRmb: "", - materialNoUsd: "", - materialRmb: "", - materialNoRmbSum: "", - materialRmbSum: "", - materialUsd: "", - materialUsdSum: "", - materialNoUsdSum: "", - remark: "", + var selectedRows = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections'); + + if (selectedRows.length === 0) { + $.modal.alertError("请选择至少一条物料信息"); + return; + } + + var existingData = $("#bootstrap-sub-table-quoteChild").bootstrapTable('getData'); + var promises = []; + + // 存储要插入的新行 + var newRows = []; + + // 遍历选中的每一行物料信息 + for (var i = 0; i < selectedRows.length; i++) { + var rowData = selectedRows[i]; + + // 检查是否已经存在相同的物料 + var isDuplicate = false; + for (var j = 0; j < existingData.length; j++) { + if (existingData[j].materialCode === rowData.materialNo) { + isDuplicate = true; + break; + } + } + + if (!isDuplicate) { + // 如果不存在,则准备插入新行,并发起查询请求 + promises.push(queryRecentQuotation(rowData.materialNo).then(function (quotationData) { + // 将查询结果赋值给 newRows 中的相应字段 + 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, + countTax: '', + usdTax: '', + materialNum: "", + materialSole: "", + recentQuotationRMB: quotationData.data.materialRmb || '', + recentQuotationUSD: quotationData.data.materialUsd || '', + materialRmb: "", + materialNoRmb: "", + materialNoUsd: "", + materialUsd: "", + materialUsdSum: "", + materialNoUsdSum: "", + materialNoRmbSum: "", + materialRmbSum: "", + createBy: "", + createTime: "", + updateBy: "", + updateTime: "", + remark: "", + }; + }).catch(function (error) { + // 返回一个默认对象以保证数据结构一致 + 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, + countTax: '', + usdTax: '', + materialNum: "", + materialSole: "", + recentQuotationRMB: '', + recentQuotationUSD: '', + materialRmb: "", + materialNoRmb: "", + materialNoUsd: "", + materialUsd: "", + materialUsdSum: "", + materialNoUsdSum: "", + materialNoRmbSum: "", + materialRmbSum: "", + createBy: "", + createTime: "", + updateBy: "", + updateTime: "", + remark: "", + }; + })); + } else { + $.modal.alertError("不能选择已添加过的相同料号"); + } + } + + // 使用Promise.all等待所有查询完成 + Promise.all(promises).then(function (rows) { + newRows = rows.filter(row => !!row); // 清除可能的null或undefined + if (newRows.length > 0) { + // 批量插入新行 + for (var k = 0; k < newRows.length; k++) { + $("#bootstrap-sub-table-quoteChild").bootstrapTable('insertRow', { index: 1, row: newRows[k] }); + } } - }) - layer.close(index); + layer.close(index); + }).catch(function (error) { + console.error('Some requests failed:', error); + layer.close(index); + }); } + + // 查找最新的报价数据 + function queryRecentQuotation(materialNo) { + return new Promise((resolve, reject) => { + // 使用AJAX请求从服务器获取最近的报价信息 + $.ajax({ + url: prefix + '/queryLatestRecentQuotation', // 假设这是你的API路径 + type: 'GET', + data: { materialNo: materialNo, customerCode: $("#customerCode").val() }, + success: function (data) { + resolve(data); // 成功时解析数据 + }, + error: function (jqXHR, textStatus, errorThrown) { + reject(new Error('查找最新报价数据失败')); // 失败时抛出错误 + } + }); + }); + } + + + function insertRow() { var url = ctx + "erp/material/select"; var options = { diff --git a/ruoyi-admin/src/main/resources/templates/system/customerQuote/taskYwjlVerify.html b/ruoyi-admin/src/main/resources/templates/system/customerQuote/taskYwjlVerify.html index b506e85d..003dd549 100644 --- a/ruoyi-admin/src/main/resources/templates/system/customerQuote/taskYwjlVerify.html +++ b/ruoyi-admin/src/main/resources/templates/system/customerQuote/taskYwjlVerify.html @@ -164,14 +164,6 @@
-
-
- 选择报价信息 - - 添加物料 - -
-
@@ -247,92 +239,28 @@ } }, { title: '对外售价',field: 'materialSole', - editable: { - type: 'number', - mode: 'inline', - title: '对外售价', - validate: function (value) { - if (!value) { - return '对外售价不能为空'; - } - if (isNaN(value)) { - return '对外售价必须为数字'; - } - } + }, + { 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: '物料的数量',field: 'materialNum',align: 'center', - editable:{ - type : 'text', - mode: 'inline', - title : '物料的数量', - validate : function(value) { - if (!value) { - return '用量不能为空'; - } - if (isNaN(value)) { - return '用量必须为数字'; - } - } - }, }, { title: '物料的不含税单价(RMB)', field: 'materialNoRmb', align: 'center', - editable:{ - type: 'text', // 使用'text'类型,因为我们需自定义验证小数 - mode: 'inline', - enabled: function() { - return ($("#commonCurrency_add").val() === '1'); // 当货币类型为2时启用 - }, - title: '物料的不含税单价(RMB)', - validate: function(value) { - // 验证是否为空 - if (!value) { - return '金额不能为空'; - } - // 尝试转换为浮点数并检查是否成功 - var num = parseFloat(value); - if (isNaN(num)) { - return '请输入有效的数字'; - } - // 检查小数点后是否有超过两位的数字 - var decimalPart = num.toString().split('.')[1]; // 获取小数部分 - if (decimalPart && decimalPart.length > 2) { - return '请输入精确到小数点后两位的数字'; - } - } - } }, {title: '物料的不含税单价(美元)', field: 'materialNoUsd', align: 'center', - editable: { - type: 'text', // 使用'text'类型,因为我们需自定义验证小数 - mode: 'inline', - enabled: function() { - return ($("#commonCurrency_add").val() === '2'); // 当货币类型为2时启用 - }, - title: '物料的不含税单价(美元)', - validate: function(value) { - // 验证是否为空 - if (!value) { - return '金额不能为空'; - } - // 尝试转换为浮点数并检查是否成功 - var num = parseFloat(value); - if (isNaN(num)) { - return '请输入有效的数字'; - } - // 检查小数点后是否有超过两位的数字 - var decimalPart = num.toString().split('.')[1]; // 获取小数部分 - if (decimalPart && decimalPart.length > 2) { - return '请输入精确到小数点后两位的数字'; - } - } - } }, {title: '物料的含税单价(RMB)',field: 'materialRmb',align: 'center'}, {title: '物料的含税总价(RMB)',field: 'materialNoRmbSum',align: 'center'}, @@ -523,6 +451,18 @@ } } + + //最新报价历史 + function recentQuotationHistory(materialCode){ + var customerCode = $("#customerCode").val(); + var queryParams = new URLSearchParams(); + queryParams.append("materialCode", materialCode); + queryParams.append("customerCode", encodeURIComponent(customerCode)); + var url = prefix + '/recentQuotationHistory?'+queryParams.toString(); + + $.modal.open("最新报价历史", url); + } + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/customerQuote/taskYwzgVerify.html b/ruoyi-admin/src/main/resources/templates/system/customerQuote/taskYwzgVerify.html index 7b620d69..d38ea836 100644 --- a/ruoyi-admin/src/main/resources/templates/system/customerQuote/taskYwzgVerify.html +++ b/ruoyi-admin/src/main/resources/templates/system/customerQuote/taskYwzgVerify.html @@ -166,14 +166,6 @@
-
-
- 选择报价信息 - - 添加物料 - -
-
@@ -269,92 +261,28 @@ } }, { title: '对外售价',field: 'materialSole', - editable: { - type: 'number', - mode: 'inline', - title: '对外售价', - validate: function (value) { - if (!value) { - return '对外售价不能为空'; - } - if (isNaN(value)) { - return '对外售价必须为数字'; - } - } + }, + { 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: '物料的数量',field: 'materialNum',align: 'center', - editable:{ - type : 'text', - mode: 'inline', - title : '物料的数量', - validate : function(value) { - if (!value) { - return '用量不能为空'; - } - if (isNaN(value)) { - return '用量必须为数字'; - } - } - }, }, { title: '物料的不含税单价(RMB)', field: 'materialNoRmb', align: 'center', - editable:{ - type: 'text', // 使用'text'类型,因为我们需自定义验证小数 - mode: 'inline', - enabled: function() { - return ($("#commonCurrency_add").val() === '1'); // 当货币类型为2时启用 - }, - title: '物料的不含税单价(RMB)', - validate: function(value) { - // 验证是否为空 - if (!value) { - return '金额不能为空'; - } - // 尝试转换为浮点数并检查是否成功 - var num = parseFloat(value); - if (isNaN(num)) { - return '请输入有效的数字'; - } - // 检查小数点后是否有超过两位的数字 - var decimalPart = num.toString().split('.')[1]; // 获取小数部分 - if (decimalPart && decimalPart.length > 2) { - return '请输入精确到小数点后两位的数字'; - } - } - } }, {title: '物料的不含税单价(美元)', field: 'materialNoUsd', align: 'center', - editable: { - type: 'text', // 使用'text'类型,因为我们需自定义验证小数 - mode: 'inline', - enabled: function() { - return ($("#commonCurrency_add").val() === '2'); // 当货币类型为2时启用 - }, - title: '物料的不含税单价(美元)', - validate: function(value) { - // 验证是否为空 - if (!value) { - return '金额不能为空'; - } - // 尝试转换为浮点数并检查是否成功 - var num = parseFloat(value); - if (isNaN(num)) { - return '请输入有效的数字'; - } - // 检查小数点后是否有超过两位的数字 - var decimalPart = num.toString().split('.')[1]; // 获取小数部分 - if (decimalPart && decimalPart.length > 2) { - return '请输入精确到小数点后两位的数字'; - } - } - } }, {title: '物料的含税单价(RMB)',field: 'materialRmb',align: 'center'}, {title: '物料的含税总价(RMB)',field: 'materialNoRmbSum',align: 'center'}, @@ -482,6 +410,17 @@ } } + //最新报价历史 + function recentQuotationHistory(materialCode){ + var customerCode = $("#customerCode").val(); + var queryParams = new URLSearchParams(); + queryParams.append("materialCode", materialCode); + queryParams.append("customerCode", encodeURIComponent(customerCode)); + var url = prefix + '/recentQuotationHistory?'+queryParams.toString(); + + $.modal.open("最新报价历史", url); + } + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/customerQuote/taskZozjVerify.html b/ruoyi-admin/src/main/resources/templates/system/customerQuote/taskZozjVerify.html index 79c69432..4e466ee8 100644 --- a/ruoyi-admin/src/main/resources/templates/system/customerQuote/taskZozjVerify.html +++ b/ruoyi-admin/src/main/resources/templates/system/customerQuote/taskZozjVerify.html @@ -168,14 +168,6 @@
-
-
- 选择报价信息 - - 添加物料 - -
-
@@ -250,92 +242,28 @@ } }, { title: '对外售价',field: 'materialSole', - editable: { - type: 'number', - mode: 'inline', - title: '对外售价', - validate: function (value) { - if (!value) { - return '对外售价不能为空'; - } - if (isNaN(value)) { - return '对外售价必须为数字'; - } - } + }, + { 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',}, {field: 'materialNum',align: 'center',title: '物料的数量', - editable:{ - type : 'text', - mode: 'inline', - title : '物料的数量', - validate : function(value) { - if (!value) { - return '用量不能为空'; - } - if (isNaN(value)) { - return '用量必须为数字'; - } - } - }, }, { title: '物料的不含税单价(RMB)', field: 'materialNoRmb', align: 'center', - editable:{ - type: 'text', // 使用'text'类型,因为我们需自定义验证小数 - mode: 'inline', - enabled: function() { - return ($("#commonCurrency_add").val() === '1'); // 当货币类型为2时启用 - }, - title: '物料的不含税单价(RMB)', - validate: function(value) { - // 验证是否为空 - if (!value) { - return '金额不能为空'; - } - // 尝试转换为浮点数并检查是否成功 - var num = parseFloat(value); - if (isNaN(num)) { - return '请输入有效的数字'; - } - // 检查小数点后是否有超过两位的数字 - var decimalPart = num.toString().split('.')[1]; // 获取小数部分 - if (decimalPart && decimalPart.length > 2) { - return '请输入精确到小数点后两位的数字'; - } - } - } }, {title: '物料的不含税单价(美元)', field: 'materialNoUsd', align: 'center', - editable: { - type: 'text', // 使用'text'类型,因为我们需自定义验证小数 - mode: 'inline', - enabled: function() { - return ($("#commonCurrency_add").val() === '2'); // 当货币类型为2时启用 - }, - title: '物料的不含税单价(美元)', - validate: function(value) { - // 验证是否为空 - if (!value) { - return '金额不能为空'; - } - // 尝试转换为浮点数并检查是否成功 - var num = parseFloat(value); - if (isNaN(num)) { - return '请输入有效的数字'; - } - // 检查小数点后是否有超过两位的数字 - var decimalPart = num.toString().split('.')[1]; // 获取小数部分 - if (decimalPart && decimalPart.length > 2) { - return '请输入精确到小数点后两位的数字'; - } - } - } }, {title: '物料的含税单价(RMB)',field: 'materialRmb',align: 'center'}, {title: '物料的含税总价(RMB)',field: 'materialNoRmbSum',align: 'center'}, @@ -455,6 +383,18 @@ $.operate.save(prefix + "/complete/" + taskId, $('#form-customerQuote-zozj').serialize()); } } + + //最新报价历史 + function recentQuotationHistory(materialCode){ + var customerCode = $("#customerCode").val(); + var queryParams = new URLSearchParams(); + queryParams.append("materialCode", materialCode); + queryParams.append("customerCode", encodeURIComponent(customerCode)); + var url = prefix + '/recentQuotationHistory?'+queryParams.toString(); + + $.modal.open("最新报价历史", url); + } + \ No newline at end of file