signWarehousing.vue 5.5 KB

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