workorderSelected.vue 3.2 KB

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