Commit 065b58b1 by Jie Feng

logic change

parent e481d8f8
......@@ -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="#" 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>
......@@ -136,11 +137,11 @@
</div>
</div>
<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">
<a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion"
href="#collapseFive" aria-expanded="false" aria-controls="collapseFive">
<i class="fa fa-bookmark" aria-hidden="true"></i>工单管理<i
href="#collapseFive" aria-expanded="true" aria-controls="collapseFive">
<i class="fa fa-bookmark" aria-hidden="false"></i>工单管理<i
class="fa fa-angle-left right" aria-hidden="true"></i>
</a>
</h4>
......@@ -164,15 +165,19 @@
<button type="button" class="btn btn-default">回访</button>
<!--<button type="button" class="btn btn-default else">其他</button>-->
</div>
<div class="status" id="workStatus">
工作状态:<select name="status" id="">
<option value="">空闲中</option>
<option value="">下班</option>
<option value="">挂起</option>
<option value="">接待中</option>
<option value="">会议中</option>
<option value="">午饭中</option>
<div class="status" id="workStatus" >
工作状态:
<select @change="updateWOStatus">
<option v-for="(item,index) in woStates" :value='index'> {{item.text}}
</option>
</select>
<!--
<option value=''>空闲中</option>
<option value='' >下班</option>
<option value='' >挂起</option>
<option value='' >接待中</option>
<option value='' >会议中</option>
<option value='' >午饭中</option>-->
</div>
<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"
......@@ -186,7 +191,7 @@
aria-controls="myTabDrop1-contents" aria-expanded="false" v-on:click="processed()">已完结</a>
</li>
</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">
......@@ -222,7 +227,7 @@
<nav aria-label="..." id="pager">
<ul class="pager">
<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>
</ul>
</nav>
......
jQuery(document).ready(function($) {
jQuery(document).ready(function ($) {
// 工单列表逻辑
var orderList = new Vue({
......@@ -15,7 +15,7 @@ jQuery(document).ready(function($) {
"id": wo.id,
"woStatus": wo.woStatus,
"woType": wo.woType,
"woProcessUid":''
"woProcessUid": ''
}
);
$.ajax({
......@@ -27,6 +27,14 @@ 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);
} else {
console.log(res.data.total / res.data.size);
pager.totalPage = Math.round(res.data.total / res.data.size) + 1;
}
},
fail: function (msg) {
console.log(msg);
......@@ -39,12 +47,12 @@ jQuery(document).ready(function($) {
})
function initLoadWO() {
var url = "/work/wo/list?page=1&limit=20";
var url = "/work/wo/list?page=1&limit=10";
var data = JSON.stringify({
"reqDto": {
"woStatus": 0,
"woType": "revisit",
"woProcessUid":''
"woProcessUid": ''
}
});
$.ajax({
......@@ -57,6 +65,14 @@ jQuery(document).ready(function($) {
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);
} 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($) {
// 员工工作状态逻辑
var workStatus = new Vue({
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: {
curStatus: '下班'
woStates: [
{value: 0, text: '空闲中'},
{value: 1, text: '下班'},
{value: 2, text: '挂起'},
{value: 3, text: '接待中'},
{value: 4, text: '会议中'},
{value: 5, text: '午饭中'}
]
}
})
// 数据提示条
var numCount = new Vue({
el: '#numCount',
data: {
message:"100"
message: "100"
}
})
// 页面分页按钮逻辑
var pager = new Vue({
el: '#pager',
data: {
curPage: 1
curPage: 1,
totalPage: 1
},
methods: {
prePage: function() {
prePage: function () {
if (this.curPage - 1 < 1) {
return;
} else {
this.curPage = this.curPage - 1;
}
},
nextPage: function() {
nextPage: function () {
if (this.curPage + 1 > this.totalPage) {
return;
} else {
this.curPage = this.curPage + 1;
}
}
}
})
// 工单状态选择Tab逻辑
var url = "/work/wo/list?page=1&limit=20";
var url = "/work/wo/list?page=1&limit=10";
var statusTab = new Vue({
el: '#statusTab',
methods: {
......@@ -107,7 +164,7 @@ jQuery(document).ready(function($) {
{
"woStatus": 0,
"woType": "revisit",
"woProcessUid":''
"woProcessUid": ''
}
);
$.ajax({
......@@ -117,7 +174,15 @@ jQuery(document).ready(function($) {
type: 'post',
contentType: "application/json; charset=utf-8",
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);
} else {
console.log(res.data.total / res.data.size);
pager.totalPage = Math.round(res.data.total / res.data.size) + 1;
}
},
fail: function (msg) {
console.log("Error happened, Please contact Administrator. " + msg);
......@@ -130,7 +195,7 @@ jQuery(document).ready(function($) {
{
"woStatus": 1,
"woType": "revisit",
"woProcessUid":''
"woProcessUid": ''
}
);
$.ajax({
......@@ -142,6 +207,13 @@ 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);
} else {
console.log(res.data.total / res.data.size);
pager.totalPage = Math.round(res.data.total / res.data.size) + 1;
}
},
fail: function (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