From 300f0fd4a8148dab8915eb26ace72e187fa18e61 Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期四, 30 四月 2026 10:03:49 +0800
Subject: [PATCH] 工艺路线模块开发
---
src/pages.json | 14
src/api/productionManagement/processRoute.js | 37 +
src/pages/works.vue | 4
src/api/productionManagement/productionOrder.js | 26
src/pages/productionManagement/processRoute/index.vue | 287 ++++++++++
src/pages/productionManagement/processRoute/items.vue | 544 ++++++++++++++++++++
src/pages/productionManagement/productionOrder/index.vue | 688 +++++++++++++-----------
7 files changed, 1,282 insertions(+), 318 deletions(-)
diff --git a/src/api/productionManagement/processRoute.js b/src/api/productionManagement/processRoute.js
new file mode 100644
index 0000000..bf49b11
--- /dev/null
+++ b/src/api/productionManagement/processRoute.js
@@ -0,0 +1,37 @@
+// 宸ヨ壓璺嚎鐩稿叧鎺ュ彛
+import request from "@/utils/request";
+
+// 鍒嗛〉鏌ヨ宸ヨ壓璺嚎鍒楄〃
+export function listPage(query) {
+ return request({
+ url: "/technologyRouting/page",
+ method: "get",
+ params: query,
+ });
+}
+
+// 鏌ヨ宸ヨ壓璺嚎椤圭洰鍒楄〃
+export function findProcessRouteItemList(query) {
+ return request({
+ url: "/technologyRoutingOperation/list",
+ method: "get",
+ params: query,
+ });
+}
+
+// 鑾峰彇宸ュ簭鍙傛暟鍒楄〃
+export function getProcessParamList(query) {
+ return request({
+ url: "/technologyRoutingOperationParam/list",
+ method: "get",
+ params: query,
+ });
+}
+
+// 鏌ヨBOM缁撴瀯 (宸ヨ壓璺嚎)
+export function queryBomList(bomId) {
+ return request({
+ url: "/technologyBomStructure/listByBomId/" + bomId,
+ method: "get",
+ });
+}
diff --git a/src/api/productionManagement/productionOrder.js b/src/api/productionManagement/productionOrder.js
index 87dd65e..bbe6162 100644
--- a/src/api/productionManagement/productionOrder.js
+++ b/src/api/productionManagement/productionOrder.js
@@ -42,3 +42,29 @@
method: "get",
});
}
+
+// 鑾峰彇鐢熶骇璁㈠崟鍏宠仈鐨勫伐鑹鸿矾绾夸富淇℃伅
+export function getOrderProcessRouteMain(orderId) {
+ return request({
+ url: "/productionOrderRouting/listMain",
+ method: "get",
+ params: { orderId },
+ });
+}
+
+// 鏌ヨBOM缁撴瀯 (鐢熶骇璁㈠崟)
+export function queryOrderBomList(bomId) {
+ return request({
+ url: "/productionBomStructure/listByBomId/" + bomId,
+ method: "get",
+ });
+}
+
+// 鑾峰彇宸ュ簭鍙傛暟鍒楄〃 (鐢熶骇璁㈠崟)
+export function findProcessParamListOrder(query) {
+ return request({
+ url: "/productionOrderRoutingOperationParam/list",
+ method: "get",
+ params: query,
+ });
+}
diff --git a/src/pages.json b/src/pages.json
index 5a2c086..ce4058c 100644
--- a/src/pages.json
+++ b/src/pages.json
@@ -789,6 +789,20 @@
}
},
{
+ "path": "pages/productionManagement/processRoute/index",
+ "style": {
+ "navigationBarTitleText": "宸ヨ壓璺嚎",
+ "navigationStyle": "custom"
+ }
+ },
+ {
+ "path": "pages/productionManagement/processRoute/items",
+ "style": {
+ "navigationBarTitleText": "璺嚎椤圭洰",
+ "navigationStyle": "custom"
+ }
+ },
+ {
"path": "pages/productionManagement/productionDispatching/index",
"style": {
"navigationBarTitleText": "鐢熶骇娲惧伐",
diff --git a/src/pages/productionManagement/processRoute/index.vue b/src/pages/productionManagement/processRoute/index.vue
new file mode 100644
index 0000000..b993d99
--- /dev/null
+++ b/src/pages/productionManagement/processRoute/index.vue
@@ -0,0 +1,287 @@
+<template>
+ <view class="process-route">
+ <!-- 浣跨敤閫氱敤椤甸潰澶撮儴缁勪欢 -->
+ <PageHeader title="宸ヨ壓璺嚎"
+ @back="goBack" />
+ <!-- 鎼滅储鍖哄煙 -->
+ <view class="search-section">
+ <view class="search-bar">
+ <view class="search-input">
+ <up-input class="search-text"
+ placeholder="璇疯緭鍏ヨ鏍煎悕绉版悳绱�"
+ v-model="searchForm.model"
+ @change="handleQuery"
+ clearable />
+ </view>
+ <view class="filter-button"
+ @click="handleQuery">
+ <up-icon name="search"
+ size="24"
+ color="#999"></up-icon>
+ </view>
+ </view>
+ </view>
+ <!-- 鍒楄〃鍖哄煙 -->
+ <scroll-view scroll-y
+ class="list-container"
+ v-if="tableData.length > 0"
+ @scrolltolower="loadMore">
+ <view v-for="(item, index) in tableData"
+ :key="item.id || index"
+ @click="goDetail(item)">
+ <view class="ledger-item">
+ <view class="item-header">
+ <view class="item-left">
+ <view class="document-icon">
+ <up-icon name="share-square"
+ size="16"
+ color="#ffffff"></up-icon>
+ </view>
+ <text class="item-id">{{ item.processRouteCode }}</text>
+ </view>
+ </view>
+ <up-divider></up-divider>
+ <view class="item-details">
+ <view class="detail-row">
+ <text class="detail-label">浜у搧鍚嶇О</text>
+ <text class="detail-value font-bold">{{ item.productName || '-' }}</text>
+ </view>
+ <view class="detail-row">
+ <text class="detail-label">瑙勬牸鍚嶇О</text>
+ <text class="detail-value">{{ item.model || '-' }}</text>
+ </view>
+ <view class="detail-row">
+ <text class="detail-label">BOM缂栧彿</text>
+ <text class="detail-value">{{ item.bomNo || '-' }}</text>
+ </view>
+ <view class="detail-row">
+ <text class="detail-label">鎻忚堪</text>
+ <text class="detail-value">{{ item.description || '-' }}</text>
+ </view>
+ </view>
+ <view class="item-footer">
+ <text class="more-detail">璺嚎椤圭洰</text>
+ <up-icon name="arrow-right"
+ size="14"
+ color="#999"></up-icon>
+ </view>
+ </view>
+ </view>
+ <up-loadmore :status="loadStatus"
+ v-if="tableData.length >= page.size" />
+ </scroll-view>
+ <view v-else
+ class="no-data">
+ <up-empty mode="data"
+ text="鏆傛棤宸ヨ壓璺嚎鏁版嵁"></up-empty>
+ </view>
+ </view>
+</template>
+
+<script setup>
+ import { ref, reactive, toRefs, getCurrentInstance } from "vue";
+ import { onShow } from "@dcloudio/uni-app";
+ import { listPage } from "@/api/productionManagement/processRoute.js";
+ import PageHeader from "@/components/PageHeader.vue";
+
+ const { proxy } = getCurrentInstance();
+
+ // 鍔犺浇鐘舵��
+ const loading = ref(false);
+ const loadStatus = ref("loadmore");
+ // 鍒楄〃鏁版嵁
+ const tableData = ref([]);
+
+ // 鍒嗛〉閰嶇疆
+ const page = reactive({
+ current: 1,
+ size: 10,
+ total: 0,
+ });
+
+ // 鎼滅储琛ㄥ崟鏁版嵁
+ const data = reactive({
+ searchForm: {
+ model: "",
+ },
+ });
+ const { searchForm } = toRefs(data);
+
+ // 杩斿洖涓婁竴椤�
+ const goBack = () => {
+ uni.navigateBack();
+ };
+
+ // 鏌ヨ鍒楄〃
+ const handleQuery = () => {
+ page.current = 1;
+ tableData.value = [];
+ getList();
+ };
+
+ // 鍔犺浇鏇村
+ const loadMore = () => {
+ if (loadStatus.value === "nomore" || loading.value) return;
+ page.current++;
+ getList();
+ };
+
+ // 鑾峰彇鍒楄〃鏁版嵁
+ const getList = () => {
+ loading.value = true;
+ loadStatus.value = "loading";
+
+ const params = {
+ current: page.current,
+ size: page.size,
+ model: searchForm.value.model,
+ };
+
+ listPage(params)
+ .then(res => {
+ loading.value = false;
+ const records = res.data.records || [];
+ if (page.current === 1) {
+ tableData.value = records;
+ } else {
+ tableData.value = [...tableData.value, ...records];
+ }
+
+ if (records.length < page.size) {
+ loadStatus.value = "nomore";
+ } else {
+ loadStatus.value = "loadmore";
+ }
+ page.total = res.data.total || 0;
+ })
+ .catch(() => {
+ loading.value = false;
+ loadStatus.value = "loadmore";
+ uni.showToast({
+ title: "鍔犺浇澶辫触",
+ icon: "error",
+ });
+ });
+ };
+
+ // 璺宠浆璺嚎椤圭洰
+ const goDetail = item => {
+ uni.navigateTo({
+ url: `/pages/productionManagement/processRoute/items?id=${
+ item.id
+ }&processRouteCode=${
+ item.processRouteCode
+ }&productName=${encodeURIComponent(
+ item.productName || ""
+ )}&model=${encodeURIComponent(item.model || "")}&bomNo=${
+ item.bomNo || ""
+ }&bomId=${item.bomId || ""}&description=${encodeURIComponent(
+ item.description || ""
+ )}`,
+ });
+ };
+
+ // 椤甸潰鏄剧ず鏃跺姞杞芥暟鎹�
+ onShow(() => {
+ handleQuery();
+ });
+</script>
+
+<style scoped lang="scss">
+ @import "@/styles/sales-common.scss";
+
+ .process-route {
+ min-height: 100vh;
+ background: #f8f9fa;
+ display: flex;
+ flex-direction: column;
+ }
+
+ .list-container {
+ flex: 1;
+ height: 0;
+ }
+
+ .ledger-item {
+ background: #fff;
+ margin: 20rpx;
+ padding: 24rpx;
+ border-radius: 16rpx;
+ box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.06);
+
+ .item-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding-bottom: 12rpx;
+
+ .item-left {
+ display: flex;
+ align-items: center;
+
+ .document-icon {
+ width: 44rpx;
+ height: 44rpx;
+ background: #3c9cff;
+ border-radius: 10rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ margin-right: 20rpx;
+ }
+
+ .item-id {
+ font-size: 30rpx;
+ font-weight: bold;
+ color: #333;
+ }
+ }
+ }
+
+ .item-details {
+ padding: 16rpx 0;
+
+ .detail-row {
+ display: flex;
+ justify-content: space-between;
+ align-items: flex-start;
+ margin-bottom: 16rpx;
+
+ .detail-label {
+ font-size: 26rpx;
+ color: #999;
+ min-width: 140rpx;
+ }
+
+ .detail-value {
+ font-size: 26rpx;
+ color: #333;
+ text-align: right;
+ flex: 1;
+
+ &.font-bold {
+ font-weight: bold;
+ }
+ }
+ }
+ }
+
+ .item-footer {
+ display: flex;
+ justify-content: flex-end;
+ align-items: center;
+ padding-top: 16rpx;
+ border-top: 1rpx solid #f0f0f0;
+
+ .more-detail {
+ font-size: 24rpx;
+ color: #3c9cff;
+ margin-right: 8rpx;
+ }
+ }
+ }
+
+ .no-data {
+ padding-top: 200rpx;
+ }
+</style>
diff --git a/src/pages/productionManagement/processRoute/items.vue b/src/pages/productionManagement/processRoute/items.vue
new file mode 100644
index 0000000..d555526
--- /dev/null
+++ b/src/pages/productionManagement/processRoute/items.vue
@@ -0,0 +1,544 @@
+<template>
+ <view class="process-route-items">
+ <PageHeader title="璺嚎椤圭洰"
+ @back="goBack" />
+ <!-- 璺嚎鍩虹淇℃伅鍗$墖 -->
+ <view class="route-info-card">
+ <view class="info-row">
+ <text class="label">宸ヨ壓璺嚎缂栧彿</text>
+ <text class="value">{{ routeInfo.processRouteCode || '-' }}</text>
+ </view>
+ <view class="info-row">
+ <text class="label">浜у搧鍚嶇О</text>
+ <text class="value">{{ routeInfo.productName || '-' }}</text>
+ </view>
+ <view class="info-row">
+ <text class="label">瑙勬牸鍚嶇О</text>
+ <text class="value">{{ routeInfo.model || '-' }}</text>
+ </view>
+ <view class="info-row">
+ <text class="label">BOM缂栧彿</text>
+ <text class="value">{{ routeInfo.bomNo || '-' }}</text>
+ </view>
+ </view>
+ <!-- 閫夐」鍗″垏鎹� -->
+ <view class="tabs-box">
+ <up-tabs :list="tabsList"
+ @click="handleTabClick"
+ :current="currentTab"></up-tabs>
+ </view>
+ <!-- 宸ュ簭椤圭洰鍒楄〃 -->
+ <scroll-view scroll-y
+ class="content-scroll"
+ v-if="currentTab === 0">
+ <view v-if="itemsList.length > 0">
+ <view v-for="(item, index) in itemsList"
+ :key="index"
+ class="process-card">
+ <view class="card-header">
+ <view class="index-badge">{{ index + 1 }}</view>
+ <text class="process-name">{{ item.technologyOperationName || item.operationName || '-' }}</text>
+ </view>
+ <view class="card-content">
+ <view class="detail-row">
+ <text class="detail-label">鍏宠仈浜у搧</text>
+ <text class="detail-value">{{ item.productName || '-' }}</text>
+ </view>
+ <view class="detail-row">
+ <text class="detail-label">瑙勬牸鍨嬪彿</text>
+ <text class="detail-value">{{ item.model || '-' }}</text>
+ </view>
+ <view class="detail-row">
+ <text class="detail-label">鍗曚綅</text>
+ <text class="detail-value">{{ item.unit || '-' }}</text>
+ </view>
+ <view class="tag-row">
+ <up-tag v-if="item.isQuality"
+ text="璐ㄦ"
+ type="primary"
+ size="mini"
+ plain />
+ <up-tag v-if="item.isProduction"
+ text="鐢熶骇"
+ type="success"
+ size="mini"
+ plain />
+ </view>
+ </view>
+ <view class="card-footer"
+ @click="showParams(item)">
+ <text class="action-text">鏌ョ湅鍙傛暟鍒楄〃</text>
+ <up-icon name="arrow-right"
+ size="14"
+ color="#3c9cff"></up-icon>
+ </view>
+ </view>
+ </view>
+ <view v-else
+ class="no-data">
+ <up-empty mode="data"
+ text="鏆傛棤璺嚎椤圭洰"></up-empty>
+ </view>
+ </scroll-view>
+ <!-- BOM 缁撴瀯灞曠ず -->
+ <scroll-view scroll-y
+ class="content-scroll"
+ v-if="currentTab === 1">
+ <view v-if="bomList.length > 0"
+ class="bom-tree">
+ <view v-for="(node, nIndex) in flatBomList"
+ :key="nIndex"
+ class="bom-node"
+ :style="{ paddingLeft: (node.level * 40) + 'rpx' }">
+ <view class="bom-node-inner">
+ <view class="bom-line"
+ v-if="node.level > 0"></view>
+ <view class="bom-content">
+ <view class="bom-header">
+ <text class="bom-product">{{ node.productName }}</text>
+ <text class="bom-model"
+ v-if="node.model">({{ node.model }})</text>
+ </view>
+ <view class="bom-details">
+ <text class="bom-info">宸ュ簭: {{ node.operationName || '-' }}</text>
+ <text class="bom-info">鎵�闇�: {{ node.unitQuantity || 0 }} {{ node.unit || '' }}</text>
+ </view>
+ </view>
+ </view>
+ </view>
+ </view>
+ <view v-else
+ class="no-data">
+ <up-empty mode="data"
+ text="鏆傛棤 BOM 缁撴瀯"></up-empty>
+ </view>
+ </scroll-view>
+ <!-- 鍙傛暟鍒楄〃寮圭獥 -->
+ <up-popup :show="showPopup"
+ mode="bottom"
+ @close="showPopup = false"
+ round="10">
+ <view class="popup-content">
+ <view class="popup-header">
+ <text class="title">鍙傛暟鍒楄〃 - {{ currentItem.technologyOperationName || currentItem.operationName }}</text>
+ <up-icon name="close"
+ size="20"
+ @click="showPopup = false"></up-icon>
+ </view>
+ <scroll-view scroll-y
+ class="param-list">
+ <view v-if="paramList.length > 0">
+ <view v-for="(param, pIndex) in paramList"
+ :key="pIndex"
+ class="param-item">
+ <view class="param-row">
+ <text class="param-label">鍙傛暟鍚嶇О锛�</text>
+ <text class="param-value">{{ param.paramName || '-' }}</text>
+ </view>
+ <view class="param-row">
+ <text class="param-label">鏍囧噯鍊硷細</text>
+ <text class="param-value">{{ param.standardValue || '-' }}</text>
+ </view>
+ <view class="param-row">
+ <text class="param-label">鍗曚綅锛�</text>
+ <text class="param-value">{{ param.unit || '-' }}</text>
+ </view>
+ </view>
+ </view>
+ <view v-else
+ class="no-record">
+ <text>鏆傛棤鍙傛暟璁板綍</text>
+ </view>
+ </scroll-view>
+ </view>
+ </up-popup>
+ </view>
+</template>
+
+<script setup>
+ import { ref, reactive, computed } from "vue";
+ import { onLoad } from "@dcloudio/uni-app";
+ import {
+ findProcessRouteItemList,
+ getProcessParamList,
+ queryBomList,
+ } from "@/api/productionManagement/processRoute.js";
+ import {
+ queryOrderBomList,
+ findProcessParamListOrder,
+ } from "@/api/productionManagement/productionOrder.js";
+ import PageHeader from "@/components/PageHeader.vue";
+
+ const routeInfo = ref({});
+ const itemsList = ref([]);
+ const bomList = ref([]);
+ const loading = ref(false);
+ const pageType = ref("route"); // route | order
+
+ // 閫夐」鍗�
+ const tabsList = reactive([{ name: "璺嚎椤圭洰" }, { name: "BOM缁撴瀯" }]);
+ const currentTab = ref(0);
+
+ // 寮圭獥鐩稿叧
+ const showPopup = ref(false);
+ const currentItem = ref({});
+ const paramList = ref([]);
+ const paramLoading = ref(false);
+
+ const goBack = () => {
+ uni.navigateBack();
+ };
+
+ const handleTabClick = item => {
+ currentTab.value = item.index;
+ if (item.index === 1 && bomList.value.length === 0) {
+ fetchBom();
+ }
+ };
+
+ // 鎵佸钩鍖� BOM 鏍戠敤浜庡睍绀�
+ const flatBomList = computed(() => {
+ const result = [];
+ const flatten = (nodes, level = 0) => {
+ nodes.forEach(node => {
+ result.push({ ...node, level });
+ if (node.children && node.children.length > 0) {
+ flatten(node.children, level + 1);
+ }
+ });
+ };
+ flatten(bomList.value);
+ return result;
+ });
+
+ onLoad(options => {
+ if (options.id) {
+ pageType.value = options.type || "route";
+ routeInfo.value = {
+ id: options.id,
+ processRouteCode: options.processRouteCode || "",
+ productName: decodeURIComponent(options.productName || ""),
+ model: decodeURIComponent(options.model || ""),
+ bomNo: options.bomNo || "",
+ bomId: options.bomId || "",
+ description: decodeURIComponent(options.description || ""),
+ orderId: options.orderId || "",
+ };
+ fetchItems(options.id);
+ }
+ });
+
+ const fetchItems = id => {
+ loading.value = true;
+ findProcessRouteItemList({ routeId: id, orderId: routeInfo.value.orderId })
+ .then(res => {
+ itemsList.value = res.data || [];
+ loading.value = false;
+ })
+ .catch(() => {
+ loading.value = false;
+ uni.showToast({
+ title: "鑾峰彇椤圭洰澶辫触",
+ icon: "error",
+ });
+ });
+ };
+
+ const fetchBom = () => {
+ console.log(routeInfo.value.bomId, "routeInfo.value.bomId");
+
+ if (!routeInfo.value.bomId) return;
+ loading.value = true;
+ const api = pageType.value === "order" ? queryOrderBomList : queryBomList;
+ api(routeInfo.value.bomId)
+ .then(res => {
+ bomList.value = res.data || [];
+ loading.value = false;
+ })
+ .catch(() => {
+ loading.value = false;
+ uni.showToast({
+ title: "鑾峰彇 BOM 澶辫触",
+ icon: "error",
+ });
+ });
+ };
+
+ const showParams = item => {
+ currentItem.value = item;
+ showPopup.value = true;
+ paramLoading.value = true;
+ paramList.value = [];
+
+ const api =
+ pageType.value === "order"
+ ? findProcessParamListOrder
+ : getProcessParamList;
+ const params =
+ pageType.value === "order"
+ ? {
+ productionOrderRoutingOperationId: item.id,
+ productionOrderId: routeInfo.value.orderId,
+ }
+ : { technologyRoutingOperationId: item.id };
+
+ api(params)
+ .then(res => {
+ paramList.value = res.data || [];
+ paramLoading.value = false;
+ })
+ .catch(() => {
+ paramLoading.value = false;
+ uni.showToast({
+ title: "鑾峰彇鍙傛暟澶辫触",
+ icon: "error",
+ });
+ });
+ };
+</script>
+
+<style scoped lang="scss">
+ .process-route-items {
+ min-height: 100vh;
+ background: #f8f9fa;
+ display: flex;
+ flex-direction: column;
+ }
+
+ .route-info-card {
+ background: #fff;
+ margin: 20rpx;
+ padding: 24rpx;
+ border-radius: 16rpx;
+ box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.05);
+
+ .info-row {
+ display: flex;
+ justify-content: space-between;
+ margin-bottom: 12rpx;
+ &:last-child {
+ margin-bottom: 0;
+ }
+
+ .label {
+ font-size: 26rpx;
+ color: #999;
+ }
+ .value {
+ font-size: 26rpx;
+ color: #333;
+ font-weight: bold;
+ }
+ }
+ }
+
+ .tabs-box {
+ background: #fff;
+ margin-bottom: 10rpx;
+ }
+
+ .content-scroll {
+ flex: 1;
+ height: 0;
+ padding: 0 20rpx;
+ }
+
+ .process-card {
+ background: #fff;
+ margin-bottom: 24rpx;
+ border-radius: 16rpx;
+ overflow: hidden;
+ box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.05);
+
+ .card-header {
+ display: flex;
+ align-items: center;
+ padding: 20rpx 24rpx;
+ background: #fcfcfc;
+ border-bottom: 1rpx solid #f5f5f5;
+
+ .index-badge {
+ width: 40rpx;
+ height: 40rpx;
+ background: #3c9cff;
+ color: #fff;
+ border-radius: 20rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ font-size: 24rpx;
+ margin-right: 20rpx;
+ }
+
+ .process-name {
+ font-size: 28rpx;
+ font-weight: bold;
+ color: #333;
+ }
+ }
+
+ .card-content {
+ padding: 24rpx;
+
+ .detail-row {
+ display: flex;
+ justify-content: space-between;
+ margin-bottom: 12rpx;
+
+ .detail-label {
+ font-size: 24rpx;
+ color: #999;
+ }
+ .detail-value {
+ font-size: 24rpx;
+ color: #666;
+ }
+ }
+
+ .tag-row {
+ display: flex;
+ gap: 16rpx;
+ margin-top: 10rpx;
+ }
+ }
+
+ .card-footer {
+ padding: 16rpx 24rpx;
+ border-top: 1rpx dashed #eee;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+
+ .action-text {
+ font-size: 24rpx;
+ color: #3c9cff;
+ }
+ }
+ }
+
+ /* BOM 鏍戞牱寮� */
+ .bom-tree {
+ padding: 20rpx 0;
+ }
+
+ .bom-node {
+ position: relative;
+ margin-bottom: 20rpx;
+ }
+
+ .bom-node-inner {
+ background: #fff;
+ padding: 20rpx;
+ border-radius: 12rpx;
+ box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.03);
+ display: flex;
+ align-items: center;
+ }
+
+ .bom-line {
+ position: absolute;
+ left: -20rpx;
+ top: 50%;
+ width: 20rpx;
+ height: 2rpx;
+ background: #ddd;
+ }
+
+ .bom-content {
+ flex: 1;
+ }
+
+ .bom-header {
+ display: flex;
+ align-items: center;
+ margin-bottom: 8rpx;
+
+ .bom-product {
+ font-size: 28rpx;
+ font-weight: bold;
+ color: #333;
+ }
+
+ .bom-model {
+ font-size: 24rpx;
+ color: #999;
+ margin-left: 10rpx;
+ }
+ }
+
+ .bom-details {
+ display: flex;
+ justify-content: space-between;
+
+ .bom-info {
+ font-size: 24rpx;
+ color: #666;
+ }
+ }
+
+ .no-data {
+ padding-top: 100rpx;
+ }
+
+ /* 寮圭獥鏍峰紡 */
+ .popup-content {
+ background: #fff;
+ padding: 30rpx;
+ max-height: 70vh;
+ display: flex;
+ flex-direction: column;
+ }
+
+ .popup-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding-bottom: 30rpx;
+ border-bottom: 1rpx solid #eee;
+
+ .title {
+ font-size: 30rpx;
+ font-weight: bold;
+ color: #333;
+ }
+ }
+
+ .param-list {
+ flex: 1;
+ height: 0;
+ padding-top: 20rpx;
+ }
+
+ .param-item {
+ padding: 20rpx;
+ background: #f9f9f9;
+ border-radius: 12rpx;
+ margin-bottom: 16rpx;
+
+ .param-row {
+ display: flex;
+ margin-bottom: 8rpx;
+ &:last-child {
+ margin-bottom: 0;
+ }
+
+ .param-label {
+ font-size: 24rpx;
+ color: #999;
+ width: 140rpx;
+ }
+ .param-value {
+ font-size: 24rpx;
+ color: #333;
+ flex: 1;
+ }
+ }
+ }
+
+ .no-record {
+ padding: 100rpx 0;
+ text-align: center;
+ color: #999;
+ font-size: 26rpx;
+ }
+</style>
diff --git a/src/pages/productionManagement/productionOrder/index.vue b/src/pages/productionManagement/productionOrder/index.vue
index 7f7ae4f..3a55461 100644
--- a/src/pages/productionManagement/productionOrder/index.vue
+++ b/src/pages/productionManagement/productionOrder/index.vue
@@ -1,344 +1,400 @@
<template>
- <view class="production-order">
- <!-- 浣跨敤閫氱敤椤甸潰澶撮儴缁勪欢 -->
- <PageHeader title="鐢熶骇璁㈠崟" @back="goBack" />
-
- <!-- 鎼滅储鍖哄煙 -->
- <view class="search-section">
- <view class="search-bar">
- <view class="search-input">
- <up-input
- class="search-text"
- placeholder="璇疯緭鍏ヨ鍗曞彿鎴栦骇鍝佸悕绉�"
- v-model="searchForm.keyword"
- @change="handleQuery"
- clearable
- />
- </view>
- <view class="filter-button" @click="handleQuery">
- <up-icon name="search" size="24" color="#999"></up-icon>
- </view>
- </view>
- </view>
-
- <!-- 鍒楄〃鍖哄煙 -->
- <scroll-view scroll-y class="list-container" v-if="tableData.length > 0" @scrolltolower="loadMore">
- <view v-for="(item, index) in tableData" :key="item.id || index">
- <view class="ledger-item">
- <view class="item-header">
- <view class="item-left">
- <view class="document-icon">
- <up-icon name="file-text" size="16" color="#ffffff"></up-icon>
- </view>
- <text class="item-id">{{ item.npsNo }}</text>
- </view>
- <view class="item-right">
- <up-tag :text="getStatusText(item.status)" :type="getStatusType(item.status)" size="mini" />
- </view>
- </view>
- <up-divider></up-divider>
-
- <view class="item-details">
- <view class="detail-row">
- <text class="detail-label">浜у搧鍚嶇О</text>
- <text class="detail-value font-bold">{{ item.productName || '-' }}</text>
- </view>
- <view class="detail-row">
- <text class="detail-label">瑙勬牸鍨嬪彿</text>
- <text class="detail-value">{{ item.model || '-' }}</text>
- </view>
- <view class="detail-row">
- <text class="detail-label">璁㈠崟鏁伴噺</text>
- <text class="detail-value">{{ item.quantity || 0 }}</text>
- </view>
- <view class="detail-row">
- <text class="detail-label">瀹屾垚杩涘害</text>
- <view class="progress-box">
- <up-line-progress :percentage="toProgressPercentage(item.completionStatus)"
- :activeColor="progressColor(item.completionStatus)"
- height="10"></up-line-progress>
- <text class="progress-text">{{ item.completeQuantity || 0 }} / {{ item.quantity || 0 }}</text>
- </view>
- </view>
- <view class="detail-row">
- <text class="detail-label">璁″垝瀹屾垚</text>
- <text class="detail-value">{{ formatDate(item.planCompleteTime) }}</text>
- </view>
- </view>
-
- <view class="item-footer">
- <view class="action-btns">
- <up-button type="primary" size="mini" plain text="鏉ユ簮" @click="goSource(item)"></up-button>
- <up-button type="success" size="mini" plain text="棰嗘枡璇︽儏" @click="goPickingDetail(item)"></up-button>
- </view>
- </view>
- </view>
- </view>
- <up-loadmore :status="loadStatus" v-if="tableData.length >= page.size" />
- </scroll-view>
-
- <view v-else class="no-data">
- <up-empty mode="data" text="鏆傛棤鐢熶骇璁㈠崟鏁版嵁"></up-empty>
- </view>
- </view>
+ <view class="production-order">
+ <!-- 浣跨敤閫氱敤椤甸潰澶撮儴缁勪欢 -->
+ <PageHeader title="鐢熶骇璁㈠崟"
+ @back="goBack" />
+ <!-- 鎼滅储鍖哄煙 -->
+ <view class="search-section">
+ <view class="search-bar">
+ <view class="search-input">
+ <up-input class="search-text"
+ placeholder="璇疯緭鍏ヨ鍗曞彿鎴栦骇鍝佸悕绉�"
+ v-model="searchForm.keyword"
+ @change="handleQuery"
+ clearable />
+ </view>
+ <view class="filter-button"
+ @click="handleQuery">
+ <up-icon name="search"
+ size="24"
+ color="#999"></up-icon>
+ </view>
+ </view>
+ </view>
+ <!-- 鍒楄〃鍖哄煙 -->
+ <scroll-view scroll-y
+ class="list-container"
+ v-if="tableData.length > 0"
+ @scrolltolower="loadMore">
+ <view v-for="(item, index) in tableData"
+ :key="item.id || index">
+ <view class="ledger-item">
+ <view class="item-header">
+ <view class="item-left">
+ <view class="document-icon">
+ <up-icon name="file-text"
+ size="16"
+ color="#ffffff"></up-icon>
+ </view>
+ <text class="item-id">{{ item.npsNo }}</text>
+ </view>
+ <view class="item-right">
+ <up-tag :text="getStatusText(item.status)"
+ :type="getStatusType(item.status)"
+ size="mini" />
+ </view>
+ </view>
+ <up-divider></up-divider>
+ <view class="item-details">
+ <view class="detail-row">
+ <text class="detail-label">浜у搧鍚嶇О</text>
+ <text class="detail-value font-bold">{{ item.productName || '-' }}</text>
+ </view>
+ <view class="detail-row">
+ <text class="detail-label">瑙勬牸鍨嬪彿</text>
+ <text class="detail-value">{{ item.model || '-' }}</text>
+ </view>
+ <view class="detail-row">
+ <text class="detail-label">璁㈠崟鏁伴噺</text>
+ <text class="detail-value">{{ item.quantity || 0 }}</text>
+ </view>
+ <view class="detail-row">
+ <text class="detail-label">瀹屾垚杩涘害</text>
+ <view class="progress-box">
+ <up-line-progress :percentage="toProgressPercentage(item.completionStatus)"
+ :activeColor="progressColor(item.completionStatus)"
+ height="10"></up-line-progress>
+ <text class="progress-text">{{ item.completeQuantity || 0 }} / {{ item.quantity || 0 }}</text>
+ </view>
+ </view>
+ <view class="detail-row">
+ <text class="detail-label">璁″垝瀹屾垚</text>
+ <text class="detail-value">{{ formatDate(item.planCompleteTime) }}</text>
+ </view>
+ </view>
+ <view class="item-footer">
+ <view class="action-btns">
+ <up-button type="info"
+ size="mini"
+ plain
+ text="宸ヨ壓璺嚎"
+ @click="goProcessRoute(item)"></up-button>
+ <up-button type="primary"
+ size="mini"
+ plain
+ text="鏉ユ簮"
+ @click="goSource(item)"></up-button>
+ <up-button type="success"
+ size="mini"
+ plain
+ text="棰嗘枡璇︽儏"
+ @click="goPickingDetail(item)"></up-button>
+ </view>
+ </view>
+ </view>
+ </view>
+ <up-loadmore :status="loadStatus"
+ v-if="tableData.length >= page.size" />
+ </scroll-view>
+ <view v-else
+ class="no-data">
+ <up-empty mode="data"
+ text="鏆傛棤鐢熶骇璁㈠崟鏁版嵁"></up-empty>
+ </view>
+ </view>
</template>
<script setup>
-import { ref, reactive, toRefs, getCurrentInstance } from "vue";
-import { onShow } from '@dcloudio/uni-app';
-import dayjs from "dayjs";
-import { productOrderListPage } from "@/api/productionManagement/productionOrder.js";
-import PageHeader from "@/components/PageHeader.vue";
+ import { ref, reactive, toRefs, getCurrentInstance } from "vue";
+ import { onShow } from "@dcloudio/uni-app";
+ import dayjs from "dayjs";
+ import {
+ productOrderListPage,
+ getOrderProcessRouteMain,
+ } from "@/api/productionManagement/productionOrder.js";
+ import PageHeader from "@/components/PageHeader.vue";
-const { proxy } = getCurrentInstance();
+ const { proxy } = getCurrentInstance();
-// 鍔犺浇鐘舵��
-const loading = ref(false);
-const loadStatus = ref('loadmore');
-// 鍒楄〃鏁版嵁
-const tableData = ref([]);
+ // 鍔犺浇鐘舵��
+ const loading = ref(false);
+ const loadStatus = ref("loadmore");
+ // 鍒楄〃鏁版嵁
+ const tableData = ref([]);
-// 鍒嗛〉閰嶇疆
-const page = reactive({
- current: 1,
- size: 10,
- total: 0,
-});
+ // 鍒嗛〉閰嶇疆
+ const page = reactive({
+ current: 1,
+ size: 10,
+ total: 0,
+ });
-// 鎼滅储琛ㄥ崟鏁版嵁
-const data = reactive({
- searchForm: {
- keyword: "",
- },
-});
-const { searchForm } = toRefs(data);
+ // 鎼滅储琛ㄥ崟鏁版嵁
+ const data = reactive({
+ searchForm: {
+ keyword: "",
+ },
+ });
+ const { searchForm } = toRefs(data);
-// 杩斿洖涓婁竴椤�
-const goBack = () => {
- uni.navigateBack();
-};
+ // 杩斿洖涓婁竴椤�
+ const goBack = () => {
+ uni.navigateBack();
+ };
-// 鏍煎紡鍖栨棩鏈�
-const formatDate = (date) => {
- return date ? dayjs(date).format('YYYY-MM-DD') : '-';
-};
+ // 鏍煎紡鍖栨棩鏈�
+ const formatDate = date => {
+ return date ? dayjs(date).format("YYYY-MM-DD") : "-";
+ };
-// 鑾峰彇鐘舵�佹枃鏈�
-const getStatusText = (status) => {
- const statusMap = {
- 1: "寰呭紑濮�",
- 2: "杩涜涓�",
- 3: "宸插畬鎴�",
- 4: "宸插彇娑�",
- };
- return statusMap[status] || "鏈煡";
-};
+ // 鑾峰彇鐘舵�佹枃鏈�
+ const getStatusText = status => {
+ const statusMap = {
+ 1: "寰呭紑濮�",
+ 2: "杩涜涓�",
+ 3: "宸插畬鎴�",
+ 4: "宸插彇娑�",
+ };
+ return statusMap[status] || "鏈煡";
+ };
-// 鑾峰彇鐘舵�佺被鍨�
-const getStatusType = (status) => {
- const typeMap = {
- 1: "primary",
- 2: "warning",
- 3: "success",
- 4: "danger",
- };
- return typeMap[status] || "info";
-};
+ // 鑾峰彇鐘舵�佺被鍨�
+ const getStatusType = status => {
+ const typeMap = {
+ 1: "primary",
+ 2: "warning",
+ 3: "success",
+ 4: "danger",
+ };
+ return typeMap[status] || "info";
+ };
-// 瀹屾垚杩涘害鐧惧垎姣�
-const toProgressPercentage = (val) => {
- const n = Number(val);
- if (!Number.isFinite(n)) return 0;
- if (n <= 0) return 0;
- if (n >= 100) return 100;
- return Math.round(n);
-};
+ // 瀹屾垚杩涘害鐧惧垎姣�
+ const toProgressPercentage = val => {
+ const n = Number(val);
+ if (!Number.isFinite(n)) return 0;
+ if (n <= 0) return 0;
+ if (n >= 100) return 100;
+ return Math.round(n);
+ };
-// 杩涘害鏉¢鑹�
-const progressColor = (percentage) => {
- const p = toProgressPercentage(percentage);
- if (p < 30) return "#f56c6c";
- if (p < 50) return "#e6a23c";
- if (p < 80) return "#409eff";
- return "#67c23a";
-};
+ // 杩涘害鏉¢鑹�
+ const progressColor = percentage => {
+ const p = toProgressPercentage(percentage);
+ if (p < 30) return "#f56c6c";
+ if (p < 50) return "#e6a23c";
+ if (p < 80) return "#409eff";
+ return "#67c23a";
+ };
-// 鏌ヨ鍒楄〃
-const handleQuery = () => {
- page.current = 1;
- tableData.value = [];
- getList();
-};
+ // 鏌ヨ鍒楄〃
+ const handleQuery = () => {
+ page.current = 1;
+ tableData.value = [];
+ getList();
+ };
-// 鍔犺浇鏇村
-const loadMore = () => {
- if (loadStatus.value === 'nomore' || loading.value) return;
- page.current++;
- getList();
-};
+ // 鍔犺浇鏇村
+ const loadMore = () => {
+ if (loadStatus.value === "nomore" || loading.value) return;
+ page.current++;
+ getList();
+ };
-// 鑾峰彇鍒楄〃鏁版嵁
-const getList = () => {
- loading.value = true;
- loadStatus.value = 'loading';
-
- const params = {
- current: page.current,
- size: page.size,
- npsNo: searchForm.value.keyword,
- productName: searchForm.value.keyword
- };
-
- productOrderListPage(params).then((res) => {
- loading.value = false;
- const records = res.data.records || [];
- if (page.current === 1) {
- tableData.value = records;
- } else {
- tableData.value = [...tableData.value, ...records];
- }
-
- if (records.length < page.size) {
- loadStatus.value = 'nomore';
- } else {
- loadStatus.value = 'loadmore';
- }
- page.total = res.data.total || 0;
- }).catch(() => {
- loading.value = false;
- loadStatus.value = 'loadmore';
- uni.showToast({
- title: '鍔犺浇澶辫触',
- icon: 'error'
- });
- });
-};
+ // 鑾峰彇鍒楄〃鏁版嵁
+ const getList = () => {
+ loading.value = true;
+ loadStatus.value = "loading";
-// 璺宠浆鏉ユ簮
-const goSource = (item) => {
- uni.navigateTo({
- url: `/pages/productionManagement/productionOrder/source?id=${item.id}&productName=${encodeURIComponent(item.productName)}&model=${encodeURIComponent(item.model)}&quantity=${item.quantity}`
- });
-};
+ const params = {
+ current: page.current,
+ size: page.size,
+ npsNo: searchForm.value.keyword,
+ productName: searchForm.value.keyword,
+ };
-// 璺宠浆棰嗘枡璇︽儏
-const goPickingDetail = (item) => {
- uni.navigateTo({
- url: `/pages/productionManagement/productionOrder/pickingDetail?id=${item.id}&npsNo=${item.npsNo}`
- });
-};
+ productOrderListPage(params)
+ .then(res => {
+ loading.value = false;
+ const records = res.data.records || [];
+ if (page.current === 1) {
+ tableData.value = records;
+ } else {
+ tableData.value = [...tableData.value, ...records];
+ }
-// 椤甸潰鏄剧ず鏃跺姞杞芥暟鎹�
-onShow(() => {
- handleQuery();
-});
+ if (records.length < page.size) {
+ loadStatus.value = "nomore";
+ } else {
+ loadStatus.value = "loadmore";
+ }
+ page.total = res.data.total || 0;
+ })
+ .catch(() => {
+ loading.value = false;
+ loadStatus.value = "loadmore";
+ uni.showToast({
+ title: "鍔犺浇澶辫触",
+ icon: "error",
+ });
+ });
+ };
+
+ // 璺宠浆宸ヨ壓璺嚎 (BOM)
+ const goProcessRoute = item => {
+ getOrderProcessRouteMain(item.id)
+ .then(res => {
+ const data = res.data || {};
+ if (!data.id) {
+ uni.showToast({ title: "鏈壘鍒板伐鑹鸿矾绾�", icon: "none" });
+ return;
+ }
+ uni.navigateTo({
+ url: `/pages/productionManagement/processRoute/items?id=${
+ data.id
+ }&bomId=${data.orderBomId}&processRouteCode=${
+ data.processRouteCode || ""
+ }&productName=${encodeURIComponent(
+ item.productName || ""
+ )}&model=${encodeURIComponent(item.model || "")}&orderId=${
+ item.id
+ }&type=order`,
+ });
+ })
+ .catch(() => {
+ uni.showToast({ title: "鑾峰彇璺嚎澶辫触", icon: "none" });
+ });
+ };
+
+ // 璺宠浆鏉ユ簮
+ const goSource = item => {
+ uni.navigateTo({
+ url: `/pages/productionManagement/productionOrder/source?id=${
+ item.id
+ }&productName=${encodeURIComponent(
+ item.productName
+ )}&model=${encodeURIComponent(item.model)}&quantity=${item.quantity}`,
+ });
+ };
+
+ // 璺宠浆棰嗘枡璇︽儏
+ const goPickingDetail = item => {
+ uni.navigateTo({
+ url: `/pages/productionManagement/productionOrder/pickingDetail?id=${item.id}&npsNo=${item.npsNo}`,
+ });
+ };
+
+ // 椤甸潰鏄剧ず鏃跺姞杞芥暟鎹�
+ onShow(() => {
+ handleQuery();
+ });
</script>
<style scoped lang="scss">
-@import '@/styles/sales-common.scss';
+ @import "@/styles/sales-common.scss";
-.production-order {
- min-height: 100vh;
- background: #f8f9fa;
- display: flex;
- flex-direction: column;
-}
+ .production-order {
+ min-height: 100vh;
+ background: #f8f9fa;
+ display: flex;
+ flex-direction: column;
+ }
-.list-container {
- flex: 1;
- height: 0;
-}
+ .list-container {
+ flex: 1;
+ height: 0;
+ }
-.ledger-item {
- background: #fff;
- margin: 20rpx;
- padding: 24rpx;
- border-radius: 16rpx;
- box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.06);
-
- .item-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding-bottom: 12rpx;
-
- .item-left {
- display: flex;
- align-items: center;
-
- .document-icon {
- width: 44rpx;
- height: 44rpx;
- background: #3c9cff;
- border-radius: 10rpx;
- display: flex;
- justify-content: center;
- align-items: center;
- margin-right: 20rpx;
- }
-
- .item-id {
- font-size: 30rpx;
- font-weight: bold;
- color: #333;
- }
- }
- }
-
- .item-details {
- padding: 16rpx 0;
-
- .detail-row {
- display: flex;
- justify-content: space-between;
- align-items: flex-start;
- margin-bottom: 16rpx;
-
- .detail-label {
- font-size: 26rpx;
- color: #999;
- min-width: 140rpx;
- }
-
- .detail-value {
- font-size: 26rpx;
- color: #333;
- text-align: right;
-
- &.font-bold {
- font-weight: bold;
- }
- }
-
- .progress-box {
- flex: 1;
- margin-left: 40rpx;
-
- .progress-text {
- font-size: 22rpx;
- color: #999;
- margin-top: 4rpx;
- display: block;
- text-align: right;
- }
- }
- }
- }
-
- .item-footer {
- padding-top: 20rpx;
- border-top: 1rpx solid #f0f0f0;
- display: flex;
- justify-content: flex-end;
-
- .action-btns {
- display: flex;
- gap: 20rpx;
- }
- }
-}
+ .ledger-item {
+ background: #fff;
+ margin: 20rpx;
+ padding: 24rpx;
+ border-radius: 16rpx;
+ box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.06);
-.no-data {
- padding-top: 200rpx;
-}
+ .item-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding-bottom: 12rpx;
+
+ .item-left {
+ display: flex;
+ align-items: center;
+
+ .document-icon {
+ width: 44rpx;
+ height: 44rpx;
+ background: #3c9cff;
+ border-radius: 10rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ margin-right: 20rpx;
+ }
+
+ .item-id {
+ font-size: 30rpx;
+ font-weight: bold;
+ color: #333;
+ }
+ }
+ }
+
+ .item-details {
+ padding: 16rpx 0;
+
+ .detail-row {
+ display: flex;
+ justify-content: space-between;
+ align-items: flex-start;
+ margin-bottom: 16rpx;
+
+ .detail-label {
+ font-size: 26rpx;
+ color: #999;
+ min-width: 140rpx;
+ }
+
+ .detail-value {
+ font-size: 26rpx;
+ color: #333;
+ text-align: right;
+
+ &.font-bold {
+ font-weight: bold;
+ }
+ }
+
+ .progress-box {
+ flex: 1;
+ margin-left: 40rpx;
+
+ .progress-text {
+ font-size: 22rpx;
+ color: #999;
+ margin-top: 4rpx;
+ display: block;
+ text-align: right;
+ }
+ }
+ }
+ }
+
+ .item-footer {
+ padding-top: 20rpx;
+ border-top: 1rpx solid #f0f0f0;
+ display: flex;
+ justify-content: flex-end;
+
+ .action-btns {
+ display: flex;
+ gap: 20rpx;
+ }
+ }
+ }
+
+ .no-data {
+ padding-top: 200rpx;
+ }
</style>
diff --git a/src/pages/works.vue b/src/pages/works.vue
index 2759b3e..202d9ca 100644
--- a/src/pages/works.vue
+++ b/src/pages/works.vue
@@ -837,9 +837,9 @@
url: "/pages/productionManagement/productionDispatching/index",
});
break;
- case "宸ュ簭鎺掍骇":
+ case "宸ヨ壓璺嚎":
uni.navigateTo({
- url: "/pages/productionManagement/processScheduling/index",
+ url: "/pages/productionManagement/processRoute/index",
});
break;
case "鐢熶骇宸ュ崟":
--
Gitblit v1.9.3