inventory-scan.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <template>
  2. <view class="page">
  3. <uni-section :title='sectionTitle' type="line" :strong="true" class="bg-white"/>
  4. <template v-for="(item,index) in list">
  5. <list-item :key="index" @delete="onDelete(index)">
  6. <item-row title="物品号">{{item.itemno}}</item-row>
  7. <item-row title="数量">{{item.itemnum}}</item-row>
  8. </list-item>
  9. </template>
  10. <btn-scan :type='barCodeType' @scan="onScan($event,{uniqueItemid:true})" @submit="onSubmit(urlkey,urlparams)" ></btn-scan>
  11. </view>
  12. </template>
  13. <script>
  14. import uniSection from "@/components/uni-ui/uni-section/uni-section.vue"
  15. import listItem from "@/components/warehousing-item/list-item.vue"
  16. import btnScan from "@/components/common/btn-scan.vue"
  17. import itemRow from "@/components/common/item-row.vue"
  18. import {onErrorBarCodeType,formateScanData} from "@/common/utils/common.js"
  19. import {BARCODE_CAIGOU_KEY,BARCODE_FINISHEDGOOD_KEY} from "@/common/utils/barCode.js"
  20. import {scanProductMixin} from "@/common/utils/mixins.js"
  21. import {queryDirectDetailInventoryorder,queryExamineDetailInventoryorder,querySaleDetailInventoryorder} from "@/api/api.js"
  22. export default {
  23. mixins:[scanProductMixin],
  24. components:{
  25. uniSection,
  26. listItem,
  27. btnScan,
  28. itemRow
  29. },
  30. data () {
  31. return {
  32. list:[], // 物品列表 (当前页面展示)
  33. QRDH:null, // 销售单号
  34. SWH:null, // 事务号
  35. typekey:null, // 类型关键字
  36. type:null, // 清点类型
  37. }
  38. },
  39. computed:{
  40. urlkey () {
  41. return this.type === '入库' ? 'inventory-warehousing-edit' : 'inventory-outsource-edit'
  42. },
  43. urlparams () {
  44. let str=`&typekey=${this.typekey}`
  45. switch (this.type) {
  46. case "入库":
  47. str+=`&SWH=${this.SWH}`
  48. break;
  49. case "出库":
  50. str+=`&QRDH=${this.QRDH}`
  51. break;
  52. }
  53. return str
  54. },
  55. // 页面标题
  56. sectionTitle () {
  57. let title=''
  58. switch (this.type) {
  59. case "入库":
  60. title='入库物品条形码'
  61. break;
  62. case "出库":
  63. title='出库物品条形码'
  64. break;
  65. }
  66. return title
  67. },
  68. // 条形码类型
  69. barCodeType () {
  70. let type=''
  71. switch (this.type) {
  72. case "入库":
  73. type=BARCODE_CAIGOU_KEY
  74. break;
  75. case "出库":
  76. type=BARCODE_FINISHEDGOOD_KEY
  77. break;
  78. }
  79. return type
  80. }
  81. },
  82. onReady () {
  83. uni.setNavigationBarTitle({
  84. title:`请扫描${this.type}物品`
  85. })
  86. },
  87. onLoad (e) {
  88. /*
  89. SWH:事务号
  90. type:清点类型(入库,出库)
  91. typekey:关键字(入库:直接入库,检验入库,出库:出库)
  92. */
  93. this.QRDH=e.QRDH
  94. this.SWH=e.SWH
  95. this.type=e.type
  96. this.typekey=e.typekey
  97. },
  98. methods:{
  99. }
  100. }
  101. </script>
  102. <style lang="scss">
  103. </style>