outWarehousing.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <template>
  2. <view class="replenishment-outWarehousing-wrap" :style="`backgroundImage:linear-gradient(180deg, ${$config('primaryColor')}, #F5F6F7 12%)`">
  3. <view class="replenishment-outWarehousing-body">
  4. <view class="head-info" v-if="basicInfoData">
  5. <view class="states">
  6. <view>
  7. <u-icon name="icon_out" 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 class="info-txt">{{basicInfoData.shelfInfo&&basicInfoData.shelfInfo.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 class="info-txt">{{basicInfoData.customerAddr}}</view>
  18. </view>
  19. </view>
  20. <view class="part-list">
  21. <!-- 配件列表 -->
  22. <partList :list="partList" title="配件列表" model="view" fromPage="replenishmentOut" ref="partList" noDataText="暂无配件"></partList>
  23. </view>
  24. </view>
  25. <view class="replenishment-outWarehousing-footer">
  26. <u-button class="button" @click="goSendOutGoods" :custom-style="customDefalutStyle" hover-class="none" shape="circle">扫码出库</u-button>
  27. <u-button class="button" @click="confirmModal=true" :loading="loading" type="success" :custom-style="customStyle" hover-class="none" shape="circle">一键出库</u-button>
  28. </view>
  29. <!-- 一键出库弹框 -->
  30. <common-modal :openModal="confirmModal" title="确认信息无误并进行出库吗?" confirmText="确认" @confirm="modalConfirm" @close="confirmModal=false">
  31. <u-input type='textarea' v-model="remarks" :maxlength="100" placeholder="请输入出库备注(最多100字符)" border :height="100"></u-input>
  32. </common-modal>
  33. </view>
  34. </template>
  35. <script>
  36. import commonModal from '@/pages/common/commonModal.vue'
  37. import { shelfReplenishDetail, shelfReplenishDetailList, shelfReplenishOutStock } from '@/api/shelfReplenish'
  38. import partList from '@/pages/common/partList.vue'
  39. export default {
  40. components: { partList, commonModal },
  41. data() {
  42. return {
  43. loading: false,
  44. replenishBillSn: '',
  45. basicInfoData:null,
  46. partList: [],
  47. customStyle: {
  48. borderRadius:'100rpx',
  49. fontSize:'30rpx',
  50. background: this.$config('primaryColor')
  51. },
  52. customDefalutStyle: {
  53. borderRadius:'100rpx',
  54. fontSize:'30rpx',
  55. color: this.$config('primaryColor'),
  56. background: '#fff'
  57. },
  58. confirmModal: false,
  59. remarks: ''
  60. }
  61. },
  62. onReady() {
  63. uni.setNavigationBarColor({
  64. frontColor: '#ffffff',
  65. backgroundColor: this.$config('primaryColor')
  66. })
  67. },
  68. onLoad(option) {
  69. this.replenishBillSn = option.sn
  70. this.getDetail()
  71. this.getPartList()
  72. },
  73. methods: {
  74. // 查询详情
  75. getDetail(){
  76. shelfReplenishDetail({ sn: this.replenishBillSn }).then(res => {
  77. if(res.status == 200){
  78. this.basicInfoData = res.data || null
  79. }else{
  80. this.basicInfoData = null
  81. }
  82. })
  83. },
  84. // 查询列表
  85. getPartList(){
  86. const _this = this
  87. shelfReplenishDetailList({ replenishBillSn: this.replenishBillSn }).then(res => {
  88. if(res.status == 200 && res.data){
  89. res.data.map(item =>{
  90. item.confirmQty = item.confirmQty ? Number(item.confirmQty) : 0
  91. })
  92. this.partList = res.data || []
  93. }else{
  94. this.partList = []
  95. }
  96. })
  97. },
  98. // 一键出库
  99. modalConfirm(){
  100. const arr = []
  101. const _this = this
  102. _this.partList.map((item, index) => {
  103. arr.push({
  104. productSn: item.productSn,
  105. confirmQty: item.confirmQty,
  106. replenishBillDetailSn: item.replenishBillDetailSn,
  107. id: item.id
  108. })
  109. })
  110. const params = {
  111. replenishBillSn: _this.replenishBillSn,
  112. detailList: arr,
  113. remarks: _this.remarks,
  114. shelfSn: _this.basicInfoData && _this.basicInfoData.shelfSn
  115. }
  116. _this.showLoading('正在出库...')
  117. shelfReplenishOutStock(params).then(res => {
  118. console.log(res)
  119. if (res.status == 200) {
  120. _this.remarks = ''
  121. uni.$emit('refreshBL')
  122. uni.$emit("refreshBhList",'WAIT_CHECK')
  123. uni.navigateBack()
  124. }
  125. _this.toashMsg(res.message)
  126. uni.hideLoading()
  127. })
  128. },
  129. // 发货出库
  130. goSendOutGoods(){
  131. uni.navigateTo({ url: "/pages/replenishmentManage/sendOutGoods?sn="+this.replenishBillSn+'&shelfSn='+this.basicInfoData.shelfSn })
  132. }
  133. }
  134. }
  135. </script>
  136. <style lang="less">
  137. page {
  138. height: 100vh;
  139. }
  140. .replenishment-outWarehousing-wrap{
  141. position: relative;
  142. width: 100%;
  143. height: 100%;
  144. overflow: hidden;
  145. padding-bottom: 136upx;
  146. .replenishment-outWarehousing-body{
  147. padding: 0 30rpx;
  148. height: 100%;
  149. overflow: auto;
  150. > view{
  151. padding: 10rpx 25rpx;
  152. background-color: #fff;
  153. margin-bottom: 20rpx;
  154. border-radius: 25rpx;
  155. box-shadow: 2rpx 3rpx 5rpx #eee;
  156. }
  157. .head-info{
  158. .states{
  159. border: 0;
  160. padding: 20rpx 0;
  161. > view{
  162. color: #191919;
  163. text-align: center;
  164. font-size: 40rpx;
  165. text{
  166. margin-left: 20rpx;
  167. }
  168. }
  169. }
  170. .info-txt{
  171. word-break: break-word;
  172. }
  173. font-size: 30rpx;
  174. > view{
  175. display: flex;
  176. border-bottom: 2rpx solid #f5f5f5;
  177. padding: 20rpx 0;
  178. > view:last-child{
  179. flex-grow: 1;
  180. width: 80%;
  181. }
  182. &:last-child{
  183. border:0;
  184. }
  185. }
  186. .label{
  187. display: flex;
  188. align-items: center;
  189. width: 220rpx;
  190. height: 44rpx;
  191. color: #7C7D7E;
  192. text{
  193. margin-left: 10rpx;
  194. }
  195. }
  196. }
  197. }
  198. .replenishment-outWarehousing-footer{
  199. padding: 26upx 32upx 30upx;
  200. background-color: #fff;
  201. position: fixed;
  202. left: 0;
  203. bottom: 0;
  204. width: 100%;
  205. box-shadow: 3px 1px 7px #eee;
  206. display: flex;
  207. justify-content: space-between;
  208. align-items: center;
  209. .button{
  210. width: 45%;
  211. }
  212. }
  213. }
  214. </style>