工作组变更;统计样式;单个开票
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
@cancel="handleCancel"
|
||||
cancelText="关闭">
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form>
|
||||
<a-form :form="form">
|
||||
<a-row>
|
||||
<a-col :span="2"></a-col>
|
||||
<a-col :span="20">
|
||||
@@ -20,11 +20,16 @@
|
||||
:replaceFields="replaceFields"
|
||||
checkable
|
||||
@check="onCheck"/>
|
||||
<a-input style="display: none" v-decorator="['memberName',validatorRules.memberName]"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
<template slot="footer">
|
||||
<a-button @click="handleCancel">关闭</a-button>
|
||||
<a-button @click="handleOk" type="primary" v-preventclick>确定</a-button>
|
||||
</template>
|
||||
</j-modal>
|
||||
</template>
|
||||
|
||||
@@ -69,6 +74,7 @@ export default {
|
||||
title: '分发',
|
||||
width: 500,
|
||||
confirmLoading: false,
|
||||
form: this.$form.createForm(this),
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 5 }
|
||||
@@ -86,13 +92,9 @@ export default {
|
||||
key: 'id'
|
||||
},
|
||||
validatorRules: {
|
||||
dataId: {
|
||||
rules: [{ required: true, message: '请重新上传文件' }],
|
||||
validateTrigger: 'change'
|
||||
},
|
||||
memberName: {
|
||||
rules: [{ required: true, message: '请选择成员' }],
|
||||
validateTrigger: 'blur, change'
|
||||
rules: [{ required: true, message: '请选择成员单位'}],
|
||||
validateTrigger: 'change'
|
||||
}
|
||||
},
|
||||
url: {
|
||||
@@ -138,46 +140,67 @@ export default {
|
||||
this.memberList = []
|
||||
},
|
||||
handleOk() {
|
||||
if (this.isBatch) {
|
||||
// 批量分发
|
||||
const formData = {
|
||||
contactsIds: this.checkedKeys.join(','),
|
||||
dataIds: this.recordId,
|
||||
projectId: this.projectId,
|
||||
projectType: this.projectType
|
||||
}
|
||||
batchDistribute(formData).then(res => {
|
||||
console.log(res)
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
this.close()
|
||||
this.$emit('ok')
|
||||
} else {
|
||||
this.$message.warn(res.message)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
// 单个分发
|
||||
const formData = {
|
||||
contactsId: this.checkedKeys.join(','),
|
||||
dataId: this.recordId,
|
||||
projectId: this.projectId,
|
||||
projectType: this.projectType
|
||||
}
|
||||
distribute(formData).then(res => {
|
||||
console.log(res)
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
this.close()
|
||||
this.$emit('ok')
|
||||
} else {
|
||||
this.$message.warn(res.message)
|
||||
}
|
||||
})
|
||||
if (this.checkedKeys.length === 0) {
|
||||
this.form.validateFields()
|
||||
return
|
||||
}
|
||||
let str = this.checkedKeys.join(',').toString()
|
||||
console.log(str)
|
||||
this.form.setFieldsValue({memberName: str})
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
this.confirmLoading = true
|
||||
if (this.isBatch) {
|
||||
// 批量分发
|
||||
const formData = {
|
||||
contactsIds: this.checkedKeys.join(','),
|
||||
dataIds: this.recordId,
|
||||
projectId: this.projectId,
|
||||
projectType: this.projectType
|
||||
}
|
||||
batchDistribute(formData).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
this.close()
|
||||
this.$emit('ok')
|
||||
} else {
|
||||
this.$message.warn(res.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
this.confirmLoading = false
|
||||
})
|
||||
} else {
|
||||
// 单个分发
|
||||
const formData = {
|
||||
contactsIds: this.checkedKeys.join(','),
|
||||
dataId: this.recordId,
|
||||
projectId: this.projectId,
|
||||
projectType: this.projectType
|
||||
}
|
||||
distribute(formData).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
this.close()
|
||||
this.$emit('ok')
|
||||
} else {
|
||||
this.$message.warn(res.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
this.confirmLoading = false
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
handleCancel() {
|
||||
this.close()
|
||||
},
|
||||
checkMember(rules, value, callback) {
|
||||
if (this.checkedKeys.length === 0) {
|
||||
callback('请选选择成员')
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user