caojunjie 1 год назад
Родитель
Сommit
2331f1546f

+ 64 - 1
src/views/tirePartsMall/basicData/listingManagement/index.vue

@@ -31,6 +31,9 @@
               <el-button :size="size" :type="type" :disabled="row.upAndDownShelves"
                 @click="$refs.crud.rowDel(row, index)">删除
               </el-button>
+                <el-button :size="size" :type="type" :disabled="row.upAndDownShelves"
+                           @click="annexOpen(row, index)">商城图片
+                </el-button>
               <el-tooltip :content="`${row.upAndDownShelves == 0 ? '上架' : '下架'}`" placement="top">
                 <el-switch style="margin-left: 10px" v-model="row.upAndDownShelves" @change="check(row)" :active-value="1"
                   :inactive-value="0">
@@ -156,6 +159,21 @@
         温馨提示 第一次导入时请先下载模板
       </p>
     </el-dialog>
+
+
+      <el-dialog
+          title="商城图片  (图片文件像素推荐700X700,有且只允许有一张主图,其余均为副图)"
+          :visible.sync="enclosure"
+          append-to-body
+          width="70%">
+          <c-upload :data="orderList" display basic deleteUrl="/api/blade-sales-part/productLaunchFiles/remove"
+                    :enumerationValue="160" />
+          <span slot="footer" class="dialog-footer">
+          <el-button @click="enclosure = false" size="small">取 消</el-button>
+          <el-button type="primary" @click="saveAnnex" size="small">保 存</el-button>
+        </span>
+      </el-dialog>
+
   </div>
 </template>
 
@@ -176,6 +194,11 @@ export default {
   name: "index",
   data() {
     return {
+        orderList:[],
+        enclosure:false,
+        dataId:0,
+        rowImg:[],
+
       data: [],
       sharedCompanyoptions: [],
       activeName: 'searchList',
@@ -269,7 +292,7 @@ export default {
         updateBtnText:'保存',
         searchMenuPosition: "right",
         align: "center",
-        menuWidth: 150,
+        menuWidth: 220,
         searchSpan: 8,
         searchIcon: true,
         searchIndex: 2,
@@ -457,6 +480,46 @@ export default {
     }
   },
   methods: {
+      //打开附件
+      annexOpen(row, index) {
+          this.dataId = index
+          this.rowImg = row
+          this.orderList = row.filesList?row.filesList:[];
+          for (let order of this.orderList) {
+              order.paymentType = order.typeFiles
+          }
+          this.enclosure = true
+      },
+      // 附件保存
+      saveAnnex() {
+          if (this.orderList.length > 0) {
+              // 循环把编辑状态变成保存状态
+              this.orderList.map((item)=>{
+                  if (item.$cellEdit == true) {
+                      item.$cellEdit = false
+                  } else {
+                      item.$cellEdit = true
+                  }
+              })
+              let flag = this.orderList.some(item => {
+                  return item.$version == '主图'
+              })
+              if (!flag) {
+                  this.$message.warning('请选择主图')
+                  return
+              }
+          }
+          this.rowImg.filesList = this.orderList;
+          submit({
+              ...this.rowImg
+          }).then(res=>{
+              this.$message.success("添加成功")
+              // this.onLoad(this.page, this.search)
+          })
+          this.enclosure = false
+      },
+
+
     derivation() {
       window.open(
         `/api/blade-sales-part/productLaunch/export-productLaunch?${this.website.tokenHeader

+ 62 - 1
src/views/tirePartsMall/basicData/shareListing/index.vue

@@ -25,6 +25,9 @@
             <template slot-scope="{type,size,row,index}" slot="menu">
               <el-button :size="size" :type="type" :disabled="row.upAndDownShelves" @click="$refs.crud.rowEdit(row, index)">编辑
               </el-button>
+                <el-button :size="size" :type="type" :disabled="row.upAndDownShelves"
+                           @click="annexOpen(row, index)">商城图片
+                </el-button>
               <el-tooltip :content="`${row.upAndDownShelves == 0?'上架':'下架'}`" placement="top">
                 <el-switch
                     style="margin-left: 10px"
@@ -63,6 +66,21 @@
         温馨提示 第一次导入时请先下载模板
       </p>
     </el-dialog>
+
+
+      <el-dialog
+          title="商城图片  (图片文件像素推荐700X700,有且只允许有一张主图,其余均为副图)"
+          :visible.sync="enclosure"
+          append-to-body
+          width="70%">
+          <c-upload :data="orderList" display basic deleteUrl="/api/blade-sales-part/productLaunchFiles/remove"
+                    :enumerationValue="160" />
+          <span slot="footer" class="dialog-footer">
+          <el-button @click="enclosure = false" size="small">取 消</el-button>
+          <el-button type="primary" @click="saveAnnex" size="small">保 存</el-button>
+        </span>
+      </el-dialog>
+
   </div>
 </template>
 
@@ -80,6 +98,11 @@ export default {
   name: "index",
   data() {
     return {
+        orderList:[],
+        enclosure:false,
+        dataId:0,
+        rowImg:[],
+
       optionsUeditor: {
         //普通上传地址
         // action:'https://avuejs.com/imgupload',
@@ -155,7 +178,7 @@ export default {
         height: "auto",
         searchMenuPosition: "right",
         align: "center",
-        menuWidth: 100,
+        menuWidth: 200,
         updateBtnText:'保存',
         searchSpan: 8,
         searchIcon: true,
@@ -339,6 +362,44 @@ export default {
     }
   },
   methods: {
+      //打开附件
+      annexOpen(row, index) {
+          this.dataId = index
+          this.rowImg = row
+          this.orderList = row.filesList?row.filesList:[];
+          for (let order of this.orderList) {
+              order.paymentType = order.typeFiles
+          }
+          this.enclosure = true
+      },
+      // 附件保存
+      saveAnnex() {
+          if (this.orderList.length > 0) {
+              // 循环把编辑状态变成保存状态
+              this.orderList.map((item)=>{
+                  if (item.$cellEdit == true) {
+                      item.$cellEdit = false
+                  } else {
+                      item.$cellEdit = true
+                  }
+              })
+              let flag = this.orderList.some(item => {
+                  return item.$version == '主图'
+              })
+              if (!flag) {
+                  this.$message.warning('请选择主图')
+                  return
+              }
+          }
+          this.rowImg.filesList = this.orderList;
+          submit({
+              ...this.rowImg
+          }).then(res=>{
+              this.$message.success("添加成功")
+              // this.onLoad(this.page, this.search)
+          })
+          this.enclosure = false
+      },
     derivation() {
       window.open(
         `/api/blade-sales-part/productLaunch/export-productLaunch?${this.website.tokenHeader