Browse Source

在线问答

1018653686@qq.com 1 year ago
parent
commit
a608c075db

+ 6 - 4
src/views/XMHJC/column/index.vue

@@ -355,11 +355,13 @@ const select = (_selection, row) => {
 };
 const submitForm = () => {
   byform.value.handleSubmit(() => {
-    if (!(formData.data.columnMenuSubList && formData.data.columnMenuSubList.length > 0)) {
-      // formData.data.columnMenuSubList = [];
+    if(formData.data.type == '1'){
+      if (!(formData.data.columnMenuSubList && formData.data.columnMenuSubList.length > 0)) {
+        // formData.data.columnMenuSubList = [];
 
-      ElMessage({message: "请填写子栏目",type: "error",});
-      return
+        ElMessage({message: "请填写子栏目",type: "error",});
+        return
+      }
     }
 
     if (formData.data.type == '2' &&

+ 19 - 14
src/views/XMHJC/product/info/index.vue

@@ -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,

+ 1 - 1
src/views/XMHJC/topic/content/replyList.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="replyList">111
+  <div class="replyList">
     <div class="content">
       <byTable
         :source="sourceList.data"