Commit 566f9ebf authored by rencs's avatar rencs

9.3 后台列表

parent 543b011a
...@@ -259,7 +259,14 @@ ...@@ -259,7 +259,14 @@
</template> </template>
<script type="javascript"> <script type="javascript">
import { page, addObj, getObj, delObj, putObj, companyListById } from "api/admin/user/index"; import {
page,
addObj,
getObj,
delObj,
putObj,
companyListById,
} from "api/admin/user/index";
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
...@@ -401,8 +408,8 @@ export default { ...@@ -401,8 +408,8 @@ export default {
list_All: [], list_All: [],
companys_list: [], companys_list: [],
branchCompany_list: [], // 所属门店列表 branchCompany_list: [], // 所属门店列表
branchCompany_list_select: [],// 全部所属门店 branchCompany_list_select: [], // 全部所属门店
edit_item: {} edit_item: {},
}; };
}, },
created() { created() {
...@@ -445,18 +452,18 @@ export default { ...@@ -445,18 +452,18 @@ export default {
/** /**
* 选择所属公司后--查询所属门店列表 * 选择所属公司后--查询所属门店列表
*/ */
changeCorporation(){ changeCorporation() {
this.form.companyId = undefined // 切换所属公司----所属门店置空 this.form.companyId = undefined; // 切换所属公司----所属门店置空
companyListById({companyId: this.form.corporationId}).then((res) => { companyListById({ companyId: this.form.corporationId }).then((res) => {
if (res.status == 200) { if (res.status == 200) {
this.branchCompany_list = res.data; this.branchCompany_list = res.data;
} else { } else {
this.$notify({ this.$notify({
title: '失败', title: "失败",
message: res.message, message: res.message,
type: 'error', type: "error",
duration: 2000 duration: 2000,
}) });
} }
}); });
}, },
...@@ -467,11 +474,11 @@ export default { ...@@ -467,11 +474,11 @@ export default {
this.companys_list = res.data; this.companys_list = res.data;
} else { } else {
this.$notify({ this.$notify({
title: '失败', title: "失败",
message: res.message, message: res.message,
type: 'error', type: "error",
duration: 2000 duration: 2000,
}) });
} }
}); });
}, },
...@@ -524,8 +531,8 @@ export default { ...@@ -524,8 +531,8 @@ export default {
this.listQuery.companyId = undefined; this.listQuery.companyId = undefined;
} }
page(this.listQuery).then((response) => { page(this.listQuery).then((response) => {
this.list = response.data.rows; this.list = response.data.data;
this.total = response.data.total; this.total = response.data.totalCount;
this.listLoading = false; this.listLoading = false;
}); });
}, },
...@@ -593,18 +600,18 @@ export default { ...@@ -593,18 +600,18 @@ export default {
dataLimit: undefined, //数据权限 dataLimit: undefined, //数据权限
members: [], members: [],
}; };
if(this.form.corporationId) { if (this.form.corporationId) {
// 所属公司 -所属门店 // 所属公司 -所属门店
companyListById({companyId: this.form.corporationId}).then((res) => { companyListById({ companyId: this.form.corporationId }).then((res) => {
if (res.status == 200) { if (res.status == 200) {
this.branchCompany_list = res.data; this.branchCompany_list = res.data;
} else { } else {
this.$notify({ this.$notify({
title: '失败', title: "失败",
message: res.message, message: res.message,
type: 'error', type: "error",
duration: 2000 duration: 2000,
}) });
} }
}); });
} }
...@@ -661,14 +668,15 @@ export default { ...@@ -661,14 +668,15 @@ export default {
// if ( this.form.corporationId == undefined && this.form.companyId == undefined ) { // if ( this.form.corporationId == undefined && this.form.companyId == undefined ) {
// this.form.dataAll = 1; // this.form.dataAll = 1;
// } // }
if(this.form.corporationId == 0 && this.form.companyId == 0){ // 所属公司、所属门店 均为全部 if (this.form.corporationId == 0 && this.form.companyId == 0) {
// 所属公司、所属门店 均为全部
this.form.dataAll = 1; this.form.dataAll = 1;
} else if(this.form.corporationId > 0 && this.form.companyId == 0){ } else if (this.form.corporationId > 0 && this.form.companyId == 0) {
// 选择所属公司 全部门店 // 选择所属公司 全部门店
this.form.dataCorporation = this.form.corporationId; this.form.dataCorporation = this.form.corporationId;
} else if(this.form.corporationId > 0 && this.form.companyId > 0) { } else if (this.form.corporationId > 0 && this.form.companyId > 0) {
this.form.dataAll = undefined; this.form.dataAll = undefined;
this.form.dataCorporation = undefined this.form.dataCorporation = undefined;
this.form.dataCompany = this.form.companyId; this.form.dataCompany = this.form.companyId;
} }
...@@ -729,14 +737,15 @@ export default { ...@@ -729,14 +737,15 @@ export default {
} else { } else {
this.form.password = undefined; this.form.password = undefined;
} }
if(this.form.corporationId == 0 && this.form.companyId == 0){ // 所属公司、所属门店 均为全部 if (this.form.corporationId == 0 && this.form.companyId == 0) {
// 所属公司、所属门店 均为全部
this.form.dataAll = 1; this.form.dataAll = 1;
} else if(this.form.corporationId > 0 && this.form.companyId == 0){ } else if (this.form.corporationId > 0 && this.form.companyId == 0) {
// 选择所属公司 全部门店 // 选择所属公司 全部门店
this.form.dataCorporation = this.form.corporationId; this.form.dataCorporation = this.form.corporationId;
} else if(this.form.corporationId > 0 && this.form.companyId > 0) { } else if (this.form.corporationId > 0 && this.form.companyId > 0) {
this.form.dataAll = undefined; this.form.dataAll = undefined;
this.form.dataCorporation = undefined this.form.dataCorporation = undefined;
this.form.dataCompany = this.form.companyId; this.form.dataCompany = this.form.companyId;
} }
putObj(this.form.id, this.form).then((response) => { putObj(this.form.id, this.form).then((response) => {
......
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