diff --git a/src/views/wastematerials/ProcessWasteMaterialsList.vue b/src/views/wastematerials/ProcessWasteMaterialsList.vue index e257e02..6c524f2 100644 --- a/src/views/wastematerials/ProcessWasteMaterialsList.vue +++ b/src/views/wastematerials/ProcessWasteMaterialsList.vue @@ -257,14 +257,11 @@ } let ue= sessionStorage.getItem('USER_INFORMATION'); let res=JSON.parse(ue); - // console.log("res",res); - let role = { userid : res.id, } let isAdmin = false; await getAction(this.url.userRoleUrl,role).then(res =>{ - // console.log("res信息",res) if(res.success){ let item = res.result; item.forEach( re =>{ @@ -328,22 +325,64 @@ } }, - handleDetail(record){ + async handleDetail(record){ // console.log("1111111111111111111111111111111111") - // console.log(record); - this.$router.push({ - // name:'src-views-wastematerials-ProcessWasteMaterialsLists', - // params:{ - // merchandiseNewsId: record.merchandiseNewsId, - // materialStorageId : record.materialStorageId - // } - path:'/materials/wastematerials_detail', - query:{ - merchandiseNewsId: record.merchandiseNewsId, - materialStorageId : record.departId, - merchandiseName : ' - '+record.materialDescription.substring(0,10) - } - }) + // console.log("sdfgadsg",record); + + + this.$router.push({ + path:'/materials/wastematerials_detail', + query:{ + merchandiseNewsId: record.merchandiseNewsId, + materialStorageId : record.materialStorageId, + merchandiseName : ' - '+record.materialDescription.substring(0,10) + } + }) + + // let ue= sessionStorage.getItem('USER_INFORMATION'); + // let res=JSON.parse(ue); + // let role = { + // userid : res.id, + // } + // let is = false; + // await getAction(this.url.userRoleUrl,role).then(res =>{ + // // console.log("res信息",res) + // if(res.success){ + // let item = res.result; + // item.forEach( re =>{ + // if(re.roleName === "管理员" || re.roleName === "超级管理员"){ + // is = true; + // } + // }) + // } + // }) + // + // console.log("is=====",is); + // if(is){ + // this.$router.push({ + // // name:'src-views-wastematerials-ProcessWasteMaterialsLists', + // // params:{ + // // merchandiseNewsId: record.merchandiseNewsId, + // // materialStorageId : record.materialStorageId + // // } + // path:'/materials/wastematerials_detail', + // query:{ + // merchandiseNewsId: record.merchandiseNewsId, + // materialStorageId : record.materialStorageId, + // merchandiseName : ' - '+record.materialDescription.substring(0,10) + // } + // }) + // }else{ + // this.$router.push({ + // path:'/materials/wastematerials_detail', + // query:{ + // merchandiseNewsId: record.merchandiseNewsId, + // materialStorageId : record.materialStorageId, + // merchandiseName : ' - '+record.materialDescription.substring(0,10) + // } + // }) + // } + }, initDictConfig(){ //优先从缓存中读取字典配置 diff --git a/src/views/wastematerials/ProcessWasteMaterialsLists.vue b/src/views/wastematerials/ProcessWasteMaterialsLists.vue index e9bc55f..73de79c 100644 --- a/src/views/wastematerials/ProcessWasteMaterialsLists.vue +++ b/src/views/wastematerials/ProcessWasteMaterialsLists.vue @@ -179,7 +179,7 @@ merchandiseNewsId: this.$route.query.merchandiseNewsId, materialStorageId: this.$route.query.materialStorageId, descriptionId: null, - del_flag: 0 + delFlag: 0 }, createProductTime:[], @@ -321,8 +321,8 @@ watch: { $route() { this.queryParam.merchandiseNewsId = this.$route.query.merchandiseNewsId; - this.queryParam.departId = this.$route.query.materialStorageId; - this.loadData() + this.queryParam.materialStorageId = this.$route.query.materialStorageId; + this.loadData(1) } }, computed: { @@ -341,6 +341,7 @@ this.queryParam.inboundDateBegin=dateString[0]; this.queryParam.inboundDateEnd=dateString[1]; }, + //判断是否传值 judgeRouterParam(){ if (this.$route.query.merchandiseNewsId == null){ this.$router.go(-1); @@ -355,7 +356,9 @@ // } // }); // }, + //重置 searchReset(){ + this.createProductTime = [], this.createInnerTime = [], this.queryParam = { @@ -363,7 +366,41 @@ materialStorageId: this.$route.query.materialStorageId, del_flag: 0 }, - this.loadData(1); + this.ipagination.current = 1; + this.loadData(1); + + // getAction(this.url.list,this.queryParam).then((res)=>{ + // if(res.success){ + // this.dataSource=res.result.records; + // } + // }); + }, + loadData(arg){ + + if(!this.url.list){ + this.$message.error("请设置url.list属性!") + return + } + //加载数据 若传入参数1则加载第一页的内容 + if (arg === 1) { + this.ipagination.current = 1; + } + var params = this.getQueryParams();//查询条件 + this.loading = true; + console.log("params>>>>>>",params) + getAction(this.url.list, params).then((res) => { + if (res.success) { + this.dataSource = res.result.records||res.result; + if(res.result.total) + { + this.ipagination.total = res.result.total; + } + } + if(res.code===510){ + this.$message.warning(res.message) + } + this.loading = false; + }) // getAction(this.url.list,this.queryParam).then((res)=>{ // if(res.success){ @@ -371,13 +408,6 @@ // } // }); }, - // loadData(){ - // getAction(this.url.list,this.queryParam).then((res)=>{ - // if(res.success){ - // this.dataSource=res.result.records; - // } - // }); - // }, getSuperFieldList(){ let fieldList=[]; fieldList.push({type:'string',value:'supplier',text:'供应商',dictCode:''})