Files
income_payments_client/src/views/incomePayments/meetManage/modules/BatchSetDockerModal.vue
T
2021-10-12 17:30:14 +08:00

113 lines
2.9 KiB
Vue

<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
:confirmLoading="confirmLoading"
@ok="handleOk"
@cancel="handleCancel"
cancelText="关闭">
<a-spin :spinning="confirmLoading">
<a-form :form="form">
<a-row :gutter="24">
<a-col :xl="24" :sm="24">
<a-form-item label="会议对接人" :labelCol="labelCol" :wrapperCol="wrapperCol">
<select-principal placeholder="请选择会议对接人"
v-decorator="['dockId',validatorRules.dockId]"></select-principal>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-spin>
<template slot="footer">
<a-button @click="handleCancel">关闭</a-button>
<a-button type="primary" @click="handleOk" v-preventclick>确定</a-button>
</template>
</j-modal>
</template>
<script>
import SelectPrincipal from '@comp/company/SelectPrincipal'
import {httpAction} from '@api/manage'
export default {
name: 'BatchSetDockerModal',
components:{
SelectPrincipal
},
data() {
return {
title: '设置对接人',
width: 400,
visible: false,
confirmLoading: false,
form: this.$form.createForm(this),
labelCol: {
xs: {span: 24},
sm: {span: 6}
},
wrapperCol: {
xs: {span: 24},
sm: {span: 18}
},
validatorRules: {
dockId: {
rules: [{required: true, message: '请选择会议对接人'}],
validateTrigger: ['change']
}
},
// 列表选择的key值
meetingSituationIds:[],
url: {
add: '/meeting/internalMeetingSituation/addDock',
}
}
},
methods: {
open(meetingSituationIds) {
this.form.resetFields()
this.visible = true
this.meetingSituationIds = [...meetingSituationIds]
},
close() {
this.$emit('close')
this.visible = false
},
handleOk() {
const that = this
// 触发表单验证
that.form.validateFields((err, values) => {
if (!err) {
let httpurl = that.url.add
let method = 'post'
const formData = Object.assign({}, values)
formData.meetingSituationIds = this.meetingSituationIds
console.log('表单提交数据', formData)
httpAction(httpurl, formData, method).then((res) => {
if (res.success) {
that.$message.success(res.message)
that.$emit('ok')
that.close()
} else {
that.$message.warning(res.message)
}
}).finally(() => {
that.confirmLoading = false
})
}
})
},
handleCancel() {
this.close()
},
addContactsOk() {
this.$refs.selectContacts.getContactsList()
}
}
}
</script>
<style scoped>
</style>