Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
work-order-system
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
xueyuanyuan
work-order-system
Commits
38497800
Commit
38497800
authored
Jul 28, 2018
by
洪晓珍
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
order pagination and data display
parent
4595a821
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
108 additions
and
40 deletions
+108
-40
.gitignore
.gitignore
+2
-2
index.html
index.html
+6
-6
index.js
js/index.js
+100
-32
No files found.
.gitignore
View file @
38497800
.idea/*
*.iml
\ No newline at end of file
*.iml
.project
index.html
View file @
38497800
...
...
@@ -168,7 +168,7 @@
<div
class=
"status"
id=
"workStatus"
>
工作状态:
<select
@
change=
"updateWOStatus"
>
<option
v-for=
"(item
,index) in woStates"
:value=
'index
'
>
{{item.text}}
<option
v-for=
"(item
) in woStates"
:value=
'item.value
'
>
{{item.text}}
</option>
</select>
</div>
...
...
@@ -184,7 +184,7 @@
aria-controls=
"myTabDrop1-contents"
aria-expanded=
"false"
v-on:click=
"processed()"
>
已完结
</a>
</li>
</ul>
<div
class=
"detail"
id=
"numCount"
>
第
1-10条,共{{message
}}条数据
</div>
<div
class=
"detail"
id=
"numCount"
>
第
{{pageStart}}-{{pageEnd}}条,共{{count
}}条数据
</div>
<!-- 表格 -->
<table
class=
"table"
id=
"order-list"
>
...
...
@@ -205,13 +205,13 @@
<tr
class=
"active"
v-for=
"wo in workOrders"
v-bind:key=
"wo.id"
>
<th
scope=
"row"
>
{{wo.id}}
</th>
<td>
{{wo.urgentLevelDisplay}}
</td>
<td>
{{wo.urgentLevelDisplay}}
</td>
<td>
{{wo.woType}}
</td>
<td>
{{wo.woCreate
Un
ame}}
</td>
<td>
{{wo.woCreate
N
ame}}
</td>
<td>
{{wo.deptName}}
</td>
<td>
{{wo.statusDisplay}}
</td>
<td>
{{wo.woStartTime}}
</td>
<td>
12:00
</td>
<td>
{{wo.wo
Formatted
StartTime}}
</td>
<td>
{{wo.remainTime}}
</td>
<td><a
href=
"#"
v-on:click=
"woDetail(wo)"
>
查看
</a></td>
</tr>
</tbody>
...
...
js/index.js
View file @
38497800
jQuery
(
document
).
ready
(
function
(
$
)
{
var
pageSize
=
10
var
prePageSize
// 工单列表逻辑
var
orderList
=
new
Vue
({
el
:
'#order-list'
,
...
...
@@ -16,11 +18,11 @@ jQuery(document).ready(function ($) {
})
function
initLoadWO
()
{
var
url
=
"/work/wo/list?page=1&limit=10"
;
var
url
=
"/work/wo/list?page=1&limit="
+
pageSize
;
var
data
=
JSON
.
stringify
({
"woStatus"
:
0
,
"woType"
:
"revisit"
,
"woProcessUid"
:
1
"woStatus"
:
0
,
"woType"
:
"revisit"
,
"woProcessUid"
:
1
});
$
.
ajax
({
url
:
url
,
...
...
@@ -31,15 +33,18 @@ jQuery(document).ready(function ($) {
success
:
function
(
res
)
{
console
.
log
(
res
);
orderList
.
workOrders
=
res
.
data
.
list
;
numCount
.
message
=
res
.
data
.
total
;
// 计算页数
if
(
Math
.
round
(
res
.
data
.
total
%
res
.
data
.
size
)
==
0
)
{
pager
.
totalPage
=
Math
.
round
(
res
.
data
.
total
/
res
.
data
.
size
)
;
numCount
.
count
=
res
.
data
.
total
;
numCount
.
pageStart
=
1
;
var
curItems
;
if
(
res
.
data
.
size
<
pageSize
)
{
curItems
=
res
.
data
.
size
;
}
else
{
console
.
log
(
res
.
data
.
total
/
res
.
data
.
size
);
pager
.
totalPage
=
Math
.
round
(
res
.
data
.
total
/
res
.
data
.
size
)
+
1
;
curItems
=
pageSize
;
}
numCount
.
pageEnd
=
curItems
;
pager
.
curPage
=
1
;
// 计算页数
pager
.
totalPage
=
Math
.
ceil
(
res
.
data
.
total
/
pageSize
);
}
});
}
...
...
@@ -78,12 +83,11 @@ jQuery(document).ready(function ($) {
},
data
:
{
woStates
:
[
{
value
:
0
,
text
:
'空闲中'
},
{
value
:
1
,
text
:
'下班'
},
{
value
:
2
,
text
:
'挂起'
},
{
value
:
1
,
text
:
'空闲中'
},
{
value
:
2
,
text
:
'下班'
},
{
value
:
3
,
text
:
'接待中'
},
{
value
:
4
,
text
:
'会议中'
},
{
value
:
5
,
text
:
'
午饭中
'
}
{
value
:
5
,
text
:
'
短暂离开
'
}
]
}
})
...
...
@@ -93,36 +97,90 @@ jQuery(document).ready(function ($) {
var
numCount
=
new
Vue
({
el
:
'#numCount'
,
data
:
{
message
:
"100"
count
:
""
,
pageStart
:
""
,
pageEnd
:
""
}
})
// 页面分页按钮逻辑
var
pager
=
new
Vue
({
el
:
'#pager'
,
data
:
{
curPage
:
1
,
totalPage
:
1
curPage
:
""
,
totalPage
:
""
},
methods
:
{
prePage
:
function
()
{
if
(
this
.
curPage
-
1
<
1
)
{
if
(
this
.
curPage
-
1
<
1
)
{
return
;
}
else
{
this
.
curPage
=
this
.
curPage
-
1
;
}
var
url
=
"/work/wo/list?page="
+
this
.
curPage
+
"&limit="
+
pageSize
;
var
data
=
JSON
.
stringify
({
"woStatus"
:
0
,
"woType"
:
"revisit"
,
"woProcessUid"
:
1
});
$
.
ajax
({
url
:
url
,
dataType
:
"json"
,
data
:
data
,
type
:
'post'
,
contentType
:
"application/json; charset=utf-8"
,
success
:
function
(
res
)
{
console
.
log
(
res
);
orderList
.
workOrders
=
res
.
data
.
list
;
numCount
.
pageStart
=
numCount
.
pageStart
-
pageSize
;
numCount
.
pageEnd
=
numCount
.
pageEnd
-
prePageSize
;
prePageSize
=
res
.
data
.
size
;
}
});
},
nextPage
:
function
()
{
if
(
this
.
curPage
+
1
>
this
.
totalPage
)
{
if
(
this
.
curPage
+
1
>
this
.
totalPage
)
{
return
;
}
else
{
this
.
curPage
=
this
.
curPage
+
1
;
}
var
url
=
"/work/wo/list?page="
+
this
.
curPage
+
"&limit="
+
pageSize
;
var
data
=
JSON
.
stringify
({
"woStatus"
:
0
,
"woType"
:
"revisit"
,
"woProcessUid"
:
1
});
$
.
ajax
({
url
:
url
,
dataType
:
"json"
,
data
:
data
,
type
:
'post'
,
contentType
:
"application/json; charset=utf-8"
,
success
:
function
(
res
)
{
console
.
log
(
res
);
orderList
.
workOrders
=
res
.
data
.
list
;
prePageSize
=
res
.
data
.
size
;
numCount
.
pageStart
=
numCount
.
pageStart
+
pageSize
;
var
curItems
;
if
(
res
.
data
.
size
<
pageSize
){
curItems
=
res
.
data
.
size
;
}
else
{
curItems
=
pageSize
;
}
// 计算页数
numCount
.
pageEnd
=
numCount
.
pageEnd
+
curItems
;
}
});
}
}
})
// 工单状态选择Tab逻辑
var
url
=
"/work/wo/list?page=1&limit=
10"
;
var
url
=
"/work/wo/list?page=1&limit=
"
+
pageSize
;
var
statusTab
=
new
Vue
({
el
:
'#statusTab'
,
methods
:
{
...
...
@@ -143,13 +201,18 @@ jQuery(document).ready(function ($) {
success
:
function
(
res
)
{
console
.
log
(
res
);
orderList
.
workOrders
=
res
.
data
.
list
;
// 计算页数
if
(
res
.
data
.
total
%
res
.
data
.
size
==
0
)
{
pager
.
totalPage
=
Math
.
round
(
res
.
data
.
total
/
res
.
data
.
size
);
numCount
.
count
=
res
.
data
.
total
;
numCount
.
pageStart
=
1
;
var
curItems
;
if
(
res
.
data
.
size
<
pageSize
){
curItems
=
res
.
data
.
size
;
}
else
{
console
.
log
(
res
.
data
.
total
/
res
.
data
.
size
);
pager
.
totalPage
=
Math
.
round
(
res
.
data
.
total
/
res
.
data
.
size
)
+
1
;
curItems
=
pageSize
;
}
numCount
.
pageEnd
=
curItems
;
pager
.
curPage
=
1
;
// 计算页数
pager
.
totalPage
=
Math
.
ceil
(
res
.
data
.
total
/
pageSize
);
},
fail
:
function
(
msg
)
{
console
.
log
(
"Error happened, Please contact Administrator. "
+
msg
);
...
...
@@ -174,13 +237,18 @@ jQuery(document).ready(function ($) {
success
:
function
(
res
)
{
console
.
log
(
res
);
orderList
.
workOrders
=
res
.
data
.
list
;
// 计算页数
if
(
Math
.
round
(
res
.
data
.
total
%
res
.
data
.
size
)
==
0
)
{
pager
.
totalPage
=
Math
.
round
(
res
.
data
.
total
/
res
.
data
.
size
);
numCount
.
count
=
res
.
data
.
total
;
numCount
.
pageStart
=
1
;
var
curItems
;
if
(
res
.
data
.
size
<
pageSize
){
curItems
=
res
.
data
.
size
;
}
else
{
console
.
log
(
res
.
data
.
total
/
res
.
data
.
size
);
pager
.
totalPage
=
Math
.
round
(
res
.
data
.
total
/
res
.
data
.
size
)
+
1
;
curItems
=
pageSize
;
}
pager
.
curPage
=
1
;
numCount
.
pageEnd
=
curItems
;
// 计算页数
pager
.
totalPage
=
Math
.
ceil
(
res
.
data
.
total
/
pageSize
);
},
fail
:
function
(
msg
)
{
console
.
log
(
msg
);
...
...
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