Browse Source

Merge branch 'master' of http://git.tjyourong.com.cn/ctop/adsp-vue

魏志佳 4 years ago
parent
commit
0fe7b45fe2

+ 5 - 2
src/components/ctop/ActorModal.vue

@@ -30,7 +30,7 @@
             :accessKeySecret="accessKeySecret"></upload-to-ali> -->
         </a-form-item>
         <a-form-item label="视频作品" :labelCol="labelCol" :wrapperCol="wrapperCol" v-if="!model.name">
-          <uploadFile :value.sync="videoUrl" :fileCount="1" uploadType="video" />
+          <uploadFile :value.sync="videoUrl" :fileCount="10" uploadType="video" />
           <!-- <upload-to-ali v-model="videoUrl" :customDomain="customDomain" multiple preview :region="region"
             :bucket="bucket" :accept="acceptVideo" :max="10" :size="1024000" :accessKeyId="accessKeyId"
             :accessKeySecret="accessKeySecret"></upload-to-ali> -->
@@ -130,6 +130,9 @@
         })
       },
       add() {
+        this.imageUrl = []
+        this.videoUrl = []
+        this.coverUrl = ""
         this.edit({});
       },
       edit(record) {
@@ -138,7 +141,7 @@
         that.form.resetFields();
         that.model = Object.assign({}, record);
         that.visible = true;
-        // that.coverUrl = ""
+        that.coverUrl = record.coverUrl?record.coverUrl:''
         // that.imageUrl = ""
         // that.videoUrl = ""
         that.$nextTick(() => {

+ 2 - 1
src/components/ctop/propModal.vue

@@ -112,11 +112,12 @@
         this.edit({});
       },
       edit(record) {
-
+        console.log(record)
         let that = this;
         that.form.resetFields();
         that.model = Object.assign({}, record);
         that.visible = true;
+        that.imageUrl = record.coverUrl?[record.coverUrl]:[]
         that.$nextTick(() => {
           that.form.setFieldsValue(pick(this.model, 'name', 'desc'))
           //时间格式化

+ 4 - 4
src/components/ctop/vm-card.vue

@@ -222,7 +222,7 @@ li {
       @ok="handleOk('photo')"
       @cancel="handleCancel('photo')"
     >
-    <uploadFile :value.sync="imageUrl" :fileCount="1" uploadType="image" :multiple="false" />
+    <uploadFile :value.sync="imageUrl" :fileCount="10" uploadType="image" />
       <!-- <upload-to-ali
         style="margin:10px"
         v-model="imageUrl"
@@ -244,7 +244,7 @@ li {
       @ok="handleOk('video')"
       @cancel="handleCancel('video')"
     >
-    <uploadFile :value.sync="videoUrl" :fileCount="1" uploadType="video" :multiple="false" />
+    <uploadFile :value.sync="videoUrl" :fileCount="10" uploadType="video" />
       <!-- <upload-to-ali
         style="margin:10px"
         v-model="videoUrl"
@@ -377,8 +377,8 @@ export default {
       noImgUrl: require('@/assets/img/noImg.png'),
       loginInfo: JSON.parse(localStorage.getItem('pro__Login_Userinfo')),
       photoList: [],
-      imageUrl: '',
-      videoUrl: '',
+      imageUrl: [],
+      videoUrl: [],
       total: 1,
       videoTotal: 1,
       pageSize: 4,

+ 1 - 1
src/components/uploadFile.vue

@@ -8,7 +8,7 @@
       action="https://media-1301855440.cos.ap-chongqing.myqcloud.com/" :before-upload="beforeUpload"
       @change="handleChange" :accept="uploadType+'/'+(uploadType=='image'?'jpeg,image/jpg':'mp4')" :file-list="fileList"
       :remove="removeFile" @preview="handlePreview" :disabled="loadingElse||disabled">
-      <div v-if="uploadType=='image'?fileList.length < fileCount:fileList.length<1">
+      <div v-if="fileList.length < fileCount||fileList.length<1">
         <a-progress v-if='loadingElse' :percent="percent" :show-info="false" />
         <div class="ant-upload-text">
           点击上传

+ 32 - 4
src/views/modules/advertiser/ProjectList.vue

@@ -123,11 +123,27 @@
         <span slot="maxBid" slot-scope="text">{{ text / 1000 }}</span>
         <span slot="maxDeepCpaBid" slot-scope="text">{{ text / 1000 }}</span>
         <span slot="ocpxActionType" slot-scope="text">
-          {{ text | ocpxActionType }}
+          <div v-if="text">
+            <span v-for="(item, index) of JSON.parse(text)" :key="index"
+              >{{ item | ocpxActionType }}{{ index == JSON.parse(text).length - 1 ? '' : ',' }}</span
+            >
+          </div>
+          <div v-else>-</div>
+
+          <!-- {{ text | ocpxActionType }} -->
         </span>
         <span slot="bidType" slot-scope="text">
-          {{ text | bidType }}
+          <div v-if="text">
+            <span v-for="(item, index) of JSON.parse(text)" :key="index"
+              >{{ item | bidType }}{{ index == JSON.parse(text).length - 1 ? '' : ',' }}</span
+            >
+          </div>
+          <div v-else>-</div>
+        </span>
+        <span slot="mediaId" slot-scope="text">
+          {{ text == '1' || text == '3' ? '头条' : '快手' }}
         </span>
+
         <span slot="action" slot-scope="text, record">
           <a @click="handleEdit(record)">编辑</a>
 
@@ -227,6 +243,14 @@ export default {
           dataIndex: 'designResponsibleId_dictText',
         },
         {
+          title: '媒体',
+          align: 'center',
+          dataIndex: 'mediaId',
+          scopedSlots: {
+            customRender: 'mediaId',
+          },
+        },
+        {
           title: '操作',
           dataIndex: 'action',
           align: 'center',
@@ -267,6 +291,12 @@ export default {
         31: '下载完成',
         53: '提交线索',
         180: '激活',
+        190: '付费',
+        191: '首日ROI',
+        348: '有效线索',
+        383: '授信',
+        384: '完件',
+        394: '订单提交',
       }
       return data[sta]
     },
@@ -282,11 +312,9 @@ export default {
       // params.userId = this.userInfo().id
       params.pageSize = 1000
       params.pageNo = 1
-      console.log(params)
       getAction('/ctop/advertiser/list', params)
         .then((res) => {
           if (res.success) {
-            console.log(res)
             this.list = res.result.records
           } else {
             this.$message.warning(res.message)

+ 58 - 60
src/views/modules/advertiser/modules/projectListModal.vue

@@ -18,14 +18,11 @@
             <a-radio-button value="4">快手内广</a-radio-button>
           </a-radio-group>
         </a-form-item> -->
+
         <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="项目名称">
           <a-input placeholder="请输入项目名称" v-decorator="['projectName', validatorRules.projectName]" disabled />
         </a-form-item>
-        <!-- <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="行业">
-          <j-tree-select ref="treeSelect" placeholder="请选择行业" v-decorator="['industryId']"
-            dict="sys_category,name,id" pidField="pid" pidValue="f5cb2d2d28417b3b65a6dd744bcb9a76">
-          </j-tree-select>
-        </a-form-item>-->
+
         <a-form-item
           :labelCol="labelCol"
           :wrapperCol="wrapperCol"
@@ -79,33 +76,37 @@
         <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="最高转化出价">
           <a-input placeholder="最高转化出价" v-decorator="['maxDeepCpaBid']" addonAfter="元" />
         </a-form-item>
+        <div v-if="showDian">
+          <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="优化目标">
+            <a-select v-decorator="['bidType', { initialValue: 2 }]" mode="multiple">
+              <a-select-option :value="2">点击数</a-select-option>
+              <a-select-option :value="10">OCPM</a-select-option>
+              <a-select-option :value="6">OCPC</a-select-option>
+            </a-select>
+          </a-form-item>
+          <div v-if="Array.isArray(getFormFieldValue('bidType'))">
+            <a-form-item
+              label="转化目标"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              v-show="getFormFieldValue('bidType').findIndex((item) => item == 10)>-1 || getFormFieldValue('bidType').findIndex((item) => item == 6)>-1"
+            >
+              <a-select v-model="model.ocpxActionType" mode="multiple">
+                <a-select-option :value="2">行为数</a-select-option>
+                <a-select-option :value="180">激活</a-select-option>
+                <a-select-option :value="53">表单提交</a-select-option>
 
-        <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="优化目标">
-          <a-radio-group buttonStyle="solid" v-decorator="['bidType', { initialValue: 2 }]">
-            <a-radio-button :value="2">点击数</a-radio-button>
-            <a-radio-button :value="10">转化数</a-radio-button>
-          </a-radio-group>
-        </a-form-item>
-        <a-form-item
-          label="转化目标"
-          :labelCol="labelCol"
-          :wrapperCol="wrapperCol"
-          v-show="getFormFieldValue('bidType') == 10"
-        >
-          <a-select v-decorator="['ocpxActionType', { initialValue: 2 }]">
-            <a-select-option :value="2">行为数</a-select-option>
-            <a-select-option :value="180">激活</a-select-option>
-            <a-select-option :value="53">表单提交</a-select-option>
-
-            <a-select-option :value="394">订单提交</a-select-option>
-            <a-select-option :value="348">使用有效线索</a-select-option>
-            <a-select-option :value="383">授信出价</a-select-option>
-            <a-select-option :value="384">完件出价</a-select-option>
-            <a-select-option :value="190">付费出价</a-select-option>
-            <a-select-option :value="191">首日ROI</a-select-option>
-            <a-select-option :value="396">注册优化目标</a-select-option>
-          </a-select>
-        </a-form-item>
+                <a-select-option :value="394">订单提交</a-select-option>
+                <a-select-option :value="348">使用有效线索</a-select-option>
+                <a-select-option :value="383">授信出价</a-select-option>
+                <a-select-option :value="384">完件出价</a-select-option>
+                <a-select-option :value="190">付费出价</a-select-option>
+                <a-select-option :value="191">首日ROI</a-select-option>
+                <a-select-option :value="396">注册优化目标</a-select-option>
+              </a-select>
+            </a-form-item>
+          </div>
+        </div>
 
         <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="销售">
           <a-select
@@ -217,6 +218,7 @@ export default {
       optionsElse: [],
       supplierList: [],
       editAll: false,
+      showDian: false,
     }
   },
   created() {
@@ -235,19 +237,14 @@ export default {
       console.log(`checked = ${e.target.value}`)
     },
     handleChange(value) {
-      console.log(value)
       getAction('/ctop/product/list', { advertiserId: value, pageSize: 1000 }).then((res) => {
         if (res.success) {
           this.listProduct = res.result.records
         }
       })
     },
-    handleBlur() {
-      console.log('blur')
-    },
-    handleFocus() {
-      console.log('focus')
-    },
+    handleBlur() {},
+    handleFocus() {},
     filterOption(input, option) {
       return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
     },
@@ -256,11 +253,9 @@ export default {
       // params.userId = this.userInfo().id
       params.pageSize = 1000
       params.pageNo = 1
-      console.log(params)
       getAction(this.url.getList, params)
         .then((res) => {
           if (res.success) {
-            console.log(res)
             this.list = res.result.records
           } else {
             this.$message.warning(res.message)
@@ -297,38 +292,45 @@ export default {
           }
         })
       }
-      var params = { ...record }
-
-      console.log(record)
+      // else if (this.request == '2,4') {
+      //         params.type = 'kuaishou'
+      //       }
+      if (record.mediaId == '2' || record.mediaId == '4') {
+        var params = { ...record }
+        params.bidType = record.bidType == null ? [2] : JSON.parse(record.bidType)
+        params.ocpxActionType = record.ocpxActionType == null ? [2] : JSON.parse(record.ocpxActionType)
+        this.showDian = true
+      } else {
+        var { ocpxActionType, bidType, ...params } = record
+        this.showDian = false
+      }
       this.form.resetFields()
       this.model = Object.assign({}, params)
       this.model.maxBid = this.model.maxBid ? this.model.maxBid / 1000 : 0
       this.model.maxDeepCpaBid = this.model.maxDeepCpaBid ? this.model.maxDeepCpaBid / 1000 : 0
-      this.model.bidType = this.model.bidType == null ? 2 : this.model.bidType
-      this.model.ocpxActionType = this.model.ocpxActionType == null ? 2 : this.model.ocpxActionType
+      // if (record.mediaId == '2' || record.mediaId == '4') {
+      //   this.model.bidType = this.model.bidType == null ? [2] : JSON.parse(this.model.bidType)
+      //   this.model.ocpxActionType = this.model.ocpxActionType == null ? [2] : JSON.parse(this.model.ocpxActionType)
+      // }
       this.visible = true
+      console.log(this.model)
       this.$nextTick(() => {
-        console.log(this.model)
         if (record.advertiserId) {
           this.form.setFieldsValue(
             pick(
               this.model,
               'projectName',
-              'industryId',
               'advertiserId',
               'productId',
-              'responsibleName',
               'maxBid',
               'maxDeepCpaBid',
-              'userId',
               'designResponsibleId',
               'responsibleId',
-              'industryCode',
+
               'supplierCode',
               // 'advertiserType',
               'saleId',
               'bidType',
-              'ocpxActionType'
             )
           )
         } else {
@@ -336,15 +338,11 @@ export default {
             pick(
               this.model,
               'projectName',
-              'industryId',
               'advertiserId',
-              'responsibleName',
               'maxBid',
               'maxDeepCpaBid',
-              'userId',
               'designResponsibleId',
               'responsibleId',
-              'industryCode',
               'supplierCode',
               // 'advertiserType',
               'saleId',
@@ -357,13 +355,11 @@ export default {
         // this.resId = record.responsibleId
         // this.shejiId = record.designResponsibleId
         getAction('/sys/user/getAllUserListV1', '').then((res) => {
-          console.log(res)
           if (res.success) {
             this.options = res.result
           }
         })
         getAction('/sys/user/getAllSaleList', '').then((res) => {
-          console.log(res)
           if (res.success) {
             this.optionsElse = res.result
           }
@@ -401,8 +397,11 @@ export default {
           formData.responsibleId = values.responsibleId
           formData.designResponsibleId = values.designResponsibleId
           formData.userId = formData.userId ? formData.userId : that.userInfo().id
-          formData.ocpxActionType = formData.bidType == 2 ? 0 : formData.ocpxActionType
-          console.log(formData)
+          if (this.showDian) {
+            formData.ocpxActionType =
+              formData.bidType == 2 ? JSON.stringify([0]) : JSON.stringify(formData.ocpxActionType)
+            formData.bidType = JSON.stringify(formData.bidType)
+          }
           httpAction(httpurl, formData, method)
             .then((res) => {
               if (res.success) {
@@ -427,7 +426,6 @@ export default {
       return this.form.getFieldValue(field)
     },
     get(valueName, key) {
-      console.log(valueName, key)
       this.resId = key
     },
   },