Files
foton-laws-system-front/src/pages/regulatoryRepository/standardForComments/pags/consultationDetails.vue
T
2022-01-28 17:22:56 +08:00

749 lines
25 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!--征求意见详情-->
<template>
<div class="consultationDetails">
<div class="contentTitle">
<div class="back" title="返回" @click="back">
<i class="el-icon-back"></i>
</div>
<div class="title">征求意见详情<i class="el-icon-s-order" @click="heightShow = !heightShow"></i></div>
</div>
<transition name="el-zoom-in-top">
<div v-show="heightShow" class="transition-box">
<p class="transition-box-p">
<label class="transition-box-label">标准名称:</label>
<span class="transition-box-span table-jump"
@click="handlePreview(itemData)"
>
{{ this.lawsStand.cid }}
</span>
</p>
<!-- <p class="transition-box-p">-->
<!-- <label class="transition-box-label">标准名称:</label>-->
<!-- <span class="transition-box-span table-jump"-->
<!-- @click="handlePreview(itemData)"-->
<!-- >-->
<!-- {{ this.lawsStand.cname || '-' }}-->
<!-- </span>-->
<!-- </p>-->
<div class="transition-box-p">
<label class="transition-box-label">附件:</label>
<div class="file-box" v-if="fileInfoList.length > 0">
<div style="display: flex;">
<div v-for="(file,item) in fileInfoList"
target="_blank"
class="transition-box-span table-jump"
@click="handleQueryPdf(file)"
:key="item">
{{ file.name }}
<el-button
size="small"
@click="downloadFile(file.attId)"
icon="el-icon-download"
style="height: 32px; margin-left: 5px;"
></el-button>
</div>
</div>
</div>
<span class="transition-box-span" v-else>-</span>
</div>
<div class="transition-box-p">
<label class="transition-box-label">流程稿件:</label>
<div class="file-box" v-if="fileInfoLists.length > 0">
<div style="display: flex;">
<div v-for="(file,item) in fileInfoLists"
target="_blank"
class="transition-box-span table-jump"
@click="handleQueryPdf(file)"
:key="item">
{{ file.name }}
<el-button
size="small"
@click="downloadFile(file.attId)"
icon="el-icon-download"
style="height: 32px; margin-left: 5px;"
></el-button>
</div>
</div>
</div>
<span class="transition-box-span" v-else>-</span>
</div>
<p class="transition-box-p">
<label class="transition-box-label">上传时间:</label>
<span class="transition-box-span">{{ this.lawsStand.startTime || '-' }}</span>
</p>
<p class="transition-box-p">
<label class="transition-box-label">征求意见周期:</label>
<span class="transition-box-span" v-if="this.lawsStand.startTime && this.lawsStand.endTime">{{ this.lawsStand.startTime + ' ~ ' + this.lawsStand.endTime }}</span>
<span class="transition-box-span" v-else>-</span>
</p>
</div>
</transition>
<div class="effect">
<el-button v-if="ideaKey" type="primary" class="common-button-primary" size="mini" @click="selectStandardPro('add')">
添加
</el-button>
<el-button type="primary" class="common-button-primary" size="mini" @click="exportAll">导出</el-button>
<el-button type="primary" class="common-button-primary" size="mini" @click="exportAll1">导出上报意见</el-button>
</div>
<div class="container">
<el-table
:data="standinfoList"
height="100%"
border
style="width: 100%"
:default-sort = "{prop: 'partCode', order: 'ascending'}"
:header-cell-style="{background: '#e8e8e8', color: '#333333', fontSize: '16px',
fontWeight: 'bold', height: '48px'}">
<el-table-column
type="index"
label="序号"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="partCode"
label="章节编号"
sortable
align="center"
width="120">
</el-table-column>
<el-table-column
prop="chapterName"
align="center"
width="200px"
label="章节名称">
</el-table-column>
<el-table-column
prop="content"
align="center"
label="修改意见内容(包括理由或依据)"
>
<el-table-column
prop="oldText"
align="center"
label="修改前"
width="150"
>
<template slot-scope="scope">
<el-button size="mini" type="primary" :disabled="scope.row.partCode.length === 0" @click="itermsConditionsOpen(scope.row.oldText)" class="common-button-primary">查看修改前内容</el-button>
</template>
</el-table-column>
<el-table-column
prop="newText"
align="center"
label="修改后"
>
</el-table-column>
<el-table-column
prop="reason"
align="center"
label="修改理由"
>
</el-table-column>
</el-table-column>
<el-table-column
prop="deptName"
align="center"
label="提出部门"
width="170"
>
</el-table-column>
<el-table-column
prop="userName"
align="center"
width="100"
label="提出人"
>
</el-table-column>
<el-table-column
prop="state"
align="center"
label="处理意见">
<template slot-scope="scope">
<div>{{ stateText(scope.row.state) }}</div>
</template>
</el-table-column>
<el-table-column
prop="cause"
align="center"
label="原因"
width="170"
>
</el-table-column>
<el-table-column label="操作" align="center" width="50" fixed="right" v-if="ideaKey">
<template slot-scope="scope">
<div @click.stop style="display: inline-block">
<el-dropdown trigger="click" @command="handleCommand">
<i class="iconfont">&#xe61e;</i>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item v-if="scope.row.userId === $store.getters.userInfo.userId" :command="[scope.row, '编辑']">
编辑
</el-dropdown-item>
<el-dropdown-item v-if="scope.row.userId === $store.getters.userInfo.userId" :command="[scope.row, '删除']">
删除
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</template>
</el-table-column>
</el-table>
</div>
<pagination
style="position: static;width: 100%;"
:page="form.page"
:total="total"
@pageChange="handlePageChange"
@pageSizeChange="handlePageSizeChange"></pagination>
<el-drawer
:title=opiniontitle
:visible.sync="isDialog"
:wrapperClosable="false"
size="1050px"
destroy-on-close
:before-close="closeDrawer"
>
<div class="demo-drawer-content add-demo">
<div class="search-area">
<el-form style="width: 100%;" :model="opinionContent" ref="formAdd" :rules="opinionContentRules" class="label-input-form">
<el-form-item label="章节编号" label-width="" prop="partCode" class="add-form-item">
<el-select filterable v-model="opinionContent.partCode" placeholder="请选择条款章节" @change="optionsChange">
<el-option
v-for="(item,index) in options"
:key="index"
:label="item.itemsNum"
:value="item.itemsNum"></el-option>
</el-select>
</el-form-item>
<el-form-item label="章节名称" prop="chapterName" label-width="" class="add-form-item">
<el-input v-model="opinionContent.chapterName" autocomplete="off" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="修改前" label-width="" class="add-form-item">
<div v-html="opinionContent.oldText" style="margin: 56px 0 0 10px;"></div>
</el-form-item>
<el-form-item label="修改后" prop="newText" label-width="" class="add-form-item">
<el-input v-model="opinionContent.newText" autocomplete="off" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="修改理由" prop="reason" label-width="" class="add-form-item">
<el-input v-model="opinionContent.reason" autocomplete="off" placeholder="请输入修改理由"></el-input>
</el-form-item>
<!-- <el-form-item label="原因" prop="cause" label-width="" class="add-form-item">-->
<!-- <el-input v-model="opinionContent.cause" autocomplete="off" placeholder="请输入原因"></el-input>-->
<!-- </el-form-item>-->
</el-form>
</div>
<div class="demo-drawer-footer">
<el-button :loading="isSubmit" size="mini" class="common-button-primary" icon="el-icon-check" type="primary" @click="saveUserInfo">
提交
</el-button>
<el-button size="mini" class="common-button-default" icon="el-icon-close" @click="closeDrawer">取消</el-button>
</div>
</div>
</el-drawer>
<loading :loading="spinShow">数据加载中……</loading>
<el-dialog
title="查看修改前内容"
:visible.sync="itermsConditionsFlag"
width="800px">
<div style="height: 500px;overflow: auto;" v-html="itermsConditionsTitle"></div>
<div slot="footer">
<el-button class="common-button-default" size="mini" icon="el-icon-close" @click="itermsConditionsClose">关闭</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
export default {
name: 'consultationDetails',
data() {
return {
freshClueNum: '',
itermsConditionsFlag: false,
itermsConditionsTitle: '',
options: [],
fileInfoList: [],
fileInfoLists: [],
itemData: this.lawsStand,
id: '', // 选中id
type: '', // 选中状态
spinShow: false,
total: 0, // 总数
opiniontitle: '新增意见', // 抽屉标题
isDialog: false, //新增抽屉状态
heightShow: true, // 高度
isSubmit: false,
opinionContent: { // 抽屉数据
partCode: '',
oldText: '',
newText: '',
reason: '',
chapterName: '',
// cause: '',
},
opinionContentRules: {
partCode: [
{required: true, message: '请输入章节编号', trigger: 'blur'},
],
oldText: [
{required: true, message: '请输入修改前内容', trigger: 'blur'}
],
newText: [
{required: true, message: '请输入修改后内容', trigger: 'blur'}
],
reason: [
{required: true, message: '请输入修改理由', trigger: 'blur'}
],
},
standinfoList: [], // 详情列表
form: {
ideaId: '',
cid: '',
page: 1,
size: this.$store.getters.userInfo.configContent,
userId: this.$store.getters.userInfo.userId,
endTime: ''
}, // 详情数据
ideaKey: false,
refreshTimer: null
}
},
methods: {
stateText(row) {
if (row === '1') {
return '上报'
} else if (row === '2') {
return '处理后上报'
} else {
return '不上报'
}
},
itermsConditionsClose () {
this.itermsConditionsFlag = false
},
itermsConditionsOpen (row) {
this.itermsConditionsFlag = true
this.itermsConditionsTitle = row
},
optionsChange (data) {
for (let a = 0; a < this.options.length; a++) {
if (data === this.options[a].itemsNum) {
this.opinionContent.oldText = this.options[a].termsConditions
this.opinionContent.chapterName = this.options[a].itemsName
}
}
},
downloadFile (attId) {
window.location.href = '/api/att/attFile/downloadFileForSar?fileId=' + attId
},
// 点击查看
handlePreview(item) {
let routeUrl = this.$router.resolve({
name: 'OtherStandardDetails',
params: {
id: item.standId,
pageType: 'INLAND_STAND'
}
})
window.open(routeUrl.href, '_blank')
},
exportAll() {
window.open('/api/slrs/sar-public-idea-all/tuallStand?cid=' + this.lawsStand.id)
},
exportAll1() {
window.open('/api/slrs/sar-public-idea-all/tuallStand?type=1&cid=' + this.lawsStand.id)
},
getIdeaKey() {
this.$http.get('slrs/sar-public-idea-all/checkIsShow', {
endTime: this.form.endTime
}, {}, res => {
if (res.message === '1') {
this.ideaKey = false
} else {
this.ideaKey = true
}
})
},
// 获取详情信息列表
getList() {
this.spinShow = true
this.$http.get('slrs/sar-public-idea-all/getAllStand', this.form, {
_this: this
}, res => {
this.standinfoList = res.data.records
console.log(res.data.records);
this.total = res.data.total
this.spinShow = false
}, e => {
})
},
//分页数据改变
handlePageChange(page) {
this.form.page = page
this.getList()
},
handlePageSizeChange(pageSize) {
this.$store.getters.userInfo.configContent = pageSize
this.form.size = pageSize
this.getList()
},
back() {
this.$router.push({
name: 'standardForComments'
})
},
// 更多
handleCommand(command) {
switch (command[1]) {
case '编辑':
this.selectStandardPro('edit', command[0])
break
case '删除':
this.deleteStand(command[0].id)
break
}
},
//编辑
selectStandardPro(type, row) {
this.type = type
if (type === 'edit') {
this.id = row.id
this.opiniontitle = '编辑意见内容'
this.opinionContent.partCode = row.partCode
this.opinionContent.reason = row.reason
this.opinionContent.oldText = row.oldText
this.opinionContent.newText = row.newText
this.opinionContent.cause = row.cause
this.isDialog = true
} else {
localStorage.setItem('freshClueNum', new Date().getTime())
this.freshClueNum = localStorage.getItem('freshClueNum') || '';
const that = this
const watcherRefreshData = function(ev) {
const { key: eventType, newValue } = ev
if (eventType === 'refreshFlag' && eval(newValue) === true) {
// 更新数据...
that.$store.commit('SET_REFRESH_FLAG', false)
}
}
// 对浏览器的localStorage进行监听,当需要更新数据时,refreshFlag为true,数据更新后将refreshFlag置为false
window.addEventListener('storage', (ev) => {
watcherRefreshData(ev)
this.$once('hook:beforeDestroy', () => {
window.removeEventListener('storage', (ev) => {
watcherRefreshData(ev)
})
})
})
let routeData = this.$router.resolve({
name: "AddFileDetails",
query: {
attId: this.fileInfoList[0].attId,
userId: this.$store.getters.userInfo.userId || '',
userName: this.$store.getters.userInfo.userName || '',
deptName: this.$store.getters.userInfo.institutionName || '',
deptId: this.$store.getters.userInfo.institutionId || '',
standId: JSON.parse(this.lawsStand.files)[0].standId,
fileType: JSON.parse(this.lawsStand.files)[0].standFileClassify,
ideaId: this.lawsStand.id,
cid: this.lawsStand.cid,
}
});
window.open(routeData.href, '_blank')
}
},
//删除
deleteStand(id) {
this.$confirm('确认删除这些意见?', '提示', {
confirmButtonText: '确定',
confirmButtonClass: 'common-button-primary',
cancelButtonText: '取消',
type: 'warning',
roundButton: false
}).then(() => {
var form = {
id: id,
autUserId: this.$store.getters.userInfo.userId,
userId: this.$store.getters.userInfo.userId
}
this.$http.get('slrs/sar-public-idea-all/deleteStand', form, {
_this: this
}, res => {
this.$message.warning(res.message)
this.form.page = 1
this.getList()
})
//确认事件
}).catch(() => {
this.$message.warning('取消删除')
//取消事件
})
},
//点击抽屉按钮提交事件
saveUserInfo() {
this.$refs['formAdd'].validate((valid) => {
if (valid) {
var url = ''
var form = {
ideaId: this.lawsStand.id,
cid: this.lawsStand.cid,
content: this.opinionContent.content,
oldText: this.opinionContent.oldText,
newText: this.opinionContent.newText,
reason: this.opinionContent.reason,
partCode: this.opinionContent.partCode,
chapterName: this.opinionContent.chapterName,
// cause: this.opinionContent.cause,
userId: this.$store.getters.userInfo.userId || '',
userName: this.$store.getters.userInfo.userName || '',
deptName: this.$store.getters.userInfo.institutionName || '',
deptId: this.$store.getters.userInfo.institutionId || '',
}
if (this.type === 'edit') {
form.id = this.id
form.autUserId = this.$store.getters.userInfo.userId
url = 'slrs/sar-public-idea-all/updateStand'
} else {
url = 'slrs/sar-public-idea-all/insetStand'
}
this.$http.post(url, form, {
_this: this
}, res => {
if (res.respCode === '200') {
this.form.page = 1
this.getList()
if (this.type === 'edit') {
this.isDialog = false
} else {
this.id = ''
this.opinionContent.partCode = ''
this.opinionContent.reason = ''
this.opinionContent.oldText = ''
this.opinionContent.newText = ''
// this.opinionContent.cause = ''
}
}
})
}
})
},
//点击抽屉按钮取消事件
closeDrawer() {
this.isDialog = false
},
getFileInfo() {
JSON.parse(this.lawsStand.files).forEach(item=>{
this.fileInfoList.push({
attId: item.attId,
id: item.id,
name: item.fileName
})
})
},
handleQueryPdf(file){
window.open('/static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + file.attId))
}
},
watch: {
refreshFlag(val) {
this.form.page = 1
this.getList()
}
},
computed: {
lawsStand() {
return this.$route.query.item && JSON.parse(this.$route.query.item)
},
...mapGetters(['refreshFlag'])
},
mounted() {
if (this.lawsStand) {
this.form = {
ideaId: this.lawsStand.id,
cid: this.lawsStand.cid,
page: 1,
size: this.$store.getters.userInfo.configContent,
userId: this.$store.getters.userInfo.userId,
endTime: this.lawsStand.endTime
}
}
// 详情数据
// window.addEventListener("storage", ev => {
// if(ev.key === 'freshClueNum'){
// this.form.page = 1
// this.getList()
// }
// })
if (JSON.parse(this.lawsStand.wkfiles).length) {
this.fileInfoLists = JSON.parse(this.lawsStand.wkfiles)
} else {
this.fileInfoLists = []
}
if (JSON.parse(this.lawsStand.files).length) {
let json = JSON.parse(this.lawsStand.files)[0]
this.$http.get('SarStandItems/sar-stand-items/querySarItemAndInterpretation', {
standId: json.standId,
fileType: json.standFileClassify,
pageSize: 9999,
page: 1
}, {}, res => {
if (res.ok) {
this.options = res.data.list
}
}, e => {
})
} else {
this.options = []
}
this.getList()
this.getIdeaKey()
this.getFileInfo()
}
}
</script>
<style lang="less" scoped>
@import '~@/assets/styles/mixins';
@import '~@/assets/styles/style';
.consultationDetails {
height: 100%;
display: flex;
flex-direction: column;
.iconClass {
width: 18px;
height: 18px;
}
.contentTitle {
display: flex;
align-items: center;
padding: 0 10px;
height: 50px;
background: #ffffff;
.title {
flex: 1;
font-weight: bold;
font-size: 20px;
margin-left: 15px;
.el-icon-s-order {
font-size: 22px;
color: #4498F0;
cursor: pointer;
}
}
}
.transition-box {
padding: 0 10px;
background: #ffffff;
font-size: 14px;
.transition-box-p {
line-height: 35px;
.transition-box-label {
display: inline-block;
width: 100px;
vertical-align: top;
}
.transition-box-span {
display: inline-block;
width: calc(~'100% - 100px');
}
.file-box {
display: inline-block;
width: calc(~'100% - 100px');
.transition-box-span {
display: inline;
width: 100%;
cursor: pointer;
color: #4498f0;
}
p {
& > a {
cursor: pointer;
}
& > i {
display: inline-block;
margin-left: 3px;
width: 18px;
height: 16px;
background-repeat: no-repeat;
background-size: 100% 100%;
background-position: center center;
vertical-align: sub;
cursor: pointer;
}
.icon-download {
background-image: url("~assets/images/shangqi/img/download.png");
}
.icon-download2 {
background-image: url("~assets/images/shangqi/img/download2.png");
}
}
}
}
}
.effect {
margin: 10px 10px 0 0;
}
.container {
height: calc(~'100% - 52px - 55px - 50px');
flex: auto;
display: flex;
margin: 10px 0;
flex-direction: column;
padding: 0;
.el-tabs {
height: 100%;
display: flex;
flex-direction: column;
flex: auto;
/deep/ .el-tabs__content {
//height: calc(~'100% - 55px');
overflow-y: auto;
flex: auto;
display: flex;
flex-direction: column;
.el-tab-pane {
height: 100%;
flex: auto;
display: flex;
flex-direction: column;
}
}
}
}
.add-demo {
.search-area {
height: calc(~'100% - 55px');
overflow: auto;
}
::v-deep .el-textarea__inner {
width: 1000px;
}
}
}
</style>