index.vue 11 KB

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