Merge branch 'master' of http://8.140.50.127:3000/JSY/jsy-app
This commit is contained in:
commit
96a78290ff
@ -91,9 +91,12 @@
|
||||
} from "@/utils/permission"
|
||||
import store from "@/store"
|
||||
import plugin from "@/plugins"
|
||||
import constant from "@/utils/constant.js"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isFirst:true,
|
||||
user: store.state.user.user,
|
||||
windowHeight: null,
|
||||
defaultCheckedKeys: "",
|
||||
paging: null,
|
||||
@ -122,16 +125,26 @@
|
||||
methods: {
|
||||
/** 查询公司下拉树结构 */
|
||||
getCompanyTree() {
|
||||
const obj = {
|
||||
status: 0,
|
||||
delFlag: "0",
|
||||
companyTypes: [1, 2, 3],
|
||||
}
|
||||
store
|
||||
.dispatch("companyTreeSelect", null)
|
||||
.dispatch("companyTreeSelect", obj)
|
||||
.then(res => {
|
||||
this.treeList = res.data;
|
||||
if (this.treeList && this.treeList.length) {
|
||||
let cache_companyId = uni.getStorageSync("app_companyId")
|
||||
if(cache_companyId){
|
||||
this.defaultCheckedKeys = cache_companyId + "";
|
||||
}else{
|
||||
let companyList = this.treeList[0].children.filter(x => x.id != 100);
|
||||
if (companyList && companyList.length) {
|
||||
this.defaultCheckedKeys = companyList[0].id + "";
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
plugin.modal.msgError(error)
|
||||
@ -192,6 +205,10 @@
|
||||
handleTreeChange(values, currentItem) {
|
||||
this.query.companyGroupIds = "";
|
||||
this.companyGroupId = values;
|
||||
if(!this.isFirst){
|
||||
uni.setStorageSync("app_companyId", this.companyGroupId)
|
||||
}
|
||||
this.isFirst = false;
|
||||
this.selectCompanyObj = currentItem;
|
||||
if (this.all) {
|
||||
this.getCompanyGroupIds();
|
||||
@ -227,6 +244,13 @@
|
||||
this.query.companyGroupIds += this.companyGroupId;
|
||||
}
|
||||
this.getListData();
|
||||
},
|
||||
// 缓存数据
|
||||
setStorage(type, data) {
|
||||
uni.setStorageSync(type, {
|
||||
userId: this.user.userId,
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -119,6 +119,8 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isFirst:true,
|
||||
user: store.state.user.user,
|
||||
defaultCheckedKeys: "",
|
||||
list: [],
|
||||
windowHeight: null,
|
||||
@ -170,16 +172,26 @@
|
||||
methods: {
|
||||
/** 查询公司下拉树结构 */
|
||||
getCompanyTree() {
|
||||
const obj = {
|
||||
status: 0,
|
||||
delFlag: "0",
|
||||
companyTypes: [1, 2, 3],
|
||||
}
|
||||
store
|
||||
.dispatch("companyTreeSelect", null)
|
||||
.dispatch("companyTreeSelect", obj)
|
||||
.then(res => {
|
||||
this.treeList = res.data;
|
||||
if (this.treeList && this.treeList.length) {
|
||||
let cache_companyId = uni.getStorageSync("app_companyId")
|
||||
if(cache_companyId){
|
||||
this.defaultCheckedKeys = cache_companyId + "";
|
||||
}else{
|
||||
let companyList = this.treeList[0].children.filter(x => x.id != 100);
|
||||
if (companyList && companyList.length) {
|
||||
this.defaultCheckedKeys = companyList[0].id + "";
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
plugin.modal.msgError(error)
|
||||
@ -241,6 +253,9 @@
|
||||
handleTreeChange(values, currentItem) {
|
||||
this.query.companyGroupIds = "";
|
||||
this.companyGroupId = values;
|
||||
if(!this.isFirst){
|
||||
uni.setStorageSync("app_companyId", this.companyGroupId)
|
||||
}
|
||||
this.selectCompanyObj = currentItem;
|
||||
if (this.all) {
|
||||
this.getCompanyGroupIds();
|
||||
@ -339,6 +354,13 @@
|
||||
this.query.companyGroupIds += this.companyGroupId;
|
||||
}
|
||||
this.queryList();
|
||||
},
|
||||
// 缓存数据
|
||||
setStorage(type, data) {
|
||||
uni.setStorageSync(type, {
|
||||
userId: this.user.userId,
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user