signWarehousing.vue 6.0 KB

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