historyReport.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405
  1. <template>
  2. <view class="content">
  3. <view class="topView">
  4. <!-- 切换tab -->
  5. <view class="tabBox">
  6. <scroll-view scroll-x="true" class="scroll">
  7. <view class="tabCotn">
  8. <view class="tabLine" :class="{tabactive:tabIndex==0}" @click="tabClick(0)">全部</view>
  9. <view class="tabLine" :class="{tabactive:tabIndex==1}" @click="tabClick(1)">待提交</view>
  10. <view class="tabLine" :class="{tabactive:tabIndex==2}" @click="tabClick(2)">待作业</view>
  11. <view class="tabLine" :class="{tabactive:tabIndex==3}" @click="tabClick(3)">待评价</view>
  12. <view class="tabLine" :class="{tabactive:tabIndex==4}" @click="tabClick(4)">待回复</view>
  13. </view>
  14. </scroll-view>
  15. </view>
  16. <!-- 搜索 -->
  17. <view class="searchBox">
  18. <image src="../../static/img/icon_search.png" class="searchImg"></image>
  19. <input type="text" class="searchInput" placeholder="请输入门店名称、联系人、手机号" v-model="searchValue"
  20. @confirm="searchDone" />
  21. </view>
  22. <!-- 条件筛选 -->
  23. <view class="siftBg">
  24. <!-- 日期选择 -->
  25. <view class="timeChose">
  26. <view @click="timeClick">{{dateTime == null ? '日期筛选' : dateTime}}</view>
  27. <image class="downArrow" src="../../static/img/icon_downArrow.png"></image>
  28. </view>
  29. <picker :value="thirdIndex" mode="selector" :range="thirdArr"
  30. @change="bindPickerChange3">
  31. <view class="uni-input">{{thirdIndex == null ? '访问人' : thirdArr[thirdIndex]}}
  32. <image class="downArrow" src="../../static/img/icon_downArrow.png"></image>
  33. </view>
  34. </picker>
  35. </view>
  36. </view>
  37. <!-- 列表 -->
  38. <view class="shopList">
  39. <view v-for="(item,index) in shopData" :key="index">
  40. <!-- shopBox -->
  41. <view class="shopBox" @click="goAppraise(item)">
  42. <view class=" shopTop">
  43. <view class="shopName">{{item.ShopName}}</view>
  44. <!-- 订单状态 1 待提交 草稿 2 已提交 待作业 3 已作业 待点评 4 已评价 待回复,5 已回复 已完成 -->
  45. <view class="type" v-if="item.State == 1">待提交</view>
  46. <view class="type" v-if="item.State == 2">已提交</view>
  47. <view class="type" v-if="item.State == 3">已作业</view>
  48. <view class="type" v-if="item.State == 4">已评价</view>
  49. <view class="type" v-if="item.State == 5">已回复</view>
  50. </view>
  51. <!-- 第2行 -->
  52. <view class="bottomView">
  53. <!-- 运营经理 -->
  54. <view class="manager">{{item.ManagerName}} · {{item.CheckTime}}</view>
  55. <!-- 评分 -->
  56. <view class="score" v-if="item.ShopScore">{{item.ShopScore}}分</view>
  57. </view>
  58. </view>
  59. </view>
  60. </view>
  61. <!-- 上拉 加载更多 -->
  62. <view class="noMore" v-if="noMoreShow">没有更多数据</view>
  63. <!-- 无数据空白页 -->
  64. <view class="nodataBox" v-if="shopData.length == 0">
  65. <image src="../../static/img/pic_empty_def.png" mode="widthFix" class="nodataImg"></image>
  66. <view class="noTxt">暂无数据</view>
  67. </view>
  68. <timeChose ref="timepop" @returnDate="returnDate" :isShow="timeShow"></timeChose>
  69. </view>
  70. </template>
  71. <script>
  72. import timeChose from '@/components/timeChose/timeChose.vue'
  73. export default {
  74. components: {
  75. timeChose
  76. },
  77. data() {
  78. return {
  79. tabIndex: 0,
  80. status: '', //订单状态 1 待提交 草稿 2 已提交 待作业 3 已作业 待点评 4 已评价 待回复,5 已回复 已完成
  81. searchValue: '',
  82. thirdIndex: null,
  83. thirdArr: ['请选择'],
  84. managerId: '',
  85. shopData: [],
  86. page: 1,
  87. noMoreShow: false,
  88. timeShow: false,
  89. starTime: '',
  90. endTime: '',
  91. dateTime: null,
  92. shopId:'',
  93. }
  94. },
  95. onShow() {
  96. this.page = 1
  97. this.getShopData()
  98. },
  99. onLoad(opt) {
  100. this.shopId = opt.shopId
  101. this.getVisitor()
  102. this.page = 1
  103. this.getShopData()
  104. },
  105. methods: {
  106. timeClick() {
  107. this.$refs.timepop.father();
  108. },
  109. returnDate(e) {
  110. console.log(e)
  111. this.starTime = e.startTime
  112. this.endTime = e.endTime
  113. if (e.startTime) {
  114. this.dateTime = e.startTime + '-' + e.endTime
  115. } else {
  116. this.dateTime = null
  117. }
  118. this.page = 1;
  119. this.getShopData()
  120. },
  121. tabClick(num) {
  122. this.tabIndex = num;
  123. if (num == 0) {
  124. this.status = ''
  125. } else {
  126. this.status = num;
  127. }
  128. this.page = 1;
  129. this.getShopData()
  130. },
  131. searchDone(e) {
  132. this.searchValue = e.target.value
  133. this.page = 1
  134. this.getShopData()
  135. },
  136. bindPickerChange3(e) {
  137. this.thirdIndex = e.target.value
  138. this.managerId = this.thirdArr[this.thirdIndex].ID
  139. if(e.target.value == 0){
  140. this.thirdIndex = null
  141. }
  142. this.page = 1
  143. this.getShopData()
  144. },
  145. getVisitor() {
  146. uni.showLoading({
  147. title: '加载中'
  148. })
  149. let url = 'accompany/SuperCheckSheet/myShopCheckManagerPage',
  150. params = {
  151. }
  152. this.$http(url, params, 'GET').then(res => {
  153. this.thirdArr = this.thirdArr.concat(res.data)
  154. })
  155. },
  156. getShopData() {
  157. uni.showLoading({
  158. title: '加载中'
  159. })
  160. let url = 'accompany/SuperAccounts/listShopInfoCheckPage',
  161. params = {
  162. page: this.page,
  163. limit: 20,
  164. managerID: this.managerId,
  165. shopName: this.searchValue,
  166. starTime: this.starTime,
  167. endTime: this.endTime,
  168. state: this.status,
  169. shopID:this.shopId,
  170. }
  171. this.$http(url, params, 'GET').then(res => {
  172. var list = res.data.Items
  173. // 处理 undefined和null转为空白字符串
  174. list.forEach((item, index) => {
  175. for (const key in item) {
  176. item[key] = this.$praseStrEmpty(item[key])
  177. }
  178. })
  179. if (this.page == 1 && list.length == 0) {
  180. this.noMoreShow = false
  181. } else if (list.length < 20) {
  182. this.noMoreShow = true
  183. }
  184. if (this.page == 1) {
  185. this.shopData = list
  186. } else {
  187. this.shopData = this.shopData.concat(list)
  188. }
  189. })
  190. },
  191. goAppraise(v) {
  192. }
  193. },
  194. // 下拉刷新 上拉加载更多
  195. onPullDownRefresh() {
  196. this.page = 1
  197. this.getShopData()
  198. setTimeout(function() {
  199. uni.stopPullDownRefresh();
  200. }, 1000);
  201. },
  202. onReachBottom() {
  203. this.page++;
  204. this.getShopData()
  205. },
  206. }
  207. </script>
  208. <style>
  209. .content {
  210. background-color: #F4F5F7;
  211. min-height: 100vh;
  212. }
  213. .topView {
  214. width: 100%;
  215. height: 290rpx;
  216. background-color: #FFFFFF;
  217. left: 0rpx;
  218. top: 0rpx;
  219. position: fixed;
  220. z-index: 99;
  221. }
  222. /* #ifdef H5 */
  223. .topView {
  224. top: 44px;
  225. }
  226. /* #endif */
  227. .searchBox {
  228. height: 72rpx;
  229. margin: 24rpx;
  230. background-color: #F4F5F7;
  231. border-radius: 36rpx;
  232. display: flex;
  233. }
  234. .searchImg {
  235. margin-top: 20rpx;
  236. margin-left: 20rpx;
  237. width: 32rpx;
  238. height: 32rpx;
  239. }
  240. .searchInput {
  241. height: 72rpx;
  242. font-size: 28rpx;
  243. padding-left: 16rpx;
  244. width: 85%;
  245. }
  246. .siftBg {
  247. display: flex;
  248. justify-content: space-around;
  249. height: 80rpx;
  250. align-items: center;
  251. }
  252. .timeChose {
  253. display: flex;
  254. justify-content: space-between;
  255. align-items: center;
  256. }
  257. .downArrow {
  258. width: 16rpx;
  259. height: 12rpx;
  260. padding: 6rpx 8rpx;
  261. }
  262. .tabBox {
  263. width: 100%;
  264. }
  265. .tabCotn {
  266. display: flex;
  267. }
  268. .tabLine {
  269. width: 150rpx;
  270. text-align: center;
  271. color: #3C3C3C;
  272. font-size: 30rpx;
  273. line-height: 88rpx;
  274. }
  275. .tabactive {
  276. color: #FF4F00;
  277. border-bottom: 4rpx solid #FF4F00;
  278. }
  279. .shopList {
  280. background-color: #F4F5F7;
  281. padding: 0rpx 24rpx;
  282. padding-top: 290rpx;
  283. }
  284. .shopBox {
  285. background-color: #FFFFFF;
  286. border-radius: 10rpx;
  287. margin: 20rpx 0rpx;
  288. }
  289. .shopTop {
  290. display: flex;
  291. padding: 30rpx 20rpx 10rpx 20rpx;
  292. justify-content: space-between;
  293. }
  294. .shopName {
  295. font-size: 28rpx;
  296. color: #3C3C3C;
  297. font-weight: bold;
  298. width: 500rpx;
  299. }
  300. .type {
  301. font-size: 28rpx;
  302. color: #FF4F00;
  303. margin-left: 10rpx;
  304. }
  305. .bottomView {
  306. padding: 28rpx 20rpx;
  307. display: flex;
  308. justify-content: space-between;
  309. }
  310. .manager {
  311. font-size: 24rpx;
  312. color: #666666;
  313. }
  314. .score {
  315. font-size: 28rpx;
  316. color: #B98B5D;
  317. }
  318. /* 空白页css */
  319. .nodataBox {
  320. text-align: center;
  321. }
  322. .nodataImg {
  323. width: 400rpx;
  324. padding-top: 290rpx;
  325. }
  326. .noTxt {
  327. font-size: 30rpx;
  328. color: #999999;
  329. padding-top: 50rpx;
  330. }
  331. .noMore {
  332. text-align: center;
  333. line-height: 50rpx;
  334. color: #999999;
  335. font-size: 28rpx;
  336. }
  337. </style>