outassemble01.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <template>
  2. <view>
  3. <view class="uni-form-item uni-column">
  4. <view class="uni-flex uni-row" style="margin-top: 3px;margin-bottom: 3px;">
  5. <view class="title" style="width: 180rpx;">生产令号:</view>
  6. <input class="uni-input" style="-webkit-flex: 1;flex: 1;margin-right: 5px;" v-model="bomNo" :focus="foucusIndex === 0" placeholder="请输入生产令号" @confirm="foucusChange0"/>
  7. </view>
  8. <view class="uni-flex uni-row">
  9. <button type="primary" style="-webkit-flex: 1;flex: 1;margin-left: 5px;" @click="queryFun">查询</button>
  10. <button type="primary" style="-webkit-flex: 1;flex: 1;margin-left: 5px;margin-right: 5px;" @click="resetCondition">重置条件</button>
  11. </view>
  12. </view>
  13. <uni-section title="关键件清单数据:" type="line" style="margin-bottom: 3px;padding: 3px;">
  14. <!-- <view style="margin-left: 10px;margin-bottom: 5px;">关键件清单数据:</view> -->
  15. <view class="my-tips-view" v-if="isShowTips">没有查询到关键件清单数据......</view>
  16. <view class="uni-navigate-item1 uni-flex uni-row" style="-webkit-justify-content: space-between;justify-content: space-between;"
  17. v-for="(item,key) in bomList" :key="key" @click="goDetailPage(item)">
  18. <text class="uni-navigate-text">{{item.bomNo}}</text>
  19. <text class="uni-navigate-icon uni-icon">&#xe470;</text>
  20. </view>
  21. <view v-if="!isShowTips" style="text-align: center; margin-top: 10px;">
  22. <text class="example-info">数据总量:{{ total }}条,每页数据:{{ pageSize }}</text>
  23. </view>
  24. <uni-pagination :total="total" :current="current" :pageSize="pageSize" @change="pageChange" title="标题文字" v-if="!isShowTips" style="margin: 10px;"/>
  25. </uni-section>
  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. bomNo: '',
  41. isShowTips: true,
  42. bomList:[],
  43. foucusIndex: 0,
  44. current: 1,
  45. total: 0,
  46. pageSize: 10
  47. }
  48. },
  49. methods: {
  50. async queryFun() {
  51. uni.showLoading({
  52. title: "正在查询...",
  53. mask: true,
  54. })
  55. this.bomList = []
  56. let parm = {
  57. url : '/business/SapBomRecord/QueryBomList',
  58. data: {
  59. BomNo: this.bomNo,
  60. PageNum: this.current,
  61. PageSize: this.pageSize
  62. },
  63. method: 'POST',
  64. isHaveToken : true
  65. }
  66. let retData = await getApp().RequestData(parm)
  67. if(retData.isSuccess) {
  68. if(retData.data.code == 200) {
  69. // console.log(retData)
  70. let len = retData.data.data.result.length
  71. this.total = retData.data.data.totalNum
  72. for (let i = 0; i < len; i++) {
  73. this.bomList.push({
  74. bomId: i + 1,
  75. bomNo: retData.data.data.result[i].bomNo
  76. });
  77. }
  78. if(len > 0) {
  79. this.isShowTips = false
  80. }
  81. else {
  82. this.isShowTips = true
  83. }
  84. }
  85. else {
  86. this.isShowTips = true
  87. }
  88. }
  89. else {
  90. this.isShowTips = true
  91. }
  92. uni.hideLoading()
  93. },
  94. resetCondition() {
  95. this.bomNo = ''
  96. this.foucusIndex = 0
  97. },
  98. goDetailPage(item) {
  99. let urlStr = '/pages/Outstore/outassembleDtlNew?bomNo=' + item.bomNo;
  100. uni.navigateTo({
  101. url: urlStr
  102. });
  103. },
  104. foucusChange0(event) {
  105. let str = event.detail.value
  106. if(str.length !== 0) {
  107. this.foucusIndex = 1
  108. }
  109. },
  110. foucusChange1(event) {
  111. let str = event.detail.value
  112. if(str.length !== 0) {
  113. this.foucusIndex = 2
  114. }
  115. },
  116. pageChange(e) {
  117. this.current = e.current
  118. this.queryFun()
  119. }
  120. }
  121. }
  122. </script>
  123. <style lang="scss">
  124. @import '@/common/uni-nvue.css';
  125. .uni-navigate-icon-01 {
  126. //margin-left: 200px;
  127. // margin-right: 5px;
  128. color: #999999;
  129. font-size: 14px;
  130. font-weight: normal;
  131. }
  132. .uni-navigate-item1 {
  133. align-items: center;
  134. background-color: #FFFFFF;
  135. border-top-style: solid;
  136. border-top-color: #f0f0f0;
  137. border-top-width: 1px;
  138. padding: 12px;
  139. cursor: pointer;
  140. }
  141. .uni-navigate-item1:active {
  142. background-color: #007AFF;
  143. }
  144. .my-tips-view {
  145. margin-top: 50px;
  146. text-align: center;
  147. color: #999999;
  148. font-size: 20px;
  149. font-weight: normal;
  150. }
  151. </style>