平板端快衣店
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

413 lines
14 KiB

<template>
<view class="container">
<cmd-nav-bar iconOne="chevron-left" @iconOne="goToInfo" :title="'入库确认'" background-color="#fff"></cmd-nav-bar>
<!-- <uni-card :title="(purchase.supplierName == null ?'暂无':purchase.supplierName)" thumbnail="/static/images/dingdan/dd0.png">
</uni-card> -->
<view class="tui-order-item boxbg">
<view style="width: 100%;background: #088FEB;height: 30px;line-height: 30px;color: #fff;text-align:center;display: flex;">
<view style="width: 5%;border-right:1px solid #fff;">图</view>
<view style="width: 17%;border-right:1px solid #fff;">名称</view>
<view style="width: 17%;border-right:1px solid #fff;">货号</view>
<view style="width: 15%;border-right:1px solid #fff;">颜色</view>
<view style="width: 15%;border-right:1px solid #fff;">尺码</view>
<view style="width: 11%;border-right:1px solid #fff;">数量</view>
<view style="width: 20%;border-right:1px solid #fff;">供应商</view>
</view>
<view v-for="(item,index) in purchaseDetails" :key="index"
style="width: 100%;height: auto;line-height: 30px;background: #fff;">
<view v-for="(item1,index1) in item.stockLogList1" :key='index1'>
<view style="display: flex;height: 30px;text-align: center;position: relative;border-bottom: 1px solid #eee;">
<view style="width: 5%;border-right:1px solid #eee;position: relative;">
<view style="width: 30px;height: 30px;margin: 0 auto;">
<img :src="item.productPicture"
alt="" style="width: 30px;height: 30px;" v-if="item.productPicture">
<view v-else
style="width: 100%;height: 100%;color: #777;background: #eee;border-radius: 5px;margin: 0 auto;">
暂无
</view>
</view>
</view>
<view style="width: 17%;border-right:1px solid #eee;">
{{item.productName == null?'':item.productName}}
</view>
<view style="width: 17%;border-right:1px solid #eee;display: flex;height: 30px;line-height: 30px;text-align:center;">
{{item.productSn}}
</view>
<view style="width: 15%;border-right:1px solid #eee;">
<text>
{{numData(item1.attributeList)[0]}}
</text>
</view>
<view style="width: 15%;border-right:1px solid #eee;">
<text>
{{numData(item1.attributeList)[1]}}
</text>
</view>
<view style="width: 11%;border-right:1px solid #eee;">
<view style="height: 30px;line-height: 30px;">
<input v-model="item1.productCount" disabled style="height: 30px;line-height: 30px;" />
</view>
</view>
<view style="width: 20%;border-right:1px solid #eee;">
{{purchase.supplierName}}
</view>
</view>
</view>
</view>
<!-- <view class="shop-box" style="border-top:5px solid #eee;" v-for="(item,index) in purchaseDetails" :key="index">
<view class="shop-name">
<img class="img-radius" :src="item.productPicture" alt="" style="width: 140rpx;height: 140rpx;margin: 30rpx 0 0 30rpx;" v-if="item.productPicture">
<view class="noPic" v-else>暂无图片</view>
<view class="shop-productName">
<view style="color:#FF5809;">{{item.productName == null ?'暂无':item.productName}}</view>
<view>货号:{{item.productSn == null ?'暂无':item.productSn}}</view>
<view><text v-if="type==0">单价:{{item.purchasePrice == null ?'暂无':item.purchasePrice}} </text><text style="padding: 0 5rpx;">数量:{{item.productCount == null ?'暂无':item.productCount}} </text><text v-if="type==0">总价:{{item.price == null ?'暂无':item.price}}</text></view>
</view>
</view>
<view class="shop-type">
<view class="shop-collapse" v-for="(items,index) in item.stockLogList1" :key='index'>
<text>{{items.attributeList | sliceMsg}}</text>
<text>数量:{{items.productCount == null ?'暂无':items.productCount}}</text>
</view>
</view>
</view> -->
<view class="tui-goods-info" style="width: 100%;margin: 20px auto 0;border-top: 5px solid #eee;">
<view class="tui-price-flex" v-if="userType == 0&& zhiqianqiankuan >= 0" style="height: 40px;line-height: 40px;">
<view class="tui-flex-shrink">之前欠款</view>
<view class="tui-goods-price">
<view>¥</view>
<view class="tui-price-large">{{zhiqianqiankuan == null ?'暂无':Math.abs(zhiqianqiankuan) }}</view>
</view>
</view>
<view class="tui-price-flex" v-if="userType == 0&&zhiqianqiankuan < 0 && aiinventory != 2" style="height: 40px;line-height: 40px;">
<view class="tui-flex-shrink">客户余额</view>
<view class="tui-goods-price">
<view>¥</view>
<view class="tui-price-large">{{zhiqianqiankuan == null ?'暂无':Math.abs(zhiqianqiankuan) }}</view>
</view>
</view>
<view class="tui-price-flex" v-if="userType == 0 && aiinventory != 2" style="height: 40px;line-height: 40px;">
<view class="tui-flex-shrink">应付金额</view>
<view class="tui-goods-price">
<view>¥</view>
<view class="tui-price-large">{{ purchase.shouldPay == null ?'暂无':purchase.shouldPay }}</view>
</view>
</view>
<view class="tui-price-flex" v-if="userType == 0 && aiinventory != 2" style="height: 40px;line-height: 40px;">
<view class="tui-flex-shrink">已付金额</view>
<view class="tui-goods-price">
<view>¥</view>
<view class="tui-price-large">{{ purchase.alreadyPay == null ?'暂无':purchase.alreadyPay }}</view>
</view>
</view>
<view class="tui-price-flex" v-if="userType == 0 && aiinventory == 2" style="height: 40px;line-height: 40px;">
<view class="tui-flex-shrink">退货金额</view>
<view class="tui-goods-price">
<view>¥</view>
<view class="tui-price-large">{{ purchase.alreadyPay == null ?'暂无':purchase.alreadyPay }}</view>
</view>
</view>
<view class="tui-price-flex" v-if="yuedikou != 0 && userType == 0 && aiinventory != 2" style="height: 40px;line-height: 40px;">
<view class="tui-flex-shrink">余额抵扣</view>
<view class="tui-goods-price">
<view>¥</view>
<view class="tui-price-large">{{yuedikou == null ?'暂无':yuedikou }}</view>
</view>
</view>
<view class="tui-price-flex" v-if="leijiqiankuan > 0 && userType == 0 && aiinventory != 2" style="height: 40px;line-height: 40px;">
<view class="tui-flex-shrink">累计欠款</view>
<view class="tui-goods-price">
<view>¥</view>
<view class="tui-price-large">{{leijiqiankuan == null ?'暂无':leijiqiankuan }}</view>
</view>
</view>
<view class="tui-price-flex" v-if="leijiqiankuan < 0 && userType == 0 && aiinventory != 2" style="height: 40px;line-height: 40px;">
<view class="tui-flex-shrink">累计余额</view>
<view class="tui-goods-price">
<view>¥</view>
<view class="tui-price-large">{{leijiqiankuan == null ?'暂无':Math.abs(leijiqiankuan) }}</view>
</view>
</view>
<view class="tui-price-flex" v-if="purchase.noPay >= 0 && userType == 0 && aiinventory != 2" style="height: 40px;line-height: 40px;">
<view class="tui-flex-shrink">本次欠款</view>
<view class="tui-goods-price">
<view>¥</view>
<view class="tui-price-large">{{purchase.noPay == null ?'暂无':purchase.noPay }}</view>
</view>
</view>
<view class="tui-price-flex" v-if="purchase.noPay < 0 && userType == 0 && aiinventory != 2" style="height: 40px;line-height: 40px;">
<view class="tui-flex-shrink">本次余额</view>
<view class="tui-goods-price">
<view>¥</view>
<view class="tui-price-large">{{purchase.noPay == null ?'暂无':purchase.noPay }}</view>
</view>
</view>
<view class="tui-price-flex" style="height: 40px;line-height: 40px;">
<view class="tui-flex-shrink">其他费用</view>
<view class="tui-goods-price tui-primary-color">
<view>¥</view>
<view class="tui-price-large">{{ purchase.otherPay == null ?'暂无':purchase.otherPay}}</view>
</view>
</view>
<view class="tui-price-flex">
<view class="tui-flex-shrink">备注</view>
<view class="tui-goods-price">
<uni-tooltip :content="purchase.remark == null ?'暂无':purchase.remark">
<view style="font-size: 13px;width: 200px;height: 40rpx;overflow: hidden;text-align: right;">{{ purchase.remark == null ?'':purchase.remark}}</view>
<text style="color: blue;">查看更多</text>
</uni-tooltip>
</view>
</view>
</view>
</view>
<view class="tui-tabbar">
<view class="tui-btn-mr" @click="batchPrint" v-if="aiinventory !=1">批量打印</view>
<view class="tui-btn-mr" @click="inventorySubmit">确认提交</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
purchase:{},
purchaseDetails:'',
aiinventory:0, //1是AI入库 0是普通入库 2采购退货
userType:1,
claerSubmitBtn:0,
leijiqiankuan:0,
zhiqianqiankuan:0,
khid:'',
yuedikou:0,
khName: [],
data:{}
}
},
filters: {
sliceMsg(val) {
var name = ''
if (typeof(val) == 'string') {
let newObj = JSON.parse(val)
for (let as in newObj) {
name += newObj[as] + '/'
}
}
return name;
}
},
onLoad(option) {
this.aiinventory = option.aiinventory
if(option.aiinventory == 2){
uni.setNavigationBarTitle({
title:'采购退货确认'
});
}
this.purchaseDetails = JSON.parse(option.purchaseDetails)
if(this.purchaseDetails != '' && uni.getStorageSync('type') == 0){
for(let i=0;i<this.purchaseDetails.length;i++){
if(this.purchaseDetails[i].purchasePrice == '' || this.purchaseDetails[i].purchasePrice == null){
this.purchaseDetails[i].purchasePrice = 0
}
if(this.purchaseDetails[i].wholesalePrice == '' || this.purchaseDetails[i].wholesalePrice == null){
this.purchaseDetails[i].wholesalePrice = 0
}
for(let m=0;m<this.purchaseDetails[i].stockLogList1.length;m++){
if(this.purchaseDetails[i].stockLogList1[m].productCount == '' || this.purchaseDetails[i].stockLogList1[m].productCount == null){
this.purchaseDetails[i].stockLogList1[m].productCount = 0
}
}
}
}
this.purchase = JSON.parse(option.purchase)
this.userType = uni.getStorageSync('type')
this.yuedikou = option.yuedikou
this.zhiqianqiankuan = option.zhiqianqiankuan
this.leijiqiankuan = option.leijiqiankuan
},
methods: {
numData(val) {
var name = []
if (typeof(val) == 'string') {
let newObj = JSON.parse(val)
for (let as in newObj) {
name.push(newObj[as])
}
}
return name;
},
inventorySubmit() {
var that = this;
this.claerSubmitBtn += 1
if(this.claerSubmitBtn == 1){
let url;
uni.showLoading({
title: '加载中...'
})
if(this.aiinventory == 1){
url = '/app/stock/putInPriceOfAi'
for(let i=0;i<this.purchaseDetails.length;i++){
delete this.purchaseDetails[i].id;
}
}else if(this.aiinventory == 0){
url = '/app/stock/putInOfProduct'
}else{
url = '/app/stock/putOutPrice'
for(let i=0;i<this.purchaseDetails.length;i++){
delete this.purchaseDetails[i].id;
}
}
if(uni.getStorageSync('storeFlag') == '1'){
this.purchase.storeFlag = 1
}
this.$nextTick(()=>{
this.purchase.balanceDeductionAmount = this.yuedikou
this.tui.request(url, "post", {
purchase: this.purchase,
purchaseDetails: this.purchaseDetails
}, false, false).then((res) => {
if (res.code == 200) {
uni.showToast({
title: "成功",
icon: 'none',
duration:500
})
if(this.aiinventory == 1){
setTimeout(function() {
uni.showModal({
title: "提示",
content: "是否向所有客户推送上新消息?",
success: function(res1) {
if (res1.confirm) {
uni.reLaunch({
url: "/package1/inventory/inventoryUpNew?id=" + res.result
// url: "/package1/inventory/inventoryUpNew?id=1879820286384279553"
})
}else{
uni.redirectTo({
url: '/package1/AI/waitStorageHeng?inStorageStatus=1'
});
}
}
})
}, 500);
}else{
setTimeout(function() {
uni.navigateBack({
delta: 2
})
}, 500);
}
} else {
uni.showToast({
title: res.message,
icon: 'none'
})
}
})
})
setTimeout(res => {
uni.hideLoading();
}, 2000)
}else{
this.tui.toast("请勿重复提交!")
}
},
goToInfo() {
uni.navigateBack()
},
batchPrint(){
uni.navigateTo({
url: "/package1/inventory/batchPrint?purchase=" + JSON.stringify(this.purchase) + '&purchaseDetails=' + JSON.stringify(this.purchaseDetails)
})
},
},
}
</script>
<style lang="scss">
.container {
font-size: 14px;
padding-bottom: 60px;
.boxbg {
background-color: #fff;
margin: 80px 30px 0;
padding: 20px;
border-radius: 10upx;
box-shadow: 0px 1px 10px 2px #e2e2e2;
}
.tui-order-item {
.tui-goods-info {
width: 100%;
box-sizing: border-box;
background: #fff;
line-height: 26px;
.tui-price-flex {
display: flex;
align-items: center;
justify-content: space-between;
}
.tui-flex-shrink {
flex-shrink: 0;
}
.tui-goods-price {
width: 100%;
display: flex;
align-items: flex-end;
justify-content: flex-end;
}
.tui-primary-color {
color: #EB0909;
}
}
}
}
.tui-tabbar {
width: 100%;
height: 50px;
background: #fff;
position: fixed;
left: 0;
bottom: 0;
display: flex;
align-items: center;
justify-content: flex-end;
font-size: 14px;
box-shadow: 0 0 1px rgba(0, 0, 0, 0.3);
padding-bottom: env(safe-area-inset-bottom);
z-index: 996;
}
.tui-btn-mr {
width: 80px;
height: 40px;
background: #088FEB;
color: #fff;
border-radius: 10px;
line-height: 40px;
text-align: center;
margin-right: 30rpx;
}
.uni-tooltip {
display: flex !important;
}
</style>