feat:样品库管理
This commit is contained in:
@@ -77,5 +77,11 @@ export default {
|
|||||||
url: 'qms/business-sub-sample/execTakeOff',
|
url: 'qms/business-sub-sample/execTakeOff',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data
|
data
|
||||||
|
}),
|
||||||
|
// 根据权限查询样品库
|
||||||
|
querySampleLocation: () =>
|
||||||
|
request({
|
||||||
|
url: '/qms/config-warehouse-location/selectListWithPermission',
|
||||||
|
method: 'GET'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,21 +24,21 @@
|
|||||||
<template #right> <up-text type="error" size="18" bold :text="sampleList.length"></up-text></template>
|
<template #right> <up-text type="error" size="18" bold :text="sampleList.length"></up-text></template>
|
||||||
<scroll-view style="height: 49vh" scroll-y scroll-with-animation>
|
<scroll-view style="height: 49vh" scroll-y scroll-with-animation>
|
||||||
<uni-card margin="5px" v-for="item in sampleList" class="sample-item">
|
<uni-card margin="5px" v-for="item in sampleList" class="sample-item">
|
||||||
<view class="x-bc">
|
<view
|
||||||
|
>调拨人:<text class="black">{{ item.borrowUser }}</text></view
|
||||||
|
>
|
||||||
|
<view
|
||||||
|
>调拨时间:<text class="black">{{ nx.$dayjs(item.borrowTime).format('YYYY-MM-DD HH:mm:ss') }}</text></view
|
||||||
|
>
|
||||||
|
<view class="mt8">
|
||||||
<view
|
<view
|
||||||
>样品名称:<text class="black">{{ item.sampleName }}</text></view
|
>样品名称:<text class="black">{{ item.sampleName }}</text></view
|
||||||
>
|
>
|
||||||
<view
|
|
||||||
>调拨人:<text class="black">{{ item.borrowUser }}</text></view
|
|
||||||
>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="x-bc">
|
<view class="mt4">
|
||||||
<view
|
<view
|
||||||
>样品编号:<text class="black">{{ item.sampleReturnCode }}</text></view
|
>样品编号:<text class="black">{{ item.sampleReturnCode }}</text></view
|
||||||
>
|
>
|
||||||
<view
|
|
||||||
>调拨时间:<text class="black">{{ nx.$dayjs(item.borrowTime).format('YYYY-MM-DD HH:mm:ss') }}</text></view
|
|
||||||
>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="mt4"
|
<view class="mt4"
|
||||||
>归库编码:<text class="black">{{ item.sampleReturnCode }}</text></view
|
>归库编码:<text class="black">{{ item.sampleReturnCode }}</text></view
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ watch(changeCode, newVal => {
|
|||||||
})
|
})
|
||||||
async function getSampleList() {
|
async function getSampleList() {
|
||||||
if (changeCode.value === '') return
|
if (changeCode.value === '') return
|
||||||
let params = { pageSize: 999, pageNo: 1, returnStatus: 'completed' }
|
let params = { pageSize: 999, pageNo: 1, returnStatus: 'completed', sampleFlowNodeKey: 'flw_sample_storage' }
|
||||||
if (changeType.value === 'sample') {
|
if (changeType.value === 'sample') {
|
||||||
params.sampleReturnCode = changeCode.value
|
params.sampleReturnCode = changeCode.value
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -3,7 +3,21 @@
|
|||||||
<view class="pl8 pr8 pt8">
|
<view class="pl8 pr8 pt8">
|
||||||
<view class="x-f">
|
<view class="x-f">
|
||||||
<text class="pl6">领取人:</text>
|
<text class="pl6">领取人:</text>
|
||||||
<uni-data-select v-model="receiverId" :localdata="range" placeholder="请选择样品领取人"></uni-data-select>
|
<uni-data-select
|
||||||
|
v-model="receiverId"
|
||||||
|
:localdata="assignUserRange"
|
||||||
|
placeholder="请选择样品领取人"
|
||||||
|
:clear="false"
|
||||||
|
></uni-data-select>
|
||||||
|
</view>
|
||||||
|
<view class="x-f mt10 mb10" v-if="warehouseRange.length > 1">
|
||||||
|
<text class="pl20">仓库:</text>
|
||||||
|
<uni-data-select
|
||||||
|
v-model="warehouseCode"
|
||||||
|
:clear="false"
|
||||||
|
:localdata="warehouseRange"
|
||||||
|
placeholder="请选择仓库"
|
||||||
|
></uni-data-select>
|
||||||
</view>
|
</view>
|
||||||
<view class="border-b p6 x-f"
|
<view class="border-b p6 x-f"
|
||||||
><view class="pr16">库管员:</view><text>{{ userInfo.nickname }}</text></view
|
><view class="pr16">库管员:</view><text>{{ userInfo.nickname }}</text></view
|
||||||
@@ -22,7 +36,7 @@
|
|||||||
|
|
||||||
<uni-section v-if="sampleList.length > 0" type="line" title="调拨样品明细" titleFontSize="15px">
|
<uni-section v-if="sampleList.length > 0" type="line" title="调拨样品明细" titleFontSize="15px">
|
||||||
<template #right> <up-text type="error" size="18" bold :text="sampleList.length"></up-text></template>
|
<template #right> <up-text type="error" size="18" bold :text="sampleList.length"></up-text></template>
|
||||||
<scroll-view style="height: 49vh" scroll-y scroll-with-animation>
|
<scroll-view style="height: 44vh" scroll-y scroll-with-animation>
|
||||||
<uni-card margin="5px" v-for="item in sampleList" class="sample-item">
|
<uni-card margin="5px" v-for="item in sampleList" class="sample-item">
|
||||||
<view
|
<view
|
||||||
>样品名称:<text class="black">{{ item.sampleName }}</text></view
|
>样品名称:<text class="black">{{ item.sampleName }}</text></view
|
||||||
@@ -52,7 +66,7 @@ import { debounce } from 'lodash'
|
|||||||
const btnLoading = ref(false)
|
const btnLoading = ref(false)
|
||||||
let sampleCode = ref('')
|
let sampleCode = ref('')
|
||||||
let sampleList = ref([])
|
let sampleList = ref([])
|
||||||
const range = ref([])
|
const assignUserRange = ref([])
|
||||||
const userInfo = computed(() => nx.$store('user').userInfo)
|
const userInfo = computed(() => nx.$store('user').userInfo)
|
||||||
const receiverId = ref('')
|
const receiverId = ref('')
|
||||||
const { scanQRInfo } = toRefs(nx.$store('biz'))
|
const { scanQRInfo } = toRefs(nx.$store('biz'))
|
||||||
@@ -85,7 +99,11 @@ async function createDispatchTempData() {
|
|||||||
}
|
}
|
||||||
async function getScanSample() {
|
async function getScanSample() {
|
||||||
if (sampleCode.value === '') return
|
if (sampleCode.value === '') return
|
||||||
await nx.$api.sampleWarehouse.addDispatchSample({ id: dispatchTempId.value, sampleReturnCode: sampleCode.value })
|
await nx.$api.sampleWarehouse.addDispatchSample({
|
||||||
|
id: dispatchTempId.value,
|
||||||
|
sampleReturnCode: sampleCode.value,
|
||||||
|
warehouseCode: warehouseCode.value
|
||||||
|
})
|
||||||
getSampleList()
|
getSampleList()
|
||||||
}
|
}
|
||||||
async function getSampleList() {
|
async function getSampleList() {
|
||||||
@@ -104,7 +122,7 @@ async function handleSubmit() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
btnLoading.value = true
|
btnLoading.value = true
|
||||||
const receiver = range.value.find(item => item.value === receiverId.value)?.text
|
const receiver = assignUserRange.value.find(item => item.value === receiverId.value)?.text
|
||||||
await nx.$api.sampleWarehouse
|
await nx.$api.sampleWarehouse
|
||||||
.execSampleDispatch({
|
.execSampleDispatch({
|
||||||
id: dispatchTempId.value,
|
id: dispatchTempId.value,
|
||||||
@@ -130,9 +148,22 @@ function handleReset() {
|
|||||||
sampleList.value = []
|
sampleList.value = []
|
||||||
createDispatchTempData()
|
createDispatchTempData()
|
||||||
}
|
}
|
||||||
onMounted(async () => {
|
const warehouseRange = ref([])
|
||||||
const data = await nx.$api.user.getAssignUserList()
|
const warehouseCode = ref('')
|
||||||
range.value = data.map(item => ({ text: item.nickname, value: item.id }))
|
function getWarehouseRange() {
|
||||||
|
nx.$api.sampleWarehouse.querySampleLocation({ warehouseType: '样品库' }).then(res => {
|
||||||
|
warehouseRange.value = res.map(item => ({ text: item.name, value: item.code }))
|
||||||
|
warehouseCode.value = res[0].code
|
||||||
|
})
|
||||||
|
}
|
||||||
|
function getAssignUserRange() {
|
||||||
|
nx.$api.user.getAssignUserList().then(res => {
|
||||||
|
assignUserRange.value = res.map(item => ({ text: item.nickname, value: item.id }))
|
||||||
|
})
|
||||||
|
}
|
||||||
|
onMounted(() => {
|
||||||
|
getAssignUserRange()
|
||||||
|
getWarehouseRange()
|
||||||
handleReset()
|
handleReset()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -23,6 +23,15 @@
|
|||||||
>样品名称:<text>{{ sampleData.sampleName }}</text></view
|
>样品名称:<text>{{ sampleData.sampleName }}</text></view
|
||||||
>
|
>
|
||||||
<up-tag
|
<up-tag
|
||||||
|
v-if="sampleData.dispatchStatus == 1"
|
||||||
|
plain
|
||||||
|
plainFill
|
||||||
|
size="mini"
|
||||||
|
type="info"
|
||||||
|
text="已调拨"
|
||||||
|
></up-tag>
|
||||||
|
<up-tag
|
||||||
|
v-else
|
||||||
plain
|
plain
|
||||||
plainFill
|
plainFill
|
||||||
size="mini"
|
size="mini"
|
||||||
@@ -30,9 +39,9 @@
|
|||||||
:text="sampleData.returnStatus_dictText"
|
:text="sampleData.returnStatus_dictText"
|
||||||
></up-tag>
|
></up-tag>
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view class="mt4">
|
||||||
>样品编号:<text>{{ sampleData.sampleCode }}</text></view
|
样品编号:<text>{{ sampleData.sampleCode }}</text>
|
||||||
>
|
</view>
|
||||||
<view class="mt4"
|
<view class="mt4"
|
||||||
>归库编码:<text>{{ sampleData.sampleReturnCode }}</text></view
|
>归库编码:<text>{{ sampleData.sampleReturnCode }}</text></view
|
||||||
>
|
>
|
||||||
@@ -94,6 +103,7 @@ async function getSampleDetail() {
|
|||||||
sampleData.value = {}
|
sampleData.value = {}
|
||||||
const { list } = await nx.$api.sampleWarehouse.queryReturnToStockSample({
|
const { list } = await nx.$api.sampleWarehouse.queryReturnToStockSample({
|
||||||
sampleReturnCode: sampleCode.value,
|
sampleReturnCode: sampleCode.value,
|
||||||
|
sampleFlowNodeKey: 'flw_sample_storage',
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
pageNo: 1
|
pageNo: 1
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -118,12 +118,19 @@ onShow(() => {
|
|||||||
|
|
||||||
async function getSampleList() {
|
async function getSampleList() {
|
||||||
if (targetCode.value === '') return
|
if (targetCode.value === '') return
|
||||||
let params = { pageSize: 999, pageNo: 1, returnStatus: 'completed', dispatchStatus: '0' }
|
let params = {
|
||||||
|
pageSize: 999,
|
||||||
|
pageNo: 1,
|
||||||
|
returnStatus: 'completed',
|
||||||
|
dispatchStatus: '0',
|
||||||
|
sampleFlowNodeKey: 'flw_sample_storage'
|
||||||
|
}
|
||||||
if (takeOffType.value === 'sample') {
|
if (takeOffType.value === 'sample') {
|
||||||
params.sampleReturnCode = targetCode.value
|
params.sampleReturnCode = targetCode.value
|
||||||
} else {
|
} else {
|
||||||
params.warehouseLocationCode = targetCode.value
|
params.warehouseLocationCode = targetCode.value
|
||||||
}
|
}
|
||||||
|
sampleList.value = []
|
||||||
const { list } = await nx.$api.sampleWarehouse.queryReturnToStockSample(params)
|
const { list } = await nx.$api.sampleWarehouse.queryReturnToStockSample(params)
|
||||||
if (list.length === 0) {
|
if (list.length === 0) {
|
||||||
return uni.showToast({ title: '未查询到该样品信息', icon: 'none' })
|
return uni.showToast({ title: '未查询到该样品信息', icon: 'none' })
|
||||||
|
|||||||
Reference in New Issue
Block a user