instoreOperate.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <template>
  2. <view>
  3. <view style="flex-direction: row;flex-direction: row;display: flex;padding: 2px;margin-top: 5px;">
  4. <text style="align-self: center;font-size: 35rpx;color: darkslategray;">交验单号:</text>
  5. <text style="align-self: center;font-size: 35rpx;word-wrap: break-word;width: 200px;font-weight: bold;">{{deliverDtlMd.deliverNo}}</text>
  6. </view>
  7. <view style="flex-direction: row;flex-direction: row;display: flex;padding: 2px;">
  8. <text style="align-self: center;font-size: 35rpx;color: darkslategray;">生产令号:</text>
  9. <text style="align-self: center;font-size: 35rpx;word-wrap: break-word;width: 200px;font-weight: bold;">{{deliverDtlMd.bomNo}}</text>
  10. </view>
  11. <view style="flex-direction: row;flex-direction: row;display: flex;padding: 2px;">
  12. <text style="align-self: center;font-size: 35rpx;color: darkslategray;">物料号:</text>
  13. <text style="align-self: center;font-size: 35rpx;word-wrap: break-word;width: 200px;font-weight: bold;">{{deliverDtlMd.materialCode}}</text>
  14. </view>
  15. <view style="flex-direction: row;flex-direction: row;display: flex;padding: 2px;">
  16. <text style="align-self: center;font-size: 35rpx;color: darkslategray;">物料名称:</text>
  17. <text style="align-self: center;font-size: 35rpx;word-wrap: break-word;width: 200px;font-weight: bold;">{{deliverDtlMd.materialName}}</text>
  18. </view>
  19. <view style="flex-direction: row;flex-direction: row;display: flex;padding: 2px;">
  20. <text style="align-self: center;font-size: 35rpx;color: darkslategray;">规格型号/图号:</text>
  21. <text style="align-self: center;font-size: 35rpx;word-wrap: break-word;width: 200px;font-weight: bold;">{{deliverDtlMd.materialSpec}}</text>
  22. </view>
  23. <view style="flex-direction: row;flex-direction: row;display: flex;padding: 2px;">
  24. <text style="align-self: center;font-size: 35rpx;color: darkslategray;">BN/SN码:</text>
  25. <text style="align-self: center;font-size: 35rpx;word-wrap: break-word;width: 200px;font-weight: bold;">{{deliverDtlMd.bnSnCode}}</text>
  26. </view>
  27. <view style="flex-direction: row;flex-direction: row;display: flex;padding: 1px;">
  28. <text style="align-self: center;font-size: 35rpx;color: darkslategray;">质检合格数量:</text>
  29. <text style="align-self: center;font-size: 40rpx;font-weight: bold;">{{deliverDtlMd.checkQty}}</text>
  30. </view>
  31. <view style="flex-direction: row;flex-direction: row;display: flex;padding: 1px;">
  32. <text style="align-self: center;font-size: 35rpx;color: darkslategray;">已入库数量:</text>
  33. <text style="align-self: center;font-size: 40rpx;font-weight: bold;color: blue;">{{deliverDtlMd.instoreQty}}</text>
  34. </view>
  35. <view style="flex-direction: row;flex-direction: row;display: flex;padding: 2px; margin-top: 5px;">
  36. <text style="align-self: center;font-size: 35rpx;color: darkslategray;">本次入库数量:</text>
  37. <input class="uni-input" type="number" style="margin-right: 5px;font-size: 40rpx;font-weight: bold;" v-model="instoreNum"/>
  38. </view>
  39. <button type="primary" style="margin-top: 15px;" @click="submitResult">入库结果提交</button>
  40. </view>
  41. </template>
  42. <script>
  43. export default {
  44. data() {
  45. return {
  46. deliverDtlMd: {},
  47. instoreNum: ''
  48. }
  49. },
  50. onUnload() {
  51. },
  52. onLoad() {
  53. uni.$once('sendCheckedDeliverDtlData', (data) => {
  54. this.deliverDtlMd = data
  55. this.instoreNum = data.checkQty
  56. })
  57. },
  58. methods: {
  59. async submitResult() {
  60. if(Number(this.instoreNum) <= 0) {
  61. uni.showToast({
  62. title: '入库数量不能为:0!',
  63. icon: 'none',
  64. mask: true,
  65. duration: 1000
  66. })
  67. return;
  68. }
  69. if((Number(this.instoreNum) + this.deliverDtlMd.instoreQty) > this.deliverDtlMd.checkQty) {
  70. uni.showToast({
  71. title: '本次入库数量录入错误,数量不能大于未入库数量!',
  72. icon: 'none',
  73. mask: true,
  74. duration: 1000
  75. })
  76. return;
  77. }
  78. uni.showLoading({
  79. title: "正在提交数据...",
  80. mask: true,
  81. })
  82. let tmpMd = this.deliverDtlMd;
  83. tmpMd.instoreQty = this.instoreNum;
  84. let parm = {
  85. url : '/business/InInstoreRecord/AddCheckedSapDeliverInstoreDtlResult',
  86. data: tmpMd,
  87. method: 'POST',
  88. isHaveToken : true
  89. }
  90. let retData = await getApp().RequestData(parm)
  91. if(retData.isSuccess) {
  92. if(retData.data.code == 200) {
  93. uni.navigateBack({
  94. url: '/pages/Inspect/inspectDtl',
  95. success: () => {
  96. uni.hideLoading()
  97. uni.$emit('addInstoreData',tmpMd);
  98. }
  99. });
  100. }
  101. else {
  102. uni.hideLoading()
  103. uni.showToast({
  104. title: '提交数据失败!' + retData.data.msg,
  105. icon: 'none',
  106. mask: true,
  107. duration: 1000,
  108. success: () => {
  109. tmpMd.instoreQty = 0;
  110. }
  111. })
  112. }
  113. }
  114. else {
  115. uni.hideLoading()
  116. uni.showToast({
  117. title: '接口异常!' + retData.retMsg,
  118. icon: 'none',
  119. mask: true,
  120. duration: 1000,
  121. success: () => {
  122. tmpMd.instoreQty = 0;
  123. }
  124. })
  125. }
  126. },
  127. isEmptyStr(s) {
  128. if (s == undefined || s === '') {
  129. return true
  130. }
  131. return false
  132. },
  133. foucusChange0(event) {
  134. let str = event.detail.value
  135. if(str.length !== 0) {
  136. this.foucusIndex = 1
  137. }
  138. },
  139. foucusChange1(event) {
  140. let str = event.detail.value
  141. if(str.length !== 0) {
  142. this.foucusIndex = 2
  143. }
  144. }
  145. }
  146. }
  147. </script>
  148. <style lang="scss">
  149. @import '@/common/uni-nvue.css';
  150. </style>