平板端快衣店
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.
 
 
 
 
 

449 lines
12 KiB

<template>
<view class="container">
<uni-card :title="(sales.supplierName == null ?'暂无':sales.supplierName)+'--'+(supplier.consigneeMobile == null ?'暂无':supplier.consigneeMobile)" thumbnail="/static/images/dingdan/dd0.png">
<view class="uni-body" v-if="supplier.province">{{supplier.province + supplier.area + supplier.city + supplier.address}} </view>
</uni-card>
<view class="tui-order-item boxbg">
<view class="shop-box" style="border-top:5px solid #eee;" v-for="(item,index) in goodsList" :key="index">
<view class="shop-name">
<img :src="item.productPicture == null ?'暂无':item.productPicture" alt=""
style="width: 140rpx;height: 140rpx;margin: 30rpx 0 0 30rpx;">
<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> 数量:{{item.productCount == null ?'暂无':item.productCount}} <text v-if="type==0">总价:{{item.price == null ?'暂无':item.price}}</text></view>
</view>
<view v-if="type==0 && sales.inStorageStatus == 0" style="position: absolute;top: 130rpx;right: 40rpx;color: blue;text-decoration: underline;"
@tap="clickCollapse(index)">
维护采购价
</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 style="color: red;">单价:¥{{item.price}}</text> -->
<text>数量:{{items.productCount == null ?'暂无':items.productCount}}</text>
</view>
</view>
</view>
<view class="tui-goods-info" style="width: 95%;margin: 0 auto;" v-if="type==0 && sales.inStorageStatus != 0">
<view class="tui-price-flex tui-size32" style="height: 80rpx;line-height: 80rpx;">
<view class="tui-flex-shrink">应付金额</view>
<view class="tui-goods-price">
<view class="tui-size-24">¥</view>
<view class="tui-price-large">{{ sales.shouldPay == null ?'暂无':sales.shouldPay }}</view>
</view>
</view>
<view class="tui-price-flex tui-size32" style="height: 80rpx;line-height: 80rpx;">
<view class="tui-flex-shrink">已付金额</view>
<view class="tui-goods-price">
<view class="tui-size-24">¥</view>
<view class="tui-price-large">{{ sales.alreadyPay == null ?'暂无':sales.alreadyPay }}</view>
</view>
</view>
<view class="tui-price-flex tui-size32" style="height: 80rpx;line-height: 80rpx;">
<view class="tui-flex-shrink">欠款</view>
<view class="tui-goods-price tui-primary-color">
<view class="tui-size-24">¥</view>
<view class="tui-price-large">{{ sales.noPay == null ?'暂无':sales.noPay}}</view>
</view>
</view>
<view class="tui-price-flex tui-size32" style="height: 80rpx;line-height: 80rpx;">
<view class="tui-flex-shrink">其他费用</view>
<view class="tui-goods-price">
<view class="tui-size-24">¥</view>
<view class="tui-price-large">{{ sales.otherPay == null ?'暂无':sales.otherPay}}</view>
</view>
</view>
<view class="tui-price-flex tui-size32" style="height: 80rpx;line-height: 80rpx;">
<view class="tui-flex-shrink">备注</view>
<view class="tui-goods-price">
<view class="tui-price-large">{{ sales.remark == null ?'暂无':sales.remark}}</view>
</view>
</view>
</view>
<view class="tui-goods-info" v-if="type==0 && sales.inStorageStatus == 0">
<!-- 账号权限是否可以维护成本价格(主账号和被授权的账号可以维护),参数名:shop_admin_cost,维护在用户表中,存在前后端缓存里,把备注栏挪出来,谁都可以备注 -->
<view class="price-box-list">
<view class="content-list">
<view class="list-name">应付金额</view>
<view class="list-val">
<input type="text" v-model="shouldPay">
</view>
</view>
<view class="content-list">
<view class="list-name">已付金额</view>
<view class="list-val">
<input type="text" v-model="alreadyPay" @blur="changePay">
</view>
</view>
<view class="content-list">
<view class="list-name">欠款</view>
<view class="list-val">
<input type="text" v-model="noPay" disabled>
</view>
</view>
<view class="content-list">
<view class="list-name">其他费用</view>
<view class="list-val">
<input type="text" v-model="otherPay">
</view>
</view>
<view class="content-list">
<view class="list-name">备注</view>
<view class="">
<textarea v-model="remark" />
</view>
</view>
</view>
</view>
</view>
<view class="tui-tabbar">
<view class="tui-btn-mr" v-if="type==0 && sales.inStorageStatus == 1 && sales.noPay >0" @tap="inputDialogToggle">回款</view>
<view class="tui-btn-mr" v-if="type==0 && sales.inStorageStatus == 0" @click="inventorySubmit">确认提交</view>
</view>
<!-- 弹出输入框 -->
<uni-popup ref="priceDialog" type="dialog">
<uni-popup-dialog ref="inputClose" mode="input" title="采购价" placeholder="请输入采购价"
@confirm="changePrice"></uni-popup-dialog>
</uni-popup>
<!-- 回款金额输入框 -->
<uni-popup ref="inputDialog" type="dialog">
<uni-popup-dialog ref="inputClose" mode="input" title="回款金额" placeholder="请输入回款金额"
@confirm="sureNpPay"></uni-popup-dialog>
</uni-popup>
</view>
</template>
<script>
export default {
data() {
return {
sales: {},
goodsList: [],
isReturn: false,
shouldPay:0,
noPay:0,
alreadyPay:0,
otherPay:0,
remark:'',
id:'',
type:'',
supplier:[]
}
},
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.id = option.id
this.getWaitStorage(option.id)
this.type = uni.getStorageSync('type')
},
methods: {
getWaitStorage(id) {
this.tui.request("/app/purchase/getPurchaseAllData", "post", {
id: id
}, false, true).then((res) => {
if (res.code == 200) {
this.sales = res.result.purchase
this.noPay = res.result.purchase.noPay
this.supplier = res.result.supplier
this.remark = res.result.purchase.remark
this.goodsList = res.result.purchaseDetails
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
},
//计算欠款
changePay() {
this.noPay = this.shouldPay - this.alreadyPay
},
//回款金额输入框
inputDialogToggle() {
this.$refs.inputDialog.open()
},
sureNpPay(e){
if(e>this.noPay){
uni.showToast({
title: "回款金额不应超过欠款金额!",
icon: 'none'
})
return
}
this.tui.request('/app/purchase/editPayPrice','post', {
id:this.sales.id,
price:e
},false,true).then(res => {
uni.showToast({
title: "成功!",
icon: 'none'
})
uni.navigateBack();
}).catch(res => {});
},
inventorySubmit() {
if(this.shouldPay == 0){
uni.showToast({
title: "请维护商品价格后入库!",
icon: 'none'
})
return
}else if(this.alreadyPay == 0){
uni.showToast({
title: "管理员必须维护价格后入库!",
icon: 'none'
})
return
}
let that = this;
let purchase = {
id:this.id,
alreadyPay: this.alreadyPay, //已付金额
noPay: this.noPay, //欠款
shouldPay: this.shouldPay, //应付金额
totalAmount: this.sales.totalAmount, //总数量
remark: this.remark,
supplierId: this.sales.supplierId, //供应商id和姓名
supplierName: this.sales.supplierName
}
this.tui.request("/app/stock/putInPrice", "post", {
purchase: purchase,
purchaseDetails: this.goodsList
}, false, false).then((res) => {
if (res.code == 200) {
uni.showToast({
title: "入库成功",
icon: 'none'
})
uni.navigateBack({
delta: 2
})
} else {
uni.showToast({
title: "入库失败",
icon: 'none'
})
}
})
},
//编辑每一个的单价
clickCollapse(index) {
this.index = index
this.$refs.priceDialog.val = ''
this.$refs.priceDialog.open()
},
//计算价格
changePrice(val) {
let that = this;
that.shouldPay = 0
that.goodsList[that.index].purchasePrice = val
that.goodsList[that.index].price = val * that.goodsList[that.index].productCount;
that.goodsList.forEach(function(value, key) {
that.shouldPay += value.price
})
}
},
}
</script>
<style lang="scss" scoped>
.container {
padding-bottom: 118rpx;
.boxbg {
background-color: #fff;
margin: 30upx;
border-radius: 10upx;
box-shadow: 0px 1px 10px 2px #e2e2e2;
}
.tui-order-item {
.u-collapse-content {
display: flex;
justify-content: space-between;
line-height: 30px;
}
.tui-goods-info {
width: 100%;
box-sizing: border-box;
background: #fff;
line-height: 26px;
border-top: 10px solid #eee;
.tui-price-flex {
display: flex;
align-items: center;
justify-content: space-between;
}
.tui-size32 {
font-size: 32rpx;
font-weight: 500;
}
.tui-size-24 {
font-size: 24rpx;
}
.tui-price-large {
font-size: 32rpx;
.lineText {
text-decoration: line-through;
font-size: 12px;
color: #888;
}
}
.tui-flex-shrink {
flex-shrink: 0;
}
.tui-goods-price {
width: 100%;
display: flex;
align-items: flex-end;
justify-content: flex-end;
font-size: 24rpx;
}
.tui-primary-color {
color: #EB0909;
}
.tui-pbtm20 {
padding-bottom: 20rpx;
}
}
}
}
.tui-tabbar {
width: 100%;
height: 98rpx;
background: #fff;
position: fixed;
left: 0;
bottom: 0;
display: flex;
align-items: center;
justify-content: flex-end;
font-size: 26rpx;
box-shadow: 0 0 1px rgba(0, 0, 0, .3);
padding-bottom: env(safe-area-inset-bottom);
z-index: 996;
}
.tui-btn-mr {
width:130rpx;
height: 60rpx;
background: #088FEB;
color: #fff;
border-radius: 10px;
line-height: 60rpx;
text-align: center;
margin-right: 30rpx;
}
.shop-box {
width: 95%;
margin: 0 auto;
position: relative;
}
.shop-name {
width: 100%;
height: 200rpx;
line-height: 80rpx;
border-top: 1px solid #eee;
border-bottom: 1px solid #eee;
font-size: 28rpx;
font-weight: bold;
display: flex;
.uni-icons {
color: #088FEB !important;
}
}
.shop-productName {
flex: 1;
display: flex;
flex-direction: column;
padding-left: 20rpx;
}
.shop-productName view {
height: 55rpx;
}
.shop-collapse {
display: flex;
height: 80rpx;
font-size: 26rpx;
line-height: 80rpx;
}
.shop-collapse text {
flex: 1;
text-align: center;
padding-right: 40rpx;
border-right: 1px solid #eee;
}
.content-list {
width: 95%;
margin: 0 auto;
display: flex;
height: 80rpx;
border-bottom: 1px solid #eee;
}
.content-list:last-child {
border-bottom: none;
height: auto;
}
.list-name {
width: 200rpx;
text-align: left;
line-height: 40px;
height: 80rpx;
padding-left: 20rpx;
}
.list-val {
width: 560rpx;
height: 80rpx;
line-height: 80rpx;
}
.list-val input {
width: 400rpx;
height: 60rpx;
display: inline-block;
line-height: 60rpx;
float: left;
margin-top: 10rpx;
padding-left: 20rpx;
border-bottom: 1px solid #088FEB;
}
textarea {
margin: 20rpx;
border: 1px solid #eee;
height: 150rpx;
width: 500rpx;
}
</style>