Jelajahi Sumber

修改产品

朱鑫波 4 tahun lalu
induk
melakukan
a1a9a6b94f

+ 50 - 6
src/views/modules/material/accountCheck.vue

@@ -13,9 +13,19 @@
 <template>
   <div>
     <a-modal title="账户选择" v-model="showEdit" @ok="handleOk" @cancel="close" width="80%">
-      <a-checkbox :indeterminate="indeterminate" @change="onCheckAllChange" :checked="checkAll">全选</a-checkbox>
+      <!-- <a-checkbox :indeterminate="indeterminate" @change="onCheckAllChange" :checked="checkAll">全选</a-checkbox>
       <br />
-      <a-checkbox-group :options="showList" v-model="dataValue" class="checked-account" @change="onChange"/>
+      <a-checkbox-group :options="showList" v-model="dataValue" class="checked-account" @change="onChange" /> -->
+      <a-tree
+        v-model="checkedKeys"
+        checkable
+        :expanded-keys="expandedKeys"
+        :auto-expand-parent="autoExpandParent"
+        :selected-keys="selectedKeys"
+        :tree-data="treeData"
+        @expand="onExpand"
+        @select="onSelect"
+      />
     </a-modal>
   </div>
 </template>
@@ -30,19 +40,44 @@ export default {
 
   data: function () {
     return {
+      checkedKeys: [],
       showEdit: false,
       dataList: [],
       showList: null,
       dataValue: [],
       indeterminate: false,
       checkAll: false,
+      expandedKeys: [],
+      autoExpandParent: true,
+      selectedKeys: [],
+      treeData:[],
     }
   },
+  watch: {
+    checkedKeys(val) {
+      console.log('onCheck', val)
+    },
+  },
   methods: {
+    onExpand(expandedKeys) {
+      console.log('onExpand', expandedKeys)
+      // if not set autoExpandParent to false, if children expanded, parent can not collapse.
+      // or, you can remove all expanded children keys.
+      this.expandedKeys = expandedKeys
+      this.autoExpandParent = false
+    },
+    onCheck(checkedKeys) {
+      console.log('onCheck', checkedKeys)
+      this.checkedKeys = checkedKeys
+    },
+    onSelect(selectedKeys, info) {
+      console.log('onSelect', info)
+      this.selectedKeys = selectedKeys
+    },
     handleOk(e) {
       console.log(e)
       this.showEdit = false
-      this.$emit('synchro', this.dataValue)
+      this.$emit('synchro', this.checkedKeys)
     },
     close() {
       this.showEdit = false
@@ -72,17 +107,26 @@ export default {
       this.dataList = []
       this.showList = null
       this.dataValue = []
+      this.checkedKeys = []
       this.indeterminate = false
       this.checkAll = false
       console.log(url, item)
       getAction(url, item).then((res) => {
         if (res.success) {
-          this.showList = res.result.records.map((item) => {
+          let arrList = []
+          this.treeData = res.result.map(item=>{
             return {
-              label: item.authName,
-              value: item.accountId,
+              title: item.projectName,
+              key: item.projectId,
+              children:item.userAllocationList.map(i=>{
+                  return {
+                    title: i.authName+'\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0'+(item.userName?item.userName:'管理员'), 
+                    key: i.accountId
+                  }
+              })
             }
           })
+         
         }
         console.log(res)
       })

+ 3 - 3
src/views/modules/material/accountCheckBytedance.vue

@@ -289,12 +289,12 @@ export default {
         resolve(data)
       }
     },
-    getParticipateList(projectId) {
+    getParticipateList(productId) {
       //我参与的
       //   toutiaoParticipateList
       this.showEdit = true
-      getAction('/ctop/userAllocation/getUserIdListByProjectId', {
-        projectId: projectId,
+      getAction('/ctop/userAllocation/getUserIdListByProductId', {
+        productId: productId,
       }).then((res) => {
         if (res.code == 0) {
           console.log(res)

+ 2 - 2
src/views/modules/material/comment/selectTable.vue

@@ -69,8 +69,8 @@
     >
       <a-list :data-source="data">
         <a-list-item slot="renderItem" slot-scope="item" @click="showProject(item)">
-          <a-list-item-meta :description="'产品名称:' + item.productName">
-            <a slot="title">广告主名称:{{ item.advertiserName }}</a>
+          <a-list-item-meta :description="'广告主名称:' + item.advertiserName">
+            <a slot="title">产品名称:{{ item.productName }}</a>
           </a-list-item-meta>
           <!-- <div>
             {{

+ 39 - 4
src/views/modules/material/videoMaterial.vue

@@ -453,9 +453,37 @@ a {
             role.roleCode == 'touTiaoOperationManager')
         "
         :disabled="checkArr.length == 0"
+        @click="tongbu('3')"
+        >一键同步头条内广</a-button
+      >
+      <a-button
+        v-if="
+          queryParam.productId &&
+          active == '1' &&
+          (role.roleCode == 'operator' ||
+            role.roleCode == 'kuaishouOperationManager' ||
+            role.roleCode == 'admin' ||
+            role.roleCode == 'operationAssistant' ||
+            role.roleCode == 'touTiaoOperationManager')
+        "
+        :disabled="checkArr.length == 0"
         @click="tongbu('2')"
         >一键同步快手</a-button
       >
+      <a-button
+        v-if="
+          queryParam.productId &&
+          active == '1' &&
+          (role.roleCode == 'operator' ||
+            role.roleCode == 'kuaishouOperationManager' ||
+            role.roleCode == 'admin' ||
+            role.roleCode == 'operationAssistant' ||
+            role.roleCode == 'touTiaoOperationManager')
+        "
+        :disabled="checkArr.length == 0"
+        @click="tongbu('4')"
+        >一键同步快手内广</a-button
+      >
     </div>
 
     <a-tabs @change="callbackTwo" v-model="active" type="card" id="material-card">
@@ -1967,6 +1995,7 @@ export default {
     'queryParam.productId': function (n, o) {
       if (n != '') {
         this.getList(n)
+        this.checkArr = []
       }
     },
     visibleDetail: function (n, o) {
@@ -2204,17 +2233,23 @@ export default {
     },
     moment,
     tongbu(value) {
+      this.mediaId = value
       // getAction('/ctop/project/queryById', { id: this.queryParam.projectId }).then((res) => {
       //   console.log(res)
       //   if (res.success) {
       if (value == '1' || value == '3') {
-        this.$refs.check.getData('/ctop/projectMember/participateListV2', {
+        this.$refs.check.getData('/ctop/userAllocation/getAccountListByUserIdAndProductId', {
           userId: this.userInfo().id,
-          pageNo:1,
-          pageSize:100
+          productId: this.queryParam.productId,
+          mediaId: value,
         })
       } else if (value == '2' || value == '4') {
-        this.$refs.accountCheckBytedance.getParticipateList(this.queryParam.projectId)
+        this.$refs.accountCheckBytedance.getParticipateList(this.queryParam.productId)
+        // this.$refs.check.getData('/ctop/userAllocation/getAccountListByUserIdAndProductId', {
+        //   userId: this.userInfo().id,
+        //   productId: this.queryParam.productId,
+        //   mediaId: value,
+        // })
       }
       //   } else {
       //     this.$message.error('网络波动,请稍后再试')