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

客户管理优化

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