From 2f71101ad75ce34a9f5f9de6e0d0902093b36ce3 Mon Sep 17 00:00:00 2001
From: chenhj <1263187585@qq.com>
Date: 星期二, 17 三月 2026 11:45:06 +0800
Subject: [PATCH] Merge branch 'dev_衡阳_鹏创电子' of http://114.132.189.42:9002/r/product-inventory-management into dev_衡阳_鹏创电子
---
src/views/productionManagement/workOrder/components/CopperPrintingForm.vue | 443 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 443 insertions(+), 0 deletions(-)
diff --git a/src/views/productionManagement/workOrder/components/CopperPrintingForm.vue b/src/views/productionManagement/workOrder/components/CopperPrintingForm.vue
new file mode 100644
index 0000000..7a11105
--- /dev/null
+++ b/src/views/productionManagement/workOrder/components/CopperPrintingForm.vue
@@ -0,0 +1,443 @@
+<script setup lang="ts">
+import {computed, onMounted, reactive, ref} from "vue";
+import dayjs from "dayjs";
+import {userListNoPageByTenantId} from "@/api/system/user.js";
+import {ElMessage} from "element-plus";
+import {addProductMain} from "@/api/productionManagement/workOrder.js";
+
+defineOptions({
+ name: "CopperPrintingForm"
+});
+
+const props = defineProps({
+ isShow: {
+ type: Boolean,
+ required: true
+ },
+ isEdit: {
+ type: Boolean,
+ default: false
+ },
+ detailData: {
+ type: Object,
+ default: () => ({}),
+ },
+ row: {
+ type: Object,
+ default: () => ({}),
+ }
+});
+
+const emits = defineEmits(["update:isShow", "refreshData"]);
+
+const visible = computed({
+ get: () => props.isShow,
+ set: (value: boolean) => emits("update:isShow", value),
+});
+
+const formData = reactive({
+ productProcessRouteItemId: undefined,
+ workOrderId: undefined,
+ planQuantity: undefined,
+ reportWork: undefined,
+ productMainId: undefined,
+ quantity: undefined, // 鐑ч摐浜у嚭婵�
+ userId: undefined, // 浣滀笟鍛�
+ userName: undefined, // 浣滀笟鍛�
+ otherData: {
+ dryingTemperature: '', // 鐑樺共娓╁害
+ startTime: dayjs().format('YYYY-MM-DD HH:mm:ss'), // 寮�濮嬫椂闂�
+ endTime: dayjs().format('YYYY-MM-DD HH:mm:ss'), // 缁撴潫鏃堕棿
+ userId: undefined, // 浣滀笟鍛�
+ userName: undefined, // 浣滀笟鍛�
+ underlyingCopperPaste: undefined, // 搴曞眰閾滄祮
+ underlyingCopperPastePrintingQuantity: undefined, // 搴曞眰閾滄祮鍗板埛娆℃暟
+ underlyingCopperPasteMachineNumber: undefined, // 搴曞眰閾滄祮鏈哄彴鍙�
+ underlyingCopperPasteSilkScreenFamilyNumber: undefined, // 搴曞眰閾滄祮涓濈綉鏃忓彿
+ underlyingCopperPasteNumberOfEyes: undefined, // 搴曞眰閾滄祮鐩暟
+ underlyingCopperPasteUserId: undefined, // 搴曞眰閾滄祮浣滀笟鍛�
+ underlyingCopperPasteUserName: undefined, // 搴曞眰閾滄祮浣滀笟鍛�
+ underlyingCopperPasteDryingTemperature: undefined, // 搴曞眰閾滄祮鐑樺共娓╁害
+ surfaceCopperPaste: undefined, // 琛ㄥ眰閾滄祮
+ surfaceCopperPastePrintingQuantity: undefined, // 琛ㄥ眰閾滄祮鍗板埛娆℃暟
+ surfaceCopperPasteMachineNumber: undefined, // 琛ㄥ眰閾滄祮鏈哄彴鍙�
+ surfaceCopperPasteSilkScreenFamilyNumber: undefined, // 琛ㄥ眰閾滄祮涓濈綉鏃忓彿
+ surfaceCopperPasteNumberOfEyes: undefined, // 琛ㄥ眰閾滄祮鐩暟
+ surfaceCopperPasteUserId: undefined, // 琛ㄥ眰閾滄祮浣滀笟鍛�
+ surfaceCopperPasteUserName: undefined, // 琛ㄥ眰閾滄祮浣滀笟鍛�
+ surfaceCopperPasteDryingTemperature: undefined, // 琛ㄥ眰閾滄祮鐑樺共娓╁害,
+ steelBurningDate: undefined, // 鐑ч挗鏃ユ湡
+ copperFiringTime: undefined, // 鐑ч摐杩涚倝鏃堕棿
+ steelFiringTime: undefined, // 鐑ч挗鍑虹倝鏃堕棿
+ weight: undefined, // 閲嶉噺锛坘g/pos锛�
+ copperSmeltingTemperatureProfile: undefined, // 鐑ч摐娓╁害鏇茬嚎
+ remark: undefined, // 澶囨敞
+ }
+})
+
+const userOptions = ref([]);
+const getUserList = () => {
+ userListNoPageByTenantId()
+ .then(res => {
+ if (res.code === 200) {
+ userOptions.value = res.data || [];
+ }
+ })
+ .catch(err => {
+ console.error("鑾峰彇鐢ㄦ埛鍒楄〃澶辫触", err);
+ });
+};
+// 鐢ㄦ埛閫夋嫨鍙樺寲鏃舵洿鏂� userName
+const handleUserChange = (userId: any, reportType: string) => {
+ if (userId) {
+ const selectedUser = userOptions.value.find(user => user.userId === userId);
+
+ switch (reportType) {
+ case 'userId':
+ formData.otherData.userName = selectedUser.userName;
+ break;
+ case 'underlyingCopperPasteUserId':
+ formData.otherData.underlyingCopperPasteUserName = selectedUser.userName;
+ break;
+ case 'surfaceCopperPasteUserId':
+ formData.otherData.surfaceCopperPasteUserName = selectedUser.userName;
+ break;
+ }
+ } else {
+ switch (reportType) {
+ case 'userId':
+ formData.otherData.userName = "";
+ break;
+ case 'underlyingCopperPasteUserId':
+ formData.otherData.underlyingCopperPasteUserName = "";
+ break;
+ case 'surfaceCopperPasteUserId':
+ formData.otherData.surfaceCopperPasteUserName = "";
+ break;
+ }
+ }
+};
+const handleReport = () => {
+ if (!formData.otherData.userId && !formData.otherData.surfaceCopperPasteUserId && !formData.otherData.underlyingCopperPasteUserId) {
+ ElMessage.error('璇烽�夋嫨浣滀笟鍛�')
+ return;
+ }
+ if (!formData.quantity || formData.quantity <= 0) {
+ ElMessage.error('璇疯緭鍏ョ敓浜ф暟閲�')
+ return;
+ }
+ formData.userId = formData.otherData.surfaceCopperPasteUserId || formData.otherData.underlyingCopperPasteUserId;
+
+ const otherData = JSON.stringify(formData.otherData);
+ const submitData = {
+ ...formData,
+ otherData: otherData
+ };
+
+ addProductMain(submitData).then(res => {
+ if (res.code === 200) {
+ ElMessage({
+ message: '鎶ュ伐鎴愬姛',
+ type: 'success',
+ })
+ emits("refreshData")
+ visible.value = false;
+ } else {
+ ElMessage.error('鎶ュ伐澶辫触')
+ }
+ });
+};
+
+const initData = () => {
+ if (!props.isEdit) {
+ formData.otherData = JSON.parse(props.detailData.otherData || '{}');
+ formData.quantity = props.detailData.quantity;
+ } else {
+ const row = props.row;
+ formData.planQuantity = row.planQuantity
+ formData.productProcessRouteItemId = row.productProcessRouteItemId
+ formData.workOrderId = row.id
+ formData.reportWork = row.reportWork
+ formData.productMainId = row.productMainId
+ }
+}
+
+const displayValue = (value: any) => {
+ return value === undefined || value === null || value === "" ? "-" : value;
+};
+
+onMounted(() => {
+ getUserList();
+ initData()
+})
+</script>
+
+<template>
+ <el-dialog v-model="visible"
+ title="鍗伴摐鎶ュ伐"
+ width="90%">
+ <el-form :model="formData">
+ <table class="report-table">
+ <tbody>
+ <tr>
+ <td class="tip" colspan="4">鐡风墖娓呮礂鍚庢斁缃椂闂磋秴杩�72H锛岄噸鏂扮儤鐗囧悗鎵嶈兘鍗板埛骞跺~鍐欐湰鏍�</td>
+ <td class="label" colspan="3">鐑樺共娓╁害</td>
+ <td colspan="2">
+ <el-input v-if="props.isEdit" v-model="formData.otherData.dryingTemperature" placeholder="璇疯緭鍏�"/>
+ <span v-else class="view-value">{{ displayValue(formData.otherData.dryingTemperature) }}</span>
+ </td>
+ <td class="label">寮�濮嬫椂闂�</td>
+ <td colspan="2">
+ <el-date-picker
+ v-if="props.isEdit"
+ v-model="formData.otherData.startTime"
+ type="datetime"
+ value-format="YYYY-MM-DD HH:mm:ss"
+ format="YYYY-MM-DD HH:mm:ss"
+ placeholder="璇烽�夋嫨"
+ style="width: 100%"
+ />
+ <span v-else class="view-value">{{ displayValue(formData.otherData.startTime) }}</span>
+ </td>
+ <td class="label" colspan="3">缁撴潫鏃堕棿</td>
+ <td colspan="2">
+ <el-date-picker
+ v-if="props.isEdit"
+ v-model="formData.otherData.endTime"
+ type="datetime"
+ value-format="YYYY-MM-DD HH:mm:ss"
+ format="YYYY-MM-DD HH:mm:ss"
+ placeholder="璇烽�夋嫨"
+ style="width: 100%"
+ />
+ <span v-else class="view-value">{{ displayValue(formData.otherData.endTime) }}</span>
+ </td>
+ <td class="label" colspan="2">浣滀笟鍛�</td>
+ <td colspan="2">
+ <el-select v-model="formData.otherData.userId"
+ v-if="props.isEdit"
+ style="width: 100%"
+ placeholder="璇烽�夋嫨浣滀笟鍛�"
+ clearable
+ filterable
+ @change="handleUserChange($event, 'userId')">
+ <el-option v-for="user in userOptions"
+ :key="user.userId"
+ :label="user.userName"
+ :value="user.userId"/>
+ </el-select>
+ <span v-else class="view-value">{{ displayValue(formData.otherData.userName || formData.otherData.userId) }}</span>
+ </td>
+ </tr>
+ <tr>
+ <td class="label" colspan="2">搴曞眰閾滄祮</td>
+ <td>
+ <el-input v-if="props.isEdit" v-model="formData.otherData.underlyingCopperPaste" placeholder="璇疯緭鍏�"/>
+ <span v-else class="view-value">{{ displayValue(formData.otherData.underlyingCopperPaste) }}</span>
+ </td>
+ <td class="label">鍗板埛娆℃暟</td>
+ <td colspan="2">
+ <el-input v-if="props.isEdit" v-model="formData.otherData.underlyingCopperPastePrintingQuantity" placeholder="璇疯緭鍏�"/>
+ <span v-else class="view-value">{{ displayValue(formData.otherData.underlyingCopperPastePrintingQuantity) }}</span>
+ </td>
+ <td class="label">鏈哄彴鍙�</td>
+ <td>
+ <el-input v-if="props.isEdit" v-model="formData.otherData.underlyingCopperPasteMachineNumber" placeholder="璇疯緭鍏�"/>
+ <span v-else class="view-value">{{ displayValue(formData.otherData.underlyingCopperPasteMachineNumber) }}</span>
+ </td>
+ <td class="label">涓濈綉鏃忓彿</td>
+ <td colspan="2">
+ <el-input v-if="props.isEdit" v-model="formData.otherData.underlyingCopperPasteSilkScreenFamilyNumber" placeholder="璇疯緭鍏�"/>
+ <span v-else class="view-value">{{ displayValue(formData.otherData.underlyingCopperPasteSilkScreenFamilyNumber) }}</span>
+ </td>
+ <td class="label">鐩暟</td>
+ <td colspan="2">
+ <el-input v-if="props.isEdit" v-model="formData.otherData.underlyingCopperPasteNumberOfEyes" placeholder="璇疯緭鍏�"/>
+ <span v-else class="view-value">{{ displayValue(formData.otherData.underlyingCopperPasteNumberOfEyes) }}</span>
+ </td>
+ <td class="label">浣滀笟鍛�</td>
+ <td colspan="2">
+ <el-select v-model="formData.otherData.underlyingCopperPasteUserId"
+ v-if="props.isEdit"
+ style="width: 100%"
+ placeholder="璇烽�夋嫨浣滀笟鍛�"
+ clearable
+ filterable
+ @change="handleUserChange($event, 'underlyingCopperPasteUserId')">
+ <el-option v-for="user in userOptions"
+ :key="user.userId"
+ :label="user.userName"
+ :value="user.userId"/>
+ </el-select>
+ <span v-else class="view-value">{{ displayValue(formData.otherData.underlyingCopperPasteUserName || formData.otherData.underlyingCopperPasteUserId) }}</span>
+ </td>
+ <td class="label" colspan="2">鐑樺共娓╁害</td>
+ <td colspan="2">
+ <el-input v-if="props.isEdit" v-model="formData.otherData.underlyingCopperPasteDryingTemperature" placeholder="璇疯緭鍏�"/>
+ <span v-else class="view-value">{{ displayValue(formData.otherData.underlyingCopperPasteDryingTemperature) }}</span>
+ </td>
+ </tr>
+ <tr>
+ <td class="label" colspan="2">琛ㄥ眰閾滄祮</td>
+ <td>
+ <el-input v-if="props.isEdit" v-model="formData.otherData.surfaceCopperPaste" placeholder="璇疯緭鍏�"/>
+ <span v-else class="view-value">{{ displayValue(formData.otherData.surfaceCopperPaste) }}</span>
+ </td>
+ <td class="label">鍗板埛娆℃暟</td>
+ <td colspan="2">
+ <el-input v-if="props.isEdit" v-model="formData.otherData.surfaceCopperPastePrintingQuantity" placeholder="璇疯緭鍏�"/>
+ <span v-else class="view-value">{{ displayValue(formData.otherData.surfaceCopperPastePrintingQuantity) }}</span>
+ </td>
+ <td class="label">鏈哄彴鍙�</td>
+ <td>
+ <el-input v-if="props.isEdit" v-model="formData.otherData.surfaceCopperPasteMachineNumber" placeholder="璇疯緭鍏�"/>
+ <span v-else class="view-value">{{ displayValue(formData.otherData.surfaceCopperPasteMachineNumber) }}</span>
+ </td>
+ <td class="label">涓濈綉鏃忓彿</td>
+ <td colspan="2">
+ <el-input v-if="props.isEdit" v-model="formData.otherData.surfaceCopperPasteSilkScreenFamilyNumber" placeholder="璇疯緭鍏�"/>
+ <span v-else class="view-value">{{ displayValue(formData.otherData.surfaceCopperPasteSilkScreenFamilyNumber) }}</span>
+ </td>
+ <td class="label">鐩暟</td>
+ <td colspan="2">
+ <el-input v-if="props.isEdit" v-model="formData.otherData.surfaceCopperPasteNumberOfEyes" placeholder="璇疯緭鍏�"/>
+ <span v-else class="view-value">{{ displayValue(formData.otherData.surfaceCopperPasteNumberOfEyes) }}</span>
+ </td>
+ <td class="label">浣滀笟鍛�</td>
+ <td colspan="2">
+ <el-select v-model="formData.otherData.surfaceCopperPasteUserId"
+ v-if="props.isEdit"
+ style="width: 100%"
+ placeholder="璇烽�夋嫨浣滀笟鍛�"
+ clearable
+ filterable
+ @change="handleUserChange($event, 'surfaceCopperPasteUserId')">
+ <el-option v-for="user in userOptions"
+ :key="user.userId"
+ :label="user.userName"
+ :value="user.userId"/>
+ </el-select>
+ <span v-else class="view-value">{{ displayValue(formData.otherData.surfaceCopperPasteUserName || formData.otherData.surfaceCopperPasteUserId) }}</span>
+ </td>
+ <td class="label" colspan="2">鐑樺共娓╁害</td>
+ <td colspan="2">
+ <el-input v-if="props.isEdit" v-model="formData.otherData.surfaceCopperPasteDryingTemperature" placeholder="璇疯緭鍏�"/>
+ <span v-else class="view-value">{{ displayValue(formData.otherData.surfaceCopperPasteDryingTemperature) }}</span>
+ </td>
+ </tr>
+ <tr>
+ <td class="label" colspan="2">鐑ч挗鏃ユ湡</td>
+ <td colspan="2">
+ <el-date-picker
+ v-if="props.isEdit"
+ v-model="formData.otherData.steelBurningDate"
+ type="date"
+ value-format="YYYY-MM-DD"
+ format="YYYY-MM-DD"
+ placeholder="璇烽�夋嫨"
+ style="width: 100%"
+ />
+ <span v-else class="view-value">{{ displayValue(formData.otherData.steelBurningDate) }}</span>
+ </td>
+ <td class="label" colspan="3">鐑ч摐杩涚倝鏃堕棿</td>
+ <td colspan="2">
+ <el-date-picker
+ v-if="props.isEdit"
+ v-model="formData.otherData.copperFiringTime"
+ type="datetime"
+ value-format="YYYY-MM-DD HH:mm:ss"
+ format="YYYY-MM-DD HH:mm:ss"
+ placeholder="璇烽�夋嫨"
+ style="width: 100%"
+ />
+ <span v-else class="view-value">{{ displayValue(formData.otherData.copperFiringTime) }}</span>
+ </td>
+ <td class="label">鐑ч挗鍑虹倝鏃堕棿</td>
+ <td colspan="2">
+ <el-date-picker
+ v-if="props.isEdit"
+ v-model="formData.otherData.steelFiringTime"
+ type="datetime"
+ value-format="YYYY-MM-DD HH:mm:ss"
+ format="YYYY-MM-DD HH:mm:ss"
+ placeholder="璇烽�夋嫨"
+ style="width: 100%"
+ />
+ <span v-else class="view-value">{{ displayValue(formData.otherData.steelFiringTime) }}</span>
+ </td>
+ <td class="label" colspan="3">鐑ч摐浜у嚭婵�</td>
+ <td colspan="2">
+ <el-input v-if="props.isEdit" v-model="formData.quantity" placeholder="璇疯緭鍏�"/>
+ <span v-else class="view-value">{{ displayValue(formData.quantity) }}</span>
+ </td>
+ <td class="label" colspan="2">閲嶉噺(kg/pos)</td>
+ <td colspan="2">
+ <el-input v-if="props.isEdit" v-model="formData.otherData.weight" placeholder="璇疯緭鍏�"/>
+ <span v-else class="view-value">{{ displayValue(formData.otherData.weight) }}</span>
+ </td>
+ </tr>
+ <tr>
+ <td class="label" colspan="2">鐑ч摐娓╁害鏇茬嚎</td>
+ <td colspan="7">
+ <el-input
+ v-if="props.isEdit"
+ v-model="formData.otherData.copperSmeltingTemperatureProfile"
+ type="textarea"
+ :rows="3"
+ placeholder="璇疯緭鍏�"
+ />
+ <span v-else class="view-value">{{ displayValue(formData.otherData.copperSmeltingTemperatureProfile) }}</span>
+ </td>
+ <td class="label">澶囨敞</td>
+ <td colspan="11">
+ <el-input v-if="props.isEdit" v-model="formData.otherData.remark" type="textarea" :rows="3" placeholder="璇疯緭鍏�"/>
+ <span v-else class="view-value">{{ displayValue(formData.otherData.remark) }}</span>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </el-form>
+ <template #footer>
+ <span class="dialog-footer">
+ <el-button v-if="props.isEdit" type="primary"
+ @click="handleReport">纭畾</el-button>
+ <el-button @click="visible = false">{{ props.isEdit ? "鍙栨秷" : "鍏抽棴" }}</el-button>
+ </span>
+ </template>
+ </el-dialog>
+</template>
+
+<style scoped>
+.report-table {
+ width: 100%;
+ border-collapse: collapse;
+ table-layout: fixed;
+ font-size: 13px;
+}
+
+.report-table td {
+ border: 1px solid #dcdfe6;
+ padding: 6px;
+ vertical-align: middle;
+}
+
+.report-table .label {
+ width: 90px;
+ background: #f5f7fa;
+ text-align: center;
+ font-weight: 500;
+}
+
+.report-table .tip {
+ text-align: center;
+ font-weight: 500;
+ line-height: 1.4;
+ background: #fafafa;
+}
+
+.view-value {
+ display: inline-block;
+ min-height: 32px;
+ line-height: 32px;
+}
+</style>
--
Gitblit v1.9.3