车辆,司机管理下拉刷新,车辆管理->服务种类预期:支持多选

This commit is contained in:
2023-08-24 13:07:58 +08:00
parent 620944b6e2
commit 3742c2f3a1
3 changed files with 74 additions and 66 deletions

View File

@ -18,6 +18,7 @@
</template> </template>
</van-nav-bar> </van-nav-bar>
</div> </div>
<van-pull-refresh v-model="isLoading" @refresh="onRefresh">
<div class="itemWrap" v-for="(item,index) in driverList" :key="index"> <div class="itemWrap" v-for="(item,index) in driverList" :key="index">
<div class="name-status"> <div class="name-status">
<div class="namephone">{{ item.driverName }} / {{ item.driverPhone }}</div> <div class="namephone">{{ item.driverName }} / {{ item.driverPhone }}</div>
@ -45,6 +46,7 @@
<span :class="item.states?.code == 1 ? 'statusYes' : 'statusNo'">{{ item.states?.label }}</span> <span :class="item.states?.code == 1 ? 'statusYes' : 'statusNo'">{{ item.states?.label }}</span>
</div> </div>
</div> </div>
</van-pull-refresh>
</div> </div>
</template> </template>
@ -64,6 +66,8 @@ export default {
driverList:[], driverList:[],
states:'', states:'',
supplierType:'', supplierType:'',
count: 0,
isLoading: false,
} }
}, },
mounted() { mounted() {
@ -72,8 +76,14 @@ export default {
this.getDriverList() this.getDriverList()
}, },
methods:{ methods:{
onRefresh() {
this.getDriverList()
setTimeout(() => {
this.$toast('刷新成功');
this.isLoading = false;
}, 1000);
},
addDriver(){ addDriver(){
this.$toast(this.supplierType)
if(this.supplierType == 1){ if(this.supplierType == 1){
this.$toast("无权添加") this.$toast("无权添加")
}else{ }else{
@ -108,10 +118,11 @@ export default {
driverId:item.driverId, driverId:item.driverId,
states:this.states states:this.states
}) })
await this.getDriverList(); await this.getDriverList();
setTimeout(()=>{ // setTimeout(()=>{
this.$toast('操作成功') // this.$toast('操作成功')
},2000) // },2000)
console.log("item",res) console.log("item",res)
}, },
updateDriver(item){ updateDriver(item){

View File

@ -62,24 +62,9 @@
<span class="service">{{ item.name }}:</span> <span class="service">{{ item.name }}:</span>
<span class="line"></span> <span class="line"></span>
</div> </div>
<van-radio-group v-model="trailerService" @change="change" class="radioWrap"> <van-checkbox-group v-model="serviceIds" v-for="(item2,index2) in item.children" :key="index2" class="radioWrap" @change="change">
<van-radio :name="item2.name" class="item" v-for="(item2,index2) in item.children" :key="index2"> <van-checkbox class="item" :name="item2.id">{{item2.name }}</van-checkbox>
{{item2.name }} </van-checkbox-group>
<img
slot="icon"
slot-scope="props"
:src="props.checked ? activeIcon : inactiveIcon"
>
</van-radio>
<!-- <van-radio name=" 事故——平板拖车" class="item">-->
<!-- 事故平板拖车-->
<!-- <img-->
<!-- slot="icon"-->
<!-- slot-scope="props"-->
<!-- :src="props.checked ? activeIcon : inactiveIcon"-->
<!-- >-->
<!-- </van-radio>-->
</van-radio-group>
</div> </div>
</div> </div>
<two-common-btn class="btn" @cancelClick="cancelBtn" @submitClick="submitBtn" /> <two-common-btn class="btn" @cancelClick="cancelBtn" @submitClick="submitBtn" />
@ -102,11 +87,13 @@ export default {
isJoin:'',//是否参与 isJoin:'',//是否参与
activeIcon: require('@/assets/check.png'), activeIcon: require('@/assets/check.png'),
inactiveIcon: require('@/assets/uncheck.png'), inactiveIcon: require('@/assets/uncheck.png'),
// result: [],
checked: true,
carNum:"",//车牌号 carNum:"",//车牌号
typeList:[],//车辆类型列表 typeList:[],//车辆类型列表
selectedOption:'1',//车辆类型 selectedOption:'1',//车辆类型
id:'',//车辆Id id:'',//车辆Id
serviceIds:'',//车辆服务种类, serviceIds:[],//车辆服务种类,
supplierServiceList:[] supplierServiceList:[]
} }
}, },
@ -145,8 +132,8 @@ export default {
this.serviceIds=result.serviceIds this.serviceIds=result.serviceIds
}, },
change(e) { change(e) {
this.trailerService=e // this.trailerService=e
console.log(" this.trailerService", this.trailerService) console.log(" this.trailerService",e, this.result)
}, },
change2(e) { change2(e) {
this.smallRepairService=e this.smallRepairService=e

View File

@ -18,6 +18,7 @@
</template> </template>
</van-nav-bar> </van-nav-bar>
</div> </div>
<van-pull-refresh v-model="isLoading" @refresh="onRefresh">
<div class="carItem" v-for="(item,index) in vehicleList" :key="index"> <div class="carItem" v-for="(item,index) in vehicleList" :key="index">
<div class="carCode"> <div class="carCode">
<div class="codeLeft">{{item.plateNumber}} / {{item.vehicleTypeString}}</div> <div class="codeLeft">{{item.plateNumber}} / {{item.vehicleTypeString}}</div>
@ -32,7 +33,8 @@
<span :class="item.hasPolymerization.code == 0 ? 'isYes' :'isNo'">{{item.hasPolymerization.label}}</span> <span :class="item.hasPolymerization.code == 0 ? 'isYes' :'isNo'">{{item.hasPolymerization.label}}</span>
</div> </div>
</div> </div>
<van-dialog v-model="show" title="确定删除吗" show-cancel-button @confirm="handleConfirm"></van-dialog> </van-pull-refresh>
<van-dialog v-model="show" title="确定删除吗" show-cancel-button @confirm="handleConfirm"></van-dialog>
<div v-if="loading">加载中...</div> <div v-if="loading">加载中...</div>
</div> </div>
@ -53,12 +55,20 @@ export default {
pageSize:10, pageSize:10,
total:'', total:'',
loading:false, loading:false,
isLoading: false,
} }
}, },
mounted() { mounted() {
this.getVehicleList(); this.getVehicleList();
}, },
methods:{ methods:{
onRefresh() {
this.getVehicleList()
setTimeout(() => {
this.$toast('刷新成功');
this.isLoading = false;
}, 1000);
},
async getVehicleList(){ async getVehicleList(){
let result = await supplierVehicleList({ let result = await supplierVehicleList({
pageNum:this.pageNum, pageNum:this.pageNum,
@ -85,7 +95,7 @@ export default {
}) })
// if(result.code === 200){ // if(result.code === 200){
this.$toast('删除成功'); this.$toast('删除成功');
this.vehicleList=[] // this.vehicleList=[]
await this.getVehicleList(); await this.getVehicleList();
// } // }
}, },