index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455
  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 @tap="$u.throttle(whole, 500)">全部</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 u-font-28" 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 class="u-font-25">
  53. <view>物料描述</view>
  54. <view>{{item3.maktx}}</view>
  55. </view>
  56. <view class="u-font-25">
  57. <view>轮胎胎号</view>
  58. <view>{{item3.tyreNum}}</view>
  59. </view>
  60. <view class="u-font-25">
  61. <view>参加活动</view>
  62. <view v-if="item3.satisfyActivity == 1">参加</view>
  63. <view v-else>不参加</view>
  64. </view>
  65. <view class="u-font-25">
  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="$t('scancodeenter.daterange')" :mode="mode" @change="time" :mask-close-able="false" start-text="开始" end-text="结束"></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. onBackPress(options) {
  141. //
  142. if (options.from == 'backbutton') {
  143. this.$u.route({
  144. type: 'switchTab',
  145. url: 'pages/me/index'
  146. })
  147. }
  148. return true;
  149. },
  150. methods: {
  151. content_s() {
  152. //
  153. },
  154. inputbox(e) {
  155. this.page = 1
  156. //
  157. //
  158. this.itemList = []
  159. this.brandCode = null
  160. this.beginDate = null
  161. this.endDate = null
  162. this.content = e
  163. if (this.itemList.length >= this.length) {
  164. this.status = 'nomore';
  165. this.getPage()
  166. } else {
  167. //
  168. this.getPage()
  169. }
  170. },
  171. close() {
  172. this.whole()
  173. },
  174. time(e) {
  175. this.page = 1
  176. this.itemList = []
  177. this.beginDate = e.startDate + " 00:00:00"
  178. this.endDate = e.endDate + " 23:59:59"
  179. //
  180. //
  181. //
  182. this.current = 0
  183. this.getPage()
  184. },
  185. click(index) {
  186. this.page = 1
  187. //
  188. this.brandCode = this.list_a[index].brandCode
  189. this.itemList = []
  190. this.judge = true
  191. //
  192. this.getPage()
  193. },
  194. whole() {
  195. this.itemList = []
  196. this.judge = true
  197. this.bottoma = true
  198. this.bottomb = false
  199. this.bottomc = false
  200. this.brandCode = null
  201. this.beginDate = null
  202. this.endDate = null
  203. this.content = null
  204. this.page = 1
  205. //
  206. this.getPage()
  207. },
  208. brand() {
  209. this.bottoma = false
  210. this.bottomb = true
  211. this.bottomc = false
  212. this.brandCode = null
  213. this.beginDate = null
  214. this.endDate = null
  215. this.content = null
  216. this.show = true
  217. if (this.list_a.length == 0) {
  218. request({
  219. url: '/baseReq/getBrandListByStoreId',
  220. method: 'Post',
  221. data: {
  222. storeId: this.$store.state.storeInfo.storeId,
  223. userId: this.$store.state.storeInfo.userId
  224. }
  225. }).then(res => {
  226. //
  227. //
  228. for (let i = 0; i < res.data.data.length; i++) {
  229. //
  230. this.list_a.push({
  231. brandCode: res.data.data[i].brandCode,
  232. text: res.data.data[i].brandName,
  233. color: '#000',
  234. fontSize: 28
  235. })
  236. }
  237. }).catch(err => {
  238. uni.showToast({
  239. icon: 'none',
  240. title: '网络繁忙,请稍后再试~',
  241. position: "bottom"
  242. })
  243. }).finally(() => {
  244. // Loading.close()
  245. })
  246. }
  247. },
  248. time_s() {
  249. this.bottoma = false
  250. this.bottomb = false
  251. this.bottomc = true
  252. this.brandCode = null
  253. this.beginDate = null
  254. this.endDate = null
  255. this.content = null
  256. this.show_d = true
  257. },
  258. // change(index) {
  259. // this.current = index;
  260. // this.brandCode = null
  261. // this.beginDate = null
  262. // this.endDate = null
  263. // this.content = null
  264. // if (index == 1) {
  265. // this.show = true
  266. // if (this.list_a.length == 0) {
  267. // request({
  268. // url: '/baseReq/getBrandList',
  269. // method: 'Post',
  270. // data: {
  271. // storeId:this.$store.state.storeInfo.storeId,
  272. // userId:this.$store.state.storeInfo.userId
  273. // }
  274. // }).then(res => {
  275. //
  276. //
  277. // for (let i = 0; i < res.data.data.length; i++) {
  278. //
  279. // this.list_a.push({
  280. // brandCode: res.data.data[i].brandCode,
  281. // text: res.data.data[i].brandName,
  282. // color: '#000',
  283. // fontSize: 28
  284. // })
  285. // }
  286. // }).catch(err => {
  287. //
  288. // }).finally(() => {
  289. // // Loading.close()
  290. // })
  291. // }
  292. // } else if (index == 0) {
  293. // this.page = 0
  294. //
  295. // this.getPage()
  296. // } else if (index == 2) {
  297. // this.show_d = true
  298. // }
  299. //
  300. // },
  301. getPage() {
  302. //
  303. //
  304. //
  305. //
  306. //
  307. uni.showLoading({
  308. title: '加载中...'
  309. });
  310. setTimeout(function() {
  311. uni.hideLoading();
  312. }, 1000);
  313. request({
  314. url: '/myPage/getPageScanRecordList',
  315. method: 'Post',
  316. data: {
  317. storeId: this.$store.state.storeInfo.storeId,
  318. userId: this.$store.state.storeInfo.userId,
  319. size: this.size,
  320. current: this.page, //获取第几页
  321. scanType: '1',
  322. brandCode: this.brandCode,
  323. beginDate: this.beginDate, //开始时间
  324. endDate: this.endDate, //结束时间
  325. content: this.content //搜索内容
  326. }
  327. }).then(res => {
  328. //
  329. if(res.data.code == 500){
  330. uni.showToast({
  331. icon: 'none',
  332. title: res.data.msg,
  333. position: "bottom"
  334. })
  335. }else{
  336. this.total = res.data.stock
  337. this.length = res.data.count
  338. this.itemList = this.itemList.concat(res.data.record)
  339. if (this.itemList.length >= res.data.count) this.status = 'nomore';
  340. else this.status = 'loading';
  341. if (this.itemList.length == 0) {
  342. this.judge = true
  343. } else {
  344. this.judge = false
  345. }
  346. //
  347. return this.itemList
  348. }
  349. }).catch(err => {
  350. //
  351. uni.showToast({
  352. icon: 'none',
  353. title: '网络繁忙,请稍后再试~',
  354. position: "bottom"
  355. })
  356. }).finally(() => {
  357. // Loading.close()
  358. })
  359. }
  360. },
  361. }
  362. </script>
  363. <style lang="scss" scoped>
  364. .details>view {
  365. width: 96%;
  366. height: 54rpx;
  367. color: #303134;
  368. }
  369. .details>view>view:nth-child(1) {
  370. float: left;
  371. }
  372. .details>view>view:nth-child(2) {
  373. float: right;
  374. }
  375. .inputbox {
  376. width: 350rpx;
  377. float: right;
  378. padding-right: 30rpx;
  379. padding-top: 10rpx;
  380. }
  381. .title {
  382. width: 98%;
  383. height: 60rpx;
  384. margin: 0 auto;
  385. padding-top: 10rpx;
  386. // background-color: #55aa7f;
  387. }
  388. .title>view:nth-child(1) {
  389. font-size: 34rpx;
  390. font-weight: bold;
  391. color: #0094FE;
  392. float: left;
  393. }
  394. .title>view:nth-child(2) {
  395. font-size: 30rpx;
  396. font-weight: bold;
  397. color: #000000;
  398. float: left;
  399. position: relative;
  400. top: 10%;
  401. }
  402. .title>view:nth-child(3) {
  403. font-size: 30rpx;
  404. font-weight: 500;
  405. color: #000000;
  406. float: right;
  407. position: relative;
  408. top: 10%;
  409. }
  410. .block {
  411. width: 96%;
  412. background-color: #FFFFFF;
  413. margin: 0 auto;
  414. margin-top: 20rpx;
  415. border-radius: 15rpx;
  416. box-shadow: 0 0 24rpx 0 rgba(101, 176, 249, 0.41);
  417. }
  418. .nothing {
  419. width: 96%;
  420. height: 800rpx;
  421. background-color: #FFFFFF;
  422. margin: 0 auto;
  423. margin-top: 200rpx;
  424. border-radius: 20rpx;
  425. box-shadow: 0 0 24rpx 0 rgba(101, 176, 249, 0.41);
  426. }
  427. .header {
  428. height: 400rpx;
  429. width: 100%;
  430. background: #0094FE;
  431. color: #fff;
  432. font-size: 28rpx;
  433. }
  434. .header-one {
  435. text-align: center;
  436. padding-top: 40rpx;
  437. }
  438. .header-one>text {
  439. font-size: 52rpx;
  440. }
  441. </style>