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