my_task.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525
  1. <template name="task">
  2. <view class="content">
  3. <view class="cu-bar search bg-white">
  4. <view class="search-form round" @click="naviageToPage('/pageA/product/search?TabCur=')">
  5. <text style='color: #ccc;' class="cuIcon-search"></text>
  6. <input type="text" placeholder="请输入合同编号、车牌号或派车编号" confirm-type="search"></input>
  7. </view>
  8. </view>
  9. <view style='background:#fff;padding:0 145px;display:table-footer-group ;'>
  10. <view @click='tabcarchange(1)' class='line' :class='statusFlag==1?"active":""'>未完成</view>
  11. <view @click='tabcarchange(3)' class='line' :class='statusFlag==3?"active":""'>已完成</view>
  12. </view>
  13. <view class="introduce-section">
  14. <view v-for="(item, index) in taskInfo" :key="index" class="guess-item" @click="navToDetailPage(item)">
  15. <view class="price-box">
  16. <view class='tag tag-bule radius line-pink'>入库任务</view>
  17. <view class="title">{{item.carNo}}({{item.tranCarNo}})</view>
  18. <view class="title-tip" v-if="item.statusFlag==3">已完成</view>
  19. <view class="title-tip" v-if="item.statusFlag==1">未完成</view>
  20. </view>
  21. <view class="titles ">{{item.contractNo}}</view>
  22. <view class="titles titleds_aa">{{item.createDate | formatDate}}</view>
  23. </view>
  24. <view v-show="isLoadMore">
  25. <uni-load-more :status="loadStatus"></uni-load-more>
  26. </view>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. export default {
  32. name: "task",
  33. data() {
  34. return {
  35. PageCur: "task",
  36. taskInfo: [],
  37. pages: 1, //页数
  38. limit: 10, //每次取条目数
  39. loadStatus: 'loading', //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
  40. isLoadMore: false, //是否加载中
  41. showTran: true,
  42. scrollTop: 0,
  43. statusFlag: 1,
  44. current: 1,
  45. warehouseInOutInfo: {
  46. pageSize: 10,
  47. currentPage: 1
  48. }
  49. };
  50. },
  51. onLoad(options) {
  52. this.getIndexBuyData()
  53. },
  54. filters: {
  55. formatDate (date) {
  56. var date=new Date(date)
  57. var time=new Date()
  58. var newdate=''
  59. if(time.getMonth() + 1>=10){
  60. newdate=time.getFullYear()+'-'+(time.getMonth()+1)+'-'+time.getDate()
  61. }else{
  62. newdate=time.getFullYear()+'-0'+(time.getMonth()+1)+'-'+time.getDate()
  63. }
  64. //把时间戳改为yyyy-MM-dd格式
  65. //判断是否今天
  66. var datatime=''
  67. if(date.getMonth() + 1>=10){
  68. datatime=date.getFullYear()+'-'+(date.getMonth()+1)+'-'+date.getDate()
  69. }else{
  70. datatime=date.getFullYear()+'-0'+(date.getMonth()+1)+'-'+date.getDate()
  71. }
  72. console.log(datatime ,newdate)
  73. if(datatime == newdate){
  74. var h = date.getHours();
  75. h = h < 10 ? '0' + h : h;
  76. var m = date.getMinutes();
  77. m = m < 10 ? '0' + m : m;
  78. var s = date.getSeconds();
  79. s = s < 10 ? '0' + s : s;
  80. return h + ':' + m + ':' + s;
  81. }else{
  82. if(date.getMonth() + 1>=10){
  83. return date.getFullYear()+'-'+(date.getMonth()+1)+'-'+date.getDate()
  84. }else{
  85. return date.getFullYear()+'-0'+(date.getMonth()+1)+'-'+date.getDate()
  86. }
  87. }
  88. let o = {
  89. 'Y': date.getFullYear(),
  90. 'M+': date.getMonth() + 1,
  91. 'd+': date.getDate(),
  92. // 'H+': date.getHours(),
  93. // 'm+': date.getMinutes(),
  94. // 's+': date.getSeconds()
  95. }
  96. },
  97. },
  98. methods: {
  99. getIndexBuyData() {
  100. console.log(11111)
  101. const that = this
  102. var pages = that.pages
  103. var limit = that.limit
  104. console.log(2112454)
  105. this.warehouseInOutInfo.statusFlag = this.statusFlag
  106. //this.warehouseInOutInfo.status = this.status
  107. this.$api.doRequest('get', '/warehouseInOutInfo/selectInfo', this.warehouseInOutInfo).then(res => {
  108. console.log(res, "对象")
  109. if (res.data.code == 200) {
  110. let data = res.data.data.records
  111. // for(var i=0;i<res.data.data.records.length;i++){
  112. // }
  113. //采购信息
  114. if (data.length > 0) {
  115. that.taskInfo = that.taskInfo.concat(data)
  116. that.isLoadMore = false
  117. } else {
  118. if (that.pages > 1) {
  119. that.pages -= 1
  120. }
  121. that.isLoadMore = true
  122. that.loadStatus = 'nomore'
  123. }
  124. uni.hideLoading()
  125. this.taskInfo = res.data.data.records
  126. } else {
  127. uni.showToast({
  128. title: res.data.message,
  129. icon: 'none',
  130. duration: 2000
  131. })
  132. }
  133. }).catch(res => {
  134. uni.showToast({
  135. title: res.data.message,
  136. icon: 'none',
  137. duration: 2000
  138. })
  139. })
  140. },
  141. tabcarchange(statusFlag) {
  142. this.statusFlag = statusFlag
  143. this.pageSize = 1
  144. this.getIndexBuyData()
  145. },
  146. navToDetailPage(item) {
  147. if(item.statusFlag == 3){
  148. uni.navigateTo({
  149. url: `/pageD/warehousings/warehousingDetails?id=${item.id}`
  150. })
  151. }else{
  152. uni.navigateTo({
  153. url: `/pageD/warehousings/warehousings?id=${item.id}&goodsName=${item.goodsName}&contractNo=${item.contractNo}&startWeight=${item.startWeight}&carNo=${item.carNo}&tranCarNo=${item.tranCarNo}&warehouseName=${item.warehouseName}`
  154. })
  155. }
  156. }
  157. }
  158. }
  159. </script>
  160. <style lang="scss" scoped>
  161. page,
  162. .content {
  163. background: #F5F6FA;
  164. }
  165. .line {
  166. display: inline-block;
  167. padding: 5px;
  168. position: relative;
  169. font-size: 17px;
  170. width: 187px;
  171. padding-left: 68px;
  172. }
  173. .line.active {
  174. font-size: 19px;
  175. font-weight: 900;
  176. }
  177. .line.active:after {
  178. content: '';
  179. display: block;
  180. position: absolute;
  181. width: 18px;
  182. left: 50%;
  183. transform: translateX(-50%);
  184. bottom: 0;
  185. border-bottom: 1px solid #22C572;
  186. }
  187. .cu-tag.badge {
  188. right: 26rpx;
  189. }
  190. .cu-item {
  191. height: 80rpx;
  192. display: inline-block;
  193. line-height: 80rpx;
  194. }
  195. .search-form {
  196. background: #fff;
  197. box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  198. }
  199. .title-tip {
  200. color: #00aa00;
  201. text-align: center;
  202. font-size: 7px;
  203. }
  204. .tag-bule {
  205. background: #a8e4a5;
  206. color: #000000;
  207. }
  208. .tag {
  209. padding: 5px;
  210. display: inline-flex;
  211. font-size: 22rpx;
  212. margin: 3px;
  213. }
  214. .text-white {
  215. color: #fff;
  216. }
  217. .text-white text {
  218. position: relative;
  219. z-index: 2;
  220. background: linear-gradient(45deg, #3DC146, #B2D612);
  221. padding: 5px 10px;
  222. border-radius: 38rpx;
  223. }
  224. .guess-section {
  225. padding-bottom: 100upx;
  226. display: flex;
  227. flex-wrap: wrap;
  228. padding: 0 30upx;
  229. background: #fff;
  230. .guess-item {
  231. display: flex;
  232. flex-direction: column;
  233. width: 98%;
  234. border-bottom: 1px solid #ccc;
  235. }
  236. .image-wrapper {
  237. width: 100%;
  238. height: 330upx;
  239. border-radius: 3px;
  240. overflow: hidden;
  241. image {
  242. width: 100%;
  243. height: 100%;
  244. opacity: 1;
  245. }
  246. }
  247. .title {
  248. font-size: $font-lg;
  249. color: #121212;
  250. }
  251. .price-orther {
  252. font-size: $font-sm;
  253. color: $font-color-base;
  254. }
  255. .price {
  256. font-size: 64rpx;
  257. color: #39b54a;
  258. line-height: 1;
  259. padding-right: 10upx;
  260. }
  261. .view-item {
  262. width: 100%;
  263. // line-height: 40upx;
  264. padding-top: 10upx;
  265. }
  266. .confirm-btn {
  267. margin-left: 20%;
  268. }
  269. .date-time {
  270. margin-left: 30%;
  271. }
  272. .padding-xs-tmp {
  273. padding: 15upx 10upx 10upx 10upx;
  274. }
  275. }
  276. .navbar {
  277. position: fixed;
  278. left: 0;
  279. top: var(--window-top);
  280. display: flex;
  281. width: 100%;
  282. height: 80upx;
  283. background: #fff;
  284. box-shadow: 0 2upx 10upx rgba(0, 0, 0, .06);
  285. z-index: 10;
  286. .nav-item {
  287. flex: 1;
  288. display: flex;
  289. justify-content: center;
  290. align-items: center;
  291. height: 100%;
  292. font-size: 30upx;
  293. color: $font-color-dark;
  294. position: relative;
  295. &.current {
  296. color: $base-color;
  297. &:after {
  298. content: '';
  299. position: absolute;
  300. left: 50%;
  301. bottom: 0;
  302. transform: translateX(-50%);
  303. width: 120upx;
  304. height: 0;
  305. border-bottom: 4upx solid $base-color;
  306. }
  307. }
  308. }
  309. .p-box {
  310. display: flex;
  311. flex-direction: column;
  312. .yticon {
  313. display: flex;
  314. align-items: center;
  315. justify-content: center;
  316. width: 30upx;
  317. height: 14upx;
  318. line-height: 1;
  319. margin-left: 4upx;
  320. font-size: 26upx;
  321. color: #888;
  322. &.active {
  323. color: $base-color;
  324. }
  325. }
  326. .xia {
  327. transform: scaleY(-1);
  328. }
  329. }
  330. .cate-item {
  331. display: flex;
  332. justify-content: center;
  333. align-items: center;
  334. height: 100%;
  335. width: 80upx;
  336. position: relative;
  337. font-size: 44upx;
  338. &:after {
  339. content: '';
  340. position: absolute;
  341. left: 0;
  342. top: 50%;
  343. transform: translateY(-50%);
  344. border-left: 1px solid #ddd;
  345. width: 0;
  346. height: 36upx;
  347. }
  348. }
  349. }
  350. /* 分类 */
  351. .cate-mask {
  352. position: fixed;
  353. left: 0;
  354. top: var(--window-top);
  355. bottom: 0;
  356. width: 100%;
  357. background: rgba(0, 0, 0, 0);
  358. z-index: 95;
  359. transition: .3s;
  360. .cate-content {
  361. width: 630upx;
  362. height: 100%;
  363. background: #fff;
  364. float: right;
  365. transform: translateX(100%);
  366. transition: .3s;
  367. }
  368. &.none {
  369. display: none;
  370. }
  371. &.show {
  372. background: rgba(0, 0, 0, .4);
  373. .cate-content {
  374. transform: translateX(0);
  375. }
  376. }
  377. }
  378. .cate-list {
  379. display: flex;
  380. flex-direction: column;
  381. height: 100%;
  382. .cate-item {
  383. display: flex;
  384. align-items: center;
  385. height: 90upx;
  386. padding-left: 30upx;
  387. font-size: 28upx;
  388. color: #555;
  389. position: relative;
  390. }
  391. .two {
  392. height: 64upx;
  393. color: #303133;
  394. font-size: 30upx;
  395. background: #f8f8f8;
  396. }
  397. .active {
  398. color: $base-color;
  399. }
  400. }
  401. /* 销售信息 */
  402. .introduce-section {
  403. background: #fff;
  404. padding: 20upx 30upx;
  405. padding-bottom: 100upx;
  406. .guess-item {
  407. padding-bottom: 20upx;
  408. border-bottom: 1px solid #ccc;
  409. }
  410. .title {
  411. font-size: 13upx;
  412. color: $font-color-dark;
  413. font-weight: bold;
  414. height: 100upx;
  415. line-height: 50upx;
  416. flex: 2.5;
  417. margin-left: -4px;
  418. padding: 0px 24px;
  419. }
  420. .title-tip {
  421. flex: 1;
  422. -webkit-tap-highlight-color:transparent;
  423. }
  424. .price-box {
  425. display: flex;
  426. align-items: baseline;
  427. height: 57px;
  428. padding: 5px 0;
  429. font-size: 13px;
  430. color: #fa436a;
  431. }
  432. .price {
  433. font-size: 15px;
  434. }
  435. .m-price {
  436. margin: 0 12upx;
  437. color: $font-color-light;
  438. text-decoration: line-through;
  439. }
  440. .coupon-tip {
  441. align-items: center;
  442. padding: 4upx 10upx;
  443. background: $uni-color-primary;
  444. font-size: $font-sm;
  445. color: #fff;
  446. border-radius: 6upx;
  447. line-height: 1;
  448. transform: translateY(-4upx);
  449. }
  450. .bot-row {
  451. display: flex;
  452. align-items: center;
  453. height: 50upx;
  454. font-size: $font-sm;
  455. color: $font-color-light;
  456. view {
  457. flex: 1;
  458. }
  459. }
  460. }
  461. .titles {
  462. display: -webkit-inline-box;
  463. }
  464. .titleds_aa {
  465. float: right;
  466. }
  467. </style>