index.vue 11 KB

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