This commit is contained in:
mkm 2024-10-13 16:30:38 +08:00
parent c807a39032
commit c676d944c5
2 changed files with 40 additions and 9 deletions

View File

@ -3,9 +3,9 @@ let WSS_URL
import store from "@/store/user.js"
// 环境
// let env = "dev"
// let env = "prod"
let env = "prod"
// let env = "release";
let env = "local";
// let env = "local";
switch (env) {
case 'dev':
@ -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:

View File

@ -51,7 +51,9 @@
<up-input v-model="formData.store_name" border="none" disabled=""></up-input>
</up-form-item>
<up-form-item label="数量">
<up-input v-model="formData.nums" @change='changeInputPrice'></up-input>
<up-input v-model="formData.nums" @change='changeInputPrice'> <template #suffix>
<span>{{formData.unit_name}}</span>
</template></up-input>
</up-form-item>
<up-form-item label="单价">
<up-input v-model="formData.price" @change='changeInputPrice'></up-input>
@ -59,13 +61,19 @@
<up-form-item label="总价">
<up-input v-model="formData.total_price"></up-input>
</up-form-item>
<up-form-item label="出库价">
<up-form-item label="出库价" labelWidth='auto'>
<up-input @click="pickerShow=true" v-model="formData.outbound_price">
<template #suffix>
<span>{{pickerText}}</span>
<span>{{pickerText}}</span>
</template>
</up-input>
</up-form-item>
<up-form-item label="付款方式" labelWidth='auto'>
<up-radio-group v-model="radio_value">
<up-radio v-for="(item, index) in radiolist1" :key="index" :label="item.name"
:name="item.name" @change="radioChange"></up-radio>
</up-radio-group>
</up-form-item>
</up-form>
</up-modal>
<up-picker :show="pickerShow" :columns="columns" keyName="name" @confirm="pickerConfirm"
@ -96,6 +104,7 @@
}
const show = ref(false)
const pickerText = ref('')
const picker_price = ref(0)
const pickerShow = ref(false)
const formData = ref({
"id": '',
@ -104,9 +113,13 @@
'nums': '',
'price': '',
'total_price': '',
'outbound_price': ''
'outbound_price': '',
'unit_name': '',
'pay_type':1
})
// tabsindex
const radiolist1=ref([{name:'赊账'},{name:'现金'}])
const radio_value=ref('赊账')
const tabIndex = ref(1)
const {
windowWidth
@ -132,11 +145,18 @@
goodsList1.value = res.data.lists
}
const cancleOrder = (item) => {
columns.value[0].forEach(e => {
if (e['name_b'] == item['category_name']) {
pickerText.value = e['name']
picker_price.value = e['value']
}
})
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']
formData.value.unit_name = item['unit_name']
}
const offerUpdate = () => {
purchaseProductOfferUpdate(formData.value).then(res => {
@ -147,7 +167,11 @@
}
const changeInputPrice = (e) => {
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).toFixed(2)
if (picker_price.value > 0) {
let outbound_price = (formData.value.price * picker_price.value)
formData.value.outbound_price = (parseInt(formData.value.price) + outbound_price).toFixed(2)
}
}
}
const sectionChange = (index) => {
@ -158,7 +182,7 @@
const pickerConfirm = (e) => {
pickerShow.value = false
let outbound_price = (formData.value.price * e.value[0].value)
pickerText.value=e.value[0].name
pickerText.value = e.value[0].name
formData.value.outbound_price = (parseInt(formData.value.price) + outbound_price).toFixed(2)
}
const OutboundFloatingLv = () => {
@ -166,6 +190,13 @@
columns.value = res.data
})
}
const radioChange=(e)=>{
if(e=='赊账'){
formData.pay_type=1
}else{
formData.pay_type=2
}
}
getGoodsList()
OutboundFloatingLv()
</script>