Commit 4cb0d869 authored by 786817560's avatar 786817560

'scroll修改'

parent ba8e1dbb
<!-- <!--
* @Author: your name * @Author: your name
* @Date: 2019-09-29 10:02:11 * @Date: 2019-09-29 10:02:11
* @LastEditTime: 2019-11-29 12:40:38 * @LastEditTime: 2019-11-29 17:31:00
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: In User Settings Edit * @Description: In User Settings Edit
--> -->
...@@ -23,14 +23,13 @@ ...@@ -23,14 +23,13 @@
</div> </div>
<scroll <scroll
v-show="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>
...@@ -48,9 +47,9 @@ ...@@ -48,9 +47,9 @@
</div> </div>
</scroll> </scroll>
<scroll <!-- <scroll
v-show="num === 2" v-show="num === 2"
ref="scrolls" ref="scroll"
:updateData="[approvedLists]" :updateData="[approvedLists]"
:pullUp="true" :pullUp="true"
@pullingUp="loadMore" @pullingUp="loadMore"
...@@ -72,7 +71,7 @@ ...@@ -72,7 +71,7 @@
</div> </div>
</div> </div>
</div> </div>
</scroll> </scroll> -->
</h-view> </h-view>
</template> </template>
...@@ -99,17 +98,23 @@ export default { ...@@ -99,17 +98,23 @@ export default {
approvedLists: [], // 已签约 approvedLists: [], // 已签约
showLists: [], showLists: [],
lists: [], lists: [],
submitFlag: false,
approvedFlag: false, approvedFlag: false,
} }
}, },
watch: { watch: {
'num': { 'num': {
handler (newVal, oldVal) { handler (newVal, oldVal) {
this.$refs.scroll.update(false)
if (newVal === 2) { if (newVal === 2) {
if (!this.approvedFlag) { if (!this.approvedFlag) {
this.contractList() this.contractList()
} }
this.$refs.scroll.scrollToTop()
this.showLists = this.approvedLists
} else if (newVal === 1) {
this.showLists = this.submitLists
this.$refs.scroll.scrollToTop()
// this.$refs.scroll.update(false)
} }
}, },
immediate: true, immediate: true,
...@@ -175,7 +180,7 @@ export default { ...@@ -175,7 +180,7 @@ export default {
vm.hlsPopup.hideLoading() vm.hlsPopup.hideLoading()
if (res.result === 'S') { if (res.result === 'S') {
vm.submitLists = res.lists vm.submitLists = res.lists
vm.submitFlag = true vm.showLists = vm.submitLists
if (res.lists.length > 0 && res.lists.length < 10) { 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) { } else if (res.lists.length === 10) {
...@@ -201,10 +206,11 @@ export default { ...@@ -201,10 +206,11 @@ export default {
console.log(res.lists) console.log(res.lists)
vm.approvedLists = res.lists vm.approvedLists = res.lists
vm.approvedFlag = true vm.approvedFlag = true
vm.showLists = vm.approvedLists
if (res.lists.length > 0 && res.lists.length < 10) { if (res.lists.length > 0 && res.lists.length < 10) {
vm.$refs.scrolls.update(true) vm.$refs.scroll.update(true)
} else if (res.lists.length === 10) { } else if (res.lists.length === 10) {
vm.$refs.scrolls.update(false) vm.$refs.scroll.update(false)
} }
} else { } else {
hlsPopup.showLongCenter(res.message) hlsPopup.showLongCenter(res.message)
...@@ -225,7 +231,7 @@ export default { ...@@ -225,7 +231,7 @@ export default {
confirm_status: 'SUBMIT', confirm_status: 'SUBMIT',
searchInput: vm.searchInput, 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 = [] let returnData = []
...@@ -244,6 +250,7 @@ export default { ...@@ -244,6 +250,7 @@ export default {
}) })
vm.$refs.scroll.update(false) vm.$refs.scroll.update(false)
} }
vm.showLists = vm.submitLists
} else { } else {
hlsPopup.showLongCenter(res.message) hlsPopup.showLongCenter(res.message)
} }
...@@ -258,25 +265,26 @@ export default { ...@@ -258,25 +265,26 @@ export default {
confirm_status: 'APPROVED', confirm_status: 'APPROVED',
searchInput: vm.searchInput, 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 = [] let returnData = []
if (res.result === 'S') { if (res.result === 'S') {
returnData = res.lists returnData = res.lists
if (returnData.length === 0) { if (returnData.length === 0) {
vm.$refs.scrolls.update(true) vm.$refs.scroll.update(true)
} else if (returnData.length > 0 && returnData.length < 10) { } else if (returnData.length > 0 && returnData.length < 10) {
returnData.forEach((data, index, array) => { returnData.forEach((data, index, array) => {
vm.approvedLists.push(array[index]) vm.approvedLists.push(array[index])
}) })
vm.$refs.scrolls.update(true) vm.$refs.scroll.update(true)
} else if (returnData.length === 10) { } else if (returnData.length === 10) {
returnData.forEach((data, index, array) => { returnData.forEach((data, index, array) => {
vm.approvedLists.push(array[index]) vm.approvedLists.push(array[index])
}) })
vm.$refs.scrolls.update(false) vm.$refs.scroll.update(false)
} }
vm.showLists = vm.approvedLists
} else { } else {
hlsPopup.showLongCenter(res.message) hlsPopup.showLongCenter(res.message)
} }
...@@ -294,11 +302,15 @@ export default { ...@@ -294,11 +302,15 @@ export default {
confirm_status: 'SUBMIT', confirm_status: 'SUBMIT',
searchInput: vm.searchInput, searchInput: vm.searchInput,
} }
vm.hlsPopup.showLoading('数据加载中') vm.hlsPopup.showLoading('请稍后')
let res = await vm.$post(url, param) let res = await vm.$post(url, param)
if (res.result === 'S') { if (res.result === 'S') {
vm.hlsPopup.hideLoading() vm.hlsPopup.hideLoading()
vm.submitLists = res.lists vm.submitLists = res.lists
if (vm.num === 1) {
vm.showLists = vm.submitLists
}
// vm.showLists = vm.submitLists
if (res.lists.length >= 0 && res.lists.length < 10) { 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) { } else if (res.lists.length === 10) {
...@@ -325,10 +337,14 @@ export default { ...@@ -325,10 +337,14 @@ export default {
vm.hlsHttp.post(url, param).then(function (res) { vm.hlsHttp.post(url, param).then(function (res) {
vm.hlsPopup.hideLoading() vm.hlsPopup.hideLoading()
vm.approvedLists = res.lists vm.approvedLists = res.lists
if (vm.num === 2) {
vm.showLists = vm.approvedLists
}
// vm.showLists = vm.approvedLists
if (res.lists.length >= 0 && res.lists.length < 10) { if (res.lists.length >= 0 && res.lists.length < 10) {
vm.$refs.scrolls.update(true) vm.$refs.scroll.update(true)
} else if (res.lists.length === 10) { } else if (res.lists.length === 10) {
vm.$refs.scrolls.update(false) vm.$refs.scroll.update(false)
} }
}) })
}, },
......
...@@ -136,6 +136,7 @@ export default { ...@@ -136,6 +136,7 @@ export default {
}, },
getTabNum (i) { getTabNum (i) {
this.tabNum = i this.tabNum = i
this.$refs.scroll.scrollToTop()
}, },
goAdd () { goAdd () {
hlsPopup.showLongCenter('暂不支持无关联进件的车辆发送') hlsPopup.showLongCenter('暂不支持无关联进件的车辆发送')
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<h-view id="distribute-sign" title="经销商签约"> <h-view id="distribute-sign" title="经销商签约">
<h-header :proportion="[5,1,1]" class="bar-custom"> <h-header :proportion="[5,1,1]" class="bar-custom">
<div slot="left" class="h-header-btn"> <div slot="left" class="h-header-btn">
<img src="@/assets/userBind/arrow.png" @click="goBack"> <img src="@/assets/userBind/arrow.png" @click="$routeGo()">
<span>经销商签约</span> <span>经销商签约</span>
</div> </div>
</h-header> </h-header>
...@@ -21,21 +21,20 @@ ...@@ -21,21 +21,20 @@
<input v-model="searchInput" type="text" placeholder="请输入合同号/承租人名称"> <input v-model="searchInput" type="text" placeholder="请输入合同号/承租人名称">
</div> </div>
<scroll <scroll
v-show="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>
<span>合同号</span> <span>合同号</span>
<span>{{ item.project_number }}</span> <span>{{ item.project_number }}</span>
</p> </p>
<img src="@/assets/constractSigning/righticon.png" alt="" class="arrow"> <img src="@/assets/distributorSign/goDetails.png" alt="" class="arrow">
</div> </div>
<div class="box"> <div class="box">
<div><p>承租人</p><p>{{ item.bp_name }}</p></div> <div><p>承租人</p><p>{{ item.bp_name }}</p></div>
...@@ -45,9 +44,9 @@ ...@@ -45,9 +44,9 @@
</div> </div>
</div> </div>
</scroll> </scroll>
<scroll <!-- <scroll
v-show="num === 2" v-show="num === 2"
ref="scrolls" ref="scroll"
:updateData="[approvedLists]" :updateData="[approvedLists]"
:pullUp="true" :pullUp="true"
@pullingUp="loadMore" @pullingUp="loadMore"
...@@ -60,7 +59,7 @@ ...@@ -60,7 +59,7 @@
<span>合同号</span> <span>合同号</span>
<span>{{ item.project_number }}</span> <span>{{ item.project_number }}</span>
</p> </p>
<img src="@/assets/constractSigning/righticon.png" alt="" class="arrow"> <img src="@/assets/distributorSign/goDetails.png" alt="" class="arrow">
</div> </div>
<div class="box"> <div class="box">
<div><p>承租人</p><p>{{ item.bp_name }}</p></div> <div><p>承租人</p><p>{{ item.bp_name }}</p></div>
...@@ -69,7 +68,7 @@ ...@@ -69,7 +68,7 @@
</div> </div>
</div> </div>
</div> </div>
</scroll> </scroll> -->
</h-view> </h-view>
</template> </template>
...@@ -91,29 +90,30 @@ export default { ...@@ -91,29 +90,30 @@ export default {
uncheck1: unCheck1, uncheck1: unCheck1,
uncheck2: unCheck2, uncheck2: unCheck2,
lists: [], lists: [],
showLists: [],
submitLists: [], // 待签约列表 submitLists: [], // 待签约列表
approvedLists: [], // 已签约列表 approvedLists: [], // 已签约列表
approvedFlag: false, approvedFlag: false,
} }
}, },
watch: { watch: {
// 'num': { 'num': {
// handler (newVal, oldVal) { handler (newVal, oldVal) {
// if (newVal === 2) { this.$refs.scroll.update(false)
// if (!this.approvedFlag) { if (newVal === 2) {
// this.getLists()
// }
// }
// },
// immediate: true,
// },
num () {
if (this.num === 2) {
if (!this.approvedFlag) { if (!this.approvedFlag) {
this.getLists() this.getLists()
} }
this.$refs.scroll.scrollToTop()
this.showLists = this.approvedLists
} else if (newVal === 1) {
this.showLists = this.submitLists
this.$refs.scroll.scrollToTop()
// this.$refs.scroll.update(false)
} }
}, },
immediate: true,
},
searchInput () { searchInput () {
let vm = this let vm = this
if (vm.timeout) { if (vm.timeout) {
...@@ -168,7 +168,7 @@ export default { ...@@ -168,7 +168,7 @@ export default {
if (res.result === 'S') { if (res.result === 'S') {
console.log(res.lists) console.log(res.lists)
vm.submitLists = res.lists vm.submitLists = res.lists
// vm.showLists = vm.submitLists vm.showLists = vm.submitLists
if (res.lists.length > 0 && res.lists.length < 10) { 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) { } else if (res.lists.length === 10) {
...@@ -194,10 +194,11 @@ export default { ...@@ -194,10 +194,11 @@ export default {
console.log(res.lists) console.log(res.lists)
vm.approvedLists = res.lists vm.approvedLists = res.lists
vm.approvedFlag = true vm.approvedFlag = true
vm.showLists = vm.approvedLists
if (res.lists.length > 0 && res.lists.length < 10) { if (res.lists.length > 0 && res.lists.length < 10) {
vm.$refs.scrolls.update(true) vm.$refs.scroll.update(true)
} else if (res.lists.length === 10) { } else if (res.lists.length === 10) {
vm.$refs.scrolls.update(false) vm.$refs.scroll.update(false)
} }
} else { } else {
hlsPopup.showLongCenter(res.message) hlsPopup.showLongCenter(res.message)
...@@ -206,7 +207,6 @@ export default { ...@@ -206,7 +207,6 @@ export default {
} }
}, },
loadMore () { loadMore () {
console.log('lodeMore')
let vm = this let vm = this
if (vm.num === 1) { if (vm.num === 1) {
vm.submitPagenum++ vm.submitPagenum++
...@@ -237,6 +237,7 @@ export default { ...@@ -237,6 +237,7 @@ export default {
}) })
vm.$refs.scroll.update(false) vm.$refs.scroll.update(false)
} }
vm.showLists = vm.submitLists
} else { } else {
hlsPopup.showLongCenter(res.message) hlsPopup.showLongCenter(res.message)
} }
...@@ -258,25 +259,26 @@ export default { ...@@ -258,25 +259,26 @@ export default {
if (res.result === 'S') { if (res.result === 'S') {
returnData = res.lists returnData = res.lists
if (returnData.length === 0) { if (returnData.length === 0) {
vm.$refs.scrolls.update(true) vm.$refs.scroll.update(true)
} else if (returnData.length > 0 && returnData.length < 10) { } else if (returnData.length > 0 && returnData.length < 10) {
returnData.forEach((data, index, array) => { returnData.forEach((data, index, array) => {
vm.approvedLists.push(array[index]) vm.approvedLists.push(array[index])
}) })
vm.$refs.scrolls.update(true) vm.$refs.scroll.update(true)
} else if (returnData.length === 10) { } else if (returnData.length === 10) {
returnData.forEach((data, index, array) => { returnData.forEach((data, index, array) => {
vm.approvedLists.push(array[index]) vm.approvedLists.push(array[index])
}) })
vm.$refs.scrolls.update(false) vm.$refs.scroll.update(false)
} }
vm.showLists = vm.approvedLists
} else { } else {
hlsPopup.showLongCenter(res.message) hlsPopup.showLongCenter(res.message)
} }
}) })
} }
}, },
async submitSearch () { submitSearch () {
let vm = this let vm = this
vm.submitPagenum = 1 vm.submitPagenum = 1
let url = $config.basePath + 'prj_confirm_list_query' let url = $config.basePath + 'prj_confirm_list_query'
...@@ -288,20 +290,16 @@ export default { ...@@ -288,20 +290,16 @@ export default {
searchInput: vm.searchInput, searchInput: vm.searchInput,
} }
vm.hlsPopup.showLoading('请稍后') vm.hlsPopup.showLoading('请稍后')
let res = await vm.$post(url, param) vm.hlsHttp.post(url, param).then(function (res) {
if (res.result === 'S') {
vm.hlsPopup.hideLoading() vm.hlsPopup.hideLoading()
vm.submitLists = res.lists vm.submitLists = res.lists
vm.showLists = vm.submitLists
if (res.lists.length >= 0 && res.lists.length < 10) { 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) { } else if (res.lists.length === 10) {
vm.$refs.scroll.update(false) vm.$refs.scroll.update(false)
} }
return true })
} else {
hlsPopup.showLongCenter(res.message)
return false
}
}, },
approvedearch () { approvedearch () {
let vm = this let vm = this
...@@ -319,18 +317,17 @@ export default { ...@@ -319,18 +317,17 @@ export default {
// vm.hlsPopup.hideLoading() // vm.hlsPopup.hideLoading()
// console.log(res.lists) // console.log(res.lists)
vm.approvedLists = res.lists vm.approvedLists = res.lists
vm.showLists = vm.approvedLists
if (res.lists.length >= 0 && res.lists.length < 10) { if (res.lists.length >= 0 && res.lists.length < 10) {
vm.$refs.scrolls.update(true) vm.$refs.scroll.update(true)
} else if (res.lists.length === 10) { } else if (res.lists.length === 10) {
vm.$refs.scrolls.update(false) vm.$refs.scroll.update(false)
} }
}) })
}, },
async search () { search () {
let res = await this.submitSearch() this.submitSearch()
if (res) { setTimeout(this.approvedearch, 1000)
this.approvedearch()
}
}, },
goDetails (item) { goDetails (item) {
this.$router.push({ this.$router.push({
...@@ -343,12 +340,6 @@ export default { ...@@ -343,12 +340,6 @@ export default {
dateConverse (date) { dateConverse (date) {
return date.replace(/\//g, '-') return date.replace(/\//g, '-')
}, },
// 返回个人中心
goBack () {
this.$router.push({
name: 'MyInfo',
})
},
}, },
} }
</script> </script>
...@@ -415,7 +406,7 @@ export default { ...@@ -415,7 +406,7 @@ export default {
font-family: PingFangSC-Regular; font-family: PingFangSC-Regular;
font-size: 14px; font-size: 14px;
color: #888C8F; color: #888C8F;
// line-height: 36px; line-height: 36px;
background: url("../../assets/contractStart/search1.png") 320px no-repeat; background: url("../../assets/contractStart/search1.png") 320px no-repeat;
background-size: 16px 16px; background-size: 16px 16px;
background-color: rgba(239, 239, 239, 0.55); background-color: rgba(239, 239, 239, 0.55);
......
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