Files
foton-laws-system-front/src/pages/localTool/standContrast/index.vue
T
2023-11-23 16:15:53 +08:00

622 lines
21 KiB
Vue

<comment>
# 标准对比
</comment>
<template>
<div class="standContrast">
<!-- 顶部工具栏 -->
<table-tools-bar>
<div slot="left">
<div class="search-area">
<el-form :modal="standCommonlySearch" inline class="label-input-form" @keyup.enter.native="sarStandCompareHis">
<el-formItem :label="$t('m.oldTextNumberOrName')" class="search-item">
<el-input v-model="oldNumOrName" class="s-c-input" :placeholder="$t('m.searchByOldTextNumberOrname')" clearable :maxlength="100" @keyup.enter.native="sarStandCompareHis()"></el-input>
</el-formItem>
<el-formItem :label="$t('m.newTextNumberOrname')" class="search-item">
<el-input v-model="newNumOrName" class="s-c-input" :placeholder="$t('m.searchByNewTextNumberOrname')" clearable :maxlength="100" @keyup.enter.native="sarStandCompareHis()"></el-input>
</el-formItem>
<el-formItem class="search-item btn-box">
<el-button
type="primary"
size="mini"
class="common-button-primary"
v-btn-permission="'91e02de33d955a8df791366636803570'"
@click="sarStandCompareHisInfo">搜索</el-button>
<el-button
class="common-button-default"
size="mini"
v-btn-permission="'fda571f37b0dc0738856799e3287990e'"
@click="clearSearchStand">清空</el-button>
</el-formItem>
</el-form>
</div>
</div>
</table-tools-bar>
<div class="content">
<div class="action-bar">
<el-button size="mini" v-btn-permission="'36078b3c8e897f8c1b6d6974a612d0c7'" @click="contrastStandFile" style="width:77px; height:32px;">比对</el-button>
<el-button size="mini" v-btn-permission="'83981863baa8716bdcc9e52a1fb1d2dc'" @click="batchDelete"><i class="iconfont">&#xe61b;</i>批量删除</el-button>
</div>
<div class="table-wrap">
<div style="position: absolute;height: calc(100% - 10px);width: 100%;">
<el-table
ref="selection"
:data="standInfoList"
tooltip-effect="dark"
style="width: 100%;padding:0 0 20px 0;"
height="100%"
border
:header-cell-style="{background: '#f8f8f9', color: '#515a6e'}"
@selection-change="standSelectChange">
<el-table-column
type="selection"
width="55"
align="center">
</el-table-column>
<el-table-column
type="index"
width="55"
label="序号"
align="center">
<template slot-scope="{scope, column, $index}">
{{ ($index + 1) + (splitInfoPage - 1) * splitInfoPageSize }}
</template>
</el-table-column>
<el-table-column
show-overflow-tooltip
prop="oldStandNum"
label="旧文档文本号"
align="center"
>
</el-table-column>
<el-table-column
show-overflow-tooltip
prop="oldStandName"
label="旧文档文本名称"
align="center">
</el-table-column>
<el-table-column
prop="oldFileTypeShow"
label="旧文本状态"
align="center">
</el-table-column>
<el-table-column
show-overflow-tooltip
prop="newStandNum"
label="新文档文本号"
align="center">
</el-table-column>
<el-table-column
show-overflow-tooltip
prop="newStandName"
label="新文档文本名称"
align="center">
</el-table-column>
<el-table-column
prop="newFileTypeShow"
label="新文本状态"
align="center">
</el-table-column>
<el-table-column
prop="compareType"
label="比对类型"
align="center">
</el-table-column>
<el-table-column
prop="compareStatus"
label="比对状态"
align="center">
<!-- <template slot-scope="scope">-->
<!-- -->
<!-- </template>-->
</el-table-column>
<el-table-column
prop="createTime"
label="比对时间"
sortable
align="center">
</el-table-column>
<el-table-column
prop="action"
label="操作"
width="50px"
align="center">
<!-- <template slot-scope="scope">
<el-button
class="opera-btn"
size="mini"
type="primary"
@click="handlePreview(scope.row)">查看</el-button>
<el-button
class="opera-btn"
size="mini"
type="danger"
@click="delFileEditInfo(scope.row.id)">删除</el-button>
<el-button
class="opera-btn"
size="mini"
type="primary"
@click="enjoyInfo(scope.row)">分享</el-button>
<el-button size="mini" class="opera-btn" type="primary" v-if="scope.row.collectBtn" @click="collectInfo(scope.row)">收藏</el-button>
<el-button size="mini" class="opera-btn" type="primary" v-else @click="cancelCollectInfo(scope.row)">取消收藏</el-button>
</template>-->
<template slot-scope="scope">
<el-dropdown trigger="click" @command="handleCommand">
<i class="iconfont">&#xe61e;</i>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item v-btn-permission="'13219b54a6f41280818e7ade5cf2cfad'" :command="[scope.row, '查看']">查看</el-dropdown-item>
<el-dropdown-item v-btn-permission="'b6b048e926ecc9334cad769d4be7c4ec'" :command="[scope.row, '删除']">删除</el-dropdown-item>
<!-- <el-dropdown-item v-btn-permission="''" :command="[scope.row, '分享']">分享</el-dropdown-item>
<el-dropdown-item
v-if="scope.row.collectBtn"
v-btn-permission="''"
:command="[scope.row, '收藏']"
>
收藏
</el-dropdown-item>
<el-dropdown-item
v-else
v-btn-permission="''"
:command="[scope.row, '取消收藏']"
>
取消收藏
</el-dropdown-item>-->
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
</div>
</div>
</div>
<pagination :page="splitInfoPage" :total="total" @pageChange="pageChange" @pageSizeChange="pageSizeChange"></pagination>
<loading :loading="spinShow">{{$t('m.dataLoading')}}……</loading>
<!-- 分享 -->
<el-drawer :title="$t('m.sharingStandard')" :visible.sync="drawerModal" width="300" :styles="drawerModalstyles" @on-close="treeCancel">
<div class="demo-drawer-content">
<dept-tree treeDivId="drawerModalTree"
ref="drawerModalTree"
@treeClick="selcetTree"
allDept
showUser
:editable="false"
style="padding: 0 15px">
</dept-tree>
</div>
<div class="demo-drawer-footer">
<el-button size="mini" type="primary" @click="shareStandardBt" icon="el-icon-check">确定</el-button>
<el-button size="mini" style="margin-right: 8px" @click="treeCancel" icon="el-icon-close">取消</el-button>
</div>
</el-drawer>
<!-- 分享 全部选人 -->
<org-table
:visible.sync="visibleOrgTable"
title="分享人员"
dialog-model
:config="{
value: orgTableVal,
valueName: orgTableValName
}"
@confirm="isTreeOk"
></org-table>
</div>
</template>
<script>
export default {
name: 'standContrast',
components: {
},
data () {
return {
visibleOrgTable: false,
orgTableVal: '',
orgTableValName: '',
spinShow: false,
collect: '收藏',
cancelCollect: false,
standCommonlySearch: {},
oldNumOrName: '',
newNumOrName: '',
standInfoList: [],
tableHeight: null,
total: 0,
splitInfoPage: 1,
splitInfoPageSize: this.$store.getters.userInfo.configContent,
selectedList: [],
drawerModalstyles: {
height: 'calc(100% - 55px)',
overflow: 'auto',
paddingBottom: '53px',
position: 'static'
},
// end 分享相关的
shareStandardModal: false,
shareStandardSelect: [],
// 分享数据
resType: '',
// 消息推送保存对象
personShareEO: {
id: '',
recipientId: '',
shareUserId: '',
resType: '',
resId: '',
resUri: '',
resTitle: '',
readFlag: '',
validFlag: '',
modifyTime: '',
creationTime: ''
},
// 收藏标准
personCollect: {
collectResId: '',
collectTitle: '',
collectType: ''
},
drawerModal: false // 分享
}
},
props: {
},
watch: {
},
methods: {
handleCommand (command) {
switch (command[1]) {
case '查看':
this.handlePreview(command[0])
break
case '收藏':
this.collectInfo(command[0])
break
case '取消收藏':
this.cancelCollectInfo(command[0])
break
case '分享':
this.enjoyInfo(command[0])
break
case '删除':
this.delFileEditInfo(command[0].id)
break
}
},
// 树点击
isTreeOk (checkedList) {
this.shareStandardSelect = []
checkedList.map((item, index) => {
if (!item.isParent) {
this.shareStandardSelect.push(item.userId)
}
})
if (this.shareStandardSelect.length === 0) {
this.$message({
message: '请选择要分享的人!',
type: 'warning'
})
} else {
this.personShareEO.resType = 'COMPARISON'
this.personShareEO.resTitle = '【标准比对】 ' + (this.resPk.oldStandNum ? this.resPk.oldStandNum:'') + ' - ' + (this.resPk.newStandNum ? this.resPk.newStandNum:'')
/*if (this.resPk.standYear != null && this.resPk.standYear !== '') {
this.personShareEO.resTitle = this.resPk.oldStandName + ' ( 编号:' + this.resPk.oldFileType + ' ' + this.resPk.oldStandNum + '-' + this.resPk.standYear + ' )'
} else {
}*/
this.personShareEO.resId = this.resPk.id
this.personShareEO.resUri = JSON.stringify(this.resPk)
this.personShareEO.recipientId = this.shareStandardSelect
this.$http.post('/person/personShare/savePersonShare', this.personShareEO, {
_this: this
}, res => {
this.$message({
message: '标准分享成功!',
type: 'success'
})
this.shareStandardModal = false
this.visibleOrgTable = false
// this.drawerModal = false
this.shareStandardSelect = []
// this.$refs.drawerModalTree.treeReload()
}, e => {
this.$message.error('标准分享失败!')
})
}
},
// 消息推送
shareStandardBt () {
if (this.shareStandardSelect.length === 0) {
this.$message({
message: '请选择要分享的人!',
type: 'warning'
})
} else {
this.personShareEO.resType = 'COMPARISON'
this.personShareEO.resTitle = '【标准比对】 ' + (this.resPk.oldStandNum ? this.resPk.oldStandNum:'') + ' - ' + (this.resPk.newStandNum ? this.resPk.newStandNum:'')
/*if (this.resPk.standYear != null && this.resPk.standYear !== '') {
this.personShareEO.resTitle = this.resPk.oldStandName + ' ( 编号:' + this.resPk.oldFileType + ' ' + this.resPk.oldStandNum + '-' + this.resPk.standYear + ' )'
} else {
}*/
this.personShareEO.resId = this.resPk.id
this.personShareEO.resUri = JSON.stringify(this.resPk)
this.personShareEO.recipientId = this.shareStandardSelect
this.$http.post('/person/personShare/savePersonShare', this.personShareEO, {
_this: this
}, res => {
this.$message({
message: '标准分享成功!',
type: 'success'
})
this.shareStandardModal = false
this.drawerModal = false
this.shareStandardSelect = []
this.$refs.drawerModalTree.treeReload()
}, e => {
this.$message.error('标准分享失败!')
})
}
},
// 树点击
selcetTree (treeId, treeNode) {
this.shareStandardSelect = treeNode.id
},
// 取消
treeCancel () {
this.drawerModal = false
this.$refs.drawerModalTree.treeReload()
},
// 查看
handlePreview (params) {
if (params.compareType === '条款比对') {
this.$store.commit('setDetailMap', this.$route.path)
this.$router.push({
name: 'SeeDatalis',
query: {
row: JSON.stringify(params)
}
})
} else {
let rowDataLeft = {}
let rowDataRight = {}
rowDataLeft.showNumber = params.oldStandNum
rowDataLeft.standName = params.oldStandName
rowDataLeft.standNameSplit = null
rowDataLeft.standNumSplit = null
rowDataRight.showNumber = params.newStandNum
rowDataRight.standName = params.newStandName
rowDataRight.standNameSplit = null
rowDataRight.standNumSplit = null
this.$store.commit('setDetailMap', this.$route.path)
this.$router.push({
name: 'TextComparison',
query: {
id: params.id,
flag: '查看',
rowDataLeft: JSON.stringify(rowDataLeft),
rowDataRight: JSON.stringify(rowDataRight)
}
})
}
},
// 删除
delFileEditInfo (id) {
this.$confirm('是否删除?', '提示', {
confirmButtonText: this.$t('m.determine'),
cancelButtonText: this.$t('m.cancel'),
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
this.$http.post('lawss/sarStandCompareHis/deleteByIds', {
deleteByIdList: id
}, {
_this: this
}, res => {
if (res.ok) {
this.sarStandCompareHis()
}
})
}).catch(() => {
// 取消删除,清空选择
// this.$refs.selections.clearSelection()
})
},
enjoyInfo (item) {
// this.$message({
// message: '此功能正在开发中……',
// type: 'warning'
// })
// this.drawerModal = true
// this.$nextTick(() => {
// this.$refs.drawerModalTree.clearSearch()
// })
this.visibleOrgTable = true
this.resPk = JSON.parse(JSON.stringify(item))
},
// scope.$index 获取当前行下标
collectInfo (item) {
// 点击收藏
this.spinShow = true
item.isSubmit = true
this.personCollect.collectResId = item.id
if (item.standYear != null && item.standYear !== '') {
this.personCollect.collectTitle = item.newStandName + ' ( 编号:' + item.newStandNum + ' )'
} else {
this.personCollect.collectTitle = item.newStandName + ' ( 编号:' + item.newStandNum + ' )'
}
this.personCollect.collectType = 'INLAND_STAND'
this.$http.postData('person/personCollect', this.personCollect, {
_this: this
}, res => {
this.spinShow = false
item.isSubmit = false
item.collectBtn = !item.collectBtn
item.collectId = res.data.id
this.cancelCollect = !this.cancelCollect
}, e => {
item.isSubmit = false
})
},
cancelCollectInfo (item) {
this.$http.put('person/personCollect/updateByUserId', {
id: item.collectId
}, {
_this: this
}, res => {
if (res.ok) {
item.collectBtn = !item.collectBtn
this.cancelCollect = !this.cancelCollect
item.collectId = ''
}
})
},
clearSearchStand () {
this.oldNumOrName = ''
this.newNumOrName = ''
this.splitInfoPage = 1
this.sarStandCompareHis()
},
sarStandCompareHisInfo() {
this.splitInfoPage = 1
this.sarStandCompareHis()
},
// 表格
sarStandCompareHis () {
this.spinShow = true
this.$http.get('lawss/sarStandCompareHis/page', {
page: this.splitInfoPage,
pageSize: this.splitInfoPageSize,
oldNumOrName: this.oldNumOrName,
newNumOrName: this.newNumOrName
}, {
_this: this
}, res => {
for (let i = 0; i < res.data.list.length; i++) {
res.data.list[i].checked = false
if (res.data.list[i].collectId != null && res.data.list[i].collectId !== '') {
res.data.list[i].collectBtn = false
res.data.list[i].cancelCollectBtn = true
} else {
res.data.list[i].collectBtn = true
res.data.list[i].cancelCollectBtn = false
}
res.data.list[i].isSubmit = false
}
this.standInfoList = res.data.list
this.total = res.data.count
this.spinShow = false
}, e => {
})
},
pageChange (page) {
this.splitInfoPage = page
this.sarStandCompareHis()
},
// 分页每页显示数改变后方法
pageSizeChange (pageSize) {
this.splitInfoPageSize = pageSize
this.sarStandCompareHis()
},
standSelectChange (data) {
this.selectedList = []
for (let i = 0; i < data.length; i++) {
this.selectedList.push(data[i].id)
}
},
contrastStandFile () {
this.$store.commit('setDetailMap', this.$route.path)
this.$router.push({
name: 'ContrastDetails'
})
},
batchDelete () {
if (this.selectedList.length === 0) {
this.$message({
message: '请选择要删除的数据',
type: 'warning'
})
} else {
this.$confirm('确认删除这些数据?', '提示', {
confirmButtonText: this.$t('m.determine'),
cancelButtonText: this.$t('m.cancel'),
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
this.$http.post('lawss/sarStandCompareHis/deleteByIds', {
deleteByIdList: this.selectedList.join(',')
}, {
_this: this
}, res => {
this.sarStandCompareHis()
}, e => {
})
}).catch(() => {
// 取消删除,清空选择
// this.$refs.multipleTable.clearSelection()
})
}
}
},
computed: {
},
mounted () {
this.sarStandCompareHis()
this.tableHeight = $('.content').height() - 44
window.onresize = () => {
this.tableHeight = $('.content').height() - 44
}
}
}
</script>
<style lang="less" scoped>
@import '~@/assets/styles/mixins';
@import '~@/assets/styles/style';
.standContrast {
height: 100%;
background: #fff;
.el-divider--horizontal {
display: block;
height: 1px;
width: 100%;
margin: 0;
}
.flex();
flex-direction: column;
.action-bar {
margin-bottom: 5px;
padding: 0;
}
.content {
flex: auto;
overflow: hidden;
display: flex;
flex-direction: column;
.table-wrap {
flex: auto;
overflow: hidden;
position: relative;
}
}
& > .pagination {
position: static;
/deep/.pagination-slot {
padding: 0;
}
}
.s-c-input {
/deep/ .el-input__inner {
width: 190px;
}
}
}
::v-deep .el-drawer__header{
&>span:first-child{
outline: none!important;
}
}
::v-deep .el-drawer{
outline: none!important;
}
</style>