123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270 |
- <template>
- <view class="cancelStockPages" :style="`backgroundImage:linear-gradient(180deg, ${$config('primaryColor')}, #F5F6F7 12%)`">
- <view class="cancelStockPages-body">
- <view class="head-info" v-if="basicInfoData">
- <view class="states">
- <view>
- <u-icon name="icon_withdrawal" custom-prefix="iscm-icon" size="48"></u-icon>
- <text>待退库</text>
- </view>
- </view>
- <view>
- <view class="label"><u-icon name="ison_shelf" custom-prefix="iscm-icon" size="32"></u-icon><text>货架名称</text></view>
- <view class="info-txt">{{basicInfoData.shelfInfo&&basicInfoData.shelfInfo.shelfName || '--'}}</view>
- </view>
- <view>
- <view class="label"><u-icon name="icon_position" custom-prefix="iscm-icon" size="32"></u-icon><text>客户地址</text></view>
- <view class="info-txt">{{basicInfoData.customerAddr || '--'}}</view>
- </view>
- </view>
- <view class="part-list">
- <!-- 配件列表 -->
- <!-- <partList title="配件列表" fromPage="recall" ref="partList" :list="partList" @allChecked="allCheckedCallback"></partList> -->
- <partList title="配件列表" fromPage="recall" ref="partList" :list="partList"></partList>
- </view>
- </view>
- <view class="cancelStockPages-footer">
- <u-button @click="submit" shape="circle" :custom-style="{background:$config('primaryColor')}" type="primary">确定退库</u-button>
- </view>
- <!-- 确认弹框 -->
- <common-modal :openModal="confirmModal" content="调回产品将退回至经销商仓库,确认退库吗?" confirmText="确认退库" @confirm="modalConfirm" @close="confirmModal=false" />
- <!-- 生成销售退货单弹窗 -->
- <common-modal :showTitle="false" :openModal="refundModal" @confirm="refundModalConfirm" @close="refundModal=false">
- <view style="font-size: 28upx;">
- <view style="padding: 10upx;" class="flex align_center justify_between" v-if="basicInfoData">
- <view>产品总款数:<text style="color: red;">{{basicInfoData.totalCategory}}</text></view>
- <view>产品总件数:<text style="color: red;">{{basicInfoData.totalQty}}</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">
- <text>{{item.salesReturnNo}}</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 partList from '@/pages/common/partList.vue'
- import { shelfRecallFindBySn, shelfRecallDetail, shelfRecallConfirm,generateSaleReturnBill } from '@/api/shelfRecall.js'
- export default {
- components: { commonModal, partList },
- data() {
- return {
- allChecked: false,
- recallBillSn: '',
- basicInfoData: null,
- partList: [],
- confirmModal: false,
- refundModal:false,
- salesOrderList:[]
- }
- },
- onReady() {
- uni.setNavigationBarColor({
- frontColor: '#ffffff',
- backgroundColor: this.$config('primaryColor')
- })
- },
- onLoad(option) {
- this.recallBillSn = option.sn
- this.getDetail()
- this.getPartList()
- },
- onNavigationBarButtonTap(){
- this.refundModal = true;
- },
- methods: {
- // 全选
- // allCheckeChange(e){
- // this.$refs.partList.allSelect(e.value)
- // },
- // allCheckedCallback(val){
- // this.allChecked = val
- // },
- // 查询详情
- getDetail(){
- shelfRecallFindBySn({sn: this.recallBillSn}).then(res => {
- if(res.status == 200){
- this.basicInfoData = res.data || null
- this.salesOrderList = res.data.salesReturnBillList ? res.data.salesReturnBillList:[];
- }else{
- this.basicInfoData = null
- }
-
- })
- },
- // 查询配件列表
- getPartList(){
- shelfRecallDetail({ recallBillSn: this.recallBillSn }).then(res => {
- if(res.status == 200 && res.data){
- res.data.map(item =>{
- item.confirmQty = item.qty ? Number(item.qty) : 0
- })
- this.partList = res.data || []
- console.log(res.data)
- }else{
- this.partList = []
- }
- })
- },
- // 确定退货
- submit(){
- this.confirmModal = true
- // const result =this.$refs.partList.getAllChecked()
- // if(result.length){
- // this.confirmModal = true
- // }else{
- // this.toashMsg("请选择配件!")
- // }
- },
- // 确认退库 confirm
- modalConfirm(){
- // const result =this.$refs.partList.getAllChecked()
- const arr = []
- this.partList.map((item, index) => {
- if (item.confirmQty || item.confirmQty == 0) {
- arr.push({
- productSn: item.productSn,
- confirmQty: item.confirmQty,
- recallBillDetailSn: item.recallBillDetailSn
- })
- }
- })
- const params = {
- shelfSn: result[0].shelfSn,
- recallBillSn: this.recallBillSn,
- recallBillNo: result[0].recallBillNo,
- detailList: arr
- }
- shelfRecallConfirm(params).then(res => {
- if(res.status == 200){
- uni.$emit("refreshBL")
- uni.navigateBack()
- }
- this.toashMsg(res.message)
- })
- },
- // 生成销售退货单
- refundModalConfirm(){
- generateSaleReturnBill({ recallBillSn: this.recallBillSn }).then(res => {
- if (res.status == 200) {
- uni.showToast({
- title:res.message
- })
- this.refundModal = false
- }else{
- uni.showToast({
- title:res.message,
- icon:'none'
- })
- }
- })
- }
- }
- }
- </script>
- <style lang="less">
- page {
- height: 100vh;
- }
- .cancelStockPages{
- position: relative;
- width: 100%;
- height: 100%;
- overflow: hidden;
- padding-bottom: 136upx;
- .cancelStockPages-body{
- padding: 0 30rpx;
- height: 100%;
- overflow: auto;
- > view{
- padding: 10rpx 25rpx;
- background-color: #fff;
- margin-bottom: 20rpx;
- border-radius: 25rpx;
- box-shadow: 2rpx 3rpx 5rpx #eee;
- }
- .head-info{
- .states{
- border: 0;
- padding: 20rpx 0;
- > view{
- color: #191919;
- text-align: center;
- font-size: 40rpx;
- text{
- margin-left: 20rpx;
- }
- }
- }
- .info-txt{
- word-break: break-word;
- }
- font-size: 30rpx;
- > view{
- display: flex;
- border-bottom: 2rpx solid #f5f5f5;
- padding: 20rpx 0;
- > view:last-child{
- flex-grow: 1;
- width: 80%;
- }
- &:last-child{
- border:0;
- }
- }
- .label{
- display: flex;
- align-items: center;
- width: 220rpx;
- height: 44rpx;
- color: #7C7D7E;
- text{
- margin-left: 10rpx;
- }
- }
- }
- }
- .cancelStockPages-footer{
- padding: 20upx 32upx 26upx;
- background-color: #fff;
- position: fixed;
- left: 0;
- bottom: 0;
- width: 100%;
- box-shadow: 3px 1px 7px #eee;
- .button{
- width: 100%;
- }
- }
- }
- </style>
|