|
@@ -113,7 +113,7 @@
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="子类型" prop="giftTypeChildId">
|
|
<el-form-item label="子类型" prop="giftTypeChildId">
|
|
|
- <el-select v-model="form.giftTypeChildId" placeholder="请选择" clearable filterable @change="onParentChildChange">
|
|
|
|
|
|
|
+ <el-select v-model="form.giftTypeChildId" placeholder="请选择" clearable filterable @visible-change="handleChildVisibleChange" @change="onParentChildChange">
|
|
|
<el-option v-for="item in itemOptionsChildList" :key="item.id" :label="item.label" :value="item.id" />
|
|
<el-option v-for="item in itemOptionsChildList" :key="item.id" :label="item.label" :value="item.id" />
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -379,6 +379,8 @@ const handleAdd = () => {
|
|
|
const handleUpdate = async (row?: ItemsVO) => {
|
|
const handleUpdate = async (row?: ItemsVO) => {
|
|
|
reset();
|
|
reset();
|
|
|
resetFormPrize();
|
|
resetFormPrize();
|
|
|
|
|
+ form.value.giftTypeParentId = null;
|
|
|
|
|
+ form.value.giftTypeParentId = null;
|
|
|
const _id = row?.id || ids.value[0];
|
|
const _id = row?.id || ids.value[0];
|
|
|
const res = await getItems(_id);
|
|
const res = await getItems(_id);
|
|
|
Object.assign(form.value, res.data);
|
|
Object.assign(form.value, res.data);
|
|
@@ -420,6 +422,9 @@ const handleUpdate = async (row?: ItemsVO) => {
|
|
|
if (form.value.giftTypeParentId) {
|
|
if (form.value.giftTypeParentId) {
|
|
|
await onParentChange(form.value.giftTypeParentId);
|
|
await onParentChange(form.value.giftTypeParentId);
|
|
|
}
|
|
}
|
|
|
|
|
+ if (form.value.giftTypeChildId) {
|
|
|
|
|
+ await onParentChildChange(form.value.giftTypeChildId);
|
|
|
|
|
+ }
|
|
|
dialog.visible = true;
|
|
dialog.visible = true;
|
|
|
dialog.title = '修改';
|
|
dialog.title = '修改';
|
|
|
};
|
|
};
|
|
@@ -721,6 +726,15 @@ const handleIsGiveAwayChange = (value: number) => {
|
|
|
form.value.giveStopTime = undefined;
|
|
form.value.giveStopTime = undefined;
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
+const handleChildVisibleChange = (visible: boolean) => {
|
|
|
|
|
+ if (visible && itemOptionsChildList.value.length === 1) {
|
|
|
|
|
+ const onlyItem = itemOptionsChildList.value[0];
|
|
|
|
|
+ if (form.value.giftTypeChildId !== onlyItem.id) {
|
|
|
|
|
+ form.value.giftTypeChildId = onlyItem.id;
|
|
|
|
|
+ nextTick(() => onParentChildChange(onlyItem.id));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
</script>
|
|
</script>
|
|
|
<style scoped>
|
|
<style scoped>
|
|
|
.upload-container {
|
|
.upload-container {
|