Browse Source

代理商信息修改

main
niefei 1 month ago
parent
commit
394092d6c4
  1. 464
      src/views/business/userInfoAgent/index.vue

464
src/views/business/userInfoAgent/index.vue

@ -2,37 +2,25 @@
<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.agent.userInfoAgent.agentName')" prop="agentName"> <el-form-item :label="$t('business.agent.userInfoAgent.agentName')" prop="agentName">
<el-input <el-input v-model="queryParams.agentName"
v-model="queryParams.agentName" :placeholder="$t('business.agent.userInfoAgent.placeholder.agentName')" clearable
:placeholder="$t('business.agent.userInfoAgent.placeholder.agentName')" @keyup.enter.native="handleQuery" />
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('business.agent.userInfoAgent.account')" prop="account"> <el-form-item :label="$t('business.agent.userInfoAgent.account')" prop="account">
<el-input <el-input v-model="queryParams.account" :placeholder="$t('business.agent.userInfoAgent.placeholder.account')"
v-model="queryParams.account" clearable @keyup.enter.native="handleQuery" />
:placeholder="$t('business.agent.userInfoAgent.placeholder.account')"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">{{ $t('common.button.search') }}</el-button> <el-button type="primary" icon="el-icon-search" size="mini"
@click="handleQuery">{{ $t('common.button.search') }}</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{ $t('common.button.reset') }}</el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{ $t('common.button.reset') }}</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
type="warning" v-hasPermi="['business:userInfoAgent:export']">{{ $t('common.button.export') }}</el-button>
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['business:userInfoAgent:export']"
>{{ $t('common.button.export') }}</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
@ -45,28 +33,20 @@
<el-table-column :label="$t('business.agent.userInfoAgent.licenseOther')" align="center" prop="licenseOther" /> <el-table-column :label="$t('business.agent.userInfoAgent.licenseOther')" align="center" prop="licenseOther" />
<el-table-column :label="$t('business.agent.userInfoAgent.legalPerson')" align="center" prop="legalPerson" /> <el-table-column :label="$t('business.agent.userInfoAgent.legalPerson')" align="center" prop="legalPerson" />
<el-table-column :label="$t('business.agent.userInfoAgent.operateStatus')" align="center" prop="operateStatus" /> <el-table-column :label="$t('business.agent.userInfoAgent.operateStatus')" align="center" prop="operateStatus" />
<el-table-column :label="$t('business.agent.userInfoAgent.contactAddress')" align="center" prop="contactAddress" /> <el-table-column :label="$t('business.agent.userInfoAgent.contactAddress')" align="center"
prop="contactAddress" />
<el-table-column :label="$t('business.agent.userInfoAgent.operateAddr')" align="center" prop="operateAddr" /> <el-table-column :label="$t('business.agent.userInfoAgent.operateAddr')" align="center" prop="operateAddr" />
<el-table-column :label="$t('common.tableMsg.operation')" align="center" width="200" class-name="small-padding fixed-width"> <el-table-column :label="$t('common.tableMsg.operation')" align="center" width="200"
class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
size="mini" v-hasPermi="['business:userInfoAgent:edit']">{{ $t('common.button.edit') }}</el-button>
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['business:userInfoAgent:edit']"
>{{ $t('common.button.edit') }}</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
v-show="total>0" @pagination="getList" />
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改代理商信息对话框 --> <!-- 添加或修改代理商信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="700px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
@ -78,20 +58,25 @@
<el-input v-model="form.license" :placeholder="$t('business.agent.userInfoAgent.placeholder.license')" /> <el-input v-model="form.license" :placeholder="$t('business.agent.userInfoAgent.placeholder.license')" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('business.agent.userInfoAgent.licenseOther')" prop="licenseOther"> <el-form-item :label="$t('business.agent.userInfoAgent.licenseOther')" prop="licenseOther">
<el-input v-model="form.licenseOther" :placeholder="$t('business.agent.userInfoAgent.placeholder.licenseOther')" /> <el-input v-model="form.licenseOther"
:placeholder="$t('business.agent.userInfoAgent.placeholder.licenseOther')" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('business.agent.userInfoAgent.legalPerson')" prop="legalPerson"> <el-form-item :label="$t('business.agent.userInfoAgent.legalPerson')" prop="legalPerson">
<el-input v-model="form.legalPerson" :placeholder="$t('business.agent.userInfoAgent.placeholder.legalPerson')" /> <el-input v-model="form.legalPerson"
:placeholder="$t('business.agent.userInfoAgent.placeholder.legalPerson')" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('business.agent.userInfoAgent.contactAddress')" prop="contactAddress"> <el-form-item :label="$t('business.agent.userInfoAgent.contactAddress')" prop="contactAddress">
<el-input v-model="form.contactAddress" :placeholder="$t('business.agent.userInfoAgent.placeholder.contactAddress')" /> <el-input v-model="form.contactAddress"
:placeholder="$t('business.agent.userInfoAgent.placeholder.contactAddress')" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('business.agent.userInfoAgent.operateAddr')" prop="operateAddr"> <el-form-item :label="$t('business.agent.userInfoAgent.operateAddr')" prop="operateAddr">
<el-input v-model="form.operateAddr" :placeholder="$t('business.agent.userInfoAgent.placeholder.operateAddr')" /> <el-input v-model="form.operateAddr"
:placeholder="$t('business.agent.userInfoAgent.placeholder.operateAddr')" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm">{{ $t('common.button.confirm') }}</el-button> <el-button :loading="buttonLoading" type="primary"
@click="submitForm">{{ $t('common.button.confirm') }}</el-button>
<el-button @click="cancel">{{ $t('common.button.cancel') }}</el-button> <el-button @click="cancel">{{ $t('common.button.cancel') }}</el-button>
</div> </div>
</el-dialog> </el-dialog>
@ -100,197 +85,222 @@
</template> </template>
<script> <script>
import { listUserInfoAgent, getUserInfoAgent, delUserInfoAgent, addUserInfoAgent, updateUserInfoAgent } from "@/api/business/userInfoAgent"; import {
listUserInfoAgent,
getUserInfoAgent,
delUserInfoAgent,
addUserInfoAgent,
updateUserInfoAgent
} from "@/api/business/userInfoAgent";
export default { export default {
name: "UserInfoAgent", name: "UserInfoAgent",
data() { data() {
return { return {
// loading // loading
buttonLoading: false, buttonLoading: false,
// //
loading: true, loading: true,
// //
ids: [], ids: [],
// //
single: true, single: true,
// //
multiple: true, multiple: true,
// //
showSearch: true, showSearch: true,
// //
total: 0, total: 0,
// //
userInfoAgentList: [], userInfoAgentList: [],
// //
title: "", title: "",
// //
open: false, open: false,
// //
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
userId: undefined, userId: undefined,
agentName: undefined, agentName: undefined,
license: undefined, license: undefined,
licenseOther: undefined, licenseOther: undefined,
legalPerson: undefined, legalPerson: undefined,
operateStatus: undefined, operateStatus: undefined,
contactAddress: undefined, contactAddress: undefined,
operateAddr: undefined, operateAddr: undefined,
}, },
// //
form: {}, form: {},
// //
rules: { rules: {
id: [ id: [{
{ required: true, message: this.$t('business.agent.userInfoAgent.rule.idRequired'), trigger: "blur" } required: true,
], message: this.$t('business.agent.userInfoAgent.rule.idRequired'),
userId: [ trigger: "blur"
{ required: true, message: this.$t('business.agent.userInfoAgent.rule.userIdRequired'), trigger: "blur" } }],
], /* userId: [{
agentName: [ required: true,
{ required: true, message: this.$t('business.agent.userInfoAgent.rule.agentNameRequired'), trigger: "blur" } message: this.$t('business.agent.userInfoAgent.rule.userIdRequired'),
], trigger: "blur"
license: [ }], */
{ required: true, message: this.$t('business.agent.userInfoAgent.rule.licenseRequired'), trigger: "blur" } agentName: [{
], required: true,
licenseOther: [ message: this.$t('business.agent.userInfoAgent.rule.agentNameRequired'),
{ required: true, message: this.$t('business.agent.userInfoAgent.rule.licenseOtherRequired'), trigger: "blur" } trigger: "blur"
], }],
legalPerson: [ license: [{
{ required: true, message: this.$t('business.agent.userInfoAgent.rule.legalPersonRequired'), trigger: "blur" } required: true,
], message: this.$t('business.agent.userInfoAgent.rule.licenseRequired'),
operateStatus: [ trigger: "blur"
{ required: true, message: this.$t('business.agent.userInfoAgent.rule.operateStatusRequired'), trigger: "change" } }],
], licenseOther: [{
contactAddress: [ required: true,
{ required: true, message: this.$t('business.agent.userInfoAgent.rule.contactAddressRequired'), trigger: "blur" } message: this.$t('business.agent.userInfoAgent.rule.licenseOtherRequired'),
], trigger: "blur"
operateAddr: [ }],
{ required: true, message: this.$t('business.agent.userInfoAgent.rule.operateAddrRequired'), trigger: "blur" } legalPerson: [{
], required: true,
} message: this.$t('business.agent.userInfoAgent.rule.legalPersonRequired'),
}; trigger: "blur"
}, }],
created() { /* operateStatus: [{
this.getList(); required: true,
}, message: this.$t('business.agent.userInfoAgent.rule.operateStatusRequired'),
methods: { trigger: "change"
/** 查询代理商信息列表 */ }], */
getList() { contactAddress: [{
this.loading = true; required: true,
listUserInfoAgent(this.queryParams).then(response => { message: this.$t('business.agent.userInfoAgent.rule.contactAddressRequired'),
this.userInfoAgentList = response.rows; trigger: "blur"
this.total = response.total; }],
this.loading = false; operateAddr: [{
}); required: true,
}, message: this.$t('business.agent.userInfoAgent.rule.operateAddrRequired'),
// trigger: "blur"
cancel() { }],
this.open = false; }
this.reset();
},
//
reset() {
this.form = {
id: undefined,
userId: undefined,
agentName: undefined,
license: undefined,
licenseOther: undefined,
legalPerson: undefined,
operateStatus: undefined,
contactAddress: undefined,
operateAddr: undefined,
delFlag: undefined,
createBy: undefined,
createTime: undefined,
updateBy: undefined,
updateTime: undefined
}; };
this.resetForm("form");
}, },
/** 搜索按钮操作 */ created() {
handleQuery() {
this.queryParams.pageNum = 1;
this.getList(); this.getList();
}, },
/** 重置按钮操作 */ methods: {
resetQuery() { /** 查询代理商信息列表 */
this.resetForm("queryForm"); getList() {
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = this.$t('business.agent.userInfoAgent.addTitle');
},
/** 修改按钮操作 */
handleUpdate(row) {
this.loading = true;
this.reset();
const id = row.id || this.ids
getUserInfoAgent(id).then(response => {
this.loading = false;
this.form = response.data;
this.open = true;
this.title = this.$t('business.agent.userInfoAgent.editTitle');
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.buttonLoading = true;
if (this.form.id != null) {
updateUserInfoAgent(this.form).then(response => {
this.$modal.msgSuccess(this.$t('business.agent.userInfoAgent.editSuccess'));
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
} else {
addUserInfoAgent(this.form).then(response => {
this.$modal.msgSuccess(this.$t('business.agent.userInfoAgent.addSuccess'));
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm(this.$t('business.agent.userInfoAgent.deleteConfirm', { ids: ids })).then(() => {
this.loading = true; this.loading = true;
return delUserInfoAgent(ids); listUserInfoAgent(this.queryParams).then(response => {
}).then(() => { this.userInfoAgentList = response.rows;
this.loading = false; this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: undefined,
userId: undefined,
agentName: undefined,
license: undefined,
licenseOther: undefined,
legalPerson: undefined,
operateStatus: undefined,
contactAddress: undefined,
operateAddr: undefined,
delFlag: undefined,
createBy: undefined,
createTime: undefined,
updateBy: undefined,
updateTime: undefined
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList(); this.getList();
this.$modal.msgSuccess(this.$t('business.agent.userInfoAgent.deleteSuccess')); },
}).catch(() => { /** 重置按钮操作 */
}).finally(() => { resetQuery() {
this.loading = false; this.resetForm("queryForm");
}); this.handleQuery();
}, },
/** 导出按钮操作 */ //
handleExport() { handleSelectionChange(selection) {
this.download('business/userInfoAgent/export', { this.ids = selection.map(item => item.id)
...this.queryParams this.single = selection.length !== 1
}, `userInfoAgent_${new Date().getTime()}.xlsx`) this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = this.$t('business.agent.userInfoAgent.addTitle');
},
/** 修改按钮操作 */
handleUpdate(row) {
this.loading = true;
this.reset();
const id = row.id || this.ids
getUserInfoAgent(id).then(response => {
this.loading = false;
this.form = response.data;
this.open = true;
this.title = this.$t('business.agent.userInfoAgent.editTitle');
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.buttonLoading = true;
if (this.form.id != null) {
updateUserInfoAgent(this.form).then(response => {
this.$modal.msgSuccess(this.$t('business.agent.userInfoAgent.editSuccess'));
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
} else {
addUserInfoAgent(this.form).then(response => {
this.$modal.msgSuccess(this.$t('business.agent.userInfoAgent.addSuccess'));
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm(this.$t('business.agent.userInfoAgent.deleteConfirm', {
ids: ids
})).then(() => {
this.loading = true;
return delUserInfoAgent(ids);
}).then(() => {
this.loading = false;
this.getList();
this.$modal.msgSuccess(this.$t('business.agent.userInfoAgent.deleteSuccess'));
}).catch(() => {}).finally(() => {
this.loading = false;
});
},
/** 导出按钮操作 */
handleExport() {
this.download('business/userInfoAgent/export', {
...this.queryParams
}, `userInfoAgent_${new Date().getTime()}.xlsx`)
}
} }
} };
};
</script> </script>

Loading…
Cancel
Save