index.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  1. <template>
  2. <!-- 入库明细页面 -->
  3. <view class="header">
  4. <view class="header-one">
  5. 库存总量:<text>{{total}}</text>
  6. </view>
  7. <view style="width: 100%;margin-top: 60rpx;">
  8. <u-tabs style="width: 350rpx;float: left;margin-top: 0;" :list="list" :is-scroll="false" :current="current" @change="change"
  9. active-color="#fff" inactive-color="#ffffff" bg-color="#ffffff00"></u-tabs>
  10. <u-search class="inputbox" placeholder="请输入胎号或规格" @change="inputbox" v-model="keyword"
  11. :show-action="false"></u-search>
  12. </view>
  13. <view class="nothing" v-if="judge==true">
  14. <u-empty text="暂无数据"></u-empty>
  15. </view>
  16. <view style="width: 100%;margin-top: 160rpx;">
  17. <view class="block" v-for="(item, index) in itemList" :key="index">
  18. <view class="title">
  19. <view>|</view>
  20. <view>单号:{{item.scanNum}} </view>
  21. <view>{{item.scanTime.slice(0,10)}}</view>
  22. </view>
  23. <u-line color="#f4f4f4"></u-line>
  24. <view v-for="item2 in item.tyreMsgVOList">
  25. <u-collapse>
  26. <u-collapse-item style="margin-left: 10rpx;">
  27. <view class="u-flex u-row-between" style="width: 100%;" slot="title">
  28. <view>
  29. {{item2.tireModel}}
  30. </view>
  31. <view class="">
  32. {{item2.tyreCount}}条
  33. </view>
  34. </view>
  35. <view class="details" v-for="item3 in item2.matnrMsgVOS">
  36. <view>
  37. <view>物料描述</view>
  38. <view>{{item3.maktx}}</view>
  39. </view>
  40. <view>
  41. <view>轮胎胎号</view>
  42. <view>{{item3.tyreNum}}</view>
  43. </view>
  44. <view>
  45. <view>参加活动</view>
  46. <view>{{item3.satisfyActivity}}</view>
  47. </view>
  48. <view>
  49. <view>创建时间</view>
  50. <view>{{item3.createDate}}</view>
  51. </view>
  52. <u-line color="#f4f4f4"></u-line>
  53. </view>
  54. </u-collapse-item>
  55. </u-collapse>
  56. </view>
  57. </view>
  58. <view style="margin-top: 30rpx;margin-bottom: 30rpx;">
  59. <u-loadmore :status="status" :icon-type="iconType" :load-text="loadText" />
  60. </view>
  61. <u-action-sheet :list="list_a" @click="click" v-model="show" :mask-close-able="false" @close="close"></u-action-sheet>
  62. <u-calendar v-model="show_d" toolTip="请选择日期范围" :closeable="false" :mode="mode" @change="time" :mask-close-able="false"></u-calendar>
  63. </view>
  64. </view>
  65. </template>
  66. <script>
  67. import {
  68. request
  69. } from '../../../common/request/request'
  70. require("promise.prototype.finally").shim()
  71. export default {
  72. data() {
  73. return {
  74. status: 'loadmore',
  75. iconType: 'flower',
  76. show: false,
  77. judge: true,
  78. show_d: false,
  79. mode: 'range',
  80. loadText: {
  81. loadmore: '无数据',
  82. loading: '努力加载中',
  83. nomore: '我是有底线的'
  84. },
  85. list: [{
  86. name: '全部'
  87. }, {
  88. name: '品牌'
  89. }, {
  90. name: '时间'
  91. }],
  92. brandCode: null,
  93. list_a: [],
  94. current: 0,
  95. keyword: '',
  96. itemList: [],
  97. total: '',
  98. size: 10,
  99. page: 0,
  100. beginDate: null,
  101. endDate: null,
  102. content: null,
  103. length:''
  104. }
  105. },
  106. onReachBottom() {
  107. this.status = 'loading';
  108. this.page++
  109. if(this.itemList.length >= this.length){
  110. this.status = 'nomore';
  111. }else{
  112. this.getPage()
  113. }
  114. },
  115. created() {
  116. this.page = 1
  117. this.getPage()
  118. },
  119. methods: {
  120. content_s(){
  121. console.log(this.keyword)
  122. },
  123. inputbox(e){
  124. this.page = 1
  125. console.log(e)
  126. this.itemList = []
  127. this.brandCode = null
  128. this.beginDate = null
  129. this.endDate = null
  130. this.content = e
  131. if(this.itemList.length >= this.length){
  132. this.status = 'nomore';
  133. }else{
  134. this.getPage()
  135. }
  136. },
  137. close() {
  138. this.current = 0
  139. this.page = 1
  140. this.getPage()
  141. },
  142. time(e) {
  143. this.page = 1
  144. this.itemList = []
  145. this.beginDate = e.startDate + " 00:00:00"
  146. this.endDate = e.endDate + " 00:00:00"
  147. console.log(e)
  148. console.log("触发了")
  149. console.log(this.show_d)
  150. this.current = 0
  151. this.getPage()
  152. },
  153. click(index) {
  154. this.page = 1
  155. console.log(`点击了第${index + 1}项,内容为:${this.list_a[index].brandCode}`)
  156. this.brandCode = this.list_a[index].brandCode
  157. this.itemList = []
  158. this.judge = true
  159. console.log(this.judge)
  160. this.getPage()
  161. },
  162. change(index) {
  163. this.current = index;
  164. this.brandCode = null
  165. this.beginDate = null
  166. this.endDate = null
  167. this.content = null
  168. if (index == 1) {
  169. this.show = true
  170. if (this.list_a.length == 0) {
  171. request({
  172. url: '/baseReq/getBrandList',
  173. method: 'Post',
  174. data: {
  175. storeId: '1000',
  176. userId: '123'
  177. }
  178. }).then(res => {
  179. console.log(res)
  180. console.log(res.data.data)
  181. for (let i = 0; i < res.data.data.length; i++) {
  182. console.log(res.data.data[i].brandCode)
  183. this.list_a.push({
  184. brandCode: res.data.data[i].brandCode,
  185. text: res.data.data[i].brandName,
  186. color: '#000',
  187. fontSize: 28
  188. })
  189. }
  190. }).catch(err => {
  191. console.log(err)
  192. }).finally(() => {
  193. // Loading.close()
  194. })
  195. }
  196. } else if (index == 0) {
  197. this.page = 0
  198. console.log(this.brandCode)
  199. this.getPage()
  200. } else if (index == 2) {
  201. this.show_d = true
  202. }
  203. console.log(this.current)
  204. },
  205. getPage() {
  206. console.log(this.page)
  207. console.log(this.brandCode)
  208. console.log(this.beginDate)
  209. console.log(this.endDate)
  210. console.log(this.content)
  211. uni.showLoading({
  212. title: '加载中...'
  213. });
  214. setTimeout(function() {
  215. uni.hideLoading();
  216. }, 1000);
  217. request({
  218. url: '/myPage/getPageScanRecordList',
  219. method: 'Post',
  220. data: {
  221. storeId: '1000',
  222. userId: '123',
  223. size: this.size,
  224. current: this.page, //获取第几页
  225. scanType: '1',
  226. brandCode: this.brandCode,
  227. beginDate: this.beginDate, //开始时间
  228. endDate: this.endDate, //结束时间
  229. content: this.content //搜索内容
  230. }
  231. }).then(res => {
  232. console.log(res)
  233. this.total = res.data.stock
  234. this.length = res.data.count
  235. this.itemList = this.itemList.concat(res.data.record)
  236. if (this.itemList.length >= res.data.count) this.status = 'nomore';
  237. else this.status = 'loading';
  238. if (this.itemList.length == 0) {
  239. this.judge = true
  240. } else {
  241. this.judge = false
  242. }
  243. console.log(this.itemList)
  244. return this.itemList
  245. }).catch(err => {
  246. console.log(err)
  247. }).finally(() => {
  248. // Loading.close()
  249. })
  250. }
  251. },
  252. }
  253. </script>
  254. <style lang="scss" scoped>
  255. .details>view {
  256. width: 96%;
  257. height: 54rpx;
  258. color: #303134;
  259. }
  260. .details>view>view:nth-child(1) {
  261. float: left;
  262. }
  263. .details>view>view:nth-child(2) {
  264. float: right;
  265. }
  266. .inputbox{
  267. width: 350rpx;
  268. float: right;
  269. padding-right: 30rpx;
  270. padding-top: 10rpx;
  271. }
  272. .title {
  273. width: 98%;
  274. height: 60rpx;
  275. margin: 0 auto;
  276. padding-top: 10rpx;
  277. // background-color: #55aa7f;
  278. }
  279. .title>view:nth-child(1) {
  280. font-size: 34rpx;
  281. font-weight: bold;
  282. color: #0094FE;
  283. float: left;
  284. }
  285. .title>view:nth-child(2) {
  286. font-size: 30rpx;
  287. font-weight: bold;
  288. color: #000000;
  289. float: left;
  290. position: relative;
  291. top: 10%;
  292. }
  293. .title>view:nth-child(3) {
  294. font-size: 30rpx;
  295. font-weight: 500;
  296. color: #000000;
  297. float: right;
  298. position: relative;
  299. top: 10%;
  300. }
  301. .block {
  302. width: 96%;
  303. background-color: #FFFFFF;
  304. margin: 0 auto;
  305. margin-top: 20rpx;
  306. border-radius: 15rpx;
  307. box-shadow: 0 0 24rpx 0 rgba(101, 176, 249, 0.41);
  308. }
  309. .nothing {
  310. width: 96%;
  311. height: 800rpx;
  312. background-color: #FFFFFF;
  313. margin: 0 auto;
  314. margin-top: 200rpx;
  315. border-radius: 20rpx;
  316. box-shadow: 0 0 24rpx 0 rgba(101, 176, 249, 0.41);
  317. }
  318. .header {
  319. height: 400rpx;
  320. width: 100%;
  321. background: #0094FE;
  322. color: #fff;
  323. font-size: 28rpx;
  324. }
  325. .header-one {
  326. text-align: center;
  327. padding-top: 40rpx;
  328. }
  329. .header-one>text {
  330. font-size: 52rpx;
  331. }
  332. </style>