|
@@ -62,10 +62,9 @@ export default {
|
|
|
actions: {
|
|
|
async setBranchs ({ commit, state }, force) {
|
|
|
if ((!state.branchs.length || force === true) && !loadings.commit_branchs) {
|
|
|
- loadings.commit_branchs = true
|
|
|
+ loadings.commit_branchs = getEmployeeOrgan()
|
|
|
try {
|
|
|
- state.branchsLoading = getEmployeeOrgan()
|
|
|
- const res = await getEmployeeOrgan()
|
|
|
+ const res = await loadings.commit_branchs
|
|
|
commit('commit_branchs', res.data)
|
|
|
} catch (error) { }
|
|
|
loadings.commit_branchs = false
|
|
@@ -75,8 +74,7 @@ export default {
|
|
|
if ((!state.subjects.length || force === true) && !loadings.commit_subjects) {
|
|
|
loadings.commit_subjects = getSubject({rows: 9999, tenantId: '1'})
|
|
|
try {
|
|
|
- state.subjectsLoading = true
|
|
|
- const res = await getSubject({rows: 9999, tenantId: '1'})
|
|
|
+ const res = await loadings.commit_subjects
|
|
|
commit('commit_subjects', res.data)
|
|
|
} catch (error) { }
|
|
|
loadings.commit_subjects = false
|
|
@@ -86,8 +84,7 @@ export default {
|
|
|
if ((!state.teachers.length || force === true) && !loadings.commit_teachers) {
|
|
|
loadings.commit_teachers = getTeacher()
|
|
|
try {
|
|
|
- state.teachersLoading =true
|
|
|
- const res = await getTeacher()
|
|
|
+ const res = await loadings.commit_teachers
|
|
|
commit('commit_teachers', res.data)
|
|
|
} catch (error) { }
|
|
|
loadings.commit_teachers = false
|
|
@@ -97,7 +94,6 @@ export default {
|
|
|
if ((!state.schools.length || force === true) && !loadings.commit_schools) {
|
|
|
loadings.commit_schools = getSchool()
|
|
|
try {
|
|
|
- state.schoolsLoading = true
|
|
|
const res = await loadings.commit_schools
|
|
|
commit('commit_schools', res.data)
|
|
|
} catch (error) { }
|
|
@@ -109,8 +105,7 @@ export default {
|
|
|
if ((!state.vipGroupCategory.length || force === true) && !loadings.commit_vip_group_category) {
|
|
|
loadings.commit_vip_group_category = vipGroupCategory()
|
|
|
try {
|
|
|
- state.vipGroupCategoryLoading = true
|
|
|
- const res = await vipGroupCategory()
|
|
|
+ const res = await loadings.commit_vip_group_category
|
|
|
commit('commit_vip_group_category', res.data)
|
|
|
} catch (error) { }
|
|
|
loadings.commit_vip_group_category = false
|
|
@@ -120,7 +115,7 @@ export default {
|
|
|
if ((!state.educations.length || force === true) && !loadings.commit_educations) {
|
|
|
loadings.commit_educations = findEducationUsers()
|
|
|
try {
|
|
|
- const res = await findEducationUsers()
|
|
|
+ const res = await loadings.commit_educations
|
|
|
commit('commit_educations', res.data)
|
|
|
} catch (error) { }
|
|
|
loadings.commit_educations = false
|
|
@@ -130,7 +125,7 @@ export default {
|
|
|
if ((!state.technician.length || force === true) && !loadings.commit_technician) {
|
|
|
loadings.commit_technician = findTechnician()
|
|
|
try {
|
|
|
- const res = await findTechnician()
|
|
|
+ const res = await loadings.commit_technician
|
|
|
commit('commit_technician', res.data)
|
|
|
} catch (error) {}
|
|
|
loadings.commit_technician = false
|