[update] 删除企标发起更改和临时权限的功能

This commit is contained in:
lideqin
2024-06-18 09:26:47 +08:00
parent e43bbdfc09
commit d4bc7c52b0
3 changed files with 1 additions and 464 deletions
@@ -78,12 +78,6 @@
<a-button icon="setting" type="primary" ghost @click="handleAllocationStandard" v-has="'enterpriseStandard:allocationStandard'">{{ $t('enterpriseStandardLibrary.standard.allocationStandard') }}</a-button>
<!-- 移出标准 -->
<a-button icon="minus-circle" type="primary" ghost @click="handleShiftOutStandard" v-has="'enterpriseStandard:shiftOutStandard'">{{ $t('enterpriseStandardLibrary.standard.shiftOutStandard') }}</a-button>
<!-- 发起更改 -->
<a-button icon="setting" type="primary" ghost @click="handleInitChange" v-has="'enterpriseStandard:initChange'">{{ $t('enterpriseStandardLibrary.standard.initChange') }}</a-button>
<!-- 临时权限设置 -->
<a-button icon="setting" type="primary" ghost @click="handleTemporaryPermissSet" v-has="'enterpriseStandard:temporaryPermissSet'">{{ $t('enterpriseStandardLibrary.standard.temporaryPermissionSet') }}</a-button>
<!-- 临时权限记录 -->
<a-button icon="setting" type="primary" ghost @click="handleTemporaryPermissionRecord" v-has="'enterpriseStandard:temporaryPermissRecord'">{{ $t('enterpriseStandardLibrary.standard.temporaryPermissionRecord') }}</a-button>
</div>
<div>
<j-table
@@ -209,12 +203,8 @@
<enterprise-standard-modal ref="modalForm" @ok="modalFormOk"></enterprise-standard-modal>
<!-- 配置标准-标准选择弹框 -->
<allocation-standard-drawer ref="allocationStandardDrawer" @ok="modalOkDoNotRefreshTree"></allocation-standard-drawer>
<!-- 临时权限设置 -->
<temporary-permission-set ref="temporaryPermissionSet" @ok="modalFormOk"></temporary-permission-set>
<!-- 左侧树节点的新增和编辑 -->
<tree-node-modal ref="treeNodeModal" @ok="treeNodeModalOk"></tree-node-modal>
<!-- 临时权限记录 -->
<temporary-permission-record ref="temporaryPermissionRecord" @ok="modalFormOk"></temporary-permission-record>
</a-card>
</template>
@@ -235,19 +225,16 @@ import {
} from '@api/enterpriseStandardLibraryApi'
// 添加、编辑弹框
import EnterpriseStandardModal from './modules/EnterpriseStandardModal'
// 临时权限设置
import TemporaryPermissionSet from './modules/TemporaryPermissionSet'
import TreeNodeModal from './modules/TreeNodeModal'
// 配置标准弹框
import AllocationStandardDrawer from './modules/AllocationStandardDrawer'
import { postDownFile, downloadFile, postAction } from '@/api/manage'
import TemporaryPermissionRecord from './modules/TemporaryPermissionRecord'
import { mapGetters } from 'vuex'
import { isHasPermission } from '@/utils/hasPermission'
export default {
name: 'EnterpriseStandardList',
components: { TemporaryPermissionRecord, AllocationStandardDrawer, TreeNodeModal, TemporaryPermissionSet, EnterpriseStandardModal, JTable, Search },
components: { AllocationStandardDrawer, TreeNodeModal, EnterpriseStandardModal, JTable, Search },
mixins: [ConfigurableTableMixin],
data () {
return {
@@ -613,40 +600,6 @@ export default {
this.loading = false
})
},
// 发起更改
handleInitChange () {
// 没有选择列表数据,需要提示“请选择一条列表数据”
if (!this.selectedRowKeys || this.selectedRowKeys.length !== 1) {
this.$message.warning(this.$t('selectOne'))
return
}
this.$router.push({
path: '/workCenter/enterpriseStandardChange/enterpriseStandardChangeFlow',
query: {
enStandardId: this.selectedRowKeys[0]
}
})
},
// 临时权限设置
handleTemporaryPermissSet () {
// 没有选择列表数据,需要提示“选中至少一条列表数据”
if (!this.selectedRowKeys || this.selectedRowKeys.length === 0) {
this.$message.warning(this.$t('selectLeastOne'))
return
}
const notPremissData = this.selectionRows.filter(item => !item.detailFlag).map(item => item.standard_number)
if (notPremissData && notPremissData.length > 0) {
// 选中数据存在没有查看权限的数据
this.$message.warning(this.$t('enterpriseStandardLibrary.standard.youNot') +
notPremissData.join(',') + this.$t('enterpriseStandardLibrary.standard.dataPremissReCheck'))
return
}
this.$refs.temporaryPermissionSet.open(this.selectedRowKeys.join(','))
},
// 临时权限记录
handleTemporaryPermissionRecord () {
this.$refs.temporaryPermissionRecord.open()
},
// 操作栏的点击
operationClick (operation, record) {
if (operation.clickEvent === 'handleDelete') {
@@ -1,281 +0,0 @@
<template>
<j-modal
:title="title"
:maskClosable="true"
:width="1200"
:closable="true"
switchFullscreen
:footer="false"
@cancel="handleCancel"
:visible="visible">
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :sm="8">
<!-- 企标编号 -->
<a-form-item :label="$t('enterpriseStandardLibrary.reviewMeeting.enterpriseStandardNum')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
:placeholder="$t('pleaseEnter') + $t('enterpriseStandardLibrary.reviewMeeting.enterpriseStandardNum')"
v-model="queryParam.standardNumber">
</a-input>
</a-form-item>
</a-col>
<!-- 授权到期日期 -->
<a-col :sm="8">
<a-form-item :label="$t('enterpriseStandardLibrary.standard.authorizationExpirationDate')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker v-model="queryParam.authorizationExpirationDate"
format="YYYY-MM-DD" value-format="YYYY-MM-DD"
@change="onChange"></a-range-picker>
</a-form-item>
</a-col>
<a-col :sm="8">
<!-- 授权部门 -->
<a-form-item :label="$t('enterpriseStandardLibrary.standard.authorizationDepart')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-tree-select
tree-node-filter-prop="title"
v-model="queryParam.authorizationDepart"
:maxTagCount="1"
allowClear
:getPopupContainer="triggerNode=> triggerNode.parentNode"
class="box-input"
style="width: 100%"
:tree-data="categoryTreeList"
:placeholder="$t('pleaseSelect') + $t('enterpriseStandardLibrary.standard.authorizationDepart')"
treeCheckable
treeCheckStrictly
show-search
:filterTreeNode="filterTreeOption"
/>
</a-form-item>
</a-col>
<a-col :sm="8">
<!-- 授权人员 -->
<a-form-item :label="$t('enterpriseStandardLibrary.standard.authorizationUser')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
:placeholder="$t('pleaseEnter') + $t('enterpriseStandardLibrary.standard.authorizationUser')"
v-model="queryParam.authUser">
</a-input>
</a-form-item>
</a-col>
<div style="float: right;overflow: hidden;margin-right: 11px" class="table-page-search-submitButtons">
<a-button class="box-button" type="primary" icon="search" @click="searchQuery">{{ $t('query') }}</a-button>
<a-button class="box-button" icon="reload" style="margin-left: 8px" @click="searchReset">{{ $t('reset') }}</a-button>
</div>
</a-row>
</a-form>
</div>
<j-table
ref="table"
rowKey="id"
:can-drag="true"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:scroll="{x: '100%', y: 'calc(100vh - 500px)'}"
@change="handleTableChange">
<template v-slot:action="{text, record}">
<!-- 解除授权 -->
<a class="table-del" :disabled="isDisabled(record)" @click="handleCancelAuthor(record)">{{$t('enterpriseStandardLibrary.standard.cancelAuthor')}}</a>
</template>
</j-table>
</j-modal>
</template>
<script>
import { JeroListMixin } from '@/mixins/JeroListMixin'
import { cancelAuthor } from '@/api/enterpriseStandardLibraryApi'
import { queryDepartTreeList } from '@/api/api'
import JTable from '@/components/jero/JTable'
import { getAction } from '../../../../api/manage'
export default {
name: 'TemporaryPermissionRecord',
mixins: [JeroListMixin],
components: { JTable },
data () {
return {
title: this.$t('enterpriseStandardLibrary.standard.temporaryPermissionRecord'),
visible: false,
labelCol: {
span: 4
},
wrapperCol: {
span: 14
},
disableMixinCreated: true,
categoryTreeList: [], // 组织机构下拉框数据
columns: [
{
title: this.$t('serialNumber'),
dataIndex: '',
key: 'rowIndex',
align: 'center',
width: 80,
customRender: function (t, r, index) {
return parseInt(index) + 1
}
},
{ // 授权日期
title: this.$t('enterpriseStandardLibrary.standard.authorizationDate'),
align: 'center',
width: 180,
dataIndex: 'createTime',
scopedSlots: { customRender: 'text' }
},
{ // 授权到期日期
title: this.$t('enterpriseStandardLibrary.standard.maturityDate'),
align: 'center',
width: 180,
dataIndex: 'authExpireDate',
scopedSlots: { customRender: 'text' }
},
{ // 授权部门
title: this.$t('enterpriseStandardLibrary.standard.authorizationDepart'),
align: 'center',
width: 180,
dataIndex: 'authDept_dictText',
scopedSlots: { customRender: 'text' }
},
{ // 授权人员
title: this.$t('enterpriseStandardLibrary.standard.authorizationUser'),
align: 'center',
width: 180,
dataIndex: 'authUser_dictText',
scopedSlots: { customRender: 'text' }
},
{ // 授权企标
title: this.$t('enterpriseStandardLibrary.standard.authorizationStandard'),
align: 'center',
width: 180,
dataIndex: 'standardNumber',
scopedSlots: { customRender: 'text' }
},
{
title: this.$t('operation'),
scopedSlots: { customRender: 'action' },
align: 'center',
fixed: 'right',
width: 100
}
],
url: {
list: '/laws/standard/enterprise/tempAuthRecord'
}
}
},
mounted () {
this.getSysCategoryTree()
},
methods: {
open () {
this.visible = true
this.loadData()
},
// 获取组织机构树
getSysCategoryTree () {
queryDepartTreeList().then((res) => {
if (res.success) {
this.categoryTreeList = res.result
} else {
this.categoryTreeList = []
}
})
},
// 解除授权按钮是否不可点击
isDisabled (record) {
const authExpireDate = new Date(Date.parse(record.authExpireDate))
const currentDate = new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + new Date().getDate()
return new Date(Date.parse(authExpireDate)) < new Date(Date.parse(currentDate))
},
loadData (arg) {
if (!this.url.list) {
this.$message.warning('请设置url.list属性!')
return
}
// 加载数据 若传入参数1则加载第一页的内容
if (arg === 1) {
this.ipagination.current = 1
}
const params = this.getQueryParams()// 查询条件
if (params.authorizationDepart && params.authorizationDepart.length > 0) {
params.authDept = params.authorizationDepart.map(item => item.value).join(',')
}
this.loading = true
getAction(this.url.list, params).then((res) => {
if (res.success) {
// update-begin---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
this.dataSource = res.result.records || res.result
if (res.result.total) {
this.ipagination.total = res.result.total
} else {
this.ipagination.total = 0
}
// update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
},
filterTreeOption (input, option) {
const text = option.componentOptions.propsData.title || option.componentOptions.propsData.label
return text.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
onChange () {
if (this.queryParam.authorizationExpirationDate && this.queryParam.authorizationExpirationDate.length > 0) {
this.queryParam.startAuthExpireDate = this.queryParam.authorizationExpirationDate[0]
this.queryParam.endAuthExpireDate = this.queryParam.authorizationExpirationDate[1]
} else {
this.queryParam.authorizationExpirationDate = []
}
},
// 解除授权
handleCancelAuthor (record) {
this.$confirm({
title: this.$t('enterpriseStandardLibrary.standard.cancelAuthor'),
content: this.$t('enterpriseStandardLibrary.standard.confirmCancelAuthor'),
onOk: () => {
const params = {}
params.id = record.id
cancelAuthor(params).then(res => {
if (res.success) {
this.$message.success(res.message)
this.loadData()
} else {
this.$message.warning(res.message)
}
})
}
})
},
handleCancel () {
this.close()
},
close () {
this.queryParam = {}
this.visible = false
this.ipagination = {
current: 1,
pageSize: 10,
pageSizeOptions: ['10', '30', '50', '100', '150', '200'],
showTotal: (total, range) => {
return range[0] + '-' + range[1] + ' ' + this.$t('total') + total + this.$t('strip')
},
showQuickJumper: true,
showSizeChanger: true,
total: 0
}
}
}
}
</script>
<style scoped>
</style>
@@ -1,135 +0,0 @@
<template>
<j-modal
:title="title"
:maskClosable="true"
:width="800"
:closable="true"
switchFullscreen
@cancel="handleCancel"
@ok="handleOk"
:visible="visible">
<a-spin :spinning="confirmLoading">
<a-form :form="form">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('enterpriseStandardLibrary.standard.authorizationDepart')">
<j-select-depart
v-decorator.trim="[ 'deptIds', validatorRules.deptIds]"
:multi="true"
:backDepart="true"
:treeOpera="true">
</j-select-depart>
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('enterpriseStandardLibrary.standard.authorizationUser')">
<user-selection
type="checkbox"
v-decorator.trim="[ 'userIds', validatorRules.userIds]"
:nameStr="model.userNames"
:placeholder="$t('pleaseSelect') + $t('enterpriseStandardLibrary.standard.authorizationUser')"
@nameChange="userSelectNameChange">
</user-selection>
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('enterpriseStandardLibrary.standard.maturityDate')">
<a-date-picker
v-decorator.trim="[ 'authDate', validatorRules.authDate]"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
>
</a-date-picker>
</a-form-item>
</a-form>
</a-spin>
</j-modal>
</template>
<script>
import { temporaryPermissionSet } from '@/api/enterpriseStandardLibraryApi'
import UserSelection from '@/components/selection/UserSelection'
export default {
name: 'TemporaryPermissionSet',
components: { UserSelection },
data () {
return {
title: this.$t('enterpriseStandardLibrary.standard.temporaryPermissionSet'),
visible: false,
confirmLoading: false,
form: this.$form.createForm(this),
model: {},
labelCol: {
xs: { span: 24 },
sm: { span: 6 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 }
},
validatorRules: {
deptIds: {
rules: [
{ required: false, message: this.$t('pleaseEnter') + this.$t('enterpriseStandardLibrary.standard.authorizationDepart') }
],
validateTrigger: 'change'
},
userIds: {
rules: [
{ required: false, message: this.$t('pleaseEnter') + this.$t('enterpriseStandardLibrary.standard.authorizationUser') }
],
validateTrigger: 'change'
},
authDate: {
rules: [
{ required: true, message: this.$t('pleaseEnter') + this.$t('enterpriseStandardLibrary.standard.maturityDate') }
],
validateTrigger: 'change'
}
}
}
},
methods: {
open (standards) {
this.visible = true
this.form.resetFields()
this.model.standards = standards
},
userSelectNameChange (value) {
this.model.userNames = value
},
handleCancel () {
this.close()
},
handleOk () {
if (this.confirmLoading) return
this.form.validateFields((err, values) => {
if (!err) {
if (!values.deptIds && !values.userIds) {
this.$message.warning(this.$t('enterpriseStandardLibrary.standard.pleaseSelectUserOrDepart'))
return
}
this.confirmLoading = true
const param = Object.assign({}, values)
param.standardIds = this.model.standards
temporaryPermissionSet(param).then(res => {
if (res.success) {
this.$message.success(res.message)
this.$emit('ok')
this.close()
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.confirmLoading = false
})
}
})
},
close () {
this.visible = false
this.model = {}
}
}
}
</script>
<style scoped>
</style>