chenrui 1 tahun lalu
induk
melakukan
0848214b6e

+ 5 - 2
src/components/UploadFile/index.vue

@@ -90,6 +90,9 @@ export default {
       if (a == undefined) {
         this.fileList = []
       }
+    },
+    uploadParams (val) {
+      this.params = val
     }
   },
   data () {
@@ -108,7 +111,7 @@ export default {
     const _this = this
     this.$nextTick(() => {
       const el = document.querySelector('.ant-upload-list-picture-card')
-      if(el){
+      if (el) {
         const sortable = Sortable.create(el, {
           onEnd: function (evt) {
             console.log(evt.oldIndex, evt.newIndex)
@@ -116,7 +119,7 @@ export default {
             console.log(a.split(','))
             const ret = moveElement(a.split(','), evt.oldIndex, evt.newIndex)
             console.log(ret)
-        
+
             _this.$emit('change', ret.join(','))
             _this.$emit('input', ret.join(','))
           }

+ 8 - 3
src/views/promotionRulesManagement/dealerPromotions/importGuideModal.vue

@@ -39,8 +39,8 @@
               :maxNums="1"
               fileType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
               uploadType="attach"
-              :uploadParams="goodFlag==='0'?{discountType:rulesType,savePathType: 'ali'}:undefined"
-              :action="goodFlag==='1'?attachAction:attachAction1"
+              :uploadParams="uploadData"
+              :action="goodFlag=='1'?attachAction:attachAction1"
               upText="选择导入文件"
               @remove="resetSearchForm"
               @change="changeImport"></Upload>
@@ -100,7 +100,8 @@ export default {
       attachAction: process.env.VUE_APP_API_BASE_URL + '/promotion/rule/importNormalProduct', // 导入门槛、正价、促销产品
       attachAction1: process.env.VUE_APP_API_BASE_URL + '/promotion/rule/importSpecialProduct', // 导入特价产品
       paramsData: null,
-      filePath: ''
+      filePath: '',
+      uploadData: null
     }
   },
   methods: {
@@ -108,6 +109,7 @@ export default {
     resetSearchForm () {
       this.$refs.importUpload.setFileList() //  清空导入文件
       this.paramsData = null //  清空上传数据
+      this.uploadData = null
     },
     // 下一步
     handlerNextStep () {
@@ -152,9 +154,12 @@ export default {
       } else {
         if (this.goodFlag != '0') {
           this.filePath = location.protocol + '//' + location.host + '/templ/促销规则导入产品.xlsx'
+          this.uploadData = { savePathType: 'ali' }
         } else {
+          this.uploadData = { discountType: this.rulesType, savePathType: 'ali' }
           this.filePath = location.protocol + '//' + location.host + (this.rulesType == '0' ? '/templ/促销规则导入特价产品.xlsx' : this.rulesType == '1' ? '/templ/促销规则导入特价产品(打折).xlsx' : '/templ/促销规则导入特价产品(直降).xlsx')
         }
+        console.log('111111111111:', this.uploadData)
       }
     }
   }