signWarehousing.vue 5.8 KB

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