| | |
| | | <view class="hero-section"> |
| | | <view class="bg-img"> |
| | | <view class="hero-content"> |
| | | <text class="hero-title">润泰生物科技</text> |
| | | <text class="hero-title">双奇点</text> |
| | | </view> |
| | | <view class="hero-wave"></view> |
| | | </view> |
| | |
| | | </up-grid> |
| | | </view> |
| | | </view> |
| | | <GoodsDetailPopup ref="refGoodsDetailPopup"></GoodsDetailPopup> |
| | | </view> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import {ref, onMounted, nextTick, reactive} from 'vue'; |
| | | import {userLoginFacotryList} from "@/api/login"; |
| | | import { stockinDetail, detailManagementByCustom } from '@/api/inventoryManagement/receiptManagement' |
| | | import modal from "@/plugins/modal"; |
| | | import useUserStore from "@/store/modules/user"; |
| | | import GoodsDetailPopup from './components/GoodsDetailPopup.vue'; |
| | | |
| | | const userStore = useUserStore() |
| | | const factoryId = ref(''); |
| | |
| | | { |
| | | icon: '/static/images/icon/huikuandengji@2x.png', |
| | | label: '库存管理', |
| | | }, |
| | | { |
| | | icon: '/static/images/icon/huikuandengji@2x.png', |
| | | label: '产品扫码', |
| | | } |
| | | ]); |
| | | |
| | |
| | | url: '/pages/inventoryManagement/issueManagement/index' |
| | | }); |
| | | break |
| | | case '出库台账': |
| | | uni.navigateTo({ |
| | | url: '/pages/inventoryManagement/dispatchLog/index' |
| | | }); |
| | | break |
| | | case '库存管理': |
| | | uni.navigateTo({ |
| | | url: '/pages/inventoryManagement/stockManagement/index' |
| | | }); |
| | | break |
| | | case '产品扫码': |
| | | scanQRCode() |
| | | break |
| | | default: |
| | | uni.showToast({ |
| | | title: `点击了${item.label}`, |
| | |
| | | }); |
| | | } |
| | | |
| | | |
| | | //开始扫码 |
| | | const scanQRCode = ()=>{ |
| | | uni.scanCode({ |
| | | onlyFromCamera:true, |
| | | scanType:['barCode','qrCode'], |
| | | success(res) { |
| | | searchDetail(res.result||'') |
| | | }, |
| | | fail(res) { |
| | | uni.showToast({ |
| | | title: res.errMsg||'扫码失败', |
| | | icon: 'none', |
| | | duration: 1500 |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | //谈框相关 |
| | | const refGoodsDetailPopup = ref(null) |
| | | |
| | | |
| | | //查看详情 |
| | | const searchDetail = (barcode)=>{ |
| | | if(!barcode||barcode.indexOf(',')==-1){ |
| | | uni.showToast({ |
| | | title:"请扫描正确的二维码", |
| | | icon: 'none', |
| | | duration: 1500 |
| | | }) |
| | | return |
| | | } |
| | | let barcodeList = barcode.split(",") |
| | | let barcodeId = barcodeList[0] |
| | | let type = barcodeList[1] |
| | | let detailApi = null |
| | | if(type==1){ |
| | | detailApi = stockinDetail |
| | | }else if(type==2){ |
| | | detailApi = detailManagementByCustom |
| | | } |
| | | |
| | | if(!detailApi){ |
| | | uni.showToast({ |
| | | title:"请扫描正确的二维码", |
| | | icon: 'none', |
| | | duration: 1500 |
| | | }) |
| | | return |
| | | } |
| | | detailApi({id:barcodeId}).then((resp) => { |
| | | if(resp.code!=200||!resp.data)return |
| | | // barcodeDetail.value = resp.data |
| | | refGoodsDetailPopup.value.open({ |
| | | type: type, |
| | | ...resp.data |
| | | }) |
| | | }).catch(() => { |
| | | uni.showToast({ |
| | | title: "获取数据失败", |
| | | icon: 'none', |
| | | duration: 1500 |
| | | }); |
| | | }) |
| | | } |
| | | |
| | | // 定义方法 |
| | | const click = (name) => { |
| | | if (uToastRef.value) { |