index.vue 11 KB

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