workorderSelected.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <template>
  2. <view class="workorder-selected">
  3. <uni-nav-bar
  4. fixed="true"
  5. statusBar="true"
  6. left-icon="back"
  7. title="选择盘点工单"
  8. @clickLeft="back"
  9. >
  10. </uni-nav-bar>
  11. <view class="search-box">
  12. <u-input
  13. type="text"
  14. placeholder="搜索工单号或名称"
  15. clearable
  16. prefixIcon="search"
  17. prefixIconStyle="font-size: 22px;color: #909399"
  18. ></u-input>
  19. </view>
  20. <view class="list-wrapper">
  21. <view
  22. class="card"
  23. v-for="(item, index) in tableList"
  24. :key="index"
  25. @click="selected = item"
  26. :class="{ selected: selected.id === item.id }"
  27. >
  28. <view class="title">{{ item.workOrderCode }}</view>
  29. <view><text class="label">盘点名称</text>{{ item.planName }}</view>
  30. <view
  31. ><text class="label">资产类型</text
  32. >{{ getDictName(warehousingType, item.assetDict) }}</view
  33. >
  34. <view><text class="label">盘点仓库</text>{{ item.bizTypeName }}</view>
  35. <view><text class="label">审核时间</text></view>
  36. <view class="card-footer">
  37. <text>盘盈&nbsp;{{ item.inventoryProfitNum || 0 }}</text>
  38. <text>盘亏&nbsp;{{ item.inventoryLossesNum || 0 }}</text>
  39. <text>破损&nbsp;{{ item.damagedNum || 0 }}</text>
  40. </view>
  41. </view>
  42. </view>
  43. <u-button class="footer" type="success" @click="confirm">确定选中</u-button>
  44. </view>
  45. </template>
  46. <script>
  47. import { postJ } from '@/utils/api.js'
  48. import { getDictName, warehousingType } from '../enum'
  49. export default {
  50. data () {
  51. return {
  52. tableList: [],
  53. selected: {},
  54. getDictName,
  55. warehousingType
  56. }
  57. },
  58. onLoad () {
  59. this._getCheckAbnormalList()
  60. },
  61. methods: {
  62. async _getCheckAbnormalList () {
  63. const res = await postJ(this.apiUrl + '/workOrder/getCheckAbnormalList', {
  64. size: 999999
  65. })
  66. if (res?.success) {
  67. this.tableList = res.data.records
  68. }
  69. },
  70. confirm () {
  71. if (!this.selected?.id) {
  72. uni.showToast({
  73. icon: 'none',
  74. title: '请选择工单!'
  75. })
  76. return
  77. }
  78. uni.$emit('getWorkorder', this.selected)
  79. uni.navigateBack({
  80. delta: 1
  81. })
  82. }
  83. }
  84. }
  85. </script>
  86. <style lang="scss" scoped>
  87. .search-box {
  88. position: fixed;
  89. left: 0;
  90. right: 0;
  91. padding: 10rpx;
  92. background-color: #fff;
  93. .u-input {
  94. border: 1rpx solid #dadbde;
  95. }
  96. }
  97. .list-wrapper {
  98. padding: 100rpx 0 80rpx;
  99. font-size: 28rpx;
  100. color: #555;
  101. .card {
  102. padding: 0 10rpx;
  103. border-bottom: 8rpx solid #f2f2f2;
  104. &.selected {
  105. background-color: rgba(202, 249, 130, 0.380392156862745);
  106. }
  107. .title {
  108. color: #333333;
  109. font-weight: bold;
  110. border-bottom: 1rpx solid #f2f2f2;
  111. font-size: 30rpx;
  112. padding: 8rpx 0;
  113. }
  114. .card-footer {
  115. border-top: 1rpx solid #f2f2f2;
  116. display: flex;
  117. justify-content: space-between;
  118. align-items: center;
  119. padding: 0 15rpx;
  120. }
  121. .label {
  122. color: #aaaaaa;
  123. margin-right: 20rpx;
  124. }
  125. }
  126. }
  127. .footer {
  128. position: fixed;
  129. bottom: 0;
  130. left: 0;
  131. right: 0;
  132. }
  133. </style>