count.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. <template>
  2. <view class="count">
  3. <!-- 自定义头部 -->
  4. <view class="pfixed">
  5. <uni-nav-bar left-icon="left" fixed="true" :border='border' statusBar='true' :rightText="checkPermi(['system:wczs:list','system:djks:list'])?'上报记录':''" title="潜山市招商情况月统计表" rightWidth='180rpx' @clickRight="clickRight" @clickLeft='getBack'/>
  6. </view>
  7. <!-- 站位的 -->
  8. <uni-nav-bar left-icon="left" :border='border' statusBar='true' />
  9. <!-- 搜索 -->
  10. <view class="zhanline"></view>
  11. <view class="flexc allpage_zd">
  12. <!-- <view class="allpage_zdl">共计<text>{{total||0}}</text>个</view> -->
  13. <time-year @bindDateChange="bindDateChange" fields='month' textAlign='right' timetxt='选择日期'></time-year>
  14. </view>
  15. <!-- 表格 -->
  16. <view class="tablebox">
  17. <table border='0' class='table'>
  18. <thead class='thead'>
  19. <tr class="tr_one">
  20. <th style="width: 140rpx;" rowspan='2'>汇报单位</th>
  21. <th style="width: 200rpx;" colspan='2' class='borbot'>招商外出次数/天数</th>
  22. <th style="width: 190rpx;" colspan='2' class='borbot'>对接客商次数</th>
  23. <th style="width: 220rpx;" colspan='2' class='borbot borbotn'>提供有效招商线索数</th>
  24. </tr>
  25. <tr class="tr_one">
  26. <th style="width: 100rpx;" class='borbotn'>当月外出数</th>
  27. <th style="width: 100rpx;">本年累计数</th>
  28. <th style="width: 95rpx;" class='borbotn'>当月对接数</th>
  29. <th style="width: 95rpx;">本年累计数</th>
  30. <th style="width: 110rpx;" class='borbotn'>当月线索数</th>
  31. <th style="width: 110rpx;" class='borbotn'>本年累计数</th>
  32. </tr>
  33. </thead>
  34. <tbody class="tbody">
  35. <tr v-for="(item,index) in list" :key="index">
  36. <td style="width: 140rpx;" >{{item.name}}</td>
  37. <td style="width: 100rpx;">{{item.zswcMonth}}</td>
  38. <td style="width: 100rpx;" >{{item.zswcYear}}</td>
  39. <td style="width: 95rpx;" >{{item.sjksMonth}}</td>
  40. <td style="width: 95rpx;" >{{item.sjksYear}}</td>
  41. <td style="width: 110rpx;" >{{item.yxxsMonth}}</td>
  42. <td style="width: 110rpx;" >{{item.yxxsYear}}</td>
  43. </tr>
  44. <div class="shax" v-if="list.length>0">
  45. {{wtdt}}
  46. </div>
  47. <div class="shax" v-else><span>暂无数据</span></div>
  48. </tbody>
  49. </table>
  50. </view>
  51. <view class="count_btn" @click="getAddCount" v-if="checkPermi(['system:wczs:add','system:djks:add'])">
  52. <image :src="addimg"></image>
  53. 新增
  54. </view>
  55. <!--新增选择 -->
  56. <!-- 弹窗 -->
  57. <view class="bgbox" @click="getClose" v-if="moreflag"></view>
  58. <view class="more_fixed" v-if="moreflag">
  59. <view class="more_fixedt">
  60. <!-- -->
  61. <view v-if="checkPermi(['system:wczs:add'])" @click="getzsaddFn">外出招商</view>
  62. <view v-if="checkPermi(['system:djks:add'])" @click="getksaddFn">对接客商</view>
  63. </view>
  64. <view class="more_fixedb" @click="getClose">取消</view>
  65. </view>
  66. </view>
  67. </template>
  68. <script>
  69. import timeYear from "@/components/timedata/timeyear.vue"
  70. import {getstatMonthFn} from "@/api/work/count.js"
  71. import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
  72. import tabSearchone from "@/components/toptab/searchone.vue"
  73. export default{
  74. components:{
  75. timeYear,tabSearchone
  76. },
  77. data(){
  78. return{
  79. addimg:require("@/static/images/index/addt.png"),
  80. border:false,
  81. time:'',
  82. year:'',
  83. month:'',
  84. pageSize: 10,
  85. pageNum: 1,
  86. reachflag:true,
  87. wtdt:'',
  88. list:[],
  89. total:0,
  90. moreflag:false,
  91. }
  92. },
  93. onReachBottom() {
  94. if (this.reachflag) {
  95. this.pageNum++
  96. this.getDataFn()
  97. }
  98. },
  99. onUnload(){
  100. uni.$off('refreshdata')
  101. uni.$off('refreshdatatong')
  102. },
  103. onLoad() {
  104. uni.$on('refreshdatatong',(e) => {
  105. this.reachflag=true;
  106. this.pageNum=1;
  107. this.list=[];
  108. this.getDataFn();
  109. })
  110. this.time = this.getNowFormatDate();
  111. this.getDataFn()
  112. },
  113. methods:{
  114. checkPermi, checkRole,
  115. bindDateChange(e){
  116. this.time=e;
  117. var timestr=e.split('-');
  118. this.year=timestr[0];
  119. this.month=timestr[1];
  120. this.reachflag=true;
  121. this.pageNum=1;
  122. this.list=[];
  123. this.getDataFn();
  124. },
  125. getNowFormatDate(){
  126. let date = new Date();
  127. let y = date.getFullYear();
  128. let m = date.getMonth() + 1;
  129. m = m < 10 ? "0" + m : m;
  130. let d = date.getDate();
  131. d = d < 10 ? "0" + d : d;
  132. const timeday = y + "-" + m;
  133. this.year=y;
  134. this.month=m;
  135. return timeday;
  136. },
  137. getDataFn(){
  138. var params={
  139. pageSize:this.pageSize,
  140. pageNum: this.pageNum,
  141. year:this.year,
  142. month:this.month,
  143. }
  144. getstatMonthFn(params).then(res=>{
  145. if(res.code==200){
  146. this.total=res.total;
  147. if (res.data.length < this.pageSize) {
  148. this.reachflag = false
  149. this.wtdt = '到底了~';
  150. } else {
  151. var num = parseInt(res.data.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
  152. if (num < res.total) {
  153. this.reachflag = true
  154. this.wtdt = '上拉加载更多'
  155. } else {
  156. this.reachflag = false
  157. this.wtdt = '到底了~';
  158. }
  159. }
  160. if (this.pageNum == 1) {
  161. this.list = res.data;
  162. } else {
  163. this.list = this.list.concat(res.data)
  164. }
  165. }else{
  166. this.$toast(res.msg)
  167. }
  168. })
  169. },
  170. getzsaddFn(){
  171. this.moreflag=false;
  172. this.$tab.navigateTo('/pages/work/count/addzscount')
  173. },
  174. getksaddFn(){
  175. this.moreflag=false;
  176. this.$tab.navigateTo('/pages/work/count/addkscount')
  177. },
  178. getClose(){
  179. this.moreflag=false;
  180. },
  181. getAddCount(){
  182. this.moreflag=true
  183. },
  184. getBack(){
  185. uni.navigateBack({
  186. delta:1
  187. })
  188. },
  189. clickRight(){
  190. if(checkPermi(['system:wczs:list','system:djks:list'])){
  191. this.$tab.navigateTo("/pages/work/count/cluelist?strfrom=tong")
  192. }else{
  193. return
  194. }
  195. },
  196. }
  197. }
  198. </script>
  199. <style lang="scss" scoped>
  200. .count{display: flex;flex-direction: column;height: 100vh;overflow: hidden;}
  201. .count /deep/ .uni-nav-bar-right-text{font-size: 34rpx; color: #26C240 !important;font-weight: 500;padding-right: 14rpx;}
  202. //统计
  203. .allpage_zd{background-color:#ffffff;padding: 0 28rpx;justify-content: space-between;flex: 0 0 auto;
  204. .allpage_zdl{font-size: 30rpx;font-weight: 500;
  205. color: #666666;
  206. text{font-weight: bold;color: #FE5706;margin: 0 8rpx;}
  207. }
  208. }
  209. // 表格
  210. .borbot{border-bottom: 2rpx solid #CDCDCD;}
  211. .borbotn{border-right: none !important;}
  212. .tablebox{padding:10rpx 0 0;flex: 1;display: flex;flex-direction: column;overflow: hidden;
  213. th{padding: 8rpx;box-sizing: border-box;font-size: 26rpx;color: #343434;font-weight: bold;text-align: center;}
  214. }
  215. .table{border-spacing: 0;width: 100%;display: flex;flex-direction: column;overflow: hidden;}
  216. .thead{width: 100%;background-color: #F1F1F1;flex: 0 0 auto;border-radius: 10rpx;
  217. th{border-right: 2rpx solid #CDCDCD;}
  218. }
  219. .tbody {flex: 1;overflow: auto;padding-bottom: 120rpx;}
  220. .tbody td{height: 120rpx;box-sizing: border-box;padding: 24rpx 14rpx;font-weight: 500;color: #343434;font-size: 28rpx;border-bottom: 2rpx solid #CDCDCD;text-align: center;word-break: break-all;}
  221. .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;
  222. background: #FE5706;display: flex;align-items: center;justify-content: center;
  223. image{width: 34rpx;height: 34rpx;margin-right: 16rpx;}
  224. }
  225. </style>