[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
@@ -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>