账号管理
This commit is contained in:
parent
6712991029
commit
714f8e612d
@ -31,9 +31,9 @@ class CompanyController extends Controller
|
|||||||
$conditions = [];
|
$conditions = [];
|
||||||
$conditions['limit'] = $this->request->get('limit', 20);
|
$conditions['limit'] = $this->request->get('limit', 20);
|
||||||
|
|
||||||
$accounts = $this->companyService->index($conditions);
|
$companies = $this->companyService->index($conditions);
|
||||||
|
|
||||||
return res($accounts, '企业列表', 201);
|
return res($companies, '企业列表', 201);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -70,9 +70,9 @@ class CompanyAccountService extends Service implements JwtServiceContract
|
|||||||
$attributes = array_only($attributes, array_merge(app(CompanyAccount::class)->getFillable()));
|
$attributes = array_only($attributes, array_merge(app(CompanyAccount::class)->getFillable()));
|
||||||
|
|
||||||
$rule = [
|
$rule = [
|
||||||
'username' => ['username', 'between:2,12', Rule::unique($this->companyAccountRepository->getTable(), 'username')->ignore($attributes['id']), Rule::notIn(config('domain.account.reserved_account'))],
|
'username' => ['username', 'between:2,12', Rule::unique($this->companyAccountRepository->getTable(), 'username')->ignore($attributes['id'])->whereNUll('deleted_at'), Rule::notIn(config('domain.account.reserved_account'))],
|
||||||
'nickname' => ['string', 'between:2,32'],
|
'nickname' => ['string', 'between:2,32'],
|
||||||
'mobile' => ['string', 'cn_phone', Rule::unique($this->companyAccountRepository->getTable(), 'mobile')->ignore($attributes['id'])],
|
'mobile' => ['string', 'cn_phone', Rule::unique($this->companyAccountRepository->getTable(), 'mobile')->ignore($attributes['id'])->whereNUll('deleted_at')],
|
||||||
'password' => ['string'],
|
'password' => ['string'],
|
||||||
'avatar' => ['image'],
|
'avatar' => ['image'],
|
||||||
];
|
];
|
||||||
|
@ -172,7 +172,7 @@ class CreateBaseTables extends Migration
|
|||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
$table->softDeletes();
|
$table->softDeletes();
|
||||||
|
|
||||||
$table->unique('mobile');
|
$table->unique(['mobile', 'deleted_at']);
|
||||||
});
|
});
|
||||||
|
|
||||||
Schema::create("virtual_company_addresses", function (Blueprint $table) {
|
Schema::create("virtual_company_addresses", function (Blueprint $table) {
|
||||||
|
@ -16,6 +16,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
my_show: false,
|
my_show: false,
|
||||||
|
isUpdate: false,
|
||||||
loading: false,
|
loading: false,
|
||||||
params: {
|
params: {
|
||||||
name: '',
|
name: '',
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<Modal :closable="false" :mask-closable="false" :title=" isUpdate ? '编辑账号' : '添加账号'" @on-visible-change="visibleChange" v-model="my_show">
|
<Modal :closable="false" :mask-closable="false" :title="isUpdate ? '编辑账号' : '添加账号'" @on-visible-change="visibleChange" v-model="my_show">
|
||||||
<div class="page-edit-wrap uinn-lr20">
|
<div class="page-edit-wrap uinn-lr20">
|
||||||
<ui-loading :show="page_loading.show"></ui-loading>
|
<ui-loading :show="page_loading.show"></ui-loading>
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@
|
|||||||
></Page>
|
></Page>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ui-edit :data="editObj.data" :show.sync="editObj.show" @add-success="index" @update-success="index(list_data.current_page)"></ui-edit>
|
<ui-edit :data="editObj.data" :show.sync="editObj.show" :isUpdate.sync="editObj.isUpdate" @add-success="index" @update-success="index(list_data.current_page)"></ui-edit>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -3,17 +3,17 @@ import { isPhone, isPsw, isUserName } from 'validate';
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
isUpdate: {
|
show: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
},
|
},
|
||||||
show: {
|
isUpdate: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default() {
|
default () {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -21,6 +21,7 @@ export default {
|
|||||||
watch: {
|
watch: {
|
||||||
show(bool) {
|
show(bool) {
|
||||||
this.my_show = bool;
|
this.my_show = bool;
|
||||||
|
console.log(this.isUpdate);
|
||||||
if (bool) {
|
if (bool) {
|
||||||
if (this.data) {
|
if (this.data) {
|
||||||
for (let k in this.data) {
|
for (let k in this.data) {
|
||||||
|
@ -182,9 +182,11 @@ export default {
|
|||||||
* @return {[type]} [description]
|
* @return {[type]} [description]
|
||||||
*/
|
*/
|
||||||
openEdit(bool, row = null) {
|
openEdit(bool, row = null) {
|
||||||
let data = {};
|
|
||||||
let isUpdate = false;
|
let isUpdate = false;
|
||||||
data.company_id = row.id;
|
let data = {
|
||||||
|
id: 0,
|
||||||
|
company_id: row.id
|
||||||
|
};
|
||||||
|
|
||||||
if (row && row.accounts && row.accounts.length) {
|
if (row && row.accounts && row.accounts.length) {
|
||||||
data = Object.assign(data, row.accounts[0]);
|
data = Object.assign(data, row.accounts[0]);
|
||||||
@ -193,9 +195,11 @@ export default {
|
|||||||
|
|
||||||
this.editObj = {
|
this.editObj = {
|
||||||
show: bool,
|
show: bool,
|
||||||
data,
|
isUpdate,
|
||||||
isUpdate
|
data
|
||||||
};
|
};
|
||||||
|
|
||||||
|
console.log(this.editObj);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user