signWarehousing.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  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" :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. replenishBillSn: '',
  41. basicInfoData:null,
  42. partList: [],
  43. confirmQty: 0, // 实发数量之和
  44. totalQty: 0, // 应发数量之和
  45. customStyle: {
  46. borderRadius:'100rpx',
  47. fontSize:'30rpx',
  48. background: this.$config('primaryColor')
  49. },
  50. confirmModal: false
  51. }
  52. },
  53. onReady() {
  54. uni.setNavigationBarColor({
  55. frontColor: '#ffffff',
  56. backgroundColor: this.$config('primaryColor')
  57. })
  58. },
  59. onLoad(option) {
  60. this.replenishBillSn = option.sn
  61. this.getDetail()
  62. this.getPartList()
  63. },
  64. methods: {
  65. // 查询详情
  66. getDetail(){
  67. shelfReplenishDetail({ sn: this.replenishBillSn }).then(res => {
  68. if(res.status == 200){
  69. this.basicInfoData = res.data || null
  70. }else{
  71. this.basicInfoData = null
  72. }
  73. })
  74. },
  75. // 查询列表
  76. getPartList(){
  77. const _this = this
  78. shelfReplenishDetailList({ replenishBillSn: this.replenishBillSn }).then(res => {
  79. if(res.status == 200 && res.data){
  80. _this.totalQty = 0
  81. _this.confirmQty = 0
  82. res.data.map(item =>{
  83. item.confirmQty = item.confirmQty ? Number(item.confirmQty) : 0
  84. item.putQty = item.confirmQty ? Number(item.confirmQty) : 0
  85. if(item.confirmQty && Number(item.confirmQty)){
  86. _this.totalQty += Number(item.confirmQty)
  87. }
  88. if(item.putQty && Number(item.putQty)){
  89. _this.confirmQty += Number(item.putQty)
  90. }
  91. })
  92. this.partList = res.data || []
  93. }else{
  94. this.partList = []
  95. }
  96. })
  97. },
  98. // 确认签收 confirm
  99. modalConfirm(){
  100. const arr = []
  101. this.partList.map((item, index) => {
  102. if (item.putQty || item.putQty == 0) {
  103. arr.push({
  104. productSn: item.productSn,
  105. putQty: item.putQty,
  106. replenishBillDetailSn: item.replenishBillDetailSn,
  107. shelfPlaceSn: item.shelfPlaceSn,
  108. shelfPlaceCode: item.shelfPlaceCode
  109. })
  110. }
  111. })
  112. const params = {
  113. replenishBillSn: this.replenishBillSn,
  114. detailList: arr
  115. }
  116. shelfReplenishPutStock(params).then(res => {
  117. if(res.status == 200){
  118. uni.$emit('refreshBL')
  119. uni.$emit("refreshBhList",'FINISH')
  120. uni.navigateBack()
  121. }
  122. this.toashMsg(res.message)
  123. })
  124. },
  125. // 数量 change
  126. numberChange(value, index){
  127. const _this = this
  128. this.confirmQty = 0
  129. let list = this.$refs.partList.getAllData()
  130. list.map(item => {
  131. if(item.putQty && Number(item.putQty)){
  132. _this.confirmQty += Number(item.putQty)
  133. }
  134. })
  135. }
  136. }
  137. }
  138. </script>
  139. <style lang="less">
  140. page{
  141. height: 100vh;
  142. }
  143. .replenishment-putWarehousing-wrap{
  144. position: relative;
  145. width: 100%;
  146. height: 100%;
  147. overflow: hidden;
  148. padding-bottom: 136upx;
  149. .replenishment-putWarehousing-body{
  150. padding: 0 30rpx;
  151. height: 100%;
  152. overflow: auto;
  153. > view{
  154. padding: 10rpx 25rpx;
  155. background-color: #fff;
  156. margin-bottom: 20rpx;
  157. border-radius: 25rpx;
  158. box-shadow: 2rpx 3rpx 5rpx #eee;
  159. }
  160. .head-info{
  161. .states{
  162. border: 0;
  163. padding: 20rpx 0;
  164. > view{
  165. color: #191919;
  166. text-align: center;
  167. font-size: 40rpx;
  168. text{
  169. margin-left: 20rpx;
  170. }
  171. }
  172. }
  173. .info-txt{
  174. word-break: break-word;
  175. }
  176. font-size: 30rpx;
  177. > view{
  178. display: flex;
  179. border-bottom: 2rpx solid #f5f5f5;
  180. padding: 20rpx 0;
  181. > view:last-child{
  182. flex-grow: 1;
  183. width: 80%;
  184. }
  185. &:last-child{
  186. border:0;
  187. }
  188. }
  189. .label{
  190. display: flex;
  191. align-items: center;
  192. width: 220rpx;
  193. height: 44rpx;
  194. color: #7C7D7E;
  195. text{
  196. margin-left: 10rpx;
  197. }
  198. }
  199. }
  200. }
  201. .replenishment-putWarehousing-footer{
  202. padding: 26upx 32upx 30upx;
  203. background-color: #fff;
  204. position: fixed;
  205. left: 0;
  206. bottom: 0;
  207. width: 100%;
  208. box-shadow: 3px 1px 7px #eee;
  209. }
  210. }
  211. </style>