Files
laws_weilai/jero-web/src/views/businessSupport/technologyAssessment/index.vue
T

595 lines
19 KiB
Java

<template>
<a-card :bordered="false">
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="8">
<div class="box-title-text">
<div class="title-text" :title="$t('standard')">
<span>{{$t('standard')}}</span>
</div>
<j-input class="box-input" :placeholder="$t('PleaseEnter')+$t('standard')"
v-model="queryParam.serialNumber"></j-input>
</div>
</a-col>
<a-col :md="6" :sm="8">
<div class="box-title-text">
<div class="title-text" :title="$t('title')">
<span>{{$t('title')}}</span>
</div>
<j-input class="box-input" :placeholder="$t('PleaseEnter')+$t('title')"
v-model="queryParam.title"></j-input>
</div>
</a-col>
<a-col :md="6" :sm="8">
<div class="box-title-text tree-select">
<div class="title-text" :title="$t('technicalField')">
<span>{{$t('technicalField')}}</span>
</div>
<a-tree-select
tree-node-filter-prop="title"
v-model="queryParam.technologyTerritory"
:maxTagCount="1"
:getPopupContainer="triggerNode=> triggerNode.parentNode"
class="box-input"
style="width: 100%"
:tree-data="CategoryTreeList"
tree-checkable
:placeholder="$t('PleaseSelect')+$t('technicalField')"
/>
</div>
</a-col>
<template v-if="toggleSearchStatus">
<a-col :md="6" :sm="8">
<div class="box-title-text">
<div class="title-text" :title="$t('ProcessStatus')">
<span>{{$t('ProcessStatus')}}</span>
</div>
<a-select :placeholder="$t('PleaseSelect')+$t('ProcessStatus')"
class="box-input"
:getPopupContainer="triggerNode=> triggerNode.parentNode"
allowClear
v-model="queryParam.flowStatus">
<a-select-option v-for="(item, key) in gatherResultList"
:key="key"
:value="item.value">
<span style="display: inline-block;width: 100%" :title=" item.name">
{{ item.name }}
</span>
</a-select-option>
</a-select>
</div>
</a-col>
<a-col :md="6" :sm="8">
<div class="box-title-text">
<div class="title-text" :title="$t('brand')">
<span>{{$t('brand')}}</span>
</div>
<j-multi-select-tag class="box-input" v-model="queryParam.brand"
:placeholder="$t('PleaseSelect')+$t('brand')"
:type="'select'"
:triggerChange="false" :dictCode="'brand'"/>
</div>
</a-col>
</template>
<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 @click="handleToggleSearch" style="margin-left: 8px">
{{ !toggleSearchStatus ? $t('open') : $t('away') }}
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
</a>
</a-col>
</span>
</a-row>
</a-form>
</div>
<div class="table-operator">
<div @click="initiatingProcessClick"
v-has="'regulatoryAndTechnicalAssessment:initiationProcess'"
class="operator-text">
<a-icon type="solution"/>
{{$t('initiatingProcess')}}
</div>
<div @click="BatchDelete"
v-has="'regulatoryAndTechnicalAssessment:batchDelete'"
class="operator-text">
<a-icon type="delete"/>
{{$t('BatchDelete')}}
</div>
</div>
<div>
<a-table
ref="table"
size="middle"
:components="drag(columns,'columns')"
:loading="loading"
:pagination="false"
:scroll="{x: '100%',y:'calc(100vh - 140px)'}"
rowKey="id"
:data-source="dataSource"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
:columns="columns"
>
<!-- -->
<span slot="operation" slot-scope="text,record">
<!-- <a class="text-operation" @click="viewProcessClick(record)">{{$t('viewProcess')}}</a>-->
<!-- v-if="record.flowStatus == 'Completed'"-->
<a class="text-operation"
@click="evaluationResultsClick(record)">{{$t('evaluationResults')}}</a>
<a class="text-operation"
v-if="(record.flowStatus == 'Completed' && userInfoQuery.username == record.createBy) || administrators"
v-has="'regulatoryAndTechnicalAssessment:delete'"
@click="deleteData(record)">{{$t('delete')}}</a>
</span>
</a-table>
<div class="page" v-if="dataSource && dataSource.length > 0">
<a-pagination
:show-total="total => $t('total')+` ${total} `+$t('strip')"
show-quick-jumper
show-size-changer
:page-size.sync="pageSize"
:total="total"
:current="pageNo"
@change="pageOnChange"
@showSizeChange="SizeChange"
/>
</div>
</div>
<a-modal
:title="$t('initiatingProcess')"
:width="600"
:visible="visible"
:maskClosable="false"
@ok="handleOk"
@cancel="visible = false"
>
<a-form-model :model="formInline" class="formAdd" :rules="rules" ref="ruleForm">
<a-row :gutter="24">
<a-col :span="24">
<div class="box-title-text">
<div class="title-text" style="margin-top: -18px">
<span class="Required">*</span>
<span class="title-text-text"
:title="$t('standardDecompositionDocument')">{{$t('standardDecompositionDocument')}}</span>
</div>
<a-form-model-item class="itemModel" prop="whetherTobring">
<a-select :placeholder="$t('PleaseSelect')+$t('standardDecompositionDocument')"
class="box-input"
:getPopupContainer="triggerNode=> triggerNode.parentNode"
allowClear
v-model="formInline.whetherTobring">
<a-select-option v-for="(item, key) in whetherTobringList"
:key="key"
:value="item.value">
<span style="display: inline-block;width: 100%" :title=" item.name">
{{ item.name }}
</span>
</a-select-option>
</a-select>
</a-form-model-item>
</div>
</a-col>
</a-row>
</a-form-model>
</a-modal>
<processInformation ref="processInformationRef"/>
</a-card>
</template>
<script>
import { getAction, postAction, deleteAction } from '@/api/manage'
import processInformation from './components/processInformation'
import { mapGetters } from 'vuex'
import { ResizeHeader, ResizeColumnProvide } from '@/mixins/header'
export default {
name: 'index',
components: {
processInformation
},
mixins:[ResizeHeader, ResizeColumnProvide],
data() {
return {
//url传参严格按照当前命名
url: {
list: '/lawsTechnologyEvaluation/lawsTechnologyEvaluationEO/page',
getSysCategoryTree: '/sys/category/getSysCategoryTree',
deleteBatch: '/lawsTechnologyEvaluation/lawsTechnologyEvaluationEO/deleteBatch'
},
visible: false,
loading: false,
toggleSearchStatus: false,
dataSource: [],
selectedRowKeys: [],
selectedRowKeysRecord: [],
serialNumber: '',
total: 0,
pageSize: 10,
pageNo: 1,
CategoryTreeList: [],
queryParam: {},
formInline: {},
rules: {
whetherTobring: [
{
required: true,
message: this.$t('standardDecompositionDocument') + this.$t('cannotEmpty'),
trigger: 'change'
}
]
},
whetherTobringList: [
{
value: '1',
name: this.$t('yes')
},
{
value: '2',
name: this.$t('notOnlyRz')
}
],
gatherResultList: [
{
value: 'Underway',
name: this.$t('Underway')
},
{
value: 'Completed',
name: this.$t('Finished')
}
],
columns: [
{
title: this.$t('standard'),
align: 'left',
dataIndex: 'serialNumber',
ellipsis: true,
width: 170
},
{
title: this.$t('title'),
align: 'left',
dataIndex: 'title',
ellipsis: true,
width: 170
},
{
title: this.$t('technicalField'),
align: 'left',
width: 170,
ellipsis: true,
dataIndex: 'technologyTerritoryName'
},
{
title: this.$t('evaluationMethod'),
align: 'left',
width: 170,
ellipsis: true,
dataIndex: 'evaluationMethodsName'
},
{
title: this.$t('ProcessStatus'),
align: 'left',
width: 170,
ellipsis: true,
dataIndex: 'flowStatusName'
},
{
title: this.$t('Sponsor'),
align: 'left',
width: 140,
ellipsis: true,
dataIndex: 'createBy'
},
{
title: this.$t('brand'),
align: 'left',
ellipsis: true,
width: 140,
dataIndex: 'brand_text'
},
{
title: this.$t('dateOfInitiation'),
align: 'left',
ellipsis: true,
width: 170,
dataIndex: 'startTime'
},
{
title: this.$t('closingDate'),
align: 'left',
ellipsis: true,
width: 170,
dataIndex: 'endTime'
},
{
title: this.$t('remarks'),
align: 'left',
ellipsis: true,
width: 170,
dataIndex: 'remark'
},
{
title: this.$t('operation'),
align: 'left',
fixed: 'right',
width: 220,
scopedSlots: { customRender: 'operation' }
}
],
userInfoQuery: {},
administrators: false
}
},
mounted() {
this.getList()
this.getSysCategoryTree()
this.userInfoQuery = this.userInfo()
this.administrators = false
if (this.userInfo().userRoleList && this.userInfo().userRoleList.length > 0) {
this.userInfo().userRoleList.forEach(res => {
if (res.roleCode == 'admin') {
this.administrators = true
}
})
}
},
methods: {
...mapGetters(['userInfo']),
getSysCategoryTree() {
getAction(this.url.getSysCategoryTree, {}).then((res) => {
if (res.success) {
this.CategoryTreeList = res.result
} else {
this.CategoryTreeList = []
}
})
},
deleteData(val) {
let _this = this
this.$confirm({
content: _this.$t('ConfirmDelete'),
onOk() {
deleteAction(_this.url.deleteBatch, { ids: val.id }).then((res) => {
if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
_this.getList()
} else {
_this.$message.warning(res.message)
}
})
}
})
},
BatchDelete() {
if (this.selectedRowKeys.length > 0) {
let _this = this
this.$confirm({
content: _this.$t('ConfirmBatchDeletion'),
onOk() {
let idList = []
let selectedRowKeysRecord = JSON.parse(JSON.stringify(_this.selectedRowKeysRecord))
for (let i = 0; i < selectedRowKeysRecord.length; i++) {
if ((selectedRowKeysRecord[i].flowStatus == 'Completed' && selectedRowKeysRecord[i].createBy == _this.userInfo().username)
|| _this.administrators) {
idList.push(selectedRowKeysRecord[i].id)
}
}
if (idList.length > 0) {
deleteAction(_this.url.deleteBatch, { ids: idList.join(',') }).then((res) => {
if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
_this.selectedRowKeys = []
_this.getList()
} else {
_this.$message.warning(res.message)
}
})
} else {
_this.$message.warning(_this.$t('doNotHavePermissionDeleteData'))
}
}
})
} else {
this.$message.warning(this.$t('selectLeastOne'))
}
},
handleToggleSearch() {
this.toggleSearchStatus = !this.toggleSearchStatus
},
searchQuery() {
this.pageNo = 1
this.getList()
},
searchReset() {
this.queryParam = {}
this.$route.query.serialNumber = ''
this.$route.query.flowStatus = ''
this.pageNo = 1
this.getList()
},
pageOnChange(page) {
this.pageNo = page
this.getList()
},
SizeChange(page, pageSize) {
this.pageNo = 1
this.pageSize = pageSize
this.getList()
},
getList() {
let queryParam = JSON.parse(JSON.stringify(this.queryParam))
Object.keys(queryParam).forEach(val => {
if (queryParam[val] instanceof Array) {
queryParam[val] = queryParam[val].join(',')
}
})
let query = {
pageNo: this.pageNo,
pageSize: this.pageSize,
serialNumber: this.$route.query.serialNumber ? this.$route.query.serialNumber : '',
flowStatus: this.$route.query.flowStatus ? this.$route.query.flowStatus : '',
...queryParam
}
this.loading = true
getAction(this.url.list, query).then((res) => {
if (res.success) {
if (res.result.current > 1 && res.result.records.length == 0) {
this.pageNo = 1
this.getList()
return
}
this.dataSource = res.result.records || []
this.total = res.result.total
this.loading = false
} else {
this.loading = false
}
})
},
onSelectChange(value, record) {
this.selectedRowKeys = value
this.selectedRowKeysRecord = record
},
handleOk() {
this.$refs.ruleForm.validate(valid => {
if (valid) {
this.visible = false
}
})
},
initiatingProcessClick() {
// this.visible = true
// this.formInline = {}
// this.$nextTick(() => {
// this.$refs.ruleForm.clearValidate()
// })
this.formInline.firstInitiation = '1'
this.formInline.whetherTobring = '1'
let newUrl = this.$router.resolve({
path: '/evaluationInitiationProcess',
query: this.formInline
})
// let newUrl = this.$router.resolve({
// path: '/evaluationProcess'
// })
window.open(newUrl.href, '_blank')
},
viewProcessClick(row) {
this.$refs.processInformationRef.getData(JSON.parse(JSON.stringify(row)))
},
evaluationResultsClick(row) {
if (row.evaluationType == 'Feedback evaluation') {
let newUrl = this.$router.resolve({
path: '/evaluationResultsWhole',
query: {
id: row.id,
processBackground: row.processBackground,
serialNumber: row.serialNumber,
lawsTechnologyEvaluationId: row.id,
standId: row.standId,
remark: row.remark,
createBy: row.createBy,
flowStatus: row.flowStatus
}
})
window.open(newUrl.href, '_blank')
} else {
let newUrl = this.$router.resolve({
path: '/evaluationResultsClause',
query: {
id: row.id,
processBackground: row.processBackground,
serialNumber: row.serialNumber,
lawsTechnologyEvaluationId: row.id,
standId: row.standId,
remark: row.remark,
createBy: row.createBy,
flowStatus: row.flowStatus
}
})
window.open(newUrl.href, '_blank')
}
}
}
}
</script>
<style>
.tree-select .ant-select-tree-dropdown {
height: 298px !important;
}
</style>
<style scoped>
@import '~@assets/less/common.less';
.page {
text-align: right;
margin-top: 20px;
}
.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;
/*margin-top: 2px;*/
}
.text-operation {
margin-right: 8px;
}
.itemModel {
width: calc(100% - 130px);
display: inline-block;
margin-top: 2px;
}
.Required {
color: red;
margin-right: 4px;
}
::v-deep .ant-table-row:first-child {
background: #fff !important;
opacity: 0.9;
}
::v-deep .ant-table-body {
background: transparent !important;
}
::v-deep .ant-table-placeholder {
margin-top: 8px !important;
}
</style>