提交 5e0e9106 authored 作者: 刘旭's avatar 刘旭

优化

上级 5fbe0d1c
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -41,3 +41,6 @@ export const quotationDetail = (data: any) => request('/wx/quotation/detail', 'P
// 报价单-execl下载
export const quotationDownload = (data: any) => request('/wx/quotation/download', 'GET', data);
// 报价单-是否存在
export const quotationExist = (data: any) => request('/wx/quotation/exist', 'GET', data);
......@@ -50,3 +50,6 @@ export const getTax = () => request('/wx/config/tax', 'GET');
// 推送订单
export const pushOrder = (data: any) => request('/wx/order/push', 'GET', data)
// 获取商品配件
export const goodsParts = (data: any) => request('/wx/goods/parts', 'GET', data)
......@@ -14,3 +14,6 @@ export const productLineByuNow = (data: any) => request('/wx/cart/fastadd', 'POS
// 产品线点击购买后获取数据
export const getProductLineByuNowData = (data: any) => request('/wx/cart/checkout', 'GET', data)
// 产品线点击购买后获取数据
export const getProductLineIndex = (data: any) => request('/wx/productLine/index', 'GET', data)
\ No newline at end of file
......@@ -104,6 +104,24 @@
</view>
</view>
</view>
<view v-if="JSON.stringify(goodsInfo.partsData) !== '[]'" class="specification-item">
<view class="item-title">配件(多选)</view>
<view
style="display: flex; justify-content: space-between; align-items: center;"
>
<view class="item-wrapper">
<view
v-for="(item, index) in goodsInfo.partsData"
:key="item.id"
class="item-content"
:class="[item.show ? 'actived' : '']"
@tap="tapParts(item, index)"
>
{{ item.partGoodsName }}
</view>
</view>
</view>
</view>
<view class="number-box-view">
<view style="flex: 1;">数量</view>
<view style="flex: 4;text-align: right;">
......@@ -219,8 +237,13 @@ export default {
'plus',
'confirm',
'blur',
'select-parts',
],
props: {
// 配件值
partsData: {
Type: Object,
},
// true 组件显示 false 组件隐藏
value: {
Type: Boolean,
......@@ -559,6 +582,11 @@ export default {
},
mounted() {},
methods: {
// 选择配件
tapParts(row, index) {
this.goodsInfo.partsData[index].show = !this.goodsInfo.partsData[index].show;
this.$emit('select-parts', row);
},
// 初始化
init(notAutoClick) {
let that = this;
......
......@@ -149,6 +149,12 @@
"navigationBarTitleText": "收货人",
"navigationBarBackgroundColor": "#fff"
}
}, {
"path": "pages/order/editQuotation",
"style": {
"navigationBarTitleText": "重新报价",
"navigationBarBackgroundColor": "#fff"
}
}
],
"tabBar": {
......
......@@ -207,7 +207,8 @@ const tapOptions = () => {
data: el,
success(res: any) {
if (prop == 'cartId' && el == 0) {
if(type.value === 0) uni.navigateTo({ url: `../order/checkout?type=` + 'cart' });
if (type.value === 0)
uni.navigateTo({ url: `../order/checkout?type=` + 'cart' });
else uni.navigateTo({ url: `../order/checkout?type=` + 'productLineCart' });
}
},
......@@ -351,7 +352,7 @@ onShow(() => {
width: 55%;
display: flex;
flex-direction: column;
justify-content: space-between;
justify-content: flex-start;
margin-left: 20rpx;
.b-tag {
display: flex;
......
......@@ -7,6 +7,7 @@
border-radius="20"
:localdata="goodsInfo"
:mode="skuMode"
:partsData="partsData"
@open="onOpenSkuPopup"
@close="SkuPopup"
@add-cart="addCarts"
......@@ -17,6 +18,7 @@
@plus="onPlus"
@confirm="onConfirm"
@blur="onBlur"
@select-parts="selectParts"
></vk-data-goods-sku-popup>
</view>
</template>
......@@ -33,6 +35,7 @@ let skuKey = ref(false);
let goodsInfo = ref({} as any);
let skuPopupRef = ref();
let detailData = ref()
let partsIds = ref([] as any)
let detailId = ref()
let selectedGoodsItem = ref('')
let selectedGoodsSum = ref(1)
......@@ -68,9 +71,16 @@ let onConfirm = (val: string, index: number) => {
goodsInfo.value.spec_list[index].custom = val
}
// 选择配件
let selectParts = (data: any) => {
let index = partsIds.value.indexOf(data.id)
if(index === -1) {
if(data.show = true) partsIds.value.push(data.id)
} else partsIds.value.splice(index, 1)
}
// 初始化 把请求数据变成组件需要的格式
let init = (data: any, id: number) => {
// console.log(data, id);
let init = (data: any, id: number, partsData: any) => {
detailData.value = data
detailId.value = id
let productList: any = [];
......@@ -106,6 +116,7 @@ let init = (data: any, id: number) => {
goods_thumb: data.info.picUrl,
sku_list: productList,
spec_list: specificationList,
partsData
};
productList = []
specificationList = []
......@@ -146,9 +157,11 @@ let addCartFn = (obj: any) => {
number: selectShop.buy_num,
productId: productId,
type: 0,
specifications
specifications,
partsIds: partsIds.value
}).then((res: any) => {
if(res.data.code === 200) {
uni.showToast({
title: '已添加至购物车',
icon: 'none',
......@@ -184,7 +197,8 @@ let buyNow = (selectShop: any) => {
goodsId: detailId.value,
number: selectShop.buy_num,
productId: productId,
type: 0
type: 0,
partsIds: partsIds.value
}
fastaddCart(data).then((res: any) => {
if(res.data.code === 200) {
......
......@@ -126,13 +126,15 @@ import { ref, computed } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import {
indexDetails,
collectAddordelete
collectAddordelete,
goodsParts
} from '@/api/index';
import goodsSku from './goodsSku'
const goodsSkuRef = ref()
const attrPopup = ref(false);
const detailData: any = ref();
const partsData = ref();
const tabButtons = ref(['商品详情']);
let current = ref(0);
......@@ -159,6 +161,7 @@ const detailId = ref()
onLoad((options: any) => {
detailId.value = options.id
initDetails(options.id)
initParts(options.id)
});
let selectedGoodsItem = ref()
......@@ -219,7 +222,7 @@ const onClick = (e: any) => {
// 打开sku
const buttonClick = () => {
goodsSkuRef.value.init(detailData.value, detailId.value)
goodsSkuRef.value.init(detailData.value, detailId.value, partsData.value)
goodsSkuRef.value.skuKey = true
};
......@@ -257,10 +260,21 @@ const initDetails = (id: number) => {
}
detailData.value = res.data.data;
console.log(detailData.value, '商品详情数据');
}
});
}
// 获取商品配件
const initParts = (id: number) => {
goodsParts({ goodsId: id }).then((res: any) => {
if(res.data.code === 200) {
res.data.data.forEach((item: any) => {
item['show'] = false
})
partsData.value = res.data.data
}
})
}
</script>
<style lang="scss" scoped>
......
......@@ -102,8 +102,9 @@ import { ref, computed } from 'vue';
import { onLoad, onBackPress } from '@dcloudio/uni-app';
import config from '@/utils/config';
import { useStore, useCurrentStore } from '@/store/useStore';
import { getOrderPdf, quotationOrder } from '@/api/cart';
// import { getOrderPdf } from '@/api/cart';
import { orderDetail, getTax } from '@/api/index';
import { getProductLineIndex } from '@/api/productLine';
let baseUrl = config.baseUrl;
let store = useStore();
......@@ -123,10 +124,11 @@ onLoad((options: any) => {
enclosure.value = res.data.data.orderInfo.enclosure;
detailData.value = res.data.data.orderGoods;
orderId.value = res.data.data.orderInfo.id;
initProductLineIndex();
}
console.log(res, '订单详情信息');
});
initPdf(options.orderId); // 查询pdf详细资料
// initPdf(options.orderId); // 查询pdf详细资料
initTax(); // 查询税率
});
......@@ -160,6 +162,7 @@ let generateQuote = () => {
});
};
// 总价格
let totlePirce: any = computed(() => {
let totlePic = 0;
if (detailData.value) {
......@@ -172,6 +175,7 @@ let totlePirce: any = computed(() => {
return totlePic.toFixed(2);
});
// 含税总价格
let taxTotlePirce = computed(() => {
let taxTotlePic = Number(totlePirce.value) + Number(totlePirce.value) * tax.value * 0.01;
return Number(taxTotlePic).toFixed(2);
......@@ -206,13 +210,13 @@ let download = () => {
};
// 获取下载pdf信息
let initPdf = (orderId: number) => {
getOrderPdf({ orderId }).then((res: any) => {
if (res.data.code === 200) {
console.log(res, 'pdf');
}
});
};
// let initPdf = (orderId: number) => {
// getOrderPdf({ orderId }).then((res: any) => {
// if (res.data.code === 200) {
// console.log(res, 'pdf');
// }
// });
// };
// 获取税率
let initTax = () => {
......@@ -221,6 +225,15 @@ let initTax = () => {
});
};
let initProductLineIndex = () => {
console.log(type.value, '产品线type');
detailData.value.map((item: any) => {
getProductLineIndex({ lineId: item.goodsId }).then((res: any) => {
console.log(res, '产品线');
});
});
};
onBackPress(() => {
if (type.value === 'productline') {
store.$reset();
......
<template></template>
<script setup lang="ts">
import { onLoad } from '@dcloudio/uni-app';
import { ref } from 'vue';
import { quotationInitAgain } from '@/api/cart';
let orderId = ref();
onLoad((options: any) => {
orderId.value = options.orderId;
quotationInitAgain({ orderId: orderId.value }).then((res: any) => {
if(res.data.code === 200) {
console.log(res);
}
})
});
</script>
<style></style>
......@@ -47,7 +47,6 @@
class="item"
v-for="(item, index) in res.goodsList"
:key="index"
@tap="toDownPdf(res.id)"
>
<view class="left">
<image
......@@ -152,6 +151,7 @@
<script setup lang="ts">
import { ref, computed } from 'vue'
import { getOrderData, orderDelete, pushOrder } from '@/api/index'
import { quotationExist } from '@/api/cart'
import { onLoad } from '@dcloudio/uni-app'
import { useCurrentStore } from '@/store/useStore'
import config from '@/utils/config';
......@@ -184,7 +184,6 @@ let orderIds = ref(0) //删除的订单id
onLoad((options?: any) => {
if(options) {
current.value = options.showType
console.log(current.value);
swiperCurrent.value = options.showType
listQuery.value.showType = options.showType
}
......@@ -271,11 +270,19 @@ let orderDel = (orderId: number) => {
orderIds.value = orderId
}
// 推送订单
// 生成报价 @tap="toDownPdf(res.id)"
let orderQuotation = (orderId: number) => {
show.value = true
content.value = '确认将状态推送到待生产?'
orderIds.value = orderId
quotationExist({ orderId }).then((res: any) => {
if(res.data.code === 200) {
if(res.data.data) {
uni.navigateTo({
url: '../order/editQuotation?orderId=' + orderId
})
} else toDownPdf(orderId)
}
})
}
// 推送订单
......
......@@ -75,6 +75,7 @@
v-model="showModel"
:content="content"
@confirm="modelConfirm"
@cancel="modelCancel"
showCancelButton
></u-modal>
</template>
......@@ -86,7 +87,7 @@ import { onLoad, onReady } from '@dcloudio/uni-app';
import config from '@/utils/config';
import orderForm from './components/orderForm.vue';
let {proxy} : any = getCurrentInstance() as ComponentInternalInstance
let { proxy } : any = getCurrentInstance() as ComponentInternalInstance
let orderRef = ref()
let baseUrl = config.baseUrl;
let pickerShow = ref(false)
......@@ -213,10 +214,20 @@ let modelConfirm = () => {
downloadElement.click(); //点击下载
document.body.removeChild(downloadElement); //下载完成移除元素
window.URL.revokeObjectURL(res.tempFilePath); //释放掉blob对象
uni.redirectTo({
url: '../index/index'
})
}
})
}
// 点击取消按钮
let modelCancel = () => {
uni.redirectTo({
url: '../index/index'
})
}
let onSubmit = (data: any) => {
quotationData.value.items = data
orderRef.value.show = false
......
......@@ -29,11 +29,14 @@
</u-cell-item>
<u-cell-item
icon=""
title="用户名"
title="名"
:value="userData.nickName"
@click="setName"
></u-cell-item>
<u-cell-item icon="" title="密码设置" :value="userData.pwd" @click="setPwd"></u-cell-item>
<u-cell-item icon="" title="手机号" :value="userData.mobile"></u-cell-item>
<u-cell-item icon="" title="姓名" value="userData"></u-cell-item>
<u-cell-item icon="" title="邮箱" value="userData"></u-cell-item>
</u-cell-group>
<u-button style="margin-top: 100rpx;" @tap="openModel">退出当前用户</u-button>
......@@ -73,25 +76,25 @@
<view style="font-size: 34rpx; width: 100%; text-align: center; margin-bottom: 20rpx;">
设置密码
</view>
<u-form label-width="110">
<u-form-item label="密码:">
<u-form label-width="130">
<u-form-item label="密码:">
<u-input
v-model="oldPwd"
type="password"
:border="true"
:password-icon="true"
clearable
placeholder="请输入密码"
placeholder="请输入密码"
/>
</u-form-item>
<u-form-item label="密码:">
<u-form-item label="确认密码:">
<u-input
v-model="newPwd"
type="password"
:border="true"
:password-icon="true"
clearable
placeholder="请输入旧密码"
placeholder="请再次输入密码"
/>
</u-form-item>
</u-form>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论