my_task.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. <template name="task">
  2. <view class="content">
  3. <view class="cu-bar search bg-white">
  4. <view class="search-form round" >
  5. <u-search placeholder="请输入合同编号、车牌号或派车编号" v-model="keyword"
  6. @search="searchKeyWord()"
  7. @custom="searchKeyWord()"
  8. ></u-search>
  9. </view>
  10. </view>
  11. <view style='background:#fff;padding:0 15px;'>
  12. <view @click='tabcarchange(1)' class='line' :class='statusFlag==1?"active":""'>未完成</view>
  13. <view @click='tabcarchange(3)' class='line' :class='statusFlag==3?"active":""'>已完成</view>
  14. </view>
  15. <view class="introduce-section">
  16. <view v-for="(item, index) in taskInfo" :key="index" class="guess-item" @click="navToDetailPage(item)">
  17. <view class="title flex">
  18. <text>
  19. {{item.carNo}}({{item.tranCarNo}})
  20. </text>
  21. <view class="title-tip-a" v-if="item.statusFlag==3">已完成</view>
  22. <view class="title-tip" v-if="item.statusFlag==1">未完成</view>
  23. </view>
  24. <view class="flex title_b">
  25. <view class="title-tip">
  26. {{item.contractNo}}
  27. </view>
  28. <view class="title-tip-b">{{item.inOutDate}}</view>
  29. <!-- <view class="title-tip-b">2021-07-30</view> -->
  30. </view>
  31. <u-tag :text="item.taskType" type="success" />
  32. <!-- <u-tag text="入库任务" type="primary" /> -->
  33. </view>
  34. <view v-show="isLoadMore">
  35. <uni-load-more :status="loadStatus"></uni-load-more>
  36. </view>
  37. </view>
  38. </view>
  39. </template>
  40. <script>
  41. export default {
  42. name: "task",
  43. data() {
  44. return {
  45. PageCur: "task",
  46. taskInfo: [],
  47. pages: 1, //页数
  48. limit: 10, //每次取条目数
  49. loadStatus: 'loading', //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
  50. isLoadMore: false, //是否加载中
  51. showTran: true,
  52. scrollTop: 0,
  53. statusFlag: 1,
  54. current: 1,
  55. warehouseInOutInfo: {
  56. pageSize: 10,
  57. currentPage: 1
  58. },
  59. keyword:""
  60. };
  61. },
  62. onLoad(options) {
  63. this.getIndexBuyData();
  64. },
  65. methods: {
  66. searchKeyWord(){
  67. if(!this.keyword){
  68. this.$api.msg('关键字不能为空')
  69. }
  70. this.warehouseInOutInfo.statusFlag = this.statusFlag
  71. this.warehouseInOutInfo.keyWord = this.keyword
  72. uni.showLoading({
  73. title:"正在加载"
  74. })
  75. this.$api.doRequest('get', '/warehouseInOutInfo/selectInfoByKeyWord', this.warehouseInOutInfo).then(res => {
  76. console.log(res, "对象")
  77. if (res.data.code == 200) {
  78. this.taskInfo = res.data.data
  79. uni.hideLoading()
  80. } else {
  81. uni.showToast({
  82. title: res.data.message,
  83. icon: 'none',
  84. duration: 2000
  85. })
  86. uni.hideLoading()
  87. }
  88. }).catch(res => {
  89. uni.showToast({
  90. title: res.data.message,
  91. icon: 'none',
  92. duration: 2000
  93. })
  94. uni.hideLoading()
  95. })
  96. },
  97. getIndexBuyData() {
  98. const that = this
  99. var pages = that.pages
  100. var limit = that.limit
  101. uni.showLoading({
  102. title:"正在加载"
  103. })
  104. this.warehouseInOutInfo.statusFlag = this.statusFlag
  105. //this.warehouseInOutInfo.status = this.status
  106. this.$api.doRequest('get', '/warehouseInOutInfo/selectInfo', this.warehouseInOutInfo).then(res => {
  107. console.log(res, "对象")
  108. if (res.data.code == 200) {
  109. let data = res.data.data.records
  110. //采购信息
  111. if (data.length > 0) {
  112. that.taskInfo = that.taskInfo.concat(data)
  113. that.isLoadMore = false
  114. } else {
  115. if (that.pages > 1) {
  116. that.pages -= 1
  117. }
  118. that.isLoadMore = true
  119. that.loadStatus = 'nomore'
  120. }
  121. uni.hideLoading()
  122. this.taskInfo = res.data.data.records
  123. } else {
  124. uni.showToast({
  125. title: res.data.message,
  126. icon: 'none',
  127. duration: 2000
  128. })
  129. }
  130. }).catch(res => {
  131. uni.showToast({
  132. title: res.data.message,
  133. icon: 'none',
  134. duration: 2000
  135. })
  136. })
  137. },
  138. tabcarchange(statusFlag) {
  139. this.statusFlag = statusFlag
  140. this.pageSize = 1
  141. this.getIndexBuyData()
  142. },
  143. navToDetailPage(item) {
  144. if(item.statusFlag == 3){
  145. uni.navigateTo({
  146. url: `/pageD/warehousings/warehousingDetails?id=${item.id}`
  147. })
  148. }else{
  149. uni.navigateTo({
  150. 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}`
  151. })
  152. }
  153. }
  154. }
  155. }
  156. </script>
  157. <style lang="scss" scoped>
  158. .tag {
  159. background:#F5F6F9;
  160. padding: 5px;
  161. color:#333333;
  162. display: inline-flex;
  163. font-size: 22rpx;
  164. border-radius: 3px;
  165. margin: 3px;
  166. }
  167. .introduce-section .title_b .title-tip{
  168. font-size: 13px;
  169. height:40px;
  170. line-height: 40px;
  171. flex: 2.5;
  172. }
  173. .introduce-section .title_b .title-tip-b{
  174. flex: 1;
  175. font-size: 13px;
  176. color: #878C9C;
  177. height:40px;
  178. line-height: 40px;
  179. }
  180. .introduce-section .title text{
  181. font-size: 17px;
  182. font-weight: bold;
  183. height:50px;
  184. line-height: 50px;
  185. flex: 2.5;
  186. border-bottom:1px solid #EEEEEE;
  187. }
  188. .introduce-section .title .title-tip{
  189. flex: 1;
  190. font-size: 15px;
  191. color: #FE6430;
  192. font-weight: 500;
  193. height:50px;
  194. line-height: 50px;
  195. border-bottom:1px solid #EEEEEE;
  196. }
  197. .introduce-section .title .title-tip-a{
  198. flex: 1;
  199. font-size: 15px;
  200. color: #AFB3BF;
  201. font-weight: 500;
  202. height:50px;
  203. line-height: 50px;
  204. border-bottom:1px solid #EEEEEE;
  205. }
  206. .introduce-section .guess-item{
  207. border-radius:4px;
  208. background: #fff;
  209. padding: 0upx 30upx 20upx;
  210. margin:10px;
  211. padding-bottom: 20upx;
  212. border-bottom: 1px solid #ccc;
  213. }
  214. .line{
  215. display:inline-block;
  216. padding:5px;
  217. position:relative;
  218. font-size:17px;
  219. }
  220. .line.active{
  221. font-size:19px;
  222. font-weight: 900;
  223. }
  224. .line.active:after{
  225. content:'';
  226. display:block;
  227. position:absolute;
  228. width:18px;
  229. left:50%;
  230. transform: translateX(-50%);
  231. bottom:0;
  232. border-bottom:1px solid #22C572;
  233. }
  234. </style>