报表申报智能运输页面完成
This commit is contained in:
@@ -3,13 +3,14 @@
|
||||
<view class="contentBox">
|
||||
<!-- 仓库信息 - 仓库、存储区 -->
|
||||
<warehousing-info ref="warehousingInfoRef" :warehouseInfo="warehouseInfo"
|
||||
:pathParams="{ ...pathParams, type: 'stockIn' }" />
|
||||
:pathParams="{ ...pathParams, type: pathParams.type === 'my' ? 'my' : 'stockIn' }" />
|
||||
<!-- 物料列表 - 添加物料 -->
|
||||
<material-list ref="materialRef" :formData="formData" isEdit="1" backStr="stockIn" :pathParams="pathParams" />
|
||||
<material-list ref="materialRef" :formData="formData" isEdit="1"
|
||||
:backStr="pathParams.type === 'my' ? 'my' : 'stockIn'" :pathParams="pathParams" />
|
||||
<!-- 底部操作栏 -->
|
||||
<view class="bottom">
|
||||
<uv-button @click="scanCode">扫码添加</uv-button>
|
||||
<uv-button type="primary" @click="submitForm">提交</uv-button>
|
||||
<uv-button @tap="scanCode">扫码添加</uv-button>
|
||||
<uv-button type="primary" @tap="submitForm">提交</uv-button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -35,7 +36,17 @@ const OPERATE_CONFIG = {
|
||||
stockIn: {
|
||||
back: '/pages/warehousing/stockIn/components/detail',
|
||||
title: ''
|
||||
}
|
||||
},
|
||||
//
|
||||
declaration: {
|
||||
back: '/pages/warehousing/Declaration/components/detail',
|
||||
title: ''
|
||||
},
|
||||
//
|
||||
my: {
|
||||
back: '/pages/warehousing/Declaration/components/detail',
|
||||
title: ''
|
||||
},
|
||||
}
|
||||
// 数据:路径参数
|
||||
const pathParams = ref('')
|
||||
@@ -125,15 +136,15 @@ const scanCode = () => {
|
||||
// 提交表单
|
||||
const submitForm = () => {
|
||||
const info = warehousingInfoRef.value.getWarehousingInfo()
|
||||
const materialInfo = materialRef.value.getMaterialList()
|
||||
const materialInfo = materialRef.value.getMaterialList() || []
|
||||
|
||||
let params = {
|
||||
warehouseCode: info.warehousing?.[0].deptCode || info.warehousing?.[0].deptId,
|
||||
warehouseName: info.warehousing?.[0].deptName,
|
||||
areaCode: info.storageArea?.[0].deptCode || info.storageArea?.[0].deptId,
|
||||
areaName: info.storageArea?.[0].deptName,
|
||||
remark: info.remark,
|
||||
billRemark: info.remark,
|
||||
warehouseCode: info?.warehousing?.[0]?.deptCode || info?.warehousing?.[0]?.deptId,
|
||||
warehouseName: info?.warehousing?.[0]?.deptName,
|
||||
areaCode: info?.storageArea?.[0]?.deptCode || info.storageArea?.[0]?.deptId,
|
||||
areaName: info?.storageArea?.[0]?.deptName,
|
||||
remark: info?.remark,
|
||||
billRemark: info?.remark,
|
||||
itemList: _.map(materialInfo, (i) => ({ ...i.material }))
|
||||
}
|
||||
try {
|
||||
@@ -142,7 +153,13 @@ const submitForm = () => {
|
||||
addStockIn(params).then((res) => {
|
||||
if (res.code == 200) {
|
||||
uni.showToast({ title: '入库单创建成功', icon: 'success', mask: true })
|
||||
uni.navigateTo({ url: OPERATE_CONFIG.list.back })
|
||||
if (pathParams.value.type == 'my') {
|
||||
const queryStr = objectToQuery(pathParams.value)
|
||||
uni.navigateTo({ url: OPERATE_CONFIG.my.back + queryStr })
|
||||
} else {
|
||||
uni.navigateTo({ url: OPERATE_CONFIG.list.back })
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
@@ -169,7 +186,7 @@ onLoad((options) => {
|
||||
console.log('options==>', options);
|
||||
|
||||
// 若有billNo传入 修改标题且为编辑 stockIn:入库编辑 stockIn-putAway:入库单入库编辑
|
||||
if (options?.billNo) {
|
||||
if (options?.billNo && options?.type != 'my') {
|
||||
const query = objectToQuery(options)
|
||||
title.value = options.billNo
|
||||
backUrl.value = OPERATE_CONFIG.stockIn.back + query;
|
||||
|
||||
Reference in New Issue
Block a user