Pārlūkot izejas kodu

Merge branch 'master' of http://47.107.53.207:3000/ymy/oms

# Conflicts:
#	src/benyun/utils/auth.ts
ymy 6 mēneši atpakaļ
vecāks
revīzija
5ea340a009

+ 2 - 2
src/views/packing/setupPacking/components/openLogModal.vue

@@ -76,7 +76,7 @@ export default class openLogModal extends Vue {
 
   setShow(v: boolean) {
     this.hideBtn = false;
-    console.log("数据111111111========", v);
+    // console.log("数据111111111========", v);
     this.value = v;
   }
   mounted(){
@@ -90,7 +90,7 @@ export default class openLogModal extends Vue {
       const datas:string|null = localStorage.getItem("logLsit");
     if(datas){
       let data=JSON.parse(datas)
-      this.data=data.reverse();
+      this.data=data;
       this.page.total=data.length
       // let height = (document.getElementById('openLogModal') as any).parentNode.offsetHeight;
       // this.config.attr.height=height - 36;

+ 22 - 8
src/views/packing/setupPacking/index.vue

@@ -31,11 +31,12 @@ import { Component, Prop, Vue, Watch } from "vue-property-decorator";
 export default class packing extends Vue {
   form = {
     userName: (this as any).$store.getters.userInfo.userName,
-    content: "",
-    createTime: "",
+    content: '',
+    createTime: '',
   };
   index = 0;
   data: Array<any> = [];
+  data1: Array<any> = [];
   saveLog() {
     const now = new Date();
     this.form.createTime = now.toLocaleString();
@@ -47,12 +48,25 @@ export default class packing extends Vue {
       });
       // const aa=this.form
       this.index++;
-      console.log("this.index========", this.index);
-      // if()
-      let from = JSON.stringify(this.form);
-      this.data.push(JSON.parse(from));
-      localStorage.setItem('logLsit', JSON.stringify(this.data));
-      console.log("提交的数据========", this.data);
+
+      const datas: string | null = localStorage.getItem("logLsit");
+      console.log("datas========", datas);
+      let data1:any=[]
+      if (datas) {
+        let from = JSON.stringify(this.form);
+        // this.data1.push(JSON.parse(from));
+        // let from = JSON.stringify(this.form);
+        data1.push(JSON.parse(from));
+        let datacun = JSON.parse(datas);
+        this.data = data1.concat(datacun);
+        localStorage.setItem("logLsit", JSON.stringify(this.data));
+        console.log("提交的数据1========", this.data);
+      } else {
+        let from = JSON.stringify(this.form);
+        this.data.push(JSON.parse(from));
+        localStorage.setItem("logLsit", JSON.stringify(this.data));
+        console.log("提交的数据2========", this.data);
+      }
     } else {
       this.$message({
         message: "输入内容不能为空!",