yangfan преди 2 години
родител
ревизия
4be025feb2

+ 34 - 128
admin/src/views/channel/channelEdit.vue

@@ -4,133 +4,52 @@
       <el-main>
         <!-- 二级 -->
         <template v-if="form.parentId || $route.query.type == 'erji'">
-          <el-form
-            ref="form"
-            :model="formm"
-            :rules="ruless"
-            label-width="160px"
-          >
+          <el-form ref="form" :model="formm" :rules="ruless" label-width="160px">
             <el-form-item label="渠道名称" prop="channelName">
-              <el-input
-                placeholder="请输入内容"
-                v-model="formm.channelName"
-                clearable
-                @blur="changeName"
-              ></el-input>
+              <el-input placeholder="请输入内容" v-model="formm.channelName" clearable @blur="changeName"></el-input>
               <!-- @change="changeInputer" -->
             </el-form-item>
             <el-form-item label="一级渠道">
-              <el-select
-                v-model="formm.parentId"
-                remote
-                reserve-keyword
-                placeholder="请输入关键词"
-                :loading="loading"
-              >
-                <el-option
-                  v-for="item in options"
-                  :key="item.id"
-                  :label="item.channelName"
-                  :value="item.id"
-                >
+              <el-select v-model="formm.parentId" remote reserve-keyword placeholder="请输入关键词" :loading="loading">
+                <el-option v-for="item in options" :key="item.id" :label="item.channelName" :value="item.id">
                 </el-option>
               </el-select>
             </el-form-item>
             <el-form-item label="二级编码">
-              <el-input
-                placeholder="自动生成"
-                v-model="formm.channelCode"
-                disabled
-                @change="changeInput"
-              ></el-input>
+              <el-input placeholder="自动生成" v-model="formm.channelCode" disabled @change="changeInput"></el-input>
             </el-form-item>
             <el-form-item label="完整编码">
-              <el-input
-                placeholder="自动生成"
-                v-model="formm.fullCode"
-                disabled
-                @change="changeInput"
-              ></el-input>
+              <el-input placeholder="自动生成" v-model="formm.fullCode" disabled @change="changeInput"></el-input>
             </el-form-item>
             <el-form-item label="key">
-              <el-input
-                placeholder="自动生成"
-                v-model="formm.channelKey"
-                disabled
-                @change="changeInput"
-              ></el-input>
+              <el-input placeholder="自动生成" v-model="formm.channelKey" disabled @change="changeInput"></el-input>
             </el-form-item>
             <el-form-item label="渠道类别" prop="channelType">
-              <el-select
-                v-model="formm.channelType"
-                clearable
-                placeholder="请选择"
-              >
-                <el-option
-                  v-for="item in typeList"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value"
-                >
+              <el-select v-model="formm.channelType" clearable placeholder="请选择">
+                <el-option v-for="item in typeList" :key="item.value" :label="item.label" :value="item.value">
                 </el-option>
               </el-select>
             </el-form-item>
             <el-form-item label="上线时间">
               <el-col :span="11">
-                <el-date-picker
-                  type="datetime"
-                  placeholder="选择日期"
-                  v-model="formm.onlineTime"
-                  start-placeholder="开始日期"
-                  end-placeholder="结束日期"
-                  range-separator="至"
-                  value-format="yyyy-MM-dd HH:mm:ss"
-                  style="width: 100%"
-                >
+                <el-date-picker type="datetime" placeholder="选择日期" v-model="formm.onlineTime" start-placeholder="开始日期" end-placeholder="结束日期" range-separator="至" value-format="yyyy-MM-dd HH:mm:ss" style="width: 100%">
                 </el-date-picker>
               </el-col>
             </el-form-item>
 
             <el-form-item label="绑定策略" prop="strategyId">
-              <el-select
-                v-model="formm.strategyId"
-                filterable
-                remote
-                reserve-keyword
-                placeholder="请输入关键词"
-                :loading="loading"
-              >
-                <el-option
-                  v-for="item in celueList"
-                  :key="item.id"
-                  :label="item.strategyName"
-                  :value="item.id"
-                >
+              <el-select v-model="formm.strategyId" filterable remote reserve-keyword placeholder="请输入关键词" :loading="loading">
+                <el-option v-for="item in celueList" :key="item.id" :label="item.strategyName" :value="item.id">
                 </el-option>
               </el-select>
               <span style="margin-left: 20px">
-                <el-button
-                  @click="refresh"
-                  icon="el-icon-refresh"
-                  size="mini"
-                  content="刷新"
-                ></el-button>
+                <el-button @click="refresh" icon="el-icon-refresh" size="mini" content="刷新"></el-button>
               </span>
               <span style="margin-left: 20px">
-                <el-button
-                  @click="toAdd"
-                  icon="el-icon-plus"
-                  size="mini"
-                  content="新建"
-                ></el-button>
+                <el-button @click="toAdd" icon="el-icon-plus" size="mini" content="新建"></el-button>
               </span>
               <span style="margin-left: 20px">
-                <el-button
-                  @click="toEdit(formm.strategyId)"
-                  icon="el-icon-edit"
-                  size="mini"
-                  content="编辑"
-                ></el-button>
+                <el-button @click="toEdit(formm.strategyId)" icon="el-icon-edit" size="mini" content="编辑"></el-button>
               </span>
             </el-form-item>
 
@@ -159,28 +78,14 @@
         <template v-else>
           <el-form ref="form" :model="form" :rules="rules" label-width="160px">
             <el-form-item label="渠道名称" prop="channelName">
-              <el-input
-                placeholder="请输入内容"
-                v-model="form.channelName"
-                clearable
-                @change="changeInput"
-              ></el-input>
+              <el-input placeholder="请输入内容" v-model="form.channelName" clearable @change="changeInput"></el-input>
             </el-form-item>
             <el-form-item label="一级编码">
               <el-input disabled v-model="form.channelCode"></el-input>
             </el-form-item>
             <el-form-item label="上线时间">
               <el-col :span="11">
-                <el-date-picker
-                  type="datetime"
-                  placeholder="选择日期"
-                  v-model="form.onlineTime"
-                  start-placeholder="开始日期"
-                  end-placeholder="结束日期"
-                  range-separator="至"
-                  value-format="yyyy-MM-dd HH:mm:ss"
-                  style="width: 100%"
-                >
+                <el-date-picker type="datetime" placeholder="选择日期" v-model="form.onlineTime" start-placeholder="开始日期" end-placeholder="结束日期" range-separator="至" value-format="yyyy-MM-dd HH:mm:ss" style="width: 100%">
                 </el-date-picker>
               </el-col>
             </el-form-item>
@@ -229,19 +134,20 @@ import XEUtils from "xe-utils";
 var text1 = "";
 export default {
   name: "SchemeEdit",
-  data() {
+  data () {
     return {
       form: {
-        channelPattern: "1",
-        channelStatus: "",
+
+        channelStatus: 1,
         parentId: 0,
       },
       formm: {
-        channelPattern: "",
-        channelStatus: "",
+        channelPattern: "1",
+        channelStatus: 1,
         parentId: this.$route.query.id,
         onlineTime: "",
         strategyId: "",
+        wotv: "1"
       },
       oldform: {},
 
@@ -315,7 +221,7 @@ export default {
       num: null,
     };
   },
-  created() {
+  created () {
     //获取策略
     get("/strategy/strategy-info/page", {
       pageSize: 100,
@@ -349,7 +255,7 @@ export default {
   methods: {
     //新增历史记录
 
-    addHistory(type, channelId, text) {
+    addHistory (type, channelId, text) {
       // createHistory({
       //   type: type,
       //   notes: text,
@@ -366,7 +272,7 @@ export default {
       });
     },
 
-    ontwo() {
+    ontwo () {
       var array1 = this.oldform;
       var array2 = this.formm;
       XEUtils.objectEach(array2, (item, key) => {
@@ -417,7 +323,7 @@ export default {
         addChannel(this.formm).then((res) => {
           if (res.data) {
             this.$message({
-              message: "编辑成功√",
+              message: "新增成功·√",
               type: "success",
             });
             setTimeout(() => {
@@ -429,7 +335,7 @@ export default {
     },
 
     //   点击提交
-    onSubmit() {
+    onSubmit () {
       this.$confirm("此操作将永久改变数据, 是否继续?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
@@ -491,14 +397,14 @@ export default {
         }
       });
     },
-    changeInput() {
+    changeInput () {
       this.form.channelName = this.form.channelName.includes("H5")
         ? this.form.channelName
         : `${this.form.channelName}H5`;
       // this.$set(this.form,'name',`${newV}H5`)
     },
 
-    close() {
+    close () {
       this.$confirm("此操作不会保存已编辑数据, 是否继续?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
@@ -514,16 +420,16 @@ export default {
           });
         });
     },
-    toAdd(e) {
+    toAdd (e) {
       this.$router.push("/schemeV2/schemeAdd");
     },
 
-    toEdit(id) {
+    toEdit (id) {
       this.$router.push("/schemeV2/schemeAdd?ids=" + id);
     },
 
     // },
-    refresh() {
+    refresh () {
       get("/strategy/strategy-info/page", {
         strategyType: 0,
         pageSize: 100,
@@ -535,7 +441,7 @@ export default {
     },
 
     // 渠道名称输入框失焦事件
-    changeName() {
+    changeName () {
       if (!this.num && !this.$route.query.ids)
         if (this.formm.channelName) {
           this.num = 1;

+ 2 - 2
admin/src/views/schemeGlobal/api.js

@@ -1,6 +1,6 @@
 import request from '@/utils/request'
 
-//获取全局策略管理列表
+//获取控制项列表
 export function listSchemeGlobal(query) {
   return request({
     url: '/strategy/global-info/page',
@@ -9,7 +9,7 @@ export function listSchemeGlobal(query) {
   })
 }
 
-// 获取控制项列表
+// 获取全局策略管理列表
 export function listItem(query) {
   return request({
     url: '/record/strategy-global-record/page',

+ 20 - 15
admin/src/views/schemeGlobal/index.vue

@@ -126,6 +126,7 @@ export default {
         cancelButtonText: '取消',
         type: 'warning'
       }).then(() => {
+        // console.log(this.form)
         addapplication(this.form).then(res => {
           this.$message({
             message: '操作成功',
@@ -151,7 +152,7 @@ export default {
       })
 
     },
-    // 订单列表
+    // 审核列表
     init () {
       listItem(this.searchForm).then(res => {
         this.tableData = res.data.list
@@ -192,7 +193,7 @@ export default {
         infoId: row.id,
         name: row.name,
         operDetail: 0,
-        status: 0,
+        status: 1,
         tag: row.tag,
         id: row.id
       }
@@ -210,25 +211,29 @@ export default {
       }).then(() => {
 
         let update = {
-          applicant: row.applicant,
-          applyReason: row.applyReason,
-          infoId: row.infoId,
+
           name: row.name,
-          operDetail: row.operDetail,
           status: obj.status,
           tag: row.tag,
           id: row.id
         }
-        console.log(update)
-        put('/strategy/global-info/update', update).then(res => {
-          this.$message({
-            message: "操作成功",
-            type: 'success',
-            duration: 3000,
-            offset: 360
+
+        put('/record/strategy-global-record/update', update).then(res => {
+          console.log(update)
+          put('/strategy/global-info/update', update).then(res => {
+            console.log(res)
+            this.$message({
+              message: "操作成功",
+              type: 'success',
+              duration: 3000,
+              offset: 360
+            })
+
+            this.getItemList()
           })
           this.init()
-          this.getItemList()
+
+
         })
       })
         .catch(() => {
@@ -243,7 +248,7 @@ export default {
 
     // 行颜色
     rowClassName ({ row, rowIndex }) {
-      console.log(row)
+
       if (row.status === 1) {
         return 'row-green'
       }

+ 22 - 15
admin/src/views/schemeGlobal/itemEdit.vue

@@ -28,7 +28,7 @@
 </template>
 
 <script>
-import { post, get } from '@/api/common'
+import { post, get, put } from '@/api/common'
 import { addchemeGlobal } from './api'
 export default {
   name: "itemEdit",
@@ -52,11 +52,15 @@ export default {
   },
   created () {
     document.title = '管理项登记'
-    if (this.$route.query.id) {
-      get('/strategyglobalinfo/page', { 'id': this.$route.query.id }).then(res => {
-        res = res.data.list[0];
-        this.form = res;
-        console.log(this.form)
+
+    if (this.$route.query.ids) {
+      console.log(this.$route.query.ids)
+      get('/strategy/global-info/list', { 'ids': this.$route.query.ids }).then(res => {
+        console.log(res.data)
+
+        this.form = res.data[0];
+        console.log(this.form, 'this.form')
+
 
       });
       this.btn = '修改'
@@ -72,15 +76,17 @@ export default {
       }).then(() => {
         this.$refs[formName].validate((valid) => {
           if (valid) {
-            if (this.$route.query.id) {
-              post('/strategyglobalinfo/update/' + this.$route.query.id, this.form).then(res => {
+            if (this.$route.query.ids) {
+              console.log(this.form)
+              put('/strategy/global-info/update', this.form).then(res => {
+
                 this.$message({
                   message: res.message,
                   type: 'success',
                   duration: 3000,
                   offset: 360
                 })
-                setTimeout(() => { this.$router.back()() }, 1200)
+                setTimeout(() => { this.$router.back() }, 1200)
               }).catch(error => {
                 console.log(error)
               })
@@ -109,12 +115,13 @@ export default {
             return false;
           }
         });
-      }).catch(() => {
-        this.$message({
-          type: 'info',
-          message: '已取消'
-        });
-      });
+      })
+      // .catch(() => {
+      //   this.$message({
+      //     type: 'info',
+      //     message: '已取消'
+      //   });
+      // });
     },
 
     // 取消按钮

+ 9 - 5
admin/src/views/schemeGlobal/itemGlobal.vue

@@ -21,7 +21,7 @@
           <el-table-column prop="createTime" label="创建时间" />
           <el-table-column prop="operDetail" label="操作">
             <template slot-scope="scope">
-              <el-button @click="toAdd(scope.row.id)" type="text" icon="el-icon-edit">编辑</el-button>
+              <el-button @click="toEdit(scope.row.id)" type="text" icon="el-icon-edit">编辑</el-button>
               <el-button @click="del(scope.row.id)" type="text" icon="el-icon-delete">删除</el-button>
             </template>
           </el-table-column>
@@ -59,9 +59,10 @@ export default {
     };
   },
   created () {
+
     console.log("用户:", this.$store.state.user.name);
     this.userName = this.$store.state.user.name;
-    this.init();
+
   },
   mounted () {
     this.init();
@@ -83,12 +84,15 @@ export default {
         this.tableData.forEach((item) => {
           item.createTime = getTime(item.createTime);
         });
-
+        console.log(111)
       })
     },
 
-    toAdd (e) {
-      this.$router.push("/schemeGlobal/itemEdit");
+    toAdd () {
+      this.$router.push("/schemeGlobal/itemEdit?");
+    },
+    toEdit (id) {
+      this.$router.push("/schemeGlobal/itemEdit?ids=" + id);
     },
     del (id) {
       this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", {