Commit daae1bdb authored by 13841799530's avatar 13841799530

项目组长签名 缓存回显

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