signWarehousing.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  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. .replenishment-putWarehousing-wrap{
  140. position: relative;
  141. width: 100%;
  142. height: 100%;
  143. overflow: hidden;
  144. padding-bottom: 136upx;
  145. .replenishment-putWarehousing-body{
  146. padding: 0 30rpx;
  147. height: 100%;
  148. overflow: auto;
  149. > view{
  150. padding: 10rpx 25rpx;
  151. background-color: #fff;
  152. margin-bottom: 20rpx;
  153. border-radius: 25rpx;
  154. box-shadow: 2rpx 3rpx 5rpx #eee;
  155. }
  156. .head-info{
  157. .states{
  158. border: 0;
  159. padding: 20rpx 0;
  160. > view{
  161. color: #191919;
  162. text-align: center;
  163. font-size: 40rpx;
  164. text{
  165. margin-left: 20rpx;
  166. }
  167. }
  168. }
  169. .info-txt{
  170. word-break: break-word;
  171. }
  172. font-size: 30rpx;
  173. > view{
  174. display: flex;
  175. border-bottom: 2rpx solid #f5f5f5;
  176. padding: 20rpx 0;
  177. > view:last-child{
  178. flex-grow: 1;
  179. width: 80%;
  180. }
  181. &:last-child{
  182. border:0;
  183. }
  184. }
  185. .label{
  186. display: flex;
  187. align-items: center;
  188. width: 220rpx;
  189. height: 44rpx;
  190. color: #7C7D7E;
  191. text{
  192. margin-left: 10rpx;
  193. }
  194. }
  195. }
  196. }
  197. .replenishment-putWarehousing-footer{
  198. padding: 26upx 32upx 30upx;
  199. background-color: #fff;
  200. position: fixed;
  201. left: 0;
  202. bottom: 0;
  203. width: 100%;
  204. box-shadow: 3px 1px 7px #eee;
  205. }
  206. }
  207. </style>