|
|
@ -3,9 +3,18 @@ |
|
|
|
<view class="page-wraper"> |
|
|
|
|
|
|
|
<view class="page-header"> |
|
|
|
<view class="" style="margin: 10rpx;"> |
|
|
|
<uni-segmented-control :current="current" :values="items" @clickItem="onClickItem" styleType="button" |
|
|
|
activeColor="#007AFF"></uni-segmented-control> |
|
|
|
<view class="" style="margin-bottom: 8rpx; margin-top: 8rpx; background-color: #fff"> |
|
|
|
<scroll-view scroll-x="true" class="scrollview-box"> |
|
|
|
<block v-for="(item, index) in tabs" :key="index" > |
|
|
|
<view |
|
|
|
:class="tabIndex==index ? 'item_select' : 'item'" |
|
|
|
:data-current="index" @click="ontabtap"> |
|
|
|
<text class="name">{{item}}</text> |
|
|
|
</view> |
|
|
|
</block> |
|
|
|
|
|
|
|
</scroll-view> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
@ -15,8 +24,8 @@ |
|
|
|
<view class="uni-flex uni-row" style="flex-wrap: wrap; margin: 10rpx;"> |
|
|
|
<view class="uni-flex" style=" width: 50%; justify-content: center; margin-top: 40rpx; " |
|
|
|
v-for="(item, index) in showList" :key="index"> |
|
|
|
<uni-tag style="width: 100%; margin-left: 20rpx;" :inverted="!item.checked" :circle="false" :text="item.code+'\n'+item.desc1" type="primary" |
|
|
|
@click="setContainerModel(item)" /> |
|
|
|
<uni-tag style="width: 100%; margin-left: 20rpx;" :inverted="!item.checked" :circle="false" |
|
|
|
:text="item.code+'\n'+item.desc1" type="primary" @click="setContainerModel(item)" /> |
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
@ -41,6 +50,8 @@ |
|
|
|
import { |
|
|
|
injectionIssuePlanRequest, |
|
|
|
getItemCategoryList, |
|
|
|
injectionIssuePlanRequestItemCategoryName, |
|
|
|
injectionIssuePlanRequestItemCategory, |
|
|
|
locations |
|
|
|
} from '@/api/index.js'; |
|
|
|
|
|
|
@ -65,14 +76,14 @@ |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
items: ['保险杠', '轮眉', '车门装饰板'], |
|
|
|
tabs: [], |
|
|
|
current: 0, |
|
|
|
pageSize: this.modelConfig, |
|
|
|
pageIndex: 1, |
|
|
|
loadingType: "nomore", |
|
|
|
dataList: [], |
|
|
|
showList: [], |
|
|
|
toLocationInfo: null |
|
|
|
toLocationInfo: null, |
|
|
|
tabIndex:0 |
|
|
|
}; |
|
|
|
}, |
|
|
|
filters: { |
|
|
@ -83,23 +94,7 @@ |
|
|
|
|
|
|
|
onShow() {}, |
|
|
|
onLoad() { |
|
|
|
uni.showLoading({ |
|
|
|
title:"加载中", |
|
|
|
mask:true |
|
|
|
}) |
|
|
|
getItemCategoryList().then(res => { |
|
|
|
uni.hideLoading() |
|
|
|
this.dataList = res; |
|
|
|
this.dataList.forEach(res => { |
|
|
|
res.checked = true; |
|
|
|
}) |
|
|
|
this.onClickItem({ |
|
|
|
currentIndex: 0 |
|
|
|
}) |
|
|
|
}).catch(error => { |
|
|
|
uni.hideLoading() |
|
|
|
this.showMessage("获取分类信息失败"+error) |
|
|
|
}) |
|
|
|
this.getCategoryListName(); |
|
|
|
}, |
|
|
|
onReachBottom() {}, |
|
|
|
onPullDownRefresh() {}, |
|
|
@ -120,6 +115,41 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
getCategoryListName(){ |
|
|
|
uni.showLoading({ |
|
|
|
title: "加载中", |
|
|
|
mask: true |
|
|
|
}) |
|
|
|
injectionIssuePlanRequestItemCategoryName().then(res => { |
|
|
|
uni.hideLoading() |
|
|
|
if(res.length==0){ |
|
|
|
this.showMessage("获取分类信息失败,请在字典中维护") |
|
|
|
}else { |
|
|
|
this.tabs = res; |
|
|
|
this.getCategoryList(this.tabs[0]) |
|
|
|
} |
|
|
|
this.tabIndex=0 |
|
|
|
|
|
|
|
}).catch(error => { |
|
|
|
uni.hideLoading() |
|
|
|
this.showMessage("获取分类信息失败" + error) |
|
|
|
}) |
|
|
|
}, |
|
|
|
getCategoryList(categoryName){ |
|
|
|
injectionIssuePlanRequestItemCategory(categoryName).then(res => { |
|
|
|
uni.hideLoading() |
|
|
|
if(res.length==0){ |
|
|
|
this.showMessage("获取["+categoryName+"]信息失败,请在字典中维护") |
|
|
|
}else { |
|
|
|
this.showList = res; |
|
|
|
} |
|
|
|
|
|
|
|
}).catch(error => { |
|
|
|
uni.hideLoading() |
|
|
|
this.showMessage("获取["+categoryName+"]信息失败,"+error) |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
clearDefaultLocation() { |
|
|
|
this.toLocationInfo = null |
|
|
|
}, |
|
|
@ -151,18 +181,6 @@ |
|
|
|
item.checked = true; |
|
|
|
this.$forceUpdate() |
|
|
|
}, |
|
|
|
onClickItem(item) { |
|
|
|
if (item.currentIndex == 0) { |
|
|
|
this.showList = this.dataList.filter(res => res.category == "保险杠") |
|
|
|
} else if (item.currentIndex == 1) { |
|
|
|
this.showList = this.dataList.filter(res => res.category == "轮眉") |
|
|
|
} else if (item.currentIndex == 2) { |
|
|
|
this.showList = this.dataList.filter(res => res.category == "车门装饰板") |
|
|
|
} |
|
|
|
this.showList.forEach(res => { |
|
|
|
res.checked = false; |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
//查询发货任务 |
|
|
|
showMessage(message) { |
|
|
@ -172,9 +190,12 @@ |
|
|
|
this.$refs.comMessage.showCommitSuccess(); |
|
|
|
}, |
|
|
|
clearData() { |
|
|
|
this.onClickItem({ |
|
|
|
currentIndex: 0 |
|
|
|
}) |
|
|
|
this.tabs=[] |
|
|
|
this.current=0 |
|
|
|
this.showList= [] |
|
|
|
this.toLocationInfo = null, |
|
|
|
this.tabIndex = 0 |
|
|
|
|
|
|
|
}, |
|
|
|
submit(item) { |
|
|
|
var checked = this.showList.filter(r => r.checked) |
|
|
@ -228,6 +249,7 @@ |
|
|
|
if (res) { |
|
|
|
this.showCommitSuccessMessage(); |
|
|
|
this.clearData(); |
|
|
|
this.getCategoryListName(); |
|
|
|
} else { |
|
|
|
this.showMessage("提交失败"); |
|
|
|
} |
|
|
@ -237,6 +259,58 @@ |
|
|
|
uni.hideLoading(); |
|
|
|
}); |
|
|
|
}, |
|
|
|
ontabtap(e){ |
|
|
|
let index = e.target.dataset.current || e.currentTarget.dataset.current; |
|
|
|
if (this.tabIndex == index) { |
|
|
|
return; |
|
|
|
} |
|
|
|
this.tabIndex = index; |
|
|
|
this.getCategoryList(this.tabs[index]) |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
</script> |
|
|
|
<style> |
|
|
|
.scrollview-box { |
|
|
|
white-space: nowrap; |
|
|
|
/* 滚动必须加的属性 */ |
|
|
|
width: 100%; |
|
|
|
} |
|
|
|
|
|
|
|
.item { |
|
|
|
margin: 10rpx; |
|
|
|
padding: 15rpx; |
|
|
|
display: inline-flex; |
|
|
|
/* item的外层定义成行内元素才可进行滚动 inline-block / inline-flex 均可 */ |
|
|
|
flex-direction: column; |
|
|
|
align-items: center; |
|
|
|
background-color: #fff; |
|
|
|
color: #007AFF; |
|
|
|
border: 1px solid #007AFF; |
|
|
|
border-radius:8rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.item_select { |
|
|
|
margin: 10rpx; |
|
|
|
padding: 15rpx; |
|
|
|
display: inline-flex; |
|
|
|
/* item的外层定义成行内元素才可进行滚动 inline-block / inline-flex 均可 */ |
|
|
|
flex-direction: column; |
|
|
|
align-items: center; |
|
|
|
background-color: #007AFF; |
|
|
|
color: #fff; |
|
|
|
border: 1px solid #007AFF; |
|
|
|
border-radius: 8rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.name { |
|
|
|
font-size: 35rpx; |
|
|
|
/* color: #fff; */ |
|
|
|
padding: 0; |
|
|
|
/* width: 90%; */ |
|
|
|
text-align: center; |
|
|
|
text-overflow: ellipsis; |
|
|
|
white-space: nowrap; |
|
|
|
overflow: hidden; |
|
|
|
} |
|
|
|
</style> |