entryReport.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423
  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()">录入报告</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. })
  100. },
  101. methods: {
  102. goEntered(){
  103. uni.navigateTo({
  104. url:'entered'
  105. })
  106. },
  107. searchDone(e) {
  108. this.searchValue = e.target.value;
  109. this.page = 1
  110. this.getShopData()
  111. },
  112. bindPickerChange(e) {
  113. this.firstIndex = Number(e.target.value)
  114. this.page = 1
  115. this.getShopData()
  116. },
  117. changeHave() {
  118. this.isHave = !this.isHave
  119. this.page = 1
  120. this.getShopData()
  121. },
  122. goAddress(v) {
  123. uni.openLocation({
  124. latitude: Number(v.lat),
  125. longitude: Number(v.lng),
  126. name: v.shopName,
  127. address: v.Address,
  128. });
  129. },
  130. call(e) {
  131. if (e.length != 0) {
  132. uni.makePhoneCall({
  133. phoneNumber: e
  134. })
  135. }
  136. },
  137. getShopData() {
  138. uni.showLoading({
  139. title: '加载中'
  140. })
  141. var maxTime = ''
  142. if(this.firstIndex == 0){
  143. maxTime = ''
  144. }
  145. else {
  146. maxTime = Number(this.firstIndex)
  147. }
  148. var checkCount = ''
  149. if(this.isHave == true){
  150. checkCount = 1
  151. }
  152. let url = 'accompany/SuperAccounts/queryShopListByMyTeam',
  153. params = {
  154. // page: this.page,
  155. // limit: 20,
  156. shopName: this.searchValue,
  157. lng: this.lng,
  158. lat: this.lat,
  159. maxTime:maxTime,
  160. checkCount:checkCount,
  161. }
  162. this.$http(url, params, 'GET').then(res => {
  163. var list = res.data
  164. // 处理 undefined和null转为空白字符串
  165. list.forEach((item, index) => {
  166. for (const key in item) {
  167. item[key] = this.$praseStrEmpty(item[key])
  168. }
  169. })
  170. this.shopData = list
  171. // if (this.page == 1 && list.length == 0) {
  172. // this.noMoreShow = false
  173. // } else if (list.length < 20) {
  174. // this.noMoreShow = true
  175. // }
  176. // if (this.page == 1) {
  177. // this.shopData = list
  178. // } else {
  179. // this.shopData = this.shopData.concat(list)
  180. // }
  181. })
  182. },
  183. },
  184. // 下拉刷新 上拉加载更多
  185. onPullDownRefresh() {
  186. this.getShopData()
  187. setTimeout(function() {
  188. uni.stopPullDownRefresh();
  189. }, 1000);
  190. },
  191. // onReachBottom() {
  192. // this.page++;
  193. // this.getShopData()
  194. // },
  195. }
  196. </script>
  197. <style>
  198. .content {
  199. background-color: #F4F5F7;
  200. min-height: 100vh;
  201. }
  202. .topView {
  203. width: 100%;
  204. height: 200rpx;
  205. background-color: #FFFFFF;
  206. left: 0rpx;
  207. top: 0rpx;
  208. position: fixed;
  209. z-index: 99;
  210. }
  211. /* #ifdef H5 */
  212. .topView {
  213. top: 44px;
  214. }
  215. /* #endif */
  216. .searchBox {
  217. height: 72rpx;
  218. margin: 24rpx;
  219. background-color: #F4F5F7;
  220. border-radius: 36rpx;
  221. display: flex;
  222. }
  223. .searchImg {
  224. margin-top: 20rpx;
  225. margin-left: 20rpx;
  226. width: 32rpx;
  227. height: 32rpx;
  228. }
  229. .searchInput {
  230. height: 72rpx;
  231. font-size: 28rpx;
  232. padding-left: 16rpx;
  233. width: 85%;
  234. }
  235. .siftBg {
  236. display: flex;
  237. justify-content: space-between;
  238. height: 80rpx;
  239. padding: 0rpx 24rpx;
  240. align-items: center;
  241. }
  242. .siftBg,
  243. .checkBg {
  244. font-size: 28rpx;
  245. color: #3C3C3C;
  246. }
  247. .downArrow {
  248. width: 16rpx;
  249. height: 12rpx;
  250. padding: 6rpx 8rpx;
  251. }
  252. .checkBg {
  253. display: flex;
  254. flex-direction: row;
  255. align-items: center;
  256. height: 72rpx;
  257. padding: 0rpx 24rpx;
  258. }
  259. .checkImg {
  260. width: 32rpx;
  261. height: 32rpx;
  262. margin-right: 8rpx;
  263. }
  264. .shopContent {
  265. background-color: #F4F5F7;
  266. padding: 0rpx 24rpx;
  267. padding-top: 200rpx;
  268. }
  269. .shopBox {
  270. background-color: #FFFFFF;
  271. border-radius: 10rpx;
  272. margin: 20rpx 0rpx;
  273. }
  274. .shopTop {
  275. display: flex;
  276. justify-content: space-between;
  277. padding-top: 30rpx;
  278. padding-left: 20rpx;
  279. padding-right: 20rpx;
  280. }
  281. .shopName {
  282. font-size: 30rpx;
  283. font-weight: bold;
  284. color: #3C3C3C;
  285. margin-right: 20rpx;
  286. width: 500rpx;
  287. }
  288. .tubiao {
  289. width: 48rpx;
  290. height: 48rpx;
  291. padding-left: 40rpx;
  292. }
  293. .shopType {
  294. padding: 10rpx 20rpx;
  295. font-size: 26rpx;
  296. color: #3C3C3C;
  297. }
  298. .addressView {
  299. padding: 10rpx 20rpx;
  300. display: flex;
  301. font-size: 26rpx;
  302. color: #999999;
  303. display: flex;
  304. justify-content: space-between;
  305. }
  306. .address {
  307. margin-right: 20rpx;
  308. }
  309. .tijao {
  310. padding: 10rpx 20rpx 30rpx 20rpx;
  311. display: flex;
  312. justify-content: space-between;
  313. font-size: 26rpx;
  314. color: #999999;
  315. border-bottom: 1rpx solid #EEEEEE;
  316. }
  317. .btns {
  318. display: flex;
  319. justify-content: flex-end;
  320. }
  321. .lishi,
  322. .qiandao,
  323. .baogao {
  324. margin: 20rpx;
  325. color: #3C3C3C;
  326. font-size: 28rpx;
  327. width: 150rpx;
  328. height: 56rpx;
  329. border-radius: 28rpx;
  330. border: 2rpx solid #DDDDDD;
  331. text-align: center;
  332. line-height: 56rpx;
  333. }
  334. .baogao {
  335. border: 2rpx solid #FF4F00;
  336. color: #FF4F00;
  337. }
  338. /* 空白页css */
  339. .nodataBox {
  340. text-align: center;
  341. }
  342. .nodataImg {
  343. width: 400rpx;
  344. padding-top: 300rpx;
  345. }
  346. .noTxt {
  347. font-size: 30rpx;
  348. color: #999999;
  349. padding-top: 50rpx;
  350. }
  351. .noMore {
  352. text-align: center;
  353. line-height: 50rpx;
  354. color: #999999;
  355. font-size: 28rpx;
  356. }
  357. </style>