完善入库跳转以及出库创建页面
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user