选择联系人组件修改,分标委样式调整

This commit is contained in:
zhaoxiao
2021-09-26 16:59:11 +08:00
parent a20d8c65bc
commit 3c9c9c5df8
3 changed files with 67 additions and 43 deletions
+26 -8
View File
@@ -60,6 +60,12 @@ export default {
type: Boolean,
required: false,
default: false
},
// value的类型
valueType: {
type: String,
required: false,
default: 'string'
}
},
data() {
@@ -109,11 +115,14 @@ export default {
const params = {
companyId: this.selectedCompany.id
}
getContactsByCompany(params).then(res => {
this.contactsList = res.result
if (this.initContacts && this.initContacts.hasOwnProperty.call(this.initContacts, 'id')) {
this.contactsList.push(this.initContacts)
}
return new Promise(resolve => {
getContactsByCompany(params).then(res => {
this.contactsList = res.result
if (this.initContacts && this.initContacts.hasOwnProperty.call(this.initContacts, 'id')) {
this.contactsList.push(this.initContacts)
}
resolve()
})
})
}
},
@@ -130,9 +139,18 @@ export default {
this.$message.warn('请先选择来款企业再为该企业新建联系人')
},
addContactsOk(id) {
this.getContactsList()
this.$emit('change', id)
this.$emit('ok')
this.getContactsList().then(() => {
if (this.valueType === 'object') {
let objContact = this.contactsList.filter(tt => tt.id === id)
objContact = objContact[0]
objContact.label = objContact.name
objContact.key = objContact.id
this.$emit('change', objContact)
} else {
this.$emit('change', id)
}
this.$emit('ok')
})
},
// 下拉框的搜索
filterOption(input, option) {
@@ -35,7 +35,8 @@
<!-- 操作按钮区域-->
<div class="table-operator">
<a-button type="primary" icon="plus" @click="handleAdd" v-has="'committee:add'">新增分标委</a-button>
<a-button type="primary" icon="export" @click="handleExportXls('分标委维护')" v-has="'committee:export'">导出</a-button>
<a-button type="primary" icon="export" @click="handleExportXls('分标委维护')" v-has="'committee:export'">导出
</a-button>
<a-button type="danger" icon="delete" @click="batchDel" v-has="'committee:batchDel'">批量删除</a-button>
</div>
<!-- 操作按钮区域-end-->
@@ -43,11 +44,13 @@
<!-- table表格区域-->
<div>
<a-table rowKey="id"
v-if="dataSource.length > 0"
:scroll="{x: 1300}"
:columns="columns"
:data-source="dataSource"
:pagination="ipagination"
bordered
:defaultExpandAllRows="true"
:loading="loading"
@change="handleTableChange"
class="j-table-force-nowrap">
@@ -56,29 +59,30 @@
</template>
<span slot="operation" class="action-span-cell" slot-scope="text, record">
<a @click="handleMaintainData(record)" v-has="'committee:fileMaintenance'">资料维护</a>
<a @click="handleMaintainMeeting(record)" v-has="'committee:meetingMaintenance'">会议维护</a>
<a @click="handleAddCommitteeMember(record)" v-has="'committee:addMember'">新增成员</a>
<a @click="handleEdit(record)" v-has="'committee:edit'">编辑</a>
<a @click="handleDelete(record.id)" v-has="'committee:delete'">删除</a>
</span>
<a @click="handleMaintainData(record)" v-has="'committee:fileMaintenance'">资料维护</a>
<a @click="handleMaintainMeeting(record)" v-has="'committee:meetingMaintenance'">会议维护</a>
<a @click="handleAddCommitteeMember(record)" v-has="'committee:addMember'">新增成员</a>
<a @click="handleEdit(record)" v-has="'committee:edit'">编辑</a>
<a @click="handleDelete(record.id)" v-has="'committee:delete'">删除</a>
</span>
<a-table
v-if="record.list.length > 0"
rowKey="childrenId"
slot="expandedRowRender"
slot-scope="record"
:columns="committeeMemberColumns"
:data-source="record.list"
:pagination="false"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, columnWidth: 80}"
class="j-table-force-nowrap">
<template slot="textRow" slot-scope="text">
<j-ellipsis :value="text" :length="20"></j-ellipsis>
</template>
<span slot="action" class="action-span-cell" slot-scope="text, itemRecord">
<a @click="handleDeleteMember(itemRecord.childrenId)" v-has="'committee:member:delete'">删除</a>
</span>
<a @click="handleDeleteMember(itemRecord.childrenId)" v-has="'committee:member:delete'">删除</a>
</span>
</a-table>
</a-table>
</div>
@@ -92,27 +96,27 @@
</template>
<script>
import {JeroListMixin} from '@/mixins/JeroListMixin'
import { JeroListMixin } from '@/mixins/JeroListMixin'
import CommitteeModule from '@views/dataNetworkDiskManagement/committee/modules/CommitteeModule'
import CommitteeMemberModule from '@views/dataNetworkDiskManagement/committee/modules/CommitteeMemberModule'
import {getAction} from '@api/manage'
import { getAction } from '@api/manage'
import PageHeaderTitle from '@comp/layouts/PageHeaderTitle'
import IconImg from '@/assets/imgs/icon/icon_committee.png'
export default {
name: 'CommitteeMaintenance',
components: {CommitteeModule, CommitteeMemberModule, PageHeaderTitle},
components: { CommitteeModule, CommitteeMemberModule, PageHeaderTitle },
mixins: [JeroListMixin],
data() {
return {
IconImg,
labelCol: {
xs: {span: 24},
sm: {span: 5}
xs: { span: 24 },
sm: { span: 5 }
},
wrapperCol: {
xs: {span: 24},
sm: {span: 10}
xs: { span: 24 },
sm: { span: 10 }
},
url: {
list: '/payCaseCommitteeSubitem/payCaseCommitteeSubitem/find',
@@ -136,13 +140,13 @@ export default {
title: '分标委名称',
align: 'center',
dataIndex: 'name',
scopedSlots: {customRender: 'text'}
scopedSlots: { customRender: 'text' }
}, {
title: '操作',
dataIndex: 'operation',
align: 'center',
width: 400,
scopedSlots: {customRender: 'operation'}
scopedSlots: { customRender: 'operation' }
}
],
// 成员表头
@@ -160,28 +164,29 @@ export default {
title: '姓名',
align: 'center',
dataIndex: 'peopleName',
scopedSlots: {customRender: 'textRow'}
scopedSlots: { customRender: 'textRow' }
}, {
title: '企业名称',
align: 'center',
dataIndex: 'companyName',
scopedSlots: {customRender: 'textRow'}
scopedSlots: { customRender: 'textRow' }
}, {
title: '职务',
align: 'center',
dataIndex: 'post',
scopedSlots: {customRender: 'textRow'}
scopedSlots: { customRender: 'textRow' }
}, {
title: '手机号',
align: 'center',
dataIndex: 'phone',
scopedSlots: {customRender: 'textRow'}
width: 200,
scopedSlots: { customRender: 'textRow' }
}, {
title: '操作',
dataIndex: 'action',
align: 'center',
width: 199,
scopedSlots: {customRender: 'action'}
scopedSlots: { customRender: 'action' }
}
],
dataSource: []
@@ -220,7 +225,7 @@ export default {
title: '确认删除',
content: '确定要删除此条数据吗?',
onOk: function () {
getAction(that.url.deleteMember, {id: id}).then((res) => {
getAction(that.url.deleteMember, { id: id }).then((res) => {
if (res.success) {
that.$message.success(res.message)
that.loadData()
@@ -234,24 +239,24 @@ export default {
/*
* 资料维护
* */
handleMaintainData(record){
handleMaintainData(record) {
this.$router.push({
path:'/projectManagement/WorkingGroupProjectDataMaintenance',
query:{
id:record.id
path: '/projectManagement/WorkingGroupProjectDataMaintenance',
query: {
id: record.id
}
})
},
/*
* 会议维护
* */
handleMaintainMeeting(record){
handleMaintainMeeting(record) {
this.$router.push({
path:'/projectManagement/CommitteeMeeting',
query:{
id:record.id,
title:record.name,
meetingType:'5'
path: '/projectManagement/CommitteeMeeting',
query: {
id: record.id,
title: record.name,
meetingType: '5'
}
})
}
@@ -39,6 +39,7 @@
:maxLength='50'
ref="selectContacts"
labelInValue
valueType="object"
@change="handleContactChange"
@ok="addContactsOk"></select-contacts>
</a-form-item>