teamStore.vue 8.7 KB

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