挂账初始化
This commit is contained in:
parent
d0c983f0c6
commit
025397f780
44
src/api/bst/credit.js
Normal file
44
src/api/bst/credit.js
Normal file
|
@ -0,0 +1,44 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询挂账方列表
|
||||
export function listCredit(query) {
|
||||
return request({
|
||||
url: '/bst/credit/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询挂账方详细
|
||||
export function getCredit(id) {
|
||||
return request({
|
||||
url: '/bst/credit/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增挂账方
|
||||
export function addCredit(data) {
|
||||
return request({
|
||||
url: '/bst/credit',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改挂账方
|
||||
export function updateCredit(data) {
|
||||
return request({
|
||||
url: '/bst/credit',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除挂账方
|
||||
export function delCredit(id) {
|
||||
return request({
|
||||
url: '/bst/credit/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
1
src/assets/icons/svg/credit.svg
Normal file
1
src/assets/icons/svg/credit.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg t="1748334961679" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5198" width="64" height="64"><path d="M364.562449 737.651269a318.783275 318.783275 0 0 1 16.240162-101.938775 328.79747 328.79747 0 0 1 45.882177-89.269388 360.60255 360.60255 0 0 1 70.248141-72.491322 352.877315 352.877315 0 0 1 89.349503-50.734769c1.899836-4.841148 3.502107-9.373286 4.772478-13.596414l4.783924-12.703721c1.270372-4.211684 2.552189-8.148693 3.822561-11.765248a49.01805 49.01805 0 0 0 18.151442-10.002749q7.656567-6.35186 13.859645-17.670761t8.137248-31.267176q1.899836-14.500553-0.492126-24.468968a57.693204 57.693204 0 0 0-6.214523-16.308831A31.965308 31.965308 0 0 0 622.596761 273.656455a559.650397 559.650397 0 0 0-4.783924-73.406905 407.640651 407.640651 0 0 0-16.240161-66.585808 187.545829 187.545829 0 0 0-36.31433-63.884837q-10.52921-12.692276-29.149889-25.373107A238.269154 238.269154 0 0 0 493.579605 21.756552a294.337197 294.337197 0 0 0-51.135337-15.862483 259.384798 259.384798 0 0 0-54.935008-5.894069 337.758743 337.758743 0 0 0-45.41294 3.193097 214.498318 214.498318 0 0 0-47.347111 12.234485 198.384049 198.384049 0 0 0-45.779173 24.915315q-21.974003 15.862484-41.098253 41.201256a177.897869 177.897869 0 0 0-29.619126 59.81049 436.939322 436.939322 0 0 0-13.378963 62.522907 622.90577 622.90577 0 0 0-3.822561 68.874766 57.738983 57.738983 0 0 0-12.429046 19.021247 62.946364 62.946364 0 0 0-5.722397 22.660691q-0.961363 12.680831 3.822561 28.085523t11.444794 23.56483a84.920367 84.920367 0 0 0 12.429045 12.692275 44.543136 44.543136 0 0 0 13.378964 6.340416q4.772479 14.500553 9.556402 28.085523a217.142065 217.142065 0 0 0 10.987002 23.107038q6.214523 11.330345 13.859645 17.670761 16.240162 12.680831 29.619125 24.92676t15.290244 33.075453q0.961363 14.489108 0.961363 26.323025a55.759033 55.759033 0 0 1-4.772479 22.649246q-4.772479 10.883999-15.770925 22.202899t-31.06117 23.107038a201.027796 201.027796 0 0 1-37.767818 16.766622q-20.600628 6.798207-42.517407 12.692276t-43.043868 12.223039a165.194148 165.194148 0 0 0-38.237055 16.755178 113.566685 113.566685 0 0 0-29.149889 24.915315Q9.991305 704.10658 6.157299 726.778715q-9.544958 58.883462-4.303242 96.502498t15.78237 44.852146q5.722397 4.577917 27.707844 9.064276t53.515854 9.064276q31.553295 4.577917 70.248142 8.606485t77.893264 7.244554q39.198417 3.170208 75.981984 4.98993t64.468521 1.819722h25.808009a352.785757 352.785757 0 0 1-35.845093-81.10925 312.522973 312.522973 0 0 1-12.852503-90.162083z m635.552267-110.098912a295.767796 295.767796 0 0 0-64.525745-91.031887q-40.606127-38.912298-95.564025-61.618768t-117.080236-22.660691q-63.083701 0-118.030155 22.660691t-95.575469 61.618768a295.733461 295.733461 0 0 0-64.502856 91.077666 269.788115 269.788115 0 0 0 0 222.028992 295.687682 295.687682 0 0 0 64.502856 91.008997q40.617572 38.912298 95.575469 61.160976t118.030155 22.202899q62.133783 0 117.080236-22.202899t95.564025-61.160976a295.905133 295.905133 0 0 0 64.5143-91.066221 269.788115 269.788115 0 0 0 0-222.028992zM835.939155 728.358097q21.504767 1.91128 23.496161 20.852413-1.979949 18.964023-23.496161 20.852414h-72.399763V802.291462h72.399763q21.504767 1.922725 23.496161 20.852414-1.979949 18.986912-23.496161 20.852413h-72.399763v58.75757q-1.979949 32.251428-37.184134 32.239983t-37.184134-32.239983v-58.75757H616.759916q-21.561991-1.854057-23.484716-20.852413 1.922725-18.918243 23.484716-20.852414h72.411208v-32.228538H616.759916q-21.561991-1.865501-23.484716-20.852414 1.922725-18.941133 23.484716-20.852413h41.098254l-62.62591-85.30949a31.942418 31.942418 0 0 1-7.828239-20.852414q3.89123-32.217093 37.184134-36.016765 19.536262 1.91128 29.355895 15.152907l72.411208 100.485286 72.411208-100.485286q9.773854-13.241626 29.355895-15.152907 33.189901 3.811116 37.184134 36.016765a32.11409 32.11409 0 0 1-7.828239 20.852414l-62.591575 85.30949z" p-id="5199"></path></svg>
|
After Width: | Height: | Size: 3.8 KiB |
1
src/assets/icons/svg/credit2.svg
Normal file
1
src/assets/icons/svg/credit2.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg t="1748335108691" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6374" width="64" height="64"><path d="M723.36 704c-54.4-25.6-73.6-60.8-60.8-102.4 9.6-38.4 44.8-67.2 83.2-67.2 38.4 0 73.6 25.6 83.2 60.8 12.8 44.8-6.4 80-60.8 108.8 28.8 38.4 60.8 76.8 92.8 112 3.2 6.4 16 6.4 19.2 9.6 25.6 9.6 41.6 32 38.4 60.8-3.2 28.8-22.4 51.2-54.4 51.2h-240c-25.6 0-51.2-22.4-54.4-51.2-3.2-25.6 12.8-51.2 38.4-60.8 12.8-6.4 22.4-12.8 32-22.4 28.8-32 57.6-67.2 83.2-99.2z m-156.8 102.4c-32 16-41.6 54.4-41.6 80h-278.4c-51.2 0-70.4-19.2-70.4-70.4v-44.8h57.6c38.4 0 60.8-22.4 60.8-57.6s-25.6-57.6-57.6-60.8h-60.8v-86.4h51.2c41.6 0 64-25.6 64-57.6 0-38.4-25.6-60.8-64-60.8h-51.2v-86.4h51.2c35.2 0 60.8-28.8 60.8-60.8 0-32-25.6-57.6-60.8-57.6h-51.2c0-22.4-3.2-44.8 3.2-60.8 3.2-32 28.8-51.2 57.6-51.2h531.2c28.8 0 48 19.2 54.4 44.8 3.2 9.6 3.2 19.2 3.2 28.8v316.8c-19.2-19.2-60.8-28.8-89.6-25.6-38.4 3.2-73.6 25.6-92.8 57.6h-73.6c6.4-16 6.4-28.8 12.8-38.4 12.8-25.6 41.6-3.2 60.8-16v-44.8c-9.6-3.2-19.2-3.2-32-3.2 22.4-41.6 44.8-83.2 64-128h-48c-16 0-28.8 3.2-35.2 19.2-16 38.4-35.2 73.6-54.4 115.2-22.4-44.8-38.4-86.4-57.6-124.8-3.2-6.4-9.6-16-16-16h-64l64 128c-16 0-22.4 3.2-35.2 3.2v48h28.8c35.2 0 44.8 12.8 38.4 51.2h-67.2v48h73.6v67.2h64v-67.2h51.2c-6.4 28.8 3.2 83.2 51.2 112 0 3.2-16 25.6-48 57.6-19.2 19.2-19.2 22.4-54.4 41.6z m-448-480c-19.2 0-32-9.6-28.8-28.8 3.2-16 12.8-28.8 32-28.8h108.8c16 0 28.8 6.4 32 25.6 3.2 19.2-9.6 32-25.6 32-38.4 3.2-80 0-118.4 0z m144 377.6c0 19.2-12.8 28.8-22.4 28.8h-118.4c-19.2-3.2-25.6-12.8-25.6-32 0-16 6.4-22.4 25.6-22.4h112c16 0 28.8 6.4 28.8 25.6z m-172.8-201.6c0-19.2 9.6-28.8 28.8-28.8h115.2c16 0 25.6 16 25.6 28.8s-6.4 25.6-25.6 25.6h-118.4c-16 0-25.6-6.4-25.6-25.6z" p-id="6375"></path></svg>
|
After Width: | Height: | Size: 1.7 KiB |
|
@ -442,3 +442,8 @@ export const VipLimitUnit = {
|
|||
DAY: "1", // 天
|
||||
}
|
||||
|
||||
// 挂账方状态
|
||||
export const CreditStatus = {
|
||||
NORMAL: "1", // 正常
|
||||
DISABLED: "2", // 停用
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<el-dialog
|
||||
:title="title"
|
||||
:visible.sync="dialogVisible"
|
||||
width="500px"
|
||||
width="650px"
|
||||
append-to-body
|
||||
:close-on-click-modal="false"
|
||||
@open="handleOpen"
|
||||
|
@ -32,12 +32,12 @@
|
|||
<template slot="append">%</template>
|
||||
</el-input>
|
||||
</form-col>
|
||||
<form-col :span="span" label="备注" prop="remark">
|
||||
<form-col :span="24" label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入备注" maxlength="30" show-word-limit/>
|
||||
</form-col>
|
||||
<form-col :span="span" label="权限" prop="permissions">
|
||||
<form-col :span="24" label="权限" prop="permissions">
|
||||
<el-checkbox-group v-model="form.permissions">
|
||||
<el-checkbox v-for="dict in dict.type.area_join_permission" :key="dict.value" :label="dict.value">{{dict.label}}</el-checkbox>
|
||||
<el-checkbox style="width: 25%;margin-left: 0; margin-right: 0;" v-for="dict in dict.type.area_join_permission" :key="dict.value" :label="dict.value">{{dict.label}}</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</form-col>
|
||||
</el-row>
|
||||
|
@ -50,11 +50,11 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { getAreaJoin, addAreaJoin, updateAreaJoin } from "@/api/bst/areaJoin";
|
||||
import FormCol from "@/components/FormCol/index.vue";
|
||||
import { addAreaJoin, getAreaJoin, updateAreaJoin } from "@/api/bst/areaJoin";
|
||||
import AreaRemoteSelect from "@/components/Business/Area/AreaRemoteSelect.vue";
|
||||
import { AreaJoinType } from "@/utils/enums";
|
||||
import UserInput from '@/components/Business/User/UserInput.vue';
|
||||
import FormCol from "@/components/FormCol/index.vue";
|
||||
import { AreaJoinType } from "@/utils/enums";
|
||||
|
||||
export default {
|
||||
name: 'AreaJoinEditDialog',
|
||||
|
@ -81,7 +81,7 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
AreaJoinType,
|
||||
span: 24,
|
||||
span: 12,
|
||||
title: '',
|
||||
submitLoading: false,
|
||||
form: {
|
||||
|
|
158
src/views/bst/credit/components/CreditEditDialog.vue
Normal file
158
src/views/bst/credit/components/CreditEditDialog.vue
Normal file
|
@ -0,0 +1,158 @@
|
|||
<template>
|
||||
<el-dialog
|
||||
:title="title"
|
||||
:visible.sync="dialogVisible"
|
||||
width="500px"
|
||||
append-to-body
|
||||
:close-on-click-modal="false"
|
||||
@open="handleOpen"
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px" v-loading="loading">
|
||||
<el-row>
|
||||
<form-col :span="span" label="名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入名称" />
|
||||
</form-col>
|
||||
<form-col :span="span" label="运营区" prop="areaId">
|
||||
<area-remote-select v-model="form.areaId" placeholder="请选择运营区" style="width: 100%;"/>
|
||||
</form-col>
|
||||
<form-col :span="span" label="状态" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio
|
||||
v-for="dict in dict.type.credit_status"
|
||||
:key="dict.value"
|
||||
:label="dict.value"
|
||||
>{{dict.label}}</el-radio>
|
||||
</el-radio-group>
|
||||
</form-col>
|
||||
<form-col :span="span" label="额度限制" prop="limitAmount">
|
||||
<el-input-number v-model="form.limitAmount" placeholder="请输入额度限制" style="width: calc(100% - 2em)" controls-position="right" /> 元
|
||||
</form-col>
|
||||
<form-col :span="span" label="管理员" prop="adminMobile">
|
||||
<el-input v-model="form.adminMobile" placeholder="请输入管理员手机号" />
|
||||
</form-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm" :loading="submitLoading">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { addCredit, getCredit, updateCredit } from "@/api/bst/credit";
|
||||
import AreaRemoteSelect from "@/components/Business/Area/AreaRemoteSelect.vue";
|
||||
import FormCol from "@/components/FormCol/index.vue";
|
||||
import { CreditStatus } from "@/utils/enums";
|
||||
|
||||
|
||||
export default {
|
||||
name: 'CreditEditDialog',
|
||||
components: { FormCol, AreaRemoteSelect },
|
||||
dicts: ['credit_status'],
|
||||
props: {
|
||||
visible: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
id: {
|
||||
type: [String, Number],
|
||||
default: null
|
||||
},
|
||||
initData: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
submitLoading: false,
|
||||
span: 24,
|
||||
title: '',
|
||||
form: {},
|
||||
rules: {
|
||||
name: [
|
||||
{ required: true, message: "名称不能为空", trigger: "blur" }
|
||||
],
|
||||
status: [
|
||||
{ required: true, message: "状态不能为空", trigger: "change" }
|
||||
],
|
||||
limitAmount: [
|
||||
{ required: true, message: "额度限制不能为空", trigger: "blur" }
|
||||
],
|
||||
adminMobile: [
|
||||
{ required: true, message: "管理员手机号不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
dialogVisible: {
|
||||
get() {
|
||||
return this.visible;
|
||||
},
|
||||
set(val) {
|
||||
this.$emit('update:visible', val);
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleOpen() {
|
||||
if (this.id == null) {
|
||||
this.reset();
|
||||
this.title = "添加挂账方";
|
||||
} else {
|
||||
this.getDetail();
|
||||
this.title = "修改挂账方";
|
||||
}
|
||||
},
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
name: null,
|
||||
status: CreditStatus.NORMAL,
|
||||
limitAmount: null,
|
||||
adminId: null,
|
||||
createTime: null,
|
||||
createId: null,
|
||||
deleted: null,
|
||||
...this.initData
|
||||
};
|
||||
this.$nextTick(() => {
|
||||
this.$refs.form && this.$refs.form.clearValidate();
|
||||
});
|
||||
},
|
||||
getDetail() {
|
||||
this.loading = true;
|
||||
getCredit(this.id).then(response => {
|
||||
this.form = response.data;
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
submitForm() {
|
||||
this.$refs.form.validate(valid => {
|
||||
if (valid) {
|
||||
this.submitLoading = true;
|
||||
const promise = this.form.id != null ? updateCredit(this.form) : addCredit(this.form);
|
||||
promise.then(response => {
|
||||
this.$modal.msgSuccess(this.form.id != null ? "修改成功" : "新增成功");
|
||||
this.dialogVisible = false;
|
||||
this.$emit('success');
|
||||
}).finally(() => {
|
||||
this.submitLoading = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
this.dialogVisible = false;
|
||||
this.reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
</style>
|
295
src/views/bst/credit/index.vue
Normal file
295
src/views/bst/credit/index.vue
Normal file
|
@ -0,0 +1,295 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="名称" prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
placeholder="请输入名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="运营区" prop="areaId">
|
||||
<area-remote-select v-model="queryParams.areaId" style="width: 100%;" clearable @change="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable @change="handleQuery">
|
||||
<el-option
|
||||
v-for="dict in dict.type.credit_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="管理员" prop="adminName">
|
||||
<el-input
|
||||
v-model="queryParams.adminName"
|
||||
placeholder="请输入管理员ID"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人" prop="createName">
|
||||
<el-input
|
||||
v-model="queryParams.createName"
|
||||
placeholder="请输入创建人"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<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-has-permi="['bst:credit:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-has-permi="['bst:credit:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-has-permi="['bst:credit:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="creditList" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="onSortChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<template v-for="column of showColumns">
|
||||
<el-table-column
|
||||
:key="column.key"
|
||||
:label="column.label"
|
||||
:prop="column.key"
|
||||
:align="column.align"
|
||||
:min-width="column.minWidth"
|
||||
:sort-orders="orderSorts"
|
||||
:sortable="column.sortable"
|
||||
:show-overflow-tooltip="column.overflow"
|
||||
:width="column.width"
|
||||
>
|
||||
<template slot-scope="d">
|
||||
<template v-if="column.key === 'id'">
|
||||
{{d.row[column.key]}}
|
||||
</template>
|
||||
<template v-else-if="column.key === 'status'">
|
||||
<dict-tag :options="dict.type.credit_status" :value="d.row[column.key]"/>
|
||||
</template>
|
||||
<template v-else-if="column.key === 'adminName'">
|
||||
<user-link :id="d.row.adminId" :text="d.row.adminName" />
|
||||
</template>
|
||||
<template v-else-if="column.key === 'areaName'">
|
||||
<area-link :id="d.row.areaId" :text="d.row.areaName" />
|
||||
</template>
|
||||
<template v-else-if="column.key === 'createName'">
|
||||
<user-link :id="d.row.createId" :text="d.row.createName" />
|
||||
</template>
|
||||
<template v-else-if="column.key === 'limitAmount'">
|
||||
{{d.row.usedAmount | fix2 | dv}} 元 / {{d.row.limitAmount | fix2 | dv}} 元
|
||||
</template>
|
||||
<template v-else>
|
||||
{{d.row[column.key]}}
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-has-permi="['bst:credit:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-has-permi="['bst:credit:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改挂账方对话框 -->
|
||||
<credit-edit-dialog
|
||||
:visible.sync="open"
|
||||
:id="id"
|
||||
@success="getList"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { delCredit, listCredit } from "@/api/bst/credit";
|
||||
import AreaLink from '@/components/Business/Area/AreaLink.vue';
|
||||
import UserLink from '@/components/Business/User/UserLink.vue';
|
||||
import FormCol from "@/components/FormCol/index.vue";
|
||||
import { $showColumns } from '@/utils/mixins';
|
||||
import CreditEditDialog from './components/CreditEditDialog.vue';
|
||||
|
||||
// 默认排序字段
|
||||
const defaultSort = {
|
||||
prop: "createTime",
|
||||
order: "descending"
|
||||
}
|
||||
|
||||
export default {
|
||||
name: "Credit",
|
||||
mixins: [$showColumns],
|
||||
dicts: ['credit_status'],
|
||||
components: {FormCol, CreditEditDialog, AreaLink, UserLink},
|
||||
data() {
|
||||
return {
|
||||
span: 24,
|
||||
// 字段列表
|
||||
columns: [
|
||||
{key: 'id', visible: false, label: 'ID', minWidth: null, sortable: true, overflow: false, align: 'center', width: "80"},
|
||||
{key: 'name', visible: true, label: '名称', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'status', visible: true, label: '状态', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'areaName', visible: true, label: '运营区', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'limitAmount', visible: true, label: '额度限制', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'adminName', visible: true, label: '管理员', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'createName', visible: true, label: '创建人', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'createTime', visible: true, label: '创建时间', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
],
|
||||
// 排序方式
|
||||
orderSorts: ['ascending', 'descending', null],
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 挂账方表格数据
|
||||
creditList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
defaultSort,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
orderByColumn: defaultSort.prop,
|
||||
isAsc: defaultSort.order,
|
||||
id: null,
|
||||
name: null,
|
||||
status: null,
|
||||
adminId: null,
|
||||
createId: null,
|
||||
deleted: null
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 当排序按钮被点击时触发 **/
|
||||
onSortChange(column) {
|
||||
if (column.order == null) {
|
||||
this.queryParams.orderByColumn = defaultSort.prop;
|
||||
this.queryParams.isAsc = defaultSort.order;
|
||||
} else {
|
||||
this.queryParams.orderByColumn = column.prop;
|
||||
this.queryParams.isAsc = column.order;
|
||||
}
|
||||
this.getList();
|
||||
},
|
||||
/** 查询挂账方列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listCredit(this.queryParams).then(response => {
|
||||
this.creditList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.open = true;
|
||||
this.id = null;
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.id = row.id || this.ids;
|
||||
this.open = true;
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除挂账方编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delCredit(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('bst/credit/export', {
|
||||
...this.queryParams
|
||||
}, `credit_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
Reference in New Issue
Block a user