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.

139 lines
3.0 KiB

8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
  1. <template>
  2. <div>
  3. <div class="pda-receipt">
  4. <div class="status-bar">
  5. <div class="time">{{ new Date().toTimeString().substr(0, 5) }}</div>
  6. <div class="network" style="color: #fff" @click="$router.push({path: '/'})">🏠首页</div>
  7. </div>
  8. <!-- 扫描输入区 -->
  9. <div class="scan-box">
  10. <input
  11. v-model="scanCode"
  12. placeholder="扫描PO条码或输入PO号"
  13. @keyup.enter="addItem"
  14. ref="scanCodeRef"
  15. />
  16. </div>
  17. <!-- 商品列表区 -->
  18. <div class="item-list">
  19. <div
  20. v-for="(item, i) in items"
  21. :key="i"
  22. class="item-row"
  23. >
  24. <span>{{ item.code }}</span>
  25. <span>{{ item.qty }}</span>
  26. <el-button icon="el-icon-delete" @click="removeItem(i)"></el-button>
  27. </div>
  28. </div>
  29. <!-- 操作按钮区 -->
  30. <el-button
  31. class="submit-btn"
  32. @click="submit"
  33. >
  34. 确认收货 ({{ totalQty }})
  35. </el-button>
  36. </div>
  37. <el-dialog
  38. style="font-size: 12px"
  39. v-drag
  40. :title="'Dialog'"
  41. :visible.sync="siteVisible"
  42. width="260px" :append-to-body="true" >
  43. <el-form label-position="top" style="margin-left: 7px;margin-top: 10px;">
  44. <el-row :gutter="20">
  45. <el-col :span="24">
  46. <el-form-item :label="'Test'" >
  47. <el-radio label="Y">Y</el-radio>
  48. <el-radio label="N">N</el-radio>
  49. </el-form-item>
  50. </el-col>
  51. </el-row>
  52. </el-form>
  53. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  54. <el-button type="primary" @click="">确定</el-button>
  55. <el-button type="primary" @click="siteVisible=false">关闭</el-button>
  56. </el-footer>
  57. </el-dialog>
  58. </div>
  59. </template>
  60. <script>
  61. export default {
  62. data() {
  63. return {
  64. siteVisible: false,
  65. scanCode: '',
  66. items: [{code: 'A001', qty: 1}, {code: 'A002', qty: 2}]
  67. }
  68. },
  69. computed: {
  70. totalQty() {
  71. return this.items.reduce((sum, item) => sum + item.qty, 0)
  72. }
  73. },
  74. methods: {
  75. toShouye(){
  76. this.$router.push({path: '/'})
  77. },
  78. addItem() {
  79. if (!this.scanCode) return
  80. this.items.push({
  81. code: this.scanCode,
  82. qty: 1
  83. })
  84. this.scanCode = ''
  85. },
  86. removeItem(index) {
  87. this.items.splice(index, 1)
  88. },
  89. submit() {
  90. alert(`已提交${this.items.length}种商品`)
  91. this.items = []
  92. }
  93. },
  94. mounted() {
  95. this.$nextTick(() => {
  96. this.$refs.scanCodeRef.focus()
  97. })
  98. }
  99. }
  100. </script>
  101. <style scoped>
  102. .pda-receipt {
  103. display: flex;
  104. flex-direction: column;
  105. height: 80vh;
  106. padding: 10px;
  107. }
  108. .scan-box input {
  109. width: 100%;
  110. padding: 12px;
  111. font-size: 16px;
  112. }
  113. .item-list {
  114. flex: 1;
  115. overflow-y: auto;
  116. margin: 20px 0;
  117. }
  118. .item-row {
  119. display: flex;
  120. justify-content: space-between;
  121. padding: 8px;
  122. border-bottom: 1px solid #eee;
  123. }
  124. .submit-btn {
  125. padding: 12px;
  126. background: #07c160;
  127. color: white;
  128. border: none;
  129. font-size: larger;
  130. }
  131. </style>