[update] 增加企标详情页,未完全写完,添加企标操作弹框

This commit is contained in:
lideqin
2023-09-08 17:42:21 +08:00
parent 798774b291
commit c7c1a9aa27
9 changed files with 682 additions and 39 deletions
+22 -1
View File
@@ -8,10 +8,31 @@ const getEnterpriseStandardSearchForm = (params) => getAction('/laws/standard/en
const getEnterpriseStandardAddForm = (params) => getAction('/laws/standard/enterprise/getFormModel', params)
// 根据id获取详情
const getEnterpriseStandardInfoById = (params) => getAction('/laws/standard/enterprise/getByIdAndModule', params)
// 配置标准
const allocationStandard = (params) => getAction('', params)
// 移出标准
const shiftStandard = (params) => getAction('', params)
// 获取左侧树列表
const getTreeList = (params) => getAction('', params)
// 发起变更
const initChange = (params) => getAction('', params)
// 临时权限设置
const temporaryPermissionSet = (params) => getAction('', params)
// 收藏企标
const collectStandard = (params) => getAction('', params)
// 分享企标
const shareStandard = (params) => getAction('', params)
export {
getEnterpriseStandardTableHeader,
getEnterpriseStandardSearchForm,
getEnterpriseStandardAddForm,
getEnterpriseStandardInfoById
getEnterpriseStandardInfoById,
allocationStandard,
shiftStandard,
getTreeList,
initChange,
temporaryPermissionSet,
collectStandard,
shareStandard
}
@@ -1,13 +1,35 @@
// 企标库的所有翻译
module.exports = {
// 企业标准
enterpriseStandard: {
standard: {
allocationStandard: '配置标准',
shiftOutStandard: '移出标准',
initChange: '发起更改',
temporaryPermissionSet: '临时权限设置',
collection: '收藏',
cancelCollection: '取消收藏',
templateExport: '企业标准模板'
templateExport: '企业标准模板',
pleaseSelectLeastOneNode: '请先选择二级及以下体系',
authorizationDepart: '授权部门',
authorizationUser: '授权人员',
maturityDate: '授权到期日期',
detailTitle: '企业标准详情页',
evaluate: '企标评价',
updateRecord: '更新记录',
submitQuestion: '提交问题',
standardResolutionSheet: '标准分解单'
},
// 宣贯
publicize: {
enterpriseStandardNum: '企标编号',
enterpriseStandardName: '企标名称',
publicizeData: '宣贯日期',
publicist: '宣贯人',
exportName: '企标宣贯表',
fileExportName: '企标宣贯表',
templateName: '企标宣贯模板',
releaseDate: '发布日期',
materialDate: '实施日期',
relatedMaterial: '相关材料'
}
}
+4
View File
@@ -150,6 +150,10 @@ export default {
color: #D52C26;
}
/deep/ .anticon {
color: #D52C26;
}
/* update_end author:sunjianlei date:20190509 for: 修改侧边导航栏滚动条的样式 */
</style>
+4 -1
View File
@@ -111,7 +111,8 @@ export const ConfigurableTableMixin = {
const tempColumns = []
columns.forEach(item => {
// 可点击项加入插槽
if (item.click === 'true') {
// 标准编号和标准名称可以跳转详情页
if (item.dbFieldName === 'standard_number' || item.dbFieldName === 'standard_name') {
item.scopedSlots = {
customRender: 'detailClick'
}
@@ -131,6 +132,7 @@ export const ConfigurableTableMixin = {
customRender: item.dbFieldName
}
}
console.log(item)
tempColumns.push(item)
})
if (this.showAction && this.operateColumn) {
@@ -142,6 +144,7 @@ export const ConfigurableTableMixin = {
operateColumn.width = width || 100
tempColumns.push(operateColumn)
}
console.log(tempColumns)
return tempColumns
},
/**
@@ -0,0 +1,231 @@
<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 :span="6">
<a-form-item :label="$t('enterpriseStandardLibrary.publicize.enterpriseStandardNum')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input :placeholder="$t('pleaseEnter')+$t('enterpriseStandardLibrary.publicize.enterpriseStandardNum')" v-model="queryParam.standardNo"></a-input>
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item :label="$t('enterpriseStandardLibrary.publicize.enterpriseStandardName')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input :placeholder="$t('pleaseEnter')+$t('enterpriseStandardLibrary.publicize.enterpriseStandardName')" v-model="queryParam.standardName"></a-input>
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item :label="$t('enterpriseStandardLibrary.publicize.publicizeData')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker
:placeholder="$t('pleaseEnter')+$t('enterpriseStandardLibrary.publicize.publicizeData')"
value-format="YYYY-MM-DD"
format="YYYY-MM-DD"
@change="publicizeDataChange"
v-model="queryParam.publicizeData">
</a-range-picker>
</a-form-item>
</a-col>
<template v-if="toggleSearchStatus">
<a-col :span="6">
<a-form-item :label="$t('enterpriseStandardLibrary.publicize.publicist')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input :placeholder="$t('pleaseEnter')+$t('enterpriseStandardLibrary.publicize.publicist')" v-model="queryParam.declareUserName"></a-input>
</a-form-item>
</a-col>
</template>
<div style="float: right;overflow: hidden;" class="table-page-search-submitButtons">
<a @click="handleToggleSearch">
{{ toggleSearchStatus ? $t('putAway') : $t('open') }}
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
</a>
<a-button type="primary" @click="searchQuery" icon="search" style="margin-left: 8px">{{ $t('query') }}</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">{{ $t('reset') }}</a-button>
</div>
</a-row>
</a-form>
</div>
<!-- 操作区域 -->
<div class="table-operator">
<!-- 导出-->
<a-button icon="upload" type="primary" ghost @click="handleExportXls($t('enterpriseStandardLibrary.publicize.exportName'))">
{{ $t('export') }}
</a-button>
<a-button icon="upload" type="primary" ghost @click="handleFileExport($t('enterpriseStandardLibrary.publicize.fileExportName'))">{{ $t('exportWithFile') }}</a-button>
<!-- 模板下载-->
<a-button type="primary" icon="download" ghost @click="downTemplate('enterpriseStandardLibrary.publicize.templateName')">
{{ $t('templateDownload') }}
</a-button>
</div>
<div>
<j-table
:can-drag="true"
:scroll="{x: '100%'}"
ref="table"
size="middle"
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<!-- 企标编号 -->
<template v-slot:enterpriseStandardNum="{text, record}">
<a-tooltip overlay-class-name="tooltip-style">
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
<a class="link-a" @click="handleGoDetail(record)">{{ text }}</a>
</a-tooltip>
</template>
<!-- 企标名称 -->
<template v-slot:enterpriseStandardName="{text, record}">
<a-tooltip overlay-class-name="tooltip-style">
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
<a class="link-a" @click="handleGoDetail(record)">{{ text }}</a>
</a-tooltip>
</template>
<!-- 相关材料 -->
<template v-slot:relatedMaterial="{text, record}">
<a-tooltip overlay-class-name="tooltip-style">
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
<a class="link-a" @click="handleRelatedMaterialClick(record)">{{ text }}</a>
</a-tooltip>
</template>
</j-table>
</div>
</a-card>
</template>
<script>
import '@assets/less/common.less'
import JTable from '@/components/jero/JTable'
import { JeroListMixin } from '@/mixins/JeroListMixin'
import Vue from 'vue'
import { ACCESS_TOKEN } from '@/store/mutation-types'
import { previewPdf } from '@/utils/previewPdf'
import { getFileAccessHttpUrl } from '@/api/manage'
const FILE_TYPE_IMGS = ['jpg', 'jpeg', 'png', 'raw']
const FILE_TYPE_PDF = 'pdf'
const Base64 = require('js-base64').Base64
export default {
name: 'EnterpriseStandardPublicize',
components: { JTable },
mixins: [JeroListMixin],
data () {
return {
labelCol: {
span: 4
},
wrapperCol: {
span: 18
},
columns: [
{
title: this.$t('enterpriseStandardLibrary.publicize.enterpriseStandardNum'),
align: 'center',
width: 180,
dataIndex: 'standardNo',
scopedSlots: { customRender: 'enterpriseStandardNum' }
},
{
title: this.$t('enterpriseStandardLibrary.publicize.enterpriseStandardName'),
align: 'center',
width: 180,
dataIndex: 'standardName',
scopedSlots: { customRender: 'enterpriseStandardName' }
},
{
title: this.$t('enterpriseStandardLibrary.publicize.releaseDate'),
align: 'center',
width: 180,
dataIndex: 'releaseDate',
scopedSlots: { customRender: 'text' }
},
{
title: this.$t('enterpriseStandardLibrary.publicize.materialDate'),
align: 'center',
width: 180,
dataIndex: 'implementationDate',
scopedSlots: { customRender: 'text' }
},
{
title: this.$t('enterpriseStandardLibrary.publicize.publicizeData'),
align: 'center',
width: 180,
dataIndex: 'declareDate',
scopedSlots: { customRender: 'text' }
},
{
title: this.$t('enterpriseStandardLibrary.publicize.publicist'),
align: 'center',
width: 180,
dataIndex: 'declareUserName',
scopedSlots: { customRender: 'text' }
},
{
title: this.$t('enterpriseStandardLibrary.publicize.relatedMaterial'),
align: 'center',
width: 180,
dataIndex: 'declareFileName',
scopedSlots: { customRender: 'relatedMaterial' }
}
],
url: {
list: '/enterprise/declare/page'
}
}
},
methods: {
publicizeDataChange (date) {
console.log(date)
this.queryParam.declareStartDate = date[0]
this.queryParam.declareEndDate = date[1]
},
// 点击跳转企标详情
handleGoDetail (record) {
this.$openPageNewSheet({
path: '/enterpriseStandardLibrary/enterpriseStandardDetail',
query: {
id: record.id
}
})
},
// 点击相关材料
handleRelatedMaterialClick (record) {
// 截取文件后缀名
const fileSuffix = record.declareFileName ? record.declareFileName.split('.')[record.declareFileName.split('.').length - 1] : ''
const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/download/${record.declareFile}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${record.declareFileName}`
// 图片预览,使用自己添加的组件
if (FILE_TYPE_IMGS.includes(fileSuffix)) {
this.imageUrl = getFileAccessHttpUrl(record.declareFile)
// 获取viewer实例
const viewer = this.$el.querySelector('.image').$viewer
// 调用show方法进行显示预览图
viewer.show()
// this.$refs.imagePreviewModal.open(file)
return
}
// pdf预览
if (FILE_TYPE_PDF.includes(fileSuffix)) {
const url = previewPdf(record.declareFile)
window.open(url)
return
}
// 其余可预览文件仍使用KKFile进行预览
const url = `${window._CONFIG.onlinePreviewDomainURL}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}`
window.open(url)
}
}
}
</script>
<style scoped>
</style>
@@ -49,16 +49,16 @@
<div class="table-operator">
<a-button icon="plus" type="primary" @click="handleAdd">{{ $t('newlyAdded') }}</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button icon="upload">{{ $t('import') }}</a-button>
<a-button icon="upload" type="primary" ghost>{{ $t('import') }}</a-button>
</a-upload>
<a-button icon="export" @click="handleExportXls">{{ $t('export') }}</a-button>
<a-button icon="mail" @click="handleFileExport">{{ $t('exportWithFile') }}</a-button>
<a-button icon="download" @click="downTemplate($t('enterpriseStandardLibrary.enterpriseStandard.templateExport'))">{{ $t('templateDownload') }}</a-button>
<a-button icon="delete" @click="batchDel">{{ $t('batchDelete') }}</a-button>
<a-button icon="setting" @click="handleAllocationStandard">{{ $t('enterpriseStandardLibrary.enterpriseStandard.allocationStandard') }}</a-button>
<a-button icon="setting" @click="handleShiftOutStandard">{{ $t('enterpriseStandardLibrary.enterpriseStandard.shiftOutStandard') }}</a-button>
<a-button icon="setting" @click="handleInitChange">{{ $t('enterpriseStandardLibrary.enterpriseStandard.initChange') }}</a-button>
<a-button icon="setting" @click="handleTemporaryPermissSet">{{ $t('enterpriseStandardLibrary.enterpriseStandard.temporaryPermissionSet') }}</a-button>
<a-button icon="export" type="primary" ghost @click="handleExportXls">{{ $t('export') }}</a-button>
<a-button icon="mail" type="primary" ghost @click="handleFileExport">{{ $t('exportWithFile') }}</a-button>
<a-button icon="download" type="primary" ghost @click="downTemplate($t('enterpriseStandardLibrary.standard.templateExport'))">{{ $t('templateDownload') }}</a-button>
<a-button icon="delete" type="primary" ghost @click="batchDel">{{ $t('batchDelete') }}</a-button>
<a-button icon="setting" type="primary" ghost @click="handleAllocationStandard">{{ $t('enterpriseStandardLibrary.standard.allocationStandard') }}</a-button>
<a-button icon="minus-circle" type="primary" ghost @click="handleShiftOutStandard">{{ $t('enterpriseStandardLibrary.standard.shiftOutStandard') }}</a-button>
<a-button icon="setting" type="primary" ghost @click="handleInitChange">{{ $t('enterpriseStandardLibrary.standard.initChange') }}</a-button>
<a-button icon="setting" type="primary" ghost @click="handleTemporaryPermissSet">{{ $t('enterpriseStandardLibrary.standard.temporaryPermissionSet') }}</a-button>
</div>
<div>
<j-table
@@ -74,7 +74,7 @@
<!-- 在混入里已经过滤过没有权限的按钮了 -->
<template slot="operation" slot-scope="{text, record}">
<a v-for="(operation, index) in operationList.slice(0, operateMaxNum)" :key="index" @click="operationClick(operation,record)">
<template v-if="operation.text === $t('enterpriseStandardLibrary.enterpriseStandard.collection')">
<template v-if="operation.text === $t('enterpriseStandardLibrary.standard.collection')">
<i class="iconfont icon-star1" v-show="record.collectFlag === 1" />
<i class="iconfont icon-star" v-show="!record.collectFlag || record.collectFlag === 0" />
</template>
@@ -110,7 +110,10 @@
</j-table>
</div>
</div>
<!-- 新增编辑弹框 -->
<enterprise-standard-modal ref="modalForm" @ok="modalFormOk"></enterprise-standard-modal>
<standard-selection-modal ref="standardSelectionModal" @change="allocationStandardChange"></standard-selection-modal>
<temporary-permission-set ref="temporaryPermissionSet" @ok="modalFormOk"></temporary-permission-set>
</a-card>
</template>
@@ -120,12 +123,26 @@ import JTable from '@/components/jero/JTable'
// 搜索组件
import Search from '@/components/customField/Search'
import { ConfigurableTableMixin } from '@/mixins/ConfigurableTableMixin'
import { getEnterpriseStandardTableHeader, getEnterpriseStandardSearchForm } from '@api/enterpriseStandardLibraryApi'
import {
getTreeList,
getEnterpriseStandardTableHeader,
getEnterpriseStandardSearchForm,
allocationStandard,
shiftStandard,
initChange,
collectStandard,
shareStandard
} from '@api/enterpriseStandardLibraryApi'
// 添加、编辑弹框
import EnterpriseStandardModal from './modules/EnterpriseStandardModal'
// 选择标准组件
import StandardSelectionModal from '@/components/selection/StandardSelectionModal'
// 临时权限设置
import TemporaryPermissionSet from './modules/TemporaryPermissionSet'
export default {
name: 'EnterpriseStandardList',
components: { EnterpriseStandardModal, JTable, Search },
components: { TemporaryPermissionSet, StandardSelectionModal, EnterpriseStandardModal, JTable, Search },
mixins: [ConfigurableTableMixin],
data () {
return {
@@ -139,7 +156,7 @@ export default {
mouseInNodeKey: null, // 鼠标悬浮的节点key值
operationList: [
{
text: this.$t('enterpriseStandardLibrary.enterpriseStandard.collection'),
text: this.$t('enterpriseStandardLibrary.standard.collection'),
clickEvent: 'handleCollection',
has: 'enterpriseStandard:collection'
},
@@ -173,27 +190,13 @@ export default {
exportZipUrl: '', // 带文件导出
downTemplateUrl: '' // 下载导入模板
},
showAction: true, // 是否显示操作列
dataSource: [
{
collectFlag: '0',
id: 'fd045f5c5d734087a884a63664ee91f1',
issue_time: '',
region: '',
serial_number: '0621001编号',
state: '现行',
subscribeFlag: '0',
technology_territory: '',
title: '0621001标题',
title_en: '0621001Title'
}
]
showAction: true // 是否显示操作列
}
},
methods: {
// 获取左侧树数据
initTreeData (params) {
getWorkGroupTreeList(params).then(res => {
getTreeList(params).then(res => {
if (res.success) {
this.treeData = this.dealTreeData(res.result)
// this.treeData = res.result
@@ -262,19 +265,89 @@ export default {
},
// 配置标准
handleAllocationStandard () {
// 没选择左侧树节点,需要提示“请先选择二级及以下体系”
if (!this.currentTreeNode || this.currentTreeNode.length === 0) {
this.$message.warn(this.$t('enterpriseStandardLibrary.standard.pleaseSelectLeastOneNode'))
return
}
this.$refs.standardSelectionModal.open()
},
// 配置标准确定
allocationStandardChange (dbFieldName, standardIds) {
this.loading = true
const params = {
nodeId: this.currentTreeNode[0],
standardIds
}
allocationStandard(params).then(res => {
if (res.success) {
this.$message.success(res.message)
this.modalFormOk()
} else {
this.$message.warn(res.message)
}
}).finally(() => {
this.loading = false
})
},
// 移出标准
handleShiftOutStandard () {
// 没选择左侧树节点,需要提示“请先选择二级及以下体系”
if (!this.currentTreeNode || this.currentTreeNode.length === 0) {
this.$message.warn(this.$t('enterpriseStandardLibrary.standard.pleaseSelectLeastOneNode'))
return
}
// 没有选择列表数据,需要提示“选中至少一条列表数据”
if (!this.selectedRowKeys || this.selectedRowKeys.length === 0) {
this.$message.warning(this.$t('selectLeastOne'))
return
}
this.loading = true
const params = {
nodeId: this.currentTreeNode[0],
ids: this.selectedRowKeys.join(',')
}
shiftStandard(params).then(res => {
if (res.success) {
this.$message.success(res.message)
this.modalFormOk()
} else {
this.$message.warn(res.message)
}
}).finally(() => {
this.loading = false
})
},
// 发起更改
handleInitChange () {
// 没有选择列表数据,需要提示“选中至少一条列表数据”
if (!this.selectedRowKeys || this.selectedRowKeys.length === 0) {
this.$message.warning(this.$t('selectLeastOne'))
return
}
this.loading = true
const params = {
ids: this.selectedRowKeys.join(',')
}
initChange(params).then(res => {
if (res.success) {
this.$message.success(res.message)
this.modalFormOk()
} else {
this.$message.warn(res.message)
}
}).finally(() => {
this.loading = false
})
},
// 临时权限设置
handleTemporaryPermissSet () {
// 没有选择列表数据,需要提示“选中至少一条列表数据”
if (!this.selectedRowKeys || this.selectedRowKeys.length === 0) {
this.$message.warning(this.$t('selectLeastOne'))
return
}
this.$refs.temporaryPermissionSet.open(this.selectedRowKeys.join(','))
},
// 操作栏的点击
operationClick (operation, record) {
@@ -286,11 +359,36 @@ export default {
},
// 收藏
handleCollection (record) {
const params = {}
params.id = record.id
collectStandard(params).then(res => {
if (res.success) {
this.$message.success(res.message)
} else {
this.$message.warning(res.message)
}
})
},
// 分享
handleShare (record) {
const params = {}
params.id = record.id
shareStandard(params).then(res => {
if (res.success) {
this.$message.success(res.message)
} else {
this.$message.warning(res.message)
}
})
},
// 跳转详情
detailClick (record) {
this.$openPageNewSheet({
path: '/enterpriseStandardLibrary/enterpriseStandardDetail',
query: {
id: record.id
}
})
}
}
}
@@ -0,0 +1,133 @@
<template>
<div class="detail-page">
<div class="detail-page-title">{{ pageTitle }}{{ $t('enterpriseStandardLibrary.standard.detailTitle') }}</div>
<div class="detail-page-part" v-for="(part, index) in partList" :key="part + index">
<div class="detail-page-part-title">
<span>{{ part }}</span>
<div class="detail-page-part-title-operate-box" v-if="index === 0">
<!-- 企标评价-->
<a-button type="icon-edit-1" @click="handleEvaluate">
<i class="iconfont icon-root-list" />
{{ $t('enterpriseStandardLibrary.standard.evaluate') }}
</a-button>
<!-- 收藏-->
<!-- <i class="iconfont icon-star1" v-if="form[part].collect === '0'" />-->
<!-- <i class="iconfont icon-star" v-else />-->
<!-- 更新记录-->
<a-button type="link" @click="handleOpenUpdateRecord">
<i class="iconfont icon-root-list" />
{{ $t('enterpriseStandardLibrary.standard.updateRecord') }}
</a-button>
<!-- 提交问题-->
<a-button type="link" @click="submitQuestion">
<i class="iconfont icon-chat" />
{{ $t('enterpriseStandardLibrary.standard.submitQuestion') }}
</a-button>
</div>
</div>
<div class="detail-page-part-form" v-if="index !== 3">
<div class="detail-page-part-form-item" v-for="formItem in form[part]" :key="formItem.id">
<label>{{ formItem.dbFieldTxt }}</label>
<span>{{ detailData[formItem.dbFieldName] }}</span>
</div>
</div>
<!-- 过程稿件特殊处理-->
<div class="detail-page-process-manuscript" v-if="index === 3">
<div class="detail-page-process-manuscript-item" v-for="(formItem, formIndex) in form[part]" :key="formItem.id">
<div class="detail-page-process-manuscript-title">
<span>{{ formItem.dbFieldTxt }}</span>
<a-button v-if="formIndex === 0" type="primary" ghost icon="file-text">{{ $t('enterpriseStandardLibrary.standard.standardResolutionSheet') }}</a-button>
</div>
<div class="detail-page-process-manuscript-file" v-for="file in detailData[formItem.dbFieldName]" :key="file.id">
<div class="detail-page-process-manuscript-file-info">
<a-icon type="link" />
<div class="detail-page-process-manuscript-file-name">{{ file.fileName }}</div>
</div>
<div class="detail-page-process-manuscript-file-operate">
<a-button type="link" icon="download">{{ $t('download') }}</a-button>
<a-button type="link">
<i class="iconfont icon-water-drop-slash"></i>
{{ $t('unwatermarkedDownload') }}
</a-button>
</div>
</div>
</div>
</div>
<!-- 稽查内容特殊处理-->
<div>
<a-table></a-table>
</div>
</div>
</div>
</template>
<script>
import '@assets/less/common.less'
import { getEnterpriseStandardInfoById } from '@/api/enterpriseStandardLibraryApi'
export default {
name: 'EnterpriseStandardDetail',
data () {
return {
partList: [], // 页面模块列表
form: {}, // 页面字段
detailData: {
modification_list: [
{
id: 1,
fileName: '国内文字占位符段落标题标准.pdf'
},
{
id: 2,
fileName: '国内标准国内文字占位符段落标题标准.pdf'
},
{
id: 3,
fileName: '国内标准国内标准.pdf'
}
],
draft_for_review: [{
id: 11,
fileName: '国内文字占位符段落标题标准.pdf'
}],
draft_for_approval: [{
id: 21,
fileName: '国内标准国内文字占位符段落标题标准.pdf'
}],
draft_for_comment: [{
id: 31,
fileName: '国内标准国内标准.pdf'
}],
draft: [{
id: 311,
fileName: '国内标准国内标准.pdf'
}]
} // 页面数据
}
},
created () {
this.initForm()
},
methods: {
initForm () {
const params = {}
params.id = this.$route.query.id
params.module = '3'
getEnterpriseStandardInfoById(params).then(res => {
if (res.success) {
const data = res.result || {}
this.partList = Object.keys(data)
this.form = data
} else {
this.$message.warn(res.message)
}
})
}
}
}
</script>
<style scoped>
</style>
@@ -60,6 +60,9 @@ export default {
},
edit (record) {
this.visible = true
this.$nextTick(() => {
this.$refs.addForm.edit(record)
})
},
handleOk () {
this.confirmLoading = true
@@ -0,0 +1,128 @@
<template>
<a-modal
:title="title"
:maskClosable="true"
:width="800"
:closable="true"
@cancel="handleCancel"
@ok="handleOk"
:visible="visible">
<a-spin :spinning="confirmLoading">
<a-form :form="form">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('enterpriseStandard.enterpriseStandard.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('enterpriseStandard.enterpriseStandard.authorizationUser')">
<user-selection
v-decorator.trim="[ 'userIds', validatorRules.userIds]"
:nameStr="model.userNames"
@nameChange="userSelectNameChange">
</user-selection>
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('enterpriseStandard.enterpriseStandard.maturityDate')">
<a-date-picker
v-decorator.trim="[ 'maturityDate', validatorRules.maturityDate]"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
>
</a-date-picker>
</a-form-item>
</a-form>
</a-spin>
</a-modal>
</template>
<script>
import { temporaryPermissionSet } from '@/api/enterpriseStandardLibraryApi'
import UserSelection from '@/components/selection/UserSelection'
export default {
name: 'TemporaryPermissionSet',
components: { UserSelection },
data () {
return {
title: '',
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('enterpriseStandard.enterpriseStandard.authorizationDepart') }
],
validateTrigger: 'change'
},
userIds: {
rules: [
{ required: false, message: this.$t('pleaseEnter') + this.$t('enterpriseStandard.enterpriseStandard.authorizationUser') }
],
validateTrigger: 'change'
},
notes: {
rules: [
{ required: true, message: this.$t('pleaseEnter') + this.$t('enterpriseStandard.enterpriseStandard.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) {
this.confirmLoading = true
const param = Object.assign({}, values)
param.standards = 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>