|
@@ -55,28 +55,21 @@ export default {
|
|
|
this.search();
|
|
|
},
|
|
|
methods: {
|
|
|
- ...users(['query', 'delete', 'update']),
|
|
|
+ ...users(['query', 'delete', 'update', 'userquery']),
|
|
|
...exportuser({ exportuserQuery: 'query' }),
|
|
|
- async search({ ...info } = {}) {
|
|
|
+ async search({ skip = 0, limit = 10, pid = '', ...info } = {}) {
|
|
|
if (this.user.code.length == 3) {
|
|
|
- const res = await this.query({ ...info });
|
|
|
- const resTwo = await this.exportuserQuery({ ...info });
|
|
|
- var newData = res.data.concat(resTwo.data);
|
|
|
- if (this.$checkRes(newData)) {
|
|
|
- var arr = newData.filter(item => item.pid == undefined && item.status != '3');
|
|
|
- console.log(arr);
|
|
|
- this.$set(this, `list`, arr);
|
|
|
- this.$set(this, `total`, arr.length);
|
|
|
+ const res = await this.userquery({ skip, limit, pid, ...info });
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ console.log(res);
|
|
|
+ this.$set(this, `list`, res.data);
|
|
|
+ this.$set(this, `total`, res.total);
|
|
|
}
|
|
|
} else {
|
|
|
- const res = await this.query({ code: this.user.code, ...info });
|
|
|
- const resTwo = await this.exportuserQuery({ code: this.user.code, ...info });
|
|
|
- var newData = res.data.concat(resTwo.data);
|
|
|
- if (this.$checkRes(newData)) {
|
|
|
- var arr = newData.filter(item => item.pid == undefined && item.status != '3');
|
|
|
- console.log(arr);
|
|
|
- this.$set(this, `list`, arr);
|
|
|
- this.$set(this, `total`, arr.length);
|
|
|
+ const res = await this.userquery({ skip, limit, pid, code: this.user.code, ...info });
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$set(this, `list`, res.data);
|
|
|
+ this.$set(this, `total`, res.total);
|
|
|
}
|
|
|
}
|
|
|
},
|