Commit 941cf41e authored by chenqikuai's avatar chenqikuai

update

parent a3f57396
import { eLevel } from '@/types/level'
import { eUserStatusAction } from '@/types/user'
import baseAxios from '../index'
import { iStaffItem } from './types'
import { iOutLet, iStaffItem } from './types'
export default class StaffService {
static instance: StaffService
......@@ -36,10 +36,10 @@ export default class StaffService {
}
getBranch(data: {
leve: eLevel
page: number
page_size: number
parent_id: number
level: eLevel
page?: number
page_size?: number
parent_id?: number
}) {
return baseAxios({
url: '/staff/branch',
......@@ -47,4 +47,11 @@ export default class StaffService {
data,
})
}
getSelfOutLet() {
return baseAxios<iOutLet>({
url: '/staff/outlet',
method: 'get',
})
}
}
......@@ -13,3 +13,14 @@ export interface iStaffItem {
time: string
work: number
}
export interface iOutLet {
fid: number
first_branch: string
fs_id: number
first_sub_branch: string
second_branch: string
second_sub_branch: string
sid: number
ss_id: number
}
import StaffService from '@/service/StaffService'
import { iOutLet } from '@/service/StaffService/types'
const OUT_LET = 'out-let'
export async function getSelfOutLet(): Promise<iOutLet> {
const outletStorage = localStorage.getItem(OUT_LET)
const outlet = (outletStorage && JSON.parse(outletStorage)) || undefined
if (!outlet) {
const ret = await StaffService.getInstance().getSelfOutLet()
if (ret.code === 200) {
const data: iOutLet = ret.data
localStorage.setItem(OUT_LET, JSON.stringify(data))
} else {
throw new Error('用户网点信息获取失败F')
}
}
const storage = localStorage.getItem(OUT_LET)
const result = (storage && JSON.parse(storage)) || undefined
return result
}
<template>
<div class="header-select">
<a-select
class="header-select-item mx-3"
:value="selectValue.f"
:disabled="selectDisable.f"
@popupScroll="popupScroll1"
>
<a-select-option
:value="option.value"
:key="option.value"
v-for="option in selectOptions.f"
>{{ option.label }}</a-select-option
>
</a-select>
<a-select
class="header-select-item mx-3"
:value="selectValue.s"
:disabled="selectDisable.s"
@popupScroll="popupScroll1"
>
<a-select-option
:value="option.value"
:key="option.value"
v-for="option in selectOptions.s"
>{{ option.label }}</a-select-option
>
</a-select>
<a-select
class="header-select-item mx-3"
:value="selectValue.fs"
:disabled="selectDisable.fs"
@popupScroll="popupScroll1"
>
<a-select-option
:value="option.value"
:key="option.value"
v-for="option in selectOptions.fs"
>{{ option.label }}</a-select-option
>
</a-select>
<a-select
class="header-select-item mx-3"
:value="selectValue.ss"
:disabled="selectDisable.ss"
@popupScroll="popupScroll1"
>
<a-select-option
:value="option.value"
:key="option.value"
v-for="option in selectOptions.ss"
>{{ option.label }}</a-select-option
>
</a-select>
</div>
</template>
<script lang="ts">
import { message } from "ant-design-vue";
import Vue from "vue";
export default Vue.extend({
props: [
"selectValue",
"selectDisable",
"selectOptions",
"setSelectValue",
"setSelectDisable",
"setSelectOptions",
],
methods: {
popupScroll1(e: Event) {
let h = e.target as HTMLElement;
if (h.scrollHeight - h.scrollTop <= h.clientHeight) {
message.info("臣妾做不到啊");
}
},
popupScroll2(e: Event) {
let h = e.target as HTMLElement;
if (h.scrollHeight - h.scrollTop <= h.clientHeight) {
message.info("臣妾做不到啊");
}
},
popupScroll3(e: Event) {
let h = e.target as HTMLElement;
if (h.scrollHeight - h.scrollTop <= h.clientHeight) {
message.info("臣妾做不到啊");
}
},
popupScroll4(e: Event) {
let h = e.target as HTMLElement;
if (h.scrollHeight - h.scrollTop <= h.clientHeight) {
message.info("臣妾做不到啊");
}
},
},
});
</script>
<style scoped lang="less">
.header-select {
.header-select-item {
width: 200px;
}
}
</style>
\ No newline at end of file
This diff is collapsed.
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