魏志佳 5 năm trước cách đây
mục cha
commit
f7e3037331

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

@@ -51,6 +51,7 @@
   import moment from 'moment'
   import {
     getAction,
+    
     postAction,
     downFile,
     downFilePost

+ 83 - 5
src/views/modules/Statistics/videoStatics/Treeselect.vue

@@ -5,10 +5,15 @@
 </style>
 <template>
   <div class="select-project">
-    <!-- <treeselect :options="options"
+    <treeselect :options="options"
      :multiple="multiple"
+      :disable-branch-nodes="!multiple"
+      :load-options="loadOptions"
       placeholder="请选择项目以及账户"
       v-model="value"
+      :value-consists-of="valueConsistsOf"
+      :auto-load-root-options="false"
+      @select="update"
       @input="emitValue"
       :limit="2"
       :limitText="
@@ -16,18 +21,19 @@
           return '隐藏' + count + '条'
         }
       "
+      noChildrenText="该项目下暂无账号"
       noOptionsText="loading..."
     >
       <div slot="value-label" slot-scope="{ node }">{{ node.raw.customLabel }}</div>
-    </treeselect> -->
+    </treeselect>
 
-     <treeselect :options="options" @input="emitValue" placeholder="请选择项目以及账户" v-model="value" :multiple="multiple"  noOptionsText="loading..."  :limit="2"
+     <!-- <treeselect :options="options" @input="emitValue" placeholder="请选择项目以及账户" v-model="value" :multiple="multiple"  noOptionsText="loading..."  :limit="2"
       :limitText="
         count => {
           return '隐藏' + count + '条'
         }
       ">
-  </treeselect>
+  </treeselect> -->
   </div>
 </template>
 
@@ -54,9 +60,32 @@
     data: () => ({
       multiple: true,
       value: null,
-      options: []
+      options: [],
+      valueConsistsOf: 'LEAF_PRIORITY',
      
     }),
+     props: {
+    // multiple: {
+    //   type: Boolean,
+    //   default() {
+    //     return true
+    //   }
+    // },
+    appId: {},
+    // request: {
+    //   type: String,
+    //   default() {
+    //     return '2'
+    //   }
+    // },
+    reqUrl: {
+        type: String,
+        default () {
+          return '/ctop/projectMember/participateList'
+        }
+
+      }
+  },
     components: {
       Treeselect
     },
@@ -82,6 +111,27 @@
           console.log(this.value)
         this.$emit('update:appId', this.value)
       },
+
+    update(node, id) {
+
+      getAction('/ctop/projectMember/bytedanceProjectParticipateInList', { projectId: node.id }).then(res => {
+        console.log(res)
+        if (res.code == 0) {
+          if (res.result.length > 0) {
+            node.children = res.result.map(item => {
+              return {
+                id: item.accountId,
+                label: item.userName + '         ' + item.authName
+              }
+            })
+          } else {
+              
+          }
+        } else {
+          new Error('Failed to load options: network error.')
+        }
+      })
+    },
       getChildren() {},
       getParticipateList() {
         //我参与的
@@ -97,8 +147,36 @@
             })
           }
         })
+      },
+
+      loadOptions({ action, parentNode, callback }) {
+        console.log({ action, parentNode, callback })
+      // Typically, do the AJAX stuff here.
+      // Once the server has responded,
+      // assign children options to the parent node & call the callback.
+      if (action === LOAD_CHILDREN_OPTIONS) {
+        getAction('/ctop/userAllocation/getAccountListByProjectId', { projectId: parentNode.id }).then(res => {
+          console.log(res)
+          if (res.code == 0) {
+            if (res.result.length > 0) {
+              parentNode.children = res.result.map(item => {
+                return {
+                  id: item.accountId,
+                  label: item.userName + '\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0' + item.authName
+                }
+              })
+              callback()
+            } else {
+              parentNode.children = []
+              callback()
+            }
+          } else {
+            callback(new Error('Failed to load options: network error.'))
+          }
+        })
       }
     },
+    },
 
     activated() {
       this.getParticipateList()

+ 9 - 0
src/views/modules/Statistics/videoStatics/vSummary.vue

@@ -3,6 +3,14 @@
     <div class="xiangmuxuanze">
       <span>项目选择:</span>
        <Treeselect  :appId.sync="appId"  style="display: inline-block;position: relative;top: 10px;"/>
+       <!-- <a-tree-select style="width: 60%"
+       v-model="value"
+      :tree-data="treeData"
+      tree-checkable
+      :show-checked-strategy="SHOW_PARENT"
+      search-placeholder="Please select">
+
+       </a-tree-select> -->
     </div>
     <div class="timeDiv">
       <div>
@@ -274,6 +282,7 @@ let variableCol = [
   }
 ]
 let show = 0
+
 export default {
   data() {
     return {

+ 2 - 0
src/views/modules/advertiser/ProjectList.vue

@@ -9,6 +9,7 @@
               <a-input placeholder="请输入项目名称" v-model="queryParam.projectName"></a-input>
             </a-form-item>
           </a-col>
+           
           <a-col :md="6" :sm="8">
             <a-form-item label="广告主名称">
               <a-input placeholder="请输入广告主名称" v-model="queryParam.advertiserName"></a-input>
@@ -109,6 +110,7 @@
             align: 'center',
             dataIndex: 'projectName'
           },
+          
           {
             title: '广告主名称',
             align: 'center',

+ 22 - 3
src/views/modules/advertiser/modules/ProjectModal.vue

@@ -21,6 +21,19 @@
         <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="项目名称">
           <a-input placeholder="请输入项目名称" v-decorator="['projectName', validatorRules.projectName]" />
         </a-form-item>
+        
+        <a-form-item label="行业" :labelCol="labelCol" :wrapperCol="wrapperCol">
+          <j-tree-select 
+            ref="treeSelect"
+            placeholder="请选择行业"
+            dict="sys_category,name,id"
+            pidField="pid"
+            pidValue="f5cb2d2d28417b3b65a6dd744bcb9a76"
+            v-decorator="['industryId', validatorRules.industryId]"
+           
+          >
+          </j-tree-select>
+        </a-form-item>
         <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="广告主名称">
           <a-select
             @change="handleChange"
@@ -118,13 +131,14 @@ import pick from 'lodash.pick'
 import moment from 'moment'
 import JSelectDepart from '@/components/jeecgbiz/JSelectDepart'
 import JSelectUserByDep from '@/components/jeecgbiz/JSelectUserByDep'
-
+import JTreeSelect from '@/components/jeecg/JTreeSelect'
 import { mapGetters } from 'vuex'
 export default {
   name: 'ProjectModal',
   components: {
     JSelectUserByDep,
-    JSelectDepart
+    JSelectDepart,
+    JTreeSelect
   },
   data() {
     return {
@@ -139,11 +153,12 @@ export default {
         xs: { span: 24 },
         sm: { span: 16 }
       },
-
+      industryId:'',
       confirmLoading: false,
       form: this.$form.createForm(this),
       validatorRules: {
         projectName: { rules: [{ required: true, message: '请输入项目名称!' }] },
+        industryId: { rules: [{ required: true, message: '请选择行业!' }] },
         advertiserId: { rules: [{ required: true, message: '请选择广告主!' }] },
         responsibleName: { rules: [{ required: true, message: '请选择负责人!' }] },
         maxBid: { rules: [{ required: true, message: '请输入最高出价!' }, { validator: this.validateInputCode }] },
@@ -192,7 +207,9 @@ export default {
       getAction(this.url.getList, { userId: this.userInfo().id })
         .then(res => {
           if (res.success) {
+            console.log(res)
             this.list = res.result.records
+            
           } else {
             this.$message.warning(res.message)
           }
@@ -218,10 +235,12 @@ export default {
       this.model.maxDeepCpaBid = this.model.maxDeepCpaBid ? this.model.maxDeepCpaBid / 1000 : 0
       this.visible = true
       this.$nextTick(() => {
+        console.log(this.model)
         this.form.setFieldsValue(
           pick(
             this.model,
             'projectName',
+            'industryId',
             'advertiserId',
             'responsibleName',
             'maxBid',