Commit f0ccf9bd authored by 786817560's avatar 786817560

'拉代码'

parent 372859e3
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Descrip 融资试算 * @Descrip 融资试算
* @Author: your name * @Author: your name
* @Date: 2019-09-29 17:09:49 * @Date: 2019-09-29 17:09:49
* @LastEditTime: 2019-11-21 17:27:36 * @LastEditTime: 2019-11-22 09:15:25
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
--> -->
<template> <template>
...@@ -78,11 +78,11 @@ export default { ...@@ -78,11 +78,11 @@ export default {
clearTimeout(vm.timeout) clearTimeout(vm.timeout)
} }
vm.timeout = setTimeout(() => { vm.timeout = setTimeout(() => {
// if (vm.fromProduct) { if (vm.fromProduct) {
// vm.search(vm.fromProduct) vm.search(vm.fromProduct)
// } else { } else {
// vm.search() vm.search()
// } }
}, 1000) }, 1000)
}, },
}, },
...@@ -122,7 +122,7 @@ export default { ...@@ -122,7 +122,7 @@ export default {
}, },
}) })
}, },
// 试算查询 // 初始试算查询
calculationQuery (val) { calculationQuery (val) {
let vm = this let vm = this
if (val) { if (val) {
...@@ -165,6 +165,39 @@ export default { ...@@ -165,6 +165,39 @@ export default {
loadMore () { loadMore () {
let vm = this let vm = this
if (vm.fromProduct) {
vm.pagenum = vm.pagenum + 1
let url = $config.basePath + 'prd_product_calculation_query'
let param = {
division: window.sessionStorage.division, // 收藏到试算通过产品线查询
searchInput: vm.searchInput,
pagenum: vm.pagenum,
pagesize: 10,
}
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((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)
}
} else {
hlsPopup.showLongCenter(res.message)
}
})
} else {
vm.pagenum = vm.pagenum + 1 vm.pagenum = vm.pagenum + 1
let url = $config.basePath + 'prd_calculation_query' let url = $config.basePath + 'prd_calculation_query'
let param = { let param = {
...@@ -195,15 +228,19 @@ export default { ...@@ -195,15 +228,19 @@ export default {
hlsPopup.showLongCenter(res.message) hlsPopup.showLongCenter(res.message)
} }
}) })
}
}, },
search () {
search (val) {
let vm = this let vm = this
if (val) {
vm.pagenum = 1 vm.pagenum = 1
let url = $config.basePath + 'prd_product_calculation_query' let url = $config.basePath + 'prd_product_calculation_query'
let param = { let param = {
pagesize: 10, pagesize: 10,
pagenum: 1, pagenum: 1,
searchInput: vm.searchInput, searchInput: vm.searchInput,
division: window.sessionStorage.division, // 收藏到试算通过产品线查询
} }
vm.hlsPopup.showLoading('数据加载中') vm.hlsPopup.showLoading('数据加载中')
vm.hlsHttp.post(url, param).then(function (res) { vm.hlsHttp.post(url, param).then(function (res) {
...@@ -215,7 +252,27 @@ export default { ...@@ -215,7 +252,27 @@ export default {
vm.$refs.scroll.update(false) vm.$refs.scroll.update(false)
} }
}) })
} else {
vm.pagenum = 1
let url = $config.basePath + 'prd_calculation_query'
let param = {
pagesize: 10,
pagenum: 1,
searchInput: vm.searchInput,
}
vm.hlsPopup.showLoading('数据加载中')
vm.hlsHttp.post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
vm.lists = res.lists
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)
}
})
}
}, },
}, },
} }
</script> </script>
......
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