出库对接

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

@@ -5,19 +5,25 @@
<view class="right-btn flex align-center justify-center ">
<uv-image @click="onPrinter" src="../../../../static/printer.png" width="20px" height="20px"
style="margin-top:10rpx" />
<uv-image @click="onEdit" src="../../../../static/edit.png" class="ml-24" width="20px" height="20px"
style="margin-top:10rpx" />
<uv-image @click="toEditOrAway('2')" src="../../../../static/edit.png" class="ml-24" width="20px"
height="20px" style="margin-top:10rpx" />
</view>
</template>
</navigation>
<!-- 详情信息 -->
<detail-info type="stockIn" :detailInfo="detailInfo" />
<view class="contentBox">
<!-- 详情信息 -->
<detail-info :type="pathParams.value?.type" :detailInfo="detailInfo" />
<view v-if="detailInfo?.billType == '0'"
:class="getBillType(detailInfo?.billType, detailInfo?.status) != '物料部分入库' ? 'bottom' : 'bottom1'">
<uv-button type="error" v-if="getBillType(detailInfo?.billType, detailInfo?.status) != '物料部分入库'" text="作废"
@click="toObsolete"></uv-button>
<uv-button type="primary" text="入库单入库" @click="toPutAway"></uv-button>
<!-- 底部按钮 -->
<view v-if="detailInfo?.billType == '0' && !flag"
:class="getBillType(detailInfo?.billType, detailInfo?.status) != '物料部分入库' ? 'bottom' : 'bottom1'">
<uv-button type="error" v-if="getBillType(detailInfo?.billType, detailInfo?.status, flag) != '物料部分入库'"
text="作废" @click="toObsolete"></uv-button>
<uv-button type="primary" text="入库单入库" @click="toEditOrAway('1')"></uv-button>
</view>
<view v-if="detailInfo?.billType == '0' && flag" class="bottom1">
<uv-button type="primary" text="出库单出库" @click="toEditOrAway('1')"></uv-button>
</view>
</view>
</template>
<script setup>
@@ -25,101 +31,139 @@ import _ from 'lodash';
import { ref, computed } from 'vue';
import { onLoad } from "@dcloudio/uni-app";
import { objectToQuery, getBillType } from '../../../until';
import { stockInDetail, inboundBillVoid } from '../../../../api/stockIn';
import { stockOutDetail } from '@/api/stockOut';
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('')
// 数据:详情
const detailInfo = ref('')
// 数据:类型 stockIn:入库 stockIn-putAway入库单入库 stockOut出库
const type = computed(() => pathParams.value.type)
// 方法:获取详情 - 将isDelete写入
const getDetailInfo = () => {
stockInDetail({ billNo: pathParams.value.billNo }).then((res) => {
detailInfo.value = res.data
})
// type
const OPERATE_CONFIG = {
// url:入库/出库 地址 back导航栏返回地址 editUrl编辑地址
stockIn: {// 入库单开单
type: 'stockIn',
url: '/pages/warehousing/stockOut/components/outAway',
back: '/pages/warehousing/stockIn/my',
editUrl: '/pages/warehousing/stockIn/create',
},
stockIn_inbound: { // 入库单入库
type: 'stockIn_inbound',
url: '/pages/warehousing/stockIn/components/inbound',
back: '/pages/warehousing/stockIn/putAway',
editUrl: '/pages/warehousing/stockIn/create',
},
stockOut: { // 出库单开单
type: 'stockOut',
url: '/pages/warehousing/stockOut/components/outAway',
back: '/pages/warehousing/stockOut/my',
editUrl: '/pages/warehousing/stockOut/create',
},
stockOut_outAway: { // 出库单入库
type: 'stockOut_outAway',
url: '/pages/warehousing/stockOut/components/outAway',
back: '/pages/warehousing/stockOut/outbound',
editUrl: '/pages/warehousing/stockOut/create',
},
}
const flag = computed(() => _.includes(pathParams.value.type, 'stockIn') ? 0 : 1)
// 打印
const onPrinter = () => {
const onPrinter = () => { }
// 获取详情 - 将isDelete写入
const getDetailInfo = () => {
if (flag.value == 1) {
stockOutDetail({ billNo: pathParams.value.billNo }).then((res) => {
detailInfo.value = res.data
})
} else {
stockInDetail({ billNo: pathParams.value.billNo }).then((res) => {
detailInfo.value = res.data
})
}
}
const toObsolete = () => {
const params = {
inboundBillVoid({
billNo: pathParams.value?.billNo,
billType: '5'
}
inboundBillVoid(params).then((res) => {
// /pages/warehousing/stockIn/my
}).then((res) => {
uni.navigateTo({
url: `/pages/warehousing/stockIn/my`
});
})
}
/**
* 详情信息存入本地缓存
* @param {any} type - 类型标识,控制物料存储逻辑
*/
const setDetailInfoToStorage = (type) => {
const data = detailInfo.value || {}
// 仓库信息
uni.setStorageSync('app_warehousing', [{
deptName: detailInfo.value?.warehouseName,
deptCode: detailInfo.value?.warehouseCode,
deptName: data.warehouseName || '',
deptCode: data.warehouseCode || ''
}])
// 库区信息
uni.setStorageSync('app_storageArea', [{
deptName: detailInfo.value?.areaName,
deptCode: detailInfo.value?.areaCode,
deptName: data.areaName || '',
deptCode: data.areaCode || ''
}])
if (type) {
const material = _.filter(detailInfo.value?.itemList, (i) => i?.uniqueCode && i.status == '0')
const materialSelectList = _.filter(detailInfo.value?.itemList, (i) => !i?.uniqueCode && i.status == '0')
// 单据备注
uni.setStorageSync('app_billRemark', data.billRemark || '')
// 物料列表
const itemList = data.itemList || []
if (!type) {
// 无 type筛选出状态=0 的数据,分两组
const material = _.filter(itemList, i => i?.uniqueCode && i.status === '0')
const materialSelectList = _.filter(itemList, i => !i?.uniqueCode && i.status === '0')
uni.setStorageSync('app_material', material)
uni.setStorageSync('app_material_select_list', materialSelectList)
} else {
uni.setStorageSync('app_material', detailInfo.value?.itemList)
// 有 type直接存储全部 itemList
uni.setStorageSync('app_material', itemList)
}
uni.setStorageSync('app_billRemark', detailInfo.value?.billRemark,)
}
// 按钮:入库单入库
const toPutAway = () => {
setDetailInfoToStorage('1')
const query = objectToQuery(pathParams.value)
uni.navigateTo({
url: `/pages/warehousing/stockIn/components/inbound${query}`
});
}
// 编辑
const onEdit = () => {
setDetailInfoToStorage()
const query = objectToQuery(pathParams.value)
let url = `/pages/warehousing/stockIn/create${query}`
uni.navigateTo({
url: url
});
}
// 接收路径参数billNo
/**
* 路径跳转操作 入库、出库、编辑
* @param {any} type - 类型标识1 出入库操作 2 编辑
*/
const toEditOrAway = (key) => {
const config = flag.value ? OPERATE_CONFIG.stockOut_outAway : OPERATE_CONFIG.stockIn_inbound; // 获取配置flag 区分入库/出库)
console.log(config, 'config===>');
const queryParams = { ...pathParams.value, type: config.type } // 拼接路径参数
const queryStr = objectToQuery(queryParams)
const targetUrl = key === '1' ? config.url : config.editUrl // 区分跳转:操作 / 编辑
setDetailInfoToStorage(key === '1' ? flag.value : undefined)// 存储数据
uni.navigateTo({
url: targetUrl + queryStr
}).catch(err => {
console.error('页面跳转失败:', err)
})
}
// 接收路径参数
onLoad((options) => {
if (!options.billNo) {
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
const query = objectToQuery(pathParams.value)
backUrl.value = OPERATE_CONFIG?.[pathParams.value.type]?.back + `${query}`
getDetailInfo()
})
</script>
<style scoped lang="scss">
/* 底部按钮 */
// 底部按钮
.bottom {
position: fixed;

View File

@@ -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(() => {

View File

@@ -1,8 +1,9 @@
<template>
<view class="page">
<navigation :title="title" :back-url="backUrl"></navigation>
<navigation :title="title" :back-url="backUrl"></navigation>
<view class="contentBox">
<!-- 仓库信息 - 仓库存储区 -->
<warehousing-info ref="warehousingInfoRef" :warehouseInfo="warehouseInfo" :pathParams="pathParams" />
<warehousing-info ref="warehousingInfoRef" :warehouseInfo="warehouseInfo"
:pathParams="{ ...pathParams, type: 'stockIn' }" />
<!-- 物料列表 - 添加物料 -->
<material-list ref="materialRef" :formData="formData" isEdit="1" backStr="stockIn" :pathParams="pathParams" />
<!-- 底部操作栏 -->
@@ -24,18 +25,26 @@ 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 OPERATE_CONFIG = {
// 创建
list: {
back: 'pages/warehousing/index',
title: '入库单开单'
},
// 编辑/入库
stockIn: {
back: '/pages/warehousing/stockIn/components/detail',
title: ''
}
}
// 数据:路径参数
const pathParams = ref('')
// 标志:是否为编辑
const isEdit = ref('')
// 标志:区分页面 进入页面的状态 null新建 stockIn:入库编辑 stockIn-putAway入库单入库编辑
const flag = ref('')
// ref标题
const title = ref('入库单开单')
const backUrl = ref('pages/warehousing/index')
const title = ref('')
const backUrl = ref('')
// ref物料绑定
const materialRef = ref([])
@@ -49,20 +58,19 @@ const warehouseInfo = ref({ warehousing: {}, storageArea: {}, remark: '' })
// 数据:获取缓存信息
const getMaterialList = () => {
// 获取仓库信息
// 仓库信息
const warehouse = uni.getStorageSync('app_warehousing');
warehouseInfo.value.warehousing = warehouse
// 获取存储区信息
// 存储区信息
const storageArea = uni.getStorageSync('app_storageArea');
warehouseInfo.value.storageArea = storageArea
// 获取物料信息
// 物料信息
const material = uni.getStorageSync('app_material');
formData.value.material = material
// 获取入库单备注
// 入库单备注
const billRemark = uni.getStorageSync('app_billRemark');
warehouseInfo.value.remark = billRemark
}
@@ -128,65 +136,56 @@ const submitForm = () => {
billRemark: info.remark,
itemList: _.map(materialInfo, (i) => ({ ...i.material }))
}
console.log(params, isEdit, !isEdit, info, materialInfo, '入参params');
// 新建
if (!isEdit.value) {
addStockIn(params).then((res) => {
if (res.code == 200) {
uni.showToast({
title: '入库单创建成功',
mask: true,
icon: 'success',
})
uni.navigateTo({
url: `/pages/warehousing/stockIn/my`,
});
}
})
} else if (isEdit.value) {
// 编辑
params.billNo = pathParams.value?.billNo
params.billId = pathParams.value?.billId
const query = objectToQuery(pathParams.value)
stockInUpdate(params).then((res) => {
if (res.code == 200) {
uni.showToast({
title: '入库单编辑成功',
mask: true,
icon: 'success',
})
let url = `/pages/warehousing/stockIn/components/detail${query}`
uni.navigateTo({
url: url,
});
}
})
try {
if (!isEdit.value) {
// 新增
addStockIn(params).then((res) => {
if (res.code == 200) {
uni.showToast({ title: '入库单创建成功', icon: 'success', mask: true })
uni.navigateTo({ url: OPERATE_CONFIG.list.back })
}
})
} else {
// 编辑
params.billNo = pathParams.value?.billNo;
params.billId = pathParams.value?.billId;
const queryStr = objectToQuery(pathParams.value)
stockInUpdate(params).then((res) => {
if (res.code == 200) {
uni.showToast({ title: '入库单编辑成功', icon: 'success', mask: true })
uni.navigateTo({ url: OPERATE_CONFIG.stockIn.back + queryStr })
}
})
}
} catch (err) {
console.error('提交失败:', err)
uni.showToast({ title: '提交失败', icon: 'none' })
}
}
// 数据:路径参数
onLoad((options) => {
console.log(options, 'options', _.includes(options?.type, 'stockIn'));
pathParams.value = options
flag.value = options.type
isEdit.value = _.includes(options?.type, 'stockIn')
})
// 修改标题若有billNo传入 修改标题
onShow(() => {
const query = objectToQuery(pathParams.value)
if (pathParams.value.billNo) {
title.value = pathParams.value.billNo
}
if ( includes(pathParams.value.type,'stockIn') ) {
backUrl.value = `/pages/warehousing/stockIn/components/detail${query}`
console.log('options==>', options);
// 若有billNo传入 修改标题且为编辑 stockIn:入库编辑 stockIn-putAway入库单入库编辑
if (options?.billNo) {
const query = objectToQuery(options)
title.value = options.billNo
backUrl.value = OPERATE_CONFIG.stockIn.back + query;
isEdit.value = true
} else {
isEdit.value = false
title.value = OPERATE_CONFIG.list.title;
backUrl.value = OPERATE_CONFIG.list.back;
}
})
</script>
<style lang="scss" scoped>
.page {
.contentBox {
background: #f5f5f5;
min-height: 100vh;
}

View File

@@ -0,0 +1,170 @@
<!-- 选择 -->
<template>
<navigation title="我提交的技术鉴定表" :back-url="backUrl"></navigation>
<view class="contentBox">
<view class="topSearch">
<uni-easyinput type="text" v-model="queryParams.keyword" prefixIcon="search" :inputBorder="false"
@iconClick="getTechnicalList" placeholder="请输入搜索内容" />
</view>
<!-- 列表 -->
<z-paging ref="pagingRef" class="containerBox" v-model="infoList" @query="getTechnicalList">
<uni-list class="listBox">
<uni-list-item v-for="item in infoList" :key="item.id" clickable @click="onChecked(item)">
<template v-slot:body>
<view style="display: flex; flex-direction: column; width: 100%;">
<view class="line title">
<p>技术鉴定表</p>
<p>{{ item?.appraisalNo }}</p>
</view>
<view class="line content">
<uv-upload :fileList="item?.fileUrlList" name="3" multiple :maxCount="6"
:previewFullImage="true"></uv-upload>
</view>
<view class="line content">
<p>备注</p>
<p>
<span v-if="item?.appraisalDesc">{{ item?.appraisalDesc }}</span>
<span v-else class="empty">未填写</span>
</p>
</view>
<view class="line content">
<p>创建时间</p>
<view>{{ formatDate(item?.createTime) }}</view>
</view>
</view>
</template>
</uni-list-item>
</uni-list>
</z-paging>
</view>
</template>
<script setup>
import { ref, toRefs } from 'vue';
import { onShow, onLoad } from "@dcloudio/uni-app";
import { myList } from '@/api/stockOut';
import { formatDate, objectToQuery } from '../../../until';
import Navigation from '../../../components/Navigation.vue';
const props = defineProps({
pathParams: {
type: Object,
default: null,
required: false
}
})
const { pathParams } = toRefs(props)
// 数据:查询关键字
const queryParams = ref({
keyword: ''
})
// 数据:返回路径
const backUrl = ref('')
// 绑定:加载屏
const pagingRef = ref(null)
// 数据
const infoList = ref([])
// 选中技术鉴定表
const onChecked = (item) => {
if (item.appraisalNo) {
uni.setStorageSync('app_technical', item);
uni.navigateTo({
url: backUrl.value
});
}
}
// 列表
const getTechnicalList = (pageNo, pageSize) => {
queryParams.value.pageNum = pageNo
myList(queryParams.value).then(res => {
res.rows.forEach(e => {
e.showMore = false;
});
infoList.value = res.rows
pagingRef.value.complete(res.rows)
}).catch(res => {
pagingRef.value.complete(false)
})
}
// 数据:路径参数
onLoad((options) => {
pathParams.value = options
const query = objectToQuery(options)
backUrl.value = `/pages/warehousing/stockOut/components/technicalEvaluation${query}`
})
onShow(() => {
pagingRef.value?.reload?.()
})
const onDownLoad = () => {
}
</script>
<style scoped lang="scss">
.topSearch {
position: fixed;
top: 65rpx;
left: 0;
right: 0;
z-index: 999;
padding: 4rpx;
background-color: #fff;
border-bottom: 1px solid #eee;
box-sizing: border-box;
}
.containerBox {
padding-top: 125rpx !important;
width: 100%;
height: 100%;
box-sizing: border-box;
.zp-l-text-rpx {
font-size: 12px;
}
}
::v-deep.listBox {
.uni-list {
background-color: #F8F8FF;
}
.uv-upload {
flex: none !important;
}
.uni-list-item {
margin-bottom: 1rpx;
}
.uni-list-item__container {
padding: 0;
}
.line {
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid #eee;
padding: 12rpx;
}
.title {
font-weight: 600;
font-size: 14px;
}
.content {
font-weight: 500;
font-size: 13px;
}
.empty {
color: #D3D3D3;
}
}
</style>

View File

@@ -0,0 +1,204 @@
<!--点击出库单出库后的出库页面 -->
<template>
<navigation title="出库" :back-url="backUrl"></navigation>
<view class="contentBox">
<!-- 技术鉴定表 -->
<uv-form ref="formRef" class="form" :model="technicalEvaluationList" label-width="150rpx">
<uv-form-item label="技术鉴定表" prop="fileList" @click="toTechnical">
<u-cell>
<view slot="title" class="u-slot-title">
<text class="u-cell-text" v-if="technicalEvaluationList">
{{ technicalEvaluationList?.appraisalNo }}
</text>
<text class="placeholder" v-else> 请添加技术鉴定表</text>
<uni-icons type="right" size="10" />
</view>
</u-cell>
</uv-form-item>
</uv-form>
<!-- 仓库信息 - 仓库存储区 -->
<warehousing-info ref="warehousingInfoRef" :warehouseInfo="warehouseInfo"
:pathParams="{ ...pathParams, back: 'stockOut' }" />
<!-- 物料列表 - 添加物料 -->
<material-list ref="materialRef" :formData="formData" isEdit="5" backStr="stockOut" :pathParams="pathParams" />
<!-- 底部操作栏 -->
<view class="bottom">
<uv-button type="primary" @click="submitForm">出库</uv-button>
</view>
</view>
</template>
<script setup>
import _ from 'lodash';
import { ref } from 'vue';
import { onLoad } from "@dcloudio/uni-app";
import { outBoundFinish } from '@/api/stockOut';
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('')
// ref物料绑定
const materialRef = ref([])
// ref仓库信息绑定
const warehousingInfoRef = ref([])
// 数据:物料列表
const formData = ref([{ remark: '', material: [] }])
// 数据:仓库信息
const warehouseInfo = ref({ warehousing: {}, storageArea: {}, remark: '' })
// 技术鉴定表
const technicalEvaluationList = ref({
appraisalNo: '',
fileList: [],
remark:''
})
// 数据:获取缓存信息
const getMaterialList = () => {
// 获取仓库信息
const warehouse = uni.getStorageSync('app_warehousing');
warehouseInfo.value.warehousing = warehouse
// 获取存储区信息
const storageArea = uni.getStorageSync('app_storageArea');
warehouseInfo.value.storageArea = storageArea
// 获取出库单备注
const billRemark = uni.getStorageSync('app_billRemark');
warehouseInfo.value.remark = billRemark
// 获取技术鉴定表数据
const list = uni.getStorageSync('app_technical');
technicalEvaluationList.value.appraisalNo = list.appraisalNo
// 获取物料信息 - 有uniqueCode
const material = uni.getStorageSync('app_material');
formData.value.material = material
}
// 出库:提交表单
const submitForm = () => {
const info = warehousingInfoRef.value.getWarehousingInfo()
const materialInfo = materialRef.value.getMaterialList()
// 过滤出已删除的物料
const _materialInfo = _.filter(materialInfo, { isDelete: '0' })
let params = {
billType: '1',//0出库申请 1出库成功 2出库申请 3出库成功 4出库单已作废 5出库单已作废
billNo: pathParams.value.billNo,
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 }))
}
outBoundFinish(params).then((res) => {
// /pages/warehousing/stockOut/components/detail
uni.navigateTo({
url: backUrl.value
});
console.log(res, '出库单出库');
})
}
// 数据:路径参数
onLoad((options) => {
console.log(options, 'options', _.includes(options?.type, 'stockOut'));
if (!options.billNo) {
uni.showToast({ title: '参数错误,无唯一码ID', icon: 'none' })
return
}
pathParams.value = options
// stockOut-putAway
// stockOut
const query = objectToQuery(pathParams.value)
backUrl.value = `/pages/warehousing/stockIn/components/detail${query}`
})
onMounted(() => {
getMaterialList()
})
const toTechnical = () => {
const query = objectToQuery(pathParams.value)
uni.navigateTo({
url: `/pages/warehousing/stockOut/components/technicalEvaluation${query}`
})
}
</script>
<style lang="scss" scoped>
.page {
background: #f5f5f5;
min-height: 100vh;
}
/* 底部按钮 */
::v-deep .bottom {
position: fixed;
bottom: 0;
height: 60rpx;
font-size: 14px;
display: flex;
align-items: center;
justify-content: center;
width: 100%;
.uv-button-wrapper {
width: 100%;
border-radius: 0;
}
}
::v-deep .form {
// background-color: #fff;
padding: 0;
.uv-input__content {
.uv-input__content__field-wrapper__field {
text-align: right !important;
}
}
.uv-form-item__body {
background-color: #fff;
padding: 12rpx;
margin-bottom: 2rpx;
align-items: center;
}
.uv-form-item__body__left__content__label {
font-size: 14px;
}
.uv-line {
border-bottom: 0 !important;
}
.uv-form-item__body__right__content__slot {
justify-content: flex-end;
align-items: center;
}
.uv-cell__body {
padding: 0
}
.uni-icons {
display: block;
}
.u-slot-title {
display: flex;
align-items: center;
}
}
</style>

View File

@@ -0,0 +1,145 @@
<template>
<navigation title="技术鉴定表详情" :back-url="backUrl">
<template #right>
<my-link @click="toMyTechnicalList" style="font-size: 14px;">我的</my-link>
</template>
</navigation>
<view class="contentBox">
<uv-form labelPosition="top" :model="formModel" class="technicalForm" ref="technicalEvaluationRef"
labelWidth="auto">
<uv-form-item label="技术鉴定表" prop="fileList" style="margin-top: 16rpx;">
<uv-upload :fileList="formModel?.fileList" name="1" multiple :maxCount="6" @afterRead="afterRead"
@delete="deleteImg" :previewFullImage="true"></uv-upload>
</uv-form-item>
<uv-form-item label="技术鉴定表备注说明" prop="remark" style="margin-top: 16rpx;">
<uv-textarea v-model="formModel.remark" placeholder="请输入技术鉴定表备注说明..." border="none"></uv-textarea>
</uv-form-item>
</uv-form>
<view class="bottom">
<uv-button type="primary" @click="submitForm">提交信息</uv-button>
</view>
</view>
</template>
<script setup>
import { ref } from 'vue';
import { onLoad } from "@dcloudio/uni-app";
import { objectToQuery } from '../../../until';
import Navigation from '../../../components/Navigation.vue';
import { uploadTechnicalFile, addWithFiles } from '@/api/stockOut'
import _ from 'lodash';
const queryParams = ref('')
const formModel = ref({
billNo: null,
remark: '',
fileList: [],
})
const backUrl = ref('')
const afterRead = async (event) => {
// scene = outbound
// bizType = technical_appraisal
// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
console.log(event, '上传')
let files = event.file?.map(file => file.url);
// console.log('files', files);
let formData = {
scene: 'OUTBOUND',
bizType: 'TECHNICAL_APPRAISAL',
}
// files = files.map(p => ({ name: "files", uri: p }))
uploadTechnicalFile(files, formData).then(res => {
const some = _.some(res, { success: false })
console.log(some,'上传接口调取成功', res)
if (some) return;
if (!formModel.value.fileList || formModel.value.fileList.length == 0) {
formModel.value.fileList = []
}
res?.data?.fileUrlList.forEach(item => {
formModel.value.fileList.push({ url: item?.url, name: item?.name, scene: 'OUTBOUND', bizType: 'TECHNICAL_APPRAISAL' })
})
})
}
// 删除图片
const deleteImg = (index, type) => {
formModel.value.fileList?.splice(index, 1)
}
// 提交
const submitForm = () => {
console.log(formModel, 'formModel==>');
addWithFiles({ ...formModel.value, billNo: queryParams.value.billNo }).then((res) => {
if (res.code == 200) {
console.log(res.data);
}
})
}
// 数据:路径参数
onLoad((options) => {
const query = objectToQuery(options)
queryParams.value = options
backUrl.value = `/pages/warehousing/stockOut/components/outAway${query}`
})
const toMyTechnicalList = () => {
console.log('1111111111');
const query = objectToQuery(queryParams.value)
uni.navigateTo({
url: `/pages/warehousing/stockOut/components/myTechnicalEvaluation${query}`
});
}
// 获取技术鉴定编数据
const getTechnicalList = () => {
const list = uni.getStorageSync('app_technical');
formModel.value.fileList = list?.fileList
formModel.value.remark = list?.remark
}
getTechnicalList()
</script>
<style scoped lang="scss">
::v-deep.technicalForm {
.uv-form-item {
background-color: #fff;
padding: 0 24rpx;
}
.uv-form-item__body__left__content__label {
margin-bottom: 8px;
}
.uv-form-item__body {
background-color: #fff;
padding: 12rpx;
margin-bottom: 2rpx;
}
.uv-textarea {
padding: 0;
}
}
/* 底部按钮 */
::v-deep .bottom {
position: fixed;
bottom: 0;
height: 60rpx;
font-size: 14px;
display: flex;
align-items: center;
justify-content: center;
width: 100%;
.uv-button-wrapper {
width: 100%;
border-radius: 0;
}
.uv-button--info {
background-color: #07c160;
color: #fff;
}
}
</style>

View File

@@ -1,10 +1,12 @@
<template>
<view class="page">
<navigation :title="title" :back-url="backUrl"></navigation>
<navigation :title="title" :back-url="backUrl"></navigation>
<view class="contentBox">
<!-- 仓库信息 - 仓库存储区 -->
<warehousing-info ref="warehousingInfoRef" :warehouseInfo="warehouseInfo" :pathParams="pathParams" />
<warehousing-info ref="warehousingInfoRef" :warehouseInfo="warehouseInfo"
:pathParams="{ ...pathParams, type: 'stockOut' }" />
<!-- 物料列表 - 添加物料 -->
<material-list ref="materialRef" :formData="formData" isEdit="1" backStr="stockOut" :pathParams="pathParams" />
<material-list ref="materialRef" :formData="formData" :isEdit="flag == 'stockOut' ? 5 : 1"
:pathParams="{...pathParams.value, type: 'stockOut' }" />
<!-- 底部操作栏 -->
<view class="bottom">
<uv-button @click="scanCode">扫码添加</uv-button>
@@ -17,10 +19,10 @@
import _ from 'lodash';
import { ref } from 'vue';
import { objectToQuery } from '../../until';
import { objectToQuery, removeStorage } from '../../until';
import { onLoad, onShow } from "@dcloudio/uni-app";
import { addStockIn, stockInUpdate } from '@/api/stockIn';
import { getMaterialUnique } from '@/api/uniqueCode';
import { addStockOut, stockOutUpdate } from '@/api/stockOut';
import { getMaterialByQrCodeInfo } from '@/api/uniqueCode';
import MaterialList from '../../components/MaterialList.vue';
import WarehousingInfo from '../../components/WarehousingInfo.vue';
import Navigation from '../../components/Navigation.vue';
@@ -30,12 +32,14 @@ import { includes } from 'lodash';
const pathParams = ref('')
// 标志:是否为编辑
const isEdit = ref('')
// 标志:区分页面 进入页面的状态 null新建 stockIn:入库编辑 stockIn-putAway库单库编辑
// 标志:区分页面 进入页面的状态 null新建 stockOut:出库编辑 stockOut-putAway库单库编辑
const flag = ref('')
// ref标题
const title = ref('库单开单')
const title = ref('库单开单')
const backUrl = ref('pages/warehousing/index')
//ref:已经扫过的code
const existList = ref([])
// ref物料绑定
const materialRef = ref([])
@@ -49,7 +53,6 @@ const warehouseInfo = ref({ warehousing: {}, storageArea: {}, remark: '' })
// 数据:获取缓存信息
const getMaterialList = () => {
// 获取仓库信息
const warehouse = uni.getStorageSync('app_warehousing');
warehouseInfo.value.warehousing = warehouse
@@ -62,44 +65,53 @@ const getMaterialList = () => {
const material = uni.getStorageSync('app_material');
formData.value.material = material
// 获取库单备注
// 获取库单备注
const billRemark = uni.getStorageSync('app_billRemark');
warehouseInfo.value.remark = billRemark
}
getMaterialList();
const scanResult = ref('')
// 扫码添加
const scanCode = () => {
// 先校验是否支持扫码
uni.scanCode({
scanType: ['qrCode', 'barCode'], // 支持二维码 + 条形码
success: (res) => {
scanResult.value = res.result;
console.log('二维码code====>', res.result);
const idx = includes(existList, res.result)
if (idx) {
uni.showToast({
title: '该物料已添加,请勿重复添加!',
mask: true,
icon: 'none',
})
return
}
if (res.result) {
getMaterialUnique({ code: res.result }).then((response) => {
console.log('物料内容:', response);
getMaterialByQrCodeInfo({ code: res.result, existList: existList.value }).then((response) => {
console.log('物料内容====>', response);
if (`${response.code}` === '200') {
const material = uni.getStorageSync('app_material');
// 处理物料信息 合并
const materialInfo = _.filter(material, { isDelete: '0' });
console.log('materialInfo', materialInfo);
console.log('materialInfo====>', materialInfo);
const materialId = response.data?.[0]?.materialId;
console.log('materialId', materialId);
const idx = _.findIndex(materialInfo, (i) => i.materialId ? i.materialId == materialId : i.id == materialId);
console.log('已选中是否有重复数据', idx);
console.log('materialId====>', materialId);
// const idx = _.findIndex(materialInfo, (i) => i.materialId ? i.materialId == materialId : i.id == materialId);
// console.log('已选中是否有重复数据====>', idx);
if (idx != -1) {
uni.showToast({
title: '该物料已添加,请勿重复添加!',
mask: true,
icon: 'none',
})
} else {
let _material = [...materialInfo, { ...response.data[0], uniqueCode: res.result }]
console.log('新的物料数组', _material);
formData.value.material = _material
uni.setStorageSync('app_material', formData.value.material)
}
// if (idx != -1) {
// uni.showToast({
// title: '该物料已添加,请勿重复添加!',
// mask: true,
// icon: 'none',
// })
// } else {
let _material = [...materialInfo, { ...response.data[0], uniqueCode: res.result }]
console.log('新的物料数组====>', _material);
formData.value.material = _material
uni.setStorageSync('app_material', formData.value.material)
existList.value.push(res.result)
// }
} else {
console.log(response.code, 'response.code');
}
@@ -118,7 +130,9 @@ const scanCode = () => {
const submitForm = () => {
const info = warehousingInfoRef.value.getWarehousingInfo()
const materialInfo = materialRef.value.getMaterialList()
if (!info.warehousing?.[0].deptCode) {
console.log(info, 'info==>');
if (!info.warehousing?.[0]?.deptName) {
uni.showToast({
title: '请填写仓库信息',
mask: true,
@@ -126,7 +140,7 @@ const submitForm = () => {
})
return
}
if (!info.storageArea?.[0].deptName) {
if (!info.storageArea?.[0]?.deptName) {
uni.showToast({
title: '请填写存储区信息',
mask: true,
@@ -146,15 +160,16 @@ const submitForm = () => {
console.log(params, isEdit, !isEdit, info, materialInfo, '入参params');
// 新建
if (!isEdit.value) {
addStockIn(params).then((res) => {
addStockOut(params).then((res) => {
if (res.code == 200) {
uni.showToast({
title: '库单创建成功',
title: '库单创建成功',
mask: true,
icon: 'success',
})
removeStorage()
uni.navigateTo({
url: `/pages/warehousing/stockIn/my`,
url: `/pages/warehousing/stockOut/my`,
});
}
@@ -164,14 +179,14 @@ const submitForm = () => {
params.billNo = pathParams.value?.billNo
params.billId = pathParams.value?.billId
const query = objectToQuery(pathParams.value)
stockInUpdate(params).then((res) => {
stockOutUpdate(params).then((res) => {
if (res.code == 200) {
uni.showToast({
title: '库单编辑成功',
title: '库单编辑成功',
mask: true,
icon: 'success',
})
let url = `/pages/warehousing/stockIn/components/detail${query}`
let url = `/pages/warehousing/stockOut/components/detail${query}`
uni.navigateTo({
url: url,
});
@@ -182,21 +197,23 @@ const submitForm = () => {
}
// 数据:路径参数
onLoad((options) => {
console.log(options, 'options', _.includes(options?.type, 'stockIn'));
console.log(options, 'options', _.includes(options?.type, 'stockOut'));
pathParams.value = options
flag.value = options.type
isEdit.value = _.includes(options?.type, 'stockIn')
isEdit.value = _.includes(options?.type, 'stockOut')
})
// 修改标题若有billNo传入 修改标题
onShow(() => {
const query = objectToQuery(pathParams.value)
if (pathParams.value.billNo) {
title.value = pathParams.value.billNo
}
// /pages/warehousing/stockIn/components/detail?billNo=DL1775619567111&type=stockOut
if (includes(pathParams.value.type, 'stockOut')) {
backUrl.value = `/pages/warehousing/stockIn/components/detail${query}`
}
if (pathParams.value.billNo) {
title.value = pathParams.value.billNo
}
})
</script>

View File

@@ -4,5 +4,4 @@
</template>
<script setup>
import SearchList from '../../components/SearchList.vue';
</script>

View File

@@ -1,6 +1,8 @@
<!-- 底部导航栏仓库 -->
<template>
<view class="content">
<navigation title="仓储" :showBack="false"></navigation>
<view class="contentBox">
<uni-card v-for="(item, index) in menuList" :key="item.id" :title="item.title" :isFull="true"
class="custom-card">
<view v-for="value in item.menuItem" :key="value.id" class="card_items" @click="value.click">
@@ -14,6 +16,8 @@
<script setup>
import { onShow } from '@dcloudio/uni-app';
import { removeStorage } from '../until';
import Navigation from '../components/Navigation.vue';
const menuList = [
{
id: 'inventory',
@@ -152,7 +156,7 @@ const menuList = [
click: () => {
console.log('入库单入库')
uni.navigateTo({
url: '/pages/warehousing/stockIn/putaway'
url: '/pages/warehousing/stockIn/putAway'
});
}

View File

@@ -1,6 +1,6 @@
<!-- 仓库信息选择 -->
<template>
<choose-list :isWarehousing="isWarehousing" :backStr="pathParams.backStr" :pathParams="pathParams" />
<choose-list :isWarehousing="isWarehousing" :backStr="pathParams.back" :pathParams="pathParams" />
</template>
<script setup>
import { computed, ref } from 'vue'

View File

@@ -1,64 +1,65 @@
<!-- 唯一码发放页面 - 唯一码发放唯一码编辑入库单快速生成唯一码 -->
<template>
<view class="content">
<navigation :title="title" :back-url="backUrl"></navigation>
<navigation :title="title" :back-url="backUrl"></navigation>
<view class="contentBox">
<view class="remarkLine">
<span>备注</span>
<uni-easyinput type="text" v-model="formData.remark" :inputBorder="false" placeholder="请输入备注" />
</view>
<!-- 物料列表 - 添加物料 -->
<material-list ref="materialRef" :formData="formData" :remark="formData.remark" isEdit="1" :backStr="backStr"
<material-list ref="materialRef" :formData="formData" :remark="formData.remark" isEdit="1"
:pathParams="pathParams" />
<button class="bottom-btn" type="primary" @click="handleSubmit">提交</button>
</view>
</template>
<script setup>
import { ref, onMounted } from 'vue';
import { onLoad, onShow } from '@dcloudio/uni-app';
import { onLoad } from '@dcloudio/uni-app';
import { addUniqueCode, editUniqueCode } from '@/api/uniqueCode';
import MaterialList from '../../../components/MaterialList.vue';
import Navigation from '../../../components/Navigation.vue';
import { objectToQuery } from '../../../until';
import { computed } from 'vue';
import _ from 'lodash';
import { includes } from 'lodash';
const OPERATE_CONFIG = {
// 唯一码创建
issueUniqueCode: {
title: '唯一码发放',
back: 'pages/warehousing/index'
},
//唯一码编辑
issueUniqueCode_edit: {
title: '',
back: '/pages/warehousing/uniqueCode/myUniqueCode'
},
//入库单入库
stockIn_inbound: {
title: '快速生成唯一码',
back: '/pages/warehousing/stockIn/components/inbound'
},
}
// ref标题
const title = ref('入库单开单')
const backUrl = ref('pages/warehousing/index')
const title = ref('')
const backUrl = ref('')
// 数据:路径参数
const pathParams = ref('')
// 数据:物料、备注
const formData = ref({ remark: '', material: [] })
// ref:绑定物料列表
const materialRef = ref([])
const backStr = computed(() => pathParams.value.back == 'inbound' ? `issueUniqueCode_inbound` : 'issueUniqueCode')
// 接收路径参数 - 修改标题- 携带code、id、materialId
onLoad((options) => {
const query = objectToQuery(options)
pathParams.value = options
const config = options.type ? OPERATE_CONFIG[options.type] : OPERATE_CONFIG.issueUniqueCode
title.value = config.title ? config.title : options.title
backUrl.value = config.back + query
})
onShow(() => {
// 唯一码发放、唯一码编辑、入库单快速生成唯一码
const query = objectToQuery(pathParams.value)
if (pathParams.value.title) {
// 唯一码编辑 /pages/warehousing/uniqueCode/myUniqueCode/detail?id=64&code=600064
title.value = pathParams.value.title
backUrl.value = `/pages/warehousing/uniqueCode/myUniqueCode${query}`
} else if (includes(pathParams.value.back, 'inbound')) {
// 入库单快速生成唯一码 /pages/warehousing/uniqueCode/issueUniqueCode/index?billNo=WR1775527275119&back=inbound
title.value = '快速生成唯一码'
backUrl.value = `/pages/warehousing/stockIn/components/inbound${query}`
} else {
title.value = '唯一码发放'
backUrl.value = 'pages/warehousing/index'
}
})
onMounted(() => {
// 快速生成唯一码时 已选择的物料列表初始为空 点击添加物料 去选择
if (pathParams.value.back != 'inbound') {
if (pathParams.value.type != 'inbound') {
getMaterialList();
}
@@ -67,12 +68,12 @@ onMounted(() => {
const handleSubmit = () => {
// 物料最新编辑数据
const material = materialRef.value.getMaterialList()?.[0]
const query = objectToQuery(pathParams.value)
const params = {
remark: formData.value.remark,
material: { ...material.material, unitId: '23' }
}
if (pathParams.value.back == `issueUniqueCode_inbound`) {
if (pathParams.value.type == `issueUniqueCode_inbound`) {
params.billNo = pathParams.value.billNo
}
if (pathParams.value.id) {
@@ -87,7 +88,7 @@ const handleSubmit = () => {
icon: 'success',
})
uni.navigateTo({
url: `/pages/warehousing/uniqueCode/myUniqueCode/detail?id=${pathParams.value.id}&title=${pathParams.value.title}`,
url: OPERATE_CONFIG.issueUniqueCode_edit.back + query
});
}
@@ -100,17 +101,15 @@ const handleSubmit = () => {
mask: true,
icon: 'success',
})
if (_.includes(pathParams.value?.back, 'inbound')) {
// /pages/warehousing/uniqueCode/myUniqueCode/detail?id=38&code=600038
if (_.includes(pathParams.value?.type, 'inbound')) {
uni.navigateTo({
url: `/pages/warehousing/stockIn/components/inbound?billNo=${pathParams.value.billNo}`,
url: OPERATE_CONFIG.stockIn_inbound.back + query
});
} else {
uni.switchTab({
url: "/pages/warehousing/index"
url: OPERATE_CONFIG.issueUniqueCode.back
})
}
// /pages/warehousing/stockIn/components/inbound?billNo=WR1775032495153
}

View File

@@ -1,14 +1,14 @@
<!-- 物料选择 -->
<template>
<view class="content">
<view class="topSearch" v-if="!backUrl.includes('inbound')">
<view class="contentBox">
<view class="topSearch" v-if="!isInbound">
<uni-easyinput type="text" v-model="queryParams.keyword" prefixIcon="search" :inputBorder="false"
@iconClick="getMaterialList" placeholder="请输入搜索内容" />
</view>
<!-- 物料列表 -->
<z-paging ref="pagingRef" class="containerBox" v-model="materialList" @query="getMaterialList"
v-if="!backUrl.includes('inbound')">
v-if="!isInbound">
<uni-list>
<uni-list-item v-for="item in materialList" :key="item.id" clickable class="material-card"
@click="onMaterial(item)">
@@ -33,7 +33,7 @@
</uni-list>
</z-paging>
<view v-if="backUrl.includes('inbound')">
<view v-if="isInbound">
<uni-list>
<uni-list-item v-for="item in materialList" :key="item.id" clickable class="material-card"
@click="onMaterial(item)">
@@ -66,7 +66,28 @@ import { getTypeParentNames, } from '../until';
import { objectToQuery } from '../../../until';
import { getMaterial } from '@/api/uniqueCode'
import { onShow, onLoad } from "@dcloudio/uni-app";
const OPERATE_CONFIG = {
// 唯一码创建
issueUniqueCode: {
back: '/pages/warehousing/uniqueCode/issueUniqueCode/index'
},
//唯一码编辑
issueUniqueCode_edit: {
back: '/pages/warehousing/uniqueCode/issueUniqueCode/index'
},
//入库单开单
stockIn: {
back: '/pages/warehousing/stockIn/create'
},
//入库单入库
stockIn_inbound: {
back: '/pages/warehousing/uniqueCode/issueUniqueCode/index'
},
//入库单编辑
stockIn_detail: {
back: '/pages/warehousing/stockIn/create'
},
}
// ref:下拉加载
const pagingRef = ref(null)
// 数据:查询参数
@@ -77,9 +98,9 @@ const queryParams = ref({
const materialList = ref([])
// 数据:路径参数
const pathParams = ref('')
// 数据:返回路径标识 stockIn 入库单开单 stockInDetail入库单编辑 issueUniqueCode唯一码 issueUniqueCode_inbound入库生成唯一码
const backUrl = computed(() => pathParams?.value?.back)
// 数据:返回路径标识
const keyType = computed(() => pathParams?.value?.type)
const isInbound = computed(() => _.includes(pathParams?.value?.type, 'inbound'))
// 方法:获取列表
const getMaterialList = () => {
getMaterial(queryParams.value).then(res => {
@@ -94,10 +115,7 @@ const getMaterialList = () => {
// 方法:获取列表 - 入库生成唯一码
const getMaterialListInbound = () => {
const list = uni.getStorageSync('app_material_select_list')
console.log('list',list);
materialList.value=list
materialList.value = list
}
onShow(() => {
@@ -118,76 +136,39 @@ const getStorageMaterial = (val) => {
}
return [{ ...val, quantity: 1 }]
}
// 方法:返回路径
const toBack = (back) => {
const path = objectToQuery({ ...pathParams.value })
let url = ''
switch (back) {
case 'stockIn':
// 入库单开单添加物料进入
url = `/pages/warehousing/stockIn/create`
break
case 'issueUniqueCode':
case 'issueUniqueCode_inbound':
// 唯一码发放/入库生成唯一码
url = `/pages/warehousing/uniqueCode/issueUniqueCode/index`
break
case 'stockInDetail':
//我的入库单/入库单入库
url = `/pages/warehousing/stockIn/components/detail`
break
}
uni.navigateTo({
url: `${url}${path}`
})
}
// 方法:选择物料
const onMaterial = (val) => {
let materialChecked = uni.getStorageSync('app_material');
const path = objectToQuery(pathParams.value)
if (!Array.isArray(materialChecked)) {
materialChecked = [];
}
console.log(materialChecked, 'materialChecked==>');
const item = _.find(materialChecked, (i) => i.materialId ? i.materialId === val.id : i.id === val.id)
console.log(item, 'item==>');
const idx = _.findIndex(materialChecked, (i) => i.materialId ? i.materialId === val.id : i.id === val.id)
console.log(idx, 'idx==>', idx != -1 && item?.isDelete == '0', backUrl.value);
if (idx != -1 && item?.isDelete == '0') { // isDelete为0表示未删除 1为已删除数据不在对比范围内
console.log(backUrl.value == 'stockIn', '11111111111111111111111111');
if (backUrl.value == 'stockIn') {
console.log(111111111111);
if (keyType.value === 'stockIn') {
uni.showToast({
title: '该物料已添加,请勿重复添加!',
mask: true,
icon: 'none',
})
}
//! 现在仅允许添加一条物料打印一个唯一码 但保留可添加多个
// uni.showToast({
// title: '该物料已添加,请勿重复添加!',
// mask: true,
// icon: 'none',
// })
toBack(backUrl.value)
} else {
console.log('执行到这里');
} else {
if (val) {
if (backUrl.value == 'stockIn') {
if (keyType.value == 'stockIn') {
materialChecked = [...materialChecked, { ...val, quantity: 1, isDelete: '0' }];
} else {
materialChecked = getStorageMaterial(val)
}
uni.setStorageSync('app_material', materialChecked);
}
toBack(backUrl.value)
}
uni.navigateTo({
url: OPERATE_CONFIG?.[keyType.value].back + path
})
}
</script>

View File

@@ -136,7 +136,7 @@ const toTraceability = () => {
// 修改:唯一码的物料信息 - 携带title和唯一码id
const toEdit = () => {
uni.navigateTo({
url: `/pages/warehousing/uniqueCode/issueUniqueCode/index?title=${pathParams.value.code}&id=${pathParams.value.id}`,
url: `/pages/warehousing/uniqueCode/issueUniqueCode/index?title=${pathParams.value.code}&id=${pathParams.value.id}type=issueUniqueCode_edit`,
});
}

View File

@@ -1,11 +1,11 @@
<!-- 唯一码 -->
<template>
<view class="content">
<navigation title="唯一码" back-url="pages/warehousing/index"></navigation>
<navigation title="唯一码" back-url="pages/warehousing/index"></navigation>
<view class="contentBox">
<view class="topSearch">
<uni-easyinput type="text" v-model="queryParams.code" prefixIcon="search" :inputBorder="false"
@iconClick="getMaterialList" placeholder="请输入关键词搜索" />
</view>
<!-- 唯一码列表 -->
@@ -61,11 +61,11 @@
</template>
<script setup>
import { ref } from 'vue';
import { getStatusName, getDetail } from '../until';
import { onShow } from "@dcloudio/uni-app";
import { getUniqueCodeList, delUniqueCode, detailUniqueCode } from '@/api/uniqueCode'
import QrCodeModal from './QrCodeModal.vue';
import { getStatusName, getDetail } from '../until';
import Navigation from '../../../components/Navigation.vue';
import { getUniqueCodeList, delUniqueCode, detailUniqueCode } from '@/api/uniqueCode'
const queryParams = ref({
code: ''
@@ -144,10 +144,10 @@ const getDetailInfo = (row) => {
<style scoped lang="scss">
.topSearch {
position: fixed;
top: var(--nav-height); /* 关键:自动在导航栏下方 */
top: var(--nav-height);
left: 0;
right: 0;
z-index: 99; /* 比导航栏小 */
z-index: 99;
padding: 8rpx 16rpx;
background-color: #fff;
border-bottom: 1px solid #eee;
@@ -155,8 +155,7 @@ const getDetailInfo = (row) => {
}
.containerBox {
// padding: 0 12rpx;
padding-top: 90px !important; /* 撑开:导航栏+搜索框高度 */
padding-top: 100px !important;
width: 100%;
height: 100%;
box-sizing: border-box;

View File

@@ -13,7 +13,7 @@ const statusMenu = [
},
{
value: 1,
label: "已打印",
label: "入库单开单",
},
{
value: 2,
@@ -21,11 +21,15 @@ const statusMenu = [
},
{
value: 3,
label: "出库,",
label: "出库单开单",
},
{
value: 3,
label: "已配送,",
value: 4,
label: "已出库",
},
{
value: 9,
label: "已作废",
},
];
export const getStatusName = (val) => {