<template>
|
<div class="high-view-scope">
|
<el-dialog title="分配" :visible.sync="editConfig.visible" :width="dialogWidth" :before-close="handleClose">
|
<el-form
|
ref="form"
|
:model="editConfig.infomation"
|
:rules="rules"
|
label-position="right"
|
label-width="130px"
|
size="mini"
|
style="height: 80px; margin-top: 40px; overflow-x: hidden"
|
>
|
<el-form-item label="销售负责人" prop="member_id">
|
<el-select v-model="editConfig.infomation.member_id" placeholder="请选择" size="mini" style="width: 63%">
|
<el-option v-for="item in memberOptions" :key="item.id" :label="item.username" :value="item.id">
|
</el-option>
|
</el-select>
|
</el-form-item>
|
</el-form>
|
<div slot="footer" class="dialog-footer">
|
<el-button type="primary" size="small" @click="sureClick">确认</el-button>
|
<el-button size="small" @click="editConfig.visible = false">取消</el-button>
|
</div>
|
</el-dialog>
|
</div>
|
</template>
|
|
<script>
|
import { getAllData } from "@/api/client/client"
|
import { getAssign } from "@/api/common/other"
|
export default {
|
name: "AllocationDialog",
|
props: {
|
editCommonConfig: {
|
type: Object,
|
default: () => {
|
return {
|
visible: false,
|
infomation: {}
|
}
|
}
|
}
|
},
|
components: {},
|
computed: {},
|
watch: {},
|
data() {
|
return {
|
dialogWidth: "25%",
|
editConfig: this.editCommonConfig,
|
memberOptions: [],
|
rules: {
|
member_id: [{ required: true, message: "请选择销售负责人", trigger: "change" }]
|
}
|
}
|
},
|
created() {
|
this.getCommonData()
|
},
|
methods: {
|
getCommonData() {
|
getAllData().then((res) => {
|
this.memberOptions = res.data.member
|
})
|
},
|
handleClose() {
|
this.editConfig.visible = false
|
},
|
// 确认
|
async sureClick() {
|
await getAssign({
|
ids: [this.editConfig.infomation.id],
|
member_id: this.editConfig.infomation.member_id,
|
type: "client"
|
}).then((res) => {
|
this.editConfig.visible = false
|
if (res.code === 200) {
|
this.$message.success("添加成功")
|
this.$parent.getData()
|
}
|
})
|
}
|
}
|
}
|
</script>
|
|
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
<style lang="scss" scoped>
|
.high-view-scope {
|
// .view-sel-bg {
|
// display: flex;
|
// align-items: center;
|
// margin: 20px 20px 0;
|
// .el-input {
|
// width: 240px;
|
// margin-left: 5px;
|
// }
|
// .el-checkbox {
|
// margin-left: 5px;
|
// margin-right: 0;
|
// }
|
// }
|
.dialog-footer {
|
background-color: #f5f5f5;
|
height: 55px;
|
line-height: 55px;
|
}
|
}
|
</style>
|