瀏覽代碼

广告组

zhuxinbo 5 年之前
父節點
當前提交
71055818d5

+ 1 - 1
src/views/dashboard/Analysis.vue

@@ -145,7 +145,7 @@
     </div>
 
     <statistics v-else-if="roleCode == 'kuaishouOperationManager'" />
-
+    <statistics v-else-if="roleCode == 'sale'" />
     <statistics v-else-if="roleCode == 'admin'" />
     <Workbench v-else-if="roleCode == 'clip'" />
     <Workbench v-else-if="roleCode == 'plane'" />

+ 1 - 1
src/views/modules/Statistics/Statistics.vue

@@ -1201,7 +1201,7 @@ export default {
           params.endDate = dateValue[1]
         }
         getKsDetail(params).then(res => {
-          that.dataDetail = res
+          that.dataDetail = res.result
           resolve(res)
         })
       })

+ 14 - 13
src/views/modules/achievements/design.vue

@@ -12,7 +12,7 @@
     <a-row :gutter="24" style="margin-top:15px">
       <a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }">
         <chart-card :loading="loading" title="有效数" :total="dataCount.effiVideoCount + ''">
-          <a-tooltip title="指标说明" slot="action">
+          <a-tooltip title="两周视频跑量超过5000的素材数" slot="action">
             <a-icon type="info-circle-o" />
           </a-tooltip>
           <template slot="footer"> </template>
@@ -20,7 +20,7 @@
       </a-col>
       <a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }">
         <chart-card :loading="loading" title="素材总数" :total="dataCount.videoCount + ''">
-          <a-tooltip title="指标说明" slot="action">
+          <a-tooltip title="当前季度到目前为止的上传视频总数量" slot="action">
             <a-icon type="info-circle-o" />
           </a-tooltip>
           <template slot="footer"> </template>
@@ -28,7 +28,7 @@
       </a-col>
       <a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }">
         <chart-card :loading="loading" title="有效率" :total="dataCount.effiRate ? dataCount.effiRate + '%' : '0%'">
-          <a-tooltip title="指标说明" slot="action">
+          <a-tooltip title="当前季度到目前为止的有效率" slot="action">
             <a-icon type="info-circle-o" />
           </a-tooltip>
           <template slot="footer"> </template>
@@ -36,7 +36,7 @@
       </a-col>
       <a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }">
         <chart-card :loading="loading" title="总消耗" :total="dataCount.cost + ''">
-          <a-tooltip title="指标说明" slot="action">
+          <a-tooltip title="所有素材当前季度的总消耗" slot="action">
             <a-icon type="info-circle-o" />
           </a-tooltip>
           <!-- <div>
@@ -82,7 +82,7 @@
               :columns="innerColumns"
               :dataSource="record.innerData"
               :pagination="false"
-              :loading="childrenLoading"
+              :loading="record.showDetail"
             >
             </a-table>
           </a-table>
@@ -263,11 +263,11 @@ export default {
         {
           key: 'kuaishou',
           tab: '快手'
-        },
-        {
-          key: 'toutiao',
-          tab: '头条'
         }
+        // {
+        //   key: 'toutiao',
+        //   tab: '头条'
+        // }
       ],
       noTitleKey: 'kuaishou',
       dataCount: {
@@ -339,7 +339,7 @@ export default {
       var params = qs.stringify({
         materialId: record.id
       })
-      this.childrenLoading = true
+      record.showDetail = true
       if (expanded) {
         postAction('/ctop/performance2/materialAccountInfo', params).then(res => {
           if (res.success) {
@@ -349,12 +349,12 @@ export default {
                 key: index
               }
             })
-            this.childrenLoading = false
+            record.showDetail = false
           }
           if (res.code === 510) {
             this.$message.warning(res.message)
           }
-          this.childrenLoading = false
+          record.showDetail = false
         })
       } else {
         record.innerData = []
@@ -389,7 +389,8 @@ export default {
           return {
             ...item,
             key: index,
-            innerData: []
+            innerData: [],
+            showDetail: false
           }
         })
       }

+ 18 - 26
src/views/modules/achievements/optimize.vue

@@ -52,7 +52,7 @@
                 :total="dataCount.royaltyRatio ? dataCount.royaltyRatio : '0‰'"
                 style="border: 1px solid #e8e8e8;"
               >
-                <a-tooltip title="指标说明" slot="action">
+                <a-tooltip title="当前的绩效提点比例" slot="action">
                   <a-icon type="info-circle-o" />
                 </a-tooltip>
                 <template slot="footer"> </template>
@@ -91,7 +91,7 @@
               slot-scope="record"
               :columns="innerColumns"
               :dataSource="record.innerData"
-              :loading="childrenLoading"
+              :loading="record.showDetail"
               size="middle"
             >
             </a-table>
@@ -119,7 +119,7 @@
                   <div slot="description"></div>
                   <a slot="title" style="font-size:16px"
                     ><span style="display:inline-block;width:100px">{{ item.realName }}</span
-                    ><span style="margin-left:20px">总消耗:{{ item.totalCost }}</span></a
+                    ><span style="margin-left:20px">总消耗:{{ item.totalCost }}</span></a
                   >
                   <a-avatar slot="avatar" src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png" />
                 </a-list-item-meta>
@@ -158,7 +158,7 @@
         <a-list-item slot="renderItem" slot-scope="item">
           <a-list-item-meta style="width:50%">
             {{ item }}
-            <div slot="description">总消耗:{{ item.totalCost }}</div>
+            <div slot="description">总消耗:{{ item.totalCost }}</div>
             <a slot="title" href="https://vue.ant.design/">{{ item.realName }}</a>
             <a-avatar slot="avatar" src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png" />
           </a-list-item-meta>
@@ -167,7 +167,7 @@
       </a-list>
     </a-modal>
     <a-modal
-      title="有效视频"
+      title="账户跑量"
       :visible="visibleVideo"
       @ok="handleOk('visibleVideo')"
       @cancel="handleCancel('visibleVideo')"
@@ -226,7 +226,7 @@ const columns = [
     align: 'center'
   },
   {
-    title: '总消耗',
+    title: '总消耗(元)',
     dataIndex: 'totalCost',
     key: 'totalCost',
     align: 'center'
@@ -263,11 +263,11 @@ export default {
         {
           key: 'kuaishou',
           tab: '快手'
-        },
-        {
-          key: 'toutiao',
-          tab: '头条'
         }
+        // {
+        //   key: 'toutiao',
+        //   tab: '头条'
+        // }
       ],
       noTitleKey: 'kuaishou',
       dataCount: {
@@ -279,17 +279,8 @@ export default {
       },
       a: '',
       columns,
-      dataList: [
-        {
-          key: 1,
-          videoUrl:
-            'https://ctop-media.oss-cn-beijing.aliyuncs.com/video/2019-12-14/%E9%AB%98%E6%B8%85-1576318874426.mp4',
-          videoCost: 34.56,
-          pageClickCount: 1200,
-          pageExposureCount: 3939,
-          behaviorCount: 5000
-        }
-      ],
+      dataList: [],
+      dataListTop: [],
       innerColumns: [
         {
           title: '素材账户',
@@ -298,7 +289,7 @@ export default {
           align: 'center'
         },
         {
-          title: '总消耗',
+          title: '总消耗(元)',
           dataIndex: 'totalCost',
           key: 'totalCost',
           align: 'center'
@@ -332,7 +323,7 @@ export default {
     expand(expanded, record) {
       var param = {}
       param.projectId = record.projectId
-      this.childrenLoading = true
+      record.showDetail = true
       if (expanded) {
         getAction('/ctop/performance/account/list', param).then(res => {
           if (res.success) {
@@ -342,12 +333,12 @@ export default {
                 key: index
               }
             })
-            this.childrenLoading = false
+            record.showDetail = false
           }
           if (res.code === 510) {
             this.$message.warning(res.message)
           }
-          this.childrenLoading = false
+          record.showDetail = false
         })
       } else {
         record.innerData = []
@@ -373,7 +364,8 @@ export default {
         this.dataList = res.data.map(item => {
           return {
             ...item,
-            innerData: []
+            innerData: [],
+            showDetail: false
           }
         })
       }

+ 2 - 1
src/views/modules/kuaishouapp/account/stepForm/Step1.vue

@@ -190,6 +190,7 @@ export default {
             console.log(res)
             if (res.success) {
               this.$message.success('创建成功')
+              localStorage.setItem("campaignId",res.result)
               this.nextStep(res.result)
             } else {
               this.$message.error(res.message)
@@ -257,7 +258,7 @@ export default {
       this.$emit('nextStep')
     }
   },
-  activated: function() {
+  mounted: function() {
     // //出价方式
     // let params = {}
     // params.dictId = '181afbae847dd3bc7e27795d8958956'

+ 322 - 12
src/views/modules/kuaishouapp/account/stepForm/Step2.vue

@@ -191,7 +191,7 @@
       <div style="text-align:center;font-size:16px">
         目标人群
       </div>
-      <targeted-population ref="population" />
+      <targeted-population ref="population" :populationData.sync="populationData" />
       <div style="text-align:center;font-size:16px">
         预算和排期
       </div>
@@ -250,7 +250,194 @@
         <br />
         <a-range-picker v-if="allForm.time == '2'" v-model="timeRange" format="YYYY-MM-DD" :allowClear="false" />
       </a-form-item>
-      <selectCheckAll style="width:100%"/>
+      <a-form-item
+        label="投放时段"
+        :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
+        :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
+      >
+        <!-- v-decorator="['speed', { initialValue: '1' }]" -->
+        <a-radio-group buttonStyle="solid" v-model="allForm.scheduleTime" @change="setTimeAll">
+          <a-radio-button value="1">全天</a-radio-button>
+          <a-radio-button value="2">特定时间</a-radio-button>
+        </a-radio-group>
+        <br />
+        <selectCheckAll
+          style="width:100%"
+          v-show="allForm.scheduleTime == '2'"
+          :scheduleTime.sync="allForm.scheduleTimeData"
+          ref="selectCheck"
+        />
+      </a-form-item>
+
+      <a-form-item
+        label="创意展现方式"
+        :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
+        :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
+      >
+        <!-- v-decorator="['speed', { initialValue: '1' }]" -->
+        <a-radio-group buttonStyle="solid" v-decorator="['show_mode', { initialValue: '2' }]">
+          <a-radio-button value="2">智能优选</a-radio-button>
+          <a-radio-button value="1">随机轮播</a-radio-button>
+        </a-radio-group>
+        <br />
+        <span>
+          {{
+            getData('show_mode') == '1'
+              ? '广告组包含的广告创意将随机展现'
+              : '每一次展现的时候,系统会进行CTR预估,预估CTR高的会得到展现机会'
+          }}
+        </span>
+      </a-form-item>
+      <a-form-item
+        label="场景广告位"
+        :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
+        :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
+      >
+        <!-- v-decorator="['speed', { initialValue: '1' }]" -->
+        <a-radio-group buttonStyle="solid" v-decorator="['scene_id', { initialValue: '2' }]">
+          <a-radio-button value="2">按场景选择广告位-信息流广告</a-radio-button>
+          <a-radio-button value="1">优选广告位</a-radio-button>
+        </a-radio-group>
+      </a-form-item>
+      <div style="text-align:center;font-size:16px">优化目标和计费</div>
+      <a-form-item
+        label=" "
+        :labelCol="{ lg: { span: 6 }, sm: { span: 6 } }"
+        :wrapperCol="{ lg: { span: 18 }, sm: { span: 18 } }"
+        class="else-label"
+      >
+        <div style="width:100%">
+          <a-layout>
+            <a-layout-content style="padding:10px;">
+              <div :style="{ marginBottom: '16px' }">
+                <a-button @click="addGroup" :disabled="allForm.group.length > 10">添加广告组</a-button>
+              </div>
+              <a-row>
+                <a-col :sm="24" :md="24" :xl="12" :xxl="12" v-for="(item, index) of allForm.group" :key="index">
+                  <a-card title :ref="item" style="height:435px">
+                    {{ index + 1 }}
+                    <a-icon type="close" style="float:right;cursor: pointer;" @click="removeGroup(index)" />
+                    <div style="clear:both"></div>
+                    <a-form-item
+                      label="优化目标"
+                      :labelCol="{ lg: { span: 6 }, sm: { span: 7 } }"
+                      :wrapperCol="{ lg: { span: 18 }, sm: { span: 17 } }"
+                    >
+                      <a-radio-group buttonStyle="solid" v-model="item.bid_type" @change="resData(index)">
+                        <a-radio-button value="1">点击数</a-radio-button>
+                        <a-radio-button value="2">行为数</a-radio-button>
+                        <a-radio-button
+                          value="180"
+                          v-if="campaignType == '2' && allForm.groupTypeData.is_activate == '1'"
+                          >激活</a-radio-button
+                        >
+                        <a-radio-button
+                          value="53"
+                          v-if="
+                            (campaignType == '4' || campaignType == '5') && allForm.groupTypeData.is_form_submit == '1'
+                          "
+                          >表单提交</a-radio-button
+                        >
+                      </a-radio-group>
+                    </a-form-item>
+                    <a-form-item
+                      label="深度转化目标"
+                      :labelCol="{ lg: { span: 6 }, sm: { span: 7 } }"
+                      :wrapperCol="{ lg: { span: 18 }, sm: { span: 17 } }"
+                      v-if="
+                        (item.bid_type == '180' || item.bid_type == '53') &&
+                          allForm.groupTypeData.deep_conversion_types.length > 0
+                      "
+                    >
+                      <a-select v-model="item.deep_conversion_type">
+                        <a-select-option
+                          :value="items.deep_conversion_type"
+                          v-for="(items, index) of allForm.groupTypeData.deep_conversion_types"
+                          :key="index"
+                          >{{ items.desc }}</a-select-option
+                        >
+                      </a-select>
+                    </a-form-item>
+
+                    <a-form-item
+                      label="计费方式"
+                      :labelCol="{ lg: { span: 6 }, sm: { span: 7 } }"
+                      :wrapperCol="{ lg: { span: 18 }, sm: { span: 17 } }"
+                    >
+                      <a-radio-group defaultValue="1">
+                        <a-radio value="1">点击计费</a-radio>
+                      </a-radio-group>
+                    </a-form-item>
+                    <a-form-item
+                      label="出价"
+                      :labelCol="{ lg: { span: 6 }, sm: { span: 7 } }"
+                      :wrapperCol="{ lg: { span: 18 }, sm: { span: 17 } }"
+                      v-if="item.bid_type == '1'"
+                    >
+                      <a-input-number
+                        v-model="item.bid"
+                        @change="showTip(index)"
+                        :style="{ borderColor: item.showTipCheck ? 'red' : '#d9d9d9' }"
+                        style="width:100%"
+                      ></a-input-number>
+                      <span style="color:red" v-if="item.showTipCheck"
+                        >不得低于0.2元,不得高于项目最高出价{{ maxBid }}元</span
+                      >
+                    </a-form-item>
+                    <a-form-item
+                      label="目标成本"
+                      :labelCol="{ lg: { span: 6 }, sm: { span: 7 } }"
+                      :wrapperCol="{ lg: { span: 18 }, sm: { span: 17 } }"
+                      v-else
+                    >
+                      <a-input-number
+                        v-model="item.cpa_bid"
+                        @change="showTip(index)"
+                        :style="{ borderColor: item.showTipCheck ? 'red' : '#d9d9d9' }"
+                        style="width:100%"
+                      ></a-input-number>
+                      <span style="color:red" v-if="item.showTipCheck">{{
+                        item.bid_type == '2'
+                          ? '不得低于1元,不得高于项目最高出价' + maxBid + '元'
+                          : '不得低于5元,不得高于项目最高出价' + maxBid + '元'
+                      }}</span>
+                    </a-form-item>
+                    <a-form-item
+                      label="深度转化出价"
+                      :labelCol="{ lg: { span: 6 }, sm: { span: 7 } }"
+                      :wrapperCol="{ lg: { span: 18 }, sm: { span: 17 } }"
+                      v-if="
+                        (item.bid_type == '180' || item.bid_type == '53') &&
+                          allForm.groupTypeData.deep_conversion_types.length > 0 &&
+                          item.deep_conversion_type != ''
+                      "
+                    >
+                      <a-input-number
+                        v-model="item.deep_conversion_bid"
+                        @change="deep_conversion_bidTip(index)"
+                        :style="{ borderColor: item.deep_conversion_bidCheck ? 'red' : '#d9d9d9' }"
+                        style="width:100%"
+                        :disabled="item.cpa_bid == ''"
+                      ></a-input-number>
+                      <span style="color:red" v-if="item.deep_conversion_bidCheck"
+                        >深度转化目标成本必须高于优化目标成本,且不得高于3000元</span
+                      >
+                    </a-form-item>
+                    <a-form-item
+                      label="广告组名称"
+                      :labelCol="{ lg: { span: 6 }, sm: { span: 7 } }"
+                      :wrapperCol="{ lg: { span: 18 }, sm: { span: 17 } }"
+                    >
+                      <a-input v-model="item.unitName" @change="checkGroup($event, index)"></a-input>
+                      <span style="color:red" v-if="item.unitNameCheck">广告组名称重复</span>
+                    </a-form-item>
+                  </a-card>
+                </a-col>
+              </a-row>
+            </a-layout-content>
+          </a-layout>
+        </div>
+      </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>
@@ -347,6 +534,7 @@ export default {
       selectedRowKeysNo: [],
       selectedRowKeysValueNo: [],
       data: [],
+      populationData: {},
       url: {
         insertTemplateUrl: '/kuaishou/create/createGroups',
         userAllocationList: '/ctop/userAllocation/list',
@@ -360,7 +548,16 @@ export default {
       loading: false,
       campaignTemplateId: '',
       campaignType: '2',
-      allForm: { dayBudget: '0', time: '1' }
+      maxBid: 0,
+      allForm: {
+        dayBudget: '0',
+        time: '1',
+        scheduleTime: '1',
+        scheduleTimeData:
+          '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
+        group: [],
+        groupTypeData: null
+      }
     }
   },
   computed: {
@@ -411,6 +608,72 @@ export default {
     }
   },
   methods: {
+    addGroup() {
+      this.allForm.group.push({
+        bid_type: '2',
+        bid: '',
+        cpa_bid: '',
+        showTipCheck: false,
+        deep_conversion_bidCheck: false,
+        unitName: '',
+        unitNameCheck: false,
+        deep_conversion_type: '',
+        deep_conversion_bid: ''
+      })
+    },
+    resData(index) {
+      this.allForm.group[index].bid = ''
+      this.allForm.group[index].cpa_bid = ''
+      this.allForm.group[index].showTipCheck = false
+      this.allForm.group[index].deep_conversion_bidCheck = false
+      this.allForm.group[index].deep_conversion_type = ''
+      this.allForm.group[index].deep_conversion_bid = ''
+    },
+    removeGroup(index) {
+      this.allForm.group.splice(index, 1)
+    },
+    deep_conversion_bidTip(index) {
+      if (
+        this.allForm.group[index].deep_conversion_bid < this.allForm.group[index].cpa_bid ||
+        this.allForm.group[index].deep_conversion_bid > 3000
+      ) {
+        this.allForm.group[index].deep_conversion_bidCheck = true
+      } else {
+        this.allForm.group[index].deep_conversion_bidCheck = false
+      }
+    },
+    checkGroup(e, index) {
+      getAction('/kuaishou/batch/checkUnitName', {
+        campaignId: localStorage.getItem('campaignId'),
+        unitName: e.target.value
+      }).then(res => {
+        this.allForm.group[index].unitNameCheck = !res.result
+      })
+    },
+    showTip(index) {
+      if (this.allForm.group[index].bid_type == '1') {
+        if (this.allForm.group[index].bid < 0.2 || this.allForm.group[index].bid > this.maxBid) {
+          this.allForm.group[index].showTipCheck = true
+        } else {
+          this.allForm.group[index].showTipCheck = false
+        }
+      } else if (this.allForm.group[index].bid_type == '2') {
+        if (this.allForm.group[index].cpa_bid < 1 || this.allForm.group[index].cpa_bid > this.maxBid) {
+          this.allForm.group[index].showTipCheck = true
+        } else {
+          this.allForm.group[index].showTipCheck = false
+        }
+      } else {
+        if (this.allForm.group[index].cpa_bid < 5 || this.allForm.group[index].cpa_bid > this.maxBid) {
+          this.allForm.group[index].showTipCheck = true
+        } else {
+          this.allForm.group[index].showTipCheck = false
+        }
+      }
+    },
+    getScheduleTime(item) {
+      this.allForm.scheduleTimeData = item
+    },
     setTime(e) {
       //   console.log(moment('2019-12-27'))
       if (e.target.value == '2') {
@@ -418,6 +681,15 @@ export default {
         this.timeRange[1] = moment().add(1, 'months')
       }
     },
+    setTimeAll(e) {
+      //   console.log(moment('2019-12-27'))
+      if (e.target.value == '2') {
+        this.$nextTick(() => {
+          this.$refs.selectCheck.init()
+        })
+      } else {
+      }
+    },
     getData(className) {
       return this.form.getFieldValue(className)
     },
@@ -515,11 +787,36 @@ export default {
       this.$refs.application.showApplication()
     },
     handleSubmit(e) {
+      //   this.$refs.population.handleSubmit()
       e.preventDefault()
-
+      this.$refs.population.handleSubmit()
       this.form.validateFields((err, values) => {
         if (!err) {
+          console.log(this.populationData)
+
+          var groupArr = this.allForm.group.map(item => {
+            return {
+              ...item,
+              cpa_bid: item.cpa_bid != '' ? item.cpa_bid * 1000 : '',
+              bid: item.bid != '' ? item.bid * 1000 : '',
+              deep_conversion_bid: item.deep_conversion_bid != '' ? item.deep_conversion_bid * 1000 : '',
+              ocpx_action_type: item.bid_type,
+              bid_type: item.bid_type == '1' ? '2' : '6'
+            }
+          })
           console.log('Received values of form: ', values)
+          var json = { ...values, scene_id: [values.scene_id], day_budget: values.day_budget * 1000 }
+          var params = {
+            ...this.populationData,
+            ...json,
+            groupArr: groupArr,
+            accountId: localStorage.getItem('accountId'),
+            campaignId: localStorage.getItem('campaignId'),
+            unit_type: 4,
+            begin_time: moment(this.timeRange[0]).format('YYYY-MM-DD')
+          }
+
+          postAction('/kuaishou/batch/createUnit', params).then(res => {})
         }
       })
     },
@@ -528,7 +825,7 @@ export default {
     },
     handleChange(value) {
       console.log(`selected ${value}`)
-      this.$refs.population.getAppList(value)
+      //   this.$refs.population.getAppList(value)
     },
     handleBlur() {
       console.log('blur')
@@ -551,7 +848,6 @@ export default {
       let params = {}
       params.accountId = localStorage.getItem('accountId')
       getAction('/kuaishou/batch/getAppList', params).then(res => {
-        console.log(res)
         if (res.success) {
           this.appList = res.result.map((item, index) => {
             return {
@@ -567,7 +863,12 @@ export default {
       if (e.target.value == 3) {
         getAction('/kuaishou/batch/getPopulationList', { accountId: localStorage.getItem('accountId') }).then(res => {
           if (res.success) {
-            this.data = res.result
+            this.data = res.result.map((item, index) => {
+              return {
+                ...item,
+                key: index
+              }
+            })
           }
         })
       }
@@ -591,11 +892,20 @@ export default {
       console.log(val)
     }
   },
-  activated: function() {
-    this.$nextTick(() => {
-      this.step = localStorage.getItem('step')
-      this.getAppList()
-      this.getCampaignList()
+  mounted: function() {
+    this.step = localStorage.getItem('step')
+    this.getAppList()
+    this.getCampaignList()
+    getAction('/kuaishou/batch/getIsActivate', { accountId: localStorage.getItem('accountId') }).then(res => {
+      console.log(res)
+      if (res.success) {
+        this.allForm.groupTypeData = res.result
+      }
+    })
+    getAction('/kuaishou/batch/getProjectMaxBid', { accountId: localStorage.getItem('accountId') }).then(res => {
+      if (res.success) {
+        this.maxBid = res.result / 1000
+      }
     })
   }
 }

+ 1 - 1
src/views/modules/kuaishouapp/account/stepForm/Step3.vue

@@ -1292,7 +1292,7 @@ export default {
       return 'video/' + y + '-' + MM + '-' + d + '/'
     }
   },
-  activated: function() {
+  mounted: function() {
     let params = {}
     params.pageSize = '1000'
     params.mediaId = '2'

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

@@ -69,7 +69,7 @@ export default {
       this.currentTab = 0
     }
   },
-  activated() {
+  mounted() {
     this.currentTab = parseInt(localStorage.getItem('step'))
   }
 }

+ 4 - 5
src/views/modules/kuaishouapp/account/stepForm/stepModule/targetedPopulation.vue

@@ -132,7 +132,6 @@ li:hover {
         <a-radio-button value="0" v-if="getApp == '0'">不限</a-radio-button>
         <a-radio-button value="1" v-if="getApp == '0' || getApp == '1'">Android系统</a-radio-button>
         <a-radio-button value="2" v-if="getApp == '0' || getApp == '2'">IOS系统</a-radio-button>
-        {{ getData('platform_os') }}
         <div v-if="getData('platform_os') == '1'" style="margin-top:10px">
           <a-radio-group
             v-decorator="[
@@ -166,7 +165,6 @@ li:hover {
           </a-radio-group>
         </div>
       </a-radio-group>
-      <a-button htmlType="submit" type="primary">确定</a-button>
     </a-form-item>
     <a-form-item
       v-if="getData('platform_os') != '2'"
@@ -648,11 +646,12 @@ export default {
       //   }
       //   this.checkAll = !this.checkAll
     },
-    handleSubmit(e) {
-      e.preventDefault()
+    handleSubmit() {
+      //   e.preventDefault()
       this.form.validateFields((err, values) => {
         if (!err) {
           console.log('Received values of form: ', values)
+          this.$emit('update:populationData', values)
         }
       })
     },
@@ -755,7 +754,7 @@ export default {
       return this.form.getFieldValue(className)
     }
   },
-  activated: function() {
+  mounted: function() {
     getAction('/kuaishou/batch/getRegion').then(res => {
       console.log(res)
       this.options = res.result

+ 146 - 126
src/views/modules/kuaishouapp/account/stepForm/stepModule/test.vue

@@ -3,10 +3,10 @@
     <table class="time_table table" v-on:mouseleave="mouseleave">
       <thead>
         <tr>
-          <th rowspan="2">日期/时间</th>
+          <th rowspan="2" style="width:120px">日期/时间</th>
         </tr>
         <tr>
-          <th class="unselectable" v-for="(num, index) in numData" :key="index">{{ num }}</th>
+          <th class="unselectable" v-for="(num, index) in numData" :key="index" style="width:30px">{{ num }}</th>
         </tr>
       </thead>
       <tbody>
@@ -24,141 +24,79 @@
         </tr>
       </tbody>
     </table>
+    <!-- <div style="height:200px;overflow:auto">
+      <span v-for="(item, index) of dataString" :key="index">
+        <a-tag v-if="item" closable :afterClose="() => handleClose(index)">
+          {{ setItemDate(index) }}
+        </a-tag>
+      </span>
+    </div> -->
   </div>
 </template>
 <script>
 export default {
   name: 'calendar-table',
+  props: {
+    scheduleTime: {
+      type: String
+    }
+  },
   data() {
     return {
-      numData: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
+      numData: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23],
+      dateTime: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
       timeData: [
         {
           date: '周一',
-          time: [
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false }
-          ]
+          time: []
         },
         {
           date: '周二',
-          time: [
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false }
-          ]
+          time: []
         },
         {
           date: '周三',
-          time: [
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false }
-          ]
+          time: []
         },
         {
           date: '周四',
-          time: [
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false }
-          ]
+          time: []
         },
         {
           date: '周五',
-          time: [
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false }
-          ]
+          time: []
         },
         {
           date: '周六',
-          time: [
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false }
-          ]
+          time: []
         },
         {
           date: '周日',
-          time: [
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false },
-            { isSelected: false, move: false }
-          ]
+          time: []
         }
       ],
       selectFlag: false,
       max: {
         x: 0,
         y: 0
-      }
+      },
+      dataString: ''
     }
   },
-
-  computed: {},
-  created: {},
   methods: {
+    handleClose(item) {
+      var index = Math.floor(item / 24)
+      var key = item % 7
+      if (this.timeData[index].time[key].value == false) {
+        if (this.timeData[index].time[key].isSelected) {
+          this.timeData[index].time[key].isSelected = false
+        } else {
+          this.$set(this.timeData[index].time[key], 'isSelected', true)
+        }
+      }
+    },
     showOne(index, key) {
-      this.timeData[index].time[key].isSelected = !this.timeData[index].time[key].isSelected
+      //   this.timeData[index].time[key].isSelected = !this.timeData[index].time[key].isSelected
     },
     mousedown: function(index, key) {
       this.selectStart = []
@@ -192,16 +130,21 @@ export default {
           x: index,
           y: key
         }
-        // for (var i = end.x; i <= this.max.x; i++) {
-        //   for (var j = end.y; j <= this.max.y; j++) {
-        //     this.$set(this.timeData[i].time[j], 'isSelected', false)
+        for (var i = end.x; i <= this.max.x; i++) {
+          for (var j = end.y; j <= this.max.y; j++) {
+            this.$set(this.timeData[i].time[j], 'isSelected', false)
+          }
+        }
+        /* 渲染选中的区域 */
+        // for (var i = start.x; i <= end.x; i++) {
+        //   for (var j = start.y; j <= end.y; j++) {
+        //     // this.$set(this.timeData[i].time[j], 'isSelected', true)
+        //     this.$set(this.timeData[i].time[j], 'show', true)
         //   }
         // }
-        /* 渲染选中的区域 */
         for (var i = start.x; i <= end.x; i++) {
           for (var j = start.y; j <= end.y; j++) {
-            // this.$set(this.timeData[i].time[j], 'isSelected', true)
-            this.$set(this.timeData[i].time[j], 'show', true)
+            this.$set(this.timeData[i].time[j], 'isSelected', true)
           }
         }
       }
@@ -215,22 +158,32 @@ export default {
         x: index,
         y: key
       }
-      //   for (var i = end.x; i <= this.max.x; i++) {
-      //     for (var j = end.y; j <= this.max.y; j++) {
-      //       this.$set(this.timeData[i].time[j], 'isSelected', false)
+      /* 渲染选中的区域 */
+      var data = []
+      var arr = []
+      //   for (let i = 0; i < this.timeData.length; i++) {
+      //     for (let j = 0; j < this.timeData[i].time.length; j++) {
+      //       this.timeData[i].time[j].show = false
       //     }
       //   }
-      /* 渲染选中的区域 */
-      for (let i = 0; i < this.timeData.length; i++) {
-        for (let j = 0; j < this.timeData[i].time.length; j++) {
-          this.timeData[i].time[j].show = false
-        }
-      }
-      for (var i = start.x; i <= end.x; i++) {
-        for (var j = start.y; j <= end.y; j++) {
-          this.timeData[i].time[j].isSelected = !this.timeData[i].time[j].isSelected
+      arr = data.concat(
+        this.timeData[0].time,
+        this.timeData[1].time,
+        this.timeData[2].time,
+        this.timeData[3].time,
+        this.timeData[4].time,
+        this.timeData[5].time,
+        this.timeData[6].time
+      )
+      this.dataString = arr.map(item => {
+        if (item.isSelected) {
+          return 1
+        } else {
+          return 0
         }
-      }
+      })
+      console.log(this.dataString.join(''))
+      this.$emit('update:scheduleTime', this.dataString.join(''))
       this.selectFlag = false
       this.max = {
         x: 0,
@@ -239,13 +192,77 @@ export default {
     },
     mouseleave: function() {
       this.selectFlag = false
+    },
+    setItemDate(sum) {
+      let i = sum
+      if (i < 24) {
+        return '周一' + i + ':00~' + (i + 1) + ':00'
+      } else if (i < 48 && i >= 24) {
+        return '周二' + (i - 24) + ':00~' + (i - 23) + ':00'
+      } else if (i < 72 && i >= 48) {
+        return '周三' + (i - 48) + ':00~' + (i - 47) + ':00'
+      } else if (i < 96 && i >= 72) {
+        return '周四' + (i - 72) + ':00~' + (i - 71) + ':00'
+      } else if (i < 120 && i >= 96) {
+        return '周五' + (i - 96) + ':00~' + (i - 95) + ':00'
+      } else if (i < 144 && i >= 120) {
+        return '周六' + (i - 120) + ':00~' + (i - 119) + ':00'
+      } else {
+        return '周日' + (i - 144) + ':00~' + (i - 143) + ':00'
+      }
+    },
+    init() {
+      var str = this.scheduleTime
+      var arr = str.split('')
+      this.timeData = [
+        {
+          date: '周一',
+          time: []
+        },
+        {
+          date: '周二',
+          time: []
+        },
+        {
+          date: '周三',
+          time: []
+        },
+        {
+          date: '周四',
+          time: []
+        },
+        {
+          date: '周五',
+          time: []
+        },
+        {
+          date: '周六',
+          time: []
+        },
+        {
+          date: '周日',
+          time: []
+        }
+      ]
+      for (let i = 0; i < arr.length; i++) {
+        if (i < 24) {
+          this.timeData[0].time.push({ isSelected: arr[i] == 1 ? true : false, move: false, value: false })
+        } else if (i < 48 && i >= 24) {
+          this.timeData[1].time.push({ isSelected: arr[i] == 1 ? true : false, move: false, value: false })
+        } else if (i < 72 && i >= 48) {
+          this.timeData[2].time.push({ isSelected: arr[i] == 1 ? true : false, move: false, value: false })
+        } else if (i < 96 && i >= 72) {
+          this.timeData[3].time.push({ isSelected: arr[i] == 1 ? true : false, move: false, value: false })
+        } else if (i < 120 && i >= 96) {
+          this.timeData[4].time.push({ isSelected: arr[i] == 1 ? true : false, move: false, value: false })
+        } else if (i < 144 && i >= 120) {
+          this.timeData[5].time.push({ isSelected: arr[i] == 1 ? true : false, move: false, value: false })
+        } else {
+          this.timeData[6].time.push({ isSelected: arr[i] == 1 ? true : false, move: false, value: false })
+        }
+      }
     }
-  },
-  created() {
-    this.$nextTick(() => {})
-  },
-  //监听
-  watch: {}
+  }
 }
 </script>
 
@@ -257,8 +274,11 @@ export default {
 .time_table th,
 .time_table td {
   border: 1px solid #ccc;
-  width: 30px;
-  height: 40px;
+  text-align: center;
+}
+.time_table .unselectable {
+  //   width: 30px !important;
+  height: 20px;
 }
 .active_select {
   background: cornflowerblue;

+ 19 - 13
src/views/modules/material/materialList.vue

@@ -660,7 +660,9 @@ export default {
       id: '',
       role: { roleCode: '', roleName: '' },
       key: '0',
-      mediaId: null
+      mediaId: null,
+      repeat: false,
+      noList: []
     }
   },
   filters: {
@@ -1107,22 +1109,26 @@ export default {
       console.log(this.imageArr)
     },
     file(file) {
+      console.log(file)
       var bmf = new BMF()
       var that = this
       return new Promise(function(resolve, reject) {
-        bmf.md5(file[0], (err, md5) => {
-          //   that.urlList.name.push(file[0].name)
-          //   that.urlList.md5.push(md5)
-          fileCheck({ code: md5 }).then(res => {
-            if (res.code == 0) {
-              that.$message.error('此素材已经上传')
-              reject()
-            } else {
-              resolve()
-              //   reject()
-            }
+        for (let i = 0; i < file.length; i++) {
+          bmf.md5(file[i], (err, md5) => {
+            //   that.urlList.name.push(file[0].name)
+            //   that.urlList.md5.push(md5)
+
+            fileCheck({ code: md5 }).then(res => {
+              if (res.code == 0) {
+                that.$message.error('此素材已经上传')
+                reject()
+              } else {
+                resolve()
+                //   reject()
+              }
+            })
           })
-        })
+        }
       })
     },
     fileWater(file) {

+ 27 - 11
src/views/modules/material/videoMaterial.vue

@@ -424,6 +424,12 @@ a {
             :dir="dirVideo"
             @loaded="overUpload"
           ></upload-to-ali>
+          <span v-if="repeat" style="color:red">
+            此素材重复,请从新选择上传
+          </span>
+          <span v-if="confirmLoading && urlList.url != ''" style="color:green">
+            上传成功
+          </span>
         </a-form-item>
         <div>
           <a-form-item :label-col="labelCol" :wrapper-col="wrapperCol" label="策划" v-if="activeKey == 'video'">
@@ -781,7 +787,8 @@ export default {
       key: '0',
       mediaId: null,
       sizeType: [],
-      size: 4
+      size: 4,
+      repeat: false
     }
   },
   filters: {
@@ -1149,17 +1156,22 @@ export default {
           params.tag = this.tags
           if (this.add) {
             fileInsert(params).then(res => {
-              this.form.resetFields()
-              this.urlList = { url: '', md5: '', name: '' }
-              this.watermarkUrl = { url: '', md5: '', name: '' }
-              this.tags = []
-              this.loadData()
-              this.visible = false
-              this.add = true
-              for (const key in this.role) {
-                if (key == 'roleCode') {
-                  this.role[key] = this.role[key].substr(0, this.role[key].length - 2)
+              if (res.success) {
+                this.form.resetFields()
+                this.urlList = { url: '', md5: '', name: '' }
+                this.watermarkUrl = { url: '', md5: '', name: '' }
+                this.tags = []
+                this.loadData()
+                this.visible = false
+                this.add = true
+                for (const key in this.role) {
+                  if (key == 'roleCode') {
+                    this.role[key] = this.role[key].substr(0, this.role[key].length - 2)
+                  }
                 }
+                this.$message.success('素材上传成功')
+              } else {
+                this.$message.error(res.message)
               }
             })
           } else {
@@ -1199,6 +1211,8 @@ export default {
     },
     overUpload(urlAll) {
       this.confirmLoading = true
+      this.repeat = false
+      this.$message.success('上传成功')
     },
     file(file) {
       var bmf = new BMF()
@@ -1210,8 +1224,10 @@ export default {
           fileCheck({ code: md5 }).then(res => {
             if (res.code == 0) {
               that.$message.error('此素材已经上传')
+              that.repeat = true
               reject()
             } else {
+              that.repeat = false
               resolve()
               //   reject()
             }