| | |
| | | <template> |
| | | <GlobalWindow :title="title" width="820px" :visible.sync="visible" :confirm-working="isWorking" @confirm="confirm"> |
| | | <el-form :model="form" ref="form" label-position="top" :rules="rules"> |
| | | <div class="list"> |
| | | <el-form-item label="客户名称" prop="customerId"> |
| | | <el-select v-model="form.customerId" clearable filterable> |
| | | <el-option v-for="item in clientList" :value="item.id" :label="item.name" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="姓名" prop="name"> |
| | | <div class="df"> |
| | | <el-input v-model="form.name" placeholder="请输入" v-trim /> |
| | | </div> |
| | | </el-form-item> |
| | | <el-form-item label="手机号" prop="phone"> |
| | | <el-input v-model="form.phone" placeholder="请输入手机号" v-trim /> |
| | | </el-form-item> |
| | | <el-form-item label="身份"> |
| | | <el-select v-model="form.highCheckor" filterable> |
| | | <el-option :value="0" label="老板/超级管理员" /> |
| | | <el-option :value="1" label="人事/管理员" /> |
| | | <el-option :value="2" label="员工/普通员工" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="证件类型"> |
| | | <el-select v-model="form.idcardType" filterable> |
| | | <el-option :value="0" label="身份证" /> |
| | | <el-option :value="1" label="港澳证件" /> |
| | | <el-option :value="2" label="护照" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="证件号码" prop="member.idcardNo"> |
| | | <el-input v-model="form.idcardNo" placeholder="请输入" v-trim /> |
| | | </el-form-item> |
| | | <el-form-item label="邮箱" prop="email"> |
| | | <el-input v-model="form.email" placeholder="请输入邮箱" v-trim /> |
| | | </el-form-item> |
| | | <el-form-item label="性别"> |
| | | <el-select v-model="form.sex" filterable> |
| | | <el-option :value="1" label="男" /> |
| | | <el-option :value="2" label="女" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="出生日期"> |
| | | <el-date-picker type="date" v-model="form.birthday" value-format="yyyy-MM-dd" placeholder="请选择" /> |
| | | </el-form-item> |
| | | <GlobalWindow :title="title" width="720px" :visible.sync="visible" :confirm-working="isWorking" @confirm="confirm"> |
| | | <el-form |
| | | ref="form" |
| | | :model="form" |
| | | :rules="rules" |
| | | label-width="88px" |
| | | label-position="right" |
| | | class="staff-edit-form" |
| | | > |
| | | <section class="form-section"> |
| | | <div class="form-section__title">归属信息</div> |
| | | <div class="form-grid"> |
| | | <el-form-item label="客户名称" prop="customerId" class="col-full"> |
| | | <el-select |
| | | v-model="form.customerId" |
| | | :disabled="form.id || customerId != ''" |
| | | clearable |
| | | filterable |
| | | placeholder="请选择客户" |
| | | > |
| | | <el-option v-for="item in clientList" :key="item.id" :value="item.id" :label="item.name" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="身份"> |
| | | <el-select v-model="form.highCheckor" filterable placeholder="请选择身份"> |
| | | <el-option :value="0" label="老板/超级管理员" /> |
| | | <el-option :value="1" label="人事/管理员" /> |
| | | <el-option :value="2" label="员工/普通员工" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </div> |
| | | </section> |
| | | |
| | | </div> |
| | | <section class="form-section"> |
| | | <div class="form-section__title">基本信息</div> |
| | | <div class="form-grid"> |
| | | <el-form-item label="姓名" prop="name"> |
| | | <el-input v-model="form.name" placeholder="请输入姓名" v-trim /> |
| | | </el-form-item> |
| | | <el-form-item label="手机号" prop="phone"> |
| | | <el-input v-model="form.phone" placeholder="请输入手机号" v-trim maxlength="11" /> |
| | | </el-form-item> |
| | | <el-form-item label="性别"> |
| | | <el-select v-model="form.sex" filterable clearable placeholder="请选择性别"> |
| | | <el-option :value="1" label="男" /> |
| | | <el-option :value="2" label="女" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="出生日期"> |
| | | <el-date-picker |
| | | v-model="form.birthday" |
| | | type="date" |
| | | value-format="yyyy-MM-dd" |
| | | placeholder="请选择出生日期" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item |
| | | label="邮箱" |
| | | prop="email" |
| | | class="col-full" |
| | | :rules="[{ required: false, type: 'email', message: '请输入正确的邮箱格式' }]" |
| | | > |
| | | <el-input v-model="form.email" placeholder="请输入邮箱" v-trim /> |
| | | </el-form-item> |
| | | </div> |
| | | </section> |
| | | |
| | | <section class="form-section"> |
| | | <div class="form-section__title">证件信息</div> |
| | | <div class="form-grid"> |
| | | <el-form-item label="证件类型"> |
| | | <el-select v-model="form.idcardType" filterable placeholder="请选择证件类型"> |
| | | <el-option :value="0" label="身份证" /> |
| | | <el-option :value="1" label="港澳证件" /> |
| | | <el-option :value="2" label="护照" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="证件号码" :prop="form.id ? '' : 'idcardNo'" class="col-full"> |
| | | <el-input |
| | | v-if="!form.id" |
| | | v-model="form.idcardNo" |
| | | placeholder="请输入证件号码" |
| | | v-trim |
| | | clearable |
| | | /> |
| | | <div v-else class="idcard-field"> |
| | | <div class="idcard-field__current"> |
| | | <i class="el-icon-bank-card" /> |
| | | <span class="idcard-field__label">当前证件号</span> |
| | | <span class="idcard-field__value">{{ form.idcardDecode || '未登记' }}</span> |
| | | </div> |
| | | <el-input |
| | | v-model="form.idcardNoNew" |
| | | placeholder="如需变更,请输入新证件号(留空表示不修改)" |
| | | v-trim |
| | | clearable |
| | | /> |
| | | </div> |
| | | </el-form-item> |
| | | </div> |
| | | </section> |
| | | </el-form> |
| | | </GlobalWindow> |
| | | </template> |
| | |
| | | <script> |
| | | import BaseOpera from '@/components/base/BaseOpera' |
| | | import GlobalWindow from '@/components/common/GlobalWindow' |
| | | import { fetchCateList } from '@/api/business/category' |
| | | import { staffRules } from './config' |
| | | import { detailById } from '@/api/client/ywCustomer' |
| | | import { fetchList } from '@/api/client/ywCustomer' |
| | | |
| | | export default { |
| | | name: 'OperaYwCustomerWindow', |
| | | extends: BaseOpera, |
| | | components: { GlobalWindow }, |
| | | data() { |
| | | return { |
| | | // 表单数据 |
| | | form: { |
| | | id: null, |
| | | customerId: '', |
| | |
| | | sex: '', |
| | | status: '', |
| | | memberName: '', |
| | | |
| | | lastLoginDate: '', |
| | | loginNum: '', |
| | | userId: '', |
| | | |
| | | accountBank: '', |
| | | accountNo: '', |
| | | accountPhone: '', |
| | | creditCard: '', |
| | | fpType: '', |
| | | accountAddr: '', |
| | | // identityType: '0', |
| | | name: "", |
| | | phone: "", |
| | | name: '', |
| | | phone: '', |
| | | highCheckor: 0, |
| | | idcardType: 0, |
| | | idcardNo: '', |
| | | email: '', |
| | | idcardNoNew: '', |
| | | email: '' |
| | | }, |
| | | customerId: '', |
| | | clientList: [], |
| | | // 验证规则 |
| | | rules: staffRules |
| | | } |
| | | }, |
| | |
| | | 'field.id': 'id' |
| | | }) |
| | | }, |
| | | |
| | | methods: { |
| | | initData() { |
| | | fetchList({ |
| | |
| | | open(title, target) { |
| | | this.title = title |
| | | this.visible = true |
| | | this.customerId = '' |
| | | this.initData() |
| | | // 新建 |
| | | if (target == null) { |
| | | this.$nextTick(() => { |
| | | this.$refs.form.resetFields() |
| | | this.form = { |
| | | id: null, |
| | | customerId: '', |
| | | creator: '', |
| | | createDate: '', |
| | | editor: '', |
| | | editDate: '', |
| | | isdeleted: '', |
| | | birthday: '', |
| | | industryId: '', |
| | | type: '1', |
| | | idcardDecode: '', |
| | | sex: '', |
| | | status: '', |
| | | memberName: '', |
| | | lastLoginDate: '', |
| | | loginNum: '', |
| | | userId: '', |
| | | accountBank: '', |
| | | accountNo: '', |
| | | accountPhone: '', |
| | | creditCard: '', |
| | | fpType: '', |
| | | accountAddr: '', |
| | | name: '', |
| | | phone: '', |
| | | highCheckor: 0, |
| | | idcardType: 0, |
| | | idcardNo: '', |
| | | idcardNoNew: '', |
| | | email: '' |
| | | } |
| | | }) |
| | | return |
| | | } |
| | | // 编辑 |
| | | this.$nextTick(() => { |
| | | for (const key in this.form) { |
| | | this.form[key] = target[key] |
| | | } |
| | | this.form.idcardNo = '' |
| | | this.form.idcardNoNew = '' |
| | | }) |
| | | }, |
| | | changeValid(e) { |
| | | this.$set(this.form, 'validity', e ? '2099-12-31' : '') |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | <style lang='scss' scoped> |
| | | @import '@/assets/style/variables.scss'; |
| | | |
| | | div { |
| | | box-sizing: border-box; |
| | | } |
| | | |
| | | .title { |
| | | width: 100%; |
| | | font-weight: 500; |
| | | font-size: 15px; |
| | | margin-top: 16px; |
| | | } |
| | | |
| | | .list { |
| | | /* padding-top: 14px; */ |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | |
| | | .el-form-item { |
| | | width: 33.33%; |
| | | margin-bottom: 12px; |
| | | padding: 0 12px; |
| | | |
| | | .la { |
| | | color: #7f7f7f; |
| | | margin-top: 2px; |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | @import '@/assets/style/variables.scss'; |
| | | |
| | | .staff-edit-form { |
| | | padding-top: 4px; |
| | | |
| | | ::v-deep .el-form-item { |
| | | margin-bottom: 14px; |
| | | } |
| | | |
| | | ::v-deep .el-form-item__label { |
| | | color: #606266; |
| | | font-size: 13px; |
| | | line-height: 32px; |
| | | padding-right: 12px; |
| | | } |
| | | |
| | | ::v-deep .el-input, |
| | | ::v-deep .el-select, |
| | | ::v-deep .el-date-editor { |
| | | width: 100%; |
| | | } |
| | | } |
| | | |
| | | .form-section { |
| | | margin-bottom: 14px; |
| | | padding: 16px 16px 2px; |
| | | background: #fff; |
| | | border: 1px solid #ebeef5; |
| | | border-radius: 6px; |
| | | |
| | | &:last-child { |
| | | margin-bottom: 0; |
| | | } |
| | | |
| | | &__title { |
| | | margin-bottom: 14px; |
| | | padding-bottom: 10px; |
| | | border-bottom: 1px solid #f0f2f5; |
| | | font-size: 14px; |
| | | font-weight: 600; |
| | | color: #303133; |
| | | line-height: 22px; |
| | | |
| | | &::before { |
| | | content: ''; |
| | | display: inline-block; |
| | | width: 3px; |
| | | height: 14px; |
| | | margin-right: 8px; |
| | | background: $primary-color; |
| | | border-radius: 2px; |
| | | vertical-align: -2px; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .form-grid { |
| | | display: grid; |
| | | grid-template-columns: repeat(2, minmax(0, 1fr)); |
| | | column-gap: 20px; |
| | | |
| | | .col-full { |
| | | grid-column: 1 / -1; |
| | | } |
| | | } |
| | | |
| | | .idcard-field { |
| | | display: flex; |
| | | flex-direction: column; |
| | | gap: 8px; |
| | | |
| | | &__current { |
| | | display: flex; |
| | | align-items: center; |
| | | min-height: 32px; |
| | | padding: 0 12px; |
| | | background: linear-gradient(90deg, #f8fafc 0%, #f5f7fa 100%); |
| | | border: 1px solid #e4e7ed; |
| | | border-radius: 4px; |
| | | font-size: 13px; |
| | | color: #606266; |
| | | } |
| | | |
| | | .el-icon-bank-card { |
| | | margin-right: 6px; |
| | | font-size: 15px; |
| | | color: $primary-color; |
| | | } |
| | | |
| | | &__label { |
| | | flex-shrink: 0; |
| | | margin-right: 8px; |
| | | color: #909399; |
| | | font-size: 12px; |
| | | } |
| | | |
| | | &__value { |
| | | flex: 1; |
| | | min-width: 0; |
| | | color: #303133; |
| | | font-weight: 500; |
| | | letter-spacing: 0.4px; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | white-space: nowrap; |
| | | } |
| | | } |
| | | </style> |