Commit daae1bdb authored by 13841799530's avatar 13841799530

项目组长签名 缓存回显

解润东
2021110202
parent c51fba4a
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
data () { data () {
return { return {
transitionName: 'slide-left', transitionName: 'slide-left',
cachePage:["add-danger","change-info","affirm-danger","risk-affirm","manager-survey","super-survey","major-survey"] cachePage:["add-danger","change-info","affirm-danger","risk-affirm","manager-survey","super-survey","major-survey","notice"]
} }
}, },
watch: { watch: {
......
...@@ -46,15 +46,18 @@ ...@@ -46,15 +46,18 @@
</van-tab> --> </van-tab> -->
</van-tabs> </van-tabs>
<tab-bar :index="1"></tab-bar>
</div> </div>
</template> </template>
<script> <script>
import tabBar from "@/components/TabBar";
import LHeader from '@/components/header.vue' import LHeader from '@/components/header.vue'
import { getFun,postFun } from '@/service/table' import { getFun,postFun } from '@/service/table'
export default { export default {
name: 'formwork', name: 'formwork',
components: { components: {
"LHeader":LHeader "LHeader":LHeader,
"tabBar":tabBar
}, },
data() { data() {
return { return {
......
...@@ -24,16 +24,19 @@ ...@@ -24,16 +24,19 @@
<van-button type="primary" round size="large" @click="note" :disabled="nums.troubleNumber<1?true:false">检查问题记录{{'('+nums.troubleNumber+')'}}</van-button> <van-button type="primary" round size="large" @click="note" :disabled="nums.troubleNumber<1?true:false">检查问题记录{{'('+nums.troubleNumber+')'}}</van-button>
<van-button type="primary" round size="large" @click="end" :disabled="finish=='true'?true:false">结束上报</van-button> <van-button type="primary" round size="large" @click="end" :disabled="finish=='true'?true:false">结束上报</van-button>
</div> </div>
<tab-bar :index="1"></tab-bar>
</div> </div>
</template> </template>
<script> <script>
import tabBar from "@/components/TabBar";
import LHeader from '@/components/header.vue' import LHeader from '@/components/header.vue'
import { getFun,postFun } from '@/service/table' import { getFun,postFun } from '@/service/table'
export default { export default {
name: 'problem', name: 'problem',
components: { components: {
"LHeader":LHeader "LHeader":LHeader,
"tabBar":tabBar
}, },
data() { data() {
return { return {
......
...@@ -74,16 +74,19 @@ ...@@ -74,16 +74,19 @@
<van-button round block type="info" native-type="submit">提交</van-button> <van-button round block type="info" native-type="submit">提交</van-button>
</div> </div>
</van-form> </van-form>
<tab-bar :index="1"></tab-bar>
</div> </div>
</template> </template>
<script> <script>
import tabBar from "@/components/TabBar";
import LHeader from '@/components/header.vue' import LHeader from '@/components/header.vue'
import { getFun,postFun } from '@/service/table' import { getFun,postFun } from '@/service/table'
export default { export default {
name: 'list', name: 'list',
components: { components: {
"LHeader":LHeader "LHeader":LHeader,
"tabBar":tabBar
}, },
data() { data() {
return { return {
......
...@@ -25,17 +25,20 @@ ...@@ -25,17 +25,20 @@
<van-button round type="defult" @click="cancel" :disabled="finish=='true'?true:false">取消</van-button> <van-button round type="defult" @click="cancel" :disabled="finish=='true'?true:false">取消</van-button>
<van-button round type="info" @click="commit" :disabled="finish=='true'?true:false">提交</van-button> <van-button round type="info" @click="commit" :disabled="finish=='true'?true:false">提交</van-button>
</div> </div>
<tab-bar :index="1"></tab-bar>
</div> </div>
</template> </template>
<script> <script>
import tabBar from "@/components/TabBar";
import LHeader from '@/components/header.vue' import LHeader from '@/components/header.vue'
import { ContactList } from 'vant'; import { ContactList } from 'vant';
import { getFun,postFun } from '@/service/table' import { getFun,postFun } from '@/service/table'
export default { export default {
name: 'note', name: 'note',
components: { components: {
"LHeader":LHeader "LHeader":LHeader,
"tabBar":tabBar
}, },
data() { data() {
return { return {
......
...@@ -21,16 +21,19 @@ ...@@ -21,16 +21,19 @@
<div>是否完成检查:{{item.finish?'':''}}</div> <div>是否完成检查:{{item.finish?'':''}}</div>
<div>问题数量:{{item.troubleNumber}}</div> <div>问题数量:{{item.troubleNumber}}</div>
</div> </div>
<tab-bar :index="1"></tab-bar>
</div> </div>
</template> </template>
<script> <script>
import tabBar from "@/components/TabBar";
import LHeader from '@/components/header.vue' import LHeader from '@/components/header.vue'
import { getFun,postFun } from '@/service/table' import { getFun,postFun } from '@/service/table'
export default { export default {
name: 'notice', name: 'notice',
components: { components: {
"LHeader":LHeader "LHeader":LHeader,
"tabBar":tabBar
}, },
data() { data() {
return { return {
...@@ -61,7 +64,8 @@ export default { ...@@ -61,7 +64,8 @@ export default {
sessionStorage.setItem('id',item.id) sessionStorage.setItem('id',item.id)
this.$router.push({ this.$router.push({
name:'noticeList', name:'noticeList',
query:{ params:{
name:'notice',
id:item.id id:item.id
} }
}) })
......
...@@ -58,28 +58,35 @@ ...@@ -58,28 +58,35 @@
/> />
<van-calendar v-model="showCalendar" @confirm="onConfirm" /> <van-calendar v-model="showCalendar" @confirm="onConfirm" />
<div class="sign"><span>检查组负责人签字确认:</span><van-tag color="#ffe1e1" :disabled="finish=='true'?true:false"><p v-show="istext" @click="sign" >电子签字</p><img class="sign-img" v-show="isImg" :src="resultImg" alt=""></van-tag></div> <div class="sign"><span>检查组负责人签字确认:</span><van-tag color="#ffe1e1" :disabled="finish=='true'?true:false"><p v-show="istext" @click="sign" >电子签字</p><img class="sign-img" v-show="isImg" :src="resultImg" alt=""></van-tag></div>
<div class="sign2"><span>项目经理签字确认:</span><van-tag color="#ffe1e1" :disabled="finish=='true'?true:false"><p v-show="istext2" @click="sign2" >电子签字</p><img class="sign-img2" v-show="isImg2" :src="resultImg2" alt=""></van-tag></div>
<div class="page-footer-button"> <div class="page-footer-button">
<van-button round type="info" size="large" @click="commit" :disabled="finish=='true'?true:status==true?true:false">生成整改通知单</van-button> <van-button round type="info" size="large" @click="commit" :disabled="finish=='true'?true:isFinish==true?true:false">生成整改通知单</van-button>
<van-button round type="defult" size="large" @click="cancel" :disabled="finish=='true'?true:false">取消</van-button> <van-button round type="defult" size="large" @click="cancel" :disabled="finish=='true'?true:false">取消</van-button>
</div> </div>
</van-tab> </van-tab>
</van-tabs> </van-tabs>
<tab-bar :index="1"></tab-bar>
</div> </div>
</template> </template>
<script> <script>
import tabBar from "@/components/TabBar";
import LHeader from '@/components/header.vue' import LHeader from '@/components/header.vue'
import { getFun,postFun } from '@/service/table' import { getFun,postFun } from '@/service/table'
export default { export default {
name: 'notice', name: 'notice',
components: { components: {
"LHeader":LHeader "LHeader":LHeader,
"tabBar":tabBar
}, },
data() { data() {
return { return {
istext:true,//是否显示文字 istext:true,//是否显示文字
isImg:false,//是否显示图片 isImg:false,//是否显示图片
istext2:true,//是否显示文字2
isImg2:false,//是否显示图片2
resultImg:'',//电子签名图片 resultImg:'',//电子签名图片
resultImg2:'',//电子签名图片2
noticeQuestionList:[],//整改通知问题记录列表 noticeQuestionList:[],//整改通知问题记录列表
active: 0,//tab选中状态 active: 0,//tab选中状态
checkedAll:false,//全选状态 checkedAll:false,//全选状态
...@@ -90,13 +97,25 @@ export default { ...@@ -90,13 +97,25 @@ export default {
id:'',//整改通知id id:'',//整改通知id
showCalendar: false,//弹出层状态 showCalendar: false,//弹出层状态
finish:'',//检查状态 finish:'',//检查状态
status:false,//提交状态 isFinish:false,//提交状态
} }
}, },
watch:{ watch:{
}, },
mounted() { activated(){
//判断是否由整改通知管理跳转进来--执行问题记录的缓存方法
if(this.$route.params.name=='notice'){
//清空表单
this.value=""
this.checkedAll=false
this.result=[];
this.resultImg=""
this.resultImg2=""
this.isImg=false;
this.istext=true
this.isImg2=false;
this.istext2=true
//获取检查id //获取检查id
if(sessionStorage.getItem('id')){ if(sessionStorage.getItem('id')){
this.id=sessionStorage.getItem('id') this.id=sessionStorage.getItem('id')
...@@ -106,21 +125,38 @@ export default { ...@@ -106,21 +125,38 @@ export default {
this.finish=sessionStorage.getItem('finish') this.finish=sessionStorage.getItem('finish')
} }
this.init() this.init()
//从session中获取签名生成的图片
if(sessionStorage.getItem('resultImg')){
this.resultImg=sessionStorage.getItem('resultImg')
} }
//获取图片是否显示的布尔值 //判断是否从电子签名跳转过来-获取图片是否显示的布尔值
if(this.$route.query.isImg){ if(this.$route.name=='noticeList'){
console.log(this.$route.query) if(this.$route.query.img==true){
this.istext=false this.istext=false
this.isImg=true this.isImg=true
//从session中获取签名生成的图片1
if(sessionStorage.getItem('resultImg')){
this.resultImg=sessionStorage.getItem('resultImg')
}
}else if(this.$route.query.img2==true){
//从session中获取签名生成的图片2
if(sessionStorage.getItem('resultImg2')){
this.resultImg2=sessionStorage.getItem('resultImg2')
}
this.istext2=false
this.isImg2=true
}
this.active=1 this.active=1
this.value=this.$route.query.value
this.checkedAll=this.$route.query.checkedAll
this.result=this.$route.query.result
} }
}, },
mounted() {
//获取检查id
if(sessionStorage.getItem('id')){
this.id=sessionStorage.getItem('id')
}
//获取检查状态
if(sessionStorage.getItem('finish')){
this.finish=sessionStorage.getItem('finish')
}
this.init()
},
methods: { methods: {
/* 同步请求上报状态列表问题记录列表 */ /* 同步请求上报状态列表问题记录列表 */
async init(){ async init(){
...@@ -145,21 +181,40 @@ export default { ...@@ -145,21 +181,40 @@ export default {
problem(){ problem(){
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.isFinish=Response.data.isFinish
this.noticeQuestionList=Response.data.list this.noticeQuestionList=Response.data.list
/* ----详情---- */
if(this.isFinish){
//获取选中状态数组
this.noticeQuestionList.forEach((item)=>{
if(item.checkSubmitId){
this.result.push(parseInt(item.checkSubmitId))
}
})
//日期数据回显
if(Response.data.finishTime){
this.value=Response.data.finishTime this.value=Response.data.finishTime
}
//电子签名数据回显
if(Response.data.leaderSign){
this.resultImg=Response.data.leaderSign this.resultImg=Response.data.leaderSign
}
//电子签名数据2回显
if(Response.data.managerSign){
this.resultImg2=Response.data.managerSign
}
//判断是否有签名
if(this.resultImg){ if(this.resultImg){
console.log(this.resultImg)
this.istext=false this.istext=false
this.isImg=true this.isImg=true
} }
this.status=Response.data.status //判断是否有签名
console.log(this.status) if(this.resultImg2){
this.noticeQuestionList.forEach((item)=>{ this.istext2=false
if(item.checkSubmitId){ this.isImg2=true
this.result.push(parseInt(item.checkSubmitId)) }
} }
})
}) })
}, },
/* 全选点击事件---只让全选框的触发全不选事件 */ /* 全选点击事件---只让全选框的触发全不选事件 */
...@@ -213,11 +268,18 @@ export default { ...@@ -213,11 +268,18 @@ export default {
} }
} }
}, },
//电子签名 //电子签名1
sign(){ sign(){
//点击电子签名,保存用户选择的日期和复选框回显值 //点击电子签名,保存用户选择的日期和复选框回显值
if(this.finish=='false'){ if(this.finish=='false'){
this.$router.push({name:'sign',query:{value:this.value,result:this.result,checkedAll:this.checkedAll}}) this.$router.push({name:'sign',query:{img:true}})
}
},
//电子签名2
sign2(){
//点击电子签名,保存用户选择的日期和复选框回显值
if(this.finish=='false'){
this.$router.push({name:'sign',query:{img2:true}})
} }
}, },
//提交问题记录 //提交问题记录
...@@ -235,7 +297,8 @@ export default { ...@@ -235,7 +297,8 @@ export default {
planId:this.id, planId:this.id,
troubleIds:checkedList, troubleIds:checkedList,
finishTime:this.value, finishTime:this.value,
leaderSign:this.resultImg leaderSign:this.resultImg,
managerSign:this.resultImg2
} }
this.$dialog.confirm({ this.$dialog.confirm({
title: '提示', title: '提示',
...@@ -250,6 +313,7 @@ export default { ...@@ -250,6 +313,7 @@ export default {
postFun('check/notify/trouble',obj).then((Response)=>{ postFun('check/notify/trouble',obj).then((Response)=>{
this.$toast.clear() this.$toast.clear()
this.$toast.success('提交成功') this.$toast.success('提交成功')
this.init()
this.$router.push('/notice') this.$router.push('/notice')
}).catch(()=>{ }).catch(()=>{
this.$toast.clear() this.$toast.clear()
...@@ -295,10 +359,19 @@ export default { ...@@ -295,10 +359,19 @@ export default {
margin-left:0.4rem ; margin-left:0.4rem ;
font-size: 0.37333rem; font-size: 0.37333rem;
} }
.sign2{
width: 90%;
height: 2rem;
display: flex;
align-items: center;
margin-top: 0.1rem;
margin-left:0.4rem ;
font-size: 0.37333rem;
}
.van-tag{ .van-tag{
color: #323233 color: #323233
} }
.sign-img{ .sign-img,.sign-img2{
width: 2rem; width: 2rem;
height: 1rem; height: 1rem;
} }
......
...@@ -9,16 +9,18 @@ ...@@ -9,16 +9,18 @@
<van-button round type="primary" size="large" @click="handleReset">清空画板</van-button> <van-button round type="primary" size="large" @click="handleReset">清空画板</van-button>
<van-button round type="info" size="large" @click="handleGenerate">生成图片</van-button> <van-button round type="info" size="large" @click="handleGenerate">生成图片</van-button>
</div> </div>
<tab-bar :index="1"></tab-bar>
</div> </div>
</template> </template>
<script> <script>
import tabBar from "@/components/TabBar";
import LHeader from '@/components/header.vue' import LHeader from '@/components/header.vue'
export default { export default {
name: 'sign', name: 'sign',
components: { components: {
"LHeader":LHeader "LHeader":LHeader,
"tabBar":tabBar
}, },
data() { data() {
return { return {
...@@ -30,14 +32,15 @@ export default { ...@@ -30,14 +32,15 @@ export default {
isCrop: false, isCrop: false,
value:'', value:'',
result:[], result:[],
checkedAll:'' checkedAll:'',
img:'',
img2:''
}; };
}, },
mounted(){ mounted(){
if(this.$route.name=='sign'){ if(this.$route.name=='sign'){
this.value=this.$route.query.value this.img=this.$route.query.img
this.result=this.$route.query.result this.img2=this.$route.query.img2
this.checkedAll=this.$route.query.checkedAll
} }
}, },
methods: { methods: {
...@@ -52,8 +55,13 @@ export default { ...@@ -52,8 +55,13 @@ export default {
this.resultImg = res //把base64赋给img this.resultImg = res //把base64赋给img
//生成图片后存储到session中并跳转把图片是否显示的boolean带过去 //生成图片后存储到session中并跳转把图片是否显示的boolean带过去
console.log(this.value) console.log(this.value)
this.$router.push({name:'noticeList',query:{isImg:true,value:this.value,result:this.result,checkedAll:this.checkedAll}}) this.$router.push({name:'noticeList',query:{img:this.img,img2:this.img2}})
//判断是检查组签字还是项目经理签字
if(this.img){
sessionStorage.setItem('resultImg',this.resultImg) sessionStorage.setItem('resultImg',this.resultImg)
}else if(this.img2){
sessionStorage.setItem('resultImg2',this.resultImg)
}
}).catch(err => { }).catch(err => {
// 画布没有签字时会执行这里 // 画布没有签字时会执行这里
this.$dialog.alert({ this.$dialog.alert({
......
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