出库对接

This commit is contained in:
zx
2026-04-14 08:46:29 +08:00
parent b16dd22d70
commit 6f1db0f92e
30 changed files with 1366 additions and 458 deletions

View File

@@ -1,6 +1,8 @@
<!-- 仓库/存储区选择 -->
<template>
<view class="content">
<navigation :title="isWarehousing.value ? '仓库选择' : '存储区选择'" :back-url="backUrl"></navigation>
<view class="contentBox">
<view class="topSearch">
<uni-easyinput type="text" v-model="queryParams.keyword" prefixIcon="search" :inputBorder="false"
@iconClick="getList" placeholder="请输入搜索内容" />
@@ -56,11 +58,13 @@
</view>
</template>
<script setup>
import { ref, toRefs } from 'vue';
import { computed, ref, toRefs } from 'vue';
import { onShow } from "@dcloudio/uni-app";
import { getWarehousingInfo } from '../../api/system';
import { getWarehousingInfo } from '@/api/system';
import getRepository from "@/api/getRepository";
import { objectToQuery } from '../until';
import Navigation from '../components/Navigation.vue';
import { watch } from 'vue';
const props = defineProps({
// 是否为仓库查询
@@ -69,12 +73,6 @@ const props = defineProps({
default: true,
required: true
},
// 返回出库开单/入库开单
backStr: {
type: String,
default: true,
required: true
},
pathParams: {
type: Object,
default: null,
@@ -82,11 +80,14 @@ const props = defineProps({
}
})
const { isWarehousing, backStr, pathParams } = toRefs(props)
const { isWarehousing, pathParams } = toRefs(props)
// 数据:查询关键字
const queryParams = ref({
keyword: ''
})
const backUrl = ref('')
// stockIn 入库单开单 stockIn_Detail入库单编辑 issueUniqueCode唯一码 issueUniqueCode_inbound入库生成唯一码
const keyType = computed(() => pathParams.value.type || pathParams.value.back)
// 绑定:加载屏
const pagingRef = ref(null)
// 数据:仓库/存储区
@@ -132,25 +133,27 @@ const getRepositoryInfo = async () => {
}
// 返回路径
const toBack = (back) => {
const toBack = (keyType) => {
console.log('监听', keyType);
let url = ''
switch (back) {
switch (keyType) {
case 'stockIn':
// 入库单开单
url = '/pages/warehousing/stockIn/create'
break;
case 'stockOut':
// 出库单开单
url = ''
url = '/pages/warehousing/stockOut/create'
break;
case 'stockOut-outbound':
// 出库单出库
url = '/pages/warehousing/stockOut/components/outAway'
break;
}
let params = pathParams.value
delete params.backStr
delete params.flag
const query = objectToQuery(params)
uni.navigateTo({
url: `${url}${query}`
})
const query = objectToQuery(pathParams.value)
backUrl.value = `${url}${query}`
}
// 选择:仓库/存储区
const onChecked = (val) => {
@@ -166,9 +169,25 @@ const onChecked = (val) => {
}
// 返回list
toBack(backStr.value)
uni.navigateTo({
url: backUrl.value
})
}
// 监听:确保 pathParams 变化时一定执行 toBack()
watch(
() => pathParams.value,
(d) => {
console.log('pathParams 变化:', d);
if (!d) return
const type = d.type || d.back;
console.log(type, 'eeeeeee');
toBack(type)
},
{ deep: true, immediate: true }
)
onShow(() => {
pagingRef.value?.reload?.()
})
@@ -177,7 +196,7 @@ onShow(() => {
<style scoped lang="scss">
.topSearch {
position: fixed;
top: 0;
top: 65rpx;
left: 0;
right: 0;
z-index: 999;
@@ -188,7 +207,7 @@ onShow(() => {
}
.containerBox {
padding-top: 44px;
padding-top: 120rpx !important;
width: 100%;
height: 100%;
box-sizing: border-box;
@@ -199,12 +218,10 @@ onShow(() => {
}
::v-deep.listBox {
.uni-list {
background-color: #F8F8FF;
}
background-color: #F8F8FF;
.uni-list-item {
margin-bottom: 1rpx;
margin-bottom: 8rpx;
}
.uni-list-item__container {