出库对接
This commit is contained in:
@@ -2,12 +2,11 @@
|
||||
<template>
|
||||
<view class="page">
|
||||
<navigation title="入库" :back-url="backUrl"></navigation>
|
||||
|
||||
<!-- 仓库信息 - 仓库、存储区 -->
|
||||
<warehousing-info ref="warehousingInfoRef" :warehouseInfo="warehouseInfo" :pathParams="pathParams" />
|
||||
<warehousing-info ref="warehousingInfoRef" :warehouseInfo="warehouseInfo"
|
||||
:pathParams="{ ...pathParams, back: 'stockIn' }" />
|
||||
<!-- 物料列表 - 添加物料 -->
|
||||
<material-list ref="materialRef" :formData="formData" isEdit="5" backStr="stockIn" :pathParams="pathParams"
|
||||
:extendData="{ selectMaterialList }" />
|
||||
<material-list ref="materialRef" :formData="formData" isEdit="5" :pathParams="pathParams":extendData="{ selectMaterialList }" />
|
||||
<!-- 底部操作栏 -->
|
||||
<view class="bottom">
|
||||
<uv-button type="primary" @click="submitForm">入库</uv-button>
|
||||
@@ -16,32 +15,25 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
|
||||
import _ from 'lodash';
|
||||
import { ref } from 'vue';
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import { objectToQuery } from '../../../until';
|
||||
import { inboundFinish, stockInDetail } from '@/api/stockIn';
|
||||
import Navigation from '../../../components/Navigation.vue';
|
||||
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';
|
||||
|
||||
// stockIn-putAway:入库单入库编辑
|
||||
const backUrl = ref('')
|
||||
// 数据:路径参数
|
||||
const pathParams = ref('')
|
||||
// 标志:是否为编辑
|
||||
const isEdit = ref('')
|
||||
// 标志:区分页面 进入页面的状态 null新建 stockIn:入库编辑 stockIn-putAway:入库单入库编辑
|
||||
const flag = ref('')
|
||||
|
||||
// ref:物料绑定
|
||||
const materialRef = ref([])
|
||||
// ref:仓库信息绑定
|
||||
const warehousingInfoRef = ref([])
|
||||
|
||||
// ref:选中的物料
|
||||
const selectMaterialList = ref([])
|
||||
const detailInfo = ref('')
|
||||
|
||||
// 数据:物料列表
|
||||
const formData = ref([{ remark: '', material: [] }])
|
||||
// 数据:仓库信息
|
||||
@@ -69,7 +61,6 @@ const getMaterialList = () => {
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 方法:获取详情 - 更新物料得值 获取唯一码后回来
|
||||
const getDetailInfo = () => {
|
||||
stockInDetail({ billNo: pathParams.value.billNo }).then((res) => {
|
||||
@@ -102,32 +93,27 @@ const submitForm = () => {
|
||||
billRemark: info.remark,
|
||||
itemList: _.map(_materialInfo, (i) => ({ ...i.material }))
|
||||
}
|
||||
try {
|
||||
inboundFinish(params).then((res) => {
|
||||
uni.navigateTo({ url: backUrl.value });
|
||||
})
|
||||
} catch (err) {
|
||||
console.log('入库单入库失败==》', err);
|
||||
}
|
||||
|
||||
inboundFinish(params).then((res) => {
|
||||
// stockIn
|
||||
// /pages/warehousing/stockIn/components/detail
|
||||
uni.navigateTo({
|
||||
url: backUrl.value
|
||||
});
|
||||
console.log(res, '入库单入库');
|
||||
})
|
||||
|
||||
}
|
||||
// 数据:路径参数
|
||||
onLoad((options) => {
|
||||
console.log(options, 'options', _.includes(options?.type, 'stockIn'));
|
||||
if (!options.billNo) {
|
||||
uni.showToast({ title: '参数错误,无唯一码ID', icon: 'none' })
|
||||
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')
|
||||
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
Reference in New Issue
Block a user