From a9d97b150701e634bdb751eab277696abd136cca Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期二, 16 六月 2026 14:39:47 +0800
Subject: [PATCH] 君歌app 1.依照web端功能修改
---
src/pages/productionDesign/processManagement/index.vue | 287 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 287 insertions(+), 0 deletions(-)
diff --git a/src/pages/productionDesign/processManagement/index.vue b/src/pages/productionDesign/processManagement/index.vue
new file mode 100644
index 0000000..9fd6d5d
--- /dev/null
+++ b/src/pages/productionDesign/processManagement/index.vue
@@ -0,0 +1,287 @@
+<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="queryParams.name"
+ 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="list-dot"
+ size="16"
+ color="#ffffff"></up-icon>
+ </view>
+ <text class="item-id">{{ item.name || "-" }}</text>
+ </view>
+ <text class="item-index">{{ item.no || "-" }}</text>
+ </view>
+ <up-divider></up-divider>
+ <view class="item-details">
+ <view class="detail-row">
+ <text class="detail-label">閮ㄤ欢绫诲瀷</text>
+ <text class="detail-value">{{ item.processType || "-" }}</text>
+ </view>
+ <view class="detail-row">
+ <text class="detail-label">鍏宠仈璁惧</text>
+ <text class="detail-value">{{ getDeviceName(item.deviceLedgerId) }}</text>
+ </view>
+ <view class="detail-row">
+ <text class="detail-label">璁″垝宸ユ椂</text>
+ <text class="detail-value highlight">{{ item.salaryQuota || 0 }}灏忔椂</text>
+ </view>
+ <view class="detail-row">
+ <text class="detail-label">璁″垝浜哄憳</text>
+ <text class="detail-value">{{ getEmployeeName(item.planPerson) }}</text>
+ </view>
+ <view class="detail-row">
+ <text class="detail-label">璁″垝鎵ц浜哄憳</text>
+ <text class="detail-value">{{ getEmployeeName(item.executor) }}</text>
+ </view>
+ <view class="detail-row">
+ <text class="detail-label">澶囨敞</text>
+ <text class="detail-value">{{ item.remark || "-" }}</text>
+ </view>
+ </view>
+ <view class="status-tags">
+ <up-tag :text="item.isQuality ? '璐ㄦ' : '闈炶川妫�'"
+ :type="item.isQuality ? 'warning' : 'info'"
+ size="mini" />
+ <up-tag :text="item.isProduction ? '鐢熶骇' : '涓嶇敓浜�'"
+ :type="item.isProduction ? 'warning' : 'info'"
+ size="mini"
+ style="margin-left: 8rpx" />
+ </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="warning"
+ @click="goParams(item)">鍙傛暟閰嶇疆</up-button>
+ <up-button class="action-btn"
+ size="small"
+ type="error"
+ @click="handleDelete(item)">鍒犻櫎</up-button>
+ </view>
+ </view>
+ <up-loadmore :status="pageStatus" />
+ </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 {
+ getProcessList,
+ del,
+ getDeviceLedger,
+ } from "@/api/productionManagement/processManagement";
+ import { staffOnJobListPage } from "@/api/personnelManagement/onboarding";
+
+ const queryParams = reactive({
+ name: "",
+ });
+ const list = ref([]);
+ const deviceOptions = ref([]);
+ const employeeOptions = ref([]);
+ const pageStatus = ref("loadmore");
+
+ const page = reactive({
+ current: 1,
+ size: 10,
+ total: 0,
+ });
+
+ const goBack = () => {
+ uni.navigateBack();
+ };
+
+ const getDeviceName = deviceId => {
+ if (!deviceId) return "鏈叧鑱�";
+ const device = deviceOptions.value.find(item => item.id === Number(deviceId));
+ return device?.deviceName || "鏈叧鑱�";
+ };
+
+ const getEmployeeName = employeeId => {
+ if (!employeeId) return "鏈寚瀹�";
+ const emp = employeeOptions.value.find(item => item.id === Number(employeeId));
+ return emp?.staffName || "鏈寚瀹�";
+ };
+
+ const loadDevices = async () => {
+ try {
+ const { data } = await getDeviceLedger();
+ deviceOptions.value = data || [];
+ } catch (error) {
+ console.error("鍔犺浇璁惧鍒楄〃澶辫触", error);
+ }
+ };
+
+ const loadEmployees = async () => {
+ try {
+ const res = await staffOnJobListPage({ current: -1, size: -1, staffState: 1 });
+ employeeOptions.value = res.data?.records || [];
+ } catch (error) {
+ console.error("鍔犺浇鍛樺伐鍒楄〃澶辫触", error);
+ }
+ };
+
+ const handleSearch = () => {
+ page.current = 1;
+ pageStatus.value = "loadmore";
+ list.value = [];
+ getList();
+ };
+
+ const getList = () => {
+ if (pageStatus.value === "loading" || pageStatus.value === "nomore") return;
+
+ pageStatus.value = "loading";
+ getProcessList({
+ current: page.current,
+ size: page.size,
+ name: queryParams.name,
+ })
+ .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) {
+ pageStatus.value = "nomore";
+ } else {
+ pageStatus.value = "loadmore";
+ page.current++;
+ }
+ })
+ .catch(() => {
+ uni.showToast({ title: "鏌ヨ澶辫触", icon: "error" });
+ pageStatus.value = "loadmore";
+ });
+ };
+
+ const goAdd = () => {
+ uni.navigateTo({ url: "/pages/productionDesign/processManagement/edit" });
+ };
+
+ const goEdit = item => {
+ uni.navigateTo({
+ url: `/pages/productionDesign/processManagement/edit?item=${encodeURIComponent(
+ JSON.stringify(item)
+ )}`,
+ });
+ };
+
+ const goParams = item => {
+ uni.navigateTo({
+ url: `/pages/productionDesign/processManagement/params?id=${item.id}&name=${encodeURIComponent(item.name)}`,
+ });
+ };
+
+ const handleDelete = item => {
+ uni.showModal({
+ title: "鎻愮ず",
+ content: "纭畾瑕佸垹闄よ宸ュ簭鍚楋紵",
+ success: res => {
+ if (res.confirm) {
+ del([item.id]).then(() => {
+ uni.showToast({ title: "鍒犻櫎鎴愬姛" });
+ handleSearch();
+ });
+ }
+ },
+ });
+ };
+
+ onReachBottom(() => {
+ getList();
+ });
+
+ onShow(async () => {
+ await Promise.all([loadDevices(), loadEmployees()]);
+ handleSearch();
+ });
+</script>
+
+<style scoped lang="scss">
+ @import "@/styles/procurement-common.scss";
+
+ .no-data {
+ padding-top: 100rpx;
+ text-align: center;
+ color: #999;
+ font-size: 28rpx;
+ }
+
+ .status-tags {
+ display: flex;
+ align-items: center;
+ padding-bottom: 16rpx;
+ }
+
+ .action-buttons {
+ display: flex;
+ justify-content: flex-end;
+ gap: 20rpx;
+ padding-bottom: 30rpx;
+ }
+
+ .action-btn {
+ flex: 1;
+ 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>
\ No newline at end of file
--
Gitblit v1.9.3