Commit 102406b7 authored by linxin's avatar linxin

添加分页,搜索以及修改bug

parent cfc56f03
...@@ -78,6 +78,9 @@ export default { ...@@ -78,6 +78,9 @@ export default {
}, },
immediate: true, immediate: true,
}, },
keyWord (newVal, oldVal) {
this.search()
},
}, },
created () { created () {
}, },
...@@ -87,6 +90,23 @@ export default { ...@@ -87,6 +90,23 @@ export default {
}) })
}, },
methods: { methods: {
search () {
let vm = this
let randomString = Math.floor(Math.random() * 21)
let url = process.env.basePath + 'car_confirm_list_query' + '&index' + `'${randomString}'`
let param = {
user_phone: window.localStorage.getItem('user_phone'),
searchInput: vm.keyWord,
}
vm.$post(url, param).then(function (res) {
if (res.result === 'S') {
vm.lists = res.lists
vm.selectShowList()
} else {
hlsPopup.showLongCenter(res.message)
}
})
},
selectShowList () { selectShowList () {
let vm = this let vm = this
vm.undo = [] vm.undo = []
...@@ -115,7 +135,8 @@ export default { ...@@ -115,7 +135,8 @@ export default {
}, },
getList () { getList () {
let vm = this let vm = this
let url = process.env.basePath + 'car_confirm_list_query' let randomString = Math.floor(Math.random() * 21)
let url = process.env.basePath + 'car_confirm_list_query' + '&index' + `'${randomString}'`
let param = { let param = {
user_phone: window.localStorage.getItem('user_phone'), user_phone: window.localStorage.getItem('user_phone'),
pagesize: 10, pagesize: 10,
...@@ -139,6 +160,7 @@ export default { ...@@ -139,6 +160,7 @@ export default {
vum.forEach(returnData, function (data, index, array) { vum.forEach(returnData, function (data, index, array) {
vm.lists.push(array[index]) vm.lists.push(array[index])
}) })
vm.pagenum++
vm.$refs.scroll.update(false) vm.$refs.scroll.update(false)
} }
vm.selectShowList() vm.selectShowList()
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<div class="center"> <div class="center">
<div><span>合同金额</span><p>{{ item.total_price|currency }}</p></div> <div><span>合同金额</span><p>{{ item.total_price|currency }}</p></div>
<div><span>已还金额</span><p class="bold">{{ item.recivied_amount|currency }}</p></div> <div><span>已还金额</span><p class="bold">{{ item.recivied_amount|currency }}</p></div>
<span v-if="item.overdue_status==='Y'" class="red">已逾期</span> <span v-if="item.overdue_status==='已逾期'" class="red">已逾期</span>
<section @click="toRepayDetails(item)"> <section @click="toRepayDetails(item)">
<img src="@/assets/contractRepayment/view.png" alt=""> <img src="@/assets/contractRepayment/view.png" alt="">
<span>查看合同明细</span> <span>查看合同明细</span>
......
...@@ -321,21 +321,6 @@ export default { ...@@ -321,21 +321,6 @@ export default {
.green { .green {
background-color: rgba(27, 162, 97, 0.5); background-color: rgba(27, 162, 97, 0.5);
} }
// .top {
// font-family: PingFangSC-Regular;
// font-size: 13px;
// color: rgba(56, 63, 69, 0.6);
// letter-spacing: 0;
// display: flex;
// justify-content: space-between;
// span {
// // margin-left: 20px;
// font-family: PingFangSC-Regular;
// font-size: 13px;
// color: #4b4a4b;
// letter-spacing: 0;
// }
// }
.time { .time {
flex: 3; flex: 3;
height: 85%; height: 85%;
......
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
</div> </div>
</div> </div>
<div slot="content"> <div slot="content">
<span v-if="item.overdue_times!=undefined" :class="['status','red']">逾期{{ item.overdue_times }}</span> <span v-if="item.overdue_times!=0" :class="['status','red']">逾期{{ item.overdue_times }}</span>
<div class="plan" @click="toRepayPlan(item.contract_id)"> <div class="plan" @click="toRepayPlan(item.contract_id)">
<img src="@/assets/contractRepayment/plan.png" alt=""> <img src="@/assets/contractRepayment/plan.png" alt="">
<span>还款计划</span> <span>还款计划</span>
......
...@@ -73,6 +73,8 @@ export default { ...@@ -73,6 +73,8 @@ export default {
beforeRouteEnter (to, from, next) { beforeRouteEnter (to, from, next) {
next(vm => { next(vm => {
// if (from.name === 'MyInfo') { // if (from.name === 'MyInfo') {
vm.pagenum = 1
vm.lists = []
vm.getList() vm.getList()
// } // }
}) })
...@@ -88,10 +90,30 @@ export default { ...@@ -88,10 +90,30 @@ export default {
}, },
immediate: true, immediate: true,
}, },
keyWord (newVal, oldVal) {
this.search()
},
}, },
created () { created () {
}, },
methods: { methods: {
search () {
let vm = this
let randomString = Math.floor(Math.random() * 21)
let url = process.env.basePath + 'car_apply_list_query' + '&index' + `'${randomString}'`
let param = {
user_phone: window.localStorage.getItem('user_phone'),
searchInput: vm.keyWord,
}
vm.$post(url, param).then(function (res) {
if (res.result === 'S') {
vm.lists = res.lists
vm.selectShowList()
} else {
hlsPopup.showLongCenter(res.message)
}
})
},
selectShowList () { selectShowList () {
let vm = this let vm = this
vm.undo = [] vm.undo = []
...@@ -126,7 +148,8 @@ export default { ...@@ -126,7 +148,8 @@ export default {
}, },
getList () { getList () {
let vm = this let vm = this
let url = process.env.basePath + 'car_apply_list_query' let randomString = Math.floor(Math.random() * 21)
let url = process.env.basePath + 'car_apply_list_query' + '&index' + `'${randomString}'`
let param = { let param = {
user_phone: window.localStorage.getItem('user_phone'), user_phone: window.localStorage.getItem('user_phone'),
pagesize: 10, pagesize: 10,
...@@ -137,7 +160,6 @@ export default { ...@@ -137,7 +160,6 @@ export default {
vm.$post(url, param).then(function (res) { vm.$post(url, param).then(function (res) {
vm.hlsPopup.hideLoading() vm.hlsPopup.hideLoading()
if (res.result === 'S') { if (res.result === 'S') {
vm.pagenum += 1
let returnData = [] let returnData = []
returnData = res.lists returnData = res.lists
if (returnData.length === 0) { if (returnData.length === 0) {
...@@ -151,10 +173,10 @@ export default { ...@@ -151,10 +173,10 @@ export default {
vum.forEach(returnData, function (data, index, array) { vum.forEach(returnData, function (data, index, array) {
vm.lists.push(array[index]) vm.lists.push(array[index])
}) })
vm.pagenum++
vm.$refs.scroll.update(false) vm.$refs.scroll.update(false)
} }
// vm.lists = res.lists vm.selectShowList()
// vm.selectShowList()
} else { } else {
hlsPopup.showLongCenter(res.message) hlsPopup.showLongCenter(res.message)
} }
......
...@@ -234,7 +234,7 @@ export default new Router({ ...@@ -234,7 +234,7 @@ export default new Router({
{path: '/repay-details', component: RepayDetails, name: 'RepayDetails', meta: {keepAlive: true}}, {path: '/repay-details', component: RepayDetails, name: 'RepayDetails', meta: {keepAlive: true}},
{path: '/repay-plan', component: RepayPlan, name: 'RepayPlan', meta: {keepAlive: true}}, {path: '/repay-plan', component: RepayPlan, name: 'RepayPlan', meta: {keepAlive: true}},
// 发车申请 // 发车申请
{path: '/start-List', component: StartList, name: 'StartList', meta: {keepAlive: true}}, {path: '/start-List', component: StartList, name: 'StartList', meta: {keepAlive: false}},
{path: '/add-car', component: AddCar, name: 'AddCar', meta: {keepAlive: false}}, {path: '/add-car', component: AddCar, name: 'AddCar', meta: {keepAlive: false}},
// 发车确认 // 发车确认
{path: '/confirm-detail', component: ConfirmDetail, name: 'ConfirmDetail', meta: {keepAlive: true}}, {path: '/confirm-detail', component: ConfirmDetail, name: 'ConfirmDetail', meta: {keepAlive: true}},
......
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
let store = new Vuex.Store({
state: {
routerHistory: [],
userInfo: void 0,
allSystemUser: void 0,
locationSearch: void 0,
},
getters: {
getRouterHistory: (state) => {
return state.routerHistory
},
getUserInfo: (state) => {
return state.userInfo
},
getAllSystemUser: (state) => {
return state.allSystemUser
},
getLocationSearch: (state) => {
return state.locationSearch
},
},
mutations: {
setRouterHistory: (state, value) => {
state.routerHistory = value
},
setUserInfo: (state, value) => {
state.userInfo = value
},
setAllSystemUser: (state, value) => {
state.allSystemUser = value
},
setLocationSearch: (state, value) => {
state.locationSearch = value
},
},
})
export default store
const createGetter = (state) => {
let getters = {}
for (let key in state) {
let getter = `get${key.replace(key.charAt(0), key.charAt(0).toUpperCase())}`
getters[getter] = (state) => {
return state[key]
}
}
return getters
}
const createMutations = (state) => {
let mutations = {}
for (let key in state) {
let mutation = `set${key.replace(key.charAt(0), key.charAt(0).toUpperCase())}`
mutations[mutation] = (state, value) => {
state[key] = value
}
}
return mutations
}
export {
createGetter,
createMutations,
}
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