|
@@ -28,9 +28,19 @@
|
|
|
placeholder="示范:手持吸尘器、翡翠吊坠"
|
|
|
v-model="formData.description"/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="类别">
|
|
|
+ <el-form-item v-if="formData.product == 'jewelry'" label="类别">
|
|
|
<el-select class="wid100" style="width:200px" v-model="formData.category" filterable clearable
|
|
|
- :multiple="formData.product == 'jewelry'" placeholder="请选择">
|
|
|
+ multiple placeholder="请选择">
|
|
|
+ <el-option
|
|
|
+ v-for="item in categoryListOther"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"/>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item v-if="formData.product != 'jewelry'" label="类别">
|
|
|
+ <el-select class="wid100" style="width:200px" v-model="formData.category" filterable clearable
|
|
|
+ placeholder="请选择">
|
|
|
<el-option
|
|
|
v-for="item in categoryList"
|
|
|
:key="item.value"
|
|
@@ -38,6 +48,7 @@
|
|
|
:value="item.value"/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
+
|
|
|
<template v-if="formData.product == 'jewelry'">
|
|
|
<el-row :gutter="20">
|
|
|
<el-col :span="8">
|
|
@@ -240,7 +251,8 @@ const rainGroup = ref([
|
|
|
{label: '4096:4096', value: 2},
|
|
|
{label: '1636:1536', value: 3},
|
|
|
])
|
|
|
-let categoryList = ref(typeList)
|
|
|
+let categoryList = ref()
|
|
|
+let categoryListOther = ref(typeList)
|
|
|
let formData = ref({
|
|
|
product: 'jewelry',
|
|
|
description: '',
|
|
@@ -264,8 +276,9 @@ function getTypeName() {
|
|
|
}
|
|
|
|
|
|
function setData(type) {
|
|
|
+ categoryList.value = []
|
|
|
if (type === 'jewelry') { // 珠宝
|
|
|
- categoryList.value = typeList
|
|
|
+ // categoryList.value = typeList
|
|
|
} else if (type === 'electricRiceCooker') { // 电饭煲
|
|
|
categoryList.value = electricRiceCooker
|
|
|
} else if (type === 'refrigerator') { // 冰箱
|
|
@@ -279,6 +292,7 @@ function setData(type) {
|
|
|
} else {
|
|
|
categoryList.value = []
|
|
|
}
|
|
|
+ console.log(categoryList.value)
|
|
|
}
|
|
|
|
|
|
function onGetScalc(item) {
|
|
@@ -330,9 +344,13 @@ const creatTask = async () => {
|
|
|
creativity
|
|
|
}
|
|
|
if (product !== 'jewelry') {
|
|
|
- param.category = [category]
|
|
|
+ if (category) {
|
|
|
+ param.category = [category]
|
|
|
+ } else {
|
|
|
+ param.category = []
|
|
|
+ }
|
|
|
} else {
|
|
|
- console.log(param.category)
|
|
|
+ // console.log(param.category)
|
|
|
if (param.category === null || param.category === "") {
|
|
|
param.category = [];
|
|
|
}
|
|
@@ -358,6 +376,9 @@ watch(() => props.taskDetail, (newVal) => {
|
|
|
setData(newVal.task.product)
|
|
|
Object.assign(formData.value, newVal.task)
|
|
|
if (newVal.task.product != 'jewelry') {
|
|
|
+ if (newVal.task.category) {
|
|
|
+
|
|
|
+ }
|
|
|
formData.value.category = newVal.task.category.join('')
|
|
|
}
|
|
|
}
|