[update 功能安全中心] 成员只能添加父级已添加的成员
This commit is contained in:
+4
-1
@@ -120,6 +120,8 @@ export const transitRESTful = {
|
||||
const getContactsByCompany = (params) => getAction('/company/payContactsManagement/queryByCompany', params)
|
||||
// 通过企业名称获取该企业下的联系人无权限接口
|
||||
const getContactsByCompanyNoLimit = (params) => getAction('/company/payContactsManagement/queryByCompanyMeeting', params)
|
||||
// 通过企业名称获取该企业下的联系人 功能安全中心接口只能看到父级的
|
||||
const getContactsByCompanyBySafetyCenter = (params) => getAction('/company/payContactsManagement/queryBySafetyCenter', params)
|
||||
// 通过联系人id获取联系人信息
|
||||
const getContactsById = (param) => getAction('/company/payContactsManagement/queryByIdMeeting', param)
|
||||
// 企业管理员重置密码
|
||||
@@ -203,7 +205,8 @@ export {
|
||||
ssLoginEnterTerminal,
|
||||
companyAdminResetPassword,
|
||||
companyAdminEnable,
|
||||
queryCompanyInfoById
|
||||
queryCompanyInfoById,
|
||||
getContactsByCompanyBySafetyCenter
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -77,6 +77,18 @@ export default {
|
||||
type:Boolean,
|
||||
required:false,
|
||||
default:false
|
||||
},
|
||||
// 自定义列表接口(功能安全中心只能看到父级已添加的企业)
|
||||
customListUrl: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: ''
|
||||
},
|
||||
// 自定义列表查询参数,功能安全中心会议
|
||||
customListParams: {
|
||||
type: Object,
|
||||
required: false,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@@ -133,7 +145,16 @@ export default {
|
||||
params.memberNature = this.memberNature
|
||||
}
|
||||
this.loading = true
|
||||
getAction(this.url.list, params).then((res) => {
|
||||
let url = this.url.list
|
||||
// 如果有自定义的查询列表接口,就用自定义的查询以及查询参数
|
||||
if (this.customListUrl) {
|
||||
url = this.customListUrl
|
||||
}
|
||||
// 如果有自定义查询参数,就将参数合并进去
|
||||
if (this.customListParams) {
|
||||
Object.assign(params, this.customListParams)
|
||||
}
|
||||
getAction(url, params).then((res) => {
|
||||
if (res.success) {
|
||||
//update-begin---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
|
||||
this.dataSource = res.result.records || res.result
|
||||
|
||||
@@ -72,6 +72,18 @@ export default {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false
|
||||
},
|
||||
// 自定义列表接口(功能安全中心只能看到父级已添加的企业)
|
||||
customListFn: {
|
||||
type: [Function, null],
|
||||
required: false,
|
||||
default: null
|
||||
},
|
||||
// 自定义列表查询参数,功能安全中心会议
|
||||
customListParams: {
|
||||
type: Object,
|
||||
required: false,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@@ -126,6 +138,22 @@ export default {
|
||||
} else {
|
||||
params.companyId = null
|
||||
}
|
||||
// 如果有自定义查询参数,就将参数合并进去
|
||||
if (this.customListParams) {
|
||||
Object.assign(params, this.customListParams)
|
||||
}
|
||||
// 如果有自定义查询接口,就用自定义的
|
||||
if (this.customListFn) {
|
||||
return new Promise(resolve => {
|
||||
this.customListFn(params).then(res => {
|
||||
this.contactsList = res.result
|
||||
if (this.initContacts && this.initContacts.id) {
|
||||
this.contactsList.push(this.initContacts)
|
||||
}
|
||||
resolve()
|
||||
})
|
||||
})
|
||||
}
|
||||
// 是否调用无权限接口
|
||||
if (this.isLimit) {
|
||||
// 调用无权限接口
|
||||
|
||||
@@ -67,13 +67,13 @@
|
||||
<span slot="action" class="action-span-cell" slot-scope="text, record">
|
||||
<!-- 研究组可以点击在研项目显示项目组的信息 -->
|
||||
<a @click="goUnderStudyProject(record)" v-has="'draftingGroup:underStudyProject'"
|
||||
v-if="record.projectType === SafetyCenterProjectTypeEnums.studyGroup.value">在研项目</a>
|
||||
v-if="record.projectType + '' === SafetyCenterProjectTypeEnums.studyGroup.value">在研项目</a>
|
||||
<a @click="goFilesMaintenance(record)" v-has="'draftingGroup:fileMaintenance'">其他分发资料</a>
|
||||
<a @click="goConferenceMaintenance(record)" v-has="'draftingGroup:meetingMaintenance'">项目会议</a>
|
||||
<!--<a @click="handleCopy(record.id)" v-has="'draftingGroup:copy'">复制</a>-->
|
||||
<a @click="handleEdit(record)" v-has="'draftingGroup:edit'">基本信息维护</a>
|
||||
<a @click="handleDelete(record.id)" v-has="'draftingGroup:delete'"
|
||||
v-if="record.projectType === SafetyCenterProjectTypeEnums.projectGroup.value">删除</a>
|
||||
v-if="record.projectType + '' === SafetyCenterProjectTypeEnums.projectGroup.value">删除</a>
|
||||
</span>
|
||||
</a-table>
|
||||
</div>
|
||||
|
||||
@@ -126,7 +126,8 @@
|
||||
</a-card>
|
||||
|
||||
<project-detail-modal ref="projectDetail"></project-detail-modal>
|
||||
<safety-center-member-unit-module ref="modalForm" @ok="modalFormOk"></safety-center-member-unit-module>
|
||||
<!-- 控制功能安全中心可以选择全部,其他的都只能选择父级选的 -->
|
||||
<safety-center-member-unit-module :is-safety-center="isSafetyCenter" ref="modalForm" @ok="modalFormOk"></safety-center-member-unit-module>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -138,7 +139,7 @@ import ProjectDetailModal from '../../components/ProjectDetailModal'
|
||||
import Vue from 'vue'
|
||||
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
||||
import PreviewFile from '../../components/jero/PreviewFile'
|
||||
import { ProjectTypeEnums } from '@/enums/commonEnums'
|
||||
import {ProjectTypeEnums, SafetyCenterProjectTypeEnums} from '@/enums/commonEnums'
|
||||
import SafetyCenterMemberUnitModule
|
||||
from '@views/functionalSafetyCenter/modules/SafetyCenterMemberUnitModule'
|
||||
|
||||
@@ -157,6 +158,10 @@ export default {
|
||||
computed: {
|
||||
importExcelUrl: function () {
|
||||
return `${ window._CONFIG['domianURL'] }/${ this.url.importExcelUrl }`
|
||||
},
|
||||
// projectType是否功能安全中心, 1功能安全中心 2研究组 3项目组
|
||||
isSafetyCenter () {
|
||||
return this.detail.projectType + '' === SafetyCenterProjectTypeEnums.safetyCenter.value
|
||||
}
|
||||
},
|
||||
data() {
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
v-decorator="['chargeCompany',validatorRules.chargeCompany]"
|
||||
:disabled="disabledCompany"
|
||||
@change="companyChange"
|
||||
:customListUrl="isSafetyCenter ? '' : companyList"
|
||||
:customListParams="isSafetyCenter ? {} : customListParams"
|
||||
:maxLength='50'>
|
||||
</company-select>
|
||||
</a-form-item>
|
||||
@@ -32,6 +34,8 @@
|
||||
v-decorator="[`contactsList[${index}].contactsId`, {rules: [{ required: index === 0, validator: index === 0 ? validateContactRequired : validateContact }],validateTrigger: 'change'}]"
|
||||
:maxLength='50'
|
||||
:ref="`selectContacts${index}`"
|
||||
:customListFn="isSafetyCenter ? null : getContactsByCompanyBySafetyCenter"
|
||||
:customListParams="isSafetyCenter ? {} : customListParams"
|
||||
@ok="addContactsOneOk"></select-contacts>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
@@ -77,11 +81,20 @@ import SelectContacts from '@comp/company/SelectContacts'
|
||||
import {getAllDraftProjects} from '@api/incomePaymentsApi'
|
||||
import { addZero } from '@/utils/util'
|
||||
import { CalcAmountMixin } from '@/mixins/CalcAmountMixin'
|
||||
import {getContactsByCompanyBySafetyCenter} from '@api/api'
|
||||
|
||||
export default {
|
||||
name: 'SafetyCenterMemberUnitModule',
|
||||
components: { CompanySelect, SelectContacts },
|
||||
mixins: [CalcAmountMixin],
|
||||
props: {
|
||||
// 是否安全中心,控制添加成员 只能选择上级的成员还是选择全部
|
||||
isSafetyCenter: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
required: false,
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '操作',
|
||||
@@ -132,6 +145,12 @@ export default {
|
||||
add: '/SafetyCenterSubitem/add',
|
||||
edit: '/SafetyCenterSubitem/edit'
|
||||
},
|
||||
// 成员单位列表(只能选上级选过的)
|
||||
companyList: '/company/payCompanyManagement/listSafetyCenter',
|
||||
// 需要带上当前项目id
|
||||
customListParams: {
|
||||
projectId: this.$route.query.projectId
|
||||
},
|
||||
// 默认的联系人数据
|
||||
defaultPayWorkingGroupSubItemContact: {
|
||||
contactsId: undefined,
|
||||
@@ -142,6 +161,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
addZero,
|
||||
getContactsByCompanyBySafetyCenter,
|
||||
add() {
|
||||
this.edit({})
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user