index.vue 11 KB

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