From ffe58e0cf73fa61d8b05de09645c5d8d89007ce5 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期二, 16 六月 2026 15:20:52 +0800
Subject: [PATCH] 君歌 1.部署修改
---
src/views/productionManagement/productionProcess/Edit.vue | 214 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 214 insertions(+), 0 deletions(-)
diff --git a/src/views/productionManagement/productionProcess/Edit.vue b/src/views/productionManagement/productionProcess/Edit.vue
index e69de29..e1d91d8 100644
--- a/src/views/productionManagement/productionProcess/Edit.vue
+++ b/src/views/productionManagement/productionProcess/Edit.vue
@@ -0,0 +1,214 @@
+<template>
+ <FormDialog
+ v-model="isShow"
+ title="缂栬緫宸ュ簭"
+ width="800px"
+ @confirm="handleSubmit"
+ @cancel="closeModal"
+ >
+ <el-form label-width="180px" :model="formState" label-position="top" ref="formRef">
+ <el-form-item
+ label="閮ㄤ欢锛�"
+ prop="name"
+ :rules="[
+ {
+ required: true,
+ message: '璇疯緭鍏ラ儴浠�',
+ },
+ {
+ max: 100,
+ message: '鏈�澶�100涓瓧绗�',
+ }
+ ]">
+ <el-input v-model="formState.name" />
+ </el-form-item>
+ <el-form-item label="宸ュ簭缂栧彿" prop="no">
+ <el-input v-model="formState.no" />
+ </el-form-item>
+ <el-form-item
+ label="宸ュ簭绫诲瀷"
+ prop="processType"
+ :rules="[
+ {
+ required: true,
+ message: '璇烽�夋嫨宸ュ簭绫诲瀷',
+ }
+ ]"
+ >
+ <el-select v-model="formState.processType" placeholder="璇烽�夋嫨宸ュ簭绫诲瀷" style="width: 100%">
+ <el-option v-for="item in processTypeOptions"
+ :key="item"
+ :label="item"
+ :value="item" />
+ </el-select>
+ </el-form-item>
+ <el-form-item label="璁″垝宸ユ椂(灏忔椂)" prop="salaryQuota">
+ <el-input v-model="formState.salaryQuota" type="number" :step="0.5" />
+ </el-form-item>
+ <el-form-item label="璁″垝浜哄憳" prop="planPerson">
+ <el-select v-model="formState.planPerson"
+ placeholder="璇烽�夋嫨璁″垝浜哄憳"
+ clearable
+ filterable
+ style="width: 100%">
+ <el-option v-for="item in employeeOptions"
+ :key="item.id"
+ :label="item.staffName"
+ :value="item.id" />
+ </el-select>
+ </el-form-item>
+ <el-form-item label="璁″垝鎵ц浜哄憳" prop="executor">
+ <el-select v-model="formState.executor"
+ placeholder="璇烽�夋嫨璁″垝鎵ц浜哄憳"
+ clearable
+ filterable
+ style="width: 100%">
+ <el-option v-for="item in employeeOptions"
+ :key="item.id"
+ :label="item.staffName"
+ :value="item.id" />
+ </el-select>
+ </el-form-item>
+ <el-form-item label="鏄惁璐ㄦ" prop="isQuality">
+ <el-switch v-model="formState.isQuality" :active-value="true" inactive-value="false"/>
+ </el-form-item>
+ <el-form-item label="鏄惁鍏ュ簱" prop="inbound">
+ <el-switch v-model="formState.inbound" :active-value="true" inactive-value="false"/>
+ </el-form-item>
+ <el-form-item label="鏄惁鎶ュ伐" prop="reportWork">
+ <el-switch v-model="formState.reportWork" :active-value="true" inactive-value="false"/>
+ </el-form-item>
+ <el-form-item label="澶囨敞" prop="remark">
+ <el-input v-model="formState.remark" type="textarea" />
+ </el-form-item>
+ </el-form>
+ </FormDialog>
+</template>
+
+<script setup>
+import { ref, computed, getCurrentInstance, watch, onMounted } from "vue";
+import { update } from "@/api/productionManagement/productionProcess.js";
+import { staffOnJobListPage } from "@/api/personnelManagement/staffOnJob.js";
+import FormDialog from "@/components/Dialog/FormDialog.vue";
+
+const props = defineProps({
+ visible: {
+ type: Boolean,
+ required: true,
+ },
+
+ record: {
+ type: Object,
+ required: true,
+ }
+});
+
+const emit = defineEmits(['update:visible', 'completed']);
+
+const processTypeOptions = [
+ "鏈哄姞宸�",
+ "鍒澘鍐疯姱鍒朵綔",
+ "绠¤矾缁勫",
+ "缃愪綋杩炴帴鍙婅皟璇�",
+ "娴嬭瘯鎵撳帇",
+ "鍏朵粬",
+];
+
+const employeeOptions = ref([]);
+
+const formState = ref({
+ id: props.record.id,
+ name: props.record.name,
+ no: props.record.no,
+ processType: props.record.processType || '',
+ remark: props.record.remark,
+ salaryQuota: props.record.salaryQuota,
+ planPerson: props.record.planPerson || null,
+ executor: props.record.executor || null,
+ isQuality: props.record.isQuality,
+ inbound: props.record.inbound,
+ reportWork: props.record.reportWork,
+});
+
+const isShow = computed({
+ get() {
+ return props.visible;
+ },
+ set(val) {
+ emit('update:visible', val);
+ },
+});
+
+watch(() => props.record, (newRecord) => {
+ if (newRecord && isShow.value) {
+ formState.value = {
+ id: newRecord.id,
+ name: newRecord.name || '',
+ no: newRecord.no || '',
+ processType: newRecord.processType || '',
+ remark: newRecord.remark || '',
+ salaryQuota: newRecord.salaryQuota || '',
+ planPerson: newRecord.planPerson || null,
+ executor: newRecord.executor || null,
+ isQuality: props.record.isQuality,
+ inbound: newRecord.inbound,
+ reportWork: newRecord.reportWork,
+ };
+ }
+}, { immediate: true, deep: true });
+
+watch(() => props.visible, (visible) => {
+ if (visible && props.record) {
+ formState.value = {
+ id: props.record.id,
+ name: props.record.name || '',
+ no: props.record.no || '',
+ processType: props.record.processType || '',
+ remark: props.record.remark || '',
+ salaryQuota: props.record.salaryQuota || '',
+ planPerson: props.record.planPerson || null,
+ executor: props.record.executor || null,
+ isQuality: props.record.isQuality,
+ inbound: props.record.inbound,
+ reportWork: props.record.reportWork,
+ };
+ }
+});
+
+let { proxy } = getCurrentInstance()
+
+const closeModal = () => {
+ isShow.value = false;
+};
+
+const handleSubmit = () => {
+ proxy.$refs["formRef"].validate(valid => {
+ if (valid) {
+ update(formState.value).then(res => {
+ isShow.value = false;
+ emit('completed');
+ proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
+ })
+ }
+ })
+};
+
+const loadEmployees = async () => {
+ try {
+ const res = await staffOnJobListPage({ current: -1, size: -1, staffState: 1 });
+ employeeOptions.value = res.data?.records || [];
+ } catch (error) {
+ console.error("鍔犺浇鍛樺伐鍒楄〃澶辫触", error);
+ }
+};
+
+onMounted(() => {
+ loadEmployees();
+});
+
+defineExpose({
+ closeModal,
+ handleSubmit,
+ isShow,
+});
+</script>
--
Gitblit v1.9.3