cancellingStocks.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. <template>
  2. <view class="cancelStockPages" :style="`backgroundImage:linear-gradient(180deg, ${$config('primaryColor')}, #F5F6F7 12%)`">
  3. <view class="cancelStockPages-body">
  4. <view class="head-info" v-if="info">
  5. <view class="states">
  6. <view>
  7. <u-icon name="icon_withdrawal" custom-prefix="iscm-icon" size="48"></u-icon>
  8. <text>待退货</text>
  9. </view>
  10. </view>
  11. <view>
  12. <view class="label"><u-icon name="ison_shelf" custom-prefix="iscm-icon" size="32"></u-icon><text>货架名称</text></view>
  13. <view>{{info.shelfName}}</view>
  14. </view>
  15. <view>
  16. <view class="label"><u-icon name="icon_position" custom-prefix="iscm-icon" size="32"></u-icon><text>客户地址</text></view>
  17. <view>{{info.shelfAddress}}</view>
  18. </view>
  19. </view>
  20. <view class="part-list">
  21. <!-- 配件列表 -->
  22. <partList title="配件列表" ref="partList" :list="partList" @allChecked="allCheckedCallback"></partList>
  23. </view>
  24. </view>
  25. <view class="cancelStockPages-footer">
  26. <view>
  27. <u-checkbox size="40" @change="allCheckeChange" v-model="allChecked" shape="circle">{{allChecked?'取消全选':'全选'}}</u-checkbox>
  28. </view>
  29. <view>
  30. <u-button @click="submit" shape="circle" :custom-style="{background:$config('primaryColor')}" type="primary">确定退库</u-button>
  31. </view>
  32. </view>
  33. </view>
  34. </template>
  35. <script>
  36. import { shelfRecallFindBySn, detailQueryCount, shelfRecallDetail, shelfRecallConfirm } from '@/api/shelfRecall.js'
  37. import partList from '../common/partList.vue'
  38. export default {
  39. components: {
  40. partList
  41. },
  42. data() {
  43. return {
  44. allChecked: false,
  45. recallBillSn: '',
  46. info:null,
  47. partList: []
  48. }
  49. },
  50. onReady() {
  51. uni.setNavigationBarColor({
  52. frontColor: '#ffffff',
  53. backgroundColor: this.$config('primaryColor')
  54. })
  55. },
  56. onLoad(option) {
  57. this.recallBillSn = option.recallBillSn
  58. this.getDetail()
  59. this.getPartList()
  60. },
  61. methods: {
  62. // 全选
  63. allCheckeChange(e){
  64. this.$refs.partList.allSelect(e.value)
  65. },
  66. allCheckedCallback(val){
  67. this.allChecked = val
  68. },
  69. // 查询详情
  70. getDetail(){
  71. shelfRecallFindBySn({sn:this.recallBillSn}).then(res => {
  72. if(res.status == 200){
  73. this.info = res.data
  74. }
  75. })
  76. },
  77. // 查询配件列表
  78. getPartList(){
  79. shelfRecallDetail({recallBillSn:this.recallBillSn}).then(res => {
  80. if(res.status == 200){
  81. this.partList = res.data.data
  82. }
  83. })
  84. },
  85. // 确定退货
  86. submit(){
  87. const result =this.$refs.partList.getAllChecked()
  88. if(result.length){
  89. shelfRecallConfirm().then(res => {
  90. if(res.status == 200){
  91. uni.$emit("refreshBL")
  92. uni.navigateBack()
  93. }
  94. this.toashMsg(res.message)
  95. })
  96. }else{
  97. this.toashMsg("请选择配件!")
  98. }
  99. }
  100. }
  101. }
  102. </script>
  103. <style lang="less">
  104. .cancelStockPages{
  105. width: 100%;
  106. height: 100vh;
  107. display: flex;
  108. flex-direction: column;
  109. .cancelStockPages-body{
  110. padding: 0 30rpx;
  111. flex-grow: 1;
  112. overflow: auto;
  113. > view{
  114. padding: 10rpx 25rpx;
  115. background-color: #fff;
  116. margin-bottom: 20rpx;
  117. border-radius: 25rpx;
  118. box-shadow: 2rpx 3rpx 5rpx #eee;
  119. }
  120. .head-info{
  121. .states{
  122. border: 0;
  123. padding: 20rpx 0;
  124. > view{
  125. color: #191919;
  126. text-align: center;
  127. font-size: 40rpx;
  128. text{
  129. margin-left: 20rpx;
  130. }
  131. }
  132. }
  133. font-size: 30rpx;
  134. > view{
  135. display: flex;
  136. border-bottom: 2rpx solid #f5f5f5;
  137. padding: 20rpx 0;
  138. > view:last-child{
  139. flex-grow: 1;
  140. width: 80%;
  141. }
  142. &:last-child{
  143. border:0;
  144. }
  145. }
  146. .label{
  147. display: flex;
  148. align-items: center;
  149. width: 220rpx;
  150. height: 44rpx;
  151. color: #7C7D7E;
  152. text{
  153. margin-left: 10rpx;
  154. }
  155. }
  156. }
  157. }
  158. .cancelStockPages-footer{
  159. background-color: #fff;
  160. padding: 20rpx 40rpx;
  161. display: flex;
  162. align-items: center;
  163. justify-content: space-between;
  164. }
  165. }
  166. </style>