feat: 修改配置文件和页面逻辑,优化商品采购和订单获取功能

This commit is contained in:
mkm 2024-09-25 17:41:45 +08:00
parent 585e3e3b56
commit 3069b34763
7 changed files with 279 additions and 526 deletions

View File

@ -0,0 +1,9 @@
import request from '@/utils/request';
export const StoreOrderCartInfoLists = (data) => {
return request.get('/store_order_cart_info/StoreOrderCartInfo/lists', data);
}
export const StoreOrderCartInfoGroupLists = (data) => {
return request.get('/store_order_cart_info/StoreOrderCartInfo/group_lists', data);
}

View File

@ -0,0 +1,9 @@
import request from '@/utils/request';
export const SystemStoreStorageLists = (data) => {
return request.get('/system_store_storage/SystemStoreStorage/lists', data);
}
export const SystemStoreStorageGroupLists = (data) => {
return request.get('/system_store_storage/SystemStoreStorage/group_lists', data);
}

View File

@ -1,23 +1,24 @@
<template> <template>
<view style="background-color: #ffffff;"> <view style="background-color: #ffffff;">
<up-sticky offset-top="0"> <up-sticky offset-top="0" style="background-color: #ffffff;">
<view class="navbar"> <view class="navbar">
<view style="width: 580rpx;"> <view style="width: 580rpx;">
<up-search placeholder="请输入商品" @search="searchKeyword" @clear="searchKeyword" v-model="keyword" <up-search placeholder="请输入商品" @search="searchKeyword" @clear="searchKeyword" v-model="keyword"
:showAction="false"></up-search> :showAction="false"></up-search>
</view> </view>
<view class="nav-item" @click="calendarShow=true"> <view class="nav-item" @click="calendarShow=true">
<up-icon name="calendar" color="#2979ff" size="28"></up-icon> <up-icon name="calendar" color="#2979ff" size="28"></up-icon>
<text>筛选日期</text> <text>筛选日期</text>
</view>
</view> </view>
</view> </up-sticky> </up-sticky>
<view class="content"> <view class="content">
<up-transition :show="true" mode="slide-left"> <up-transition :show="true" mode="slide-left">
<view v-if="goodsList1.length>0"> <up-list @scrolltolower="scrolltolower" v-if="goodsList1.length>0">
<view class="card" v-for="(item,index) in goodsList1" :key='index'> <up-list-item class="card" v-for="(item,index) in goodsList1" :key='index'>
<view class="card-content"> <view class="card-content">
<view class="card-content-l" style="width: 152rpx;height: 152rpx;"> <view class="card-content-l" style="width: 152rpx;height: 152rpx;">
<image style="width: 152rpx;height: 152rpx;" :src="item.image" mode=""></image> <image style="width: 152rpx;height: 152rpx;" :src="item.image" mode=""></image>
@ -33,118 +34,78 @@
规格:{{item.store_info}} 规格:{{item.store_info}}
</view> </view>
<view style="color: red;"> <view style="color: red;">
需求量 {{item.need_num}} 数量 {{item.nums}}
</view>
<view style="color: red;" v-if="item.staff_id>0">
确认人 {{item.nums}}
</view> </view>
</view> </view>
</view> </view>
<view class="card-footer">
<up-button size="small" type="primary" shape="circle"
@click="cancleOrder(item)" v-if="item.buyer_confirm==0">确认已采购</up-button>
<up-button size="small" type="success" shape="circle"
v-else disabled >{{item.buyer_confirm_name}}</up-button>
</view>
<up-line style="margin-top: 30rpx;" color="#F3F3F3"></up-line> <up-line style="margin-top: 30rpx;" color="#F3F3F3"></up-line>
</view> </up-list-item>
</view> </up-list>
<up-empty @click='test2' v-else mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png"> <up-empty @click='test2' v-else mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png">
</up-empty> </up-empty>
</up-transition> </up-transition>
<up-modal :show="show" title="采购确认" showCancelButton @cancel="show=false" @confirm="offerUpdate()">
<up-form labelPosition="left">
<up-form-item label="名称">
<up-input v-model="formData.store_name" border="none"></up-input>
</up-form-item>
<up-form-item label="数量">
<up-input v-model="formData.nums" border="none" @change='changeInputPrice'></up-input>
</up-form-item>
<up-form-item label="单价">
<up-input v-model="formData.price" border="none" @change='changeInputPrice'></up-input>
</up-form-item>
<up-form-item label="总价">
<up-input v-model="formData.total_price" border="none"></up-input>
</up-form-item>
</up-form>
</up-modal>
</view> </view>
</view> </view>
<up-calendar :show="calendarShow" @confirm="calendarConfirm" @close="calendarShow=false" :closeOnClickOverlay="true"></up-calendar> <up-calendar :show="calendarShow" @confirm="calendarConfirm" @close="calendarShow=false"
:closeOnClickOverlay="true" mode="range"></up-calendar>
</template> </template>
<script setup> <script setup>
import {
timeFrom
} from '@/uni_modules/uview-plus';
import { import {
ref, ref,
reactive, reactive,
} from "vue" } from "vue"
import { import {
purchaseProductOfferLists, SystemStoreStorageGroupLists,
purchaseProductOfferUpdate } from "@/api/system_store_storage.js"
} from "@/api/purchase_product_offer.js"
const test2 = () => {
console.log("点解")
uni.navigateTo({
url: '/pages/index/index'
})
}
const show = ref(false) const show = ref(false)
const calendarShow=ref(false) const where = ref({
const formData = ref({ store_name: '',
"id": '', page_no: 1,
"store_name": '', start_time: timeFrom(new Date()),
'product_id': '', end_time: timeFrom(new Date())
'nums': '',
'price': '',
'total_price':''
}) })
const calendarConfirm=(e)=>{ const calendarShow = ref(false)
console.log(e[0])
}
// tabsindex
const tabIndex = ref(1)
const {
windowWidth
} = uni.getSystemInfoSync();
const tabsLeft = ref(((windowWidth / 2) - 26) / 2)
const tabsRight = ref(tabsLeft.value + (windowWidth / 2))
// tabsindex
const priceBlur = (index, goodsList) => { const calendarConfirm = (e) => {
goodsList[index].price = Number(goodsList[index].price).toFixed(2) where.value.start_time = e[0];
where.value.end_time = e[(e.length)-1];
goodsList1.value=[]
getGoodsList()
calendarShow.value = false
} }
// //
const showGoods = ref(false)
const showGoods1 = ref(false)
const goodsList = ref([]) const goodsList = ref([])
const goodsList1 = ref([]) const goodsList1 = ref([])
const getGoodsList = async () => { const getGoodsList = async () => {
let res = await purchaseProductOfferLists({}) let res = await SystemStoreStorageGroupLists(where.value)
goodsList1.value = res.data.lists goodsList1.value.push(...res.data.lists)
} }
const cancleOrder = (item) => {
show.value = true const keyword = ref('');
formData.value.store_name = item['store_name']
formData.value.id = item['id'] const searchKeyword = () => {
formData.value.nums = item['need_num'] where.value.store_name = keyword.value;
formData.value.product_id = item['product_id'] goodsList1.value=[]
getGoodsList();
} }
const offerUpdate = () => { const scrolltolower = () => {
purchaseProductOfferUpdate(formData.value).then(res=>{ where.value.page_no += 1
uni.$u.toast(res.msg); getGoodsList()
show.value=false
getGoodsList()
})
} }
const changeInputPrice=(e)=>{
if(formData.value.nums>0 && formData.value.price>0){
formData.value.total_price=formData.value.nums*formData.value.price
}
}
getGoodsList() getGoodsList()
</script> </script>
@ -156,19 +117,19 @@
justify-content: space-between; justify-content: space-between;
font-size: 22rpx; font-size: 22rpx;
color: #777; color: #777;
.nav-item { .nav-item {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
position: relative; position: relative;
image { image {
height: 40rpx; height: 40rpx;
width: 40rpx; width: 40rpx;
} }
.badge { .badge {
position: absolute; position: absolute;
top: -10rpx; top: -10rpx;
@ -181,25 +142,7 @@
border-radius: 30rpx; border-radius: 30rpx;
font-size: 18rpx; font-size: 18rpx;
} }
}
}
.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;
} }
} }
@ -223,18 +166,6 @@
.card-content-l { .card-content-l {
margin-right: 20rpx; margin-right: 20rpx;
position: relative; position: relative;
.status {
width: 152rpx;
height: 40rpx;
background-color: rgba(0, 0, 0, .3);
text-align: center;
color: white;
font-size: 24rpx;
line-height: 40rpx;
position: absolute;
bottom: 0;
}
} }
.card-content-r { .card-content-r {
@ -246,54 +177,21 @@
font-size: 30rpx; font-size: 30rpx;
width: 500rpx; width: 500rpx;
} }
.need {
color: #777777;
font-size: 24rpx;
}
.ipt { .ipt {
display: flex; display: flex;
height: 56rpx; 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;
}
} }
.detail {
width: 88rpx;
height: 88rpx;
border-radius: 88rpx;
text-align: center;
line-height: 88rpx;
background-color: #50C758;
color: white;
position: absolute;
bottom: 300rpx;
right: 20rpx;
}
.ellipsis { .ellipsis {
white-space: nowrap; white-space: nowrap;

View File

@ -1,23 +1,24 @@
<template> <template>
<view style="background-color: #ffffff;"> <view style="background-color: #ffffff;">
<up-sticky offset-top="0"> <up-sticky offset-top="0" style="background-color: #ffffff;">
<view class="navbar"> <view class="navbar">
<view style="width: 580rpx;"> <view style="width: 580rpx;">
<up-search placeholder="请输入商品" @search="searchKeyword" @clear="searchKeyword" v-model="keyword" <up-search placeholder="请输入商品" @search="searchKeyword" @clear="searchKeyword" v-model="keyword"
:showAction="false"></up-search> :showAction="false"></up-search>
</view> </view>
<view class="nav-item" @click="calendarShow=true"> <view class="nav-item" @click="calendarShow=true">
<up-icon name="calendar" color="#2979ff" size="28"></up-icon> <up-icon name="calendar" color="#2979ff" size="28"></up-icon>
<text>筛选日期</text> <text>筛选日期</text>
</view>
</view> </view>
</view> </up-sticky> </up-sticky>
<view class="content"> <view class="content">
<up-transition :show="true" mode="slide-left"> <up-transition :show="true" mode="slide-left">
<view v-if="goodsList1.length>0"> <up-list @scrolltolower="scrolltolower" v-if="goodsList1.length>0">
<view class="card" v-for="(item,index) in goodsList1" :key='index'> <up-list-item class="card" v-for="(item,index) in goodsList1" :key='index'>
<view class="card-content"> <view class="card-content">
<view class="card-content-l" style="width: 152rpx;height: 152rpx;"> <view class="card-content-l" style="width: 152rpx;height: 152rpx;">
<image style="width: 152rpx;height: 152rpx;" :src="item.image" mode=""></image> <image style="width: 152rpx;height: 152rpx;" :src="item.image" mode=""></image>
@ -33,21 +34,22 @@
规格:{{item.store_info}} 规格:{{item.store_info}}
</view> </view>
<view style="color: red;"> <view style="color: red;">
需求量 {{item.need_num}} 数量 {{item.nums}}
</view>
<view style="color: red;" v-if="item.staff_id>0">
确认人 {{item.nums}}
</view> </view>
</view> </view>
</view> </view>
<view class="card-footer"> <view class="card-footer">
<up-button size="small" type="primary" shape="circle" <up-button size="small" type="primary" shape="circle" @click="cancleOrder(item)"
@click="cancleOrder(item)" v-if="item.buyer_confirm==0">确认已采购</up-button> v-if="item.status==0">确认已采购</up-button>
<up-button size="small" type="success" shape="circle"
v-else disabled >{{item.buyer_confirm_name}}</up-button>
</view> </view>
<up-line style="margin-top: 30rpx;" color="#F3F3F3"></up-line> <up-line style="margin-top: 30rpx;" color="#F3F3F3"></up-line>
</view> </up-list-item>
</view> </up-list>
<up-empty @click='test2' v-else mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png"> <up-empty @click='test2' v-else mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png">
</up-empty> </up-empty>
</up-transition> </up-transition>
@ -70,19 +72,24 @@
</view> </view>
</view> </view>
<up-calendar :show="calendarShow" @confirm="calendarConfirm" @close="calendarShow=false" :closeOnClickOverlay="true"></up-calendar> <up-calendar :show="calendarShow" @confirm="calendarConfirm" @close="calendarShow=false"
:closeOnClickOverlay="true"></up-calendar>
</template> </template>
<script setup> <script setup>
import {
timeFrom
} from '@/uni_modules/uview-plus';
import { import {
ref, ref,
reactive, reactive,
} from "vue" } from "vue"
import { import {
purchaseProductOfferLists, SystemStoreStorageLists,
purchaseProductOfferUpdate } from "@/api/system_store_storage.js"
} from "@/api/purchase_product_offer.js"
const test2 = () => { const test2 = () => {
console.log("点解") console.log("点解")
@ -91,26 +98,28 @@
}) })
} }
const show = ref(false) const show = ref(false)
const calendarShow=ref(false) const where = ref({
store_name: '',
page_no: 1,
start_time: timeFrom(new Date()),
end_time: timeFrom(new Date())
})
const calendarShow = ref(false)
const formData = ref({ const formData = ref({
"id": '', "id": '',
"store_name": '', "store_name": '',
'product_id': '', 'product_id': '',
'nums': '', 'nums': '',
'price': '', 'price': '',
'total_price':'' 'total_price': ''
}) })
const calendarConfirm=(e)=>{ const calendarConfirm = (e) => {
console.log(e[0]) where.value.start_time = e[0];
where.value.end_time = e[0];
goodsList1.value=[]
getGoodsList()
calendarShow.value = false
} }
// tabsindex
const tabIndex = ref(1)
const {
windowWidth
} = uni.getSystemInfoSync();
const tabsLeft = ref(((windowWidth / 2) - 26) / 2)
const tabsRight = ref(tabsLeft.value + (windowWidth / 2))
// tabsindex
const priceBlur = (index, goodsList) => { const priceBlur = (index, goodsList) => {
goodsList[index].price = Number(goodsList[index].price).toFixed(2) goodsList[index].price = Number(goodsList[index].price).toFixed(2)
@ -123,8 +132,8 @@
const goodsList1 = ref([]) const goodsList1 = ref([])
const getGoodsList = async () => { const getGoodsList = async () => {
let res = await purchaseProductOfferLists({}) let res = await SystemStoreStorageLists(where.value)
goodsList1.value = res.data.lists goodsList1.value.push(...res.data.lists)
} }
const cancleOrder = (item) => { const cancleOrder = (item) => {
show.value = true show.value = true
@ -134,17 +143,28 @@
formData.value.product_id = item['product_id'] formData.value.product_id = item['product_id']
} }
const offerUpdate = () => { const offerUpdate = () => {
purchaseProductOfferUpdate(formData.value).then(res=>{ purchaseProductOfferUpdate(formData.value).then(res => {
uni.$u.toast(res.msg); uni.$u.toast(res.msg);
show.value=false show.value = false
getGoodsList() getGoodsList()
}) })
} }
const changeInputPrice=(e)=>{ const changeInputPrice = (e) => {
if(formData.value.nums>0 && formData.value.price>0){ if (formData.value.nums > 0 && formData.value.price > 0) {
formData.value.total_price=formData.value.nums*formData.value.price formData.value.total_price = formData.value.nums * formData.value.price
} }
} }
const keyword = ref('');
const searchKeyword = () => {
where.value.store_name = keyword.value;
goodsList1.value=[]
getGoodsList();
}
const scrolltolower = () => {
where.value.page_no += 1
getGoodsList()
}
getGoodsList() getGoodsList()
</script> </script>
@ -156,19 +176,19 @@
justify-content: space-between; justify-content: space-between;
font-size: 22rpx; font-size: 22rpx;
color: #777; color: #777;
.nav-item { .nav-item {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
position: relative; position: relative;
image { image {
height: 40rpx; height: 40rpx;
width: 40rpx; width: 40rpx;
} }
.badge { .badge {
position: absolute; position: absolute;
top: -10rpx; top: -10rpx;
@ -181,9 +201,10 @@
border-radius: 30rpx; border-radius: 30rpx;
font-size: 18rpx; font-size: 18rpx;
} }
} }
} }
.head { .head {
padding: 20rpx; padding: 20rpx;
background-color: white; background-color: white;

View File

@ -1,23 +1,24 @@
<template> <template>
<view style="background-color: #ffffff;"> <view style="background-color: #ffffff;">
<up-sticky offset-top="0"> <up-sticky offset-top="0" style="background-color: #ffffff;">
<view class="navbar"> <view class="navbar">
<view style="width: 580rpx;"> <view style="width: 580rpx;">
<up-search placeholder="请输入商品" @search="searchKeyword" @clear="searchKeyword" v-model="keyword" <up-search placeholder="请输入商品" @search="searchKeyword" @clear="searchKeyword" v-model="keyword"
:showAction="false"></up-search> :showAction="false"></up-search>
</view> </view>
<view class="nav-item" @click="calendarShow=true"> <view class="nav-item" @click="calendarShow=true">
<up-icon name="calendar" color="#2979ff" size="28"></up-icon> <up-icon name="calendar" color="#2979ff" size="28"></up-icon>
<text>筛选日期</text> <text>筛选日期</text>
</view>
</view> </view>
</view> </up-sticky> </up-sticky>
<view class="content"> <view class="content">
<up-transition :show="true" mode="slide-left"> <up-transition :show="true" mode="slide-left">
<view v-if="goodsList1.length>0"> <up-list @scrolltolower="scrolltolower" v-if="goodsList1.length>0">
<view class="card" v-for="(item,index) in goodsList1" :key='index'> <up-list-item class="card" v-for="(item,index) in goodsList1" :key='index'>
<view class="card-content"> <view class="card-content">
<view class="card-content-l" style="width: 152rpx;height: 152rpx;"> <view class="card-content-l" style="width: 152rpx;height: 152rpx;">
<image style="width: 152rpx;height: 152rpx;" :src="item.image" mode=""></image> <image style="width: 152rpx;height: 152rpx;" :src="item.image" mode=""></image>
@ -27,62 +28,46 @@
{{item.store_name}} {{item.store_name}}
</view> </view>
<view> <view>
单位:{{item.unit_name}} 时间:{{item.create_time}}
</view> </view>
<view> <view>
规格:{{item.store_info}} 规格:{{item.store_info}}
</view> </view>
<view style="color: red;">
需求量 {{item.need_num}} <view>
单价:<span style="margin-right: 20rpx;color: red;">{{item.price}}</span>
数量:<span style="margin-right: 20rpx;color: red;">{{item.cart_num}}/{{item.unit_name}}</span>
总价:<span style="margin-right: 20rpx;color: red;">{{item.total_price}}</span>
</view> </view>
</view> </view>
</view> </view>
<view class="card-footer">
<up-button size="small" type="primary" shape="circle"
@click="cancleOrder(item)" v-if="item.buyer_confirm==0">确认已采购</up-button>
<up-button size="small" type="success" shape="circle"
v-else disabled >{{item.buyer_confirm_name}}</up-button>
</view>
<up-line style="margin-top: 30rpx;" color="#F3F3F3"></up-line> <up-line style="margin-top: 30rpx;" color="#F3F3F3"></up-line>
</view> </up-list-item>
</view> </up-list>
<up-empty @click='test2' v-else mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png"> <up-empty @click='test2' v-else mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png">
</up-empty> </up-empty>
</up-transition> </up-transition>
<up-modal :show="show" title="采购确认" showCancelButton @cancel="show=false" @confirm="offerUpdate()">
<up-form labelPosition="left">
<up-form-item label="名称">
<up-input v-model="formData.store_name" border="none"></up-input>
</up-form-item>
<up-form-item label="数量">
<up-input v-model="formData.nums" border="none" @change='changeInputPrice'></up-input>
</up-form-item>
<up-form-item label="单价">
<up-input v-model="formData.price" border="none" @change='changeInputPrice'></up-input>
</up-form-item>
<up-form-item label="总价">
<up-input v-model="formData.total_price" border="none"></up-input>
</up-form-item>
</up-form>
</up-modal>
</view> </view>
</view> </view>
<up-calendar :show="calendarShow" @confirm="calendarConfirm" @close="calendarShow=false" :closeOnClickOverlay="true"></up-calendar> <up-calendar :show="calendarShow" @confirm="calendarConfirm" @close="calendarShow=false"
:closeOnClickOverlay="true" :min-date="min_date" monthNum="13" mode="range"></up-calendar>
</template> </template>
<script setup> <script setup>
import {
timeFrom
} from '@/uni_modules/uview-plus';
import { import {
ref, ref,
reactive, reactive,
} from "vue" } from "vue"
import { import {
purchaseProductOfferLists, StoreOrderCartInfoGroupLists,
purchaseProductOfferUpdate } from "@/api/store_order_cart_info.js"
} from "@/api/purchase_product_offer.js"
const test2 = () => { const test2 = () => {
console.log("点解") console.log("点解")
@ -91,60 +76,44 @@
}) })
} }
const show = ref(false) const show = ref(false)
const calendarShow=ref(false) const min_date = ref('')
const formData = ref({ const where = ref({
"id": '', store_name: '',
"store_name": '', page_no: 1,
'product_id': '', start_time: timeFrom(new Date()),
'nums': '', end_time: timeFrom(new Date())
'price': '',
'total_price':''
}) })
const calendarConfirm=(e)=>{ const calendarShow = ref(false)
console.log(e[0])
}
// tabsindex
const tabIndex = ref(1)
const {
windowWidth
} = uni.getSystemInfoSync();
const tabsLeft = ref(((windowWidth / 2) - 26) / 2)
const tabsRight = ref(tabsLeft.value + (windowWidth / 2))
// tabsindex
const priceBlur = (index, goodsList) => { const calendarConfirm = (e) => {
goodsList[index].price = Number(goodsList[index].price).toFixed(2) where.value.start_time = e[0];
where.value.end_time = e[(e.length)-1];
goodsList1.value = []
getGoodsList()
calendarShow.value = false
} }
let currentDate = new Date();
min_date.value=currentDate.setFullYear(currentDate.getFullYear() - 1);
// //
const showGoods = ref(false)
const showGoods1 = ref(false)
const goodsList = ref([])
const goodsList1 = ref([]) const goodsList1 = ref([])
const getGoodsList = async () => { const getGoodsList = async () => {
let res = await purchaseProductOfferLists({}) let res = await StoreOrderCartInfoGroupLists(where.value)
goodsList1.value = res.data.lists goodsList1.value.push(...res.data.lists)
} }
const cancleOrder = (item) => {
show.value = true const keyword = ref('');
formData.value.store_name = item['store_name']
formData.value.id = item['id'] const searchKeyword = () => {
formData.value.nums = item['need_num'] where.value.store_name = keyword.value;
formData.value.product_id = item['product_id'] goodsList1.value = []
getGoodsList();
} }
const offerUpdate = () => { const scrolltolower = () => {
purchaseProductOfferUpdate(formData.value).then(res=>{ where.value.page_no += 1
uni.$u.toast(res.msg); getGoodsList()
show.value=false
getGoodsList()
})
} }
const changeInputPrice=(e)=>{
if(formData.value.nums>0 && formData.value.price>0){
formData.value.total_price=formData.value.nums*formData.value.price
}
}
getGoodsList() getGoodsList()
</script> </script>
@ -156,19 +125,19 @@
justify-content: space-between; justify-content: space-between;
font-size: 22rpx; font-size: 22rpx;
color: #777; color: #777;
.nav-item { .nav-item {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
position: relative; position: relative;
image { image {
height: 40rpx; height: 40rpx;
width: 40rpx; width: 40rpx;
} }
.badge { .badge {
position: absolute; position: absolute;
top: -10rpx; top: -10rpx;
@ -181,27 +150,10 @@
border-radius: 30rpx; border-radius: 30rpx;
font-size: 18rpx; font-size: 18rpx;
} }
} }
} }
.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;
}
}
.content { .content {
padding: 20rpx; padding: 20rpx;
@ -224,17 +176,6 @@
margin-right: 20rpx; margin-right: 20rpx;
position: relative; position: relative;
.status {
width: 152rpx;
height: 40rpx;
background-color: rgba(0, 0, 0, .3);
text-align: center;
color: white;
font-size: 24rpx;
line-height: 40rpx;
position: absolute;
bottom: 0;
}
} }
.card-content-r { .card-content-r {
@ -259,41 +200,14 @@
} }
} }
.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;
}
} }
.detail {
width: 88rpx;
height: 88rpx;
border-radius: 88rpx;
text-align: center;
line-height: 88rpx;
background-color: #50C758;
color: white;
position: absolute;
bottom: 300rpx;
right: 20rpx;
}
.ellipsis { .ellipsis {
white-space: nowrap; white-space: nowrap;

View File

@ -1,23 +1,24 @@
<template> <template>
<view style="background-color: #ffffff;"> <view style="background-color: #ffffff;">
<up-sticky offset-top="0"> <up-sticky offset-top="0" style="background-color: #ffffff;">
<view class="navbar"> <view class="navbar">
<view style="width: 580rpx;"> <view style="width: 580rpx;">
<up-search placeholder="请输入商品" @search="searchKeyword" @clear="searchKeyword" v-model="keyword" <up-search placeholder="请输入商品" @search="searchKeyword" @clear="searchKeyword" v-model="keyword"
:showAction="false"></up-search> :showAction="false"></up-search>
</view> </view>
<view class="nav-item" @click="calendarShow=true"> <view class="nav-item" @click="calendarShow=true">
<up-icon name="calendar" color="#2979ff" size="28"></up-icon> <up-icon name="calendar" color="#2979ff" size="28"></up-icon>
<text>筛选日期</text> <text>筛选日期</text>
</view>
</view> </view>
</view> </up-sticky> </up-sticky>
<view class="content"> <view class="content">
<up-transition :show="true" mode="slide-left"> <up-transition :show="true" mode="slide-left">
<view v-if="goodsList1.length>0"> <up-list @scrolltolower="scrolltolower" v-if="goodsList1.length>0">
<view class="card" v-for="(item,index) in goodsList1" :key='index'> <up-list-item class="card" v-for="(item,index) in goodsList1" :key='index'>
<view class="card-content"> <view class="card-content">
<view class="card-content-l" style="width: 152rpx;height: 152rpx;"> <view class="card-content-l" style="width: 152rpx;height: 152rpx;">
<image style="width: 152rpx;height: 152rpx;" :src="item.image" mode=""></image> <image style="width: 152rpx;height: 152rpx;" :src="item.image" mode=""></image>
@ -27,62 +28,46 @@
{{item.store_name}} {{item.store_name}}
</view> </view>
<view> <view>
单位:{{item.unit_name}} 时间:{{item.create_time}}
</view> </view>
<view> <view>
规格:{{item.store_info}} 规格:{{item.store_info}}
</view> </view>
<view style="color: red;">
需求量 {{item.need_num}} <view>
单价:<span style="margin-right: 20rpx;color: red;">{{item.price}}</span>
数量:<span style="margin-right: 20rpx;color: red;">{{item.cart_num}}/{{item.unit_name}}</span>
总价:<span style="margin-right: 20rpx;color: red;">{{item.total_price}}</span>
</view> </view>
</view> </view>
</view> </view>
<view class="card-footer">
<up-button size="small" type="primary" shape="circle"
@click="cancleOrder(item)" v-if="item.buyer_confirm==0">确认已采购</up-button>
<up-button size="small" type="success" shape="circle"
v-else disabled >{{item.buyer_confirm_name}}</up-button>
</view>
<up-line style="margin-top: 30rpx;" color="#F3F3F3"></up-line> <up-line style="margin-top: 30rpx;" color="#F3F3F3"></up-line>
</view> </up-list-item>
</view> </up-list>
<up-empty @click='test2' v-else mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png"> <up-empty @click='test2' v-else mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png">
</up-empty> </up-empty>
</up-transition> </up-transition>
<up-modal :show="show" title="采购确认" showCancelButton @cancel="show=false" @confirm="offerUpdate()">
<up-form labelPosition="left">
<up-form-item label="名称">
<up-input v-model="formData.store_name" border="none"></up-input>
</up-form-item>
<up-form-item label="数量">
<up-input v-model="formData.nums" border="none" @change='changeInputPrice'></up-input>
</up-form-item>
<up-form-item label="单价">
<up-input v-model="formData.price" border="none" @change='changeInputPrice'></up-input>
</up-form-item>
<up-form-item label="总价">
<up-input v-model="formData.total_price" border="none"></up-input>
</up-form-item>
</up-form>
</up-modal>
</view> </view>
</view> </view>
<up-calendar :show="calendarShow" @confirm="calendarConfirm" @close="calendarShow=false" :closeOnClickOverlay="true"></up-calendar> <up-calendar :show="calendarShow" @confirm="calendarConfirm" @close="calendarShow=false"
:closeOnClickOverlay="true" :min-date="min_date" monthNum="13"></up-calendar>
</template> </template>
<script setup> <script setup>
import {
timeFrom
} from '@/uni_modules/uview-plus';
import { import {
ref, ref,
reactive, reactive,
} from "vue" } from "vue"
import { import {
purchaseProductOfferLists, StoreOrderCartInfoLists,
purchaseProductOfferUpdate } from "@/api/store_order_cart_info.js"
} from "@/api/purchase_product_offer.js"
const test2 = () => { const test2 = () => {
console.log("点解") console.log("点解")
@ -91,60 +76,44 @@
}) })
} }
const show = ref(false) const show = ref(false)
const calendarShow=ref(false) const min_date = ref('')
const formData = ref({ const where = ref({
"id": '', store_name: '',
"store_name": '', page_no: 1,
'product_id': '', start_time: timeFrom(new Date()),
'nums': '', end_time: timeFrom(new Date())
'price': '',
'total_price':''
}) })
const calendarConfirm=(e)=>{ const calendarShow = ref(false)
console.log(e[0])
}
// tabsindex
const tabIndex = ref(1)
const {
windowWidth
} = uni.getSystemInfoSync();
const tabsLeft = ref(((windowWidth / 2) - 26) / 2)
const tabsRight = ref(tabsLeft.value + (windowWidth / 2))
// tabsindex
const priceBlur = (index, goodsList) => { const calendarConfirm = (e) => {
goodsList[index].price = Number(goodsList[index].price).toFixed(2) where.value.start_time = e[0];
where.value.end_time = e[0];
goodsList1.value = []
getGoodsList()
calendarShow.value = false
} }
let currentDate = new Date();
min_date.value=currentDate.setFullYear(currentDate.getFullYear() - 1);
// //
const showGoods = ref(false)
const showGoods1 = ref(false)
const goodsList = ref([])
const goodsList1 = ref([]) const goodsList1 = ref([])
const getGoodsList = async () => { const getGoodsList = async () => {
let res = await purchaseProductOfferLists({}) let res = await StoreOrderCartInfoLists(where.value)
goodsList1.value = res.data.lists goodsList1.value.push(...res.data.lists)
} }
const cancleOrder = (item) => {
show.value = true const keyword = ref('');
formData.value.store_name = item['store_name']
formData.value.id = item['id'] const searchKeyword = () => {
formData.value.nums = item['need_num'] where.value.store_name = keyword.value;
formData.value.product_id = item['product_id'] goodsList1.value = []
getGoodsList();
} }
const offerUpdate = () => { const scrolltolower = () => {
purchaseProductOfferUpdate(formData.value).then(res=>{ where.value.page_no += 1
uni.$u.toast(res.msg); getGoodsList()
show.value=false
getGoodsList()
})
} }
const changeInputPrice=(e)=>{
if(formData.value.nums>0 && formData.value.price>0){
formData.value.total_price=formData.value.nums*formData.value.price
}
}
getGoodsList() getGoodsList()
</script> </script>
@ -156,19 +125,19 @@
justify-content: space-between; justify-content: space-between;
font-size: 22rpx; font-size: 22rpx;
color: #777; color: #777;
.nav-item { .nav-item {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
position: relative; position: relative;
image { image {
height: 40rpx; height: 40rpx;
width: 40rpx; width: 40rpx;
} }
.badge { .badge {
position: absolute; position: absolute;
top: -10rpx; top: -10rpx;
@ -181,27 +150,10 @@
border-radius: 30rpx; border-radius: 30rpx;
font-size: 18rpx; font-size: 18rpx;
} }
} }
} }
.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;
}
}
.content { .content {
padding: 20rpx; padding: 20rpx;
@ -224,17 +176,6 @@
margin-right: 20rpx; margin-right: 20rpx;
position: relative; position: relative;
.status {
width: 152rpx;
height: 40rpx;
background-color: rgba(0, 0, 0, .3);
text-align: center;
color: white;
font-size: 24rpx;
line-height: 40rpx;
position: absolute;
bottom: 0;
}
} }
.card-content-r { .card-content-r {
@ -259,41 +200,14 @@
} }
} }
.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;
}
} }
.detail {
width: 88rpx;
height: 88rpx;
border-radius: 88rpx;
text-align: center;
line-height: 88rpx;
background-color: #50C758;
color: white;
position: absolute;
bottom: 300rpx;
right: 20rpx;
}
.ellipsis { .ellipsis {
white-space: nowrap; white-space: nowrap;

View File

@ -137,18 +137,6 @@
{{item.tag}} {{item.tag}}
</view> </view>
</view> </view>
<view class="shop-content-li" style="color: #999999;" v-if="priceKey.off_activity==1">
<view class="shop-content-li-l">原价</view>
<view class="shop-content-li-r line-through">{{item[priceKey.op_price]}}</view>
</view>
<view class="shop-content-li" v-else>
<view class="shop-content-li-l">售价</view>
<view class="shop-content-li-r" style="color:#FC452F ;"><text
style="font-size: 28rpx;">{{item[priceKey.op_price]}}</text>
</view>
</view>
<view class="shop-content-li" style="justify-content: space-between;" <view class="shop-content-li" style="justify-content: space-between;"
v-if="item.store_info"> v-if="item.store_info">
<view style="display: flex;"> <view style="display: flex;">