PrintLabel.vue 4.4 KB

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