This commit is contained in:
zmj 2024-05-11 10:31:59 +08:00
parent 56668bb2e0
commit dc02bca062
1 changed files with 109 additions and 99 deletions

View File

@ -20,6 +20,7 @@
</up-sticky>
<view class="content">
<!-- 报价列表 -->
<view v-if="showGoods1">
<up-transition :show="showGoods1" mode="slide-left">
<view class="" v-if="goodsList1.length>0">
<view class="card" v-for="(item,index) in goodsList1" :key='index'>
@ -42,15 +43,18 @@
需求量 {{item.need_num}}{{item.unit_name}}
</view>
<view class="ipt">
<up-input placeholderStyle='fontSize:24rpx' placeholder="点击数入报价数量"
<up-input :placeholderStyle="{fontSize:'20rpx'}" placeholder="输入报价数量"
:readonly="tabIndex==2" v-model="item.nums"
style="margin-right: 10rpx;background-color:#F6F6F6;border: none;"></up-input>
style="background-color:#F6F6F6;border: none;"></up-input>
<!-- <up-input placeholderStyle='fontSize:24rpx' placeholder="点击数入报价数量" :readonly="tabIndex==2"
v-model="item.num"
style="margin-right: 10rpx;background-color:#F6F6F6;border: none;"></up-input> -->
<up-input placeholderStyle='fontSize:24rpx'
style="background-color: #F6F6F6;border: none;" placeholder="点击数入产品报价"
@blur="priceBlur(index)" :readonly="tabIndex==2"
<view style="width: 10rpx;">
</view>
<up-input :placeholderStyle="{fontSize:'20rpx'}"
style="background-color: #F6F6F6;border: none;" placeholder="输入产品报价"
@blur="priceBlur(index,goodsList1)" :readonly="tabIndex==2"
v-model="item.price"></up-input>
</view>
</view>
@ -59,21 +63,22 @@
</image>
</view>
</view>
<view class="card-footer" v-if="item.nums &&item.price">
<view class="card-footer" v-if="item.nums && item.price">
{{item.nums}}{{item.unit_name}}&nbsp; &nbsp;合计:<text
style="font-size: 28rpx;color: #FC452F;font-weight: 700;">{{item.nums*item.price}}</text>
</view>
<up-line style="margin-top: 30rpx;" color="#F3F3F3"></up-line>
</view>
<view class="submit-btn" v-if="tabIndex==1">
<up-button shape='circle' color='#20B128' @click="submit" text="提交"></up-button>
</view>
</view>
<up-empty @click='test2' v-else mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png">
</up-empty>
<button @click="test2">叫我按钮</button>
<!-- <button @click="test2">叫我按钮</button> -->
</up-transition>
</view>
<!-- 报价记录 -->
<view v-if="showGoods2">
<up-transition :show="showGoods2" mode="slide-right">
<view class="" v-if="goodsList2.length>0">
<view class="card" v-for="(item,index) in goodsList2" :key='index'>
@ -104,7 +109,7 @@
style="margin-right: 10rpx;background-color:#F6F6F6;border: none;"></up-input> -->
<up-input placeholderStyle='fontSize:24rpx'
style="background-color: #F6F6F6;border: none;" placeholder="点击数入产品报价"
@blur="priceBlur(index)" :readonly="tabIndex==2"
@blur="priceBlur(index,goodsList2)" :readonly="tabIndex==2"
v-model="item.price"></up-input>
</view>
</view>
@ -125,6 +130,13 @@
<up-empty v-else mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png">
</up-empty>
</up-transition>
</view>
<view class="submit-btn" v-if="tabIndex==1">
<up-button shape='circle' color='#20B128' @click="submit" text="提交"></up-button>
</view>
</view>
</view>
</template>
@ -160,8 +172,8 @@
const tabsRight = ref(tabsLeft.value + (windowWidth / 2))
// tabsindex
const priceBlur = (index) => {
goodsList.value[index].price = Number(goodsList.value[index].price).toFixed(2)
const priceBlur = (index, goodsList) => {
goodsList[index].price = Number(goodsList[index].price).toFixed(2)
}
//
@ -208,7 +220,7 @@
getGoodsList(tabIndex.value)
//
const submit = async () => {
let datas = goodsList.value.map(item => ({
let datas = goodsList1.value.map(item => ({
id: item.id,
nums: item.nums,
price: item.price
@ -219,8 +231,6 @@
newData.push(item)
}
})
let res = await OpurchaseGoodsOfferApi({
data: newData
})