index.vue 11 KB

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