浏览代码

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

魏志佳 4 年之前
父节点
当前提交
9647e6698c

文件差异内容过多而无法显示
+ 655 - 609
src/views/modules/Statistics/mediaReport.vue


+ 351 - 0
src/views/modules/advertiser/modules/productModal.vue

@@ -0,0 +1,351 @@
+<template>
+  <a-modal :title="title" :width="800" :visible="visible" :confirmLoading="confirmLoading" @ok="handleOk"
+    @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-option :value="item.id" v-for="(item, index) of list" :key="index">{{
+              item.name
+            }}</a-select-option>
+          </a-select>
+        </a-form-item>
+        <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="产品名称">
+          <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
+            }}</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>
+      </a-form>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+  import {
+    httpAction,
+    getAction,
+    postAction
+  } from '@/api/manage'
+  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,
+      JTreeSelect
+    },
+    data() {
+      return {
+        title: '操作',
+        visible: false,
+        model: {},
+        labelCol: {
+          xs: {
+            span: 24
+          },
+          sm: {
+            span: 5
+          }
+        },
+        wrapperCol: {
+          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: '请选择广告主!'
+            }]
+          },
+          supplierCode: {
+            rules: [{
+              required: true,
+              message: '请选择项目!'
+            }],
+          },
+          responsibleName: {
+            rules: [{
+              required: true,
+              message: '请选择负责人!'
+            }]
+          },
+          maxBid: {
+            rules: [{
+              required: true,
+              message: '请输入最高出价!'
+            }, {
+              validator: this.validateInputCode
+            }]
+          },
+        },
+        url: {
+          add: '/ctop/product/insertOrUpdateProduct',
+          edit: '/ctop/product/insertOrUpdateProduct',
+          getList: '/ctop/product/advertiserList'
+
+        },
+        list: [],
+        resId: '',
+        shejiId: '',
+        options: [],
+        optionsElse: [],
+        supplierList: [],
+        addDis: true
+      }
+    },
+    created() {
+      //   this.getSupplierList()
+    },
+    methods: {
+      validateInputCode(rule, value, callback) {
+        if (!value || value > 0) {
+          callback()
+        } else {
+          callback('请输入大于0的最高报价!')
+        }
+      },
+      ...mapGetters(['nickname', 'avatar', 'userInfo']),
+      onChange(e) {
+        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', {
+            "projectIds": this.getFormFieldValue('projectIds')
+          }).then(res => {
+            if (res.success) {
+              this.options = res.result.saleList
+              this.optionsElse = res.result.yunyingList
+            }
+          })
+        }
+
+      },
+      handleBlur() {
+        console.log('blur')
+      },
+      handleFocus() {
+        console.log('focus')
+      },
+      filterOption(input, option) {
+        return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      },
+      getList() {
+        var params = {}
+        params.userId = this.userInfo().id
+        console.log(params)
+        getAction(this.url.getList)
+          .then(res => {
+            if (res.success) {
+              console.log(res)
+              this.list = res.result
+
+            } 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)
+          }
+        })
+      },
+      add() {
+        this.addDis = false
+        this.edit({
+          mediaId: '2'
+        })
+      },
+      edit(record) {
+        // this.getSupplierList()
+        this.getList()
+        this.supplierList = []
+        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 }
+        //   }
+        console.log(record)
+        this.form.resetFields()
+        this.model = Object.assign({}, params)
+        this.visible = true
+        this.$nextTick(() => {
+          console.log(this.model)
+          this.form.setFieldsValue(
+            pick(
+              this.model,
+              'productName',
+              'advertiserId',
+              'projectIds'
+            )
+          )
+          // this.resId = record.responsibleId
+          // this.shejiId = record.designResponsibleId
+          //   getAction('/sys/user/getAllUserList', '').then(res => {
+          //     console.log(res)
+          //     if (res.success) {
+          //       this.options = res.result
+          //     }
+          //   })
+          //   getAction('/sys/user/getAllSaleList', '').then(res => {
+          //     console.log(res)
+          //     if (res.success) {
+          //       this.optionsElse = res.result
+          //     }
+          //   })
+          //时间格式化
+        })
+      },
+      close() {
+        this.$emit('close')
+        this.visible = false
+      },
+      handleOk() {
+        const that = this
+        // 触发表单验证
+        this.form.validateFields((err, values) => {
+          if (!err) {
+            that.confirmLoading = true
+            let httpurl = ''
+            let method = ''
+            if (!this.model.id) {
+              httpurl += this.url.add
+              method = 'post'
+            } else {
+              httpurl += this.url.edit
+              method = 'post'
+            }
+            var data = values.advertiserId
+            let formData = Object.assign(this.model, values)
+
+            //   if(this.model.mediaId)
+            //时间格式化
+            formData.advertiserId = data.key
+            formData.advertiserName = data.label
+            if (formData.id) {
+              formData.productId = formData.id
+            }
+            httpAction(httpurl, formData, method)
+              .then(res => {
+                if (res.success) {
+                  that.$message.success(res.message)
+                  that.$emit('ok')
+                } else {
+                  that.$message.warning(res.message)
+                }
+              })
+              .finally(() => {
+                that.confirmLoading = false
+                that.close()
+              })
+          }
+        })
+      },
+      handleCancel() {
+        this.close()
+      },
+      getFormFieldValue(field) {
+        return this.form.getFieldValue(field)
+      },
+      get(valueName, key) {
+        console.log(valueName, key)
+        this.resId = key
+      }
+    }
+  }
+</script>
+
+<style lang="less" scoped></style>

+ 346 - 0
src/views/modules/advertiser/productList.vue

@@ -0,0 +1,346 @@
+<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="productName"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="8">
+            <a-form-item label="广告主名称">
+              <a-input placeholder="请输入广告主名称" v-model="advertiserName"></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="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
+              <!-- <a @click="handleToggleSearch" style="margin-left: 8px">
+                {{ toggleSearchStatus ? '收起' : '展开' }}
+                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
+              </a> -->
+            </span>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+
+    <!-- 操作按钮区域 -->
+    <div class="table-operator">
+      <a-button @click="handleAdd" 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"
+        style="word-break: break-all;font-size:16px;font-weight:600">
+        <span slot="mediaId"
+          slot-scope="mediaId">{{ mediaId == 1 ? '头条' :mediaId == 2? '快手':mediaId == 3?'头条内广':'快手内广' }}</span>
+        <span slot="projectList" slot-scope="text">
+          <span v-for="(item,index) in text"
+            :key="index">{{index+1}}.{{item.projectName}}{{index==(text.length-1)?'':';'}}</span>
+        </span>
+        <span slot="yunyingList" slot-scope="text">
+          <span v-for="(item,index) in text" :key="index">{{item.realname}}{{index==(text.length-1)?'':','}}</span>
+        </span>
+        <span slot="saleList" slot-scope="text">
+          <span v-for="(item,index) in text" :key="index">{{item.saleName}}{{index==(text.length-1)?'':','}}</span>
+        </span>
+        <span slot="action" slot-scope="text, record">
+          <a @click="handleAddList(record)">绑定项目</a>
+
+          <a-divider type="vertical" />
+
+          <a @click="handleEdit(record)">编辑</a>
+
+          <a-divider type="vertical" />
+
+          <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
+            <a>删除</a>
+          </a-popconfirm>
+        </span>
+      </a-table>
+    </div>
+    <project-modal ref="modalForm" @ok="modalFormOk"></project-modal>
+    <a-modal title="项目展示" :width="800" :visible="visible" :footer="null" @cancel="handleCancel" destroyOnClose
+      cancelText="关闭">
+      <a-button @click="handleProjectAdd" type="primary" icon="plus" style="margin-bottom:20px">新增</a-button>
+      <a-list bordered :data-source="dataList">
+        <a-list-item slot="renderItem" slot-scope="item, index">
+          {{ item.projectName }}
+          <div slot="actions">
+            <a @click="removeTitleCun(item,index)">删除</a>
+          </div>
+        </a-list-item>
+
+        <!-- <div slot="header">
+          Header
+        </div>
+        <div slot="footer">
+          Footer
+        </div> -->
+      </a-list>
+    </a-modal>
+    <a-modal title="新增项目" :width="800" :visible="visibleAdd" :confirmLoading="confirmLoading" @ok="handleOk"
+      destroyOnClose cancelText="关闭" @cancel="handleCancelAdd">
+      <a-select optionFilterProp="children" showSearch :filterOption="filterOption" mode="multiple" v-model="projectIds"
+        style="width:100%">
+        <a-select-option :value="item.id" v-for="(item, index) of supplierList" :key="index">{{
+              item.projectName
+            }}</a-select-option>
+      </a-select>
+    </a-modal>
+  </a-card>
+</template>
+
+<script>
+  import ProjectModal from './modules/productModal'
+  import JTreeSelect from '@/components/jeecg/JTreeSelect'
+  import {
+    httpAction,
+    getAction,
+    postAction,
+    deleteAction
+  } from '@/api/manage'
+  import {
+    JeecgListMixin
+  } from '@/mixins/ipagination'
+
+  export default {
+    name: 'ProjectList',
+    mixins: [JeecgListMixin],
+    components: {
+      ProjectModal,
+      JTreeSelect
+    },
+    data() {
+      return {
+        description: '产品管理页面',
+        loading: false,
+        visible: false,
+        visibleAdd: false,
+        dataList: [],
+        productIdDelete: null,
+        confirmLoading: false,
+        projectIds: [],
+        supplierList: [],
+        advertiserId: null,
+        // 表头
+        columns: [
+
+          {
+            title: '媒体',
+            align: 'center',
+            dataIndex: 'mediaId',
+            scopedSlots: {
+              customRender: 'mediaId'
+            },
+            width: 100
+          }, {
+            title: '产品名称',
+            align: 'center',
+            dataIndex: 'productName',
+            width: 200
+          },
+          {
+            title: '广告主名称',
+            align: 'center',
+            dataIndex: 'advertiserName',
+            width: 200
+          },
+          {
+            title: '项目名称',
+            align: 'center',
+            dataIndex: 'projectList',
+            scopedSlots: {
+              customRender: 'projectList'
+            },
+          },
+          {
+            title: '运营',
+            align: 'center',
+            dataIndex: 'yunyingList',
+            scopedSlots: {
+              customRender: 'yunyingList'
+            },
+            width: 120,
+
+          },
+          {
+            title: '销售',
+            align: 'center',
+            dataIndex: 'saleList',
+            scopedSlots: {
+              customRender: 'saleList'
+            },
+            width: 120
+          },
+          {
+            title: '操作',
+            dataIndex: 'action',
+            align: 'center',
+            scopedSlots: {
+              customRender: 'action'
+            },
+            width: 300
+          }
+        ],
+        dataSource: [],
+        url: {
+          list: '/ctop/product/getProductList',
+          delete: '/ctop/product/deleteProduct',
+          deleteBatch: '/ctop/project/deleteBatch',
+          exportXlsUrl: 'ctop/project/exportXls',
+          importExcelUrl: 'ctop/project/importExcel'
+        },
+        options: [],
+        advertiserName: null,
+        productName: null,
+      }
+    },
+    computed: {},
+    watch: {
+      'ipagination.current': function (n, o) {
+        console.log(n, o)
+        if (n != o) {
+          this.tableHttp()
+        }
+
+      }
+    },
+    methods: {
+      searchQuery() {
+        this.tableHttp()
+      },
+      searchReset() {
+        this.advertiserName = null
+        this.productName = null
+        this.tableHttp()
+      },
+      handleTableChange() {
+
+      },
+      handleDelete: function (id) {
+        if (!this.url.delete) {
+          this.$message.error("请设置url.delete属性!")
+          return
+        }
+        var that = this;
+        postAction(that.url.delete, {
+          productId: id
+        }).then((res) => {
+          if (res.success) {
+            that.$message.success(res.message);
+            this.ipagination.current = 1
+            this.tableHttp()
+          } else {
+            that.$message.warning(res.message);
+          }
+        });
+      },
+      handleProjectAdd() {
+        this.visibleAdd = true
+        // this.supplierList = 
+        postAction('/ctop/product/getProjectListByAdvertiserId', {
+          "advertiserId": this.advertiserId
+        }).then(res => {
+          if (res.success) {
+            this.supplierList = res.result
+            this.projectIds = this.dataList.map(item => {
+              return item.projectId
+            })
+          }
+        })
+      },
+      handleCancelAdd() {
+        this.visibleAdd = false
+      },
+      handleOk() {
+        this.confirmLoading = true
+        postAction('/ctop/product/insertProductProjectMap', {
+          "productId": this.productIdDelete,
+          "projectIds": this.projectIds
+        }).then(res => {
+          if (res.success) {
+            this.confirmLoading = false
+            this.visibleAdd = false
+            this.handleCancel()
+          } else {
+            this.confirmLoading = false
+            this.$message.error(res.message)
+          }
+        })
+      },
+      removeTitleCun(item, index) {
+        postAction('/ctop/product/deleteByProjectIdAndProductId', {
+          "projectId": item.projectId,
+          "productId": this.productIdDelete
+        }).then(res => {
+          if (res.success) {
+            this.dataList.splice(index, 1)
+            this.tableHttp()
+          }
+        })
+      },
+      handleCancel() {
+        this.visible = false
+        this.tableHttp()
+      },
+
+      handleAddList(record) {
+        this.visible = true
+        this.dataList = record.projectList
+        this.productIdDelete = record.id
+        this.advertiserId = record.advertiserId
+      },
+      handleEdit: function (record) {
+        console.log(record)
+        this.$refs.modalForm.edit(record);
+        this.$refs.modalForm.title = "编辑";
+        this.$refs.modalForm.disableSubmit = false;
+      },
+      handleAdd: function () {
+        this.$refs.modalForm.add();
+        this.$refs.modalForm.title = "新增";
+        this.$refs.modalForm.disableSubmit = false;
+      },
+      modalFormOk() {
+        this.ipagination.current = 1
+        this.tableHttp()
+      },
+      filterOption(input, option) {
+        return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      },
+      tableHttp() {
+        this.loading = true;
+        this.dataSource = []
+        var params = {}
+        params.pageNum = this.ipagination.current
+        params.pageSize = this.ipagination.pageSize
+        params.advertiserName = this.advertiserName
+        params.productName = this.productName
+        // {"pageNum":1,"pageSize":10,"advertiserName":"","productName":""}
+        postAction('/ctop/product/getProductList', params).then(res => {
+          if (res.success) {
+            // console.log(res)
+            this.loading = false;
+            this.ipagination.total = res.result.total
+            this.dataSource = res.result.list
+          }
+        })
+      },
+    },
+    mounted() {
+      this.tableHttp()
+    },
+  }
+</script>
+<style scoped>
+  @import '~@assets/less/common.less';
+</style>

+ 15 - 2
src/views/modules/kuaishouapp/account/accountIndex.vue

@@ -62,7 +62,7 @@
           <a-input-number :min="0" :step="0.01" v-model="allMoney" style="width:150px" @fouse.stop v-else />
 
           <!-- <a-input-number :min="0" :step="0.01" v-model="allMoney" style="width:150px" @fouse.stop /> -->
-          <a-button @click="editMoney" style="margin:0 15px 15px 15px" type="primary">修改</a-button>
+          <a-button @click="editMoney" style="margin:0 15px 15px 15px" type="primary" :loading="loadingMoney">修改</a-button>
 
           批量操作:
           <a-select style="width: 120px" v-model="allType">
@@ -70,7 +70,7 @@
             <a-select-option value="2">暂停</a-select-option>
             <a-select-option value="3">删除</a-select-option>
           </a-select>
-          <a-button @click="editStatus" style="margin:0 0 15px 15px" type="primary">确认</a-button>
+          <a-button @click="editStatus" style="margin:0 0 15px 15px" type="primary" :loading="loadingState">确认</a-button>
         </div>
         <a-modal v-model="visible" title="错误信息" onOk="handleOk" :footer="null">
           <div v-if="visibleData">
@@ -308,6 +308,8 @@
     },
     data: function () {
       return {
+        loadingMoney:false,
+        loadingState:false,
         nameEdit: false,
         campaignIdSearch: '',
         loadingList: false,
@@ -566,6 +568,7 @@
         //    this.selectedRowKeysValue.length > 0 ? this.selectedRowKeysValue :
       },
       editStatus() {
+        this.loadingState = true
         var params = {}
         params.accountId = this.appId + ''
         params.putStatus = this.allType
@@ -577,10 +580,14 @@
             this.addUser()
             this.selectedRowKeysValue = []
             this.selectedRowKeys = []
+            this.loadingState =false
+          }else{
+            this.loadingState =false
           }
         })
       },
       editMoney() {
+         this.loadingMoney = true 
         if (this.allPrice == '1') {
           var params = {}
           params.accountId = this.appId + ''
@@ -594,13 +601,16 @@
                 this.visible = true
                 this.visibleData = res.result
                 this.addUser()
+                this.loadingMoney = false
               } else {
                 this.addUser()
                 this.selectedRowKeysValue = []
                 this.selectedRowKeys = []
+                this.loadingMoney = false
               }
             } else {
               this.$message.error(res.message)
+              this.loadingMoney = false
             }
           })
         } else if (this.allPrice == '2') {
@@ -616,13 +626,16 @@
                 this.visible = true
                 this.visibleData = res.result
                 this.addUser()
+                this.loadingMoney = false
               } else {
                 this.addUser()
                 this.selectedRowKeysValue = []
                 this.selectedRowKeys = []
+                this.loadingMoney = false
               }
             } else {
               this.$message.error(res.message)
+              this.loadingMoney = false
             }
           })
         }

+ 22 - 3
src/views/modules/kuaishouapp/account/advertisingGroup.vue

@@ -53,7 +53,7 @@
             <div v-show="selectedRowKeys.length > 0">
               批量修改预算:
               <a-input-number :min="-1" :step="0.1" v-model="allMoney" style="width:150px" @fouse.stop />
-              <a-button @click="editMoney" style="margin:0 15px 15px 15px" type="primary">修改</a-button>
+              <a-button @click="editMoney" style="margin:0 15px 15px 15px" type="primary" :loading="loadingMoney">修改</a-button>
 
               批量修改出价:
               <a-select style="width: 120px" v-model="allPrice" @change="changePrice">
@@ -71,7 +71,7 @@
                   {{allMoneyBid&&deepConversionBid?((allMoneyBid/deepConversionBid)*100).toFixed(2)+'%':''}}</span>
               </div>
 
-              <a-button @click="editMoneyBid" style="margin:0 15px 15px 15px" type="primary">修改</a-button>
+              <a-button @click="editMoneyBid" style="margin:0 15px 15px 15px" type="primary" :loading="loadingAllMoney">修改</a-button>
 
               批量操作:
               <a-select style="width: 120px" v-model="allType">
@@ -81,7 +81,7 @@
                 <a-select-option value="4">修改</a-select-option>
                 <a-select-option value="5">复制</a-select-option>
               </a-select>
-              <a-button @click="editStatus" style="margin:0 0 15px 15px" type="primary">确认</a-button>
+              <a-button @click="editStatus" style="margin:0 0 15px 15px" type="primary" :loading="loadingState">确认</a-button>
             </div>
             <a-modal title="列表项筛选" v-model="showEdit" @ok="handleOk">
               <a-checkbox :indeterminate="indeterminate" @change="onCheckAllChange" :checked="checkAll">全选</a-checkbox>
@@ -557,6 +557,9 @@
 
     data: function () {
       return {
+        loadingMoney:false,
+        loadingState:false,
+        loadingAllMoney:false,
         unitName: '',
         unitNameInit: '',
         unitId: '',
@@ -935,12 +938,15 @@
         }
       },
       editStatus() {
+        this.loadingState = true
         if (this.allType == '4') {
+            this.loadingState = false
           this.visibleEditAll = true
         } else if (this.allType == '5') {
           this.getCampaignList()
           this.campaignId = localStorage.getItem('advertisingGroupKey')
           this.visibleBatch = true
+          this.loadingState = false
         } else {
 
           var params = {}
@@ -952,18 +958,21 @@
             if (res.result.failCount > 0) {
               this.visible = true
               this.visibleData = res.result
+              this.loadingState = false
             } else {
               this.getDataList(localStorage.getItem('advertisingGroupKey'))
               this.$message.success('批量修改成功')
               this.allType = '1'
               this.selectedRowKeysValue = []
               this.selectedRowKeys = []
+              this.loadingState = false
             }
 
           })
         }
       },
       editMoney() {
+          this.loadingMoney = true
         var params = {}
         params.accountId = localStorage.getItem('accountId')
         params.proportion = this.allMoney
@@ -972,6 +981,7 @@
         postAction('/kuaishou/batch/batchUpdateUnitBudgetByProportion', params).then(res => {
           console.log(res)
           if (res.success) {
+            this.loadingMoney = false
             if (res.result.failCount > 0) {
               this.visible = true
               this.visibleData = res.result
@@ -984,6 +994,7 @@
               this.selectedRowKeys = []
             }
           } else {
+            this.loadingMoney = false
             this.$message.error(res.message)
           }
         })
@@ -1014,11 +1025,13 @@
         }
       },
       editMoneyBid() {
+          this.loadingAllMoney = true
         if (this.allPrice == '2') {
 
 
           if (this.allMoneyBid < 1 || this.allMoneyBid > this.maxBid) {
             this.$message.error('不得低于1元,不得高于项目最高出价' + this.maxBid + '元')
+            this.loadingAllMoney = false
             return
           }
           var params = {}
@@ -1033,15 +1046,18 @@
                 this.visible = true
                 this.visibleData = res.result
                 this.getDataList(localStorage.getItem('advertisingGroupKey'))
+                this.loadingAllMoney = false
               } else {
                 this.allMoneyBid = null
                 this.$message.success('批量修改成功')
                 this.getDataList(localStorage.getItem('advertisingGroupKey'))
                 this.selectedRowKeysValue = []
                 this.selectedRowKeys = []
+                this.loadingAllMoney = false
               }
             } else {
               this.$message.error(res.message)
+              this.loadingAllMoney = false
             }
           })
         } else if (this.allPrice == '1') {
@@ -1056,15 +1072,18 @@
                 this.visible = true
                 this.visibleData = res.result
                 this.getDataList(localStorage.getItem('advertisingGroupKey'))
+                this.loadingAllMoney = false
               } else {
                 this.allMoneyBidProportion = 1.2
                 this.$message.success('批量修改成功')
                 this.getDataList(localStorage.getItem('advertisingGroupKey'))
                 this.selectedRowKeysValue = []
                 this.selectedRowKeys = []
+                this.loadingAllMoney = false
               }
             } else {
               this.$message.error(res.message)
+              this.loadingAllMoney = false
             }
           })
         }

+ 11 - 7
src/views/modules/kuaishouapp/account/copyGroup.vue

@@ -162,16 +162,16 @@
     <a-form-item label="场景广告位" :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
       :wrapperCol="{ lg: { span: 17 }, sm: { span: 17 } }">
       <!-- v-decorator="['speed', { initialValue: '1' }]" -->
-      <a-radio-group buttonStyle="solid" v-decorator="['sceneId', { initialValue: '1' }]">
-        <a-radio-button value="1">优选广告位</a-radio-button>
-        <a-radio-button value="2">按场景选择广告位</a-radio-button>
+      <a-radio-group buttonStyle="solid" v-model="allForm.sceneIdAll">
+        <a-radio-button :value="1">优选广告位</a-radio-button>
+        <a-radio-button :value="2">按场景选择广告位</a-radio-button>
       </a-radio-group>
       <!-- getData('speed') == '2' -->
       <br>
 
     </a-form-item>
     <a-form-item label=" " :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
-      :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }" class="else-label" v-if="getData('sceneId') == '2'">
+      :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }" class="else-label" v-if="allForm.sceneIdAll == 2">
       <a-checkbox-group :defaultValue="[7]" v-model="allForm.sceneId">
         <a-checkbox :value="7">信息流广告</a-checkbox>
         <a-checkbox :value="6">上下滑大屏广告</a-checkbox>
@@ -342,6 +342,7 @@
           fail: [],
           success: [],
           sceneId: [7],
+          sceneIdAll: 1,
           useAppMarket: false
         },
         dataList: [],
@@ -575,7 +576,10 @@
                 ...res.result.appInfo,
                 ...res.result.target
               }
-              dataJson.sceneId = JSON.parse(dataJson.sceneId)[0] == '1' ? '1' : '2'
+            //   dataJson.sceneId = JSON.parse(dataJson.sceneId)[0] == '1' ? '1' : '2'
+              this.allForm.sceneId = this.allForm.sceneIdAll == 1 ? [7] : JSON.parse(res.result.baseInfo
+              .sceneId)
+              this.allForm.sceneIdAll = JSON.parse(dataJson.sceneId).filter(item => item == 1).length > 0 ? 1 : 2
               dataJson.dayBudget = dataJson.dayBudget / 1000
               this.allForm.dayBudget = dataJson.dayBudget == 0 ? '0' : '1'
               this.allForm.useAppMarket = dataJson.useAppMarket ? (dataJson.useAppMarket == 0 ? false : true) :
@@ -644,7 +648,7 @@
               console.log(this.populationData.allForm, dataJson.agesRange)
               this.$nextTick(() => {
                 this.form.setFieldsValue(pick(dataJson, ['appId', 'urlType', 'url', 'dayBudget', 'speed',
-                  'showMode', 'sceneId'
+                  'showMode'
                 ]))
               })
             }
@@ -675,7 +679,7 @@
             var json = {
               ...values,
               //   sceneId: [values.sceneId],
-              sceneId: values.sceneId == 1 ? [values.sceneId] : this.allForm.sceneId,
+              sceneId: this.allForm.sceneIdAll == 1 ? [this.allForm.sceneIdAll] : this.allForm.sceneId,
               dayBudget: values.dayBudget * 1000
             }
             var params = {