instoreDtlNew.vue 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  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: 190rpx;">交验单号:</view>
  6. <input class="uni-input" style="margin-right: 5px;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: 190rpx;">规格型号\图号:</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="queryClick">查 询</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. <uni-pagination :total="total" :current="current" :pageSize="pageSize" @change="pageChange" title="标题文字" v-if="!isShowTips" style="margin: 4px;"/>
  20. <view v-if="!isShowTips" style="text-align: center;">
  21. <text class="example-info">数据总量:{{ total }}条,每页数据:{{ pageSize }}</text>
  22. </view>
  23. <view v-for="(newsitem,key) in inspectRecordList" :key="key">
  24. <view class="myDeliverDetail" @click="myDeliverDetailClick(newsitem)">
  25. <view style="flex-direction: row;flex-direction: row;height: 25px;display: flex;padding: 2px;border-radius: 5px 5px;">
  26. <text style="align-self: center;">物料编号:</text>
  27. <text style="align-self: center;font-size: 30rpx;font-weight: bold;">{{newsitem.materialCode}}</text>
  28. <text :class="newsitem.keyFlag ? 'keyFlagRed' : 'keyFlagGray'" style="align-self: center;margin-left: 20px;">{{newsitem.keyFlag ? '★' : '■'}}</text>
  29. </view>
  30. <view class="line-h"></view>
  31. <view style="flex-direction: row;flex-direction: row;display: flex;-webkit-justify-content: space-between;justify-content: space-between;">
  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: 25rpx;word-wrap: break-word;width: 200px;">{{newsitem.materialName}}</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.materialSpec}}</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;">生产令号:</text>
  43. <text style="align-self: center;font-size: 35rpx;font-weight: bold;color: blue;word-wrap: break-word;width: 200px;">{{newsitem.bomNo}}</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;">BN/SN:</text>
  47. <text style="align-self: center;font-size: 30rpx;font-weight: bold;word-wrap: break-word;width: 200px;">{{newsitem.bnSnCode}}</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: 30rpx;font-weight: bold;">{{newsitem.checkQty}}</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: 35rpx;font-weight: bold;color: red;">{{newsitem.instoreQty}}</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.inspectedBy}}</text>
  60. </view>
  61. <view style="flex-direction: row;flex-direction: row;display: flex;padding: 2px;">
  62. <text style="align-self: center;color: #555;font-size: 25rpx;">质检时间:</text>
  63. <text style="align-self: center;font-size: 30rpx;">{{newsitem.inspectTime}}</text>
  64. </view>
  65. </view>
  66. <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>
  67. <view v-else style="border-radius: 35px;width: 35px; background-color: lightgray;height: 35px;align-self: center;margin-right: 5px;"></view>
  68. </view>
  69. </view>
  70. </view>
  71. </uni-section>
  72. </view>
  73. </template>
  74. <script>
  75. export default {
  76. data() {
  77. return {
  78. deliverNo: '',
  79. foucusIndex: 0,
  80. materialSpecCode: '',
  81. isShowTips: true,
  82. inspectRecordList:[],
  83. current: 1,
  84. total: 0,
  85. pageSize: 10,
  86. }
  87. },
  88. onLoad(option) {
  89. this.deliverNo = option.deliverNo;
  90. uni.$on('addInstoreData', this.addInstoreData)
  91. this.QueryNotInstoreData(option.deliverNo)
  92. },
  93. onUnload() {
  94. uni.$off('addInstoreData', this.addInstoreData)
  95. },
  96. methods: {
  97. async queryClick() {
  98. if(!this.isEmptyStr(this.materialSpecCode)) {
  99. await this.queryFun()
  100. }
  101. else {
  102. await this.QueryNotInstoreData(this.deliverNo)
  103. }
  104. },
  105. async queryFun() {
  106. if(this.isEmptyStr(this.materialSpecCode)) {
  107. uni.showToast({
  108. title: '物料信息 不能为空!',
  109. icon: 'none',
  110. duration: 1500,
  111. mask:true,
  112. })
  113. this.foucusIndex = 1
  114. setTimeout(() => {
  115. this.foucusIndex = 0;
  116. }, 150)
  117. return
  118. }
  119. uni.showLoading({
  120. title: "正在查询...",
  121. mask: true,
  122. })
  123. this.inspectRecordList = []
  124. let parm = {
  125. url : '/business/QaInspectRecord/QueryInspectRecordData?deliverNo=' + this.deliverNo + '&materialSpecCode=' + this.materialSpecCode,
  126. data: {
  127. },
  128. method: 'POST',
  129. isHaveToken : true
  130. }
  131. let retData = await getApp().RequestData(parm)
  132. // console.log(retData)
  133. if(retData.isSuccess) {
  134. if(retData.data.code == 200) {
  135. let len = retData.data.data.length
  136. this.inspectRecordList = retData.data.data
  137. if(len > 0) {
  138. this.isShowTips = false;
  139. }
  140. else {
  141. this.isShowTips = true;
  142. }
  143. }
  144. else {
  145. this.isShowTips = true
  146. }
  147. }
  148. else {
  149. this.isShowTips = true
  150. }
  151. uni.hideLoading()
  152. },
  153. resetCondition() {
  154. this.materialSpecCode = ''
  155. // this.inspectRecordList = []
  156. this.isShowTips = true
  157. // this.foucusIndex = 1
  158. // setTimeout(() => {
  159. // this.foucusIndex = 0;
  160. // }, 150)
  161. this.QueryNotInstoreData(this.deliverNo)
  162. },
  163. ResetFoucus() {
  164. this.foucusIndex = 1
  165. setTimeout(() => {
  166. this.foucusIndex = 0;
  167. }, 150)
  168. },
  169. isEmptyStr(s) {
  170. if (s == undefined || s === '') {
  171. return true
  172. }
  173. return false
  174. },
  175. myDeliverDetailClick(model) {
  176. model.deliverNo = this.deliverNo;
  177. if(model.instoreQty >= model.checkQty) {
  178. uni.showToast({
  179. title: '已全部入库',
  180. icon: 'error',
  181. mask: true,
  182. duration: 1500
  183. })
  184. } else {
  185. uni.navigateTo({
  186. url: '/pages/Instore/instoreOperate',
  187. success() {
  188. uni.$emit('sendCheckedDeliverDtlData',model)
  189. // console.log(model)
  190. }
  191. });
  192. }
  193. } ,
  194. addInstoreData(data) {
  195. // this.inspectRecordList.forEach((item) => {
  196. // if(item.inspectId === data.inspectId) {
  197. // item.instoreQty += Number(data.instoreQty);
  198. // }
  199. // })
  200. // let isFinish = this.inspectRecordList.some(x => x.instoreQty < x.checkQty)
  201. // if(!isFinish) {
  202. // this.resetCondition()
  203. // }
  204. // else {
  205. // this.queryFun()
  206. // }
  207. this.QueryNotInstoreData(this.deliverNo)
  208. },
  209. confirmFun() {
  210. this.queryFun()
  211. },
  212. pageChange(e) {
  213. this.current = e.current
  214. this.QueryNotInstoreData(this.deliverNo)
  215. },
  216. async QueryNotInstoreData(deliverNoStr) {
  217. this.inspectRecordList = []
  218. let parm = {
  219. url : '/business/QaInspectRecord/QueryNotInstoreData',
  220. data: {
  221. DeliverNo: deliverNoStr,
  222. PageNum: this.current,
  223. PageSize: this.pageSize
  224. },
  225. method: 'POST',
  226. isHaveToken : true
  227. }
  228. uni.showLoading({
  229. title: "正在查询...",
  230. mask: true,
  231. })
  232. let retData = await getApp().RequestData(parm)
  233. if(retData.isSuccess) {
  234. if(retData.data.code == 200) {
  235. // let len = retData.data.data.length
  236. // this.inspectRecordList = retData.data.data
  237. let len = retData.data.data.result.length
  238. this.total = retData.data.data.totalNum
  239. if(len > 0) {
  240. this.isShowTips = false
  241. }
  242. else {
  243. this.isShowTips = true
  244. }
  245. this.inspectRecordList = retData.data.data.result
  246. }
  247. else {
  248. this.isShowTips = true
  249. }
  250. }
  251. else {
  252. this.isShowTips = true
  253. }
  254. this.ResetFoucus()
  255. uni.hideLoading()
  256. }
  257. }
  258. }
  259. </script>
  260. <style lang="scss">
  261. .my-tips-view {
  262. /* margin-top: 50px; */
  263. text-align: center;
  264. color: #999999;
  265. font-size: 20px;
  266. font-weight: normal;
  267. }
  268. .myDeliverDetail {
  269. border: 1px solid #cccccc;
  270. border-radius: 5px;
  271. margin-top: 1px;
  272. }
  273. .myDeliverDetail:active {
  274. background-color: aliceblue;
  275. }
  276. .line-h {
  277. height: 1rpx;
  278. background-color: #cccccc;
  279. }
  280. .keyFlagRed {
  281. color: red;
  282. }
  283. .keyFlagGray {
  284. color: lightgray;
  285. }
  286. </style>