batchInfo.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. <template>
  2. <view class="content">
  3. <view class="topbar" v-show="isIphone">
  4. </view>
  5. <view class="status_bar">
  6. <view class="left" @click="goBack"><u-icon name="arrow-left"></u-icon>返回</view>
  7. <span style="font-size: 36rpx;">批次详情</span>
  8. <view class="right"></view>
  9. </view>
  10. <view class="mainCont">
  11. <view class="pcTop" v-show="tableList.length">
  12. {{ batchName }}({{ tableList.length - notHandlePackIds.length }}/{{ tableList.length }})
  13. <span style="float: right" v-show="checkWeight">{{ checkWeight }}kg</span>
  14. </view>
  15. <view class="card" @click="goInfo(item.id)" v-for="(item, index) in tableList" :key="index">
  16. <view class="top">
  17. <view class="left">{{ item.packCode }}</view>
  18. <view class="right" :style="{color: item.finishState == 1 ? '#00CC00' : '#FF0000'}"
  19. v-show="item.abnormalType == 1">{{ item.finishState == 1 ? '已完成' : '待处理' }}</view>
  20. </view>
  21. <view class="bottom">
  22. <view>科&emsp;&emsp;室:{{ item.positionName }}<span
  23. style="float: right">{{ item.packWeight }}kg</span></view>
  24. <view>医废分类:{{ item.categoryName }}
  25. <span style="float: right"
  26. v-show="item.finishState == 1 && item.abnormalType == 1 && item.abnormalCategory == 1">标签破损--记重</span>
  27. <span style="float: right"
  28. v-show="item.finishState == 1 && item.abnormalType == 1 && item.abnormalCategory == 2">丢失--不记重</span>
  29. <span style="float: right"
  30. v-show="item.finishState == 1 && item.abnormalType == 1 && item.abnormalCategory == 3">无需处理</span>
  31. </view>
  32. <view>打&ensp;包&ensp;人:{{ item.createName }}<span style="float: right">{{ item.createTime }}</span>
  33. </view>
  34. <view class="bButton" v-show="item.packState == 3 && item.finishState == null">
  35. <span v-show="item.finishState != '0'" @click.stop="doCollect(item.batchId, item.id)">验收</span>
  36. <span @click.stop="doUnusual(item.id)" v-show="item.abnormalType != 1"
  37. style="margin-right: 10px;background: #fff;color: #5976ba">异常处理</span>
  38. </view>
  39. </view>
  40. </view>
  41. <view style="margin-top: 100px;text-align: center;" v-show="!tableList.length">暂无数据</view>
  42. </view>
  43. <view class="bottomButtons" v-show="batchState == '2'">
  44. <view style="background-color: #fff;color: rgba(89, 118, 186, 1)">扫码</view>
  45. <view @click="confirmCheck" :style="{backgroundColor: notHandlePackIds.length ? '#cccccc' : '#5976ba'}"
  46. style="color: #fff;">确认验收
  47. </view>
  48. </view>
  49. <u-toast ref="uToast" />
  50. </view>
  51. </template>
  52. <script>
  53. const NET = require('@/utils/request')
  54. const API = require('@/config/api')
  55. export default {
  56. data() {
  57. return {
  58. id: "",
  59. tableList: [],
  60. batchName: "",
  61. notHandlePackIds: [],
  62. checkWeight: "",
  63. realWeight: "",
  64. createName: "",
  65. batchState: "",
  66. isIphone: false,
  67. }
  68. },
  69. onLoad(options) {
  70. uni.getSystemInfo({
  71. success: (res) => {
  72. console.log(res)
  73. if (res.model == 'iPhone') {
  74. this.isIphone = true;
  75. }
  76. },
  77. fail: (err) => {
  78. console.log(err)
  79. }
  80. })
  81. this.id = options.id
  82. this.getInfo()
  83. },
  84. onReady() {
  85. if (this.isIphone) {
  86. document.getElementsByClassName('mainCont')[0].style.height = document.getElementsByClassName('mainCont')[
  87. 0].clientHeight - 25 + 'px'
  88. }
  89. },
  90. onShow() {
  91. this.getInfo()
  92. },
  93. methods: {
  94. goBack() {
  95. uni.navigateBack({
  96. delta: 1
  97. });
  98. },
  99. getInfo() {
  100. NET.request(API.queryBatchDetail + '/' + this.id, {}).then(res => {
  101. // this.text = res.data.
  102. this.realWeight = res.data.realWeight
  103. this.createName = res.data.createName
  104. this.checkWeight = res.data.checkWeight
  105. this.tableList = res.data.packageList
  106. this.batchName = res.data.batchName
  107. this.notHandlePackIds = res.data.notHandlePackIds
  108. this.batchState = res.data.batchState
  109. }).catch(error => {
  110. this.$refs.uToast.show({
  111. title: error.msg,
  112. type: 'warning',
  113. })
  114. })
  115. },
  116. doCollect(batchId, id) {
  117. let postData = {
  118. batchId: batchId,
  119. id: id
  120. }
  121. NET.request(API.receivePackage4Batch, postData).then(res => {
  122. this.$refs.uToast.show({
  123. title: res.msg,
  124. type: 'success',
  125. })
  126. this.getInfo()
  127. }).catch(error => {
  128. this.$refs.uToast.show({
  129. title: error.msg,
  130. type: 'warning',
  131. })
  132. })
  133. },
  134. doUnusual(id) {
  135. uni.navigateTo({
  136. url: `/wasteCheck/unusualDeal?id=${id}`
  137. });
  138. },
  139. confirmCheck() {
  140. if (this.notHandlePackIds.length) {
  141. return false
  142. } else {
  143. uni.navigateTo({
  144. url: `/wasteCheck/confirmCheck?id=${this.id}&name=${this.createName}&batchName=${this.batchName}&num=${this.tableList.length}&weight=${this.realWeight}`
  145. });
  146. }
  147. },
  148. goInfo(id) {
  149. uni.navigateTo({
  150. url: `/wasteCheck/infor?id=${id}`
  151. });
  152. }
  153. }
  154. }
  155. </script>
  156. <style lang="scss">
  157. .mainCont {
  158. height: calc(100% - 80rpx);
  159. padding-bottom: 60px;
  160. overflow-y: scroll;
  161. }
  162. .pcTop {
  163. width: calc(100% - 20px);
  164. padding: 0 10px;
  165. height: 20px;
  166. line-height: 20px;
  167. margin: 0 auto;
  168. margin-top: 10px;
  169. margin-bottom: 10px;
  170. position: relative;
  171. &:after {
  172. content: '';
  173. position: absolute;
  174. height: 20px;
  175. top: 0;
  176. left: 0;
  177. width: 2px;
  178. background-color: #6aa0f7;
  179. }
  180. }
  181. .bottomButtons {
  182. box-shadow: 0px -5px 5px #d0cece;
  183. position: fixed;
  184. display: flex;
  185. justify-content: space-between;
  186. width: 100%;
  187. height: 40px;
  188. line-height: 40px;
  189. bottom: 0;
  190. left: 0;
  191. view {
  192. width: 50%;
  193. height: 40px;
  194. line-height: 40px;
  195. text-align: center;
  196. }
  197. }
  198. </style>