feat(storegoods): 新增加工进仓模块并适配智盛ERP

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-23 18:32:02 +08:00
co-authored by Cursor
parent 02f192cac6
commit d660d6fcf1
31 changed files with 2483 additions and 312 deletions
@@ -0,0 +1,129 @@
<template>
<view class="fabric-out-page">
<OrderStatusBar class="fabric-out-mt32" :status="order.audit_status" :name="order.audit_status_name" />
<view class="flex-white-plr26 ptb10 bdb_f5">
<text class="mr26">进仓单号</text>
<text>{{ order.order_no }}</text>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">进仓类型</text>
<text>{{ order.in_order_type_name || '加工进仓单' }}</text>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">加工单位</text>
<text>{{ order.process_name || '-' }}</text>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">仓库名称</text>
<text>{{ order.warehouse_name || '-' }}</text>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">单据备注</text>
<text>{{ order.remark || '-' }}</text>
</view>
<view class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">创建人</text>
<text>{{ order.creator_name }} {{ formatTime(order.create_time, 'YYYY-MM-DD') }}</text>
</view>
<view v-if="order.auditor_name" class="flex-white-plr26 ptb20 bdb_f5">
<text class="mr26">审核人</text>
<text>{{ order.auditor_name }} {{ formatTime(order.audit_time, 'YYYY-MM-DD') }}</text>
</view>
<ProcessInDetailList
:title="detailTitle"
:list="order.item_data"
/>
<FabricOutFooter :buttons="actionButtons" @action="handleAction" />
</view>
</template>
<script>
import util from '@/common/util';
import OrderStatusBar from '@/components/storefabric/OrderStatusBar.vue';
import FabricOutFooter from '@/components/storefabric/FabricOutFooter.vue';
import ProcessInDetailList from '@/components/storegoods/ProcessInDetailList.vue';
import {
normalizeOrder,
getViewStatusActionButtons,
confirmOrderStatusAction,
formatDisplayTime,
} from '@/common/storeGoodsProcessIn';
export default {
components: { OrderStatusBar, FabricOutFooter, ProcessInDetailList },
data() {
return {
orderId: 0,
order: { item_data: [] },
};
},
computed: {
actionButtons() {
return getViewStatusActionButtons(this.order.audit_status);
},
detailTitle() {
return `进仓明细(共 ${this.order.total_roll || 0} 匹)`;
},
},
onLoad(e) {
uni.setNavigationBarTitle({ title: '查看加工进仓单' });
if (e.id) {
this.orderId = Number(e.id);
this.refreshOrder();
}
},
onShow() {
if (this.orderId) this.refreshOrder();
},
methods: {
formatTime: formatDisplayTime,
refreshOrder() {
this.$u.api.fpmProcessInOrder.detail({ id: this.orderId })
.then((res) => {
const order = normalizeOrder(res);
if (!order) {
this.showError('单据不存在');
return;
}
this.order = order;
})
.catch((err) => {
this.showError(err.message || '加载单据失败');
});
},
handleAction(action) {
if (action === 'edit') {
uni.navigateTo({ url: `./storeGoodsProcessInEdit?id=${this.orderId}` });
return;
}
confirmOrderStatusAction(this, {
orderId: this.orderId,
action,
onSuccess: () => this.$u.api.fpmProcessInOrder.detail({ id: this.orderId })
.then((res) => {
uni.hideLoading();
const order = normalizeOrder(res);
if (order) this.order = order;
util.playSuccessAudio();
uni.showToast({ title: '操作成功', icon: 'success' });
}),
});
},
showError(message) {
util.playErrorAudio();
uni.showModal({ title: '提示', content: message, showCancel: false });
},
},
};
</script>
<style lang="scss">
@import '@/pages/storefabric/storeFabricBusinessOutPage.scss';
page {
background-color: #F8F8F8;
padding-bottom: 260rpx;
}
</style>