开发环境配置更新与采购产品报价页面优化

- 将环境变量从生产切换到本地开发环境
This commit is contained in:
mkm 2024-10-11 18:00:50 +08:00
parent a8d038b011
commit 5d9c009be6
2 changed files with 57 additions and 24 deletions

View File

@ -3,9 +3,9 @@ let WSS_URL
import store from "@/store/user.js" import store from "@/store/user.js"
// 环境 // 环境
// let env = "dev" // let env = "dev"
let env = "prod" // let env = "prod"
// let env = "release"; // let env = "release";
// let env = "local"; let env = "local";
switch (env) { switch (env) {
case 'dev': case 'dev':
@ -17,7 +17,7 @@ switch (env) {
WSS_URL = 'wss://ceshi-multi-store.lihaink.cn/pull' WSS_URL = 'wss://ceshi-multi-store.lihaink.cn/pull'
break; break;
case 'local': case 'local':
BASE_URL = 'http://192.168.1.7:8545'; BASE_URL = 'http://192.168.1.22:8545';
WSS_URL = 'wss://ceshi-multi-store.lihaink.cn/pull' WSS_URL = 'wss://ceshi-multi-store.lihaink.cn/pull'
break; break;
default: default:

View File

@ -1,5 +1,6 @@
<template> <template>
<view> <view>
<up-subsection :list="menu_list" :current="0" @change="sectionChange"></up-subsection>
<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"> <view v-if="goodsList1.length>0">
@ -14,7 +15,7 @@
</view> </view>
<view class="card-content-r"> <view class="card-content-r">
<view class="title ellipsis"> <view class="title ellipsis">
{{item.store_name}} 编号:{{item.order_id}}|{{item.store_name}}
</view> </view>
<view> <view>
单位:{{item.unit_name}} 单位:{{item.unit_name}}
@ -22,6 +23,9 @@
<view> <view>
规格:{{item.store_info}} 规格:{{item.store_info}}
</view> </view>
<view>
备注:{{item.mark}}
</view>
<view style="color: red;"> <view style="color: red;">
需求量 {{item.need_num}} 需求量 {{item.need_num}}
</view> </view>
@ -30,10 +34,10 @@
</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.buyer_confirm==0">确认已采购</up-button>
<up-button size="small" type="success" shape="circle" <up-button size="small" type="success" shape="circle" v-else
v-else disabled >{{item.buyer_confirm_name}}</up-button> 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> </view>
@ -44,19 +48,23 @@
<up-modal :show="show" title="采购确认" showCancelButton @cancel="show=false" @confirm="offerUpdate()"> <up-modal :show="show" title="采购确认" showCancelButton @cancel="show=false" @confirm="offerUpdate()">
<up-form labelPosition="left"> <up-form labelPosition="left">
<up-form-item label="名称"> <up-form-item label="名称">
<up-input v-model="formData.store_name" border="none"></up-input> <up-input v-model="formData.store_name" border="none" disabled=""></up-input>
</up-form-item> </up-form-item>
<up-form-item label="数量"> <up-form-item label="数量">
<up-input v-model="formData.nums" border="none" @change='changeInputPrice'></up-input> <up-input v-model="formData.nums" @change='changeInputPrice'></up-input>
</up-form-item> </up-form-item>
<up-form-item label="单价"> <up-form-item label="单价">
<up-input v-model="formData.price" border="none" @change='changeInputPrice'></up-input> <up-input v-model="formData.price" @change='changeInputPrice'></up-input>
</up-form-item> </up-form-item>
<up-form-item label="总价"> <up-form-item label="总价">
<up-input v-model="formData.total_price" border="none"></up-input> <up-input v-model="formData.total_price"></up-input>
</up-form-item>
<up-form-item label="出库价">
<up-input @click="pickerShow=true"></up-input>
</up-form-item> </up-form-item>
</up-form> </up-form>
</up-modal> </up-modal>
<up-picker :show="pickerShow" :columns="columns" keyName="label" @confirm="pickerConfirm"></up-picker>
</view> </view>
</view> </view>
@ -72,6 +80,7 @@
purchaseProductOfferLists, purchaseProductOfferLists,
purchaseProductOfferUpdate purchaseProductOfferUpdate
} from "@/api/purchase_product_offer.js" } from "@/api/purchase_product_offer.js"
const menu_list = ref(['未采购', '已采购']);
const test2 = () => { const test2 = () => {
console.log("点解") console.log("点解")
@ -80,13 +89,14 @@
}) })
} }
const show = ref(false) const show = ref(false)
const pickerShow=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': ''
}) })
// tabsindex // tabsindex
const tabIndex = ref(1) const tabIndex = ref(1)
@ -106,9 +116,11 @@
const showGoods1 = ref(false) const showGoods1 = ref(false)
const goodsList = ref([]) const goodsList = ref([])
const goodsList1 = ref([]) const goodsList1 = ref([])
const where = ref({
buyer_confirm: 0
})
const getGoodsList = async () => { const getGoodsList = async () => {
let res = await purchaseProductOfferLists({}) let res = await purchaseProductOfferLists(where.value)
goodsList1.value = res.data.lists goodsList1.value = res.data.lists
} }
const cancleOrder = (item) => { const cancleOrder = (item) => {
@ -119,17 +131,38 @@
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 sectionChange = (index) => {
where.value.buyer_confirm = index
getGoodsList()
}
const columns = reactive([
[{
label: '雪月夜',
//
id: 2021
// ...
},
{
label: '冷夜雨',
id: 804
}
]
]);
const pickerConfirm=(e)=>{
pickerShow.value=false
console.log(e.value[0])
}
getGoodsList() getGoodsList()
</script> </script>