报表申报智能运输页面完成
This commit is contained in:
214
pages/warehousing/Declaration/components/detail.vue
Normal file
214
pages/warehousing/Declaration/components/detail.vue
Normal 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>
|
||||
170
pages/warehousing/Declaration/components/materialQueryDetail.vue
Normal file
170
pages/warehousing/Declaration/components/materialQueryDetail.vue
Normal 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>
|
||||
Reference in New Issue
Block a user