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

优化

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