Commit 17bd0157 authored by 13841799530's avatar 13841799530

接口联调

parent 9095144c
...@@ -66,8 +66,15 @@ export default { ...@@ -66,8 +66,15 @@ export default {
mounted() {}, mounted() {},
methods: { methods: {
onSubmit(values) { onSubmit(values) {
this.$toast.loading({
message:'登录中...',
forbidClick: true,
loadingType: 'spinner',
duration: 0
})
getFun('check/token',values).then((Response)=>{ getFun('check/token',values).then((Response)=>{
if(Response.code==0){ if(Response.code==0){
this.$toast.clear()
postFun('mobile/user').then((Response2)=>{ postFun('mobile/user').then((Response2)=>{
var userInfo={ var userInfo={
avatar:Response2.data.avatar, avatar:Response2.data.avatar,
...@@ -77,11 +84,6 @@ export default { ...@@ -77,11 +84,6 @@ export default {
/* 存储用户信息 */ /* 存储用户信息 */
setUserInfo(userInfo) setUserInfo(userInfo)
}) })
this.$notify({
message:'登录成功',
background:'green',
duration: 1000
})
setToken(Response.data) setToken(Response.data)
this.$router.push('/message-center') this.$router.push('/message-center')
} }
......
...@@ -52,8 +52,18 @@ export default { ...@@ -52,8 +52,18 @@ export default {
methods: { methods: {
list(){ list(){
this.checkedList=[] this.checkedList=[]
this.$toast.loading({
message:'加载中...',
forbidClick: true,
loadingType: 'spinner',
duration: 0
})
getFun('check/carry/user/list').then((Response)=>{ getFun('check/carry/user/list').then((Response)=>{
this.$toast.clear()
this.checkedList=Response.data this.checkedList=Response.data
}).catch(()=>{
this.$toast.clear()
this.$toast.fail('加载失败,请稍后再试')
}) })
}, },
onSearch(){ onSearch(){
...@@ -62,9 +72,8 @@ export default { ...@@ -62,9 +72,8 @@ export default {
}) })
}, },
cardLocation(item){ cardLocation(item){
console.log(item)
sessionStorage.setItem('id',item.id) sessionStorage.setItem('id',item.id)
this.$router.push('/problem') this.$router.push({name:'problem',params:{id:item.id}})//此id来判断是否加载问题上报新数据
} }
} }
} }
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<div> <div>
<LHeader v-bind:text="text"></LHeader> <LHeader v-bind:text="text"></LHeader>
<van-tabs v-model="active"> <van-tabs v-model="active">
<van-tab title="有限空间类"> <van-tab v-for="(item,index) in tableData" :key="index" :title="item.title">
<table border="1" cellspacing="0"> <table border="1" cellspacing="0">
<thead> <thead>
<tr> <tr>
...@@ -24,27 +24,27 @@ ...@@ -24,27 +24,27 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr v-for="(item,index) in list" :key="index"> <tr v-for="(item2,index2) in item.list" :key="index2">
<td align="center" v-text="index+1" style="width:10%" ></td> <td align="center" v-text="index2+1" style="width:10%" ></td>
<td align="center" v-text="item.checkItem" style="width:15%"></td> <td align="center" v-text="item2.checkItem" style="width:15%"></td>
<td align="center" v-text="item.checkContent" style="width:20%"></td> <td align="center" v-text="item2.checkContent" style="width:20%"></td>
<td align="center" v-text="item.checkBasis" style="width:30%"></td> <td align="center" v-text="item2.checkBasis" style="width:30%"></td>
<td align="center"> <td align="center">
<van-radio-group v-model="item.checkStatus" :disabled="item.isDisabled"> <van-radio-group v-model="item2.checkStatus" :disabled="item2.isDisabled">
<van-radio name="0" >合格</van-radio> <van-radio name="0" >合格</van-radio>
<van-radio name="1" @click="noGrage(item)" >不合格</van-radio> <van-radio name="1" @click="noGrage(item2)" >不合格</van-radio>
</van-radio-group> </van-radio-group>
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</van-tab> </van-tab>
<van-tab title="文明施工类"> <!-- <van-tab title="文明施工类">
</van-tab> </van-tab>
<van-tab title="消防安全类"> <van-tab title="消防安全类">
</van-tab> </van-tab> -->
</van-tabs> </van-tabs>
</div> </div>
</template> </template>
...@@ -58,38 +58,54 @@ export default { ...@@ -58,38 +58,54 @@ export default {
}, },
data() { data() {
return { return {
tableData:[],
id:'',
list:[], list:[],
active:0, active:0,
text:'问题上报表', text:'问题上报表',
} }
}, },
mounted() { mounted() {
if(this.$route.query.id){
this.id=this.$route.query.id
}
this.init() this.init()
}, },
methods: { methods: {
init(){ init(){
this.list=[] this.list=[]
getFun('check/carry/list/problem').then((Response)=>{ this.$toast.loading({
this.list=Response.data message:'加载中...',
forbidClick: true,
loadingType: 'spinner',
duration: 0
})
getFun('check/carry/list/problem',{planId:this.id}).then((Response)=>{
this.tableData=Response.data
this.$toast.clear()
//根据选择的合格状态来填入单选框禁用状态,'1'为禁用,'0'为启用 //根据选择的合格状态来填入单选框禁用状态,'1'为禁用,'0'为启用
this.list.forEach((item)=>{ this.tableData.forEach((item)=>{
if(item.checkStatus=='1'){ item.list.forEach((item2)=>{
item.isDisabled=true if(item2.checkStatus=='1'){
}else if(item.checkStatus=='0'){ item2.isDisabled=true
item.isDisabled=false }else if(item2.checkStatus=='0'){
} item2.isDisabled=false
}
})
}) })
console.log(this.tableData)
}) })
}, },
noGrage(item){ noGrage(item2){
console.log(item2)
//通过禁用状态来判断是否可以跳转 //通过禁用状态来判断是否可以跳转
if(item.isDisabled==false){ if(item2.isDisabled==false){
this.$router.push({ this.$router.push({
name: 'list', name: 'list',
query:{ query:{
checkitem:item.checkItem,//检查项目 checkitem:item2.checkItem,//检查项目
checkContent:item.checkContent,//检查内容 checkContent:item2.checkContent,//检查内容
checkBasis:item.checkBasis,//法律依据 checkBasis:item2.checkBasis,//法律依据
} }
}) })
} }
......
...@@ -19,9 +19,9 @@ ...@@ -19,9 +19,9 @@
<div>检查地点:{{nums.address}}</div> <div>检查地点:{{nums.address}}</div>
</div> </div>
<div class="button-more"> <div class="button-more">
<van-button type="primary" round size="large" @click="problem">检查问题上报{{nums.TroubleNumber}}</van-button> <van-button type="primary" round size="large" @click="problem">检查问题上报{{nums.troubleNumber}}</van-button>
<van-button type="primary" round size="large" @click="formwork">检查清单模板{{nums.addTroubleNumber}}</van-button> <van-button type="primary" round size="large" @click="formwork">检查清单模板{{nums.listNumber}}</van-button>
<van-button type="primary" round size="large" @click="note">检查问题记录{{nums.listNumber}}</van-button> <van-button type="primary" round size="large" @click="note">检查问题记录{{nums.addTroubleNumber}}</van-button>
<van-button type="primary" round size="large" @click="end">结束上报</van-button> <van-button type="primary" round size="large" @click="end">结束上报</van-button>
</div> </div>
</div> </div>
...@@ -37,19 +37,39 @@ export default { ...@@ -37,19 +37,39 @@ export default {
}, },
data() { data() {
return { return {
id:'',
nums:{}, nums:{},
text:'问题上报' text:'问题上报'
} }
}, },
mounted() { mounted() {
this.init() //请求新数据
if(this.$route.params.id){
this.id=sessionStorage.getItem('id')
this.init()
}
//缓存数据
else if(sessionStorage.getItem('id')){
this.id=sessionStorage.getItem('id')
this.nums=JSON.parse(sessionStorage.getItem('nums'))
}
}, },
methods: { methods: {
init(){ init(){
var id=sessionStorage.getItem('id') this.$toast.loading({
message:'加载中...',
forbidClick: true,
loadingType: 'spinner',
duration: 0
})
this.nums=[]; this.nums=[];
getFun('check/carry/count',{planId:id}).then((Response)=>{ getFun('check/carry/count',{planId:this.id}).then((Response)=>{
this.$toast.clear()
this.nums=Response.data this.nums=Response.data
sessionStorage.setItem('nums',JSON.stringify(this.nums))
}).catch(()=>{
this.$toast.clear()
this.$toast.fail('加载失败,请稍后再试')
}) })
}, },
end(){ end(){
...@@ -57,11 +77,17 @@ export default { ...@@ -57,11 +77,17 @@ export default {
title: '提示', title: '提示',
message: '确定结束检查上报?', message: '确定结束检查上报?',
}).then(()=>{ }).then(()=>{
this.$router.push('/checked') postFun('check/carry/trouble/finish',{planId:this.id}).then((Response)=>{
this.$toast.clear()
this.$router.push('/checked')
}).catch(()=>{
this.$toast.clear()
this.$toast.fail('加载失败,请稍后再试')
})
}) })
}, },
problem(){ problem(){
this.$router.push('/list') this.$router.push({name:'list',query:{id:this.id}})
}, },
note(){ note(){
this.$router.push({ this.$router.push({
...@@ -72,7 +98,7 @@ export default { ...@@ -72,7 +98,7 @@ export default {
}) })
}, },
formwork(){ formwork(){
this.$router.push('/formwork') this.$router.push({name:'formwork',query:{id:this.id}})
} }
} }
} }
......
...@@ -102,10 +102,14 @@ export default { ...@@ -102,10 +102,14 @@ export default {
{ text:'平台应用事业前端组',value:3}, { text:'平台应用事业前端组',value:3},
{ text:'项目经理部',value:4}], { text:'项目经理部',value:4}],
text:'检查问题', text:'检查问题',
jumpObj:{} jumpObj:{},
id:'',
} }
}, },
mounted() { mounted() {
if(this.$route.query.id){
this.id=this.$route.query.id
}
if(this.$route.name=='list'&&this.$route.query.checkitem){ if(this.$route.name=='list'&&this.$route.query.checkitem){
this.problemName=this.$route.query.checkitem,//检查项目 this.problemName=this.$route.query.checkitem,//检查项目
this.problemDescribe=this.$route.query.checkContent,//检查内容 this.problemDescribe=this.$route.query.checkContent,//检查内容
...@@ -125,21 +129,33 @@ export default { ...@@ -125,21 +129,33 @@ export default {
onSubmit(value){ onSubmit(value){
console.log(value) console.log(value)
var obj={ var obj={
planId:1, planId:this.id,
title:value['问题名称'],//问题名称 title:value['问题名称'],//问题名称
address:value['问题位置'],//问题位置 address:value['问题位置'],//问题位置
deptId:this.valueId,//责任单位 deptId:this.valueId,//责任单位
context:value['问题描述'],//问题描述 context:value['问题描述'],//问题描述
checkBasis:value['法律依据']//法律依据 checkBasis:value['法律依据']//法律依据
} }
console.log(obj)
this.$dialog.confirm({ this.$dialog.confirm({
title: '提示', title: '提示',
message: '确定提交检查问题?', message: '确定提交检查问题?',
}).then(()=>{ }).then(()=>{
postFun('check/carry/trouble',value).then((Response)=>{ this.$toast.loading({
message:'提交中...',
forbidClick: true,
loadingType: 'spinner',
duration: 0
})
postFun('check/carry/trouble',obj).then((Response)=>{
this.$toast.clear()
this.$toast.success({
message:'提交成功',
duration: 2000
})
history.go(-1) history.go(-1)
}).catch(()=>{
this.$toast.clear()
this.$toast.fail('提交失败,请稍后再试')
}) })
}).catch(()=>{ }).catch(()=>{
......
...@@ -55,13 +55,23 @@ export default { ...@@ -55,13 +55,23 @@ export default {
}, },
methods: { methods: {
init(){ init(){
getFun('check/carry/trouble/list',).then((Response)=>{ this.$toast.loading({
message:'查询中...',
forbidClick: true,
loadingType: 'spinner',
duration: 0
})
getFun('check/carry/trouble/list',{planId:this.id}).then((Response)=>{
this.$toast.clear()
this.list=Response.data this.list=Response.data
this.list.forEach((item)=>{ this.list.forEach((item)=>{
if(item.checkSubmitId){ if(item.checkSubmitId){
this.result.push(parseInt(item.checkSubmitId)) this.result.push(parseInt(item.checkSubmitId))
} }
}) })
}).catch(()=>{
this.$toast.clear()
this.$toast.fail('提交失败,请稍后再试')
}) })
}, },
//全选点击事件---只让全选框的触发全不选事件 //全选点击事件---只让全选框的触发全不选事件
...@@ -110,16 +120,21 @@ export default { ...@@ -110,16 +120,21 @@ export default {
title: '提示', title: '提示',
message: '确定提交检查问题?', message: '确定提交检查问题?',
}).then(()=>{ }).then(()=>{
this.$toast.loading({
message:'提交中...',
forbidClick: true,
loadingType: 'spinner',
duration: 0
})
postFun('check/carry/trouble/submit',obj).then((Response)=>{ postFun('check/carry/trouble/submit',obj).then((Response)=>{
this.$router.push('/correct') this.$router.push('/correct')
this.$toast.clear()
this.$toast.success('提交成功')
}).catch(()=>{
this.$toast.clear()
this.$toast.fail('提交失败,请稍后再试')
}) })
}).catch(()=>{ }).catch(()=>{
// this.$toast.loading({
// message:'加载中...',
// forbidClick: true,
// loadingType: 'spinner',
// duration: 0
// })
this.$toast.success('取消') this.$toast.success('取消')
}) })
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
<div>检查结束时间:{{item.planEndTime}}</div> <div>检查结束时间:{{item.planEndTime}}</div>
<div>检查地点:{{item.address}}</div> <div>检查地点:{{item.address}}</div>
<div>是否完成检查:{{item.finish?'':''}}</div> <div>是否完成检查:{{item.finish?'':''}}</div>
<div>问题数量:{{item.troubleNumber}}</div>
</div> </div>
</div> </div>
</template> </template>
...@@ -44,7 +45,14 @@ export default { ...@@ -44,7 +45,14 @@ export default {
methods: { methods: {
init(){ init(){
this.noticeList=[] this.noticeList=[]
this.$toast.loading({
message:'加载中...',
forbidClick: true,
loadingType: 'spinner',
duration: 0
})
getFun('check/notify/list').then((Response)=>{ getFun('check/notify/list').then((Response)=>{
this.$toast.clear()
this.noticeList=Response.data this.noticeList=Response.data
}) })
}, },
......
...@@ -94,11 +94,22 @@ export default { ...@@ -94,11 +94,22 @@ export default {
this.id=this.$route.query.id this.id=this.$route.query.id
} }
this.init() this.init()
this.problem() // this.$toast.clear()
}, },
methods: { methods: {
async init(){
this.$toast.loading({
message:'加载中...',
forbidClick: true,
loadingType: 'spinner',
duration: 0
})
await this.statusList()
await this.problem()
this.$toast.clear()
},
/* 上报状态列表 */ /* 上报状态列表 */
init(){ statusList(){
this.noticeTableList=[] this.noticeTableList=[]
getFun('check/notify/user/list',{planId:this.id}).then((Response)=>{ getFun('check/notify/user/list',{planId:this.id}).then((Response)=>{
this.noticeTableList=Response.data this.noticeTableList=Response.data
...@@ -109,6 +120,12 @@ export default { ...@@ -109,6 +120,12 @@ export default {
this.noticeQuestionList=[] this.noticeQuestionList=[]
getFun('check/notify/trouble/list',{planId:this.id}).then((Response)=>{ getFun('check/notify/trouble/list',{planId:this.id}).then((Response)=>{
this.noticeQuestionList=Response.data this.noticeQuestionList=Response.data
this.noticeQuestionList=Response.data
this.noticeQuestionList.forEach((item)=>{
if(item.checkSubmitId){
this.result.push(parseInt(item.checkSubmitId))
}
})
}) })
}, },
/* 全选点击事件---只让全选框的触发全不选事件 */ /* 全选点击事件---只让全选框的触发全不选事件 */
...@@ -124,10 +141,10 @@ export default { ...@@ -124,10 +141,10 @@ export default {
} }
} }
}, },
checkedEvent(list){ checkedEvent(){
if(this.result.length==this.list.length){ if(this.result.length==this.noticeQuestionList.length){
this.checkedAll=true this.checkedAll=true
}else if(this.result.length<this.list.length){ }else if(this.result.length<this.noticeQuestionList.length){
this.checkedAll=false this.checkedAll=false
} }
}, },
...@@ -144,10 +161,32 @@ export default { ...@@ -144,10 +161,32 @@ export default {
this.$toast('取消') this.$toast('取消')
}, },
commit(){ commit(){
var checkedList=[]
/* 禁用状态下的(已选过)问题不进行提交,进行清空处理 */
this.result.forEach((it)=>{
this.noticeQuestionList.forEach((item)=>{
if(it==item.id&&!item.checkSubmitId){
checkedList.push(it)
}
})
})
this.$dialog.confirm({ this.$dialog.confirm({
title: '提示', title: '提示',
message: '确定提交检查问题?', message: '确定提交检查问题?',
}).then(()=>{ }).then(()=>{
this.$toast.loading({
message:'提交中...',
forbidClick: true,
loadingType: 'spinner',
duration: 0
})
postFun('check/notify/trouble',{planId:this.id,troubleIds:checkedList,date:this.value}).then((Response)=>{
this.$toast.clear()
this.$toast.success('提交成功')
}).catch(()=>{
this.$toast.clear()
this.$toast.fail('提交失败,请稍后再试')
})
// this.$router.push('/correct') // this.$router.push('/correct')
}) })
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment