From 889c51afdd70896907b744bb0754af8d62ae3dab Mon Sep 17 00:00:00 2001
From: LSH
Date: 星期二, 12 九月 2023 17:38:35 +0800
Subject: [PATCH] #
---
src/main/webapp/static/js/order/order.js | 36 +++++++++++++++++++++++++++++++++---
1 files changed, 33 insertions(+), 3 deletions(-)
diff --git a/src/main/webapp/static/js/order/order.js b/src/main/webapp/static/js/order/order.js
index adb2696..c4ab073 100644
--- a/src/main/webapp/static/js/order/order.js
+++ b/src/main/webapp/static/js/order/order.js
@@ -2,6 +2,8 @@
var pageCount = 0;
var treeCond;
var admin;
+var userId ;
+var userName ;
layui.config({
base: baseUrl + "/static/layui/lay/modules/"
}).extend({
@@ -268,6 +270,7 @@
success: function (layero, dIndex) {
let cstmrSel = loadCstmrSel();
let companySel = loadCompanySel();
+ let method = mData?'update':'add';
if (!mData){
companySel.setValue([{name: "娴欐睙涓壃绔嬪簱鎶�鏈湁闄愬叕鍙�", value: 4}]);
}
@@ -277,8 +280,8 @@
if (mData.company) { companySel.setValue([{name: mData.company$, value: mData.company}]); }
}else {
mData = {
- director: 25,
- director$: "闄嗘檽娑�"
+ director: Number(userId),
+ director$: userName
}
}
layDateRender(mData);
@@ -313,11 +316,13 @@
}
var loadIndex = layer.load(2);
$.ajax({
- url: baseUrl+"/order/"+(mData?'update':'add')+"/auth",
+ url: baseUrl+"/order/"+(method)+"/auth",
headers: {'token': localStorage.getItem('token')},
data: data.field,
method: 'POST',
success: function (res) {
+ console.log(data.field)
+ console.log(res)
layer.close(loadIndex);
if (res.code === 200){
layer.close(dIndex);
@@ -328,6 +333,12 @@
}else {
layer.msg(res.msg, {icon: 2});
}
+ }
+ ,error: function(xhr, status, error) {
+ // 澶勭悊閿欒
+ console.log(data.field)
+ console.log(res)
+ console.log(error)
}
})
return false;
@@ -410,6 +421,25 @@
});
}
+ $(document).ready(function() {
+ $.ajax({
+ url: baseUrl + "/order/userName/userId/auth",
+ headers: { 'token': localStorage.getItem('token') },
+ method: 'POST',
+ success: function(res) {
+ if (res.code === 200) {
+ userId = res.data.value;
+ userName = res.data.name;
+ }
+ },
+ error: function(xhr, status, error) {
+ // 澶勭悊閿欒
+ console.log(error);
+ }
+ });
+ });
+
+
window.loadCstmrSel = function () {
return xmSelect.render({
el: '#cstmrXmlSel',
--
Gitblit v1.9.1