inspectOperate.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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: 1px;">
  24. <text style="align-self: center;font-size: 35rpx;color: darkslategray;">交验单数量:</text>
  25. <text style="align-self: center;font-size: 40rpx;font-weight: bold;">{{deliverDtlMd.qty}}</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;color: blue;">{{deliverDtlMd.checkQty}}</text>
  30. </view>
  31. <view style="flex-direction: row;flex-direction: row;display: flex;padding: 2px; margin-top: 5px;">
  32. <text style="align-self: center;font-size: 35rpx;color: darkslategray;">BN/SN码:</text>
  33. <input class="uni-input" style="margin-right: 5px;" v-model="bnSnCode" :focus="foucusIndex === 0" @confirm="foucusChange0" placeholder="请输BN/SN码" />
  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;" v-model="checkOkQty" :focus="foucusIndex === 1" @confirm="foucusChange1" placeholder="请输合格数量" />
  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. bnSnCode: '',
  48. checkOkQty: '',
  49. foucusIndex: 0
  50. }
  51. },
  52. onUnload() {
  53. },
  54. onLoad() {
  55. uni.$once('sendDeliverDtlData', (data) => {
  56. this.deliverDtlMd = data
  57. })
  58. },
  59. methods: {
  60. async submitResult() {
  61. // let that = this;
  62. if(this.isEmptyStr(this.bnSnCode)) {
  63. uni.showToast({
  64. title: 'BN/SN码不能为空!',
  65. icon: 'none',
  66. duration: 1000
  67. })
  68. return;
  69. }
  70. if(Number(this.checkOkQty) <= 0) {
  71. uni.showToast({
  72. title: '未输入质检合格数量!',
  73. icon: 'none',
  74. duration: 1000
  75. })
  76. return;
  77. }
  78. if((Number(this.checkOkQty) + this.deliverDtlMd.checkQty) > this.deliverDtlMd.qty) {
  79. uni.showToast({
  80. title: '质检合格数量录入错误,数量不能大于未录入数!',
  81. icon: 'none',
  82. duration: 1000
  83. })
  84. return;
  85. }
  86. let tmpMd = this.deliverDtlMd;
  87. tmpMd.bnSnCode = this.bnSnCode;
  88. tmpMd.checkOkQty = this.checkOkQty;
  89. let parm = {
  90. url : '/business/QaInspectRecord/addSapDeliverDtlInspectResult',
  91. data: tmpMd,
  92. method: 'POST',
  93. isHaveToken : true
  94. }
  95. let retData = await getApp().RequestData(parm)
  96. if(retData.isSuccess) {
  97. if(retData.data.code == 200) {
  98. uni.navigateBack({
  99. url: '/pages/Inspect/inspectDtl',
  100. success: () => {
  101. uni.$emit('addInspectedData',tmpMd);
  102. }
  103. });
  104. }
  105. else {
  106. uni.showToast({
  107. title: '提交数据失败!' + retData.data.msg,
  108. icon: 'none',
  109. duration: 1000
  110. })
  111. }
  112. }
  113. else {
  114. uni.showToast({
  115. title: '接口异常!' + retData.retMsg,
  116. icon: 'none',
  117. duration: 1000
  118. })
  119. }
  120. },
  121. isEmptyStr(s) {
  122. if (s == undefined || s === '') {
  123. return true
  124. }
  125. return false
  126. },
  127. foucusChange0(event) {
  128. let str = event.detail.value
  129. if(str.length !== 0) {
  130. this.foucusIndex = 1
  131. }
  132. },
  133. foucusChange1(event) {
  134. let str = event.detail.value
  135. if(str.length !== 0) {
  136. this.foucusIndex = 2
  137. }
  138. }
  139. }
  140. }
  141. </script>
  142. <style lang="scss">
  143. @import '@/common/uni-nvue.css';
  144. </style>