FastOutStoreInspectOperate.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <template>
  2. <view style="padding: 3px;">
  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.materialCode}}</text>
  10. </view>
  11. <view style="flex-direction: row;flex-direction: row;display: flex;padding: 2px;margin-top: 5px;margin-bottom: 5px;">
  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.materialName}}</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.materialSpec}}</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: 40rpx;font-weight: bold;">{{deliverDtlMd.sumQty}}</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;">已质检数量:</text>
  25. <text style="align-self: center;font-size: 40rpx;font-weight: bold;color: blue;">{{deliverDtlMd.sumCheckQty}}</text>
  26. </view>
  27. <view style="flex-direction: row;flex-direction: row;display: flex;padding: 2px; ">
  28. <text style="align-self: center;font-size: 35rpx;color: darkslategray;width: 230rpx;">BN/SN码:</text>
  29. <input class="uni-input" style="margin-right: 5px;font-size: 40rpx;font-weight: bold;" v-model="bnSnCode" :focus="foucusIndex === 0" placeholder="请输BN/SN码" />
  30. </view>
  31. <view style="flex-direction: row;flex-direction: row;display: flex;padding: 2px;">
  32. <text style="align-self: center;font-size: 35rpx;color: darkslategray;width: 230rpx;">合格数量:</text>
  33. <input class="uni-input" type="number" style="margin-right: 5px;color: blue;font-size: 40rpx;font-weight: bold;" v-model="checkOkQty" placeholder="请输合格数量" />
  34. </view>
  35. <view style="flex-direction: row;flex-direction: row;display: flex;padding: 2px;">
  36. <text style="align-self: center;font-size: 35rpx;color: red;width: 230rpx;">不合格数量:</text>
  37. <input class="uni-input" type="number" style="margin-right: 5px;color: red;font-size: 40rpx;font-weight: bold;" v-model="checkNgQty" placeholder="请输不合格数量" />
  38. </view>
  39. <button type="primary" style="margin-top: 20px;" @click="resetCondition">重 置</button>
  40. <button type="primary" style="margin-top: 20px;" @click="submitResult">质检结果&#8194;==>>&#8194;快速出库过账</button>
  41. </view>
  42. </template>
  43. <script>
  44. export default {
  45. data() {
  46. return {
  47. deliverDtlMd: {},
  48. bnSnCode: '',
  49. checkOkQty: 0,
  50. checkNgQty: 0,
  51. foucusIndex: 0
  52. }
  53. },
  54. onUnload() {
  55. },
  56. onLoad() {
  57. uni.$once('sendDeliverDtlData', (data) => {
  58. this.deliverDtlMd = data
  59. this.checkOkQty = data.sumQty - data.sumCheckQty
  60. })
  61. },
  62. methods: {
  63. async submitResult() {
  64. if(this.isEmptyStr(this.bnSnCode)) {
  65. uni.showToast({
  66. title: 'BN/SN码不能为空!',
  67. icon: 'none',
  68. duration: 1000
  69. })
  70. return;
  71. }
  72. if(Number(this.checkOkQty) <= 0 && Number(this.checkNgQty) <= 0) {
  73. uni.showToast({
  74. title: '质检合格数量和不合格数量,至少需要输入一项!',
  75. icon: 'none',
  76. duration: 1000
  77. })
  78. return;
  79. }
  80. if((Number(this.checkOkQty) + Number(this.checkNgQty) + this.deliverDtlMd.sumCheckQty) > this.deliverDtlMd.sumQty) {
  81. uni.showToast({
  82. title: '质检合格数量+不合格数量 不能大于未质检数量。录入错误!',
  83. icon: 'none',
  84. duration: 1000
  85. })
  86. return;
  87. }
  88. let tmpMd = this.deliverDtlMd;
  89. tmpMd.DeliverNo = this.deliverNo;
  90. tmpMd.MaterialSpec = this.materialSpecCode;
  91. tmpMd.BnSnCode = this.bnSnCode;
  92. tmpMd.CheckOkQty = this.checkOkQty;
  93. tmpMd.CheckNgQty = this.checkNgQty;
  94. let parm = {
  95. url : '/business/QaInspectRecord/InspectOneClickOutStore',
  96. data: tmpMd,
  97. method: 'POST',
  98. isHaveToken : true
  99. }
  100. let retData = await getApp().RequestData(parm)
  101. if(retData.isSuccess) {
  102. if(retData.data.code == 200) {
  103. uni.navigateBack({
  104. url: '/pages/Inspect/FastOutStoreInspectDtl',
  105. success: () => {
  106. uni.$emit('CallSapDeliverDtlQueryFunc',null);
  107. }
  108. });
  109. }
  110. else {
  111. uni.showToast({
  112. title: '提交数据失败!' + retData.data.msg,
  113. icon: 'none',
  114. duration: 1000
  115. })
  116. }
  117. }
  118. else {
  119. uni.showToast({
  120. title: '接口异常!' + retData.retMsg,
  121. icon: 'none',
  122. duration: 1000
  123. })
  124. }
  125. },
  126. isEmptyStr(s) {
  127. if (s == undefined || s === '') {
  128. return true
  129. }
  130. return false
  131. },
  132. foucusChange0(event) {
  133. let str = event.detail.value
  134. if(str.length !== 0) {
  135. this.foucusIndex = 1
  136. }
  137. },
  138. foucusChange1(event) {
  139. let str = event.detail.value
  140. if(str.length !== 0) {
  141. this.foucusIndex = 2
  142. }
  143. },
  144. resetCondition() {
  145. this.bnSnCode = ''
  146. this.foucusIndex = 1
  147. setTimeout(() => {
  148. this.foucusIndex = 0;
  149. }, 150)
  150. this.checkOkQty = this.deliverDtlMd.sumQty - this.deliverDtlMd.sumCheckQty
  151. this.checkNgQty = 0
  152. }
  153. }
  154. }
  155. </script>
  156. <style lang="scss">
  157. @import '@/common/uni-nvue.css';
  158. </style>