|
@@ -1,5 +1,11 @@
|
|
|
<template>
|
|
|
- <view class="replenishment-putWarehousing-wrap" :style="`backgroundImage:linear-gradient(180deg, ${$config('primaryColor')}, #F5F6F7 12%)`">
|
|
|
+ <view class="replenishment-putWarehousing-wrap">
|
|
|
+ <u-navbar back-text="补货签收" :border-bottom="false" :background="{backgroundColor: $config('primaryColor')}" back-icon-color="#fff" :back-text-style="{ color: '#fff' }">
|
|
|
+ <view slot='right' style="padding: 0 30upx;color: #ffffff;" @click="creatSalesOrder">
|
|
|
+ <u-icon name="chuangjiandingdan" custom-prefix="iscm-icon"></u-icon>
|
|
|
+ <text style="margin-left: 6rpx;">生成销售单</text>
|
|
|
+ </view>
|
|
|
+ </u-navbar>
|
|
|
<view class="replenishment-putWarehousing-body">
|
|
|
<view class="head-info" v-if="basicInfoData">
|
|
|
<view class="states">
|
|
@@ -31,12 +37,53 @@
|
|
|
</view>
|
|
|
<!-- 确认弹框 -->
|
|
|
<common-modal :openModal="confirmModal" content="签收后数字货架的产品数量将增加,确认签收吗?" confirmText="确认签收" @confirm="modalConfirm" @close="confirmModal=false" />
|
|
|
+ <!-- 生成销售单 -->
|
|
|
+ <common-modal v-if="showModal" :showTitle="false" :openModal="showModal" @confirm="showModalConfirm" @close="showModal=false">
|
|
|
+ <view style="font-size: 28upx;">
|
|
|
+ <view style="padding: 10upx;margin: 20upx 0;" class="flex align_center justify_between">
|
|
|
+ <view>产品总款数:<text style="color: red;">{{partList.length}}</text></view>
|
|
|
+ <view>产品总件数:<text style="color: red;">{{totalNums}}</text></view>
|
|
|
+ </view>
|
|
|
+ <view v-if="salesOrderList.length">
|
|
|
+ <view style="padding: 0 10upx 10upx;">此补货单已经存在对应的销售单?</view>
|
|
|
+ <view style="padding: 0 10upx 20upx;">确认再次生成销售单吗?</view>
|
|
|
+ <view>
|
|
|
+ <view
|
|
|
+ v-for="item in salesOrderList"
|
|
|
+ :key="item.id"
|
|
|
+ style="color: #00aaff;border-bottom: 1px solid #eee;padding: 10upx 0;"
|
|
|
+ class="flex align_center justify_between"
|
|
|
+ @click="viewSales(item)"
|
|
|
+ >
|
|
|
+ <text>{{item.salesBillNo}}</text>
|
|
|
+ <view>
|
|
|
+ <u-icon name="arrow-right"></u-icon>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view v-else>
|
|
|
+ <view style="padding: 0 10upx 20upx;">确认生成销售单?</view>
|
|
|
+ <view>
|
|
|
+ <view
|
|
|
+ v-for="item in salesOrderList" :key="item.id"
|
|
|
+ style="color: #00aaff;border-bottom: 1px solid #eee;padding: 10upx 0;"
|
|
|
+ class="flex align_center justify_between">
|
|
|
+ <text>{{item.orderNo}}</text>
|
|
|
+ <view>
|
|
|
+ <u-icon name="arrow-right"></u-icon>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </common-modal>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import commonModal from '@/pages/common/commonModal.vue'
|
|
|
- import { shelfReplenishDetail, shelfReplenishDetailList, shelfReplenishPutStock } from '@/api/shelfReplenish'
|
|
|
+ import { shelfReplenishDetail, shelfReplenishDetailList, shelfReplenishPutStock, queryRelationSalesBill } from '@/api/shelfReplenish'
|
|
|
import partList from '@/pages/common/partList.vue'
|
|
|
export default {
|
|
|
components: { partList, commonModal },
|
|
@@ -53,7 +100,8 @@
|
|
|
fontSize:'30rpx',
|
|
|
background: this.$config('primaryColor')
|
|
|
},
|
|
|
- confirmModal: false
|
|
|
+ confirmModal: false,
|
|
|
+ showModal: false
|
|
|
}
|
|
|
},
|
|
|
onReady() {
|
|
@@ -66,6 +114,16 @@
|
|
|
this.replenishBillSn = option.sn
|
|
|
this.getDetail()
|
|
|
this.getPartList()
|
|
|
+ this.getSalesOrder()
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ totalNums() {
|
|
|
+ let ret = 0
|
|
|
+ this.partList.map(item => {
|
|
|
+ ret = ret + item.qty
|
|
|
+ })
|
|
|
+ return ret
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
// 查询详情
|
|
@@ -81,7 +139,9 @@
|
|
|
// 查询列表
|
|
|
getPartList(){
|
|
|
const _this = this
|
|
|
+ this.showLoading()
|
|
|
shelfReplenishDetailList({ replenishBillSn: this.replenishBillSn }).then(res => {
|
|
|
+ uni.hideLoading()
|
|
|
if(res.status == 200 && res.data){
|
|
|
_this.totalQty = 0
|
|
|
_this.confirmQty = 0
|
|
@@ -143,6 +203,35 @@
|
|
|
_this.confirmQty += Number(item.putQty)
|
|
|
}
|
|
|
})
|
|
|
+ },
|
|
|
+ // 查询关联销售单
|
|
|
+ getSalesOrder () {
|
|
|
+ queryRelationSalesBill({ replenishBillSn: this.replenishBillSn }).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ this.salesOrderList = res.data
|
|
|
+ } else {
|
|
|
+ this.salesOrderList = []
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 生成销售单
|
|
|
+ creatSalesOrder(){
|
|
|
+ this.showModal = true
|
|
|
+ },
|
|
|
+ showModalConfirm(){
|
|
|
+ this.showLoading("正在生成销售单...")
|
|
|
+ createSalesBill({ replenishBillSn: this.replenishBillSn }).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ this.getSalesOrder()
|
|
|
+ }
|
|
|
+ this.showModal = false
|
|
|
+ this.toashMsg(res.message)
|
|
|
+ uni.hideLoading()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 查看销售单
|
|
|
+ viewSales(data){
|
|
|
+ uni.navigateTo({ url: '/pages/sales/edit?pageType=detail&data='+JSON.stringify(data) })
|
|
|
}
|
|
|
}
|
|
|
}
|