[update] 修改企标计划立项/变更流程

This commit is contained in:
lideqin
2023-10-09 18:09:38 +08:00
parent c1cc454f1b
commit f863ea3255
22 changed files with 2019 additions and 92 deletions
+4 -1
View File
@@ -53,6 +53,8 @@ const initReview = (params) => getAction('', params)
// 企标计划-根据id获取计划详情
const getEnterpriseStandardPlanInfoById = (params) => getAction('/enterprise/plan/detail', params)
// 企标计划-分页获取(选择企标计划组件中用)
const getEnterpriseStandardPlanPage = (params) => getAction('/enterprise/plan/page', params)
export {
getEnterpriseStandardTableHeader,
@@ -83,5 +85,6 @@ export {
initReview,
getEnterpriseStandardPlanInfoById
getEnterpriseStandardPlanInfoById,
getEnterpriseStandardPlanPage
}
+4 -2
View File
@@ -16,7 +16,8 @@ const enterprisePlanApprovalTurnTo = (params) => postAction('', params)
const enterprisePlanApprovalAgree = (params) => postAction('', params)
// 驳回
const enterprisePlanApprovalReject = (params) => postAction('', params)
// 确定
const enterprisePlanApprovalDetermine = (params) => postAction('', params)
export {
deployWorkFlow,
getFlowNodeList,
@@ -25,5 +26,6 @@ export {
enterprisePlanApprovalTurnTo,
enterprisePlanApprovalAgree,
enterprisePlanApprovalReject
enterprisePlanApprovalReject,
enterprisePlanApprovalDetermine
}
+7 -1
View File
@@ -500,6 +500,10 @@ module.exports = {
releaseDate: 'Release date',
textState: 'Text state'
},
// 企标计划选择器
enterprisePlanSelect: {
title: '企标计划选择'
},
// 用户/组织结构选择器
userOrOrganSelect: {
select: 'Select',
@@ -515,7 +519,9 @@ module.exports = {
selectUser: 'Select User',
userList: 'Users List',
name: 'name',
post: 'Post'
post: 'Post',
selectedPersonnel: '已选人员',
workGroup: '内部工作组'
},
// 弹框上传附件
uploadFile: {
+7
View File
@@ -80,5 +80,12 @@ module.exports = {
isShelf: 'Shelf Or Not',
sort: 'Sort',
shelfWarn: 'the link is empty please fill in the link first'
},
// 联络人管理
contact: {
departName: '部门名称',
standardizationEngineer: '标准化工程师',
contactPerson: '联络人',
contactPersonSupervisorLevelLeader: '部门联络人主管级领导'
}
}
+7
View File
@@ -81,5 +81,12 @@ module.exports = {
isShelf: '是否上架',
sort: '排序',
shelfWarn: '链接为空,请先填写链接'
},
// 联络人管理
contact: {
departName: '部门名称',
standardizationEngineer: '标准化工程师',
contactPerson: '联络人',
contactPersonSupervisorLevelLeader: '部门联络人主管级领导'
}
}
+3 -1
View File
@@ -72,7 +72,9 @@ module.exports = {
originalDraftPlanFinishDate: '原草稿计划完成日期',
originalExposureDraftPlanFinishDate: '原征求意见稿计划完成日期',
originalPlanSubmissionDate: '原计划报批日期',
changeReason: '变更原因'
changeReason: '变更原因',
superintendent: '所长',
relatedPersonnel: '相关人员'
},
// 流程配置
processConfig: {
+3 -1
View File
@@ -72,7 +72,9 @@ module.exports = {
originalDraftPlanFinishDate: '原草稿计划完成日期',
originalExposureDraftPlanFinishDate: '原征求意见稿计划完成日期',
originalPlanSubmissionDate: '原计划报批日期',
changeReason: '变更原因'
changeReason: '变更原因',
superintendent: '所长',
relatedPersonnel: '相关人员'
},
// 流程配置
processConfig: {
+6 -1
View File
@@ -501,6 +501,10 @@ module.exports = {
releaseDate: '发布日期',
textState: '文本状态'
},
// 企标计划选择器
enterprisePlanSelect: {
title: '企标计划选择'
},
// 用户/组织结构选择器
userOrOrganSelect: {
select: '选择',
@@ -517,7 +521,8 @@ module.exports = {
userList: '用户列表',
name: '姓名',
post: '岗位',
selectedPersonnel: '已选人员'
selectedPersonnel: '已选人员',
workGroup: '内部工作组'
},
// 弹框上传附件
uploadFile: {
+6 -2
View File
@@ -29,7 +29,9 @@
<div class="personnel-container-content-text">
<template v-if="step.canChoose && index >= currentNodeIndex">
<!-- TODO 数据库设计确定后处理数据抛出格式-->
<user-selection type="checkbox" input-type="textarea" />
<user-select-by-work-group v-if="step.chooseSource === 'workGroup'" v-model="step.user" :type="step.chooseType" input-type="textarea"/>
<user-select-by-contact v-else-if="step.chooseSource === 'contactManage'" v-model="step.user" :type="step.chooseType" input-type="textarea"/>
<user-selection v-else :type="step.chooseType" v-model="step.user" input-type="textarea" />
</template>
<div class="personnel-container-content-echo-text" v-else>{{ step.userList }}</div>
</div>
@@ -48,10 +50,12 @@
<script>
import '@assets/less/common.less'
import UserSelection from './selection/UserSelection.vue'
import UserSelectByWorkGroup from './selection/UserSelectByWorkGroup'
import UserSelectByContact from './selection/UserSelectByContact'
export default {
name: 'PersonnelInfo',
components: { UserSelection },
components: { UserSelectByContact, UserSelectByWorkGroup, UserSelection },
props: {
// 数据
data: {
@@ -0,0 +1,80 @@
<template>
<div class="selection-wrapper">
<div class="box-title-text">
<a-input class="box-input" :value="standardNumber" :title="standardNumber" @click="standardClick"
disabled readonly :placeholder="placeholder"/>
<a-button v-if="!isDisabled" type="primary" class="button-box" @click="standardClick">
{{this.$t('enterprisePlanSelect.title')}}
</a-button>
</div>
<enterprise-plan-selection-modal ref="enterprisePlanSelectionModal" v-bind="$attrs" :value="value" @change="modalChange" @standardNumberChange="standardNumberChange" @listChange="modalListChange"></enterprise-plan-selection-modal>
</div>
</template>
<script>
import EnterprisePlanSelectionModal from './EnterprisePlanSelectionModal'
export default {
name: 'EnterprisePlanSelection',
components: { EnterprisePlanSelectionModal },
props: {
value: {
type: String,
default: ''
},
placeholder: {
type: String,
default: ''
},
isDisabled: {
type: Boolean,
default: false
},
standardNumber: {
type: String,
default: ''
}
},
methods: {
// 点击选择标准按钮
standardClick () {
this.$refs.enterprisePlanSelectionModal.open()
},
modalChange (value) {
this.$emit('change', value)
},
standardNumberChange (value) {
this.$emit('standardNumberChange', value)
},
modalListChange (value) {
this.$emit('listChange', value)
}
},
model: {
prop: 'value',
event: 'change'
}
}
</script>
<style scoped lang="less">
.selection-wrapper {
height: 40px;
line-height: 40px;
}
.box-title-text {
height: 100%;
display: flex;
align-items: center;
.box-input {
width: 100%;
}
/deep/ .ant-input-disabled {
background: #fff;
color: rgba(0, 0, 0, 0.65);
cursor: default;
}
.button-box {
margin-left: 10px;
}
}
</style>
@@ -0,0 +1,316 @@
<template>
<a-drawer
:title="$t('enterprisePlanSelect.title')"
: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 :span="8">
<a-form-item :label="$t('enterpriseStandardLibrary.plan.oldEnterpriseStandardNum')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input :placeholder="$t('pleaseEnter')+$t('enterpriseStandardLibrary.plan.oldEnterpriseStandardNum')" v-model="queryParam.originEnStandardNo"></a-input>
</a-form-item>
</a-col>
<!-- 原企标名称 -->
<a-col :span="8">
<a-form-item :label="$t('enterpriseStandardLibrary.plan.oldEnterpriseStandardName')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input :placeholder="$t('pleaseEnter')+$t('enterpriseStandardLibrary.plan.oldEnterpriseStandardName')" v-model="queryParam.originEnStandardName"></a-input>
</a-form-item>
</a-col>
<!-- 主起草人 -->
<a-col :span="8">
<a-form-item :label="$t('enterpriseStandardLibrary.plan.principalDrafter')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input :placeholder="$t('pleaseEnter')+$t('enterpriseStandardLibrary.plan.principalDrafter')" v-model="queryParam.mainDraftingUser"></a-input>
</a-form-item>
</a-col>
<!-- 主起草单位 -->
<a-col :span="8">
<a-form-item :label="$t('enterpriseStandardLibrary.plan.mainDraftingUnit')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-tree-select
tree-node-filter-prop="title"
v-model="queryParam.mainDraftingUnit"
:maxTagCount="1"
:show-search="true"
:getPopupContainer="triggerNode=> triggerNode.parentNode"
class="box-input"
style="width: 100%"
:tree-data="categoryTreeList"
:placeholder="$t('pleaseSelect') + $t('enterpriseStandardLibrary.plan.mainDraftingUnit')"
/>
</a-form-item>
</a-col>
<!-- 主起草单位负责人 -->
<a-col :span="8">
<a-form-item :label="$t('enterpriseStandardLibrary.plan.headOfMainDraftingUnit')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input :placeholder="$t('pleaseEnter')+$t('enterpriseStandardLibrary.plan.headOfMainDraftingUnit')" v-model="queryParam.mainDraftingUnitResponsiblePerson"></a-input>
</a-form-item>
</a-col>
<!-- 制修订类型 -->
<a-col :span="8">
<a-form-item :label="$t('enterpriseStandardLibrary.plan.revisionType')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-dict-select-tag
:placeholder="$t('pleaseEnter')+$t('enterpriseStandardLibrary.plan.revisionType')"
dict-code="esp_application_category"
v-model="queryParam.applicationCategory">
</j-dict-select-tag>
</a-form-item>
</a-col>
<div style="float: right;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search" style="margin-left: 8px" v-has="'enterpriseStandardLibrary:plan:search'">{{ $t('query') }}</a-button>
<a-button type="primary" ghost @click="searchReset" icon="reload" style="margin-left: 8px">{{ $t('reset') }}</a-button>
</div>
</a-row>
</a-form>
</div>
<a-table
:columns="columns"
rowKey="id"
:scroll="{x: 900}"
:data-source="dataList"
:pagination="ipagination"
:row-selection="{ type: type, selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
:loading="loading">
</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 { getEnterpriseStandardPlanPage } from '@/api/enterpriseStandardLibraryApi'
import { queryDepartTreeList } from '@/api/api'
export default {
name: 'EnterprisePlanSelectionModal',
props: {
value: {
type: String,
default: ''
},
type: {
type: String,
required: false,
default: 'checkbox'
}
},
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('enterpriseStandardLibrary.plan.revisionType'),
align: 'center',
width: 180,
dataIndex: 'applicationCategory_dictText',
scopedSlots: { customRender: 'text' }
},
{ // 原企标编号
title: this.$t('enterpriseStandardLibrary.plan.oldEnterpriseStandardNum'),
align: 'center',
width: 180,
dataIndex: 'originEnStandardNo',
scopedSlots: { customRender: 'toDetailOld' }
},
{ // 原企标名称
title: this.$t('enterpriseStandardLibrary.plan.oldEnterpriseStandardName'),
align: 'center',
width: 180,
dataIndex: 'originEnStandardName',
scopedSlots: { customRender: 'toDetailOld' }
},
{ // 授权部门
title: this.$t('enterpriseStandardLibrary.plan.authDepartment'),
align: 'center',
width: 180,
dataIndex: 'authDeparts',
scopedSlots: { customRender: 'text' }
},
{ // 企业标准代号
title: this.$t('enterpriseStandardLibrary.plan.enterpriseStandardCode'),
align: 'center',
width: 180,
dataIndex: 'enStandardCode',
scopedSlots: { customRender: 'text' }
},
{ // 配合单位
title: this.$t('enterpriseStandardLibrary.plan.suitUnit'),
align: 'center',
width: 180,
dataIndex: 'cooperateDeparts',
scopedSlots: { customRender: 'text' }
},
{ // 主起草人
title: this.$t('enterpriseStandardLibrary.plan.principalDrafter'),
align: 'center',
width: 180,
dataIndex: 'mainDraftingUser',
scopedSlots: { customRender: 'text' }
},
{ // 主起草单位
title: this.$t('enterpriseStandardLibrary.plan.mainDraftingUnit'),
align: 'center',
width: 180,
dataIndex: 'mainDraftingUnit',
scopedSlots: { customRender: 'text' }
},
{ // 主起草单位负责人
title: this.$t('enterpriseStandardLibrary.plan.headOfMainDraftingUnit'),
align: 'center',
width: 180,
dataIndex: 'mainDraftingUnitResponsiblePerson',
scopedSlots: { customRender: 'text' }
},
{ // 标准推进人
title: this.$t('enterpriseStandardLibrary.plan.standardPusher'),
align: 'center',
width: 180,
dataIndex: 'standardPromoter',
scopedSlots: { customRender: 'text' }
},
{ // 草稿计划完成日期
title: this.$t('enterpriseStandardLibrary.plan.draftPlanFinishDate'),
align: 'center',
width: 180,
dataIndex: 'draftPlannedCompleteDate',
scopedSlots: { customRender: 'specialDate' }
},
{ // 征求意见稿计划完成日期
title: this.$t('enterpriseStandardLibrary.plan.exposureDraftPlanFinishDate'),
align: 'center',
width: 200,
dataIndex: 'solicitationDraftPlanCompleteDate',
scopedSlots: { customRender: 'specialDate' }
},
{ // 计划报批日期
title: this.$t('enterpriseStandardLibrary.plan.planSubmissionDate'),
align: 'center',
width: 180,
dataIndex: 'planApprovalDate',
scopedSlots: { customRender: 'specialDate' }
},
{ // 项目状态
title: this.$t('enterpriseStandardLibrary.plan.projectStatus'),
align: 'center',
width: 180,
dataIndex: 'projectStatus_dictText',
scopedSlots: { customRender: 'text' }
}
],
dataList: [],
categoryTreeList: [] // 组织机构下拉框数据
}
},
mounted () {
this.getSysCategoryTree()
},
methods: {
open () {
this.visible = true
this.queryParam = {}
this.$nextTick(() => {
this.replacePage()
})
},
// 获取组织机构树
getSysCategoryTree () {
queryDepartTreeList().then((res) => {
if (res.success) {
this.categoryTreeList = res.result
} else {
this.categoryTreeList = []
}
})
},
// 获取表格数据
replacePage () {
const query = {
...this.queryParam,
pageNo: this.ipagination.current,
pageSize: this.ipagination.pageSize,
// 搜索项目状态为未开始和进行中的数据
projectStatus: '1,2'
}
this.selectedRowKeys = []
this.loading = true
getEnterpriseStandardPlanPage(query).then((res) => {
if (res.success) {
this.dataList = res.result.records
this.ipagination.total = res.result.total
this.selectedRowKeys = this.value.split(',')
} 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 standardNumberList = this.selectedRowList.map(item => item.originEnStandardNo)
this.$emit('change', this.selectedRowKeys.join(','))
this.$emit('standardNumberChange', standardNumberList.join(','))
this.$emit('listChange', this.selectedRowList)
this.visible = false
} else {
this.$message.warning(this.$t('selectLeastOne'))
}
}
}
}
</script>
<style scoped>
</style>
@@ -8,7 +8,7 @@
{{this.$t('standardSelect.standardSelection')}}
</a-button>
</div>
<standard-selection-modal ref="standardSelectionModal" v-bind="$attrs" :value="value" @change="modalInput" @nameChange="modalNameChange" @listChange="modalListChange"></standard-selection-modal>
<standard-selection-modal ref="standardSelectionModal" v-bind="$attrs" :value="value" @change="modalInput" @nameChange="modalNameChange"></standard-selection-modal>
</div>
</template>
@@ -46,9 +46,6 @@ export default {
},
modalNameChange (value) {
this.$emit('nameChange', value)
},
modalListChange (value) {
this.$emit('listChange', value)
}
},
model: {
@@ -193,7 +193,6 @@ export default {
})
this.$emit('change', serialNumber.join(','))
this.$emit('nameChange', serialNameArr.join(','))
this.$emit('listChange', this.selectedRowList)
this.visible = false
} else {
this.$message.warning(this.$t('selectLeastOne'))
@@ -0,0 +1,116 @@
<template>
<div>
<div class="user-organ-wrap">
<a-input
:type="inputType"
:autosize="true"
:rows="1"
disabled
class="user-input"
:placeholder="placeholder"
:value="checkedValue"
@click="selectClick"
:title="checkedValue"
>
</a-input>
<a-button type="primary" class="button-box" @click="selectClick" :disabled="disabled">
{{ $t('userSelect.select') }}
</a-button>
</div>
<user-select-by-contact-modal v-bind="$attrs" :nameStr="nameStr" ref="selectModal" @change="selectChange" @nameChange="nameChange"></user-select-by-contact-modal>
</div>
</template>
<script>
import UserSelectByContactModal from './UserSelectByContactModal'
export default {
name: 'UserSelectByContact',
components: { UserSelectByContactModal },
props: {
disabled: {
type: Boolean,
default: false
},
placeholder: {
type: String,
default: ''
},
value: {
type: String,
default: () => {
return ''
}
},
// 名字字符串
nameStr: {
type: String,
default: ''
},
// 修改的字段名
filedName: {
type: String,
default: ''
},
// 回显输入框的类型,默认是input
inputType: {
type: String,
required: false,
default: 'text'
}
},
watch: {
nameStr: {
immediate: true,
handler (val) {
this.checkedValue = val
}
}
},
data () {
return {
checkedValue: ''
}
},
methods: {
selectClick () {
this.$refs.selectModal.open(this.value)
},
selectChange (ids) {
this.$emit('change', ids)
},
nameChange (value) {
this.checkedValue = value
this.$emit('nameChange', value, this.filedName)
}
},
model: {
prop: 'value',
event: 'change'
}
}
</script>
<style scoped lang="less">
.user-organ-wrap {
width: 100%;
position: relative;
display: flex;
align-items: center;
height: 39.98px;
.user-input {
resize: none;
width: calc(100% - 70px);
}
// 因为需要加title,所以不能把鼠标事件去掉
/deep/ .ant-input-disabled {
background: #fff;
color: rgba(0, 0, 0, 0.65);
cursor: default;
}
.button-box {
margin-left: 5px;
}
}
</style>
@@ -0,0 +1,320 @@
<template>
<a-modal
:title="$t('userSelect.selectUser')"
:maskClosable="false"
:width="1000"
:closable="true"
@ok="handleOk"
@cancel="handleCancel"
:visible="visible">
<div class="modal-search-wrapper 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('system.contact.departName')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input :placeholder="$t('pleaseEnter')+$t('system.contact.departName')" v-model="queryParam.departName"></a-input>
</a-form-item>
</a-col>
<span style="float: right;overflow: hidden;margin-right: 11px" class="table-page-search-submitButtons">
<a-button style="margin-left: 8px" @click="searchReset">{{$t('reset')}}</a-button>
<a-button style="margin-left: 8px" type="primary" @click="searchQuery">{{$t('query')}}</a-button>
</span>
</a-row>
</a-form>
</div>
<div class="modal-content">
<a-table
:columns="columns"
rowKey="id"
bordered
:scroll="{x: '100%'}"
:data-source="dataSource"
:pagination="ipagination"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type: type }"
:loading="loadingLeft"
@change="leftTableChange">
<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>
<p class="modal-content-title">{{ $t('userSelect.selectedPersonnel') }}</p>
<div v-if="dataSourceRight && dataSourceRight.length > 0" class="name-content">
<div v-for="(item, index) in dataSourceRight" :key="item.id" class="name-div">
{{ item.realname + '(' + item.username + ')' }}
<a-icon type="close" @click="handleDelete(item, index)" />
</div>
</div>
<a-empty v-else/>
</a-modal>
</template>
<script>
import { getAction } from '@/api/manage'
export default {
name: 'UserSelectByContactModal',
props: {
type: { // 是单选还是多选
type: String,
default: 'radio'
},
value: {
type: String,
default: () => {
return ''
}
}
},
watch: {
value: {
immediate: true,
handler (val) {
console.log(val)
if (val) {
this.selectedRowKeys = val ? val.split(',') : []
this.getUserListByIds(val)
}
}
}
},
data () {
return {
visible: false,
queryParam: {},
labelCol: {
span: 1
},
wrapperCol: {
span: 22
},
columns: [
{ // 部门名称
title: this.$t('system.contact.departName'),
align: 'center',
width: 180,
dataIndex: 'departName',
scopedSlots: { customRender: 'text' }
},
{ // 标准化工程师
title: this.$t('system.contact.standardizationEngineer'),
align: 'center',
width: 180,
dataIndex: 'standardizationEngineer',
scopedSlots: { customRender: 'text' }
},
{ // 联络人
title: this.$t('system.contact.contactPerson'),
align: 'center',
width: 180,
dataIndex: 'contactPerson',
scopedSlots: { customRender: 'text' }
},
{ // 部门联络人主管级领导
title: this.$t('system.contact.contactPersonSupervisorLevelLeader'),
align: 'center',
width: 240,
dataIndex: 'contactPersonSupervisorLevelLeader',
scopedSlots: { customRender: 'text' }
}
],
dataSource: [],
ipagination: {
current: 1,
pageSize: 5,
pageSizeOptions: ['5', '10', '20', '30', '100', '200'],
showTotal: (total, range) => {
return range[0] + '-' + range[1] + ' ' + this.$t('total') + ' ' + total + ' ' + this.$t('strip')
},
showQuickJumper: true,
showSizeChanger: true,
total: 0
},
selectedRowKeys: [],
loadingLeft: false,
dataSourceRight: [],
url: {
userList: '',
userListByIds: '/sys/user/queryByIds'
}
}
},
mounted () {
this.loadData()
},
methods: {
open (value) {
this.visible = true
if (value) {
this.selectedRowKeys = value.split(',')
this.getUserListByIds(value)
this.loadData()
}
},
searchReset () {
this.queryParam = {}
this.loadData()
},
searchQuery () {
this.loadData()
},
// 获取用户左侧树列表
loadData () {
const params = Object.assign({}, this.queryParam)
params.pageNo = this.ipagination.current
params.pageSize = this.ipagination.pageSize
params.column = 'createTime'
params.order = 'desc'
this.loadingLeft = true
getAction(this.url.userList, params).then((res) => {
if (res.success) {
if (res.result.current > 1 && res.result.records.length === 0) {
this.ipagination.current = res.result.current - 1
this.loadData()
return
}
this.dataSource = res.result.records || []
this.ipagination.total = res.result.total
} else {
this.$message.warn(res.message)
}
}).finally(() => {
this.loadingLeft = false
})
},
// 表格选择
onSelectChange (selectedRowKeys, selectedRows) {
this.selectedRowKeys = selectedRowKeys
if (this.type === 'checkbox') {
if (selectedRowKeys.length > this.dataSourceRight.length) {
// 说明是增加了数据
for (const rowIndex in selectedRows) {
if (!this.dataSourceRight.find(item => item.id === selectedRows[rowIndex].id)) {
// 右侧不存在,追加到右侧表格
this.dataSourceRight.push(selectedRows[rowIndex])
}
}
} else {
// 说明是删除了数据
if (selectedRowKeys && selectedRowKeys.length > 0) {
// 没有选中数据,说明这一页没有选中数据了
for (let i = 0; i < this.dataSourceRight.length; i++) {
if (!selectedRowKeys.find(item => item === this.dataSourceRight[i].id)) {
// 表格选中中没有找到这一条数据,说明已经被删了
this.dataSourceRight.splice(i, 1)
i--
}
}
} else {
this.dataSourceRight = []
}
}
console.log(this.dataSourceRight)
} else {
this.dataSourceRight = selectedRows
}
},
// 左侧表格改变
leftTableChange (pagination) {
this.ipagination = pagination
this.loadData()
},
// 根据ids获取用户列表
getUserListByIds (ids) {
const params = {}
params.userIds = ids
this.loadingRight = true
getAction(this.url.userListByIds, params).then((res) => {
if (res.success) {
this.dataSourceRight = res.result || []
} else {
this.$message.warn(res.message)
}
}).finally(() => {
this.loadingRight = false
})
},
// 名字列表的删除
handleDelete (record, index) {
this.dataSourceRight.splice(index, 1)
this.selectedRowKeys = this.selectedRowKeys.filter(item => item !== record.id)
},
handleOk () {
this.$emit('change', this.selectedRowKeys.join(','))
this.$emit('nameChange', this.dataSourceRight.map(item => item.realname + '(' + item.username + ')').join(','))
this.close()
},
handleCancel () {
this.close()
},
close () {
this.visible = false
this.dataSourceRight = []
this.selectedRowKeys = []
this.queryParam = {}
this.ipagination = {
current: 1,
pageSize: 5,
pageSizeOptions: ['5', '10', '20', '30', '100', '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 lang="less">
.modal-content {
width: 100%;
display: flex;
justify-content: space-between;
&-left {
width: 58%;
}
&-right {
width: 40%;
}
&-title-div {
display: flex;
align-items: center;
height: 28px;
margin: 20px 0;
.modal-content-title {
color: #1D2129;
font-weight: 500;
margin-right: 12px;
margin-bottom: 0;
}
}
}
.name-content {
display: flex;
flex-wrap: wrap;
.name-div {
width: auto;
padding: 5px 16px;
margin-right: 12px;
margin-top: 8px;
background: rgba(213, 44, 38, 0.08);
border-radius: 4px 4px 4px 4px;
opacity: 1;
color: @primary-color;
white-space: nowrap;
/deep/ .anticon {
margin-left: 4px;
}
}
}
/deep/ .ant-form-item-label{
min-width: 70px !important;
}
</style>
@@ -0,0 +1,116 @@
<template>
<div>
<div class="user-organ-wrap">
<a-input
:type="inputType"
:autosize="true"
:rows="1"
disabled
class="user-input"
:placeholder="placeholder"
:value="checkedValue"
@click="selectClick"
:title="checkedValue"
>
</a-input>
<a-button type="primary" class="button-box" @click="selectClick" :disabled="disabled">
{{ $t('userSelect.select') }}
</a-button>
</div>
<user-select-by-work-group-modal v-bind="$attrs" :nameStr="nameStr" ref="selectModal" @change="selectChange" @nameChange="nameChange"></user-select-by-work-group-modal>
</div>
</template>
<script>
import UserSelectByWorkGroupModal from './UserSelectByWorkGroupModal'
export default {
name: 'UserSelectByWorkGroup',
components: { UserSelectByWorkGroupModal },
props: {
disabled: {
type: Boolean,
default: false
},
placeholder: {
type: String,
default: ''
},
value: {
type: String,
default: () => {
return ''
}
},
// 名字字符串
nameStr: {
type: String,
default: ''
},
// 修改的字段名
filedName: {
type: String,
default: ''
},
// 回显输入框的类型,默认是input
inputType: {
type: String,
required: false,
default: 'text'
}
},
watch: {
nameStr: {
immediate: true,
handler (val) {
this.checkedValue = val
}
}
},
data () {
return {
checkedValue: ''
}
},
methods: {
selectClick () {
this.$refs.selectModal.open(this.value)
},
selectChange (ids) {
this.$emit('change', ids)
},
nameChange (value) {
this.checkedValue = value
this.$emit('nameChange', value, this.filedName)
}
},
model: {
prop: 'value',
event: 'change'
}
}
</script>
<style scoped lang="less">
.user-organ-wrap {
width: 100%;
position: relative;
display: flex;
align-items: center;
height: 39.98px;
.user-input {
resize: none;
width: calc(100% - 70px);
}
// 因为需要加title,所以不能把鼠标事件去掉
/deep/ .ant-input-disabled {
background: #fff;
color: rgba(0, 0, 0, 0.65);
cursor: default;
}
.button-box {
margin-left: 5px;
}
}
</style>
@@ -0,0 +1,365 @@
<template>
<a-modal
:title="$t('userSelect.selectUser')"
:maskClosable="false"
:width="1000"
:closable="true"
@ok="handleOk"
@cancel="handleCancel"
:visible="visible">
<div class="modal-search-wrapper 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('system.internalWorkGroup.name')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input :placeholder="$t('pleaseEnter')+$t('system.internalWorkGroup.name')" v-model="queryParam.realname"></a-input>
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item :label="$t('system.internalWorkGroup.workNo')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input :placeholder="$t('pleaseEnter')+$t('system.internalWorkGroup.workNo')" v-model="queryParam.username"></a-input>
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item :label="$t('system.internalWorkGroup.role')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input :placeholder="$t('pleaseEnter')+$t('system.internalWorkGroup.role')" v-model="queryParam.userRoleName"></a-input>
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item :label="$t('system.internalWorkGroup.post')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input :placeholder="$t('pleaseEnter')+$t('system.internalWorkGroup.post')" v-model="queryParam.userPostName"></a-input>
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item :label="$t('userSelect.workGroup')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-tree-select
tree-node-filter-prop="title"
v-model="queryParam.workingGroupId"
:maxTagCount="1"
:show-search="true"
:getPopupContainer="triggerNode=> triggerNode.parentNode"
style="width: 100%"
:tree-data="workingGroupTreeList"
:placeholder="$t('pleaseSelect')"
/>
</a-form-item>
</a-col>
<span style="float: right;overflow: hidden;margin-right: 11px" class="table-page-search-submitButtons">
<a-button style="margin-left: 8px" @click="searchReset">{{$t('reset')}}</a-button>
<a-button style="margin-left: 8px" type="primary" @click="searchQuery">{{$t('query')}}</a-button>
</span>
</a-row>
</a-form>
</div>
<div class="modal-content">
<a-table
:columns="columns"
rowKey="userId"
bordered
:scroll="{x: '100%'}"
:data-source="dataSource"
:pagination="ipagination"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type: type }"
:loading="loadingLeft"
@change="leftTableChange">
<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>
<p class="modal-content-title">{{ $t('userSelect.selectedPersonnel') }}</p>
<div v-if="dataSourceRight && dataSourceRight.length > 0" class="name-content">
<div v-for="(item, index) in dataSourceRight" :key="item.id" class="name-div">
{{ item.realname + '(' + item.username + ')' }}
<a-icon type="close" @click="handleDelete(item, index)" />
</div>
</div>
<a-empty v-else/>
</a-modal>
</template>
<script>
import { getAction } from '@/api/manage'
import { getWorkGroupTreeList } from '@/api/api'
export default {
name: 'UserSelectByWorkGroupModal',
props: {
type: { // 是单选还是多选
type: String,
default: 'radio'
},
value: {
type: String,
default: () => {
return ''
}
}
},
watch: {
value: {
immediate: true,
handler (val) {
console.log(val)
if (val) {
this.selectedRowKeys = val ? val.split(',') : []
this.getUserListByIds(val)
}
}
}
},
data () {
return {
visible: false,
queryParam: {},
labelCol: {
span: 1
},
wrapperCol: {
span: 22
},
columns: [
{
title: this.$t('user.workNo'),
dataIndex: 'username',
align: 'center',
scopedSlots: { customRender: 'text' }
},
{
title: this.$t('userSelect.name'),
dataIndex: 'realname',
align: 'center',
scopedSlots: { customRender: 'text' }
},
{
title: this.$t('role'),
dataIndex: 'userRoleName',
align: 'center',
scopedSlots: { customRender: 'text' }
},
{
title: this.$t('userSelect.post'),
dataIndex: 'userPostName',
align: 'center',
scopedSlots: { customRender: 'text' }
}
],
dataSource: [],
ipagination: {
current: 1,
pageSize: 5,
pageSizeOptions: ['5', '10', '20', '30', '100', '200'],
showTotal: (total, range) => {
return range[0] + '-' + range[1] + ' ' + this.$t('total') + ' ' + total + ' ' + this.$t('strip')
},
showQuickJumper: true,
showSizeChanger: true,
total: 0
},
selectedRowKeys: [],
loadingLeft: false,
dataSourceRight: [],
workingGroupTreeList: [], // 内部工作组下拉框数据
url: {
userList: '/sys/lawsWorkingGroupUser/page',
userListByIds: '/sys/user/queryByIds'
}
}
},
mounted () {
this.getWorkGroupTree()
this.loadData()
},
methods: {
open (value) {
this.visible = true
if (value) {
this.selectedRowKeys = value.split(',')
this.getUserListByIds(value)
this.loadData()
}
},
// 获取内部工作组树
getWorkGroupTree () {
getWorkGroupTreeList().then((res) => {
if (res.success) {
this.workingGroupTreeList = this.dealTreeData(res.result)
} else {
this.workingGroupTreeList = []
}
})
},
// 处理左侧树数据结构
dealTreeData (treeData) {
return treeData.map(item => {
item.label = item.name
item.value = item.id
item.children = this.dealTreeData(item.subset)
return item
})
},
searchReset () {
this.queryParam = {}
this.loadData()
},
searchQuery () {
this.loadData()
},
// 获取用户左侧树列表
loadData () {
const params = Object.assign({}, this.queryParam)
params.pageNo = this.ipagination.current
params.pageSize = this.ipagination.pageSize
this.loadingLeft = true
getAction(this.url.userList, params).then((res) => {
if (res.success) {
if (res.result.current > 1 && res.result.records.length === 0) {
this.ipagination.current = res.result.current - 1
this.loadData()
return
}
this.dataSource = res.result.records || []
this.ipagination.total = res.result.total
} else {
this.$message.warn(res.message)
}
}).finally(() => {
this.loadingLeft = false
})
},
// 表格选择
onSelectChange (selectedRowKeys, selectedRows) {
this.selectedRowKeys = selectedRowKeys
if (this.type === 'checkbox') {
if (selectedRowKeys.length > this.dataSourceRight.length) {
// 说明是增加了数据
for (const rowIndex in selectedRows) {
if (!this.dataSourceRight.find(item => item.userId === selectedRows[rowIndex].userId)) {
// 右侧不存在,追加到右侧表格
this.dataSourceRight.push(selectedRows[rowIndex])
}
}
} else {
// 说明是删除了数据
if (selectedRowKeys && selectedRowKeys.length > 0) {
// 没有选中数据,说明这一页没有选中数据了
for (let i = 0; i < this.dataSourceRight.length; i++) {
if (!selectedRowKeys.find(item => item === this.dataSourceRight[i].userId)) {
// 表格选中中没有找到这一条数据,说明已经被删了
this.dataSourceRight.splice(i, 1)
i--
}
}
} else {
this.dataSourceRight = []
}
}
console.log(this.dataSourceRight)
} else {
this.dataSourceRight = selectedRows
}
},
// 左侧表格改变
leftTableChange (pagination) {
this.ipagination = pagination
this.loadData()
},
// 根据ids获取用户列表
getUserListByIds (ids) {
const params = {}
params.userIds = ids
this.loadingRight = true
getAction(this.url.userListByIds, params).then((res) => {
if (res.success) {
this.dataSourceRight = res.result || []
} else {
this.$message.warn(res.message)
}
}).finally(() => {
this.loadingRight = false
})
},
// 名字列表的删除
handleDelete (record, index) {
this.dataSourceRight.splice(index, 1)
this.selectedRowKeys = this.selectedRowKeys.filter(item => item !== record.userId)
},
handleOk () {
this.$emit('change', this.selectedRowKeys.join(','))
this.$emit('nameChange', this.dataSourceRight.map(item => item.realname + '(' + item.username + ')').join(','))
this.close()
},
handleCancel () {
this.close()
},
close () {
this.visible = false
this.dataSourceRight = []
this.selectedRowKeys = []
this.queryParam = {}
this.ipagination = {
current: 1,
pageSize: 5,
pageSizeOptions: ['5', '10', '20', '30', '100', '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 lang="less">
.modal-content {
width: 100%;
display: flex;
justify-content: space-between;
&-left {
width: 58%;
}
&-right {
width: 40%;
}
&-title-div {
display: flex;
align-items: center;
height: 28px;
margin: 20px 0;
.modal-content-title {
color: #1D2129;
font-weight: 500;
margin-right: 12px;
margin-bottom: 0;
}
}
}
.name-content {
display: flex;
flex-wrap: wrap;
.name-div {
width: auto;
padding: 5px 16px;
margin-right: 12px;
margin-top: 8px;
background: rgba(213, 44, 38, 0.08);
border-radius: 4px 4px 4px 4px;
opacity: 1;
color: @primary-color;
white-space: nowrap;
/deep/ .anticon {
margin-left: 4px;
}
}
}
/deep/ .ant-form-item-label{
min-width: 70px !important;
}
</style>
@@ -0,0 +1,121 @@
<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('system.contact.departName')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input :placeholder="$t('pleaseEnter')+$t('system.contact.departName')" v-model="queryParam.departName"></a-input>
</a-form-item>
</a-col>
<div style="float: right;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search" style="margin-left: 8px" v-has="'system:contactManage:search'">{{ $t('query') }}</a-button>
<a-button type="primary" ghost @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="plus" type="primary" v-has="'system:contactManage:add'"
@click="handleAdd">
{{ $t('newlyAdded') }}
</a-button>
</div>
<div>
<j-table
:can-drag="true"
:scroll="{x: '100%'}"
ref="table"
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<!-- 操作栏 -->
<div slot="action" slot-scope="{record}" class="action-span-cell">
<a @click="handleEdit(record)" class="table-ope-btn" v-has="'system:contactManage:edit'">{{ $t('edt') }}</a>
<a-divider type="vertical" />
<a @click="handleDelete(record.id)" class="table-ope-btn" v-has="'system:contactManage:delete'">{{ $t('delete') }}</a>
</div>
</j-table>
</div>
<contact-manage-modal ref="modalForm" @ok="modalFormOk"></contact-manage-modal>
</a-card>
</template>
<script>
import { JeroListMixin } from '@/mixins/JeroListMixin'
import JTable from '@/components/jero/JTable'
import ContactManageModal from './modules/ContactManageModal'
export default {
name: 'ContactManageList',
mixins: [JeroListMixin],
components: { ContactManageModal, JTable },
data () {
return {
labelCol: {
span: 4
},
wrapperCol: {
span: 14
},
columns: [
{ // 部门名称
title: this.$t('system.contact.departName'),
align: 'center',
width: 180,
dataIndex: 'departName',
scopedSlots: { customRender: 'text' }
},
{ // 标准化工程师
title: this.$t('system.contact.standardizationEngineer'),
align: 'center',
width: 180,
dataIndex: 'standardizationEngineer',
scopedSlots: { customRender: 'text' }
},
{ // 联络人
title: this.$t('system.contact.contactPerson'),
align: 'center',
width: 180,
dataIndex: 'contactPerson',
scopedSlots: { customRender: 'text' }
},
{ // 部门联络人主管级领导
title: this.$t('system.contact.contactPersonSupervisorLevelLeader'),
align: 'center',
width: 240,
dataIndex: 'contactPersonSupervisorLevelLeader',
scopedSlots: { customRender: 'text' }
},
{
title: this.$t('operation'),
scopedSlots: { customRender: 'action' },
align: 'center',
fixed: 'right',
width: 200
}
],
url: {
list: ''
}
}
}
}
</script>
<style scoped lang="less">
@import '~@assets/less/common.less';
</style>
@@ -0,0 +1,171 @@
<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('system.contact.departName')">
<j-select-depart
v-decorator.trim="[ 'departName', validatorRules.departName]"
:multi="false"
:backDepart="true"
:treeOpera="true">
</j-select-depart>
</a-form-item>
<!-- 标准化工程师 -->
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('system.contact.standardizationEngineer')">
<user-selection :placeholder="$t('pleaseSelect')+$t('system.contact.standardizationEngineer')"
v-decorator.trim="[ 'standardizationEngineer', validatorRules.standardizationEngineer]"
filedName="standardizationEngineer"
@nameChange="userSelectNameChange"
:nameStr="model.standardizationEngineer_dictText"
type="radio" />
</a-form-item>
<!-- 联络人 -->
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('system.contact.contactPerson')">
<user-selection :placeholder="$t('pleaseSelect')+$t('system.contact.contactPerson')"
v-decorator.trim="[ 'contactPerson', validatorRules.contactPerson]"
filedName="contactPerson"
@nameChange="userSelectNameChange"
:nameStr="model.contactPerson_dictText"
type="radio" />
</a-form-item>
<!-- 部门联络人主管级领导 -->
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('system.contact.contactPersonSupervisorLevelLeader')">
<user-selection :placeholder="$t('pleaseSelect')+$t('system.contact.contactPersonSupervisorLevelLeader')"
v-decorator.trim="[ 'contactPersonSupervisorLevelLeader', validatorRules.contactPersonSupervisorLevelLeader]"
filedName="contactPersonSupervisorLevelLeader"
@nameChange="userSelectNameChange"
:nameStr="model.contactPersonSupervisorLevelLeader_dictText"
type="radio" />
</a-form-item>
</a-form>
</a-spin>
</j-modal>
</template>
<script>
import pick from 'lodash.pick'
import { postAction } from '@/api/manage'
import UserSelection from '@/components/selection/UserSelection'
export default {
name: 'ContactManageModal',
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: {
// 部门名称
departName: {
rules: [
{ required: true, message: this.$t('pleaseEnter') + this.$t('system.contact.departName') }
],
validateTrigger: 'blur'
},
// 标准化工程师
standardizationEngineer: {
rules: [
{ required: true, message: this.$t('pleaseEnter') + this.$t('system.contact.standardizationEngineer') }
],
validateTrigger: 'change'
},
// 联络人
contactPerson: {
rules: [
{ required: true, message: this.$t('pleaseEnter') + this.$t('system.contact.contactPerson') }
],
validateTrigger: 'change'
},
// 部门联络人主管级领导
contactPersonSupervisorLevelLeader: {
rules: [
{ required: true, message: this.$t('pleaseEnter') + this.$t('system.contact.contactPersonSupervisorLevelLeader') }
],
validateTrigger: 'change'
}
},
url: {
add: '',
edit: ''
}
}
},
methods: {
add () {
this.edit({})
},
edit (record) {
this.visible = true
this.form.resetFields()
this.model = Object.assign({}, record)
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model, 'departName', 'standardizationEngineer', 'contactPerson', 'contactPersonSupervisorLevelLeader'))
})
},
// 选择用户得到用户名
userSelectNameChange (value, fieldName) {
this.model[fieldName + '_dictText'] = value
},
handleCancel () {
this.close()
},
handleOk () {
if (this.confirmLoading) return
this.form.validateFields((err, values) => {
if (!err) {
this.confirmLoading = true
const param = Object.assign({}, values)
let url = ''
if (this.model.id) {
url = this.url.edit
param.id = this.model.id
} else {
url = this.url.add
}
postAction(url, 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>
@@ -11,6 +11,7 @@
</a>
</div>
</template>
<!-- 基础信息 -->
<div v-if="switchValue === 'base'" class="scroll-content">
<!-- 流程信息 -->
<div class="process-part-title">{{ $t('processInformation') }}</div>
@@ -36,14 +37,16 @@
v-decorator="['expirationDate']" />
</a-form-item>
</a-col>
<!-- 流程说明 -->
<a-form-item :labelCol="longLabelCol" :wrapperCol="longWrapperCol" :label="$t('processExplain')">
<a-textarea :placeholder="$t('pleaseEnter') + $t('processExplain')"
:maxLength="500"
:rows="4"
:disabled="disabled"
v-decorator="['processExplain']" />
</a-form-item>
<a-col :span="24">
<!-- 流程说明 -->
<a-form-item :labelCol="longLabelCol" :wrapperCol="longWrapperCol" :label="$t('processExplain')">
<a-textarea :placeholder="$t('pleaseEnter') + $t('processExplain')"
:maxLength="500"
:rows="4"
:disabled="disabled"
v-decorator="['processExplain']" />
</a-form-item>
</a-col>
</a-row>
</a-form>
@@ -90,7 +93,6 @@
<a-select v-else
v-model="formInline.itemCategory"
:disabled="disabled"
@change="itemCategoryChange"
:placeholder="$t('pleaseSelect')+$t('workCenter.enterpriseInitChangePlan.itemCategory')">
<a-select-option :value="1">{{ $t('workCenter.enterpriseInitChangePlan.completionTimeChange') }}</a-select-option>
<a-select-option :value="2">{{ $t('workCenter.enterpriseInitChangePlan.terminationOfWork') }}</a-select-option>
@@ -107,6 +109,7 @@
v-if="formInline.applicationType === 1"
ref="approvalBaseInfo"
:disabled="disabled"
:currentNode="currentNode"
:itemCategory="formInline.itemCategory">
</approval-base-info>
<!-- 申请类型为变更时的业务基本信息部分组件 -->
@@ -114,9 +117,34 @@
v-else-if="formInline.applicationType === 2"
ref="changeBaseInfo"
:disabled="disabled"
:currentNode="currentNode"
>
</change-base-info>
<!-- 部分节点需要选人 -->
<a-form v-if="formInline.applicationType === 2 && [6, 7].includes(currentNode)" class="user-form" :form="userForm">
<a-row :gutter="24">
<a-col :span="12">
<!-- 所长节点6需要选所长 -->
<a-form-item v-if="currentNode === 6" :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('workCenter.enterpriseInitChangePlan.superintendent')">
<user-selection :placeholder="$t('pleaseSelect') + $t('workCenter.enterpriseInitChangePlan.superintendent')"
type="radio"
v-decorator="['superintendent', validatorRules.superintendent]"
input-type="textarea" />
</a-form-item>
</a-col>
<a-col :span="12">
<!-- 相关人员节点7需要选相关人员 -->
<a-form-item v-if="currentNode === 7" :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('workCenter.enterpriseInitChangePlan.relatedPersonnel')">
<user-selection :placeholder="$t('pleaseSelect') + $t('workCenter.enterpriseInitChangePlan.relatedPersonnel')"
type="checkbox"
v-decorator="['relatedPersonnel', validatorRules.relatedPersonnel]"
input-type="textarea" />
</a-form-item>
</a-col>
</a-row>
</a-form>
<!-- 流程审批信息 -->
<div class="process-part-title">{{ $t('processApprovalInformation') }}</div>
<a-form :form="approvalInfoForm">
@@ -133,18 +161,33 @@
</a-form-item>
</a-form>
</div>
<!-- 人员信息 -->
<div v-if="switchValue === 'user'" class="scroll-content">
<personnel-info></personnel-info>
<personnel-info :data="personnelInfoData" :currentNode="currentNode"></personnel-info>
</div>
<!-- 操作按钮 -->
<div class="bottom-operate-box">
<!-- 发起节点 -->
<template v-if="currentNode === 1">
<!-- 保存 -->
<a-button type="primary" ghost :loading="loading" @click="handleSave"><i class="iconfont icon-save"></i> {{ $t('preservation') }}</a-button>
<!-- 提交 -->
<a-button type="primary" :loading="loading" @click="handleSubmit" icon="upload">{{ $t('agree') }}</a-button>
</template>
<template v-if="currentNode === 2">
<!-- 变更的新起草部门主管级上一级领导下发节点 -->
<template v-else-if="formInline.applicationType === 2 && [6, 7].includes(currentNode)">
<!-- 转办 -->
<a-button type="primary" ghost :loading="loading" @click="handleTurnTo" icon="upload">{{ $t('turnTo') }}</a-button>
<!-- 保存 -->
<a-button type="primary" ghost :loading="loading" @click="handleSave"><i class="iconfont icon-save"></i> {{ $t('preservation') }}</a-button>
<!-- 提交 -->
<a-button type="primary" :loading="loading" @click="handleSubmit" icon="upload">{{ $t('agree') }}</a-button>
</template>
<template v-else-if="formInline.applicationType === 2 && currentNode === 9">
<!-- 确定, 谁发起的谁点确定抄送消息 -->
<a-button type="primary" :loading="loading" @click="handleDetermine" icon="upload">{{ $t('determine') }}</a-button>
</template>
<template v-else>
<!-- 转办 -->
<a-button type="primary" ghost :loading="loading" @click="handleTurnTo" icon="upload">{{ $t('turnTo') }}</a-button>
<!-- 保存 -->
@@ -165,14 +208,133 @@
import InternalDetailPage from '@/components/InternalDetailPage'
import PersonnelInfo from '@/components/PersonnelInfo'
import UserSelectModal from '@/components/selection/UserSelectModal'
import UserSelection from '@/components/selection/UserSelection'
import {
enterprisePlanApprovalTurnTo,
enterprisePlanApprovalAgree,
enterprisePlanApprovalReject
enterprisePlanApprovalReject,
enterprisePlanApprovalDetermine
} from '@/api/workCenter'
import ApprovalBaseInfo from './modules/ApprovalBaseInfo'
import ChangeBaseInfo from './modules/ChangeBaseInfo'
// 标准立项的人员信息
const approvalPersonalInfo = [ // 人员信息的数据
{
id: 1,
nodeName: '主起草人发起',
nodeRoleName: '发起人',
canChoose: false
},
{
id: 2,
nodeName: '部所联络人校对',
nodeRoleName: '部所联络人',
canChoose: true,
chooseType: 'radio',
chooseSource: 'contactManage'
},
{
id: 3,
nodeName: '专家审批',
nodeRoleName: '专家',
canChoose: true,
chooseType: 'checkbox',
chooseSource: 'workGroup'
},
{
id: 4,
nodeName: '发起人主管级领导审批',
nodeRoleName: '发起人主管级领导',
canChoose: true,
chooseType: 'radio'
},
{
id: 5,
nodeName: '发起人主管级上级领导审批',
nodeRoleName: '发起人主管级上级领导',
canChoose: true,
chooseType: 'radio'
},
{
id: 6,
nodeName: '标准化审批',
nodeRoleName: '标准化',
canChoose: true,
chooseType: 'radio'
}
]
// 变更的人员信息
const changePersonalInfo = [
{
id: 1,
nodeName: '主起草人发起',
nodeRoleName: '发起人',
canChoose: false
},
{
id: 2,
nodeName: '部所联络人校对',
nodeRoleName: '部所联络人',
canChoose: true,
chooseType: 'radio',
chooseSource: 'contactManage'
},
{
id: 3,
nodeName: '主起草人主管级领导审批',
nodeRoleName: '主起草人主管级领导',
canChoose: true,
chooseType: 'radio'
},
{
id: 4,
nodeName: '主起草人主管级上一级领导审批',
nodeRoleName: '主起草人主管级上一级领导',
canChoose: true,
chooseType: 'radio'
},
{
id: 5,
nodeName: '标准化审批',
nodeRoleName: '标准化',
canChoose: true,
chooseType: 'radio'
},
{
id: 6,
nodeName: '新起草部门主管级上一级领导下发',
nodeRoleName: '新起草部门主管级上一级领导',
canChoose: true,
chooseType: 'radio',
disabled: true
},
{
id: 7,
nodeName: '新起草部门主管级领导确认',
nodeRoleName: '新起草部门主管级领导',
canChoose: true,
chooseType: 'radio',
disabled: true
},
{
id: 8,
nodeName: '相关人员会签',
nodeRoleName: '相关人员',
canChoose: true,
chooseType: 'checkbox',
disabled: true
},
{
id: 9,
nodeName: '抄送主起草人',
nodeRoleName: '主起草人',
canChoose: true,
chooseType: 'checkbox',
disabled: true
},
]
export default {
name: 'PlanApprovalFlow',
components: {
@@ -180,19 +342,37 @@ export default {
ApprovalBaseInfo,
UserSelectModal,
PersonnelInfo,
InternalDetailPage
InternalDetailPage,
UserSelection
},
computed: {
pageTitle () {
return this.$t('flowCenter') + this.$route.meta.title
}
},
watch: {
'formInline.applicationType' (value) {
if (value) {
if (this.formInline.applicationType === 1) {
this.personnelInfoData = approvalPersonalInfo
} else {
this.personnelInfoData = changePersonalInfo
}
}
if (this.formInline.itemCategory) {
this.formInline.itemCategory = undefined
}
}
},
mounted () {
this.personnelInfoData = approvalPersonalInfo
},
data () {
return {
loading: false,
switchValue: 'base', // 头部tab选中值
disabled: false,
currentNode: 2, // 当前节点
currentNode: 1, // 当前节点
model: {},
processInfoForm: this.$form.createForm(this),
labelCol: {
@@ -224,6 +404,20 @@ export default {
{ required: false, message: this.$t('pleaseEnter') + this.$t('remarks') }
],
validateTrigger: 'blur'
},
// 所长
superintendent: {
rules: [
{ required: true, message: this.$t('pleaseSelect') + this.$t('workCenter.enterpriseInitChangePlan.superintendent') }
],
validateTrigger: 'change'
},
// 相关人员
relatedPersonnel: {
rules: [
{ required: true, message: this.$t('pleaseSelect') + this.$t('workCenter.enterpriseInitChangePlan.relatedPersonnel') }
],
validateTrigger: 'change'
}
},
formInline: {},
@@ -245,7 +439,9 @@ export default {
}
]
},
approvalInfoForm: this.$form.createForm(this) // 审批信息表单
userForm: this.$form.createForm(this), // 部分节点需要选人的表单
approvalInfoForm: this.$form.createForm(this), // 审批信息表单
personnelInfoData: []
}
},
methods: {
@@ -255,6 +451,7 @@ export default {
},
// 项目类别改变
itemCategoryChange (value) {
console.log(value)
if (value === 1) {
this.$refs.approvalBaseInfo.rules.enterpriseStandardName[0].required = true
} else {
@@ -270,14 +467,27 @@ export default {
if (this.loading) return
this.processInfoForm.validateFields((err, values) => {
this.$refs.ruleForm.validate(valid => {
this.$refs.approvalBaseInfo.$refs.ruleForm.validate(approvalBaseValid => {
this.approvalInfoForm.validateFields((approvalErr, approvalValues) => {
if (valid && approvalBaseValid && !err && !approvalErr) {
this.loading = true
const param = Object.assign({}, this.$refs.approvalBaseInfo.formInline)
console.log(param)
}
})
this.approvalInfoForm.validateFields((approvalErr, approvalValues) => {
// 立项和变更的数据不一样,分开判断
if (this.formInline.applicationType === 1) {
// 是立项
this.$refs.approvalBaseInfo.$refs.ruleForm.validate(approvalBaseValid => {
if (valid && approvalBaseValid && !err && !approvalErr) {
this.loading = true
const param = Object.assign({}, this.$refs.approvalBaseInfo.formInline)
console.log(param)
}
})
} else {
// 是变更
this.userForm.validateFields((userErr, userValues) => {
if (valid && !err && !approvalErr && !userErr) {
this.loading = true
const param = this.$refs.changeBaseInfo.dataSource
console.log(param)
}
})
}
})
})
})
@@ -352,6 +562,28 @@ export default {
})
}
})
},
// 确定
handleDetermine () {
if (this.loading) return
this.approvalInfoForm.validateFields((err, values) => {
if (!err) {
this.loading = true
let param = {}
param = Object.assign({}, values)
param.processId = this.model.id
enterprisePlanApprovalDetermine(param).then(res => {
if (res.success) {
this.$message.success(res.message)
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
this.validatorRules.remarks.rules[0].required = false
})
}
})
}
}
}
@@ -441,4 +673,11 @@ export default {
overflow: auto;
padding: 32px;
}
.user-form {
margin-top: 24px;
/deep/ .ant-form-item {
margin-bottom: 0;
}
}
</style>
@@ -17,7 +17,7 @@
:can-drag="true"
:scroll="{x: '100%'}"
ref="table"
rowKey="id"
rowKey="enterpriseStandardPlanId"
:columns="columns"
:dataSource="dataSource"
:pagination="false"
@@ -34,32 +34,35 @@
</template>
<!-- 操作栏 -->
<div slot="action" slot-scope="{record}" class="action-span-cell">
<a @click="handleEdit(record)" class="table-ope-btn" :disabled="disabled">{{ $t('edit') }}</a>
<div slot="action" slot-scope="{record, index}" class="action-span-cell">
<a @click="handleEdit(record, index)" class="table-ope-btn" :disabled="disabled">{{ $t('edit') }}</a>
<a-divider type="vertical" />
<a @click="handleDelete(record.id)" class="table-ope-btn" :disabled="disabled">{{ $t('delete') }}</a>
<a @click="handleDelete(record.id, index)" class="table-ope-btn" :disabled="disabled">{{ $t('delete') }}</a>
</div>
</j-table>
</div>
<change-base-info-drawer ref="changeBaseInfoDrawer"></change-base-info-drawer>
<change-base-info-drawer ref="changeBaseInfoDrawer" @ok="changeBaseInfoDrawerOk"></change-base-info-drawer>
</div>
</template>
<script>
import ChangeBaseInfoDrawer from './ChangeBaseInfoDrawer'
import { JeroListMixin } from '@/mixins/JeroListMixin'
import JTable from '@/components/jero/JTable'
export default {
name: 'ChangeBaseInfo',
components: { ChangeBaseInfoDrawer, JTable },
mixins: [JeroListMixin],
props: {
disabled: {
type: Boolean,
required: false,
default: false
},
currentNode: {
type: Number,
required: false,
default: 1
}
},
data () {
@@ -94,14 +97,14 @@ export default {
title: this.$t('workCenter.enterpriseInitChangePlan.principalDrafter'),
align: 'center',
width: 180,
dataIndex: 'mainDraftingUser',
dataIndex: 'principalDrafter_dictText',
scopedSlots: { customRender: 'text' }
},
{ // 主起草单位
title: this.$t('workCenter.enterpriseInitChangePlan.mainDraftUnit'),
align: 'center',
width: 180,
dataIndex: 'mainDraftingUnit',
dataIndex: 'mainDraftUnit',
scopedSlots: { customRender: 'text' }
},
{ // 原草稿计划完成日期
@@ -114,7 +117,7 @@ export default {
{ // 原征求意见稿计划完成日期
title: this.$t('workCenter.enterpriseInitChangePlan.originalExposureDraftPlanFinishDate'),
align: 'center',
width: 200,
width: 210,
dataIndex: 'originalExposureDraftPlanFinishDate',
scopedSlots: { customRender: 'text' }
},
@@ -158,10 +161,9 @@ export default {
selectedRowKeys: [],
selectionRows: [],
url: {
list: '',
delete: '',
deleteBatch: ''
}
list: ''
},
modalType: '' // 是在新增还是在编辑,编辑的时候放正在编辑的下标
}
},
methods: {
@@ -179,13 +181,35 @@ export default {
this.selectedRowKeys = selectedRowKeys
this.selectionRows = selectionRows
},
// 新增或编辑完成
changeBaseInfoDrawerOk (value) {
console.log(value, this.modalType)
value.draftPlannedCompleteDate = value.originalDraftPlanFinishDate
value.solicitationDraftPlanCompleteDate = value.originalExposureDraftPlanFinishDate
value.planApprovalDate = value.originalPlanSubmissionDate
if (this.modalType === 'add') {
this.dataSource.push(value)
} else if (this.modalType && this.modalType.split(',')[0] === 'edit') {
this.dataSource.splice(Number(this.modalType.split(',')[1]), 1, value)
}
},
// 新增
handleAdd () {
this.modalType = 'add'
this.$refs.changeBaseInfoDrawer.add()
},
// 编辑
handleEdit (record) {
handleEdit (record, index) {
this.modalType = 'edit' + index
this.$refs.changeBaseInfoDrawer.edit(record)
},
// 删除
handleDelete (id, index) {
this.dataSource.splice(index, 1)
},
// 批量删除
batchDel () {
this.dataSource = this.dataSource.filter(item => !this.selectedRowKeys.includes(item.enterpriseStandardPlanId))
}
}
}
@@ -21,11 +21,13 @@
{{ $t('workCenter.enterpriseInitChangePlan.enterpriseStandardNum') }}
</span>
</div>
<a-form-model-item class="item-model" prop="enterpriseStandardNum">
<standard-selection :source="StandardSource.ENTERPRISE.value"
:disabledSourceSearch="true"
v-model="formInline.enterpriseStandardNum"
@listChange="listChange"/>
<a-form-model-item class="item-model" prop="enterpriseStandardPlanId">
<enterprise-plan-selection type="radio"
:placeholder="$t('pleaseSelect')+$t('workCenter.enterpriseInitChangePlan.enterpriseStandardNum')"
v-model="formInline.enterpriseStandardPlanId"
:standard-number="formInline.standardNo"
@standardNumberChange="standardNumberChange"
@listChange="listChange"/>
</a-form-model-item>
</div>
<!-- 企标名称 -->
@@ -36,10 +38,10 @@
{{ $t('workCenter.enterpriseInitChangePlan.enterpriseStandardName') }}
</span>
</div>
<a-form-model-item class="item-model" prop="enterpriseStandardName">
<a-form-model-item class="item-model" prop="standardName">
<a-input class="box-input"
disabled
v-model="formInline.enterpriseStandardName"
v-model="formInline.standardName"
:maxLength="50"
:placeholder="$t('pleaseEnter')+$t('workCenter.enterpriseInitChangePlan.enterpriseStandardName')" />
</a-form-model-item>
@@ -171,6 +173,7 @@
<!-- 变更原因 -->
<div class="box-title-text form-flex-item form-flex-item-long">
<div class="title-text title-text-long">
<span class="required">*</span>
<span class="title-text-text" :title="$t('workCenter.enterpriseInitChangePlan.changeReason')">
{{ $t('workCenter.enterpriseInitChangePlan.changeReason') }}
</span>
@@ -194,12 +197,12 @@
<script>
import { StandardSource } from '@/enums/commonEnums'
import StandardSelection from '@/components/selection/StandardSelection'
import UserSelection from '@/components/selection/UserSelection'
import EnterprisePlanSelection from '../../../../../components/selection/EnterprisePlanSelection'
export default {
name: 'ChangeBaseInfoDrawer',
components: { StandardSelection, UserSelection },
components: { EnterprisePlanSelection, UserSelection },
data () {
return {
StandardSource,
@@ -209,12 +212,44 @@ export default {
formInline: {},
rules: {
// 企标编号
enterpriseStandardNum: [
enterpriseStandardPlanId: [
{
required: true,
message: this.$t('workCenter.enterpriseInitChangePlan.enterpriseStandardNum') + this.$t('cannotEmpty'),
trigger: 'change'
}
],
// 草稿计划完成日期
draftPlanFinishDate: [
{
required: true,
message: this.$t('workCenter.enterpriseInitChangePlan.draftPlanFinishDate') + this.$t('cannotEmpty'),
trigger: ['change', 'blur']
}
],
// 征求意见稿计划完成日期
exposureDraftPlanFinishDate: [
{
required: true,
message: this.$t('workCenter.enterpriseInitChangePlan.exposureDraftPlanFinishDate') + this.$t('cannotEmpty'),
trigger: ['change', 'blur']
}
],
// 计划报批日期
planSubmissionDate: [
{
required: true,
message: this.$t('workCenter.enterpriseInitChangePlan.planSubmissionDate') + this.$t('cannotEmpty'),
trigger: ['change', 'blur']
}
],
// 变更原因
changeReason: [
{
required: true,
message: this.$t('workCenter.enterpriseInitChangePlan.changeReason') + this.$t('cannotEmpty'),
trigger: 'blur'
}
]
}
}
@@ -228,41 +263,25 @@ export default {
this.model = Object.assign({}, record)
this.formInline = Object.assign({}, record)
},
// 企标计划选择完成的企标编号回调
standardNumberChange (value) {
this.formInline.standardNo = value
},
// 企标选编号选择完成的回调
listChange (value) {
// todo: 三个有校验的日期验证不会消失
console.log(value)
// 企标名称
const serialNameArr = []
// 主起草人
const principalDrafterArr = []
// 主起草单位
const mainDraftUnitArr = []
// 草稿计划完成日期
const draftPlanFinishDateArr = []
// 征求意见稿计划完成日期
const exposureDraftPlanFinishDateArr = []
// 计划报批日期
const planSubmissionDateArr = []
if (value && value.length > 0) {
value.forEach(res => {
serialNameArr.push(res.standardName || '')
principalDrafterArr.push(res.principalDrafter)
mainDraftUnitArr.push(res.mainDraftUnit)
draftPlanFinishDateArr.push(res.draftPlanFinishDate || '')
exposureDraftPlanFinishDateArr.push(res.exposureDraftPlanFinishDate || '')
planSubmissionDateArr.push(res.planSubmissionDate || '')
})
this.formInline.standardName = value[0].originEnStandardName
this.formInline.principalDrafter_dictText = value[0].mainDraftingUser
this.formInline.mainDraftUnit = value[0].mainDraftingUnit
this.formInline.originalDraftPlanFinishDate = value[0].draftPlannedCompleteDate
this.formInline.originalExposureDraftPlanFinishDate = value[0].solicitationDraftPlanCompleteDate
this.formInline.originalPlanSubmissionDate = value[0].planApprovalDate
this.formInline.draftPlanFinishDate = value[0].draftPlannedCompleteDate
this.formInline.exposureDraftPlanFinishDate = value[0].solicitationDraftPlanCompleteDate
this.formInline.planSubmissionDate = value[0].planApprovalDate
}
// const formInline = {}
this.formInline.enterpriseStandardName = serialNameArr.join(',')
this.formInline.principalDrafter = principalDrafterArr.join(',')
this.formInline.mainDraftUnit = mainDraftUnitArr.join(',')
this.formInline.originalDraftPlanFinishDate = draftPlanFinishDateArr.join(',')
this.formInline.originalExposureDraftPlanFinishDate = exposureDraftPlanFinishDateArr.join(',')
this.formInline.originalPlanSubmissionDate = planSubmissionDateArr.join(',')
this.formInline.draftPlanFinishDate = draftPlanFinishDateArr.join(',')
this.formInline.exposureDraftPlanFinishDate = exposureDraftPlanFinishDateArr.join(',')
this.formInline.planSubmissionDate = planSubmissionDateArr.join(',')
},
// 选择用户得到用户名
userSelectNameChange (value, fieldName) {
@@ -276,12 +295,18 @@ export default {
this.model = {}
this.formInline = {}
this.visible = false
this.$refs.ruleForm.clearValidate()
},
// 提交
handleSubmit () {
if (this.confirmLoading) return
this.$refs.ruleForm.validate(valid => {
if (valid) {
this.confirmLoading = true
const formInline = JSON.parse(JSON.stringify(this.formInline))
this.$emit('ok', formInline)
this.close()
this.confirmLoading = false
}
})
}