Bläddra i källkod

批量创建广告组

zhuxinbo 5 år sedan
förälder
incheckning
79b1328156

+ 1 - 0
src/components/layouts/TabLayout.vue

@@ -83,6 +83,7 @@
       if(!this.linkList.includes("/account/stepForm")){
           localStorage.removeItem("step")
           localStorage.removeItem("campaignId")
+          localStorage.removeItem("pans")
       }
       if(!this.linkList.includes("/account/advertisingGroup")){
           localStorage.removeItem("advertisingGroup")

+ 22 - 5
src/views/modules/Statistics/dataDisplayStatistics.vue

@@ -367,6 +367,17 @@ const columns = [
     dataIndex: 'afterFormPrice',
     align: 'center'
   },
+
+  {
+    title: '注册数',
+    dataIndex: 'eventRegister',
+    align: 'center'
+  },
+  {
+    title: '注册成本(¥)',
+    dataIndex: 'eventRegisterCost',
+    align: 'center'
+  },
   {
     title: '单价区间',
     dataIndex: 'price',
@@ -615,7 +626,9 @@ export default {
                   ? (item.activationPrice / this.discount).toFixed(2)
                   : 0,
                 date: this.statHour ? res.result.statDate + '  ' + this.statHour : res.result.statDate,
-                formCount: item.formCount > 0 ? item.formCount : item.activationCount
+                formCount: item.formCount > 0 ? item.formCount : item.activationCount,
+                eventRegister: item.eventRegister.toFixed(2),
+                eventRegisterCost: item.eventRegisterCost.toFixed(2)
               }
             })
             var index = this.data.length
@@ -641,7 +654,9 @@ export default {
                   : res.result.now.activationPrice
                   ? (res.result.now.activationPrice / this.discount).toFixed(2)
                   : 0,
-                formCount: res.result.now.formCount > 0 ? res.result.now.formCount : res.result.now.activationCount
+                formCount: res.result.now.formCount > 0 ? res.result.now.formCount : res.result.now.activationCount,
+                eventRegister: res.result.now.eventRegister.toFixed(2),
+                eventRegisterCost: res.result.now.eventRegisterCost.toFixed(2)
               }
               var allYesterday = {
                 key: index + 2,
@@ -667,7 +682,9 @@ export default {
                 formCount:
                   res.result.yesterday.formCount > 0
                     ? res.result.yesterday.formCount
-                    : res.result.yesterday.activationCount
+                    : res.result.yesterday.activationCount,
+                eventRegister: res.result.yesterday.eventRegister.toFixed(2),
+                eventRegisterCost: res.result.yesterday.eventRegisterCost.toFixed(2)
               }
               var chainRatio = {
                 key: index + 3,
@@ -691,14 +708,14 @@ export default {
                   : res.result.chainRatio.beforeActivationPriceProportion
                   ? (res.result.chainRatio.beforeActivationPriceProportion * 100).toFixed(2) + '%'
                   : 0.0 + '%',
-
                 afterFormPrice: res.result.chainRatio.afterFormPriceProportion
                   ? (res.result.chainRatio.afterFormPriceProportion * 100).toFixed(2) + '%'
                   : res.result.chainRatio.afterActivationPriceProportion
                   ? (res.result.chainRatio.afterActivationPriceProportion * 100).toFixed(2) + '%'
                   : 0 + '%',
-
                 costY: (res.result.chainRatio.costProportion * 100).toFixed(2) + '%',
+                eventRegister: (res.result.chainRatio.eventRegisterProportion * 100).toFixed(2) + '%',
+                eventRegisterCost: (res.result.chainRatio.eventRegisterCostProportion * 100).toFixed(2) + '%',
                 accountId: '环比'
               }
               this.data.push(allNow)

+ 46 - 8
src/views/modules/advertiser/ProjectMemberList.vue

@@ -108,16 +108,15 @@
       :okButtonProps="{ props: { disabled: false } }"
       :cancelButtonProps="{ props: { disabled: false } }"
     >
-      <a-form v-model="form">
+      <a-form :form="form">
         <a-form-item
           label="选择方式"
           :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
           :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
         >
           <a-radio-group buttonStyle="solid" v-model="mode" @change="onChageLogin">
-              <a-radio-button value="authorization">授权</a-radio-button>
+            <a-radio-button value="authorization">授权</a-radio-button>
             <a-radio-button value="login">登录</a-radio-button>
-            
           </a-radio-group>
         </a-form-item>
 
@@ -147,6 +146,34 @@
             <a-radio-button value="bytedance">头条</a-radio-button>
           </a-radio-group>
         </a-form-item>
+        <a-form-item
+          label="预警金额"
+          :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
+          :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
+        >
+          <!-- <a-input v-decorator="['warningAmount', { rules: [{ required: true, message: '请输入预警金额' }] }]" /> -->
+          <a-input-number
+            style="width:50%"
+            v-decorator="[
+              'warningAmount',
+              { rules: [{ required: true, message: '请输入预警金额' }], initialValue: 5000 }
+            ]"
+          />
+        </a-form-item>
+        <a-form-item
+          label="预警比例"
+          :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
+          :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
+        >
+          <a-input-number
+            :step="0.1"
+            style="width:50%"
+            v-decorator="[
+              'warningProportion',
+              { rules: [{ required: true, message: '请输入预警比例' }], initialValue: 1.5 }
+            ]"
+          />
+        </a-form-item>
       </a-form>
     </a-modal>
 
@@ -256,6 +283,16 @@ export default {
           scopedSlots: { customRender: 'maxBid' }
         },
         {
+          title: '预警金额',
+          align: 'center',
+          dataIndex: 'warningAmount'
+        },
+        {
+          title: '预警比例',
+          align: 'center',
+          dataIndex: 'warningProportion'
+        },
+        {
           title: '操作',
           dataIndex: 'action',
           align: 'center',
@@ -336,9 +373,9 @@ export default {
         operator: '运营专员',
         kuaishouOperationManager: '快手运营经理',
         designTeamLeader: '设计组长',
-        planeLeader:"平面组长",
-        touTiaoOperationManager:'头条运营经理',
-        operationAssistant:"运营助理"
+        planeLeader: '平面组长',
+        touTiaoOperationManager: '头条运营经理',
+        operationAssistant: '运营助理'
       }
 
       if (value) {
@@ -396,7 +433,6 @@ export default {
       this.loading = true
       getAction('/ctop/project/responsibleList', { userId: this.userInfo().id }).then(res => {
         if (res.code == 0) {
-         
           this.dataSource = res.result
           this.dataElse = res.result
           this.loading = false
@@ -501,7 +537,7 @@ export default {
       params.projectName = this.record.projectName
 
       // 触发表单验证
-      this.form.validateFields(err => {
+      this.form.validateFields((err, values) => {
         if (!err) {
           if (this.mode == 'login') {
             params.accountName = this.accountName
@@ -532,6 +568,8 @@ export default {
             } else if (this.loginType == 'bytedance') {
               params.mediaId = 1
             }
+            params.warningAmount = values.warningAmount
+            params.warningProportion = values.warningProportion
             httpAction(this.bindAuthorizationUrl, params, 'post').then(res => {
               if (res.success) {
                 window.open(res.message, '_blank')

+ 25 - 3
src/views/modules/advertiser/modules/UserAllocationModal.vue

@@ -11,13 +11,13 @@
     <a-spin :spinning="confirmLoading">
       <a-form :form="form">
         <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="账户所属人">
-          <a-input placeholder="请输入userName" v-decorator="['userName', {}]" disabled/>
+          <a-input placeholder="请输入userName" v-decorator="['userName', {}]" disabled />
         </a-form-item>
         <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="账号id">
           <a-input placeholder="请输入账户id --授权" v-decorator="['accountId', {}]" disabled />
         </a-form-item>
         <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="广告主名称">
-          <a-input placeholder="请输入广告主名称" v-decorator="['advertiserName', {}]" disabled/>
+          <a-input placeholder="请输入广告主名称" v-decorator="['advertiserName', {}]" disabled />
         </a-form-item>
         <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="项目名称">
           <a-input placeholder="请输入项目名称" v-decorator="['projectName', {}]" disabled />
@@ -38,6 +38,26 @@
             <a-select-option value="2">快手</a-select-option>
           </a-select>
         </a-form-item>
+        <a-form-item label="预警金额" :labelCol="labelCol" :wrapperCol="wrapperCol">
+          <!-- <a-input v-decorator="['warningAmount', { rules: [{ required: true, message: '请输入预警金额' }] }]" /> -->
+          <a-input-number
+            style="width:100%"
+            v-decorator="[
+              'warningAmount',
+              { rules: [{ required: true, message: '请输入预警金额' }], initialValue: 5000 }
+            ]"
+          />
+        </a-form-item>
+        <a-form-item label="预警比例" :labelCol="labelCol" :wrapperCol="wrapperCol">
+          <a-input-number
+            :step="0.1"
+            style="width:100%"
+            v-decorator="[
+              'warningProportion',
+              { rules: [{ required: true, message: '请输入预警比例' }], initialValue: 1.5 }
+            ]"
+          />
+        </a-form-item>
       </a-form>
     </a-spin>
   </a-modal>
@@ -95,7 +115,9 @@ export default {
             'projectName',
             'accountName',
             'authName',
-            'mediaId'
+            'mediaId',
+            "warningAmount",
+            "warningProportion"
           )
         )
         //时间格式化

+ 294 - 67
src/views/modules/kuaishouapp/account/advertisingGroup.vue

@@ -1,5 +1,5 @@
 <style>
-.account-statistics .ant-card-body .count {
+.advertising-group .ant-card-body .count {
   display: inline-block;
   height: 32px;
   line-height: 32px;
@@ -18,6 +18,21 @@
         <a-button @click="dianji" style="margin-bottom:15px;">新增广告组</a-button>
         <a-button @click="showEdit = true" style="margin:0 0 15px 15px;">列表项筛选</a-button>
 
+        <div v-show="selectedRowKeys.length > 0">
+          批量修改预算:<a-input-number :min="0" :step="0.01" v-model="allMoney" style="width:150px" @fouse.stop />
+          <a-button @click="editMoney" style="margin:0 15px 15px 15px" type="primary">修改</a-button>
+
+          批量修改出价:<a-input-number :min="0" :step="0.01" v-model="allMoneyBid" style="width:150px" @fouse.stop />
+          <a-button @click="editMoneyBid" style="margin:0 15px 15px 15px" type="primary">修改</a-button>
+
+          批量操作:
+          <a-select style="width: 120px" v-model="allType">
+            <a-select-option value="1">启动</a-select-option>
+            <a-select-option value="2">暂停</a-select-option>
+            <a-select-option value="3">删除</a-select-option>
+          </a-select>
+          <a-button @click="editStatus" style="margin:0 0 15px 15px" type="primary">确认</a-button>
+        </div>
         <a-modal title="列表项筛选" v-model="showEdit" @ok="handleOk">
           <a-checkbox :indeterminate="indeterminate" @change="onCheckAllChange" :checked="checkAll">全选</a-checkbox>
           <a-checkbox-group :options="showList" v-model="dataValue" class="checked" />
@@ -30,13 +45,22 @@
           bordered
           :customRow="rowClick"
           :pagination="ipagination"
-          :scroll="{ x: true }"
+          :scroll="{ x: 1900 }"
+          :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
         >
+          <span slot="action" slot-scope="text, record">
+            <a-switch v-model="record.showSwich" @change="onChangeSwitch(record)" />
+          </span>
+
           <span slot="status" slot-scope="text">{{ text | status }}</span>
           <span slot="putStatus" slot-scope="text">{{ text | putStatus }}</span>
           <span slot="createChannel" slot-scope="text">{{ text | createChannel }}</span>
-          <span slot="bidType" slot-scope="text">{{ text | bidType }}</span>
-          <span slot="ocpxActionType" slot-scope="text">{{ text | ocpxActionType }}</span>
+          <span slot="bidType" slot-scope="text, record">
+            <!-- {{ text | bidType }} -->
+            {{ record.ocpxActionType | ocpxActionType }}</span
+          >
+          <!-- <span slot="ocpxActionType" slot-scope="text">{{ text | ocpxActionType }}</span> -->
+
           <span slot="speed" slot-scope="text">{{ text | speed }}</span>
           <span slot="sceneId" slot-scope="text"
             ><span v-for="item of text" :key="item">{{ item | sceneId }}</span></span
@@ -44,11 +68,61 @@
           <span slot="showModel" slot-scope="text">{{ text | showModel }}</span>
           <span slot="unitType" slot-scope="text">{{ text == 4 ? '自定义' : '' }}</span>
           <span slot="urlType" slot-scope="text">{{ text | urlType }}</span>
-          <!-- <span slot=""></span>
-          <span slot=""></span> -->
+
+          <template slot="dayBudget" slot-scope="text, record">
+            <div style="display:flex;justify-content: center;">
+              <span v-show="!record.edit" class="count">{{ text ? (text / 1000).toFixed(2) : '不限制预算' }}</span>
+              <a-input-number
+                :min="0"
+                :step="0.01"
+                v-show="record.edit"
+                v-model="record.elseMoney"
+                style="width:150px"
+                @fouse.stop
+              />
+              <a-icon
+                :type="record.edit ? 'check' : 'edit'"
+                @click.stop=";(record.edit = !record.edit), editShow(record)"
+                style="margin-left:10px"
+                class="count"
+              />
+            </div>
+          </template>
+          <template slot="bid" slot-scope="text, record">
+            <!-- <span slot="bid" slot-scope="text, record">{{ text == 0 ? record.cpaBid / 1000 : text / 1000 }}</span> -->
+            <div style="display:flex;justify-content: center;">
+              <span v-show="!record.editBid" class="count">{{ text == 0 ? record.cpaBid / 1000 : text / 1000 }}</span>
+              <a-input-number
+                :min="0"
+                :step="0.01"
+                v-show="record.editBid"
+                v-model="record.elseMoneyBid"
+                style="width:150px"
+                @fouse.stop
+              />
+              <a-icon
+                :type="record.editBid ? 'check' : 'edit'"
+                @click.stop=";(record.editBid = !record.editBid), editShowBid(record)"
+                style="margin-left:10px"
+                class="count"
+              />
+            </div>
+          </template>
         </a-table>
       </a-card>
     </a-row>
+    <a-modal v-model="visible" title="错误信息" onOk="handleOk" :footer="null">
+      <div v-if="visibleData">
+        修改条数:{{ visibleData.totalCount }} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;失败条数:{{ visibleData.failCount }}
+        <div style="margin-top:20px">
+          <p v-for="(item, index) of visibleData.failInfo" :key="index">
+            <span>名称:{{ item.campaignName }}</span
+            ><br />
+            <span>错误信息:{{ item.message }}</span>
+          </p>
+        </div>
+      </div>
+    </a-modal>
   </div>
 </template>
 
@@ -57,20 +131,43 @@ import ARow from 'ant-design-vue/es/grid/Row'
 import ACol from 'ant-design-vue/es/grid/Col'
 import moment from 'moment'
 import countTo from 'vue-count-to'
-import { deleteAction, getAction } from '@/api/manage'
+import { deleteAction, getAction, postAction } from '@/api/manage'
 // import lifting from './components/lifting'
+import { mapGetters } from 'vuex'
 var columns = [
   {
-    title: '广告计划ID',
+    title: '操作',
     align: 'center',
-    dataIndex: 'campaignId',
-    colSpan: 1
+    dataIndex: 'action',
+    fixed: 'left',
+    width: 100,
+    scopedSlots: { customRender: 'action' }
+  },
+  {
+    title: '预算',
+    align: 'center',
+    dataIndex: 'dayBudget',
+    colSpan: 1,
+    scopedSlots: { customRender: 'dayBudget' },
+    width: 200,
+    fixed: 'left'
+  },
+  {
+    title: '出价',
+    align: 'center',
+    dataIndex: 'bid',
+    scopedSlots: { customRender: 'bid' },
+    colSpan: 1,
+    width: 150,
+    fixed: 'left'
   },
   {
     title: '广告组名称',
     align: 'center',
     dataIndex: 'unitName',
-    colSpan: 1
+    colSpan: 1,
+    fixed: 'left',
+    width: 200
   },
   {
     title: '广告组状态',
@@ -106,44 +203,13 @@ var columns = [
     colSpan: 1,
     scopedSlots: { customRender: 'bidType' }
   },
-  {
-    title: '出价',
-    align: 'center',
-    dataIndex: 'bid',
-    colSpan: 1
-  },
-  {
-    title: 'OCPC出价',
-    align: 'center',
-    dataIndex: 'cpaBid',
-    colSpan: 1
-  },
-  {
-    title: '优化目标',
-    align: 'center',
-    dataIndex: 'ocpxActionType',
-    colSpan: 1,
-    scopedSlots: { customRender: 'ocpxActionType' }
-  },
   //   {
-  //     title: '深度转换目标',
+  //     title: 'OCPC出价',
   //     align: 'center',
-  //     dataIndex: 'deepConversionType',
-  //     colSpan:1
-  //   },
-  //   {
-  //     title: '深度转换目标出价',
-  //     align: 'center',
-  //     dataIndex: 'deepConversionBid',
-  //     colSpan:1
+  //     dataIndex: 'cpaBid',
+  //     colSpan: 1
   //   },
   {
-    title: '单日预算',
-    align: 'center',
-    dataIndex: 'dayBudget',
-    colSpan: 1
-  },
-  {
     title: '投放方式',
     align: 'center',
     dataIndex: 'speed',
@@ -156,12 +222,12 @@ var columns = [
     dataIndex: 'beginTime',
     colSpan: 1
   },
-  {
-    title: '投放结束时间',
-    align: 'center',
-    dataIndex: 'endTime',
-    colSpan: 1
-  },
+  //   {
+  //     title: '投放结束时间',
+  //     align: 'center',
+  //     dataIndex: 'endTime',
+  //     colSpan: 1
+  //   },
   {
     title: '广告位',
     align: 'center',
@@ -202,25 +268,21 @@ export default {
 
   data: function() {
     return {
-      three: {
-        title: 'url类型',
-        align: 'center',
-        dataIndex: 'urlType',
-        colSpan: 1,
-        scopedSlots: { customRender: 'urlType' }
-      },
-
-      duration: 1000,
+      visible: false,
+      visibleData: null,
       showEdit: false,
       columns,
       columnsElse: columns,
       dataList: [],
+      selectedRowKeys: [],
+      selectedRowKeysValue: [],
       rowClick: (record, index) => ({
         // 事件
         on: {
           dblclick: () => {
             // 点击改行时要做的事情
-            localStorage.setItem('originalityKey', record.campaignName)
+            localStorage.setItem('originalityKey', record.unitId)
+            localStorage.setItem('campaignId', record.campaignId)
             if (localStorage.getItem('originality')) {
               var dataElse = JSON.parse(localStorage.getItem('originality'))
               for (let i = 0; i < dataElse.length; i++) {
@@ -269,12 +331,28 @@ export default {
       showList: null,
       dataValue: [],
       indeterminate: true,
-      checkAll: false
+      checkAll: false,
+      allMoney: null,
+      allMoneyBid: null,
+      allType: '1',
+      maxBid: null
     }
   },
   filters: {
     status(sta) {
-      var data = { '-1': '不限', 1: '已暂停', 3: '计划超预算', 4: '有效', 6: '余额不足' }
+      var data = {
+        '-1': '不限',
+        1: '计划已暂停',
+        3: '计划超预算',
+        6: '余额不足',
+        11: '审核中',
+        12: '审核未通过',
+        14: '已结束',
+        15: '已暂停',
+        17: '组超预算',
+        19: '未达投放时间',
+        20: '有效'
+      }
       return data[sta]
     },
     putStatus(sta) {
@@ -290,7 +368,7 @@ export default {
       return data[sta]
     },
     ocpxActionType(sta) {
-      var data = { 0: '未知', 2: '点击转化链接', 10: '曝光', 11: '点击', 31: '下载完成', 53: '提交线索', 180: '激活' }
+      var data = { 0: '封面点击', 2: '行为数', 10: '曝光', 11: '点击', 31: '下载完成', 53: '提交线索', 180: '激活' }
       return data[sta]
     },
     speed(sta) {
@@ -298,7 +376,7 @@ export default {
       return data[sta]
     },
     sceneId(sta) {
-      var data = { 1: '优选广告位', 2: '按场景选择广告位-信息流广告', 3: '按场景选择广告位-视频后贴片广告' }
+      var data = { 1: '优选广告位', 2: '信息流广告', 3: '视频后贴片广告' }
       return data[sta]
     },
     showModel(sta) {
@@ -311,6 +389,139 @@ export default {
     }
   },
   methods: {
+    ...mapGetters(['nickname', 'avatar', 'userInfo']),
+    onChangeSwitch(item) {
+      console.log(item)
+      var params = {}
+      params.accountId = localStorage.getItem('accountId')
+      params.putStatus = item.showSwich ? 1 : 2
+      params.userId = this.userInfo().id
+      params.unitIds = [item.unitId]
+      postAction('/kuaishou/batch/batchUpdateUnitStatus', params).then(res => {
+        console.log(res)
+      })
+    },
+    editShowBid(item) {
+      if (!item.editBid) {
+        if (item.elseMoneyBid < 1 || item.elseMoneyBid > this.maxBid) {
+          this.$message.error('不得低于1元,不得高于项目最高出价' + this.maxBid + '元')
+          return
+        } else {
+          item.bid = item.elseMoneyBid * 1000
+          var params = {}
+          params.accountId = localStorage.getItem('accountId')
+          params.bid = item.elseMoneyBid * 1000
+          params.userId = this.userInfo().id
+          params.unitIds = [item.unitId]
+          postAction('/kuaishou/batch/batchUpdateUnitBid', params).then(res => {
+            console.log(res)
+            if (res.result.failCount > 0) {
+              this.$message.error(
+                '广告计划:' +
+                  res.result.failInfo[0].campaignName +
+                  '          ' +
+                  '错误:' +
+                  res.result.failInfo[0].message
+              )
+            }
+          })
+        }
+      } else {
+        item.elseMoneyBid = item.bid == 0 ? item.cpaBid / 1000 : item.bid / 1000
+      }
+      console.log(item)
+    },
+    editShow(item) {
+      if (!item.edit) {
+        if (item.elseMoney < 500 || item.elseMoney > 100000000) {
+          this.$message.error('请输入大于500并且小于100000000的预算')
+          return
+        } else {
+          item.dayBudget = item.elseMoney * 1000
+          var params = {}
+          params.accountId = localStorage.getItem('accountId')
+          params.dayBudget = item.elseMoney * 1000
+          params.userId = this.userInfo().id
+          params.unitIds = [item.unitId]
+          postAction('/kuaishou/batch/batchUpdateUnitBudget', params).then(res => {
+            console.log(res)
+            if (res.result.failCount > 0) {
+              this.$message.error(
+                '广告计划:' +
+                  res.result.failInfo[0].campaignName +
+                  '          ' +
+                  '错误:' +
+                  res.result.failInfo[0].message
+              )
+            }
+          })
+        }
+      } else {
+        item.elseMoney = item.dayBudget / 1000
+      }
+      console.log(item)
+    },
+    editStatus() {
+      var params = {}
+      params.accountId = localStorage.getItem('accountId')
+      params.putStatus = this.allType
+      params.userId = this.userInfo().id
+      params.unitIds = this.selectedRowKeysValue
+      postAction('/kuaishou/batch/batchUpdateUnitStatus', params).then(res => {
+        console.log(res)
+        this.getDataList(localStorage.getItem('advertisingGroupKey'))
+        this.$message.success('批量修改成功')
+        this.allType = '1'
+        this.selectedRowKeysValue = []
+        this.selectedRowKeys = []
+      })
+    },
+    editMoney() {
+      var params = {}
+      params.accountId = localStorage.getItem('accountId')
+      params.dayBudget = this.allMoney * 1000
+      params.userId = this.userInfo().id
+      params.unitIds = this.selectedRowKeysValue
+      postAction('/kuaishou/batch/batchUpdateUnitBudget', params).then(res => {
+        console.log(res)
+        if (res.result.failCount > 0) {
+          this.visible = true
+          this.visibleData = res.result
+          this.getDataList(localStorage.getItem('advertisingGroupKey'))
+        } else {
+          this.getDataList(localStorage.getItem('advertisingGroupKey'))
+          this.allMoney = null
+          this.$message.success('批量修改成功')
+          this.selectedRowKeysValue = []
+          this.selectedRowKeys = []
+        }
+      })
+    },
+    editMoneyBid() {
+      if (this.allMoneyBid < 1 || this.allMoneyBid > this.maxBid) {
+        this.$message.error('不得低于1元,不得高于项目最高出价' + this.maxBid + '元')
+        return
+      }
+      var params = {}
+      params.accountId = localStorage.getItem('accountId')
+      params.bid = this.allMoneyBid * 1000
+      params.userId = this.userInfo().id
+      params.unitIds = this.selectedRowKeysValue
+      postAction('/kuaishou/batch/batchUpdateUnitBid', params).then(res => {
+        console.log(res)
+        if (res.result.failCount > 0) {
+          this.visible = true
+          this.visibleData = res.result
+          this.getDataList(localStorage.getItem('advertisingGroupKey'))
+        } else {
+          this.getDataList(localStorage.getItem('advertisingGroupKey'))
+          this.$message.success('批量修改成功')
+          this.allMoneyBid = null
+          this.selectedRowKeysValue = []
+          this.selectedRowKeys = []
+        }
+      })
+    },
     handleOk(e) {
       console.log(e)
       this.showEdit = false
@@ -327,6 +538,13 @@ export default {
         checkAll: e.target.checked
       })
     },
+    onSelectChange(selectedRowKeys, selectionRows) {
+      this.selectedRowKeys = selectedRowKeys
+      this.selectedRowKeysValue = selectionRows.map(item => {
+        return item.unitId
+      })
+      //    this.selectedRowKeysValue.length > 0 ? this.selectedRowKeysValue :
+    },
     onChange(checkedValues) {
       var data = []
       for (let j = 0; j < this.columnsElse.length; j++) {
@@ -364,12 +582,16 @@ export default {
       params.pageNo = this.ipagination.current
       params.pageSize = this.ipagination.pageSize
       getAction('/kuaishou/batch/getUnitList', params).then(res => {
-        if (res.code == 0) {
+        if (res.success) {
           this.dataList = res.result.records.map((v, index) => {
             return {
               ...v,
               key: index,
-              edit: false
+              edit: false,
+              editBid: false,
+              elseMoney: null,
+              elseMoneyBid: null,
+              showSwich: v.putStatus == 1 ? true : false
             }
           })
         }
@@ -413,6 +635,11 @@ export default {
     this.dataValue = this.columns.map(item => {
       return item.dataIndex
     })
+    getAction('/kuaishou/batch/getProjectMaxBid', { accountId: localStorage.getItem('accountId') }).then(res => {
+      if (res.success) {
+        this.maxBid = res.result / 1000
+      }
+    })
   }
 }
 </script>

+ 110 - 48
src/views/modules/kuaishouapp/account/originality.vue

@@ -4,41 +4,19 @@
   height: 32px;
   line-height: 32px;
 }
+.creative-name .ant-table td {
+  white-space: nowrap;
+}
 </style>
 <template>
-  <div class="account-statistics">
+  <div class="creative-name">
     <a-row style="margin-top:15px">
-      <a-card
-        :tabList="title"
-        :activeTabKey="titleKey"
-        @tabChange="key => onTabChange(key, 'titleKey')"
-      >
+      <a-card :tabList="title" :activeTabKey="titleKey" @tabChange="key => onTabChange(key, 'titleKey')">
         <a-button @click="dianji" style="margin-bottom:15px">新增创意</a-button>
-        <a-table
-          :columns="columns"
-          :dataSource="data"
-          bordered
-          :scroll="{ x: 1900 }"
-          :customRow="rowClick"
-        >
-          <template slot="money" slot-scope="text,record">
-            <div style="display:flex">
-              <span v-show="!record.edit" class="count">{{text?text.toFixed(2):'不限制预算'}}</span>
-              <a-input-number
-                :min="0"
-                :step="0.01"
-                v-show="record.edit"
-                v-model="record.elseMoney"
-                style="width:150px"
-              />
-              <a-icon
-                :type="record.edit?'check':'edit'"
-                @click.stop="record.edit=!record.edit,editShow(record)"
-                style="margin-left:10px"
-                class="count"
-              />
-            </div>
-          </template>
+        <a-table :columns="columns" :dataSource="dataList" bordered :scroll="{ x: true }" :customRow="rowClick">
+          <span slot="status" slot-scope="text">{{ text | status }}</span>
+          <span slot="putStatus" slot-scope="text">{{ text | putStatus }}</span>
+          <img slot="coverUrl" slot-scope="text" :src="text" alt="" style="width:100px" />
         </a-table>
       </a-card>
     </a-row>
@@ -50,26 +28,40 @@ import ARow from 'ant-design-vue/es/grid/Row'
 import ACol from 'ant-design-vue/es/grid/Col'
 import moment from 'moment'
 import countTo from 'vue-count-to'
+
+import { deleteAction, getAction } from '@/api/manage'
 // import lifting from './components/lifting'
 const columns = [
   {
-    title: '账户',
-    dataIndex: 'campaignName',
-    scopedSlots: { customRender: 'name' },
+    title: '创意名称',
+    dataIndex: 'creativeName',
     fixed: 'left',
-    width: 200
+    width: 300,
+    align: 'center'
   },
   {
-    title: '预算(不输入为不限制预算)',
-    className: 'column-money',
-    dataIndex: 'money',
-    fixed: 'left',
-    width: 250,
-    scopedSlots: { customRender: 'money' }
+    title: '封面',
+    dataIndex: 'coverUrl',
+    scopedSlots: { customRender: 'coverUrl' },
+    align: 'center'
+  },
+  {
+    title: '广告创意状态',
+    dataIndex: 'status',
+    scopedSlots: { customRender: 'status' },
+    align: 'center'
+  },
+  {
+    title: '投放状态',
+    dataIndex: 'putStatus',
+    scopedSlots: { customRender: 'putStatus' },
+    align: 'center'
   },
   {
-    title: '其他',
-    dataIndex: 'address'
+    title: '广告语',
+    dataIndex: 'description',
+    scopedSlots: { customRender: 'description' },
+    align: 'center'
   }
 ]
 
@@ -88,7 +80,7 @@ export default {
       many: 1200,
       manyTwo: null,
       columns,
-      data: [],
+      dataList: [],
       rowClick: (record, index) => ({
         // 事件
         on: {
@@ -98,16 +90,60 @@ export default {
           }
         }
       }),
+      ipagination: {
+        current: 1,
+        pageSize: 10,
+        //   pageSizeOptions: ['10', '20', '30'],
+        showTotal: (total, range) => {
+          return range[0] + '-' + range[1] + ' 共' + total + '条'
+        },
+        showQuickJumper: true,
+        //   showSizeChanger: true,
+        total: 0,
+        onChange: current => {
+          // 切换分页时的回调,
+          // 当在页面定义change事件时,切记要把此处的事件清除,因为这两个事件重叠了,可能到时候会导致一些莫名的bug
+          this.ipagination.current = current
+          this.getDataList(this.titleKey)
+        }
+      },
       name: null,
       title: [],
       titleKey: null
     }
   },
+  filters: {
+    status(sta) {
+      var data = {
+        '-1': '不限',
+        1: '已暂停',
+        3: '计划超预算',
+        6: '余额不足',
+        11: '组审核中',
+        12: '组审核未通过',
+        14: '已结束',
+        15: '组已暂停',
+        17: '组超预算',
+        19: '未达投放时间',
+        41: '审核中',
+        42: '审核未通过',
+        46: '已暂停',
+        52: '投放中',
+        53: '作品异常'
+      }
+      return data[sta]
+    },
+    putStatus(sta) {
+      var data = { 1: '投放中', 2: '暂停' }
+      return data[sta]
+    }
+  },
   methods: {
     onTabChange(key, type) {
       console.log(key, type)
       this[type] = key
-      localStorage.setItem('originalityKey',key)
+      localStorage.setItem('originalityKey', key)
+      this.getDataList(key)
     },
     show() {
       if (!this.showEdit) {
@@ -129,8 +165,33 @@ export default {
         return
       } else {
         localStorage.setItem('step', 2)
-        this.$router.replace({ name: 'account-StepForm' })
+        var dataJson = JSON.stringify(
+          this.title.filter(item => {
+            return item.key == this.titleKey
+          })
+        )
+        localStorage.setItem('pans', dataJson)
+        this.$router.replace({ path: '/account/stepForm' })
       }
+    },
+    getDataList(id) {
+      this.dataList = []
+      var params = {}
+      params.unitId = id
+      params.accountId = localStorage.getItem('accountId')
+      params.pageNo = this.ipagination.current
+      params.pageSize = this.ipagination.pageSize
+      getAction('/kuaishou/batch/getCreativeList', params).then(res => {
+        if (res.code == 0) {
+          this.dataList = res.result.records.map((v, index) => {
+            return {
+              ...v,
+              key: index,
+              edit: false
+            }
+          })
+        }
+      })
     }
   },
   watch: {},
@@ -140,10 +201,11 @@ export default {
     console.log(this.$route.params)
     this.title = JSON.parse(localStorage.getItem('originality')).map(item => {
       return {
-        key: item.campaignName,
-        tab: '广告组:' + item.campaignName
+        key: item.unitId + '',
+        tab: '广告组:' + item.unitName
       }
     })
+    this.getDataList(localStorage.getItem('originalityKey'))
     this.data = JSON.parse(localStorage.getItem('originality'))
   }
 }

+ 76 - 9
src/views/modules/kuaishouapp/account/stepForm/Step2.vue

@@ -440,9 +440,34 @@
       </a-form-item>
       <a-form-item :wrapperCol="{ span: 20 }" style="text-align: center">
         <a-button htmlType="submit" type="primary" :loading="loading">下一步</a-button>
-        <a-button style="margin-left: 8px" @click="prevStep" v-show="step == 1">上一步</a-button>
+        <!-- <a-button style="margin-left: 8px" @click="prevStep" v-show="step == 1">上一步</a-button> -->
       </a-form-item>
     </a-form>
+    <a-modal v-model="visible" title="广告组创建信息">
+      <div>
+        创建成功:{{ allForm.success.length }}条
+        <div style="margin-top:20px">
+          <p v-for="(item, index) of allForm.success" :key="index">
+            <span>名称:{{ item.unit_name }}</span>
+          </p>
+        </div>
+        <br />
+        创建失败:{{ allForm.fail.length }}条
+        <div style="margin-top:20px">
+          <p v-for="(item, index) of allForm.fail" :key="index">
+            <span>名称:{{ item.unit_name }}</span
+            ><br />
+            <span>错误信息:{{ item.failMessage }}</span>
+          </p>
+        </div>
+      </div>
+      <template slot="footer">
+        <a-button key="back" @click="handleCancel">关闭</a-button>
+        <a-button key="submit" type="primary" @click="handleOk" :disabled="allForm.success.length == 0">
+          进入创意创建
+        </a-button>
+      </template>
+    </a-modal>
   </a-card>
 </template>
 
@@ -519,6 +544,7 @@ export default {
 
   data() {
     return {
+      visible: false,
       timeRange: [],
       form: this.$form.createForm(this),
       step: 0,
@@ -556,7 +582,9 @@ export default {
         scheduleTimeData:
           '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
         group: [],
-        groupTypeData: null
+        groupTypeData: null,
+        fail: [],
+        success: []
       }
     }
   },
@@ -786,6 +814,16 @@ export default {
     addApplication() {
       this.$refs.application.showApplication()
     },
+    handleOk() {
+      var that = this
+      if (this.allForm.success.length > 0) {
+        that.$emit('nextStep')
+        this.visible = false
+      }
+    },
+    handleCancel(e) {
+      this.visible = false
+    },
     handleSubmit(e) {
       //   this.$refs.population.handleSubmit()
       e.preventDefault()
@@ -804,8 +842,27 @@ export default {
               bid_type: item.bid_type == '1' ? '2' : '6'
             }
           })
+          var jsonData = {}
+          if (this.targeted == '2') {
+            jsonData.population = this.selectedRowKeysValue.map(item => {
+              return item.orientation_id
+            })
+          } else if (this.targeted == '3') {
+            jsonData.exclude_population = this.selectedRowKeysValueNo.map(item => {
+              return item.orientation_id
+            })
+          } else if (this.targeted == '4') {
+            jsonData.population = this.selectedRowKeysValue.map(item => {
+              return item.orientation_id
+            })
+            jsonData.exclude_population = this.selectedRowKeysValueNo.map(item => {
+              return item.orientation_id
+            })
+          } else {
+            jsonData = {}
+          }
           console.log('Received values of form: ', values)
-          var json = { ...values, scene_id: [values.scene_id], day_budget: values.day_budget * 1000 }
+          var json = { ...values, scene_id: [values.scene_id], day_budget: values.day_budget * 1000, ...jsonData }
           var params = {
             ...this.populationData,
             ...json,
@@ -816,7 +873,22 @@ export default {
             begin_time: moment(this.timeRange[0]).format('YYYY-MM-DD')
           }
 
-          postAction('/kuaishou/batch/createUnit', params).then(res => {})
+          postAction('/kuaishou/batch/createUnit', params).then(res => {
+            if (res.success) {
+              this.visible = true
+              this.allForm.fail = res.result.fail
+              this.allForm.success = res.result.success
+
+              if (res.result.success.length > 0) {
+                var data = JSON.parse(
+                  res.result.success.map(item => {
+                    return { tab: item.unit_name, key: item.unit_id }
+                  })
+                )
+                // localStorage.setItem('pans', data)
+              }
+            }
+          })
         }
       })
     },
@@ -836,11 +908,6 @@ export default {
     filterOption(input, option) {
       return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
     },
-    nextStep() {
-      var that = this
-
-      that.$emit('nextStep', that.list)
-    },
     prevStep() {
       this.$emit('prevStep', this.campaignId ? this.campaignId : localStorage.getItem('campaignId'))
     },

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 20 - 1135
src/views/modules/kuaishouapp/account/stepForm/Step3.vue


+ 2 - 4
src/views/modules/kuaishouapp/account/stepForm/StepForm.vue

@@ -9,7 +9,7 @@
     <div class="content">
       <step1 v-if="currentTab === 0" @nextStep="nextStep" ref="step" />
       <step2 v-if="currentTab === 1" :campaignId="campaignId" @nextStep="nextStepTwo" @prevStep="prevStep" />
-      <step3 :pans="pans" v-show="currentTab === 2" @prevStep="prevStepTwo" />
+      <step3 v-show="currentTab === 2" @prevStep="prevStepTwo" />
       <!-- <step4 v-if="currentTab === 3" @prevStep="prevStep" @finish="finish" /> -->
     </div>
   </a-card>
@@ -34,7 +34,6 @@ export default {
 
       // form
       form: null,
-      pans: [],
       campaignId: null
     }
   },
@@ -46,8 +45,7 @@ export default {
         this.currentTab += 1
       }
     },
-    nextStepTwo(item) {
-      this.pans = item
+    nextStepTwo() {
       if (this.currentTab < 2) {
         this.currentTab += 1
       }

+ 388 - 0
src/views/modules/kuaishouapp/account/stepForm/stepModule/selectRegion.vue

@@ -0,0 +1,388 @@
+<style scoped>
+.transfer {
+  display: flex;
+}
+.transfer .transfer-box {
+  width: 350px;
+  height: 250px;
+  border: 1px solid #dadfe3;
+  display: flex;
+  overflow-x: auto;
+  overflow-y: hidden;
+  box-sizing: border-box;
+  margin-right: 25px;
+}
+.content-box {
+  min-width: 174px;
+  width: 100%;
+  height: 100%;
+  border-right: 1px solid #dadfe3;
+}
+.content-box .content-title {
+  width: 100%;
+  background: #f8f9fa;
+  border-bottom: 1px solid #dadfe3;
+  padding: 5px 15px;
+  font-size: 16px;
+  font-weight: 700;
+  line-height: 30px;
+}
+.content-box .content {
+  width: 100%;
+  height: 85%;
+  overflow: auto;
+}
+.content-box .content p:hover {
+  background: #edf1f5;
+  cursor: pointer;
+}
+.content-box .content p:hover span {
+  display: inline-block;
+}
+.content-box .content p span {
+  display: none;
+}
+p {
+  padding: 5px;
+  margin-bottom: 0;
+  border-bottom: 1px solid #f2f2f2;
+}
+.backgroundOnly {
+  background: #edf1f5;
+}
+</style>
+<style>
+.transfer .ant-checkbox-group {
+  width: 100px;
+  overflow-x: hidden;
+}
+.transfer .ant-checkbox-group-item {
+  display: inline-block;
+  margin-right: 8px;
+  width: 100%;
+}
+</style>
+
+<template>
+  <div class="transfer">
+    <div class="transfer-box">
+      <div class="content-box">
+        <p class="content-title">省份</p>
+        <div class="content" style="position:relative">
+          <div
+            style="position:absolute;top:0;left:0;width:100%;height:100%;background: rgba(0, 0, 0, 0.5)"
+            v-if="loading"
+          ></div>
+          <p><input type="checkbox" class="select_all" @change="checkAllBox" v-model="checkAll" /> 全选</p>
+
+          <p v-for="(item, index) of province" :key="item.value" :class="{ backgroundOnly: provinceIndex == index }">
+            <input
+              class="checkItem"
+              type="checkbox"
+              :value="item.value"
+              :id="item.value"
+              v-model="checkMatched"
+              @change="checkOne(item, index)"
+            />
+            <span @click="showCity(item, index)" style="color:black;display:inline-block;margin-left:5px;width:80%">{{
+              item.label
+            }}</span>
+          </p>
+        </div>
+      </div>
+      <div class="content-box" :style="{ borderRight: !showClass ? '0px' : '1px solid #dadfe3' }" v-show="showCityData">
+        <p class="content-title">城市</p>
+        <div class="content">
+          <!-- <p>
+            <input
+              type="checkbox"
+              class="select_all"
+              @change="checkAllBoxCity"
+              v-model="checkAllCity"
+            /> 全选
+          </p>-->
+          <p v-for="(item, index) of city" :key="item.id" :class="{ backgroundOnly: cityIndex == index }">
+            <input
+              class="checkItem"
+              type="checkbox"
+              :value="item.value"
+              :id="item.value"
+              v-model="checkMatchedCity"
+              @change="checkOneCity(item, index)"
+            />
+            {{ item.label }}
+          </p>
+        </div>
+      </div>
+    </div>
+    <div class="transfer-box" style="width:176px">
+      <div class="content-box">
+        <p class="content-title">
+          已选
+          <span style="float:right;font-weight:normal;color:blue;cursor: pointer;font-size:14px" @click="clear"
+            >清空</span
+          >
+        </p>
+        <div class="content">
+          <p v-for="(item, index) of checkData" :key="index">
+            {{ item.label }}
+            <!-- <span
+              style="float:right;font-weight:normal;color:blue;cursor: pointer;font-size:14px"
+              @click="detele(item,index)"
+            >删除</span>-->
+          </p>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import { getProvince } from '@/api/manage'
+import $ from 'jquery'
+export default {
+  name: 'ByteDanceUserOrientationTemplateList',
+  components: {},
+  props: {
+    dataValue: {
+      type: Array,
+      default() {
+        return []
+      }
+    }
+  },
+  data() {
+    return {
+      showClass: false,
+      showCityData: false,
+      checkData: [],
+      checkMatched: [],
+      province: [],
+      city: [],
+      area: [],
+      CityData: '/kuaishou/batch/getRegion',
+      provinceIndex: null,
+      cityIndex: null,
+      checkAll: false,
+      checkMatchedCity: [],
+      checkAllCity: false,
+      nowProvince: null,
+      loading: false
+    }
+  },
+  computed: {},
+  mounted() {
+    this.$nextTick(() => {
+      this.getData()
+      if (this.dataValue.length > 0) {
+        this.checkData = this.dataValue
+        this.checkMatched = this.dataValue.map(item => {
+          return item.value
+        })
+        this.checkMatchedCity = this.dataValue.map(item => {
+          return item.value
+        })
+        this.$emit('update:checkData', this.checkData)
+      }
+    })
+  },
+  methods: {
+    getData() {
+      this.loading = true
+      getProvince(this.CityData, { level: 1 }).then(res => {
+        if (res.code == '0') {
+          //   this.province.push(...res.result.records)
+          this.province = res.result.map(item => {
+            return {
+              label: item.name,
+              value: item.regionId
+            }
+          })
+          this.loading = false
+        }
+      })
+    },
+    showCity(item, index) {
+      this.city = []
+      this.showCityData = false
+      this.showClass = false
+      this.provinceIndex = index
+      this.cityIndex = null
+      this.nowProvince = item
+      this.checkMatchedCity = []
+      getProvince(this.CityData, { parent: item.value }).then(res => {
+        if (res.code == '0') {
+          this.city = res.result.map(item => {
+            return {
+              label: item.name,
+              value: item.regionId
+            }
+          })
+          if (this.checkMatched.indexOf(item.value) != -1) {
+            this.checkAllCity = true
+            this.checkMatchedCity = this.city.map(item => {
+              return item.value
+            })
+          } else {
+            this.checkMatchedCity = this.checkData.map(item => {
+              return item.value
+            })
+          }
+          //   this.city.push(...res.result.records)
+          this.showCityData = true
+        }
+      })
+    },
+    checkAllBox() {
+      this.checkMatched = []
+      this.checkData = []
+      if (this.checkAll) {
+        this.checkMatched = this.province.map(item => {
+          return item.value
+        })
+        this.checkData.push(...this.province)
+      } else {
+        this.checkMatched = []
+        this.checkData = []
+        this.checkMatchedCity = []
+      }
+      this.$emit('update:checkData', this.checkData)
+    },
+    checkOne(item, index) {
+      if (this.checkMatched.indexOf(item.value) == -1) {
+        var index1 = this.checkData.findIndex(v => v.value === item.value)
+        this.checkData.splice(index1, 1)
+        if (this.nowProvince) {
+          if (this.nowProvince.value == item.value) {
+            this.checkMatchedCity = []
+          }
+        }
+      } else {
+        this.checkData.push(item)
+        var data = []
+        getProvince(this.CityData, { parent: item.value }).then(res => {
+          if (res.code == '0') {
+            data = res.result.map(item => {
+              return {
+                label: item.name,
+                value: item.regionId
+              }
+            })
+            for (var i = 0; i < this.checkData.length; i++) {
+              for (let j = 0; j < data.length; j++) {
+                if (this.checkData[i].value == data[j].value) {
+                  this.checkData.splice(i, 1)
+                }
+              }
+            }
+          }
+        })
+
+        if (this.nowProvince) {
+          if (item.value == this.nowProvince.value) {
+            this.checkMatchedCity = this.city.map(item => {
+              return item.value
+            })
+          }
+        }
+      }
+      if (this.checkMatched.length == this.province.length) {
+        this.checkAll = true
+      } else {
+        this.checkAll = false
+      }
+      this.$emit('update:checkData', this.checkData)
+    },
+    checkAllBoxCity() {
+      this.checkMatchedCity = []
+      if (this.checkAllCity) {
+        this.checkMatchedCity = this.city.map(item => {
+          return item.value
+        })
+        this.checkMatched.push(this.nowProvince.value)
+        this.checkData.push(this.nowProvince)
+      } else {
+        this.checkMatchedCity = []
+        var index = this.checkData.findIndex(v => v.value === this.nowProvince.value)
+        var index1 = this.checkMatched.findIndex(v => v === this.nowProvince.value)
+        this.checkData.splice(index, 1)
+        this.checkMatched.splice(index1, 1)
+      }
+      this.$emit('update:checkData', this.checkData)
+    },
+    checkOneCity(item, index) {
+      var allCity = this.checkMatchedCity.filter(v => {
+        return v.toString().slice(0, 2) == this.nowProvince.value
+      })
+
+      if (allCity.length == this.city.length) {
+        this.checkMatched.push(this.nowProvince.value)
+        this.checkData.push(this.nowProvince)
+        for (var i = 0; i < allCity.length; i++) {
+          for (var j = 0; j < this.checkData.length; j++) {
+            if (allCity[i] == this.checkData[j].value) {
+              this.checkData.splice(j, 1)
+              j--
+            }
+          }
+        }
+      }
+      if (this.checkMatchedCity.indexOf(item.value) != -1) {
+        if (allCity.length != this.city.length) {
+          this.checkData.push(item)
+        }
+        if (this.checkMatched.length == this.province.length) {
+          this.checkAll = true
+        } else {
+          this.checkAll = false
+        }
+      } else {
+        if (this.checkMatched.indexOf(this.nowProvince.value) != -1) {
+          var index1 = this.checkData.findIndex(v => v.value === this.nowProvince.value)
+          var index2 = this.checkMatched.findIndex(v => v === this.nowProvince.value)
+          this.checkData.splice(index1, 1)
+          this.checkMatched.splice(index2, 1)
+          this.checkAll = false
+          var data = this.city.filter(v => {
+            return v.value != item.value
+          })
+          this.checkData.push(...data)
+        } else {
+          var index1 = this.checkData.findIndex(v => v.value === item.value)
+          this.checkData.splice(index1, 1)
+        }
+      }
+      this.$emit('update:checkData', this.checkData)
+    },
+    clear() {
+      this.checkData = []
+      this.checkMatched = []
+      this.checkMatchedCity = []
+      this.checkAll = false
+      this.$emit('update:checkData', this.checkData)
+    },
+    detele(item, index) {
+      //   if (this.checkMatched.indexOf(this.nowProvince.value) != -1) {
+      var index1 = this.checkMatched.findIndex(v => v === item.value)
+      var index2 = this.checkData.findIndex(v => v.value === item.value)
+      this.checkData.splice(index2, 1)
+      this.checkMatched.splice(index1, 1)
+      this.checkAll = false
+      //   } else {
+      //   }
+
+      this.$emit('update:checkData', this.checkData)
+    }
+  },
+  watch: {
+    checkData: {
+      handler(newName, oldName) {
+        console.log(newName, oldName)
+      },
+      // 代表在wacth里声明了firstName这个方法之后立即先去执行handler方法
+      deep: true
+    }
+  }
+}
+</script>

+ 54 - 18
src/views/modules/kuaishouapp/account/stepForm/stepModule/targetedPopulation.vue

@@ -46,16 +46,19 @@ li:hover {
         <a-radio-button value="limit">指定地区</a-radio-button>
       </a-radio-group>
       <div v-if="allForm.regionType == 'limit'" style="margin-top:10px">
+        <select-region :checkData.sync="allForm.region" />
         <!-- v-model="allForm.region" -->
-        <el-cascader
-          ref="cascader"
+        <!-- {{ getData('region') }} -->
+        <!-- <el-cascader
+          ref="cascaderRegion"
           v-decorator="['region', { rules: [{ required: true, message: '请选择地区' }] }]"
           :options="options"
           :props="optionProps"
           clearable
           filterable
           style="width:100%"
-        ></el-cascader>
+          @change="getRegion"
+        ></el-cascader> -->
       </div>
     </a-form-item>
     <a-form-item
@@ -241,7 +244,6 @@ li:hover {
       v-if="getData('platform_os') == '1' && allForm.appType == '1'"
       class="else-label"
     >
-      {{ getData('app_interest') }}
       <el-cascader
         ref="cascader"
         v-decorator="['app_interest', { rules: [{ required: true, message: '请选择分类' }] }]"
@@ -322,7 +324,6 @@ li:hover {
       class="else-label"
       v-if="getData('business_interest_type') == '2'"
     >
-      {{ getData('business_interest') }}
       <a-select
         mode="multiple"
         style="width: 100%"
@@ -485,6 +486,8 @@ import moment from 'moment'
 import { mapGetters } from 'vuex'
 import jq from 'jquery'
 
+import selectRegion from './selectRegion'
+
 let dateQuantumRangeConst = ''
 const clickoutside = {
   // 初始化指令
@@ -514,7 +517,7 @@ const clickoutside = {
 
 export default {
   name: 'BaseForm',
-  components: {},
+  components: { selectRegion },
   props: {
     campaignId: {
       type: String,
@@ -546,10 +549,7 @@ export default {
       checkAll: false,
       allForm: {
         regionType: 'noLimit',
-        region: [
-          [12, 120102],
-          [12, 120103]
-        ],
+        region: [],
         ageType: 'noLimit',
         ages_range: [],
         age: [],
@@ -565,7 +565,9 @@ export default {
         value: 'regionId',
         label: 'name',
         children: 'children',
-        multiple: true
+        multiple: true,
+        emitPath: false
+        // checkStrictly: true
       },
       optionsApp: [],
       checkOptions: [],
@@ -576,7 +578,8 @@ export default {
         value: 'tagId',
         label: 'tagName',
         children: 'children',
-        multiple: true
+        multiple: true,
+        emitPath: false
       },
       getApp: '0',
       closeDialog: false,
@@ -586,6 +589,22 @@ export default {
   },
   computed: {},
   methods: {
+    getRegion(data) {
+      this.$refs.cascaderRegion.getCheckedNodes()
+      console.log(this.$refs.cascaderRegion.getCheckedNodes())
+      var dataName = this.$refs.cascaderRegion.getCheckedNodes()
+      var jsonArr = data
+      for (let i = 0; i < dataName.length; i++) {
+        for (let j = 0; j < data.length; j++) {
+          if (dataName[i].children.length > 0) {
+            if (data[j].substring(0, 2) == dataName[i].value) {
+              jsonArr.splice(j, 1)
+            }
+          }
+        }
+      }
+      console.log(jsonArr)
+    },
     showAppName(appId) {
       var data = this.checkOptions.filter(item => {
         return item.app_id == appId
@@ -651,7 +670,24 @@ export default {
       this.form.validateFields((err, values) => {
         if (!err) {
           console.log('Received values of form: ', values)
-          this.$emit('update:populationData', values)
+          //   this.checkArr
+          var json = {}
+          if (this.allForm.appType == '2') {
+            json.app_ids = this.checkArr
+          }
+          if (this.allForm.regionType == 'limit') {
+            json.region = this.allForm.region.map(item => {
+              return item.value
+            })
+          }
+          var dataJson = {
+            ...values,
+            ...json,
+            no_age_break: values.no_age_break ? 1 : 0,
+            no_gender_break: values.no_gender_break ? 1 : 0,
+            no_area_break: values.no_area_break ? 1 : 0
+          }
+          this.$emit('update:populationData', dataJson)
         }
       })
     },
@@ -670,11 +706,11 @@ export default {
     },
     regionChange() {
       this.allForm.region = []
-      getAction('/kuaishou/batch/getRegion').then(res => {
-        console.log(res)
-        this.options = res.result
-        this.optionsAll = res.result
-      })
+      //   getAction('/kuaishou/batch/getRegion').then(res => {
+      //     console.log(res)
+      //     this.options = res.result
+      //     this.optionsAll = res.result
+      //   })
     },
     ageChange() {
       this.allForm.ages_range = []

+ 1 - 1
src/views/modules/material/videoMaterial.vue

@@ -425,7 +425,7 @@ a {
             @loaded="overUpload"
           ></upload-to-ali>
           <span v-if="repeat" style="color:red">
-            此素材重复,请新选择上传
+            此素材重复,请新选择上传
           </span>
           <span v-if="confirmLoading && urlList.url != ''" style="color:green">
             上传成功

+ 395 - 395
src/views/template/userorientation/modules/transferCity.vue

@@ -1,395 +1,395 @@
-<style scoped>
-.transfer {
-  display: flex;
-}
-.transfer .transfer-box {
-  width: 350px;
-  height: 250px;
-  border: 1px solid #dadfe3;
-  display: flex;
-  overflow-x: auto;
-  overflow-y: hidden;
-  box-sizing: border-box;
-  margin-right: 25px;
-}
-.content-box {
-  min-width: 174px;
-  width: 100%;
-  height: 100%;
-  border-right: 1px solid #dadfe3;
-}
-.content-box .content-title {
-  width: 100%;
-  background: #f8f9fa;
-  border-bottom: 1px solid #dadfe3;
-  padding: 5px 15px;
-  font-size: 16px;
-  font-weight: 700;
-  line-height: 30px;
-}
-.content-box .content {
-  width: 100%;
-  height: 85%;
-  overflow: auto;
-}
-.content-box .content p:hover {
-  background: #edf1f5;
-  cursor: pointer;
-}
-.content-box .content p:hover span {
-  display: inline-block;
-}
-.content-box .content p span {
-  display: none;
-}
-p {
-  padding: 5px;
-  margin-bottom: 0;
-  border-bottom: 1px solid #f2f2f2;
-}
-.backgroundOnly {
-  background: #edf1f5;
-}
-</style>
-<style>
-.transfer .ant-checkbox-group {
-  width: 100px;
-  overflow-x: hidden;
-}
-.transfer .ant-checkbox-group-item {
-  display: inline-block;
-  margin-right: 8px;
-  width: 100%;
-}
-</style>
-
-<template>
-  <div class="transfer">
-    <div class="transfer-box">
-      <div class="content-box">
-        <p class="content-title">省份</p>
-        <div class="content" style="position:relative">
-          <div
-            style="position:absolute;top:0;left:0;width:100%;height:100%;background: rgba(0, 0, 0, 0.5)"
-            v-if="loading"
-          ></div>
-          <p>
-            <input type="checkbox" class="select_all" @change="checkAllBox" v-model="checkAll" /> 全选
-          </p>
-
-          <p
-            v-for="(item,index) of province"
-            :key="item.value"
-            :class="{backgroundOnly:provinceIndex == index}"
-          >
-            <input
-              class="checkItem"
-              type="checkbox"
-              :value="item.value"
-              :id="item.value"
-              v-model="checkMatched"
-              @change="checkOne(item,index)"
-            />
-            <span
-              @click="showCity(item,index)"
-              style="color:black;display:inline-block;margin-left:5px;width:80%"
-            >{{item.label}}</span>
-          </p>
-        </div>
-      </div>
-      <div
-        class="content-box"
-        :style="{borderRight:!showClass?'0px':'1px solid #dadfe3'}"
-        v-show="showCityData"
-      >
-        <p class="content-title">城市</p>
-        <div class="content">
-          <!-- <p>
-            <input
-              type="checkbox"
-              class="select_all"
-              @change="checkAllBoxCity"
-              v-model="checkAllCity"
-            /> 全选
-          </p>-->
-          <p
-            v-for="(item,index) of city"
-            :key="item.id"
-            :class="{backgroundOnly:cityIndex == index}"
-          >
-            <input
-              class="checkItem"
-              type="checkbox"
-              :value="item.value"
-              :id="item.value"
-              v-model="checkMatchedCity"
-              @change="checkOneCity(item,index)"
-            />
-            {{item.label}}
-          </p>
-        </div>
-      </div>
-    </div>
-    <div class="transfer-box" style="width:176px">
-      <div class="content-box">
-        <p class="content-title">
-          已选
-          <span
-            style="float:right;font-weight:normal;color:blue;cursor: pointer;font-size:14px"
-            @click="clear"
-          >清空</span>
-        </p>
-        <div class="content">
-          <p v-for="(item,index) of checkData" :key="index">
-            {{item.label}}
-            <!-- <span
-              style="float:right;font-weight:normal;color:blue;cursor: pointer;font-size:14px"
-              @click="detele(item,index)"
-            >删除</span>-->
-          </p>
-        </div>
-      </div>
-    </div>
-  </div>
-</template>
-
-<script>
-import { JeecgListMixin } from '@/mixins/JeecgListMixin'
-import { getProvince } from '@/api/manage'
-import $ from 'jquery'
-export default {
-  name: 'ByteDanceUserOrientationTemplateList',
-  components: {},
-  props: {
-    dataValue: {
-      type: Array,
-      default() {
-        return []
-      }
-    }
-  },
-  data() {
-    return {
-      showClass: false,
-      showCityData: false,
-      checkData: [],
-      checkMatched: [],
-      province: [],
-      city: [],
-      area: [],
-      CityData: '/ctop/bytedanceAreaInfo/listbycode',
-      provinceIndex: null,
-      cityIndex: null,
-      checkAll: false,
-      checkMatchedCity: [],
-      checkAllCity: false,
-      nowProvince: null,
-      loading: false
-    }
-  },
-  computed: {},
-  mounted() {
-    this.$nextTick(() => {
-      this.getData()
-      if (this.dataValue.length > 0) {
-        this.checkData = this.dataValue
-        this.checkMatched = this.dataValue.map(item => {
-          return item.value
-        })
-        this.checkMatchedCity = this.dataValue.map(item => {
-          return item.value
-        })
-        this.$emit('update:checkData', this.checkData)
-      }
-    })
-  },
-  methods: {
-    getData() {
-      this.loading = true
-      getProvince(this.CityData, { parentCode: '' }).then(res => {
-        if (res.code == '0') {
-          //   this.province.push(...res.result.records)
-          this.province = res.result.records.map(item => {
-            return {
-              label: item.name,
-              value: item.id
-            }
-          })
-          this.loading = false
-        }
-      })
-    },
-    showCity(item, index) {
-      this.city = []
-      this.showCityData = false
-      this.showClass = false
-      this.provinceIndex = index
-      this.cityIndex = null
-      this.nowProvince = item
-      this.checkMatchedCity = []
-      getProvince(this.CityData, { parentCode: item.value }).then(res => {
-        if (res.code == '0') {
-          this.city = res.result.records.map(item => {
-            return {
-              label: item.name,
-              value: item.id
-            }
-          })
-          if (this.checkMatched.indexOf(item.value) != -1) {
-            this.checkAllCity = true
-            this.checkMatchedCity = this.city.map(item => {
-              return item.value
-            })
-          } else {
-            this.checkMatchedCity = this.checkData.map(item => {
-              return item.value
-            })
-          }
-          //   this.city.push(...res.result.records)
-          this.showCityData = true
-        }
-      })
-    },
-    checkAllBox() {
-      this.checkMatched = []
-      this.checkData = []
-      if (this.checkAll) {
-        this.checkMatched = this.province.map(item => {
-          return item.value
-        })
-        this.checkData.push(...this.province)
-      } else {
-        this.checkMatched = []
-        this.checkData = []
-        this.checkMatchedCity = []
-      }
-      this.$emit('update:checkData', this.checkData)
-    },
-    checkOne(item, index) {
-      if (this.checkMatched.indexOf(item.value) == -1) {
-        var index1 = this.checkData.findIndex(v => v.value === item.value)
-        this.checkData.splice(index1, 1)
-        if (this.nowProvince) {
-          if (this.nowProvince.value == item.value) {
-            this.checkMatchedCity = []
-          }
-        }
-      } else {
-        this.checkData.push(item)
-        var data = []
-        getProvince(this.CityData, { parentCode: item.value }).then(res => {
-          if (res.code == '0') {
-            data = res.result.records.map(item => {
-              return {
-                label: item.name,
-                value: item.id
-              }
-            })
-            for (var i = 0; i < this.checkData.length; i++) {
-              for (let j = 0; j < data.length; j++) {
-                if (this.checkData[i].value == data[j].value) {
-                  this.checkData.splice(i, 1)
-                }
-              }
-            }
-          }
-        })
-
-        if (this.nowProvince) {
-          if (item.value == this.nowProvince.value) {
-            this.checkMatchedCity = this.city.map(item => {
-              return item.value
-            })
-          }
-        }
-      }
-      if (this.checkMatched.length == this.province.length) {
-        this.checkAll = true
-      } else {
-        this.checkAll = false
-      }
-      this.$emit('update:checkData', this.checkData)
-    },
-    checkAllBoxCity() {
-      this.checkMatchedCity = []
-      if (this.checkAllCity) {
-        this.checkMatchedCity = this.city.map(item => {
-          return item.value
-        })
-        this.checkMatched.push(this.nowProvince.value)
-        this.checkData.push(this.nowProvince)
-      } else {
-        this.checkMatchedCity = []
-        var index = this.checkData.findIndex(v => v.value === this.nowProvince.value)
-        var index1 = this.checkMatched.findIndex(v => v === this.nowProvince.value)
-        this.checkData.splice(index, 1)
-        this.checkMatched.splice(index1, 1)
-      }
-      this.$emit('update:checkData', this.checkData)
-    },
-    checkOneCity(item, index) {
-      var allCity = this.checkMatchedCity.filter(v => {
-        return v.toString().slice(0, 2) == this.nowProvince.value
-      })
-
-      if (allCity.length == this.city.length) {
-        this.checkMatched.push(this.nowProvince.value)
-        this.checkData.push(this.nowProvince)
-        for (var i = 0; i < allCity.length; i++) {
-          for (var j = 0; j < this.checkData.length; j++) {
-            if (allCity[i] == this.checkData[j].value) {
-              this.checkData.splice(j, 1)
-              j--
-            }
-          }
-        }
-      }
-      if (this.checkMatchedCity.indexOf(item.value) != -1) {
-        if (allCity.length != this.city.length) {
-          this.checkData.push(item)
-        }
-        if (this.checkMatched.length == this.province.length) {
-          this.checkAll = true
-        } else {
-          this.checkAll = false
-        }
-      } else {
-        if (this.checkMatched.indexOf(this.nowProvince.value) != -1) {
-          var index1 = this.checkData.findIndex(v => v.value === this.nowProvince.value)
-          var index2 = this.checkMatched.findIndex(v => v === this.nowProvince.value)
-          this.checkData.splice(index1, 1)
-          this.checkMatched.splice(index2, 1)
-          this.checkAll = false
-          var data = this.city.filter(v => {
-            return v.value != item.value
-          })
-          this.checkData.push(...data)
-        } else {
-          var index1 = this.checkData.findIndex(v => v.value === item.value)
-          this.checkData.splice(index1, 1)
-        }
-      }
-      this.$emit('update:checkData', this.checkData)
-    },
-    clear() {
-      this.checkData = []
-      this.checkMatched = []
-      this.checkMatchedCity = []
-      this.checkAll = false
-      this.$emit('update:checkData', this.checkData)
-    },
-    detele(item, index) {
-      //   if (this.checkMatched.indexOf(this.nowProvince.value) != -1) {
-      var index1 = this.checkMatched.findIndex(v => v === item.value)
-      var index2 = this.checkData.findIndex(v => v.value === item.value)
-      this.checkData.splice(index2, 1)
-      this.checkMatched.splice(index1, 1)
-      this.checkAll = false
-      //   } else {
-      //   }
-
-      this.$emit('update:checkData', this.checkData)
-    }
-  }
-}
-</script>
+<style scoped>
+.transfer {
+  display: flex;
+}
+.transfer .transfer-box {
+  width: 350px;
+  height: 250px;
+  border: 1px solid #dadfe3;
+  display: flex;
+  overflow-x: auto;
+  overflow-y: hidden;
+  box-sizing: border-box;
+  margin-right: 25px;
+}
+.content-box {
+  min-width: 174px;
+  width: 100%;
+  height: 100%;
+  border-right: 1px solid #dadfe3;
+}
+.content-box .content-title {
+  width: 100%;
+  background: #f8f9fa;
+  border-bottom: 1px solid #dadfe3;
+  padding: 5px 15px;
+  font-size: 16px;
+  font-weight: 700;
+  line-height: 30px;
+}
+.content-box .content {
+  width: 100%;
+  height: 85%;
+  overflow: auto;
+}
+.content-box .content p:hover {
+  background: #edf1f5;
+  cursor: pointer;
+}
+.content-box .content p:hover span {
+  display: inline-block;
+}
+.content-box .content p span {
+  display: none;
+}
+p {
+  padding: 5px;
+  margin-bottom: 0;
+  border-bottom: 1px solid #f2f2f2;
+}
+.backgroundOnly {
+  background: #edf1f5;
+}
+</style>
+<style>
+.transfer .ant-checkbox-group {
+  width: 100px;
+  overflow-x: hidden;
+}
+.transfer .ant-checkbox-group-item {
+  display: inline-block;
+  margin-right: 8px;
+  width: 100%;
+}
+</style>
+
+<template>
+  <div class="transfer">
+    <div class="transfer-box">
+      <div class="content-box">
+        <p class="content-title">省份</p>
+        <div class="content" style="position:relative">
+          <div
+            style="position:absolute;top:0;left:0;width:100%;height:100%;background: rgba(0, 0, 0, 0.5)"
+            v-if="loading"
+          ></div>
+          <p>
+            <input type="checkbox" class="select_all" @change="checkAllBox" v-model="checkAll" /> 全选
+          </p>
+
+          <p
+            v-for="(item,index) of province"
+            :key="item.value"
+            :class="{backgroundOnly:provinceIndex == index}"
+          >
+            <input
+              class="checkItem"
+              type="checkbox"
+              :value="item.value"
+              :id="item.value"
+              v-model="checkMatched"
+              @change="checkOne(item,index)"
+            />
+            <span
+              @click="showCity(item,index)"
+              style="color:black;display:inline-block;margin-left:5px;width:80%"
+            >{{item.label}}</span>
+          </p>
+        </div>
+      </div>
+      <div
+        class="content-box"
+        :style="{borderRight:!showClass?'0px':'1px solid #dadfe3'}"
+        v-show="showCityData"
+      >
+        <p class="content-title">城市</p>
+        <div class="content">
+          <!-- <p>
+            <input
+              type="checkbox"
+              class="select_all"
+              @change="checkAllBoxCity"
+              v-model="checkAllCity"
+            /> 全选
+          </p>-->
+          <p
+            v-for="(item,index) of city"
+            :key="item.id"
+            :class="{backgroundOnly:cityIndex == index}"
+          >
+            <input
+              class="checkItem"
+              type="checkbox"
+              :value="item.value"
+              :id="item.value"
+              v-model="checkMatchedCity"
+              @change="checkOneCity(item,index)"
+            />
+            {{item.label}}
+          </p>
+        </div>
+      </div>
+    </div>
+    <div class="transfer-box" style="width:176px">
+      <div class="content-box">
+        <p class="content-title">
+          已选
+          <span
+            style="float:right;font-weight:normal;color:blue;cursor: pointer;font-size:14px"
+            @click="clear"
+          >清空</span>
+        </p>
+        <div class="content">
+          <p v-for="(item,index) of checkData" :key="index">
+            {{item.label}}
+            <!-- <span
+              style="float:right;font-weight:normal;color:blue;cursor: pointer;font-size:14px"
+              @click="detele(item,index)"
+            >删除</span>-->
+          </p>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import { getProvince } from '@/api/manage'
+import $ from 'jquery'
+export default {
+  name: 'ByteDanceUserOrientationTemplateList',
+  components: {},
+  props: {
+    dataValue: {
+      type: Array,
+      default() {
+        return []
+      }
+    }
+  },
+  data() {
+    return {
+      showClass: false,
+      showCityData: false,
+      checkData: [],
+      checkMatched: [],
+      province: [],
+      city: [],
+      area: [],
+      CityData: '/ctop/bytedanceAreaInfo/listbycode',
+      provinceIndex: null,
+      cityIndex: null,
+      checkAll: false,
+      checkMatchedCity: [],
+      checkAllCity: false,
+      nowProvince: null,
+      loading: false
+    }
+  },
+  computed: {},
+  mounted() {
+    this.$nextTick(() => {
+      this.getData()
+      if (this.dataValue.length > 0) {
+        this.checkData = this.dataValue
+        this.checkMatched = this.dataValue.map(item => {
+          return item.value
+        })
+        this.checkMatchedCity = this.dataValue.map(item => {
+          return item.value
+        })
+        this.$emit('update:checkData', this.checkData)
+      }
+    })
+  },
+  methods: {
+    getData() {
+      this.loading = true
+      getProvince(this.CityData, { parentCode: '' }).then(res => {
+        if (res.code == '0') {
+          //   this.province.push(...res.result.records)
+          this.province = res.result.records.map(item => {
+            return {
+              label: item.name,
+              value: item.id
+            }
+          })
+          this.loading = false
+        }
+      })
+    },
+    showCity(item, index) {
+      this.city = []
+      this.showCityData = false
+      this.showClass = false
+      this.provinceIndex = index
+      this.cityIndex = null
+      this.nowProvince = item
+      this.checkMatchedCity = []
+      getProvince(this.CityData, { parentCode: item.value }).then(res => {
+        if (res.code == '0') {
+          this.city = res.result.records.map(item => {
+            return {
+              label: item.name,
+              value: item.id
+            }
+          })
+          if (this.checkMatched.indexOf(item.value) != -1) {
+            this.checkAllCity = true
+            this.checkMatchedCity = this.city.map(item => {
+              return item.value
+            })
+          } else {
+            this.checkMatchedCity = this.checkData.map(item => {
+              return item.value
+            })
+          }
+          //   this.city.push(...res.result.records)
+          this.showCityData = true
+        }
+      })
+    },
+    checkAllBox() {
+      this.checkMatched = []
+      this.checkData = []
+      if (this.checkAll) {
+        this.checkMatched = this.province.map(item => {
+          return item.value
+        })
+        this.checkData.push(...this.province)
+      } else {
+        this.checkMatched = []
+        this.checkData = []
+        this.checkMatchedCity = []
+      }
+      this.$emit('update:checkData', this.checkData)
+    },
+    checkOne(item, index) {
+      if (this.checkMatched.indexOf(item.value) == -1) {
+        var index1 = this.checkData.findIndex(v => v.value === item.value)
+        this.checkData.splice(index1, 1)
+        if (this.nowProvince) {
+          if (this.nowProvince.value == item.value) {
+            this.checkMatchedCity = []
+          }
+        }
+      } else {
+        this.checkData.push(item)
+        var data = []
+        getProvince(this.CityData, { parentCode: item.value }).then(res => {
+          if (res.code == '0') {
+            data = res.result.records.map(item => {
+              return {
+                label: item.name,
+                value: item.id
+              }
+            })
+            for (var i = 0; i < this.checkData.length; i++) {
+              for (let j = 0; j < data.length; j++) {
+                if (this.checkData[i].value == data[j].value) {
+                  this.checkData.splice(i, 1)
+                }
+              }
+            }
+          }
+        })
+
+        if (this.nowProvince) {
+          if (item.value == this.nowProvince.value) {
+            this.checkMatchedCity = this.city.map(item => {
+              return item.value
+            })
+          }
+        }
+      }
+      if (this.checkMatched.length == this.province.length) {
+        this.checkAll = true
+      } else {
+        this.checkAll = false
+      }
+      this.$emit('update:checkData', this.checkData)
+    },
+    checkAllBoxCity() {
+      this.checkMatchedCity = []
+      if (this.checkAllCity) {
+        this.checkMatchedCity = this.city.map(item => {
+          return item.value
+        })
+        this.checkMatched.push(this.nowProvince.value)
+        this.checkData.push(this.nowProvince)
+      } else {
+        this.checkMatchedCity = []
+        var index = this.checkData.findIndex(v => v.value === this.nowProvince.value)
+        var index1 = this.checkMatched.findIndex(v => v === this.nowProvince.value)
+        this.checkData.splice(index, 1)
+        this.checkMatched.splice(index1, 1)
+      }
+      this.$emit('update:checkData', this.checkData)
+    },
+    checkOneCity(item, index) {
+      var allCity = this.checkMatchedCity.filter(v => {
+        return v.toString().slice(0, 2) == this.nowProvince.value
+      })
+
+      if (allCity.length == this.city.length) {
+        this.checkMatched.push(this.nowProvince.value)
+        this.checkData.push(this.nowProvince)
+        for (var i = 0; i < allCity.length; i++) {
+          for (var j = 0; j < this.checkData.length; j++) {
+            if (allCity[i] == this.checkData[j].value) {
+              this.checkData.splice(j, 1)
+              j--
+            }
+          }
+        }
+      }
+      if (this.checkMatchedCity.indexOf(item.value) != -1) {
+        if (allCity.length != this.city.length) {
+          this.checkData.push(item)
+        }
+        if (this.checkMatched.length == this.province.length) {
+          this.checkAll = true
+        } else {
+          this.checkAll = false
+        }
+      } else {
+        if (this.checkMatched.indexOf(this.nowProvince.value) != -1) {
+          var index1 = this.checkData.findIndex(v => v.value === this.nowProvince.value)
+          var index2 = this.checkMatched.findIndex(v => v === this.nowProvince.value)
+          this.checkData.splice(index1, 1)
+          this.checkMatched.splice(index2, 1)
+          this.checkAll = false
+          var data = this.city.filter(v => {
+            return v.value != item.value
+          })
+          this.checkData.push(...data)
+        } else {
+          var index1 = this.checkData.findIndex(v => v.value === item.value)
+          this.checkData.splice(index1, 1)
+        }
+      }
+      this.$emit('update:checkData', this.checkData)
+    },
+    clear() {
+      this.checkData = []
+      this.checkMatched = []
+      this.checkMatchedCity = []
+      this.checkAll = false
+      this.$emit('update:checkData', this.checkData)
+    },
+    detele(item, index) {
+      //   if (this.checkMatched.indexOf(this.nowProvince.value) != -1) {
+      var index1 = this.checkMatched.findIndex(v => v === item.value)
+      var index2 = this.checkData.findIndex(v => v.value === item.value)
+      this.checkData.splice(index2, 1)
+      this.checkMatched.splice(index1, 1)
+      this.checkAll = false
+      //   } else {
+      //   }
+
+      this.$emit('update:checkData', this.checkData)
+    }
+  }
+}
+</script>