workorderSelected.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <template>
  2. <view class="workorder-selected">
  3. <uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="选择盘点工单" @clickLeft="back"></uni-nav-bar>
  4. <view class="search-box">
  5. <u-input type="text" placeholder="搜索工单号或名称" clearable prefixIcon="search"
  6. prefixIconStyle="font-size: 22px;color: #909399" v-model="keyWord"></u-input>
  7. </view>
  8. <view class="list-wrapper">
  9. <view class="card" v-for="(item, index) in tableList" :key="index" @click="selected = item"
  10. :class="{ selected: selected.id === item.id }">
  11. <view class="title">
  12. <view class="round">{{Number(index)+1}}</view>
  13. {{ item.code }}
  14. </view>
  15. <view>
  16. <text class="label">计划名称:</text>
  17. {{ item.planName }}
  18. </view>
  19. <view>
  20. <text class="label">产品分类:</text>
  21. {{ item.categoryLevelId }}
  22. </view>
  23. <view>
  24. <text class="label">盘点仓库:</text>
  25. {{ item.warehouseName }}
  26. </view>
  27. <view>
  28. <text class="label">盘点部门:</text>
  29. {{ item.executeGroupName }}
  30. </view>
  31. <view>
  32. <text class="label">盘点人员:</text>
  33. {{ item.executorName }}
  34. </view>
  35. <view>
  36. <text class="label">审核时间:</text>
  37. {{ item.createTime }}
  38. </view>
  39. <view class="card-footer">
  40. <text>盘盈&nbsp;{{ item.surplusQuantity || 0 }}</text>
  41. <text>盘亏&nbsp;{{ item.wornQuantity || 0 }}</text>
  42. <text>破损&nbsp;{{ item.loseQuantity || 0 }}</text>
  43. </view>
  44. </view>
  45. </view>
  46. <u-button class="footer" type="success" @click="confirm">确定选中</u-button>
  47. </view>
  48. </template>
  49. <script>
  50. import {
  51. getPlanOrderList
  52. } from '@/api/warehouseManagement'
  53. export default {
  54. data() {
  55. return {
  56. keyWord: '',
  57. tableList: [],
  58. selected: {}
  59. }
  60. },
  61. onLoad() {
  62. this._getCheckAbnormalList()
  63. },
  64. methods: {
  65. async _getCheckAbnormalList() {
  66. uni.showLoading({
  67. title: '加载中'
  68. })
  69. getPlanOrderList({
  70. pageNum: 1,
  71. pageSize: 999999,
  72. keyWord: this.keyWord,
  73. type: 1
  74. })
  75. .then(res => {
  76. this.tableList = res.list
  77. console.log(this.tableList)
  78. })
  79. .finally(() => {
  80. uni.hideLoading()
  81. })
  82. },
  83. confirm() {
  84. if (!this.selected?.id) {
  85. uni.showToast({
  86. icon: 'none',
  87. title: '请选择工单!'
  88. })
  89. return
  90. }
  91. uni.$emit('getWorkorder', this.selected)
  92. uni.navigateBack({
  93. delta: 1
  94. })
  95. }
  96. }
  97. }
  98. </script>
  99. <style lang="scss" scoped>
  100. .search-box {
  101. position: fixed;
  102. left: 0;
  103. right: 0;
  104. padding: 10rpx;
  105. background-color: #fff;
  106. .u-input {
  107. border: 1rpx solid #dadbde;
  108. }
  109. }
  110. .list-wrapper {
  111. padding: 100rpx 0 80rpx;
  112. font-size: 28rpx;
  113. color: #555;
  114. .card {
  115. padding: 0 16px 8px 16px;
  116. border-bottom: 8rpx solid #f2f2f2;
  117. &.selected {
  118. background-color: #f5f5f5;
  119. }
  120. .title {
  121. color: #333333;
  122. font-weight: bold;
  123. border-bottom: 1rpx solid #f2f2f2;
  124. font-size: 30rpx;
  125. padding: 8rpx 0;
  126. display: flex;
  127. }
  128. .round {
  129. width: 40rpx;
  130. height: 40rpx;
  131. line-height: 40rpx;
  132. border-radius: 50%;
  133. background: $theme-color;
  134. color: #fff;
  135. text-align: center;
  136. font-size: 20rpx;
  137. margin-right: 8px;
  138. }
  139. .card-footer {
  140. border-top: 1rpx solid #f2f2f2;
  141. display: flex;
  142. justify-content: space-between;
  143. align-items: center;
  144. padding-top: 16rpx;
  145. }
  146. .label {
  147. // color: #aaaaaa;
  148. margin-right: 20rpx;
  149. line-height: 24px;
  150. }
  151. }
  152. }
  153. .footer {
  154. position: fixed;
  155. bottom: 0;
  156. left: 0;
  157. right: 0;
  158. }
  159. </style>