| | |
| | | <template> |
| | | <div class="add-quotation"> |
| | | <el-dialog |
| | | :title="'用户详情'" |
| | | :visible.sync="editConfig.visible" |
| | | :title="editConfig.title + '用户'" |
| | | :visible.sync="isvisible" |
| | | :width="dialogWidth" |
| | | :before-close="handleClose" |
| | | append-to-body |
| | |
| | | > |
| | | <div class="drawerContent" style="overflow: auto"> |
| | | <el-form ref="form" :rules="rules" :model="editConfig.form" label-position="right" label-width="100px"> |
| | | <el-form-item label="用户名:" prop="username"> |
| | | <el-input v-model="editConfig.form.username" placeholder="--" disabled></el-input> |
| | | <el-form-item label="用户名:" prop="userName"> |
| | | <el-input |
| | | v-model="editConfig.form.userName" |
| | | :placeholder="editConfig.title == '添加' ? '请输入用户名' : '--'" |
| | | :disabled="editConfig.title == '添加' ? false : true" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="密码:" prop="password"> |
| | | <el-input v-model="editConfig.form.password" placeholder="--" disabled></el-input> |
| | | <el-form-item v-if="editConfig.title == '添加'" label="密码:" prop="passWord"> |
| | | <el-input v-model="editConfig.form.passWord" :placeholder="'请输入密码'"></el-input> |
| | | </el-form-item> |
| | | <el-form-item v-else label="密码:" prop="password"> |
| | | <el-input v-model="editConfig.form.passsord" :placeholder="'******'" disabled></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="手机号:" prop="phone"> |
| | | <el-input v-model="editConfig.form.phone" placeholder="--" disabled></el-input> |
| | | <el-input |
| | | v-model="editConfig.form.phone" |
| | | :placeholder="editConfig.title == '添加' ? '请输入手机号' : '--'" |
| | | :disabled="editConfig.title == '添加' ? false : true" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="公司名称:" prop="companyName"> |
| | | <el-input v-model="editConfig.form.company" placeholder="--" disabled></el-input> |
| | | <el-input |
| | | v-model="editConfig.form.company" |
| | | :placeholder="editConfig.title == '添加' ? '请输入公司名称' : '--'" |
| | | :disabled="editConfig.title == '添加' ? false : true" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="联系人名称:" prop="nickName"> |
| | | <el-input v-model="editConfig.form.contact" placeholder="--" disabled></el-input> |
| | | <el-form-item label="联系人名称:" prop="companyContact"> |
| | | <el-input |
| | | v-model="editConfig.form.companyContact" |
| | | :placeholder="editConfig.title == '添加' ? '请输入联系人名称' : '--'" |
| | | :disabled="editConfig.title == '添加' ? false : true" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="邮箱:" prop="companyEmail"> |
| | | <el-input v-model="editConfig.form.email" placeholder="--" disabled></el-input> |
| | | <el-input |
| | | v-model="editConfig.form.email" |
| | | :placeholder="editConfig.title == '添加' ? '请输入邮箱' : '--'" |
| | | :disabled="editConfig.title == '添加' ? false : true" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="行业:" prop="industry"> |
| | | <el-input v-model="editConfig.form.industry" placeholder="--" disabled></el-input> |
| | | <el-form-item label="行业:" prop="companyTrade"> |
| | | <el-input |
| | | v-model="editConfig.form.companyTrade" |
| | | :placeholder="editConfig.title == '添加' ? '请输入行业' : '--'" |
| | | :disabled="editConfig.title == '添加' ? false : true" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="地区:" prop="region"> |
| | | <el-input v-model="editConfig.form.region" placeholder="--" disabled></el-input> |
| | | <el-form-item label="地区:" prop="companyProvince"> |
| | | <el-input |
| | | v-model="editConfig.form.companyProvince" |
| | | :placeholder="editConfig.title == '添加' ? '请输入地区' : '--'" |
| | | :disabled="editConfig.title == '添加' ? false : true" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="用户等级:" prop="roleIDs"> |
| | | <el-checkbox-group v-model="editConfig.form.roleIDs" :disabled="editConfig.title == '查看' ? true : false"> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { getRoleIDs, setUser } from "@/api/unifiedManage/userManage" |
| | | import { getRoleIDs, setUser, register } from "@/api/unifiedManage/userManage" |
| | | export default { |
| | | name: "EditUserInfo", |
| | | props: { |
| | |
| | | data() { |
| | | return { |
| | | dialogWidth: "30%", |
| | | isvisible: false, |
| | | editConfig: this.editCommonConfig, |
| | | // form: {}, |
| | | rules: { |
| | | username: [{ required: true, message: "请输入用户名", trigger: "blur" }], |
| | | // password: [{ required: true, message: "请输入密码", trigger: "blur" }], |
| | | userName: [{ required: true, message: "请输入用户名", trigger: "blur" }], |
| | | passWord: [{ required: true, message: "请输入密码", trigger: "blur" }], |
| | | phone: [{ required: true, message: "请输入手机号", trigger: "blur" }], |
| | | // companyName: [{ required: true, message: "请输入公司名称", trigger: "blur" }], |
| | | nickName: [{ required: true, message: "请输入联系人名称", trigger: "blur" }], |
| | | companyContact: [{ required: true, message: "请输入联系人名称", trigger: "blur" }], |
| | | roleIDs: [{ required: true, message: "请选择用户等级", trigger: "change" }] |
| | | }, |
| | | roleList: [] // 用户等级 |
| | | } |
| | | }, |
| | | watch: { |
| | | "editCommonConfig.visible"(val) { |
| | | console.log("sssssssssss") |
| | | isvisible(val) { |
| | | console.log("ssss") |
| | | if (val) { |
| | | // this.formInfo() |
| | | console.log(val) |
| | | } |
| | | }, |
| | | "editCommonConfig.form.username"(val) { |
| | | console.log(val) |
| | | if (this.editConfig.visible) { |
| | | this.$refs.form.resetFields() |
| | | if (val.id) { |
| | | // this.getDataInfo(val) |
| | | } |
| | | // this.$refs.form.resetFields() |
| | | } |
| | | } |
| | | }, |
| | |
| | | }, |
| | | methods: { |
| | | handleClose() { |
| | | this.editConfig.visible = false |
| | | this.isvisible = false |
| | | }, |
| | | // 获取等级信息 |
| | | async getDataInfo() { |
| | |
| | | this.$refs[formName].validate((valid) => { |
| | | console.log(valid) |
| | | if (valid) { |
| | | let requestUrl = this.editConfig.title == "添加" ? register : setUser |
| | | let param = this.saveParams() |
| | | setUser(param).then((reply) => { |
| | | requestUrl(param).then((reply) => { |
| | | if (reply && reply.code === 200) { |
| | | this.$message.success("保存成功") |
| | | this.handleClose() |
| | |
| | | }, |
| | | saveParams() { |
| | | let params = { |
| | | userName: this.editConfig.form.userName || "", |
| | | passWord: this.editConfig.form.passWord || "", |
| | | dutyIDs: this.editConfig.form.dutyIDs, |
| | | id: this.editConfig.form.id, |
| | | nickName: this.editConfig.form.nickName, |
| | | phone: this.editConfig.form.phone, |
| | | roleIDs: this.editConfig.form.roleIDs |
| | | nickName: this.editConfig.form.nickName || "", |
| | | phone: this.editConfig.form.phone || "", |
| | | roleIDs: this.editConfig.form.roleIDs, |
| | | companyCity: this.editConfig.form.companyCity || "", |
| | | companyContact: this.editConfig.form.companyContact || "", |
| | | companyEmail: this.editConfig.form.companyEmail || "", |
| | | companyName: this.editConfig.form.companyName || "", |
| | | companyProvince: this.editConfig.form.companyProvince || "", |
| | | companyTrade: this.editConfig.form.companyTrade || "" |
| | | } |
| | | return params |
| | | } |