You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

109 lines
2.5 KiB

8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
6 months ago
8 months ago
  1. <template>
  2. <div>
  3. <div class="pda-container">
  4. <div class="status-bar">
  5. <div class="goBack" @click="$router.back()"><i class="el-icon-arrow-left"></i>上一页</div>
  6. <div class="goBack">登记检验结果</div>
  7. <div class="network" style="color: #fff" @click="$router.push({path: '/'})">🏠首页</div>
  8. </div>
  9. <!-- 扫描输入区 -->
  10. <div class="scan-box">
  11. <input
  12. v-model="scanCode"
  13. placeholder="扫描PO条码或输入PO号"
  14. @keyup.enter="addItem"
  15. ref="scanCodeRef"
  16. />
  17. </div>
  18. <!-- 商品列表区 -->
  19. <div class="item-list">
  20. <el-table :height="240" :data="items" @row-click="rowClick"
  21. stripe highlight-current-row border :row-style="{ height: '30px' }" style="width: 100%;">
  22. <el-table-column prop="code" header-align="center" align="center" label="商品编码"></el-table-column>
  23. <el-table-column prop="qty" header-align="center" align="center" label="数量" width="42"></el-table-column>
  24. <el-table-column prop="qty" header-align="center" align="center" label="不合格数量">
  25. <template slot-scope="scope">
  26. <span style="height: 11px;width:98%;color: red">{{scope.row.qty}}</span>
  27. </template>
  28. </el-table-column>
  29. </el-table>
  30. </div>
  31. <!-- 操作按钮区 -->
  32. </div>
  33. </div>
  34. </template>
  35. <script>
  36. export default {
  37. data() {
  38. return {
  39. siteVisible: false,
  40. scanCode: '',
  41. items: [{code: 'A001', qty: 1}, {code: 'A002', qty: 2}]
  42. }
  43. },
  44. computed: {
  45. totalQty() {
  46. return this.items.reduce((sum, item) => sum + item.qty, 0)
  47. }
  48. },
  49. methods: {
  50. addItem() {
  51. if (!this.scanCode) return
  52. this.items.push({
  53. code: this.scanCode,
  54. qty: 1
  55. })
  56. this.scanCode = ''
  57. },
  58. removeItem(index) {
  59. this.items.splice(index, 1)
  60. },
  61. submit() {
  62. alert(`已提交${this.items.length}种商品`)
  63. this.items = []
  64. }
  65. },
  66. mounted() {
  67. this.$nextTick(() => {
  68. this.$refs.scanCodeRef.focus()
  69. })
  70. }
  71. }
  72. </script>
  73. <style scoped>
  74. .scan-box input {
  75. width: 100%;
  76. padding: 12px;
  77. font-size: 16px;
  78. }
  79. .item-list {
  80. flex: 1;
  81. overflow-y: auto;
  82. margin: 20px 0;
  83. }
  84. .item-row {
  85. display: flex;
  86. justify-content: space-between;
  87. padding: 8px;
  88. border-bottom: 1px solid #eee;
  89. }
  90. .status-bar {
  91. display: flex;
  92. justify-content: space-between;
  93. align-items: center;
  94. background: #17b3a3;
  95. color: #fff;
  96. padding: 8px 12px;
  97. }
  98. </style>