signWarehousing.vue 5.8 KB

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