Procházet zdrojové kódy

添加商品时新增可添加商家信息

DELL před 3 roky
rodič
revize
5156440a13
1 změnil soubory, kde provedl 22 přidání a 5 odebrání
  1. 22 5
      src/views/business/goods/add.vue

+ 22 - 5
src/views/business/goods/add.vue

@@ -11,7 +11,6 @@
         <el-col :span="23">
           <el-form-item label="商品主图:" prop="picUrl">
             <Upload v-model="mainPicUrl" :limit="10" />
-            <br>
             <div class="tip">第一张图片将作为商品列表图片,最多上传10张,多张图片之间可随意调整位置,支持jpg、png格式,推荐750*750px;</div>
           </el-form-item>
         </el-col>
@@ -30,7 +29,7 @@
       </el-row>
       <el-row :gutter="40" style="width: 500px">
         <el-col :span="23">
-          <el-form-item label="商品分类" prop="categoryId">
+          <el-form-item label="商品分类:" prop="categoryId">
             <el-select
               v-model="addData.categoryId"
               placeholder="请选择商品分类"
@@ -43,7 +42,7 @@
       </el-row>
        <el-row :gutter="40" style="width: 500px">
         <el-col :span="23">
-          <el-form-item label="商品标签">
+          <el-form-item label="商品标签:">
             <el-select
               v-model="addData.tagIds"
               placeholder="请选择商品标签"
@@ -54,6 +53,12 @@
             </el-select>
           </el-form-item>
         </el-col>
+         <el-col :span="23">
+           <el-form-item label="商家信息:">
+             <Upload v-model="MerchantInformation" :limit="10" />
+             <div class="tip">上传商家营业执照</div>
+           </el-form-item>
+         </el-col>
       </el-row>
       <el-divider content-position="left">价格库存</el-divider>
       <el-row>
@@ -188,6 +193,18 @@ export default {
       set(val) {
         this.$set(this.addData, 'picUrl', val.map(item => { return item.fileName }).toString())
       }
+    },
+    MerchantInformation:{
+      get() {
+        return this.addData.merchantInfo ? this.addData.merchantInfo.split(',').map(item => {
+          return {
+            fileName: item
+          }
+        }) : []
+      },
+      set(val) {
+        this.$set(this.addData, 'merchantInfo', val.map(item => { return item.fileName }).toString())
+      }
     }
   },
   created() {
@@ -195,11 +212,11 @@ export default {
     this.getGoodsTagItems()
     if (this.id) {
       getGoodsDetail(this.id).then(res => {
-        const { goodsId, title, picUrl, exchangeShow, multiSku, value, exchangePrice, cost, quantity, description, skuList, categoryId, tagIds } = res.data
+        const { goodsId, title, picUrl,merchantInfo, exchangeShow, multiSku, value, exchangePrice, cost, quantity, description, skuList, categoryId, tagIds } = res.data
         this.addData = {
           value: accDiv(value, 100),
           cost: cost == '' || cost == null ? '' : accDiv(cost, 100),
-          goodsId, title, picUrl, exchangeShow, multiSku, exchangePrice, quantity, description, skuList, categoryId, tagIds
+          goodsId, title, picUrl,merchantInfo, exchangeShow, multiSku, exchangePrice, quantity, description, skuList, categoryId, tagIds
         }
         if(description) {
           this.$refs.editor.setContent(description)