|
@@ -20,7 +20,7 @@
|
|
|
</template>
|
|
|
</byTable>
|
|
|
</div>
|
|
|
- <el-dialog z-index="100" :title="modalType == 'add' ? '新增' : '编辑'" v-model="dialogVisible" width="800" v-loading="loading">
|
|
|
+ <el-dialog z-index="100" :title="modalType == 'add' ? '新增' : '编辑'" v-model="dialogVisible" width="80%" v-loading="loading">
|
|
|
<byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="byform">
|
|
|
<template #coverUrl>
|
|
|
<el-row style="width: 100%">
|
|
@@ -97,7 +97,7 @@
|
|
|
<el-select
|
|
|
v-model="formData.data.categoryId"
|
|
|
placeholder="请选择产品类目"
|
|
|
- @change="(val) => getSubCategoryList(val)"
|
|
|
+ @change="(val) => getSubCategoryList(val, true)"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in productCategoryList"
|
|
@@ -131,6 +131,7 @@ const specDict = ref([]);
|
|
|
const enableStatus = ref([]);
|
|
|
const productCategoryList = ref([]);
|
|
|
const productSubCategoryList = ref([]);
|
|
|
+const productSubCategoryALLList = ref([]);
|
|
|
const contentType = ref([]);
|
|
|
const sourceList = ref({
|
|
|
data: [],
|
|
@@ -176,7 +177,7 @@ const config = computed(() => {
|
|
|
|
|
|
},
|
|
|
render(val) {
|
|
|
- return proxy.dictValueLabel(val, productSubCategoryList.value);
|
|
|
+ return proxy.dictValueLabel(val, productSubCategoryALLList.value);
|
|
|
},
|
|
|
},
|
|
|
{
|
|
@@ -435,6 +436,7 @@ const getDetail = (row) => {
|
|
|
formData.data.coverUrlList = resFile1.data[res.id];
|
|
|
dialogVisible.value = true;
|
|
|
});
|
|
|
+ getSubCategoryList(res.categoryId, false);
|
|
|
});
|
|
|
};
|
|
|
|
|
@@ -498,16 +500,16 @@ const getDictlist = async () => {
|
|
|
value: x.id,
|
|
|
}));
|
|
|
});
|
|
|
- // proxy.post("/productSubCategory/page", {
|
|
|
- // pageNum: 1,
|
|
|
- // pageSize: 99999,
|
|
|
- // status: 1,
|
|
|
- // }).then((res) => {
|
|
|
- // productSubCategoryList.value = res.rows.map((x) => ({
|
|
|
- // label: x.name,
|
|
|
- // value: x.id,
|
|
|
- // }));
|
|
|
- // });
|
|
|
+ proxy.post("/productSubCategory/page", {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 99999,
|
|
|
+ status: 1,
|
|
|
+ }).then((res) => {
|
|
|
+ productSubCategoryALLList.value = res.rows.map((x) => ({
|
|
|
+ label: x.name,
|
|
|
+ value: x.id,
|
|
|
+ }));
|
|
|
+ });
|
|
|
};
|
|
|
|
|
|
|
|
@@ -558,7 +560,10 @@ const coverUrlSuccess = (response, uploadFile) => {
|
|
|
];
|
|
|
};
|
|
|
|
|
|
-const getSubCategoryList = (val) => {
|
|
|
+const getSubCategoryList = (val, isClean) => {
|
|
|
+ if(isClean){
|
|
|
+ formData.data.subCategoryId = "";
|
|
|
+ }
|
|
|
productSubCategoryList.value = [];
|
|
|
proxy.post("/productSubCategory/page", {
|
|
|
pageNum: 1,
|