show.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <template>
  2. <view>
  3. <uni-section title="">
  4. <view class="example">
  5. <uni-forms ref="form" :modelValue="item" labelWidth="80px" :rules="rules">
  6. <uni-forms-item label="装箱单号" name="FBillNo">
  7. <uni-easyinput v-model="item['FENCHASENUM.LT']" disabled>
  8. </uni-easyinput>
  9. </uni-forms-item>
  10. <uni-forms-item label="调拨数量" name="FQty" >
  11. <uni-easyinput v-model="item['FQty']"/>
  12. </uni-forms-item>
  13. </uni-forms>
  14. <button type="primary" @click="submit()">确认</button>
  15. </view>
  16. </uni-section>
  17. </view>
  18. </template>
  19. <script>
  20. import {
  21. getInfoByBarcode,
  22. getStockInfo
  23. } from '../../api/production_replenishment';
  24. import {
  25. playVoice,
  26. audioUrls
  27. } from '@/utils/audio.js'
  28. import modal from '../../uni_modules/uview-ui/libs/config/props/modal';
  29. export default {
  30. onLoad(option) {
  31. this.formId = uni.getStorageSync("formId")
  32. const item = JSON.parse(decodeURIComponent(option.item))
  33. const index = JSON.parse(decodeURIComponent(option.index))
  34. console.log(item)
  35. console.log(index)
  36. this.item = item
  37. this.index = index
  38. },
  39. data() {
  40. return {
  41. formId: '',
  42. item: {},
  43. index: '',
  44. isReplace: false,
  45. rules: {
  46. FActualQty: {
  47. rules: [{
  48. required: true,
  49. errorMessage: '请输入实发数量',
  50. },
  51. ]
  52. },
  53. FQty: {
  54. rules: [{
  55. required: true,
  56. errorMessage: '请输入实发数量',
  57. },
  58. ]
  59. },
  60. FRMREALQTY: {
  61. rules: [{
  62. required: true,
  63. errorMessage: '请输入实际作业数量',
  64. },
  65. ]
  66. },
  67. },
  68. };
  69. },
  70. computed: {
  71. },
  72. methods: {
  73. handleError(error) {
  74. playVoice(audioUrls.failVoiceUrl)
  75. console.error('操作失败:', error);
  76. modal.confirm(error).then(res => {
  77. if (res) {} else {}
  78. })
  79. },
  80. submit() {
  81. console.log(this.item)
  82. this.$refs.form.validate().then(res => {
  83. this.item["index"] = this.index
  84. let self = this
  85. uni.navigateBack({
  86. success: function() {
  87. // 传递数据给上一页
  88. uni.$emit('item', self.item);
  89. }
  90. });
  91. }).catch(err => {
  92. console.log(err);
  93. })
  94. },
  95. }
  96. };
  97. </script>
  98. <style>
  99. /deep/ .is-disabled {
  100. background-color: #ffffff !important;
  101. color: #0d0d0d !important;
  102. }
  103. .example {
  104. padding-left: 10px;
  105. padding-right: 10px;
  106. background-color: #fff;
  107. }
  108. .segmented-control {
  109. margin-bottom: 15px;
  110. }
  111. .button-group {
  112. margin-top: 15px;
  113. display: flex;
  114. justify-content: space-around;
  115. }
  116. .form-item {
  117. display: flex;
  118. align-items: center;
  119. }
  120. .button {
  121. display: flex;
  122. align-items: center;
  123. height: 35px;
  124. margin-left: 10px;
  125. }
  126. </style>