This commit is contained in:
wangweidong 2026-04-23 08:31:36 +08:00
parent 24f8ef58ff
commit f4ffbe2689
2 changed files with 30 additions and 20 deletions

View File

@ -11,7 +11,7 @@
<view class="box" v-for="(v,i) in list" :key='i' :class="act==i?'act':''" @click="act=i">
<view class="box" v-for="(v,i) in list" :key='i' >
<view>
<text class="tit">{{v.comName}}</text>
</view>

View File

@ -50,15 +50,15 @@
<text></text>
<view>销售单位</view>
</view>
<scroll-view scroll-y="true" class="scrollxhdw" :style="Math.ceil(list.length / 2)>4?'height:400rpx':'height:'+ (Math.ceil(list.length / 2)*100)+'rpx'">
<scroll-view scroll-y="true" class="scrollxhdw" :show-scrollbar="false" :style="Math.ceil(list.length / 2)>4?'height:400rpx':'height:'+ (Math.ceil(list.length / 2)*100)+'rpx'">
<view class="xhdw">
<view v-for="(v,i) in list " :key='i' :class="i==dwact?'act':''" @click="dwact = i;qita = v.text">{{v.text}}</view>
</view>
</scroll-view>
<view class="qit">
<view class="qit" style="width: 518rpx;">
<text>其它</text>
<view>
<view style="width: 430rpx;">
<input type="text" v-model="qita" @blur="blur">
</view>
</view>
@ -100,7 +100,7 @@
<view v-for="(v,i) in materialTypeList" @click="checkMaterialType(v.materialTypeId)">{{v.typeName}}</view>
</view> -->
<scroll-view class="scrollviews" scroll-y="true" scroll-with-animation @scrolltolower="scrolltolower"
:style="{ height:`calc(100vh - ${uni.getStorageSync('moveHeight') + 160}px )`}">
:style="{ height:`calc(100vh - ${uni.getStorageSync('moveHeight') + 145}px )`}">
<view class="lists" v-for="(v,i) in listarr" :key="i">
<view class="zuo">
<image :src="v.materialImg?orgObj.orgNetUrl+v.materialImg:'https://www.focusnu.com/media/default/PICNULL.png'" mode="aspectFill"></image>
@ -135,6 +135,7 @@
<view style="height:3vw;width: 100%;display: flex;align-items: center;justify-content: center;margin-top: 30rpx;">
<u-loadmore :status="status" :loadText="{nomore:'暂无更多数据'}" v-if="list.length>0" />
</view>
<view style="height: 20px;"></view>
</scroll-view>
<view class="botfiexd">
@ -170,7 +171,7 @@
const status = ref('loadmore')
onLoad((e)=>{
orgObj.value = JSON.parse(e.orgObj);
console.log('orgObj.value-->',orgObj.value);
// console.log('orgObj.value-->',orgObj.value);
getMaterialType();//
// getMaterialInfo();//
gettimearr()
@ -190,6 +191,13 @@
}
const queding = (e)=>{
if(e=='dw'){
if(qita.value == ""){
uni.showToast({
title:'请输入单位',
icon:'none'
})
return
}
let obj={
salesUnit:qita.value,
id:listarr.value[index.value].id,
@ -270,7 +278,7 @@
stringShow.value +=item
stringShow.value = stringShow.value.replace(/^(\d+)\.(\d{0,2}).*/, '$1.$2')
stringShow.value = formatStr(stringShow.value)
// console.log(stringShow.value)
// // console.log(stringShow.value)
}
function formatStr(val) {
if (!val) return ''
@ -291,8 +299,8 @@
const clickTab = (e,v)=>{
if(current.value == e){return}
current.value = e
scrollLeft.value = e*70;
console.log('item', e);
scrollLeft.value = (e-2)*70;
// console.log('item', e,v);
listarr.value = [];
pageNo.value = 1;
checkMaterialType(v.materialTypeId);
@ -305,9 +313,11 @@
openId: openId
}
getSuppliersMaterialType(obj).then(res=>{
console.log('1--->',res);
// console.log('1--->',res);
materialTypeList.value = res.result;
clickTab(0,res.result[0])
setTimeout(()=>{
clickTab(0,res.result[0])
},50)
})
}
const sxlist = ref([])
@ -342,7 +352,7 @@
const chongzhi = (k,d)=>{
sxlist.value.forEach(item=>{
item.children.forEach(e=>{
console.log(d,e.id)
// console.log(d,e.id)
if(k==0){
e.flag = false
}
@ -360,7 +370,7 @@
sxlist.value.forEach(item=>{
item.children.forEach(e=>{
if(e.flag){
console.log(e)
// console.log(e)
// checkMaterialType(e.id)
chaxn(e.id)
}
@ -371,7 +381,7 @@
const chaxn = (e)=>{
materialTypeList.value.forEach((item,i)=>{
if(item.id==e){
console.log(item.id,e)
// console.log(item.id,e)
clickTab(i,materialTypeList.value[i])
}
})
@ -397,18 +407,18 @@
pageSize:10,
pageNo:pageNo.value
}
console.log('getMaterialInfo-obj--->', obj);
// console.log('getMaterialInfo-obj--->', obj);
getSuppliersMaterialInfo(obj).then(res=>{
console.log('2--->',res);
// console.log('2--->',res);
listarr.value.push(...res.result.records)
status.value = (res.result.total == listarr.value.length ? 'nomore' : 'loadmore')
})
}
//
const checkMaterialType = (checkId)=>{
console.log('checkId--->',checkId);
// console.log('checkId--->',checkId);
materialTypeId.value = checkId;
console.log('materialTypeId.value>',materialTypeId.value);
// console.log('materialTypeId.value>',materialTypeId.value);
getMaterialInfo();
}
const flag = ref(false)
@ -480,13 +490,13 @@
}
}
.qit{
width: 540rpx;
width: 466rpx;
display: flex;
justify-content: space-between;
align-items: center;
margin: 20rpx auto;
view{
width: 450rpx;
width: 355rpx;
height: 81rpx;
border-radius: 20rpx;
border: 1px solid #A9B1C0;