排序
This commit is contained in:
parent
cd75300bc5
commit
3c4c0ec67c
@ -8,7 +8,7 @@ CREATE OR REPLACE VIEW real_virtual_relations AS
|
|||||||
COUNT(*) as times,
|
COUNT(*) as times,
|
||||||
MAX(v.created_at) as updated_at
|
MAX(v.created_at) as updated_at
|
||||||
FROM real_order_cards_partition as r
|
FROM real_order_cards_partition as r
|
||||||
JOIN virtual_order_cards as v ON v.id = r.virtual_order_id
|
JOIN virtual_orders as v ON v.id = r.virtual_order_id
|
||||||
WHERE r.virtual_order_id <> 0
|
WHERE r.virtual_order_id <> 0
|
||||||
GROUP BY r.type,r.company_id,r.package_id,v.company_id,v.package_id;
|
GROUP BY r.type,r.company_id,r.package_id,v.company_id,v.package_id;
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@ const actions = {
|
|||||||
},
|
},
|
||||||
getRelations(context, params) {
|
getRelations(context, params) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
if (JSON.stringify(context.state.relationParams) == JSON.stringify(params)) {
|
if (JSON.stringify(context.state.relationParams) == JSON.stringify(params) && context.state.relations.length) {
|
||||||
return resolve(context.state.relations);
|
return resolve(context.state.relations);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,10 +81,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (this.selectedMapped.length && !Object.keys(this.order_group).length) {
|
||||||
this.selectedMapped.length &&
|
|
||||||
!Object.keys(this.order_group).length
|
|
||||||
) {
|
|
||||||
this.setParamsByReal(this.selected);
|
this.setParamsByReal(this.selected);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -93,18 +90,6 @@ export default {
|
|||||||
this.selectGroup(this.order_group[key], key);
|
this.selectGroup(this.order_group[key], key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
counts(value) {
|
|
||||||
if (value) {
|
|
||||||
if (
|
|
||||||
this.selectedMapped.length &&
|
|
||||||
!Object.keys(this.order_group).length
|
|
||||||
) {
|
|
||||||
this.setParamsByReal(this.selected);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.params.counts = value;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -291,6 +276,8 @@ export default {
|
|||||||
this.setParamsByReal(item);
|
this.setParamsByReal(item);
|
||||||
},
|
},
|
||||||
setParamsByReal(array) {
|
setParamsByReal(array) {
|
||||||
|
this.params.counts = this.counts;
|
||||||
|
|
||||||
let tmp = array.map(el => {
|
let tmp = array.map(el => {
|
||||||
return el.company_id + "_" + el.package_id;
|
return el.company_id + "_" + el.package_id;
|
||||||
}).filter((v, i, a) => {
|
}).filter((v, i, a) => {
|
||||||
@ -330,12 +317,12 @@ export default {
|
|||||||
case "支付宝":
|
case "支付宝":
|
||||||
this.params.pay_channel = "alipay";
|
this.params.pay_channel = "alipay";
|
||||||
break;
|
break;
|
||||||
// case '余额支付':
|
// case '余额支付':
|
||||||
// this.params.pay_channel = 'account';
|
// this.params.pay_channel = 'account';
|
||||||
// break;
|
// break;
|
||||||
// case '天猫续费':
|
// case '天猫续费':
|
||||||
// this.params.pay_channel = 'tmall';
|
// this.params.pay_channel = 'tmall';
|
||||||
// break;
|
// break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -374,68 +361,73 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let relations = this.relations.filter(el => {
|
this.$store.dispatch("getRelations").then(res => {
|
||||||
return (
|
let relations = res.filter(el => {
|
||||||
array.findIndex(e => {
|
return orders.findIndex(e => {
|
||||||
return (
|
return (e.company_id === el.real_company_id && e.package_id === el.real_package_id);
|
||||||
e.company_id === el.real_company_id &&
|
}) !== -1;
|
||||||
e.package_id === el.real_package_id
|
});
|
||||||
);
|
|
||||||
}) !== -1
|
if (relations.length) {
|
||||||
);
|
let mappedCompany = this.companies.map((el, i) => {
|
||||||
|
return { index: i, company_id: el.id };
|
||||||
|
});
|
||||||
|
|
||||||
|
mappedCompany.map(el => {
|
||||||
|
el.display = '0';
|
||||||
|
let relation = relations.find(e => {
|
||||||
|
return e.virtual_company_id === el.company_id;
|
||||||
|
});
|
||||||
|
|
||||||
|
if (relation) {
|
||||||
|
el.display = relation.updated_at;
|
||||||
|
}
|
||||||
|
|
||||||
|
return el;
|
||||||
|
});
|
||||||
|
|
||||||
|
mappedCompany = mappedCompany.sort((a, b) => {
|
||||||
|
return a.display > b.display ? -1 : a.display < b.display ? 1 : 0;
|
||||||
|
});
|
||||||
|
|
||||||
|
this.companies = mappedCompany.map(el => {
|
||||||
|
return this.companies[el.index];
|
||||||
|
});
|
||||||
|
|
||||||
|
if (this.companies.length) {
|
||||||
|
this.params.company_id = this.companies[0].id;
|
||||||
|
}
|
||||||
|
|
||||||
|
let mappedPackage = this.completePackagesFilter.map((el, i) => {
|
||||||
|
return { index: i, package_id: el.id };
|
||||||
|
});
|
||||||
|
|
||||||
|
mappedPackage = mappedPackage.map(el => {
|
||||||
|
el.display = '0';
|
||||||
|
let relation = relations.find(e => {
|
||||||
|
return e.virtual_package_id === el.package_id;
|
||||||
|
});
|
||||||
|
|
||||||
|
if (relation) {
|
||||||
|
el.display = relation.updated_at;
|
||||||
|
}
|
||||||
|
|
||||||
|
return el;
|
||||||
|
});
|
||||||
|
|
||||||
|
mappedPackage.sort((a, b) => {
|
||||||
|
return a.display > b.display ? -1 : a.display < b.display ? 1 : 0;
|
||||||
|
});
|
||||||
|
|
||||||
|
this.completePackagesFilter = mappedPackage.map(el => {
|
||||||
|
return this.completePackagesFilter[el.index];
|
||||||
|
});
|
||||||
|
|
||||||
|
if (this.completePackagesFilter.length) {
|
||||||
|
this.params.package_id = this.completePackagesFilter[0].id;
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (relations.length) {
|
|
||||||
let mappedCompany = this.companies.map(el, i => {
|
|
||||||
return { index: i, company_id: el.id };
|
|
||||||
});
|
|
||||||
|
|
||||||
mappedCompany = mappedCompany.map(el => {
|
|
||||||
el.display = 0;
|
|
||||||
let relation = relations.find(e => {
|
|
||||||
return e.virtual_company_id === el.id;
|
|
||||||
});
|
|
||||||
|
|
||||||
if (relation) {
|
|
||||||
el.display = relation.updated_at;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
mappedCompany.sort((a, b) => {
|
|
||||||
return a.display > b.display ? 1 : a.display < b.display ? -1 : 0;
|
|
||||||
});
|
|
||||||
|
|
||||||
this.companies = mappedCompany.map(el => {
|
|
||||||
return this.companies[el.index];
|
|
||||||
});
|
|
||||||
|
|
||||||
this.params.company_id = this.companies[0].company_id;
|
|
||||||
|
|
||||||
let mappedPackage = this.completePackagesFilter.map(el, i => {
|
|
||||||
return { index: i, package_id: el.id };
|
|
||||||
});
|
|
||||||
|
|
||||||
mappedPackage = mappedPackage.map(el => {
|
|
||||||
el.display = 0;
|
|
||||||
let relation = relations.find(e => {
|
|
||||||
return e.virtual_package_id === el.id;
|
|
||||||
});
|
|
||||||
|
|
||||||
if (relation) {
|
|
||||||
el.display = relation.updated_at;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
mappedPackage.sort((a, b) => {
|
|
||||||
return a.display > b.display ? 1 : a.display < b.display ? -1 : 0;
|
|
||||||
});
|
|
||||||
|
|
||||||
this.completePackagesFilter = mappedPackage.map(el => {
|
|
||||||
return this.completePackagesFilter[el.index];
|
|
||||||
});
|
|
||||||
|
|
||||||
this.params.package_id = this.completePackagesFilter[0].package_id;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
handelSuccess() {
|
handelSuccess() {
|
||||||
if (Object.keys(this.order_group).length >= 1) {
|
if (Object.keys(this.order_group).length >= 1) {
|
||||||
|
2
public/js/app.fb2ddb4b.js
Normal file
2
public/js/app.fb2ddb4b.js
Normal file
File diff suppressed because one or more lines are too long
1
public/js/app.fb2ddb4b.js.map
Normal file
1
public/js/app.fb2ddb4b.js.map
Normal file
File diff suppressed because one or more lines are too long
15
public/js/chunk-6d96644c.aac85e3c.js
Normal file
15
public/js/chunk-6d96644c.aac85e3c.js
Normal file
File diff suppressed because one or more lines are too long
1
public/js/chunk-6d96644c.aac85e3c.js.map
Normal file
1
public/js/chunk-6d96644c.aac85e3c.js.map
Normal file
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
|||||||
<!DOCTYPE html><html><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=\favicon.ico><script src=\config.js></script><title></title><link href=/css/chunk-6d96644c.e151cd00.css rel=prefetch><link href=/css/chunk-996b1e80.5cadf3d0.css rel=prefetch><link href=/js/chunk-00ae0766.3874cd10.js rel=prefetch><link href=/js/chunk-07a274ec.c3ad5dec.js rel=prefetch><link href=/js/chunk-6d96644c.347f439e.js rel=prefetch><link href=/js/chunk-996b1e80.d3b45e46.js rel=prefetch><link href=/css/app.d71a8195.css rel=preload as=style><link href=/css/chunk-vendors.3c3b2e85.css rel=preload as=style><link href=/js/app.456c05b7.js rel=preload as=script><link href=/js/chunk-vendors.ed6443e8.js rel=preload as=script><link href=/css/chunk-vendors.3c3b2e85.css rel=stylesheet><link href=/css/app.d71a8195.css rel=stylesheet></head><body><noscript><strong>很抱歉,如果没有启用JavaScript,程序不能正常工作,若要继续使用请启用它。</strong></noscript><div id=app></div><script src=/js/chunk-vendors.ed6443e8.js></script><script src=/js/app.456c05b7.js></script></body></html>
|
<!DOCTYPE html><html><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=\favicon.ico><script src=\config.js></script><title></title><link href=/css/chunk-6d96644c.e151cd00.css rel=prefetch><link href=/css/chunk-996b1e80.5cadf3d0.css rel=prefetch><link href=/js/chunk-00ae0766.3874cd10.js rel=prefetch><link href=/js/chunk-07a274ec.c3ad5dec.js rel=prefetch><link href=/js/chunk-6d96644c.aac85e3c.js rel=prefetch><link href=/js/chunk-996b1e80.d3b45e46.js rel=prefetch><link href=/css/app.d71a8195.css rel=preload as=style><link href=/css/chunk-vendors.3c3b2e85.css rel=preload as=style><link href=/js/app.fb2ddb4b.js rel=preload as=script><link href=/js/chunk-vendors.ed6443e8.js rel=preload as=script><link href=/css/chunk-vendors.3c3b2e85.css rel=stylesheet><link href=/css/app.d71a8195.css rel=stylesheet></head><body><noscript><strong>很抱歉,如果没有启用JavaScript,程序不能正常工作,若要继续使用请启用它。</strong></noscript><div id=app></div><script src=/js/chunk-vendors.ed6443e8.js></script><script src=/js/app.fb2ddb4b.js></script></body></html>
|
Loading…
x
Reference in New Issue
Block a user