inspect01.vue 5.7 KB

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