outassemble01.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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. <view style="margin-left: 5px;margin-right: 5px;">
  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>
  22. </view>
  23. </template>
  24. <script>
  25. // TODO 修复Android v3 加载过慢问题
  26. // #ifdef APP-PLUS
  27. var domModule = weex.requireModule('dom');
  28. domModule.addRule('fontFace', {
  29. 'fontFamily': "uniicons",
  30. 'src': "url('/static/uni.ttf')"
  31. });
  32. // #endif
  33. export default {
  34. data() {
  35. return {
  36. bomNo: '',
  37. isShowTips: true,
  38. bomList:[],
  39. foucusIndex: 0
  40. }
  41. },
  42. methods: {
  43. async queryFun() {
  44. uni.showLoading({
  45. title: "正在查询...",
  46. mask: true,
  47. })
  48. this.bomList = []
  49. let parm = {
  50. url : '/business/SapBomRecord/QueryBomList',
  51. data: {
  52. BomNo: this.bomNo
  53. },
  54. method: 'POST',
  55. isHaveToken : true
  56. }
  57. let retData = await getApp().RequestData(parm)
  58. if(retData.isSuccess) {
  59. if(retData.data.code == 200) {
  60. // console.log(retData)
  61. let len = retData.data.data.length
  62. for (let i = 0; i < len; i++) {
  63. this.bomList.push({
  64. bomId: i + 1,
  65. bomNo: retData.data.data[i].bomNo
  66. });
  67. }
  68. if(len > 0) {
  69. this.isShowTips = false
  70. }
  71. else {
  72. this.isShowTips = true
  73. }
  74. }
  75. else {
  76. this.isShowTips = true
  77. }
  78. }
  79. else {
  80. this.isShowTips = true
  81. }
  82. uni.hideLoading()
  83. },
  84. resetCondition() {
  85. this.bomNo = ''
  86. this.foucusIndex = 0
  87. },
  88. goDetailPage(item) {
  89. let urlStr = '/pages/Outstore/outassembleDtlNew?bomNo=' + item.bomNo;
  90. uni.navigateTo({
  91. url: urlStr
  92. });
  93. },
  94. foucusChange0(event) {
  95. let str = event.detail.value
  96. if(str.length !== 0) {
  97. this.foucusIndex = 1
  98. }
  99. },
  100. foucusChange1(event) {
  101. let str = event.detail.value
  102. if(str.length !== 0) {
  103. this.foucusIndex = 2
  104. }
  105. }
  106. }
  107. }
  108. </script>
  109. <style lang="scss">
  110. @import '@/common/uni-nvue.css';
  111. .uni-navigate-icon-01 {
  112. //margin-left: 200px;
  113. // margin-right: 5px;
  114. color: #999999;
  115. font-size: 14px;
  116. font-weight: normal;
  117. }
  118. .uni-navigate-item1 {
  119. align-items: center;
  120. background-color: #FFFFFF;
  121. border-top-style: solid;
  122. border-top-color: #f0f0f0;
  123. border-top-width: 1px;
  124. padding: 12px;
  125. cursor: pointer;
  126. }
  127. .uni-navigate-item1:active {
  128. background-color: #007AFF;
  129. }
  130. .my-tips-view {
  131. margin-top: 50px;
  132. text-align: center;
  133. color: #999999;
  134. font-size: 20px;
  135. font-weight: normal;
  136. }
  137. </style>