instoreDtlNew.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. <template>
  2. <view>
  3. <view class="uni-form-item uni-column">
  4. <view class="uni-flex uni-row">
  5. <view class="title" style="width: 120rpx;">交验单号:</view>
  6. <input class="uni-input" style="font-size: 40rpx;font-weight: bold;color: black;" disabled="true" v-model="deliverNo"/>
  7. </view>
  8. <view class="uni-flex uni-row" style="margin-top: 3px;margin-bottom: 3px;">
  9. <view class="title" style="width: 120rpx;">物料号:</view>
  10. <input class="uni-input" style="margin-right: 5px;" :focus="foucusIndex === 0" v-model="materialSpecCode" placeholder="请输入物料信息" @confirm="confirmFun"/>
  11. </view>
  12. <view class="uni-flex uni-row">
  13. <button type="primary" style="-webkit-flex: 1;flex: 1;margin-left: 5px;" @click="queryFun">查 询</button>
  14. <button type="primary" style="-webkit-flex: 1;flex: 1;margin-left: 5px;margin-right: 5px;" @click="resetCondition">重 置</button>
  15. </view>
  16. </view>
  17. <uni-section title="待入库的质检记录数据:" type="line" style="margin-bottom: 3px;padding: 3px;">
  18. <view class="my-tips-view" v-if="isShowTips">没有查询到数据......</view>
  19. <view v-for="(newsitem,key) in inspectRecordList" :key="key">
  20. <view class="myDeliverDetail" @click="myDeliverDetailClick(newsitem)">
  21. <view style="flex-direction: row;flex-direction: row;height: 25px;display: flex;padding: 2px;border-radius: 5px 5px;">
  22. <text style="align-self: center;">物料编号:</text>
  23. <text style="align-self: center;font-size: 30rpx;font-weight: bold;">{{newsitem.materialCode}}</text>
  24. <text :class="newsitem.keyFlag ? 'keyFlagRed' : 'keyFlagGray'" style="align-self: center;margin-left: 20px;">{{newsitem.keyFlag ? '★' : '■'}}</text>
  25. </view>
  26. <view class="line-h"></view>
  27. <view style="flex-direction: row;flex-direction: row;display: flex;-webkit-justify-content: space-between;justify-content: space-between;">
  28. <view>
  29. <view style="flex-direction: row;flex-direction: row;display: flex;padding: 2px;">
  30. <text style="align-self: center;color: #555;font-size: 25rpx;">物料名称:</text>
  31. <text style="align-self: center;font-size: 25rpx;word-wrap: break-word;width: 200px;">{{newsitem.materialName}}</text>
  32. </view>
  33. <view style="flex-direction: row;flex-direction: row;display: flex;padding: 2px;">
  34. <text style="align-self: center;color: #555;font-size: 25rpx;">规格型号/图号:</text>
  35. <text style="align-self: center;font-size: 35rpx;font-weight: bold;color: blue;word-wrap: break-word;width: 200px;">{{newsitem.materialSpec}}</text>
  36. </view>
  37. <view style="flex-direction: row;flex-direction: row;display: flex;padding: 2px;">
  38. <text style="align-self: center;color: #555;font-size: 25rpx;">生产令号:</text>
  39. <text style="align-self: center;font-size: 35rpx;font-weight: bold;color: blue;word-wrap: break-word;width: 200px;">{{newsitem.bomNo}}</text>
  40. </view>
  41. <view style="flex-direction: row;flex-direction: row;display: flex;padding: 2px;">
  42. <text style="align-self: center;color: #555;font-size: 25rpx;">BN/SN:</text>
  43. <text style="align-self: center;font-size: 30rpx;font-weight: bold;word-wrap: break-word;width: 200px;">{{newsitem.bnSnCode}}</text>
  44. </view>
  45. <view style="flex-direction: row;flex-direction: row;display: flex;padding: 2px;">
  46. <text style="align-self: center;color: #555;font-size: 25rpx;">质检合格数量:</text>
  47. <text style="align-self: center;font-size: 30rpx;font-weight: bold;">{{newsitem.checkQty}}</text>
  48. </view>
  49. <view style="flex-direction: row;flex-direction: row;display: flex;padding: 2px;">
  50. <text style="align-self: center;color: #555;font-size: 25rpx;">已入库数量:</text>
  51. <text style="align-self: center;font-size: 35rpx;font-weight: bold;color: red;">{{newsitem.instoreQty}}</text>
  52. </view>
  53. <view style="flex-direction: row;flex-direction: row;display: flex;padding: 2px;">
  54. <text style="align-self: center;color: #555;font-size: 25rpx;">质检人:</text>
  55. <text style="align-self: center;font-size: 30rpx;">{{newsitem.inspectedBy}}</text>
  56. </view>
  57. <view style="flex-direction: row;flex-direction: row;display: flex;padding: 2px;">
  58. <text style="align-self: center;color: #555;font-size: 25rpx;">质检时间:</text>
  59. <text style="align-self: center;font-size: 30rpx;">{{newsitem.inspectTime}}</text>
  60. </view>
  61. </view>
  62. <view v-if="newsitem.instoreQty < newsitem.checkQty" style="border-radius: 35px;width: 35px; background-color: lime;height: 35px;align-self: center;margin-right: 5px;"></view>
  63. <view v-else style="border-radius: 35px;width: 35px; background-color: lightgray;height: 35px;align-self: center;margin-right: 5px;"></view>
  64. </view>
  65. </view>
  66. </view>
  67. </uni-section>
  68. </view>
  69. </template>
  70. <script>
  71. export default {
  72. data() {
  73. return {
  74. deliverNo: '',
  75. foucusIndex: 0,
  76. materialSpecCode: '',
  77. isShowTips: true,
  78. inspectRecordList:[],
  79. }
  80. },
  81. onLoad(option) {
  82. this.deliverNo = option.deliverNo;
  83. uni.$on('addInstoreData', this.addInstoreData)
  84. },
  85. onUnload() {
  86. uni.$off('addInstoreData', this.addInstoreData)
  87. },
  88. methods: {
  89. async queryFun() {
  90. if(this.isEmptyStr(this.materialSpecCode)) {
  91. uni.showToast({
  92. title: '物料信息 不能为空!',
  93. icon: 'none',
  94. duration: 1500,
  95. mask:true,
  96. })
  97. this.foucusIndex = 1
  98. setTimeout(() => {
  99. this.foucusIndex = 0;
  100. }, 150)
  101. return
  102. }
  103. uni.showLoading({
  104. title: "正在查询...",
  105. mask: true,
  106. })
  107. this.inspectRecordList = []
  108. let parm = {
  109. url : '/business/QaInspectRecord/QueryInspectRecordData?deliverNo=' + this.deliverNo + '&materialSpecCode=' + this.materialSpecCode,
  110. data: {
  111. },
  112. method: 'POST',
  113. isHaveToken : true
  114. }
  115. let retData = await getApp().RequestData(parm)
  116. // console.log(retData)
  117. if(retData.isSuccess) {
  118. if(retData.data.code == 200) {
  119. let len = retData.data.data.length
  120. this.inspectRecordList = retData.data.data
  121. if(len > 0) {
  122. this.isShowTips = false
  123. }
  124. else {
  125. this.isShowTips = true
  126. this.resetCondition()
  127. }
  128. }
  129. else {
  130. this.isShowTips = true
  131. this.resetCondition()
  132. }
  133. }
  134. else {
  135. this.isShowTips = true
  136. this.resetCondition()
  137. }
  138. uni.hideLoading()
  139. },
  140. resetCondition() {
  141. this.materialSpecCode = ''
  142. this.inspectRecordList = []
  143. this.isShowTips = true
  144. this.foucusIndex = 1
  145. setTimeout(() => {
  146. this.foucusIndex = 0;
  147. }, 150)
  148. },
  149. isEmptyStr(s) {
  150. if (s == undefined || s === '') {
  151. return true
  152. }
  153. return false
  154. },
  155. myDeliverDetailClick(model) {
  156. model.deliverNo = this.deliverNo;
  157. if(model.instoreQty >= model.checkQty) {
  158. uni.showToast({
  159. title: '已全部入库',
  160. icon: 'error',
  161. mask: true,
  162. duration: 1500
  163. })
  164. } else {
  165. uni.navigateTo({
  166. url: '/pages/Instore/instoreOperate',
  167. success() {
  168. uni.$emit('sendCheckedDeliverDtlData',model)
  169. // console.log(model)
  170. }
  171. });
  172. }
  173. },
  174. addInstoreData(data) {
  175. this.inspectRecordList.forEach((item) => {
  176. if(item.inspectId === data.inspectId) {
  177. item.instoreQty += Number(data.instoreQty);
  178. }
  179. })
  180. let isFinish = this.inspectRecordList.some(x => x.instoreQty < x.checkQty)
  181. if(!isFinish) {
  182. this.resetCondition()
  183. }
  184. else {
  185. this.queryFun()
  186. }
  187. },
  188. confirmFun() {
  189. this.queryFun()
  190. }
  191. }
  192. }
  193. </script>
  194. <style lang="scss">
  195. .my-tips-view {
  196. /* margin-top: 50px; */
  197. text-align: center;
  198. color: #999999;
  199. font-size: 20px;
  200. font-weight: normal;
  201. }
  202. .myDeliverDetail {
  203. border: 1px solid #cccccc;
  204. border-radius: 5px;
  205. margin-top: 1px;
  206. }
  207. .myDeliverDetail:active {
  208. background-color: aliceblue;
  209. }
  210. .line-h {
  211. height: 1rpx;
  212. background-color: #cccccc;
  213. }
  214. .keyFlagRed {
  215. color: red;
  216. }
  217. .keyFlagGray {
  218. color: lightgray;
  219. }
  220. </style>