instroe01.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <template>
  2. <view>
  3. <view class="uni-form-item uni-column">
  4. <view class="uni-flex uni-row">
  5. <view class="title">交验单号:</view>
  6. <input class="uni-input" style="-webkit-flex: 1;flex: 1;margin-right: 5px;" v-model="deliverNo" :focus="foucusIndex === 0" placeholder="请输入交验单号" @confirm="foucusChange0"/>
  7. </view>
  8. <view class="uni-flex uni-row" style="margin-top: 3px;margin-bottom: 3px;">
  9. <view class="title">生产令号:</view>
  10. <input class="uni-input" style="margin-right: 5px;" :focus="foucusIndex === 1" v-model="bomNo" placeholder="请输入生产令号" @confirm="foucusChange1"/>
  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. <view style="margin-left: 5px;margin-right: 5px;">
  18. <view style="margin-left: 10px;margin-bottom: 5px;">已质检完成的交验单数据:</view>
  19. <view class="my-tips-view" v-if="isShowTips">没有查询到交验单数据......</view>
  20. <view class="uni-navigate-item1 uni-flex uni-row" style="-webkit-justify-content: space-between;justify-content: space-between;"
  21. v-for="(item,key) in deliverList" :key="key" @click="goDetailPage(item)">
  22. <text class="uni-navigate-text">{{item.deliverNo}}</text>
  23. <text class="uni-navigate-icon uni-icon">&#xe470;</text>
  24. </view>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. // TODO 修复Android v3 加载过慢问题
  30. // #ifdef APP-PLUS
  31. var domModule = weex.requireModule('dom');
  32. domModule.addRule('fontFace', {
  33. 'fontFamily': "uniicons",
  34. 'src': "url('/static/uni.ttf')"
  35. });
  36. // #endif
  37. export default {
  38. data() {
  39. return {
  40. title: '没有查询到校验单数据......',
  41. deliverNo : '',
  42. bomNo: '',
  43. isShowTips: true,
  44. deliverList:[],
  45. foucusIndex: 0
  46. }
  47. },
  48. methods: {
  49. initData() {
  50. this.deliverList = []
  51. let random = Math.round(Math.random()*10)
  52. let random1 = Math.round(Math.random()*80+10)
  53. if(random)
  54. {
  55. for(let i = 1; i <= random; i++) {
  56. this.deliverList.push({
  57. deliverid: i,
  58. deliverNo: 'JC-JY-23021400' + (i + random1)
  59. });
  60. }
  61. this.isShowTips = false;
  62. }
  63. else {
  64. this.isShowTips = true;
  65. }
  66. },
  67. async queryFun() {
  68. uni.showLoading({
  69. title: "正在查询...",
  70. mask: true,
  71. })
  72. this.deliverList = []
  73. let parm = {
  74. url : '/business/QaInspectRecord/QueryCheckedSapDeliverData',
  75. data: {
  76. DeliverNo: this.deliverNo,
  77. BomNo: this.bomNo
  78. },
  79. method: 'POST',
  80. isHaveToken : true
  81. }
  82. let retData = await getApp().RequestData(parm)
  83. // console.log(retData)
  84. if(retData.isSuccess) {
  85. if(retData.data.code == 200) {
  86. let len = retData.data.data.length
  87. for (let i = 0; i < len; i++) {
  88. this.deliverList.push({
  89. deliverid: i + 1,
  90. deliverNo: retData.data.data[i].deliverNo
  91. });
  92. }
  93. if(len > 0) {
  94. this.isShowTips = false
  95. }
  96. else {
  97. this.isShowTips = true
  98. }
  99. }
  100. else {
  101. this.isShowTips = true
  102. }
  103. }
  104. else {
  105. this.isShowTips = true
  106. }
  107. uni.hideLoading()
  108. },
  109. resetCondition() {
  110. this.deliverNo = ''
  111. this.bomNo = ''
  112. this.foucusIndex = 0
  113. },
  114. goDetailPage(item) {
  115. let urlStr = '/pages/Instore/instoreDtlNew?deliverNo=' + item.deliverNo;
  116. uni.navigateTo({
  117. url: urlStr
  118. });
  119. },
  120. foucusChange0(event) {
  121. let str = event.detail.value
  122. if(str.length !== 0) {
  123. this.foucusIndex = 1
  124. }
  125. },
  126. foucusChange1(event) {
  127. let str = event.detail.value
  128. if(str.length !== 0) {
  129. this.foucusIndex = 2
  130. }
  131. }
  132. }
  133. }
  134. </script>
  135. <style lang="scss">
  136. @import '@/common/uni-nvue.css';
  137. .uni-navigate-icon-01 {
  138. //margin-left: 200px;
  139. // margin-right: 5px;
  140. color: #999999;
  141. font-size: 14px;
  142. font-weight: normal;
  143. }
  144. .uni-navigate-item1 {
  145. align-items: center;
  146. background-color: #FFFFFF;
  147. border-top-style: solid;
  148. border-top-color: #f0f0f0;
  149. border-top-width: 1px;
  150. padding: 12px;
  151. cursor: pointer;
  152. }
  153. .uni-navigate-item1:active {
  154. background-color: #007AFF;
  155. }
  156. .my-tips-view {
  157. margin-top: 50px;
  158. text-align: center;
  159. color: #999999;
  160. font-size: 20px;
  161. font-weight: normal;
  162. }
  163. </style>