feat: 添加采购商品列表和获取功能,优化订单获取逻辑
This commit is contained in:
parent
937730558c
commit
d7255d9690
|
@ -3,3 +3,7 @@ import request from '@/utils/request';
|
|||
export const purchaseProductOfferLists = (data) => {
|
||||
return request.get('/purchase_product_offer/purchaseproductoffer/lists', data);
|
||||
}
|
||||
//报价单提交
|
||||
export const purchaseProductOfferUpdate = (data) => {
|
||||
return request.post('/purchase_product_offer/purchaseproductoffer/offer_update', data);
|
||||
}
|
|
@ -17,7 +17,7 @@ switch (env) {
|
|||
WSS_URL = 'wss://ceshi-multi-store.lihaink.cn/pull'
|
||||
break;
|
||||
case 'local':
|
||||
BASE_URL = 'http://192.168.1.22:8545';
|
||||
BASE_URL = 'http://192.168.1.7:8545';
|
||||
WSS_URL = 'wss://ceshi-multi-store.lihaink.cn/pull'
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<template>
|
||||
<view>
|
||||
<view class="content">
|
||||
<up-transition mode="slide-left">
|
||||
<view class="a" v-if="goodsList1.length>0">
|
||||
<up-transition :show="true" mode="slide-left">
|
||||
<view v-if="goodsList1.length>0">
|
||||
<view class="card" v-for="(item,index) in goodsList1" :key='index'>
|
||||
<view class="head">
|
||||
<!-- <text> {{orer_sn}}</text> -->
|
||||
|
@ -16,15 +16,24 @@
|
|||
<view class="title ellipsis">
|
||||
{{item.store_name}}
|
||||
</view>
|
||||
<view class="need">
|
||||
<view>
|
||||
单位:{{item.unit_name}}
|
||||
</view>
|
||||
<view>
|
||||
规格:{{item.store_info}}
|
||||
</view>
|
||||
<view style="color: red;">
|
||||
需求量: {{item.need_num}}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="card-footer" v-if="item.nums && item.price">
|
||||
共{{item.nums}}{{item.unit_name}} 合计:<text
|
||||
style="font-size: 28rpx;color: #FC452F;font-weight: 700;">¥{{item.nums*item.price}}</text>
|
||||
|
||||
<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>
|
||||
</view>
|
||||
|
@ -33,6 +42,23 @@
|
|||
</up-empty>
|
||||
<!-- <button @click="test2">叫我按钮</button> -->
|
||||
</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>
|
||||
</template>
|
||||
|
@ -44,7 +70,8 @@
|
|||
reactive,
|
||||
} from "vue"
|
||||
import {
|
||||
purchaseProductOfferLists
|
||||
purchaseProductOfferLists,
|
||||
purchaseProductOfferUpdate
|
||||
} from "@/api/purchase_product_offer.js"
|
||||
|
||||
const test2 = () => {
|
||||
|
@ -53,13 +80,15 @@
|
|||
url: '/pages/index/index'
|
||||
})
|
||||
}
|
||||
// 状态图片url
|
||||
const successPng = ref('https://lihai001.oss-cn-chengdu.aliyuncs.com/attach/739c3202405071458553459.png')
|
||||
const errPng = ref('https://lihai001.oss-cn-chengdu.aliyuncs.com/attach/04c2c202405071501462462.png')
|
||||
const waitPng = ref('https://lihai001.oss-cn-chengdu.aliyuncs.com/attach/274ad202405111523222891.png')
|
||||
|
||||
|
||||
|
||||
const show = ref(false)
|
||||
const formData = ref({
|
||||
"id": '',
|
||||
"store_name": '',
|
||||
'product_id': '',
|
||||
'nums': '',
|
||||
'price': '',
|
||||
'total_price':''
|
||||
})
|
||||
// tabsindex
|
||||
const tabIndex = ref(1)
|
||||
const {
|
||||
|
@ -79,15 +108,30 @@
|
|||
const goodsList = ref([])
|
||||
const goodsList1 = ref([])
|
||||
|
||||
const getGoodsList = async (type) => {
|
||||
let res = await purchaseProductOfferLists({
|
||||
type
|
||||
})
|
||||
const getGoodsList = async () => {
|
||||
let res = await purchaseProductOfferLists({})
|
||||
goodsList1.value = res.data.lists
|
||||
}
|
||||
|
||||
|
||||
getGoodsList(tabIndex.value)
|
||||
const cancleOrder = (item) => {
|
||||
show.value = true
|
||||
formData.value.store_name = item['store_name']
|
||||
formData.value.id = item['id']
|
||||
formData.value.nums = item['need_num']
|
||||
formData.value.product_id = item['product_id']
|
||||
}
|
||||
const offerUpdate = () => {
|
||||
purchaseProductOfferUpdate(formData.value).then(res=>{
|
||||
uni.$u.toast(res.msg);
|
||||
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()
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
|
|
@ -124,7 +124,7 @@
|
|||
<up-cell title="支付密码" :isLink="true" url="/pagesOrder/setPayPassword/index"></up-cell>
|
||||
<up-cell title="商品列表" :isLink="true" url="pages/product/product" v-if="userInfo.system_store_id>0"></up-cell>
|
||||
<up-cell title="订单列表" :isLink="true" url="pagesOrder/delivery/index" v-if="userInfo.system_store_id>0"></up-cell>
|
||||
<up-cell title="采购列表" :isLink="true" url="pageQuota/purchase_product_offer/index"></up-cell>
|
||||
<up-cell title="采购列表" :isLink="true" url="pageQuota/purchase_product_offer/index" v-if="userInfo.delivery_service_id>0"></up-cell>
|
||||
</up-cell-group>
|
||||
</view>
|
||||
|
||||
|
|
Loading…
Reference in New Issue