suxinf il y a 5 ans
Parent
commit
b5a4de1920

+ 37 - 27
src/views/data/UploadInfor.vue

@@ -38,7 +38,6 @@
             class="selectStyle"
             v-model="scope"
             autocomplete="off"
-            @change="scopeChange"
           >
             <option value="1">共通</option>
             <option value="0">部分</option>
@@ -68,11 +67,9 @@
             v-model="addByCustomize"
           />
           <datalist id="dlrs">
-            <option
-              v-for="(dlr, index) in dlrList"
-              :key="index"
-              :value="dlr.dlrCode || dlr.dlrName"
-            ></option>
+            <option v-for="(item, index) in dlrList" :key="index" :value="item">
+              {{ item }}
+            </option>
           </datalist>
           <button @click.prevent="addBySelf">添加</button>
         </div>
@@ -83,7 +80,7 @@
             <div class="optionBox" v-if="optionFlag">
               <ul>
                 <li v-for="(item, index) in groupList" :key="index">
-                  <p>{{ item }}</p>
+                  <p>{{ item.groupName }}</p>
                   <img
                     src="../../img/add.png"
                     @click="addGroup(index)"
@@ -177,7 +174,6 @@ export default {
       localMonth: "",
       tableData: [], // 表格显示的数据
       AllDlr: [], // 所有进销商数据
-      dealerList: [], // 筛选以后的数据
       imgFlag: new Array(20).fill(true), // 筛选栏用添加图片还是删除图片
       // 文件
     };
@@ -212,10 +208,6 @@ export default {
       // this.materialTime = this.localMonth.replace('-', '/');
       console.log(this.materialTime);
     },
-    // 进销商范围变化
-    scopeChange: function () {
-      console.log(this.scope, "1是共通", "0是部分");
-    },
     // 显示隐藏按小组添加下拉框
     showOption() {
       this.optionFlag = !this.optionFlag;
@@ -234,13 +226,13 @@ export default {
     },
     // 点击按区域添加button
     addByArea: function () {
+      console.log(this.checkedBoxList);
       console.log(JSON.parse(JSON.stringify(this.checkedBoxList)));
     },
     // 自定义添加
     addBySelf: function () {
-      console.log(this.addByCustomize);
       let data = {
-        dlrCode: this.addByCustomize,
+        queryParams: this.addByCustomize,
       };
       this.getDlrData(data);
       this.getAllDlr(data);
@@ -259,10 +251,10 @@ export default {
       this.addGroupList = [];
       this.addFlag.forEach((item, index) => {
         if (!item) {
-          this.addGroupList.push(this.groupList[index]);
+          this.addGroupList.push(this.groupList[index]['id']);
         }
       });
-      console.log(JSON.parse(JSON.stringify(this.addGroupList)));
+      console.log(this.addGroupList);
       this.optionFlag = false;
     },
     // 筛选
@@ -317,9 +309,9 @@ export default {
     getFileInfo: function (event) {
       this.file = event.target.files;
       this.fileDes = [];
-        this.file.forEach((item) => {
-          this.fileDes.push(item.name);
-        });
+      this.file.forEach((item) => {
+        this.fileDes.push(item.name);
+      });
     },
     // 获取当前的月份
     getLocalMonth: function () {
@@ -341,6 +333,9 @@ export default {
       paramData.append("dataDesc", this.inforDes);
       paramData.append("sourceTime", this.materialTime);
       paramData.append("dealerScope", this.scope);
+      if (this.scope !== 1) {
+         paramData.append("dealerList", this.AllDlr);
+      }
       console.log(paramData.getAll("dataName"));
       this.$http
         .uploadFile("/firmsUpload", paramData)
@@ -389,16 +384,11 @@ export default {
             this.dlrList = [];
             this.AllDlr = res.data.data;
             let resData = JSON.parse(JSON.stringify(res.data.data));
+            console.log(resData);
             resData.forEach((item) => {
               // 获取自定义下拉框的值
-              if (item.dlrCode || item.dlrName) {
-                this.dlrList.push({
-                  dlrCode: item.dlrCode,
-                });
-                this.dlrList.push({
-                  dlrName: item.dlrName,
-                });
-              }
+              this.dlrList.push(item.dlrName);
+              this.dlrList.push(item.dlrCode);
             });
           } else {
             console.log(res);
@@ -427,6 +417,25 @@ export default {
           console.log(err);
         });
     },
+    // 获取小组接口
+    selectGroupList: function () {
+      this.$http({
+        method: "post",
+        url: "/sys/group/selectGroupList",
+        data: {},
+      })
+        .then((res) => {
+          if (res.data && res.data.code === 200) {
+            this.groupList = res.data.data;
+            console.log(this.groupList);
+          } else {
+            console.log(res);
+          }
+        })
+        .catch((err) => {
+          console.log(err);
+        });
+    },
   },
   mounted() {
     this.getLocalMonth();
@@ -438,6 +447,7 @@ export default {
     this.getDlrData();
     // 获取所有的资料名称
     this.getAllDataName();
+    this.selectGroupList();
   },
 };
 </script>

+ 2 - 7
src/views/data/UploadLinks.vue

@@ -101,8 +101,6 @@ export default {
     },
     search: function () {
       let data= {
-        page: this.currentPage,
-        pageSize: this.pageSize,
         code: this.inputValue,
         area: this.areaValue,
         startTime: this.startTime,
@@ -131,13 +129,10 @@ export default {
           this.currentPage = this.totalPage;
           break;
       }
-      let data= {
-        page: this.currentPage
-      }
-      this.firmsLinkUpload(data);
+      this.firmsLinkUpload({});
     },
     // 获取表格数据
-    firmsLinkUpload: function (data) {
+    firmsLinkUpload: function (data={}) {
       this.$http({
         method: "post",
         url: "/firmsLinkUpload",

+ 2 - 3
src/views/data/UploadRecord.vue

@@ -69,7 +69,7 @@ export default {
       return Math.ceil(this.sum / this.pageSize);
     },
     isShowDetail() {
-      return this.$route.query && this.$route.query.id ? true : false;
+      return this.$route.query && this.$route.query.tag ? true : false;
     },
   },
   methods: {
@@ -130,9 +130,8 @@ export default {
       }, 2000)
     },
     detail: function (i) {
-      let id = this.tableData[i].id || i;
       this.detailData = this.tableData[i];
-      this.$router.push({ query: { id: id } });
+      this.$router.push({ query: { tag: 'detail' } });
     },
     // 上传记录列表接口
     getFirmsUploadList: function (data = {}) {

+ 54 - 28
src/views/data/components/UploadRecordDetail.vue

@@ -102,7 +102,10 @@ export default {
     TablePage,
   },
   mounted() {
-    console.log(this.detailData);
+    let id = this.detailData['id'];
+    let data = {informationId: id};
+    console.log(this.detailData, 11);
+    this.selectInformationFileList(data);
   },
   data() {
     return {
@@ -123,15 +126,21 @@ export default {
   methods: {
     showTable: function () {
       this.isShowTable = !this.isShowTable;
-      let id = this.detailData['id'];
-      this.getDlrData(id)
+      let id = this.detailData["id"];
+      let  dataObj= {
+          informationId: id,
+        };
+      this.getDlrData(dataObj);
     },
     hidTable: function () {
       this.isShowTable = false;
     },
     seletByArea: function () {
-      console.log(this.optionValue);
-      this.selectInformationFileList();
+      console.log(this.optionValue, 111);
+      let dataObj = {
+        localArea: ['东区', '南区']
+      }
+      this.getDlrData(dataObj); 
     },
     // 获取某一页面的数据,展示在表格
     changePage: function (page) {
@@ -162,33 +171,33 @@ export default {
     },
     // 导出文件
     downloadExcel: function () {
-      let id = this.detailData['id'];
+      let id = this.detailData["id"];
       this.exportTem(id);
     },
     // 下载文件接口
-    selectInformationFileList: function (id) {
-      this.$http({
-        method: "post",
-        url: "/selectInformationFileList",
-        data: {
-          id: id,
-        },
-      })
-        .then((res) => {
-          console.log(res);
-        })
-        .catch((err) => {
-          console.log(err);
-        });
-    },
+    // selectInformationFileList: function (id) {
+    //   this.$http({
+    //     method: "post",
+    //     url: "/selectInformationFileList",
+    //     data: {
+    //       id: id,
+    //     },
+    //   })
+    //     .then((res) => {
+    //       console.log(res);
+    //     })
+    //     .catch((err) => {
+    //       console.log(err);
+    //     });
+    // },
     // 导出模板
     exportTem: function (i) {
       return new Promise((resolve, reject) => {
         this.$http({
-          url: '/export',
+          url: "/export",
           method: "post",
-          data: {id: i},
-          responseType: 'blob'
+          data: { id: i },
+          responseType: "blob",
         })
           .then((res) => {
             console.log(res);
@@ -208,16 +217,15 @@ export default {
       });
     },
     // 分页获取所有进销商信息接口
-    getDlrData: function (id) {
+    getDlrData: function (dataObj={}) {
       this.$http({
         method: "post",
         url: "/sys/agent/selectAgentInfoPage",
-        data: {
-          informationId: id,
-        },
+        data: dataObj
       })
         .then((res) => {
           if (res.data && res.data.code === 200) {
+            console.log(res);
             this.tableData = res.data.data;
             this.sum = res.data.count;
           } else {
@@ -228,6 +236,24 @@ export default {
           console.log(err);
         });
     },
+    // 文件详情  接口
+    selectInformationFileList(data) {
+      this.$http({
+        method: "post",
+        url: "/selectInformationFileList",
+        data: data
+      })
+        .then((res) => {
+          if (res.data && res.data.code === 200) {
+            console.log(res , '文件');
+          } else {
+            console.log(res);
+          }
+        })
+        .catch((err) => {
+          console.log(err);
+        });
+    },
   },
 };
 </script>

+ 9 - 7
src/views/parameter/LinkUpload.vue

@@ -38,7 +38,7 @@
           :modalFlag="modalFlag"
           @submit="submit"
           @hide_modal="showModal"
-          :optionList='optionList'
+          :selectedplateForm='selectedplateForm'
         ></Modal>
       </div>
     </div>
@@ -73,6 +73,7 @@ export default {
       modalFlag: false, // 控制模态框展示
       optionList: [],
       selectedForm: '',
+      selectedplateForm: {}
     };
   },
   computed: {
@@ -138,16 +139,16 @@ export default {
       console.log("删除", this.functionData[index].str);
     },
     // 模态框保存
-    submit: function (time, num, id) {
-      time = time.replace('-','/');
-      console.log(time);
-      this.addMediaPublishInfo(+num, '2021/03', 'test', id);
+    submit: function (time, num, obj) {
+      let addTime = time.replace('-','/');
+      this.addMediaPublishInfo(+num, addTime, obj.platformName, obj.id);
       this.modalFlag = false;
     },
     // slectPlatForm
     slectPlatForm: function (e) {
-      console.log(e.target.options.selectedIndex);
-      console.log(1111, this.selectedForm);
+      // console.log(1111, this.selectedForm);
+      let index = e.target.options.selectedIndex
+      this.selectedplateForm = this.optionList[index];
     },
     // 新增 接口
     addMediaPublishInfo: function (publishCount, publishMonth, publishPlatformName, publishPlatformId) {
@@ -263,6 +264,7 @@ export default {
             console.log(res);
             this.optionList = res.data.data;
             this.selectedForm = this.optionList[0]['platformName'];
+            this.selectedplateForm = this.optionList[0];
           } else {
             console.log(res);
           }

+ 6 - 20
src/views/parameter/components/LinkUpload/Modal.vue

@@ -8,11 +8,7 @@
         </div>
         <div class="plate">
           <p>选择平台</p>
-          <select v-model="selectedForm" @change="slectPlatForm($event)">
-            <option v-for="(item, index) in optionList" :key="index">
-              {{ item.platformName }}
-            </option>
-          </select>
+          <div>{{selectedplateForm.platformName}}</div>
         </div>
         <div class="num">
           <p>设置上传数量</p>
@@ -34,10 +30,10 @@ export default {
       type: Boolean,
       default: false,
     },
-    optionList: {
-      type: Array,
+    selectedplateForm: {
+      type: Object,
       default: () => {
-        return [];
+        return {};
       },
     },
   },
@@ -45,8 +41,6 @@ export default {
     return {
       time: "",
       num: 0,
-      selectedForm: this.optionList[0]['platformName'],
-      platformId: this.optionList[0]['id'],
     };
   },
   methods: {
@@ -63,7 +57,7 @@ export default {
       } else if (Math.ceil(num) !== num) {
         alert("请输入大于零的整数");
       } else {
-        this.$emit("submit", this.time, this.num, this.platformId);
+        this.$emit("submit", this.time, this.num, this.selectedplateForm);
       }
     },
     hideModal: function () {
@@ -72,13 +66,9 @@ export default {
     mousewheel: function (e) {
       e.preventDefault();
     },
-    slectPlatForm: function (e) {
-      let index = e.target.options.selectedIndex
-      this.platformId = this.optionList[index]['id']
-    },
   },
   created() {
-    console.log(this.optionList);
+    console.log(this.selectedplateForm);
   }
 };
 </script>
@@ -124,10 +114,6 @@ export default {
       p {
         width: 100px;
       }
-      select{
-        height: 26px;
-        width: 144px;
-      }
     }
     .num {
       display: flex;