feat:样品库管理
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
prefixIcon="scan"
|
||||
fontSize="16"
|
||||
prefixIconStyle="font-size: 30px;"
|
||||
@confirm="handleSearch"
|
||||
>
|
||||
<template #suffix>
|
||||
<!-- <up-button type="primary" text="查询" icon="search"></up-button> -->
|
||||
@@ -14,31 +15,43 @@
|
||||
</template>
|
||||
</up-input>
|
||||
|
||||
<uni-section type="line" title="样品详情">
|
||||
<uni-section v-if="sampleData.id" type="line" title="样品详情" titleFontSize="15px">
|
||||
<uni-card>
|
||||
<view>
|
||||
<view class="x-bc">
|
||||
<view
|
||||
>样品名称:<text>{{ sampleData.sampleName }}</text></view
|
||||
>
|
||||
<up-tag :text="sampleData.returnStatus_dictText"></up-tag>
|
||||
<up-tag
|
||||
plain
|
||||
plainFill
|
||||
size="mini"
|
||||
:type="sampleData.returnStatus === 'completed' ? 'success' : 'info '"
|
||||
:text="sampleData.returnStatus_dictText"
|
||||
></up-tag>
|
||||
</view>
|
||||
<view
|
||||
>样品编号:<text>{{ sampleData.sampleCode }}</text></view
|
||||
>
|
||||
<view class="mt4"
|
||||
>归库编码:<text>{{ sampleData.sampleCode }}</text></view
|
||||
>归库编码:<text>{{ sampleData.sampleReturnCode }}</text></view
|
||||
>
|
||||
<view class="mt4"
|
||||
>样品库名称:<text>{{ sampleData.sampleCode }}</text></view
|
||||
>样品库名称:<text>{{ sampleData.warehouseName }}</text></view
|
||||
>
|
||||
<view class="mt4"
|
||||
>库位信息:<text>{{ sampleData.sampleCode }}</text></view
|
||||
>库位信息:<text>{{ sampleData.warehouseLocationCode }}</text></view
|
||||
>
|
||||
</view>
|
||||
</uni-card>
|
||||
</uni-section>
|
||||
<up-button type="primary" style="width: 90%" text="打印归库标签" @click="handlePrint"></up-button>
|
||||
<up-button
|
||||
v-if="sampleData.id"
|
||||
type="primary"
|
||||
style="width: 90%"
|
||||
text="打印归库标签"
|
||||
@click="handlePrint"
|
||||
></up-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -49,18 +62,17 @@ import nx from '@/nx'
|
||||
|
||||
const { scanQRInfo } = toRefs(nx.$store('biz'))
|
||||
watch(scanQRInfo, newVal => {
|
||||
if (newVal && nx.$router.getCurrentPage().route == 'pages/sampleWarehouse/sampleSearch/index') {
|
||||
try {
|
||||
sampleCode.value = newVal
|
||||
handleSearch()
|
||||
scanQRInfo.value = ''
|
||||
} catch (error) {
|
||||
scanQRInfo.value = ''
|
||||
uni.showToast({
|
||||
title: '请扫描样品编码',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
if (!newVal) return
|
||||
scanQRInfo.value = ''
|
||||
if (nx.$router.getCurrentPage().route !== 'pages/sampleWarehouse/sampleSearch/index') return
|
||||
try {
|
||||
sampleCode.value = newVal
|
||||
handleSearch()
|
||||
} catch (error) {
|
||||
uni.showToast({
|
||||
title: '请扫描正确的样品编码',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
onShow(() => {
|
||||
@@ -73,7 +85,25 @@ function handleSearch() {
|
||||
|
||||
let sampleData = ref({})
|
||||
async function getSampleDetail() {
|
||||
sampleData.value = await nx.$api.sample.getSampleDetail({ sampleReturnCode: sampleCode.value })
|
||||
sampleData.value = {}
|
||||
const { list } = await nx.$api.sampleWarehouse.queryReturnToStockSample({
|
||||
sampleReturnCode: sampleCode.value,
|
||||
pageSize: 10,
|
||||
pageNo: 1
|
||||
})
|
||||
if (list.length == 0) {
|
||||
uni.showToast({
|
||||
title: '未查询到该样品信息',
|
||||
icon: 'none'
|
||||
})
|
||||
} else if (list.length > 1) {
|
||||
uni.showToast({
|
||||
title: '查询出重复的样品编号,请联系管理员',
|
||||
icon: 'none'
|
||||
})
|
||||
} else {
|
||||
sampleData.value = list[0]
|
||||
}
|
||||
}
|
||||
function handlePrint() {}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user