完善入库跳转以及出库创建页面
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<!-- 自定义导航栏 -->
|
||||
<navigation :title="pathParams.billNo">
|
||||
<navigation :title="pathParams.billNo" :back-url="backUrl">
|
||||
<template #right>
|
||||
<view class="right-btn flex align-center justify-center ">
|
||||
<uv-image @click="onPrinter" src="../../../../static/printer.png" width="20px" height="20px"
|
||||
@@ -9,7 +9,7 @@
|
||||
style="margin-top:10rpx" />
|
||||
</view>
|
||||
</template>
|
||||
</Navigation>
|
||||
</navigation>
|
||||
<!-- 详情信息 -->
|
||||
<detail-info type="stockIn" :detailInfo="detailInfo" />
|
||||
|
||||
@@ -28,6 +28,8 @@ import { objectToQuery, getBillType } from '../../../until';
|
||||
import { stockInDetail, inboundBillVoid } from '../../../../api/stockIn';
|
||||
import DetailInfo from '../../../components/DetailInfo.vue';
|
||||
import Navigation from '../../../components/Navigation.vue';
|
||||
// ref:返回路径
|
||||
const backUrl = ref('')
|
||||
|
||||
// 数据:路径参数
|
||||
const pathParams = ref('')
|
||||
@@ -83,8 +85,9 @@ const setDetailInfoToStorage = (type) => {
|
||||
// 按钮:入库单入库
|
||||
const toPutAway = () => {
|
||||
setDetailInfoToStorage('1')
|
||||
const query = objectToQuery(pathParams.value)
|
||||
uni.navigateTo({
|
||||
url: `/pages/warehousing/stockIn/components/inbound?billNo=${pathParams.value.billNo}`
|
||||
url: `/pages/warehousing/stockIn/components/inbound${query}`
|
||||
});
|
||||
}
|
||||
// 编辑
|
||||
@@ -103,6 +106,11 @@ onLoad((options) => {
|
||||
uni.showToast({ title: '参数错误,无唯一码ID', icon: 'none' })
|
||||
return
|
||||
}
|
||||
if (options.type == 'stockIn') {
|
||||
backUrl.value = '/pages/warehousing/stockIn/my'
|
||||
} else if (options.type == 'stockIn-putAway') {
|
||||
backUrl.value = '/pages/warehousing/stockIn/putaway'
|
||||
}
|
||||
pathParams.value = options
|
||||
getDetailInfo()
|
||||
})
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<!--点击入库单入库后的入库页面 -->
|
||||
<template>
|
||||
<view class="page">
|
||||
<navigation title="入库" :back-url="backUrl"></navigation>
|
||||
|
||||
<!-- 仓库信息 - 仓库、存储区 -->
|
||||
<warehousing-info ref="warehousingInfoRef" :warehouseInfo="warehouseInfo" :pathParams="pathParams" />
|
||||
<!-- 物料列表 - 添加物料 -->
|
||||
@@ -17,12 +19,14 @@
|
||||
|
||||
import _ from 'lodash';
|
||||
import { ref } from 'vue';
|
||||
import { onLoad, onShow } from "@dcloudio/uni-app";
|
||||
import { inboundFinish, stockInDetail,inboundBillVoid } from '@/api/stockIn';
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import { inboundFinish, stockInDetail } from '@/api/stockIn';
|
||||
import MaterialList from '../../../components/MaterialList.vue';
|
||||
import WarehousingInfo from '../../../components/WarehousingInfo.vue';
|
||||
import { onMounted } from 'vue';
|
||||
|
||||
import Navigation from '../../../components/Navigation.vue';
|
||||
import {objectToQuery} from '../../../until';
|
||||
const backUrl = ref('')
|
||||
// 数据:路径参数
|
||||
const pathParams = ref('')
|
||||
// 标志:是否为编辑
|
||||
@@ -103,7 +107,7 @@ const submitForm = () => {
|
||||
// stockIn
|
||||
// /pages/warehousing/stockIn/components/detail
|
||||
uni.navigateTo({
|
||||
url: `/pages/warehousing/stockIn/components/detail?billNo=${pathParams.value.billNo}&type=stockIn`
|
||||
url: backUrl.value
|
||||
});
|
||||
console.log(res, '入库单入库');
|
||||
})
|
||||
@@ -117,16 +121,15 @@ onLoad((options) => {
|
||||
return
|
||||
}
|
||||
pathParams.value = options
|
||||
// stockIn-putAway
|
||||
// stockIn
|
||||
const query = objectToQuery(pathParams.value)
|
||||
backUrl.value = `/pages/warehousing/stockIn/components/detail${query}`
|
||||
getDetailInfo()
|
||||
flag.value = options.type
|
||||
isEdit.value = _.includes(options?.type, 'stockIn')
|
||||
})
|
||||
// 修改标题:若有billNo传入 修改标题
|
||||
onShow(() => {
|
||||
if (pathParams.value.billNo) {
|
||||
uni.setNavigationBarTitle({ title: pathParams.value.billNo })
|
||||
}
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
getMaterialList()
|
||||
})
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<template>
|
||||
<view class="page">
|
||||
<navigation :title="title" :back-url="backUrl"></navigation>
|
||||
<!-- 仓库信息 - 仓库、存储区 -->
|
||||
<warehousing-info ref="warehousingInfoRef" :warehouseInfo="warehouseInfo" :pathParams="pathParams" />
|
||||
<!-- 物料列表 - 添加物料 -->
|
||||
@@ -22,7 +23,8 @@ import { addStockIn, stockInUpdate } from '@/api/stockIn';
|
||||
import { getMaterialUnique } from '@/api/uniqueCode';
|
||||
import MaterialList from '../../components/MaterialList.vue';
|
||||
import WarehousingInfo from '../../components/WarehousingInfo.vue';
|
||||
|
||||
import Navigation from '../../components/Navigation.vue';
|
||||
import { includes } from 'lodash';
|
||||
|
||||
// 数据:路径参数
|
||||
const pathParams = ref('')
|
||||
@@ -31,6 +33,10 @@ const isEdit = ref('')
|
||||
// 标志:区分页面 进入页面的状态 null新建 stockIn:入库编辑 stockIn-putAway:入库单入库编辑
|
||||
const flag = ref('')
|
||||
|
||||
// ref:标题
|
||||
const title = ref('入库单开单')
|
||||
const backUrl = ref('pages/warehousing/index')
|
||||
|
||||
// ref:物料绑定
|
||||
const materialRef = ref([])
|
||||
// ref:仓库信息绑定
|
||||
@@ -70,7 +76,7 @@ const scanCode = () => {
|
||||
success: (res) => {
|
||||
scanResult.value = res.result;
|
||||
if (res.result) {
|
||||
getMaterialUnique({ code: res.result }).then((response) => {
|
||||
getMaterialUnique({ code: res.result }).then((response) => {
|
||||
console.log('物料内容:', response);
|
||||
if (`${response.code}` === '200') {
|
||||
const material = uni.getStorageSync('app_material');
|
||||
@@ -89,7 +95,7 @@ const scanCode = () => {
|
||||
icon: 'none',
|
||||
})
|
||||
} else {
|
||||
let _material = [...materialInfo, { ...response.data[0],uniqueCode:res.result }]
|
||||
let _material = [...materialInfo, { ...response.data[0], uniqueCode: res.result }]
|
||||
console.log('新的物料数组', _material);
|
||||
formData.value.material = _material
|
||||
uni.setStorageSync('app_material', formData.value.material)
|
||||
@@ -169,8 +175,12 @@ onLoad((options) => {
|
||||
})
|
||||
// 修改标题:若有billNo传入 修改标题
|
||||
onShow(() => {
|
||||
const query = objectToQuery(pathParams.value)
|
||||
if (pathParams.value.billNo) {
|
||||
uni.setNavigationBarTitle({ title: pathParams.value.billNo })
|
||||
title.value = pathParams.value.billNo
|
||||
}
|
||||
if ( includes(pathParams.value.type,'stockIn') ) {
|
||||
backUrl.value = `/pages/warehousing/stockIn/components/detail${query}`
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<template>
|
||||
<!-- 我的入库单 -->
|
||||
<search-list type="stockIn" :onDetail="onDetail" />
|
||||
</template>
|
||||
<script setup>
|
||||
|
||||
Reference in New Issue
Block a user