|
@@ -18,39 +18,30 @@
|
|
|
:label-col="formItemLayout.labelCol"
|
|
|
:wrapper-col="formItemLayout.wrapperCol"
|
|
|
>
|
|
|
- <a-form-model-item label="经销商名称" prop="productBrandName">
|
|
|
- <a-select
|
|
|
- id="dealerAccountEdit-supplierSn"
|
|
|
- placeholder="请选择经销商"
|
|
|
- allowClear
|
|
|
- v-model="form.supplierSn"
|
|
|
- :showSearch="true"
|
|
|
- option-filter-prop="children"
|
|
|
- :filter-option="filterOption">
|
|
|
- <a-select-option v-for="item in productBrandList" :key="item.supplierSn" :value="item.supplierSn">{{ item.supplierName }}</a-select-option>
|
|
|
- </a-select>
|
|
|
+ <a-form-model-item label="经销商名称" prop="tenantSn">
|
|
|
+ <custList ref="custList" id="dealerAccountEdit-tenantSn" @change="custChange"></custList>
|
|
|
</a-form-model-item>
|
|
|
- <a-form-model-item label="管理员姓名" prop="productBrandName">
|
|
|
+ <a-form-model-item label="管理员姓名" prop="name">
|
|
|
<a-input
|
|
|
- id="dealerAccountEdit-productBrandName"
|
|
|
+ id="dealerAccountEdit-name"
|
|
|
:maxLength="30"
|
|
|
- v-model.trim="form.productBrandName"
|
|
|
+ v-model.trim="form.name"
|
|
|
placeholder="请输入管理员姓名(最多30个字符)"
|
|
|
allowClear />
|
|
|
</a-form-model-item>
|
|
|
- <a-form-model-item label="管理员手机" prop="contactTel">
|
|
|
+ <a-form-model-item label="管理员手机" prop="phone">
|
|
|
<a-input
|
|
|
- id="dealerAccountEdit-contactTel"
|
|
|
+ id="dealerAccountEdit-phone"
|
|
|
:maxLength="11"
|
|
|
- v-model.trim="form.contactTel"
|
|
|
+ v-model.trim="form.phone"
|
|
|
placeholder="请输入管理员手机(最多11个字符)"
|
|
|
allowClear />
|
|
|
</a-form-model-item>
|
|
|
- <a-form-model-item label="管理员账号" prop="account">
|
|
|
+ <a-form-model-item label="管理员账号" prop="loginName">
|
|
|
<a-input
|
|
|
- id="dealerAccountEdit-account"
|
|
|
+ id="dealerAccountEdit-loginName"
|
|
|
:maxLength="50"
|
|
|
- v-model.trim="form.account"
|
|
|
+ v-model.trim="form.loginName"
|
|
|
placeholder="请输入管理员账号,字母/数字(最多50个字符)"
|
|
|
allowClear />
|
|
|
</a-form-model-item>
|
|
@@ -63,10 +54,10 @@
|
|
|
placeholder="请输入管理员密码,字母/数字(最多50个字符)"
|
|
|
allowClear />
|
|
|
</a-form-model-item>
|
|
|
- <a-form-model-item label="最大可开通用户数" prop="password" extra="(不含管理员账号)">
|
|
|
+ <a-form-model-item label="最大可开通用户数" prop="org.childUserMaxNum" extra="(不含管理员账号)">
|
|
|
<a-input-number
|
|
|
- id="dealerAccountEdit-password"
|
|
|
- v-model="form.password"
|
|
|
+ id="dealerAccountEdit-childUserMaxNum"
|
|
|
+ v-model="form.org.childUserMaxNum"
|
|
|
:precision="0"
|
|
|
:min="1"
|
|
|
:max="999999"
|
|
@@ -83,9 +74,11 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-// import { dealerProductBrandSave } from '@/api/dealerProductBrand'
|
|
|
+import custList from '@/views/common/custList.vue'
|
|
|
+import { dealerUserSave } from '@/api/dealer'
|
|
|
export default {
|
|
|
name: 'DealerAccountEditModal',
|
|
|
+ components: { custList },
|
|
|
props: {
|
|
|
openModal: { // 弹框显示状态
|
|
|
type: Boolean,
|
|
@@ -108,22 +101,30 @@ export default {
|
|
|
wrapperCol: { span: 18 }
|
|
|
},
|
|
|
form: {
|
|
|
- productBrandName: '', // 产品品牌名称
|
|
|
- contactTel: '',
|
|
|
- desc: ''
|
|
|
+ tenantSn: '',
|
|
|
+ name: '',
|
|
|
+ phone: '',
|
|
|
+ loginName: '',
|
|
|
+ password: '',
|
|
|
+ org: {
|
|
|
+ childUserMaxNum: ''
|
|
|
+ }
|
|
|
},
|
|
|
rules: {
|
|
|
- productBrandName: [
|
|
|
- { required: true, message: '请输入产品品牌名称', trigger: 'blur' }
|
|
|
- ],
|
|
|
- contactTel: [{ required: true, message: '请输入联系电话', trigger: 'blur' }, { pattern: /^\d{11}$/, message: '请输入正确的手机号' }],
|
|
|
- account: [{ required: true, message: '请输入管理员账号', trigger: 'blur' }, { pattern: /^[0-9a-zA-Z]+$/, message: '管理员账号由字母和数字组成' }],
|
|
|
- password: [{ required: true, message: '请输入管理员密码', trigger: 'blur' }, { pattern: /^[0-9a-zA-Z]+$/, message: '管理员密码由字母和数字组成' }]
|
|
|
+ tenantSn: [{ required: true, message: '请选择经销商', trigger: 'change' }],
|
|
|
+ name: [{ required: true, message: '请输入管理员姓名', trigger: 'blur' }],
|
|
|
+ phone: [{ required: true, message: '请输入管理员手机', trigger: 'blur' }, { pattern: /^\d{11}$/, message: '请输入正确的手机号' }],
|
|
|
+ loginName: [{ required: true, message: '请输入管理员账号', trigger: 'blur' }, { pattern: /^[0-9a-zA-Z]+$/, message: '管理员账号由字母和数字组成' }],
|
|
|
+ password: [{ required: true, message: '请输入管理员密码', trigger: 'blur' }, { pattern: /^[0-9a-zA-Z]+$/, message: '管理员密码由字母和数字组成' }],
|
|
|
+ 'org.childUserMaxNum': [{ required: true, message: '请输入最大可开通用户数', trigger: 'blur' }]
|
|
|
},
|
|
|
productBrandList: []
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ custChange (val) {
|
|
|
+ this.form.tenantSn = val.key
|
|
|
+ },
|
|
|
// 保存
|
|
|
handleSave () {
|
|
|
const _this = this
|
|
@@ -131,7 +132,10 @@ export default {
|
|
|
if (valid) {
|
|
|
const formData = JSON.parse(JSON.stringify(_this.form))
|
|
|
formData.id = _this.itemId ? _this.itemId : undefined
|
|
|
- dealerProductBrandSave(formData).then(res => {
|
|
|
+ if (!_this.itemId) {
|
|
|
+ formData.loginFlag = 1
|
|
|
+ }
|
|
|
+ dealerUserSave(formData).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
_this.$message.success(res.message)
|
|
|
_this.$emit('ok')
|
|
@@ -142,11 +146,6 @@ export default {
|
|
|
return false
|
|
|
}
|
|
|
})
|
|
|
- },
|
|
|
- filterOption (input, option) {
|
|
|
- return (
|
|
|
- option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
|
- )
|
|
|
}
|
|
|
},
|
|
|
watch: {
|