| | |
| | | <span class="template-panel__unit">℃</span> |
| | | </el-form-item> |
| | | <el-form-item label="检测时间:"> |
| | | <el-date-picker v-model="currentOtherForm.detectionTime" :disabled="state > 1" type="date" |
| | | value-format="YYYY-MM-DD" placeholder="请选择日期" size="small" style="width: 160px" |
| | | @change="m => subOtherForm(m, 'detectionTime')"></el-date-picker> |
| | | <el-date-picker v-model="currentOtherForm.detectionTimeRange" :disabled="state > 1" type="daterange" |
| | | value-format="YYYY-MM-DD" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" size="small" style="width: 260px" |
| | | @change="m => subOtherForm(m, 'detectionTimeRange')"></el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item label="检测地点:"> |
| | | <el-input v-model="currentOtherForm.detectionPlace" :disabled="state > 1" clearable |
| | |
| | | <script> |
| | | // Vue3 没有 this.$createElement(下面用 h 造 VNode 当 $msgbox 的 message) |
| | | import { h } from 'vue' |
| | | import { readDetectionTimeRange, isCompleteDetectionTimeRange, toDetectionTimePayload } from '@/utils/detectionTimeRange' |
| | | import excelFunction from '@/utils/excelFountion' |
| | | import UnPassDialog from "@/views/business/unpass/components/unPassDialog.vue"; |
| | | import AddUnPass from "@/views/business/unpass/components/addUnPass.vue"; |
| | |
| | | numOptions: [], |
| | | temperatureOptions: [], |
| | | wareTableData: [], |
| | | // 检测条件按模板 id 分组:{ [templateId]: { temperature, detectionTime, detectionPlace, deviceIds } } |
| | | // 检测条件按模板 id 分组:{ [templateId]: { temperature, detectionTimeRange, detectionPlace, deviceIds } } |
| | | otherForm: {}, |
| | | deviceOptions: [], |
| | | equipForm: { |
| | |
| | | currentOtherForm() { |
| | | return this.otherForm[this.currentTable] || { |
| | | temperature: null, |
| | | detectionTime: null, |
| | | detectionTimeRange: null, |
| | | detectionPlace: null, |
| | | deviceIds: [], |
| | | insResult: null |
| | |
| | | conditionList.forEach(item => { |
| | | this.otherForm[item.templateId] = { |
| | | temperature: item.temperature != null ? item.temperature : null, |
| | | detectionTime: item.detectionTime != null ? item.detectionTime : null, |
| | | detectionTimeRange: readDetectionTimeRange(item), |
| | | detectionPlace: item.detectionPlace != null ? item.detectionPlace : null, |
| | | deviceIds: Array.isArray(item.deviceIds) ? [...item.deviceIds] : [], |
| | | insResult: item.insResult != null ? item.insResult : null |
| | |
| | | if (!this.otherForm[templateId]) { |
| | | this.otherForm[templateId] = { |
| | | temperature: null, |
| | | detectionTime: null, |
| | | detectionTimeRange: null, |
| | | detectionPlace: null, |
| | | deviceIds: [], |
| | | insResult: null |
| | |
| | | } |
| | | if (type === 'deviceIds') { |
| | | payload.deviceIds = Array.isArray(m) ? [...m] : [] |
| | | } else if (type === 'detectionTime' || type === 'detectionPlace') { |
| | | } else if (type === 'detectionTimeRange') { |
| | | Object.assign(payload, toDetectionTimePayload(m)) |
| | | } else if (type === 'detectionPlace') { |
| | | payload[type] = m === '' || m == null ? null : m |
| | | } else { |
| | | payload[type] = Number(m) |
| | |
| | | this.tableLists.forEach(m => { |
| | | const form = this.otherForm[m.templateId] || {} |
| | | if (!form.temperature) missing.push(`请填写「${m.templateName}」的温度`) |
| | | if (!form.detectionTime) missing.push(`请选择「${m.templateName}」的检测时间`) |
| | | if (!isCompleteDetectionTimeRange(form.detectionTimeRange)) missing.push(`请选择「${m.templateName}」的检测时间`) |
| | | if (!form.detectionPlace) missing.push(`请填写「${m.templateName}」的检测地点`) |
| | | if (!form.deviceIds || form.deviceIds.length === 0) { |
| | | missing.push(`请选择「${m.templateName}」的设备`) |