Commit 30e249a8 authored by 786817560's avatar 786817560

'部分分页'

parent af1385df
<!-- <!--
* @Author: your name * @Author: your name
* @Date: 2019-10-31 09:49:57 * @Date: 2019-10-31 09:49:57
* @LastEditTime: 2019-11-18 16:31:19 * @LastEditTime: 2019-11-19 11:12:37
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: 合同查询--明细 * @Description: 合同查询--明细
* @FilePath: * @FilePath:
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
</div> </div>
</div> </div>
<div slot="content"> <div slot="content">
<span v-if="item.overdue_times" :class="['status','red']">逾期{{ totalTimes }}</span> <span v-if="item.overdue_times" :class="['status','red']">逾期{{ item.overdue_times }}</span>
<div class="plan" @click="toRepayPlans(item.contract_id)"> <div class="plan" @click="toRepayPlans(item.contract_id)">
<img src="@/assets/contractRepayment/plan.png" alt=""> <img src="@/assets/contractRepayment/plan.png" alt="">
<span>还款计划</span> <span>还款计划</span>
...@@ -99,13 +99,7 @@ export default { ...@@ -99,13 +99,7 @@ export default {
} }
}, },
computed: { computed: {
totalTimes () {
let num = 0
for (let item of this.lists) {
num += Number(item.overdue_times)
}
return num
},
}, },
watch: {}, watch: {},
beforeRouteEnter (to, from, next) { beforeRouteEnter (to, from, next) {
......
<!-- <!--
* @Author: your name * @Author: your name
* @Date: 2019-09-29 10:02:11 * @Date: 2019-09-29 10:02:11
* @LastEditTime: 2019-11-18 16:25:52 * @LastEditTime: 2019-11-19 16:47:01
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: In User Settings Edit * @Description: In User Settings Edit
--> -->
...@@ -26,14 +26,13 @@ ...@@ -26,14 +26,13 @@
<!-- <h-content > --> <!-- <h-content > -->
<scroll <scroll
v-if="num === 1"
ref="scroll" ref="scroll"
:updateData="[submitLists]" :updateData="[showLists]"
:pullUp="true" :pullUp="true"
@pullingUp="loadMore" @pullingUp="loadMore"
> >
<div class="wrap"> <div class="wrap">
<div v-for="(item,index) in submitLists" :key="index" class="contract-lists" > <div v-for="(item,index) in showLists" :key="index" class="contract-lists" >
<div class="pro-code" @click="goDetails(item)"> <div class="pro-code" @click="goDetails(item)">
<img src="@/assets/distributorSign/fileIcon.png" alt="" class="file-icon"> <img src="@/assets/distributorSign/fileIcon.png" alt="" class="file-icon">
<p> <p>
...@@ -50,35 +49,6 @@ ...@@ -50,35 +49,6 @@
</div> </div>
</div> </div>
</scroll> </scroll>
<!-- </h-content> -->
<!-- <h-content > -->
<scroll
v-if="num === 2"
ref="scrollList"
:updateData="[approvedLists]"
:pullUp="true"
@pullingUp="loadMore"
>
<div class="wrap">
<div v-for="(item,index) in approvedLists" :key="index" class="contract-lists" >
<div class="pro-code" @click="goDetails(item)">
<img src="@/assets/distributorSign/fileIcon.png" alt="" class="file-icon">
<p>
<span>合同号</span>
<span>{{ item.project_number }}</span>
</p>
<img src="@/assets/distributorSign/goDetails.png" alt="" class="arrow">
</div>
<div class="box">
<div><p>承租人</p><p>{{ item.bp_name }}</p></div>
<div><p>合同租金</p><p class="money">{{ item.total_price|currency }}</p></div>
<div><p>申请时间</p><p>{{ dateConverse(item.confirm_start_date) }}</p></div>
</div>
</div>
</div>
</scroll>
<!-- </h-content> -->
</h-view> </h-view>
</template> </template>
...@@ -91,7 +61,7 @@ import unCheck2 from '@/assets/constractSigning/yes-undone.png' ...@@ -91,7 +61,7 @@ import unCheck2 from '@/assets/constractSigning/yes-undone.png'
export default { export default {
data () { data () {
return { return {
num: 1, num: null,
pagenum: 1, pagenum: 1,
searchInput: '', searchInput: '',
check1: Check1, check1: Check1,
...@@ -101,7 +71,30 @@ export default { ...@@ -101,7 +71,30 @@ export default {
user_bp_type: '', // 客户类型 user_bp_type: '', // 客户类型
submitLists: [], // 待签约 submitLists: [], // 待签约
approvedLists: [], // 已签约 approvedLists: [], // 已签约
showLists: [],
lists: [],
}
},
watch: {
'num': {
handler (newVal, oldVal) {
if (newVal === 1) {
this.showLists = this.submitLists
} else if (newVal === 2) {
this.showLists = this.approvedLists
}
},
immediate: true,
},
searchInput () {
let vm = this
if (vm.timeout) {
clearTimeout(vm.timeout)
} }
vm.timeout = setTimeout(() => {
vm.search()
}, 1000)
},
}, },
activated () { activated () {
...@@ -113,6 +106,8 @@ export default { ...@@ -113,6 +106,8 @@ export default {
next(vm => { next(vm => {
if (from.name === 'MyInfo') { if (from.name === 'MyInfo') {
vm.num = 1 vm.num = 1
vm.pagenum = 1
vm.searchInput = ''
vm.user_bp_type = vm.$route.params.user_bp_type vm.user_bp_type = vm.$route.params.user_bp_type
} }
vm.contractList() vm.contractList()
...@@ -138,13 +133,14 @@ export default { ...@@ -138,13 +133,14 @@ export default {
vm.hlsPopup.hideLoading() vm.hlsPopup.hideLoading()
if (res.result === 'S') { if (res.result === 'S') {
console.log(res.lists) console.log(res.lists)
vm.lists = res.lists
vm.submitLists = res.lists.filter(item => item.confirm_status === 'SUBMIT') vm.submitLists = res.lists.filter(item => item.confirm_status === 'SUBMIT')
vm.approvedLists = res.lists.filter(item => item.confirm_status === 'APPROVED') vm.approvedLists = res.lists.filter(item => item.confirm_status === 'APPROVED')
if (vm.submitLists.length > 0 && vm.submitLists.length < 10) { vm.showLists = vm.submitLists
if (res.lists.length > 0 && res.lists.length < 10) {
vm.$refs.scroll.update(true) vm.$refs.scroll.update(true)
} } else if (res.lists.length === 10) {
if (vm.approvedLists.length > 0 && vm.approvedLists.length < 10) { vm.$refs.scroll.update(false)
vm.$refs.scrollList.update(true)
} }
} else { } else {
hlsPopup.showLongCenter(res.message) hlsPopup.showLongCenter(res.message)
...@@ -154,31 +150,73 @@ export default { ...@@ -154,31 +150,73 @@ export default {
loadMore () { loadMore () {
let vm = this let vm = this
vm.pagenum++
let url = $config.basePath + 'prj_confirm_list_query' let url = $config.basePath + 'prj_confirm_list_query'
let param = { let param = {
user_phone: window.localStorage.user_phone, user_phone: window.localStorage.user_phone,
pagesize: 10, pagesize: 10,
pagenum: vm.pagenum + 1, pagenum: vm.pagenum,
searchInput: '1', searchInput: vm.searchInput,
} }
vm.hlsPopup.showLoading('数据加载中') vm.hlsPopup.showLoading('数据加载中')
vm.hlsHttp.post(url, param).then(function (res) { vm.hlsHttp.post(url, param).then(function (res) {
vm.hlsPopup.hideLoading() vm.hlsPopup.hideLoading()
let returnData = []
if (res.result === 'S') { if (res.result === 'S') {
console.log('.....', res.lists) returnData = res.lists
vm.submitLists = res.lists.filter(item => item.confirm_status === 'SUBMIT') if (returnData.length === 0) {
vm.approvedLists = res.lists.filter(item => item.confirm_status === 'APPROVED')
if (vm.submitLists.length > 0 && vm.submitLists.length < 10) {
vm.$refs.scroll.update(true) vm.$refs.scroll.update(true)
} else if (returnData.length > 0 && returnData.length < 10) {
returnData.forEach((data, index, array) => {
vm.lists.push(array[index])
})
vm.$refs.scroll.update(true)
} else if (returnData.length === 10) {
returnData.forEach((data, index, array) => {
vm.lists.push(array[index])
})
vm.$refs.scroll.update(false)
} }
if (vm.approvedLists.length > 0 && vm.approvedLists.length < 10) { vm.submitLists = vm.lists.filter(item => item.confirm_status === 'SUBMIT')
vm.$refs.scrollList.update(true) vm.approvedLists = vm.lists.filter(item => item.confirm_status === 'APPROVED')
if (vm.num === 1) {
vm.showLists = vm.submitLists
} else {
vm.showLists = vm.approvedLists
} }
} else { } else {
hlsPopup.showLongCenter(res.message) hlsPopup.showLongCenter(res.message)
} }
}) })
}, },
search () {
let vm = this
vm.pagenum = 1
let url = $config.basePath + 'prj_confirm_list_query'
let param = {
user_phone: window.localStorage.user_phone,
pagesize: 10,
pagenum: vm.pagenum,
searchInput: vm.searchInput,
}
vm.hlsPopup.showLoading('数据加载中')
vm.hlsHttp.post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
vm.lists = res.lists
vm.submitLists = vm.lists.filter(item => item.confirm_status === 'SUBMIT')
vm.approvedLists = vm.lists.filter(item => item.confirm_status === 'APPROVED')
if (vm.num === 1) {
vm.showLists = vm.submitLists
} else {
vm.showLists = vm.approvedLists
}
if (vm.lists.length >= 0 && vm.lists.length < 10) {
vm.$refs.scroll.update(true)
} else if (vm.lists.length === 10) {
vm.$refs.scroll.update(false)
}
})
},
goDetails (item) { goDetails (item) {
this.$router.push({ this.$router.push({
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<h-content> <h-content>
<div class="hinput"> <div class="hinput">
<div class="search-box"> <div class="search-box">
<input type="text" placeholder="请输入经销商/产品名称/参数项"> <input v-model="searchInput" type="text" placeholder="请输入经销商/产品名称/参数项">
<img src="@/assets/distributorSign/search.png" alt=""> <img src="@/assets/distributorSign/search.png" alt="">
</div> </div>
</div> </div>
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
ref="scroll" ref="scroll"
:updateData="[productList]" :updateData="[productList]"
:pullUp="true" :pullUp="true"
@pullingUp="loadMore"
> >
<div class="division-box"> <div class="division-box">
...@@ -56,11 +57,24 @@ ...@@ -56,11 +57,24 @@
export default { export default {
data () { data () {
return { return {
pagenum: 1,
searchInput: '',
productList: [], productList: [],
} }
}, },
created: function () { created: function () {
}, },
watch: {
searchInput () {
let vm = this
if (vm.timeout) {
clearTimeout(vm.timeout)
}
vm.timeout = setTimeout(() => {
vm.search()
}, 1000)
},
},
mounted: function () { mounted: function () {
}, },
...@@ -70,9 +84,13 @@ export default { ...@@ -70,9 +84,13 @@ 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.searchInput = ''
vm.getList()
} else if (from.name === 'ProDetailed') {
vm.getList() vm.getList()
// } }
}) })
}, },
methods: { methods: {
...@@ -80,6 +98,9 @@ export default { ...@@ -80,6 +98,9 @@ export default {
let vm = this let vm = this
let url = $config.basePath + 'my_collection_query' let url = $config.basePath + 'my_collection_query'
let param = { let param = {
pagesize: 10,
pagenum: vm.pagenum,
searchInput: vm.searchInput,
user_phone: window.localStorage.getItem('user_phone'), user_phone: window.localStorage.getItem('user_phone'),
} }
hlsPopup.showLoading('数据加载中') hlsPopup.showLoading('数据加载中')
...@@ -87,16 +108,89 @@ export default { ...@@ -87,16 +108,89 @@ export default {
hlsPopup.hideLoading() hlsPopup.hideLoading()
if (res.result === 'S') { if (res.result === 'S') {
vm.productList = res.lists vm.productList = res.lists
res.lists.forEach(item => {
if (vm.productList.length === 0) {
vm.$refs.scroll.update(true)
} else if (vm.productList.length > 0 && vm.productList.length < 10) {
vm.productList.forEach(item => {
item['url'] = process.env.filePath + 'attachment_id=' + item.product_attachment_id + '&access_token=' + window.localStorage.access_token item['url'] = process.env.filePath + 'attachment_id=' + item.product_attachment_id + '&access_token=' + window.localStorage.access_token
}) })
if (res.lists.length > 0 && res.lists.length < 10) {
vm.$refs.scroll.update(true) vm.$refs.scroll.update(true)
} else if (vm.productList.length === 10) {
vm.productList.forEach(item => {
item['url'] = process.env.filePath + 'attachment_id=' + item.product_attachment_id + '&access_token=' + window.localStorage.access_token
})
vm.$refs.scroll.update(false)
} }
} else { } else {
hlsPopup.showLongCenter(res.message) hlsPopup.showLongCenter(res.message)
} }
}) })
},
loadMore () {
let vm = this
vm.pagenum = vm.pagenum + 1
let url = $config.basePath + 'my_collection_query'
let param = {
pagesize: 10,
pagenum: vm.pagenum,
searchInput: vm.searchInput,
user_phone: window.localStorage.getItem('user_phone'),
}
vm.hlsPopup.showLoading('数据加载中')
vm.$post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
let returnData = []
if (res.result === 'S') {
returnData = res.lists
if (returnData.length === 0) {
vm.$refs.scroll.update(true)
} else if (returnData.length > 0 && returnData.length < 10) {
returnData.forEach(item => {
item['url'] = process.env.filePath + 'attachment_id=' + item.product_attachment_id + '&access_token=' + window.localStorage.access_token
})
returnData.forEach((data, index, array) => {
vm.productList.push(array[index])
})
vm.$refs.scroll.update(true)
} else if (returnData.length === 10) {
returnData.forEach(item => {
item['url'] = process.env.filePath + 'attachment_id=' + item.product_attachment_id + '&access_token=' + window.localStorage.access_token
})
returnData.forEach((data, index, array) => {
vm.productList.push(array[index])
})
vm.$refs.scroll.update(false)
}
} else {
hlsPopup.showLongCenter(res.message)
}
})
},
search () {
let vm = this
vm.pagenum = 1
// vm.bpList = []
let url = $config.basePath + 'my_collection_query'
let param = {
pagesize: 10,
pagenum: 1,
searchInput: vm.searchInput,
user_phone: window.localStorage.getItem('user_phone'),
}
vm.hlsPopup.showLoading('数据加载中')
vm.hlsHttp.post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
vm.productList = res.lists
vm.productList.forEach(item => {
item['url'] = process.env.filePath + 'attachment_id=' + item.product_attachment_id + '&access_token=' + window.localStorage.access_token
})
if (vm.productList.length >= 0 && vm.productList.length < 10) {
vm.$refs.scroll.update(true)
} else if (vm.productList.length === 10) {
vm.$refs.scroll.update(false)
}
})
}, },
// val:产品id, status: 收藏状态 // val:产品id, status: 收藏状态
goDetailed (val, status, bp_id) { // 进入产品查询功能明细页面 goDetailed (val, status, bp_id) { // 进入产品查询功能明细页面
......
...@@ -59,15 +59,32 @@ export default { ...@@ -59,15 +59,32 @@ export default {
data () { data () {
return { return {
lists: [], lists: [],
pagenum: 2, pagenum: 1,
searchInput: '', searchInput: '',
} }
}, },
computed: {}, computed: {},
watch: {}, watch: {
activated () { searchInput () {
// debugger let vm = this
this.proQuery() if (vm.timeout) {
clearTimeout(vm.timeout)
}
vm.timeout = setTimeout(() => {
vm.search()
}, 1000)
},
},
beforeRouteEnter (to, from, next) {
next(vm => {
if (from.name === 'QueryHome') {
vm.pagenum = 1
vm.searchInput = ''
vm.proQuery()
} else if (from.name === 'ProDetailed') {
vm.proQuery()
}
})
}, },
methods: methods:
{ {
...@@ -87,14 +104,19 @@ export default { ...@@ -87,14 +104,19 @@ export default {
vm.hlsPopup.hideLoading() vm.hlsPopup.hideLoading()
if (res.result === 'S') { if (res.result === 'S') {
vm.lists = res.lists vm.lists = res.lists
res.lists.forEach(item => { if (vm.lists.length === 0) {
vm.$refs.scroll.update(true)
} else if (vm.lists.length > 0 && vm.lists.length < 10) {
vm.lists.forEach(item => {
item['url'] = process.env.filePath + 'attachment_id=' + item.product_attachment_id + '&access_token=' + window.localStorage.access_token item['url'] = process.env.filePath + 'attachment_id=' + item.product_attachment_id + '&access_token=' + window.localStorage.access_token
}) })
if (res.lists.length > 0 && res.lists.length < 10) {
vm.$refs.scroll.update(true) vm.$refs.scroll.update(true)
} else if (vm.lists.length === 10) {
vm.lists.forEach(item => {
item['url'] = process.env.filePath + 'attachment_id=' + item.product_attachment_id + '&access_token=' + window.localStorage.access_token
})
vm.$refs.scroll.update(false)
} }
// vm.picLists = res.lists
// console.log('........',vm.picLists)
} else { } else {
hlsPopup.showLongCenter(res.message) hlsPopup.showLongCenter(res.message)
} }
...@@ -103,7 +125,7 @@ export default { ...@@ -103,7 +125,7 @@ export default {
loadMore () { loadMore () {
let vm = this let vm = this
vm.pagenum++ vm.pagenum = vm.pagenum + 1
let url = $config.basePath + 'prd_product_list' let url = $config.basePath + 'prd_product_list'
let param = { let param = {
division: window.sessionStorage.division, division: window.sessionStorage.division,
...@@ -115,20 +137,62 @@ export default { ...@@ -115,20 +137,62 @@ export default {
vm.hlsPopup.showLoading('数据加载中') vm.hlsPopup.showLoading('数据加载中')
vm.$post(url, param).then(function (res) { vm.$post(url, param).then(function (res) {
vm.hlsPopup.hideLoading() vm.hlsPopup.hideLoading()
let returnData = []
if (res.result === 'S') { if (res.result === 'S') {
console.log('...........', res.lists) returnData = res.lists
// vm.lists = res.lists if (returnData.length === 0) {
// res.lists.forEach(item => { vm.$refs.scroll.update(true)
// item['url'] = process.env.filePath + 'attachment_id=' + item.product_attachment_id + '&access_token=' + window.localStorage.access_token } else if (returnData.length > 0 && returnData.length < 10) {
// }) returnData.forEach(item => {
// if (res.lists.length > 0 && res.lists.length < 10) { item['url'] = process.env.filePath + 'attachment_id=' + item.product_attachment_id + '&access_token=' + window.localStorage.access_token
// vm.$refs.scroll.update(true) })
// } returnData.forEach((data, index, array) => {
vm.lists.push(array[index])
})
vm.$refs.scroll.update(true)
} else if (returnData.length === 10) {
returnData.forEach(item => {
item['url'] = process.env.filePath + 'attachment_id=' + item.product_attachment_id + '&access_token=' + window.localStorage.access_token
})
returnData.forEach((data, index, array) => {
vm.lists.push(array[index])
})
vm.$refs.scroll.update(false)
}
} else { } else {
hlsPopup.showLongCenter(res.message) hlsPopup.showLongCenter(res.message)
} }
}) })
}, },
// 搜索
search () {
let vm = this
vm.pagenum = 1
// vm.bpList = []
let url = $config.basePath + 'prd_product_list'
let param = {
pagesize: 10,
pagenum: 1,
searchInput: vm.searchInput,
division: window.sessionStorage.division,
user_phone: window.localStorage.user_phone,
}
vm.hlsPopup.showLoading('数据加载中')
vm.hlsHttp.post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
console.log(res)
vm.lists = res.lists
vm.lists.forEach(item => {
item['url'] = process.env.filePath + 'attachment_id=' + item.product_attachment_id + '&access_token=' + window.localStorage.access_token
})
if (vm.lists.length >= 0 && vm.lists.length < 10) {
vm.$refs.scroll.update(true)
} else if (vm.lists.length === 10) {
vm.$refs.scroll.update(false)
}
})
},
// val:产品id, status: 收藏状态 // val:产品id, status: 收藏状态
goDetailed (val, status, bp_id) { goDetailed (val, status, bp_id) {
window.sessionStorage.setItem('collect_status', status) window.sessionStorage.setItem('collect_status', status)
......
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