From b904c6cf33ea022dfc84544501d965f4c30f4887 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期三, 20 五月 2026 16:49:18 +0800
Subject: [PATCH] 天津宝东app 1.部署修改
---
src/pages/productionManagement/processRoute/index.vue | 287 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 287 insertions(+), 0 deletions(-)
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>
--
Gitblit v1.9.3