index.vue 11 KB

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