优化代码

This commit is contained in:
java110 2023-07-27 10:40:09 +08:00
parent 246cc5625d
commit 1776347723

View File

@ -1,7 +1,7 @@
<template> <template>
<view class="select-single-resource" v-if="showModel"> <view class="select-single-resource" v-if="showModel">
<view> <view>
<view class="cu-form-group margin-top"> <!-- <view class="cu-form-group margin-top">
<view class="title">公司</view> <view class="title">公司</view>
<picker :value="orgIndex" :range="orgCloums" :range-key="'orgName'" @change="orgChange"> <picker :value="orgIndex" :range="orgCloums" :range-key="'orgName'" @change="orgChange">
<view class="picker"> <view class="picker">
@ -16,7 +16,7 @@
{{depCloums[depIndex].orgName}} {{depCloums[depIndex].orgName}}
</view> </view>
</picker> </picker>
</view> </view> -->
<view class="cu-form-group margin-top"> <view class="cu-form-group margin-top">
<view class="title">员工</view> <view class="title">员工</view>
<picker :value="staffIndex" :range="staffCloums" :range-key="'name'" @change="staffChange"> <picker :value="staffIndex" :range="staffCloums" :range-key="'name'" @change="staffChange">
@ -80,7 +80,8 @@
mounted() { mounted() {
this.communityId = getCurrentCommunity().communityId; this.communityId = getCurrentCommunity().communityId;
this._loadOrgList(); //this._loadOrgList();
this._loadStaffList();
}, },
methods: { methods: {
@ -123,9 +124,9 @@
let _data = { let _data = {
page: 1, page: 1,
row: 50, row: 50,
parentOrgId: this.selectedOrg.orgId, // parentOrgId: this.selectedOrg.orgId,
departmentOrgId: this.selectedDep.orgId, // departmentOrgId: this.selectedDep.orgId,
orgId: this.selectedDep.orgId, // orgId: this.selectedDep.orgId,
communityId: this.communityId, communityId: this.communityId,
}; };
queryStaffListInfo(this, _data) queryStaffListInfo(this, _data)
@ -170,7 +171,7 @@
staffChange: function(e){ staffChange: function(e){
this.staffIndex = e.target.value // this.staffIndex = e.target.value //
this.selectedStaff = ''; this.selectedStaff = '';
if (this.orgIndex == 0) { if (this.staffIndex == 0) {
return; return;
} }
let selected = this.staffCloums[this.staffIndex] // let selected = this.staffCloums[this.staffIndex] //