870 lines
23 KiB
Vue
870 lines
23 KiB
Vue
<template>
|
||
<view>
|
||
<view class="normar_container">
|
||
<page-nav :title="`收货任务详情`" :showBack="true">
|
||
<template #right>
|
||
<view class="nav-right">
|
||
<u-icon name="more-dot-fill" size="22" @click="showActionSheet = true"></u-icon>
|
||
</view>
|
||
</template>
|
||
</page-nav>
|
||
|
||
<view class="tabs-container">
|
||
<u-tabs :list="tabs" :current="currentTab" @change="handleTabChange" lineWidth="30"
|
||
lineHeight="4"></u-tabs>
|
||
</view>
|
||
|
||
<view class="container">
|
||
<!-- 收货单信息 -->
|
||
<view v-if="currentTab === 0" class="info-container">
|
||
<info-container :receivingInfo="receivingInfo" @change="initData" @print="handlePrint"/>
|
||
</view>
|
||
|
||
<!-- 收货中状态显示收货明细,其他状态显示收货清单 -->
|
||
<view v-else-if="currentTab === 1" class="content-container">
|
||
<detail-container v-if="isReceivingStatus" :selectedDetail="selectedDetail" :details="details"
|
||
@select="handleSelectDetail" @add="handleAddDetail" @delete="handleDeleteDetail"
|
||
@preview="handlePreviewImage" ref="detailContainerRef" @change="initData"
|
||
@tryGetStock="tryGetStock" @selectDetailChange="handleSelectDetailChange" @searchSpace="searchSpace" @print="handlePrint"/>
|
||
<receivingList v-else :receiving-data="receivingInfo" :detail-list="details"
|
||
:fixed-header="true" :fixed-top="receivingListHeaderTop"
|
||
:fixed-mask-height="receivingListHeaderGap"></receivingList>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
<stockList :stock-list="stockList" :show="showStockList" @select="selectStock" @close="showStockList=false" @tryGetStock="tryGetStock"></stockList>
|
||
<space-list :space-list="spaceList" :show="showSpaceList" @select="selectSpace" @close="showSpaceList=false" @searchSpace="searchSpace"></space-list>
|
||
<!-- 操作菜单 -->
|
||
<u-action-sheet :actions="actionList" :show="showActionSheet" @select="handleAction"
|
||
@close="showActionSheet = false">
|
||
</u-action-sheet>
|
||
<u-popup :show="showComplete" mode="bottom" :closeable="true" border-radius="20" @close="showComplete = false">
|
||
<view class="filter-popup">
|
||
<view class="popup-header">
|
||
<text class="popup-title">收货明细</text>
|
||
</view>
|
||
<view class="popup-content">
|
||
<receivingList :receiving-data="receivingInfo" :detail-list="details">
|
||
<template #bottom>
|
||
<u-button @click="completeReceiving">确认收货</u-button>
|
||
</template>
|
||
</receivingList>
|
||
|
||
</view>
|
||
</view>
|
||
</u-popup>
|
||
|
||
<PrintPanel :show="showPrint" :printData="printData" @close="showPrint=false"></PrintPanel>
|
||
</view>
|
||
</template>
|
||
|
||
<script>
|
||
import infoContainer from './components/info-container.vue'
|
||
import detailContainer from './components/detail-container.vue'
|
||
import stockList from './components/stockList.vue'
|
||
import spaceList from '@/components/space-list/space-list.vue'
|
||
import receivingList from './receivingList.vue'
|
||
|
||
export default {
|
||
components: {
|
||
infoContainer,
|
||
detailContainer,
|
||
stockList,
|
||
spaceList,
|
||
receivingList
|
||
},
|
||
data() {
|
||
return {
|
||
receivingId: null,
|
||
currentTab: 0,
|
||
receivingListHeaderTop: 0,
|
||
receivingListHeaderGap: 0,
|
||
qrcodeUrl: null,
|
||
showStockList: false,
|
||
showSpaceList:false,
|
||
showComplete:false,
|
||
showPrint:false,
|
||
stockList: [],
|
||
spaceList: [],
|
||
printData:{},
|
||
// 收货单信息
|
||
receivingInfo: {},
|
||
tmp_storeName: "",
|
||
// 收货明细
|
||
details: [],
|
||
selectedDetail: null,
|
||
|
||
// 对话框控制
|
||
showActionSheet: false,
|
||
|
||
// 下拉菜单
|
||
actionList: [{
|
||
name: '刷新数据',
|
||
color: '#2979ff',
|
||
action:"initData"
|
||
},
|
||
{
|
||
name: '完成收货',
|
||
color: '#9a3130',
|
||
action:"completeReceiving"
|
||
},
|
||
{
|
||
name: '打印收货单',
|
||
color: '#9a3130',
|
||
action:"comfir"
|
||
},
|
||
{
|
||
name: '整单作废',
|
||
color: '#FF0000',
|
||
action:"cancel"
|
||
}
|
||
],
|
||
};
|
||
},
|
||
|
||
computed: {
|
||
// 判断是否为收货中状态
|
||
isReceivingStatus() {
|
||
return this.receivingInfo.status === 'receiving';
|
||
},
|
||
|
||
// 动态Tab列表
|
||
tabs() {
|
||
// 基础Tab:收货单信息
|
||
const baseTabs = [{
|
||
name: '收货单信息'
|
||
}];
|
||
|
||
// 根据状态添加第二个Tab
|
||
if (this.isReceivingStatus) {
|
||
baseTabs.push({
|
||
name: '收货'
|
||
});
|
||
} else {
|
||
baseTabs.push({
|
||
name: '收货清单'
|
||
});
|
||
}
|
||
|
||
return baseTabs;
|
||
}
|
||
},
|
||
|
||
methods: {
|
||
getTodayStartTimestamp() {
|
||
const today = new Date();
|
||
today.setHours(0, 0, 0, 0);
|
||
return today.getTime();
|
||
},
|
||
parseDateToTimestamp(dateValue) {
|
||
const text = String(dateValue || '').trim();
|
||
if (!text) {
|
||
return NaN;
|
||
}
|
||
|
||
const normalizedText = text.replace(/-/g, '/');
|
||
const date = new Date(normalizedText);
|
||
if (Number.isNaN(date.getTime())) {
|
||
return NaN;
|
||
}
|
||
|
||
date.setHours(0, 0, 0, 0);
|
||
return date.getTime();
|
||
},
|
||
isShelfLifeMgmtDetail(detail) {
|
||
if (!detail || typeof detail !== 'object') {
|
||
return false;
|
||
}
|
||
|
||
const flag = detail.is_shelf_life_mgmt
|
||
?? detail.product_snapshot?.is_shelf_life_mgmt;
|
||
return flag === true || flag === 1 || flag === '1' || flag === 'true';
|
||
},
|
||
validateShelfLifeRequiredFields() {
|
||
const invalidDetail = (this.details || []).find(detail => {
|
||
if (!this.isShelfLifeMgmtDetail(detail)) {
|
||
return false;
|
||
}
|
||
|
||
const productionDate = String(detail.production_date || '').trim();
|
||
const expiryDate = String(detail.expiry_date || '').trim();
|
||
return !productionDate || !expiryDate;
|
||
});
|
||
|
||
if (!invalidDetail) {
|
||
return null;
|
||
}
|
||
|
||
const missingFields = [];
|
||
if (!String(invalidDetail.production_date || '').trim()) {
|
||
missingFields.push('生产日期');
|
||
}
|
||
if (!String(invalidDetail.expiry_date || '').trim()) {
|
||
missingFields.push('到期日期');
|
||
}
|
||
|
||
return {
|
||
detail: invalidDetail,
|
||
missingFields
|
||
};
|
||
},
|
||
validateExpiryDateNotPast() {
|
||
const todayStart = this.getTodayStartTimestamp();
|
||
const invalidDetail = (this.details || []).find(detail => {
|
||
const expiryDate = String(detail?.expiry_date || '').trim();
|
||
if (!expiryDate) {
|
||
return false;
|
||
}
|
||
|
||
const expiryTimestamp = this.parseDateToTimestamp(expiryDate);
|
||
return Number.isFinite(expiryTimestamp) && expiryTimestamp < todayStart;
|
||
});
|
||
|
||
return invalidDetail || null;
|
||
},
|
||
// 初始化数据
|
||
async initData() {
|
||
await this.loadReceivingInfo();
|
||
},
|
||
// 加载收货单信息
|
||
async loadReceivingInfo() {
|
||
try {
|
||
const res = await this.$http('storage.receiving.get', {
|
||
id: this.receivingId
|
||
});
|
||
|
||
if (res.code === 200) {
|
||
this.receivingInfo = {
|
||
...res.data,
|
||
creator_name: res.data.creator_snapshot ?
|
||
JSON.parse(res.data.creator_snapshot).name : ''
|
||
};
|
||
this.details = res.data.details || [];
|
||
|
||
// 默认选中第一个明细
|
||
if (this.details.length > 0 && !this.selectedDetail) {
|
||
this.selectedDetail = this.details[0];
|
||
}
|
||
|
||
// 如果已有选中,更新对应的明细数据
|
||
if (this.selectedDetail && this.selectedDetail.id) {
|
||
// 找到当前选中明细在数组中的位置
|
||
const index = this.details.findIndex(item => item.id === this.selectedDetail.id);
|
||
|
||
if (index !== -1) {
|
||
|
||
// 如果需要,重新设置选中的对象(保持响应性)
|
||
this.selectedDetail = this.details[index];
|
||
} else {
|
||
this.selectedDetail = this.details[0];
|
||
}
|
||
}
|
||
}
|
||
} catch (error) {
|
||
console.error('加载收货单信息失败:', error);
|
||
uni.showToast({
|
||
title: '加载失败',
|
||
icon: 'error'
|
||
});
|
||
}
|
||
},
|
||
async handleSelectDetailChange(data) {
|
||
console.log('更新数据:', data);
|
||
|
||
try {
|
||
// 货主确认逻辑
|
||
if (this.receivingInfo.store_id == null && data.system_product_id) {
|
||
const confirm = await this.confirmStoreOwner();
|
||
if (!confirm) {
|
||
uni.showToast({
|
||
title: '已取消',
|
||
icon: 'none'
|
||
});
|
||
return;
|
||
}
|
||
}
|
||
|
||
// 调用API更新
|
||
uni.showLoading({
|
||
title: '更新中...'
|
||
});
|
||
const res = await this.$http("storage.receiving.detailChange", data);
|
||
uni.hideLoading();
|
||
|
||
if (res.code == 200) {
|
||
await this.initData(); // 刷新数据
|
||
} else {
|
||
uni.showToast({
|
||
title: res.message || '更新失败',
|
||
icon: 'error'
|
||
});
|
||
}
|
||
|
||
} catch (error) {
|
||
console.error('更新失败:', error);
|
||
uni.showToast({
|
||
title: '网络错误',
|
||
icon: 'error'
|
||
});
|
||
}
|
||
},
|
||
|
||
/**
|
||
* 确认货主弹窗
|
||
*/
|
||
confirmStoreOwner() {
|
||
return new Promise((resolve) => {
|
||
uni.showModal({
|
||
title: '货主确认',
|
||
content: `是否确定当前收货单为货主【${this.tmp_storeName}】的?确定后不可更改。`,
|
||
success: (res) => {
|
||
resolve(res.confirm);
|
||
}
|
||
});
|
||
});
|
||
},
|
||
// Tab切换
|
||
handleTabChange(tab) {
|
||
this.currentTab = tab.index;
|
||
this.$nextTick(() => {
|
||
this.updateReceivingListHeaderTop();
|
||
});
|
||
},
|
||
|
||
updateReceivingListHeaderTop() {
|
||
const query = uni.createSelectorQuery().in(this);
|
||
query.select('.content-container').boundingClientRect();
|
||
query.exec(res => {
|
||
const contentRect = res && res[0];
|
||
if (!contentRect) {
|
||
return;
|
||
}
|
||
|
||
const headerGap = this.receivingListHeaderGap || uni.upx2px(20);
|
||
this.receivingListHeaderTop = contentRect.top + headerGap;
|
||
});
|
||
},
|
||
|
||
// DetailContainer事件处理
|
||
handleSelectDetail(detail) {
|
||
this.selectedDetail = detail;
|
||
},
|
||
async handleDeleteDetail(id) {
|
||
// 先查找要删除的明细信息,用于提示
|
||
const detailToDelete = this.details.find(item => item.id === id);
|
||
if (!detailToDelete) {
|
||
uni.showToast({
|
||
title: '要删除的明细不存在',
|
||
icon: 'none'
|
||
});
|
||
return;
|
||
}
|
||
|
||
uni.showModal({
|
||
title: '确认删除',
|
||
content: `确定要删除商品"${detailToDelete.product_name}"吗?`,
|
||
success: async (res) => {
|
||
if (res.confirm) {
|
||
try {
|
||
const result = await this.$http('storage.receiving.deleteDetail', {
|
||
receiving_id: this.receivingId,
|
||
detail_id: id
|
||
});
|
||
|
||
if (result.code === 200) {
|
||
uni.showToast({
|
||
title: '删除成功',
|
||
icon: 'success'
|
||
});
|
||
|
||
// 更新明细列表
|
||
if (result.data.details) {
|
||
this.details = result.data.details;
|
||
}
|
||
|
||
// 处理选中状态
|
||
if (this.selectedDetail && this.selectedDetail.id === id) {
|
||
// 如果删除的是当前选中的明细,需要重新选择一个
|
||
if (this.details.length > 0) {
|
||
// 选择第一个明细
|
||
this.selectedDetail = this.details[0];
|
||
} else {
|
||
// 如果没有明细了,清空选中
|
||
this.selectedDetail = null;
|
||
}
|
||
}
|
||
} else {
|
||
uni.showToast({
|
||
title: result.message || '删除失败',
|
||
icon: 'none'
|
||
});
|
||
}
|
||
} catch (error) {
|
||
console.error('删除明细失败:', error);
|
||
uni.showToast({
|
||
title: `删除失败: ${error.message}`,
|
||
icon: 'error'
|
||
});
|
||
}
|
||
}
|
||
}
|
||
});
|
||
},
|
||
// 处理添加明细事件 - 从detail-container组件接收
|
||
async handleAddDetail() {
|
||
try {
|
||
const result = await this.$http('storage.receiving.addDetail', {
|
||
receiving_id: this.receivingId
|
||
});
|
||
|
||
if (result.code === 200) {
|
||
uni.showToast({
|
||
title: '添加成功',
|
||
icon: 'success'
|
||
});
|
||
|
||
if (result.data.selectId) {
|
||
const newDetail = this.details.find(item => item.id === result.data.selectId);
|
||
if (newDetail) {
|
||
this.selectedDetail = newDetail;
|
||
}
|
||
}
|
||
this.initData();
|
||
}
|
||
} catch (error) {
|
||
console.error('添加明细失败:', error);
|
||
uni.showToast({
|
||
title: `添加失败: ${error.message}`,
|
||
icon: 'error'
|
||
});
|
||
}
|
||
},
|
||
|
||
// 处理删除明细事件
|
||
async deleteDetail(id) {
|
||
uni.showModal({
|
||
title: '确认删除',
|
||
content: '确定要删除这个商品明细吗?',
|
||
async success(res) {
|
||
if (res.confirm) {
|
||
try {
|
||
const result = await this.$http('storage.receiving.detailDelete', {
|
||
id: id
|
||
});
|
||
|
||
if (result.code === 200) {
|
||
uni.showToast({
|
||
title: '删除成功',
|
||
icon: 'success'
|
||
});
|
||
|
||
// 重新加载收货单信息(包含明细)
|
||
await this.loadReceivingInfo();
|
||
|
||
// 如果删除的是当前选中的,清空选中
|
||
if (this.selectedDetail && this.selectedDetail.id === id) {
|
||
this.selectedDetail = null;
|
||
}
|
||
}
|
||
} catch (error) {
|
||
uni.showToast({
|
||
title: `删除失败: ${error.message}`,
|
||
icon: 'error'
|
||
});
|
||
}
|
||
}
|
||
}
|
||
});
|
||
},
|
||
|
||
// 处理图片预览事件
|
||
handlePreviewImage({
|
||
images,
|
||
index
|
||
}) {
|
||
this.previewImage(images, index);
|
||
},
|
||
|
||
// 图片预览方法
|
||
previewImage(images, index) {
|
||
if (!images || images.length === 0) return;
|
||
|
||
uni.previewImage({
|
||
current: index,
|
||
urls: images
|
||
});
|
||
},
|
||
|
||
// 操作菜单处理
|
||
handleAction(index) {
|
||
console.log("菜单点击",index);
|
||
switch (index.action) {
|
||
case "initData":
|
||
this.initData();
|
||
break;
|
||
case "completeReceiving":
|
||
this.showComplete = true;
|
||
break;
|
||
case "cancel":
|
||
this.cancel();
|
||
}
|
||
},
|
||
async completeReceiving() {
|
||
this.showComplete = false;
|
||
const shelfLifeValidation = this.validateShelfLifeRequiredFields();
|
||
if (shelfLifeValidation) {
|
||
this.currentTab = 1;
|
||
this.selectedDetail = shelfLifeValidation.detail;
|
||
uni.showModal({
|
||
title: '商品信息不完整',
|
||
content: `${shelfLifeValidation.detail.product_name || '当前商品'}缺少${shelfLifeValidation.missingFields.join('、')}`,
|
||
showCancel: false
|
||
});
|
||
return;
|
||
}
|
||
const expiredDetail = this.validateExpiryDateNotPast();
|
||
if (expiredDetail) {
|
||
this.currentTab = 1;
|
||
this.selectedDetail = expiredDetail;
|
||
uni.showModal({
|
||
title: '禁止收货',
|
||
content: `商品名称:${expiredDetail.product_name || '当前商品'}已过期,请移除拒绝收货`,
|
||
showCancel: false
|
||
});
|
||
return;
|
||
}
|
||
try {
|
||
// 1. 显示确认弹窗
|
||
const confirmResult = await uni.showModal({
|
||
title: '完成收货',
|
||
content: '确定要完成当前收货单吗?完成后将无法修改。',
|
||
confirmText: '确定完成',
|
||
confirmColor: '#2979ff',
|
||
cancelText: '再想想',
|
||
cancelColor: '#999'
|
||
});
|
||
|
||
console.log('确认结果:', confirmResult);
|
||
|
||
// 修正:直接使用confirmResult.confirm
|
||
if (!confirmResult[1].confirm) {
|
||
return;
|
||
}
|
||
|
||
// 2. 显示加载状态
|
||
uni.showLoading({
|
||
title: '正在完成收货...',
|
||
mask: true
|
||
});
|
||
|
||
// 3. 调用完成收货接口
|
||
const res = await this.$http('storage.receiving.completeReceiving', {
|
||
id: this.receivingId
|
||
});
|
||
|
||
console.log('请求返回:', res);
|
||
|
||
// 4. 隐藏加载状态
|
||
uni.hideLoading();
|
||
|
||
// 5. 检查响应结果
|
||
// 根据你的后端响应结构调整
|
||
if (res.code === 200 || res.success) {
|
||
// 成功提示
|
||
uni.showToast({
|
||
title: '收货完成成功',
|
||
icon: 'success',
|
||
duration: 1500
|
||
});
|
||
|
||
// 延迟跳转
|
||
setTimeout(() => {
|
||
uni.redirectTo({
|
||
url: './receiving',
|
||
animationType: 'slide-in-left'
|
||
});
|
||
}, 1500);
|
||
} else {
|
||
// 处理业务错误
|
||
let errorMsg = res.message || '操作失败';
|
||
|
||
// 如果有详细的错误信息
|
||
if (res.data && res.data.invalid_details) {
|
||
const firstError = res.data.invalid_details[0];
|
||
|
||
// 弹出详细错误提示
|
||
uni.showModal({
|
||
title: '商品信息不完整',
|
||
content: errorMsg,
|
||
confirmText: '去补全',
|
||
success: (modalRes) => {
|
||
if (modalRes.confirm) {
|
||
this.currentTab = 1;
|
||
const index = this.details.findIndex(item => item.id === firstError.detail_id);
|
||
if (index !== -1) {
|
||
this.selectedDetail = this.details[index];
|
||
} else {
|
||
//数据不一致,设置选中id,更新数据
|
||
this.selectedDetail.id = firstError.detail_id;
|
||
this.initData();
|
||
|
||
}
|
||
}
|
||
}
|
||
});
|
||
return;
|
||
}
|
||
|
||
throw new Error(errorMsg);
|
||
}
|
||
|
||
} catch (error) {
|
||
// 错误处理
|
||
uni.hideLoading();
|
||
console.error('完成收货失败:', error);
|
||
this.currentTab = 1;
|
||
uni.showToast({
|
||
title: error.message || '操作失败,请稍后重试',
|
||
icon: 'none',
|
||
duration: 3000
|
||
});
|
||
}
|
||
},
|
||
async cancel() {
|
||
try {
|
||
// 1. 显示确认弹窗
|
||
const confirmResult = await uni.showModal({
|
||
title: '整单作废',
|
||
content: '确定要作废当前收货单吗?此操作不可撤销。',
|
||
confirmText: '确定作废',
|
||
confirmColor: '#e64340',
|
||
cancelText: '再想想',
|
||
cancelColor: '#999'
|
||
});
|
||
console.log(confirmResult);
|
||
if (!confirmResult[1].confirm) {
|
||
return;
|
||
}
|
||
|
||
// 2. 显示加载状态
|
||
uni.showLoading({
|
||
title: '正在作废...',
|
||
mask: true
|
||
});
|
||
console.log("作废");
|
||
// 3. 调用取消接口
|
||
const res = await this.$http('storage.receiving.cancel', {
|
||
id: this.receivingId
|
||
});
|
||
|
||
console.log("请求返回",res);
|
||
const {data} = res;
|
||
// 4. 隐藏加载状态
|
||
uni.hideLoading();
|
||
if(res.code!==200){
|
||
throw new Error("取消失败"+res.message)
|
||
}
|
||
// 5. 显示成功提示
|
||
uni.showToast({
|
||
title: '取消成功',
|
||
icon: 'success',
|
||
duration: 1500
|
||
});
|
||
|
||
// 6. 延迟跳转,让用户看到成功提示
|
||
setTimeout(() => {
|
||
uni.redirectTo({
|
||
url: './receiving',
|
||
animationType: 'slide-in-left'
|
||
});
|
||
}, 1500);
|
||
|
||
} catch (error) {
|
||
// 7. 错误处理
|
||
uni.hideLoading();
|
||
console.log(error);
|
||
uni.showToast({
|
||
title: error.message,
|
||
icon: 'none',
|
||
duration: 3000
|
||
});
|
||
}
|
||
},
|
||
async selectStock(stock) {
|
||
const updateData = {
|
||
...this.selectedDetail, // 保留原有的所有属性
|
||
system_product_id: stock.id,
|
||
};
|
||
this.tmp_storeName = stock.store_stock.store_remask;
|
||
await this.handleSelectDetailChange(updateData);
|
||
},
|
||
async selectSpace(space){
|
||
const updateData = {
|
||
...this.selectedDetail, // 保留原有的所有属性
|
||
space_id: space.id,
|
||
};
|
||
await this.handleSelectDetailChange(updateData);
|
||
},
|
||
async tryGetStock(data) {
|
||
if(!this.selectedDetail){
|
||
return false;
|
||
}
|
||
const stocks = await this.$http("stock.warehouse.search", {
|
||
keyword: data,
|
||
store_id: this.receivingInfo.store_id
|
||
});
|
||
|
||
if (stocks.code == 200) {
|
||
if (stocks.total == 1) {
|
||
const updateData = {
|
||
...this.selectedDetail, // 保留原有的所有属性
|
||
system_product_id: stocks.data[0].id,
|
||
};
|
||
this.tmp_storeName = stocks.data[0].store_stock.store_remask;
|
||
await this.handleSelectDetailChange(updateData);
|
||
} else if (stocks.total > 1) {
|
||
this.showStockList = true;
|
||
this.stockList = stocks.data;
|
||
//显示列表
|
||
} else {
|
||
const updateData = {
|
||
...this.selectedDetail, // 保留原有的所有属性
|
||
barcode: data,
|
||
system_product_id:null,
|
||
product_name:"新商品",
|
||
|
||
// 确保barcode被正确设置
|
||
};
|
||
this.tmp_storeName = null;
|
||
await this.handleSelectDetailChange(updateData);
|
||
}
|
||
} else {
|
||
console.log("搜索出错");
|
||
}
|
||
},
|
||
async searchSpace(data){
|
||
console.log("searchSpace",data);
|
||
const spaceInfo = await this.$http("common.searchSpace",{keyword:data});
|
||
if(spaceInfo.code==200){
|
||
if (spaceInfo.total == 1 && this.selectedDetail.space_id!=spaceInfo.data[0].id) {
|
||
const updateData = {
|
||
...this.selectedDetail, // 保留原有的所有属性
|
||
space_id: spaceInfo.data[0].id
|
||
};
|
||
console.log("更新仓位",updateData);
|
||
await this.handleSelectDetailChange(updateData);
|
||
} else if (spaceInfo.total > 1) {
|
||
console.log("多个仓位",spaceInfo.data);
|
||
this.showSpaceList = true;
|
||
this.spaceList = spaceInfo.data;
|
||
}
|
||
}
|
||
},
|
||
|
||
async handlePrint(data){
|
||
console.log(data);
|
||
this.printData = data;
|
||
this.showPrint = true;
|
||
},
|
||
},
|
||
onLoad(options) {
|
||
if (options.id) {
|
||
this.receivingId = parseInt(options.id);
|
||
this.initData();
|
||
}
|
||
},
|
||
onReady() {
|
||
this.receivingListHeaderGap = uni.upx2px(20);
|
||
this.$nextTick(() => {
|
||
this.updateReceivingListHeaderTop();
|
||
});
|
||
}
|
||
};
|
||
</script>
|
||
|
||
<style lang="scss" scoped>
|
||
.container {
|
||
padding: 20rpx;
|
||
flex: 1;
|
||
overflow: hidden;
|
||
}
|
||
|
||
.tabs-container {
|
||
background: #fff;
|
||
border-radius: 16rpx;
|
||
margin-bottom: 20rpx;
|
||
}
|
||
|
||
.nav-right {
|
||
padding-right: 20rpx;
|
||
}
|
||
|
||
.info-container {
|
||
height: 100%;
|
||
}
|
||
|
||
.content-container {
|
||
height: 100%;
|
||
display: flex;
|
||
flex-direction: column;
|
||
}
|
||
|
||
.receipt-content {
|
||
flex: 1;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
background: #fff;
|
||
border-radius: 16rpx;
|
||
}
|
||
.filter-popup {
|
||
height: 750rpx;
|
||
display: flex;
|
||
flex-direction: column;
|
||
padding-bottom: env(safe-area-inset-bottom);
|
||
|
||
.popup-header {
|
||
padding: 40rpx 30rpx 20rpx;
|
||
border-bottom: 1rpx solid #f0f0f0;
|
||
|
||
.popup-title {
|
||
font-size: 36rpx;
|
||
font-weight: 600;
|
||
color: #333;
|
||
}
|
||
}
|
||
|
||
.popup-content {
|
||
padding: 30rpx;
|
||
height: 100rpx;
|
||
flex:1;
|
||
.date-range {
|
||
font-size: 28rpx;
|
||
color: #333;
|
||
padding: 10rpx 0;
|
||
}
|
||
|
||
.quick-date-buttons {
|
||
display: flex;
|
||
gap: 20rpx;
|
||
|
||
::v-deep .u-btn {
|
||
flex: 1;
|
||
}
|
||
}
|
||
}
|
||
|
||
.popup-actions {
|
||
padding: 30rpx;
|
||
border-top: 1rpx solid #f0f0f0;
|
||
display: flex;
|
||
gap: 20rpx;
|
||
|
||
::v-deep .u-btn {
|
||
flex: 1;
|
||
height: 90rpx;
|
||
font-size: 32rpx;
|
||
}
|
||
}
|
||
}
|
||
</style> |