|
@ -5,9 +5,10 @@
|
|
|
<van-tab title="补货"></van-tab>
|
|
|
<van-tab title="换货"></van-tab>
|
|
|
<van-tab title="上货"></van-tab>
|
|
|
<van-tab title="下架"></van-tab>
|
|
|
</van-tabs>
|
|
|
</van-sticky>
|
|
|
<CustomList
|
|
|
<CustomList
|
|
|
ref="customList"
|
|
|
:searchfun='false'
|
|
|
@onLoad="onLoad">
|
|
@ -50,76 +51,29 @@ export default{
|
|
|
}
|
|
|
},
|
|
|
watch:{
|
|
|
activeName(n){
|
|
|
//'808080eb7d8524f8017d85911adf0001'
|
|
|
medicineAbinetApi.findDeviceById({deviceId: this.list[n].id}).then(res=>{
|
|
|
if(res.status==200){
|
|
|
this.list[n].children = res.obj.inventoryList;
|
|
|
}
|
|
|
})
|
|
|
active(n){
|
|
|
this.$refs.customList.refresh(true);
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
|
|
|
},
|
|
|
methods:{
|
|
|
// onLoad({page, pageSize, searchText}){
|
|
|
// setTimeout(()=>{
|
|
|
// for(var i=0; i<pageSize; i++){
|
|
|
// this.list.push((page-1)*pageSize + i)
|
|
|
// }
|
|
|
// console.log(this.list)
|
|
|
// debugger
|
|
|
// this.$refs.customList.endLoad(page==5, this.list.length)
|
|
|
// }, 1000)
|
|
|
// return
|
|
|
// var that = this,
|
|
|
// params = {
|
|
|
// orgCode: this.$store.getters.orgCode,
|
|
|
// doctorNameKey: searchText,
|
|
|
// dept: this.routerParam.dept,
|
|
|
// diseaseKey: this.routerParam.disease,
|
|
|
// page: page,
|
|
|
// pagesize: pageSize
|
|
|
// };
|
|
|
|
|
|
// zhuanjiazixunApi
|
|
|
// .findDoctorByHospitalAndDiseaseAndDept(params)
|
|
|
// .then(res=>{
|
|
|
// if(res.status == 200){
|
|
|
// var list = res.detailModelList.map(item=>{
|
|
|
// var data = item
|
|
|
// data.photo = this.$root.setDocPhoto(data.photo)
|
|
|
// return data
|
|
|
// })
|
|
|
// this.list = page==1? list : this.list.concat(list)
|
|
|
// this.$refs.customList.endLoad(!res.detailModelList || res.detailModelList.length==0, this.list.length)
|
|
|
// } else {
|
|
|
// this.$refs.customList[this.active].endLoad(false, true)
|
|
|
// }
|
|
|
// }).catch(err=>{
|
|
|
// console.error(err)
|
|
|
// this.$refs.customList[this.active].endLoad(false, true)
|
|
|
// })
|
|
|
// },
|
|
|
onLoad({page, pageSize, searchText}){
|
|
|
var p = {
|
|
|
userId: this.user.id,
|
|
|
page: 1,
|
|
|
size: pageSize
|
|
|
}
|
|
|
console.log('params', p)
|
|
|
medicineAbinetApi.getDeviceListWithUserId(p)
|
|
|
var that = this,
|
|
|
params = {
|
|
|
type: this.active+1,
|
|
|
userId: this.user.id,
|
|
|
page: page,
|
|
|
size: pageSize
|
|
|
};
|
|
|
|
|
|
medicineAbinetApi
|
|
|
.getDeviceInventoryRecordListWithUserId(params)
|
|
|
.then(res=>{
|
|
|
console.log('getDeviceListWithUserId', res)
|
|
|
if(res.status == 200){
|
|
|
res.detailModelList.forEach(el=>{
|
|
|
el.children = []
|
|
|
})
|
|
|
if(res.status == 200){
|
|
|
var list = res.detailModelList
|
|
|
|
|
|
this.list = page==1? list : this.list.concat(list)
|
|
|
debugger
|
|
|
this.$refs.customList.endLoad(res.totalPage<=page, this.list.length)
|
|
|
} else {
|
|
|
this.list = []
|
|
@ -127,10 +81,38 @@ export default{
|
|
|
}
|
|
|
}).catch(err=>{
|
|
|
console.error(err)
|
|
|
this.list = []
|
|
|
this.$refs.customList.endLoad(false, true)
|
|
|
this.$refs.customList[this.active].endLoad(false, true)
|
|
|
})
|
|
|
},
|
|
|
// onLoad({page, pageSize, searchText}){
|
|
|
// var p = {
|
|
|
// userId: this.user.id,
|
|
|
// page: 1,
|
|
|
// size: pageSize
|
|
|
// }
|
|
|
// console.log('params', p)
|
|
|
// medicineAbinetApi.getDeviceListWithUserId(p)
|
|
|
// .then(res=>{
|
|
|
// console.log('getDeviceListWithUserId', res)
|
|
|
// if(res.status == 200){
|
|
|
// res.detailModelList.forEach(el=>{
|
|
|
// el.children = []
|
|
|
// })
|
|
|
// var list = res.detailModelList
|
|
|
|
|
|
// this.list = page==1? list : this.list.concat(list)
|
|
|
// debugger
|
|
|
// this.$refs.customList.endLoad(res.totalPage<=page, this.list.length)
|
|
|
// } else {
|
|
|
// this.list = []
|
|
|
// this.$refs.customList.endLoad(false, true)
|
|
|
// }
|
|
|
// }).catch(err=>{
|
|
|
// console.error(err)
|
|
|
// this.list = []
|
|
|
// this.$refs.customList.endLoad(false, true)
|
|
|
// })
|
|
|
// },
|
|
|
},
|
|
|
}
|
|
|
</script>
|