index copy.vue 7.2 KB

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