index.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  1. <template>
  2. <!-- 出库明细页面 -->
  3. <view class="header">
  4. <view class="header-one">
  5. 库存总量:<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. <u-search class="inputbox" placeholder="请输入胎号或规格" @change="inputbox" v-model="keyword"
  11. :show-action="false"></u-search>
  12. </view>
  13. <view class="nothing" v-if="judge==true">
  14. <u-empty text="暂无数据"></u-empty>
  15. </view>
  16. <view style="width: 100%;margin-top: 160rpx;">
  17. <view class="block" v-for="(item, index) in itemList" :key="index">
  18. <view class="title">
  19. <view>|</view>
  20. <view>单号:{{item.scanNum}} </view>
  21. <view>{{item.scanTime.slice(0,10)}}</view>
  22. </view>
  23. <u-line color="#f4f4f4"></u-line>
  24. <view v-for="(item2,index) in item.tyreMsgVOList" :key="index">
  25. <u-collapse>
  26. <u-collapse-item style="margin-left: 10rpx;">
  27. <view class="u-flex u-row-between" style="width: 100%;" slot="title">
  28. <view>
  29. {{item2.tireModel}}
  30. </view>
  31. <view class="">
  32. {{item2.tyreCount}}条
  33. </view>
  34. </view>
  35. <view class="details" v-for="(item3,index) in item2.matnrMsgVOS" :key="index">
  36. <view>
  37. <view>物料描述</view>
  38. <view>{{item3.maktx}}</view>
  39. </view>
  40. <view>
  41. <view>轮胎胎号</view>
  42. <view>{{item3.tyreNum}}</view>
  43. </view>
  44. <view>
  45. <view>参加活动</view>
  46. <view>{{item3.satisfyActivity}}</view>
  47. </view>
  48. <view>
  49. <view>创建时间</view>
  50. <view>{{item3.createDate}}</view>
  51. </view>
  52. <u-line color="#f4f4f4"></u-line>
  53. </view>
  54. </u-collapse-item>
  55. </u-collapse>
  56. </view>
  57. </view>
  58. <view style="margin-top: 30rpx;margin-bottom: 30rpx;">
  59. <u-loadmore :status="status" :icon-type="iconType" :load-text="loadText" />
  60. </view>
  61. <u-action-sheet :list="list_a" @click="click" v-model="show" :mask-close-able="false" @close="close"></u-action-sheet>
  62. <u-calendar v-model="show_d" :mode="mode" @change="time" :mask-close-able="false"></u-calendar>
  63. </view>
  64. </view>
  65. </template>
  66. <script>
  67. import {
  68. request
  69. } from '../../../common/request/request'
  70. require("promise.prototype.finally").shim()
  71. export default {
  72. data() {
  73. return {
  74. status: 'loadmore',
  75. iconType: 'flower',
  76. show: false,
  77. judge: true,
  78. show_d: false,
  79. mode: 'range',
  80. loadText: {
  81. loadmore: '无数据',
  82. loading: '努力加载中',
  83. nomore: '我是有底线的'
  84. },
  85. list: [{
  86. name: '全部'
  87. }, {
  88. name: '品牌'
  89. }, {
  90. name: '时间'
  91. }],
  92. brandCode: null,
  93. list_a: [],
  94. current: 0,
  95. keyword: '',
  96. itemList: [],
  97. total: '',
  98. size: 10,
  99. page: 0,
  100. beginDate: null,
  101. endDate: null,
  102. content: null,
  103. length:''
  104. }
  105. },
  106. onReachBottom() {
  107. this.status = 'loading';
  108. this.page++
  109. if(this.itemList.length >= this.length){
  110. this.status = 'nomore';
  111. }else{
  112. this.getPage()
  113. }
  114. },
  115. created() {
  116. this.page = 1
  117. this.getPage()
  118. },
  119. methods: {
  120. content_s(){
  121. console.log(this.keyword)
  122. },
  123. inputbox(e){
  124. this.page = 1
  125. console.log(e)
  126. this.itemList = []
  127. this.brandCode = null
  128. this.beginDate = null
  129. this.endDate = null
  130. this.content = e
  131. if(this.itemList.length >= this.length){
  132. this.status = 'nomore';
  133. }else{
  134. this.getPage()
  135. }
  136. },
  137. close() {
  138. this.current = 0
  139. this.page = 1
  140. this.getPage()
  141. },
  142. time(e) {
  143. this.page = 1
  144. this.itemList = []
  145. this.beginDate = e.startDate + " 00:00:00",
  146. this.endDate = e.endDate + " 00:00:00",
  147. console.log(e);
  148. this.getPage()
  149. },
  150. click(index) {
  151. this.page = 1
  152. console.log(`点击了第${index + 1}项,内容为:${this.list_a[index].brandCode}`)
  153. this.brandCode = this.list_a[index].brandCode
  154. this.itemList = []
  155. this.judge = true
  156. console.log(this.judge)
  157. this.getPage()
  158. },
  159. change(index) {
  160. this.current = index;
  161. this.brandCode = null
  162. this.beginDate = null
  163. this.endDate = null
  164. this.content = null
  165. if (index == 1) {
  166. this.show = true
  167. if (this.list_a.length == 0) {
  168. request({
  169. url: '/baseReq/getBrandList',
  170. method: 'Post',
  171. data: {
  172. storeId:this.$store.state.storeInfo.storeId,
  173. userId:this.$store.state.storeInfo.userId
  174. }
  175. }).then(res => {
  176. console.log(res)
  177. console.log(res.data.data)
  178. for (let i = 0; i < res.data.data.length; i++) {
  179. console.log(res.data.data[i].brandCode)
  180. this.list_a.push({
  181. brandCode: res.data.data[i].brandCode,
  182. text: res.data.data[i].brandName,
  183. color: '#000',
  184. fontSize: 28
  185. })
  186. }
  187. }).catch(err => {
  188. console.log(err)
  189. }).finally(() => {
  190. // Loading.close()
  191. })
  192. }
  193. } else if (index == 0) {
  194. this.page = 0
  195. console.log(this.brandCode)
  196. this.getPage()
  197. } else if (index == 2) {
  198. this.show_d = true
  199. }
  200. console.log(this.current)
  201. },
  202. getPage() {
  203. console.log(this.page)
  204. console.log(this.brandCode)
  205. console.log(this.beginDate)
  206. console.log(this.endDate)
  207. console.log(this.content)
  208. uni.showLoading({
  209. title: '加载中...'
  210. });
  211. setTimeout(function() {
  212. uni.hideLoading();
  213. }, 1000);
  214. request({
  215. url: '/myPage/getPageScanRecordList',
  216. method: 'Post',
  217. data: {
  218. storeId:this.$store.state.storeInfo.storeId,
  219. userId:this.$store.state.storeInfo.userId,
  220. size: this.size,
  221. current: this.page, //获取第几页
  222. scanType: '2',
  223. brandCode: this.brandCode,
  224. beginDate: this.beginDate, //开始时间
  225. endDate: this.endDate, //结束时间
  226. content: this.content //搜索内容
  227. }
  228. }).then(res => {
  229. console.log(res)
  230. this.total = res.data.stock
  231. this.length = res.data.count
  232. this.itemList = this.itemList.concat(res.data.record)
  233. if (this.itemList.length >= res.data.count) this.status = 'nomore';
  234. else this.status = 'loading';
  235. if (this.itemList.length == 0) {
  236. this.judge = true
  237. } else {
  238. this.judge = false
  239. }
  240. console.log(this.itemList)
  241. return this.itemList
  242. }).catch(err => {
  243. console.log(err)
  244. }).finally(() => {
  245. // Loading.close()
  246. })
  247. }
  248. },
  249. }
  250. </script>
  251. <style lang="scss" scoped>
  252. .details>view {
  253. width: 96%;
  254. height: 54rpx;
  255. color: #303134;
  256. }
  257. .details>view>view:nth-child(1) {
  258. float: left;
  259. }
  260. .details>view>view:nth-child(2) {
  261. float: right;
  262. }
  263. .inputbox{
  264. width: 350rpx;
  265. float: right;
  266. padding-right: 30rpx;
  267. padding-top: 10rpx;
  268. }
  269. .title {
  270. width: 98%;
  271. height: 60rpx;
  272. margin: 0 auto;
  273. padding-top: 10rpx;
  274. // background-color: #55aa7f;
  275. }
  276. .title>view:nth-child(1) {
  277. font-size: 34rpx;
  278. font-weight: bold;
  279. color: #0094FE;
  280. float: left;
  281. }
  282. .title>view:nth-child(2) {
  283. font-size: 30rpx;
  284. font-weight: bold;
  285. color: #000000;
  286. float: left;
  287. position: relative;
  288. top: 10%;
  289. }
  290. .title>view:nth-child(3) {
  291. font-size: 30rpx;
  292. font-weight: 500;
  293. color: #000000;
  294. float: right;
  295. position: relative;
  296. top: 10%;
  297. }
  298. .block {
  299. width: 96%;
  300. background-color: #FFFFFF;
  301. margin: 0 auto;
  302. margin-top: 20rpx;
  303. border-radius: 15rpx;
  304. box-shadow: 0 0 24rpx 0 rgba(101, 176, 249, 0.41);
  305. }
  306. .nothing {
  307. width: 96%;
  308. height: 800rpx;
  309. background-color: #FFFFFF;
  310. margin: 0 auto;
  311. margin-top: 200rpx;
  312. border-radius: 20rpx;
  313. box-shadow: 0 0 24rpx 0 rgba(101, 176, 249, 0.41);
  314. }
  315. .header {
  316. height: 400rpx;
  317. width: 100%;
  318. background: #0094FE;
  319. color: #fff;
  320. font-size: 28rpx;
  321. }
  322. .header-one {
  323. text-align: center;
  324. padding-top: 40rpx;
  325. }
  326. .header-one>text {
  327. font-size: 52rpx;
  328. }
  329. </style>