index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451
  1. <template>
  2. <!-- 入库明细页面 -->
  3. <view class="header">
  4. <view class="header-one">
  5. {{$t('scancodeenter.total')}}:<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)">{{$t('scancodeenter.tabs_a')}}</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">{{$t('scancodeenter.tabs_b')}}</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">{{$t('scancodeenter.tabs_c')}}</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="$t('scancodeenter.tips')" @change="inputbox" v-model="keyword" :show-action="false"></u-search>
  28. </view>
  29. <view class="nothing" v-if="judge==true">
  30. <u-empty :text="$t('scancodeenter.nodata')"></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>{{$t('scancodeenter.number')}}:{{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}}{{$t('scancodeenter.strip')}}
  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>{{$t('scancodeenter.describe')}}</view>
  54. <view>{{item3.maktx}}</view>
  55. </view>
  56. <view class="u-font-25">
  57. <view>{{$t('scancodeenter.number_d')}}</view>
  58. <view>{{item3.tyreNum}}</view>
  59. </view>
  60. <view class="u-font-25">
  61. <view>{{$t('scancodeenter.activity')}}</view>
  62. <view v-if="item3.satisfyActivity == 1">{{$t('scancodeenter.participation')}}</view>
  63. <view v-else>{{$t('scancodeenter.noparticipation')}}</view>
  64. </view>
  65. <view class="u-font-25">
  66. <view>{{$t('scancodeenter.creationtime')}}</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"
  80. :start-text="$t('scancodeenter.start')" :end-text="$t('scancodeenter.end')"></u-calendar>
  81. </view>
  82. </view>
  83. </template>
  84. <script>
  85. import {
  86. request
  87. } from '../../../common/request/request'
  88. require("promise.prototype.finally").shim()
  89. export default {
  90. data() {
  91. return {
  92. status: 'loadmore',
  93. iconType: 'flower',
  94. show: false,
  95. judge: true,
  96. show_d: false,
  97. mode: 'range',
  98. loadText: {
  99. loadmore: this.$t('scancodeenter.loadmore'),
  100. loading: this.$t('scancodeenter.loading'),
  101. nomore: this.$t('scancodeenter.nomore')
  102. },
  103. style: '.5rpx solid #FFFFFF',
  104. brandCode: null,
  105. list_a: [],
  106. current: 0,
  107. keyword: '',
  108. bottoma: true,
  109. bottomb: false,
  110. bottomc: false,
  111. itemList: [],
  112. total: '',
  113. size: 10,
  114. page: 0,
  115. beginDate: null,
  116. endDate: null,
  117. content: null,
  118. length: ''
  119. }
  120. },
  121. onReachBottom() {
  122. this.status = 'loading';
  123. this.page++
  124. if (this.itemList.length >= this.length) {
  125. this.status = 'nomore';
  126. } else {
  127. this.getPage()
  128. }
  129. },
  130. created() {
  131. this.page = 1
  132. this.whole()
  133. },
  134. onBackPress(options) {
  135. //
  136. if (options.from == 'backbutton') {
  137. this.$u.route({
  138. type: 'switchTab',
  139. url: 'pages/me/index'
  140. })
  141. }
  142. return true;
  143. },
  144. methods: {
  145. content_s() {
  146. //
  147. },
  148. inputbox(e) {
  149. this.page = 1
  150. this.bottoma = true
  151. this.bottomb = false
  152. this.bottomc = false
  153. this.itemList = []
  154. this.brandCode = null
  155. this.beginDate = null
  156. this.endDate = null
  157. this.beginDate = null
  158. this.content = e
  159. if (this.itemList.length >= this.length) {
  160. this.status = 'nomore';
  161. this.getPage()
  162. } else {
  163. //
  164. this.getPage()
  165. }
  166. },
  167. close() {
  168. this.whole()
  169. },
  170. time(e) {
  171. this.page = 1
  172. this.itemList = []
  173. this.beginDate = e.startDate + " 00:00:00"
  174. this.endDate = e.endDate + " 23:59:59"
  175. //
  176. //
  177. //
  178. this.current = 0
  179. this.getPage()
  180. },
  181. click(index) {
  182. this.page = 1
  183. //
  184. this.brandCode = this.list_a[index].brandCode
  185. this.itemList = []
  186. this.judge = true
  187. //
  188. this.getPage()
  189. },
  190. whole() {
  191. this.itemList = []
  192. this.judge = true
  193. this.bottoma = true
  194. this.bottomb = false
  195. this.bottomc = false
  196. this.brandCode = null
  197. this.beginDate = null
  198. this.endDate = null
  199. this.content = null
  200. this.page = 1
  201. //
  202. this.getPage()
  203. },
  204. brand() {
  205. this.bottoma = false
  206. this.bottomb = true
  207. this.bottomc = false
  208. this.brandCode = null
  209. this.beginDate = null
  210. this.endDate = null
  211. this.content = null
  212. this.show = true
  213. if (this.list_a.length == 0) {
  214. request({
  215. url: '/baseReq/getBrandListByStoreId',
  216. method: 'Post',
  217. data: {
  218. storeId: this.$store.state.storeInfo.storeId,
  219. userId: this.$store.state.storeInfo.userId
  220. }
  221. }).then(res => {
  222. //
  223. //
  224. for (let i = 0; i < res.data.data.length; i++) {
  225. //
  226. this.list_a.push({
  227. brandCode: res.data.data[i].brandCode,
  228. text: res.data.data[i].brandName,
  229. color: '#000',
  230. fontSize: 28
  231. })
  232. }
  233. }).catch(err => {
  234. uni.showToast({
  235. icon: 'none',
  236. title: this.$t('scancodeenter.networkstate'),
  237. position: "bottom"
  238. })
  239. }).finally(() => {
  240. // Loading.close()
  241. })
  242. }
  243. },
  244. time_s() {
  245. this.bottoma = false
  246. this.bottomb = false
  247. this.bottomc = true
  248. this.brandCode = null
  249. this.beginDate = null
  250. this.endDate = null
  251. this.content = null
  252. this.show_d = true
  253. },
  254. // change(index) {
  255. // this.current = index;
  256. // this.brandCode = null
  257. // this.beginDate = null
  258. // this.endDate = null
  259. // this.content = null
  260. // if (index == 1) {
  261. // this.show = true
  262. // if (this.list_a.length == 0) {
  263. // request({
  264. // url: '/baseReq/getBrandList',
  265. // method: 'Post',
  266. // data: {
  267. // storeId:this.$store.state.storeInfo.storeId,
  268. // userId:this.$store.state.storeInfo.userId
  269. // }
  270. // }).then(res => {
  271. //
  272. //
  273. // for (let i = 0; i < res.data.data.length; i++) {
  274. //
  275. // this.list_a.push({
  276. // brandCode: res.data.data[i].brandCode,
  277. // text: res.data.data[i].brandName,
  278. // color: '#000',
  279. // fontSize: 28
  280. // })
  281. // }
  282. // }).catch(err => {
  283. //
  284. // }).finally(() => {
  285. // // Loading.close()
  286. // })
  287. // }
  288. // } else if (index == 0) {
  289. // this.page = 0
  290. //
  291. // this.getPage()
  292. // } else if (index == 2) {
  293. // this.show_d = true
  294. // }
  295. //
  296. // },
  297. getPage() {
  298. //
  299. //
  300. //
  301. //
  302. //
  303. uni.showLoading({
  304. title: this.$t('scancodeenter.Loading')
  305. });
  306. setTimeout(function() {
  307. uni.hideLoading();
  308. }, 1000);
  309. request({
  310. url: '/myPage/getPageScanRecordList',
  311. method: 'Post',
  312. data: {
  313. storeId: this.$store.state.storeInfo.storeId,
  314. userId: this.$store.state.storeInfo.userId,
  315. size: this.size,
  316. current: this.page, //获取第几页
  317. scanType: '1',
  318. brandCode: this.brandCode,
  319. beginDate: this.beginDate, //开始时间
  320. endDate: this.endDate, //结束时间
  321. content: this.content //搜索内容
  322. }
  323. }).then(res => {
  324. //
  325. if (res.data.code == 500) {
  326. uni.showToast({
  327. icon: 'none',
  328. title: res.data.msg,
  329. position: "bottom"
  330. })
  331. } else {
  332. this.total = res.data.stock
  333. this.length = res.data.count
  334. this.itemList = this.itemList.concat(res.data.record)
  335. if (this.itemList.length >= res.data.count) this.status = 'nomore';
  336. else this.status = 'loading';
  337. if (this.itemList.length == 0) {
  338. this.judge = true
  339. } else {
  340. this.judge = false
  341. }
  342. //
  343. return this.itemList
  344. }
  345. }).catch(err => {
  346. //
  347. uni.showToast({
  348. icon: 'none',
  349. title: this.$t('scancodeenter.networkstate'),
  350. position: "bottom"
  351. })
  352. }).finally(() => {
  353. // Loading.close()
  354. })
  355. }
  356. },
  357. }
  358. </script>
  359. <style lang="scss" scoped>
  360. .details>view {
  361. width: 96%;
  362. height: 54rpx;
  363. color: #303134;
  364. }
  365. .details>view>view:nth-child(1) {
  366. float: left;
  367. }
  368. .details>view>view:nth-child(2) {
  369. float: right;
  370. }
  371. .inputbox {
  372. width: 350rpx;
  373. float: right;
  374. padding-right: 30rpx;
  375. padding-top: 10rpx;
  376. }
  377. .title {
  378. width: 98%;
  379. height: 60rpx;
  380. margin: 0 auto;
  381. padding-top: 10rpx;
  382. // background-color: #55aa7f;
  383. }
  384. .title>view:nth-child(1) {
  385. font-size: 34rpx;
  386. font-weight: bold;
  387. color: #0094FE;
  388. float: left;
  389. }
  390. .title>view:nth-child(2) {
  391. font-size: 30rpx;
  392. font-weight: bold;
  393. color: #000000;
  394. float: left;
  395. position: relative;
  396. top: 10%;
  397. }
  398. .title>view:nth-child(3) {
  399. font-size: 30rpx;
  400. font-weight: 500;
  401. color: #000000;
  402. float: right;
  403. position: relative;
  404. top: 10%;
  405. }
  406. .block {
  407. width: 96%;
  408. background-color: #FFFFFF;
  409. margin: 0 auto;
  410. margin-top: 20rpx;
  411. border-radius: 15rpx;
  412. box-shadow: 0 0 24rpx 0 rgba(101, 176, 249, 0.41);
  413. }
  414. .nothing {
  415. width: 96%;
  416. height: 800rpx;
  417. background-color: #FFFFFF;
  418. margin: 0 auto;
  419. margin-top: 200rpx;
  420. border-radius: 20rpx;
  421. box-shadow: 0 0 24rpx 0 rgba(101, 176, 249, 0.41);
  422. }
  423. .header {
  424. height: 400rpx;
  425. width: 100%;
  426. background: #0094FE;
  427. color: #fff;
  428. font-size: 28rpx;
  429. }
  430. .header-one {
  431. text-align: center;
  432. padding-top: 40rpx;
  433. }
  434. .header-one>text {
  435. font-size: 52rpx;
  436. }
  437. </style>