Bladeren bron

Merge branch 'new' of http://git.platomix.net/litong/purchase into new

yangfan 2 jaren geleden
bovenliggende
commit
b5c7b26b7f

+ 61 - 61
purchase_ao/src/views/productV2/addProduct.vue

@@ -324,67 +324,67 @@ export default {
         row.threshold = row.threshold ? row.threshold : 0;
         this.form = row;
         this.form.productName = row.productName + " 副本";
-        // if (row.bannerPics) {
-        //   this.imgUrl = JSON.parse(row.bannerPics)
-        //   if (this.imgUrl[0] !== '' && this.imgUrl[0] !== null && this.imgUrl[0]) {
-        //     this.bannerUrl = process.env.VUE_APP_BASE_IMG_URL + this.imgUrl[0];
-        //   }
-        //   if (this.imgUrl[2] !== '' && this.imgUrl[2] !== null && this.imgUrl[2]) {
-        //     this.bannerUrl2 = process.env.VUE_APP_BASE_IMG_URL + this.imgUrl[2];
-        //   }
-        //   if (this.imgUrl[3] !== '' && this.imgUrl[3]) {
-        //     this.bannerUrl3 = process.env.VUE_APP_BASE_IMG_URL + this.imgUrl[3];
-        //   }
-        //   if (this.imgUrl[1] !== '' && this.imgUrl[1] !== null && this.imgUrl[1]) {
-        //     this.svgUrl = process.env.VUE_APP_BASE_IMG_URL + this.imgUrl[1];
-        //     this.lottie = lottie.loadAnimation({
-        //       container: document.getElementById('lottie_box'),
-        //       renderer: 'svg',
-        //       loop: true,
-        //       autoplay: true,
-        //       path: this.svgUrl
-        //     })
-        //   }
-        // }
-        // if (row.logoPic) {
-        //   this.logoUrl = process.env.VUE_APP_BASE_IMG_URL + "/" + row.logoPic;
-        // }
-        // this.addColors.thc = {
-        //   s: JSON.parse(row.themeColor)[0],
-        //   e: JSON.parse(row.themeColor)[1],
-        // };
-        // this.addColors.bgc = {
-        //   s: JSON.parse(row.bgColor)[0],
-        //   e: JSON.parse(row.bgColor)[1],
-        //   ss: JSON.parse(row.bgColor)[2],
-        //   ee: JSON.parse(row.bgColor)[3],
-        // };
-        // if (JSON.parse(row.guidancePic).p) {
-        //   this.guideUrlP =
-        //     process.env.VUE_APP_BASE_IMG_URL + JSON.parse(row.guidancePic).p;
-        //   this.guidancePic.p = JSON.parse(row.guidancePic).p;
-        // }
-        // if (JSON.parse(row.guidancePic).c) {
-        //   this.guideUrlC =
-        //     process.env.VUE_APP_BASE_IMG_URL + JSON.parse(row.guidancePic).c;
-        //   this.guidancePic.c = JSON.parse(row.guidancePic).c;
-        // }
-        // if (row.cacheSeatOne !== null) {
-        //   let arr = JSON.parse(row.cacheSeatOne)
-        //   let list = []
-        //   arr.forEach(val => {
-        //     if (!val.tabC) {
-        //       val.tabC = {
-        //         s: "",
-        //         e: ""
-        //       }
-        //     } else if (!val.dongHua) {
-        //       val.dongHua = '0'
-        //     }
-        //     list.push(val)
-        //   });
-        //   this.productJson = list;
-        // }
+        if (row.bannerPics) {
+          this.imgUrl = JSON.parse(row.bannerPics)
+          if (this.imgUrl[0] !== '' && this.imgUrl[0] !== null && this.imgUrl[0]) {
+            this.bannerUrl = process.env.VUE_APP_BASE_IMG_URL + this.imgUrl[0];
+          }
+          if (this.imgUrl[2] !== '' && this.imgUrl[2] !== null && this.imgUrl[2]) {
+            this.bannerUrl2 = process.env.VUE_APP_BASE_IMG_URL + this.imgUrl[2];
+          }
+          if (this.imgUrl[3] !== '' && this.imgUrl[3]) {
+            this.bannerUrl3 = process.env.VUE_APP_BASE_IMG_URL + this.imgUrl[3];
+          }
+          if (this.imgUrl[1] !== '' && this.imgUrl[1] !== null && this.imgUrl[1]) {
+            this.svgUrl = process.env.VUE_APP_BASE_IMG_URL + this.imgUrl[1];
+            this.lottie = lottie.loadAnimation({
+              container: document.getElementById('lottie_box'),
+              renderer: 'svg',
+              loop: true,
+              autoplay: true,
+              path: this.svgUrl
+            })
+          }
+        }
+        if (row.logoPic) {
+          this.logoUrl = process.env.VUE_APP_BASE_IMG_URL + "/" + row.logoPic;
+        }
+        this.addColors.thc = {
+          s: JSON.parse(row.themeColor)[0],
+          e: JSON.parse(row.themeColor)[1],
+        };
+        this.addColors.bgc = {
+          s: JSON.parse(row.bgColor)[0],
+          e: JSON.parse(row.bgColor)[1],
+          ss: JSON.parse(row.bgColor)[2],
+          ee: JSON.parse(row.bgColor)[3],
+        };
+        if (JSON.parse(row.guidancePic).p) {
+          this.guideUrlP =
+            process.env.VUE_APP_BASE_IMG_URL + JSON.parse(row.guidancePic).p;
+          this.guidancePic.p = JSON.parse(row.guidancePic).p;
+        }
+        if (JSON.parse(row.guidancePic).c) {
+          this.guideUrlC =
+            process.env.VUE_APP_BASE_IMG_URL + JSON.parse(row.guidancePic).c;
+          this.guidancePic.c = JSON.parse(row.guidancePic).c;
+        }
+        if (row.cacheSeatOne !== null) {
+          let arr = JSON.parse(row.cacheSeatOne)
+          let list = []
+          arr.forEach(val => {
+            if (!val.tabC) {
+              val.tabC = {
+                s: "",
+                e: ""
+              }
+            } else if (!val.dongHua) {
+              val.dongHua = '0'
+            }
+            list.push(val)
+          });
+          this.productJson = list;
+        }
       });
     }
     // this.getProductList()

+ 61 - 61
purchase_ao/src/views/productV2/editProduct.vue

@@ -299,67 +299,67 @@ export default {
       let row = res.data.list[0];
       row.threshold = row.threshold ? row.threshold : 0;
       this.form = row;
-      // if (row.bannerPics) {
-      //   this.imgUrl = JSON.parse(row.bannerPics);
-      //   if (this.imgUrl[0] !== "" && this.imgUrl[0] !== null && this.imgUrl[0]) {
-      //     this.bannerUrl = process.env.VUE_APP_BASE_IMG_URL + this.imgUrl[0];
-      //   }
-      //   if (this.imgUrl[2] !== "" && this.imgUrl[2] !== null && this.imgUrl[2]) {
-      //     this.bannerUrl2 = process.env.VUE_APP_BASE_IMG_URL + this.imgUrl[2];
-      //   }
-      //   if (this.imgUrl[3] !== '' && this.imgUrl[3]) {
-      //     this.bannerUrl3 = process.env.VUE_APP_BASE_IMG_URL + this.imgUrl[3];
-      //   }
-      //   if (this.imgUrl[1] !== "" && this.imgUrl[1] !== null && this.imgUrl[1]) {
-      //     this.svgUrl = process.env.VUE_APP_BASE_IMG_URL + this.imgUrl[1];
-      //     this.lottie = lottie.loadAnimation({
-      //       container: document.getElementById("lottie_box"),
-      //       renderer: "svg",
-      //       loop: true,
-      //       autoplay: true,
-      //       path: this.svgUrl,
-      //     });
-      //   }
-      // }
-      // if (row.logoPic) {
-      //   this.logoUrl = process.env.VUE_APP_BASE_IMG_URL + "/" + row.logoPic;
-      // }
-      // this.addColors.thc = {
-      //   s: JSON.parse(row.themeColor)[0],
-      //   e: JSON.parse(row.themeColor)[1],
-      // };
-      // this.addColors.bgc = {
-      //   s: JSON.parse(row.bgColor)[0],
-      //   e: JSON.parse(row.bgColor)[1],
-      //   ss: JSON.parse(row.bgColor)[2],
-      //   ee: JSON.parse(row.bgColor)[3],
-      // };
-      // if (JSON.parse(row.guidancePic).p) {
-      //   this.guideUrlP =
-      //     process.env.VUE_APP_BASE_IMG_URL + JSON.parse(row.guidancePic).p;
-      //   this.guidancePic.p = JSON.parse(row.guidancePic).p;
-      // }
-      // if (JSON.parse(row.guidancePic).c) {
-      //   this.guideUrlC =
-      //     process.env.VUE_APP_BASE_IMG_URL + JSON.parse(row.guidancePic).c;
-      //   this.guidancePic.c = JSON.parse(row.guidancePic).c;
-      // }
-      // if (row.cacheSeatOne !== null) {
-      //   let arr = JSON.parse(row.cacheSeatOne)
-      //   let list = []
-      //   arr.forEach(val => {
-      //     if (!val.tabC) {
-      //       val.tabC = {
-      //         s: "",
-      //         e: ""
-      //       }
-      //     } else if (!val.dongHua) {
-      //       val.dongHua = '0'
-      //     }
-      //     list.push(val)
-      //   });
-      //   this.productJson = list;
-      // }
+      if (row.bannerPics) {
+        this.imgUrl = JSON.parse(row.bannerPics);
+        if (this.imgUrl[0] !== "" && this.imgUrl[0] !== null && this.imgUrl[0]) {
+          this.bannerUrl = process.env.VUE_APP_BASE_IMG_URL + this.imgUrl[0];
+        }
+        if (this.imgUrl[2] !== "" && this.imgUrl[2] !== null && this.imgUrl[2]) {
+          this.bannerUrl2 = process.env.VUE_APP_BASE_IMG_URL + this.imgUrl[2];
+        }
+        if (this.imgUrl[3] !== '' && this.imgUrl[3]) {
+          this.bannerUrl3 = process.env.VUE_APP_BASE_IMG_URL + this.imgUrl[3];
+        }
+        if (this.imgUrl[1] !== "" && this.imgUrl[1] !== null && this.imgUrl[1]) {
+          this.svgUrl = process.env.VUE_APP_BASE_IMG_URL + this.imgUrl[1];
+          this.lottie = lottie.loadAnimation({
+            container: document.getElementById("lottie_box"),
+            renderer: "svg",
+            loop: true,
+            autoplay: true,
+            path: this.svgUrl,
+          });
+        }
+      }
+      if (row.logoPic) {
+        this.logoUrl = process.env.VUE_APP_BASE_IMG_URL + "/" + row.logoPic;
+      }
+      this.addColors.thc = {
+        s: JSON.parse(row.themeColor)[0],
+        e: JSON.parse(row.themeColor)[1],
+      };
+      this.addColors.bgc = {
+        s: JSON.parse(row.bgColor)[0],
+        e: JSON.parse(row.bgColor)[1],
+        ss: JSON.parse(row.bgColor)[2],
+        ee: JSON.parse(row.bgColor)[3],
+      };
+      if (JSON.parse(row.guidancePic).p) {
+        this.guideUrlP =
+          process.env.VUE_APP_BASE_IMG_URL + JSON.parse(row.guidancePic).p;
+        this.guidancePic.p = JSON.parse(row.guidancePic).p;
+      }
+      if (JSON.parse(row.guidancePic).c) {
+        this.guideUrlC =
+          process.env.VUE_APP_BASE_IMG_URL + JSON.parse(row.guidancePic).c;
+        this.guidancePic.c = JSON.parse(row.guidancePic).c;
+      }
+      if (row.cacheSeatOne !== null) {
+        let arr = JSON.parse(row.cacheSeatOne)
+        let list = []
+        arr.forEach(val => {
+          if (!val.tabC) {
+            val.tabC = {
+              s: "",
+              e: ""
+            }
+          } else if (!val.dongHua) {
+            val.dongHua = '0'
+          }
+          list.push(val)
+        });
+        this.productJson = list;
+      }
     });
   },
   mounted () {

+ 171 - 202
purchase_ao/src/views/schemeV2/channel.vue

@@ -1,219 +1,188 @@
 <template>
-    <div>
-        <el-container>
-            <!--搜索-->
-            <el-header class="searchBox">
-                <el-form :inline="true" :model="searchForm" ref="searchForm" class="demo-form-inline">
-                    <el-form-item label="渠道名称">
-                        <el-input v-model="searchForm.channelName" name="searchForm.channelName" placeholder="策略名称"/>
-                    </el-form-item>
-                    <el-form-item label="合作方">
-                        <el-input v-model="searchForm.channelPartner" placeholder="合作方"/>
-                    </el-form-item>
+  <div>
+    <el-container>
+      <!--搜索-->
+      <el-header class="searchBox">
+        <el-form :inline="true" :model="searchForm" ref="searchForm" class="demo-form-inline">
+          <el-form-item label="渠道名称">
+            <el-input v-model="searchForm.channelName" name="searchForm.channelName" placeholder="策略名称" />
+          </el-form-item>
+          <el-form-item label="合作方">
+            <el-input v-model="searchForm.channelPartner" placeholder="合作方" />
+          </el-form-item>
 
-                    <el-form-item style="float: right">
-                        <el-button type="primary" @click="init()">搜索</el-button>
-                        <el-button @click="reset('searchForm')">重置</el-button>
-                    </el-form-item>
-                </el-form>
-            </el-header>
-            <!--表格-->
-            <el-main class="tableBox">
-                <vxe-toolbar>
-                    <template #buttons>
-                        <vxe-button icon="fa fa-plus" @click="toEdit">新增</vxe-button>
-                        <vxe-button icon="fa fa-plus" @click="init()">刷新</vxe-button>
-                        <vxe-button icon="fa fa-plus" class="type--button theme--info"  @click="toSubChannel">二级渠道查询</vxe-button>
-                    </template>
-                </vxe-toolbar>
-                <vxe-table
-                        border
-                        resizable
-                        keep-source
-                        show-overflow
-                        highlight-hover-row
-                        ref="xTable"
-                        :data="tableData"
-                        :edit-config="{trigger: 'click', mode: 'cell', showStatus: true, }"
-                        @edit-closed="editClosedEvent"
-                >
-                    <vxe-table-column
-                            field="channelName"
-                            title="一级渠道名称"
-                    />
-                    <vxe-table-column
-                            field="unicomContacts"
-                            title="负责人"
-                    />
-                    <vxe-table-column
-                            field="channelPartner"
-                            title="合作方"
-                    />
-                    <vxe-table-column
-                            field="channelCode"
-                            title="渠道编码"
-                    />
-                    <vxe-table-column
-                            field="channelStatus"
-                            title="状态"
-                            :edit-render="{name: '$select', options: strategyStatus}"
-                    />
-                    <vxe-table-column
-                            field="onlineTime"
-                            title="生效时间"
-                    />
-                    <vxe-table-column title="操作" width="220">
-                        <template #default="{ row }">
-                            <vxe-button @click="toView(row)">查询</vxe-button>
-                            <vxe-button @click="toEdit(row)">编辑</vxe-button>
-                            <vxe-button @click="del(row)">删除</vxe-button>
-                        </template>
-                    </vxe-table-column>
-                </vxe-table>
-                <vxe-pager
-                        :loading="loading"
-                        :current-page="searchForm.pageNum"
-                        :page-size="searchForm.pageSize"
-                        :total="searchForm.totalResult"
-                        :layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"
-                        @page-change="handlePageChange"
-                />
-            </el-main>
-        </el-container>
-    </div>
+          <el-form-item style="float: right">
+            <el-button type="primary" @click="init()">搜索</el-button>
+            <el-button @click="reset('searchForm')">重置</el-button>
+          </el-form-item>
+        </el-form>
+      </el-header>
+      <!--表格-->
+      <el-main class="tableBox">
+        <vxe-toolbar>
+          <template #buttons>
+            <vxe-button icon="fa fa-plus" @click="toEdit">新增</vxe-button>
+            <vxe-button icon="fa fa-plus" @click="init()">刷新</vxe-button>
+            <vxe-button icon="fa fa-plus" class="type--button theme--info" @click="toSubChannel">二级渠道查询</vxe-button>
+          </template>
+        </vxe-toolbar>
+        <vxe-table border resizable keep-source show-overflow highlight-hover-row ref="xTable" :data="tableData">
+          <vxe-table-column field="channelName" title="一级渠道名称" />
+          <vxe-table-column field="unicomContacts" title="负责人" />
+          <vxe-table-column field="channelPartner" title="合作方" />
+          <vxe-table-column field="channelCode" title="渠道编码" />
+          <vxe-table-column title="状态">
+            <template #default="{ row }">
+              <span v-if="row.channelStatus === 1" style="color:#67C23A">生效中</span>
+              <span v-else-if="row.channelStatus ===0" style="color:#F56C6C">未生效</span>
+            </template>
+          </vxe-table-column>
+          <vxe-table-column field="onlineTime" title="生效时间" />
+          <vxe-table-column title="操作" width="220">
+            <template #default="{ row }">
+              <vxe-button @click="toView(row)">查询</vxe-button>
+              <vxe-button @click="toEdit(row)">编辑</vxe-button>
+              <vxe-button @click="del(row)">删除</vxe-button>
+            </template>
+          </vxe-table-column>
+        </vxe-table>
+        <vxe-pager :loading="loading" :current-page="searchForm.pageNum" :page-size="searchForm.pageSize" :total="searchForm.totalResult" :layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']" @page-change="handlePageChange" />
+      </el-main>
+    </el-container>
+  </div>
 </template>
 
 <script>
-    import {post, get} from '@/api/common'
+import { post, get } from '@/api/common'
 
-    export default {
-        name: 'Channel',
-        data() {
-            return {
-                //  搜索相关内容
-                searchForm: {
-                    channelName: '',
-                    channelPartner: '',
-                    parentId: 0,
-                    pageNum: 1,
-                    pageSize: 10,
-                    totalResult: 0
-                },
-                // 表格数据
-                loading: false,
-                tableData: [],
-                strategyStatus: [
-                    {label: '生效中', value: '1'},
-                    {label: '未生效', value: '0'}
-                ],
-                strategyType: [
-                    {label: '基本策略', value: '0'},
-                    {label: '活动策略', value: '1'}
-                ],
-            }
-        },
-        mounted() {
-            this.init()
-        },
-        methods: {
-            init() {
-                get('/channelInfo/page', this.searchForm).then(res => {
-                    this.tableData = res.data.list
-                    this.searchForm.totalResult = res.data.total
-                })
-            },
-            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('/channelInfo/update/' + row.id, row).then(res => {
-                            this.$message({
-                                message: res.message,
-                                type: 'success'
-                            });
-                        })
-                        // 局部更新单元格为已保存状态
-                        $table.reloadRow(row, null, field)
-                    }, 300)
-                }
-            },
-            reset(formName) { // 重置
-                this.searchForm = {}
-                get('/channelInfo/page', {}).then(res => {
-                    this.tableData = res.data.list
-                })
-            },
-            toView(e) {
-                const routeUrl = this.$router.resolve({path: '/schemeV2/channelView', query: {id: e.id}})
-                window.open(routeUrl.href, '_blank')
-            },
-            toEdit(e) {
-                const routeUrl = this.$router.resolve({path: '/schemeV2/channelEdit', query: {id: e.id}})
-                window.open(routeUrl.href, '_blank')
-            },
-            toSubChannel(e) {
-                const routeUrl = this.$router.resolve({path: '/schemeV2/channelSubList', query: {id: e.id}})
-                window.open(routeUrl.href, '_blank')
-            },
-            handlePageChange({currentPage, pageSize}) {
-                this.searchForm.pageNum = currentPage
-                this.searchForm.pageSize = pageSize
-                this.init()
-            },
-            del(row) {
-                this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
-                    confirmButtonText: '确定',
-                    cancelButtonText: '取消',
-                    type: 'warning'
-                }).then(() => {
-                    const $table = this.$refs.xTable
-                    $table.remove(row)
-                    post('/channelInfo/delete', {'ids': [row.id]}).then(res => {
-                    })
-                }).catch(() => {
-                    this.$message({
-                        type: 'info',
-                        message: '已取消删除'
-                    });
-                });
-            }
-        }
+export default {
+  name: 'Channel',
+  data () {
+    return {
+      //  搜索相关内容
+      searchForm: {
+        channelName: '',
+        channelPartner: '',
+        parentId: 0,
+        pageNum: 1,
+        pageSize: 10,
+        totalResult: 0
+      },
+      // 表格数据
+      loading: false,
+      tableData: [],
+      strategyStatus: [
+        { label: '生效中', value: '1' },
+        { label: '未生效', value: '0' }
+      ],
+      strategyType: [
+        { label: '基本策略', value: '0' },
+        { label: '活动策略', value: '1' }
+      ],
     }
+  },
+  mounted () {
+    this.init()
+  },
+  methods: {
+    init () {
+      get('/channelInfo/page', this.searchForm).then(res => {
+        this.tableData = res.data.list
+        this.searchForm.totalResult = res.data.total
+      })
+    },
+    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('/channelInfo/update/' + row.id, row).then(res => {
+            this.$message({
+              message: res.message,
+              type: 'success'
+            });
+          })
+          // 局部更新单元格为已保存状态
+          $table.reloadRow(row, null, field)
+        }, 300)
+      }
+    },
+    reset (formName) { // 重置
+      this.searchForm = {}
+      get('/channelInfo/page', {}).then(res => {
+        this.tableData = res.data.list
+      })
+    },
+    toView (e) {
+      const routeUrl = this.$router.resolve({ path: '/schemeV2/channelView', query: { id: e.id } })
+      window.open(routeUrl.href, '_blank')
+    },
+    toEdit (e) {
+      const routeUrl = this.$router.resolve({ path: '/schemeV2/channelEdit', query: { id: e.id } })
+      window.open(routeUrl.href, '_blank')
+    },
+    toSubChannel (e) {
+      const routeUrl = this.$router.resolve({ path: '/schemeV2/channelSubList', query: { id: e.id } })
+      window.open(routeUrl.href, '_blank')
+    },
+    handlePageChange ({ currentPage, pageSize }) {
+      this.searchForm.pageNum = currentPage
+      this.searchForm.pageSize = pageSize
+      this.init()
+    },
+    del (row) {
+      this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        const $table = this.$refs.xTable
+        $table.remove(row)
+        post('/channelInfo/delete', { 'ids': [row.id] }).then(res => {
+        })
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消删除'
+        });
+      });
+    }
+  }
+}
 </script>
 
 <style lang="scss">
-    .searchBox {
-        background-color: #fff;
-        border-radius: 4px;
-        box-shadow: #bfbfbf 0 0 2px;
-        height: unset !important;
-        padding: 10px 10px;
+.searchBox {
+  background-color: #fff;
+  border-radius: 4px;
+  box-shadow: #bfbfbf 0 0 2px;
+  height: unset !important;
+  padding: 10px 10px;
 
-        form {
-            margin: auto;
+  form {
+    margin: auto;
 
-            .el-form-item {
-                margin: 5px 5px;
-            }
-        }
+    .el-form-item {
+      margin: 5px 5px;
     }
+  }
+}
 
-    .tableBox {
-        margin-top: 10px;
-        background-color: #fff;
-        border-radius: 4px;
-        box-shadow: #bfbfbf 0 0 2px;
+.tableBox {
+  margin-top: 10px;
+  background-color: #fff;
+  border-radius: 4px;
+  box-shadow: #bfbfbf 0 0 2px;
 
-        .block {
-            .el-pagination {
-                margin-top: 30px;
-                float: right;
-            }
-        }
+  .block {
+    .el-pagination {
+      margin-top: 30px;
+      float: right;
     }
+  }
+}
 </style>

+ 7 - 2
purchase_ao/src/views/schemeV2/channelSubList.vue

@@ -21,7 +21,7 @@
       </el-header>
       <!--表格-->
       <el-main class="tableBox">
-        <vxe-table border resizable keep-source highlight-hover-row ref="xTable" :data="tableData" :edit-config="{trigger: 'click', mode: 'cell', showStatus: true, }" @edit-closed="editClosedEvent">
+        <vxe-table border resizable keep-source highlight-hover-row ref="xTable" :data="tableData">
           <vxe-table-column field="channelName" title="渠道名称" />
           <vxe-table-column field="channelKey" title="渠道Key" width="120" />
           <vxe-table-column field="fullCode" title="完整渠道编码" width="120" />
@@ -35,7 +35,12 @@
               <span v-else style="color:#F56C6C">旧版本</span>
             </template>
           </vxe-table-column>
-          <vxe-table-column field="channelStatus" title="状态" :edit-render="{name: '$select', options: strategyStatus}" width="80" />
+          <vxe-table-column title="状态" width="80">
+            <template #default="{ row }">
+              <span v-if="row.channelStatus === 1" style="color:#67C23A">生效中</span>
+              <span v-else-if="row.channelStatus ===0" style="color:#F56C6C">未生效</span>
+            </template>
+          </vxe-table-column>
           <vxe-table-column field="onlineTime" title="生效时间" />
           <vxe-table-column title="操作" fixed="right" width="360">
             <template #default="{ row }">

+ 8 - 3
purchase_ao/src/views/schemeV2/channelView.vue

@@ -88,8 +88,8 @@
             <vxe-button @click="init()">刷新</vxe-button>
           </template>
         </vxe-toolbar>
-        <vxe-table border resizable keep-source highlight-hover-row ref="xTable" :data="tableData" :edit-config="{trigger: 'click', mode: 'cell', showStatus: true, }" @edit-closed="editClosedEvent">
-          <vxe-table-column field="channelName" title="渠道名称" :edit-render="{name: 'input'}" width="300" />
+        <vxe-table border resizable keep-source highlight-hover-row ref="xTable" :data="tableData">
+          <vxe-table-column field="channelName" title="渠道名称" />
           <vxe-table-column field="channelKey" title="渠道Key" width="120" />
           <vxe-table-column field="fullCode" title="完整渠道编码" width="120" />
           <vxe-table-column field="channelType" title="渠道类别" width="160" />
@@ -100,7 +100,12 @@
             </template>
           </vxe-table-column>
           <vxe-table-column field="channelPartner" title="合作方" width="120" />
-          <vxe-table-column field="channelStatus" title="状态" :edit-render="{name: '$select', options: strategyStatus}" width="80" />
+          <vxe-table-column title="状态">
+            <template #default="{ row }">
+              <span v-if="row.channelStatus === 1" style="color:#67C23A">生效中</span>
+              <span v-else-if="row.channelStatus ===0" style="color:#F56C6C">未生效</span>
+            </template>
+          </vxe-table-column>
           <!-- <vxe-table-column field="wotv" title="wo186域名" width="120" :formatter="formatterWotv" /> -->
           <vxe-table-column field="onlineTime" title="生效时间" />
           <vxe-table-column title="操作" width="460">

+ 200 - 204
purchase_ao/src/views/schemeV2/index.vue

@@ -36,17 +36,20 @@
             <vxe-button status="primary" style="float: right" icon="fa fa-plus" @click="value5 = true">历史记录</vxe-button>
           </template>
         </vxe-toolbar>
-        <vxe-table border resizable keep-source show-overflow highlight-hover-row ref="xTable" :data="tableData"
-          :edit-config="{trigger: 'click', mode: 'cell', showStatus: true, }" @edit-closed="editClosedEvent">
+        <vxe-table border resizable keep-source show-overflow highlight-hover-row ref="xTable" :data="tableData">
           <vxe-table-column field="strategyName" title="策略名称" />
-          <vxe-table-column field="maskText" title="策略备注" :edit-render="{name: 'input'}" width="300" />
+          <vxe-table-column field="maskText" title="策略备注" />
           <vxe-table-column field="strategyType" title="策略类型" width="100">
             <template #default="{ row,_columnIndex}">
               {{ strategyType[row.strategyType].label }}
             </template>
           </vxe-table-column>
-          <vxe-table-column field="strategyStatus" title="状态" :edit-render="{name: '$select', options: strategyStatus}"
-            width="80" />
+          <vxe-table-column title="状态" width="80">
+            <template #default="{ row }">
+              <span v-if="row.strategyStatus === 1" style="color:#67C23A">生效中</span>
+              <span v-else-if="row.strategyStatus ===0" style="color:#F56C6C">未生效</span>
+            </template>
+          </vxe-table-column>
           <vxe-table-column field="templateId" title="使用模板">
             <template #default="{ row,_columnIndex}">
               {{ row.templateName }}
@@ -67,10 +70,7 @@
             </template>
           </vxe-table-column>
         </vxe-table>
-        <vxe-pager :loading="loading" :current-page="searchForm.pageNum" :page-size="searchForm.pageSize"
-          :total="searchForm.totalResult"
-          :layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"
-          @page-change="handlePageChange" />
+        <vxe-pager :loading="loading" :current-page="searchForm.pageNum" :page-size="searchForm.pageSize" :total="searchForm.totalResult" :layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']" @page-change="handlePageChange" />
 
         <!-- 历史记录 -->
         <vxe-modal v-model="value5" width="60%" title="历史记录">
@@ -93,10 +93,7 @@
               </vxe-table-column>
               <vxe-table-column field="userName" title="操作人"></vxe-table-column>
             </vxe-table>
-            <vxe-pager :loading="loading" :current-page="schemelogParam.pageNum" :page-size="schemelogParam.pageSize"
-              :total="schemelogParam.totalResult"
-              :layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"
-              @page-change="handlePageChangeChannelog" />
+            <vxe-pager :loading="loading" :current-page="schemelogParam.pageNum" :page-size="schemelogParam.pageSize" :total="schemelogParam.totalResult" :layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']" @page-change="handlePageChangeChannelog" />
           </template>
         </vxe-modal>
       </el-main>
@@ -105,217 +102,216 @@
 </template>
 
 <script>
-  import {
-    post,
-    get
-  } from '@/api/common'
+import {
+  post,
+  get
+} from '@/api/common'
 
-  export default {
-    name: 'Index',
-    data() {
-      return {
-        //  搜索相关内容
-        searchForm: {
-          channelKey: '',
-          strategyName: '',
-          strategyType: '',
-          strategyStatus: '',
-          pageNum: 1,
-          pageSize: 10,
-          totalResult: 0
-        },
-        // 表格数据
-        loading: false,
-        tableData: [],
-        templateList: [],
-        strategyStatus: [{
-            label: '生效中',
-            value: '1'
-          },
-          {
-            label: '未生效',
-            value: '0'
-          }
-        ],
-        strategyType: [{
-            label: '基本策略',
-            value: '0'
-          },
-          {
-            label: '活动策略',
-            value: '1'
-          },
-          {
-            label: '测试策略',
-            value: '2'
-          }
-        ],
+export default {
+  name: 'Index',
+  data () {
+    return {
+      //  搜索相关内容
+      searchForm: {
+        channelKey: '',
+        strategyName: '',
+        strategyType: '',
+        strategyStatus: '',
+        pageNum: 1,
+        pageSize: 10,
+        totalResult: 0
+      },
+      // 表格数据
+      loading: false,
+      tableData: [],
+      templateList: [],
+      strategyStatus: [{
+        label: '生效中',
+        value: '1'
+      },
+      {
+        label: '未生效',
+        value: '0'
+      }
+      ],
+      strategyType: [{
+        label: '基本策略',
+        value: '0'
+      },
+      {
+        label: '活动策略',
+        value: '1'
+      },
+      {
+        label: '测试策略',
+        value: '2'
+      }
+      ],
 
-        value5: false,
-        pushdata: false,
-        pushdataDate: '',
-        schemelog: [],
-        schemelogList: [],
-        filterName1: '',
-        schemelogParam: {
-          pageNum: 1,
-          pageSize: 10,
-          totalResult: 0
-        },
+      value5: false,
+      pushdata: false,
+      pushdataDate: '',
+      schemelog: [],
+      schemelogList: [],
+      filterName1: '',
+      schemelogParam: {
+        pageNum: 1,
+        pageSize: 10,
+        totalResult: 0
+      },
+    }
+  },
+  mounted () {
+    get('/templateInfo/page', {
+      'pageSize': 100,
+      'pageNum': 1
+    }).then(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
+    })
+    this.init()
+  },
+  methods: {
+    init () {
+      get('/strategyInfoNew/page', this.searchForm).then(res => {
+        console.log(res)
+        if (res.data) {
+          this.tableData = res.data.list
+          this.searchForm.totalResult = res.data.total
+        } else {
+          this.tableData = []
+          this.searchForm.totalResult = 0
+        }
+
+      })
+    },
+    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)
       }
     },
-    mounted() {
-      get('/templateInfo/page', {
-        'pageSize': 100,
-        'pageNum': 1
-      }).then(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
+    reset (formName) { // 重置
+      this.searchForm = {}
+      get('/strategyInfoNew/page', {}).then(res => {
+        this.tableData = res.data.list
       })
-      this.init()
     },
-    methods: {
-      init() {
-        get('/strategyInfoNew/page', this.searchForm).then(res => {
-          console.log(res)
-          if (res.data) {
-            this.tableData = res.data.list
-            this.searchForm.totalResult = res.data.total
-          } else {
-            this.tableData = []
-            this.searchForm.totalResult = 0
-          }
-
-        })
-      },
-      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)
+    toAdd (e) {
+      const routeUrl = this.$router.resolve({
+        path: '/schemeV2/schemeAdd',
+        query: {
+          id: e.id
         }
-      },
-      reset(formName) { // 重置
-        this.searchForm = {}
-        get('/strategyInfoNew/page', {}).then(res => {
-          this.tableData = res.data.list
-        })
-      },
-      toAdd(e) {
-        const routeUrl = this.$router.resolve({
-          path: '/schemeV2/schemeAdd',
-          query: {
-            id: e.id
-          }
-        })
-        window.open(routeUrl.href, '_blank')
-      },
-      toCopy(e) {
-        const routeUrl = this.$router.resolve({
-          path: '/schemeV2/schemeAdd',
-          query: {
-            copyId: e.id
-          }
-        })
-        window.open(routeUrl.href, '_blank')
-      },
-      del(row) {
-        this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-          const $table = this.$refs.xTable
-          $table.remove(row)
-          post('/strategyInfoNew/delete', {
-            'ids': [row.id]
-          }).then(res => {})
-        }).catch(() => {
-          this.$message({
-            type: 'info',
-            message: '已取消删除'
-          });
+      })
+      window.open(routeUrl.href, '_blank')
+    },
+    toCopy (e) {
+      const routeUrl = this.$router.resolve({
+        path: '/schemeV2/schemeAdd',
+        query: {
+          copyId: e.id
+        }
+      })
+      window.open(routeUrl.href, '_blank')
+    },
+    del (row) {
+      this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        const $table = this.$refs.xTable
+        $table.remove(row)
+        post('/strategyInfoNew/delete', {
+          'ids': [row.id]
+        }).then(res => { })
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消删除'
         });
-      },
-      handlePageChange({
-        currentPage,
-        pageSize
-      }) {
-        this.searchForm.pageNum = currentPage
-        this.searchForm.pageSize = pageSize
-        this.init()
-      },
-      handlePageChangeChannelog({
-        currentPage,
-        pageSize
-      }) {
-        this.schemelogParam.pageNum = currentPage
-        this.schemelogParam.pageSize = pageSize
-        get('/strategyInfoNew/getlog', this.schemelogParam).then(res => {
-          this.schemelog = res.data.list
-          this.schemelogParam.totalResult = res.data.total
-        })
-      },
-      searchEvent() {
-        get('/strategyInfoNew/getlog', this.schemelogParam).then(res => {
-          this.schemelog = res.data.list
-          this.schemelogParam.totalResult = res.data.total
-        })
-      }
+      });
+    },
+    handlePageChange ({
+      currentPage,
+      pageSize
+    }) {
+      this.searchForm.pageNum = currentPage
+      this.searchForm.pageSize = pageSize
+      this.init()
+    },
+    handlePageChangeChannelog ({
+      currentPage,
+      pageSize
+    }) {
+      this.schemelogParam.pageNum = currentPage
+      this.schemelogParam.pageSize = pageSize
+      get('/strategyInfoNew/getlog', this.schemelogParam).then(res => {
+        this.schemelog = res.data.list
+        this.schemelogParam.totalResult = res.data.total
+      })
+    },
+    searchEvent () {
+      get('/strategyInfoNew/getlog', this.schemelogParam).then(res => {
+        this.schemelog = res.data.list
+        this.schemelogParam.totalResult = res.data.total
+      })
     }
   }
+}
 
 </script>
 
 <style lang="scss">
-  .searchBox {
-    background-color: #fff;
-    border-radius: 4px;
-    box-shadow: #bfbfbf 0 0 2px;
-    height: unset !important;
-    padding: 10px 10px;
+.searchBox {
+  background-color: #fff;
+  border-radius: 4px;
+  box-shadow: #bfbfbf 0 0 2px;
+  height: unset !important;
+  padding: 10px 10px;
 
-    form {
-      margin: auto;
+  form {
+    margin: auto;
 
-      .el-form-item {
-        margin: 5px 5px;
-      }
+    .el-form-item {
+      margin: 5px 5px;
     }
   }
+}
 
-  .tableBox {
-    margin-top: 10px;
-    background-color: #fff;
-    border-radius: 4px;
-    box-shadow: #bfbfbf 0 0 2px;
+.tableBox {
+  margin-top: 10px;
+  background-color: #fff;
+  border-radius: 4px;
+  box-shadow: #bfbfbf 0 0 2px;
 
-    .block {
-      .el-pagination {
-        margin-top: 30px;
-        float: right;
-      }
+  .block {
+    .el-pagination {
+      margin-top: 30px;
+      float: right;
     }
   }
-
+}
 </style>

+ 13 - 3
purchase_ao/src/views/strategy/add.vue

@@ -4,7 +4,7 @@
       <!-- 预览页 -->
       <div class="page">
         <div class="look">
-          <el-button style="margin-left: 15px;" size="small" icon="el-icon-circle-close" @click="$router.go(-1)">取消</el-button>
+          <el-button style="margin-left: 15px;" size="small" icon="el-icon-circle-close" @click="closePage">返回</el-button>
           <el-button style="margin-left: 15px;" type="primary" icon="el-icon-folder-add" size="small" @click="keepClick()">保存</el-button>
           <el-button :disabled="templateList.length===0" size="small" icon="el-icon-view" type="warning" @click="preview"> 预览</el-button>
         </div>
@@ -923,11 +923,14 @@ export default {
     if (this.$route.query.editId) {
       this.editId = this.$route.query.editId
     }
+    if(this.$route.query.copy){
+      this.copy = this.$route.query.copy
+    }
 
   },
   methods: {
     inputBlur () {
-      this.form.strategyName = this.$store.state.user.name+'——'+this.form.strategyName
+      this.form.strategyName = this.$store.state.user.name + '——' + this.form.strategyName
     },
     // 选择模板
     templateChange (e) {
@@ -974,7 +977,7 @@ export default {
           let imgUrl = this.imgUrl + this.viceJson.jsonImg
           this.svgClick('副', imgUrl)
         }
-        if (this.$route.query.copy) {
+        if (this.copy==='1') {
           this.form.strategyName = this.form.strategyName + '-复制'
         }
         setTimeout(() => {
@@ -1211,6 +1214,13 @@ export default {
         let div = document.getElementById('lottieVice')
         div.innerHTML = ""
       }
+    },
+    closePage () {
+      if (this.editId === '1' || this.copy === '1') {
+        window.close()
+      } else {
+        this.$router.go(-1)
+      }
     }
   },
 }

+ 6 - 4
purchase_ao/src/views/strategy/index.vue

@@ -106,12 +106,13 @@ export default {
     // 编辑策略
     addClick (val, item) {
       if (val === 'add') {
-        this.$router.push('/strategy/add')
+        this.$router.push({path: "/strategy/add"})
       } else if (val === 'edit') {
-        this.$router.push({
+        const routeUrl = this.$router.resolve({
           path: "/strategy/add",
           query: { id: item.id, editId: 1 }
         })
+        window.open(routeUrl.href, '_blank')
       } else if (val === 'remove') {
         this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
           confirmButtonText: '确定',
@@ -126,10 +127,11 @@ export default {
           })
         })
       } else if (val === 'copy') {
-        this.$router.push({
+        const routeUrl = this.$router.resolve({
           path: "/strategy/add",
           query: { id: item.id, copy: 1 }
         })
+        window.open(routeUrl.href, '_blank')
       }
 
     },
@@ -182,7 +184,7 @@ export default {
       this.form.pageSize = 10
       this.form.strategyName = ''
       this.form.strategyStatus = null
-      this.getStrategyList
+      this.getStrategyList()
     }
   }