| | |
| | | style="width: 90px" @change="m => subOtherForm(m, 'temperature')"></el-input> |
| | | <span class="template-panel__unit">℃</span> |
| | | </el-form-item> |
| | | <el-form-item label="湿度:"> |
| | | <el-input v-model="currentOtherForm.humidity" :disabled="state > 1" placeholder="" size="small" |
| | | style="width: 90px" @change="m => subOtherForm(m, 'humidity')"></el-input> |
| | | <span class="template-panel__unit">%RH</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" |
| | |
| | | numOptions: [], |
| | | temperatureOptions: [], |
| | | wareTableData: [], |
| | | // 检测条件按模板 id 分组:{ [templateId]: { temperature, humidity, detectionTime, detectionPlace, deviceIds } } |
| | | // 检测条件按模板 id 分组:{ [templateId]: { temperature, detectionTime, detectionPlace, deviceIds } } |
| | | otherForm: {}, |
| | | deviceOptions: [], |
| | | equipForm: { |
| | |
| | | currentOtherForm() { |
| | | return this.otherForm[this.currentTable] || { |
| | | temperature: null, |
| | | humidity: null, |
| | | detectionTime: null, |
| | | detectionPlace: null, |
| | | deviceIds: [], |
| | |
| | | conditionList.forEach(item => { |
| | | this.$set(this.otherForm, item.templateId, { |
| | | temperature: item.temperature != null ? item.temperature : null, |
| | | humidity: item.humidity != null ? item.humidity : null, |
| | | detectionTime: item.detectionTime != null ? item.detectionTime : null, |
| | | detectionPlace: item.detectionPlace != null ? item.detectionPlace : null, |
| | | deviceIds: Array.isArray(item.deviceIds) ? [...item.deviceIds] : [], |
| | |
| | | if (this.tableLists && this.tableLists.length > 0) { |
| | | this.tableList = null; |
| | | this.tableList = this.tableLists.filter(m => m.templateId == val1) |
| | | // 模板集合可能变化,补齐温度、湿度槽位 |
| | | // 模板集合可能变化,补齐温度槽位 |
| | | this.tableLists.forEach(m => this.ensureOtherForm(m.templateId)) |
| | | // 对模板进行处理 |
| | | this.handleTableData() |
| | |
| | | this.tableList = null; |
| | | this.tableList = [this.tableLists[0]] |
| | | this.currentTable = this.tableLists[0].templateId; |
| | | // 补齐每个模板的温度、湿度槽位 |
| | | // 补齐每个模板的温度槽位 |
| | | this.tableLists.forEach(m => this.ensureOtherForm(m.templateId)) |
| | | // 处理页面列表数据 |
| | | this.handleTableData() |
| | |
| | | this.tableList = [this.tableLists[0]] |
| | | this.currentTable = this.tableLists[0].templateId; |
| | | this.currentSample.insProduct = this.HaveJson(list) |
| | | // 补齐每个模板的温度、湿度槽位 |
| | | // 补齐每个模板的温度槽位 |
| | | this.tableLists.forEach(m => this.ensureOtherForm(m.templateId)) |
| | | // 处理页面列表数据 |
| | | this.handleTableData() |
| | |
| | | if (!this.otherForm[templateId]) { |
| | | this.$set(this.otherForm, templateId, { |
| | | temperature: null, |
| | | humidity: null, |
| | | detectionTime: null, |
| | | detectionPlace: null, |
| | | deviceIds: [], |
| | |
| | | this.tableLists.forEach(m => { |
| | | const form = this.otherForm[m.templateId] || {} |
| | | if (!form.temperature) missing.push(`请填写「${m.templateName}」的温度`) |
| | | if (!form.humidity) missing.push(`请填写「${m.templateName}」的湿度`) |
| | | if (!form.detectionTime) missing.push(`请选择「${m.templateName}」的检测时间`) |
| | | if (!form.detectionPlace) missing.push(`请填写「${m.templateName}」的检测地点`) |
| | | if (!form.deviceIds || form.deviceIds.length === 0) { |