FastOutStoreInspectOperate.vue 6.8 KB

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