hml преди 2 години
родител
ревизия
087f1a9a44

+ 1 - 1
purchase_H5/src/components/repeatModal.vue

@@ -43,7 +43,7 @@ export default {
   async created () {
     if (this.pageData.remarks.orderRepeat && this.pageData.remarks.orderRepeat !== null && this.pageData
       .remarks.orderRepeat !== '') {
-      if (this.pageData.channl.edition && this.pageData.channl.edition !== 1) {
+      if (this.pageData.channl.edition !== 1) {
         let productId = await strategyGetID({
           id: this.pageData.remarks.orderRepeat,
         });

+ 50 - 87
purchase_H5/src/components/unbuyModal.vue

@@ -7,45 +7,26 @@
         <div class="body-box">
           <div class="input-box">
             <div class="input">
-              <input
-                type="text"
-                v-model="loginForm.phone"
-                placeholder="手机号码"
-              />
+              <input type="text" v-model="loginForm.phone" placeholder="手机号码" />
             </div>
           </div>
           <div class="input-box">
             <div class="input">
-              <input
-                type="text"
-                v-model="loginForm.vcode"
-                v-on:input="checkVcode"
-                placeholder="验证码"
-              />
+              <input type="text" v-model="loginForm.vcode" v-on:input="checkVcode" placeholder="验证码" />
             </div>
-            <div
-              :class="{ code: 1, number: codeState.state }"
-              @click="getCode()"
-            >
+            <div :class="{ code: 1, number: codeState.state }" @click="getCode()">
               {{ codeState.state ? codeState.time + "s" : "获取验证码" }}
             </div>
           </div>
           <div class="input-box">
-            <div
-              class="input"
-              style="
+            <div class="input" style="
                 text-overflow: ellipsis;
                 overflow: hidden;
                 white-space: nowrap;
-              "
-            >
+              ">
               {{ radio === "0" ? "退订原因" : reason }}
             </div>
-            <div
-              class="code"
-              style="color: #d6000f; text-align: end"
-              @click="showSheet = true"
-            >
+            <div class="code" style="color: #d6000f; text-align: end" @click="showSheet = true">
               请选择
             </div>
           </div>
@@ -60,44 +41,25 @@
       </div>
     </van-overlay>
     <vue-puzzle :show="showVcode" @success="onSuccessCode()"></vue-puzzle>
-    <van-action-sheet
-      lock-scroll
-      close-on-popstate
-      v-model="showSheet"
-      title="退订原因"
-      @close="closeSheet"
-    >
+    <van-action-sheet lock-scroll close-on-popstate v-model="showSheet" title="退订原因" @close="closeSheet">
       <van-radio-group v-model="radio">
         <van-cell-group>
-            <van-row>
-                <div v-for="(item, index) in resonList" style="width: 100%">
-                    <van-col span="12">
-                        <van-cell
-                                :key="index"
-                                :title="item.title"
-                                clickable
-                                @click="radio = item.value"
-                        >
-                            <template #right-icon>
-                                <van-radio checked-color="#d6000f" :name="item.value" />
-                            </template>
-                        </van-cell>
-                    </van-col>
-
-                </div>
-            </van-row>
+          <van-row>
+            <div v-for="(item, index) in resonList" style="width: 100%">
+              <van-col span="12">
+                <van-cell :key="index" :title="item.title" clickable @click="radio = item.value">
+                  <template #right-icon>
+                    <van-radio checked-color="#d6000f" :name="item.value" />
+                  </template>
+                </van-cell>
+              </van-col>
 
+            </div>
+          </van-row>
 
         </van-cell-group>
         <div class="fileBox">
-          <van-field
-            v-model="message"
-            rows="2"
-            autosize
-            type="textarea"
-            placeholder="请描述原因,如遇到其他问题请反馈给我们"
-            show-word-limit
-          />
+          <van-field v-model="message" rows="2" autosize type="textarea" placeholder="请描述原因,如遇到其他问题请反馈给我们" show-word-limit />
         </div>
         <!--        <div-->
         <!--          v-if=" radio === '3'"-->
@@ -129,7 +91,7 @@ export default {
     vuePuzzle,
     Notify,
   },
-  data() {
+  data () {
     return {
       loginForm: {
         phone: "",
@@ -148,49 +110,50 @@ export default {
       reason: "",
       resonList: [
         {
-          title: "流量无法激活",
+          title: "价格太贵",
           value: "1",
         },
         {
-          title: "会员无法领取",
+          title: "误点误操作",
           value: "2",
         },
         {
           title: "最近不用客户端",
           value: "3",
         },
-          {
-              title: "流量用不完",
-              value: "4",
-          },
-          {
-              title: "价格太贵",
-              value: "5",
-          },
-          {
-              title: "误点误操作",
-              value: "6",
-          },
-          {
-              title: "其他",
-              value: "7",
-          },
+        {
+          title: "流量用不完",
+          value: "4",
+        },
+        {
+
+          title: "流量无法激活",
+          value: "5",
+        },
+        {
+          title: "会员无法领取",
+          value: "6",
+        },
+        {
+          title: "其他",
+          value: "7",
+        },
       ],
     };
   },
   methods: {
-    closeUnbuy() {
+    closeUnbuy () {
       this.reason = "";
       this.message = "";
       this.radio = "0";
       this.$emit("change", false);
     },
-    checkVcode() {
+    checkVcode () {
       if (this.loginForm.vcode.length > 6) {
         this.loginForm.vcode = this.loginForm.vcode.slice(0, 6);
       }
     },
-    getCode() {
+    getCode () {
       if (this.codeState.state) return;
       let { phone } = this.loginForm;
       if (!/^1[23456789]\d{9}$/.test(phone)) {
@@ -198,7 +161,7 @@ export default {
       }
       this.showVcode = true;
     },
-    onSuccessCode() {
+    onSuccessCode () {
       this.showVcode = false;
       let { phone } = this.loginForm;
       getCode({
@@ -223,7 +186,7 @@ export default {
         }
       );
     },
-    unbuy() {
+    unbuy () {
       let { phone, vcode } = this.loginForm;
       if (!vcode) {
         return this.$toast("请输入验证码");
@@ -260,7 +223,7 @@ export default {
             type: "1",
             userid: this.$store.state.user.userid,
           };
-        await this.postReson(res.data.userid,phone);
+          await this.postReson(res.data.userid, phone);
           postBuy(updata).then(
             (res) => {
               if (res.code === 10000) {
@@ -287,7 +250,7 @@ export default {
         }
       });
     },
-    closeSheet() {
+    closeSheet () {
       if (this.radio !== "0" && this.reason !== "") {
         this.showSheet = false;
       } else {
@@ -297,7 +260,7 @@ export default {
         this.totasShow = false;
       }
     },
-    sureClick() {
+    sureClick () {
       if (this.radio !== "0") {
         this.reason = this.resonList.find((item) => {
           if (item.value === this.radio) {
@@ -327,16 +290,16 @@ export default {
         // }
       }
     },
-    postReson(userid,phone) {
+    postReson (userid, phone) {
       // let {userid , phone} = this.$store.state.users
       let feedBack = {
         phone: phone,
         content: "",
-        reason:"",
+        reason: "",
         channelName: this.pageData.channl.channelName,
         productName: this.pageData.mainProduct.productName,
         spid: this.pageData.mainProduct.spid,
-        userid:userid
+        userid: userid
       };
       let msg = "";
       this.resonList.forEach((item) => {

+ 2 - 2
purchase_H5/src/templates/templateColor/index.scss

@@ -79,11 +79,11 @@
 
     @keyframes scale1 {
       from {
-        transform: scaleX(1.1);
+        transform: scale(1.1);
       }
 
       to {
-        transform: scaleX(1);
+        transform: scale(1);
       }
     }
 

+ 3 - 9
purchase_H5/src/templates/templateCom/index.vue

@@ -130,7 +130,7 @@
     <!-- 重复订购引流 -->
     <repeat-modal @repeat="recommend" v-model="repeatShow"></repeat-modal>
     <!-- 合约产品退订提示 -->
-    <!-- <opOut v-model="opoutShow" @opoutClick="showUnbuy = true"></opOut> -->
+    <opOut v-model="opoutShow" @opoutClick="showUnbuy = true"></opOut>
   </div>
 </template>
 
@@ -282,10 +282,7 @@ export default {
           this.toLink(type);
         } else if (type === "unBUy") {
           addR.unBuyClick();
-          if (
-            this.pageData.strategyInfo.unsubscribeStrategyList !== null &&
-            this.pageData.strategyInfo.unsubscribeStrategyList.length > 0
-          ) {
+          if (this.pageData.strategyInfo.unsubscribeStrategyList !== null && this.pageData.strategyInfo.unsubscribeStrategyList.length > 0) {
             if (this.pageData.channl.edition && this.pageData.channl.edition === 1) {
               let productId = await strategytemplate({
                 id: this.pageData.strategyInfo.unsubscribeStrategyList[0],
@@ -314,10 +311,7 @@ export default {
         }
       } else if (type === "unBUy") {
         addR.unBuyClick();
-        if (
-          this.pageData.strategyInfo.unsubscribeStrategyList !== null &&
-          this.pageData.strategyInfo.unsubscribeStrategyList.length > 0
-        ) {
+        if (this.pageData.strategyInfo.unsubscribeStrategyList !== null && this.pageData.strategyInfo.unsubscribeStrategyList.length > 0) {
           if (this.pageData.channl.edition && this.pageData.channl.edition === 1) {
             let productId = await strategytemplate(this.pageData.strategyInfo.unsubscribeStrategyList[0]);
             let drainageRes = await detMainProduct({

+ 2 - 1
purchase_H5/src/views/index.vue

@@ -135,8 +135,9 @@ export default {
         return false;
       }
       let userid = this.user.userid;
+      let anonymousId = this.$sensors.store._state.$device_id;
       let params = {
-        anonymousId: "",
+        anonymousId: anonymousId,
         channelKey: channelKey,
         location: "",
       }

+ 12 - 11
purchase_ao/src/views/schemeV2/channelEdit.vue

@@ -34,22 +34,13 @@
                 </el-date-picker>
               </el-col>
             </el-form-item>
-            <el-form-item label="高级策略">
-              <el-select filterable clearable placeholder="高级策略" v-model="form.adStrategyId">
-                <el-option v-for="item in adStrategyList" :label="item.name" :key="item.id" :value="item.id"></el-option>
-              </el-select>
-            </el-form-item>
-            <el-form-item label="生效状态">
-              <el-radio v-model="form.channelStatus" :label="0">失效</el-radio>
-              <el-radio v-model="form.channelStatus" :label="1">生效</el-radio>
-            </el-form-item>
             <el-form-item label="策略类型">
               <el-radio @change="radioClick(1)" v-model="form.onOffStatus" :label="1">新策略</el-radio>
               <el-radio @change="radioClick(2)" v-model="form.onOffStatus" :label="2">旧策略</el-radio>
             </el-form-item>
 
             <el-form-item v-if="form.onOffStatus!==0" label="绑定策略" prop="strategyId">
-              <el-select v-model="form.strategyId" filterable remote reserve-keyword placeholder="请输入关键词" :remote-method="remoteMethodstrategyId" :loading="loading">
+              <el-select v-model="form.strategyId" filterable clearable  placeholder="请选择策略" :loading="loading">
                 <el-option v-for="item in celueList" :key="item.id" :label="item.strategyName" :value="item.id">
                 </el-option>
               </el-select>
@@ -63,6 +54,15 @@
                 <vxe-button @click="toEdit(form.strategyId)" icon="el-icon-edit" size="mini" content="编辑"></vxe-button>
               </span>
             </el-form-item>
+            <el-form-item label="高级策略">
+              <el-select filterable clearable placeholder="高级策略" v-model="form.adStrategyId">
+                <el-option v-for="item in adStrategyList" :label="item.name" :key="item.id" :value="item.id"></el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item label="生效状态">
+              <el-radio v-model="form.channelStatus" :label="0">失效</el-radio>
+              <el-radio v-model="form.channelStatus" :label="1">生效</el-radio>
+            </el-form-item>
             <!-- <el-form-item label="开启WO186域名">
               <el-radio v-model="form.wotv" label="0">关闭</el-radio>
               <el-radio v-model="form.wotv" label="1">开启</el-radio>
@@ -135,7 +135,8 @@ export default {
         channelPattern: '1',
         channelStatus: 1,
         onOffStatus: 0,
-        adStrategyId: ""
+        adStrategyId: "",
+        strategyId:""
       },
       oldform: {},
       id: null,

+ 293 - 327
purchase_ao/src/views/schemeV2/channelSubList.vue

@@ -1,348 +1,314 @@
 <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="channelName" placeholder="渠道名称"/>
-                    </el-form-item>
-                    <el-form-item label="渠道key">
-                        <el-input v-model="searchForm.channelKey" name="channelKey" placeholder="渠道Key"/>
-                    </el-form-item>
-                    <el-form-item label="完整渠道编码">
-                        <el-input v-model="searchForm.fullCode" name="fullCode" 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-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="渠道名称"
-                    />
-                    <vxe-table-column
-                            field="channelKey"
-                            title="渠道Key"
-                            width="120"
-                    />
-                    <vxe-table-column
-                            field="fullCode"
-                            title="完整渠道编码"
-                            width="120"
-                    />
-                    <vxe-table-column
-                            field="channelType"
-                            title="渠道类别"
-                    />
-                    <vxe-table-column field="channelPattern"title="渠道形态"width="100">
-                        <template #default="{ row,_columnIndex}">
+  <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="channelName" placeholder="渠道名称" />
+          </el-form-item>
+          <el-form-item label="渠道key">
+            <el-input v-model="searchForm.channelKey" name="channelKey" placeholder="渠道Key" />
+          </el-form-item>
+          <el-form-item label="完整渠道编码">
+            <el-input v-model="searchForm.fullCode" name="fullCode" 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-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="渠道名称" />
+          <vxe-table-column field="channelKey" title="渠道Key" width="120" />
+          <vxe-table-column field="fullCode" title="完整渠道编码" width="120" />
+          <vxe-table-column field="channelType" title="渠道类别" />
+          <vxe-table-column title="渠道形态" width="100">
+            <!-- <template #default="{ row,_columnIndex}">
                             {{ patnerList[row.channelPattern*1].label }}
-                        </template>
-                    </vxe-table-column>
-                    <vxe-table-column
-                            field="channelStatus"
-                            title="状态"
-                            :edit-render="{name: '$select', options: strategyStatus}"
-                            width="80"
-                    />
-                    <vxe-table-column
-                            field="onlineTime"
-                            title="生效时间"
-                    />
-                    <vxe-table-column title="操作" fixed="right" width="360">
-                        <template #default="{ row }">
-                            <vxe-button @click="toEdit(row)">编辑</vxe-button>
-                            <vxe-button @click="copy(row)">复制链接</vxe-button>
-                            <vxe-button @click="giveShort(row)">短连接</vxe-button>
-                            <vxe-button @click="ewm(row)">二维码</vxe-button>
-                        </template>
-                    </vxe-table-column>
-                </vxe-table>
-                <el-dialog title="二维码下载" :visible.sync="dialogVisible" width="350px">
-                    <div style="text-align: center">
-                        <div id="qrcode"></div>
-                        <div style="height: 25px;line-height: 25px;margin-top: 30px">鼠标右键图片另存为</div>
-                    </div>
-                    <span slot="footer" class="dialog-footer">
-                <el-button @click="dialogVisible = false">取 消</el-button>
-            </span>
-                </el-dialog>
-                <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> -->
+            <template #default="{ row }">
+              <span v-if="row.onOffStatus === 1">新版本</span>
+              <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 field="onlineTime" title="生效时间" />
+          <vxe-table-column title="操作" fixed="right" width="360">
+            <template #default="{ row }">
+              <vxe-button @click="toEdit(row)">编辑</vxe-button>
+              <vxe-button @click="copy(row)">复制链接</vxe-button>
+              <vxe-button @click="giveShort(row)">短连接</vxe-button>
+              <vxe-button @click="ewm(row)">二维码</vxe-button>
+            </template>
+          </vxe-table-column>
+        </vxe-table>
+        <el-dialog title="二维码下载" :visible.sync="dialogVisible" width="350px">
+          <div style="text-align: center">
+            <div id="qrcode"></div>
+            <div style="height: 25px;line-height: 25px;margin-top: 30px">鼠标右键图片另存为</div>
+          </div>
+          <span slot="footer" class="dialog-footer">
+            <el-button @click="dialogVisible = false">取 消</el-button>
+          </span>
+        </el-dialog>
+        <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 QRCode from 'qrcodejs2'
-    import XEUtils from 'xe-utils'
+import { post, get } from '@/api/common'
+import QRCode from 'qrcodejs2'
+import XEUtils from 'xe-utils'
 
-    export default {
-        name: 'SchemeEdit',
-        data() {
-            return {
-                searchForm: {
-                    channelName: '',
-                    channelPartner: '',
-                    channelKey: '',
-                    fullCode: '',
-                    parentId: 0,
-                    pageNum: 1,
-                    pageSize: 10,
-                    totalResult: 0
-                },
-                loading: false,
-                tableData: [],
-                content: {},
-                strategyStatus: [
-                    {label: '生效中', value: '1'},
-                    {label: '未生效', value: '0'}
-                ],
-                typeList: [
-                    {value: '集团渠道', label: '集团渠道'},
-                    {value: '省分线下渠道', label: '省分线下渠道'},
-                    {value: '省分线上渠道', label: '省分线上渠道'},
-                    {value: '互联网渠道', label: '互联网渠道'},
-                    {value: '自有线上渠道', label: '自有线上渠道'},
-                    {value: '社会代理和其他渠道', label: '社会代理和其他渠道'}
-                ],
-                patnerList: [
-                    {value: '0', label: 'V1'},
-                    {value: '1', label: 'V2'},
-                ],
+export default {
+  name: 'SchemeEdit',
+  data () {
+    return {
+      searchForm: {
+        channelName: '',
+        channelPartner: '',
+        channelKey: '',
+        fullCode: '',
+        parentId: 0,
+        pageNum: 1,
+        pageSize: 10,
+        totalResult: 0
+      },
+      loading: false,
+      tableData: [],
+      content: {},
+      strategyStatus: [
+        { label: '生效中', value: '1' },
+        { label: '未生效', value: '0' }
+      ],
+      typeList: [
+        { value: '集团渠道', label: '集团渠道' },
+        { value: '省分线下渠道', label: '省分线下渠道' },
+        { value: '省分线上渠道', label: '省分线上渠道' },
+        { value: '互联网渠道', label: '互联网渠道' },
+        { value: '自有线上渠道', label: '自有线上渠道' },
+        { value: '社会代理和其他渠道', label: '社会代理和其他渠道' }
+      ],
+      patnerList: [
+        { value: '0', label: 'V1' },
+        { value: '1', label: 'V2' },
+      ],
 
-                dialogVisible: false,
+      dialogVisible: false,
 
 
-                value5: false,
-                pushdata: false,
-                pushdataDate: '',
-                channelog: [],
-                channelogList: [],
-                filterName1: '',
-                channelogParam: {
-                    channelId: this.$route.query.id,
-                    pageNum: 1,
-                    pageSize: 10,
-                    totalResult: 0
-                },
-            }
-        },
-        watch: {
-            value5(val) {
-                if (val) {
-                    get('/channelInfo/channelogpage', this.channelogParam).then(res => {
-                        this.channelog = res.data.list
-                        this.channelogParam.totalResult = res.data.total
-                    })
-                    this.channelogParam.pageSize = 100
-                    get('/channelInfo/channelogpage', this.channelogParam).then(res => {
-                        this.channelogList = JSON.parse(JSON.stringify(res.data.list))
-                    })
-                }
-            }
-        },
-        created() {
-            this.searchForm.parentId = this.$route.query.id?this.$route.query.id:null
-            get('/channelInfo/detail', {id: this.$route.query.id}).then(res => {
-                this.content = res.data
-            })
-            this.init()
-            document.title = '所有二级渠道'
-        },
-        methods: {
-            onSubmit() {
-                post('/channelInfo/pushdata?beginTime=' + this.pushdataDate[0] + '&endTime=' + this.pushdataDate[1], {}).then(res => {
-                    this.$message({
-                        message: res.message,
-                        type: 'success'
-                    });
-                    this.pushdata = false
-                })
-            },
-            reset(formName) { // 重置
-                this.searchForm = {}
-                get('/channelInfo/listChannelslistChannels', {}).then(res => {
-                    this.tableData = res.data.list
-                })
-            },
-            checkpushdata(e) {
-                get('/channelInfo/checkpushdata', {'fullCode': e}).then(res => {
-                    let data = JSON.parse(res.data)[0]
-                    if (data.resdesc == 'ok') {
-                        this.$message({
-                            message: data.subchannelname + '已同步',
-                            type: 'success'
-                        });
-                    } else {
-                        this.$message({
-                            message: data.subchannelname + '未同步',
-                            type: 'error'
-                        });
-                    }
-                })
-            },
-            init() {
-                console.log(this.searchForm)
-                get('/channelInfo/listChannels', 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)
-                }
-            },
-            toEdit(e, type) {
-                const routeUrl = this.$router.resolve({path: '/schemeV2/channelEdit', query: {id: e.id, 'type': type}})
-                window.open(routeUrl.href, '_blank')
-            },
-            copy(row) {
-                let oInput = document.createElement('input');
-                oInput.value = `https://operation.mige.tv/a/#/${row.channelKey}`;
-                document.body.appendChild(oInput);
-                oInput.select(); // 选择对象;
-                document.execCommand("Copy"); // 执行浏览器复制命令
-                this.$message({
-                    message: '复制成功',
-                    type: 'success'
-                });
-                oInput.remove()
-            },
-            giveShort(row) {
-                let stUrl = row.shortUrl
-                if (stUrl) {
-                    let oInput = document.createElement('input');
-                    oInput.value = `http://v.mige.tv/${stUrl}`;
-                    document.body.appendChild(oInput);
-                    oInput.select(); // 选择对象;
-                    document.execCommand("Copy"); // 执行浏览器复制命令
-                    this.$message({
-                        message: '复制成功',
-                        type: 'success'
-                    });
-                    oInput.remove()
-                } else {
-                    let updata = {
-                        channel: row.channelKey,
-                        longUrl: `https://operation.mige.tv/a/#/${row.channelKey}`
-                    }
-                    post('/channelInfo/shorturl', updata).then(res => {
-                        let resUrl = res.data.shortCode
-                        let oInput = document.createElement('input');
-                        oInput.value = `http://v.mige.tv/${resUrl}`;
-                        document.body.appendChild(oInput);
-                        oInput.select(); // 选择对象;
-                        document.execCommand("Copy"); // 执行浏览器复制命令
-                        this.$message({
-                            message: '复制成功',
-                            type: 'success'
-                        });
-                        oInput.remove()
-                    })
-                }
-            },
-            ewm(row) {
-                this.dialogVisible = true;
-                this.$nextTick(function () {
-                    document.getElementById("qrcode").innerHTML = "";
-                    let qrcode = new QRCode("qrcode", {
-                        width: 300,
-                        height: 300,
-                        text: `https://operation.mige.tv/a/#/${row.channelKey}`
-                    });
-                });
-            },
-            handlePageChange({currentPage, pageSize}) {
-                this.searchForm.pageNum = currentPage
-                this.searchForm.pageSize = pageSize
-                this.init()
-            },
-            handlePageChangeChannelog({currentPage, pageSize}) {
-                this.channelogParam.pageNum = currentPage
-                this.channelogParam.pageSize = pageSize
-                get('/channelInfo/channelogpage', this.channelogParam).then(res => {
-                    this.channelog = res.data.list
-                    this.channelogParam.totalResult = res.data.total
-                })
-            },
-            searchEvent() {
-                get('/channelInfo/channelogpage', this.channelogParam).then(res => {
-                    this.channelog = res.data.list
-                    this.channelogParam.totalResult = res.data.total
-                })
-            }
+      value5: false,
+      pushdata: false,
+      pushdataDate: '',
+      channelog: [],
+      channelogList: [],
+      filterName1: '',
+      channelogParam: {
+        channelId: this.$route.query.id,
+        pageNum: 1,
+        pageSize: 10,
+        totalResult: 0
+      },
+    }
+  },
+  watch: {
+    value5 (val) {
+      if (val) {
+        get('/channelInfo/channelogpage', this.channelogParam).then(res => {
+          this.channelog = res.data.list
+          this.channelogParam.totalResult = res.data.total
+        })
+        this.channelogParam.pageSize = 100
+        get('/channelInfo/channelogpage', this.channelogParam).then(res => {
+          this.channelogList = JSON.parse(JSON.stringify(res.data.list))
+        })
+      }
+    }
+  },
+  created () {
+    this.searchForm.parentId = this.$route.query.id ? this.$route.query.id : null
+    get('/channelInfo/detail', { id: this.$route.query.id }).then(res => {
+      this.content = res.data
+    })
+    this.init()
+    document.title = '所有二级渠道'
+  },
+  methods: {
+    onSubmit () {
+      post('/channelInfo/pushdata?beginTime=' + this.pushdataDate[0] + '&endTime=' + this.pushdataDate[1], {}).then(res => {
+        this.$message({
+          message: res.message,
+          type: 'success'
+        });
+        this.pushdata = false
+      })
+    },
+    reset (formName) { // 重置
+      this.searchForm = {}
+      get('/channelInfo/listChannelslistChannels', {}).then(res => {
+        this.tableData = res.data.list
+      })
+    },
+    checkpushdata (e) {
+      get('/channelInfo/checkpushdata', { 'fullCode': e }).then(res => {
+        let data = JSON.parse(res.data)[0]
+        if (data.resdesc == 'ok') {
+          this.$message({
+            message: data.subchannelname + '已同步',
+            type: 'success'
+          });
+        } else {
+          this.$message({
+            message: data.subchannelname + '未同步',
+            type: 'error'
+          });
+        }
+      })
+    },
+    init () {
+      console.log(this.searchForm)
+      get('/channelInfo/listChannels', 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)
+      }
+    },
+    toEdit (e, type) {
+      const routeUrl = this.$router.resolve({ path: '/schemeV2/channelEdit', query: { id: e.id, 'type': type } })
+      window.open(routeUrl.href, '_blank')
+    },
+    copy (row) {
+      let oInput = document.createElement('input');
+      oInput.value = `https://operation.mige.tv/a/#/${row.channelKey}`;
+      document.body.appendChild(oInput);
+      oInput.select(); // 选择对象;
+      document.execCommand("Copy"); // 执行浏览器复制命令
+      this.$message({
+        message: '复制成功',
+        type: 'success'
+      });
+      oInput.remove()
+    },
+    giveShort (row) {
+      let stUrl = row.shortUrl
+      if (stUrl) {
+        let oInput = document.createElement('input');
+        oInput.value = `http://v.mige.tv/${stUrl}`;
+        document.body.appendChild(oInput);
+        oInput.select(); // 选择对象;
+        document.execCommand("Copy"); // 执行浏览器复制命令
+        this.$message({
+          message: '复制成功',
+          type: 'success'
+        });
+        oInput.remove()
+      } else {
+        let updata = {
+          channel: row.channelKey,
+          longUrl: `https://operation.mige.tv/a/#/${row.channelKey}`
         }
+        post('/channelInfo/shorturl', updata).then(res => {
+          let resUrl = res.data.shortCode
+          let oInput = document.createElement('input');
+          oInput.value = `http://v.mige.tv/${resUrl}`;
+          document.body.appendChild(oInput);
+          oInput.select(); // 选择对象;
+          document.execCommand("Copy"); // 执行浏览器复制命令
+          this.$message({
+            message: '复制成功',
+            type: 'success'
+          });
+          oInput.remove()
+        })
+      }
+    },
+    ewm (row) {
+      this.dialogVisible = true;
+      this.$nextTick(function () {
+        document.getElementById("qrcode").innerHTML = "";
+        let qrcode = new QRCode("qrcode", {
+          width: 300,
+          height: 300,
+          text: `https://operation.mige.tv/a/#/${row.channelKey}`
+        });
+      });
+    },
+    handlePageChange ({ currentPage, pageSize }) {
+      this.searchForm.pageNum = currentPage
+      this.searchForm.pageSize = pageSize
+      this.init()
+    },
+    handlePageChangeChannelog ({ currentPage, pageSize }) {
+      this.channelogParam.pageNum = currentPage
+      this.channelogParam.pageSize = pageSize
+      get('/channelInfo/channelogpage', this.channelogParam).then(res => {
+        this.channelog = res.data.list
+        this.channelogParam.totalResult = res.data.total
+      })
+    },
+    searchEvent () {
+      get('/channelInfo/channelogpage', this.channelogParam).then(res => {
+        this.channelog = res.data.list
+        this.channelogParam.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>

+ 297 - 302
purchase_ao/src/views/schemeV2/channelView.vue

@@ -88,17 +88,20 @@
             <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 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-column field="channelKey" title="渠道Key" width="120" />
           <vxe-table-column field="fullCode" title="完整渠道编码" width="120" />
           <vxe-table-column field="channelType" title="渠道类别" width="160" />
-          <vxe-table-column field="channelPattern" title="渠道形态" width="100" />
+          <vxe-table-column title="渠道形态" width="100">
+            <template #default="{ row }">
+              <span v-if="row.onOffStatus === 1">新版本</span>
+              <span v-else style="color:#F56C6C">旧版本</span>
+            </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 field="wotv" title="wo186域名" width="120" :formatter="formatterWotv"/>
+          <vxe-table-column field="channelStatus" title="状态" :edit-render="{name: '$select', options: strategyStatus}" width="80" />
+          <!-- <vxe-table-column field="wotv" title="wo186域名" width="120" :formatter="formatterWotv" /> -->
           <vxe-table-column field="onlineTime" title="生效时间" />
           <vxe-table-column title="操作" width="460">
             <template #default="{ row }">
@@ -110,10 +113,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" />
         <el-dialog title="二维码下载" :visible.sync="dialogVisible" width="350px">
           <div style="text-align: center">
             <div id="qrcode"></div>
@@ -143,10 +143,7 @@
               </vxe-table-column>
               <vxe-table-column field="userName" title="操作人"></vxe-table-column>
             </vxe-table>
-            <vxe-pager :loading="loading" :current-page="channelogParam.pageNum" :page-size="channelogParam.pageSize"
-              :total="channelogParam.totalResult"
-              :layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"
-              @page-change="handlePageChangeChannelog" />
+            <vxe-pager :loading="loading" :current-page="channelogParam.pageNum" :page-size="channelogParam.pageSize" :total="channelogParam.totalResult" :layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']" @page-change="handlePageChangeChannelog" />
           </template>
         </vxe-modal>
 
@@ -154,8 +151,7 @@
           <template #default>
             <el-form ref="form" label-width="80px">
               <el-form-item label="选择时间">
-                <el-date-picker v-model="pushdataDate" type="daterange" range-separator="至" start-placeholder="开始日期"
-                  end-placeholder="结束日期" format="yyyy 年 MM 月 dd 日" value-format="yyyy-MM-dd">
+                <el-date-picker v-model="pushdataDate" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy 年 MM 月 dd 日" value-format="yyyy-MM-dd">
                 </el-date-picker>
               </el-form-item>
               <el-form-item>
@@ -171,190 +167,190 @@
 </template>
 
 <script>
-  import {
-    post,
-    get
-  } from '@/api/common'
-  import QRCode from 'qrcodejs2'
-  import axios from "axios";
-  import {
-    getToken
-  } from "../../utils/auth";
-  import XEUtils from 'xe-utils'
+import {
+  post,
+  get
+} from '@/api/common'
+import QRCode from 'qrcodejs2'
+import axios from "axios";
+import {
+  getToken
+} from "../../utils/auth";
+import XEUtils from 'xe-utils'
 
-  export default {
-    name: 'SchemeEdit',
-    data() {
-      return {
-        searchForm: {
-          channelName: '',
-          channelPartner: '',
-          parentId: 0,
-          pageNum: 1,
-          pageSize: 10,
-          totalResult: 0
-        },
-        loading: false,
-        tableData: [],
-        content: {},
-        strategyStatus: [{
-            label: '生效中',
-            value: '1'
-          },
-          {
-            label: '未生效',
-            value: '0'
-          }
-        ],
-        typeList: [{
-            value: '集团渠道',
-            label: '集团渠道'
-          },
-          {
-            value: '省分线下渠道',
-            label: '省分线下渠道'
-          },
-          {
-            value: '省分线上渠道',
-            label: '省分线上渠道'
-          },
-          {
-            value: '互联网渠道',
-            label: '互联网渠道'
-          },
-          {
-            value: '自有线上渠道',
-            label: '自有线上渠道'
-          },
-          {
-            value: '社会代理和其他渠道',
-            label: '社会代理和其他渠道'
-          }
-        ],
-        patnerList: [{
-            value: '0',
-            label: 'V1'
-          },
-          {
-            value: '1',
-            label: 'V2'
-          },
-        ],
+export default {
+  name: 'SchemeEdit',
+  data () {
+    return {
+      searchForm: {
+        channelName: '',
+        channelPartner: '',
+        parentId: 0,
+        pageNum: 1,
+        pageSize: 10,
+        totalResult: 0
+      },
+      loading: false,
+      tableData: [],
+      content: {},
+      strategyStatus: [{
+        label: '生效中',
+        value: '1'
+      },
+      {
+        label: '未生效',
+        value: '0'
+      }
+      ],
+      typeList: [{
+        value: '集团渠道',
+        label: '集团渠道'
+      },
+      {
+        value: '省分线下渠道',
+        label: '省分线下渠道'
+      },
+      {
+        value: '省分线上渠道',
+        label: '省分线上渠道'
+      },
+      {
+        value: '互联网渠道',
+        label: '互联网渠道'
+      },
+      {
+        value: '自有线上渠道',
+        label: '自有线上渠道'
+      },
+      {
+        value: '社会代理和其他渠道',
+        label: '社会代理和其他渠道'
+      }
+      ],
+      patnerList: [{
+        value: '0',
+        label: 'V1'
+      },
+      {
+        value: '1',
+        label: 'V2'
+      },
+      ],
 
-        dialogVisible: false,
+      dialogVisible: false,
 
 
-        value5: false,
-        pushdata: false,
-        pushdataDate: '',
-        channelog: [],
-        channelogList: [],
-        filterName1: '',
-        channelogParam: {
-          channelId: this.$route.query.id,
-          pageNum: 1,
-          pageSize: 10,
-          totalResult: 0
-        },
+      value5: false,
+      pushdata: false,
+      pushdataDate: '',
+      channelog: [],
+      channelogList: [],
+      filterName1: '',
+      channelogParam: {
+        channelId: this.$route.query.id,
+        pageNum: 1,
+        pageSize: 10,
+        totalResult: 0
+      },
+    }
+  },
+  watch: {
+    value5 (val) {
+      if (val) {
+        get('/channelInfo/channelogpage', this.channelogParam).then(res => {
+          this.channelog = res.data.list
+          this.channelogParam.totalResult = res.data.total
+        })
+        this.channelogParam.pageSize = 100
+        get('/channelInfo/channelogpage', this.channelogParam).then(res => {
+          this.channelogList = JSON.parse(JSON.stringify(res.data.list))
+        })
       }
+    }
+  },
+  created () {
+    document.title = '一级渠道详情'
+    this.searchForm.parentId = this.$route.query.id
+    get('/channelInfo/detail', {
+      id: this.$route.query.id
+    }).then(res => {
+      this.content = res.data
+    })
+    this.init()
+  },
+  methods: {
+    formatterWotv ({
+      cellValue
+    }) {
+      return cellValue !== '1' ? '关闭' : '开启'
     },
-    watch: {
-      value5(val) {
-        if (val) {
-          get('/channelInfo/channelogpage', this.channelogParam).then(res => {
-            this.channelog = res.data.list
-            this.channelogParam.totalResult = res.data.total
-          })
-          this.channelogParam.pageSize = 100
-          get('/channelInfo/channelogpage', this.channelogParam).then(res => {
-            this.channelogList = JSON.parse(JSON.stringify(res.data.list))
-          })
+    //导出
+    download () {
+      let formData = new FormData();
+      formData.append("channelName", this.content.channelName);
+      formData.append("channelStatus", 1);
+      formData.append("parentId", this.searchForm.parentId);
+      let loading = this.$loading({
+        lock: true,
+        text: "下载量较大,请耐心等待",
+        spinner: "el-icon-loading",
+        background: "rgba(0, 0, 0, 0.7)",
+      });
+      axios({
+        method: "post",
+        url: process.env.VUE_APP_BASE_API + "/channelInfo/download",
+        data: formData,
+        responseType: "blob",
+        headers: {
+          "Content-Type": "multipart/form-data",
+          token: getToken(),
+        },
+      }).then((res) => {
+        if (res.data) {
+          loading.close();
+          let a = document.createElement("a");
+          let blob = new Blob([res.data], {
+            type: "application/vnd.ms-excel",
+          });
+          let objectUrl = URL.createObjectURL(blob);
+          a.setAttribute("href", objectUrl);
+          a.setAttribute("download", "渠道数据.xlsx");
+          a.click();
+          URL.revokeObjectURL(a.objectUrl);
         }
-      }
+      });
     },
-    created() {
-      document.title = '一级渠道详情'
-      this.searchForm.parentId = this.$route.query.id
-      get('/channelInfo/detail', {
-        id: this.$route.query.id
-      }).then(res => {
-        this.content = res.data
-      })
-      this.init()
-    },
-    methods: {
-      formatterWotv({
-        cellValue
-      }) {
-        return cellValue !== '1' ? '关闭' : '开启'
-      },
-      //导出
-      download() {
-        let formData = new FormData();
-        formData.append("channelName", this.content.channelName);
-        formData.append("channelStatus", 1);
-        formData.append("parentId", this.searchForm.parentId);
-        let loading = this.$loading({
-          lock: true,
-          text: "下载量较大,请耐心等待",
-          spinner: "el-icon-loading",
-          background: "rgba(0, 0, 0, 0.7)",
-        });
-        axios({
-          method: "post",
-          url: process.env.VUE_APP_BASE_API + "/channelInfo/download",
-          data: formData,
-          responseType: "blob",
-          headers: {
-            "Content-Type": "multipart/form-data",
-            token: getToken(),
-          },
-        }).then((res) => {
-          if (res.data) {
-            loading.close();
-            let a = document.createElement("a");
-            let blob = new Blob([res.data], {
-              type: "application/vnd.ms-excel",
-            });
-            let objectUrl = URL.createObjectURL(blob);
-            a.setAttribute("href", objectUrl);
-            a.setAttribute("download", "渠道数据.xlsx");
-            a.click();
-            URL.revokeObjectURL(a.objectUrl);
-          }
-        });
-      },
 
-      onSubmit() {
-        post('/channelInfo/pushdata?beginTime=' + this.pushdataDate[0] + '&endTime=' + this.pushdataDate[1], {}).then(
-          res => {
+    onSubmit () {
+      post('/channelInfo/pushdata?beginTime=' + this.pushdataDate[0] + '&endTime=' + this.pushdataDate[1], {}).then(
+        res => {
+          this.$message({
+            message: res.message,
+            type: 'success'
+          });
+          this.pushdata = false
+        })
+    },
+    checkpushdata (e) {
+      get('/channelInfo/detail', {
+        id: e.id
+      }).then(res1 => {
+        let channel = res1.data
+        get('/channelInfo/checkpushdata', {
+          'fullCode': channel.fullCode
+        }).then(res => {
+          let data = JSON.parse(res.data)[0]
+          if (data.resdesc == 'ok' && data.subchannelkey !== "null") {
             this.$message({
-              message: res.message,
+              message: data.subchannelname + '已同步',
               type: 'success'
             });
-            this.pushdata = false
-          })
-      },
-      checkpushdata(e) {
-        get('/channelInfo/detail', {
-          id: e.id
-        }).then(res1 => {
-          let channel = res1.data
-          get('/channelInfo/checkpushdata', {
-            'fullCode': channel.fullCode
-          }).then(res => {
-            let data = JSON.parse(res.data)[0]
-            if (data.resdesc == 'ok' && data.subchannelkey !== "null") {
-              this.$message({
-                message: data.subchannelname + '已同步',
-                type: 'success'
-              });
-            } else {
-              let bigentime = channel.createTime
-              let endtime = this.dateNew(new Date(bigentime).getTime() + 3600000)
-              this.pushdataDate = [bigentime, endtime]
-              post('/channelInfo/pushdata?beginTime=' + this.pushdataDate[0] + '&endTime=' + this.pushdataDate[
-                1], {}).then(res => {
+          } else {
+            let bigentime = channel.createTime
+            let endtime = this.dateNew(new Date(bigentime).getTime() + 3600000)
+            this.pushdataDate = [bigentime, endtime]
+            post('/channelInfo/pushdata?beginTime=' + this.pushdataDate[0] + '&endTime=' + this.pushdataDate[
+              1], {}).then(res => {
                 console.log(res)
                 this.$message({
                   message: channel.channelName + '同步成功',
@@ -362,63 +358,77 @@
                 });
                 console.log('success')
               })
-            }
-          })
-        })
-      },
-      dateNew(timestamp) {
-        var date = new Date(timestamp); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
-        var Y = date.getFullYear() + '-';
-        var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
-        // var D = date.getDate() + ' ';
-        var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' ';
-        var h = date.getHours() + ':';
-        var m = date.getMinutes() + ':';
-        var s = date.getSeconds();
-        return Y + M + D + h + m + s;
-      },
-      init() {
-        get('/channelInfo/listChannels', 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)
-        }
-      },
-      toEdit(e, type) {
-        const routeUrl = this.$router.resolve({
-          path: '/schemeV2/channelEdit',
-          query: {
-            id: e.id,
-            'type': type
           }
         })
-        window.open(routeUrl.href, '_blank')
-      },
-      copy(row) {
+      })
+    },
+    dateNew (timestamp) {
+      var date = new Date(timestamp); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
+      var Y = date.getFullYear() + '-';
+      var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
+      // var D = date.getDate() + ' ';
+      var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' ';
+      var h = date.getHours() + ':';
+      var m = date.getMinutes() + ':';
+      var s = date.getSeconds();
+      return Y + M + D + h + m + s;
+    },
+    init () {
+      get('/channelInfo/listChannels', 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)
+      }
+    },
+    toEdit (e, type) {
+      const routeUrl = this.$router.resolve({
+        path: '/schemeV2/channelEdit',
+        query: {
+          id: e.id,
+          'type': type
+        }
+      })
+      window.open(routeUrl.href, '_blank')
+    },
+    copy (row) {
+      let oInput = document.createElement('input');
+      oInput.value = `https://operation.mige.tv/a/#/${row.channelKey}`;
+      document.body.appendChild(oInput);
+      oInput.select(); // 选择对象;
+      document.execCommand("Copy"); // 执行浏览器复制命令
+      this.$message({
+        message: '复制成功',
+        type: 'success'
+      });
+      oInput.remove()
+    },
+    giveShort (row) {
+      let stUrl = row.shortUrl
+      if (stUrl) {
         let oInput = document.createElement('input');
-        oInput.value = `https://operation.mige.tv/a/#/${row.channelKey}`;
+        oInput.value = `http://v.mige.tv/${stUrl}`;
         document.body.appendChild(oInput);
         oInput.select(); // 选择对象;
         document.execCommand("Copy"); // 执行浏览器复制命令
@@ -427,12 +437,15 @@
           type: 'success'
         });
         oInput.remove()
-      },
-      giveShort(row) {
-        let stUrl = row.shortUrl
-        if (stUrl) {
+      } else {
+        let updata = {
+          channel: row.channelKey,
+          longUrl: `https://operation.mige.tv/a/#/${row.channelKey}`
+        }
+        post('/channelInfo/shorturl', updata).then(res => {
+          let resUrl = res.data.shortCode
           let oInput = document.createElement('input');
-          oInput.value = `http://v.mige.tv/${stUrl}`;
+          oInput.value = `http://v.mige.tv/${resUrl}`;
           document.body.appendChild(oInput);
           oInput.select(); // 选择对象;
           document.execCommand("Copy"); // 执行浏览器复制命令
@@ -441,67 +454,49 @@
             type: 'success'
           });
           oInput.remove()
-        } else {
-          let updata = {
-            channel: row.channelKey,
-            longUrl: `https://operation.mige.tv/a/#/${row.channelKey}`
-          }
-          post('/channelInfo/shorturl', updata).then(res => {
-            let resUrl = res.data.shortCode
-            let oInput = document.createElement('input');
-            oInput.value = `http://v.mige.tv/${resUrl}`;
-            document.body.appendChild(oInput);
-            oInput.select(); // 选择对象;
-            document.execCommand("Copy"); // 执行浏览器复制命令
-            this.$message({
-              message: '复制成功',
-              type: 'success'
-            });
-            oInput.remove()
-          })
-        }
-      },
-      ewm(row) {
-        this.dialogVisible = true;
-        this.$nextTick(function () {
-          document.getElementById("qrcode").innerHTML = "";
-          let qrcode = new QRCode("qrcode", {
-            width: 300,
-            height: 300,
-            text: `https://operation.mige.tv/a/#/${row.channelKey}`
-          });
-        });
-      },
-      handlePageChange({
-        currentPage,
-        pageSize
-      }) {
-        this.searchForm.pageNum = currentPage
-        this.searchForm.pageSize = pageSize
-        this.init()
-      },
-      handlePageChangeChannelog({
-        currentPage,
-        pageSize
-      }) {
-        this.channelogParam.pageNum = currentPage
-        this.channelogParam.pageSize = pageSize
-        get('/channelInfo/channelogpage', this.channelogParam).then(res => {
-          this.channelog = res.data.list
-          this.channelogParam.totalResult = res.data.total
-        })
-      },
-      searchEvent() {
-        get('/channelInfo/channelogpage', this.channelogParam).then(res => {
-          this.channelog = res.data.list
-          this.channelogParam.totalResult = res.data.total
         })
       }
+    },
+    ewm (row) {
+      this.dialogVisible = true;
+      this.$nextTick(function () {
+        document.getElementById("qrcode").innerHTML = "";
+        let qrcode = new QRCode("qrcode", {
+          width: 300,
+          height: 300,
+          text: `https://operation.mige.tv/a/#/${row.channelKey}`
+        });
+      });
+    },
+    handlePageChange ({
+      currentPage,
+      pageSize
+    }) {
+      this.searchForm.pageNum = currentPage
+      this.searchForm.pageSize = pageSize
+      this.init()
+    },
+    handlePageChangeChannelog ({
+      currentPage,
+      pageSize
+    }) {
+      this.channelogParam.pageNum = currentPage
+      this.channelogParam.pageSize = pageSize
+      get('/channelInfo/channelogpage', this.channelogParam).then(res => {
+        this.channelog = res.data.list
+        this.channelogParam.totalResult = res.data.total
+      })
+    },
+    searchEvent () {
+      get('/channelInfo/channelogpage', this.channelogParam).then(res => {
+        this.channelog = res.data.list
+        this.channelogParam.totalResult = res.data.total
+      })
     }
   }
+}
 
 </script>
 
 <style scoped>
-
 </style>

+ 58 - 61
purchase_ao/src/views/strategy/add.vue

@@ -3,7 +3,12 @@
     <div class="content">
       <!-- 预览页 -->
       <div class="page">
-        <el-button :disabled="templateList.length===0" class="look" size="small" type="primary" @click="preview"> 预览</el-button>
+        <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;" 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>
+
         <div class="ifreamBox">
           <iframe id="ifreamId" class="ifream" height="100%" width="100%" :src="ifreamSrc"></iframe>
         </div>
@@ -291,13 +296,11 @@
                         <span>动态文件</span>
                       </el-tooltip>
                     </template>
-                    <div v-if="productJson.jsonImg!==''" class="svgImg">
-                      <div id="lottie_box"></div>
-                    </div>
+                    <div style="max-width:260px !important" id="lottie_box"></div>
                     <el-upload v-if="productJson.jsonImg===''" class="avatar-uploader" :show-file-list="false" :action="imgapi" :on-success="((file,fileList)=>{fileSuccess(file,fileList,'主jsonImg')})">
                       <i class="el-icon-plus avatar-uploader-icon"></i>
                     </el-upload>
-                    <span v-if="productJson.jsonImg!==''" @click="productJson.jsonImg=''" style="color: #F56C6C; cursor: pointer">删除</span>
+                    <span v-if="productJson.jsonImg!==''" @click="svgRemove('主')" style="color: #F56C6C; cursor: pointer">删除</span>
                   </el-form-item>
                   <el-form-item>
                     <template slot="label">
@@ -325,27 +328,27 @@
                   </el-form-item>
                   <el-form-item>
                     <template slot="label">
-                      <el-tooltip :open-delay="500" content="页面中产品说明配图  产品说明title配图" placement="top">
-                        <span>产品说明标题</span>
+                      <el-tooltip :open-delay="500" content="订购窗配图" placement="top">
+                        <span>订购窗配图</span>
                       </el-tooltip>
                     </template>
-                    <el-upload class="avatar-uploader" :show-file-list="false" :action="imgapi" :on-success="((file,fileList)=>{fileSuccess(file,fileList,'主orderImg')})">
-                      <img v-if="productJson.orderImg !==''" :src="imgUrl+productJson.orderImg" class="avatar" />
+                    <el-upload class="avatar-uploader" :show-file-list="false" :action="imgapi" :on-success="((file,fileList)=>{fileSuccess(file,fileList,'主explainImg')})">
+                      <img v-if="productJson.explainImg !== ''" :src="imgUrl+productJson.explainImg" class="avatar" />
                       <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                     </el-upload>
-                    <span v-if="productJson.orderImg!==''" @click="productJson.orderImg=''" style="color: #F56C6C; cursor: pointer">删除</span>
+                    <span v-if="productJson.explainImg!==''" @click="productJson.explainImg=''" style="color: #F56C6C; cursor: pointer">删除</span>
                   </el-form-item>
                   <el-form-item>
                     <template slot="label">
-                      <el-tooltip :open-delay="500" content="订购窗配图" placement="top">
-                        <span>订购窗配图</span>
+                      <el-tooltip :open-delay="500" content="页面中产品说明配图  产品说明title配图" placement="top">
+                        <span>产品说明标题</span>
                       </el-tooltip>
                     </template>
-                    <el-upload class="avatar-uploader" :show-file-list="false" :action="imgapi" :on-success="((file,fileList)=>{fileSuccess(file,fileList,'主explainImg')})">
-                      <img v-if="productJson.explainImg !== ''" :src="imgUrl+productJson.explainImg" class="avatar" />
+                    <el-upload class="avatar-uploader" :show-file-list="false" :action="imgapi" :on-success="((file,fileList)=>{fileSuccess(file,fileList,'主orderImg')})">
+                      <img v-if="productJson.orderImg !==''" :src="imgUrl+productJson.orderImg" class="avatar" />
                       <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                     </el-upload>
-                    <span v-if="productJson.explainImg!==''" @click="productJson.explainImg=''" style="color: #F56C6C; cursor: pointer">删除</span>
+                    <span v-if="productJson.orderImg!==''" @click="productJson.orderImg=''" style="color: #F56C6C; cursor: pointer">删除</span>
                   </el-form-item>
                 </el-collapse-item>
                 <el-collapse-item v-if="form.viceProductIds.length>0" title="配色方案-副产品" name="2">
@@ -425,13 +428,11 @@
                     <template slot="label">
                       <span>动态文件</span>
                     </template>
-                    <div v-if="viceJson.jsonImg!==''" class="svgImg">
-                      <div id="lottieVice"></div>
-                    </div>
+                    <div style="max-width:260px !important" id="lottieVice"></div>
                     <el-upload v-if="viceJson.jsonImg===''" class="avatar-uploader" :show-file-list="false" :action="imgapi" :on-success="((file,fileList)=>{fileSuccess(file,fileList,'副jsonImg')})">
                       <i class="el-icon-plus avatar-uploader-icon"></i>
                     </el-upload>
-                    <span v-if="viceJson.jsonImg!==''" @click="viceJson.jsonImg=''" style="color: #F56C6C; cursor: pointer">删除</span>
+                    <span v-if="viceJson.jsonImg!==''" @click="svgRemove('副')" style="color: #F56C6C; cursor: pointer">删除</span>
                   </el-form-item>
                   <el-form-item>
                     <template slot="label">
@@ -456,23 +457,23 @@
                   </el-form-item>
                   <el-form-item>
                     <template slot="label">
-                      <span>产品说明标题</span>
+                      <span>订购窗配图</span>
                     </template>
-                    <el-upload class="avatar-uploader" :show-file-list="false" :action="imgapi" :on-success="((file,fileList)=>{fileSuccess(file,fileList,'副orderImg')})">
-                      <img v-if="viceJson.orderImg" :src="imgUrl+viceJson.orderImg" class="avatar" />
+                    <el-upload class="avatar-uploader" :show-file-list="false" :action="imgapi" :on-success="((file,fileList)=>{fileSuccess(file,fileList,'副explainImg')})">
+                      <img v-if="viceJson.explainImg" :src="imgUrl+viceJson.explainImg" class="avatar" />
                       <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                     </el-upload>
-                    <span v-if="viceJson.orderImg!==''" @click="viceJson.orderImg=''" style="color: #F56C6C; cursor: pointer">删除</span>
+                    <span v-if="viceJson.explainImg!==''" @click="viceJson.explainImg=''" style="color: #F56C6C; cursor: pointer">删除</span>
                   </el-form-item>
                   <el-form-item>
                     <template slot="label">
-                      <span>订购窗配图</span>
+                      <span>产品说明标题</span>
                     </template>
-                    <el-upload class="avatar-uploader" :show-file-list="false" :action="imgapi" :on-success="((file,fileList)=>{fileSuccess(file,fileList,'副explainImg')})">
-                      <img v-if="viceJson.explainImg" :src="imgUrl+viceJson.explainImg" class="avatar" />
+                    <el-upload class="avatar-uploader" :show-file-list="false" :action="imgapi" :on-success="((file,fileList)=>{fileSuccess(file,fileList,'副orderImg')})">
+                      <img v-if="viceJson.orderImg" :src="imgUrl+viceJson.orderImg" class="avatar" />
                       <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                     </el-upload>
-                    <span v-if="viceJson.explainImg!==''" @click="viceJson.explainImg=''" style="color: #F56C6C; cursor: pointer">删除</span>
+                    <span v-if="viceJson.orderImg!==''" @click="viceJson.orderImg=''" style="color: #F56C6C; cursor: pointer">删除</span>
                   </el-form-item>
                 </el-collapse-item>
                 <el-collapse-item title="菜单按钮" name="4">
@@ -761,10 +762,9 @@
             </el-form>
           </div>
         </div>
-        <div class="footer">
-          <el-button style="float:right;margin-left: 15px;" type="primary" icon="el-icon-folder-add" size="mini" @click="keepClick()">保存</el-button>
-          <el-button style="float:right;margin-left: 15px;" size="mini" icon="el-icon-circle-close" @click="$router.go(-1)">取消</el-button>
-        </div>
+        <!-- <div class="footer">
+
+        </div> -->
       </div>
     </div>
 
@@ -927,7 +927,7 @@ export default {
   },
   methods: {
     inputBlur () {
-      this.form.strategyName = this.form.strategyName + '-' + this.$store.state.user.name
+      this.form.strategyName = this.$store.state.user.name+'——'+this.form.strategyName
     },
     // 选择模板
     templateChange (e) {
@@ -966,8 +966,13 @@ export default {
         this.objVal(this.otherJson, JSON.parse(this.form.otherJson))
         this.viceProductId = this.form.viceProductIds[0]
         this.unsubscribeStrategyIds = this.form.unsubscribeStrategyIds[0]
-        if (this.productJson.jsonImg !== '' && this.viceJson.jsonImg !== '') {
-          this.svgClick('all')
+        if (this.productJson.jsonImg !== '') {
+          let imgUrl = this.imgUrl + this.productJson.jsonImg
+          this.svgClick('主', imgUrl)
+        }
+        if (this.viceJson.jsonImg !== '') {
+          let imgUrl = this.imgUrl + this.viceJson.jsonImg
+          this.svgClick('副', imgUrl)
         }
         if (this.$route.query.copy) {
           this.form.strategyName = this.form.strategyName + '-复制'
@@ -980,7 +985,7 @@ export default {
     },
     // 获取新策略列表
     getStrategyList () {
-      get('/strategytemplate/list', this.form).then(res => {
+      get('/strategytemplate/list', { pageNum: 1, pageSize: 9999 }).then(res => {
         this.strategyInfoList = res.data.list
       })
     },
@@ -1135,7 +1140,8 @@ export default {
           this.productJson.bannerImg = file.data
         } else if (name === '主jsonImg') {
           this.productJson.jsonImg = file.data
-          this.svgClick('主', file.data)
+          let imgUrl = this.imgUrl + file.data
+          this.svgClick('主', imgUrl)
         } else if (name === '主upImg') {
           this.productJson.upImg = file.data
         } else if (name === '主topImg') {
@@ -1148,7 +1154,8 @@ export default {
           this.viceJson.bannerImg = file.data
         } else if (name === '副jsonImg') {
           this.viceJson.jsonImg = file.data
-          this.svgClick('副', file.data)
+          let imgUrl = this.imgUrl + file.data
+          this.svgClick('副', imgUrl)
         } else if (name === '副upImg') {
           this.viceJson.upImg = file.data
         } else if (name === '副topImg') {
@@ -1182,7 +1189,7 @@ export default {
           renderer: 'svg',
           loop: true,
           autoplay: true,
-          path: this.imgUrl + path
+          path: path
         })
       } else if (name === '副') {
         this.lottie = lottie.loadAnimation({
@@ -1190,25 +1197,20 @@ export default {
           renderer: 'svg',
           loop: true,
           autoplay: true,
-          path: this.imgUrl + path
-        })
-      } else if (name === 'all') {
-        this.lottie = lottie.loadAnimation({
-          container: document.getElementById('lottieVice'),
-          renderer: 'svg',
-          loop: true,
-          autoplay: true,
-          path: this.imgUrl + this.viceJson.jsonImg
-        })
-        this.lottie = lottie.loadAnimation({
-          container: document.getElementById('lottie_box'),
-          renderer: 'svg',
-          loop: true,
-          autoplay: true,
-          path: this.imgUrl + this.productJson.jsonImg
+          path: path
         })
       }
-
+    },
+    svgRemove (name) {
+      if (name === '主') {
+        this.productJson.jsonImg = ''
+        let div = document.getElementById('lottie_box')
+        div.innerHTML = ""
+      } else if (name === '副') {
+        this.viceJson.jsonImg = ''
+        let div = document.getElementById('lottieVice')
+        div.innerHTML = ""
+      }
     }
   },
 }
@@ -1249,7 +1251,7 @@ export default {
       0 16px 24px 2px rgb(0 0 0 / 14%), 0 6px 30px 5px rgb(0 0 0 / 12%);
     .main {
       width: 100%;
-      height: 80vh;
+      height: 100vh;
       overflow-y: scroll;
     }
     ::-webkit-scrollbar {
@@ -1269,11 +1271,6 @@ export default {
       overflow: hidden;
     }
   }
-  .svgImg {
-    max-width: 260px;
-    margin-right: 10px;
-    display: inline-block;
-  }
 
   .avatar-uploader-icon {
     background-color: #fbfdff;

+ 3 - 3
purchase_ao/src/views/strategy/index.vue

@@ -155,13 +155,13 @@ export default {
     },
     // 每页数量
     handleSizeChange (val) {
-      this.form.pageNum = val
+      this.form.pageNum = 1
+      this.form.pageSize = val
       this.getStrategyList()
     },
     // 当前页
     handleCurrentChange (val) {
-      this.form.pageNum = 1
-      this.form.pageSize = val
+      this.form.pageNum = val
       this.getStrategyList()
     },
     // 数据失效处理