index.vue 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364
  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. ></uni-nav-bar>
  10. <template>
  11. <view class="tab-title">
  12. <view
  13. v-for="(item, index) in tabList"
  14. :key="index"
  15. class="tab-item"
  16. v-text="item.label"
  17. :class="index === pickTabIndex ? 'active' : ''"
  18. @click="changeChartsTab(index)"
  19. ></view>
  20. <view class="tab-item filter">
  21. <uni-icons
  22. custom-prefix="iconfont"
  23. type="icon-shaixuan"
  24. size="16"
  25. color="#ccc"
  26. ></uni-icons
  27. ></view>
  28. </view>
  29. <view class="tab-title__placeholder"></view>
  30. </template>
  31. <view class="listBox">
  32. <view class="listTit">
  33. <view style="display: inline-block"
  34. ><u-tag text="未受理" size="mini" shape="circle" type="error"></u-tag
  35. ></view>
  36. <view class="name">W0139901938881</view>
  37. <view class="date">2020-10-09 11:34</view>
  38. </view>
  39. <view class="listCont">
  40. <view class="item"><text>仓库:</text>5001-混炼料仓</view>
  41. <view class="item"><text>入库登记人:</text>何柏华</view>
  42. <view class="item"><text>负责人:</text>何柏华</view>
  43. <view class="item"><text>送货人:</text>李四</view>
  44. <view class="item" style="width: 100%"
  45. ><text>来源单据:</text>保养工单 W30981288831</view
  46. >
  47. </view>
  48. <view class="listbtn">
  49. <view class="operBox">
  50. <view
  51. ><u-button type="primary" size="small" text="受理"></u-button
  52. ></view>
  53. <view
  54. ><u-button type="primary" size="small" text="改派"></u-button
  55. ></view>
  56. </view>
  57. </view>
  58. </view>
  59. <view class="listBox">
  60. <view class="listTit">
  61. <view style="display: inline-block"
  62. ><u-tag
  63. text="已完成"
  64. size="mini"
  65. shape="circle"
  66. type="error"
  67. bgColor="#999"
  68. borderColor="#999"
  69. ></u-tag
  70. ></view>
  71. <view class="name">W0139901938881</view>
  72. <view class="date">2020-10-09 11:34</view>
  73. </view>
  74. <view class="listCont">
  75. <view class="item"><text>仓库:</text>5001-混炼料仓</view>
  76. <view class="item"><text>入库登记人:</text>何柏华</view>
  77. <view class="item"><text>负责人:</text>何柏华</view>
  78. <view class="item"><text>送货人:</text>李四</view>
  79. <view class="item" style="width: 100%"
  80. ><text>来源单据:</text>保养工单 W30981288831</view
  81. >
  82. </view>
  83. <view class="listbtn">
  84. <view class="operBox">
  85. <view
  86. ><u-button type="success" size="small" text="登记"></u-button
  87. ></view>
  88. </view>
  89. </view>
  90. </view>
  91. <view class="listBox">
  92. <view class="listTit">
  93. <view style="display: inline-block"
  94. ><u-tag text="未登记" size="mini" shape="circle"></u-tag
  95. ></view>
  96. <view class="name">W0139901938881</view>
  97. <view class="date">2020-10-09 11:34</view>
  98. </view>
  99. <view class="listCont">
  100. <view class="item"><text>仓库:</text>5001-混炼料仓</view>
  101. <view class="item"><text>入库登记人:</text>何柏华</view>
  102. <view class="item"><text>负责人:</text>何柏华</view>
  103. <view class="item"><text>送货人:</text>李四</view>
  104. <view class="item" style="width: 100%"
  105. ><text>来源单据:</text>保养工单 W30981288831</view
  106. >
  107. </view>
  108. <view class="listbtn">
  109. <view class="operBox">
  110. <view
  111. ><u-button type="success" size="small" text="登记"></u-button
  112. ></view>
  113. </view>
  114. </view>
  115. </view>
  116. <view class="listBox">
  117. <view class="listTit">
  118. <view style="display: inline-block"
  119. ><u-tag text="未受理" size="mini" shape="circle" type="error"></u-tag
  120. ></view>
  121. <view class="name">W0139901938881</view>
  122. <view class="date">2020-10-09 11:34</view>
  123. </view>
  124. <view class="listCont">
  125. <view class="item"><text>仓库:</text>5001-混炼料仓</view>
  126. <view class="item"><text>入库登记人:</text>何柏华</view>
  127. <view class="item"><text>负责人:</text>何柏华</view>
  128. <view class="item"><text>送货人:</text>李四</view>
  129. <view class="item" style="width: 100%"
  130. ><text>来源单据:</text>保养工单 W30981288831</view
  131. >
  132. </view>
  133. <view class="listbtn">
  134. <view class="operBox">
  135. <view
  136. ><u-button type="primary" size="small" text="受理"></u-button
  137. ></view>
  138. <view
  139. ><u-button type="primary" size="small" text="改派"></u-button
  140. ></view>
  141. </view>
  142. </view>
  143. </view>
  144. <view class="footBox">
  145. <view class="reg"
  146. ><uni-icons
  147. custom-prefix="iconfont"
  148. type="icon-shixiangxinzeng"
  149. size="20"
  150. color="#fff"
  151. ></uni-icons>
  152. 入库登记</view
  153. >
  154. </view>
  155. </view>
  156. </template>
  157. <script>
  158. import { post } from '@/utils/api.js'
  159. let [page, size, isEnd] = [1, 10, true]
  160. export default {
  161. components: {},
  162. data () {
  163. return {
  164. tabList: [
  165. { value: '2', label: '全部', list: [] },
  166. { value: '99', label: '未受理', list: [] },
  167. { value: '2', label: '未登记', list: [] },
  168. { value: '99', label: '已完成', list: [] }
  169. ],
  170. pickTabIndex: 0
  171. }
  172. },
  173. onLoad () {
  174. this.getFirstList()
  175. },
  176. onReachBottom: function () {
  177. if (isEnd) {
  178. return
  179. }
  180. // 显示加载图标
  181. uni.showLoading({
  182. title: '数据加载中'
  183. })
  184. this.getMoreLists()
  185. },
  186. methods: {
  187. getFirstList: function () {
  188. page = 1
  189. isEnd = true
  190. uni.showLoading({
  191. title: '数据加载中'
  192. })
  193. this.getList()
  194. },
  195. getMoreLists: function () {
  196. //获取更多数据
  197. page++
  198. this.getList()
  199. },
  200. getList () {
  201. uni.showLoading({
  202. title: '加载中'
  203. })
  204. let data = {
  205. page,
  206. size
  207. }
  208. let status = this.tabList[this.pickTabIndex].value
  209. //2 - 99 [已完成]
  210. post(this.apiUrl + '/repair/worksheet/list?status=' + status, data)
  211. .then(res => {
  212. let data = res.data.items
  213. let pageTotal = res.data.pageTotal
  214. if (page === 1) {
  215. this.tabList[this.pickTabIndex].list = res.data.items
  216. } else {
  217. data.forEach(element => {
  218. this.tabList[this.pickTabIndex].list.push(element)
  219. })
  220. }
  221. page < pageTotal ? (isEnd = false) : (isEnd = true)
  222. })
  223. .then(() => {
  224. uni.hideLoading()
  225. })
  226. },
  227. changeChartsTab (index) {
  228. this.pickTabIndex = index
  229. this.getFirstList()
  230. }
  231. }
  232. }
  233. </script>
  234. <style lang="scss" scoped>
  235. .mainBox {
  236. padding-bottom: 120rpx;
  237. }
  238. .tab-title {
  239. position: fixed;
  240. z-index: 99;
  241. width: 100%;
  242. display: flex;
  243. justify-content: space-between;
  244. align-items: center;
  245. height: $tab-height;
  246. line-height: $tab-height;
  247. background-color: #ffffff;
  248. border-bottom: 1px solid #f2f2f2;
  249. box-sizing: border-box;
  250. .tab-item {
  251. width: 25%;
  252. text-align: center;
  253. font-size: 32rpx;
  254. color: $uni-text-color-grey;
  255. }
  256. .tab-item.active {
  257. color: $j-primary-border-green;
  258. border-bottom: 1px solid $j-primary-border-green;
  259. font-weight: bold;
  260. }
  261. .tab-item.filter {
  262. flex: 1;
  263. padding: 0px 30rpx;
  264. .uni-icons {
  265. display: flex;
  266. padding-top: 5px;
  267. }
  268. }
  269. }
  270. .listBox {
  271. padding: 20rpx 0;
  272. margin: 30rpx 20rpx;
  273. border-bottom: 1px #f2f2f2 solid;
  274. .listTit {
  275. display: flex;
  276. align-items: center;
  277. .name {
  278. margin-left: 10px;
  279. }
  280. .date {
  281. font-size: $uni-font-size-sm;
  282. margin-left: auto;
  283. color: #999;
  284. }
  285. }
  286. .listCont {
  287. display: flex;
  288. align-items: center;
  289. flex-wrap: wrap;
  290. margin-top: 15px;
  291. .item {
  292. width: 50%;
  293. font-size: $uni-font-size-base;
  294. line-height: 48rpx;
  295. overflow: hidden;
  296. white-space: nowrap;
  297. text-overflow: ellipsis;
  298. -o-text-overflow: ellipsis;
  299. }
  300. .item text {
  301. color: #666;
  302. }
  303. }
  304. .listbtn {
  305. margin-top: 20rpx;
  306. display: flex;
  307. justify-content: flex-end;
  308. align-items: center;
  309. .operBox {
  310. display: flex;
  311. align-items: center;
  312. }
  313. }
  314. .listbtn button {
  315. margin-right: 20rpx;
  316. }
  317. }
  318. .footBox {
  319. position: fixed;
  320. left: 0px;
  321. bottom: 0px;
  322. height: 100rpx;
  323. width: 100%;
  324. display: flex;
  325. align-items: center;
  326. justify-content: space-between;
  327. view {
  328. width: 100%;
  329. height: 100%;
  330. text-align: center;
  331. color: #fff;
  332. display: flex;
  333. align-items: center;
  334. justify-content: center;
  335. }
  336. .reg {
  337. background: $u-success-dark;
  338. }
  339. .uni-icons {
  340. margin-right: 8rpx !important;
  341. font-weight: bold;
  342. }
  343. }
  344. </style>