historyReport.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411
  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-key='name' :range="thirdArr"
  30. @change="bindPickerChange3" v-if="isDirector">
  31. <view class="uni-input">{{thirdIndex == null ? '访问人' : thirdArr[thirdIndex].name}}
  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. name: '请选择',
  85. ID: ''
  86. }],
  87. managerId: '',
  88. shopData: [],
  89. page: 1,
  90. noMoreShow: false,
  91. timeShow: false,
  92. starTime: '',
  93. endTime: '',
  94. dateTime: null,
  95. isDirector:'',
  96. shopId:'',
  97. }
  98. },
  99. onShow() {
  100. this.page = 1
  101. this.getShopData()
  102. },
  103. onLoad(opt) {
  104. this.isDirector = this.$common.isDirector()
  105. this.shopId = opt.shopId
  106. if(this.isDirector) {
  107. this.getManager()
  108. }
  109. this.page = 1
  110. this.getShopData()
  111. },
  112. methods: {
  113. timeClick() {
  114. this.$refs.timepop.father();
  115. },
  116. returnDate(e) {
  117. console.log(e)
  118. this.starTime = e.startTime
  119. this.endTime = e.endTime
  120. if (e.startTime) {
  121. this.dateTime = e.startTime + '-' + e.endTime
  122. } else {
  123. this.dateTime = null
  124. }
  125. this.page = 1;
  126. this.getShopData()
  127. },
  128. tabClick(num) {
  129. this.tabIndex = num;
  130. if (num == 0) {
  131. this.status = ''
  132. } else {
  133. this.status = num;
  134. }
  135. this.page = 1;
  136. this.getShopData()
  137. },
  138. searchDone(e) {
  139. this.searchValue = e.target.value
  140. this.page = 1
  141. this.getShopData()
  142. },
  143. bindPickerChange3(e) {
  144. this.thirdIndex = e.target.value
  145. this.managerId = this.thirdArr[this.thirdIndex].ID
  146. if(e.target.value == 0){
  147. this.thirdIndex = null
  148. }
  149. this.page = 1
  150. this.getShopData()
  151. },
  152. getManager() {
  153. uni.showLoading({
  154. title: '加载中'
  155. })
  156. let url = 'accompany/SuperAccounts/queryManagerListByDept',
  157. params = {
  158. name: '',
  159. }
  160. this.$http(url, params, 'GET').then(res => {
  161. this.thirdArr = this.thirdArr.concat(res.data)
  162. })
  163. },
  164. getShopData() {
  165. uni.showLoading({
  166. title: '加载中'
  167. })
  168. let url = 'accompany/SuperAccounts/listShopInfoCheckPage',
  169. params = {
  170. page: this.page,
  171. limit: 20,
  172. managerID: this.managerId,
  173. shopName: this.searchValue,
  174. starTime: this.starTime,
  175. endTime: this.endTime,
  176. state: this.status,
  177. shopID:this.shopId,
  178. }
  179. this.$http(url, params, 'GET').then(res => {
  180. var list = res.data.Items
  181. // 处理 undefined和null转为空白字符串
  182. list.forEach((item, index) => {
  183. for (const key in item) {
  184. item[key] = this.$praseStrEmpty(item[key])
  185. }
  186. })
  187. if (this.page == 1 && list.length == 0) {
  188. this.noMoreShow = false
  189. } else if (list.length < 20) {
  190. this.noMoreShow = true
  191. }
  192. if (this.page == 1) {
  193. this.shopData = list
  194. } else {
  195. this.shopData = this.shopData.concat(list)
  196. }
  197. })
  198. },
  199. goAppraise(v) {
  200. }
  201. },
  202. // 下拉刷新 上拉加载更多
  203. onPullDownRefresh() {
  204. this.page = 1
  205. this.getShopData()
  206. setTimeout(function() {
  207. uni.stopPullDownRefresh();
  208. }, 1000);
  209. },
  210. onReachBottom() {
  211. this.page++;
  212. this.getShopData()
  213. },
  214. }
  215. </script>
  216. <style>
  217. .content {
  218. background-color: #F4F5F7;
  219. min-height: 100vh;
  220. }
  221. .topView {
  222. width: 100%;
  223. height: 290rpx;
  224. background-color: #FFFFFF;
  225. left: 0rpx;
  226. top: 0rpx;
  227. position: fixed;
  228. z-index: 99;
  229. }
  230. /* #ifdef H5 */
  231. .topView {
  232. top: 44px;
  233. }
  234. /* #endif */
  235. .searchBox {
  236. height: 72rpx;
  237. margin: 24rpx;
  238. background-color: #F4F5F7;
  239. border-radius: 36rpx;
  240. display: flex;
  241. }
  242. .searchImg {
  243. margin-top: 20rpx;
  244. margin-left: 20rpx;
  245. width: 32rpx;
  246. height: 32rpx;
  247. }
  248. .searchInput {
  249. height: 72rpx;
  250. font-size: 28rpx;
  251. padding-left: 16rpx;
  252. width: 85%;
  253. }
  254. .siftBg {
  255. display: flex;
  256. justify-content: space-around;
  257. height: 80rpx;
  258. align-items: center;
  259. }
  260. .timeChose {
  261. display: flex;
  262. justify-content: space-between;
  263. align-items: center;
  264. }
  265. .downArrow {
  266. width: 16rpx;
  267. height: 12rpx;
  268. padding: 6rpx 8rpx;
  269. }
  270. .tabBox {
  271. width: 100%;
  272. }
  273. .tabCotn {
  274. display: flex;
  275. }
  276. .tabLine {
  277. width: 150rpx;
  278. text-align: center;
  279. color: #3C3C3C;
  280. font-size: 30rpx;
  281. line-height: 88rpx;
  282. }
  283. .tabactive {
  284. color: #FF4F00;
  285. border-bottom: 4rpx solid #FF4F00;
  286. }
  287. .shopList {
  288. background-color: #F4F5F7;
  289. padding: 0rpx 24rpx;
  290. padding-top: 290rpx;
  291. }
  292. .shopBox {
  293. background-color: #FFFFFF;
  294. border-radius: 10rpx;
  295. margin: 20rpx 0rpx;
  296. }
  297. .shopTop {
  298. display: flex;
  299. padding: 30rpx 20rpx 10rpx 20rpx;
  300. justify-content: space-between;
  301. }
  302. .shopName {
  303. font-size: 28rpx;
  304. color: #3C3C3C;
  305. font-weight: bold;
  306. width: 500rpx;
  307. }
  308. .type {
  309. font-size: 28rpx;
  310. color: #FF4F00;
  311. margin-left: 10rpx;
  312. }
  313. .bottomView {
  314. padding: 28rpx 20rpx;
  315. display: flex;
  316. justify-content: space-between;
  317. }
  318. .manager {
  319. font-size: 24rpx;
  320. color: #666666;
  321. }
  322. .score {
  323. font-size: 28rpx;
  324. color: #B98B5D;
  325. }
  326. /* 空白页css */
  327. .nodataBox {
  328. text-align: center;
  329. }
  330. .nodataImg {
  331. width: 400rpx;
  332. padding-top: 290rpx;
  333. }
  334. .noTxt {
  335. font-size: 30rpx;
  336. color: #999999;
  337. padding-top: 50rpx;
  338. }
  339. .noMore {
  340. text-align: center;
  341. line-height: 50rpx;
  342. color: #999999;
  343. font-size: 28rpx;
  344. }
  345. </style>