|
@ -1,15 +1,29 @@ |
|
|
<template> |
|
|
<template> |
|
|
<div class="app-container"> |
|
|
<div class="app-container"> |
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
|
|
<el-form-item :label="$t('business.userAccount.accountName')" prop="accountName"> |
|
|
<el-form-item :label="$t('business.userAccount.accountCode')" prop="accountCode"> |
|
|
<el-input v-model="queryParams.accountName" :placeholder="$t('business.userAccount.accountNamePlaceholder')" |
|
|
<el-input v-model="queryParams.accountCode" :placeholder="$t('business.userAccount.inputAccountCode')" |
|
|
clearable @keyup.enter.native="handleQuery"/> |
|
|
clearable @keyup.enter.native="handleQuery"/> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item :label="$t('common.tableMsg.createTime')"> |
|
|
<el-form-item label="账户类型" prop="accountType"> |
|
|
<el-date-picker v-model="daterangeCreateTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" |
|
|
<el-select v-model="queryParams.accountType" size="medium" placeholder="请选择账户类型"> |
|
|
type="daterange" range-separator="-" :start-placeholder="$t('common.tableMsg.startDate')" |
|
|
<el-option |
|
|
:end-placeholder="$t('common.tableMsg.endDate')" |
|
|
v-for="item in options_accountType" |
|
|
:default-time="['00:00:00', '23:59:59']"></el-date-picker> |
|
|
:key="item.value" |
|
|
|
|
|
:label="item.label" |
|
|
|
|
|
:value="item.value"> |
|
|
|
|
|
</el-option> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="账户状态" prop="status"> |
|
|
|
|
|
<el-select v-model="queryParams.status" size="medium" placeholder="请选择账户状态"> |
|
|
|
|
|
<el-option |
|
|
|
|
|
v-for="item in options_accountStatus" |
|
|
|
|
|
:key="item.value" |
|
|
|
|
|
:label="item.label" |
|
|
|
|
|
:value="item.value"> |
|
|
|
|
|
</el-option> |
|
|
|
|
|
</el-select> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item> |
|
|
<el-form-item> |
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">{{ |
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">{{ |
|
@ -21,21 +35,11 @@ |
|
|
</el-form> |
|
|
</el-form> |
|
|
|
|
|
|
|
|
<el-row :gutter="10" class="mb8"> |
|
|
<el-row :gutter="10" class="mb8"> |
|
|
<el-col :span="1.5"> |
|
|
|
|
|
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" |
|
|
|
|
|
v-hasPermi="['business:userAccount:add']">{{ $t('common.button.add') }} |
|
|
|
|
|
</el-button> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="1.5"> |
|
|
<el-col :span="1.5"> |
|
|
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" |
|
|
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" |
|
|
v-hasPermi="['business:userAccount:edit']">{{ $t('common.button.edit') }} |
|
|
v-hasPermi="['business:userAccount:edit']">{{ $t('common.button.edit') }} |
|
|
</el-button> |
|
|
</el-button> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="1.5"> |
|
|
|
|
|
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" |
|
|
|
|
|
v-hasPermi="['business:userAccount:remove']">{{ $t('common.button.delete') }} |
|
|
|
|
|
</el-button> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="1.5"> |
|
|
<el-col :span="1.5"> |
|
|
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" |
|
|
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" |
|
|
v-hasPermi="['business:userAccount:export']">{{ $t('common.button.export') }} |
|
|
v-hasPermi="['business:userAccount:export']">{{ $t('common.button.export') }} |
|
@ -46,29 +50,53 @@ |
|
|
|
|
|
|
|
|
<el-table v-loading="loading" :data="userAccountList" @selection-change="handleSelectionChange"> |
|
|
<el-table v-loading="loading" :data="userAccountList" @selection-change="handleSelectionChange"> |
|
|
<el-table-column type="selection" width="55" align="center"/> |
|
|
<el-table-column type="selection" width="55" align="center"/> |
|
|
<el-table-column :label="$t('business.userAccount.accountId')" align="center" prop="accountId"/> |
|
|
<el-table-column label="用户名称" align="center"> |
|
|
|
|
|
<template #default="scope"> |
|
|
|
|
|
<span v-if="scope.row.userType == 0">{{ scope.row.userInfoName }}</span> |
|
|
|
|
|
<span v-if="scope.row.userType == 1">{{ scope.row.merchantName }}</span> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
<el-table-column :label="$t('business.userAccount.accountCode')" align="center" prop="accountCode"/> |
|
|
<el-table-column :label="$t('business.userAccount.accountCode')" align="center" prop="accountCode"/> |
|
|
<el-table-column :label="$t('business.userAccount.accountName')" align="center" prop="accountName"/> |
|
|
<el-table-column :label="$t('business.userAccount.accountName')" align="center" prop="accountName"/> |
|
|
<el-table-column :label="$t('business.userAccount.accountAmount')" align="center" prop="accountAmount"/> |
|
|
<el-table-column |
|
|
|
|
|
:label="$t('business.userAccount.accountAmount')" |
|
|
|
|
|
prop="accountAmount" |
|
|
|
|
|
:formatter="formatCurrency"> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column label="账户类型" align="center" prop="accountType"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<el-tag v-if="scope.row.accountType == 0">普通账户</el-tag> |
|
|
|
|
|
<el-tag type="warning" v-if="scope.row.accountType == 1">商企账户</el-tag> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column label="账户级别" align="center" prop="isPrimary"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<el-tag type="warning" v-if="scope.row.isPrimary == 0">主账户</el-tag> |
|
|
|
|
|
<el-tag v-if="scope.row.isPrimary == 1">子账户</el-tag> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
<el-table-column :label="$t('business.userAccount.status')" align="center" prop="status"> |
|
|
<el-table-column :label="$t('business.userAccount.status')" align="center" prop="status"> |
|
|
<template slot-scope="scope"> |
|
|
<template slot-scope="scope"> |
|
|
<el-tag v-if="scope.row.status == '0'">{{ $t('business.userAccount.statusNormal') }}</el-tag> |
|
|
<el-tag type="success" v-if="scope.row.status == 0">{{ $t('business.userAccount.statusNormal') }}</el-tag> |
|
|
<el-tag type="danger" v-if="scope.row.status == '1'">{{ $t('business.userAccount.statusFrozen') }}</el-tag> |
|
|
<el-tag type="danger" v-if="scope.row.status == 1">{{ $t('business.userAccount.statusFrozen') }}</el-tag> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column :label="$t('common.button.operation')" align="center" width="200" |
|
|
<el-table-column :label="$t('common.button.operation')" align="center" width="200" |
|
|
class-name="small-padding fixed-width"> |
|
|
class-name="small-padding fixed-width"> |
|
|
<template slot-scope="scope"> |
|
|
<template slot-scope="scope"> |
|
|
<el-button size="mini" type="text" icon="el-icon-view" @click="handleDetail(scope.row)"> |
|
|
<el-button size="mini" type="text" icon="el-icon-plus" @click="handleAdd(scope.row)" v-if="(scope.row.id == null)" |
|
|
{{ $t('common.button.detail') }} |
|
|
v-hasPermi="['business:userAccount:edit']">创建 |
|
|
</el-button> |
|
|
</el-button> |
|
|
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" |
|
|
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-if="(scope.row.id != null)" |
|
|
v-hasPermi="['business:userAccount:edit']">{{ $t('common.button.edit') }} |
|
|
v-hasPermi="['business:userAccount:edit']">{{ $t('common.button.edit') }} |
|
|
</el-button> |
|
|
</el-button> |
|
|
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" |
|
|
<el-button size="mini" type="text" icon="el-icon-lock" @click="accountLock(scope.row)" v-if="(scope.row.id != null && scope.row.status == 0)" |
|
|
v-hasPermi="['business:userAccount:remove']">{{ $t('common.button.delete') }} |
|
|
v-hasPermi="['business:userAccount:remove']">冻结 |
|
|
</el-button> |
|
|
</el-button> |
|
|
</template> |
|
|
<el-button size="mini" type="text" icon="el-icon-lock" @click="accountUnlock(scope.row)" v-if="(scope.row.id != null && scope.row.status == 1)" |
|
|
|
|
|
v-hasPermi="['business:userAccount:remove']">解冻 |
|
|
|
|
|
</el-button> |
|
|
|
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
</el-table> |
|
|
</el-table> |
|
|
|
|
|
|
|
@ -78,17 +106,18 @@ |
|
|
<!-- 添加或修改用户账户对话框 --> |
|
|
<!-- 添加或修改用户账户对话框 --> |
|
|
<el-dialog :title="title" :visible.sync="open" width="700px" append-to-body> |
|
|
<el-dialog :title="title" :visible.sync="open" width="700px" append-to-body> |
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="auto"> |
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="auto"> |
|
|
<el-form-item :label="$t('business.userAccount.detailAccountId')" prop="accountId"> |
|
|
|
|
|
<el-input v-model="form.accountId" :placeholder="$t('business.userAccount.inputAccountId')"/> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item :label="$t('business.userAccount.detailAccountCode')" prop="accountCode"> |
|
|
|
|
|
<el-input v-model="form.accountCode" :placeholder="$t('business.userAccount.inputAccountCode')"/> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item :label="$t('business.userAccount.detailAccountName')" prop="accountName"> |
|
|
<el-form-item :label="$t('business.userAccount.detailAccountName')" prop="accountName"> |
|
|
<el-input v-model="form.accountName" :placeholder="$t('business.userAccount.inputAccountName')"/> |
|
|
<el-input v-model="form.accountName" :placeholder="$t('business.userAccount.inputAccountName')"/> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item :label="$t('business.userAccount.detailAccountAmount')" prop="accountAmount"> |
|
|
<el-form-item label="账户级别" prop="isPrimary"> |
|
|
<el-input v-model="form.accountAmount" :placeholder="$t('business.userAccount.inputAccountAmount')"/> |
|
|
<el-select v-model="form.isPrimary" placeholder="请选择账户级别"> |
|
|
|
|
|
<el-option |
|
|
|
|
|
v-for="item in options_accountLevel" |
|
|
|
|
|
:key="item.value" |
|
|
|
|
|
:label="item.label" |
|
|
|
|
|
:value="item.value"> |
|
|
|
|
|
</el-option> |
|
|
|
|
|
</el-select> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-form> |
|
|
</el-form> |
|
|
<div slot="footer" class="dialog-footer"> |
|
|
<div slot="footer" class="dialog-footer"> |
|
@ -103,9 +132,6 @@ |
|
|
<!-- 用户账户详情显示框 --> |
|
|
<!-- 用户账户详情显示框 --> |
|
|
<el-dialog :title="title" :visible.sync="detailOpen" width="700px" append-to-body> |
|
|
<el-dialog :title="title" :visible.sync="detailOpen" width="700px" append-to-body> |
|
|
<el-form ref="form" :model="form" label-width="auto"> |
|
|
<el-form ref="form" :model="form" label-width="auto"> |
|
|
<el-form-item :label="$t('business.userAccount.detailAccountIdLabel')"> |
|
|
|
|
|
{{ form.accountId }} |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item :label="$t('business.userAccount.detailAccountCodeLabel')"> |
|
|
<el-form-item :label="$t('business.userAccount.detailAccountCodeLabel')"> |
|
|
{{ form.accountCode }} |
|
|
{{ form.accountCode }} |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
@ -127,9 +153,9 @@ |
|
|
import { |
|
|
import { |
|
|
listUserAccount, |
|
|
listUserAccount, |
|
|
getUserAccount, |
|
|
getUserAccount, |
|
|
delUserAccount, |
|
|
|
|
|
addUserAccount, |
|
|
addUserAccount, |
|
|
updateUserAccount |
|
|
updateUserAccount, |
|
|
|
|
|
lockAccount |
|
|
} from "@/api/business/userAccount"; |
|
|
} from "@/api/business/userAccount"; |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
@ -171,6 +197,7 @@ export default { |
|
|
accountCode: undefined, |
|
|
accountCode: undefined, |
|
|
accountName: undefined, |
|
|
accountName: undefined, |
|
|
accountAmount: undefined, |
|
|
accountAmount: undefined, |
|
|
|
|
|
accountType: undefined, |
|
|
status: undefined, |
|
|
status: undefined, |
|
|
createTime: undefined, |
|
|
createTime: undefined, |
|
|
updateTime: undefined |
|
|
updateTime: undefined |
|
@ -178,7 +205,28 @@ export default { |
|
|
// 表单参数 |
|
|
// 表单参数 |
|
|
form: {}, |
|
|
form: {}, |
|
|
// 表单校验 |
|
|
// 表单校验 |
|
|
rules: {} |
|
|
rules: {}, |
|
|
|
|
|
options_accountLevel: [{ |
|
|
|
|
|
value: "0", |
|
|
|
|
|
label: '主账户' |
|
|
|
|
|
}, { |
|
|
|
|
|
value: "1", |
|
|
|
|
|
label: '子账户' |
|
|
|
|
|
}], |
|
|
|
|
|
options_accountType: [{ |
|
|
|
|
|
value: 0, |
|
|
|
|
|
label: '普通账户' |
|
|
|
|
|
}, { |
|
|
|
|
|
value: 1, |
|
|
|
|
|
label: '企业账户' |
|
|
|
|
|
}], |
|
|
|
|
|
options_accountStatus: [{ |
|
|
|
|
|
value: 0, |
|
|
|
|
|
label: '正常' |
|
|
|
|
|
}, { |
|
|
|
|
|
value: 1, |
|
|
|
|
|
label: '冻结' |
|
|
|
|
|
}], |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
created() { |
|
|
created() { |
|
@ -246,8 +294,9 @@ export default { |
|
|
this.multiple = !selection.length |
|
|
this.multiple = !selection.length |
|
|
}, |
|
|
}, |
|
|
/** 新增按钮操作 */ |
|
|
/** 新增按钮操作 */ |
|
|
handleAdd() { |
|
|
handleAdd(row) { |
|
|
this.reset(); |
|
|
this.reset(); |
|
|
|
|
|
this.form = row; |
|
|
this.open = true; |
|
|
this.open = true; |
|
|
this.title = this.$t('business.userAccount.addTitle'); |
|
|
this.title = this.$t('business.userAccount.addTitle'); |
|
|
}, |
|
|
}, |
|
@ -295,16 +344,31 @@ export default { |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
/** 删除按钮操作 */ |
|
|
/** 冻结按钮操作 */ |
|
|
handleDelete(row) { |
|
|
accountLock(row) { |
|
|
const ids = row.id || this.ids; |
|
|
this.$modal.confirm('是否要对账户”' + row.accountName + '“进行冻结?').then(() => { |
|
|
this.$modal.confirm(this.$t('common.button.deleteConfirm')).then(() => { |
|
|
this.loading = true; |
|
|
|
|
|
row.status = 1; |
|
|
|
|
|
return lockAccount(row); |
|
|
|
|
|
}).then(() => { |
|
|
|
|
|
this.loading = false; |
|
|
|
|
|
this.getList(); |
|
|
|
|
|
this.$modal.msgSuccess('账户“'+ row.accountName + '”已冻结!'); |
|
|
|
|
|
}).catch(() => { |
|
|
|
|
|
}).finally(() => { |
|
|
|
|
|
this.loading = false; |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
/**解冻按钮操作**/ |
|
|
|
|
|
accountUnlock(row) { |
|
|
|
|
|
this.$modal.confirm('是否解除账户”' + row.accountName + '“的冻结状态?').then(() => { |
|
|
this.loading = true; |
|
|
this.loading = true; |
|
|
return delUserAccount(ids); |
|
|
row.status = 0; |
|
|
|
|
|
return lockAccount(row); |
|
|
}).then(() => { |
|
|
}).then(() => { |
|
|
this.loading = false; |
|
|
this.loading = false; |
|
|
this.getList(); |
|
|
this.getList(); |
|
|
this.$modal.msgSuccess(this.$t('common.button.deleteSuccess')); |
|
|
this.$modal.msgSuccess('已解除对账户“'+ row.accountName + '”的冻结状态!'); |
|
|
}).catch(() => { |
|
|
}).catch(() => { |
|
|
}).finally(() => { |
|
|
}).finally(() => { |
|
|
this.loading = false; |
|
|
this.loading = false; |
|
@ -315,6 +379,14 @@ export default { |
|
|
this.download('business/userAccount/export', { |
|
|
this.download('business/userAccount/export', { |
|
|
...this.queryParams |
|
|
...this.queryParams |
|
|
}, `userAccount_${new Date().getTime()}.xlsx`) |
|
|
}, `userAccount_${new Date().getTime()}.xlsx`) |
|
|
|
|
|
}, |
|
|
|
|
|
/**格式化金额*/ |
|
|
|
|
|
formatCurrency(row, column) { |
|
|
|
|
|
return new Intl.NumberFormat('zh-CN', { |
|
|
|
|
|
style: 'currency', |
|
|
|
|
|
currency: 'CNY', |
|
|
|
|
|
minimumFractionDigits: 2 |
|
|
|
|
|
}).format(row[column.property]); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}; |
|
|
}; |
|
|