FastOutStoreInspect01.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  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. <uni-section title="交验单数据:" type="line" style="margin-bottom: 3px;padding: 3px;">
  18. <view class="my-tips-view" v-if="isShowTips">没有查询到交验单数据......</view>
  19. <view class="uni-navigate-item1 uni-flex uni-row" style="-webkit-justify-content: space-between;justify-content: space-between;"
  20. v-for="(item,key) in deliverList" :key="key" @click="goDetailPage(item)">
  21. <text class="uni-navigate-text">{{item.deliverNo}}</text>
  22. <text class="uni-navigate-icon uni-icon">&#xe470;</text>
  23. </view>
  24. <view v-if="!isShowTips" style="text-align: center; margin-top: 10px;">
  25. <text class="example-info">数据总量:{{ total }}条,每页数据:{{ pageSize }}</text>
  26. </view>
  27. <uni-pagination :total="total" :current="current" :pageSize="pageSize" @change="pageChange" title="标题文字" v-if="!isShowTips" style="margin: 10px;"/>
  28. </uni-section>
  29. </view>
  30. </template>
  31. <script>
  32. // TODO 修复Android v3 加载过慢问题
  33. // #ifdef APP-PLUS
  34. var domModule = weex.requireModule('dom');
  35. domModule.addRule('fontFace', {
  36. 'fontFamily': "uniicons",
  37. 'src': "url('/static/uni.ttf')"
  38. });
  39. // #endif
  40. export default {
  41. data() {
  42. return {
  43. title: '没有查询到校验单数据......',
  44. deliverNo : '',
  45. bomNo: '',
  46. isShowTips: true,
  47. deliverList:[],
  48. foucusIndex: 0,
  49. current: 1,
  50. total: 0,
  51. pageSize: 10
  52. }
  53. },
  54. onLoad() {
  55. this.queryFun()
  56. uni.$on('QueryInspect01', this.QueryInspect01)
  57. },
  58. onUnload() {
  59. uni.$off('QueryInspect01', this.QueryInspect01)
  60. },
  61. methods: {
  62. async queryFun() {
  63. uni.showLoading({
  64. title: "正在查询...",
  65. mask: true,
  66. })
  67. this.deliverList = []
  68. let parm = {
  69. url : '/business/SapDeliverRecord/QuerySapDeliverData',
  70. data: {
  71. DeliverNo: this.deliverNo,
  72. BomNo: this.bomNo,
  73. IsPrintQuery: false,
  74. PageNum: this.current,
  75. PageSize: this.pageSize
  76. },
  77. method: 'POST',
  78. isHaveToken : true
  79. }
  80. let retData = await getApp().RequestData(parm)
  81. if(retData.isSuccess) {
  82. if(retData.data.code == 200) {
  83. let len = retData.data.data.result.length
  84. this.total = retData.data.data.totalNum
  85. for (let i = 0; i < len; i++) {
  86. this.deliverList.push({
  87. deliverid: i + 1,
  88. deliverNo: retData.data.data.result[i].deliverNo
  89. });
  90. }
  91. if(len > 0) {
  92. this.isShowTips = false
  93. }
  94. else {
  95. this.isShowTips = true
  96. }
  97. }
  98. else {
  99. this.isShowTips = true
  100. }
  101. }
  102. else {
  103. this.isShowTips = true
  104. }
  105. uni.hideLoading()
  106. },
  107. resetCondition() {
  108. this.deliverNo = ''
  109. this.bomNo = ''
  110. this.foucusIndex = 0
  111. },
  112. goDetailPage(item) {
  113. let urlStr = '/pages/Inspect/FastOutStoreInspectDtl?deliverNo=' + item.deliverNo;
  114. uni.navigateTo({
  115. url: urlStr
  116. });
  117. },
  118. foucusChange0(event) {
  119. let str = event.detail.value
  120. if(str.length !== 0) {
  121. this.foucusIndex = 1
  122. }
  123. },
  124. foucusChange1(event) {
  125. let str = event.detail.value
  126. if(str.length !== 0) {
  127. this.foucusIndex = 2
  128. }
  129. },
  130. pageChange(e) {
  131. this.current = e.current
  132. this.queryFun()
  133. },
  134. QueryInspect01() {
  135. this.queryFun()
  136. }
  137. }
  138. }
  139. </script>
  140. <style lang="scss">
  141. @import '@/common/uni-nvue.css';
  142. .uni-navigate-icon-01 {
  143. color: #999999;
  144. font-size: 14px;
  145. font-weight: normal;
  146. }
  147. .uni-navigate-item1 {
  148. align-items: center;
  149. background-color: #f5f5f5;
  150. border-top-style: solid;
  151. border-top-color: #f0f0f0;
  152. border-top-width: 1px;
  153. padding: 12px;
  154. cursor: pointer;
  155. margin-bottom: 1px;
  156. }
  157. .uni-navigate-item1:active {
  158. background-color: #007AFF;
  159. }
  160. .my-tips-view {
  161. margin-top: 50px;
  162. text-align: center;
  163. color: #999999;
  164. font-size: 20px;
  165. font-weight: normal;
  166. }
  167. </style>