Commit 566f9ebf authored by rencs's avatar rencs

9.3 后台列表

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