equipmentEnter.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330
  1. <template>
  2. <view>
  3. <u-navbar title="设备入库" class="head">
  4. <view class="tabs" slot="bottom">
  5. <u-tabs bar-width="80" inactive-color="#777777" active-color="#101010" :list="list" :is-scroll="false"
  6. :current="current" @change="change"></u-tabs>
  7. </view>
  8. </u-navbar>
  9. <view class="search" v-show="current==0" >
  10. <!-- <u-icon name="arrow-left" @click="back()" size="36"></u-icon> -->
  11. <view class="search-box">
  12. <u-search :show-action="true" class="u-search"
  13. v-model="queryContent" @search="initQuery()"
  14. @custom="initQuery()"
  15. placeholder="项目名称搜索"
  16. action-text="搜索" :animation="true"></u-search>
  17. <!-- <u-search class="u-search" placeholder="搜索设备名称或型号" v-model="queryContent" :show-action="false">
  18. </u-search>
  19. -->
  20. <!-- <view class="search-btn" @click="initQuery()" >
  21. <view class="text">
  22. 搜索
  23. </view>
  24. </view> -->
  25. </view>
  26. </view>
  27. <view :class="current==0?'list1':'list2'" >
  28. <view class="item" v-for="(item,i) in list[current].list" @click="ckInfo(item.id)" :key="i" >
  29. <view class="title">
  30. <view class="name">
  31. {{item.projectName}}
  32. </view>
  33. <!-- <view class="classify">
  34. 耗材
  35. </view>
  36. <view class="state">
  37. 待入库
  38. </view> -->
  39. </view>
  40. <view class="group">
  41. <view class="name">
  42. 提交人:
  43. </view>
  44. <view class="value">
  45. {{item.createByName}}
  46. </view>
  47. </view>
  48. <view class="group">
  49. <view class="name">
  50. 创建时间:
  51. </view>
  52. <view class="value">
  53. {{item.createTime}}
  54. </view>
  55. </view>
  56. <view class="group" v-if="item.approveTime">
  57. <view class="name">
  58. 入库时间:
  59. </view>
  60. <view class="value">
  61. {{item.approveTime}}
  62. </view>
  63. </view>
  64. </view>
  65. <u-divider v-if="list[current].recordsTotal==list[current].list.length"
  66. :isnone="list[current].recordsTotal==0" nonetext="没有找到相关内容"
  67. border-color="#CFD2D5">已经到底了</u-divider>
  68. </view>
  69. </view>
  70. </template>
  71. <script>
  72. import * as API from '@/apis/pagejs/storeManagement.js'
  73. export default {
  74. data() {
  75. return {
  76. queryContent:"",
  77. list: [{
  78. name: '待入库',
  79. pageIndex: 1,
  80. pageSize: 20,
  81. recordsTotal: 1,
  82. status:"0",
  83. list:[]
  84. }, {
  85. name: '已入库',
  86. pageIndex: 1,
  87. pageSize: 20,
  88. recordsTotal: 1,
  89. status:"1",
  90. list:[]
  91. }],
  92. current: 0
  93. }
  94. },
  95. onReachBottom() {
  96. var obj=this.list[this.current]
  97. if (obj.list.length < obj.recordsTotal) {
  98. this.myLoadmore();
  99. }
  100. },
  101. onReady(){
  102. this.getList()
  103. },
  104. methods: {
  105. getList(){
  106. uni.showLoading({
  107. title: "加载中",
  108. mask: true,
  109. })
  110. var list=this.list[this.current].list
  111. var obj=this.list[this.current]
  112. var listForm={
  113. ...obj
  114. }
  115. delete listForm.list
  116. if(this.current==0){
  117. listForm.projectName=this.queryContent;
  118. }
  119. API.inWaitList(listForm).then((res) => {
  120. uni.hideLoading();
  121. if(listForm.pageIndex==1){
  122. list = res.data.data;
  123. }else{
  124. list = [
  125. ...list,
  126. ...res.data.data
  127. ];
  128. }
  129. this.list[this.current].list=list
  130. if(this.current==0){
  131. this.carhelp.set("badgeList_inWaitList",res.data.recordsTotal)
  132. }
  133. this.list[this.current].recordsTotal = res.data.recordsTotal;
  134. }).catch(error => {
  135. uni.showToast({
  136. title: error,
  137. icon: "none"
  138. })
  139. })
  140. },
  141. myLoadmore(){
  142. this.list[this.current].pageIndex += 1;
  143. this.getList();
  144. },
  145. init(){
  146. this.current=0
  147. this.list[0].pageIndex=1
  148. this.list[1].pageIndex=1
  149. this.getList()
  150. },
  151. initQuery(){
  152. //this.current=0
  153. this.list[0].pageIndex=1
  154. this.list[1].pageIndex=1
  155. this.getList()
  156. },
  157. ckInfo(id){
  158. var url="./deliveryDetails?id="+id;
  159. uni.navigateTo({
  160. url:url,
  161. events: {
  162. refreshData: () => {
  163. this.init()
  164. }
  165. }
  166. })
  167. },
  168. change(index) {
  169. this.current = index;
  170. var list = this.list[this.current].list
  171. if (list.length == 0) {
  172. this.getList();
  173. }
  174. }
  175. }
  176. }
  177. </script>
  178. <style lang="scss" scoped>
  179. page{
  180. padding-bottom: 100rpx;
  181. }
  182. // 搜索
  183. .search {
  184. margin-top: 40px;
  185. padding: 12rpx 24rpx;
  186. //display: flex;
  187. border-radius: 8px;
  188. overflow: hidden;
  189. .search-box {
  190. border: 1px solid;
  191. //display: flex;
  192. border-radius: 8px;
  193. overflow: hidden;
  194. }
  195. .u-search {
  196. //width: 630rpx;
  197. margin: auto !important;
  198. position: relative;
  199. flex: 0;
  200. margin: 0 !important;
  201. height: 64rpx !important;
  202. }
  203. /deep/.u-content {
  204. width: 430px;
  205. border-radius: 0px !important;
  206. height: 64rpx !important;
  207. }
  208. /deep/.u-icon--right {
  209. margin-right: 16rpx;
  210. }
  211. .search-btn {
  212. width: 100rpx;
  213. height: 64rpx;
  214. background-color: #f2f2f2;
  215. .text {
  216. height: 40rpx;
  217. margin: 12rpx 0;
  218. border-left: 1px solid #999999;
  219. font-family: Microsoft Yahei;
  220. text-align: center;
  221. color: rgba(16, 98, 213, 1);
  222. font-size: 28rpx;
  223. }
  224. }
  225. }
  226. .head {
  227. background: linear-gradient(180deg, rgba(190, 211, 240, 1) 0%, rgba(244, 244, 246, 1) 100%) !important;
  228. /deep/.u-navbar {
  229. //background: 0!important;
  230. background: linear-gradient(180deg, rgba(190, 211, 240, 1) 0%, rgba(244, 244, 246, 1) 100%) !important;
  231. height: 210rpx;
  232. //padding: 0 32rpx;
  233. }
  234. /deep/.u-border-bottom:after {
  235. height: 0;
  236. }
  237. .tabs {
  238. padding: 0 32rpx
  239. }
  240. }
  241. .tabs{
  242. display: flex;
  243. justify-content: space-between;
  244. align-items: center;
  245. /deep/.u-tabs{
  246. background: 0 !important;
  247. width: 250rpx;
  248. }
  249. /deep/.u-tab-bar{
  250. background-color: #2A8EFB !important;
  251. }
  252. }
  253. .list1{
  254. margin-top: 10px;
  255. }
  256. .list2{
  257. margin-top: 60px;
  258. }
  259. .list1,.list2{
  260. padding: 0 32rpx;
  261. margin-bottom: 10px;
  262. .item{
  263. border-radius: 8px;
  264. background-color: rgba(255, 255, 255, 1);
  265. padding: 32rpx;
  266. margin-bottom: 24rpx;
  267. .title{
  268. color: rgba(51, 51, 51, 1);
  269. font-size: 36rpx;
  270. margin-bottom: 16rpx;
  271. display: flex;
  272. align-items: center;
  273. .classify{
  274. margin-left: 26rpx;
  275. padding: 10rpx 16rpx;
  276. border-radius: 4px;
  277. background-color: rgba(219, 255, 212, 1);
  278. color: rgba(69, 186, 69, 1);
  279. font-size: 24rpx;
  280. text-align: center;
  281. }
  282. .state{
  283. margin-left: auto;
  284. color: rgba(22, 119, 255, 1);
  285. font-size: 32rpx;
  286. }
  287. }
  288. .group{
  289. display: flex;
  290. color: rgba(119, 119, 119, 1);
  291. margin-top: 16rpx;
  292. font-weight: bold;
  293. }
  294. }
  295. }
  296. </style>