feat:部门选择
This commit is contained in:
@@ -28,13 +28,17 @@
|
||||
<view
|
||||
>样品名称:<text class="black">{{ item.sampleName }}</text></view
|
||||
>
|
||||
<view>调拨人:<text class="black">{{}}</text></view>
|
||||
<view
|
||||
>调拨人:<text class="black">{{ item.borrowUser }}</text></view
|
||||
>
|
||||
</view>
|
||||
<view class="x-bc">
|
||||
<view
|
||||
>样品编号:<text class="black">{{ item.sampleReturnCode }}</text></view
|
||||
>
|
||||
<view>调拨时间:<text class="black">{{}}</text></view>
|
||||
<view
|
||||
>调拨时间:<text class="black">{{ nx.$dayjs(item.borrowTime).format('YYYY-MM-DD HH:mm:ss') }}</text></view
|
||||
>
|
||||
</view>
|
||||
<view class="mt4"
|
||||
>归库编码:<text class="black">{{ item.sampleReturnCode }}</text></view
|
||||
@@ -89,25 +93,17 @@ onShow(() => {
|
||||
async function getSampleList() {
|
||||
if (sampleCode.value === '') return
|
||||
let params = {
|
||||
pageSize: 999,
|
||||
pageNo: 1,
|
||||
returnStatus: 'completed',
|
||||
dispatchStatus: '1',
|
||||
sampleReturnCode: sampleCode.value
|
||||
}
|
||||
|
||||
const { list } = await nx.$api.sampleWarehouse.queryReturnToStockSample(params)
|
||||
if (list.length === 0) {
|
||||
return uni.showToast({ title: '未查询到该样品信息', icon: 'none' })
|
||||
}
|
||||
const existingCodes = new Set(sampleList.value.map(item => item.id)) // 假设唯一标识是 `code`
|
||||
const newItems = list.filter(item => !existingCodes.has(item.id))
|
||||
const data = await nx.$api.sampleWarehouse.searchBySampleCode(params)
|
||||
|
||||
if (newItems.length === 0) {
|
||||
const existingCodes = new Set(sampleList.value.map(item => item.id))
|
||||
if (existingCodes.has(data.id)) {
|
||||
return uni.showToast({ title: '该样品已存在,无需重复添加', icon: 'none' })
|
||||
}
|
||||
|
||||
sampleList.value.push(...newItems)
|
||||
sampleList.value.push(data)
|
||||
}
|
||||
async function handleSubmit() {
|
||||
if (givebackUserId.value === '') {
|
||||
@@ -117,12 +113,14 @@ async function handleSubmit() {
|
||||
})
|
||||
}
|
||||
btnLoading.value = true
|
||||
const givebackUser = range.value.find(item => item.value === givebackUserId.value)?.nickname
|
||||
const givebackUser = range.value.find(item => item.value === givebackUserId.value)?.text
|
||||
await nx.$api.sampleWarehouse
|
||||
.execSampleDispatch({
|
||||
detailIds: sampleList.value.map(item => item.id),
|
||||
.execGiveback({
|
||||
detailIds: sampleList.value.map(item => item.id).join(','),
|
||||
givebackUserId: givebackUserId.value,
|
||||
givebackUser
|
||||
givebackUser,
|
||||
warehouseUser: userInfo.value.nickname,
|
||||
warehouseUserId: userInfo.value.id
|
||||
})
|
||||
.finally(() => {
|
||||
btnLoading.value = false
|
||||
|
||||
Reference in New Issue
Block a user