Browse Source

问题修改

suxinf 4 years ago
parent
commit
383f06bc88

+ 50 - 85
src/components/Modal.vue

@@ -22,18 +22,6 @@
           </div>
         </div>
         <div class="bodyRow">
-          <!--  <div class="contentCol1">
-            <span>车系</span
-            ><select v-model="carS" @change="chooseCarSeries">
-              <option
-                v-for="(item, index) in carSeries"
-                :key="index"
-                :value="item.typeName"
-              >
-                {{ item.typeName }}
-              </option>
-            </select>
-          </div> -->
           <div class="contentCol1">
             <span>涉及车型</span
             ><select v-model="carT">
@@ -227,14 +215,16 @@ export default {
     },
     formatDateToDate: function (val) {
       this.ziliaoTime = "";
-      let date = new Date(val);
-      let y = date.getFullYear();
-      let m = date.getMonth() + 1;
-      m = m < 10 ? "0" + m : m;
-      let d = date.getDate();
-      d = d < 10 ? "0" + d : d;
-      const time = y + "-" + m + "-" + d;
-      this.ziliaoTime = time;
+      if (val) {
+        let date = new Date(val);
+        let y = date.getFullYear();
+        let m = date.getMonth() + 1;
+        m = m < 10 ? "0" + m : m;
+        let d = date.getDate();
+        d = d < 10 ? "0" + d : d;
+        const time = y + "-" + m + "-" + d;
+        this.ziliaoTime = time;        
+      }
     },
     // 判断非空
     beforeEdit: function () {
@@ -304,24 +294,8 @@ export default {
     },
     edit: function () {
       this.noEditFlag = false;
-      let obj = {};
-      //获取资料名
-      /*  let idVal = this.ziliaoId;
-      obj = this.dataName.find(function (item) {
-        return item.id === idVal;
-      });
-      this.ziliaoName = obj.informationName; */
       this.beforeEdit();
       if (!this.noEditFlag) {
-        //获取车系 id
-        let nameCarS = this.carS;
-        obj = this.carSeries.find(function (item) {
-          return item.typeName === nameCarS;
-        });
-        console.log("chexi ", obj);
-        //carTypeId  表示车系 id
-        // this.carTypeId = obj.id;
-
         //当前月份
         let date = new Date();
         let m = date.getMonth() + 1;
@@ -355,7 +329,7 @@ export default {
         };
         if (this.LinkData.id) {
           //编辑
-          config.url = "/updateDealerFeedback";
+          config.url = "/lexus_php/api/add_report.php";
           config.data.id = this.LinkData.id;
         }
         // else {
@@ -403,41 +377,44 @@ export default {
         .then((res) => {
           if (res.data.code === 200) {
             this.carType = res.data.data;
-            this.chooseCarType();
+            console.log(res.data.data)
+            // this.chooseCarType();
           }
         })
         .catch((err) => {
           console.log(err);
         });
     },
-    chooseCarType: function () {
-      //清空下级select
-      this.carT = "";
-      //获取车系 id
-      let obj = {};
-      let nameCarS = this.carS;
-      obj = this.carSeries.find(function (item) {
-        return item.typeName === nameCarS;
-      });
-      this.carTypeId = obj.id;
+    // chooseCarType: function () {
+    //   //清空下级select
+    //   this.carT = "";
+    //   //获取车系 id
+    //   let obj = {};
+    //   let nameCarS = this.carS;
+    //   obj = this.carSeries.find(function (item) {
+    //     return item.typeName === nameCarS;
+    //   });
+    //   console.log(obj,222)
+    //   this.carTypeId = obj.id;
 
-      this.$http({
-        url: "/base/carTypeManager/selectCarTypeList",
-        method: "post",
-        data: {
-          parentId: this.carTypeId || "-",
-        },
-      })
-        .then((res) => {
-          if (res.data.code === 200) {
-            this.carType = res.data.data;
-            this.carT = this.LinkData.carPlatformName;
-          }
-        })
-        .catch((err) => {
-          console.log(err);
-        });
-    },
+    //   this.$http({
+    //     url: "/base/carTypeManager/selectCarTypeList",
+    //     method: "post",
+    //     data: {
+    //       parentId: this.carTypeId || "-",
+    //     },
+    //   })
+    //     .then((res) => {
+    //       console.log(res, 3333)
+    //       if (res.data.code === 200) {
+    //         this.carType = res.data.data;
+    //         this.carT = this.LinkData.carPlatformName;
+    //       }
+    //     })
+    //     .catch((err) => {
+    //       console.log(err);
+    //     });
+    // },
     //不分页查询发布平台信息 内容分类1
     //初次调用获得 content ID 用作 parentID
     firstContent1Classify: function () {
@@ -519,23 +496,13 @@ export default {
       else {
         this.ziliaoId = this.$route.query.informationId;
       }
-
       this.mediaTitle = this.LinkData.mediaTitle;
       this.mediaUrl = this.LinkData.mediaUrl;
-      this.carS = this.LinkData.carTypeName;
-
+      // this.carS = this.LinkData.carTypeName;
       this.carT = this.LinkData.carPlatformName;
-      let time = this.LinkData.publishDate; //发布时间
-      if (time != null) {
-        if (time.length > 4) {
-          let y = time.slice(0, 4);
-          let m = time.slice(5, 7);
-          let d = time.slice(8, 10);
-          let temp = y + "-" + m + "-" + d;
-          this.ziliaoTime = temp;
-        }
-      }
-
+      this.ziliaoTime = this.LinkData.publishDate; //发布时间
+      let dateArr = this.ziliaoTime.split('-');
+      this.datePickValue = Date.parse(new Date(dateArr[0], +dateArr[1]-1, +dateArr[2]));
       //publishPlatformName 发布渠道
       this.releaseC = this.LinkData.publishPlatformName;
       //publishSourceName 发布板块
@@ -562,10 +529,10 @@ export default {
         alert("链接输入有误!\n示例:https://www.baidu.com");
       }
       /*
-this.ziliaoName && this.ziliaoTime &&this.carS &&this.carT&&
-this.releaseP&& th&& this.contentName1&&
-this.contentName2&& this.mediaTitle&& this.mediaUrl&&
-this.readCount&&this.goodCount&&  this.bbsCount&& this.lookingCount */
+      this.ziliaoName && this.ziliaoTime &&this.carS &&this.carT&&
+      this.releaseP&& th&& this.contentName1&&
+      this.contentName2&& this.mediaTitle&& this.mediaUrl&&
+      this.readCount&&this.goodCount&&  this.bbsCount&& this.lookingCount */
     },
 
     //下拉选择平台  渠道
@@ -622,9 +589,7 @@ this.readCount&&this.goodCount&&  this.bbsCount&& this.lookingCount */
     this.chooseCarSeries();
     this.firstContent1Classify();
     this.firstContent2Classify();
-
     this.chooseChannel();
-
     this.initialData();
   },
 };

+ 6 - 27
src/views/data/InforList.vue

@@ -93,7 +93,7 @@
                     }"
                     >已完成</span
                   > -->
-                  <span v-if="!obj.endDate || (obj.endDate && obj.download == 1 && obj.report == 1)" class="noPoint">已完成</span>
+                  <span v-if="!obj.endDate || (obj.endDate && obj.download >= 1 && obj.report >= 1)" class="noPoint">已完成</span>
                   <span v-else @click="waitToReport(obj, index)" :class="{noDownLoad: obj.download == '0'}" class="line">待办</span>
                 </td>
 
@@ -226,18 +226,6 @@ export default {
       } else {
         return { showItemOperationStyle: true };
       }
-      /*  let now = new Date().getTime();
-     if (!this.endDate) {
-        console.log("超出反馈时间", this.endDate);
-        return { showItemOperationStyle: true };
-      } else {
-        let end = Date.parse(new Date(this.endDate));
-        if (now > end) {
-          return { showItemOperationStyle: true };
-        } else {
-          return { showItemOperationStyle: false };
-        }
-      } */
     },
   },
   watch: {
@@ -446,20 +434,6 @@ export default {
         this.newGetDataList(data);
       }
     },
-    //待办跳转
-    // waitToReport: function (obj, i) {
-    //   this.endDate = this.tableData[i].endDate;
-    //   this.localReport = this.tableData[i].report;
-    //   console.log(obj.report == 0, obj.download == 0);
-    //   console.log(obj);
-    //   if (obj.report == 0 && obj.download != 0) {
-    //     console.log("待办跳转");
-    //     this.$router.push({
-    //       path: "/uploadLink/sonUploadLink",
-    //       query: { informationName: obj.informationName, id: obj.id },
-    //     });
-    //   }
-    // },
     waitToReport: function(obj) {
       let data = new Date();
       let year = data.getFullYear();
@@ -470,6 +444,11 @@ export default {
       } else {
         month = month + "";
       }
+      if (day < 10) {
+        day = "0" + day;
+      } else {
+        day = day + "";
+      }
       let endDate = obj.endDate.replace(RegExp("-", "g"), "");
       let localDate = year + month + day;
       let dateFlag = (+endDate) - (+localDate)

+ 8 - 18
src/views/data/UploadInfor.vue

@@ -34,6 +34,7 @@
             minimum-view="month"
             :disabled-dates="limit"
           ></Datepicker>
+            <!-- :input-class="datePickStyle" -->
         </div>
         <div class="dealer_scope">
           <span>经销商范围</span>
@@ -187,6 +188,7 @@ export default {
       monthPickValue: "",
       datePickValue: "",
       limit: {},
+      // datePickStyle: "{width: "200px"}",
       allDataNameList: [],
       tipFlag: false, // 是否展示提示
       tipText: "资料名称不能重复,请重新输入",
@@ -224,6 +226,8 @@ export default {
   methods: {
     // 检查名字是否重复 失去焦点判断
     checkName: function () {
+      // 去前后空格
+      this.inforName = this.inforName.replace(/(^\s*)|(\s*$)/g, "");
       let include = this.allDataNameList.indexOf(this.inforName);
       if (!this.inforName) {
         this.tipText = "资料名不能为空";
@@ -361,7 +365,6 @@ export default {
       m = m < 10 ? ('0' + m) : m
       const time =  y + '-' + m;
       this.materialTime = time;
-      console.log(time);
     },
     formatDateToDate: function (val) {
       let date = new Date(val)
@@ -378,23 +381,23 @@ export default {
       if (this.isFeedBack === "0") {
         this.feedBackTime = "";
       }
-      this.formatDateToMonth(this.monthPickValue);
-      this.formatDateToDate(this.datePickValue);
       this.checkName();
       if (!this.tipFlag) {
         if (!this.inforDes) {
           alert("资料描述不能为空");
           return;
         }
-        if (!this.materialTime) {
+        if (!this.monthPickValue) {
           alert("请选择素材时间");
           return;
         }
+        this.formatDateToMonth(this.monthPickValue);
         if (this.isFeedBack === "1") {
-          if (!this.feedBackTime) {
+          if (!this.datePickValue) {
             alert("请选择截止日期");
             return;
           }
+          this.formatDateToDate(this.datePickValue);
         }
         if (this.file.length === 0) {
           alert("请导入资料附件");
@@ -411,14 +414,11 @@ export default {
         this.file.push(item);
         this.fileDes.push(item.name);
       });
-      console.log(this.file, "this.file");
     },
     // 删除文件
     deletFile: function(i) {
-      console.log(i);
       this.file.splice(i, 1);
       this.fileDes.splice(i, 1);
-      console.log(this.file);
     },
     // 获取当前的月份
     getLocalMonth: function () {
@@ -450,7 +450,6 @@ export default {
             this.tipModalText = "上传成功!";
           } else {
             alert("上传失败,请重试");
-            console.log(res);
           }
         })
         .catch((err) => {
@@ -470,8 +469,6 @@ export default {
               res.data.data.forEach((item) => {
                 this.allDataNameList.push(item.informationName);
               });
-          } else {
-            console.log(res);
           }
         })
         .catch((err) => {
@@ -531,8 +528,6 @@ export default {
                 return;
               }
             }
-          } else {
-            console.log(res);
           }
         })
         .catch((err) => {
@@ -556,8 +551,6 @@ export default {
                 flag: true,
               });
             });
-          } else {
-            console.log(res);
           }
         })
         .catch((err) => {
@@ -574,8 +567,6 @@ export default {
           if (res.data && res.data.code === 200) {
             this.areaList = res.data.data;
             this.areaList.unshift('全区');
-          } else {
-            console.log(res);
           }
         })
         .catch((err) => {
@@ -592,7 +583,6 @@ export default {
     this.selectGroupList();
     this.getAreaList();
   },
-  beforeCreate() {}
 };
 </script>
 

+ 26 - 44
src/views/data/UploadLink.vue

@@ -309,7 +309,7 @@ export default {
       isShowresultModal: false,
       resultModalFlag: false,
       tipModalText: "导入成功",
-      upLoadName: ""
+      upLoadName: "",
     };
   },
   computed: {
@@ -325,7 +325,6 @@ export default {
       } else {
         let end = Date.parse(new Date(this.endTime));
         if (now > end) {
-          console.log("超出反馈时间");
           return { showItemOperationStyle: true };
         } else {
           return { showItemOperationStyle: false };
@@ -344,8 +343,12 @@ export default {
       } else {
         month = month + "";
       }
+      if (day < 10) {
+        day = "0" + day;
+      } else {
+        day = day + "";
+      }
       this.nowDate = +(year + month + day);
-      console.log(this.nowDate);
     },
     /*toggleModal:点击编辑后弹窗; toggleModal2:点击删除后弹窗; toggleModal3:点击导入后弹窗;  */
     toggleModal: function (i) {
@@ -378,15 +381,13 @@ export default {
     closeme4: function () {
       this.showModal4 = !this.showModal4;
     },
-    /* 编辑内容,,Modal传参 */
     editTitle: function (val) {
-      this.$http({
-        url: val.url,
+      axiosTest({
+        url: this.otherUrl + val.url,
         method: "post",
         data: val.data,
       })
         .then((res) => {
-          console.log(res);
           if (res.data && res.data.code == 200) {
             //更新数据
             //this.choosePlatform();
@@ -397,15 +398,12 @@ export default {
               agentId: this.userId,
             };
             this.getDataList(config);
-          } else {
-            alert("编辑失败,请重试");
           }
         })
         .catch((err) => {
           console.log(err);
         });
     },
-
     toDel: function () {
       this.showModal2 = !this.showModal2;
       //更新数据
@@ -420,7 +418,6 @@ export default {
     /* 表格翻页 */
     changePage: function (page) {
       this.currentPage = page;
-      //console.log(page);
       //分页取数据
       let config = {
         Page: this.currentPage,
@@ -532,21 +529,23 @@ export default {
         url: this.otherUrl + "/lexus_php/api/report_import_continue.php",
         data: {
           agentId: this.userId,
-          name: this.upLoadName
+          name: this.upLoadName,
         },
-      }).then((res) => {
-        this.resultModalFlag = false;
-        this.isShowresultModal = true;
-        this.tipModalText = res.data.msg || "";
-        let config = {
-          Page: this.currentPage,
-          Rows: this.pageSize,
-          agentId: this.userId,
-        };
-        this.getDataList(config);
-      }).catch((err) => {
-        console.log(err);
       })
+        .then((res) => {
+          this.resultModalFlag = false;
+          this.isShowresultModal = true;
+          this.tipModalText = res.data.msg || "";
+          let config = {
+            Page: this.currentPage,
+            Rows: this.pageSize,
+            agentId: this.userId,
+          };
+          this.getDataList(config);
+        })
+        .catch((err) => {
+          console.log(err);
+        });
     },
     // 导入接口
     submitRequest: function () {
@@ -555,20 +554,6 @@ export default {
         paramData.append("file", item);
       });
       paramData.append("agentId", this.userId);
-      // this.$http
-      //   .uploadFile("/importDealerFeedback", paramData)
-      //   .then((res) => {
-      //     console.log(res);
-      //     if (res.data && res.data.code === 200) {
-      //       console.log("上传成功!");
-      //     } else {
-      //       alert(res.data.message);
-      //     }
-      //   })
-      //   .catch((err) => {
-      //     alert("上传失败,请重试");
-      //     console.log(err);
-      //   });
       axiosTest({
         method: "post",
         url: this.otherUrl + "/lexus_php/api/report_import.php",
@@ -584,12 +569,11 @@ export default {
           this.isShowresultModal = true;
           if (res.data && (res.data.code === 1 || res.data.code === -1)) {
             this.tipModalText = res.data.msg || "";
-          } else if(res.data && res.data.code === 0) { // res.data.code === 0,需要让用户选择是不是继续操作
+          } else if (res.data && res.data.code === 0) {
+            // res.data.code === 0,需要让用户选择是不是继续操作
             this.tipModalText = res.data.msg || "";
             this.resultModalFlag = true;
             this.upLoadName = res.data.name;
-          } else {
-            alert('上传失败,请重试')
           }
           let config = {
             Page: this.currentPage,
@@ -765,10 +749,8 @@ export default {
     this.getNowDate();
     let localUserId = localStorage.getItem("userId");
     if (localUserId) {
-      console.log("经销商ID", localUserId);
       this.userId = localUserId;
     } else {
-      console.log("经销商ID '-");
       this.userId = "";
     }
     // this.getPlatform();
@@ -780,7 +762,7 @@ export default {
     };
     this.getDataList(config);
     //this.testRequest(config);
-  }
+  },
 };
 </script>
 

+ 15 - 67
src/views/data/UploadLink/sonUploadLink.vue

@@ -229,12 +229,17 @@ export default {
       } else {
         month = month + "";
       }
+      if (day < 10) {
+        day = "0" + month;
+      } else {
+        day = day + "";
+      }
       this.nowDate = +(year + month + day);
     },
     /*toggleModal:点击编辑后弹窗; toggleModal2:点击删除后弹窗; toggleModal3:点击导入后弹窗;  */
     toggleModal: function (i) {
-      this.showModal = !this.showModal;
       this.modalData = this.tableData[i];
+      this.showModal = !this.showModal;
     },
     closeme: function () {
       this.showModal = !this.showModal;
@@ -254,24 +259,25 @@ export default {
     },
     /* 编辑内容,,Modal传参 */
     editTitle: function (val) {
-      this.$http({
-        url: val.url,
+      axiosTest({
+        url: this.php_url + val.url,
         method: "post",
         data: val.data,
       })
         .then((res) => {
-          if (res.data && res.data.code === 200) {
+          if (res.data && res.data.code == 200) {
             //更新数据
-            this.newGetDataList();
-          } else {
-            alert(res.data && res.data.message);
+            let config = {
+              Page: this.currentPage,
+              Rows: this.pageSize,
+              agentId: this.userId,
+            };
+            this.getDataList(config);
           }
         })
         .catch((err) => {
           console.log(err);
         });
-      // axiosTest({})
-      // console.log(val);
     },
     // 新增反馈接口
     add_report: function () {
@@ -280,7 +286,6 @@ export default {
         url: this.php_url + "/lexus_php/api/add_report.php",
         data: this.addReportConfig.data,
       }).then((res) => {
-        console.log(res);
         if(res.data && res.data.code === 0) {
           this.isShowresultModal = true;
           this.tipModalText = res.data.message;
@@ -336,37 +341,6 @@ export default {
       }
       this.getDataList();
     },
-    //获取资料列表
-    // getDataList: function () {
-    //   // let date = new Date();
-    //   // let m = date.getMonth() + 1;
-    //   // let y = date.getFullYear();
-    //   // let d = y + "/" + m;
-    //   this.$http({
-    //     url: "/firmsLinkUpload",
-    //     method: "post",
-    //     data: {
-    //       accountId: this.accountId,
-    //       informationId: this.$route.query.informationId,
-    //       page: this.currentPage,
-    //       rows: this.pageSize,
-    //     },
-    //   })
-    //     .then((res) => {
-    //       console.log(res);
-    //       if (res.data.code === 200) {
-    //         let data = res.data.data;
-    //         console.log(data, 2222);
-    //         this.sum = res.data.count;
-    //         for (let i = 0, j = 0; j < data.length; i++, j++) {
-    //           this.$set(this.tableData, i, data[j]);
-    //         }
-    //       }
-    //     })
-    //     .catch((err) => {
-    //       console.log(err);
-    //     });
-    // },
     getDataList: function () {
       axiosTest({
         method: "post",
@@ -417,32 +391,6 @@ export default {
           console.log(err);
         });
     },
-    // newGetDataList: function () {
-    //   this.$http({
-    //     url: "/firmsLinkUpload",
-    //     method: "post",
-    //     data: {
-    //       agentId: this.accountId,
-    //       informationId: this.$route.query.informationId,
-    //       Page: this.currentPage,
-    //       Rows: this.pageSize,
-    //     },
-    //   })
-    //     .then((res) => {
-    //       console.log(res);
-    //       if (res.data.code === 200) {
-    //         this.tableData = [];
-    //         let data = res.data.data;
-    //         this.sum = res.data.count;
-    //         for (let i = 0, j = 0; j < data.length; i++, j++) {
-    //           this.$set(this.tableData, i, data[j]);
-    //         }
-    //       }
-    //     })
-    //     .catch((err) => {
-    //       console.log(err);
-    //     });
-    // },
     //新增反馈
     addInfo: function () {
       this.showModalAdd = !this.showModalAdd;

+ 32 - 20
src/views/data/UploadLinks.vue

@@ -23,19 +23,23 @@
         </div>
         <div class="time">
           <p>请选择时间段</p>
-          <Datepicker
-            :language="zh"
-            format="yyyy/MM/dd"
-            placeholder=" 年 / 月 / 日"
-            v-model="startTimeValue"
-          ></Datepicker>
+          <div class="date_pick">
+            <Datepicker
+              :language="zh"
+              format="yyyy/MM/dd"
+              placeholder=" 年 / 月 / 日"
+              v-model="startTimeValue"
+            ></Datepicker>
+          </div>
           <span>至</span>
-          <Datepicker
-            :language="zh"
-            format="yyyy/MM/dd"
-            placeholder=" 年 / 月 / 日"
-            v-model="endTimeValue"
-          ></Datepicker>
+          <div class="date_pick">
+            <Datepicker
+              :language="zh"
+              format="yyyy/MM/dd"
+              placeholder=" 年 / 月 / 日"
+              v-model="endTimeValue"
+            ></Datepicker>
+          </div>
         </div>
         <div class="current_button" @click="search">搜索</div>
       </div>
@@ -104,14 +108,18 @@ export default {
       this.inputValue = "";
     },
     formatDateToDate: function (val) {
-      let date = new Date(val)
-      let y = date.getFullYear()
-      let m = date.getMonth() + 1
-      m = m < 10 ? ('0' + m) : m
-      let d = date.getDate()
-      d = d < 10 ? ('0' + d) : d
-      const time =  y + '-' + m + '-' + d;
-      return time
+      if (val) {
+        let date = new Date(val)
+        let y = date.getFullYear()
+        let m = date.getMonth() + 1
+        m = m < 10 ? ('0' + m) : m
+        let d = date.getDate()
+        d = d < 10 ? ('0' + d) : d
+        const time =  y + '-' + m + '-' + d;
+        return time
+      } else {
+        return ""
+      }
     },
     search: function () {
       this.startTime = this.formatDateToDate(this.startTimeValue);
@@ -271,6 +279,7 @@ export default {
           color: #555;
           font-size: 12px;
           height: 18px;
+          margin-top: 2px;
         }
       }
     }
@@ -312,6 +321,9 @@ export default {
         line-height: 28px;
         margin-right: 10px;
       }
+      .date_pick{
+        margin-top: 5px;
+      }
     }
   }
   .count {

+ 6 - 1
src/views/data/UploadRecord.vue

@@ -217,7 +217,12 @@ export default {
       asc: this.asc,
     };
     this.getFirmsUploadList(res);
-  }
+  },
+  // beforeRouteEnter(to, from, next) {
+  //   console.log(to);
+  //   console.log(from);
+  //   next();
+  // }
 };
 </script>
 

+ 19 - 27
src/views/data/components/UploadLinkEditModal.vue

@@ -30,7 +30,7 @@
                 :key="index"
                 :value="item.typeName"
               >
-                {{ item.typeName || "123" }}
+                {{ item.typeName || "-" }}
               </option>
             </select>
           </div>
@@ -154,7 +154,7 @@ export default {
       ziliaoName: this.LinkData.informationName,
       ziliaoId: "",
       ziliaoTime: "",
-      carTypeValue: "1",
+      carTypeValue: "",
       carType: [],
       releaseC: this.LinkData.publishPlatformName, //'发布渠道',
       releaseChannel: [], // 发布渠道列表
@@ -165,9 +165,9 @@ export default {
       contentName2: this.LinkData.contentTypeName, //'内容分类',
       content2: [],
       readCount: 0,
-      goodCount: 1,
-      bbsCount: 1,
-      lookingCount: 2,
+      goodCount: 0,
+      bbsCount: 0,
+      lookingCount: 0,
       mediaTitle: this.LinkData.mediaTitle || "", //'文章标题',
       mediaUrl: this.LinkData.mediaUrl || "",
       dictList: [],
@@ -200,14 +200,16 @@ export default {
     },
     formatDateToDate: function (val) {
       this.ziliaoTime = "";
-      let date = new Date(val);
-      let y = date.getFullYear();
-      let m = date.getMonth() + 1;
-      m = m < 10 ? "0" + m : m;
-      let d = date.getDate();
-      d = d < 10 ? "0" + d : d;
-      const time = y + "-" + m + "-" + d;
-      this.ziliaoTime = time;
+      if (val) {
+        let date = new Date(val);
+        let y = date.getFullYear();
+        let m = date.getMonth() + 1;
+        m = m < 10 ? "0" + m : m;
+        let d = date.getDate();
+        d = d < 10 ? "0" + d : d;
+        const time = y + "-" + m + "-" + d;
+        this.ziliaoTime = time;        
+      }
     },
     // 判断非空
     beforeEdit: function () {
@@ -294,28 +296,23 @@ export default {
             informationName: this.ziliaoName,
             releaseTime: this.ziliaoTime,
             carType: this.carTypeValue,
-
             //发布平台  渠道
             releaseMedia: this.releaseC,
             //发布板块
             releasePlate: this.releaseP,
-
             draftGenre: this.contentName1,
-
             //内容分类2?
             contentClass: this.contentName2,
             articleTitle: this.mediaTitle,
             articleLink: this.mediaUrl,
-
             readCount: this.readCount,
             goodCount: this.goodCount,
             bbsCount: this.bbsCount,
             lookingCount: this.lookingCount,
-            //   informationId: "1386025423408103425"
           },
         };
         if (this.LinkData.id) {
-          config.url = "/updateDealerFeedback";
+          config.url = "/lexus_php/api/add_report.php";
           config.data.id = this.LinkData.id;
         } else {
           //新增
@@ -333,14 +330,9 @@ export default {
       this.ziliaoName = this.LinkData.informationName;
       this.carTypeValue = this.LinkData.carPlatformName;
       this.ziliaoId = this.LinkData.informationId;
-      let time = this.LinkData.publishDate; //发布时间
-      if (time.length > 4) {
-        let y = time.slice(0, 4);
-        let m = time.slice(5, 7);
-        let d = time.slice(8, 10);
-        let temp = y + "-" + m + "-" + d;
-        this.ziliaoTime = temp;
-      }
+      this.ziliaoTime = this.LinkData.publishDate; //发布时间
+      let dateArr = this.ziliaoTime.split('-');
+      this.datePickValue = Date.parse(new Date(dateArr[0], +dateArr[1]-1, +dateArr[2]));
       this.readCount = this.LinkData.readCount;
       this.goodCount = this.LinkData.goodCount;
       this.bbsCount = this.LinkData.bbsCount;

+ 11 - 9
src/views/data/components/addFeedbackMoal.vue

@@ -154,7 +154,7 @@ export default {
       datePickValue: "",
       limit: {},
       ziliaoTime: "",
-      carTypeValue: "1",
+      carTypeValue: "",
       carType: [],
       releaseC: "", //'发布渠道',
       releaseChannel: [], // 发布渠道列表
@@ -200,14 +200,16 @@ export default {
     },
     formatDateToDate: function (val) {
       this.ziliaoTime = "";
-      let date = new Date(val);
-      let y = date.getFullYear();
-      let m = date.getMonth() + 1;
-      m = m < 10 ? "0" + m : m;
-      let d = date.getDate();
-      d = d < 10 ? "0" + d : d;
-      const time = y + "-" + m + "-" + d;
-      this.ziliaoTime = time;
+      if (val) {
+        let date = new Date(val);
+        let y = date.getFullYear();
+        let m = date.getMonth() + 1;
+        m = m < 10 ? "0" + m : m;
+        let d = date.getDate();
+        d = d < 10 ? "0" + d : d;
+        const time = y + "-" + m + "-" + d;
+        this.ziliaoTime = time;        
+      }
     },
     // 判断非空
     beforeEdit: function () {