修改敏感元器件

This commit is contained in:
GGJ
2024-12-06 16:30:16 +08:00
parent 366f561aa5
commit 7255c3ea90

View File

@@ -4,32 +4,18 @@
<el-form label-width='auto' :inline='true'>
<el-form-item label='生产线'>
<el-select v-model='form.productLineId'>
<el-option
v-for='item in productLineOptions'
:key='item.id'
:label='item.name'
:value='item.id'
/>
<el-option v-for='item in productLineOptions' :key='item.id' :label='item.name'
:value='item.id' />
</el-select>
</el-form-item>
<el-form-item label='终端'>
<el-select v-model='form.machineId' placeholder='暂无终端'>
<el-option
v-for='item in machineOptions'
:key='item.id'
:label='item.name'
:value='item.id'
/>
<el-option v-for='item in machineOptions' :key='item.id' :label='item.name' :value='item.id' />
</el-select>
</el-form-item>
<el-form-item label='敏感元器件'>
<el-select v-model='form.unitId' placeholder='暂无元器件'>
<el-option
v-for='item in unitOptions'
:key='item.id'
:label='item.name'
:value='item.id'
/>
<el-select v-model='form.unitId' placeholder='暂无元器件' @change="changeUnit" clearable>
<el-option v-for='item in unitOptions' :key='item.id' :label='item.name' :value='item.id' />
</el-select>
</el-form-item>
</el-form>
@@ -153,8 +139,9 @@ const search = async (id: string, beginTime: string, endTime: string) => {
unitOptions.value = res.data
if (unitOptions.value.length > 0) {
form.unitId = unitOptions.value[0].id
unit.value = unitOptions.value[0]
unit.value = JSON.parse(JSON.stringify(unitOptions.value[0]))
}
})
const data = {
@@ -168,6 +155,13 @@ const search = async (id: string, beginTime: string, endTime: string) => {
reDrawPic()
})
}
const changeUnit = (id: any) => {
if (id == undefined) return
let list = unitOptions.value.filter((item: any) => item.id == id)
unit.value = JSON.parse(JSON.stringify(list[0]))
reDrawPic()
}
const options = ref()