| | |
| | | placeholder="请输入保养项目" |
| | | clearable /> |
| | | </u-form-item> |
| | | <u-form-item label="附件图片" |
| | | prop="storageBlobDTOs" |
| | | border-bottom> |
| | | <CommonUpload v-model="form.storageBlobDTOs" /> |
| | | </u-form-item> |
| | | <!-- 提交按钮 --> |
| | | <view class="footer-btns"> |
| | | <u-button class="cancel-btn" |
| | |
| | | import { ref, computed, onMounted, onUnmounted } from "vue"; |
| | | import { onShow } from "@dcloudio/uni-app"; |
| | | import PageHeader from "@/components/PageHeader.vue"; |
| | | import CommonUpload from "@/components/CommonUpload.vue"; |
| | | import { getDeviceLedger } from "@/api/equipmentManagement/ledger"; |
| | | import { |
| | | addUpkeep, |
| | |
| | | maintenancePlanTime: dayjs().format("YYYY-MM-DD"), // 计划保养日期 |
| | | maintenancePerson: undefined, // 保养人 |
| | | machineryCategory: undefined, // 保养项目 |
| | | storageBlobDTOs: [], // 附件图片 |
| | | }); |
| | | |
| | | // 加载设备列表 |
| | |
| | | ); |
| | | form.value.maintenancePerson = data.maintenancePerson; |
| | | form.value.machineryCategory = data.machineryCategory; |
| | | form.value.storageBlobDTOs = data.storageBlobVOs || []; |
| | | // 设置设备名称显示 |
| | | const device = deviceOptions.value.find( |
| | | item => item.id === data.deviceLedgerId |
| | |
| | | |
| | | // 扫描二维码功能 |
| | | const startScan = () => { |
| | | processScanResult(""); |
| | | return; |
| | | if (isScanning.value) { |
| | | showToast("正在扫描中,请稍候..."); |
| | | return; |
| | |
| | | // 处理扫码结果并匹配设备 |
| | | const processScanResult = scanResult => { |
| | | const deviceId = getDeviceIdByRegExp(scanResult); |
| | | const matchedDevice = deviceOptions.value.find(item => item.id == deviceId); |
| | | const matchedDevice = deviceOptions.value.find(item => item.id == 4); |
| | | |
| | | if (matchedDevice) { |
| | | // 找到匹配的设备,自动填充 |
| | |
| | | const id = getPageId(); |
| | | |
| | | // 准备提交数据 |
| | | const submitData = { ...form.value }; |
| | | const submitData = { ...form.value, status: 0 }; |
| | | |
| | | // 确保日期格式正确 |
| | | if ( |
| | | submitData.maintenancePlanTime && |