signWarehousing.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  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. this.partList.map((item, index) => {
  103. if (item.putQty || item.putQty == 0) {
  104. arr.push({
  105. productSn: item.productSn,
  106. putQty: item.putQty,
  107. replenishBillDetailSn: item.replenishBillDetailSn,
  108. shelfPlaceSn: item.shelfPlaceSn,
  109. shelfPlaceCode: item.shelfPlaceCode
  110. })
  111. }
  112. })
  113. const params = {
  114. replenishBillSn: this.replenishBillSn,
  115. detailList: arr
  116. }
  117. this.loading = true
  118. shelfReplenishPutStock(params).then(res => {
  119. if(res.status == 200){
  120. uni.$emit('refreshBL')
  121. uni.$emit("refreshBhList",'FINISH')
  122. uni.navigateBack()
  123. }
  124. this.toashMsg(res.message)
  125. this.loading = false
  126. })
  127. },
  128. // 数量 change
  129. numberChange(value, index){
  130. const _this = this
  131. this.confirmQty = 0
  132. let list = this.$refs.partList.getAllData()
  133. list.map(item => {
  134. if(item.putQty && Number(item.putQty)){
  135. _this.confirmQty += Number(item.putQty)
  136. }
  137. })
  138. }
  139. }
  140. }
  141. </script>
  142. <style lang="less">
  143. page{
  144. height: 100vh;
  145. }
  146. .replenishment-putWarehousing-wrap{
  147. position: relative;
  148. width: 100%;
  149. height: 100%;
  150. overflow: hidden;
  151. padding-bottom: 136upx;
  152. .replenishment-putWarehousing-body{
  153. padding: 0 30rpx;
  154. height: 100%;
  155. overflow: auto;
  156. > view{
  157. padding: 10rpx 25rpx;
  158. background-color: #fff;
  159. margin-bottom: 20rpx;
  160. border-radius: 25rpx;
  161. box-shadow: 2rpx 3rpx 5rpx #eee;
  162. }
  163. .head-info{
  164. .states{
  165. border: 0;
  166. padding: 20rpx 0;
  167. > view{
  168. color: #191919;
  169. text-align: center;
  170. font-size: 40rpx;
  171. text{
  172. margin-left: 20rpx;
  173. }
  174. }
  175. }
  176. .info-txt{
  177. word-break: break-word;
  178. }
  179. font-size: 30rpx;
  180. > view{
  181. display: flex;
  182. border-bottom: 2rpx solid #f5f5f5;
  183. padding: 20rpx 0;
  184. > view:last-child{
  185. flex-grow: 1;
  186. width: 80%;
  187. }
  188. &:last-child{
  189. border:0;
  190. }
  191. }
  192. .label{
  193. display: flex;
  194. align-items: center;
  195. width: 220rpx;
  196. height: 44rpx;
  197. color: #7C7D7E;
  198. text{
  199. margin-left: 10rpx;
  200. }
  201. }
  202. }
  203. }
  204. .replenishment-putWarehousing-footer{
  205. padding: 26upx 32upx 30upx;
  206. background-color: #fff;
  207. position: fixed;
  208. left: 0;
  209. bottom: 0;
  210. width: 100%;
  211. box-shadow: 3px 1px 7px #eee;
  212. }
  213. }
  214. </style>