refector: 去除getuserrange方法
This commit is contained in:
parent
9737ffa89b
commit
e2bb6ac06f
|
@ -169,7 +169,6 @@
|
||||||
uni.setStorageSync('mySecret', JSON.stringify(mySecret))
|
uni.setStorageSync('mySecret', JSON.stringify(mySecret))
|
||||||
}).catch(e => {})
|
}).catch(e => {})
|
||||||
// #endif
|
// #endif
|
||||||
that.getUserRange();
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
ranStr(e) {
|
ranStr(e) {
|
||||||
|
@ -190,60 +189,6 @@
|
||||||
codeChange(text) {
|
codeChange(text) {
|
||||||
this.codeTips = text;
|
this.codeTips = text;
|
||||||
},
|
},
|
||||||
getUserRange() {
|
|
||||||
let that = this;
|
|
||||||
that.$u.api.deptList({
|
|
||||||
page: 0,
|
|
||||||
type__in: 'rparty,dept',
|
|
||||||
query: '{id, name, parent, type}'
|
|
||||||
}).then(res => {
|
|
||||||
let list1 = res;
|
|
||||||
let list2 = [];
|
|
||||||
let reqList = [];
|
|
||||||
list1.forEach(function(item) {
|
|
||||||
reqList.push(that.$u.api.userList({
|
|
||||||
page: 0,
|
|
||||||
belong_dept: item.id,
|
|
||||||
is_active: true,
|
|
||||||
query: '{id, name, belong_dept}'
|
|
||||||
}))
|
|
||||||
})
|
|
||||||
Promise.all(reqList).then(res => {
|
|
||||||
for (let i = 0; i < res.length; i++) {
|
|
||||||
list1[i].children = res[i]
|
|
||||||
}
|
|
||||||
list1.forEach(item => {
|
|
||||||
if (item.type == 'dept') {
|
|
||||||
list2.push({
|
|
||||||
...item
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
that.$u.vuex('vuex_userRange', that.parseData(list1))
|
|
||||||
that.$u.vuex('vuex_userRange2', that.parseData(list2))
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
parseData(data) {
|
|
||||||
// * 先生成parent建立父子关系
|
|
||||||
const obj = {};
|
|
||||||
data.forEach((item) => {
|
|
||||||
obj[item.id] = item;
|
|
||||||
});
|
|
||||||
const parentList = [];
|
|
||||||
data.forEach((item) => {
|
|
||||||
const parent = obj[item.parent];
|
|
||||||
if (parent) {
|
|
||||||
// * 当前项有父节点
|
|
||||||
parent.children = parent.children || [];
|
|
||||||
parent.children.unshift(item);
|
|
||||||
} else {
|
|
||||||
parentList.push(item);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return parentList;
|
|
||||||
},
|
|
||||||
|
|
||||||
// 获取验证码
|
// 获取验证码
|
||||||
getCode(e) {
|
getCode(e) {
|
||||||
// debugger;
|
// debugger;
|
||||||
|
|
|
@ -84,25 +84,8 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
onShow() {
|
onShow() {
|
||||||
// this.getUserRange();
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//获取用户
|
|
||||||
getUserRange() {
|
|
||||||
let that = this;
|
|
||||||
this.$u.api.vmVisitor({
|
|
||||||
page: 0
|
|
||||||
}).then(res => {
|
|
||||||
that.userRange = [];
|
|
||||||
res.forEach(item => {
|
|
||||||
let obj = {};
|
|
||||||
obj = item;
|
|
||||||
obj.checked = false;
|
|
||||||
that.userRange.push(obj)
|
|
||||||
})
|
|
||||||
|
|
||||||
})
|
|
||||||
},
|
|
||||||
select(row) {},
|
select(row) {},
|
||||||
goBack() {
|
goBack() {
|
||||||
uni.navigateBack({
|
uni.navigateBack({
|
||||||
|
|
|
@ -34,10 +34,6 @@
|
||||||
<text type="text" >{{worker_name}}</text>
|
<text type="text" >{{worker_name}}</text>
|
||||||
<uni-icons style="position: absolute; right: 0;" type="arrowright" color="#999999"/>
|
<uni-icons style="position: absolute; right: 0;" type="arrowright" color="#999999"/>
|
||||||
</view>
|
</view>
|
||||||
<!-- <ba-tree-picker ref="workerPicker" :multiple='false' @select-change="selectChange" title="选择作业人员"
|
|
||||||
:localdata="vuex_userRange" valueKey="id" textKey="name" childrenKey="children" :selectParent='false'/>
|
|
||||||
<text type="text">{{worker_name}}</text>
|
|
||||||
<uni-icons style="position: absolute; right: 0;" @click="showPicker" type="arrowright" color="#999999"/> -->
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
@ -63,7 +59,7 @@
|
||||||
</form>
|
</form>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="apply-info" style="min-height: fit-content;display: flex;">
|
<view class="apply-info" style="min-height: fit-content; display: flex;">
|
||||||
<button type="primary" plain="true" style="width: 25%;" @click="goBack">上一步</button>
|
<button type="primary" plain="true" style="width: 25%;" @click="goBack">上一步</button>
|
||||||
<button v-for=" item in initform.transitions" :key="item.id" @click="submitticket(item.id)" type="primary" style="width: 25%;" v-if="!showN">{{item.name}}
|
<button v-for=" item in initform.transitions" :key="item.id" @click="submitticket(item.id)" type="primary" style="width: 25%;" v-if="!showN">{{item.name}}
|
||||||
</button>
|
</button>
|
||||||
|
@ -390,21 +386,15 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.dialogCont {
|
.dialogCont {
|
||||||
/* width: 80vw;
|
width: 90vw;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
left: 10vw;
|
left: 5vw;
|
||||||
transform: translateY(-50%);
|
transform: translateY(-50%);
|
||||||
padding: 20rpx;
|
padding: 20rpx;
|
||||||
border-radius: 20rpx; */
|
border-radius: 20rpx;
|
||||||
width: 100vw;
|
|
||||||
position: absolute;
|
|
||||||
top: 61px;
|
|
||||||
height: 100vh;
|
|
||||||
padding: 30rpx;
|
|
||||||
background-color: #ffffff;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.dialogTitle {
|
.dialogTitle {
|
||||||
|
|
|
@ -248,7 +248,6 @@
|
||||||
this.getOplcates();
|
this.getOplcates();
|
||||||
this.getdept();
|
this.getdept();
|
||||||
this.getRange();
|
this.getRange();
|
||||||
// this.getUserRange();
|
|
||||||
this.getHeader();
|
this.getHeader();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -397,25 +396,6 @@
|
||||||
this.range = range
|
this.range = range
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
//获取用户
|
|
||||||
getUserRange() {
|
|
||||||
this.$u.api.userList({
|
|
||||||
page: 0
|
|
||||||
}).then(res => {
|
|
||||||
let user = [];
|
|
||||||
let obj = {};
|
|
||||||
res.forEach(item => {
|
|
||||||
obj = {
|
|
||||||
value: null,
|
|
||||||
text: ''
|
|
||||||
};
|
|
||||||
obj.value = item.id;
|
|
||||||
obj.text = item.name;
|
|
||||||
user.push(obj);
|
|
||||||
})
|
|
||||||
this.userRange = user
|
|
||||||
})
|
|
||||||
},
|
|
||||||
//获取dept
|
//获取dept
|
||||||
getdept() {
|
getdept() {
|
||||||
let that = this;
|
let that = this;
|
||||||
|
|
|
@ -240,7 +240,6 @@
|
||||||
this.getOplcates();
|
this.getOplcates();
|
||||||
this.getdept();
|
this.getdept();
|
||||||
this.getRange();
|
this.getRange();
|
||||||
// this.getUserRange();
|
|
||||||
this.getHeader();
|
this.getHeader();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -390,25 +389,6 @@
|
||||||
this.range = range
|
this.range = range
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
//获取用户
|
|
||||||
getUserRange() {
|
|
||||||
this.$u.api.userList({
|
|
||||||
page: 0
|
|
||||||
}).then(res => {
|
|
||||||
let user = [];
|
|
||||||
let obj = {};
|
|
||||||
res.forEach(item => {
|
|
||||||
obj = {
|
|
||||||
value: null,
|
|
||||||
text: ''
|
|
||||||
};
|
|
||||||
obj.value = item.id;
|
|
||||||
obj.text = item.name;
|
|
||||||
user.push(obj);
|
|
||||||
})
|
|
||||||
this.userRange = user
|
|
||||||
})
|
|
||||||
},
|
|
||||||
//获取dept
|
//获取dept
|
||||||
getdept() {
|
getdept() {
|
||||||
let that = this;
|
let that = this;
|
||||||
|
|
|
@ -243,7 +243,6 @@
|
||||||
this.getOplcates();
|
this.getOplcates();
|
||||||
this.getdept();
|
this.getdept();
|
||||||
this.getRange();
|
this.getRange();
|
||||||
// this.getUserRange();
|
|
||||||
this.getHeader();
|
this.getHeader();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -392,25 +391,6 @@
|
||||||
this.range = range
|
this.range = range
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
//获取用户
|
|
||||||
getUserRange() {
|
|
||||||
this.$u.api.userList({
|
|
||||||
page: 0
|
|
||||||
}).then(res => {
|
|
||||||
let user = [];
|
|
||||||
let obj = {};
|
|
||||||
res.forEach(item => {
|
|
||||||
obj = {
|
|
||||||
value: null,
|
|
||||||
text: ''
|
|
||||||
};
|
|
||||||
obj.value = item.id;
|
|
||||||
obj.text = item.name;
|
|
||||||
user.push(obj);
|
|
||||||
})
|
|
||||||
this.userRange = user
|
|
||||||
})
|
|
||||||
},
|
|
||||||
//获取dept
|
//获取dept
|
||||||
getdept() {
|
getdept() {
|
||||||
let that = this;
|
let that = this;
|
||||||
|
|
|
@ -350,7 +350,6 @@
|
||||||
this.getOplcates();
|
this.getOplcates();
|
||||||
this.getdept();
|
this.getdept();
|
||||||
this.getRange();
|
this.getRange();
|
||||||
// this.getUserRange();
|
|
||||||
this.getHeader();
|
this.getHeader();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -502,25 +501,6 @@
|
||||||
this.range = range
|
this.range = range
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
//获取用户
|
|
||||||
getUserRange() {
|
|
||||||
this.$u.api.userList({
|
|
||||||
page: 0
|
|
||||||
}).then(res => {
|
|
||||||
let user = [];
|
|
||||||
let obj = {};
|
|
||||||
res.forEach(item => {
|
|
||||||
obj = {
|
|
||||||
value: null,
|
|
||||||
text: ''
|
|
||||||
};
|
|
||||||
obj.value = item.id;
|
|
||||||
obj.text = item.name;
|
|
||||||
user.push(obj);
|
|
||||||
})
|
|
||||||
this.userRange = user
|
|
||||||
})
|
|
||||||
},
|
|
||||||
//获取dept
|
//获取dept
|
||||||
getdept() {
|
getdept() {
|
||||||
let that = this;
|
let that = this;
|
||||||
|
|
|
@ -172,7 +172,7 @@
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.getHeader();
|
this.getHeader();
|
||||||
this.getUserRange();
|
this.getVisitorRange();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getHeader() {
|
getHeader() {
|
||||||
|
@ -190,7 +190,7 @@
|
||||||
this.formData.test_report = data.path;
|
this.formData.test_report = data.path;
|
||||||
},
|
},
|
||||||
//获取所有已注册游客
|
//获取所有已注册游客
|
||||||
getUserRange() {
|
getVisitorRange() {
|
||||||
let that = this;
|
let that = this;
|
||||||
that.$u.api.vmVisitor({
|
that.$u.api.vmVisitor({
|
||||||
page: 0
|
page: 0
|
||||||
|
|
Loading…
Reference in New Issue