From 87fce896046ec8e804810f75a90a62a5986e67ed Mon Sep 17 00:00:00 2001
From: ZN <zhang_12370@163.com>
Date: 星期二, 31 三月 2026 15:18:26 +0800
Subject: [PATCH] fix: 修正端口号、消息页签索引及生产报告表单字段

---
 src/pages/productionManagement/workOrder/index.vue |  268 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 268 insertions(+), 0 deletions(-)

diff --git a/src/pages/productionManagement/workOrder/index.vue b/src/pages/productionManagement/workOrder/index.vue
new file mode 100644
index 0000000..5360a11
--- /dev/null
+++ b/src/pages/productionManagement/workOrder/index.vue
@@ -0,0 +1,268 @@
+<template>
+  <view class="work-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.workOrderNo"
+            @confirm="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="ledger-list" v-if="tableData.length > 0" @scrolltolower="loadMore">
+      <view v-for="(item, index) in tableData" :key="item.id || index" 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.workOrderNo }}</text>
+          </view>
+          <view class="item-right">
+            <text class="item-tag tag-type">{{ item.workOrderType }}</text>
+          </view>
+        </view>
+        
+        <up-divider></up-divider>
+        
+        <view class="item-details">
+          <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.processName }}</text>
+          </view>
+          <view class="detail-row">
+            <text class="detail-label">闇�姹�/瀹屾垚鏁伴噺</text>
+            <text class="detail-value">{{ item.planQuantity }} / {{ item.completeQuantity }} {{ item.unit }}</text>
+          </view>
+          
+          <view class="progress-section">
+            <text class="detail-label">瀹屾垚杩涘害</text>
+            <view class="progress-bar">
+              <up-line-progress 
+                :percentage="toProgressPercentage(item.completionStatus)" 
+                activeColor="#2979ff"
+                :showText="true"
+              ></up-line-progress>
+            </view>
+          </view>
+          
+          <view class="detail-row">
+            <text class="detail-label">璁″垝寮�濮�</text>
+            <text class="detail-value">{{ item.planStartTime }}</text>
+          </view>
+          <view class="detail-row">
+            <text class="detail-label">璁″垝缁撴潫</text>
+            <text class="detail-value">{{ item.planEndTime }}</text>
+          </view>
+        </view>
+      </view>
+      <up-loadmore :status="loadStatus" />
+    </scroll-view>
+    
+    <view v-else-if="!loading" class="no-data">
+      <up-empty mode="data" text="鏆傛棤宸ュ崟鏁版嵁"></up-empty>
+    </view>
+
+    <!-- 娴佽浆鍗″脊绐� -->
+    <up-popup :show="transferCardVisible" mode="center" @close="transferCardVisible = false" round="10">
+      <view class="qr-popup">
+        <text class="qr-title">宸ュ崟娴佽浆鍗′簩缁寸爜</text>
+        <view class="qr-box">
+          <geek-qrcode
+            v-if="transferCardRowData"
+            :val="String(transferCardRowData.id)"
+            :size="200"
+          />
+        </view>
+        <text class="qr-info" v-if="transferCardRowData">{{ transferCardRowData.workOrderNo }}</text>
+        <up-button text="鍏抽棴" @click="transferCardVisible = false" style="margin-top: 20px;"></up-button>
+      </view>
+    </up-popup>
+
+    <!-- 闄勪欢缁勪欢 -->
+    <FilesDia ref="workOrderFilesRef" />
+  </view>
+</template>
+
+<script setup>
+import { ref, reactive, toRefs, getCurrentInstance } from "vue";
+import { onShow } from '@dcloudio/uni-app';
+import { productWorkOrderPage } from "@/api/productionManagement/workOrder.js";
+import PageHeader from "@/components/PageHeader.vue";
+import FilesDia from "./components/filesDia.vue";
+
+const { proxy } = getCurrentInstance();
+
+const loading = ref(false);
+const tableData = ref([]);
+const loadStatus = ref('loadmore');
+const transferCardVisible = ref(false);
+const transferCardRowData = ref(null);
+const workOrderFilesRef = ref(null);
+
+const page = reactive({
+  current: 1,
+  size: 10,
+  total: 0,
+});
+
+const data = reactive({
+  searchForm: {
+    workOrderNo: "",
+  },
+});
+const { searchForm } = toRefs(data);
+
+const goBack = () => {
+  uni.navigateBack();
+};
+
+const handleQuery = () => {
+  page.current = 1;
+  tableData.value = [];
+  getList();
+};
+
+const getList = () => {
+  if (loading.value) return;
+  loading.value = true;
+  
+  const params = { ...searchForm.value, ...page };
+  
+  productWorkOrderPage(params).then((res) => {
+    loading.value = false;
+    const records = res.data.records || [];
+    tableData.value = page.current === 1 ? records : [...tableData.value, ...records];
+    page.total = res.data.total;
+    
+    if (tableData.value.length >= page.total) {
+      loadStatus.value = 'nomore';
+    } else {
+      loadStatus.value = 'loadmore';
+    }
+  }).catch(() => {
+    loading.value = false;
+    uni.showToast({ title: '鍔犺浇澶辫触', icon: 'error' });
+  });
+};
+
+const loadMore = () => {
+  if (loadStatus.value === 'nomore' || loading.value) return;
+  page.current++;
+  getList();
+};
+
+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 showTransferCard = (row) => {
+  transferCardRowData.value = row;
+  transferCardVisible.value = true;
+};
+
+const openWorkOrderFiles = (row) => {
+  workOrderFilesRef.value?.openDialog(row);
+};
+
+onShow(() => {
+  handleQuery();
+});
+</script>
+
+<style scoped lang="scss">
+@import '@/styles/sales-common.scss';
+
+.work-order {
+  min-height: 100vh;
+  background: #f8f9fa;
+}
+
+.tag-type {
+  background-color: #e3f2fd;
+  color: #2196f3;
+  padding: 2px 8px;
+  border-radius: 4px;
+  font-size: 12px;
+}
+
+.progress-section {
+  margin: 15px 0;
+  .detail-label {
+    display: block;
+    margin-bottom: 8px;
+    font-size: 13px;
+    color: #666;
+  }
+}
+
+.item-actions {
+  display: flex;
+  justify-content: flex-end;
+  gap: 10px;
+  padding: 12px 0;
+  border-top: 1px solid #f5f5f5;
+  
+  :deep(.up-button) {
+    margin: 0;
+    width: auto;
+  }
+}
+
+.qr-popup {
+  padding: 30px;
+  background-color: #fff;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  
+  .qr-title {
+    font-size: 18px;
+    font-weight: bold;
+    margin-bottom: 20px;
+  }
+  
+  .qr-box {
+    padding: 20px;
+    background-color: #fff;
+    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
+    border-radius: 8px;
+    margin-bottom: 15px;
+  }
+  
+  .qr-info {
+    font-size: 14px;
+    color: #666;
+  }
+}
+
+.no-data {
+  padding-top: 100px;
+}
+</style>

--
Gitblit v1.9.3