PrintLabelDtl.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <template>
  2. <view>
  3. <view class="uni-form-item uni-column">
  4. <view class="uni-flex uni-row">
  5. <view class="title" style="width: 190rpx;">交验单号:</view>
  6. <input class="uni-input" style="font-size: 40rpx;font-weight: bold;color: black;" disabled="true" v-model="deliverNo"/>
  7. </view>
  8. <view class="uni-flex uni-row" style="margin-top: 3px;margin-bottom: 3px;">
  9. <view class="title" style="width: 190rpx;">规格型号\图号:</view>
  10. <input class="uni-input" style="margin-right: 5px;" :focus="foucusIndex === 0" v-model="materialSpecCode" placeholder="请输入规格型号\图号" @confirm="confirmFun"/>
  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. <uni-pagination :total="total" :current="current" :pageSize="pageSize" @change="pageChange" title="标题文字" v-if="!isShowTips" style="margin: 4px;"/>
  20. <view v-if="!isShowTips" style="text-align: center;">
  21. <text class="example-info">数据总量:{{ total }}条,每页数据:{{ pageSize }}</text>
  22. </view>
  23. <view v-for="(newsitem,key) in sapDeliverDtlList" :key="key">
  24. <view class="myDeliverDetail" @click="myDeliverDetailClick(newsitem)">
  25. <view style="flex-direction: row;flex-direction: row;height: 25px;display: flex;padding: 2px;border-radius: 5px 5px;">
  26. <text style="align-self: center;">物料编号:</text>
  27. <text style="align-self: center;font-size: 30rpx;font-weight: bold;">{{newsitem.materialCode}}</text>
  28. <text :class="newsitem.keyFlag ? 'keyFlagRed' : 'keyFlagGray'" style="align-self: center;margin-left: 20px;">{{newsitem.keyFlag ? '★' : '■'}}</text>
  29. </view>
  30. <view class="line-h"></view>
  31. <view style="flex-direction: row;flex-direction: row;display: flex;-webkit-justify-content: space-between;justify-content: space-between;">
  32. <view>
  33. <view style="flex-direction: row;flex-direction: row;display: flex;padding: 2px;">
  34. <text style="align-self: center;color: #555;font-size: 25rpx;">物料名称:</text>
  35. <text style="align-self: center;font-size: 25rpx;word-wrap: break-word;width: 200px;">{{newsitem.materialName}}</text>
  36. </view>
  37. <view style="flex-direction: row;flex-direction: row;display: flex;padding: 2px;">
  38. <text style="align-self: center;color: #555;font-size: 25rpx;">规格型号/图号:</text>
  39. <text style="align-self: center;font-size: 25rpx;word-wrap: break-word;width: 200px;">{{newsitem.materialSpec}}</text>
  40. </view>
  41. <view style="flex-direction: row;flex-direction: row;display: flex;padding: 2px;">
  42. <text style="align-self: center;color: #555;font-size: 25rpx;">生产令号:</text>
  43. <text style="align-self: center;font-size: 25rpx;word-wrap: break-word;width: 200px;">{{newsitem.bomNo}}</text>
  44. </view>
  45. <view style="flex-direction: row;flex-direction: row;display: flex;padding: 1px;">
  46. <text style="align-self: center;color: #555;font-size: 25rpx;">交验单数量:</text>
  47. <text style="align-self: center;font-size: 30rpx;font-weight: bold;">{{newsitem.qty}}</text>
  48. </view>
  49. </view>
  50. <view v-if="newsitem.sumCheckQty < newsitem.sumQty" style="border-radius: 35px;width: 35px; background-color: lime;height: 35px;align-self: center;margin-right: 5px;"></view>
  51. <view v-else style="border-radius: 35px;width: 35px; background-color: lightgray;height: 35px;align-self: center;margin-right: 5px;"></view>
  52. </view>
  53. </view>
  54. </view>
  55. </uni-section>
  56. </view>
  57. </template>
  58. <script>
  59. export default {
  60. data() {
  61. return {
  62. deliverNo: '',
  63. foucusIndex: 0,
  64. materialSpecCode: '',
  65. isShowTips: true,
  66. sapDeliverDtlList:[],
  67. current: 1,
  68. total: 0,
  69. pageSize: 10
  70. }
  71. },
  72. onLoad(option) {
  73. this.deliverNo = option.deliverNo;
  74. this.queryFun()
  75. // uni.$on('CallSapDeliverDtlQueryFunc', this.CallSapDeliverDtlQueryFunc)
  76. },
  77. onUnload() {
  78. // uni.$off('CallSapDeliverDtlQueryFunc', this.CallSapDeliverDtlQueryFunc)
  79. },
  80. methods: {
  81. async queryFun() {
  82. uni.showLoading({
  83. title: "正在查询...",
  84. mask: true,
  85. })
  86. this.sapDeliverDtlList = []
  87. let parm = {
  88. url : '/business/SapDeliverRecord/QuerySapDeliverDtlData',
  89. data: {
  90. DeliverNo: this.deliverNo,
  91. MaterialSpec: this.materialSpecCode,
  92. PageNum: this.current,
  93. PageSize: this.pageSize
  94. },
  95. method: 'POST',
  96. isHaveToken : true
  97. }
  98. let retData = await getApp().RequestData(parm)
  99. if(retData.isSuccess) {
  100. if(retData.data.code == 200) {
  101. let len = retData.data.data.result.length
  102. this.total = retData.data.data.totalNum
  103. if(len > 0) {
  104. this.isShowTips = false
  105. }
  106. else {
  107. this.isShowTips = true
  108. }
  109. this.sapDeliverDtlList = retData.data.data.result
  110. }
  111. else {
  112. this.isShowTips = true
  113. }
  114. }
  115. else {
  116. this.isShowTips = true
  117. }
  118. uni.hideLoading()
  119. },
  120. resetCondition() {
  121. this.materialSpecCode = ""
  122. this.sapDeliverDtlList = []
  123. this.isShowTips = true
  124. this.foucusIndex = 1
  125. setTimeout(() => {
  126. this.foucusIndex = 0;
  127. }, 150)
  128. },
  129. confirmFun() {
  130. this.queryFun()
  131. },
  132. myDeliverDetailClick(model) {
  133. model.deliverNo = this.deliverNo;
  134. uni.navigateTo({
  135. url: '/pages/Inspect/PrintLabelOperate',
  136. success() {
  137. uni.$emit('sendDeliverDtlData',model)
  138. }
  139. });
  140. },
  141. pageChange(e) {
  142. this.current = e.current
  143. this.queryFun()
  144. },
  145. CallSapDeliverDtlQueryFunc() {
  146. this.materialSpecCode = ""
  147. this.queryFun()
  148. this.foucusIndex = 1
  149. setTimeout(() => {
  150. this.foucusIndex = 0;
  151. }, 150)
  152. }
  153. }
  154. }
  155. </script>
  156. <style lang="scss">
  157. .my-tips-view {
  158. /* margin-top: 50px; */
  159. text-align: center;
  160. color: #999999;
  161. font-size: 20px;
  162. font-weight: normal;
  163. }
  164. .myDeliverDetail {
  165. border: 1px solid #cccccc;
  166. border-radius: 5px;
  167. margin-top: 1px;
  168. }
  169. .myDeliverDetail:active {
  170. background-color: aliceblue;
  171. }
  172. .line-h {
  173. height: 1rpx;
  174. background-color: #cccccc;
  175. }
  176. .keyFlagRed {
  177. color: red;
  178. }
  179. .keyFlagGray {
  180. color: lightgray;
  181. }
  182. </style>