1
0

2 Commity f4a232d7b7 ... 0253552c05

Autor SHA1 Správa Dátum
  yangfan 0253552c05 Merge branch '1.0.0' of http://git.platomix.net/litong/purchase into 1.0.0 2 rokov pred
  yangfan 92823f588d 6.10 2 rokov pred

+ 20 - 33
admin/src/views/schemeV2/index.vue

@@ -28,7 +28,6 @@
         </el-form>
       </el-header>
 
-      <!--表格-->
       <vxe-toolbar>
         <template #buttons>
           <vxe-button icon="fa fa-plus" @click="toAdd" size="mini">新增</vxe-button>
@@ -36,8 +35,8 @@
           <vxe-button status="primary" style="float: right" icon="fa fa-plus" @click="value5 = true" size="mini">历史记录</vxe-button>
         </template>
       </vxe-toolbar>
-
-      <el-table :data="tableData" row-key="id" ref="xTable" @edit-closed="editClosedEvent" :edit-config="{ trigger: 'click', mode: 'cell', showStatus: true }">
+      <!--表格-->
+      <el-table :data="tableData" row-key="id" ref="xTable" :edit-config="{ trigger: 'click', mode: 'cell', showStatus: true }">
         <el-table-column prop="strategyName" label="策略名称" :edit-render="{ name: 'input' }"></el-table-column>
         <el-table-column prop="maskText" label="策略备注" align="center"></el-table-column>
         <el-table-column prop="strategyType" label="策略类型" align="center">
@@ -163,6 +162,21 @@ export default {
     };
   },
   mounted () {
+    get('/template/template-info/page', {
+      'pageSize': 100,
+      'pageNum': 1
+    }).then(res => {
+      console.log(res)
+      res.data.list.map(res => {
+        res.templatePhoto = process.env.VUE_APP_BASE_IMG_URL + res.templatePhoto
+        res.label = res.templateName
+        res.value = res.id
+      })
+      this.templateList = res.data.list
+      console.log(this.templateList)
+    })
+    this.init()
+
     this.init();
   },
   methods: {
@@ -190,41 +204,14 @@ export default {
         pageSize: 100,
         pageNo: 1,
       }).then((res) => {
-        console.log(res)
-        res.data.list.map((res) => {
-          res.templatePhoto =
-            process.env.VUE_APP_BASE_IMG_URL + res.templatePhoto;
-          // res.label = res.templateName;
-          res.value = res.id;
-        });
         this.total = res.data.total;
         this.tableData = res.data.list;
-        // console.log(tableData)
         this.tableData.forEach((item) => {
           item.createTime = getTime(item.createTime);
         });
       });
     },
-    editClosedEvent ({ row, column }) {
-      const $table = this.$refs.xTable;
-      const field = column.property;
-      const cellValue = row[field];
-      // 判断单元格值是否被修改
-      if ($table.isUpdateByRow(row, field)) {
-        setTimeout(() => {
-          let param = {};
-          param[field] = cellValue;
-          post("/strategyInfoNew/update/" + row.id, row).then((res) => {
-            this.$message({
-              message: res.message,
-              type: "success",
-            });
-          });
-          // 局部更新单元格为已保存状态
-          $table.reloadRow(row, null, field);
-        }, 300);
-      }
-    },
+
     reset (formName) {
       // 重置
       this.searchForm = {}
@@ -267,13 +254,13 @@ export default {
     handlePageChangeChannelog ({ currentPage, pageSize }) {
       this.schemelogParam.pageNum = currentPage;
       this.schemelogParam.pageSize = pageSize;
-      get("/strategyInfoNew/getlog", this.schemelogParam).then((res) => {
+      get("/record/strategy-record/page", this.schemelogParam).then((res) => {
         this.schemelog = res.data.list;
         this.schemelogParam.totalResult = res.data.total;
       });
     },
     searchEvent () {
-      get("/strategyInfoNew/getlog", this.schemelogParam).then((res) => {
+      get("/record/strategy-record/page", this.schemelogParam).then((res) => {
         this.schemelog = res.data.list;
         this.schemelogParam.totalResult = res.data.total;
       });

+ 55 - 30
admin/src/views/schemeV2/schemeAdd.vue

@@ -425,11 +425,8 @@
 </template>
 
 <script>
-import {
-  post,
-  get,
-  put
-} from "@/api/common";
+import { post, get, put } from "@/api/common";
+const XEUtils = require("xe-utils");
 
 function getArrayClassification (params) {
   var options = {
@@ -487,6 +484,7 @@ export default {
         activeEndTime: "23:59:59",
 
         // strategyId: "",
+        templateName: "",
         strategyName: "",
         strategyType: "",
         templateId: "",
@@ -513,6 +511,8 @@ export default {
       oldform: {},
       //扩展字段
       extJson: {
+        maskText: "",
+        maskText2: "",
         jiluBtn: "1",
         jihuoBtn: "1",
         memberBtn: "1",
@@ -680,7 +680,7 @@ export default {
           });
 
           this.weeks = weekList
-          // console.log(this.weeks);
+          console.log(this.weeks);
           // checkedWeeks.forEach((item) => {
           //   this.checkedWeeks.push(weekOptions[item]);
           // });
@@ -792,6 +792,7 @@ export default {
         res.templatePhoto = process.env.VUE_APP_BASE_IMG_URL + res.templatePhoto
       });
       this.templateList = res.data.list
+      console.log(this.templateList)
     });
 
     //获取策略列表
@@ -821,16 +822,16 @@ export default {
   },
   methods: {
     //新增历史记录
-    addHistory (type, strategyId, text, strategyName) {
-      post("/record/strategy-record/create", {
-        type: type,
-        notes: text,
-        strategyId: strategyId,
-        strategyName: strategyName
-      }).then((res) => {
-        console.log(res, "新增历史记录", notes);
-      });
-    },
+    // addHistory (type, strategyId, text, strategyName) {
+    //   post("/record/strategy-record/create", {
+    //     type: type,
+    //     notes: text,
+    //     strategyId: strategyId,
+    //     strategyName: strategyName
+    //   }).then((res) => {
+    //     console.log(res, "新增历史记录", notes);
+    //   });
+    // },
 
     onSubmit: function (formName) {
       this.$confirm(
@@ -872,25 +873,49 @@ export default {
                 .toString();
 
 
-              // var array1 = JSON.parse(JSON.stringify(this.oldform));
-              // var array2 = JSON.parse(JSON.stringify(this.form));
-              // XEUtils.objectEach(array2, (item, key) => {
-              //   if (item != array1[key]) {
-              //     text += `\n${key}:${array1[key]} 改为 ${item}`;
-              //   }
-              // });
-
-
-
-
+              var array1 = JSON.parse(JSON.stringify(this.oldform));
+              var array2 = JSON.parse(JSON.stringify(this.form));
+              console.log(array1, array2)
+              let text = "策略:" + this.form.strategyName;
+              XEUtils.objectEach(array2, (item, key) => {
+                if (item != array1[key]) {
+                  if (key == "extJson") {
+                    let ext = JSON.parse(item);
+                    if (array1[key]) {
+                      let arr = JSON.parse(array1[key]);
+                      XEUtils.objectEach(ext, (i, k) => {
+                        if (i != arr[k]) {
+                          text += `\n${k}:${arr[k]} 改为 ${i ? i : "空"}`;
+                        }
+                      });
+                    } else {
+                      XEUtils.objectEach(ext, (i, k) => {
+                        text += `\n${k}:空 改为 ${i ? i : "空"}`;
+                      });
+                    }
+                  } else {
+                    text += `\n${key}:${array1[key]} 改为 ${item ? item : "空"
+                      }`;
+                  }
+                }
+              });
+              // console.log(text)
 
               //编辑操作记录
               if (this.$route.query.ids) {
-
-
                 this.id = this.$route.ids;
 
-
+                post("/record/strategy-record/create", {
+                  type: array2.activityType ? array2.activityType : 0,
+                  notes: text,
+                  strategyId: array2.id,
+                  strategyName: array2.strategyName,
+                }).then(res => {
+                  console.log(
+                    type, notes, strategyId, strategyName
+                  )
+                  console.log(res, 编辑操作记录)
+                })
                 //修改
                 put("/strategy/strategy-info/update", this.form).then((res) => {