xiaohaizhao 1 год назад
Родитель
Сommit
01326e3c4c

+ 16 - 6
src/WebsiteManagement/marketproductMag/modules/detail.vue

@@ -56,9 +56,14 @@
           <el-descriptions-item :label="$t(`商品名称`)">{{
             detailInfo.itemname
           }}</el-descriptions-item>
-          <el-descriptions-item :label="$t('分类')">{{
-            detailInfo.class
-          }}</el-descriptions-item>
+          <el-descriptions-item :label="$t('分类')">
+            <span v-if="detailInfo.class && detailInfo.classmx">
+              {{ $t(detailInfo.class) + " / " + $t(detailInfo.classmx) }}
+            </span>
+            <span v-else>
+              {{ $t(detailInfo.class || detailInfo.classmx || "--") }}
+            </span>
+          </el-descriptions-item>
           <el-descriptions-item :label="$t('状态')">
             <span
               :style="[
@@ -85,7 +90,12 @@
         <div class="content_style">
           <div ref="contentstr" class="fwb"></div>
         </div>
-        <p v-if="dialogFormVisible && detailInfo.attinfos.length" style="font-size: 14px; margin-top: 20px">{{ $t("产品资料") }}</p>
+        <p
+          v-if="dialogFormVisible && detailInfo.attinfos.length"
+          style="font-size: 14px; margin-top: 20px"
+        >
+          {{ $t("产品资料") }}
+        </p>
         <FileItem
           :itemStyle="itemStyle"
           v-if="dialogFormVisible"
@@ -132,11 +142,11 @@ export default {
         },
       });
       this.detailInfo = res.data;
-      setTimeout(()=>{
+      setTimeout(() => {
         this.$refs.technicalparam.innerHTML = res.data.technicalparam;
         this.$refs.materialdescription.innerHTML = res.data.materialdescription;
         this.$refs.contentstr.innerHTML = res.data.content;
-      },500)
+      }, 500);
     },
     async statusChange() {
       const res = await this.$api.requested({

+ 13 - 12
src/WebsiteManagement/marketproductMag/modules/edit.vue

@@ -86,7 +86,7 @@
                   ref="selectdep"
                   size="small"
                   style="width: 100%"
-                  :placeholder="$t('分类')"
+                  :placeholder="$t(form.class || '分类')"
                   v-model="form.classmx"
                   :options="classData"
                   filterable
@@ -206,15 +206,17 @@ export default {
       this.$refs.materialdescription.innerHTML = this.form.materialdescription;
     if (this.$refs.contentstr)
       this.$refs.contentstr.innerHTML = this.form.contentstr;
-    if (!this.$refs.upload.filelist.length)
-      this.$refs.upload.filelist = this.fileType
-        .fileList(this.data.attinfos)
-        .map((v) => {
-          v.progress = 100;
-          v.type = v.postfix;
-          v.uid = v.attachmentid;
-          return v;
-        });
+    try {
+      if (!this.$refs.upload.filelist.length)
+        this.$refs.upload.filelist = this.fileType
+          .fileList(this.data.attinfos)
+          .map((v) => {
+            v.progress = 100;
+            v.type = v.postfix;
+            v.uid = v.attachmentid;
+            return v;
+          });
+    } catch (error) {}
   },
   methods: {
     oploadIng(e) {
@@ -234,10 +236,9 @@ export default {
       } else {
         this.dialogFormVisible = true;
         this.form = res.data;
+        console.log("this.form",this.form)
         this.form.contentstr = res.data.content;
         this.form.isonsale = res.data.isonsale == 1 ? "1" : "0";
-        console.log(this.$refs);
-        console.log(this.$refs.technicalparam);
         /*this.$refs.technicalparam.innerHTML = res.data.technicalparam;
         this.$refs.materialdescription.innerHTML = res.data.materialdescription;
         this.$refs.contentstr.innerHTML = res.data.contentstr;*/