前端最新版本同步
This commit is contained in:
@@ -32,7 +32,7 @@
|
||||
<PopoverList @search="handleSearch" :width="800" :modelValue="scope.row.name">
|
||||
<template #popover-content="{}">
|
||||
<DeviceList
|
||||
v-if="scope.row.type == '2'"
|
||||
v-if="scope.row.type == '2' || props.tab == 2 "
|
||||
@selectRow="(row) => selectRow(row, scope.$index)"
|
||||
:searchKey="searchKey"
|
||||
/>
|
||||
@@ -58,6 +58,26 @@
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单位" align="center" prop="unitCode_dictText" width="100">
|
||||
<template #default="scope">
|
||||
<span v-if="!scope.row.isEdit">{{ scope.row.unitCode_dictText }}</span>
|
||||
<el-form-item
|
||||
v-else
|
||||
:prop="`consumablesList.${scope.$index}.unitCode`"
|
||||
:rules="rules.unitCode"
|
||||
>
|
||||
<el-select v-model="scope.row.unitCode" placeholder="">
|
||||
<el-option
|
||||
v-for="(item, index) in scope.row.unitCodeList"
|
||||
@click="handleUnitCodeClick(item)"
|
||||
:key="index"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="使用范围" align="center" prop="rangeCode" width="150">
|
||||
<template #default="scope">
|
||||
<span v-if="!scope.row.isEdit">{{ scope.row.rangeCode_dictText }}</span>
|
||||
@@ -70,7 +90,7 @@
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="范围" align="center" prop="rangeCode" width="250">
|
||||
<!-- <el-table-column label="范围" align="center" prop="rangeCode" width="250">
|
||||
<template #default="scope">
|
||||
<span v-if="!scope.row.isEdit">{{ scope.row.rangeCode_dictText }}</span>
|
||||
<el-form-item
|
||||
@@ -88,7 +108,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="启用状态" align="center" prop="statusEnum" width="250">
|
||||
<template #default="scope">
|
||||
<span v-if="!scope.row.isEdit">{{ scope.row.statusEnum_dictText }}</span>
|
||||
@@ -208,6 +228,8 @@ watch(
|
||||
quantity: item.quantity,
|
||||
rangeCode: item.rangeCode,
|
||||
rangeCode_dictText: item.rangeCode_dictText,
|
||||
unitCode: item.unitCode,
|
||||
unitCode_dictText: item.unitCode_dictText,
|
||||
statusEnum: item.statusEnum,
|
||||
statusEnum_dictText: item.statusEnum_enumText,
|
||||
typeCode: item.typeCode,
|
||||
@@ -259,8 +281,9 @@ function handleSave(row, index) {
|
||||
itemNo: props.bindInfo.id,
|
||||
devActId: row.devActId,
|
||||
typeCode: props.bindInfo.typeCode,
|
||||
rangeCode: row.rangeCode,
|
||||
rangeCode: '3',
|
||||
quantity: row.quantity,
|
||||
unitCode: row.unitCode,
|
||||
statusEnum: row.statusEnum,
|
||||
id: row.id ? row.id : undefined,
|
||||
devActTable: row.type == '1' ? 'wor_activity_definition' : 'adm_device_definition',
|
||||
@@ -298,6 +321,10 @@ function initOptions() {
|
||||
});
|
||||
}
|
||||
|
||||
function handleUnitCodeClick(row, item) {
|
||||
row.unitCode_dictText = item.label;
|
||||
}
|
||||
|
||||
function handleSearch(value) {
|
||||
searchKey.value = value;
|
||||
}
|
||||
@@ -306,6 +333,16 @@ initOptions();
|
||||
function selectRow(row, index) {
|
||||
form.consumablesList[index].devActId = row.id;
|
||||
form.consumablesList[index].name = row.name;
|
||||
if (row.minUnitCode == row.unitCode) {
|
||||
form.consumablesList[index].unitCodeList = [
|
||||
{ label: row.unitCode_dictText, value: row.unitCode },
|
||||
];
|
||||
} else {
|
||||
form.consumablesList[index].unitCodeList = [
|
||||
{ label: row.unitCode_dictText, value: row.unitCode },
|
||||
{ label: row.minUnitCode_dictText, value: row.minUnitCode },
|
||||
];
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user