|
@@ -58,13 +58,24 @@ export default {
|
|
|
...users(['query', 'delete', 'update']),
|
|
|
...exportuser({ exportuserQuery: 'query' }),
|
|
|
async search({ skip = 0, limit = 10, ...info } = {}) {
|
|
|
- const res = await this.query({ skip, limit, ...info });
|
|
|
- const resTwo = await this.exportuserQuery({ skip, limit, ...info });
|
|
|
- var newData = res.data.concat(resTwo.data);
|
|
|
- if (this.$checkRes(newData)) {
|
|
|
- var arr = newData.filter(item => item.pid == undefined && item.status != '3');
|
|
|
- this.$set(this, `list`, arr);
|
|
|
- this.$set(this, `total`, arr.length);
|
|
|
+ if (this.user.code.length == 3) {
|
|
|
+ const res = await this.query({ skip, limit, ...info });
|
|
|
+ const resTwo = await this.exportuserQuery({ skip, limit, ...info });
|
|
|
+ var newData = res.data.concat(resTwo.data);
|
|
|
+ if (this.$checkRes(newData)) {
|
|
|
+ var arr = newData.filter(item => item.pid == undefined && item.status != '3');
|
|
|
+ this.$set(this, `list`, arr);
|
|
|
+ this.$set(this, `total`, arr.length);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ const res = await this.query({ skip, limit, code: this.user.code, ...info });
|
|
|
+ const resTwo = await this.exportuserQuery({ skip, limit, 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');
|
|
|
+ this.$set(this, `list`, arr);
|
|
|
+ this.$set(this, `total`, arr.length);
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
toEdit({ data }) {
|
|
@@ -76,6 +87,7 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
computed: {
|
|
|
+ ...mapState(['user']),
|
|
|
pageTitle() {
|
|
|
return `${this.$route.meta.title}`;
|
|
|
},
|