Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hunan-order-h5
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenweisong
hunan-order-h5
Commits
7483bfcf
Commit
7483bfcf
authored
Jul 01, 2020
by
chenweisong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加带token的post方法
parent
e6395235
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
15 deletions
+41
-15
Utils.js
js/Utils.js
+21
-0
order.1.js
js/order.1.js
+20
-15
No files found.
js/Utils.js
View file @
7483bfcf
...
...
@@ -57,6 +57,27 @@
}
});
},
getHttpResultByPOSTWithToken
:
function
(
url
,
param
,
token
,
successCallback
,
async
)
{
$
.
showIndicator
();
$
.
ajax
({
type
:
"POST"
,
url
:
url
,
headers
:
{
'Access-Token'
:
token
},
contentType
:
'application/x-www-form-urlencoded'
,
data
:
param
,
async
:
async
,
// 默认为true, 即是异步请求函数
beforeSend
:
function
(
XMLHttpRequest
)
{
},
success
:
function
(
data
)
{
successCallback
(
data
);
$
.
hideIndicator
();
},
error
:
function
(
data
)
{
$
.
hideIndicator
();
$
.
toast
(
"请求出错"
);
}
});
},
//获取QueryString的数组
getQueryString
:
function
()
{
var
result
=
location
.
search
.
match
(
new
RegExp
(
"[
\
?
\
&][^
\
?
\
&]+=[^
\
?
\
&]+"
,
"g"
));
...
...
js/order.1.js
View file @
7483bfcf
...
...
@@ -53,15 +53,13 @@ $(function () {
});
// getMissionWorkOrder();
function
getMissionWorkOrder
()
{
requestin
=
true
;
Utils
.
getHttpResultByPOST
(
context
+
'/mobile/workordermgr/missionWorkOrder'
,
{
Utils
.
getHttpResultByPOST
WithToken
(
context
+
'/mobile/workordermgr/missionWorkOrder'
,
{
'pageNumber'
:
pageNumber
},
function
(
res
)
{
},
token
,
function
(
res
)
{
requestin
=
false
;
res
=
JSON
.
parse
(
res
)
if
(
res
.
type
===
'200'
)
{
...
...
@@ -362,7 +360,13 @@ $(function () {
</header>'
,
onChange
:
function
(
e
)
{
var
val
=
e
.
value
;
var
newTime
=
moment
().
set
({
'year'
:
val
[
0
],
'month'
:
parseInt
(
val
[
1
]),
'date'
:
parseInt
(
val
[
2
]),
'hour'
:
parseInt
(
val
[
3
]),
'minute'
:
parseInt
(
val
[
4
])
});
var
newTime
=
moment
().
set
({
'year'
:
val
[
0
],
'month'
:
parseInt
(
val
[
1
]),
'date'
:
parseInt
(
val
[
2
]),
'hour'
:
parseInt
(
val
[
3
]),
'minute'
:
parseInt
(
val
[
4
])
});
if
(
!
newTime
.
isAfter
(
value
,
"minute"
))
{
pickerDom
.
picker
(
"setValue"
,
arr
);
}
...
...
@@ -388,7 +392,6 @@ $(function () {
});
// 对口人按钮
$
(
"#xperson1"
).
parent
().
off
(
"click"
);
$
(
"#xperson1"
).
parent
().
on
(
"click"
,
function
()
{
...
...
@@ -1015,8 +1018,7 @@ $(function () {
$
(
".counterpart-item"
).
on
(
"click"
,
function
()
{
$
(
".person-list-block"
).
html
(
""
);
// 获取厂商对口人员信息
Utils
.
getHttpResultByPOST
(
context
+
'/hnyd/workordermgr/getCompanyPerson'
,
{
},
function
(
res
)
{
Utils
.
getHttpResultByPOST
(
context
+
'/hnyd/workordermgr/getCompanyPerson'
,
{},
function
(
res
)
{
res
=
JSON
.
parse
(
res
)
if
(
res
.
type
===
'200'
)
{
var
list
=
res
.
data
;
...
...
@@ -1098,8 +1100,7 @@ $(function () {
$
(
".counterpart-item"
).
on
(
"click"
,
function
()
{
$
(
".person-list-block"
).
html
(
""
);
// 获取厂商对口人员信息
Utils
.
getHttpResultByPOST
(
context
+
'/hnyd/workordermgr/getCompanyPerson'
,
{
},
function
(
res
)
{
Utils
.
getHttpResultByPOST
(
context
+
'/hnyd/workordermgr/getCompanyPerson'
,
{},
function
(
res
)
{
res
=
JSON
.
parse
(
res
)
if
(
res
.
type
===
'200'
)
{
var
list
=
res
.
data
;
...
...
@@ -1286,8 +1287,7 @@ $(function () {
$
(
".person-list-block"
).
html
(
""
);
pid
=
0
;
// 获取厂商需求处理人
Utils
.
getHttpResultByPOST
(
context
+
'/hnyd/workordermgr/getCompanyPerson'
,
{
},
function
(
res
)
{
Utils
.
getHttpResultByPOST
(
context
+
'/hnyd/workordermgr/getCompanyPerson'
,
{},
function
(
res
)
{
res
=
JSON
.
parse
(
res
)
if
(
res
.
type
===
'200'
)
{
var
list
=
res
.
data
;
...
...
@@ -1360,7 +1360,6 @@ $(function () {
}
// 报表数要从1开始
function
colsFactory
(
type
)
{
if
(
type
===
"report"
)
{
...
...
@@ -1799,7 +1798,13 @@ $(function () {
</header>'
,
onChange
:
function
(
e
)
{
var
val
=
e
.
value
;
var
newTime
=
moment
().
set
({
'year'
:
val
[
0
],
'month'
:
parseInt
(
val
[
1
]),
'date'
:
parseInt
(
val
[
2
]),
'hour'
:
parseInt
(
val
[
3
]),
'minute'
:
parseInt
(
val
[
4
])
});
var
newTime
=
moment
().
set
({
'year'
:
val
[
0
],
'month'
:
parseInt
(
val
[
1
]),
'date'
:
parseInt
(
val
[
2
]),
'hour'
:
parseInt
(
val
[
3
]),
'minute'
:
parseInt
(
val
[
4
])
});
if
(
!
newTime
.
isAfter
(
xvalue
,
"minute"
))
{
xpickerDom
.
picker
(
"setValue"
,
xvalueArr
);
}
...
...
@@ -1939,6 +1944,7 @@ $(function () {
}
return
flag
;
}
$
(
".create-submit-btn"
).
html
(
"提交"
);
$
(
".create-submit-btn"
).
off
(
"click"
)
$
(
".create-submit-btn"
).
on
(
"click"
,
function
()
{
...
...
@@ -1989,7 +1995,6 @@ $(function () {
$
.
init
();
function
getToken
()
{
if
(
!
code
)
{
$
.
toast
(
"缺少code值"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment