Commit 065b58b1 by Jie Feng

logic change

parent e481d8f8
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
<a href="#"><i class="fa fa-upload" aria-hidden="true"></i>备用上传</a> <a href="#"><i class="fa fa-upload" aria-hidden="true"></i>备用上传</a>
<a href="#"><i class="fa fa-upload" aria-hidden="true"></i>海外收款</a>--> <a href="#"><i class="fa fa-upload" aria-hidden="true"></i>海外收款</a>-->
<a href="#" class="user-img"><img src="./images/avatar.jpg" alt="">admin</a> <a href="#" class="user-img"><img src="./images/avatar.jpg" alt="">admin</a>
<a href="#"><i class="fa fa-upload" aria-hidden="true"></i>退出</a>
</div> </div>
</div> </div>
</div> </div>
...@@ -136,11 +137,11 @@ ...@@ -136,11 +137,11 @@
</div> </div>
</div> </div>
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingFive"> <div class="panel-heading" role="tab" data-toggle="collapse" id="headingFive">
<h4 class="panel-title"> <h4 class="panel-title">
<a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion"
href="#collapseFive" aria-expanded="false" aria-controls="collapseFive"> href="#collapseFive" aria-expanded="true" aria-controls="collapseFive">
<i class="fa fa-bookmark" aria-hidden="true"></i>工单管理<i <i class="fa fa-bookmark" aria-hidden="false"></i>工单管理<i
class="fa fa-angle-left right" aria-hidden="true"></i> class="fa fa-angle-left right" aria-hidden="true"></i>
</a> </a>
</h4> </h4>
...@@ -164,15 +165,19 @@ ...@@ -164,15 +165,19 @@
<button type="button" class="btn btn-default">回访</button> <button type="button" class="btn btn-default">回访</button>
<!--<button type="button" class="btn btn-default else">其他</button>--> <!--<button type="button" class="btn btn-default else">其他</button>-->
</div> </div>
<div class="status" id="workStatus"> <div class="status" id="workStatus" >
工作状态:<select name="status" id=""> 工作状态:
<option value="">空闲中</option> <select @change="updateWOStatus">
<option value="">下班</option> <option v-for="(item,index) in woStates" :value='index'> {{item.text}}
<option value="">挂起</option> </option>
<option value="">接待中</option>
<option value="">会议中</option>
<option value="">午饭中</option>
</select> </select>
<!--
<option value=''>空闲中</option>
<option value='' >下班</option>
<option value='' >挂起</option>
<option value='' >接待中</option>
<option value='' >会议中</option>
<option value='' >午饭中</option>-->
</div> </div>
<ul id="statusTab" class="nav nav-tabs" role="tablist"> <ul id="statusTab" class="nav nav-tabs" role="tablist">
<li role="presentation" class="active"><a href="#home" id="home-tab" role="tab" data-toggle="tab" <li role="presentation" class="active"><a href="#home" id="home-tab" role="tab" data-toggle="tab"
...@@ -186,7 +191,7 @@ ...@@ -186,7 +191,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-20条,共{{message}}条数据</div> <div class="detail" id="numCount">第1-10条,共{{message}}条数据</div>
<!-- 表格 --> <!-- 表格 -->
<table class="table" id="order-list"> <table class="table" id="order-list">
...@@ -222,7 +227,7 @@ ...@@ -222,7 +227,7 @@
<nav aria-label="..." id="pager"> <nav aria-label="..." id="pager">
<ul class="pager"> <ul class="pager">
<li><a href="#" v-on:click="prePage()">上一页</a></li> <li><a href="#" v-on:click="prePage()">上一页</a></li>
<li><span>{{curPage}}</span>/<span>20</span></li> <li><span>{{curPage}}</span>/<span>{{totalPage}}</span></li>
<li><a href="#" v-on:click="nextPage()">下一页</a></li> <li><a href="#" v-on:click="nextPage()">下一页</a></li>
</ul> </ul>
</nav> </nav>
......
jQuery(document).ready(function($) { jQuery(document).ready(function ($) {
// 工单列表逻辑 // 工单列表逻辑
var orderList = new Vue({ var orderList = new Vue({
...@@ -15,7 +15,7 @@ jQuery(document).ready(function($) { ...@@ -15,7 +15,7 @@ jQuery(document).ready(function($) {
"id": wo.id, "id": wo.id,
"woStatus": wo.woStatus, "woStatus": wo.woStatus,
"woType": wo.woType, "woType": wo.woType,
"woProcessUid":'' "woProcessUid": ''
} }
); );
$.ajax({ $.ajax({
...@@ -27,6 +27,14 @@ jQuery(document).ready(function($) { ...@@ -27,6 +27,14 @@ 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;
// 计算页数
if (Math.round(res.data.total % res.data.size) == 0) {
pager.totalPage = Math.round(res.data.total / res.data.size);
} else {
console.log(res.data.total / res.data.size);
pager.totalPage = Math.round(res.data.total / res.data.size) + 1;
}
}, },
fail: function (msg) { fail: function (msg) {
console.log(msg); console.log(msg);
...@@ -39,12 +47,12 @@ jQuery(document).ready(function($) { ...@@ -39,12 +47,12 @@ jQuery(document).ready(function($) {
}) })
function initLoadWO() { function initLoadWO() {
var url = "/work/wo/list?page=1&limit=20"; var url = "/work/wo/list?page=1&limit=10";
var data = JSON.stringify({ var data = JSON.stringify({
"reqDto": { "reqDto": {
"woStatus": 0, "woStatus": 0,
"woType": "revisit", "woType": "revisit",
"woProcessUid":'' "woProcessUid": ''
} }
}); });
$.ajax({ $.ajax({
...@@ -57,6 +65,14 @@ jQuery(document).ready(function($) { ...@@ -57,6 +65,14 @@ jQuery(document).ready(function($) {
console.log(res); console.log(res);
orderList.workOrders = res.data.list; orderList.workOrders = res.data.list;
numCount.message = res.data.total; 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);
} else {
console.log(res.data.total / res.data.size);
pager.totalPage = Math.round(res.data.total / res.data.size) + 1;
}
} }
}); });
} }
...@@ -69,36 +85,77 @@ jQuery(document).ready(function($) { ...@@ -69,36 +85,77 @@ jQuery(document).ready(function($) {
// 员工工作状态逻辑 // 员工工作状态逻辑
var workStatus = new Vue({ var workStatus = new Vue({
el: '#workStatus', el: '#workStatus',
selected: {},
methods: {
updateWOStatus: function (val) {
console.log('updateWOStatus:' + val.target.value);
var url = "/work/ws/update";
var data = JSON.stringify({
"woStatus": val.target.value,
"statusDisplay": "",
"userId": '1'
});
$.ajax({
url: url,
dataType: "json",
data: data,
type: 'post',
contentType: "application/json; charset=utf-8",
success: function (res) {
console.log(res);
console.log("用户状态修改成功!");
}
});
}
},
data: { data: {
curStatus: '下班' woStates: [
{value: 0, text: '空闲中'},
{value: 1, text: '下班'},
{value: 2, text: '挂起'},
{value: 3, text: '接待中'},
{value: 4, text: '会议中'},
{value: 5, text: '午饭中'}
]
} }
}) })
// 数据提示条 // 数据提示条
var numCount = new Vue({ var numCount = new Vue({
el: '#numCount', el: '#numCount',
data: { data: {
message:"100" message: "100"
} }
}) })
// 页面分页按钮逻辑 // 页面分页按钮逻辑
var pager = new Vue({ var pager = new Vue({
el: '#pager', el: '#pager',
data: { data: {
curPage: 1 curPage: 1,
totalPage: 1
}, },
methods: { methods: {
prePage: function() { prePage: function () {
if (this.curPage - 1 < 1) {
return;
} else {
this.curPage = this.curPage - 1; this.curPage = this.curPage - 1;
}
}, },
nextPage: function() { nextPage: function () {
if (this.curPage + 1 > this.totalPage) {
return;
} else {
this.curPage = this.curPage + 1; this.curPage = this.curPage + 1;
} }
} }
}
}) })
// 工单状态选择Tab逻辑 // 工单状态选择Tab逻辑
var url = "/work/wo/list?page=1&limit=20"; var url = "/work/wo/list?page=1&limit=10";
var statusTab = new Vue({ var statusTab = new Vue({
el: '#statusTab', el: '#statusTab',
methods: { methods: {
...@@ -107,7 +164,7 @@ jQuery(document).ready(function($) { ...@@ -107,7 +164,7 @@ jQuery(document).ready(function($) {
{ {
"woStatus": 0, "woStatus": 0,
"woType": "revisit", "woType": "revisit",
"woProcessUid":'' "woProcessUid": ''
} }
); );
$.ajax({ $.ajax({
...@@ -117,7 +174,15 @@ jQuery(document).ready(function($) { ...@@ -117,7 +174,15 @@ jQuery(document).ready(function($) {
type: 'post', type: 'post',
contentType: "application/json; charset=utf-8", contentType: "application/json; charset=utf-8",
success: function (res) { success: function (res) {
console.log(res);
orderList.workOrders = res.data.list; orderList.workOrders = res.data.list;
// 计算页数
if (res.data.total % res.data.size == 0) {
pager.totalPage = Math.round(res.data.total / res.data.size);
} else {
console.log(res.data.total / res.data.size);
pager.totalPage = Math.round(res.data.total / res.data.size) + 1;
}
}, },
fail: function (msg) { fail: function (msg) {
console.log("Error happened, Please contact Administrator. " + msg); console.log("Error happened, Please contact Administrator. " + msg);
...@@ -130,7 +195,7 @@ jQuery(document).ready(function($) { ...@@ -130,7 +195,7 @@ jQuery(document).ready(function($) {
{ {
"woStatus": 1, "woStatus": 1,
"woType": "revisit", "woType": "revisit",
"woProcessUid":'' "woProcessUid": ''
} }
); );
$.ajax({ $.ajax({
...@@ -142,6 +207,13 @@ jQuery(document).ready(function($) { ...@@ -142,6 +207,13 @@ 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;
// 计算页数
if (Math.round(res.data.total % res.data.size) == 0) {
pager.totalPage = Math.round(res.data.total / res.data.size);
} else {
console.log(res.data.total / res.data.size);
pager.totalPage = Math.round(res.data.total / res.data.size) + 1;
}
}, },
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