提交 4ea27ba0 authored 作者: 刘旭's avatar 刘旭

优化

上级 3b58d490
...@@ -11,7 +11,14 @@ ...@@ -11,7 +11,14 @@
<text style="margin-right: 10rpx;">{{ buyNowData?.checkedAddress.name }}</text> <text style="margin-right: 10rpx;">{{ buyNowData?.checkedAddress.name }}</text>
<text>{{ buyNowData?.checkedAddress.tel }}</text> <text>{{ buyNowData?.checkedAddress.tel }}</text>
</view> </view>
<text>{{ buyNowData?.checkedAddress.addressDetail }}</text> <text>
{{
buyNowData?.checkedAddress.province +
buyNowData?.checkedAddress.city +
buyNowData?.checkedAddress.county +
buyNowData?.checkedAddress.addressDetail
}}
</text>
</view> </view>
</view> </view>
<!-- 商品详情 --> <!-- 商品详情 -->
...@@ -130,7 +137,6 @@ const onsubmit = () => { ...@@ -130,7 +137,6 @@ const onsubmit = () => {
title: '请设置收货地址', title: '请设置收货地址',
icon: 'none', icon: 'none',
}); });
console.log(uni.getStorageSync('addressId') === 0);
let types = 0; let types = 0;
if (type.value === 'productline' || type.value === 'productLineCart') types = 2; if (type.value === 'productline' || type.value === 'productLineCart') types = 2;
else types = 0; else types = 0;
......
...@@ -28,7 +28,11 @@ ...@@ -28,7 +28,11 @@
/> />
</block> </block>
</view> </view>
<text style="color: #969799; font-size: 12px;">x{{ item.number }}</text> <text
style="display: flex; justify-content: flex-end; color: #969799; font-size: 12px;"
>
x{{ item.number }}
</text>
</view> </view>
</view> </view>
<u-line v-if="detailData.length > 1" color="#e8e8e8" /> <u-line v-if="detailData.length > 1" color="#e8e8e8" />
...@@ -44,7 +48,7 @@ ...@@ -44,7 +48,7 @@
> >
返回首页 返回首页
</u-button> </u-button>
<view class=""> <view>
<u-button shape="circle" size="mini" @tap="generateQuote">生成报价</u-button> <u-button shape="circle" size="mini" @tap="generateQuote">生成报价</u-button>
<u-button shape="circle" size="mini" style="margin-left: 20rpx;" @tap="download"> <u-button shape="circle" size="mini" style="margin-left: 20rpx;" @tap="download">
下载pdf 下载pdf
...@@ -55,7 +59,7 @@ ...@@ -55,7 +59,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, computed } from 'vue'; import { ref } from 'vue';
import { onLoad, onBackPress } from '@dcloudio/uni-app'; import { onLoad, onBackPress } from '@dcloudio/uni-app';
import config from '@/utils/config'; import config from '@/utils/config';
import { useCurrentStore } from '@/store/useStore'; import { useCurrentStore } from '@/store/useStore';
...@@ -67,7 +71,6 @@ let enclosure = ref(''); // pdf key值 ...@@ -67,7 +71,6 @@ let enclosure = ref(''); // pdf key值
let detailData = ref(); let detailData = ref();
let type = ref(); let type = ref();
let orderId = ref(); let orderId = ref();
let tax = ref(0); // 税率
onLoad((options: any) => { onLoad((options: any) => {
type.value = options.type; type.value = options.type;
...@@ -99,25 +102,6 @@ let generateQuote = () => { ...@@ -99,25 +102,6 @@ let generateQuote = () => {
}); });
}; };
// 总价格
let totlePirce: any = computed(() => {
let totlePic = 0;
if (detailData.value) {
detailData.value.map((item: any) => {
if (typeof item.unitPrice !== 'undefined') {
totlePic += Number(item.unitPrice);
}
});
}
return totlePic.toFixed(2);
});
// 含税总价格
let taxTotlePirce = computed(() => {
let taxTotlePic = Number(totlePirce.value) + Number(totlePirce.value) * tax.value * 0.01;
return Number(taxTotlePic).toFixed(2);
});
// 下载pdf // 下载pdf
let download = () => { let download = () => {
uni.showLoading({ uni.showLoading({
......
...@@ -145,7 +145,6 @@ ...@@ -145,7 +145,6 @@
</u-form-item> </u-form-item>
</view> </view>
</u-form> </u-form>
<view style="height: 100rpx;"></view> <view style="height: 100rpx;"></view>
</view> </view>
<u-row class="footer"> <u-row class="footer">
...@@ -328,6 +327,7 @@ let taxTotlePirce = computed(() => { ...@@ -328,6 +327,7 @@ let taxTotlePirce = computed(() => {
let submit = () => { let submit = () => {
uFormRef.value?.validate((valid: any, err: any) => { uFormRef.value?.validate((valid: any, err: any) => {
if(valid) { if(valid) {
// 保证单价必填
detailData.value.some((item: any) => { detailData.value.some((item: any) => {
if (typeof item.unitPrice === 'undefined') { if (typeof item.unitPrice === 'undefined') {
return uni.showToast({ return uni.showToast({
...@@ -336,8 +336,8 @@ let submit = () => { ...@@ -336,8 +336,8 @@ let submit = () => {
}); });
} }
}) })
// 同步价格
quotationData.value.items.forEach((item: any) => { quotationData.value.items.forEach((item: any) => {
console.log(item);
detailData.value.map((res: any) => { detailData.value.map((res: any) => {
if(item.goodsName == res.goodsName) { if(item.goodsName == res.goodsName) {
item.price = res.unitPrice item.price = res.unitPrice
......
...@@ -28,44 +28,11 @@ ...@@ -28,44 +28,11 @@
/> />
</block> </block>
</view> </view>
<text
<view class="sum-price"> style="display: flex; justify-content: flex-end; color: #969799; font-size: 12px;"
<view style="display: flex; flex-direction: column;"> >
<view x{{ item.number }}
style="display: flex; flex-direction: row; align-items: center; margin-bottom: 10rpx;" </text>
>
<text>设置单价:</text>
<u-input
v-model="item.unitPrice"
type="number"
height="50"
placeholder="请输入单价"
style="width: 200rpx;"
/>
</view>
<view style="margin-bottom: 10rpx;">
金额:¥{{
item.unitPrice
? (Number(item.unitPrice) * item.number).toFixed(2)
: 0
}}
</view>
<view style="margin-bottom: 10rpx;">
含税金额:¥{{
item.unitPrice
? (
Number(item.unitPrice) * item.number +
Number(item.unitPrice) *
item.number *
tax *
0.01
).toFixed(2)
: 0
}}
</view>
</view>
<text style="color: #969799; font-size: 12px;">x{{ item.number }}</text>
</view>
</view> </view>
</view> </view>
<u-line v-if="detailData.length > 1" color="#e8e8e8" /> <u-line v-if="detailData.length > 1" color="#e8e8e8" />
...@@ -81,7 +48,7 @@ ...@@ -81,7 +48,7 @@
> >
返回首页 返回首页
</u-button> </u-button>
<view class=""> <view>
<u-button shape="circle" size="mini" @tap="generateQuote">生成报价</u-button> <u-button shape="circle" size="mini" @tap="generateQuote">生成报价</u-button>
<u-button shape="circle" size="mini" style="margin-left: 20rpx;" @tap="download"> <u-button shape="circle" size="mini" style="margin-left: 20rpx;" @tap="download">
下载pdf 下载pdf
...@@ -152,7 +119,7 @@ let generateQuote = () => { ...@@ -152,7 +119,7 @@ let generateQuote = () => {
}); });
if (flag) if (flag)
uni.navigateTo({ uni.navigateTo({
url: `../order/quotation?orderId=${orderId.value}&data=${JSON.stringify(data)}`, url: `../order/quotation?orderId=${orderId.value}`,
}); });
}; };
...@@ -229,7 +196,7 @@ let initQuotationInit = (orderId: number) => { ...@@ -229,7 +196,7 @@ let initQuotationInit = (orderId: number) => {
let initOrderData = (orderId: number) => { let initOrderData = (orderId: number) => {
orderDetail({ orderId }).then((res: any) => { orderDetail({ orderId }).then((res: any) => {
if (res.data.code === 200) { if (res.data.code === 200) {
enclosure.value = res.data.data.orderInfo.enclosure enclosure.value = res.data.data.orderInfo.enclosure;
res.data.data.orderGoods.map((item: any) => { res.data.data.orderGoods.map((item: any) => {
initProductLineIndex(item.goodsId); initProductLineIndex(item.goodsId);
}); });
......
...@@ -87,8 +87,8 @@ const setAddress = (item: any) => { ...@@ -87,8 +87,8 @@ const setAddress = (item: any) => {
uni.navigateBack({ uni.navigateBack({
success: function() { success: function() {
if (beforePage.route === 'pages/order/quotation') if (beforePage.route === 'pages/order/quotation')
beforePage.addressData = item; beforePage.$vm.addressData = item;
else beforePage.init(); // 执行上一页的onLoad方法 else beforePage.$vm.init(); // 执行上一页的onLoad方法
}, },
}); });
}, },
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论