cluelist.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. <template>
  2. <view class="allpage">
  3. <view class="listtop pfixed">
  4. <tab-searchone @getSearch='getSearch' placeholder='单位'></tab-searchone>
  5. <tab-list :tablist='tablist' :tabidx="tabidx" @getCheck="goCheck" ></tab-list>
  6. <view class="flexc allpage_zd">
  7. <time-year :fields="fields" @bindDateChange="bindDateChange" textAlign='right' timetxt='选择日期'></time-year>
  8. </view>
  9. </view>
  10. <view class="alllist">
  11. <!-- l列表 -->
  12. <project-list :datalist="list" v-if="tabidx==0" :wtdt="wtdt" type='tongjizs' @getDetail='goDetail'></project-list>
  13. <project-list :datalist="list" v-if="tabidx==1" :wtdt="wtdt" type='tongjiks' @getDetail='goDetail'></project-list>
  14. </view>
  15. <!-- <block v-if="checkPermi(['system:qktj:add'])">
  16. <view style="height: 100rpx;"></view>
  17. <view class="count_btn" @click="getAddCount" >
  18. <image :src="addimg"></image>新增</view>
  19. </block> -->
  20. </view>
  21. </template>
  22. <script>
  23. import projectList from "@/components/projectlist/list.vue"
  24. import tabList from "@/components/toptab/tab.vue"
  25. import tabSearchone from "@/components/toptab/searchone.vue"
  26. import timeYear from "@/components/timedata/timeyear.vue"
  27. import { getdjkslistFn,getwczslistFn} from '@/api/work/count.js'
  28. import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
  29. export default{
  30. data(){
  31. return{
  32. upimg:require("@/static/images/index/up.png"),
  33. addimg:require("@/static/images/index/addt.png"),
  34. tabidx:0,
  35. // projectV2:sbbzb:list
  36. //
  37. tablist:[{tit:'外出招商',val:0,limt:'system:wczs:list'},{tit:'对接客商',val:1,limt:'system:djks:list'}],
  38. list:[],
  39. fields:'month',
  40. pageSize: 10,
  41. pageNum: 1,
  42. reachflag:true,
  43. wtdt:'',
  44. time:'',
  45. beginTime:'',
  46. endTime:'',
  47. name:'',
  48. wtdt:'',
  49. deptId:this.$store.state.user.deptId,
  50. strfrom:'',
  51. }
  52. },
  53. components:{
  54. projectList,tabList,tabSearchone,timeYear
  55. },
  56. onUnload(){
  57. uni.$off('refreshdata')
  58. },
  59. onLoad(e) {
  60. uni.$on('refreshdata',(e) => {
  61. // // 修改统计列表数据
  62. uni.$emit('refreshdatatong')
  63. this.reachflag=true;
  64. this.pageNum=1;
  65. this.list=[];
  66. this.getDataFn();
  67. })
  68. this.strfrom=e.strfrom||'';
  69. this.getDataFn()
  70. },
  71. //
  72. onReachBottom() {
  73. if (this.reachflag) {
  74. this.pageNum++
  75. this.getDataFn()
  76. }
  77. },
  78. methods:{
  79. checkPermi, checkRole,
  80. getAddCount(){
  81. // this.$tab.navigateTo('/pages/work/count/addcount?strfrom=list')
  82. },
  83. bindDateChange(e){
  84. this.time=e;
  85. var timestr=e.split('-');
  86. this.year=timestr[0];
  87. this.month=timestr[1];
  88. this.reachflag=true;
  89. this.pageNum=1;
  90. this.list=[];
  91. this.getDataFn()
  92. },
  93. goCheck(data){
  94. this.tabidx=data;
  95. this.reachflag=true;
  96. this.pageNum=1;
  97. this.list=[];
  98. this.getDataFn()
  99. },
  100. goDetail(e){
  101. if(this.tabidx==0){
  102. this.$tab.navigateTo('/pages/work/count/addzscount?id='+e.id+'&strfrom=list&pagetype=update')
  103. }else{
  104. this.$tab.navigateTo('/pages/work/count/addkscount?id='+e.id+'&strfrom=list&pagetype=update')
  105. }
  106. },
  107. getDataFn(){
  108. var params={
  109. pageSize:this.pageSize,
  110. pageNum: this.pageNum,
  111. year:this.year,
  112. month:this.month,
  113. deptName:this.name
  114. }
  115. if(this.tabidx==0){//外出招商
  116. getwczslistFn(params).then(res=>{
  117. if(res.code==200){
  118. if (res.rows.length < this.pageSize) {
  119. this.reachflag = false
  120. this.wtdt = '到底了~';
  121. } else {
  122. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
  123. if (num < res.total) {
  124. this.reachflag = true
  125. this.wtdt = '上拉加载更多'
  126. } else {
  127. this.reachflag = false
  128. this.wtdt = '到底了~';
  129. }
  130. }
  131. if (this.pageNum == 1) {
  132. this.list = res.rows;
  133. } else {
  134. this.list = this.list.concat(res.rows)
  135. }
  136. }else{
  137. this.$toast(res.msg)
  138. }
  139. })
  140. }else {//对接客商
  141. getdjkslistFn(params).then(res=>{
  142. if(res.code==200){
  143. if (res.rows.length < this.pageSize) {
  144. this.reachflag = false
  145. this.wtdt = '到底了~';
  146. } else {
  147. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
  148. if (num < res.total) {
  149. this.reachflag = true
  150. this.wtdt = '上拉加载更多'
  151. } else {
  152. this.reachflag = false
  153. this.wtdt = '到底了~';
  154. }
  155. }
  156. if (this.pageNum == 1) {
  157. this.list = res.rows;
  158. } else {
  159. this.list = this.list.concat(res.rows)
  160. }
  161. }else{
  162. this.$toast(res.msg)
  163. }
  164. })
  165. }
  166. },
  167. getSearch(e){
  168. this.name=e;
  169. this.reachflag=true;
  170. this.pageNum=1;
  171. this.list=[];
  172. this.getDataFn()
  173. },
  174. }
  175. }
  176. </script>
  177. <style lang="scss" scoped>
  178. .allpage{min-height: 100vh;background: #ffffff;padding-top:280rpx;box-sizing: border-box;}
  179. .listtop{box-shadow: none !important;}
  180. .listtopa{border: 6rpx solid #FD5001;border-radius: 36rpx;height:72rpx;box-sizing: border-box;padding:0 140rpx 0 32rpx ;position: relative;
  181. input{}
  182. image{width: 30rpx;height: 30rpx;margin-right: 24rpx;}
  183. .btn{background: #FA5F03;border-radius: 36rpx;width: 140rpx;position: absolute;right: -2rpx;top: -2rpx;bottom:-2rpx;}
  184. }
  185. .listtopb{
  186. .tit{flex: 1;height: 130rpx;display: flex;flex-direction: column;justify-content: center;position: relative;
  187. view{text-align: center;}
  188. .tits{color: #666666;}
  189. .txt{color: #aaaaaa;}
  190. &.act{
  191. &::after{content: '';width: 100rpx;height: 6rpx;background:#FE5706 ;position: absolute;left: 50%;margin-left: -50rpx;bottom: 0;}
  192. .tits{color: #343434;}
  193. .txt{color: #FE5706;}
  194. }
  195. }
  196. }
  197. .alllist{padding-top:10rpx ;}
  198. //统计
  199. .allpage_zd{background-color:#F2F2F2;padding: 0 28rpx;justify-content: space-between;
  200. .allpage_zdl{font-size: 30rpx;font-weight: 500;
  201. color: #666666;
  202. text{font-weight: bold;color: #FE5706;margin: 0 8rpx;}
  203. }
  204. }
  205. .count_btn{position: fixed;left: 0;right: 0;bottom: 0;z-index: 4;width: 100%;height: 100rpx;font-size: 32rpx;color: #ffffff;font-weight: 500;
  206. background: #FE5706;display: flex;align-items: center;justify-content: center;
  207. image{width: 34rpx;height: 34rpx;margin-right: 16rpx;}
  208. }
  209. </style>