Commit 4fe88fcb authored by 王李辉's avatar 王李辉

Merge branch 'develop' of http://git.censoft.com.cn/BCDH-HSE/bcdh-app into develop

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