index.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383
  1. <template>
  2. <view class="mainBox">
  3. <uni-nav-bar
  4. fixed="true"
  5. statusBar="true"
  6. left-icon="back"
  7. title="出库管理"
  8. @clickLeft="back"
  9. >
  10. </uni-nav-bar>
  11. <view class="tab-wrapper">
  12. <tabs @change="handleTabChange" @handleSearch="handleTabSearch" />
  13. </view>
  14. <view class="tab-title__placeholder"></view>
  15. <CardList :list="tableList" />
  16. <CommonFooter leftText="新建出库" @leftClick="addStock('hand')" />
  17. <!-- 搜索组件 -->
  18. <u-popup :show="searchVisible" mode="right" @close="searchVisible = false">
  19. <view class="search-container">
  20. <view class="title">筛选</view>
  21. <uni-forms
  22. ref="customForm"
  23. :modelValue="popupInfo"
  24. label-position="top"
  25. >
  26. <uni-forms-item label="出库时间" name="name">
  27. <view class="time-wrapper">
  28. <uni-datetime-picker
  29. v-model="popupInfo.range"
  30. :border="false"
  31. :icon="false"
  32. type="daterange"
  33. />
  34. </view>
  35. </uni-forms-item>
  36. <uni-forms-item label="单号" name="bizNum">
  37. <uni-easyinput
  38. v-model="popupInfo.bizNum"
  39. :inputBorder="false"
  40. placeholder="请输入"
  41. />
  42. </uni-forms-item>
  43. <uni-forms-item label="领料人" name="deliveryName">
  44. <uni-easyinput
  45. v-model="popupInfo.deliveryName"
  46. :inputBorder="false"
  47. placeholder="请输入"
  48. />
  49. </uni-forms-item>
  50. </uni-forms>
  51. <view class="footer">
  52. <view class="btn reset" @click="handleReset"> 重置 </view>
  53. <view class="btn search" @click="handleSearch"> 搜索 </view>
  54. </view>
  55. </view>
  56. </u-popup>
  57. </view>
  58. </template>
  59. <script>
  60. import { post, get } from '@/utils/api.js'
  61. import tabs from '../components/tabs.vue'
  62. import CardList from './components/CardList'
  63. import CommonFooter from '.././components/CommonFooter.vue'
  64. let [page, size, isEnd] = [1, 10, true]
  65. export default {
  66. components: {
  67. CommonFooter,
  68. CardList,
  69. tabs
  70. },
  71. data () {
  72. return {
  73. status: '',
  74. pickTabIndex: 0,
  75. searchVisible: false, //右侧筛选
  76. tableList: [],
  77. popupInfo: {
  78. range: [],
  79. bizNum: '',
  80. deliveryName: ''
  81. } //筛选数据
  82. }
  83. },
  84. onShow () {
  85. this.getFirstList()
  86. },
  87. //触底加载
  88. onReachBottom: function () {
  89. if (isEnd) {
  90. uni.showToast({
  91. title: '已经没有更多数据了!',
  92. icon: 'none',
  93. duration: 1000 //提示时间
  94. })
  95. return
  96. }
  97. // 显示加载图标
  98. uni.showLoading({
  99. title: '数据加载中'
  100. })
  101. this.getMoreLists()
  102. },
  103. methods: {
  104. handleReset () {
  105. this.popupInfo = {
  106. range: [],
  107. bizNum: '',
  108. deliveryName: ''
  109. }
  110. this.getFirstList()
  111. },
  112. handleSearch () {
  113. this.getFirstList()
  114. },
  115. getFirstList () {
  116. page = 1
  117. isEnd = true
  118. this.searchVisible = false
  119. this.tableList = []
  120. uni.showLoading({
  121. title: '数据加载中'
  122. })
  123. this.getList()
  124. },
  125. getMoreLists () {
  126. //获取更多数据
  127. page++
  128. this.getList()
  129. },
  130. //获取列表信息
  131. getList () {
  132. uni.showLoading({
  133. title: '加载中'
  134. })
  135. let data = {
  136. page,
  137. size,
  138. bizStatus: 2,
  139. auditStatus: this.status.value,
  140. ...this.popupInfo
  141. }
  142. if (data.range?.length) {
  143. data.startTime = data.range[0]
  144. data.endTime = data.range[1]
  145. }
  146. delete data.range
  147. get(this.apiUrl + '/outInWarehouse/select/inWarehouse', data, true)
  148. .then(res => {
  149. if (this.status.value === data.auditStatus) {
  150. if (page === 1) {
  151. this.tableList = res.data.records
  152. } else {
  153. this.tableList.push(...res.data.records)
  154. }
  155. isEnd = this.tableList.length >= res.data.total
  156. }
  157. })
  158. .then(() => {
  159. uni.hideLoading()
  160. })
  161. },
  162. //切换tab
  163. handleTabChange (status) {
  164. this.status = status
  165. uni.pageScrollTo({ scrollTop: 0, duration: 0 })
  166. this.getFirstList()
  167. },
  168. //筛选
  169. handleTabSearch () {
  170. this.searchVisible = true
  171. // this.getFirstList()
  172. },
  173. //新增入库单
  174. addStock () {
  175. uni.navigateTo({
  176. url: '/pages/warehouse/outHouse/addStock'
  177. })
  178. },
  179. //查看详情
  180. viewDetails (id, code) {
  181. uni.navigateTo({
  182. url: '/pages/warehouse/outHouse/details?id=' + id + '&code=' + code
  183. })
  184. }
  185. }
  186. }
  187. </script>
  188. <style lang="scss" scoped>
  189. .search-container {
  190. width: 70vw;
  191. padding: 30rpx 36rpx;
  192. .footer {
  193. position: absolute;
  194. bottom: 0;
  195. left: 0;
  196. width: 100%;
  197. display: flex;
  198. box-shadow: 0 10rpx 30rpx 0 #000;
  199. .btn {
  200. width: 50%;
  201. height: 80rpx;
  202. border-radius: 0 !important;
  203. flex: 1;
  204. display: flex;
  205. justify-content: center;
  206. align-items: center;
  207. &.reset {
  208. color: $j-primary-border-green;
  209. }
  210. &.search {
  211. color: #fff;
  212. background-color: $j-primary-border-green;
  213. }
  214. }
  215. }
  216. .title {
  217. font-weight: bold;
  218. font-size: 30rpx;
  219. }
  220. .status-wrapper {
  221. display: flex;
  222. align-items: center;
  223. justify-content: space-between;
  224. view {
  225. background-color: rgba(242, 242, 242, 1);
  226. height: 60rpx;
  227. border-radius: 30rpx;
  228. line-height: 60rpx;
  229. text-align: center;
  230. width: 160rpx;
  231. border: 1rpx solid rgba(242, 242, 242, 1);
  232. &.active {
  233. color: #157a2c;
  234. border-color: rgba(21, 122, 44, 1);
  235. }
  236. }
  237. }
  238. /deep/.uni-date {
  239. .uni-icons {
  240. display: none;
  241. }
  242. .uni-date-x {
  243. padding: 0;
  244. view {
  245. margin: 0 20rpx;
  246. }
  247. }
  248. }
  249. /deep/.uni-date__x-input,
  250. /deep/.uni-easyinput__content-input {
  251. height: 60rpx;
  252. border-radius: 30rpx;
  253. overflow: hidden;
  254. background-color: rgba(242, 242, 242, 1);
  255. }
  256. }
  257. .mainBox {
  258. padding-bottom: 120rpx;
  259. }
  260. .tab-wrapper {
  261. position: fixed;
  262. z-index: 99;
  263. width: 100%;
  264. }
  265. .listBox {
  266. margin-top: 10px;
  267. padding-top: 5px;
  268. padding-bottom: 8px;
  269. .listTit {
  270. display: flex;
  271. align-items: center;
  272. .stuts {
  273. width: 55px;
  274. font-size: 12px;
  275. // border: 1px solid red;
  276. }
  277. .name {
  278. font-size: $uni-font-size-base;
  279. padding-left: 15rpx;
  280. }
  281. .date {
  282. font-size: $uni-font-size-sm;
  283. padding-left: 45rpx;
  284. color: #999;
  285. }
  286. }
  287. .listCont {
  288. display: flex;
  289. align-items: center;
  290. flex-wrap: wrap;
  291. padding-left: 20rpx;
  292. flex-direction: row;
  293. margin-top: 10rpx;
  294. color: #666;
  295. // border: 1px solid red;
  296. .item {
  297. width: 50%;
  298. font-size: $uni-font-size-sm;
  299. overflow: hidden;
  300. white-space: nowrap;
  301. text-overflow: ellipsis;
  302. -o-text-overflow: ellipsis;
  303. }
  304. .item text {
  305. color: #666;
  306. }
  307. .item-left {
  308. font-size: 20px;
  309. font-weight: 600;
  310. color: #999;
  311. position: relative;
  312. left: 90%;
  313. top: -55rpx;
  314. }
  315. }
  316. .item-top {
  317. height: 5rpx;
  318. width: 96%;
  319. margin: 0 auto;
  320. border-bottom: 1px solid #d8d3d3;
  321. }
  322. .listbtn {
  323. margin-top: 20rpx;
  324. display: flex;
  325. justify-content: flex-end;
  326. align-items: center;
  327. .operBox {
  328. display: flex;
  329. align-items: center;
  330. }
  331. }
  332. .listbtn button {
  333. margin-right: 20rpx;
  334. }
  335. }
  336. .footBox {
  337. position: fixed;
  338. left: 0px;
  339. bottom: 0px;
  340. height: 100rpx;
  341. width: 100%;
  342. display: flex;
  343. align-items: center;
  344. justify-content: space-between;
  345. view {
  346. width: 100%;
  347. height: 100%;
  348. text-align: center;
  349. color: #fff;
  350. display: flex;
  351. align-items: center;
  352. justify-content: center;
  353. }
  354. .add {
  355. background: $uni-color-primary;
  356. }
  357. .reg {
  358. background: $u-success-dark;
  359. }
  360. .uni-icons {
  361. margin-right: 8rpx !important;
  362. font-weight: bold;
  363. }
  364. }
  365. </style>