This commit is contained in:
weipengfei 2024-05-29 18:09:44 +08:00
parent e65c24c01a
commit aba60965c7

View File

@ -36,12 +36,11 @@
</view>
<view class="ipt">
<u--input placeholder="输入报价数量" :readonly="tabIndex==2" v-model="item.nums"
style="background-color:#F6F6F6;border: none;"></u--input>
style="background-color:#F6F6F6;border: none;" type="number" @blur="blur1(item)"></u--input>
<view style="width: 10rpx;">
</view>
<u--input style="background-color: #F6F6F6;border: none;" placeholder="输入产品报价" @blur="priceBlur(index)"
:readonly="tabIndex==2" v-model="item.price"></u--input>
<u--input style="background-color: #F6F6F6;border: none;" placeholder="输入产品报价" @blur="blur2(item)"
:readonly="tabIndex==2" v-model="item.price" type="number"></u--input>
</view>
</view>
<view class="status-png" v-if="tabIndex==2">
@ -69,10 +68,10 @@
</u-empty>
</view>
<view class="submit-btn" v-if="tabIndex==1">
<view class="submit-btn" v-show="tabIndex==1 && lists.length > 0">
<u-button shape='circle' color='#20B128' @click="submit" text="提交"></u-button>
</view>
<view class="submit-btn" v-if="tabIndex==2">
<view class="submit-btn" v-show="tabIndex==2 && deliveryBtnShow">
<u-button shape='circle' color='#20B128' @click="showDeliver" text="立即发货"></u-button>
</view>
<uni-popup ref="deliver" type="center" @click.stop="">
@ -81,7 +80,7 @@
<u--form labelPosition="left" style="width: 100%;" labelWidth="auto" :model="model1" :rules="rules"
ref="uForm">
<u-form-item label="配送方式" borderBottom>
<u-radio-group v-model="model_type" placement="row" @change="model1.delivery_name='';model1.delivery_id=''">
<u-radio-group v-model="model_type" placement="row" @change="model1.delivery_name='';model1.delivery_id=''" activeColor="#20B128">
<u-radio label="自己配送" :name="2" style="margin-right: 20rpx;"></u-radio>
<u-radio label="快递配送" :name="1"></u-radio>
</u-radio-group>
@ -140,6 +139,7 @@
ybj: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/attach/274ad202405111523222891.png',
model_type: 2,
deliveryNameShow: false,
deliveryBtnShow: false,
model1: {
delivery_name: "",
delivery_id: "",
@ -167,6 +167,14 @@
url
})
},
blur1(item){
if(item.nums<0) item.nums=0;
if(item.nums>item.need_num) item.nums=item.need_num;
},
blur2(item){
if(item.price<0) item.price=0;
item.price = (+item.price).toFixed(2)
},
getTabsPosi() {
const {
windowWidth
@ -180,7 +188,8 @@
type: type || this.tabIndex,
date: this.date
}).then(res => {
this.lists = res.data.lists
this.lists = res.data.lists;
this.deliveryBtnShow = res.data.extend.delivery ? true : false;
this.lists.forEach(item => {
if (!(+item.nums)) {
item.nums = ''
@ -208,6 +217,7 @@
this.lists.filter(item => {
return (+item.price && +item.nums)
}).map(item => {
if(item.nums > item.need_num) item.nums = item.need_num;
return {
id: item.id,
nums: item.nums,
@ -229,7 +239,7 @@
this.$refs.uForm.validate().then(res=>{
OpurchaseclassExpressApi({
...this.model1,
date: this.date
// date: this.date
}).then(res => {
this.getLists(2);
this.$refs.deliver.close();
@ -372,7 +382,6 @@
.deliver {
width: 600rpx;
height: 500rpx;
background-color: #fff;
border-radius: 14rpx;
padding: 20rpx;