FastOutStoreInspectDtl.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  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. <!-- 2024 孙亚龙新增的注释。 由于不确定是哪个业务要加状态过滤查询条件,所以暂时注释掉代码 -->
  13. <view class="uni-flex uni-row" style="margin-top: 5px;margin-bottom: 8px;">
  14. <view class="title">质检状态:</view>
  15. <view style="padding-top: 10rpx;padding-bottom: 10rpx;">
  16. <uni-data-checkbox v-model="CheckStatus" :localdata="CheckStatusData"></uni-data-checkbox>
  17. </view>
  18. </view>
  19. <view class="uni-flex uni-row">
  20. <button type="primary" style="-webkit-flex: 1;flex: 1;margin-left: 5px;" @click="queryFun">查 询</button>
  21. <button type="primary" style="-webkit-flex: 1;flex: 1;margin-left: 5px;margin-right: 5px;" @click="resetCondition">重 置</button>
  22. </view>
  23. </view>
  24. <uni-section title="待质检的交验单明细:" type="line" style="margin-bottom: 3px;padding: 3px;">
  25. <view class="my-tips-view" v-if="isShowTips">没有查询到交验单明细数据......</view>
  26. <uni-pagination :total="total" :current="current" :pageSize="pageSize" @change="pageChange" title="标题文字" v-if="!isShowTips" style="margin: 4px;"/>
  27. <view v-if="!isShowTips" style="text-align: center;">
  28. <text class="example-info">数据总量:{{ total }}条,每页数据:{{ pageSize }}</text>
  29. </view>
  30. <view v-for="(newsitem,key) in sapDeliverDtlList" :key="key">
  31. <view class="myDeliverDetail" @click="myDeliverDetailClick(newsitem)">
  32. <view style="flex-direction: row;flex-direction: row;height: 25px;display: flex;padding: 2px;border-radius: 5px 5px;">
  33. <text style="align-self: center;">物料编号:</text>
  34. <text style="align-self: center;font-size: 30rpx;font-weight: bold;">{{newsitem.materialCode}}</text>
  35. <text :class="newsitem.keyFlag ? 'keyFlagRed' : 'keyFlagGray'" style="align-self: center;margin-left: 20px;">{{newsitem.keyFlag ? '★' : '■'}}</text>
  36. </view>
  37. <view class="line-h"></view>
  38. <view style="flex-direction: row;flex-direction: row;display: flex;-webkit-justify-content: space-between;justify-content: space-between;">
  39. <view>
  40. <view style="flex-direction: row;flex-direction: row;display: flex;padding: 2px;">
  41. <text style="align-self: center;color: #555;font-size: 25rpx;">物料名称:</text>
  42. <text style="align-self: center;font-size: 25rpx;word-wrap: break-word;width: 200px;">{{newsitem.materialName}}</text>
  43. </view>
  44. <view style="flex-direction: row;flex-direction: row;display: flex;padding: 2px;">
  45. <text style="align-self: center;color: #555;font-size: 25rpx;">规格型号/图号:</text>
  46. <text style="align-self: center;font-size: 30rpx;font-weight: bold;word-wrap: break-word;width: 200px;">{{newsitem.materialSpec}}</text>
  47. </view>
  48. <view style="flex-direction: row;flex-direction: row;display: flex;padding: 2px;">
  49. <text style="align-self: center;color: #555;font-size: 25rpx;">交验单数量:</text>
  50. <text style="align-self: center;font-size: 35rpx;font-weight: bold;color: blue;">{{newsitem.sumQty}}</text>
  51. </view>
  52. <view style="flex-direction: row;flex-direction: row;display: flex;padding: 2px;">
  53. <text style="align-self: center;color: #555;font-size: 25rpx;">已质检数量:</text>
  54. <text style="align-self: center;font-size: 35rpx;font-weight: bold;color: blue;">{{newsitem.sumCheckQty}}</text>
  55. </view>
  56. </view>
  57. <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>
  58. <view v-else style="border-radius: 35px;width: 35px; background-color: lightgray;height: 35px;align-self: center;margin-right: 5px;"></view>
  59. </view>
  60. </view>
  61. </view>
  62. </uni-section>
  63. </view>
  64. </template>
  65. <script>
  66. export default {
  67. data() {
  68. return {
  69. deliverNo: '',
  70. foucusIndex: 0,
  71. materialSpecCode: '',
  72. isShowTips: true,
  73. sapDeliverDtlList:[],
  74. current: 1,
  75. total: 0,
  76. pageSize: 10,
  77. //2024 孙亚龙新增的注释。 由于不确定是哪个业务要加状态过滤查询条件,所以暂时注释掉代码
  78. CheckStatus: -1,
  79. CheckStatusData: [{
  80. value: -1,
  81. text: '全部'
  82. },{
  83. value: 0,
  84. text: '已质检'
  85. },{
  86. value: 1,
  87. text: '未质检'
  88. }
  89. ]
  90. }
  91. },
  92. onLoad(option) {
  93. this.deliverNo = option.deliverNo;
  94. this.queryFun()
  95. uni.$on('CallSapDeliverDtlQueryFunc', this.CallSapDeliverDtlQueryFunc)
  96. },
  97. onUnload() {
  98. uni.$off('CallSapDeliverDtlQueryFunc', this.CallSapDeliverDtlQueryFunc)
  99. },
  100. methods: {
  101. async queryFun() {
  102. uni.showLoading({
  103. title: "正在查询...",
  104. mask: true,
  105. })
  106. this.sapDeliverDtlList = []
  107. let parm = {
  108. url : '/business/SapDeliverRecord/GetSapDeliverRecordSumList',
  109. data: {
  110. DeliverNo: this.deliverNo,
  111. MaterialSpec: this.materialSpecCode,
  112. CheckStatus: this.CheckStatus, // 质检结果快速出库默认(CheckStatus = -1)查询全部质检状态的数据。
  113. PageNum: this.current,
  114. PageSize: this.pageSize
  115. },
  116. method: 'GET',
  117. isHaveToken : true
  118. }
  119. let retData = await getApp().RequestData(parm)
  120. if(retData.isSuccess) {
  121. if(retData.data.code == 200) {
  122. let len = retData.data.data.result.length
  123. this.total = retData.data.data.totalNum
  124. if(len > 0) {
  125. this.isShowTips = false
  126. }
  127. else {
  128. this.isShowTips = true
  129. }
  130. this.sapDeliverDtlList = retData.data.data.result
  131. }
  132. else {
  133. this.isShowTips = true
  134. }
  135. }
  136. else {
  137. this.isShowTips = true
  138. }
  139. uni.hideLoading()
  140. },
  141. resetCondition() {
  142. this.materialSpecCode = ""
  143. this.sapDeliverDtlList = []
  144. this.CheckStatus = -1
  145. this.isShowTips = true
  146. this.foucusIndex = 1
  147. setTimeout(() => {
  148. this.foucusIndex = 0;
  149. }, 150)
  150. },
  151. confirmFun() {
  152. this.queryFun()
  153. },
  154. myDeliverDetailClick(model) {
  155. model.deliverNo = this.deliverNo;
  156. if(model.sumCheckQty >= model.sumQty) {
  157. uni.showToast({
  158. title: '已全部质检',
  159. icon: 'error',
  160. mask: true,
  161. duration: 1500
  162. })
  163. } else {
  164. uni.navigateTo({
  165. url: '/pages/Inspect/FastOutStoreInspectOperate',
  166. success() {
  167. uni.$emit('sendDeliverDtlData',model)
  168. }
  169. });
  170. }
  171. },
  172. pageChange(e) {
  173. this.current = e.current
  174. this.queryFun()
  175. },
  176. CallSapDeliverDtlQueryFunc() {
  177. this.materialSpecCode = ""
  178. this.queryFun()
  179. this.foucusIndex = 1
  180. setTimeout(() => {
  181. this.foucusIndex = 0;
  182. }, 150)
  183. }
  184. }
  185. }
  186. </script>
  187. <style lang="scss">
  188. .my-tips-view {
  189. /* margin-top: 50px; */
  190. text-align: center;
  191. color: #999999;
  192. font-size: 20px;
  193. font-weight: normal;
  194. }
  195. .myDeliverDetail {
  196. border: 1px solid #cccccc;
  197. border-radius: 5px;
  198. margin-top: 1px;
  199. }
  200. .myDeliverDetail:active {
  201. background-color: aliceblue;
  202. }
  203. .line-h {
  204. height: 1rpx;
  205. background-color: #cccccc;
  206. }
  207. .keyFlagRed {
  208. color: red;
  209. }
  210. .keyFlagGray {
  211. color: lightgray;
  212. }
  213. </style>