index.vue 7.8 KB

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