This commit is contained in:
weipengfei 2024-05-09 09:21:38 +08:00
commit 3572565bb7
7 changed files with 563 additions and 276 deletions

View File

@ -0,0 +1,9 @@
import request from '@/utils/request';
export const goodListApi = (data) => {
return request.get('/goods/goods/lists', data);
}
export const goodClassListApi = (data) => {
return request.get('/goods/goodsclass/lists', data);
}

12
api/quotation.js Normal file
View File

@ -0,0 +1,12 @@
import request from '@/utils/request';
//报价单列表
export const OpurchaseGoodsOfferListApi = (data) => {
return request.get('/operation/OpurchaseGoodsOffer/list', data);
}
//报价单提交
export const OpurchaseGoodsOfferApi = (data) => {
return request.post('/operation/OpurchaseGoodsOffer/offer', data);
}

View File

@ -1,4 +1,13 @@
<template> <template>
<view class="">
<view class="content"> <view class="content">
<view class="card" v-for="item in 10"> <view class="card" v-for="item in 10">
<view class="head"> <view class="head">
@ -40,6 +49,11 @@
<up-button shape='circle' color='#20B128' text="提交"></up-button> <up-button shape='circle' color='#20B128' text="提交"></up-button>
</view> </view>
</view> </view>
</view>
</template> </template>
<script setup> <script setup>

View File

@ -1,15 +1,16 @@
<template> <template>
<view class="content"> <view class="">
<up-sticky bgColor="#fff"> <up-sticky bgColor="#fff">
<view class="head"> <view class="head">
<up-search placeholder="请输入提货点名称" @search="searchKeyword" v-model="keyword" <!-- <up-search placeholder="请输入提货点名称" @search="searchKeyword" v-model="keyword"
@custom="searchKeyword"></up-search> @custom="searchKeyword"></up-search> -->
<view class=""> <view class="">
<view class="" style="display: flex;justify-content: space-around;margin-top: 24rpx;color:#777777"> <view class="" style="display: flex;justify-content: space-around;margin-top: 24rpx;color:#777777">
<view :class="{act: tabIndex==1}" @click="tabIndex=1"> <view :class="{act: tabIndex==1}" @click="changeTabs(1)">
订单列表 订单列表
</view> </view>
<view :class="{act: tabIndex==2}" @click="tabIndex=2"> <view :class="{act: tabIndex==2}" @click="changeTabs(2)">
报价记录 报价记录
</view> </view>
</view> </view>
@ -18,55 +19,74 @@
</view> </view>
</view> </view>
</up-sticky> </up-sticky>
<view class="card" v-for="item in 10">
<view class="card-head">
<text>PF171504442988969633</text> <view class="content">
<text style="color:#20B128 ;">待报价</text> <view class="card" v-for="(item,index) in goodsList" :key='index'>
<text style="color:#FC452F ;">已成交</text> <view class="head">
<text style="color:#777777 ;">未成交</text> <!-- <text> {{orer_sn}}</text> -->
<!-- <text style="color: #989898;">{{time}}</text> -->
</view> </view>
<view style="padding-right: 20rpx;">
<view class="card-content"> <view class="card-content">
<image v-for="(item,index) in 10" style="width: 152rpx;height: 152rpx;margin-right: 20rpx;" <view class="card-content-l" style="width: 152rpx;height: 152rpx;">
src="../../static/logo.png" mode=""> <image style="width: 152rpx;height: 152rpx;" :src="item.goods.imgs" mode=""></image>
</image> <view class="status">
{{tabIndex==1?"未报价":"已报价" }}
</view> </view>
</view> </view>
<view class="card-content-r">
<view class="title ellipsis">
{{item.goods.name}}
</view>
<view class="need">
需求量 {{item.need_num}}{{item.unit_name}}
</view>
<view class="ipt">
<up-input placeholderStyle='fontSize:24rpx' placeholder="点击数入报价数量" :readonly="tabIndex==2"
v-model="item.nums"
style="margin-right: 10rpx;background-color:#F6F6F6;border: none;"></up-input>
<!-- <up-input placeholderStyle='fontSize:24rpx' placeholder="点击数入报价数量" :readonly="tabIndex==2"
v-model="item.num"
style="margin-right: 10rpx;background-color:#F6F6F6;border: none;"></up-input> -->
<up-input placeholderStyle='fontSize:24rpx' style="background-color: #F6F6F6;border: none;"
placeholder="点击数入产品报价" @blur="priceBlur(index)" :readonly="tabIndex==2"
v-model="item.price"></up-input>
</view>
</view>
<view class="status-png" v-if="tabIndex==2">
<image :src="item.is_adopt?successPng:errPng" style="width: 108rpx; height: 84rpx;"></image>
</view>
</view>
<view class="card-footer" v-if="item.nums &&item.price">
{{item.nums}}{{item.unit_name}}&nbsp; &nbsp;合计:<text
style="font-size: 28rpx;color: #FC452F;font-weight: 700;">{{item.nums*item.price}}</text>
</view>
<up-line style="margin-top: 30rpx;" color="#F3F3F3"></up-line>
</view>
<view class="total"> <view class="submit-btn" v-if="tabIndex==1">
<view style="display: flex;align-items: center;color: #777777;" <up-button shape='circle' color='#20B128' @click="submit" text="提交"></up-button>
@click="navgo('/pageQuota/quotation/detail')">
共4件 <up-icon name="arrow-right"></up-icon>
</view> </view>
</view> </view>
<view class="card-foot" v-if='false'>
温馨提示请于2024年05月20日前发货
</view>
</view>
</view> </view>
</template> </template>
<script setup> <script setup>
import { import {
ref, ref,
reactive reactive,
} from "vue" } from "vue"
import {
OpurchaseGoodsOfferApi,
OpurchaseGoodsOfferListApi
} from "@/api/quotation.js"
const navgo = (url) => { // url
uni.navigateTo({ const successPng = ref('https://lihai001.oss-cn-chengdu.aliyuncs.com/attach/739c3202405071458553459.png')
url const errPng = ref('https://lihai001.oss-cn-chengdu.aliyuncs.com/attach/04c2c202405071501462462.png')
}) // url
}
//
const keyword = ref('')
const searchKeyword = () => {
console.log("sousuo1")
}
//
// tabsindex // tabsindex
const tabIndex = ref(1) const tabIndex = ref(1)
const { const {
@ -75,11 +95,56 @@
const tabsLeft = ref(((windowWidth / 2) - 26) / 2) const tabsLeft = ref(((windowWidth / 2) - 26) / 2)
const tabsRight = ref(tabsLeft.value + (windowWidth / 2)) const tabsRight = ref(tabsLeft.value + (windowWidth / 2))
// tabsindex // tabsindex
const priceBlur = (index) => {
goodsList.value[index].price = Number(goodsList.value[index].price).toFixed(2)
}
//
const goodsList = ref([])
const getGoodsList = async (type) => {
let res = await OpurchaseGoodsOfferListApi({
type
})
goodsList.value = res.data.lists
goodsList.value.forEach(item => {
item.nums = item.nums ? item.nums : ''
item.price = (+item.price) ? item.price : ''
})
}
const changeTabs = (num) => {
tabIndex.value = num
getGoodsList(num)
}
getGoodsList(tabIndex.value)
//
const submit = async () => {
let datas = goodsList.value.map(item => ({
id: item.id,
nums: item.nums,
price: item.price
}))
let newData = []
datas.forEach(item => {
if (item.nums && item.price) {
newData.push(item)
}
})
let res = await OpurchaseGoodsOfferApi({
data: newData
})
tabIndex.value = 2
getGoodsList(tabIndex.value)
}
</script> </script>
<style lang="scss"> <style lang="scss">
.content {
.head { .head {
padding: 20rpx; padding: 20rpx;
background-color: white; background-color: white;
@ -99,50 +164,88 @@
} }
} }
.content {
padding: 20rpx;
padding-bottom: 150rpx;
.card { .card {
width: 710rpx; width: 710rpx;
margin: 20rpx auto; margin: 0 auto;
background-color: white;
box-sizing: border-box;
border-radius: 16rpx 16rpx 0 0;
position: relative;
.card-head {
padding: 20rpx; padding: 20rpx;
display: flex; box-sizing: border-box;
justify-content: space-between; background-color: white;
margin-bottom: 12rpx;
}
.card-content { .card-content {
padding: 20rpx;
overflow-x: auto;
white-space: nowrap;
padding-right: 152rpx;
}
.total {
width: 152rpx;
height: 160rpx;
position: absolute;
// border: 1px dashed black;
display: flex; display: flex;
justify-content: space-around; position: relative;
align-items: center;
top: 100rpx;
right: 20rpx;
background-color: white;
}
.card-foot { .card-content-l {
background-color: #FFF1EC; margin-right: 20rpx;
color: #FC452F; position: relative;
text-indent: 2em;
.status {
width: 152rpx;
height: 40rpx;
background-color: rgba(0, 0, 0, .3);
text-align: center;
color: white;
font-size: 24rpx; font-size: 24rpx;
height: 74rpx; line-height: 40rpx;
line-height: 74rpx; position: absolute;
bottom: 0;
}
}
.card-content-r {
display: flex;
flex-direction: column;
justify-content: space-between;
.title {
font-size: 30rpx;
width: 500rpx;
}
.need {
color: #777777;
font-size: 24rpx;
}
.ipt {
display: flex;
height: 56rpx;
} }
} }
.status-png {
position: absolute;
right: 20rpx;
}
}
.card-footer {
margin-top: 30rpx;
text-align: right;
font-size: 28rpx;
color: #060606;
}
}
.submit-btn {
position: fixed;
bottom: 50rpx;
width: 710rpx;
margin: 0 auto;
}
}
.ellipsis {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
} }
</style> </style>

View File

@ -0,0 +1,148 @@
<template>
<view class="content">
<up-sticky bgColor="#fff">
<view class="head">
<up-search placeholder="请输入提货点名称" @search="searchKeyword" v-model="keyword"
@custom="searchKeyword"></up-search>
<view class="">
<view class="" style="display: flex;justify-content: space-around;margin-top: 24rpx;color:#777777">
<view :class="{act: tabIndex==1}" @click="tabIndex=1">
订单列表
</view>
<view :class="{act: tabIndex==2}" @click="tabIndex=2">
报价记录
</view>
</view>
<view style="height: 8rpx;" />
<view class="line" :style="{left:tabIndex==1?tabsLeft+'px':tabsRight+'px'}" />
</view>
</view>
</up-sticky>
<view class="card" v-for="item in 10">
<view class="card-head">
<text>PF171504442988969633</text>
<text style="color:#20B128 ;">待报价</text>
<text style="color:#FC452F ;">已成交</text>
<text style="color:#777777 ;">未成交</text>
</view>
<view style="padding-right: 20rpx;">
<view class="card-content">
<image v-for="(item,index) in 10" style="width: 152rpx;height: 152rpx;margin-right: 20rpx;"
src="../../static/logo.png" mode="">
</image>
</view>
</view>
<view class="total">
<view style="display: flex;align-items: center;color: #777777;"
@click="navgo('/pageQuota/quotation/detail')">
共4件 <up-icon name="arrow-right"></up-icon>
</view>
</view>
<view class="card-foot" v-if='false'>
温馨提示请于2024年05月20日前发货
</view>
</view>
</view>
</template>
<script setup>
import {
ref,
reactive
} from "vue"
const navgo = (url) => {
uni.navigateTo({
url
})
}
//
const keyword = ref('')
const searchKeyword = () => {
console.log("sousuo1")
}
//
// tabsindex
const tabIndex = ref(1)
const {
windowWidth
} = uni.getSystemInfoSync();
const tabsLeft = ref(((windowWidth / 2) - 26) / 2)
const tabsRight = ref(tabsLeft.value + (windowWidth / 2))
// tabsindex
</script>
<style lang="scss">
.content {
.head {
padding: 20rpx;
background-color: white;
position: relative;
.act {
color: #20B128;
}
.line {
width: 26px;
height: 5rpx;
background-color: #20B128;
border-radius: 50rpx;
position: absolute;
transition: 300ms;
}
}
.card {
width: 710rpx;
margin: 20rpx auto;
background-color: white;
box-sizing: border-box;
border-radius: 16rpx 16rpx 0 0;
position: relative;
.card-head {
padding: 20rpx;
display: flex;
justify-content: space-between;
margin-bottom: 12rpx;
}
.card-content {
padding: 20rpx;
overflow-x: auto;
white-space: nowrap;
padding-right: 152rpx;
}
.total {
width: 152rpx;
height: 160rpx;
position: absolute;
// border: 1px dashed black;
display: flex;
justify-content: space-around;
align-items: center;
top: 100rpx;
right: 20rpx;
background-color: white;
}
.card-foot {
background-color: #FFF1EC;
color: #FC452F;
text-indent: 2em;
font-size: 24rpx;
height: 74rpx;
line-height: 74rpx;
}
}
}
</style>

View File

@ -24,7 +24,8 @@ const useUserStore = defineStore("user", () => {
} }
// #ifdef H5 // #ifdef H5
// token.value = "6f85cbaee3341c3f2d7bb7080663ce68"
token.value = "c13a559d04e18ddcc685eebb35c89c0f"
// token.value = "95b24dd6d2dda836fe07854b08ba0944" // token.value = "95b24dd6d2dda836fe07854b08ba0944"
userInfo.value = { userInfo.value = {
avatar: "https://lihaiim.oss-cn-chengdu.aliyuncs.com/image/admin/default_avatar.png", avatar: "https://lihaiim.oss-cn-chengdu.aliyuncs.com/image/admin/default_avatar.png",
@ -34,7 +35,7 @@ const useUserStore = defineStore("user", () => {
mobile: "19330904744", mobile: "19330904744",
nickname: "用户1714964250", nickname: "用户1714964250",
supplier: null, supplier: null,
token: "b92ad3d7bdc06fa849dfb2c3c8be824e" token: "c13a559d04e18ddcc685eebb35c89c0f"
} }
// #endif // #endif