bug修改

This commit is contained in:
zhaoxiao
2021-10-12 17:30:59 +08:00
parent 9f0e6ebc88
commit e5b6fa8ec1
23 changed files with 221 additions and 129 deletions
@@ -9,7 +9,7 @@
@cancel="handleCancel"
cancelText="关闭">
<a-spin :spinning="confirmLoading">
<a-form :form="form" v-if="memberList.length > 0">
<a-form :form="form" v-if="memberList[0].children.length > 0">
<a-row>
<a-col :span="2"></a-col>
<a-col :span="20">
@@ -66,7 +66,7 @@ export default {
default: false
}
},
watch:{
watch: {
visible(val) {
if (val) {
this.initData()
@@ -87,7 +87,10 @@ export default {
xs: { span: 24 },
sm: { span: 17 }
},
memberList: [], // 成员树
memberList: [{
name: '全选',
children: []
}], // 成员树
checkedKeys: [], // 已选中的成员数组
replaceFields: {
children: 'children',
@@ -97,7 +100,7 @@ export default {
},
validatorRules: {
memberName: {
rules: [{ required: true, message: '请选择成员单位'}],
rules: [{ required: true, message: '请选择成员单位' }],
validateTrigger: 'change'
}
},
@@ -120,7 +123,7 @@ export default {
}
distributeMemberList(param).then(res => {
if (res.success) {
this.memberList = res.result
this.memberList[0].children = res.result
} else {
this.$message.warn(res.message)
}
@@ -141,14 +144,17 @@ export default {
close() {
this.$emit('update:visible', false)
this.$emit('close')
this.memberList = []
this.memberList = [{
name: '全选',
children: []
}]
},
handleOk() {
if (this.confirmLoading) {
return
}
this.confirmLoading = true
if (this.memberList.length === 0) {
if (this.memberList[0].children.length === 0) {
this.$message.warn('当前工作组暂无成员,无法分发文件')
this.confirmLoading = false
return
@@ -158,16 +164,15 @@ export default {
this.confirmLoading = false
return
}
let str = this.checkedKeys.join(',').toString()
console.log(str)
this.form.setFieldsValue({memberName: str})
let str = this.checkedKeys.slice(1).join(',').toString()
this.form.setFieldsValue({ memberName: str })
this.form.validateFields((err) => {
if (!err) {
this.confirmLoading = true
if (this.isBatch) {
// 批量分发
const formData = {
contactsIds: this.checkedKeys.join(','),
contactsIds: str,
dataIds: this.recordId,
projectId: this.projectId,
projectType: this.projectType