Commit 75166295 authored by 罗新东's avatar 罗新东

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

parents 713e302e 374e3148
Pipeline #7092 passed with stage
in 19 seconds
......@@ -179,6 +179,24 @@ const routes = [{
},
component: () => import( /* webpackChunkName: "create-order" */ '../views/checked/problem/note'),
},
{
path: '/detail',
name: 'detail',
meta: {
title: '问题详情',
index: 3
},
component: () => import( /* webpackChunkName: "create-order" */ '../views/checked/problem/note/detail'),
},
{
path: '/edit',
name: 'edit',
meta: {
title: '问题编辑',
index: 3
},
component: () => import( /* webpackChunkName: "create-order" */ '../views/checked/problem/note/edit'),
},
{
path: '/formwork',
name: 'formwork',
......
......@@ -26,7 +26,7 @@
<tbody>
<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.typeDictName" style="width:15%"></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">
......
......@@ -19,7 +19,7 @@
<div>检查地点:{{nums.address}}</div>
</div>
<div class="button-more">
<van-button type="primary" round size="large" @click="problem" :disabled="finish=='true'?true:false">临时问题上报{{'('+nums.addTroubleNumber+')'}}</van-button>
<van-button type="primary" round size="large" @click="problem(nums)" :disabled="finish=='true'?true:false">临时问题上报{{'('+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" :disabled="nums.troubleNumber<1?true:false">检查问题记录{{'('+nums.troubleNumber+')'}}</van-button>
<van-button type="info" round size="large" @click="end" :disabled="finish=='true'?true:false">结束上报</van-button>
......@@ -57,8 +57,11 @@ export default {
else if(sessionStorage.getItem('id')){
this.id=sessionStorage.getItem('id')
this.finish=sessionStorage.getItem('finish')
//问题记录提交时候刷新问题记录数量
if(this.$route.query.pageName){
this.init()
}else if(sessionStorage.getItem('noteDelete')){
this.init()
}else{
//当清单模板,问题列表,问题记录不进行提交操作返回该页面调用缓存数据
this.nums=JSON.parse(sessionStorage.getItem('nums'))
......@@ -99,8 +102,13 @@ export default {
})
})
},
problem(){
this.$router.push({name:'list',query:{id:this.id}})
problem(nums){
var obj={
projectFlag:nums.projectFlag,
deptIdList:nums.deptIdList,
deptNameList:nums.deptNameList
}
this.$router.push({name:'list',query:{id:this.id,obj:JSON.stringify(obj)}})
},
note(){
this.$router.push({
......@@ -113,8 +121,8 @@ export default {
},
formwork(){
this.$router.push({name:'formwork',query:{id:this.id,finish:this.finish}})
}
}
},
},
}
</script>
<style lang="less" scoped>
......
......@@ -49,8 +49,9 @@
name="picker"
:value="value"
label="责任单位"
:disabled="Isvalue"
placeholder="请选择部门"
@click="showPicker = true"
@click="!Isvalue?showPicker = true:showPicker = false"
:rules="[{ required: true, message: '请填写问题位置' }]"
/>
<van-popup v-model="showPicker" position="bottom">
......@@ -112,11 +113,16 @@ export default {
planItemId:'',//不合格跳转进本页面所传列id
islay:false,//是否显示法律依据
isFormwork:false,//决定是否从不合格跳转到本页面是否禁用检查名称,内容,法律依据
Isvalue:false,//是否禁用责任单位
}
},
mounted() {
if(this.$route.query.id){
this.id=this.$route.query.id
var obj=JSON.parse(this.$route.query.obj)
this.Isvalue=obj.projectFlag
this.ids=obj.deptIdList
this.value=obj.deptNameList.join('/')
}
if(this.$route.query.name=='formwork'){
// this.problemName=this.$route.query.checkitem,//检查项目
......@@ -156,6 +162,7 @@ export default {
},
/* 问题提交 */
onSubmit(value){
console.log(value)
var pictures=[];
value.uploader.forEach((item) => {
pictures.push(item.content)
......
<!--
* 严肃声明:
* 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
* 本系统已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
* 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
* Copyright (c) 2020 陈尼克 all rights reserved.
* 版权所有,侵权必究!
*
-->
<template>
<div>
<LHeader v-bind:text="text"></LHeader>
<div class="card">
<div>问题位置:{{list.address}}</div>
<div>责任单位:{{list.deptId}}</div>
<div>问题描述:{{list.context}}</div>
<div>法律依据:{{list.checkBasis}}</div>
<div>图片展示:<van-uploader multiple :deletable="false" :show-upload="false" v-model="list.pictures" /></div>
<div>视频展示:<van-uploader multiple :deletable="false" :show-upload="false" :disabled="true" v-model="list.videos" /></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: 'detail',
components: {
"LHeader":LHeader,
"tabBar":tabBar
},
data() {
return {
text:'问题详情',//顶部文本
list:{},//详情列表
id:'',//详情列表id
}
},
mounted() {
this.id=this.$route.query.id
this.init()
},
methods: {
/* 获取详情列表 */
init(){
this.list={}
getFun('check/carry/trouble/'+this.id).then((Response)=>{
this.list=Response.data
})
}
}
}
</script>
<style lang="less" scoped>
.card{
width:90%;
box-shadow: 0px 0px 10px 2px #F3F3F3;
padding: 0.25rem;
margin:0.4rem auto;
background: white;
border-radius: 4%;
}
.card div{
font-size: 0.4rem;
line-height: 0.8rem;
}
</style>
<!--
* 严肃声明:
* 开源版本请务必保留此注释头信息,若删除我方将保留所有法律责任追究!
* 本系统已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!
* 可正常分享和学习源码,不得用于违法犯罪活动,违者必究!
* Copyright (c) 2020 陈尼克 all rights reserved.
* 版权所有,侵权必究!
*
-->
<template>
<div>
<LHeader v-bind:text="text"></LHeader>
<van-form @submit="onSubmit" @failed="onFailed">
<!-- <van-field
v-model="problemName"
name="问题名称"
label="问题名称"
placeholder="问题名称"
:rules="[{ required: true, message: '请填写问题名称' }]"
/> -->
<van-field
v-model="problemDescribe"
name="问题描述"
label="问题描述"
placeholder="问题描述"
:rules="[{ required: true, message: '请填写问题描述' }]"
:disabled="isFormwork"
/>
<van-field
v-if="islay"
v-model="checkBasis"
name="法律依据"
label="法律依据"
placeholder="法律依据"
:disabled="isFormwork"
:rules="[{ required: true, message: '请填写法律依据' }]"
/>
<van-field
v-model="problemPosition"
name="问题位置"
label="问题位置"
placeholder="问题位置"
:rules="[{ required: true, message: '请填写问题位置' }]"
/>
<van-field
readonly
clickable
name="picker"
:value="value"
label="责任单位"
:disabled="Isvalue"
placeholder="请选择部门"
@click="!Isvalue?showPicker = true:showPicker = false"
:rules="[{ required: true, message: '请填写问题位置' }]"
/>
<van-popup v-model="showPicker" position="bottom">
<van-picker ref="apicker"
show-toolbar
:columns="columns"
@confirm="onConfirm"
@cancel="showPicker = false"
@change="checkScroll"
/>
<!-- <van-area title="标题" :area-list="areaList" @confirm="onConfirm" /> -->
</van-popup>
<van-field name="uploader" label="图像上传" :rules="[{ required: true, message: '请上传图像' }]">
<template #input>
<van-uploader multiple :max-count="5" upload-text="最多上传五个" v-model="uploaderImg" />
</template>
</van-field>
<van-field name="uploader2" label="视频上传" :rules="[{ required: true, message: '请上传视频' }]">
<template #input>
<van-uploader multiple :max-count="5" upload-text="最多上传五个" v-model="uploaderVideo" />
</template>
</van-field>
<div style="margin: 0.5rem">
<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,
"tabBar":tabBar
},
data() {
return {
/* form表单 */
// problemName:'',//问题名称
problemPosition:'',//问题位置
value:'',//责任单位
valueId:0,//责任单位id
problemDescribe:'',//问题描述
uploaderImg:[],//图像上传
uploaderVideo:[],//视频上传
checkBasis:'',//法律依据
showPicker:false,//默认是否展示弹出层
columns: [],//下拉数组
text:'问题编辑',//顶部文本
jumpObj:{},//跳转对象
id:'',//检查执行id
ids:[],//下拉框选中值数组id
planId:'',//不合格跳转进本页面所传列表id
planItemId:'',//不合格跳转进本页面所传列id
islay:false,//是否显示法律依据
isFormwork:false,//决定是否从不合格跳转到本页面是否禁用检查名称,内容,法律依据
Isvalue:false,//是否禁用责任单位
}
},
mounted() {
if(this.$route.query.id){
this.id=this.$route.query.id
var obj=JSON.parse(this.$route.query.obj)
this.Isvalue=obj.projectFlag
this.ids=obj.deptIdList
this.value=obj.deptNameList.join('/')
}
if(this.$route.query.name=='formwork'){
// this.problemName=this.$route.query.checkitem,//检查项目
this.problemDescribe=this.$route.query.checkContent,//检查内容
this.checkBasis=this.$route.query.checkBasis//法规依据
this.isFormwork=true
this.planId=this.$route.query.planId
this.planItemId=this.$route.query.planItemId,
this.islay=true
}
this.init()
},
methods: {
/* 获取下拉树级联列表 */
init(){
getFun('check/dept/tree').then((Response)=>{
this.columns=Response.data
})
},
/* 下拉框文本溢出动画效果 */
checkScroll () {
this.$nextTick(() => {
// 获取选中元素
let selectedItems = [...document.querySelectorAll('.van-picker-column__item--selected')]
selectedItems.forEach(item => {
let child = item.querySelector('.van-ellipsis')
if (child.offsetWidth > item.offsetWidth) { // 判断child文字宽度
item.classList.add('scroll')
} else {
item.classList.remove('scroll')
}
})
})
},
onFailed(errorInfo){
this.$toast.fail('提交失败,请完善信息')
},
/* 问题提交 */
onSubmit(value){
console.log(value)
var pictures=[];
value.uploader.forEach((item) => {
pictures.push(item.content)
});
var videos=[];
value.uploader2.forEach((item) => {
videos.push(item.content)
});
var obj={
planId:this.planId?this.planId:this.id,
planItemId:this.planItemId?this.planItemId:'',
pictures:pictures,
videos:videos,
title:value['问题名称'],//问题名称
address:value['问题位置'],//问题位置
deptIds:this.ids,//责任单位
context:value['问题描述'],//问题描述
checkBasis:value['法律依据']//法律依据
}
console.log(obj)
this.$dialog.confirm({
title: '提示',
message: '确定提交检查问题?',
}).then(()=>{
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
})
this.$router.push({
name:'problem',
query:{
pageName:'problemList'
}
})
}).catch(()=>{
this.$toast.clear()
this.$toast.fail('提交失败,请稍后再试')
})
}).catch(()=>{
})
},
/* 确认选择级联菜单的回显数据处理 */
onConfirm(){
//获取回显的部门值和部门id数组
this.value=""
this.ids=[]
var valueList=this.$refs.apicker.getValues()
valueList.forEach((item)=>{
console.log(item)
this.ids.push(item.id)
this.value+=item.text+' / '
})
this.showPicker = false;
}
}
}
</script>
<style lang="less" scoped>
.card{
width:90%;
box-shadow: 0px 0px 10px 2px #F3F3F3;
padding: 0.25rem;
margin:0.4rem auto;
background: white;
}
.card div{
font-size: 0.4rem;
}
/deep/ .van-picker-column__item--selected {
/* 重写选中后的效果 */
.van-ellipsis {
text-overflow: unset;
overflow: visible;
}
/* 增加scroll类 */
&.scroll > .van-ellipsis {
animation: move 4s linear infinite;
}
}
@keyframes move {
0% { transform: translateX(100%); }
100% { transform: translateX(-100%); }
}
</style>
......@@ -13,11 +13,18 @@
<LHeader v-bind:text="text"></LHeader>
<van-checkbox-group v-model="result" @change="checkedEvent" ref="checkboxGroup">
<div class="card" v-for="(item,index) in list" :key="index" >
<van-overlay @click.stop="close(item)" :show="item.show" >
<van-button round type="primary" @click.stop="detail(index,item)">详情</van-button>
<van-button round type="info" @click.stop="update(index,item)">修改</van-button>
<van-button round type="warning " @click.stop="Delete(item)">删除</van-button>
</van-overlay>
<van-checkbox :name="item.id" :disabled="finish=='true'?true:item.checkSubmitId?true:false">问题{{index+1}}</van-checkbox>
<div>问题名称:{{item.title}}</div>
<div>问题位置:{{item.address}}</div>
<div>问题内容:{{item.context}}</div>
<div>发现时间:{{item.checkTime}}</div>
<div @click="cardClick(item)">
<div>问题名称:{{item.title}}</div>
<div>问题位置:{{item.address}}</div>
<div>问题内容:{{item.context}}</div>
<div>发现时间:{{item.checkTime}}</div>
</div>
</div>
</van-checkbox-group>
<div class="page-footer">
......@@ -71,6 +78,7 @@ export default {
this.$toast.clear()
this.list=Response.data
this.list.forEach((item)=>{
item.show=false
if(item.checkSubmitId){
this.result.push(parseInt(item.checkSubmitId))
}
......@@ -148,18 +156,80 @@ export default {
}).catch(()=>{
this.$toast.success('取消')
})
}
},
//卡片单击事件
cardClick(item){
item.show=true
this.$forceUpdate()//强制刷新
},
//关闭遮罩层事件
close(item){
item.show=false
this.$forceUpdate()//强制刷新
},
//修改卡片值
update(index,item){
item.show=false
this.$forceUpdate()//强制刷新
this.$router.push('/edit')
},
//列表详情
detail(index,item){
item.show=false
this.$forceUpdate()//强制刷新
this.$router.push({name:'detail',query:{id:item.id}})
},
//卡片删除
Delete(item){
item.show=false
this.$forceUpdate()//强制刷新
this.$dialog.confirm({
title: '提示',
message: '确定删除该记录?',
}).then(()=>{
this.$toast.loading({
message:'删除中...',
forbidClick: true,
loadingType: 'spinner',
duration: 0
})
postFun('check/carry/trouble/delete/'+item.id).then((Response)=>{
this.$toast.clear()
this.$toast.success('删除成功')
this.init()
sessionStorage.setItem('noteDelete',true)
}).catch(()=>{
this.$toast.clear()
this.$toast.fail('删除失败,请稍后再试')
})
this.$toast.clear()
}).catch(()=>{
this.$toast.success('取消删除')
})
},
}
}
</script>
<style lang="less" scoped>
.card{
width:90%;
position: relative;
box-shadow: 0px 0px 10px 2px #F3F3F3;
padding: 0.25rem;
margin:0.4rem auto;
background: white;
border-radius: 4%;
.van-overlay {
display:flex;
justify-content: space-evenly;
align-items: center;
.van-button{
width: 20%;
margin-top: 0;
}
text-align: center;
position: absolute;
}
}
.card div{
font-size: 0.4rem;
......
......@@ -169,7 +169,7 @@ export default {
this.init()
}
//判断是否从电子签名跳转过来-获取图片是否显示的布尔值
if(this.$route.name=='noticeList'){
if(this.$route.query.name=='noticeList'){
if(this.$route.query.img==true){
this.istext=false
this.isImg=true
......@@ -317,14 +317,14 @@ export default {
sign(){
//点击电子签名,保存用户选择的日期和复选框回显值
if(this.finish=='false'){
this.$router.push({name:'sign',query:{img:true}})
this.$router.push({name:'sign',query:{name:'sign',img:true}})
}
},
//电子签名2
sign2(){
//点击电子签名,保存用户选择的日期和复选框回显值
if(this.finish=='false'){
this.$router.push({name:'sign',query:{img2:true}})
this.$router.push({name:'sign',query:{name:'sign',img2:true}})
}
},
//提交问题记录
......@@ -392,7 +392,7 @@ export default {
detail(){
},
//卡片提交
//卡片删除
Delete(item){
item.show=false
this.$forceUpdate()//强制刷新
......
......@@ -38,7 +38,7 @@ export default {
};
},
mounted(){
if(this.$route.name=='sign'){
if(this.$route.query.name=='sign'){
this.img=this.$route.query.img
this.img2=this.$route.query.img2
}
......@@ -55,7 +55,7 @@ export default {
this.resultImg = res //把base64赋给img
//生成图片后存储到session中并跳转把图片是否显示的boolean带过去
console.log(this.value)
this.$router.push({name:'noticeList',query:{img:this.img,img2:this.img2}})
this.$router.push({name:'noticeList',query:{name:'sign',img:this.img,img2:this.img2}})
//判断是检查组签字还是项目经理签字
if(this.img){
sessionStorage.setItem('resultImg',this.resultImg)
......
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