Commit 62684fb2 authored by 仇晓婷's avatar 仇晓婷

客户管理优化

parent 75d72e99
...@@ -36,13 +36,13 @@ ...@@ -36,13 +36,13 @@
</div> </div>
</template> </template>
<script> <script>
import Api from './api' import Api from "./api";
import Add from './add' import Add from "./add";
import Edit from './edit' import Edit from "./edit";
import Detail from './detail' import Detail from "./detail";
import Search from './search' import Search from "./search";
export default { export default {
name: 'list', name: "list",
components: { components: {
Add, Add,
Edit, Edit,
...@@ -54,8 +54,7 @@ export default { ...@@ -54,8 +54,7 @@ export default {
action: Api.index, action: Api.index,
easySearch: { easySearch: {
keys: { keys: {
op: op: "name,telephone",
'name,telephone',
value: null value: null
} }
}, },
...@@ -65,258 +64,262 @@ export default { ...@@ -65,258 +64,262 @@ export default {
deletelModal: false, deletelModal: false,
curId: 0, curId: 0,
columns: [ columns: [
{ key: 'id', title: this.l('id'), hide: true, align: 'left' }, { key: "id", title: this.l("id"), hide: true, align: "left" },
{ {
key: 'creationTime', key: "creationTime",
title: this.l('creationTime'), title: this.l("creationTime"),
hide: true, hide: true,
align: 'left' align: "left"
}, },
{ {
key: 'creatorUserId', key: "creatorUserId",
title: this.l('creatorUserId'), title: this.l("creatorUserId"),
hide: true, hide: true,
align: 'left' align: "left"
}, },
{ {
key: 'lastModificationTime', key: "lastModificationTime",
title: this.l('lastModificationTime'), title: this.l("lastModificationTime"),
hide: true, hide: true,
align: 'left' align: "left"
}, },
{ {
key: 'lastModifierUserId', key: "lastModifierUserId",
title: this.l('lastModifierUserId'), title: this.l("lastModifierUserId"),
hide: true, hide: true,
align: 'left' align: "left"
}, },
{ {
key: 'isDeleted', key: "isDeleted",
title: this.l('isDeleted'), title: this.l("isDeleted"),
hide: true, hide: true,
align: 'left' align: "left"
}, },
{ {
key: 'deletionTime', key: "deletionTime",
title: this.l('deletionTime'), title: this.l("deletionTime"),
hide: true, hide: true,
align: 'left' align: "left"
}, },
{ {
key: 'deleterUserId', key: "deleterUserId",
title: this.l('deleterUserId'), title: this.l("deleterUserId"),
hide: true, hide: true,
align: 'left' align: "left"
}, },
{ {
key: 'name', key: "name",
title: this.l('name'), title: this.l("name"),
align: 'left', align: "left",
easy: true, easy: true,
high: true, high: true,
width: 160,
tooltip: true tooltip: true
}, },
{ {
key: 'abbre', key: "abbre",
title: this.l('abbre'), title: this.l("abbre"),
align: 'left', align: "left",
easy: true, easy: true,
high: true high: true,
hide: true
}, },
{ {
key: 'address', key: "address",
title: this.l('address'), title: this.l("address"),
align: 'left', align: "left",
easy: true, easy: true,
high: true, high: true,
width: 120, width: 120,
tooltip: true, tooltip: true,
hide:true, hide: true
}, },
{ {
key: 'principal', key: "principal",
title: this.l('principal'), title: this.l("principal"),
align: 'left', align: "left",
easy: true, easy: true,
high: true high: true
}, },
{ {
key: 'telephone', key: "telephone",
title: this.l('telephone'), title: this.l("telephone"),
align: 'left', align: "left",
easy: true, easy: true,
high: true high: true
}, },
{ {
key: 'mobile', key: "mobile",
title: this.l('mobile'), title: this.l("mobile"),
align: 'left', align: "left",
easy: true, easy: true,
high: true high: true
}, },
{ {
key: 'type', key: "type",
title: this.l('type'), title: this.l("type"),
align: 'left', align: "left",
easy: true, easy: true,
high: true high: true,
hide: true
}, },
{ {
key: 'area', key: "area",
title: this.l('area'), title: this.l("area"),
align: 'left', align: "left",
easy: true, easy: true,
high: true high: true,
hide: true
}, },
{ {
key: 'isInform', key: "isInform",
title: this.l('isInform'), title: this.l("isInform"),
align: 'center', align: "center",
high: true, high: true,
code: 'crm.customer.isInform', code: "crm.customer.isInform",
width:120, width: 120
}, },
{ {
key: 'status', key: "status",
title: this.l('status'), title: this.l("status"),
align: 'center', align: "center",
high: true, high: true,
code: 'crm.customer.status', code: "crm.customer.status",
width:120, width: 120
}, },
{ {
key: 'notes', key: "notes",
title: this.l('notes'), title: this.l("notes"),
align: 'left', align: "left",
easy: true, easy: true,
high: true, high: true,
tooltip: true, tooltip: true,
hide:true, hide: true
}, },
{ {
key: 'code', key: "code",
title: this.l('code'), title: this.l("code"),
align: 'left', align: "left",
easy: true, easy: true,
high: true high: true,
hide: true
}, },
{ {
key: 'trade', key: "trade",
title: this.l('trade'), title: this.l("trade"),
align: 'left', align: "left",
easy: true, easy: true,
high: true high: true,
hide: true
}, },
{ {
title: '操作', title: "操作",
key: 'action', key: "action",
width: 180, width: 180,
align: 'center', align: "center",
render: (h, params) => { render: (h, params) => {
return h('div', { class: 'action' }, [ return h("div", { class: "action" }, [
h( h(
'op', "op",
{ {
attrs: { oprate: 'detail' }, attrs: { oprate: "detail" },
on: { click: () => this.detail(params.row.id) } on: { click: () => this.detail(params.row.id) }
}, },
'查看' "查看"
), ),
h( h(
'op', "op",
{ {
attrs: { oprate: 'edit' }, attrs: { oprate: "edit" },
on: { click: () => this.edit(params.row.id) } on: { click: () => this.edit(params.row.id) }
}, },
'编辑' "编辑"
), ),
h( h(
'op', "op",
{ {
attrs: { oprate: 'remove' }, attrs: { oprate: "remove" },
on: { click: () => this.remove(params.row.id) } on: { click: () => this.remove(params.row.id) }
}, },
'删除' "删除"
), ),
h( h(
'op', "op",
{ {
attrs: { oprate: 'detail' }, attrs: { oprate: "detail" },
on: { click: () => this.goShop(params.row.id) } on: { click: () => this.goShop(params.row.id) }
}, },
'部门信息' "部门信息"
) )
]) ]);
} }
} }
] ]
} };
}, },
mounted() { mounted() {
console.log(this) console.log(this);
}, },
async fetch({ store, params }) { async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
methods: { methods: {
addOk() { addOk() {
this.$refs.grid.load() this.$refs.grid.load();
this.addModal = false this.addModal = false;
this.detailModal = false this.detailModal = false;
this.editModal = false this.editModal = false;
this.curId = 0 this.curId = 0;
}, },
search() { search() {
this.$refs.grid.reload(this.easySearch) this.$refs.grid.reload(this.easySearch);
}, },
detail(id) { detail(id) {
setTimeout(() => { setTimeout(() => {
this.detailModal = true this.detailModal = true;
}, 400) }, 400);
this.curId = id this.curId = id;
}, },
edit(id) { edit(id) {
setTimeout(() => { setTimeout(() => {
this.editModal = true this.editModal = true;
}, 400) }, 400);
this.curId = id this.curId = id;
}, },
remove(id) { remove(id) {
this.deletelModal = true this.deletelModal = true;
this.curId = id this.curId = id;
}, },
removeOk() { removeOk() {
Api.delete({ id: this.curId }).then((r) => { Api.delete({ id: this.curId }).then(r => {
if (r.success) { if (r.success) {
this.$refs.grid.load() this.$refs.grid.load();
this.deletelModal = false this.deletelModal = false;
this.$Message.success('删除成功') this.$Message.success("删除成功");
} }
}) });
}, },
removeCancel() { removeCancel() {
this.deletelModal = false this.deletelModal = false;
}, },
cancel() { cancel() {
this.curId = 0 this.curId = 0;
this.addModal = false this.addModal = false;
this.detailModal = false this.detailModal = false;
this.editModal = false this.editModal = false;
this.deletedlModal = false this.deletedlModal = false;
}, },
goShop(id) { goShop(id) {
this.$router.push({ this.$router.push({
name: 'crm-customer-shopIndex', name: "crm-customer-shopIndex",
params: { customerId: id } params: { customerId: id }
}) });
}, },
l(key) { l(key) {
let vkey = 'Customer' + '.' + key let vkey = "Customer" + "." + key;
return this.$t(vkey) || key return this.$t(vkey) || key;
} }
} }
} };
</script> </script>
<style lang="less"></style> <style lang="less"></style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment