YY пре 2 година
родитељ
комит
4e4a5fdeca
2 измењених фајлова са 5 додато и 9 уклоњено
  1. 4 3
      src/components/salesParts/detail.vue
  2. 1 6
      src/views/platGroup/goods/detail.vue

+ 4 - 3
src/components/salesParts/detail.vue

@@ -44,8 +44,8 @@
           <el-col v-if="info.type == '4' || info.type == '5'">
             <el-col :span="24" v-for="(item, index) in list" :key="index">
               <el-col :span="24" class="goods bode">
-                <el-col :span="6" v-if="item.goods.file"><el-image :src="item.goods.file[0].url"></el-image></el-col>
-                <el-col :span="6" v-else-if="item.url"><el-image :src="item.url"></el-image></el-col>
+                <el-col :span="6" v-if="item.goods.file"><el-image class="image" :src="item.goods.file[0].url"></el-image></el-col>
+                <el-col :span="6" v-else-if="item.url"><el-image class="image" :src="item.url"></el-image></el-col>
                 <el-col :span="18">
                   <el-col :span="12">
                     <el-col>
@@ -221,7 +221,8 @@ export default {
         else if (res.data.type == '1' || res.data.type == '2' || res.data.type == '3') {
           if (res.data.transport) this.$set(this, `transport`, res.data.transport);
           // 图片
-          if (res.data.goods.goods.file) this.$set(this, `file`, res.data.goods.goods.file[0].url);
+          if (res.data.goods.file && res.data.goods.file.length != 0) this.$set(this, `file`, res.data.goods.file[0].url);
+          else if (res.data.goods.goods.file) this.$set(this, `file`, res.data.goods.goods.file[0].url);
           else this.$set(this, `file`, res.data.goods.url);
           // 商品
           this.$set(this, `goods`, res.data.goods.goods);

+ 1 - 6
src/views/platGroup/goods/detail.vue

@@ -16,7 +16,6 @@
                 placeholder="请选择商品名称"
                 :remote-method="querySearch"
                 :loading="loading"
-                
                 @change="handleSelect"
                 size="small"
                 style="width: 100%"
@@ -70,7 +69,6 @@ export default {
     };
   },
   created() {
-    // this.searchOthers();
     this.search();
   },
   methods: {
@@ -103,9 +101,7 @@ export default {
     // 选择-查询规格
     async handleSelect(value) {
       let res = await this.specQuery({ goods: value });
-      if (this.$checkRes(res)) {
-        this.$set(this, 'specList', res.data);
-      }
+      if (this.$checkRes(res)) this.$set(this, 'specList', res.data);
     },
     // 保存
     async toSave({ data }) {
@@ -115,7 +111,6 @@ export default {
       if (this.$checkRes(res)) {
         this.$message({ type: `success`, message: `维护信息成功` });
         this.toBack();
-        this.search();
       }
     },
     // 返回