| | |
| | | @click="openProducerPicker" |
| | | suffix-icon="arrow-down" /> |
| | | </u-form-item> |
| | | <!-- 使用设备 --> |
| | | <u-form-item label="使用设备" |
| | | prop="deviceId"> |
| | | <u-input v-model="form.deviceName" |
| | | placeholder="请选择使用设备(选填)" |
| | | readonly |
| | | @click="openDevicePicker" |
| | | suffix-icon="arrow-down" /> |
| | | </u-form-item> |
| | | <!-- 工时 --> |
| | | <u-form-item label="工时" |
| | | v-if="form.type == 0" |
| | |
| | | title="选择生产人" |
| | | @select="onProducerConfirm" |
| | | @close="showProducerPicker = false" /> |
| | | <!-- 使用设备选择器 --> |
| | | <up-action-sheet :show="showDevicePicker" |
| | | :actions="deviceList" |
| | | title="选择使用设备" |
| | | @select="onDeviceConfirm" |
| | | @close="showDevicePicker = false" /> |
| | | <!-- 参数选择器 --> |
| | | <up-action-sheet :show="showParamSelect" |
| | | :actions="paramOptions" |
| | |
| | | }); |
| | | }; |
| | | import { addProductMain } from "@/api/productionManagement/productionReporting"; |
| | | import { getDeviceLedger } from "@/api/equipmentManagement/ledger"; |
| | | import { getInfo } from "@/api/login"; |
| | | import { userListNoPageByTenantId } from "@/api/system/user"; |
| | | import { |
| | |
| | | workHour: 0, |
| | | type: null, |
| | | paramGroups: {}, |
| | | deviceId: "", |
| | | deviceName: "", |
| | | }); |
| | | |
| | | const showProducerPicker = ref(false); |
| | | const producerList = ref([]); |
| | | |
| | | // 使用设备选择 |
| | | const showDevicePicker = ref(false); |
| | | const deviceList = ref([]); |
| | | |
| | | const openDevicePicker = async () => { |
| | | if (deviceList.value.length === 0) { |
| | | try { |
| | | const { data } = await getDeviceLedger(); |
| | | const rows = Array.isArray(data) ? data : data?.records || []; |
| | | deviceList.value = rows.map(item => ({ |
| | | name: item.deviceName || item.name || "-", |
| | | value: item.id, |
| | | })); |
| | | } catch (error) { |
| | | console.error("加载设备列表失败:", error); |
| | | return; |
| | | } |
| | | } |
| | | showDevicePicker.value = true; |
| | | }; |
| | | |
| | | const onDeviceConfirm = e => { |
| | | form.value.deviceId = e.value; |
| | | form.value.deviceName = e.name; |
| | | showDevicePicker.value = false; |
| | | }; |
| | | |
| | | const params = ref([]); |
| | | const dictOptions = ref({}); |
| | |
| | | form.value.productionOrderRoutingOperationId, |
| | | productionOrderId: form.value.productionOrderId, |
| | | workHour: form.value.workHour, |
| | | deviceId: form.value.deviceId || undefined, |
| | | productionOperationParamList: productionOperationParamList, |
| | | }; |
| | | |