朱鑫波 vor 4 Jahren
Ursprung
Commit
d5e961b61a

+ 3 - 3
public/index.html

@@ -272,9 +272,9 @@
   <script>
     window._CONFIG = {};
     // window._CONFIG['domianURL'] = 'http://192.168.1.72:8088/jeecg-boot';
-    window._CONFIG['domianURL'] = 'http://39.97.120.42:8080/jeecg-boot';
-    window._CONFIG['imgDomainURL'] = 'http://39.97.120.42:8080/jeecg-boot/sys/common/view';
-    window._CONFIG['pdfDomainURL'] = 'http://39.97.120.42:8080/jeecg-boot/sys/common/pdf/pdfPreviewIframe';
+    window._CONFIG['domianURL'] = 'http://139.186.31.213:8804/jeecg-boot';
+    window._CONFIG['imgDomainURL'] = 'http://139.186.31.213:8804/jeecg-boot/sys/common/view';
+    window._CONFIG['pdfDomainURL'] = 'http://139.186.31.213:8804/jeecg-boot/sys/common/pdf/pdfPreviewIframe';
   </script>
 </head>
 

+ 1 - 1
src/mixins/JeecgListMixin.js

@@ -281,7 +281,7 @@ export const JeecgListMixin = {
     },
     modalFormOk() {
       // 新增/修改 成功时,重载列表
-      this.loadData();
+      this.loadData(1);
     },
     handleDetail: function (record) {
       this.$refs.modalForm.edit(record);

+ 0 - 2
src/views/activiti/applyHome.vue

@@ -30,8 +30,6 @@
           </a-list>
         </a-collapse-panel>
       </a-collapse>
-      <k-form-design style="border:2px solid #ccc" :fields="typeList" :toolbars="['save', 'preview', 'reset', 'close' ]"
-        :showHead="false" toolbarsTop showToolbarsText @save="saveJson" />
     </div>
     <!--流程表单-->
     <a-modal :title="lcModa.title" v-model="lcModa.visible" :footer="null" :maskClosable="false" width="80%">

+ 268 - 0
src/views/activiti/customerForm.vue

@@ -0,0 +1,268 @@
+<style>
+.form-designer-container-9136076486841527 {
+  height: 55vh !important;
+}
+</style>
+<template>
+  <a-card :bordered="false">
+    <!-- 查询区域 -->
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline">
+        <a-row :gutter="24">
+          <a-col :md="6" :sm="8">
+            <a-form-item label="表单名称">
+              <a-input placeholder="请输入表单名称" v-model="queryParam.name"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="8">
+            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
+              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
+              <a-button type="primary" @click="searchRe" icon="reload" style="margin-left: 8px">重置</a-button>
+            </span>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+
+    <!-- 操作按钮区域 -->
+    <div class="table-operator">
+      <a-button @click="handleAddForm" type="primary" icon="plus">新增</a-button>
+    </div>
+
+    <!-- table区域-begin -->
+    <div>
+      <a-table
+        ref="table"
+        size="middle"
+        bordered
+        rowKey="id"
+        :columns="columns"
+        :dataSource="dataSource"
+        :pagination="ipagination"
+        :loading="loading"
+        @change="handleTableChange"
+      >
+        <span slot="action" slot-scope="text, record">
+          <a @click="lookView(record)">预览</a>
+        </span>
+      </a-table>
+    </div>
+    <!-- table区域-end -->
+    <a-modal
+      :maskClosable="false"
+      title="表单新增"
+      v-model="addForm"
+      :footer="null"
+      :width="1200"
+      :okButtonProps="{ props: { disabled: false } }"
+      :cancelButtonProps="{ props: { disabled: false } }"
+    >
+      <a-form :form="form">
+        <a-form-item
+          label="表单名称"
+          :label-col="{ xs: { span: 24 }, sm: { span: 5 } }"
+          :wrapper-col="{ xs: { span: 24 }, sm: { span: 16 } }"
+        >
+          <a-input
+            v-decorator="[
+            'name',
+            {rules: [{ required: true, message: '请输入表单名称' }]}
+          ]"
+            placeholder="请输入表单名称"
+          />
+        </a-form-item>
+        <k-form-design
+          v-if="addForm"
+          style="border:2px solid #ccc"
+          :fields="typeList"
+          :toolbars="['save', 'preview', 'reset', 'close' ]"
+          :showHead="false"
+          toolbarsTop
+          showToolbarsText
+          @save="saveJson"
+        />
+      </a-form>
+    </a-modal>
+    <a-modal
+      :maskClosable="false"
+      title="表单预览"
+      v-model="viewLookVisible"
+      :footer="null"
+      :width="1200"
+      :okButtonProps="{ props: { disabled: false } }"
+      :cancelButtonProps="{ props: { disabled: false } }"
+    >
+      <k-form-build
+        v-if="viewLookVisible"
+        :defaultValue="defaultValue"
+        :value="jsonData"
+        ref="KFB"
+      />
+    </a-modal>
+
+    <!-- 表单区域 -->
+    <j-select-user ref="userForm" @ok="modalFormOk"></j-select-user>
+  </a-card>
+</template>
+
+<script>
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import JTreeSelect from '@/components/jeecg/JTreeSelect'
+import AFormItem from 'ant-design-vue/es/form/FormItem'
+import JSelectDepart from '@/components/jeecgbiz/JSelectDepart'
+import JSelectUserByDep from '@/components/jeecgbiz/JSelectUserByDep'
+import JSelectUser from '@/components/jeecgbiz/JSelectUser'
+import { postAction } from '../../api/manage'
+import { mapActions, mapGetters } from 'vuex'
+
+export default {
+  name: 'AdvertiserList',
+  mixins: [JeecgListMixin],
+  components: {
+    AFormItem,
+    JTreeSelect,
+    JSelectUserByDep,
+    JSelectDepart,
+    JSelectUser,
+  },
+  data() {
+    return {
+      typeList: [
+        'input',
+        'textarea',
+        'number',
+        'select',
+        'checkbox',
+        'radio',
+        'date',
+        'time',
+        'rate',
+        'slider',
+        'uploadFile',
+        'uploadImg',
+        'switch',
+        'button',
+        'text',
+        'card',
+        'grid',
+        'table',
+      ], //"alert","html", "divider",
+      addForm: false,
+      viewLookVisible: false,
+      jsonData: {},
+      defaultValue: {},
+      departDisabled: false, //是否是我的部门调用该页面
+      users: this.userInfo().realname, //用户名称
+      departmentId: this.userInfo().departId, //部门id
+      description: '广告主信息表管理页面',
+      visible: false,
+      accountName: '',
+      password: '',
+      mode: 'login',
+      showLogin: true,
+      showAuthorization: false,
+      authorizationType: 'kuaishou',
+      loginType: 'kuaishou',
+      form: this.$form.createForm(this),
+      // 表头
+      columns: [
+        {
+          title: '表单名称',
+          align: 'center',
+          dataIndex: 'name',
+        },
+        {
+          title: '创建人',
+          align: 'center',
+          dataIndex: 'userId_dictText',
+        },
+        {
+          title: '操作',
+          dataIndex: 'action',
+          align: 'center',
+          scopedSlots: { customRender: 'action' },
+        },
+      ],
+      url: {
+        list: '/ctop/actCustomForm/list',
+        delete: '/ctop/advertiser/delete',
+        deleteBatch: '/ctop/advertiser/deleteBatch',
+        exportXlsUrl: 'ctop/advertiser/exportXls',
+        importExcelUrl: 'ctop/advertiser/importExcel',
+        bindAccountLoginUrl: '/ctop/bindAccountLogin/login',
+        bindAuthorizationUrl: '/ctop/bindAccountAuth/authorization',
+        getLoginInfo: '/ctop/bindAccount/getLoginInfo',
+        userId: '/sys/user/generateUserId', // 引入生成添加用户情况下的url
+        userWithDepart: '/sys/user/userDepartList', // 引入为指定用户查看部门信息需要的url
+      },
+    }
+  },
+  computed: {
+    importExcelUrl: function () {
+      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
+    },
+  },
+  created() {
+    this.queryParam.userId = this.userInfo().id
+  },
+  methods: {
+    lookView(item) {
+      this.viewLookVisible = true
+      this.jsonData = JSON.parse(item.text)
+    },
+    saveJson(json) {
+      console.log(json)
+      this.form.validateFields((err) => {
+        if (!err) {
+          var params = {}
+          params.name = this.getData('name')
+          params.text = json
+          postAction('/ctop/actCustomForm/add', params).then((res) => {
+            if (res.success) {
+              this.addForm = false
+              this.loadData(1)
+            }
+          })
+        }
+      })
+    },
+    handleAddForm() {
+      this.addForm = true
+    },
+    getData(className) {
+      return this.form.getFieldValue(className)
+    },
+    ...mapGetters(['nickname', 'avatar', 'userInfo']),
+    searchRe() {
+      this.queryParam.name = ''
+      this.queryParam.industryId = ''
+      this.loadData()
+    },
+    handleSubmit() {
+      // 触发表单验证
+    },
+
+    onChageLogin() {
+      console.log(this.mode)
+      if (this.mode == 'login') {
+        this.showLogin = true
+        this.showAuthorization = false
+      } else {
+        this.showLogin = false
+        this.showAuthorization = true
+      }
+    },
+    showModal(record) {
+      this.record = record
+      this.visible = true
+    },
+
+    handleCancel() {
+      this.close()
+    },
+  },
+}
+</script>
+<style scoped>
+@import '~@assets/less/common.less';
+</style>

+ 288 - 168
src/views/modules/advertiser/AdvertiserList.vue

@@ -9,19 +9,6 @@
               <a-input placeholder="请输入广告主开户主体名称" v-model="queryParam.name"></a-input>
             </a-form-item>
           </a-col>
-          <a-col :md="6" :sm="6">
-            <a-form-item label="行业">
-              <j-tree-select
-                v-model="queryParam.industryId"
-                ref="treeSelect"
-                placeholder="请选择行业"
-                dict="sys_category,name,id"
-                pidField="pid"
-                pidValue="f5cb2d2d28417b3b65a6dd744bcb9a76"
-              >
-              </j-tree-select>
-            </a-form-item>
-          </a-col>
           <a-col :md="6" :sm="8">
             <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
               <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
@@ -33,11 +20,34 @@
     </div>
 
     <!-- 操作按钮区域 -->
-    <div class="table-operator">
+    <!-- <div class="table-operator">
       <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
-    </div>
+    </div>-->
+    <a-tabs @change="callbackTwo" v-model="active">
+      <a-tab-pane key="advertiser" tab="广告主列表"></a-tab-pane>
+      <a-tab-pane key="product" tab="产品列表">
+        <a-tag
+          color="blue"
+          style="height:30px;line-height:30px;font-size:14px;margin-bottom:20px"
+          v-if="queryParam.advertiserId"
+        >
+          {{advertiserName}}
+          <a-icon type="close" @click="clear('advertiserId')" />
+        </a-tag>
+      </a-tab-pane>
+      <a-tab-pane key="project" tab="项目列表">
+        <a-tag
+          color="blue"
+          style="height:30px;line-height:30px;font-size:14px;margin-bottom:20px"
+          v-if="queryParam.productId"
+        >
+          {{advertiserName?advertiserName+' / '+productName:productName}}
+          <a-icon type="close" @click="clear('productId')" />
+        </a-tag>
+      </a-tab-pane>
+      <a-button type="primary" slot="tabBarExtraContent" @click="addNew">新增</a-button>
+    </a-tabs>
 
-    <!-- table区域-begin -->
     <div>
       <a-table
         ref="table"
@@ -58,124 +68,44 @@
             <a>删除</a>
           </a-popconfirm>
         </span>
-      </a-table>
-      <a-modal
-        title="账号绑定"
-        v-model="visible"
-        @ok="handleSubmit"
-        :width="800"
-        :okButtonProps="{ props: { disabled: false } }"
-        :cancelButtonProps="{ props: { disabled: false } }"
-      >
-        <a-form>
-          <a-form-item
-            label="选择方式"
-            :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
-            :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
-          >
-            <a-radio-group buttonStyle="solid" @change="onChageLogin" v-model="mode">
-              <a-radio-button value="login">登录</a-radio-button>
-              <a-radio-button value="authorization">授权</a-radio-button>
-            </a-radio-group>
-          </a-form-item>
-
-          <a-form-item v-if="showLogin">
-            <a-form :form="form">
-              <!-- @submit="loginForm">-->
-              <a-form-item
-                label="账号:"
-                :label-col="{ xs: { span: 24 }, sm: { span: 5 } }"
-                :wrapper-col="{ xs: { span: 24 }, sm: { span: 16 } }"
-              >
-                <a-input v-model="accountName" placeholder="请输入账户名" />
-              </a-form-item>
-              <a-form-item
-                label="密码:"
-                :label-col="{ xs: { span: 24 }, sm: { span: 5 } }"
-                :wrapper-col="{ xs: { span: 24 }, sm: { span: 16 } }"
-              >
-                <a-input type="password" v-model="password" placeholder="请输入密码" />
-              </a-form-item>
-              <a-form-item
-                label="媒体:"
-                :label-col="{ xs: { span: 24 }, sm: { span: 5 } }"
-                :wrapper-col="{ xs: { span: 24 }, sm: { span: 16 } }"
-              >
-                <a-radio-group buttonStyle="outline" v-model="loginType">
-                  <a-radio-button value="kuaishou">快手</a-radio-button>
-                  <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 } }"
-                v-show="!departDisabled"
-              >
-                <j-select-depart v-model="departmentId" :multi="false"></j-select-depart>
-              </a-form-item>
-
-              <a-form-item
-                label="用户选择"
-                :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
-                :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
-              >
-                <j-select-user-by-dep v-model="users"></j-select-user-by-dep>
-              </a-form-item>
-            </a-form>
-          </a-form-item>
-
-          <a-form-item
-            v-if="showAuthorization"
-            :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
-            :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
-          >
-            <a-form :form="form">
-              <!--@submit="authorizationForm"-->
+        <span slot="actionProduct" slot-scope="text, record">
+          <a @click="handleEditElse(record,'product')">编辑</a>
 
-              <a-form-item
-                label="媒体:"
-                :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
-                :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
-              >
-                <a-radio-group buttonStyle="outline" v-model="authorizationType">
-                  <a-radio-button value="kuaishou">快手</a-radio-button>
-                  <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 } }"
-                v-show="!departDisabled"
-              >
-                <j-select-depart v-model="departmentId" :multi="false"></j-select-depart>
-              </a-form-item>
+          <a-divider type="vertical" />
+          <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
+            <a>删除</a>
+          </a-popconfirm>
+        </span>
+        <span slot="actionProject" slot-scope="text, record">
+          <a @click="handleEditElse(record,'project')">编辑</a>
 
-              <a-form-item
-                label="用户选择"
-                :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
-                :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
-              >
-                <j-select-user-by-dep v-model="users"></j-select-user-by-dep>
-              </a-form-item>
-            </a-form>
-          </a-form-item>
-        </a-form>
-      </a-modal>
+          <a-divider type="vertical" />
+          <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
+            <a>删除</a>
+          </a-popconfirm>
+        </span>
+        <span slot="maxBid" slot-scope="text">{{ text / 1000 }}</span>
+        <span slot="maxDeepCpaBid" slot-scope="text">{{ text / 1000 }}</span>
+        <a slot="name" slot-scope="text,record" @click="toProduct(record,'product')">{{text}}</a>
+        <a slot="productName" slot-scope="text,record" @click="toProduct(record,'project')">{{text}}</a>
+      </a-table>
     </div>
+    <!-- table区域-begin -->
+
     <!-- table区域-end -->
 
     <!-- 表单区域 -->
     <advertiser-modal ref="modalForm" @ok="modalFormOk"></advertiser-modal>
+    <product-modal ref="modalFormTwo" @ok="modalFormOk"></product-modal>
+    <project-modal ref="modalFormThree" @ok="modalFormOk"></project-modal>
     <j-select-user ref="userForm" @ok="modalFormOk"></j-select-user>
   </a-card>
 </template>
 
 <script>
 import AdvertiserModal from './modules/AdvertiserModal'
+import productModal from './modules/productModal'
+import ProjectModal from './modules/ProjectModal'
 import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 import JTreeSelect from '@/components/jeecg/JTreeSelect'
 import AFormItem from 'ant-design-vue/es/form/FormItem'
@@ -185,6 +115,139 @@ import JSelectUser from '@/components/jeecgbiz/JSelectUser'
 import { postAction } from '../../../api/manage'
 import { mapActions, mapGetters } from 'vuex'
 
+const advertiserColumns = [
+  {
+    title: '广告主开户主体名称',
+    align: 'center',
+    dataIndex: 'name',
+    scopedSlots: { customRender: 'name' },
+  },
+  {
+    title: '联系人姓名',
+    align: 'center',
+    dataIndex: 'contact',
+  },
+  {
+    title: '联系人手机',
+    align: 'center',
+    dataIndex: 'mobile',
+  },
+  {
+    title: '联系人邮箱',
+    align: 'center',
+    dataIndex: 'email',
+  },
+  {
+    title: '操作',
+    dataIndex: 'action',
+    align: 'center',
+    scopedSlots: { customRender: 'action' },
+  },
+]
+const productColumns = [
+  {
+    title: '产品名',
+    align: 'center',
+    dataIndex: 'productName',
+    scopedSlots: { customRender: 'productName' },
+  },
+  {
+    title: '广告主名称',
+    align: 'center',
+    dataIndex: 'advertiserId_dictText',
+  },
+  {
+    title: '创建人',
+    align: 'center',
+    dataIndex: 'userId_dictText',
+  },
+  {
+    title: '行业',
+    align: 'center',
+    dataIndex: 'industryId_dictText',
+  },
+  {
+    title: '状态',
+    align: 'center',
+    dataIndex: 'productStatus',
+    customRender: function (text) {
+      if (text == 0) {
+        return '启动'
+      } else if (text == 1) {
+        return '暂停'
+      } else if (text == 2) {
+        return '删除'
+      }
+    },
+  },
+  {
+    title: '操作',
+    dataIndex: 'actionProduct',
+    align: 'center',
+    scopedSlots: { customRender: 'actionProduct' },
+  },
+]
+const projectColumns = [
+  {
+    title: '项目名称',
+    align: 'center',
+    dataIndex: 'projectName',
+  },
+  {
+    title: '产品名',
+    align: 'center',
+    dataIndex: 'productId_dictText',
+  },
+  {
+    title: '广告主名称',
+    align: 'center',
+    dataIndex: 'advertiserId_dictText',
+  },
+  {
+    title: '最高出价',
+    align: 'center',
+    dataIndex: 'maxBid',
+    scopedSlots: {
+      customRender: 'maxBid',
+    },
+  },
+  {
+    title: '最高转化出价',
+    align: 'center',
+    dataIndex: 'maxDeepCpaBid',
+    scopedSlots: {
+      customRender: 'maxDeepCpaBid',
+    },
+  },
+  {
+    title: '供应商',
+    align: 'center',
+    dataIndex: 'supplierCode_dictText',
+  },
+  {
+    title: '销售',
+    align: 'center',
+    dataIndex: 'saleId_dictText',
+  },
+  {
+    title: '运营负责人',
+    align: 'center',
+    dataIndex: 'responsibleId_dictText',
+  },
+  {
+    title: '设计负责人',
+    align: 'center',
+    dataIndex: 'designResponsibleId_dictText',
+  },
+  {
+    title: '操作',
+    dataIndex: 'actionProject',
+    align: 'center',
+    scopedSlots: {
+      customRender: 'actionProject',
+    },
+  },
+]
 export default {
   name: 'AdvertiserList',
   mixins: [JeecgListMixin],
@@ -194,7 +257,9 @@ export default {
     JTreeSelect,
     JSelectUserByDep,
     JSelectDepart,
-    JSelectUser
+    JSelectUser,
+    productModal,
+    ProjectModal,
   },
   data() {
     return {
@@ -211,46 +276,26 @@ export default {
       authorizationType: 'kuaishou',
       loginType: 'kuaishou',
       form: this.$form.createForm(this),
-      // 表头
-      columns: [
-        {
-          title: '广告主开户主体名称',
-          align: 'center',
-          dataIndex: 'name'
-        },
-        {
-          title: '行业',
-          align: 'center',
-          dataIndex: 'industryId_dictText'
-        },
-        {
-          title: '联系人姓名',
-          align: 'center',
-          dataIndex: 'contact'
-        },
+      active: 'advertiser',
+      advertiserName: '',
+      advertiserId: '',
+      productName: '',
+      examinelList: [
         {
-          title: '联系人手机',
-          align: 'center',
-          dataIndex: 'mobile'
+          value: '0',
+          tab: '广告主列表',
         },
         {
-          title: '联系人邮箱',
-          align: 'center',
-          dataIndex: 'email'
+          value: '1',
+          tab: '产品列表',
         },
         {
-          title: '销售',
-          align: 'center',
-          dataIndex: 'saleId_dictText'
+          value: '2',
+          tab: '项目列表',
         },
-
-        {
-          title: '操作',
-          dataIndex: 'action',
-          align: 'center',
-          scopedSlots: { customRender: 'action' }
-        }
       ],
+      // 表头
+      columns: advertiserColumns,
       url: {
         list: '/ctop/advertiser/list',
         delete: '/ctop/advertiser/delete',
@@ -261,24 +306,99 @@ export default {
         bindAuthorizationUrl: '/ctop/bindAccountAuth/authorization',
         getLoginInfo: '/ctop/bindAccount/getLoginInfo',
         userId: '/sys/user/generateUserId', // 引入生成添加用户情况下的url
-        userWithDepart: '/sys/user/userDepartList' // 引入为指定用户查看部门信息需要的url
-      }
+        userWithDepart: '/sys/user/userDepartList', // 引入为指定用户查看部门信息需要的url
+      },
     }
   },
   computed: {
-    importExcelUrl: function() {
+    importExcelUrl: function () {
       return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
-    }
+    },
   },
   created() {
-    this.queryParam.userId = this.userInfo().id
+    // this.queryParam.userId = this.userInfo().id
   },
   methods: {
+    handleEditElse(item, type) {
+      if (type == 'product') {
+        this.$refs.modalFormTwo.edit(item)
+        this.$refs.modalFormTwo.title = '编辑'
+        this.$refs.modalFormTwo.disableSubmit = false
+      } else if (type == 'project') {
+        this.$refs.modalFormThree.edit(item)
+        this.$refs.modalFormThree.title = '编辑'
+        this.$refs.modalFormThree.disableSubmit = false
+      }
+    },
+    clear(type) {
+      this.queryParam.advertiserId = null
+      this.advertiserName = ''
+
+      this.queryParam.productId = null
+      this.productName = ''
+      this.loadData(1)
+    },
+    addNew() {
+      if (this.active == 'advertiser') {
+        this.$refs.modalForm.add()
+        this.$refs.modalForm.title = '新增'
+        this.$refs.modalForm.disableSubmit = false
+      } else if (this.active == 'product') {
+        if (this.queryParam.advertiserId) {
+          this.$refs.modalFormTwo.add({ advertiserId: this.queryParam.advertiserId })
+        } else {
+          this.$refs.modalFormTwo.add()
+        }
+        this.$refs.modalFormTwo.title = '新增'
+        this.$refs.modalFormTwo.disableSubmit = false
+      } else if (this.active == 'project') {
+        this.$refs.modalFormThree.add({
+          advertiserId: this.queryParam.advertiserId
+            ? this.queryParam.advertiserId
+            : this.advertiserId
+            ? this.advertiserId
+            : null,
+          productId: this.queryParam.productId,
+        })
+        this.$refs.modalFormThree.title = '新增'
+        this.$refs.modalFormThree.disableSubmit = false
+      }
+    },
+    toProduct(item, key) {
+      if (key == 'product') {
+        this.queryParam.advertiserId = item.id
+        this.advertiserName = item.name
+        this.callbackTwo('product')
+      } else if (key == 'project') {
+        this.queryParam.productId = item.id
+        this.productName = item.productName
+        this.advertiserId = item.advertiserId
+        this.callbackTwo('project')
+      }
+    },
+    callbackTwo(key) {
+      this.active = key
+      if (key == 'advertiser') {
+        this.columns = advertiserColumns
+        this.url.list = '/ctop/advertiser/list'
+        this.url.delete = '/ctop/advertiser/delete'
+      } else if (key == 'product') {
+        this.columns = productColumns
+        this.url.list = '/ctop/product/list'
+        this.url.delete = '/ctop/product/delete'
+      } else if (key == 'project') {
+        this.columns = projectColumns
+        this.url.list = '/ctop/project/list'
+        this.url.delete = '/ctop/project/delete'
+      }
+      this.loadData(1)
+    },
     ...mapGetters(['nickname', 'avatar', 'userInfo']),
     searchRe() {
-      this.queryParam.name = ''
-      this.queryParam.industryId = ''
-      this.loadData()
+      this.queryParam.name = null
+      this.queryParam.advertiserId = null
+      this.queryParam.productId = null
+      this.callbackTwo('advertiser')
     },
     handleSubmit() {
       let params = {}
@@ -290,7 +410,7 @@ export default {
       params.projectName = this.record.projectName
 
       // 触发表单验证
-      this.form.validateFields(err => {
+      this.form.validateFields((err) => {
         if (!err) {
           if (this.mode == 'login') {
             params.accountName = this.accountName
@@ -301,7 +421,7 @@ export default {
             } else if (this.loginType == 'bytedance') {
               params.mediaId = 1
             }
-            postAction(this.url.bindAccountLoginUrl, params).then(res => {
+            postAction(this.url.bindAccountLoginUrl, params).then((res) => {
               if (res.success) {
                 alert('绑定成功')
                 this.accountName = ''
@@ -320,7 +440,7 @@ export default {
             } else if (this.authorizationType == 'bytedance') {
               params.mediaId = 1
             }
-            postAction(this.url.bindAuthorizationUrl, params).then(res => {
+            postAction(this.url.bindAuthorizationUrl, params).then((res) => {
               if (res.success) {
                 window.open(res.message, '_blank')
               } else {
@@ -349,8 +469,8 @@ export default {
 
     handleCancel() {
       this.close()
-    }
-  }
+    },
+  },
 }
 </script>
 <style scoped>

+ 0 - 29
src/views/modules/advertiser/modules/AdvertiserModal.vue

@@ -8,35 +8,6 @@
         <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="广告主开户主体名称">
           <a-input placeholder="请输入广告主开户主体名称" v-decorator="['name', validatorRules.name ]" />
         </a-form-item>
-        <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="行业">
-          <j-tree-select ref="treeSelect" placeholder="请选择行业" v-decorator="['industryId', validatorRules.pid]"
-            dict="sys_category,name,id" pidField="pid" pidValue="f5cb2d2d28417b3b65a6dd744bcb9a76">
-          </j-tree-select>
-        </a-form-item>
-        <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="客户类型">
-          <a-select v-decorator="['advertiserType',{ rules: [{ required: true, message: '请选择客户类型' }] }]" 
-          @change="changeData">
-            <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-form-item>
-        <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="销售"
-          v-if="model.advertiserType==1||model.advertiserType==2">
-          <a-select showSearch optionFilterProp="children" style="width: 100%" :filterOption="filterOption"
-            v-decorator="['saleId', { rules: [{  required: true,message: '请选择销售' }] }]">
-            <a-select-option v-for="appModel in options" :key="appModel.userId + new Date().getTime()"
-              :value="appModel.userId">{{ appModel.realName }}&#12288;&#12288;{{ appModel.roleName }}</a-select-option>
-          </a-select>
-        </a-form-item>
-        <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="代理商"
-          v-if="model.advertiserType==3">
-          <a-select showSearch optionFilterProp="children" style="width: 100%" :filterOption="filterOption"
-            v-decorator="['agentId', { rules: [{  required: true,message: '请选择代理商' }] }]">
-            <a-select-option v-for="appModel in optionsTwo" :key="appModel.id + new Date().getTime()"
-              :value="appModel.id">{{ appModel.name }}</a-select-option>
-          </a-select>
-        </a-form-item>
 
         <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="联系人姓名">
           <a-input placeholder="请输入联系人姓名" v-decorator="['contact', validatorRules.contact ]" />

+ 150 - 80
src/views/modules/advertiser/modules/ProjectModal.vue

@@ -21,49 +21,88 @@
         <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="项目名称">
           <a-input placeholder="请输入项目名称" v-decorator="['projectName', validatorRules.projectName]" />
         </a-form-item>
-         <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="行业">
+        <!-- <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" label="供应商" v-if="model.mediaId=='2'||model.mediaId=='4'">
-           <a-select
+        </a-form-item>-->
+        <a-form-item
+          :labelCol="labelCol"
+          :wrapperCol="wrapperCol"
+          label="供应商"
+          v-if="model.mediaId=='2'||model.mediaId=='4'"
+        >
+          <a-select
             optionFilterProp="children"
             showSearch
             :filterOption="filterOption"
             v-decorator="['supplierCode', validatorRules.supplierCode]"
           >
-            <a-select-option :value="item.supplierCode" v-for="(item, index) of supplierList" :key="index">{{
+            <a-select-option
+              :value="item.supplierCode"
+              v-for="(item, index) of supplierList"
+              :key="index"
+            >
+              {{
               item.supplierName
-            }}</a-select-option>
+              }}
+            </a-select-option>
           </a-select>
         </a-form-item>
-        
+
         <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="广告主名称">
           <a-select
             @change="handleChange"
-            labelInValue
             optionFilterProp="children"
             showSearch
             :filterOption="filterOption"
             v-decorator="['advertiserId', validatorRules.advertiserId]"
           >
-            <a-select-option :value="item.id" v-for="(item, index) of list" :key="index">{{
+            <a-select-option :value="item.id" v-for="(item, index) of list" :key="index">
+              {{
               item.name
-            }}</a-select-option>
+              }}
+            </a-select-option>
+          </a-select>
+        </a-form-item>
+        <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="产品名称">
+          <a-select
+            optionFilterProp="children"
+            showSearch
+            :filterOption="filterOption"
+            v-decorator="['productId', validatorRules.productId]"
+            :disabled="getFormFieldValue('advertiserId')==''||getFormFieldValue('advertiserId')==null"
+          >
+            <a-select-option :value="item.id" v-for="(item, index) of listProduct" :key="index">
+              {{
+              item.productName
+              }}
+            </a-select-option>
           </a-select>
         </a-form-item>
         <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="最高出价">
-          <a-input placeholder="请输入最高出价" v-decorator="['maxBid', validatorRules.maxBid]" addonAfter="元" />
+          <a-input
+            placeholder="请输入最高出价"
+            v-decorator="['maxBid', validatorRules.maxBid]"
+            addonAfter="元"
+          />
         </a-form-item>
         <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="最高转化出价">
           <a-input placeholder="最高转化出价" v-decorator="['maxDeepCpaBid']" addonAfter="元" />
         </a-form-item>
         <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="销售">
-          <a-select showSearch optionFilterProp="children" style="width: 100%" :filterOption="filterOption"
-            v-decorator="['saleId', { rules: [{  required: true,message: '请选择销售' }] }]">
-            <a-select-option v-for="appModel in optionsElse" :key="appModel.userId + new Date().getTime()"
-              :value="appModel.userId">{{ appModel.realName }}&#12288;&#12288;{{ appModel.roleName }}</a-select-option>
+          <a-select
+            showSearch
+            optionFilterProp="children"
+            style="width: 100%"
+            :filterOption="filterOption"
+            v-decorator="['saleId', { rules: [{  required: true,message: '请选择销售' }] }]"
+          >
+            <a-select-option
+              v-for="appModel in optionsElse"
+              :key="appModel.userId + new Date().getTime()"
+              :value="appModel.userId"
+            >{{ appModel.realName }}&#12288;&#12288;{{ appModel.roleName }}</a-select-option>
           </a-select>
         </a-form-item>
         <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="运营负责人">
@@ -73,7 +112,6 @@
             style="width: 100%"
             @focus="handleFocus"
             @blur="handleBlur"
-            @change="handleChange"
             :filterOption="filterOption"
             v-decorator="['responsibleId', { rules: [{ required: true, message: '请选择运营负责人' }] }]"
           >
@@ -81,8 +119,7 @@
               v-for="appModel in options"
               :key="appModel.userId + new Date().getTime()"
               :value="appModel.userId"
-              >{{ appModel.realName }}&#12288;&#12288;{{ appModel.roleName }}</a-select-option
-            >
+            >{{ appModel.realName }}&#12288;&#12288;{{ appModel.roleName }}</a-select-option>
           </a-select>
         </a-form-item>
         <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="设计负责人">
@@ -92,7 +129,6 @@
             style="width: 100%"
             @focus="handleFocus"
             @blur="handleBlur"
-            @change="handleChange"
             :filterOption="filterOption"
             v-decorator="['designResponsibleId', { rules: [{ required: true, message: '请选择运营负责人' }] }]"
           >
@@ -100,8 +136,7 @@
               v-for="appModel in options"
               :key="appModel.userId + new Date().getTime()"
               :value="appModel.userId"
-              >{{ appModel.realName }}&#12288;&#12288;{{ appModel.roleName }}</a-select-option
-            >
+            >{{ appModel.realName }}&#12288;&#12288;{{ appModel.roleName }}</a-select-option>
           </a-select>
         </a-form-item>
       </a-form>
@@ -122,7 +157,7 @@ export default {
   components: {
     JSelectUserByDep,
     JSelectDepart,
-    JTreeSelect
+    JTreeSelect,
   },
   data() {
     return {
@@ -131,38 +166,41 @@ export default {
       model: {},
       labelCol: {
         xs: { span: 24 },
-        sm: { span: 5 }
+        sm: { span: 5 },
       },
       wrapperCol: {
         xs: { span: 24 },
-        sm: { span: 16 }
+        sm: { span: 16 },
       },
-      industryId:'',
+      industryId: '',
       confirmLoading: false,
       form: this.$form.createForm(this),
       validatorRules: {
         projectName: { rules: [{ required: true, message: '请输入项目名称!' }] },
         industryId: { rules: [{ required: true, message: '请选择行业!' }] },
         advertiserId: { rules: [{ required: true, message: '请选择广告主!' }] },
-        supplierCode:{ rules: [{ required: true, message: '请选择供应商!' }],initialValue:'kuaishou_001'},
+        productId: { rules: [{ required: true, message: '请选择产品!' }] },
+        supplierCode: { rules: [{ required: true, message: '请选择供应商!' }], initialValue: 'kuaishou_001' },
         responsibleName: { rules: [{ required: true, message: '请选择负责人!' }] },
         maxBid: { rules: [{ required: true, message: '请输入最高出价!' }, { validator: this.validateInputCode }] },
       },
       url: {
         add: '/ctop/project/add',
         edit: '/ctop/project/edit',
-        getList: '/ctop/advertiser/list'
+        getList: '/ctop/advertiser/list',
       },
       list: [],
+      listProduct: [],
       resId: '',
       shejiId: '',
       options: [],
-      optionsElse:[],
-      supplierList:[]
+      optionsElse: [],
+      supplierList: [],
+      editAll: false,
     }
   },
   created() {
-      this.getSupplierList()
+    this.getSupplierList()
   },
   methods: {
     validateInputCode(rule, value, callback) {
@@ -176,9 +214,13 @@ export default {
     onChange(e) {
       console.log(`checked = ${e.target.value}`)
     },
-    handleChange() {},
     handleChange(value) {
-      console.log(`selected ${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')
@@ -191,47 +233,52 @@ export default {
     },
     getList() {
       var params = {}
-      params.userId = this.userInfo().id
+      // params.userId = this.userInfo().id
+      params.pageSize = 1000
+      params.pageNo = 1
       console.log(params)
-      getAction(this.url.getList, { userId: this.userInfo().id })
-        .then(res => {
+      getAction(this.url.getList,params)
+        .then((res) => {
           if (res.success) {
             console.log(res)
             this.list = res.result.records
-            
           } else {
             this.$message.warning(res.message)
           }
         })
         .finally(() => {})
     },
-    getSupplierList(){
-        var params = {}
-        getAction('/ctop/supplierList/list').then(res=>{
-            if(res.success){
-                this.supplierList = res.result.records
-            } else {
-                this.$message.warning(res.message)
-            }
-        })
+    getSupplierList() {
+      var params = {}
+      getAction('/ctop/supplierList/list').then((res) => {
+        if (res.success) {
+          this.supplierList = res.result.records
+        } else {
+          this.$message.warning(res.message)
+        }
+      })
     },
-    add() {
+    add(item) {
+      this.editAll = false
       this.edit({
         responsibleId: this.userInfo().id, //用户Id
-        mediaId: '2'
+        mediaId: '2',
+        ...item,
       })
     },
     edit(record) {
       this.getSupplierList()
       this.getList()
-      
-      var params = { ...record }
-      if (params.advertiserId) {
-        params.advertiserId = { key: params.advertiserId, label: params.advertiserName }
+      if (record.advertiserId) {
+        this.editAll = true
+        getAction('/ctop/product/list', { advertiserId: record.advertiserId, pageSize: 1000 }).then((res) => {
+          if (res.success) {
+            this.listProduct = res.result.records
+          }
+        })
       }
-    //   if (params.industryId) {
-    //     params.industryId = { key: params.industryId, label: params.industryId_dictText }
-    //   }
+      var params = { ...record }
+
       console.log(record)
       this.form.resetFields()
       this.model = Object.assign({}, params)
@@ -240,33 +287,56 @@ export default {
       this.visible = true
       this.$nextTick(() => {
         console.log(this.model)
-        this.form.setFieldsValue(
-          pick(
-            this.model,
-            'projectName',
-            'industryId',
-            'advertiserId',
-            'responsibleName',
-            'maxBid',
-            'maxDeepCpaBid',
-            'userId',
-            'designResponsibleId',
-            'responsibleId',
-            'industryCode',
-            'supplierCode',
-            // 'advertiserType',
-            'saleId'
+        if (record.advertiserId) {
+          this.form.setFieldsValue(
+            pick(
+              this.model,
+              'projectName',
+              'industryId',
+              'advertiserId',
+              'productId',
+              'responsibleName',
+              'maxBid',
+              'maxDeepCpaBid',
+              'userId',
+              'designResponsibleId',
+              'responsibleId',
+              'industryCode',
+              'supplierCode',
+              // 'advertiserType',
+              'saleId'
+            )
+          )
+        } else {
+          this.form.setFieldsValue(
+            pick(
+              this.model,
+              'projectName',
+              'industryId',
+              'advertiserId',
+              'responsibleName',
+              'maxBid',
+              'maxDeepCpaBid',
+              'userId',
+              'designResponsibleId',
+              'responsibleId',
+              'industryCode',
+              'supplierCode',
+              // 'advertiserType',
+              'saleId'
+            )
           )
-        )
+        }
+
         // this.resId = record.responsibleId
         // this.shejiId = record.designResponsibleId
-        getAction('/sys/user/getAllUserListV1', '').then(res => {
+        getAction('/sys/user/getAllUserListV1', '').then((res) => {
           console.log(res)
           if (res.success) {
             this.options = res.result
           }
         })
-         getAction('/sys/user/getAllSaleList', '').then(res => {
+        getAction('/sys/user/getAllSaleList', '').then((res) => {
           console.log(res)
           if (res.success) {
             this.optionsElse = res.result
@@ -296,17 +366,17 @@ export default {
           }
           var data = values.advertiserId
           let formData = Object.assign(this.model, values)
-        //   if(this.model.mediaId)
+          //   if(this.model.mediaId)
           formData.maxBid = formData.maxBid * 1000
-          formData.maxDeepCpaBid = formData.maxDeepCpaBid*1000
+          formData.maxDeepCpaBid = formData.maxDeepCpaBid * 1000
           //时间格式化
-          formData.advertiserId = data.key
-          formData.advertiserName = data.label
+          // formData.advertiserId = data.key
+          // formData.advertiserName = data.label
           formData.responsibleId = values.responsibleId
           formData.designResponsibleId = values.designResponsibleId
           formData.userId = formData.userId ? formData.userId : that.userInfo().id
           httpAction(httpurl, formData, method)
-            .then(res => {
+            .then((res) => {
               if (res.success) {
                 that.$message.success(res.message)
                 that.$emit('ok')
@@ -330,8 +400,8 @@ export default {
     get(valueName, key) {
       console.log(valueName, key)
       this.resId = key
-    }
-  }
+    },
+  },
 }
 </script>
 

+ 19 - 76
src/views/modules/advertiser/modules/productModal.vue

@@ -3,17 +3,9 @@
     @cancel="handleCancel" cancelText="关闭">
     <a-spin :spinning="confirmLoading">
       <a-form :form="form">
-        <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="媒体类型">
-          <a-radio-group @change="onChange" v-model="model.mediaId">
-            <a-radio-button value="1">头条</a-radio-button>
-            <a-radio-button value="2">快手</a-radio-button>
-            <!-- <a-radio-button value="3">头条内广</a-radio-button>
-            <a-radio-button value="4">快手内广</a-radio-button> -->
-          </a-radio-group>
-        </a-form-item>
         <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="广告主名称">
-          <a-select @change="handleChangeAd" labelInValue optionFilterProp="children" showSearch
-            :filterOption="filterOption" v-decorator="['advertiserId', validatorRules.advertiserId]" :disabled="addDis">
+          <a-select optionFilterProp="children" showSearch
+            :filterOption="filterOption" v-decorator="['advertiserId', validatorRules.advertiserId]">
             <a-select-option :value="item.id" v-for="(item, index) of list" :key="index">{{
               item.name
             }}</a-select-option>
@@ -23,29 +15,10 @@
           <a-input placeholder="请输入产品名称" v-decorator.trim="['productName', validatorRules.projectName]"
             @keyup="form.setFieldsValue({'productName':getFormFieldValue('productName')?getFormFieldValue('productName').replace(/\s+/g,''):''})" />
         </a-form-item>
-        <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="项目列表">
-          <a-select optionFilterProp="children" showSearch :filterOption="filterOption" mode="multiple"
-            v-decorator="['projectIds', validatorRules.supplierCode]" @blur="getPerson" :disabled="addDis">
-            <a-select-option :value="item.id" v-for="(item, index) of supplierList" :key="index">
-              {{
-              item.projectName
-            }}({{
-              item.mediaId=='1'?'头条':'快手'
-            }})
-
-            </a-select-option>
-          </a-select>
-        </a-form-item>
-        <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="运营"
-          v-if="getFormFieldValue('projectIds')&&getFormFieldValue('projectIds').length>0&&optionsElse.length>0">
-
-          <span v-for="(item,index) in optionsElse" :key="index">
-            {{item.userName?item.userName:item.realname}}{{index==(optionsElse.length-1)?'':','}}</span>
-        </a-form-item>
-        <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="销售"
-          v-if="getFormFieldValue('projectIds')&&getFormFieldValue('projectIds').length>0&&options.length>0">
-          <span v-for="(item,index) in options"
-            :key="index">{{item.saleName}}{{index==(options.length-1)?'':','}}</span>
+        <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="行业">
+          <j-tree-select ref="treeSelect" placeholder="请选择行业" v-decorator="['industryId', validatorRules.pid]"
+            dict="sys_category,name,id" pidField="pid" pidValue="f5cb2d2d28417b3b65a6dd744bcb9a76">
+          </j-tree-select>
         </a-form-item>
       </a-form>
     </a-spin>
@@ -138,9 +111,9 @@
           },
         },
         url: {
-          add: '/ctop/product/insertOrUpdateProduct',
-          edit: '/ctop/product/insertOrUpdateProduct',
-          getList: '/ctop/product/advertiserList'
+          add: '/ctop/product/add',
+          edit: '/ctop/product/edit',
+          getList: '/ctop/advertiser/list'
 
         },
         list: [],
@@ -168,19 +141,6 @@
         console.log(`checked = ${e.target.value}`)
       },
       handleChange() {},
-      handleChangeAd(value) {
-        console.log(value)
-        this.form.setFieldsValue({
-          'projectIds': []
-        })
-        postAction('/ctop/product/getProjectListByAdvertiserId', {
-          "advertiserId": value.key
-        }).then(res => {
-          if (res.success) {
-            this.supplierList = res.result
-          }
-        })
-      },
       getPerson() {
         if (this.getFormFieldValue('projectIds')) {
           postAction('/ctop/product/getSaleAndYunyingListByProjectIds', {
@@ -205,13 +165,15 @@
       },
       getList() {
         var params = {}
-        params.userId = this.userInfo().id
+        // params.userId = this.userInfo().id
+        params.pageSize = 1000
+        params.pageNo = 1
         console.log(params)
-        getAction(this.url.getList)
+        getAction(this.url.getList,params)
           .then(res => {
             if (res.success) {
               console.log(res)
-              this.list = res.result
+              this.list = res.result.records
 
             } else {
               this.$message.warning(res.message)
@@ -229,11 +191,9 @@
           }
         })
       },
-      add() {
+      add(item) {
         this.addDis = false
-        this.edit({
-          mediaId: '2'
-        })
+        this.edit(item)
       },
       edit(record) {
         // this.getSupplierList()
@@ -242,23 +202,6 @@
         var params = {
           ...record
         }
-        if (params.advertiserId) {
-          this.addDis = true
-          this.options = params.saleList
-          this.optionsElse = params.yunyingList
-          params.advertiserId = {
-            key: params.advertiserId,
-            label: params.advertiserName
-          }
-          postAction('/ctop/product/getProjectListByAdvertiserId', {
-            "advertiserId": params.advertiserId.key
-          }).then(res => {
-            if (res.success) {
-              this.supplierList = res.result
-            }
-          })
-
-        }
         //   if (params.industryId) {
         //     params.industryId = { key: params.industryId, label: params.industryId_dictText }
         //   }
@@ -273,7 +216,7 @@
               this.model,
               'productName',
               'advertiserId',
-              'projectIds'
+              'industryId'
             )
           )
           // this.resId = record.responsibleId
@@ -317,8 +260,8 @@
 
             //   if(this.model.mediaId)
             //时间格式化
-            formData.advertiserId = data.key
-            formData.advertiserName = data.label
+            // formData.advertiserId = data.key
+            formData.userId = this.userInfo().id
             if (formData.id) {
               formData.productId = formData.id
             }

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

@@ -1004,8 +1004,10 @@
         params.channelType = this.channelType
         params.status = 0
         if (this.time.length > 0) {
-          params.startDate = moment(this.time[0]).format('YYYY-MM-DD')
-          params.endDate = moment(this.time[1]).format('YYYY-MM-DD')
+          // params.startDate = moment(this.time[0]).format('YYYY-MM-DD')
+          // params.endDate = moment(this.time[1]).format('YYYY-MM-DD')
+          params.startDate = moment(this.time[0]).format('YYYY-MM-DD')+" 00:00:00"
+          params.endDate = moment(this.time[1]).format('YYYY-MM-DD')+" 23:59:59"
         }
         this.showVideoList('/kuaishou/batch/getVideoList', params)
       },
@@ -1219,8 +1221,10 @@
             params.status = 0
             params.channelType = this.channelType
             if (this.time.length > 0) {
-              params.startDate = moment(this.time[0]).format('YYYY-MM-DD')
-              params.endDate = moment(this.time[1]).format('YYYY-MM-DD')
+              // params.startDate = moment(this.time[0]).format('YYYY-MM-DD')
+              // params.endDate = moment(this.time[1]).format('YYYY-MM-DD')
+              params.startDate = moment(this.time[0]).format('YYYY-MM-DD')+" 00:00:00"
+              params.endDate = moment(this.time[1]).format('YYYY-MM-DD')+" 23:59:59"
             }
             this.showVideoList('/kuaishou/batch/getVideoList', params)
           } else {
@@ -1680,8 +1684,8 @@
           params.pageNo = 1
           params.status = 0
           params.channelType = this.channelType
-          params.startDate = moment(n[0]).format('YYYY-MM-DD')
-          params.endDate = moment(n[1]).format('YYYY-MM-DD')
+          params.startDate = moment(n[0]).format('YYYY-MM-DD')+" 00:00:00"
+          params.endDate = moment(n[1]).format('YYYY-MM-DD')+" 23:59:59"
           this.showVideoList('/kuaishou/batch/getVideoList', params)
         } else {
           var params = {}

+ 169 - 112
src/views/modules/kuaishouapp/account/stepForm/stepModule/newModulePop.vue

@@ -93,7 +93,10 @@ li:hover {
               getCheckboxProps: getCheckboxProps
             }"
           >
-            <span slot="orientationName" slot-scope="text, record">{{ text }}({{ record.orientationId }})</span>
+            <span
+              slot="orientationName"
+              slot-scope="text, record"
+            >{{ text }}({{ record.orientationId }})</span>
             <span slot="populationType" slot-scope="text">{{ text | population_type }}</span>
             <span slot="putTime" slot-scope="text">{{ text | getDate }}</span>
           </a-table>
@@ -131,7 +134,10 @@ li:hover {
               getCheckboxProps: getCheckboxPropsNo
             }"
           >
-            <span slot="orientationName" slot-scope="text, record">{{ text }}({{ record.orientationId }})</span>
+            <span
+              slot="orientationName"
+              slot-scope="text, record"
+            >{{ text }}({{ record.orientationId }})</span>
             <span slot="populationType" slot-scope="text">{{ text | population_type }}</span>
             <span slot="putTime" slot-scope="text">{{ text | getDate }}</span>
           </a-table>
@@ -166,9 +172,11 @@ li:hover {
         <a-radio-button value="ageCustom">自定义年龄段</a-radio-button>
       </a-radio-group>
       <div v-if="allForm.ageType == 'ageLimit'">
-        <a-checkbox-group v-decorator="['agesRange', { rules: [{ required: true, message: '请选择年龄段' }] }]">
+        <a-checkbox-group
+          v-decorator="['agesRange', { rules: [{ required: true, message: '请选择年龄段' }] }]"
+        >
           <!-- <a-checkbox :value="0">0-11岁</a-checkbox>
-          <a-checkbox :value="12">12-17岁</a-checkbox> -->
+          <a-checkbox :value="12">12-17岁</a-checkbox>-->
           <a-checkbox :value="18">18-23岁</a-checkbox>
           <a-checkbox :value="24">24-30岁</a-checkbox>
           <a-checkbox :value="31">31-40岁</a-checkbox>
@@ -349,9 +357,11 @@ li:hover {
         :filterOption="filterOption"
         v-decorator="['appInterest', { rules: [{ required: true, message: '请选择APP行为' }] }]"
       >
-        <a-select-option v-for="item in optionsAppActive" :key="item.tagId" :value="item.tagId">{{
+        <a-select-option v-for="item in optionsAppActive" :key="item.tagId" :value="item.tagId">
+          {{
           item.tagName
-        }}</a-select-option>
+          }}
+        </a-select-option>
       </a-select>
     </a-form-item>
     <a-form-item
@@ -379,22 +389,30 @@ li:hover {
                 @change="onCheckAllChange"
                 :indeterminate="indeterminate"
                 :checked="checkAll"
-              ></a-checkbox
-              >全选
+              ></a-checkbox>全选
             </li>
-            <a-checkbox-group @change="onChange" v-model="checkArr" class="home-card" style="width:100%">
+            <a-checkbox-group v-model="checkArr" @change="onChange" class="home-card" style="width:100%">
               <li style="padding:0 10px;width:100%;" v-for="item of optionsApp" :key="item.appId">
-                <a-checkbox :value="item.appId" style="float:left;margin:0 5px"></a-checkbox>{{ item.appName }}
+                <a-checkbox
+                  :value="item.appId"
+                  style="float:left;margin:0 5px"
+                  
+                ></a-checkbox>
+                {{ item.appName }}
               </li>
             </a-checkbox-group>
           </ul>
         </div>
-        <div style="width:100%" v-if="checkArr.length > 0">
+
+        <div style="width:100%" v-if="optionsAll.length > 0">
           <a-button @click="clearAll">清空</a-button>
           <br />
-          <a-tag v-for="item of checkArr" :key="item" closable :afterClose="() => log(item)">
-            {{ showAppName(item) }}
-          </a-tag>
+          <a-tag
+            v-for="item of optionsAll"
+            :key="item"
+            closable
+            :afterClose="() => log(item)"
+          >{{ showAppName(item) }}</a-tag>
         </div>
       </div>
     </a-form-item>
@@ -403,13 +421,19 @@ li:hover {
       :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
       :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
     >
-      <a-radio-group buttonStyle="solid" @change="businessInterest" v-model="allForm.businessInterestType">
+      <a-radio-group
+        buttonStyle="solid"
+        @change="businessInterest"
+        v-model="allForm.businessInterestType"
+      >
         <a-radio-button :value="0">不限</a-radio-button>
         <a-radio-button :value="1">智能推荐</a-radio-button>
         <a-radio-button :value="2">兴趣标签</a-radio-button>
       </a-radio-group>
-      <br>
-      <span v-if="allForm.businessInterestType==1">商业兴趣定向会根据您的投放计划,智能精选出最匹配人群,帮助您获取更满足投放意图的人群,以达到最好的投放效果。</span>
+      <br />
+      <span
+        v-if="allForm.businessInterestType==1"
+      >商业兴趣定向会根据您的投放计划,智能精选出最匹配人群,帮助您获取更满足投放意图的人群,以达到最好的投放效果。</span>
     </a-form-item>
     <a-form-item
       label=" "
@@ -426,9 +450,11 @@ li:hover {
         :filterOption="filterOption"
         v-decorator="['businessInterest', { rules: [{ required: true, message: '请选择商业兴趣' }] }]"
       >
-        <a-select-option v-for="item in businessOptions" :key="item.tagId" :value="item.tagId">{{
+        <a-select-option v-for="item in businessOptions" :key="item.tagId" :value="item.tagId">
+          {{
           item.tagName
-        }}</a-select-option>
+          }}
+        </a-select-option>
       </a-select>
     </a-form-item>
     <a-form-item
@@ -476,9 +502,11 @@ li:hover {
         :filterOption="filterOption"
         v-decorator="['fansStar', { rules: [{ required: true, message: '请选择网红类别' }] }]"
       >
-        <a-select-option v-for="item in fansStarOptions" :key="item.tagId" :value="item.tagId">{{
+        <a-select-option v-for="item in fansStarOptions" :key="item.tagId" :value="item.tagId">
+          {{
           item.tagName
-        }}</a-select-option>
+          }}
+        </a-select-option>
       </a-select>
     </a-form-item>
 
@@ -508,9 +536,11 @@ li:hover {
         :filterOption="filterOption"
         v-decorator="['interestVideo', { rules: [{ required: true, message: '请选择视频标签' }] }]"
       >
-        <a-select-option v-for="item in interestVideoOptions" :key="item.tagId" :value="item.tagId">{{
+        <a-select-option v-for="item in interestVideoOptions" :key="item.tagId" :value="item.tagId">
+          {{
           item.tagName
-        }}</a-select-option>
+          }}
+        </a-select-option>
       </a-select>
     </a-form-item>
 
@@ -524,7 +554,7 @@ li:hover {
           {
             initialValue: '0'
           }
-        ]" -->
+      ]"-->
       <a-radio-group buttonStyle="solid" v-model="allForm.isOpen">
         <a-radio-button :value="0">关闭</a-radio-button>
         <a-radio-button :value="1">开启</a-radio-button>
@@ -537,15 +567,21 @@ li:hover {
       class="else-label"
       v-if="allForm.isOpen == 1"
     >
-      <a-checkbox :disabled="allForm.ageType == 'noLimit'" :checked="allForm.noAgeBreak" @change="getAge"
-        >不可突破年龄</a-checkbox
-      >
-      <a-checkbox :disabled="getData('gender') == '0'" :checked="allForm.noGenderBreak" @change="getGender"
-        >不可突破性别</a-checkbox
-      >
-      <a-checkbox :disabled="allForm.regionType != 'limit'||allForm.region.length==0" :checked="allForm.noAreaBreak" @change="getArea"
-        >不可突破地域</a-checkbox
-      >
+      <a-checkbox
+        :disabled="allForm.ageType == 'noLimit'"
+        :checked="allForm.noAgeBreak"
+        @change="getAge"
+      >不可突破年龄</a-checkbox>
+      <a-checkbox
+        :disabled="getData('gender') == '0'"
+        :checked="allForm.noGenderBreak"
+        @change="getGender"
+      >不可突破性别</a-checkbox>
+      <a-checkbox
+        :disabled="allForm.regionType != 'limit'||allForm.region.length==0"
+        :checked="allForm.noAreaBreak"
+        @change="getArea"
+      >不可突破地域</a-checkbox>
     </a-form-item>
   </a-form>
 </template>
@@ -582,7 +618,7 @@ const clickoutside = {
     // 解除事件监听
     document.removeEventListener('click', el.__vueClickOutside__)
     delete el.__vueClickOutside__
-  }
+  },
 }
 
 const columns = [
@@ -590,7 +626,7 @@ const columns = [
     title: '人群',
     dataIndex: 'orientationName',
     scopedSlots: { customRender: 'orientationName' },
-    width: 150
+    width: 150,
   },
   {
     title: '属性',
@@ -612,22 +648,18 @@ const columns = [
       { text: '固化标签', value: '14' },
       { text: '行业偏好', value: '15' },
       { text: '第三方标签', value: '16' },
-      { text: '产品关键词', value: '17' }
+      { text: '产品关键词', value: '17' },
     ],
-    onFilter: (value, record) =>
-      record.populationType
-        .toString()
-        .toLowerCase()
-        .includes(value.toLowerCase()),
+    onFilter: (value, record) => record.populationType.toString().toLowerCase().includes(value.toLowerCase()),
     scopedSlots: { customRender: 'populationType' },
-    width: 150
+    width: 150,
   },
   {
     title: '创建时间',
     dataIndex: 'putTime',
     scopedSlots: { customRender: 'putTime' },
-    sorter: (a, b) => a.putTime - b.putTime
-  }
+    sorter: (a, b) => a.putTime - b.putTime,
+  },
 ]
 
 export default {
@@ -638,14 +670,14 @@ export default {
       type: String,
       default() {
         return null
-      }
+      },
     },
     platform: {
       default() {
         return null
-      }
+      },
     },
-    populationData: {}
+    populationData: {},
   },
   filters: {
     getDate(value) {
@@ -662,7 +694,7 @@ export default {
         1: 'Android应用下载',
         2: 'Android网页游戏',
         3: 'iOS应用下载',
-        4: 'iOS网页游戏'
+        4: 'iOS网页游戏',
       }
       return data[str]
     },
@@ -684,10 +716,10 @@ export default {
         14: '固化标签',
         15: '行业偏好',
         16: '第三方标签',
-        17: '产品关键词'
+        17: '产品关键词',
       }
       return data[str]
-    }
+    },
   },
   watch: {
     platform(n, o) {
@@ -716,7 +748,7 @@ export default {
 
           this.targeted = n.excludePopulation ? (n.population ? '4' : '3') : '2'
           this.people = n.excludePopulation ? '3' : n.population ? '3' : '2'
-          this.getPeople().then(res => {
+          this.getPeople().then((res) => {
             if (n.excludePopulation) {
               this.keyValueNo = ''
               this.selectedRowKeysValueNo = []
@@ -726,7 +758,7 @@ export default {
                     this.keyValueNo += res[i].orientationName + '   '
                     this.selectedRowKeysValueNo.push({
                       orientationId: res[i].orientationId,
-                      orientationName: res[i].orientationName
+                      orientationName: res[i].orientationName,
                     })
                     this.selectedRowKeysNo.push()
                   }
@@ -742,7 +774,7 @@ export default {
                     this.keyValue += res[i].orientationName + '   '
                     this.selectedRowKeysValue.push({
                       orientationId: res[i].orientationId,
-                      orientationName: res[i].orientationName
+                      orientationName: res[i].orientationName,
                     })
                   }
                 }
@@ -763,7 +795,7 @@ export default {
                 'iosOsv',
                 'deviceBrand',
                 'devicePrice',
-                'businessInterest'
+                'businessInterest',
               ])
             )
           })
@@ -790,11 +822,28 @@ export default {
             isOpen: 0,
             noAgeBreak: false,
             noGenderBreak: false,
-            noAreaBreak: false
+            noAreaBreak: false,
+          }
+        }
+      },
+    },
+    checkArr(n, o) {
+      console.log(n, o)
+      this.optionsAll.push(...n)
+      this.optionsAll = [...new Set(this.optionsAll)]
+      if (n.length != o.length) {
+        if (n.length < o.length) {
+          var a = new Set(n)
+          var b = new Set(o)
+          var c = new Set([...b].filter((item) => !a.has(item))) // {1}
+          console.log(...c)
+          var d = this.optionsAll.indexOf(...c)
+          if (d > 0) {
+            this.optionsAll.splice(d, 1)
           }
         }
       }
-    }
+    },
   },
   directives: { clickoutside },
   data() {
@@ -811,7 +860,7 @@ export default {
         40: '40岁',
         45: '45岁',
         50: '50岁',
-        55: '55岁'
+        55: '55岁',
       },
       step: 0,
       loading: false,
@@ -838,19 +887,20 @@ export default {
         topMiddle: false,
         topMiddleNo: false,
         keyValue: '',
-        keyValueNo: ''
+        keyValueNo: '',
       },
       options: [],
-      optionsAll: [],
       optionProps: {
         value: 'regionId',
         label: 'name',
         children: 'children',
         multiple: true,
-        emitPath: false
+        emitPath: false,
         // checkStrictly: true
       },
+      optionsAll: [],
       optionsApp: [],
+      checkElse: [],
       optionsAppActive: [],
       checkOptions: [],
       businessOptions: [],
@@ -861,7 +911,7 @@ export default {
         label: 'tagName',
         children: 'children',
         multiple: true,
-        emitPath: false
+        emitPath: false,
       },
       getApp: '0',
       closeDialog: false,
@@ -878,26 +928,28 @@ export default {
       selectedRowKeysValue: [],
       selectedRowKeysNo: [],
       selectedRowKeysValueNo: [],
-      dataList: []
+      dataList: [],
     }
   },
   computed: {},
   methods: {
     getPeople() {
       return new Promise((resolve, reject) => {
-        getAction('/kuaishou/batch/getPopulationList', { accountId: localStorage.getItem('accountIdNewMoudle') }).then(res => {
-          if (res.success) {
-            if (res.result) {
-              this.dataList = res.result.map((item, index) => {
-                return {
-                  ...item,
-                  key: index
-                }
-              })
-              resolve(res.result)
+        getAction('/kuaishou/batch/getPopulationList', { accountId: localStorage.getItem('accountIdNewMoudle') }).then(
+          (res) => {
+            if (res.success) {
+              if (res.result) {
+                this.dataList = res.result.map((item, index) => {
+                  return {
+                    ...item,
+                    key: index,
+                  }
+                })
+                resolve(res.result)
+              }
             }
           }
-        })
+        )
       })
     },
     radioChange() {
@@ -910,28 +962,28 @@ export default {
     },
     onSelectChange(selectedRowKeys, selectionRows) {
       this.selectedRowKeys = selectedRowKeys
-      this.selectedRowKeysValue = selectionRows.map(item => {
+      this.selectedRowKeysValue = selectionRows.map((item) => {
         return { orientationId: item.orientationId, orientationName: item.orientationName }
       })
     },
     getCheckboxProps(record) {
       return {
         props: {
-          disabled: this.selectedRowKeysValueNo.some(item => item.orientationId === record.orientationId)
-        }
+          disabled: this.selectedRowKeysValueNo.some((item) => item.orientationId === record.orientationId),
+        },
       }
     },
     onSelectChangeNo(selectedRowKeys, selectionRows) {
       this.selectedRowKeysNo = selectedRowKeys
-      this.selectedRowKeysValueNo = selectionRows.map(item => {
+      this.selectedRowKeysValueNo = selectionRows.map((item) => {
         return { orientationId: item.orientationId, orientationName: item.orientationName }
       })
     },
     getCheckboxPropsNo(record) {
       return {
         props: {
-          disabled: this.selectedRowKeysValue.some(item => item.orientationId === record.orientationId)
-        }
+          disabled: this.selectedRowKeysValue.some((item) => item.orientationId === record.orientationId),
+        },
       }
     },
     okSelect() {
@@ -973,15 +1025,15 @@ export default {
       }
     },
     showAppName(appId) {
-      var data = this.checkOptions.filter(item => {
+      var data = this.checkOptions.filter((item) => {
         return item.appId == appId
       })
       return data[0].appName
     },
     log(appId) {
-      var index = this.checkArr.findIndex(item => item === appId)
-      this.checkArr.splice(index, 1)
-      if (this.checkArr.length == 0) {
+      var index = this.optionsAll.findIndex((item) => item === appId)
+      this.optionsAll.splice(index, 1)
+      if (this.optionsAll.length == 0) {
         this.indeterminate = false
         this.checkAll = false
       }
@@ -991,33 +1043,39 @@ export default {
     },
     clearAll() {
       this.checkArr = []
+      this.optionsAll = []
       this.indeterminate = false
       this.checkAll = false
     },
     onChange(checkedList) {
+      console.log(checkedList, this.checkArr)
       this.indeterminate =
         !!checkedList.length &&
         checkedList.length <
-          this.optionsApp.map(item => {
+          this.optionsApp.map((item) => {
             return item.appId
           }).length
       this.checkAll =
         checkedList.length ===
-        this.optionsApp.map(item => {
+        this.optionsApp.map((item) => {
           return item.appId
         }).length
+
+      // if (this.checkArr.indexOf(checkedList) > 0) {
+      //   var index = this.optionsAll.indexOf(checkedList)
+      // }
     },
     onCheckAllChange(e) {
       Object.assign(this, {
         checkArr: e.target.checked
-          ? this.optionsApp.map(item => {
+          ? this.optionsApp.map((item) => {
               return item.appId
             })
           : [],
         indeterminate: false,
-        checkAll: e.target.checked
+        checkAll: e.target.checked,
       })
-      if (this.checkArr.length > 20) {
+      if (this.optionsAll.length > 20) {
         this.$message.error('最多选择20个APP行为')
         this.checkArr = []
         this.indeterminate = false
@@ -1039,35 +1097,35 @@ export default {
           //   this.checkArr
           var json = {}
           if (this.allForm.appType == '2') {
-            json.appIds = this.checkArr
+            json.appIds = this.optionsAll
           }
           if (this.allForm.regionType == 'limit') {
-            json.region = this.allForm.region.map(item => {
+            json.region = this.allForm.region.map((item) => {
               return item.value
             })
           }
           var jsonData = {}
-          if(this.people == '3'){
+          if (this.people == '3') {
             if (this.targeted == '2') {
-                jsonData.population = this.selectedRowKeysValue.map(item => {
+              jsonData.population = this.selectedRowKeysValue.map((item) => {
                 return item.orientationId
-                })
+              })
             } else if (this.targeted == '3') {
-                jsonData.excludePopulation = this.selectedRowKeysValueNo.map(item => {
+              jsonData.excludePopulation = this.selectedRowKeysValueNo.map((item) => {
                 return item.orientationId
-                })
+              })
             } else if (this.targeted == '4') {
-                jsonData.population = this.selectedRowKeysValue.map(item => {
+              jsonData.population = this.selectedRowKeysValue.map((item) => {
                 return item.orientationId
-                })
-                jsonData.excludePopulation = this.selectedRowKeysValueNo.map(item => {
+              })
+              jsonData.excludePopulation = this.selectedRowKeysValueNo.map((item) => {
                 return item.orientationId
-                })
+              })
             } else {
-                jsonData = {}
+              jsonData = {}
             }
           }
-          
+
           var dataJson = {
             ...values,
             platformOs: this.allForm.platform_os,
@@ -1078,7 +1136,7 @@ export default {
             noGenderBreak: this.allForm.noGenderBreak ? 1 : 0,
             noAreaBreak: this.allForm.noAreaBreak ? 1 : 0,
             allForm: this.allForm,
-            ...jsonData
+            ...jsonData,
           }
           this.$emit('update:populationData', dataJson)
         }
@@ -1101,10 +1159,10 @@ export default {
     },
     search(e) {},
     put() {
-      var data = this.allForm.region.map(item => {
+      var data = this.allForm.region.map((item) => {
         return item[1] + ''
       })
-      var dataElse = data.map(item => {
+      var dataElse = data.map((item) => {
         return [item.substring(0, 2), item]
       })
     },
@@ -1112,8 +1170,8 @@ export default {
       if (e.target.value !== '') {
         getAction('/kuaishou/batch/getAppSearch', {
           accountId: localStorage.getItem('accountId'),
-          appName: e.target.value
-        }).then(res => {
+          appName: e.target.value,
+        }).then((res) => {
           if (res.result) {
             this.optionsApp = res.result
             this.checkOptions.push(...res.result)
@@ -1133,7 +1191,7 @@ export default {
       this.formAll.setFieldsValue({ appInterest: [] })
       this.checkArr = []
       if (e.target.value == '1') {
-        getAction('/kuaishou/batch/getTargetList', { tagType: 'APP_INTEREST' }).then(res => {
+        getAction('/kuaishou/batch/getTargetList', { tagType: 'APP_INTEREST' }).then((res) => {
           if (res.success) {
             this.optionsApp = res.result
           }
@@ -1160,7 +1218,7 @@ export default {
       return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
     },
     getDataType(type, dataList) {
-      getAction('/kuaishou/batch/getTargetList', { tagType: type }).then(res => {
+      getAction('/kuaishou/batch/getTargetList', { tagType: type }).then((res) => {
         if (res.success) {
           this[dataList] = res.result
         }
@@ -1168,15 +1226,14 @@ export default {
     },
     getData(className) {
       return this.formAll.getFieldValue(className)
-    }
+    },
   },
-  mounted: function() {
+  mounted: function () {
     this.getDataType('APP_INTEREST', 'optionsAppActive')
     this.getDataType('BUSINESS_INTEREST', 'businessOptions')
     this.getDataType('FANS_STAR', 'fansStarOptions')
     this.getDataType('INTEREST_VIDEO', 'interestVideoOptions')
-
-  }
+  },
 }
 </script>
 

+ 34 - 10
src/views/modules/kuaishouapp/account/stepForm/stepModule/targetedPopulation.vue

@@ -394,10 +394,10 @@ li:hover {
             </a-checkbox-group>
           </ul>
         </div>
-        <div style="width:100%" v-if="checkArr.length > 0">
+        <div style="width:100%" v-if="optionsAll.length > 0">
           <a-button @click="clearAll">清空</a-button>
           <br />
-          <a-tag v-for="item of checkArr" :key="item" closable :afterClose="() => log(item)">
+          <a-tag v-for="item of optionsAll" :key="item" closable :afterClose="() => log(item)">
             {{ showAppName(item)?showAppName(item):item }}
           </a-tag>
         </div>
@@ -711,6 +711,7 @@ export default {
     populationData: {
       immediate: true, // immediate选项可以开启首次赋值监听
       handler(n, oldVal) {
+        console.log(n)
         if (n.allForm) {
           this.allForm = n.allForm
           this.allForm.noAgeBreak = n.noAgeBreak == '0' ? false : true
@@ -718,7 +719,7 @@ export default {
           this.allForm.noAreaBreak = n.noAreaBreak == '0' ? false : true
           this.selectedRowKeys = n.population ? n.population : []
           this.selectedRowKeysNo = n.excludePopulation ? n.excludePopulation : []
-          this.checkArr = n.allForm.checkArr
+          this.optionsAll = n.appIds
           this.targeted = n.excludePopulation ? (n.population ? '4' : '3') : '2'
           this.people = n.excludePopulation ? '3' : n.population ? '3' : '2'
           this.getPeople().then(res => {
@@ -799,11 +800,29 @@ export default {
           }
         }
       }
-    }
+    },
+    checkArr(n, o) {
+      console.log(n, o)
+      this.optionsAll.push(...n)
+      this.optionsAll = [...new Set(this.optionsAll)]
+      if (n.length != o.length) {
+        if (n.length < o.length) {
+          var a = new Set(n)
+          var b = new Set(o)
+          var c = new Set([...b].filter((item) => !a.has(item))) // {1}
+          console.log(...c)
+          var d = this.optionsAll.indexOf(...c)
+          if (d > 0) {
+            this.optionsAll.splice(d, 1)
+          }
+        }
+      }
+    },
   },
   directives: { clickoutside },
   data() {
     return {
+      optionsAll:[],
       formAll: this.$form.createForm(this),
       marks: {
         5: '5岁',
@@ -997,16 +1016,21 @@ export default {
             var data = this.checkOptions.filter(item => {
                 return item.appId == appId
             })
-            return data[0].appName
+            if(data[0]){
+              return data[0].appName
+            }else{
+              return null
+            }
+            
         }else{
             return null
         }
      
     },
     log(appId) {
-      var index = this.checkArr.findIndex(item => item === appId)
-      this.checkArr.splice(index, 1)
-      if (this.checkArr.length == 0) {
+      var index = this.optionsAll.findIndex((item) => item === appId)
+      this.optionsAll.splice(index, 1)
+      if (this.optionsAll.length == 0) {
         this.indeterminate = false
         this.checkAll = false
       }
@@ -1046,7 +1070,7 @@ export default {
         indeterminate: false,
         checkAll: e.target.checked
       })
-      if (this.checkArr.length > 20) {
+      if (this.optionsAll.length > 20) {
         this.$message.error('最多选择20个APP行为')
         this.checkArr = []
         this.indeterminate = false
@@ -1068,7 +1092,7 @@ export default {
           //   this.checkArr
           var json = {}
           if (this.allForm.appType == '2') {
-            json.appIds = this.checkArr
+            json.appIds = this.optionsAll
           }
           if (this.allForm.regionType == 'limit') {
             json.region = this.allForm.region.map(item => {

+ 101 - 106
src/views/report/JhsBakendDataList.vue

@@ -1,38 +1,53 @@
 <template>
   <a-card :bordered="false">
-
     <!-- 查询区域 -->
     <div class="table-page-search-wrapper">
       <a-form layout="inline">
         <a-row :gutter="24">
-
           <a-col :md="6" :sm="8">
             <a-form-item label="选择日期">
-<!--              <a-input placeholder="请输入stateDate" v-model="queryParam.stateDate"></a-input>-->
+              <!--              <a-input placeholder="请输入stateDate" v-model="queryParam.stateDate"></a-input>-->
               <a-date-picker v-model="queryParam.stateDate" format="YYYY-MM-DD" style="width:100%" />
             </a-form-item>
           </a-col>
-          <a-col :md="6" :sm="8" >
+          <a-col :md="6" :sm="8">
             <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
               <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
-              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
+              <a-button
+                type="primary"
+                @click="searchReset"
+                icon="reload"
+                style="margin-left: 8px"
+              >重置</a-button>
             </span>
           </a-col>
-
         </a-row>
       </a-form>
     </div>
 
     <!-- 操作按钮区域 -->
     <div class="table-operator">
-      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
+      <a-upload
+        name="file"
+        :showUploadList="false"
+        :multiple="false"
+        :headers="tokenHeader"
+        :action="importExcelUrl"
+        @change="handleImportExcel"
+      >
         <a-button type="primary" icon="import">导入</a-button>
       </a-upload>
+      <a-button type="primary" style="margin-left:20px" @click="openNewWindow">日报预览</a-button>
       <a-dropdown v-if="selectedRowKeys.length > 0">
         <a-menu slot="overlay">
-          <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
+          <a-menu-item key="1" @click="batchDel">
+            <a-icon type="delete" />删除
+          </a-menu-item>
         </a-menu>
-        <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
+        <a-button style="margin-left: 8px">
+          批量操作
+          <a-icon type="down" />
+        </a-button>
       </a-dropdown>
     </div>
 
@@ -47,24 +62,8 @@
         :dataSource="dataSource"
         :pagination="ipagination"
         :loading="loading"
-        @change="handleTableChange">
-
-        <span slot="action" slot-scope="text, record">
-          <a @click="handleEdit(record)">编辑</a>
-
-          <a-divider type="vertical" />
-          <a-dropdown>
-            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
-            <a-menu slot="overlay">
-              <a-menu-item>
-                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
-                  <a>删除</a>
-                </a-popconfirm>
-              </a-menu-item>
-            </a-menu>
-          </a-dropdown>
-        </span>
-
+        @change="handleTableChange"
+      >
       </a-table>
     </div>
     <!-- table区域-end -->
@@ -75,91 +74,87 @@
 </template>
 
 <script>
-  import JhsBakendDataModal from './modules/JhsBakendDataModal'
-  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import JhsBakendDataModal from './modules/JhsBakendDataModal'
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 
-  export default {
-    name: "JhsBakendDataList",
-    mixins:[JeecgListMixin],
-    components: {
-      JhsBakendDataModal
-    },
-    data () {
-      return {
-        description: '聚划算后端数据管理页面',
-        // 表头
-        columns: [
-		   {
-            title: '日期',
-            align:"center",
-            dataIndex: 'stateDate'
-           },
-		   {
-            title: '产品线',
-            align:"center",
-            dataIndex: 'productLine'
-           },
-		   {
-            title: '任务名称',
-            align:"center",
-            dataIndex: 'taskName'
-           },
-		   {
-            title: '客户端',
-            align:"center",
-            dataIndex: 'clientName'
-           },
-		   {
-            title: '渠道id',
-            align:"center",
-            dataIndex: 'channelId'
-           },
-		   {
-            title: '渠道名称',
-            align:"center",
-            dataIndex: 'channelName'
-           },
-		   {
-            title: '计划id',
-            align:"center",
-            dataIndex: 'adId'
-           },
-		   {
-            title: '页面访问UV',
-            align:"center",
-            dataIndex: 'pageView'
-           },
-		   {
-            title: '成交笔数',
-            align:"center",
-            dataIndex: 'dealNumber'
-           },
-          {
-            title: '操作',
-            dataIndex: 'action',
-            align:"center",
-            scopedSlots: { customRender: 'action' },
-          }
-        ],
-		url: {
-          list: "/okr/jhsBakendData/list",
-          delete: "/okr/jhsBakendData/delete",
-          deleteBatch: "/okr/jhsBakendData/deleteBatch",
-          exportXlsUrl: "okr/jhsBakendData/exportXls",
-          importExcelUrl: "okr/jhsBakendData/importExcel",
-       },
+export default {
+  name: 'JhsBakendDataList',
+  mixins: [JeecgListMixin],
+  components: {
+    JhsBakendDataModal,
+  },
+  data() {
+    return {
+      description: '聚划算后端数据管理页面',
+      // 表头
+      columns: [
+        {
+          title: '日期',
+          align: 'center',
+          dataIndex: 'stateDate',
+        },
+        {
+          title: '产品线',
+          align: 'center',
+          dataIndex: 'productLine',
+        },
+        {
+          title: '任务名称',
+          align: 'center',
+          dataIndex: 'taskName',
+        },
+        {
+          title: '客户端',
+          align: 'center',
+          dataIndex: 'clientName',
+        },
+        {
+          title: '渠道id',
+          align: 'center',
+          dataIndex: 'channelId',
+        },
+        {
+          title: '渠道名称',
+          align: 'center',
+          dataIndex: 'channelName',
+        },
+        {
+          title: '计划id',
+          align: 'center',
+          dataIndex: 'adId',
+        },
+        {
+          title: '页面访问UV',
+          align: 'center',
+          dataIndex: 'pageView',
+        },
+        {
+          title: '成交笔数',
+          align: 'center',
+          dataIndex: 'dealNumber',
+        },
+      ],
+      url: {
+        list: '/okr/jhsBakendData/list',
+        delete: '/okr/jhsBakendData/delete',
+        deleteBatch: '/okr/jhsBakendData/deleteBatch',
+        exportXlsUrl: 'okr/jhsBakendData/exportXls',
+        importExcelUrl: 'okr/jhsBakendData/importExcel',
+      },
     }
   },
   computed: {
-    importExcelUrl: function(){
-      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
-    }
+    importExcelUrl: function () {
+      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
+    },
   },
-    methods: {
-
+  methods: {
+    openNewWindow(){
+      window.open("http://139.186.29.76:8804/jeecg-boot/ureport/preview?_u=mysql:%E8%81%9A%E5%88%92%E7%AE%97%E8%B4%A6%E6%88%B7%E6%8A%A5%E8%A1%A8-%E5%A4%B4%E6%9D%A1.ureport.xml", '_blank')
     }
-  }
+  },
+}
 </script>
 <style scoped>
-  @import '~@assets/less/common.less'
+@import '~@assets/less/common.less';
 </style>