From f2770f03e7251b32eb576113c522bfbe96e5e385 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期二, 16 六月 2026 13:46:16 +0800
Subject: [PATCH] 君歌app 1.依照web端功能修改
---
src/pages/productionDesign/processManagement/edit.vue | 231 +++++++++++++++++++++++++++++++++++----------------------
1 files changed, 141 insertions(+), 90 deletions(-)
diff --git a/src/pages/productionDesign/processManagement/edit.vue b/src/pages/productionDesign/processManagement/edit.vue
index 425be43..c3eaac4 100644
--- a/src/pages/productionDesign/processManagement/edit.vue
+++ b/src/pages/productionDesign/processManagement/edit.vue
@@ -6,36 +6,59 @@
:model="form"
:rules="rules"
:errorType="['none']"
- label-width="110">
- <up-form-item label="宸ュ簭缂栫爜"
- prop="no">
- <up-input v-model="form.no"
- placeholder="璇疯緭鍏ュ伐搴忕紪鐮�"
- clearable />
- </up-form-item>
- <up-form-item label="宸ュ簭鍚嶇О"
+ label-width="130">
+ <up-form-item label="閮ㄤ欢"
prop="name"
required>
<up-input v-model="form.name"
- placeholder="璇疯緭鍏ュ伐搴忓悕绉�"
+ placeholder="璇疯緭鍏ラ儴浠�"
clearable />
</up-form-item>
- <up-form-item label="宸ヨ祫瀹氶"
+ <up-form-item label="宸ュ簭缂栧彿"
+ prop="no">
+ <up-input v-model="form.no"
+ placeholder="璇疯緭鍏ュ伐搴忕紪鍙�"
+ clearable />
+ </up-form-item>
+ <up-form-item label="宸ュ簭绫诲瀷"
+ prop="processType"
+ required>
+ <up-input v-model="processTypeText"
+ placeholder="璇烽�夋嫨宸ュ簭绫诲瀷"
+ readonly
+ @click="showProcessTypeSheet = true" />
+ <template #right>
+ <up-icon name="arrow-right"
+ @click="showProcessTypeSheet = true"></up-icon>
+ </template>
+ </up-form-item>
+ <up-form-item label="璁″垝宸ユ椂(灏忔椂)"
prop="salaryQuota">
<up-input v-model="form.salaryQuota"
type="number"
- placeholder="璇疯緭鍏ュ伐璧勫畾棰�"
+ placeholder="璇疯緭鍏ヨ鍒掑伐鏃�"
clearable />
</up-form-item>
- <up-form-item label="璁¤垂绫诲瀷"
- prop="type">
- <up-input v-model="typeText"
- placeholder="璇烽�夋嫨璁¤垂绫诲瀷"
+ <up-form-item label="璁″垝浜哄憳"
+ prop="planPerson">
+ <up-input v-model="planPersonText"
+ placeholder="璇烽�夋嫨璁″垝浜哄憳"
readonly
- @click="showTypeSheet = true" />
+ @click="showPlanPersonSheet = true" />
<template #right>
<up-icon name="arrow-right"
- @click="showTypeSheet = true"></up-icon>
+ @click="showPlanPersonSheet = true"></up-icon>
+ </template>
+ </up-form-item>
+ <up-form-item label="璁″垝鎵ц浜哄憳"
+ prop="executor">
+ <up-input v-model="executorText"
+ placeholder="璇烽�夋嫨璁″垝鎵ц浜哄憳"
+ readonly
+ @click="showExecutorSheet = true" />
+ <template #right>
+ <up-icon name="arrow-right"
+ @click="showExecutorSheet = true"></up-icon>
</template>
</up-form-item>
<up-form-item label="鏄惁璐ㄦ"
@@ -44,27 +67,22 @@
<up-switch v-model="form.isQuality" />
</view>
</up-form-item>
- <up-form-item label="鏄惁鐢熶骇"
- prop="isProduction">
+ <up-form-item label="鏄惁鍏ュ簱"
+ prop="inbound">
<view style="display: flex; justify-content: flex-end; width: 100%;">
- <up-switch v-model="form.isProduction" />
+ <up-switch v-model="form.inbound" />
</view>
</up-form-item>
- <up-form-item label="鍏宠仈璁惧"
- prop="deviceLedgerId">
- <up-input v-model="deviceText"
- placeholder="璇烽�夋嫨鍏宠仈璁惧"
- readonly
- @click="showDeviceSheet = true" />
- <template #right>
- <up-icon name="arrow-right"
- @click="showDeviceSheet = true"></up-icon>
- </template>
+ <up-form-item label="鏄惁鎶ュ伐"
+ prop="reportWork">
+ <view style="display: flex; justify-content: flex-end; width: 100%;">
+ <up-switch v-model="form.reportWork" />
+ </view>
</up-form-item>
- <up-form-item label="宸ュ簭鎻忚堪"
+ <up-form-item label="澶囨敞"
prop="remark">
<up-textarea v-model="form.remark"
- placeholder="璇疯緭鍏ュ伐搴忔弿杩�"
+ placeholder="璇疯緭鍏ュ娉�"
autoHeight />
</up-form-item>
</up-form>
@@ -72,18 +90,24 @@
:confirmText="processId ? '淇濆瓨' : '鏂板'"
@cancel="goBack"
@confirm="handleSubmit" />
- <!-- 璁¤垂绫诲瀷閫夋嫨 -->
- <up-action-sheet :show="showTypeSheet"
- title="閫夋嫨璁¤垂绫诲瀷"
- :actions="typeActions"
- @select="onSelectType"
- @close="showTypeSheet = false" />
- <!-- 璁惧閫夋嫨 -->
- <up-action-sheet :show="showDeviceSheet"
- title="閫夋嫨鍏宠仈璁惧"
- :actions="deviceActions"
- @select="onSelectDevice"
- @close="showDeviceSheet = false" />
+ <!-- 宸ュ簭绫诲瀷閫夋嫨 -->
+ <up-action-sheet :show="showProcessTypeSheet"
+ title="閫夋嫨宸ュ簭绫诲瀷"
+ :actions="processTypeActions"
+ @select="onSelectProcessType"
+ @close="showProcessTypeSheet = false" />
+ <!-- 璁″垝浜哄憳閫夋嫨 -->
+ <up-action-sheet :show="showPlanPersonSheet"
+ title="閫夋嫨璁″垝浜哄憳"
+ :actions="employeeActions"
+ @select="onSelectPlanPerson"
+ @close="showPlanPersonSheet = false" />
+ <!-- 璁″垝鎵ц浜哄憳閫夋嫨 -->
+ <up-action-sheet :show="showExecutorSheet"
+ title="閫夋嫨璁″垝鎵ц浜哄憳"
+ :actions="employeeActions"
+ @select="onSelectExecutor"
+ @close="showExecutorSheet = false" />
</view>
</template>
@@ -91,35 +115,49 @@
import { reactive, ref, computed, onMounted } from "vue";
import { onLoad, onReady } from "@dcloudio/uni-app";
import FooterButtons from "@/components/FooterButtons.vue";
- import {
- add,
- update,
- getDeviceLedger,
- } from "@/api/productionManagement/processManagement";
+ import { add, update } from "@/api/productionManagement/processManagement";
+ import { staffOnJobListPage } from "@/api/personnelManagement/onboarding";
const formRef = ref(null);
const loading = ref(false);
const processId = ref(null);
const pageTitle = computed(() => (processId.value ? "缂栬緫宸ュ簭" : "鏂板宸ュ簭"));
+ const processTypeOptions = [
+ "鏈哄姞宸�",
+ "鍒澘鍐疯姱鍒朵綔",
+ "绠¤矾缁勫",
+ "缃愪綋杩炴帴鍙婅皟璇�",
+ "娴嬭瘯鎵撳帇",
+ "鍏朵粬",
+ ];
+
+ const employeeList = ref([]);
+
const form = ref({
no: "",
name: "",
+ processType: "",
salaryQuota: "",
+ planPerson: null,
+ executor: null,
isQuality: false,
- isProduction: false,
+ inbound: false,
+ reportWork: false,
remark: "",
- deviceLedgerId: null,
- type: 0,
});
const rules = {
- name: [{ required: true, message: "璇疯緭鍏ュ伐搴忓悕绉�" }],
+ name: [
+ { required: true, message: "璇疯緭鍏ラ儴浠�" },
+ { max: 100, message: "鏈�澶�100涓瓧绗�" },
+ ],
+ processType: [{ required: true, message: "璇烽�夋嫨宸ュ簭绫诲瀷" }],
salaryQuota: [
{
validator: (rule, value, callback) => {
if (value !== "" && value !== null && (isNaN(value) || value < 0)) {
- callback(new Error("宸ヨ祫瀹氶蹇呴』鏄潪璐熸暟瀛�"));
+ callback(new Error("璁″垝宸ユ椂蹇呴』鏄潪璐熸暟瀛�"));
} else {
callback();
}
@@ -128,46 +166,60 @@
],
};
- const showTypeSheet = ref(false);
- const typeActions = [
- { name: "璁℃椂", value: 0 },
- { name: "璁′欢", value: 1 },
- ];
- const typeText = computed(() => {
- const action = typeActions.find(a => a.value === form.value.type);
- return action ? action.name : "";
- });
+ const showProcessTypeSheet = ref(false);
+ const processTypeActions = processTypeOptions.map(item => ({ name: item, value: item }));
+ const processTypeText = ref("");
- const showDeviceSheet = ref(false);
- const deviceActions = ref([]);
- const deviceText = ref("");
+ const showPlanPersonSheet = ref(false);
+ const showExecutorSheet = ref(false);
+ const planPersonText = ref("");
+ const executorText = ref("");
- const onSelectType = e => {
- form.value.type = e.value;
- showTypeSheet.value = false;
+ const employeeActions = computed(() =>
+ employeeList.value.map(item => ({
+ name: item.staffName,
+ id: item.id,
+ }))
+ );
+
+ const onSelectProcessType = e => {
+ form.value.processType = e.value;
+ processTypeText.value = e.name;
+ showProcessTypeSheet.value = false;
};
- const onSelectDevice = e => {
- form.value.deviceLedgerId = e.id;
- deviceText.value = e.name;
- showDeviceSheet.value = false;
+ const onSelectPlanPerson = e => {
+ form.value.planPerson = e.id;
+ planPersonText.value = e.name;
+ showPlanPersonSheet.value = false;
};
- const loadDevices = async () => {
+ const onSelectExecutor = e => {
+ form.value.executor = e.id;
+ executorText.value = e.name;
+ showExecutorSheet.value = false;
+ };
+
+ const loadEmployees = async () => {
try {
- const { data } = await getDeviceLedger();
- deviceActions.value = (data || []).map(item => ({
- name: item.deviceName,
- id: item.id,
- }));
- if (form.value.deviceLedgerId) {
- const device = deviceActions.value.find(
- d => d.id === Number(form.value.deviceLedgerId)
- );
- if (device) deviceText.value = device.name;
- }
+ const res = await staffOnJobListPage({ current: -1, size: -1, staffState: 1 });
+ employeeList.value = res.data?.records || [];
} catch (error) {
- console.error("鍔犺浇璁惧澶辫触", error);
+ console.error("鍔犺浇鍛樺伐鍒楄〃澶辫触", error);
+ }
+ };
+
+ const resolveDisplayTexts = () => {
+ if (form.value.processType) {
+ processTypeText.value = form.value.processType;
+ }
+ if (form.value.planPerson) {
+ const emp = employeeList.value.find(e => e.id === form.value.planPerson);
+ if (emp) planPersonText.value = emp.staffName;
+ }
+ if (form.value.executor) {
+ const emp = employeeList.value.find(e => e.id === form.value.executor);
+ if (emp) executorText.value = emp.staffName;
}
};
@@ -210,10 +262,9 @@
const item = JSON.parse(decodeURIComponent(option.item));
processId.value = item.id;
Object.assign(form.value, item);
- // 澶勭悊绫诲瀷杞崲锛岀‘淇濇槸鏁板瓧
- form.value.type = Number(form.value.type);
form.value.isQuality = !!form.value.isQuality;
- form.value.isProduction = !!form.value.isProduction;
+ form.value.inbound = !!form.value.inbound;
+ form.value.reportWork = !!form.value.reportWork;
}
});
@@ -222,7 +273,7 @@
});
onMounted(() => {
- loadDevices();
+ loadEmployees().then(() => resolveDisplayTexts());
});
</script>
--
Gitblit v1.9.3