Переглянути джерело

Merge branch 'master' of http://121.40.40.223:3000/zizhong.wang/Lexus-media

suxinf 4 роки тому
батько
коміт
acf2b13ce1

+ 1 - 1
src/App.vue

@@ -36,7 +36,7 @@ export default {
     return {
       navTitle1: ' > 数据管理',
       navTitle2: '',
-      isManufacturer: 'manufacturer', // distributor 经销商 manufacturer 厂商
+      isManufacturer: 'distributor', // distributor 经销商 manufacturer 厂商
     }
   },
   methods: {

+ 9 - 2
src/components/Modal.vue

@@ -404,7 +404,14 @@ export default {
           console.log(err);
         });
     },
-
+    
+    initialData: function () {
+      this.ziliaoId=this.LinkData.id;
+      this.carS=this.LinkData.carTypeName;
+      this.carT=this.LinkData.carPlatformName;
+      console.log(this.LinkData);
+      console.log(this.ziliaoId);
+    }
 
   },
   mounted() {
@@ -413,7 +420,7 @@ export default {
     this.firstContent1Classify();
     this.firstContent2Classify();
     //this.chooseReleasePlate();
-
+    this.initialData();
   },
 };
 </script>

+ 81 - 9
src/views/account/AccountManage.vue

@@ -39,7 +39,7 @@
     <Modal
       v-if="showModal"
       @closeme="closeme"
-      @submit="editForm"
+      @submit="addDataList"
       :editData="editData"
     ></Modal>
   </div>
@@ -112,15 +112,20 @@ export default {
         },
       ],
       editData: {},
+      dictList: [],
+      mediaPlatName: [],
     };
   },
   methods: {
-    addDataList: function (val) {
-      console.log(val);
+    addDataList: function (account, fansNum, flag, editData) {
+      console.log(account, fansNum, flag, editData);
       this.$http({
         url: "/sys/mediaAccount/addMediaAccountInfo",
         method: "post",
-        data: {},
+        data: {
+          accountId: account,
+          fansCount: fansNum,
+        },
       })
         .then((res) => {
           console.log(res);
@@ -135,8 +140,7 @@ export default {
     editForm: (account, fansNum, flag, editData) => {
       console.log(account, fansNum, flag, editData);
       //alert("编辑");
-      this.addDataList(editData);
-      //添加修改后的信息
+      //this.addDataList(account, fansNum, flag, editData);
     },
     toggleModal: function (i) {
       this.editData = this.tableData[i];
@@ -151,8 +155,8 @@ export default {
     hiddenImg: function () {
       this.imgFlag = false;
     },
-    //获取资料列表--分页查询每个经销商账号信息
-    getDataList: function () {
+    //
+    /*    getDataList: function () {
       this.$http({
         //url: "/sys/mediaAccount/selectMediaAccountPage",
         url: "/sys/mediaAccount/addMediaAccountInfo",
@@ -168,10 +172,78 @@ export default {
         .catch((err) => {
           console.log(err);
         });
+    }, */
+
+    // 获取内容分类、媒体平台、常用参数接口的标识,再调接口时需要用到
+    selectSysDataDictList: function () {
+      return new Promise((resolve, reject) => {
+        this.$http({
+          method: "post",
+          url: "/sys/dataDict/selectSysDataDictList",
+          data: {},
+        })
+          .then((res) => {
+            if (res.data && res.data.code === 200) {
+              this.dictList = res.data.data;
+              resolve();
+            } else {
+              console.log(res);
+              reject();
+            }
+          })
+          .catch((err) => {
+            console.log(err);
+            reject();
+          });
+      });
+    },
+    // 获取列表数据   接口
+    getDateList: function () {
+      this.$http({
+        method: "post",
+        url: "/sys/dataDict/selectSysDataDictPage",
+        data: {
+          dictCode: this.dictList[3]["dictCode"],
+          parentId: this.dictList[3]["id"],
+        },
+      })
+        .then((res) => {
+          if (res.data && res.data.code === 200) {
+            this.mediaPlatName = res.data.data;
+            //console.log(this.mediaPlatName);
+            //取媒体平台名称
+            let arr = [];
+            let len1 = this.mediaPlatName.length;
+            let len2 = this.tableData.length;
+            for (let i = 0; i < len1; i++) {
+              arr.push(this.mediaPlatName[i].dictName);
+            }
+            //console.log(arr);
+            while(len1 > len2){
+              this.tableData.push({})
+            }
+            //渲染,传递到页面数组
+            for (let i = 0; i < this.tableData.length; i++) {
+              this.tableData[i].dlrName=arr[i];
+            }
+          } else {
+            console.log(res);
+          }
+        })
+        .catch((err) => {
+          console.log(err);
+        });
     },
   },
   mounted() {
-    //this.getDataList();
+    this.selectSysDataDictList()
+      .then(() => {
+        this.getDateList();
+        console.log(this.dictList);
+      })
+      .catch((err) => {
+        console.log(err);
+      });
   },
 };
 </script>

+ 1 - 1
src/views/account/components/Modal2.vue

@@ -35,7 +35,7 @@
         </div>
       </div>
       <div class="modal-footer">
-        <button type="button" class="btn-confirm" @click="confirm()">
+        <button type="button" class="btn-confirm" @click="confirm(),closeSelf()">
           确认
         </button>
         <button type="button" class="btn-close" @click="closeSelf">取消</button>

+ 24 - 55
src/views/data/UploadLink.vue

@@ -72,7 +72,7 @@
     </div>
     <!-- 弹窗: 编辑表格内容 -->
     <Modal
-      v-show="showModal"
+      v-if="showModal"
       v-on:closeme="closeme"
       :LinkData="modalData"
       @update="editTitle"
@@ -385,14 +385,23 @@ export default {
       })
         .then((res) => {
           if (res.data.code === 200) {
-            this.tableData = [];
+            //this.tableData = [];
             let data = res.data.data;
             //this.tableData.push(data[0]);
-            Array.prototype.push.apply(this.tableData, data);
-            console.log(res.data.data);
+            //Array.prototype.push.apply(this.tableData, data);
+            //this.tableData.push(data[0]);
+            for (
+              let i = 0, j = 0;
+              i < this.tableData.length && j < data.length;
+              i++, j++
+            ) {
+              this.tableData.splice(i, 1, data[j]);
+              console.log("399", this.tableData);
+            }
+            console.log(data.length, this.tableData.length);
+            console.log(data[0]);
+            console.log(this.tableData);
           }
-          //console.log("uploadLink this.tableData:", this.tableData);
-          //console.log(res.data.data)
         })
         .catch((err) => {
           console.log(err);
@@ -424,50 +433,7 @@ export default {
     onOutputExcel: function () {},
     //导入excel
     onImportExcel: function () {
-      /* // 获取上传的文件对象
-      const { files } = file.target;
-      // 通过FileReader对象读取文件
-      const fileReader = new FileReader();
-      fileReader.onload = (event) => {
-        try {
-          const { result } = event.target;
-          // 以二进制流方式读取得到整份excel表格对象
-          const workbook = XLSX.read(result, { type: "binary" });
-          // 存储获取到的数据
-          let data = [];
-          // 遍历每张工作表进行读取(这里默认只读取第一张表)
-          for (const sheet in workbook.Sheets) {
-            // esline-disable-next-line
-            if (workbook.Sheets.hasOwnProperty(sheet)) {
-              // 利用 sheet_to_json 方法将 excel 转成 json 数据
-              data = data.concat(
-                XLSX.utils.sheet_to_json(workbook.Sheets[sheet])
-              );
-              // break; // 如果只取第一张表,就取消注释这行
-            }
-          }
-          // 最终获取到并且格式化后的 json 数据
-          const uploadData = data.map((item) => {
-            return {
-              id: Number(item["人员ID"]),
-              name: item["姓名"],
-              idType: this.findIdType(item["证件类型"], "string"),
-              credentialsId: item["证件号码"],
-              tel: item["固定电话"],
-              mobile: item["移动电话"],
-            };
-          });
-          console.log(uploadData); //这里得到了后端需要的json数据,调用接口传给后端就行了
-          //message.success('上传成功!') //这里用了antd中的message组件
-          console.log("上传成功!");
-        } catch (e) {
-          // 这里可以抛出文件类型错误不正确的相关提示
-          //  message.error('文件类型不正确!');
-          console.log("文件类型不正确!");
-        }
-      };
-      // 以二进制方式打开文件
-      fileReader.readAsBinaryString(files[0]); */
+      //
     },
     //获取平台列表
     getPlatform: function () {
@@ -479,6 +445,8 @@ export default {
         .then((res) => {
           if (res.data.code === 200) {
             this.platform = res.data.data;
+            this.platformVal = this.platform[0].platformName;
+            this.choosePlatform();
           }
         })
         .catch((err) => {
@@ -495,11 +463,12 @@ export default {
       });
       this.selectedPlatform = val;
 
+      //获取可发布数量
+      this.getReleaseQuantity(obj.id);
+
       //发布平台ID
       this.getDataList(obj.id);
 
-      //获取可发布数量
-      this.getReleaseQuantity(obj.id);
       //获取发布版块
       this.chooseReleasePlate(obj.id);
     },
@@ -521,13 +490,13 @@ export default {
       })
         .then((res) => {
           if (res.data.code === 200) {
-            console.log(res)
+            console.log(res);
             this.publishCount = res.data.data[1].publishCount;
             let len = this.publishCount;
             let l = this.tableData.length;
             console.log("获取可发布数量", len, l);
-            
-            while (len > l) {
+            this.tableData = [];
+            while (len > 0) {
               //this.tableData.push([]);
               Array.prototype.push.apply(this.tableData, [this.emptyData]);
               len--;