102 lines
2.8 KiB
Vue
102 lines
2.8 KiB
Vue
<template>
|
|
<el-dialog :title="title" :visible.sync="Visible" width="750px" center class="ac-dialog" :close-on-click-modal="false" @close="close">
|
|
<el-form :inline="true" :model="form" :rules="rules" ref="ruleForm" class="demo-form-inline" label-width="100px" label-position="right">
|
|
<el-row :gutter="24">
|
|
<el-col :span='24'>
|
|
<el-form-item label="联系方式">
|
|
<el-input v-model="form.contact" placeholder="请输入联系方式" style='width:300px'/>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
</el-form>
|
|
<div slot="footer" class="dialog-footer">
|
|
<el-button @click="Visible = false"> 取 消</el-button>
|
|
<el-button type="primary" @click="submit('ruleForm')"> 确 定</el-button>
|
|
</div>
|
|
</el-dialog>
|
|
</template>
|
|
<script>
|
|
import {
|
|
datingBossUpdateMany
|
|
} from '@/api/datingManagement/datingBoss'
|
|
export default {
|
|
name: 'AddOrEdit',
|
|
props: ['data'],
|
|
components: {
|
|
},
|
|
data() {
|
|
return {
|
|
Visible: true,
|
|
title: '批量设置联系方式',
|
|
// 表单数据
|
|
form: {
|
|
userId: undefined, // 用户ID
|
|
accountId: undefined, // 账号ID 0,
|
|
address: undefined, // 地址 "string",
|
|
auth: undefined, // 是否认证 true,
|
|
avatar: undefined, // 头像 "string",
|
|
background: undefined, // 背景 "string",
|
|
collects: undefined, // 收藏次数 0,
|
|
contact: undefined, // 联系方式 "string",
|
|
girls: undefined, // 妹子数量 0,
|
|
id: 0,
|
|
level: undefined, // 茶老板等级 0:普通 1:铜牌 2:银牌 3:金牌 0,
|
|
name: undefined, // 名称 "string",
|
|
recommend: undefined, // 是否推荐 1:推荐 0,
|
|
remarks: undefined, // 备注 "string",
|
|
sells: undefined, // 购买次数 0,
|
|
status: undefined, // 是否启用 true,
|
|
watches: undefined // 观看次数 0,
|
|
},
|
|
rules: {
|
|
accountId: [{ required: true, message: '必填', trigger: 'blur' }]
|
|
}
|
|
}
|
|
},
|
|
|
|
mounted() {
|
|
console.log(this.data)
|
|
},
|
|
methods: {
|
|
|
|
// TODO:编辑经纪人列表数据
|
|
update(data) {
|
|
datingBossUpdateMany(data).then((res) => {
|
|
if (res.code === 200) {
|
|
this.$message.success('更新成功')
|
|
this.close()
|
|
} else {
|
|
this.$message.error('更新失败')
|
|
}
|
|
})
|
|
},
|
|
// 提交按钮
|
|
submit(formName) {
|
|
this.$refs[formName].validate((valid) => {
|
|
if (valid) {
|
|
const arr = []
|
|
this.data.forEach(item => {
|
|
arr.push(item.id)
|
|
})
|
|
const data = {
|
|
ids: arr,
|
|
param: {
|
|
contact: this.form.contact
|
|
}
|
|
}
|
|
this.update(data)
|
|
} else {
|
|
return false
|
|
}
|
|
})
|
|
},
|
|
|
|
// 关闭编辑
|
|
close() {
|
|
this.$emit('close')
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|