index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667
  1. <template>
  2. <view class="">
  3. <view class="content">
  4. <view style='background:#fff;display:flex;' class="cu-bar search">
  5. <u-search placeholder="请输入业务编号或对方名称" v-model="searchKeyWord" @custom="doSearch"></u-search>
  6. </view>
  7. <view style='background:#fff;padding:0 15px;'>
  8. <view @click='tabcarchange(0)' class='line' :class='status==0?"active":""'>全部</view>
  9. <view @click='tabcarchange(1)' class='line' :class='status==1?"active":""'>待签收</view>
  10. <view @click='tabcarchange(2)' class='line' :class='status==2?"active":""'>待结算</view>
  11. </view>
  12. <view class="no-data" v-if="isShowNoData">
  13. 暂无相关结果
  14. </view>
  15. <view class="" v-if="!isShowNoData">
  16. <view v-for="(item,index) in listData" :key="index">
  17. <view @click='sendreceiverecord(item)' class="guess-section">
  18. <view class="list-item">
  19. <view class="list-item-left">
  20. <view class='type send' v-if="item.status=='发货'">发</view>
  21. <view class='type put' v-if="item.status=='收货'">收</view>
  22. <view class="number">
  23. <view class='businessnumber'>{{item.businessNumber}}</view>
  24. <view class='consigner'>{{item.consignee}}</view>
  25. </view>
  26. </view>
  27. <view class="list-item-right">
  28. <view class='time'>{{item.createDate}}</view>
  29. <view class='goods'>{{item.goodsName}}</view>
  30. </view>
  31. </view>
  32. <view style='width:100%;' class='goodsstatus'>
  33. <text style='margin-right:10px;'>待签收:{{item.signedFor}}</text>
  34. <text>待结算:{{item.toSettled}}</text>
  35. </view>
  36. <view style='width:100%;' class='flex justify-end'>
  37. <view class='del' @click="delRow(item)">删除</view>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. <view v-show="isLoadMore">
  43. <uni-load-more :status="loadStatus"></uni-load-more>
  44. </view>
  45. </view>
  46. <view class="footer">
  47. <button @click='addgoods' class='addgoods'>新建发货任务</button>
  48. </view>
  49. </view>
  50. </template>
  51. <script>
  52. import store from "@/store";
  53. export default {
  54. name: "business",
  55. data() {
  56. return {
  57. searchKeyWord: '',
  58. content: '搜索',
  59. status: 0,
  60. listData: [],
  61. searchData: {},
  62. userinfo: {},
  63. isShowNoData: false,
  64. currentPage: 1, //页数
  65. pageSize: 10, //每次取条目数
  66. loadStatus: 'loading', //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
  67. isLoadMore: false, //是否加载中
  68. scrollTop: 0,
  69. }
  70. },
  71. onShow() {
  72. },
  73. onLoad(options) {
  74. // 获取用户信息
  75. this.getUserInfo()
  76. //获取列表数据
  77. this.initData();
  78. },
  79. onPageScroll(e) {
  80. this.scrollTop = e.scrollTop;
  81. },
  82. onReachBottom() { //上拉触底函数
  83. debugger
  84. if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
  85. this.isLoadMore = true
  86. this.currentPage += 1
  87. this.getListData(this.status)
  88. }
  89. },
  90. onPullDownRefresh() {
  91. debugger
  92. this.currentPage = 1
  93. this.isLoadMore = false
  94. this.loadStatus = 'loading'
  95. this.listData=[]
  96. this.getListData(this.status)
  97. setTimeout(function() {
  98. uni.stopPullDownRefresh();
  99. }, 1000);
  100. },
  101. methods: {
  102. getUserInfo() {
  103. this.userinfo = store.getters.getUserInfo
  104. },
  105. addgoods() {
  106. uni.navigateTo({
  107. url: '/pageA/freightTransport/addsendgoods?phone=' + this.userInfo.phone
  108. })
  109. },
  110. sendreceiverecord(item) {
  111. if (item.status == '发货') {
  112. uni.navigateTo({
  113. url: '/pageA/freightTransport/record/sendrecord?id=' + item.id
  114. })
  115. } else {
  116. uni.navigateTo({
  117. url: '/pageA/freightTransport/record/payrecord?id=' + item.id
  118. })
  119. }
  120. },
  121. initData() {
  122. this.currentPage = 1
  123. this.isLoadMore = false
  124. this.loadStatus = 'more'
  125. this.getListData(0)
  126. },
  127. getListData(state, type) {
  128. let _data = {
  129. currentPage: this.currentPage,
  130. pageSize: this.pageSize
  131. }
  132. if (state == "searchKeyWord") {
  133. _data.searchKeyWord = type
  134. _data.accountNumber = this.userInfo.phone
  135. } else {
  136. _data.searchType = state
  137. _data.accountNumber = this.userInfo.phone
  138. }
  139. let that = this
  140. uni.showLoading({
  141. title: '正在加载',
  142. mask: true
  143. })
  144. this.$api.doRequest('get', '/freightReceivingDispatching/selectFreightReceivingDispatchingPage', _data)
  145. .then(res => {
  146. if (res.data.code == 200) {
  147. that.listData = that.listData.concat(res.data.data.records);
  148. for (let i = 0; i < that.listData.length; i++) {
  149. that.utils.nullToString(that.listData[i])
  150. that.listData[i].toSettled = that.listData[i].toSettled == '' ? 0 : that.listData[i]
  151. .toSettled
  152. that.listData[i].signedFor = that.listData[i].signedFor == '' ? 0 : that.listData[i]
  153. .signedFor
  154. }
  155. console.log(that.listData)
  156. that.isLoadMore = false
  157. } else {
  158. if (that.currentPage > 1) {
  159. that.currentPage = 1
  160. }
  161. that.isLoadMore = true
  162. that.loadStatus = 'nomore'
  163. }
  164. uni.hideLoading()
  165. }).catch(res => {
  166. that.$api.msg(res.data.data.errmsg)
  167. that.isLoadMore = false
  168. that.loadStatus = 'nomore'
  169. if (that.currentPage > 1) {
  170. that.currentPage = 1
  171. }
  172. uni.hideLoading()
  173. // uni.showToast({
  174. // title: res.data.message,
  175. // icon: 'none',
  176. // duration: 2000
  177. // })
  178. })
  179. },
  180. tabcarchange(val) {
  181. this.searchKeyWord = ""
  182. console.log(val)
  183. this.status = val
  184. this.getListData(val)
  185. },
  186. // 搜索
  187. doSearch() {
  188. console.log(this.searchKeyWord)
  189. this.getListData("searchKeyWord", this.searchKeyWord)
  190. },
  191. //删除
  192. delRow(val) {
  193. this.$api.doRequest('post', 'freightReceivingDispatching/api/deleteFreightReceivingDispatching', {
  194. "id": val.id
  195. }).then(res => {
  196. if (res.data.code == 200) {
  197. // this.listData = res.data.data.records;
  198. uni.showToast({
  199. title: "删除成功!",
  200. icon: 'none',
  201. duration: 2000
  202. })
  203. this.getListData(0)
  204. }
  205. }).catch(res => {
  206. // uni.showToast({
  207. // title: res.data.message,
  208. // icon: 'none',
  209. // duration: 2000
  210. // })
  211. })
  212. }
  213. }
  214. }
  215. </script>
  216. <style lang='scss'>
  217. page,
  218. .content {
  219. background: #F5F6FA;
  220. }
  221. .line {
  222. display: inline-block;
  223. padding: 5px;
  224. position: relative;
  225. font-size: 17px;
  226. }
  227. .line:nth-last-of-type(2),
  228. .line:nth-last-of-type(1) {
  229. margin-left: 68rpx;
  230. }
  231. .line.active {
  232. font-size: 19px;
  233. font-weight: 900;
  234. }
  235. .line.active:after {
  236. content: '';
  237. display: block;
  238. position: absolute;
  239. width: 38px;
  240. left: 50%;
  241. transform: translateX(-50%);
  242. bottom: 0;
  243. border-bottom: 1px solid #22C572;
  244. }
  245. .cu-tag.badge {
  246. right: 26rpx;
  247. }
  248. .cu-item {
  249. height: 80rpx;
  250. display: inline-block;
  251. line-height: 80rpx;
  252. }
  253. .search-form {
  254. background: #F5F6F9;
  255. padding-left: 20rpx;
  256. }
  257. .title-tip {
  258. color: #E63113;
  259. text-align: right;
  260. }
  261. .tag1 {
  262. background: #F5F6F9;
  263. padding: 5px;
  264. color: #333333;
  265. display: inline-flex;
  266. font-size: 22rpx;
  267. border-radius: 3px;
  268. margin: 3px;
  269. }
  270. .tag {
  271. background: #F5F6F9;
  272. padding: 7px 12px;
  273. color: #333333;
  274. display: inline-flex;
  275. font-size: 22rpx;
  276. border-radius: 15px;
  277. margin: 3px;
  278. }
  279. .tag-bule {
  280. background: #EBEEFA;
  281. color: #5C76DF;
  282. }
  283. .tag-green {
  284. background: #C6F7BC;
  285. color: #065112;
  286. }
  287. .tag-yellow {
  288. background: #F9F2EA;
  289. color: #BE9C69;
  290. }
  291. .tag-red {
  292. background: #FEECE6;
  293. color: #FE6430;
  294. }
  295. .text-white {
  296. color: #fff;
  297. }
  298. .text-white text {
  299. position: relative;
  300. z-index: 2;
  301. background: linear-gradient(45deg, #3DC146, #B2D612);
  302. padding: 5px 10px;
  303. border-radius: 38rpx;
  304. }
  305. .guess-section {
  306. padding-bottom: 100upx;
  307. display: flex;
  308. flex-wrap: wrap;
  309. padding: 30upx;
  310. background: #fff;
  311. margin: 10px;
  312. border-radius: 6px;
  313. .type {
  314. border-radius: 10px;
  315. padding: 5px;
  316. wdith: 22px;
  317. height: 22px;
  318. line-height: 14px;
  319. font-size: 12px;
  320. }
  321. .type.send {
  322. background: #22C572;
  323. color: #fff;
  324. }
  325. .type.put {
  326. background: #FD714F;
  327. color: #fff;
  328. }
  329. .businessnumber {
  330. font-size: 16px;
  331. font-weight: 600;
  332. }
  333. .time {
  334. color: #878C9C;
  335. }
  336. .goods,
  337. .consigner {
  338. font-size: 24rpx;
  339. font-weight: 500;
  340. color: #333333;
  341. text-align: right;
  342. margin: 20rpx 0
  343. }
  344. .goodsstatus {
  345. background: #F9F9FA;
  346. color: #9698A2;
  347. padding: 10px 0;
  348. padding-left: 47px;
  349. margin: 10px 0;
  350. }
  351. .del {
  352. width: 60px;
  353. height: 33px;
  354. line-height: 33px;
  355. font-size: 14px;
  356. background: #fff;
  357. border: 1px solid #CDCDCD;
  358. border-radius: 30px;
  359. text-align: center;
  360. }
  361. }
  362. .navbar {
  363. position: fixed;
  364. left: 0;
  365. top: var(--window-top);
  366. display: flex;
  367. width: 100%;
  368. height: 80upx;
  369. background: #fff;
  370. box-shadow: 0 2upx 10upx rgba(0, 0, 0, .06);
  371. z-index: 10;
  372. .nav-item {
  373. flex: 1;
  374. display: flex;
  375. justify-content: center;
  376. align-items: center;
  377. height: 100%;
  378. font-size: 30upx;
  379. color: $font-color-dark;
  380. position: relative;
  381. &.current {
  382. color: $base-color;
  383. &:after {
  384. content: '';
  385. position: absolute;
  386. left: 50%;
  387. bottom: 0;
  388. transform: translateX(-50%);
  389. width: 120upx;
  390. height: 0;
  391. border-bottom: 4upx solid $base-color;
  392. }
  393. }
  394. }
  395. .p-box {
  396. display: flex;
  397. flex-direction: column;
  398. .yticon {
  399. display: flex;
  400. align-items: center;
  401. justify-content: center;
  402. width: 30upx;
  403. height: 14upx;
  404. line-height: 1;
  405. margin-left: 4upx;
  406. font-size: 26upx;
  407. color: #888;
  408. &.active {
  409. color: $base-color;
  410. }
  411. }
  412. .xia {
  413. transform: scaleY(-1);
  414. }
  415. }
  416. .cate-item {
  417. display: flex;
  418. justify-content: center;
  419. align-items: center;
  420. height: 100%;
  421. width: 80upx;
  422. position: relative;
  423. font-size: 44upx;
  424. &:after {
  425. content: '';
  426. position: absolute;
  427. left: 0;
  428. top: 50%;
  429. transform: translateY(-50%);
  430. border-left: 1px solid #ddd;
  431. width: 0;
  432. height: 36upx;
  433. }
  434. }
  435. }
  436. /* 分类 */
  437. .cate-mask {
  438. position: fixed;
  439. left: 0;
  440. top: var(--window-top);
  441. bottom: 0;
  442. width: 100%;
  443. background: rgba(0, 0, 0, 0);
  444. z-index: 95;
  445. transition: .3s;
  446. .cate-content {
  447. width: 630upx;
  448. height: 100%;
  449. background: #fff;
  450. float: right;
  451. transform: translateX(100%);
  452. transition: .3s;
  453. }
  454. &.none {
  455. display: none;
  456. }
  457. &.show {
  458. background: rgba(0, 0, 0, .4);
  459. .cate-content {
  460. transform: translateX(0);
  461. }
  462. }
  463. }
  464. .cate-list {
  465. display: flex;
  466. flex-direction: column;
  467. height: 100%;
  468. .cate-item {
  469. display: flex;
  470. align-items: center;
  471. height: 90upx;
  472. padding-left: 30upx;
  473. font-size: 28upx;
  474. color: #555;
  475. position: relative;
  476. }
  477. .two {
  478. height: 64upx;
  479. color: #303133;
  480. font-size: 30upx;
  481. background: #f8f8f8;
  482. }
  483. .active {
  484. color: $base-color;
  485. }
  486. }
  487. .introduce-section .title {
  488. font-size: 17px;
  489. font-weight: bold;
  490. height: 40px;
  491. line-height: 40px;
  492. flex: 2.5;
  493. border-bottom: 1px solid #EEEEEE;
  494. }
  495. .introduce-section .address {
  496. color: #878C9C;
  497. font-size: 12px;
  498. padding: 10px 0 10px;
  499. }
  500. .introduce-section .price {
  501. padding: 10px 0 10px;
  502. color: #FD714F;
  503. font-size: 19px;
  504. font-weight: 700;
  505. }
  506. .introduce-section .guess-item {
  507. border-radius: 10px;
  508. background: #fff;
  509. padding: 0upx 30upx 20upx;
  510. margin: 8px;
  511. border-bottom: 1px solid #ccc;
  512. }
  513. /* 销售信息 */
  514. .introduce-section {
  515. .title-tip {
  516. flex: 1;
  517. }
  518. .price-box {
  519. display: flex;
  520. align-items: baseline;
  521. font-size: 26upx;
  522. }
  523. .price {
  524. font-size: $font-lg + 2upx;
  525. }
  526. .m-price {
  527. margin: 0 12upx;
  528. color: $font-color-light;
  529. text-decoration: line-through;
  530. }
  531. .coupon-tip {
  532. align-items: center;
  533. padding: 4upx 10upx;
  534. background: $uni-color-primary;
  535. font-size: $font-sm;
  536. color: #fff;
  537. border-radius: 6upx;
  538. line-height: 1;
  539. transform: translateY(-4upx);
  540. }
  541. .bot-row {
  542. display: flex;
  543. align-items: center;
  544. height: 50upx;
  545. font-size: $font-sm;
  546. color: $font-color-light;
  547. view {
  548. flex: 1;
  549. }
  550. }
  551. }
  552. .footer {
  553. background: #fff;
  554. position: fixed;
  555. bottom: 0;
  556. width: 100%;
  557. padding: 20px 0;
  558. }
  559. .addgoods {
  560. width: 90%;
  561. background: #22C572;
  562. color: #fff;
  563. border-radius: 30px;
  564. }
  565. .addgoods:after {
  566. border: none;
  567. }
  568. .cu-bar {
  569. padding: 0 30rpx;
  570. }
  571. .no-data {
  572. /* background: red; */
  573. text-align: center;
  574. font-size: 36rpx;
  575. margin-top: 300rpx;
  576. }
  577. .list-item {
  578. width: 100%;
  579. display: flex;
  580. justify-content: space-between;
  581. .list-item-left {
  582. display: flex;
  583. align-items: center;
  584. .number {
  585. margin-left: 40rpx;
  586. }
  587. }
  588. }
  589. </style>