entryReport.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432
  1. <template>
  2. <view class="content">
  3. <view class="topView">
  4. <!-- 搜索 -->
  5. <view class="searchBox">
  6. <image src="../../static/img/icon_search.png" class="searchImg"></image>
  7. <input type="text" class="searchInput" placeholder="请输入门店名称、联系人、手机号" v-model="searchValue"
  8. @confirm="searchDone" />
  9. </view>
  10. <!-- 筛选条件 -->
  11. <view class="siftBg">
  12. <picker value="firstIndex" :range="firstArr" @change="bindPickerChange">
  13. <view class="uni-input">距上次提交 {{firstIndex == null ? '不限' : firstArr[firstIndex]}}
  14. <image class="downArrow" src="../../static/img/icon_downArrow.png" mode=""></image>
  15. </view>
  16. </picker>
  17. <!-- 筛选条件 需检测项 -->
  18. <view class="checkBg" @click="changeHave">
  19. <image class='checkImg' src="../../static/img/icon_select_def@2x.png" mode="" v-if="!isHave">
  20. </image>
  21. <image class='checkImg' src="../../static/img/icon_select_per@2x.png" mode="" v-else>
  22. </image>
  23. 需检测项大于0
  24. </view>
  25. </view>
  26. </view>
  27. <!-- 门店列表 -->
  28. <view class="shopContent">
  29. <view v-for="(item,index) in shopData" :key="index">
  30. <view class="shopBox">
  31. <view class="shopTop">
  32. <view class="shopName">{{item.ShopName}}</view>
  33. <!-- 地址 和电话 图标 -->
  34. <image class="tubiao" src="../../static/img/icon_daohang_def@2x.png" @click="goAddress(item)">
  35. </image>
  36. <image class="tubiao" src="../../static/img/icon_phone_def@2x.png"
  37. @click="call(item.ContactorPhone)">
  38. </image>
  39. </view>
  40. <!-- 门店类型-开业时间-联系人 -->
  41. <view class="shopType"><text style='color: #B98B5D;'>{{item.levelName}}</text> ·
  42. <text v-if="item.OpeningTime != null">{{item.OpeningTime}}</text> 联系人:{{item.Contactor}}
  43. </view>
  44. <!-- 详细地址 -->
  45. <view class="addressView">
  46. <view class="address">{{item.Address}}</view>
  47. <view class="distance" v-if="item.distance != 0.00">{{item.distance}}km</view>
  48. </view>
  49. <!-- 提交信息 -->
  50. <view class="tijao">
  51. <view class="time" v-if="item.maxTime">距上次提交:<text style='color: #FF4F00;'>{{item.maxTime}}</text>天</view>
  52. <view class="time" v-else>暂无提交记录</view>
  53. <view class="xiangmu"><text style='color: #FF4F00;'>{{item.checkCount}}</text>项需要检测</view>
  54. </view>
  55. <!-- btns -->
  56. <view class="btns">
  57. <view class="lishi">历史记录</view>
  58. <view class="qiandao">签到</view>
  59. <view class="baogao" @click="goEntered(item)">录入报告</view>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. <!-- 上拉 加载更多 -->
  65. <!-- <view class="noMore" v-if="noMoreShow">没有更多数据</view> -->
  66. <!-- 无数据空白页 -->
  67. <view class="nodataBox" v-if="shopData.length == 0">
  68. <image src="../../static/img/pic_empty_def.png" mode="widthFix" class="nodataImg"></image>
  69. <view class="noTxt">暂无数据</view>
  70. </view>
  71. </view>
  72. </template>
  73. <script>
  74. export default {
  75. data() {
  76. return {
  77. searchValue: '',
  78. lng: '',
  79. lat: '',
  80. firstIndex: null,
  81. firstArr: ['不限', '1-15天', '15-30天', '30天以上'],
  82. isHave: false,
  83. shopData: [],
  84. page: 1,
  85. noMoreShow: false,
  86. }
  87. },
  88. onShow() {
  89. this.firstIndex = null
  90. this.isHave = false
  91. var that = this
  92. uni.getLocation({
  93. success(res) {
  94. that.lng = res.longitude
  95. that.lat = res.latitude
  96. that.page = 1
  97. that.getShopData()
  98. },
  99. fail() {
  100. }
  101. })
  102. //#ifdef H5
  103. that.lng='117.06533'
  104. that.lat='36.68013'
  105. that.getShopData()
  106. // #endif
  107. },
  108. methods: {
  109. goEntered(item){
  110. uni.navigateTo({
  111. url:'entered?shopId='+item.shopId+'&ShopName='+item.ShopName
  112. })
  113. },
  114. searchDone(e) {
  115. this.searchValue = e.target.value;
  116. this.page = 1
  117. this.getShopData()
  118. },
  119. bindPickerChange(e) {
  120. this.firstIndex = Number(e.target.value)
  121. this.page = 1
  122. this.getShopData()
  123. },
  124. changeHave() {
  125. this.isHave = !this.isHave
  126. this.page = 1
  127. this.getShopData()
  128. },
  129. goAddress(v) {
  130. uni.openLocation({
  131. latitude: Number(v.lat),
  132. longitude: Number(v.lng),
  133. name: v.shopName,
  134. address: v.Address,
  135. });
  136. },
  137. call(e) {
  138. if (e.length != 0) {
  139. uni.makePhoneCall({
  140. phoneNumber: e
  141. })
  142. }
  143. },
  144. getShopData() {
  145. uni.showLoading({
  146. title: '加载中'
  147. })
  148. var maxTime = ''
  149. if(this.firstIndex == 0){
  150. maxTime = ''
  151. }
  152. else {
  153. maxTime = Number(this.firstIndex)
  154. }
  155. var checkCount = ''
  156. if(this.isHave == true){
  157. checkCount = 1
  158. }
  159. let url = 'accompany/SuperAccounts/queryShopListByMyTeam',
  160. params = {
  161. // page: this.page,
  162. // limit: 20,
  163. shopName: this.searchValue,
  164. lng: this.lng,
  165. lat: this.lat,
  166. maxTime:maxTime,
  167. checkCount:checkCount,
  168. }
  169. this.$http(url, params, 'GET').then(res => {
  170. var list = res.data
  171. // 处理 undefined和null转为空白字符串
  172. list.forEach((item, index) => {
  173. for (const key in item) {
  174. item[key] = this.$praseStrEmpty(item[key])
  175. }
  176. })
  177. this.shopData = list
  178. // if (this.page == 1 && list.length == 0) {
  179. // this.noMoreShow = false
  180. // } else if (list.length < 20) {
  181. // this.noMoreShow = true
  182. // }
  183. // if (this.page == 1) {
  184. // this.shopData = list
  185. // } else {
  186. // this.shopData = this.shopData.concat(list)
  187. // }
  188. })
  189. },
  190. },
  191. // 下拉刷新 上拉加载更多
  192. onPullDownRefresh() {
  193. this.getShopData()
  194. setTimeout(function() {
  195. uni.stopPullDownRefresh();
  196. }, 1000);
  197. },
  198. // onReachBottom() {
  199. // this.page++;
  200. // this.getShopData()
  201. // },
  202. }
  203. </script>
  204. <style>
  205. .content {
  206. background-color: #F4F5F7;
  207. min-height: 100vh;
  208. }
  209. .topView {
  210. width: 100%;
  211. height: 200rpx;
  212. background-color: #FFFFFF;
  213. left: 0rpx;
  214. top: 0rpx;
  215. position: fixed;
  216. z-index: 99;
  217. }
  218. /* #ifdef H5 */
  219. .topView {
  220. top: 44px;
  221. }
  222. /* #endif */
  223. .searchBox {
  224. height: 72rpx;
  225. margin: 24rpx;
  226. background-color: #F4F5F7;
  227. border-radius: 36rpx;
  228. display: flex;
  229. }
  230. .searchImg {
  231. margin-top: 20rpx;
  232. margin-left: 20rpx;
  233. width: 32rpx;
  234. height: 32rpx;
  235. }
  236. .searchInput {
  237. height: 72rpx;
  238. font-size: 28rpx;
  239. padding-left: 16rpx;
  240. width: 85%;
  241. }
  242. .siftBg {
  243. display: flex;
  244. justify-content: space-between;
  245. height: 80rpx;
  246. padding: 0rpx 24rpx;
  247. align-items: center;
  248. }
  249. .siftBg,
  250. .checkBg {
  251. font-size: 28rpx;
  252. color: #3C3C3C;
  253. }
  254. .downArrow {
  255. width: 16rpx;
  256. height: 12rpx;
  257. padding: 6rpx 8rpx;
  258. }
  259. .checkBg {
  260. display: flex;
  261. flex-direction: row;
  262. align-items: center;
  263. height: 72rpx;
  264. padding: 0rpx 24rpx;
  265. }
  266. .checkImg {
  267. width: 32rpx;
  268. height: 32rpx;
  269. margin-right: 8rpx;
  270. }
  271. .shopContent {
  272. background-color: #F4F5F7;
  273. padding: 0rpx 24rpx;
  274. padding-top: 200rpx;
  275. }
  276. .shopBox {
  277. background-color: #FFFFFF;
  278. border-radius: 10rpx;
  279. margin: 20rpx 0rpx;
  280. }
  281. .shopTop {
  282. display: flex;
  283. justify-content: space-between;
  284. padding-top: 30rpx;
  285. padding-left: 20rpx;
  286. padding-right: 20rpx;
  287. }
  288. .shopName {
  289. font-size: 30rpx;
  290. font-weight: bold;
  291. color: #3C3C3C;
  292. margin-right: 20rpx;
  293. width: 500rpx;
  294. }
  295. .tubiao {
  296. width: 48rpx;
  297. height: 48rpx;
  298. padding-left: 40rpx;
  299. }
  300. .shopType {
  301. padding: 10rpx 20rpx;
  302. font-size: 26rpx;
  303. color: #3C3C3C;
  304. }
  305. .addressView {
  306. padding: 10rpx 20rpx;
  307. display: flex;
  308. font-size: 26rpx;
  309. color: #999999;
  310. display: flex;
  311. justify-content: space-between;
  312. }
  313. .address {
  314. margin-right: 20rpx;
  315. }
  316. .tijao {
  317. padding: 10rpx 20rpx 30rpx 20rpx;
  318. display: flex;
  319. justify-content: space-between;
  320. font-size: 26rpx;
  321. color: #999999;
  322. border-bottom: 1rpx solid #EEEEEE;
  323. }
  324. .btns {
  325. display: flex;
  326. justify-content: flex-end;
  327. }
  328. .lishi,
  329. .qiandao,
  330. .baogao {
  331. margin: 20rpx;
  332. color: #3C3C3C;
  333. font-size: 28rpx;
  334. width: 150rpx;
  335. height: 56rpx;
  336. border-radius: 28rpx;
  337. border: 2rpx solid #DDDDDD;
  338. text-align: center;
  339. line-height: 56rpx;
  340. }
  341. .baogao {
  342. border: 2rpx solid #FF4F00;
  343. color: #FF4F00;
  344. }
  345. /* 空白页css */
  346. .nodataBox {
  347. text-align: center;
  348. }
  349. .nodataImg {
  350. width: 400rpx;
  351. padding-top: 300rpx;
  352. }
  353. .noTxt {
  354. font-size: 30rpx;
  355. color: #999999;
  356. padding-top: 50rpx;
  357. }
  358. .noMore {
  359. text-align: center;
  360. line-height: 50rpx;
  361. color: #999999;
  362. font-size: 28rpx;
  363. }
  364. </style>