Commit 7472809e by Jie Feng
parents 1a60b8da 38497800
.idea/* .idea/*
*.iml *.iml
.project
...@@ -165,7 +165,7 @@ ...@@ -165,7 +165,7 @@
<div class="status" id="workStatus" > <div class="status" id="workStatus" >
工作状态: 工作状态:
<select @change="updateWOStatus"> <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> </option>
</select> </select>
</div> </div>
...@@ -181,7 +181,7 @@ ...@@ -181,7 +181,7 @@
aria-controls="myTabDrop1-contents" aria-expanded="false" v-on:click="processed()">已完结</a> aria-controls="myTabDrop1-contents" aria-expanded="false" v-on:click="processed()">已完结</a>
</li> </li>
</ul> </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"> <table class="table" id="order-list">
...@@ -204,11 +204,11 @@ ...@@ -204,11 +204,11 @@
<th scope="row">{{wo.id}}</th> <th scope="row">{{wo.id}}</th>
<td>{{wo.urgentLevelDisplay}}</td> <td>{{wo.urgentLevelDisplay}}</td>
<td>{{wo.woType}}</td> <td>{{wo.woType}}</td>
<td>{{wo.woCreateUname}}</td> <td>{{wo.woCreateName}}</td>
<td>{{wo.deptName}}</td> <td>{{wo.deptName}}</td>
<td>{{wo.statusDisplay}}</td> <td>{{wo.statusDisplay}}</td>
<td>{{wo.woStartTime}}</td> <td>{{wo.woFormattedStartTime}}</td>
<td>12:00</td> <td>{{wo.remainTime}}</td>
<td><a href="#" v-on:click="woDetail(wo)">查看</a></td> <td><a href="#" v-on:click="woDetail(wo)">查看</a></td>
</tr> </tr>
</tbody> </tbody>
......
jQuery(document).ready(function ($) { jQuery(document).ready(function ($) {
var pageSize = 10
var prePageSize
// 工单列表逻辑 // 工单列表逻辑
var orderList = new Vue({ var orderList = new Vue({
el: '#order-list', el: '#order-list',
...@@ -16,7 +18,7 @@ jQuery(document).ready(function ($) { ...@@ -16,7 +18,7 @@ jQuery(document).ready(function ($) {
}) })
function initLoadWO() { function initLoadWO() {
var url = "/work/wo/list?page=1&limit=10"; var url = "/work/wo/list?page=1&limit=" + pageSize;
var data = JSON.stringify({ var data = JSON.stringify({
"woStatus": 0, "woStatus": 0,
"woType": "revisit", "woType": "revisit",
...@@ -31,15 +33,18 @@ jQuery(document).ready(function ($) { ...@@ -31,15 +33,18 @@ jQuery(document).ready(function ($) {
success: function (res) { success: function (res) {
console.log(res); console.log(res);
orderList.workOrders = res.data.list; orderList.workOrders = res.data.list;
numCount.message = res.data.total; numCount.count = res.data.total;
numCount.pageStart = 1;
// 计算页数 var curItems;
if (Math.round(res.data.total % res.data.size) == 0) { if(res.data.size < pageSize){
pager.totalPage = Math.round(res.data.total / res.data.size); curItems = res.data.size;
} else { } else {
console.log(res.data.total / res.data.size); curItems = pageSize;
pager.totalPage = Math.round(res.data.total / res.data.size) + 1;
} }
numCount.pageEnd = curItems;
pager.curPage = 1;
// 计算页数
pager.totalPage = Math.ceil(res.data.total / pageSize);
} }
}); });
} }
...@@ -78,12 +83,11 @@ jQuery(document).ready(function ($) { ...@@ -78,12 +83,11 @@ jQuery(document).ready(function ($) {
}, },
data: { data: {
woStates: [ woStates: [
{value: 0, text: '空闲中'}, {value: 1, text: '空闲中'},
{value: 1, text: '下班'}, {value: 2, text: '下班'},
{value: 2, text: '挂起'},
{value: 3, text: '接待中'}, {value: 3, text: '接待中'},
{value: 4, text: '会议中'}, {value: 4, text: '会议中'},
{value: 5, text: '午饭中'} {value: 5, text: '短暂离开'}
] ]
} }
}) })
...@@ -93,15 +97,17 @@ jQuery(document).ready(function ($) { ...@@ -93,15 +97,17 @@ jQuery(document).ready(function ($) {
var numCount = new Vue({ var numCount = new Vue({
el: '#numCount', el: '#numCount',
data: { data: {
message: "100" count: "",
pageStart:"",
pageEnd:""
} }
}) })
// 页面分页按钮逻辑 // 页面分页按钮逻辑
var pager = new Vue({ var pager = new Vue({
el: '#pager', el: '#pager',
data: { data: {
curPage: 1, curPage: "",
totalPage: 1 totalPage: ""
}, },
methods: { methods: {
prePage: function () { prePage: function () {
...@@ -110,6 +116,28 @@ jQuery(document).ready(function ($) { ...@@ -110,6 +116,28 @@ jQuery(document).ready(function ($) {
} else { } else {
this.curPage = this.curPage - 1; 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 () { nextPage: function () {
if (this.curPage + 1 > this.totalPage) { if (this.curPage + 1 > this.totalPage) {
...@@ -117,12 +145,42 @@ jQuery(document).ready(function ($) { ...@@ -117,12 +145,42 @@ jQuery(document).ready(function ($) {
} else { } else {
this.curPage = this.curPage + 1; 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逻辑 // 工单状态选择Tab逻辑
var url = "/work/wo/list?page=1&limit=10"; var url = "/work/wo/list?page=1&limit=" + pageSize;
var statusTab = new Vue({ var statusTab = new Vue({
el: '#statusTab', el: '#statusTab',
methods: { methods: {
...@@ -143,13 +201,18 @@ jQuery(document).ready(function ($) { ...@@ -143,13 +201,18 @@ jQuery(document).ready(function ($) {
success: function (res) { success: function (res) {
console.log(res); console.log(res);
orderList.workOrders = res.data.list; orderList.workOrders = res.data.list;
// 计算页数 numCount.count = res.data.total;
if (res.data.total % res.data.size == 0) { numCount.pageStart = 1;
pager.totalPage = Math.round(res.data.total / res.data.size); var curItems;
if(res.data.size < pageSize){
curItems = res.data.size;
} else { } else {
console.log(res.data.total / res.data.size); curItems = pageSize;
pager.totalPage = Math.round(res.data.total / res.data.size) + 1;
} }
numCount.pageEnd = curItems;
pager.curPage = 1;
// 计算页数
pager.totalPage = Math.ceil(res.data.total / pageSize);
}, },
fail: function (msg) { fail: function (msg) {
console.log("Error happened, Please contact Administrator. " + msg); console.log("Error happened, Please contact Administrator. " + msg);
...@@ -174,13 +237,18 @@ jQuery(document).ready(function ($) { ...@@ -174,13 +237,18 @@ jQuery(document).ready(function ($) {
success: function (res) { success: function (res) {
console.log(res); console.log(res);
orderList.workOrders = res.data.list; orderList.workOrders = res.data.list;
// 计算页数 numCount.count = res.data.total;
if (Math.round(res.data.total % res.data.size) == 0) { numCount.pageStart = 1;
pager.totalPage = Math.round(res.data.total / res.data.size); var curItems;
if(res.data.size < pageSize){
curItems = res.data.size;
} else { } else {
console.log(res.data.total / res.data.size); curItems = pageSize;
pager.totalPage = Math.round(res.data.total / res.data.size) + 1;
} }
pager.curPage = 1;
numCount.pageEnd = curItems;
// 计算页数
pager.totalPage = Math.ceil(res.data.total / pageSize);
}, },
fail: function (msg) { fail: function (msg) {
console.log(msg); console.log(msg);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment