| | |
| | | <template #title> |
| | | <view> |
| | | <text class="font-medium"> |
| | | {{ user.nickName }} |
| | | <text class="text-[#0D867F] text-xs">·{{ user.roleName }}</text> |
| | | {{ userInfo?.nickName }} |
| | | <text class="text-[#0D867F] text-xs">·{{ userInfo?.roles[0].roleName }}</text> |
| | | </text> |
| | | </view> |
| | | <view> |
| | | <text class="font-medium text-[#3D3D3D] text-sm">工号: {{ user.userName }}</text> |
| | | <text class="font-medium text-[#3D3D3D] text-sm">工号: {{ userInfo?.userName }}</text> |
| | | </view> |
| | | </template> |
| | | <view class="mt-2"> |
| | |
| | | </template> |
| | | <script setup lang="ts"> |
| | | import { useUserStore } from "@/store/modules/user"; |
| | | import { nextTick } from "vue"; |
| | | const userStore = useUserStore(); |
| | | const userInfo: any = computed(() => userStore.userInfo); |
| | | const user = reactive({ |
| | | nickName: "", |
| | | userName: "", |
| | | roleName: "", |
| | | }); |
| | | |
| | | onLoad(() => { |
| | | nextTick(); |
| | | user.nickName = userInfo.value.user?.nickName; |
| | | user.userName = userInfo.value.user?.userName; |
| | | user.roleName = userInfo.value.user?.roles[0].roleName; |
| | | }); |
| | | const userInfo = computed(() => userStore.userInfo); |
| | | </script> |
| | | <style lang="scss" scoped> |
| | | .calling_card { |
| | |
| | | </wd-row> |
| | | <wd-tabs v-model="tab" auto-line-width> |
| | | <wd-tab :title="`待生产(${total.wait})`" class="tab_bg"> |
| | | <ProductList :api="ManageApi.getProductList" state="待完成" @ok="changeWait" /> |
| | | <ProductList |
| | | ref="waitRef" |
| | | :api="ManageApi.getProductList" |
| | | state="待完成" |
| | | @ok="changeWait" |
| | | /> |
| | | </wd-tab> |
| | | <wd-tab :title="`已生产(${total.already})`" class="tab_bg"> |
| | | <ProductList :api="ManageApi.getProductList" state="已完成" @ok="changeAlready" /> |
| | | <ProductList |
| | | ref="alreadyRef" |
| | | :api="ManageApi.getProductList" |
| | | state="已完成" |
| | | @ok="changeAlready" |
| | | /> |
| | | </wd-tab> |
| | | </wd-tabs> |
| | | </view> |
| | |
| | | |
| | | <script lang="ts" setup> |
| | | import ManageApi from "@/api/product/manage"; |
| | | import { onMounted, ref } from "vue"; |
| | | import { ref } from "vue"; |
| | | import ProductList from "./list/index.vue"; |
| | | |
| | | const waitRef = ref(); |
| | | const alreadyRef = ref(); |
| | | const tab = ref<number>(0); |
| | | const total = reactive({ |
| | | wait: 0, |
| | |
| | | const changeAlready = (num: number) => { |
| | | total.already = num; |
| | | }; |
| | | |
| | | onMounted(() => {}); |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | |
| | | border-radius: unset; |
| | | } |
| | | .scan_box { |
| | | padding: 6px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | width: 38px; |
| | | height: 38px; |
| | | padding: 6px; |
| | | background: #fff; |
| | | } |
| | | ::v-deep .wd-tabs__line { |
| | |
| | | import ProductCard from "@/components/product_card/index.vue"; |
| | | import { useUserStore } from "@/store/modules/user"; |
| | | import zPaging from "@/components/z-paging/z-paging.vue"; |
| | | |
| | | const userStore = useUserStore(); |
| | | const userInfo: any = computed(() => userStore.userInfo); |
| | | const pagingRef = ref(); |
| | | const props = defineProps({ |
| | | api: { |
| | |
| | | }; |
| | | |
| | | const getList = async (pageNo: number, pageSize: number) => { |
| | | const userStore = useUserStore(); |
| | | const userInfo: any = computed(() => userStore.userInfo); |
| | | const { code, data } = await props.api({ |
| | | userName: userInfo.value.user?.userName, |
| | | userName: userInfo.value.userName, |
| | | state: props.state, |
| | | current: pageNo, |
| | | size: pageSize, |
| | |
| | | return new Promise((resolve, reject) => { |
| | | UserAPI.getUserInfo() |
| | | .then((data: any) => { |
| | | setUserInfo(data.data); |
| | | console.log("获取用户信息成功", data.data.user); |
| | | setUserInfo(data.data.user); |
| | | userInfo.value = data.data.user; |
| | | resolve(data.data); |
| | | }) |