[update] 联调企业标准部分接口

This commit is contained in:
lideqin
2023-09-18 18:37:01 +08:00
parent a5f062bafe
commit 180c3f94de
6 changed files with 329 additions and 123 deletions
+5 -2
View File
@@ -9,7 +9,9 @@ const getEnterpriseStandardAddForm = (params) => getAction('/laws/standard/enter
// 根据id获取详情
const getEnterpriseStandardInfoById = (params) => getAction('/laws/standard/enterprise/getByIdAndModule', params)
// 配置标准
const allocationStandard = (params) => getAction('', params)
const allocationStandard = (params) => getAction('/laws/standard/enterprise/relatedStandard', params)
// 配置标准-获取可配置标准列表
const allocationStandardList = (params) => getAction('/laws/standard/common/getStandardRightBox', params)
// 移出标准
const shiftStandard = (params) => getAction('/laws/standard/enterprise/removeStandard', params)
// 获取左侧树列表
@@ -25,7 +27,7 @@ const collectStandard = (params) => postAction('/personal/lawsStandardCollection
// 取消收藏企标
const cancelCollectStandard = (params) => postAction('/personal/lawsStandardCollection/enterprise/delete', params)
// 分享企标
const shareStandard = (params) => getAction('', params)
const shareStandard = (params) => postAction('/personal/lawsStandardSharing/enterprise/add', params)
// 企标评审会记录-设置优质标准
const setQualityStandard = (params) => getAction('/enterprise/reviewMeeting/setQualityStandards', params)
@@ -51,6 +53,7 @@ export {
getEnterpriseStandardAddForm,
getEnterpriseStandardInfoById,
allocationStandard,
allocationStandardList,
shiftStandard,
getTreeList,
deleteTreeNode,
+1 -1
View File
@@ -432,7 +432,7 @@ export default {
ruleList.forEach((res, index) => {
const rule = []
if (res.fieldMustInput === '1') {
if ((FieldType.TEXT_BOX.value, FieldType.TEXTAREA.value, FieldType.TEXT_LINK.value).includes(res.fieldShowType)) {
if ([FieldType.TEXT_BOX.value, FieldType.TEXTAREA.value, FieldType.TEXT_LINK.value].includes(res.fieldShowType)) {
rule.push({
required: true,
message: res.dbFieldTxt + this.$t('cannotEmpty'),
+2 -2
View File
@@ -196,8 +196,8 @@
{{ !toggleSearchStatus ? $t('open') : $t('putAway') }}
<a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
</a>
<a-button type="primary" @click="searchQuery" style="margin-left: 8px" v-has="searchHas">{{ $t('query') }}</a-button>
<a-button style="margin-left: 8px" @click="searchReset">{{ $t('reset') }}</a-button>
<a-button icon="search" type="primary" @click="searchQuery" style="margin-left: 8px" v-has="searchHas">{{ $t('query') }}</a-button>
<a-button icon="reload" style="margin-left: 8px" @click="searchReset">{{ $t('reset') }}</a-button>
</div>
</a-row>
</a-form>
@@ -114,7 +114,7 @@ export default {
width: 150
},
{
title: this.$t('textStatus'),
title: this.$t('standardSelect.textState'),
dataIndex: 'standardState_dictText',
align: 'center',
width: 150
@@ -1,57 +1,54 @@
<template>
<a-card :bordered="false" class="page-left-right-layout">
<div class="page-left-box">
<a-input-search v-model="treeInput" :placeholder="$t('pleaseEnterTreeSystem')"
<a-input-search v-model="treeInput"
class="tree-search"
:placeholder="$t('pleaseEnterTreeSystem')"
@search="handleTreeSearch" />
<a-tree
v-if="treeData.length > 0"
:show-line="true"
:show-icon="true"
:tree-data="treeData"
:selectedKeys="currentTreeNode"
:default-expand-all="defaultExpandAll"
@select="treeSelect">
<a-icon type="folder" slot="folder" class="tree-icon" />
<template #custom="record">
<div class="tree-operate-node" @mouseenter="handleTreeMouseover(record.key)" @mouseleave="handleTreeMouseout(record.key)">
<!--<a-tooltip>-->
<!-- <template #title>-->
<!-- {{ record.title }}-->
<!-- </template>-->
<!-- <span v-if="record.title.indexOf(treeInput) > -1" class="tree-node-custom-title">-->
<!-- {{ record.title.substr(0, record.title.indexOf(treeInput)) }}-->
<!-- <span style="color: #f50">{{ treeInput }}</span>-->
<!-- {{ record.title.substr(record.title.indexOf(treeInput) + treeInput.length) }}-->
<!-- </span>-->
<!-- <span v-else class="tree-node-custom-title">{{ record.title }}</span>-->
<!--</a-tooltip>-->
<a-tooltip>
<template #title>
{{ record.title }}
</template>
<span class="tree-node-custom-title">{{ record.title }}</span>
</a-tooltip>
<template v-if="record.key === mouseInNodeKey && record.nodeType !== StandardSystemTreeNodeType.NOT_OPERATE_NODE.value">
<!-- 新增-->
<a-button icon="plus" class="tree-operate-node-btn" v-has="'enterpriseStandard:tree:add'"
@click="handleTreeAdd(record)"></a-button>
<!-- 编辑-->
<a-button v-if="record.nodeType !== StandardSystemTreeNodeType.ROOT_NODE.value"
v-has="'enterpriseStandard:tree:edit'"
class="tree-operate-node-btn" @click="handleTreeEdit(record)">
<i class="iconfont icon-bianji" style="color: #D52C26"></i>
</a-button>
<!-- 删除-->
<a-button v-if="record.nodeType !== StandardSystemTreeNodeType.ROOT_NODE.value"
v-has="'enterpriseStandard:tree:delete'"
class="tree-operate-node-btn" @click="handleTreeDelete(record.id)">
<i class="iconfont icon-shanchu_" style="color: #D52C26"></i>
</a-button>
<div class="page-tree-box page-tree-box-has-search">
<a-spin :spinning="treeLoading">
<a-tree
v-if="treeData.length > 0"
:show-line="true"
:show-icon="true"
:tree-data="treeData"
:selectedKeys="currentTreeNode"
:default-expand-all="defaultExpandAll">
<a-icon type="folder" slot="folder" class="tree-icon" />
<a-icon type="file" slot="file" class="tree-icon" />
<template #custom="record">
<div class="tree-operate-node"
@mouseenter="handleTreeMouseover(record.key)"
@mouseleave="handleTreeMouseout(record.key)"
@click="treeSelect(record)">
<a-tooltip>
<template #title>
{{ record.title }}
</template>
<span class="tree-node-custom-title">{{ record.title }}</span>
</a-tooltip>
<template v-if="record.key === mouseInNodeKey && record.nodeType !== StandardSystemTreeNodeType.NOT_OPERATE_NODE.value">
<!-- 新增-->
<a-button icon="plus" class="tree-operate-node-btn" v-has="'enterpriseStandard:tree:add'"
@click="handleTreeAdd(record)"></a-button>
<!-- 编辑-->
<a-button v-if="record.nodeType !== StandardSystemTreeNodeType.ROOT_NODE.value"
v-has="'enterpriseStandard:tree:edit'"
class="tree-operate-node-btn" @click="handleTreeEdit(record)">
<i class="iconfont icon-bianji" style="color: #D52C26"></i>
</a-button>
<!-- 删除-->
<a-button v-if="record.nodeType !== StandardSystemTreeNodeType.ROOT_NODE.value"
v-has="'enterpriseStandard:tree:delete'"
class="tree-operate-node-btn" @click="handleTreeDelete(record.id)">
<i class="iconfont icon-shanchu_" style="color: #D52C26"></i>
</a-button>
</template>
</div>
</template>
</div>
</template>
</a-tree>
</a-tree>
</a-spin>
</div>
</div>
<div class="page-right-box">
<div class="table-page-search-wrapper">
@@ -137,12 +134,14 @@
</div>
<!-- 新增编辑弹框 -->
<enterprise-standard-modal ref="modalForm" @ok="modalFormOk"></enterprise-standard-modal>
<!-- 标准选择弹框 -->
<standard-selection-modal ref="standardSelectionModal" @change="allocationStandardChange"></standard-selection-modal>
<!-- 配置标准-标准选择弹框 -->
<allocation-standard-drawer ref="allocationStandardDrawer" @ok="modalFormOk"></allocation-standard-drawer>
<!-- 临时权限设置 -->
<temporary-permission-set ref="temporaryPermissionSet" @ok="modalFormOk"></temporary-permission-set>
<!-- 左侧树节点的新增和编辑 -->
<tree-node-modal ref="treeNodeModal" @ok="treeNodeModalOk"></tree-node-modal>
<!-- 分享需要选人 -->
<user-select-modal ref="userSelectModal" @change="userSelectChange"></user-select-modal>
</a-card>
</template>
@@ -157,7 +156,6 @@ import {
getTreeList,
getEnterpriseStandardTableHeader,
getEnterpriseStandardSearchForm,
allocationStandard,
shiftStandard,
initChange,
collectStandard,
@@ -167,15 +165,16 @@ import {
} from '@api/enterpriseStandardLibraryApi'
// 添加、编辑弹框
import EnterpriseStandardModal from './modules/EnterpriseStandardModal'
// 选择标准组件
import StandardSelectionModal from '@/components/selection/StandardSelectionModal'
// 临时权限设置
import TemporaryPermissionSet from './modules/TemporaryPermissionSet'
import TreeNodeModal from './modules/TreeNodeModal'
import UserSelectModal from '../../../components/selection/UserSelectModal'
// 配置标准弹框
import AllocationStandardDrawer from './modules/AllocationStandardDrawer'
export default {
name: 'EnterpriseStandardList',
components: { TreeNodeModal, TemporaryPermissionSet, StandardSelectionModal, EnterpriseStandardModal, JTable, Search },
components: { AllocationStandardDrawer, UserSelectModal, TreeNodeModal, TemporaryPermissionSet, EnterpriseStandardModal, JTable, Search },
mixins: [ConfigurableTableMixin],
data () {
return {
@@ -183,8 +182,11 @@ export default {
flag: '3',
treeInput: '', // 左侧树搜索框内容
treeData: [], // 左侧树数据
treeLoading: false,
collectionFlag: false,
defaultExpandAll: false, // 左侧树默认展开所有
currentTreeNode: null, // 当前选中的树节点
currentTreeNode: null, // 当前选中的树节点key值
currentTreeNodeCode: null, // 当前选中的树节点的code值
mouseInNodeKey: null, // 鼠标悬浮的节点key值
operationList: [
{
@@ -216,14 +218,15 @@ export default {
// url传参严格按照当前命名
url: {
list: '/laws/standard/enterprise/getCommonPage', // 表格数据
delete: '', // 删除
deleteBatch: '', // 批量删除
delete: '/laws/standard/enterprise/singleDelete', // 删除
deleteBatch: '/laws/standard/enterprise/deleteByIdsAndModule', // 批量删除
importUrl: '', // 导入
exportXlsUrl: '', // 导出
exportZipUrl: '', // 带文件导出
downTemplateUrl: '' // 下载导入模板
},
showAction: true // 是否显示操作列
showAction: true, // 是否显示操作列
currentShare: {}
}
},
mounted () {
@@ -232,6 +235,7 @@ export default {
methods: {
// 获取左侧树数据
initTreeData (params) {
this.treeLoading = true
getTreeList(params).then(res => {
if (res.success) {
this.treeData = this.dealTreeData(res.result)
@@ -242,14 +246,19 @@ export default {
this.$nextTick(() => {
this.defaultExpandAll = true
})
this.treeLoading = false
})
},
// 处理左侧树数据结构
dealTreeData (treeData) {
return treeData.map(item => {
item.scopedSlots = { title: 'custom' }
if (item.children && item.children.length > 0) {
item.scopedSlots = { icon: 'folder', title: 'custom' }
item.children = this.dealTreeData(item.children)
} else if (item.nodeType === StandardSystemTreeNodeType.ROOT_NODE.value) {
item.scopedSlots = { icon: 'folder', title: 'custom' }
} else {
item.scopedSlots = { icon: 'file', title: 'custom' }
}
return item
})
@@ -260,9 +269,10 @@ export default {
this.initTreeData({ nodeName: this.treeInput })
},
// 左侧树点击选中
treeSelect (selectedKeys) {
this.currentTreeNode = selectedKeys
this.searchParams.workingGroupId = selectedKeys[0]
treeSelect (record) {
this.currentTreeNode = [record.key]
this.currentTreeNodeCode = [record.nodeCode]
this.searchParams.nodeCode = record.nodeCode
this.loadData()
},
// 左侧树点击新增
@@ -316,8 +326,8 @@ export default {
this.currentTreeNode = null
this.searchParams = {}
this.selectedRowKeys = []
this.getData()
this.getTableList()
this.getTableHeader()
this.loadData()
},
// 配置标准
handleAllocationStandard () {
@@ -327,25 +337,7 @@ export default {
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
})
this.$refs.allocationStandardDrawer.open(this.currentTreeNodeCode[0])
},
// 移出标准
handleShiftOutStandard () {
@@ -361,7 +353,7 @@ export default {
}
this.loading = true
const params = {
nodeId: this.currentTreeNode[0],
nodeCode: this.currentTreeNodeCode[0],
ids: this.selectedRowKeys.join(',')
}
shiftStandard(params).then(res => {
@@ -416,7 +408,11 @@ export default {
},
// 收藏
handleCollection (record) {
if (record.collectionFlag) {
if (this.collectionFlag || this.loading) {
return
}
this.collectionFlag = true
if (!!record.collectionFlag) {
const params = {}
params.id = record.id
// 说明已收藏,调取消收藏接口
@@ -427,11 +423,15 @@ export default {
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.setTimeout(() => {
this.collectionFlag = false
}, 100)
})
} else {
const params = {}
params.standardId = record.id
params.standardNumber = record.standard_no
params.standardNumber = record.standard_number
collectStandard(params).then(res => {
if (res.success) {
this.$message.success(res.message)
@@ -439,13 +439,24 @@ export default {
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.setTimeout(() => {
this.collectionFlag = false
}, 100)
})
}
},
// 分享
handleShare (record) {
this.currentShare = record
this.$refs.userSelectModal.open()
},
// 分享选完人的回调
userSelectChange (value) {
const params = {}
params.id = record.id
params.standardId = this.currentShare.id
params.standardNum = this.currentShare.standard_no
params.recipientId = value
shareStandard(params).then(res => {
if (res.success) {
this.$message.success(res.message)
@@ -468,37 +479,11 @@ export default {
</script>
<style scoped lang="less">
.tree-icon {
line-height: 24px;
color: #1D2129;
}
.tree-operate-node {
display: flex;
width: 100%;
align-items: center;
&-btn {
width: 20px;
height: 20px;
background: rgba(213, 44, 38, 0.08);
border-radius: 2px 2px 2px 2px;
border: none;
display: flex;
align-items: center;
justify-content: center;
margin-left: 4px;
padding: 0;
/deep/ .anticon {
margin-top: 2px;
color: #D52C26;
}
img {
width: 13px;
height: 13px;
}
}
/deep/ .ant-tree li span.ant-tree-switcher.ant-tree-switcher-noop {
display: none;
}
</style>
@@ -0,0 +1,218 @@
<template>
<a-drawer
:title="$t('standardSelect.standardSelection')"
:maskClosable="false"
:width="1000"
placement="right"
:closable="true"
@close="handleCancel"
:visible="visible"
class="custom-drawer-style">
<div class="custom-drawer-style-scroll">
<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('standardSelect.standardNumOrName')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input :placeholder="$t('pleaseEnter')+$t('standardSelect.standardNumOrName')"
v-model="queryParam.standardNumberOrName"></a-input>
</a-form-item>
</a-col>
<div style="float: right;overflow: hidden;margin-right: 41px;margin-bottom: 20px" class="table-page-search-submitButtons">
<a-button class="box-button" style="margin-left: 8px" @click="searchReset">{{ $t('reset') }}</a-button>
<a-button class="box-button" style="margin-left: 8px" type="primary" @click="searchQuery">{{ $t('query') }}</a-button>
</div>
</a-row>
</a-form>
</div>
<a-table
:columns="columns"
rowKey="id"
:scroll="{x: 900}"
:data-source="dataList"
:pagination="ipagination"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
:loading="loading">
<!-- 标准编号标准名称跳转详情-->
<template v-slot:detail="text, record">
<a-tooltip overlay-class-name="tooltip-style">
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
<div class="table-text can-click-table-text" v-if="text || text === 0" @click="toDetailPage(record)">{{ text }}</div>
<div v-else class="table-text">{{ global.emptyLine }}</div>
</a-tooltip>
</template>
<template slot="text" slot-scope="text">
<a-tooltip overlay-class-name="tooltip-style">
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
<div class="table-text">{{ text || text === 0 ? text : global.emptyLine }}</div>
</a-tooltip>
</template>
</a-table>
</div>
<div class="custom-drawer-style-bottom-btn">
<a-button @click="handleCancel">{{ $t('cancel') }}</a-button>
<a-button @click="handleSubmit" type="primary" :loading="confirmLoading">{{ $t('submit') }}</a-button>
</div>
</a-drawer>
</template>
<script>
import { allocationStandardList, allocationStandard } from '@/api/enterpriseStandardLibraryApi'
export default {
name: 'AllocationStandardDrawer',
props: {
query: {
type: Object,
required: false,
default: () => {
return {}
}
}
},
data () {
return {
visible: false,
confirmLoading: false,
labelCol: {
sm: 8
},
wrapperCol: {
sm: 14
},
selectedRowKeys: [],
selectedRowList: [],
loading: false,
queryParam: {},
/* 分页参数 */
ipagination: {
current: 1,
pageSize: 10,
pageSizeOptions: ['10', '20', '30'],
showTotal: (total, range) => {
return range[0] + '-' + range[1] + ' ' + this.$t('total') + ' ' + total + ' ' + this.$t('strip')
},
showQuickJumper: true,
showSizeChanger: true,
total: 0
},
columns: [
{
title: this.$t('standardSelect.standardNumber'),
dataIndex: 'standardNumber',
align: 'center',
width: 150,
scopedSlots: { customRender: 'detail' }
},
{
title: this.$t('standardSelect.standardName'),
dataIndex: 'standardName',
align: 'center',
width: 150,
scopedSlots: { customRender: 'detail' }
},
{
title: this.$t('standardSelect.releaseDate'),
dataIndex: 'releaseDate',
align: 'center',
width: 120,
scopedSlots: { customRender: 'text' }
},
{
title: this.$t('standardSelect.textState'),
dataIndex: 'standardState_dictText',
align: 'center',
width: 120,
scopedSlots: { customRender: 'text' }
}
],
dataList: [],
nodeCode: '' // 选中节点code
}
},
methods: {
open (nodeCode) {
this.visible = true
this.queryParam = {}
this.nodeCode = nodeCode
this.replacePage()
},
// 获取表格数据
replacePage () {
const query = {
...this.queryParam,
pageNo: this.ipagination.current,
pageSize: this.ipagination.pageSize,
nodeCode: this.nodeCode,
source: '3'
}
this.selectedRowKeys = []
this.loading = true
allocationStandardList(query).then((res) => {
if (res.success) {
this.dataList = res.result.records
this.ipagination.total = res.result.total
} else {
this.dataList = []
}
}).finally(() => {
this.loading = false
})
},
searchQuery () {
this.replacePage()
},
searchReset () {
this.queryParam = {}
this.replacePage()
},
// 表格选择改变
onSelectChange (value, row) {
this.selectedRowKeys = value
this.selectedRowList = row
},
handleCancel () {
this.visible = false
},
handleSubmit () {
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
const params = {
nodeCode: this.nodeCode,
ids: this.selectedRowKeys.join(',')
}
allocationStandard(params).then(res => {
if (res.success) {
this.$message.success(res.message)
this.$emit('ok')
} else {
this.$message.warn(res.message)
}
})
this.visible = false
} else {
this.$message.warning(this.$t('selectLeastOne'))
}
},
/**
* 跳转详情页
* @param id
*/
toDetailPage ({ id }) {
this.$openPageNewSheet({
path: '/enterpriseStandardLibrary/enterpriseStandardDetail',
query: {
id
}
})
}
}
}
</script>
<style scoped>
</style>