Files
laws_weilai/jero-web/src/views/projectManagement/components/ParameterItemCollectionList.vue
T
2022-05-20 10:40:40 +08:00

799 lines
24 KiB
Java

<template>
<a-card :bordered="false">
<div class="table-page-search-wrapper">
<!-- 认证参数收集-参数项收集清单-10控件-->
<a-row :gutter="24">
<a-col :md="6" :sm="8">
<div class="box-title-text">
<div class="title-text" :title="$t('NiONumber')">
<span>{{$t('NiONumber')}}</span>
</div>
<a-input class="box-input" :placeholder="$t('PleaseEnter')+$t('NiONumber')"
v-model="formInline.nioNumber"></a-input>
</div>
</a-col>
<a-col :md="6" :sm="8">
<div class="box-title-text">
<div class="title-text" :title="$t('ParameterName')">
<span>{{$t('ParameterName')}}</span>
</div>
<a-input class="box-input" :placeholder="$t('PleaseEnter')+$t('ParameterName')"
v-model="formInline.paramsName"></a-input>
</div>
</a-col>
<a-col :md="6" :sm="8">
<div class="box-title-text">
<div class="title-text" :title="$t('certificationCategory')">
<span>{{$t('certificationCategory')}}</span>
</div>
<j-dict-select-tag class="box-input" v-model="formInline.certCategory"
:placeholder="$t('PleaseSelect')+$t('certificationCategory')"
:type="'select'"
:triggerChange="false" :dictCode="'cert_category'"/>
</div>
</a-col>
<a-col :md="6" :sm="8">
<div class="box-title-text">
<div class="title-text" :title="$t('areaOfResponsibility')">
<span>{{$t('areaOfResponsibility')}}</span>
</div>
<j-dict-select-tag class="box-input" v-model="formInline.dutyTerritory"
:placeholder="$t('PleaseSelect')+$t('areaOfResponsibility')"
:type="'select'"
:triggerChange="false" :dictCode="'duty_territory'"/>
</div>
</a-col>
<a-col :md="6" :sm="8">
<div class="box-title-text">
<div class="title-text" :title="$t('completedBy')">
<span>{{$t('completedBy')}}</span>
</div>
<a-input class="box-input" :placeholder="$t('PleaseEnter')+$t('completedBy')"
v-model="formInline.dre"></a-input>
</div>
</a-col>
<span style="float: right;overflow: hidden;margin-right: 11px" class="table-page-search-submitButtons">
<a-col :md="6" :sm="24">
<a-button class="box-button" type="primary" @click="searchQuery">{{$t('query')}}</a-button>
<a-button class="box-button" style="margin-left: 8px" @click="searchReset">{{$t('reset')}}</a-button>
</a-col>
</span>
</a-row>
</div>
<div class="table-operator">
<a-popconfirm overlayClassName='popconfirm' placement="bottomRight">
<template slot="title" id="popconfirm">
<!-- 下发收集 -->
<div @click="distributionAndCollection" class="operator-text-title">
<a-icon type="plus"/>
{{$t('distributionAndCollection')}}
</div>
<!-- 冻结配置-->
<div @click="freezeConfiguration" class="operator-text-title">
<a-icon type="plus"/>
{{$t('FreezeConfiguration')}}
</div>
<!-- 同步上报库 -->
<div @click="handleAdd" class="operator-text-title">
<a-icon type="plus"/>
{{$t('SynchronousReportLibrary')}}
</div>
<!-- 强制撤回-->
<div @click="compulsoryWithdrawal" class="operator-text-title">
<a-icon type="bulb"/>
{{$t('CompulsoryWithdrawal')}}
</div>
<!-- 截止时间-->
<div @click="TaskCutOffTime" class="operator-text-title">
<a-icon type="bulb"/>
{{$t('TaskCutOffTime')}}
</div>
</template>
<div class="operator-text" style="position: relative">
<span style="position: absolute;left: -13px;top: -4px">...</span>{{ $t('more') }}
</div>
</a-popconfirm>
<!-- 添加-->
<div @click="handleAdd" class="operator-text">
<a-icon type="plus"/>
{{$t('addTo')}}
</div>
<!-- 分配填写人-->
<div @click="assignedBy" class="operator-text">
<a-icon type="copy"/>
{{$t('Assignedby')}}
</div>
<!-- 提交-->
<div @click="handleSubmit" class="operator-text">
<a-icon type="plus"/>
{{$t('submit')}}
</div>
<!-- 退回-->
<div @click="returnData" class="operator-text">
<a-icon type="plus"/>
{{$t('sendBack')}}
</div>
<!-- 引用参数-->
<div @click="referenceparameter" class="operator-text">
<a-icon type="plus"/>
{{$t('referenceparameter')}}
</div>
<!-- 批量删除-->
<div @click="handleDel" class="operator-text" v-has="'document:deleteBatch'">
<a-icon type="delete"/>
{{$t('BatchDelete')}}
</div>
</div>
<div style="width: 100%">
<!-- 表格-10控件-->
<table-collection ref="CollectionTabel" :url='url' :paramsManifest='paramsManifest' @rowValue='rowValue' :formInline='formInline' @LoginUserType='LoginUserType' @value='value'/>
</div>
<!-- 添加--->
<a-modal v-model="areaVisible" :title="$t('ParameterLibrary')" width='750px' :footer="null">
<parameter-library-add v-if='areaVisible' :paramsManifest='paramsManifest'/>
</a-modal>
<!-- 冻结配置--->
<a-modal v-model="areaVisibleFreeze" :title="$t('FreezeConfiguration')" width='750px' :footer="null">
<a-form-model
class='tag-module'
ref='ruleForm'
:model='Dateline'
:rules='rules'
:label-col='labelCol'
:wrapper-col='wrapperCol'
>
<a-row :gutter='24'>
<a-col :span='12'>
<a-form-model-item ref='region' :label="$t('FreezeConfiguration')" prop='region'>
<a-select :placeholder="$t('PleaseSelect')+$t('FreezeConfiguration')" v-model="Dateline.paramsConfig">
<a-select-option v-for="(item, key) in FreezeList" :key="key" :value="item.value">
<span style="display: inline-block;width: 100%" :title=" item.label ">
{{ item.label }}
</span>
</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
<div class="imports-footer">
<div class="imports-footer-wrap">
<a-button class="imports-btn imports-sub" type="primary" @click="handleSubmitFreeze" v-has="'split:sarFileSplitItems:importSplitResult'">{{$t('preservation')}}</a-button>
<a-button class="imports-btn" type="primary" @click="cancleImportsFreeze">{{$t('cancel')}}</a-button>
</div>
</div>
</a-modal>
<!-- 分配填写人--->
<a-modal v-model="areaVisibleAssignedby" :title="$t('Assignedby')" width='950px' :footer="null">
<assigned-by v-if='areaVisibleAssignedby' :selectedRowKeysArray='selectedRowKeysArray' @areaVisibleAssignedbyflag='areaVisibleAssignedbyflag'/>
</a-modal>
<!-- 截至时间--->
<a-modal v-model="areaVisibleTaskCutOffTime" :title="$t('TaskCutOffTime')" width='650px' :footer="null">
<task-cut-off-time v-if='areaVisibleTaskCutOffTime' :selectedRowKeysArray='selectedRowKeysArray' @areaVisibleTaskCutOffTimeflag='areaVisibleTaskCutOffTimeflag'/>
</a-modal>
<!-- 引用参数--->
<a-modal v-model="areaVisiblereferenceparameter" :title="$t('referenceparameter')" width='650px' :footer="null">
<reference-parameter v-if='areaVisiblereferenceparameter' :paramsManifest='paramsManifest' :selectedRowKeysArray='selectedRowKeysArray'/>
</a-modal>
</a-card>
</template>
<script>
import TableCollection from '@/components/tableCollection/index'
import { getAction,postAction } from '../../../api/manage'
import ParameterLibraryAdd from '@/components/ParameterLibraryAdd/index'
import TaskCutOffTime from '@/components/TaskCutOffTime/index'
import ReferenceParameter from '@/components/ReferenceParameter/index'
import AssignedBy from '@/components/AssignedBy/index'
import axios from 'axios'
import { ACCESS_TOKEN } from '@/store/mutation-types'
import Vue from 'vue'
import moment from 'moment'
export default {
name: 'ParameterItemCollectionList',
components:{
TableCollection,
ParameterLibraryAdd,
AssignedBy,
TaskCutOffTime,
ReferenceParameter
},
data(){
return{
columns:[
{
title: this.$t('title'),
align: 'center',
dataIndex: 'title',
scopedSlots: { customRender: 'paramsManifestClick' }
},
{
title: this.$t('status'),
align: 'center',
dataIndex: 'state',
},
{
title: this.$t('parameterTemplateName'),
align: 'center',
dataIndex: 'paramsTemplateName',
},
{
title: this.$t('collectionCompletionTime'),
align: 'center',
dataIndex: 'finishTime',
},
{
title: this.$t('Version'),
align: 'center',
dataIndex: 'version',
},
{
title: this.$t('creator'),
align: 'center',
dataIndex: 'createBy',
},
{
title: this.$t('createTime'),
align: 'center',
dataIndex: 'createTime',
},
{
title: this.$t('operation'),
align: 'center',
fixed: 'right',
width: 200,
scopedSlots: { customRender: 'operation' }
}
],
selectedRowKeys: [],
formInline: {},
url: {
tableHeader: 'params/collectManifest/getHeader',
tableList: 'params/collectManifest/list',
add: 'params/collectManifest/submit',
getLoginUserType: 'params/collectManifest/getLoginUserType', // 获取当前登陆人
getquerySdtList: 'params/collectManifest/querySdtList', // 获取工程接口人的列表
updateSdt: 'params/collectManifest/updateSdt', // 提交工程接口人
deleteBatch: 'params/collectManifest/deleteBatch',
// deleteAll: 'params/manifest/deleteBatch',
// conAdd: 'params/config/addBatch',
// conList: 'params/config/list',
},
loading: false,
dataSource: [],
areaVisible: false, // 弹框的控制
configureareaVisible: false, // 配置的彈框
pageNo: 1,
pageSize: 10,
total: 0,
selectedRowKeysArray: '',
templatetitle: '',
templatetitleId: '',
rowId: '',
version: 0,
itemId: '',
selectedRowKeysValue: [], // table列表所选得数据
token:Vue.ls.get(ACCESS_TOKEN),
homo: 0, // 认证工程师
sdt: 0, // 工程接口人
dre: 0, // 填写人
Dateline: {},
areaVisibleFreeze: false, // 冻结配置
areaVisibleAssignedby: false, // 分配填写人弹框
areaVisibleTaskCutOffTime: false, // 截至时间弹框
areaVisiblereferenceparameter: false, // 引用参数弹框
wrapperCol: {
xs: { span: 24 },
sm: { span: 14 }
},
labelCol: {
xs: { span: 24 },
sm: { span: 7 }
},
rules: {},
FreezeList: [], // 冻结字段
}
},
props: {
paramsManifest: {
type: Object,
default: {},
require: true
}
},
mounted() {},
methods:{
// 判断是否有权限 认证工程师 待发起收集
// 添加 批量删除 下发收集 冻结配置 工程接口人列修改
permission() {
// 判断是否具有提交权限
// 认证工程师
// 定义开关 0为没有权限 1为有权限
let flag = 1
if(this.homo) {
if(this.selectedRowKeysValue.length == 0) {
flag = 0
this.$message.success(this.$t('selectLeastOne'))
} else {
this.selectedRowKeysValue.forEach((item, index) => {
if(item.state !== '待发起收集') {
flag = 0
}
})
if(flag === 1) {
flag = 1
} else {
this.$message.warning(this.$t('operatethisbutton'))
}
}
}else {
this.$message.success(this.$t('operatethisbutton'))
}
return flag
},
LoginUserType(val) {
val.split(',').forEach((item,index) => {
if(item === 'homo') {
this.homo = 1
} else if(item === 'sdt') {
this.sdt = 1
} else if(item === 'dre') {
this.dre = 1
}
})
},
// 表格所选中得行内容
rowValue(val) {
this.selectedRowKeysValue = val
},
// 表格所选中得id
value(val) {
this.selectedRowKeys = val,
this.selectedRowKeysArray = val.join(',')
},
// 冻结配置
freezeConfiguration() {
this.areaVisibleFreeze = true
// 获取冻结配置数据
this.getFreeze()
},
// 冻结配置提交
handleSubmitFreeze() {
let _this = this
let param = {paramsManifestId: this.paramsManifest.id, paramsConfigIds: this.Dateline.paramsConfig}
axios({
url: '/jero-boot/params/collectManifest/lockConfigColumn',
method: 'post',
data: param,
transformRequest: [function (data) {
let ret = ''
for (let it in data) {
ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
}
return ret
}],
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'X-Access-Token':_this.token
}
})
.then( (res) =>{
console.log(res)
if (res.data.success) {
_this.$message.success(res.data.result)
this.areaVisibleFreeze = false
this.$refs.CollectionTabel.getTableList()
}else{
_this.$message.warning(res.data.result)
}
})
.catch( (error) =>{
console.log(error);
});
},
// 冻结配置取消
cancleImportsFreeze() {
this.areaVisibleFreeze = false
},
getFreeze() {
let _this = this
let param = {paramsManifestId: this.paramsManifest.id, configFlag: 2}
axios({
url: '/jero-boot/params/collectManifest/getConfigLableList',
method: 'post',
data: param,
transformRequest: [function (data) {
let ret = ''
for (let it in data) {
ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
}
return ret
}],
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'X-Access-Token':_this.token
}
})
.then( (res) =>{
console.log(res)
if (res.data.success) {
this.FreezeList = res.data.result
}else{
_this.$message.warning(res.data.result)
}
})
.catch( (error) =>{
console.log(error);
});
},
// 下发收集
distributionAndCollection() {
// 先判断是否有权限
let permission = this.permission()
if(permission) {
let _array = []
this.selectedRowKeysValue.forEach((item, index) => {
_array.push(item.id)
})
let _this = this
let param = {projectId: this.$route.query.id, ids: _array.join(',')}
axios({
url: '/jero-boot/params/collectManifest/issueCollection',
method: 'post',
data: param,
transformRequest: [function (data) {
let ret = ''
for (let it in data) {
ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
}
return ret
}],
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'X-Access-Token':_this.token
}
})
.then( (res) =>{
console.log(res)
if (res.data.success) {
_this.$message.success(res.data.result)
_this.areaVisible = false
_this.getTableList()
_this.selectedRowKeysValue=[]
}else{
_this.$message.warning(res.data.result)
}
})
.catch( (error) =>{
console.log(error);
});
}
},
// 添加
handleAdd() {
// 先判断是否有权限
let permission = this.permission()
if(permission) {
this.areaVisible = true
}
},
// 提交
handleSubmit() {
let postDate = []
this.selectedRowKeysValue.forEach((item, index) => {
let postDateobj = {}
Object.keys(item).forEach((itemIn, index) => {
if(itemIn !== 'sdt') {
if(item[itemIn] instanceof Object) {
postDateobj[itemIn] = item[itemIn]
}
}
})
postDateobj.id = item.id
postDate.push(postDateobj)
})
let configDataList = { configDataList: postDate }
if(this.selectedRowKeys.length == 0) {
this.$message.warning(this.$t('selectLeastOne'))
}else {
postAction(this.url.add, configDataList).then((res) => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
} else {
this.$message.warning(this.$t('operationFailed'))
}
})
}
},
// 退回
returnData() {
let _array = []
this.selectedRowKeysValue.forEach((item, index) => {
_array.push(item.id)
})
let _this = this
let param = {ids: _array.join(',')}
axios({
url: '/jero-boot/params/collectManifest/back',
method: 'post',
data: param,
transformRequest: [function (data) {
let ret = ''
for (let it in data) {
ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
}
return ret
}],
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'X-Access-Token':_this.token
}
})
.then( (res) =>{
console.log(res)
if (res.data.success) {
_this.$message.success(res.data.result)
_this.getTableList()
_this.selectedRowKeysValue=[]
}else{
_this.$message.warning(_this.$t('operationFailed'))
}
})
.catch( (error) =>{
console.log(error);
});
},
// 强制撤回
compulsoryWithdrawal() {
let _array = []
this.selectedRowKeysValue.forEach((item, index) => {
_array.push(item.id)
})
let _this = this
let param = {ids: _array.join(',')}
axios({
url: '/jero-boot/params/collectManifest/withdraw',
method: 'post',
data: param,
transformRequest: [function (data) {
let ret = ''
for (let it in data) {
ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
}
return ret
}],
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'X-Access-Token':_this.token
}
})
.then( (res) =>{
console.log(res)
if (res.data.success) {
_this.$message.success(res.data.result)
_this.getTableList()
_this.selectedRowKeysValue=[]
}else{
_this.$message.warning(_this.$t('operationFailed'))
}
})
.catch( (error) =>{
console.log(error);
});
},
// 分配填写人
assignedBy() {
this.areaVisibleAssignedby = true
},
// 分配填写人确定后弹框关闭
areaVisibleAssignedbyflag(val) {
this.areaVisibleAssignedby = val
},
// 截止时间
TaskCutOffTime() {
this.areaVisibleTaskCutOffTime = true
},
// 截至时间确定弹框关闭
areaVisibleTaskCutOffTimeflag(val) {
this.areaVisibleTaskCutOffTime = val
this.$refs.CollectionTabel.getTableList()
},
//引用参数
referenceparameter() {
this.areaVisiblereferenceparameter = true
},
handleModule() {
},
handleCody() {
console.log(this.paramsManifest,'paramsManifestparamsManifestparamsManifestparamsManifest')
},
searchQuery() {
this.pageNo = 1
this.$refs.CollectionTabel.getTableList()
},
searchReset() {
this.$refs.CollectionTabel.getTableListReset()
},
handleDel(){
// 先判断是否有权限
let permission = this.permission()
if(permission) {
let param={
ids: this.selectedRowKeysArray
}
if (this.selectedRowKeys.length > 0) {
let _this = this
this.$confirm({
content: _this.$t('ConfirmBatchDeletion'),
onOk() {
axios({
url: '/jero-boot/params/collectManifest/deleteBatch',
method: 'post',
data: param,
transformRequest: [function (data) {
let ret = ''
for (let it in data) {
ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
}
return ret
}],
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'X-Access-Token':_this.token
}
})
.then( (res) =>{
if (res.data.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
_this.selectedRowKeys = []
_this.$refs.CollectionTabel.getData()
_this.$refs.CollectionTabel.getTableList()
}else{
_this.$message.warning(_this.$t('operationFailed'))
}
})
.catch( (error) =>{
console.log(error);
});
}
})
} else {
this.$message.warning(this.$t('selectLeastOne'))
}
}
},
pageOnChange() {
},
SizeChange() {
},
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
.doc-detail {
background: #fff;
height: 100%;
.Virtual-detail-header {
width: 100%;
height: 68px;
line-height: 68px;
padding: 0 32px 0 32px;
box-sizing: border-box;
display: flex;
justify-content: space-between;
border-bottom: 2px #eff1f3 solid;
background: #fff;
.Virtual-detail-title {
display: inline-block;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
font-size: 20px;
font-weight: 400;
color: #040B29;
line-height: 68px;
}
.doc-detail-right {
width: 800px;
line-height: 68px;
display: flex;
}
}
.Virtual-detail-content {
padding: 0 38px 0 38px;
box-sizing: border-box;
font-size: 16px;
.box-title-text-add {
line-height: 1.4;
}
.title-text-add {
display: inline-block;
font-weight: 500;
margin-right: 16px;
height: 42px;
line-height: 42px;
}
}
}
.header-text {
font-size: 16px;
font-weight: 400;
height: 60px;
color: #000F16;
line-height: 40px;
}
.box-title-text {
line-height: 1.4;
display: flex;
align-items: center;
margin-bottom: 10px;
}
.title-text {
width: 20%;
min-width: 110px;
color: #000F16;
display: inline-block;
font-weight: 500;
font-size: 14px;
margin-right: 16px;
margin-top: 3px;
text-align: right;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.box-input {
display: inline-block;
width: 70%;
height: 38px;
margin-top: 2px;
}
.box-button {
height: 38px;
}
.text-operation {
margin-right: 8px;
}
.page {
text-align: right;
margin-top: 20px;
}
.operator-text-left {
font-size: 14px;
margin-right: 20px;
background: #eff1f3;
padding: 8px 8px;
cursor: pointer;
border-radius: 4px;
}
</style>
<style>
.box-input .ant-select-selection {
height: 38px !important;
}
.box-input .ant-select-selection__rendered {
line-height: 38px;
}
</style>