From 2b67e6524643846ddefb6279daac7f90274d3366 Mon Sep 17 00:00:00 2001 From: wangjiuyun <1595161655@qq.com> Date: Fri, 16 May 2025 17:58:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=90=8C=E7=AE=A1=E7=90=86=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=9C=AA=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 | 240 ++++++++++++------ .../templates/manage/order/edit.html | 212 ++++++++++++---- .../templates/manage/order/selectAgent.html | 54 ++++ .../manage/order/selectCustomer.html | 74 ++++++ .../templates/manage/order/selectPartner.html | 67 +++++ .../sip/controller/OrderInfoController.java | 12 + 6 files changed, 525 insertions(+), 134 deletions(-) create mode 100644 ruoyi-admin/src/main/resources/templates/manage/order/selectAgent.html create mode 100644 ruoyi-admin/src/main/resources/templates/manage/order/selectCustomer.html create mode 100644 ruoyi-admin/src/main/resources/templates/manage/order/selectPartner.html 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 3c2e18fc..648db42e 100644 --- a/ruoyi-admin/src/main/resources/templates/manage/order/add.html +++ b/ruoyi-admin/src/main/resources/templates/manage/order/add.html @@ -4,6 +4,15 @@ +
@@ -40,39 +49,7 @@
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
+
@@ -87,8 +64,7 @@
- - +
@@ -99,8 +75,7 @@
- - +
@@ -125,11 +100,52 @@
-

合同清单列表

+
+
+
+
客户编码:
+
+ + +
+
+
+
客户名称:
+
+ +
+
+
+
客户联系人:
+
+ +
+
+
+
客户邮箱:
+
+ +
+
+
+
客户电话:
+
+ +
+
+
+
+ +
+

合同清单列表

+
+
- + + +
@@ -191,7 +207,7 @@ align: 'center', title: '数量', formatter: function(value, row, index) { - var html = $.common.sprintf("", index, value); + var html = $.common.sprintf("", index, value); return html; } }, @@ -200,16 +216,25 @@ 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); + 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; } }, @@ -233,42 +258,6 @@ }; $.table.init(options); }); - 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); - } function addRow() { var count = $("#" + table.options.id).bootstrapTable('getData').length; var row = { @@ -285,6 +274,101 @@ } sub.addRow(row); } + function selectCustomer(){ + var url = prefix+"/customer"; + var options = { + title: '选择客户', + width: "680", + url: url, + callBack: doSubmitCustomer + }; + $.modal.openOptions(options); + } + function selectAgent() { + var url = prefix+"/agent"; + var options = { + title: '选择代表处', + width: "680", + url: url, + callBack: doSubmitAgent + }; + $.modal.openOptions(options); + } + function doSubmitCustomer(index, layero){ + var rows = layero.find("iframe")[0].contentWindow.getSelections(); + if (rows.length == 0) { + $.modal.alertWarning("请选择一个用户"); + return; + } + $('[name="customerCode"]').val(rows[0].customerCode); + $(' [name="customerName"]').val(rows[0].customerName); + $(' [name="customerContact"]').val(rows[0].contactPerson); + $(' [name="customerEmail"]').val(rows[0].contactEmail); + $(' [name="customerPhone"]').val(rows[0].contactPhone); + $.modal.close(index); + } + function doSubmitAgent(index, layero){ + var rows = layero.find("iframe")[0].contentWindow.getSelections(); + if (rows.length == 0) { + $.modal.alertWarning("请选择一个代表处"); + return; + } + $('[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) { + $.modal.alertWarning("请选择一个代理商"); + return; + } + $('[name="orderPartnerCode"]').val(rows[0].partnerCode); + $.modal.close(index); + } + function importList(){ + $('#uploadInput').click() + } + document.getElementById('uploadInput').addEventListener('change', function(event) { + const file = event.target.files[0]; + let data=new FormData() + data.append('file',file) + data.append('deliveryId',$('#bootstrap-table').attr('deliveryid')) + var xhr = new XMLHttpRequest(); // 创建XMLHttpRequest对象 + xhr.open('POST',prefix+'/importData', true); // 设置请求类型和URL + // 当请求完成时执行的回调函数 + xhr.onload = function (res) { + let data=JSON.parse(res.currentTarget.response) + if (data.code === 0) { + $.modal.msgSuccess('导入成功'); + $.table.refresh(); + + } else { + $.modal.msgError(data.msg||'导入失败'); + } + $('#uploadInput').val('') + + }; + + // 当请求发生错误时执行的回调函数 + xhr.onerror = function () { + console.log('上传过程中发生错误'); + }; + // + // // 发送数据到服务器 + xhr.send(data); + + + }); \ 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 cb6fc21c..7cb4c27c 100644 --- a/ruoyi-admin/src/main/resources/templates/manage/order/edit.html +++ b/ruoyi-admin/src/main/resources/templates/manage/order/edit.html @@ -46,38 +46,6 @@
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
@@ -88,30 +56,30 @@
- - - - - - - - - - - - - - - - - - - - - - - - +
+
+ +
+
+ + + +
+
+
+
+
+
+ +
+
+ + + +
+
+
+
@@ -131,6 +99,42 @@
+
+
+
+
客户编码:
+
+ + +
+
+
+
客户名称:
+
+ +
+
+
+
客户联系人:
+
+ +
+
+
+
客户邮箱:
+
+ +
+
+
+
客户电话:
+
+ +
+
+
+
+

合同清单列表

@@ -193,6 +197,102 @@ minView: "month", autoclose: true }); + function selectCustomer(){ + var url = prefix+"/customer"; + var options = { + title: '选择客户', + width: "680", + url: url, + callBack: doSubmitCustomer + }; + $.modal.openOptions(options); + } + function selectAgent() { + var url = prefix+"/agent"; + var options = { + title: '选择代表处', + width: "680", + url: url, + callBack: doSubmitAgent + }; + $.modal.openOptions(options); + } + function doSubmitCustomer(index, layero){ + var rows = layero.find("iframe")[0].contentWindow.getSelections(); + if (rows.length == 0) { + $.modal.alertWarning("请选择一个用户"); + return; + } + $('[name="customerCode"]').val(rows[0].customerCode); + $(' [name="customerName"]').val(rows[0].customerName); + $(' [name="customerContact"]').val(rows[0].contactPerson); + $(' [name="customerEmail"]').val(rows[0].contactEmail); + $(' [name="customerPhone"]').val(rows[0].contactPhone); + $.modal.close(index); + } + function doSubmitAgent(index, layero){ + var rows = layero.find("iframe")[0].contentWindow.getSelections(); + if (rows.length == 0) { + $.modal.alertWarning("请选择一个代表处"); + return; + } + $('[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) { + $.modal.alertWarning("请选择一个代理商"); + return; + } + $('[name="orderPartnerCode"]').val(rows[0].partnerCode); + $.modal.close(index); + } + function importList(){ + $('#uploadInput').click() + } + document.getElementById('uploadInput').addEventListener('change', function(event) { + const file = event.target.files[0]; + let data=new FormData() + data.append('file',file) + data.append('deliveryId',$('#bootstrap-table').attr('deliveryid')) + var xhr = new XMLHttpRequest(); // 创建XMLHttpRequest对象 + xhr.open('POST',prefix+'/importData', true); // 设置请求类型和URL + // 当请求完成时执行的回调函数 + xhr.onload = function (res) { + let data=JSON.parse(res.currentTarget.response) + if (data.code === 0) { + $.modal.msgSuccess('导入成功'); + $.table.refresh(); + + } else { + $.modal.msgError(data.msg||'导入失败'); + } + $('#uploadInput').val('') + + }; + + // 当请求发生错误时执行的回调函数 + xhr.onerror = function () { + console.log('上传过程中发生错误'); + }; + // + // // 发送数据到服务器 + xhr.send(data); + + + }); + $(function() { var options = { diff --git a/ruoyi-admin/src/main/resources/templates/manage/order/selectAgent.html b/ruoyi-admin/src/main/resources/templates/manage/order/selectAgent.html new file mode 100644 index 00000000..82a9448f --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/manage/order/selectAgent.html @@ -0,0 +1,54 @@ + + + + + + +
+
+
+ + + + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/manage/order/selectCustomer.html b/ruoyi-admin/src/main/resources/templates/manage/order/selectCustomer.html new file mode 100644 index 00000000..7c73e815 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/manage/order/selectCustomer.html @@ -0,0 +1,74 @@ + + + + + + +
+
+
+ + + + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/manage/order/selectPartner.html b/ruoyi-admin/src/main/resources/templates/manage/order/selectPartner.html new file mode 100644 index 00000000..d5bb300c --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/manage/order/selectPartner.html @@ -0,0 +1,67 @@ + + + + + + +
+
+
+ + + + + + + \ No newline at end of file diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/controller/OrderInfoController.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/controller/OrderInfoController.java index a6c4350b..17047d82 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/controller/OrderInfoController.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/controller/OrderInfoController.java @@ -47,6 +47,18 @@ public class OrderInfoController extends BaseController { return prefix + "/selectCustomer"; } + @RequiresPermissions("manage:order:view") + @GetMapping("/agent") + public String agent() + { + return prefix + "/selectAgent"; + } + @RequiresPermissions("manage:order:view") + @GetMapping("/partner") + public String partner() + { + return prefix + "/selectPartner"; + } /** * 查询合同档案列表