报表申报智能运输页面完成

This commit is contained in:
zx
2026-04-23 14:35:54 +08:00
parent 6f1db0f92e
commit 5ca85c1f0d
53 changed files with 3659 additions and 292 deletions

View File

@@ -0,0 +1,214 @@
<template>
<!-- 自定义导航栏 -->
<navigation :title="pathParams.billNo" :back-url="backUrl">
<template #right>
<view class="right-btn flex align-center justify-center ">
<uv-image @tap="onPrinter" src="../../../../static/printer.png" width="20px" height="20px"
style="margin-top:10rpx" />
<uv-image v-if="detailInfo.status != '9'" @tap="toEditOrAway('2')" src="../../../../static/edit.png"
class="ml-24" width="20px" height="20px" style="margin-top:10rpx" />
</view>
</template>
</navigation>
<view class="contentBox">
<view class="detailInfo mb-2">
<view class="line title">
<p> 申报单号{{ detailInfo?.billNo }}</p>
<text>{{ getLabel(declareType, detailInfo?.status) }}</text>
</view>
<p class="line content">联系人
<text> {{ detailInfo?.contactName || '-' }}</text>
</p>
<p class="line content">联系电话
<text> {{ detailInfo?.contactPhone || '-' }}</text>
</p>
<p class="line content">地址
<text>{{ detailInfo?.address || '-' }}</text>
</p>
<p class="line content">交付时间
<text>{{ detailInfo?.deliveryTime ? detailInfo?.deliveryTime === '0' ? '15天' :
detailInfo?.deliveryTime === '1' ? '立即' : '其他' : '-' }}</text>
</p>
<p class="line content">申报时间
<text>{{ detailInfo?.createTime || '-' }}</text>
</p>
<view class="detailInfo mb-2 mt-4">
<view class="line title">
<p> 打卡图片</p>
</view>
<view class="line">
<uv-upload :fileList="detailInfo?.fileList" name="3" multiple
:maxCount="detailInfo?.fileList?.length" :previewFullImage="true"></uv-upload>
</view>
</view>
</view>
<!-- 物料列表 -只读 -->
<material-list ref="materialRef" isEdit="3" :extendData="{ billType: detailInfo?.billType }"
:pathParams="{ billNo: detailInfo?.billNo }" backStr="declarationDetail"
:formData="{ material: detailInfo.itemList }" />
<!-- 底部按钮 -->
<view :class="detailInfo.status == '9' ? 'bottom1' : 'bottom'">
<uv-button type="error" v-if="detailInfo.status != '9'" text="作废" @tap="toObsolete"></uv-button>
<uv-button type="primary" text="申报单转入库单" @tap="toEditOrAway('1')"></uv-button>
</view>
</view>
</template>
<script setup>
import _ from 'lodash';
import { ref, computed } from 'vue';
import { onLoad } from "@dcloudio/uni-app";
import { objectToQuery, getLabel, declareType, removeStorage } from '../../../until';
import { declareBillDetail, declareBillVoid } from '@/api/declaration';
import MaterialList from '../../../components/MaterialList.vue';
import Navigation from '../../../components/Navigation.vue';
// ref:返回路径
const backUrl = ref('')
// 数据:路径参数
const pathParams = ref('')
// 数据:详情
const detailInfo = ref('')
// type
const OPERATE_CONFIG = {
declaration: {
back: '/pages/warehousing/Declaration/my',
backType: 'declaration_detail',
},
my: {
back: '/pages/warehousing/Declaration/my',
backType: 'declaration_detail'
},
}
// 打印
const onPrinter = () => { }
// 获取详情
const getDetailInfo = () => {
declareBillDetail({ billNo: pathParams.value.billNo }).then((res) => {
const fileList = _.map(res.data?.fileList, (i) => ({ ...i, url: i.fileUrl, name: i?.fileName, }))
detailInfo.value = { ...res.data, fileList: fileList }
})
}
// 作废
const toObsolete = () => {
declareBillVoid({
id: detailInfo.value.id
}).then((res) => {
console.log();
if (res.code == 200) {
uni.showToast({
title: '申报单作废成功',
mask: true,
icon: 'success',
})
getDetailInfo()
}
})
}
const setStorage = () => {
removeStorage()
uni.setStorageSync('app_material', detailInfo.value.itemList)
uni.setStorageSync('app_declaration', detailInfo.value)
}
/**
* 路径跳转操作 编辑、转为入库单
* @param {any} type - 类型标识1 转为入库单 2 编辑
*/
const toEditOrAway = (key) => {
const query = objectToQuery(pathParams.value)
setStorage()
if (key === '1') {
uni.navigateTo({
url: `/pages/warehousing/stockIn/create${query}`
});
} else {
uni.navigateTo({
url: `/pages/warehousing/Declaration/create${query}`
});
}
}
// 接收路径参数
onLoad((options) => {
pathParams.value = options;
const { type } = options;
let queryStr = objectToQuery(options);
let query = { ...options }
if (!options.billNo) {
uni.showToast({ title: '参数错误,无唯一码ID', icon: 'none' })
return
}
if (type != 'my') {
const { billNo, ...restParams } = options;
queryStr = objectToQuery(restParams);
}
backUrl.value = OPERATE_CONFIG?.[pathParams.value.type]?.back + `${queryStr}`
getDetailInfo()
})
</script>
<style scoped lang="scss">
// 底部按钮
.bottom {
position: fixed;
bottom: 0;
height: 60rpx;
font-size: 14px;
display: flex;
align-items: center;
justify-content: center;
width: 100%;
.uv-button-wrapper {
width: 50%;
border-radius: 0;
}
}
.line {
display: flex;
background-color: #fff;
align-items: center;
padding: 6rpx 20rpx;
justify-content: space-between;
}
.title {
display: flex;
justify-content: space-between;
font-weight: 600;
border-bottom: 0.5px solid #ECEFF1;
font-size: 13px;
}
.content {
font-weight: 500;
font-size: 13px;
}
.bottom1 {
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;
}
}
</style>

View File

@@ -0,0 +1,170 @@
<template>
<navigation title="物料库存查询" back-url="/pages/warehousing/Declaration/materialQuery" />
<view class="contentBox">
<view class="topSearch">
<uni-easyinput type="text" v-model="queryParams.keyword" prefixIcon="search" :inputBorder="false"
@iconClick="getList" placeholder="请输入搜索内容" />
</view>
<!-- 物料库存查询 -->
<z-paging ref="pagingRef" class="containerBox" v-model="infoList" @query="getDetailInfo">
<uni-list class="listBox">
<uni-list-item v-for="item in infoList" :key="item.id" clickable @tap="onChecked(item)">
<template v-slot:body>
<view style="display: flex; flex-direction: column; width: 100%;">
<view class="line title">
<p>{{ item.materialName }} - {{ item.materialCode }}</p>
</view>
<view class="line content" style="color: #F44336;">
<p>库存量</p>
<p>{{ item.stockQty }}{{ item.unitName }}</p>
</view>
<view class="line content">
<p>所在仓库</p>
<p>{{ item.warehouseName }} - {{ item.areaName }}</p>
</view>
<view class="line content">
<p>物料类别</p>
<p>{{ item.typeName }}</p>
</view>
<view class="line content">
<p>物料规格</p>
<p>{{ item.specification }}</p>
</view>
<view class="line content">
<p>物料型号</p>
<p> <text v-if="item?.model">{{ item?.model }}</text>
<text v-else class="empty">未填写</text>
</p>
</view>
<view class="line content">
<p>物料说明</p>
<p>
<text v-if="item?.materialDesc">{{ item?.materialDesc }}</text>
<text v-else class="empty">未填写</text>
</p>
</view>
</view>
</template>
</uni-list-item>
</uni-list>
</z-paging>
</view>
</template>
<script setup>
import { ref } from 'vue';
import { onShow, onLoad } from "@dcloudio/uni-app";
import { stockList } from '@/api/declaration';
import Navigation from '../../../components/Navigation.vue';
import { objectToQuery } from '../../../until';
const pathParams = ref('')
const queryParams = ref({
keyword: ''
})
const pagingRef = ref(null)
const infoList = ref([])
onLoad((options) => {
pathParams.value = options;
})
const getDetailInfo = () => {
const val = pathParams.value.warehouseCode
const params = {
warehouseCode: val,
keyword: queryParams.value.keyword
}
stockList(params).then(res => {
res.data.forEach(e => {
e.showMore = false;
});
infoList.value = res.data
pagingRef.value.complete(res.data)
}).catch(res => {
pagingRef.value.complete(false)
})
}
const onChecked = (val) => {
const query = objectToQuery({ ...pathParams.value, materialId: val.materialId })
console.log(query);
uni.navigateTo({
url: `/pages/warehousing/InventoryInfo/components/inventoryAgeDetail${query}`
})
}
onShow(() => {
pagingRef.value?.reload?.()
})
</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: 120rpx !important;
width: 100%;
height: 100%;
box-sizing: border-box;
.zp-l-text-rpx {
font-size: 12px;
}
}
::v-deep.listBox {
background-color: #F8F8FF;
.uni-list-item {
margin-bottom: 8rpx;
}
.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;
}
.title::before {
content: '';
position: absolute;
left: 0;
top: 0;
width: 4rpx;
height: 45rpx;
background: #08a089;
}
.content {
font-weight: 500;
font-size: 13px;
}
.empty {
color: #D3D3D3;
}
}
</style>

View File

@@ -0,0 +1,385 @@
<template>
<navigation :title="title" :back-url="backUrl">
<template #right>
<my-link @tap="toMyDeclaration" style="font-size: 14px;">我的</my-link>
</template>
</navigation>
<view class="contentBox">
<uv-form ref="formRef" labelPosition="left" class="form" :model="formData" label-width="150rpx">
<!-- 联系人 -->
<uv-form-item label="联系人" prop="contactName">
<uv-input placeholder="请输入联系人" v-model="formData.contactName" clearable border="none" />
</uv-form-item>
<!-- 联系电话 -->
<uv-form-item label="联系电话" prop="contactPhone">
<uv-input placeholder="请输入联系电话" maxlength="11" type="number" v-model="formData.contactPhone" clearable
border="none" />
</uv-form-item>
<!-- 交付时间 -->
<uv-form-item label="交付时间" @tap="toChooseTime">
<view v-if="formData?.deliveryTime">{{ formData.deliveryTime
=== '0' ? '15天' : formData.deliveryTime === '1' ? '立即' : '其他' }}</view>
</uv-form-item>
<!-- 存放地址 -->
<uv-form-item label="存放地址" prop="address" class="topLabel">
<uv-textarea v-model="formData.address" placeholder="请输入存放地址" border="none"></uv-textarea>
</uv-form-item>
<!-- 申报图片 -->
<uv-form-item label="申报图片" prop="fileList" class="topLabel">
<uv-upload :fileList="formData?.fileList" name="1" multiple :maxCount="6" @afterRead="afterRead"
@delete="deleteImg" :previewFullImage="true"></uv-upload>
</uv-form-item>
</uv-form>
<!-- 物料列表 - 添加物料 -->
<MaterialList ref="materialRef" :formData="{ material: formData?.itemList }"
:isEdit="flag == 'declaration_edit' ? 5 : 1" :pathParams="{ ...pathParams.value, type: 'declaration' }"
@setStorage="toSetStorage" />
<!-- 底部操作栏 -->
<view class="bottom">
<uv-button @tap="scanCode">扫码添加</uv-button>
<uv-button type="primary" @tap="submitForm">提交</uv-button>
</view>
</view>
<!-- 选择物料 -->
<uv-modal ref="modalRef" class="chooseModal" :title="none" :showConfirmButton="false" :showCancelButton="false">
<p class="link" @tap="toCheckTime('0')">15天</p>
<p class="link" @tap="toCheckTime('1')">立即</p>
<p class="link" @tap="toCheckTime('2')">其他</p>
</uv-modal>
</template>
<script setup>
import _ from 'lodash';
import { ref } from 'vue';
import { onLoad } from "@dcloudio/uni-app";
import { objectToQuery, removeStorage } from '../../until';
import { addDeclareBill, declareBillUpdate } from '@/api/declaration'
import { uploadTechnicalFile } from '@/api/stockOut'
import { getMaterialByQrCodeInfo } from '@/api/uniqueCode';
import Navigation from '../../components/Navigation.vue';
import MaterialList from '../../components/MaterialList.vue';
const OPERATE_CONFIG = {
declaration: {
title: '申报单开单',
back: 'pages/warehousing/index'
},
my: {
title: '',//申报单编辑
back: '/pages/warehousing/Declaration/components/detail'
},
}
const title = ref('申报单开单')// ref标题
const backUrl = ref('')
const formData = ref({ itemList: [], contactName: '', contactPhone: '', address: '', fileList: [], deliveryTime: '' })
// 数据:路径参数
const pathParams = ref('')
// 标志:区分页面
const flag = ref('')
// ref物料绑定
const materialRef = ref([])
// 弹窗:交付时间选择
const modalRef = ref()
// 交付时间选择
const toChooseTime = () => {
modalRef.value.open()
}
const toCheckTime = (val) => {
formData.value.deliveryTime = val
modalRef.value.close()
}
// 上传申报图片
const afterRead = async (event) => {
// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
let files = event.file?.map(file => file.url);
let formDataVal = {
scene: 'DECLARE',
bizType: 'DECLARE_ADDRESS',
}
uploadTechnicalFile(files, formDataVal).then(res => {
const some = _.some(res, { success: false })
if (some) return;
if (!formData.value?.fileList || formData.value?.fileList.length == 0) {
formData.value.fileList = []
}
res?.forEach(item => {
formData.value.fileList.push({ url: item?.url, name: item?.name, scene: 'DECLARE', bizType: 'DECLARE_ADDRESS' })
})
})
}
const toMyDeclaration = () => {
const query = objectToQuery(pathParams.value)
uni.navigateTo({
url: `/pages/warehousing/Declaration/my${query}`,
});
}
// 数据:缓存当前填入数据
const toSetStorage = () => {
uni.setStorageSync('app_declaration', formData.value)
}
// 数据:获取缓存信息
const getDeclarationInfo = () => {
const declarationInfo = uni.getStorageSync('app_declaration');// 申报信息
formData.value = declarationInfo || { itemList: [], contactName: '', contactPhone: '', address: '', fileList: [], deliveryTime: '' }
const material = uni.getStorageSync('app_material') || []; // 物料信息
formData.value.itemList = material
}
// 扫码添加
const scanCode = () => {
// 先校验是否支持扫码
uni.scanCode({
scanType: ['qrCode', 'barCode'], // 支持二维码 + 条形码
success: (res) => {
const idx = includes(existList, res.result)
if (idx) {
uni.showToast({
title: '该物料已添加,请勿重复添加!',
mask: true,
icon: 'none',
})
return
}
if (res.result) {
getMaterialByQrCodeInfo({ code: res.result, existList: existList.value }).then((response) => {
if (`${response.code}` === '200') {
const material = uni.getStorageSync('app_material');
// 处理物料信息 合并
const materialInfo = _.filter(material, { isDelete: '0' });
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);
// 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');
}
})
}
},
fail: () => {
uni.showToast({ title: '扫码失败', icon: 'none' });
}
});
};
// 新增/编辑
const submitForm = () => {
const materialInfo = materialRef.value.getMaterialList()
if (!materialInfo || (materialInfo && materialInfo.length == 0)) {
uni.showToast({
title: '请填写物料信息',
mask: true,
icon: 'error',
})
return
}
let params = {
itemList: _.map(materialInfo, (i) => ({ ...i.material })),
contactName: formData.value.contactName,
contactPhone: formData.value.contactPhone,
deliveryTime: formData.value.deliveryTime,
address: formData.value.address,
fileList: formData.value.fileList,
}
// 新建
if (!pathParams.value.billNo) {
addDeclareBill(params).then((res) => {
if (res.code == 200) {
uni.showToast({
title: '申报单创建成功',
mask: true,
icon: 'success',
})
removeStorage()
uni.navigateTo({
url: backUrl.value,
});
} else {
uni.showToast({
title: '申报单创建失败',
mask: true,
icon: 'error',
})
return
}
})
} else {
// 编辑
params.billNo = pathParams.value?.billNo
params.id = formData.value?.id
declareBillUpdate(params).then((res) => {
if (res.code == 200) {
uni.showToast({
title: '申报单编辑成功',
mask: true,
icon: 'success',
})
removeStorage()
uni.navigateTo({
url: backUrl.value,
});
} else {
uni.showToast({
title: '申报单编辑失败',
mask: true,
icon: 'error',
})
return
}
})
}
}
// 删除图片
const deleteImg = (index, type) => {
formData.value.fileList?.splice(index, 1)
}
onLoad((options) => {
pathParams.value = options
flag.value = options.type
const query = objectToQuery(options)
if (options.billNo) {
title.value = options.billNo
backUrl.value = OPERATE_CONFIG?.my?.back + query
} else {
backUrl.value = OPERATE_CONFIG?.[options.type]?.back
}
console.log(backUrl, options.type);
})
getDeclarationInfo();
</script>
<style scoped lang="scss">
.carPickerText {
color: #c0c4cc;
}
/* 底部按钮 */
::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: 50%;
border-radius: 0;
}
.uv-button--info {
background-color: #07c160;
color: #fff;
}
}
::v-deep .form {
// background-color: #fff;
padding: 0 0 12rpx 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;
}
.topLabel {
.uv-form-item__body {
display: block;
}
.uv-textarea {
padding-left: 0;
}
.uv-upload {
margin-top: 8px;
}
}
}
::v-deep.chooseModal {
.uv-modal__content {
display: block;
padding-top: 24rpx !important;
padding: 48rpx;
.title {
font-size: 16px;
margin: 16rpx 0;
}
.link {
color: #999;
margin-top: 24rpx;
font-size: 14px;
}
}
}
</style>

View File

@@ -0,0 +1,8 @@
<template>
<!-- 仓库信息 -->
<choose-list :isWarehousing="true" :pathParams="{ type: 'materialQuery' }" />
</template>
<script setup>
import ChooseList from '../../components/ChooseList.vue'
</script>
<style lang="sass" scoped></style>

View File

@@ -0,0 +1,155 @@
<template>
<!-- -->
<navigation title="我的申报单" :back-url="backUrl"></navigation>
<view class="contentBox">
<!-- 搜索框 -->
<view class="topSearch">
<uni-easyinput type="text" v-model="queryParams.keyword" prefixIcon="search" :input-border="false"
@icon-click="getList" placeholder="请输入搜索内容" />
</view>
<!-- 列表 -->
<z-paging ref="pagingRef" class="containerBox" v-model="list" @query="getList">
<uni-list class="listBox">
<uni-list-item v-for="item in list" :key="item.id" clickable @tap="onDetail(item)">
<template v-slot:body>
<view style="display: flex; flex-direction: column; width: 100%;">
<view class="line title">
<p> 申报单号{{ item.billNo }}</p>
<p>{{ getLabel(declareType, item?.status) }}</p>
</view>
<p class="line content">联系人<text>{{ item?.contactName || '-' }}</text></p>
<p class="line content">联系电话<text>{{ item?.contactPhone || '-' }}</text></p>
<p class="line content">地址:<text>{{ item?.address || '-' }}</text></p>
<p class="line content">申报时间 <text>{{ item?.createTime || '-' }}</text></p>
</view>
</template>
</uni-list-item>
</uni-list>
</z-paging>
</view>
</template>
<script setup>
import _ from 'lodash';
import { ref } from 'vue';
import { onShow, onLoad } from "@dcloudio/uni-app";
import { declareList } from '@/api/declaration';
import Navigation from '../../components/Navigation.vue';
import { objectToQuery, getLabel, declareType } from '../../until';
const OPERATE_CONFIG = {
declaration: {
back: '/pages/warehousing/Declaration/create'
},
my: {
back: 'pages/warehousing/index'
},
}
const pagingRef = ref(null)
const list = ref([])
const backUrl = ref('')
const pathParams = ref('')
const queryParams = ref({ keyword: '' })
const onDetail = (item) => {
const query = objectToQuery({ ...pathParams.value, billNo: item.billNo })
uni.navigateTo({
url: `/pages/warehousing/Declaration/components/detail${query}`,
});
}
const getList = (pageNo, pageSize) => {
queryParams.value.pageNum = pageNo
declareList({ ...queryParams.value }).then(res => {
res.rows.forEach(e => {
e.showMore = false;
});
pagingRef.value.complete(res.rows)
}).catch(() => {
pagingRef.value.complete(false)
})
}
// 数据:路径参数
onLoad(options => {
pathParams.value = options;
const { type } = options;
let queryStr = '';
if (type !== 'my') {
const { billNo, ...restParams } = options;
queryStr = objectToQuery(restParams);
}
const baseBackUrl = OPERATE_CONFIG?.[type]?.back;
backUrl.value = queryStr ? `${baseBackUrl}${queryStr}` : baseBackUrl;
})
onShow(() => {
pagingRef.value?.reload?.()
})
</script>
<style scoped lang="scss">
/* 搜索框:放在导航栏下面,不覆盖 */
.topSearch {
position: fixed;
top: 65rpx;
left: 0;
right: 0;
z-index: 99;
padding: 8rpx 16rpx;
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;
}
::v-deep .listBox {
width: 100%;
height: 100%;
box-sizing: border-box;
background-color: #F8F8FF;
.zp-l-text-rpx {
font-size: 12px;
}
.uni-list--border-bottom {
padding: 8px 12px 8px 15px;
}
.uni-list {
background-color: #F8F8FF;
}
.uni-list-item {
margin-bottom: 4rpx;
}
.line {
display: flex;
align-items: center;
justify-content: space-between;
padding: 8px 0;
}
.title {
justify-content: space-between;
font-weight: 600;
font-size: 13px;
}
.content {
font-weight: 500;
font-size: 13px;
color: #696969;
}
}
</style>

View File

@@ -0,0 +1,213 @@
<template>
<navigation title="物料库存查询" back-url="/pages/warehousing/Declaration/materialQuery" />
<view class="contentBox">
<view class="topSearch">
<uni-easyinput type="text" v-model="queryParams.keyword" prefixIcon="search" :inputBorder="false"
@iconClick="getList" placeholder="请输入搜索内容" />
</view>
<!-- 物料库存查询 -->
<z-paging ref="pagingRef" class="containerBox" v-model="infoList" @query="getDetailInfo">
<uni-list class="listBox">
<uni-list-item v-for="item in infoList" :key="item.id">
<template v-slot:body>
<view style="display: flex; flex-direction: column; width: 100%;">
<view class="line title">
<p>{{ item.materialName }} - {{ item.materialCode }}</p>
<p>{{ item.quantity }}{{ item.unitName }}</p>
</view>
<view class="line content" style="color: #F44336;">
<p>库龄</p>
<p>{{ item.agingDays }}</p>
</view>
<view class="line content ">
<p class="flex align-center">
<text class="mr-4"> 唯一码<text class="mr-4 ml-4">|</text>RFID</text>
<text @tap.stop="getQRcodeDetail(item)">
<uv-image src="../../../../static/qrcode.png" width="20rpx" height="20rpx" />
</text>
</p>
<p>
<text v-if="item.uniqueCode" class="mr-4">{{ item.uniqueCode }}</text>
<text v-if="item.rfidCode"> |{{ item.rfidCode }}</text>
</p>
</view>
<view class="line content">
<p>入库日期</p>
<p>{{ formatDate(item.inboundTime) }}</p>
</view>
<view class="line content">
<p>所在仓库</p>
<p>{{ item.warehouseName }}</p>
</view>
<view class="line content">
<p>所在存储区</p>
<p> {{ item.areaName }}</p>
</view>
<view class="line content">
<p>物料类别</p>
<p>{{ item.typeName }}</p>
</view>
<!-- <view class="line content">
<p>物料分类</p>
<p>{{ item.materialName }}</p>
</view> -->
<view class="line content">
<p>物料规格</p>
<p>{{ item.specification }}</p>
</view>
<view class="line content">
<p>物料型号</p>
<p> <text v-if="item?.model">{{ item?.model }}</text>
<text v-else class="empty">未填写</text>
</p>
</view>
</view>
</template>
</uni-list-item>
</uni-list>
</z-paging>
</view>
<!-- 唯一码图形显示弹窗 -->
<uv-modal ref="modalRef" :title="none" class="qrCodeModal" :showConfirmButton="false">
<qr-code-modal :detail="materialList" />
</uv-modal>
</template>
<script setup>
import { ref } from 'vue';
import { onShow, onLoad } from "@dcloudio/uni-app";
import { inventoryList } from '@/api/inventoryInfo';
import Navigation from '../../../components/Navigation.vue';
import { formatDate } from '../../../until';
import QrCodeModal from '../../uniqueCode/myUniqueCode/QrCodeModal.vue';
import { getDetail } from '../../uniqueCode/until'
import { detailUniqueCode } from '@/api/uniqueCode'
// 开关:唯一码图形
const modalRef = ref()
const pathParams = ref('')
const materialList = ref({
material: []
})
const queryParams = ref({
keyword: ''
})
const pagingRef = ref(null)
const infoList = ref([])
onLoad((options) => {
pathParams.value = options;
})
const getDetailInfo = () => {
const params = {
warehouseCode: pathParams.value.warehouseCode,
materialId: pathParams.value.materialId,
keyword: queryParams.value.keyword
}
inventoryList(params).then(res => {
res.data.forEach(e => {
e.showMore = false;
});
infoList.value = res.data
pagingRef.value.complete(res.data)
}).catch(res => {
pagingRef.value.complete(false)
})
}
// 详情:唯一码
const getQRcodeDetail = (row) => {
detailUniqueCode({ id: row.uniqueCodeId }).then((res) => {
if (res.code == 200) {
materialList.value.material = [{ ...res.data.material, ...getDetail(res.data.material.wornMaterial), qrCode: res.data.qrCode, code: res.data.code, uniqueCodeRemark: res.data.remark }]
setTimeout(() => {
modalRef.value.open()
}, 300)
}
})
}
onShow(() => {
pagingRef.value?.reload?.()
})
</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: 120rpx !important;
width: 100%;
height: 100%;
box-sizing: border-box;
.zp-l-text-rpx {
font-size: 12px;
}
}
::v-deep.listBox {
background-color: #F8F8FF;
.uni-list-item {
margin-bottom: 8rpx;
}
.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;
}
.title::before {
content: '';
position: absolute;
left: 0;
top: 0;
width: 4rpx;
height: 45rpx;
background: #08a089;
}
.content {
font-weight: 500;
font-size: 13px;
}
.empty {
color: #D3D3D3;
}
}
::v-deep.qrCodeModal {
.uv-modal__content {
display: block;
padding: 24rpx;
}
}
</style>

View File

@@ -0,0 +1,7 @@
<template>
<choose-list :isWarehousing="true" :pathParams="{ type: 'inventoryAgeView' }" />
</template>
<script setup>
import ChooseList from '../../components/ChooseList.vue'
</script>
<style lang="sass" scoped></style>

View File

@@ -0,0 +1,7 @@
<template>
<report-excel keyType="companyReport" />
</template>
<script setup>
import ReportExcel from '../../components/ReportExcel.vue'
</script>
<style scoped lang="scss"></style>

View File

@@ -0,0 +1,7 @@
<template>
<report-excel keyType="dailyReport" />
</template>
<script setup>
import ReportExcel from '../../../components/ReportExcel.vue'
</script>
<style scoped lang="scss"></style>

View File

@@ -0,0 +1,7 @@
<template>
<report-excel keyType="monthlyReport" />
</template>
<script setup>
import ReportExcel from '../../../components/ReportExcel.vue'
</script>
<style scoped lang="scss"></style>

View File

@@ -0,0 +1,7 @@
<template>
<report-excel keyType="warehouseReport" />
</template>
<script setup>
import ReportExcel from '../../../components/ReportExcel.vue'
</script>
<style scoped lang="scss"></style>

View File

@@ -0,0 +1,7 @@
<template>
<choose-list :isWarehousing="true" :pathParams="{ type: 'dailyReport' }" />
</template>
<script setup>
import ChooseList from '../../components/ChooseList.vue'
</script>
<style lang="sass" scoped></style>

View File

@@ -0,0 +1,7 @@
<template>
<choose-list :isWarehousing="true" :pathParams="{ type: 'monthlyReport' }" />
</template>
<script setup>
import ChooseList from '../../components/ChooseList.vue'
</script>
<style lang="sass" scoped></style>

View File

@@ -0,0 +1,7 @@
<template>
<choose-list :isWarehousing="true" :pathParams="{ type: 'warehouseReport' }" />
</template>
<script setup>
import ChooseList from '../../components/ChooseList.vue'
</script>
<style lang="sass" scoped></style>

View File

@@ -3,9 +3,9 @@
<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"
<uv-image @tap="onPrinter" src="../../../../static/printer.png" width="20px" height="20px"
style="margin-top:10rpx" />
<uv-image @click="toEditOrAway('2')" src="../../../../static/edit.png" class="ml-24" width="20px"
<uv-image @tap="toEditOrAway('2')" src="../../../../static/edit.png" class="ml-24" width="20px"
height="20px" style="margin-top:10rpx" />
</view>
</template>
@@ -18,11 +18,11 @@
<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>
text="作废" @tap="toObsolete"></uv-button>
<uv-button type="primary" text="入库单入库" @tap="toEditOrAway('1')"></uv-button>
</view>
<view v-if="detailInfo?.billType == '0' && flag" class="bottom1">
<uv-button type="primary" text="出库单出库" @click="toEditOrAway('1')"></uv-button>
<uv-button type="primary" text="出库单出库" @tap="toEditOrAway('1')"></uv-button>
</view>
</view>
</template>
@@ -130,6 +130,16 @@ const setDetailInfoToStorage = (type) => {
// 有 type直接存储全部 itemList
uni.setStorageSync('app_material', itemList)
}
// 技术鉴定表
const technicalEvaluationList = {
fileList: data?.appraisalFileList,
remark: data?.appraisalRemark,
createTime: data?.appraisalTime,
id: data?.appraisalId,
appraisalNo: data?.appraisalNo,
}
uni.setStorageSync('app_technical', technicalEvaluationList)
}
/**

View File

@@ -9,7 +9,7 @@
<material-list ref="materialRef" :formData="formData" isEdit="5" :pathParams="pathParams":extendData="{ selectMaterialList }" />
<!-- 底部操作栏 -->
<view class="bottom">
<uv-button type="primary" @click="submitForm">入库</uv-button>
<uv-button type="primary" @tap="submitForm">入库</uv-button>
</view>
</view>
</template>

View File

@@ -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;

View File

@@ -11,23 +11,23 @@
<!-- 列表 -->
<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)">
<uni-list-item v-for="item in infoList" :key="item.id" clickable @tap="onChecked(item)">
<template v-slot:body>
<view style="display: flex; flex-direction: column; width: 100%;">
<view class="line title">
<!-- <view class="line title">
<p>技术鉴定表</p>
<p>{{ item?.appraisalNo }}</p>
</view>
</view> -->
<view class="line content">
<uv-upload :fileList="item?.fileUrlList" name="3" multiple :maxCount="6"
:previewFullImage="true"></uv-upload>
<uv-upload :fileList="item?.fileUrlList" name="3" multiple
:maxCount="item?.fileUrlList?.length" :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>
<text v-if="item?.remark">{{ item?.remark }}</text>
<text v-else class="empty">未填写</text>
</p>
</view>
<view class="line content">
@@ -69,7 +69,8 @@ const infoList = ref([])
// 选中技术鉴定表
const onChecked = (item) => {
if (item.appraisalNo) {
uni.setStorageSync('app_technical', item);
uni.setStorageSync('app_technical', { ...item, appraisalNo: undefined });
uni.navigateTo({
url: backUrl.value
});

View File

@@ -4,7 +4,7 @@
<view class="contentBox">
<!-- 技术鉴定表 -->
<uv-form ref="formRef" class="form" :model="technicalEvaluationList" label-width="150rpx">
<uv-form-item label="技术鉴定表" prop="fileList" @click="toTechnical">
<uv-form-item label="技术鉴定表" prop="fileList" @tap="toTechnical">
<u-cell>
<view slot="title" class="u-slot-title">
<text class="u-cell-text" v-if="technicalEvaluationList">
@@ -24,7 +24,7 @@
<material-list ref="materialRef" :formData="formData" isEdit="5" backStr="stockOut" :pathParams="pathParams" />
<!-- 底部操作栏 -->
<view class="bottom">
<uv-button type="primary" @click="submitForm">出库</uv-button>
<uv-button type="primary" @tap="submitForm">出库</uv-button>
</view>
</view>
</template>
@@ -124,7 +124,7 @@ onMounted(() => {
getMaterialList()
})
const toTechnical = () => {
const query = objectToQuery(pathParams.value)
const query = objectToQuery(pathParams?.value)
uni.navigateTo({
url: `/pages/warehousing/stockOut/components/technicalEvaluation${query}`

View File

@@ -1,7 +1,7 @@
<template>
<navigation title="技术鉴定表详情" :back-url="backUrl">
<template #right>
<my-link @click="toMyTechnicalList" style="font-size: 14px;">我的</my-link>
<my-link @tap="toMyTechnicalList" style="font-size: 14px;">我的</my-link>
</template>
</navigation>
<view class="contentBox">
@@ -17,7 +17,8 @@
</uv-form>
<view class="bottom">
<uv-button type="primary" @click="submitForm">提交信息</uv-button>
<uv-button type="primary" v-if="!formModel?.appraisalNo" @tap="submitForm">提交信息</uv-button>
<uv-button type="error" v-else @tap="delForm">删除</uv-button>
</view>
</view>
</template>
@@ -27,36 +28,33 @@ 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 { uploadTechnicalFile, addWithFiles, deleteAppraisal } from '@/api/stockOut'
import _ from 'lodash';
const queryParams = ref('')
const formModel = ref({
billNo: null,
remark: '',
appraisalNo: '',
id: '',
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)
console.log(some, '上传接口调取成功', res)
if (some) return;
if (!formModel.value.fileList || formModel.value.fileList.length == 0) {
formModel.value.fileList = []
}
res?.data?.fileUrlList.forEach(item => {
res?.forEach(item => {
formModel.value.fileList.push({ url: item?.url, name: item?.name, scene: 'OUTBOUND', bizType: 'TECHNICAL_APPRAISAL' })
})
})
@@ -67,15 +65,49 @@ const deleteImg = (index, type) => {
}
// 提交
const submitForm = () => {
console.log(formModel, 'formModel==>');
addWithFiles({ ...formModel.value, billNo: queryParams.value.billNo }).then((res) => {
const params = {
remark: formModel.value.remark,
billNo: queryParams.value.billNo,
fileList: formModel.value.fileList,
}
addWithFiles(params).then((res) => {
if (res.code == 200) {
console.log(res.data);
uni.setStorageSync('app_technical', {
remark: res.data?.remark,
appraisalNo: res.data.appraisalNo,
id: res.data.id,
createTime: res.data.createTime,
fileList: res.data?.fileUrlList || [],
});
uni.navigateTo({
url: backUrl.value
});
}
})
}
const delForm = () => {
deleteAppraisal({ id: formModel.value?.id }).then((res) => {
console.log(res, '删除');
formModel.value = {
billNo: null,
remark: '',
appraisalNo: '',
id: '',
fileList: [],
}
uni.removeStorageSync("app_technical");
})
}
// 数据:获取缓存信息
const getMaterialList = () => {
// 获取技术鉴定表数据
const list = uni.getStorageSync('app_technical') || {};
formModel.value = list
}
getMaterialList()
// 数据:路径参数
onLoad((options) => {
const query = objectToQuery(options)
@@ -84,7 +116,6 @@ onLoad((options) => {
})
const toMyTechnicalList = () => {
console.log('1111111111');
const query = objectToQuery(queryParams.value)
uni.navigateTo({
url: `/pages/warehousing/stockOut/components/myTechnicalEvaluation${query}`
@@ -93,7 +124,7 @@ const toMyTechnicalList = () => {
// 获取技术鉴定编数据
const getTechnicalList = () => {
const list = uni.getStorageSync('app_technical');
formModel.value.fileList = list?.fileList
formModel.value.fileList = list?.fileList || []
formModel.value.remark = list?.remark
}
getTechnicalList()

View File

@@ -9,8 +9,8 @@
:pathParams="{...pathParams.value, type: 'stockOut' }" />
<!-- 底部操作栏 -->
<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>

View File

@@ -0,0 +1,113 @@
<template>
<navigation :title="title" :back-url="backUrl">
<template #right>
<my-link @tap="toMyTransport" style="font-size: 14px;">我的</my-link>
</template>
</navigation>
<view class="contentBox">
<!-- 仓库信息 - 仓库存储区 -->
<warehousing-info ref="warehousingInfoRef" :warehouseInfo="warehouseInfo"
:pathParams="{ ...pathParams, type: 'transport' }" />
<!-- 物料列表 - 添加物料 -->
<material-list ref="materialRef" :formData="formData" isEdit="4" :backStr="transport"
:pathParams="pathParams" />
<!-- 底部操作栏 -->
<view class="bottom">
<uv-button @tap="scanCode">扫码添加</uv-button>
<uv-button type="primary" @tap="submitForm">打卡</uv-button>
</view>
</view>
</template>
<script setup>
import _ from 'lodash';
import { ref } from 'vue';
import { objectToQuery, } from '../../until';
import { onLoad } from "@dcloudio/uni-app";
import MaterialList from '../../components/MaterialList.vue';
import WarehousingInfo from '../../components/WarehousingInfo.vue';
import Navigation from '../../components/Navigation.vue';
// const OPERATE_CONFIG = {
// // 创建
// transport: {
// back: 'pages/warehousing/index',
// title: '运输打卡'
// },
// // 编辑
// transport_edit: {
// back: '/pages/warehousing/stockIn/components/detail',
// title: ''
// },
// }
// 数据:路径参数
const pathParams = ref('')
// 标志:是否为编辑
const isEdit = ref('')
// ref标题
const title = ref('运输打卡')
const backUrl = ref('pages/warehousing/index')
const formData = ref([{ remark: '', material: [] }])
// 数据:仓库信息
const warehouseInfo = ref({ warehousing: {}, storageArea: {}, remark: '' })
// 数据:获取缓存信息
const getMaterialList = () => {
}
getMaterialList();
// 扫码添加
const scanCode = () => {
};
const toMyTransport = () => {
const query = objectToQuery(pathParams.value)
uni.navigateTo({
url: `/pages/warehousing/Transport/my${query}`
});
}
// 提交表单
const submitForm = () => {
}
// 数据:路径参数
onLoad((options) => {
pathParams.value = options
})
</script>
<style lang="scss" scoped>
.contentBox {
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: 50%;
border-radius: 0;
}
.uv-button--info {
background-color: #07c160;
color: #fff;
}
}
</style>

View File

@@ -0,0 +1,132 @@
<template>
<!-- -->
<navigation title="我的运输打卡" :back-url="backUrl"></navigation>
<view class="contentBox">
<!-- 搜索框 -->
<view class="topSearch">
<uni-easyinput type="text" v-model="queryParams.keyword" prefixIcon="search" :input-border="false"
@icon-click="getList" placeholder="请输入搜索内容" />
</view>
<!-- 列表 -->
<z-paging ref="pagingRef" class="containerBox" v-model="list" @query="getList">
<uni-list class="listBox">
<uni-list-item v-for="item in list" :key="item.id" clickable @tap="onDetail(item)">
<template v-slot:body>
<view style="display: flex; flex-direction: column; width: 100%;">
<view class="line title">
<p> 申报单号{{ item.billNo }}</p>
<p>{{ getLabel(declareType, item?.status) }}</p>
</view>
<p class="line content">联系人<text>{{ item?.contactName || '-' }}</text></p>
<p class="line content">联系电话<text>{{ item?.contactPhone || '-' }}</text></p>
<p class="line content">地址:<text>{{ item?.address || '-' }}</text></p>
<p class="line content">申报时间 <text>{{ item?.createTime || '-' }}</text></p>
</view>
</template>
</uni-list-item>
</uni-list>
</z-paging>
</view>
</template>
<script setup>
import _ from 'lodash';
import { ref } from 'vue';
import { onShow, onLoad } from "@dcloudio/uni-app";
import Navigation from '../../components/Navigation.vue';
import { getLabel, declareType } from '../../until';
const OPERATE_CONFIG = {
transport: {
back: '/pages/warehousing/Transport/checkIn'
},
my: {
back: 'pages/warehousing/index'
},
}
const pagingRef = ref(null)
const list = ref([])
const backUrl = ref('')
const pathParams = ref('')
const queryParams = ref({ keyword: '' })
const onDetail = () => { }
const getList = (pageNo, pageSize) => {
queryParams.value.pageNum = pageNo
}
// 数据:路径参数
onLoad(options => {
pathParams.value = options;
backUrl.value = OPERATE_CONFIG[options.type]?.back
})
onShow(() => {
pagingRef.value?.reload?.()
})
</script>
<style scoped lang="scss">
/* 搜索框:放在导航栏下面,不覆盖 */
.topSearch {
position: fixed;
top: 65rpx;
left: 0;
right: 0;
z-index: 99;
padding: 8rpx 16rpx;
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;
}
::v-deep .listBox {
width: 100%;
height: 100%;
box-sizing: border-box;
background-color: #F8F8FF;
.zp-l-text-rpx {
font-size: 12px;
}
.uni-list--border-bottom {
padding: 8px 12px 8px 15px;
}
.uni-list {
background-color: #F8F8FF;
}
.uni-list-item {
margin-bottom: 4rpx;
}
.line {
display: flex;
align-items: center;
justify-content: space-between;
padding: 8px 0;
}
.title {
justify-content: space-between;
font-weight: 600;
font-size: 13px;
}
.content {
font-weight: 500;
font-size: 13px;
color: #696969;
}
}
</style>

View File

@@ -5,7 +5,7 @@
<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">
<view v-for="value in item.menuItem" :key="value.id" class="card_items" @tap="value.click">
<uv-image :src="value.icon" width="40rpx" height="40rpx" style="margin-top:10rpx" />
<p> {{ value.title }} </p>
</view>
@@ -15,7 +15,7 @@
<script setup>
import { onShow } from '@dcloudio/uni-app';
import { removeStorage } from '../until';
import { objectToQuery, removeStorage } from '../until';
import Navigation from '../components/Navigation.vue';
const menuList = [
@@ -37,6 +37,11 @@ const menuList = [
title: '库龄查看',
click: () => {
console.log('库龄查看')
removeStorage()
uni.navigateTo({
url: '/pages/warehousing/InventoryInfo/inventoryAgeView'
});
}
},
{
@@ -60,14 +65,23 @@ const menuList = [
title: '库存日报',
click: () => {
console.log('库存日报')
removeStorage()
uni.navigateTo({
url: '/pages/warehousing/report/daily'
});
}
},
{
id: "report_ inventoryMonthlyReport",
icon: '../../static/report/inventoryMonthlyReport.png',
title: '库存月报',
click: () => {
console.log('库存月报')
removeStorage()
uni.navigateTo({
url: '/pages/warehousing/Report/monthly'
});
}
},
{
@@ -76,16 +90,23 @@ const menuList = [
title: '公司库存报表',
click: () => {
console.log('公司库存报表')
removeStorage()
uni.navigateTo({
url: '/pages/warehousing/Report/company'
});
}
},
{
id: "report_ warehouseInventoryReport",
icon: '../../static/report/warehouseInventoryReport.png',
title: '仓库库存报表',
click: () => {
console.log('仓库库存报表')
removeStorage()
uni.navigateTo({
url: '/pages/warehousing/Report/warehouse'
});
}
},
]
@@ -100,6 +121,11 @@ const menuList = [
title: '物资查询',
click: () => {
console.log('物资查询')
removeStorage()
uni.navigateTo({
url: '/pages/warehousing/Declaration/materialQuery'
});
}
},
{
@@ -108,6 +134,11 @@ const menuList = [
title: '申报单开单',
click: () => {
console.log('申报单开单')
removeStorage()
uni.navigateTo({
url: '/pages/warehousing/Declaration/create?type=declaration'
});
}
},
{
@@ -116,6 +147,11 @@ const menuList = [
title: '我的申报单',
click: () => {
console.log('我的申报单')
removeStorage()
uni.navigateTo({
url: '/pages/warehousing/Declaration/my?type=my'
});
}
},
@@ -216,7 +252,7 @@ const menuList = [
title: '唯一码发放',
click: () => {
console.log('唯一码发放')
uni.removeStorage('app_material')
removeStorage()
uni.navigateTo({
url: '/pages/warehousing/uniqueCode/issueUniqueCode/index'
});
@@ -254,6 +290,11 @@ const menuList = [
title: '运输打卡',
click: () => {
console.log('运输打卡')
const query = objectToQuery({ type: 'transport' })
removeStorage()
uni.navigateTo({
url: `/pages/warehousing/Transport/checkIn${query}`
});
}
},
{
@@ -262,6 +303,11 @@ const menuList = [
title: '我的运输打卡',
click: () => {
console.log('我的运输打卡')
removeStorage()
const query = objectToQuery({ type: 'my' })
uni.navigateTo({
url: `/pages/warehousing/Transport/my${query}`
});
}
},
]

View File

@@ -3,13 +3,13 @@
<navigation :title="title" :back-url="backUrl"></navigation>
<view class="contentBox">
<view class="remarkLine">
<span>备注</span>
<text>备注</text>
<uni-easyinput type="text" v-model="formData.remark" :inputBorder="false" placeholder="请输入备注" />
</view>
<!-- 物料列表 - 添加物料 -->
<material-list ref="materialRef" :formData="formData" :remark="formData.remark" isEdit="1"
:pathParams="pathParams" />
<button class="bottom-btn" type="primary" @click="handleSubmit">提交</button>
<button class="bottom-btn" type="primary" @tap="handleSubmit">提交</button>
</view>
</template>
<script setup>
@@ -73,7 +73,7 @@ const handleSubmit = () => {
remark: formData.value.remark,
material: { ...material.material, unitId: '23' }
}
if (pathParams.value.type == `issueUniqueCode_inbound`) {
if (pathParams.value.type == `stockIn_inbound`) {
params.billNo = pathParams.value.billNo
}
if (pathParams.value.id) {
@@ -139,7 +139,7 @@ const getMaterialList = () => {
margin-bottom: 8rpx;
min-height: 40rpx;
span {
text {
font-size: 14px;
}

View File

@@ -11,16 +11,16 @@
v-if="!isInbound">
<uni-list>
<uni-list-item v-for="item in materialList" :key="item.id" clickable class="material-card"
@click="onMaterial(item)">
@tap="onMaterial(item)">
<template v-slot:body>
<p style="display: flex; flex-direction: column; width: 100%;">
<p class="title">{{ item.materialName }} ({{ item.materialCode }})</p>
<p class="subTitle">
<!-- 简称/型号/规格/类型 -->
<span v-if="item.materialShortName">{{ item.materialShortName }} / </span>
<span v-if="item.model">{{ item.model }} / </span>
<span v-if="item.specification">{{ item.specification }} / </span>
<span v-if="item.typeName">{{ item.typeName }} </span>
<text v-if="item.materialShortName">{{ item.materialShortName }} / </text>
<text v-if="item.model">{{ item.model }} / </text>
<text v-if="item.specification">{{ item.specification }} / </text>
<text v-if="item.typeName">{{ item.typeName }} </text>
</p>
<p class="tag">
<uni-tag :text="getTypeParentNames(item.typeParentNames)" type="error" />
@@ -36,16 +36,16 @@
<view v-if="isInbound">
<uni-list>
<uni-list-item v-for="item in materialList" :key="item.id" clickable class="material-card"
@click="onMaterial(item)">
@tap="onMaterial(item)">
<template v-slot:body>
<p style="display: flex; flex-direction: column; width: 100%;">
<p class="title">{{ item.materialName }} ({{ item.materialCode }})</p>
<p class="subTitle">
<!-- 简称/型号/规格/类型 -->
<span v-if="item.materialShortName">{{ item.materialShortName }} / </span>
<span v-if="item.model">{{ item.model }} / </span>
<span v-if="item.specification">{{ item.specification }} / </span>
<span v-if="item.typeName">{{ item.typeName }} </span>
<text v-if="item.materialShortName">{{ item.materialShortName }} / </text>
<text v-if="item.model">{{ item.model }} / </text>
<text v-if="item.specification">{{ item.specification }} / </text>
<text v-if="item.typeName">{{ item.typeName }} </text>
</p>
<p class="tag">
<uni-tag :text="getTypeParentNames(item.typeParentNames)" type="error" />
@@ -87,6 +87,16 @@ const OPERATE_CONFIG = {
stockIn_detail: {
back: '/pages/warehousing/stockIn/create'
},
// 申报单开单
declaration: {
back: '/pages/warehousing/Declaration/create',
title: '申报单开单'
},
// 申报单开单
my: {
back: '/pages/warehousing/stockIn/create',
title: '申报单开单'
},
}
// ref:下拉加载
const pagingRef = ref(null)
@@ -117,14 +127,6 @@ const getMaterialListInbound = () => {
const list = uni.getStorageSync('app_material_select_list')
materialList.value = list
}
onShow(() => {
pagingRef.value?.reload?.()
})
onLoad((options) => {
pathParams.value = options
getMaterialListInbound()
})
// 方法:获取缓存物料信息
const getStorageMaterial = (val) => {
// 唯一码编辑进入 数量默认1\唯一码物料表id\物料id
@@ -147,7 +149,7 @@ const onMaterial = (val) => {
const idx = _.findIndex(materialChecked, (i) => i.materialId ? i.materialId === val.id : i.id === val.id)
if (idx != -1 && item?.isDelete == '0') { // isDelete为0表示未删除 1为已删除数据不在对比范围内
if (keyType.value === 'stockIn') {
if (keyType.value === 'stockIn' || _.includes(keyType.value, 'declaration')) {
uni.showToast({
title: '该物料已添加,请勿重复添加!',
mask: true,
@@ -157,7 +159,7 @@ const onMaterial = (val) => {
} else {
if (val) {
if (keyType.value == 'stockIn') {
if (keyType.value == 'stockIn' || _.includes(keyType.value, 'declaration')) {
materialChecked = [...materialChecked, { ...val, quantity: 1, isDelete: '0' }];
} else {
materialChecked = getStorageMaterial(val)
@@ -170,7 +172,13 @@ const onMaterial = (val) => {
url: OPERATE_CONFIG?.[keyType.value].back + path
})
}
onShow(() => {
pagingRef.value?.reload?.()
})
onLoad((options) => {
pathParams.value = options
getMaterialListInbound()
})
</script>
<style scoped lang="scss">
.topSearch {

View File

@@ -9,21 +9,24 @@
<view class="content mt-16">
<p>物料
<span>{{ material?.materialName }}</span>
<span v-if="material?.quantity">x {{ material?.quantity }}</span>
<text>{{ material?.materialName }}</text>
<text v-if="material?.quantity">x {{ material?.quantity }}</text>
</p>
<p>描述
<span v-if="material?.description">{{ material?.description || '-' }}</span>
<span v-else>
<span v-if="material?.materialShortName">{{ material?.materialShortName }} / </span>
<span v-if="material?.model">{{ material?.model }} / </span>
<span v-if="material?.specification">{{ material?.specification }} / </span>
<span v-if="material?.typeName">{{ material?.typeName }} </span>
</span>
<text v-if="material?.description">{{ material?.description || '-' }}</text>
<text v-else>
<text v-if="material?.materialShortName">{{ material?.materialShortName }} / </text>
<text v-if="material?.model">{{ material?.model }} / </text>
<text v-if="material?.specification">{{ material?.specification }} / </text>
<text v-if="material?.typeName">{{ material?.typeName }} </text>
</text>
</p>
<view class="top">
<p>备注
<span>{{ material?.uniqueCodeRemark || '' }}</span>
<text>
<text v-if="item?.uniqueCodeRemark">{{ item?.uniqueCodeRemark }}</text>
<text v-else class="empty">未填写</text>
</text>
</p>
<uv-image :src="qrCode" width="80rpx" height="80rpx" />
</view>
@@ -43,6 +46,7 @@ const props = defineProps({
const qrCode = computed(() => props.detail?.material?.[0]?.qrCode);
const material = computed(() => props.detail?.material?.[0]);
const barcodeValue = computed(() => props.detail?.material?.[0]?.code || '');
console.log(props.detail?.material?.[0]?.code, 'code==>');
// iPad 兼容核心:不用 document只用 uni 官方 API
@@ -98,12 +102,16 @@ watch(
font-size: 14px;
}
span {
text {
font-weight: 400;
font-size: 14px;
}
}
.empty {
color: #D3D3D3;
}
/* 必须给宽度高度iPad 才会显示 */
.barcode-canvas {
width: 40%;

View File

@@ -4,7 +4,7 @@
<navigation :title="title" :back-url="backUrl">
<template #right>
<view class="right-btn flex align-center justify-center ">
<uv-image @click="toEdit" src="../../../../static/edit.png" class="ml-24" width="20px" height="20px"
<uv-image @tap="toEdit" src="../../../../static/edit.png" class="ml-24" width="20px" height="20px"
style="margin-top:10rpx" />
</view>
</template>
@@ -24,19 +24,19 @@
<!-- 内容行 -->
<view class="text">
<p>RFID
<span v-if="item.rfidCode">{{ item.remark }}</span>
<span v-else style="color: #999;">未绑定RFID</span>
<text v-if="item.rfidCode">{{ item.remark }}</text>
<text v-else style="color: #999;">未绑定RFID</text>
</p>
<p>生成时间
<span>{{ item?.createTime }}</span>
<text>{{ item?.createTime }}</text>
</p>
<!-- 备注行-->
<view class="flex-center qrCode">
<p>备注
<span v-if="item.remark">{{ item.remark }}</span>
<span v-else style="color: #999;">未填写</span>
<text v-if="item.remark">{{ item.remark }}</text>
<text v-else style="color: #999;">未填写</text>
</p>
<view @click="toViewQrCode">
<view @tap="toViewQrCode">
<uv-image src="../../../../static/qrcode.png" width="40rpx" height="40rpx"
style="margin-top:10rpx" />
</view>
@@ -54,7 +54,7 @@
<!-- 底部按钮 -->
<view class="bottom">
<uv-button type="primary" text="唯一码打印"></uv-button>
<uv-button type="success" text="溯源" @click="toTraceability"></uv-button>
<uv-button type="success" text="溯源" @tap="toTraceability"></uv-button>
</view>
</view>
</uv-skeletons>

View File

@@ -12,7 +12,7 @@
<z-paging ref="pagingRef" class="containerBox" v-model="uniqueCodeList" @query="getMaterialList">
<uni-list>
<uni-list-item v-for="item in uniqueCodeList" :key="item.id" clickable class="material-card"
@longpress="() => handleItemLongPress(item, index)" @click="toDetail(item)">
@longpress="() => handleItemLongPress(item, index)" @tap="toDetail(item)">
<template v-slot:body>
<p style="display: flex; flex-direction: column; width: 100%;">
<!-- 编码状态行 -->
@@ -23,19 +23,19 @@
<!-- 内容行 -->
<view class="text ">
<p>RFID
<span v-if="item.rfidCode">{{ item.remark }}</span>
<span v-else style="color: #999;">未绑定RFID</span>
<text v-if="item.rfidCode">{{ item.remark }}</text>
<text v-else style="color: #999;">未绑定RFID</text>
</p>
<p>生成时间
<span>{{ item?.createTime }}</span>
<text>{{ item?.createTime }}</text>
</p>
<!-- 备注行-->
<view class="flex-center qrCode">
<p>备注
<span v-if="item.remark">{{ item.remark }}</span>
<span v-else style="color: #999;">未填写</span>
<text v-if="item.remark">{{ item.remark }}</text>
<text v-else style="color: #999;">未填写</text>
</p>
<view @click.stop="getDetailInfo(item)">
<view @tap.stop="getDetailInfo(item)">
<uv-image src="../../../../static/qrcode.png" width="40rpx" height="40rpx"
style="margin-top:10rpx" />
</view>