From 94843d2d9d8312545510c30319c4d5b58915d30c Mon Sep 17 00:00:00 2001 From: wangjiuyun <1595161655@qq.com> Date: Mon, 19 May 2025 17:27:44 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AC=AC=E4=BA=8C=E6=9C=9F=E5=9F=BA=E6=9C=AC?= =?UTF-8?q?=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/templates/manage/order/add.html | 100 ++++++++----- .../templates/manage/order/edit.html | 136 +++++++++--------- .../resources/templates/system/agent/add.html | 39 +++-- .../templates/system/agent/edit.html | 37 +++-- .../templates/system/customer/add.html | 89 +++++++----- .../templates/system/customer/edit.html | 92 +++++++----- .../templates/system/partner/add.html | 2 +- .../templates/system/partner/edit.html | 18 ++- 8 files changed, 312 insertions(+), 201 deletions(-) diff --git a/ruoyi-admin/src/main/resources/templates/manage/order/add.html b/ruoyi-admin/src/main/resources/templates/manage/order/add.html index e23720cb..26adc5b4 100644 --- a/ruoyi-admin/src/main/resources/templates/manage/order/add.html +++ b/ruoyi-admin/src/main/resources/templates/manage/order/add.html @@ -142,8 +142,6 @@
- -
@@ -198,16 +196,25 @@ align: 'center', title: 'BOM编码', formatter: function(value, row, index) { - var html = $.common.sprintf("", index, value); + var html = $.common.sprintf("", index, value); return html; } }, + { + field: 'productName', + align: 'center', + title: '产品名称', + formatter: function(value, row, index) { + var html = $.common.sprintf("

%s

", value); + return html; + } + }, { field: 'quantity', align: 'center', title: '数量', formatter: function(value, row, index) { - var html = $.common.sprintf("", index, value); + var html = $.common.sprintf("", index, value); return html; } }, @@ -216,25 +223,26 @@ align: 'center', title: '单价', formatter: function(value, row, index) { - var html = $.common.sprintf("", index, value); + var html = $.common.sprintf("", index, value); return html; } }, { - field: 'discount', - align: 'center', - title: '折扣', - formatter: function(value, row, index) { - var html = $.common.sprintf("", index, value); + field: 'discount', + align: 'center', + title: '折扣', + width:60, + formatter: function(value, row, index) { + var html = $.common.sprintf("", index, value); return html; - } + } }, { field: 'amount', align: 'center', title: '总价', formatter: function(value, row, index) { - var html = $.common.sprintf("", index, value); + var html = $.common.sprintf("", index, value); return html; } }, @@ -258,21 +266,23 @@ }; $.table.init(options); }); - function addRow() { + function addRow(row) { var count = $("#" + table.options.id).bootstrapTable('getData').length; var row = { index: $.table.serialNumber(count), - productId: "", - productCode: "", - quantity: "", - price: "", - amount: "", - remark: "", - createdAt: "", - updatedAt: "", - deletedAt: "", + productId: row.productId, + productCode: row.productCode, + quantity: row.quantity, + price: row.price, + amount: row.amount, + remark: row.remark, + createdAt: row.createdAt, + updatedAt: row.updatedAt, + deletedAt: row.deletedAt, + discount: row.discount, } sub.addRow(row); + } function selectCustomer(){ var url = prefix+"/customer"; @@ -294,6 +304,16 @@ }; $.modal.openOptions(options); } + function selectPartner() { + var url = prefix+"/partner"; + var options = { + title: '选择代理商', + width: "680", + url: url, + callBack: doSubmitPartner + }; + $.modal.openOptions(options); + } function doSubmitCustomer(index, layero){ var rows = layero.find("iframe")[0].contentWindow.getSelections(); if (rows.length == 0) { @@ -316,16 +336,6 @@ $('[name="orderAgentCode"]').val(rows[0].agentCode); $.modal.close(index); } - function selectPartner() { - var url = prefix+"/partner"; - var options = { - title: '选择代理商', - width: "680", - url: url, - callBack: doSubmitPartner - }; - $.modal.openOptions(options); - } function doSubmitPartner(index, layero){ var rows = layero.find("iframe")[0].contentWindow.getSelections(); if (rows.length == 0) { @@ -351,21 +361,29 @@ $.modal.closeLoading(); }) - } document.getElementById('uploadInput').addEventListener('change', function(event) { + } + document.getElementById('uploadInput').addEventListener('change', function(event) { const file = event.target.files[0]; let data=new FormData() data.append('file',file) - data.append('orderId',$('#bootstrap-table').attr('deliveryid')) - var xhr = new XMLHttpRequest(); // 创建XMLHttpRequest对象 - xhr.open('POST',prefix+'/list/importData', true); // 设置请求类型和URL + xhr.open('POST',prefix+'/list/readData', true); // 设置请求类型和URL // 当请求完成时执行的回调函数 xhr.onload = function (res) { let data=JSON.parse(res.currentTarget.response) if (data.code === 0) { $.modal.msgSuccess('导入成功'); - $.table.refresh(); + data.data.forEach((row)=>{ + addRow(row) + }) + $('.discount').on('change',function (){ + + changeTotal($(this)) + }) + $('.discount').on('focus',function(){ + $(this).blur() + }) } else { $.modal.msgError(data.msg||'导入失败'); } @@ -383,6 +401,14 @@ }); + + function changeTotal(ele){ + let price= Number($(ele).parent().parent().find('.price').val())||0 + let quantity=Number($(ele).parent().parent().find('.quantity').val())||0 + let discount=$(ele).val()||0 + let res= Number((price*quantity*discount).toFixed(2)) + $(ele).parent().parent().find('.amount').val(res) + } \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/manage/order/edit.html b/ruoyi-admin/src/main/resources/templates/manage/order/edit.html index e92d947b..7ce194a8 100644 --- a/ruoyi-admin/src/main/resources/templates/manage/order/edit.html +++ b/ruoyi-admin/src/main/resources/templates/manage/order/edit.html @@ -7,6 +7,9 @@ .hideTd{ display: none; } + .customerBox div{ + padding-left: 25px !important; + } @@ -58,11 +61,10 @@
- +
- - +
@@ -70,12 +72,10 @@
- +
- - - +
@@ -104,8 +104,8 @@
客户编码:
- - + +
@@ -136,10 +136,11 @@

合同清单列表

+ +
- - +
@@ -160,43 +161,7 @@ $.operate.save(prefix + "/edit", $('#form-order-edit').serialize()); } } - function selectDeptTree() { - var deptId = $.common.isEmpty($("#treeId").val()) ? "100" : $("#treeId").val(); - console.log(deptId) - var url = ctx + "system/user/selectDeptTree/" + deptId; - var options = { - title: '选择部门', - width: "380", - url: url, - callBack: doSubmit - }; - $.modal.openOptions(options); - } - function doSubmit(index, layero){ - var body = $.modal.getChildFrame(index); - $("#treeId").val(body.find('#treeId').val()); - $("#treeName").val(body.find('#treeName').val()); - $.modal.close(index); - } - function selectDeptTreePartner() { - var deptId = $.common.isEmpty($("#treeId1").val()) ? "100" : $("#treeId1").val(); - console.log(deptId) - var url = ctx + "system/user/selectDeptTree/" + deptId; - var options = { - title: '选择部门', - width: "380", - url: url, - callBack: doSubmitPartner - }; - $.modal.openOptions(options); - } - function doSubmitPartner(index, layero){ - var body = $.modal.getChildFrame(index); - $("#treeId1").val(body.find('#treeId').val()); - $("#treeName1").val(body.find('#treeName').val()); - $.modal.close(index); - } - $("input[name='orderDate']").datetimepicker({ + $("input[name='orderDate']").datetimepicker({ format: "yyyy-mm-dd", minView: "month", autoclose: true @@ -221,6 +186,17 @@ }; $.modal.openOptions(options); } + function selectPartner() { + var url = prefix+"/partner"; + var options = { + title: '选择代理商', + width: "680", + url: url, + callBack: doSubmitPartner + }; + $.modal.openOptions(options); + } + function doSubmitCustomer(index, layero){ var rows = layero.find("iframe")[0].contentWindow.getSelections(); if (rows.length == 0) { @@ -243,16 +219,6 @@ $('[name="orderAgentCode"]').val(rows[0].agentCode); $.modal.close(index); } - function selectPartner() { - var url = prefix+"/partner"; - var options = { - title: '选择代理商', - width: "680", - url: url, - callBack: doSubmitPartner - }; - $.modal.openOptions(options); - } function doSubmitPartner(index, layero){ var rows = layero.find("iframe")[0].contentWindow.getSelections(); if (rows.length == 0) { @@ -260,6 +226,9 @@ return; } $('[name="orderPartnerCode"]').val(rows[0].partnerCode); + + + $.modal.close(index); } function importList(){ @@ -269,15 +238,22 @@ const file = event.target.files[0]; let data=new FormData() data.append('file',file) - data.append('deliveryId',$('#bootstrap-table').attr('deliveryid')) + data.append('orderId',$('[name="id"]').val()) var xhr = new XMLHttpRequest(); // 创建XMLHttpRequest对象 - xhr.open('POST',prefix+'/importData', true); // 设置请求类型和URL + xhr.open('POST',prefix+'/list/importData', true); // 设置请求类型和URL // 当请求完成时执行的回调函数 xhr.onload = function (res) { let data=JSON.parse(res.currentTarget.response) if (data.code === 0) { $.modal.msgSuccess('导入成功'); $.table.refresh(); + $('.discount').on('change',function (){ + + changeTotal($(this)) + }) + $('.discount').on('focus',function(){ + $(this).blur() + }) } else { $.modal.msgError(data.msg||'导入失败'); @@ -294,7 +270,6 @@ // // 发送数据到服务器 xhr.send(data); - }); @@ -333,7 +308,7 @@ align: 'center', title: 'BOM编码', formatter: function(value, row, index) { - var html = $.common.sprintf("

%s

", value); + var html = $.common.sprintf("

%s

", value); return html; } }, @@ -352,16 +327,25 @@ align: 'center', title: '数量', formatter: function(value, row, index) { - var html = $.common.sprintf("", index, value); + var html = $.common.sprintf("", index, value); return html; } }, + { + field: 'price', + align: 'center', + title: '单价', + formatter: function(value, row, index) { + var html = $.common.sprintf("", index, value); + return html; + } + }, { field: 'discount', align: 'center', title: '折扣', formatter: function(value, row, index) { - var html = $.common.sprintf("", index, value); + var html = $.common.sprintf("", index, value); return html; } }, @@ -371,7 +355,7 @@ align: 'center', title: '总价', formatter: function(value, row, index) { - var html = $.common.sprintf("", index, value); + var html = $.common.sprintf("", index, value); return html; } }, @@ -388,6 +372,28 @@ }; $.table.init(options); }); + function downloadTem(){ + $.modal.loading("正在下载,请稍候..."); + $.post( prefix + "/list/export", {}, function(result) { + if (result.code == web_status.SUCCESS) { + window.location.href = ctx + "common/download?fileName=" + encodeURI(result.msg) + "&delete=" + true; + } else if (result.code == web_status.WARNING) { + $.modal.alertWarning(result.msg) + } else { + $.modal.alertError(result.msg); + } + $.modal.closeLoading(); + }) + + } + + function changeTotal(ele){ + let price= Number($(ele).parent().parent().find('.price').val())||0 + let quantity=Number($(ele).parent().parent().find('.quantity').val())||0 + let discount=$(ele).val()||0 + let res= Number((price*quantity*discount).toFixed(2)) + $(ele).parent().parent().find('.amount').val(res) + } \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/agent/add.html b/ruoyi-admin/src/main/resources/templates/system/agent/add.html index 36214622..14367614 100644 --- a/ruoyi-admin/src/main/resources/templates/system/agent/add.html +++ b/ruoyi-admin/src/main/resources/templates/system/agent/add.html @@ -22,19 +22,26 @@
-
-
- -
- +
+
+
+ +
+ +
-
-
-
- -
- +
+
+ +
+ + +
@@ -81,6 +88,8 @@
+ + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/agent/edit.html b/ruoyi-admin/src/main/resources/templates/system/agent/edit.html index bbf13d81..8a7a5163 100644 --- a/ruoyi-admin/src/main/resources/templates/system/agent/edit.html +++ b/ruoyi-admin/src/main/resources/templates/system/agent/edit.html @@ -23,19 +23,26 @@
-
-
- -
- +
+
+
+ +
+ +
-
-
-
- -
- +
+
+ +
+ + +
@@ -82,6 +89,8 @@
+ + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/customer/add.html b/ruoyi-admin/src/main/resources/templates/system/customer/add.html index 6c9739f8..844493e7 100644 --- a/ruoyi-admin/src/main/resources/templates/system/customer/add.html +++ b/ruoyi-admin/src/main/resources/templates/system/customer/add.html @@ -7,97 +7,103 @@
-
+
- +
-
+
- +
-
+
- +
-
-
- -
- +
+
+
+ +
+ +
-
-
-
- -
- +
+
+ +
+ + +
-
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
@@ -106,9 +112,9 @@
-
+
- +
@@ -117,9 +123,9 @@
-
+
- +
@@ -132,6 +138,8 @@
+ + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/customer/edit.html b/ruoyi-admin/src/main/resources/templates/system/customer/edit.html index ddb88d5f..b6be88a5 100644 --- a/ruoyi-admin/src/main/resources/templates/system/customer/edit.html +++ b/ruoyi-admin/src/main/resources/templates/system/customer/edit.html @@ -8,97 +8,104 @@
-
+
- +
-
+
- +
-
+
- +
-
-
- -
- +
+
+
+ +
+ +
+
+
+
+
+ +
+ + +
-
+
- -
- -
-
-
-
-
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
-
+
- +
@@ -107,9 +114,9 @@
-
+
- +
@@ -118,9 +125,9 @@
-
+
- +
@@ -128,12 +135,14 @@
-
+ + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/partner/add.html b/ruoyi-admin/src/main/resources/templates/system/partner/add.html index 165b3e5e..5ef0d825 100644 --- a/ruoyi-admin/src/main/resources/templates/system/partner/add.html +++ b/ruoyi-admin/src/main/resources/templates/system/partner/add.html @@ -22,7 +22,7 @@
-
+
diff --git a/ruoyi-admin/src/main/resources/templates/system/partner/edit.html b/ruoyi-admin/src/main/resources/templates/system/partner/edit.html index 10aae6d6..1ff10b60 100644 --- a/ruoyi-admin/src/main/resources/templates/system/partner/edit.html +++ b/ruoyi-admin/src/main/resources/templates/system/partner/edit.html @@ -23,11 +23,14 @@
+
- +
@@ -35,10 +38,14 @@
- + +
+
@@ -76,6 +83,7 @@
+ \ No newline at end of file