Browse Source

新旧值比较

QuKatie 3 năm trước cách đây
mục cha
commit
3586f3b8a6

+ 1 - 0
src/components/fee-info/main.vue

@@ -82,6 +82,7 @@
       width="60%"
       :close-on-click-modal="false"
       @closed="feeClose"
+      v-dialog-drag
     >
       <el-row style="height: 0;">
         <el-col :span="5">

+ 1 - 0
src/components/flow-dialog/main.vue

@@ -5,6 +5,7 @@
     width="60%"
     :before-close="onClose"
     append-to-body
+    v-dialog-drag
   >
     <slot name='content'></slot>
     <avue-form :option="option" v-model="query"></avue-form>

+ 1 - 0
src/components/port-info/index.vue

@@ -15,6 +15,7 @@
       width="60%"
       append-to-body
       @closed="closed"
+      v-dialog-drag
     >
       <span>
         <el-row>

+ 1 - 0
src/components/report-dialog/main.vue

@@ -5,6 +5,7 @@
     width="60%"
     :before-close="onClose"
     append-to-body
+    v-dialog-drag
   >
     <avue-crud
       :option="option"

+ 1 - 0
src/components/upload-file/config/uploadList.json

@@ -12,6 +12,7 @@
   "menuWidth": 150,
   "align":"center",
   "addBtnText": "上传",
+  "dialogDrag":true,
   "column":[
     {
       "label": "排序",

+ 45 - 0
src/util/contrastData.js

@@ -0,0 +1,45 @@
+//比较对象的值
+export function contrastObj(newval, oldval) {
+  var reg = /^[A-Za-z]+$/;
+  for (let newitem in newval) {
+    for (let olditem in oldval) {
+      if (!reg.test(newitem)) {
+        delete newval.newitem
+      }
+      if (!reg.test(oldval)) {
+        delete oldval.olditem
+      }
+      if (newitem == olditem) {
+        if (newval[newitem] != oldval[olditem]) {
+          return true
+        }
+      }
+    }
+  }
+  return false
+}
+//比较数组的值
+export function contrastList(newlist, oldlist) {
+  if (newlist.length != oldlist.length) {
+    return true
+  }
+  let reg = /^[A-Za-z]+$/;
+  for (var i = 0; i < newlist.length; i++) {
+    for (let newitem in newlist[i]) {
+      for (let olditem in oldlist[i]) {
+        if (!reg.test(newitem)) {
+          delete newlist[i].newitem
+        }
+        if (!reg.test(oldlist[i])) {
+          delete oldlist[i].olditem
+        }
+        if (newitem == olditem) {
+          if (newlist[i][newitem] != oldlist[i][olditem]) {
+            return true
+          }
+        }
+      }
+    }
+  }
+  return false;
+}

+ 12 - 2
src/views/exportTrade/customerInquiry/detailsPage.vue

@@ -252,6 +252,7 @@ import {
 } from "@/api/basicData/customerInquiry";
 import reportDialog from "@/components/report-dialog/main";
 import { isDiscount, isPercentage, micrometerFormat } from "@/util/validate";
+import { contrastObj,contrastList } from "@/util/contrastData";
 import _ from "lodash";
 export default {
   name: "detailsPageEdit",
@@ -457,7 +458,9 @@ export default {
       goodsList: [],
       selectionList: [],
       treeDeptId: null,
-      orderFeesList: []
+      orderFeesList: [],
+      oldform: {},
+      olddata:[]
     };
   },
   props: {
@@ -643,7 +646,9 @@ export default {
     getDetail(id) {
       detail(id).then(res => {
         this.form = res.data.data;
+        this.oldform = res.data.data;
         this.data = res.data.data.orderItemsList;
+        this.olddata= this.deepClone(res.data.data.orderFeesList);
         this.orderFeesList = res.data.data.orderFeesList;
         this.configuration.dicData = this.form.corpName;
       });
@@ -673,8 +678,10 @@ export default {
             if (res.data.code == 200) {
               this.$message.success(this.form.id ? "修改成功" : "提交成功");
               this.form = res.data.data;
+              this.oldform = res.data.data;
               this.data = res.data.data.orderItemsList;
               this.orderFeesList = res.data.data.orderFeesList;
+              this.olddata= this.deepClone(res.data.data.orderFeesList);
             }
           });
         } else {
@@ -684,7 +691,10 @@ export default {
     },
     //返回列表
     backToList() {
-      this.$emit("goBack");
+      console.log(contrastObj(this.form,this.oldform))
+      
+      console.log(contrastList(this.orderFeesList,this.olddata))
+      // this.$emit("goBack");
     },
     openReport() {
       this.switchDialog = !this.switchDialog;