|
|
|
@ -1,66 +1,63 @@ |
|
|
|
<template> |
|
|
|
<view class="container"> |
|
|
|
<uni-card :title="sales.userName" thumbnail="/static/images/dingdan/dd0.png"> |
|
|
|
<uni-card :title="sales.supplierName" thumbnail="/static/images/dingdan/dd0.png"> |
|
|
|
<view class="uni-body">{{sales.province + sales.area + sales.city + sales.receiveAddress}} </view> |
|
|
|
</uni-card> |
|
|
|
<view class="tui-order-item boxbg"> |
|
|
|
<view class="shop-box" style="border-top:5px solid #eee;" v-for="(value,key) in Array.from(carList)" :key="key"> |
|
|
|
<view class="shop-name"> |
|
|
|
<img :src="value[1].productPicture" alt="" |
|
|
|
style="width: 140rpx;height: 140rpx;margin: 30rpx 0 0 30rpx;"> |
|
|
|
<view class="shop-productName"> |
|
|
|
<view style="color:#FF5809;">品名:{{value[1].productName}}</view> |
|
|
|
<view>货号:{{value[1].productSn}}</view> |
|
|
|
<view>总价:{{value[1].price}} 数量:{{value[1].productCount}}</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
<view class="shop-type"> |
|
|
|
<view class="shop-collapse" v-for="(values,keys) in Array.from(value[1].stockLogList)"> |
|
|
|
<text>{{values[0] | sliceMsg}}</text> |
|
|
|
<!-- <text style="color: red;">单价:¥{{item.price}}</text> --> |
|
|
|
<text>数量:{{values[1]}}</text> |
|
|
|
</view> |
|
|
|
<view |
|
|
|
style="position: absolute;top: 130rpx;right: 40rpx;color: blue;text-decoration: underline;" |
|
|
|
@tap="clickCollapse(value[0])"> |
|
|
|
<view class="shop-box" style="border-top:5px solid #eee;" v-for="(item,index) in goodsList" :key="key"> |
|
|
|
<view class="shop-name"> |
|
|
|
<img :src="item.productPicture" alt="" |
|
|
|
style="width: 140rpx;height: 140rpx;margin: 30rpx 0 0 30rpx;"> |
|
|
|
<view class="shop-productName"> |
|
|
|
<view style="color:#FF5809;">品名:{{item.productName}}</view> |
|
|
|
<view>货号:{{item.productSn}}</view> |
|
|
|
<view>总价:{{item.price}} 数量:{{item.productCount}}</view> |
|
|
|
</view> |
|
|
|
<view style="position: absolute;top: 130rpx;right: 40rpx;color: blue;text-decoration: underline;" |
|
|
|
@tap="clickCollapse(index)"> |
|
|
|
维护采购价 |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="tui-goods-info"> |
|
|
|
<view class="tui-price-flex tui-size32 tui-pbtm20"> |
|
|
|
<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.totalAmount }}</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="tui-price-flex tui-size32"> |
|
|
|
<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.alreadyEarn }}</view> |
|
|
|
<view class="shop-type"> |
|
|
|
<view class="shop-collapse" v-for="items in item.stockLogList1"> |
|
|
|
<text>{{items.attributeList | sliceMsg}}</text> |
|
|
|
<!-- <text style="color: red;">单价:¥{{item.price}}</text> --> |
|
|
|
<text>数量:{{items.productCount}}</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="tui-price-flex tui-size32"> |
|
|
|
<view class="tui-flex-shrink">欠款</view> |
|
|
|
<view class="tui-goods-price"> |
|
|
|
<view class="tui-size-24">¥</view> |
|
|
|
<view class="tui-price-large">{{ sales.noEarn}}</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="tui-price-flex tui-size32"> |
|
|
|
<view class="tui-flex-shrink">其他费用</view> |
|
|
|
<view class="tui-goods-price"> |
|
|
|
<view class="tui-size-24">¥</view> |
|
|
|
<view class="tui-price-large">{{ sales.otherExpense}}</view> |
|
|
|
</view> |
|
|
|
<view class="tui-goods-info"> |
|
|
|
<!-- 账号权限是否可以维护成本价格(主账号和被授权的账号可以维护),参数名: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> |
|
|
|
<view class="tui-price-flex tui-size32"> |
|
|
|
<view class="tui-flex-shrink">备注</view> |
|
|
|
<view class="tui-goods-price"> |
|
|
|
<view class="tui-price-large">{{ sales.remark}}</view> |
|
|
|
<view class="content-list"> |
|
|
|
<view class="list-name">备注</view> |
|
|
|
<view class=""> |
|
|
|
<textarea v-model="remark" /> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
@ -69,7 +66,12 @@ |
|
|
|
<view class="tui-btn-mr"> |
|
|
|
<u-button type="error" :plain="true" shape="circle" @click="cancelOrder">确认提交</u-button> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<!-- 弹出输入框 --> |
|
|
|
<uni-popup ref="inputDialog" type="dialog"> |
|
|
|
<uni-popup-dialog ref="inputClose" mode="input" title="采购价" placeholder="请输入采购价" |
|
|
|
@confirm="changePrice"></uni-popup-dialog> |
|
|
|
</uni-popup> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
|
@ -78,50 +80,127 @@ |
|
|
|
data() { |
|
|
|
return { |
|
|
|
sales: {}, |
|
|
|
list: [], |
|
|
|
isReturn: false |
|
|
|
goodsList: [], |
|
|
|
isReturn: false, |
|
|
|
shouldPay:0, |
|
|
|
noPay:0, |
|
|
|
alreadyPay:0, |
|
|
|
otherPay:0, |
|
|
|
remark:'', |
|
|
|
} |
|
|
|
}, |
|
|
|
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) { |
|
|
|
onLoad(option) { |
|
|
|
this.getWaitStorage(option.id) |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
getWaitStorage(id){ |
|
|
|
this.tui.request("/app/purchase/getPurchaseAllData", "post", { |
|
|
|
id: id |
|
|
|
}, false, true).then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
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.list = res.result.purchaseDetails |
|
|
|
|
|
|
|
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 |
|
|
|
}, |
|
|
|
inventorySubmit() { |
|
|
|
if (this.noPay == 0 || this.alreadyPay == 0 || this.shouldPay == 0) { |
|
|
|
uni.showToast({ |
|
|
|
title: "信息填写完成后入库!", |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
} |
|
|
|
let that = this; |
|
|
|
let purchase = { |
|
|
|
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 |
|
|
|
} |
|
|
|
let purchaseDetails = []; |
|
|
|
this.carList.forEach(function(value, key) { |
|
|
|
value.stockLogList.forEach(function(values, keys) { |
|
|
|
let obj = { |
|
|
|
productCount: values, |
|
|
|
attributeList: keys |
|
|
|
} |
|
|
|
value.stockLogList1.push(obj) |
|
|
|
}) |
|
|
|
purchaseDetails.push(value) |
|
|
|
}) |
|
|
|
this.tui.request("/app/stock/putInOfProduct", "post", { |
|
|
|
purchase: purchase, |
|
|
|
purchaseDetails: purchaseDetails |
|
|
|
}, false, false).then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
uni.showToast({ |
|
|
|
title: "入库成功", |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
uni.navigateBack({ |
|
|
|
delta: 2 |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.tui.toast(res.message) |
|
|
|
uni.showToast({ |
|
|
|
title: "入库失败", |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
} |
|
|
|
}).catch((res) => {}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
//编辑每一个的单价 |
|
|
|
clickCollapse(index) { |
|
|
|
this.index = index |
|
|
|
this.$refs.inputDialog.val = '' |
|
|
|
this.$refs.inputDialog.open() |
|
|
|
}, |
|
|
|
//计算价格 |
|
|
|
changePrice(val) { |
|
|
|
let that = this; |
|
|
|
that.shouldPay = 0 |
|
|
|
console.log(that.goodsList) |
|
|
|
console.log(this.index) |
|
|
|
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> |
|
|
|
.btn-wrap { |
|
|
|
width: 164rpx; |
|
|
|
height: 80rpx; |
|
|
|
border-radius: 16upx; |
|
|
|
border: 2upx solid $u-primary; |
|
|
|
box-sizing: border-box; |
|
|
|
display: flex; |
|
|
|
justify-content: center; |
|
|
|
align-items: center; |
|
|
|
} |
|
|
|
|
|
|
|
.container { |
|
|
|
padding-bottom: 118rpx; |
|
|
|
|
|
|
|
.boxbg { |
|
|
|
background-color: #fff; |
|
|
|
margin: 30upx; |
|
|
|
padding: 20upx; |
|
|
|
border-radius: 10upx; |
|
|
|
box-shadow: 0px 1px 10px 2px #e2e2e2; |
|
|
|
} |
|
|
|
@ -133,64 +212,13 @@ |
|
|
|
line-height: 30px; |
|
|
|
} |
|
|
|
|
|
|
|
.tui-goods-item { |
|
|
|
width: 100%; |
|
|
|
padding: 20rpx 30rpx; |
|
|
|
box-sizing: border-box; |
|
|
|
display: flex; |
|
|
|
justify-content: space-between; |
|
|
|
|
|
|
|
.tui-goods-img { |
|
|
|
width: 180rpx; |
|
|
|
height: 180rpx; |
|
|
|
display: block; |
|
|
|
flex-shrink: 0; |
|
|
|
} |
|
|
|
|
|
|
|
.tui-goods-center { |
|
|
|
flex: 1; |
|
|
|
padding: 20rpx 8rpx; |
|
|
|
box-sizing: border-box; |
|
|
|
|
|
|
|
.tui-goods { |
|
|
|
word-break: break-all; |
|
|
|
overflow: hidden; |
|
|
|
text-overflow: ellipsis; |
|
|
|
display: -webkit-box; |
|
|
|
-webkit-box-orient: vertical; |
|
|
|
-webkit-line-clamp: 2; |
|
|
|
line-height: 32rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.tui-goods-name { |
|
|
|
font-weight: 700; |
|
|
|
max-width: 310rpx; |
|
|
|
font-size: 26rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.tui-goods-attr { |
|
|
|
font-size: 22rpx; |
|
|
|
color: #888888; |
|
|
|
padding-top: 20rpx; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.tui-price-right { |
|
|
|
text-align: right; |
|
|
|
font-size: 26upx; |
|
|
|
font-weight: 700; |
|
|
|
line-height: 30rpx; |
|
|
|
padding-top: 160rpx; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.tui-goods-info { |
|
|
|
width: 100%; |
|
|
|
padding: 30rpx; |
|
|
|
box-sizing: border-box; |
|
|
|
background: #fff; |
|
|
|
line-height: 26px; |
|
|
|
line-height: 26px; |
|
|
|
border-top: 10px solid #eee; |
|
|
|
|
|
|
|
.tui-price-flex { |
|
|
|
display: flex; |
|
|
|
@ -241,89 +269,6 @@ |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.tui-order-info { |
|
|
|
margin-top: 20rpx; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.tui-color-red { |
|
|
|
color: #E41F19; |
|
|
|
padding-right: 30rpx; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.tui-size24 { |
|
|
|
padding-bottom: 20rpx; |
|
|
|
font-size: 24rpx; |
|
|
|
line-height: 24rpx; |
|
|
|
color: #888; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.tui-order-title { |
|
|
|
position: relative; |
|
|
|
font-size: 28upx; |
|
|
|
line-height: 28upx; |
|
|
|
padding-left: 16upx; |
|
|
|
box-sizing: border-box; |
|
|
|
} |
|
|
|
|
|
|
|
.tui-order-title::before { |
|
|
|
content: ''; |
|
|
|
position: absolute; |
|
|
|
left: 0; |
|
|
|
top: 0; |
|
|
|
border-left: 8upx solid $u-primary; |
|
|
|
height: 120%; |
|
|
|
border-radius: 4upx; |
|
|
|
} |
|
|
|
|
|
|
|
.tui-order-content { |
|
|
|
width: 100%; |
|
|
|
padding: 24rpx 30rpx; |
|
|
|
box-sizing: border-box; |
|
|
|
background: #fff; |
|
|
|
font-size: 24rpx; |
|
|
|
line-height: 30rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.tui-order-flex { |
|
|
|
display: flex; |
|
|
|
padding-top: 18rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.tui-order-flex:first-child { |
|
|
|
padding-top: 0 |
|
|
|
} |
|
|
|
|
|
|
|
.tui-item-title { |
|
|
|
width: 132rpx; |
|
|
|
flex-shrink: 0; |
|
|
|
} |
|
|
|
|
|
|
|
.tui-item-content { |
|
|
|
color: #666; |
|
|
|
line-height: 32rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.tui-safe-area { |
|
|
|
height: 1rpx; |
|
|
|
padding-bottom: env(safe-area-inset-bottom); |
|
|
|
} |
|
|
|
|
|
|
|
.tui-tabbar { |
|
|
|
@ -344,18 +289,91 @@ |
|
|
|
|
|
|
|
.tui-btn-mr { |
|
|
|
margin-right: 30rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.tui-contact { |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
justify-content: center; |
|
|
|
font-size: 28rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.tui-contact image { |
|
|
|
width: 36rpx; |
|
|
|
height: 36rpx; |
|
|
|
margin-right: 16rpx; |
|
|
|
} |
|
|
|
.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> |