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/productionDesign/basicParameters/index.vue |  245 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 245 insertions(+), 0 deletions(-)

diff --git a/src/pages/productionDesign/basicParameters/index.vue b/src/pages/productionDesign/basicParameters/index.vue
new file mode 100644
index 0000000..24a5db0
--- /dev/null
+++ b/src/pages/productionDesign/basicParameters/index.vue
@@ -0,0 +1,245 @@
+<template>
+  <view class="sales-account">
+    <PageHeader title="鍩虹鍙傛暟"
+                @back="goBack" />
+    <view class="search-section">
+      <view class="search-bar">
+        <view class="search-input">
+          <up-input class="search-text"
+                    v-model="paramName"
+                    placeholder="璇疯緭鍏ュ弬鏁板悕绉�"
+                    clearable
+                    @change="handleSearch" />
+        </view>
+        <view class="filter-button"
+              @click="handleSearch">
+          <up-icon name="search"
+                   size="24"
+                   color="#999999"></up-icon>
+        </view>
+      </view>
+    </view>
+    <view v-if="list.length > 0"
+          class="ledger-list">
+      <view v-for="item in list"
+            :key="item.id"
+            class="ledger-item">
+        <view class="item-header">
+          <view class="item-left">
+            <view class="document-icon">
+              <up-icon name="setting-fill"
+                       size="16"
+                       color="#ffffff"></up-icon>
+            </view>
+            <text class="item-id">{{ item.paramName || "-" }}</text>
+          </view>
+          <text class="item-index">{{ item.paramCode || "-" }}</text>
+        </view>
+        <up-divider></up-divider>
+        <view class="item-details">
+          <view class="detail-row">
+            <text class="detail-label">鍙傛暟绫诲瀷</text>
+            <up-tag :text="getParamTypeLabel(item.paramType)"
+                    :type="getParamTypeTag(item.paramType)"
+                    size="mini" />
+          </view>
+          <view class="detail-row">
+            <text class="detail-label">鍗曚綅</text>
+            <text class="detail-value">{{ item.unit || "-" }}</text>
+          </view>
+          <view class="detail-row">
+            <text class="detail-label">鏄惁蹇呭~</text>
+            <up-tag :text="item.isRequired === 1 ? '鏄�' : '鍚�'"
+                    :type="item.isRequired === 1 ? 'success' : 'info'"
+                    size="mini" />
+          </view>
+          <view class="detail-row">
+            <text class="detail-label">鍙栧�兼牸寮�</text>
+            <text class="detail-value">{{ item.paramFormat || "-" }}</text>
+          </view>
+          <view class="detail-row">
+            <text class="detail-label">澶囨敞</text>
+            <text class="detail-value">{{ item.remark || "-" }}</text>
+          </view>
+        </view>
+        <view class="action-buttons">
+          <up-button class="action-btn"
+                     size="small"
+                     type="primary"
+                     @click="goEdit(item)">缂栬緫</up-button>
+          <up-button class="action-btn"
+                     size="small"
+                     type="error"
+                     @click="handleDelete(item)">鍒犻櫎</up-button>
+        </view>
+      </view>
+      <up-loadmore :status="page.status" />
+    </view>
+    <view v-else
+          class="no-data">
+      <text>鏆傛棤鍩虹鍙傛暟鏁版嵁</text>
+    </view>
+    <view class="fab-button"
+          @click="goAdd">
+      <up-icon name="plus"
+               size="28"
+               color="#ffffff"></up-icon>
+    </view>
+  </view>
+</template>
+
+<script setup>
+  import { reactive, ref } from "vue";
+  import { onReachBottom, onShow } from "@dcloudio/uni-app";
+  import {
+    getBaseParamList,
+    removeBaseParam,
+  } from "@/api/basicData/parameterMaintenance";
+
+  const paramName = ref("");
+  const list = ref([]);
+
+  const page = reactive({
+    current: 1,
+    size: 100,
+    total: 0,
+    status: "loadmore", // loadmore, loading, nomore
+  });
+
+  const goBack = () => {
+    uni.navigateBack();
+  };
+
+  const getParamTypeLabel = type => {
+    const map = {
+      1: "鏁板�兼牸寮�",
+      2: "鏂囨湰鏍煎紡",
+      3: "涓嬫媺閫夐」",
+      4: "鏃堕棿鏍煎紡",
+    };
+    return map[type] || type;
+  };
+
+  const getParamTypeTag = type => {
+    const map = {
+      1: "primary",
+      2: "info",
+      3: "warning",
+      4: "success",
+    };
+    return map[type] || "info";
+  };
+
+  const goAdd = () => {
+    uni.navigateTo({ url: "/pages/productionDesign/basicParameters/edit" });
+  };
+
+  const goEdit = item => {
+    uni.navigateTo({
+      url: `/pages/productionDesign/basicParameters/edit?item=${encodeURIComponent(
+        JSON.stringify(item)
+      )}`,
+    });
+  };
+
+  const handleDelete = item => {
+    uni.showModal({
+      title: "鎻愮ず",
+      content: "纭畾瑕佸垹闄よ鍙傛暟鍚楋紵",
+      success: res => {
+        if (res.confirm) {
+          removeBaseParam(item.id).then(() => {
+            uni.showToast({ title: "鍒犻櫎鎴愬姛" });
+            handleSearch();
+          });
+        }
+      },
+    });
+  };
+
+  const handleSearch = () => {
+    page.current = 1;
+    page.status = "loadmore";
+    list.value = [];
+    getList();
+  };
+
+  const getList = () => {
+    if (page.status === "loading" || page.status === "nomore") return;
+
+    page.status = "loading";
+    getBaseParamList({
+      current: page.current,
+      size: page.size,
+      paramName: paramName.value,
+    })
+      .then(res => {
+        const records = res?.data?.records || res?.records || [];
+        const total = res?.data?.total || res?.total || 0;
+
+        if (page.current === 1) {
+          list.value = records;
+        } else {
+          list.value = [...list.value, ...records];
+        }
+
+        page.total = total;
+        if (list.value.length >= total) {
+          page.status = "nomore";
+        } else {
+          page.status = "loadmore";
+          page.current++;
+        }
+      })
+      .catch(() => {
+        uni.showToast({ title: "鏌ヨ澶辫触", icon: "error" });
+        page.status = "loadmore";
+      });
+  };
+
+  onReachBottom(() => {
+    getList();
+  });
+
+  onShow(() => {
+    handleSearch();
+  });
+</script>
+
+<style scoped lang="scss">
+  @import "@/styles/procurement-common.scss";
+
+  .no-data {
+    padding-top: 100rpx;
+    text-align: center;
+    color: #999;
+    font-size: 28rpx;
+  }
+
+  .action-buttons {
+    display: flex;
+    justify-content: flex-end;
+    gap: 20rpx;
+    padding-bottom: 30rpx;
+  }
+
+  .action-btn {
+    width: 140rpx;
+    margin: 0 !important;
+  }
+
+  .fab-button {
+    position: fixed;
+    right: 40rpx;
+    bottom: 60rpx;
+    width: 100rpx;
+    height: 100rpx;
+    background: #2979ff;
+    border-radius: 50%;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    box-shadow: 0 4rpx 12rpx rgba(41, 121, 255, 0.4);
+    z-index: 100;
+  }
+</style>

--
Gitblit v1.9.3