Browse Source

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/views/template/budget/list.vue
syh 5 năm trước cách đây
mục cha
commit
7b0076e400

+ 1 - 0
src/components/jeecgbiz/JSelectUser.vue

@@ -43,6 +43,7 @@
       }
     },
     created() {
+      console.log(this.model)
     },
     methods: {
       open() {

+ 1 - 1
src/components/jeecgbiz/modal/JSelectUserByDepModal.vue

@@ -42,7 +42,7 @@
             :columns="columns"
             :dataSource="dataSource"
             :pagination="ipagination"
-            :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
+            :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type:'radio'}"
             @change="handleTableChange">
           </a-table>
         </a-card>

+ 1 - 1
src/components/jeecgbiz/modal/SelectUserListModal.vue

@@ -16,7 +16,7 @@
       :dataSource="dataSource"
       :pagination="ipagination"
       :loading="loading"
-      :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"></a-table>
+      :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type:'radio'}"></a-table>
   </a-modal>
 </template>
 

+ 5 - 0
src/mixins/JeecgListMixin.js

@@ -187,6 +187,11 @@ export const JeecgListMixin = {
       this.$refs.modalForm.title = "新增";
       this.$refs.modalForm.disableSubmit = false;
     },
+    handleOpen: function () {
+      this.$refs.userForm.open();
+      this.$refs.userForm.title = "选择";
+      this.$refs.userForm.disableSubmit = false;
+    },
     handleTableChange(pagination, filters, sorter) {
       //分页、排序、筛选变化时触发
       //TODO 筛选

+ 1 - 0
src/store/modules/user.js

@@ -11,6 +11,7 @@ const user = {
     realname: '',
     welcome: '',
     avatar: '',
+    orgcode : '',
     permissionList: [],
     info: {}
   },

+ 125 - 71
src/views/modules/advertiser/AdvertiserList.vue

@@ -99,11 +99,12 @@
       <a-modal
         title="账号绑定"
         v-model="visible"
-        @ok="handleOk"
+        @ok="handleSubmit"
         :width="800"
         :okButtonProps="{ props: {disabled: false} }"
         :cancelButtonProps="{ props: {disabled: false} }"
       >
+
         <a-form>
           <a-form-item
             label="选择方式"
@@ -119,8 +120,8 @@
             v-if="showLogin"
           >
             <a-form
-              :form="form"
-              @submit="loginForm">
+              :form="form">
+              <!-- @submit="loginForm">-->
               <a-form-item
                 label="账号:"
                 :label-col="{xs: {span: 24},sm: {span: 5}}"
@@ -142,20 +143,28 @@
                   <a-radio-button value="bytedance">头条</a-radio-button>
                 </a-radio-group>
               </a-form-item>
-              <a-form-item :wrapperCol="{ span: 24 }"
-                           style="text-align: center">
-                <a-button htmlType="submit" type="primary">提交</a-button>
+
+              <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"
-            >
+              :form="form">
+              <!--@submit="authorizationForm"-->
+
               <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">
@@ -163,10 +172,17 @@
                   <a-radio-button value="bytedance">头条</a-radio-button>
                 </a-radio-group>
               </a-form-item>
-              <a-form-item :wrapperCol="{ span: 24 }"
-                           style="text-align: center">
-                <a-button htmlType="submit" type="primary">提交</a-button>
+              <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>
 
@@ -177,6 +193,7 @@
 
     <!-- 表单区域 -->
     <advertiser-modal ref="modalForm" @ok="modalFormOk"></advertiser-modal>
+    <j-select-user ref="userForm" @ok="modalFormOk"></j-select-user>
   </a-card>
 </template>
 
@@ -184,8 +201,12 @@
   import AdvertiserModal from './modules/AdvertiserModal'
   import {JeecgListMixin} from '@/mixins/JeecgListMixin'
   import JTreeSelect from '@/components/jeecg/JTreeSelect'
-  import {deleteAction, postAction, getAction} from '@/api/manage'
   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 {
@@ -194,10 +215,16 @@
     components: {
       AFormItem,
       AdvertiserModal,
-      JTreeSelect
+      JTreeSelect,
+      JSelectUserByDep,
+      JSelectDepart,
+      JSelectUser
     },
     data() {
       return {
+        departDisabled: false, //是否是我的部门调用该页面
+        users: this.userInfo().realname,//用户名称
+        departmentId: this.userInfo().departId, //部门id
         description: '广告主信息表管理页面',
         visible: false,
         accountName: '',
@@ -258,8 +285,12 @@
           deleteBatch: '/ctop/advertiser/deleteBatch',
           exportXlsUrl: 'ctop/advertiser/exportXls',
           importExcelUrl: 'ctop/advertiser/importExcel',
-          bindAccountLoginUrl: '/ctop/bindAccount/login',
-          bindAuthorizationUrl: '/ctop/bindAccount/authorization',
+          bindAccountLoginUrl: '/ctop/bindAccountLogin/login',
+          bindAuthorizationUrl: '/ctop/bindAccountAuth/authorization',
+          getLoginInfo: '/ctop/bindAccount/getLoginInfo',
+          userId: "/sys/user/generateUserId", // 引入生成添加用户情况下的url
+          userWithDepart: "/sys/user/userDepartList", // 引入为指定用户查看部门信息需要的url
+
         },
       }
     },
@@ -269,67 +300,72 @@
       }
     },
     methods: {
-      loginForm(e) {
-        e.preventDefault()
-        this.form.validateFields((err, values) => {
-            if (!err) {
-              if (this.mode == 'login') {
-                let params = {};
-                params.advertiserId = this.record.id;
-                params.accountName = this.accountName;
-                params.password = this.password;
-                params.loginType = this.loginType;
-                console.log(this.loginType)
-                getAction(this.url.bindAccountLoginUrl, params).then((res) => {
-                  if (res.success) {
-                    alert("绑定成功");
-                    this.accountName = '';
-                    this.password = '';
-                    this.loginType = '';
-                  } else {
-                    alert("绑定失败");
-                  }
-                });
-              }
-            }
+      ...mapGetters(["nickname", "avatar", "userInfo"]),
+
+      handleSubmit() {
+        /*postAction(this.url.getLoginInfo).then((res) => {
+          if (res.success) {
+            alert("绑定成功");
+            this.accountName = '';
+            this.password = '';
+            this.loginType = '';
+          } else {
+            alert("绑定失败");
           }
-        )
-      },
+        });*/
+        let params = {};
+        params.advertiserId = this.record.id;
+        params.advertiser_name = this.record.name;
+        params.userId = this.userInfo().id;
+        params.realName = this.userInfo().realname;
+        params.departmentId = this.departmentId;
+        params.distributionName = this.users;
 
-      authorizationForm(e) {
-        e.preventDefault()
-        this.form.validateFields((err, values) => {
-            if (!err) {
-              if (this.mode == 'authorization') {
-                let params = {};
-                params.advertiserId = this.record.id;
-                params.authorizationType = this.authorizationType;
-                getAction(this.url.bindAuthorizationUrl, params).then((res) => {
-                  if (res.success) {
-                    alert("绑定成功");
-                    window.open(res.message, '_blank');
-                  } else {
-                    alert("绑定失败");
-                  }
-                });
+        // 触发表单验证
+        this.form.validateFields((err) => {
+          if (!err) {
+            if (this.mode == 'login') {
+              params.accountName = this.accountName;
+              params.password = this.password;
+              params.loginType = this.loginType;
+              if (this.loginType == 'kuaishou') {
+                params.mediaId = 2;
+              } else if (this.loginType == 'bytedance') {
+                params.mediaId = 1;
+              }
+              postAction(this.url.bindAccountLoginUrl, params).then((res) => {
+                if (res.success) {
+                  alert("绑定成功");
+                  this.accountName = '';
+                  this.password = '';
+                  this.loginType = '';
+                } else {
+                  alert("绑定失败");
+                }
+              });
+            }
+            // 授权登录
+            if (this.mode == 'authorization') {
+              params.authorizationType = this.authorizationType;
+              if (this.authorizationType == 'kuaishou') {
+                params.mediaId = 2;
+              } else if (this.authorizationType == 'bytedance') {
+                params.mediaId = 1;
               }
+              postAction(this.url.bindAuthorizationUrl, params).then((res) => {
+                if (res.success) {
+                  window.open(res.message, '_blank');
+                } else {
+                  alert("绑定失败");
+                }
+              });
             }
+
           }
-        )
-      },
+        })
 
-      showModal(record) {
-        this.record = record
-        this.visible = true
-      },
-      handleOk(e) {
-        console.log(e);
-        this.visible = false
-      },
-      handleCancel(e) {
-        console.log(e);
-        this.visible = false
       },
+
       onChageLogin() {
         console.log(this.mode)
         if (this.mode == 'login') {
@@ -341,9 +377,27 @@
 
 
         }
-      }
+      },
+      showModal(record) {
+        this.record = record
+        this.visible = true
+      },
+
+      handleCancel() {
+        this.close()
+      },
+    },
 
+    handleOk(e) {
+      console.log(e);
+      this.visible = false
+    },
+    handleCancel(e) {
+      console.log(e);
+      this.visible = false
     }
+
+
   }
 </script>
 <style scoped>

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1030 - 0
src/views/modules/bytedance/model/InternalModel.vue


+ 8 - 120
src/views/template/budget/list.vue

@@ -7,41 +7,14 @@
         <a-row :gutter="24">
 
           <a-col :md="6" :sm="8">
-            <a-form-item label="广告主id">
-              <a-input placeholder="请输入广告主id" v-model="queryParam.advertiserId"></a-input>
+            <a-form-item label="模板名称">
+              <a-input placeholder="请输入模板名称" v-model="queryParam.name"></a-input>
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="8">
-            <a-form-item label="头条账号id">
-              <a-input placeholder="请输入头条账号id" v-model="queryParam.toutiaoId"></a-input>
-            </a-form-item>
-          </a-col>
-          <template v-if="toggleSearchStatus">
-            <a-col :md="6" :sm="8">
-              <a-form-item label="bidType">
-                <a-input placeholder="请输入bidType" v-model="queryParam.bidType"></a-input>
-              </a-form-item>
-            </a-col>
-            <a-col :md="6" :sm="8">
-              <a-form-item label="flowControlMode">
-                <a-input placeholder="请输入flowControlMode"
-                         v-model="queryParam.flowControlMode"></a-input>
-              </a-form-item>
-            </a-col>
-            <a-col :md="6" :sm="8">
-              <a-form-item label="budgetPrice">
-                <a-input placeholder="请输入budgetPrice" v-model="queryParam.budgetPrice"></a-input>
-              </a-form-item>
-            </a-col>
-          </template>
-          <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>
 
@@ -52,31 +25,10 @@
     <!-- 操作按钮区域 -->
     <div class="table-operator">
       <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
-      <a-button type="primary" icon="download" @click="handleExportXls('今日头条预算模板信息')">导出</a-button>
-      <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-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>
-        <a-button style="margin-left: 8px"> 批量操作
-          <a-icon type="down"/>
-        </a-button>
-      </a-dropdown>
     </div>
 
     <!-- table区域-begin -->
     <div>
-      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
-        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{
-        selectedRowKeys.length }}</a>项
-        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
-      </div>
 
       <a-table
         ref="table"
@@ -87,23 +39,10 @@
         :dataSource="dataSource"
         :pagination="ipagination"
         :loading="loading"
-        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
         @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>
 
       </a-table>
@@ -119,7 +58,6 @@
   import ByteDanceBudgetTemplateModal from './modules/ByteDanceBudgetTemplateModal'
   import {JeecgListMixin} from '@/mixins/JeecgListMixin'
   import jq from 'jquery'
-
   export default {
     name: "ByteDanceBudgetTemplateList",
     mixins: [JeecgListMixin],
@@ -142,69 +80,19 @@
             }
           },
           {
-            title: '出价方式',
-            align: "center",
-            dataIndex: 'bidType'
-          },
-          {
-            title: '投放方式',
-            align: "center",
-            dataIndex: 'flowControlMode'
-          },
-          {
-            title: '预算价格',
-            align: "center",
-            dataIndex: 'budgetPrice'
-          },
-          {
-            title: '预算类型',
-            align: "center",
-            dataIndex: 'budgetPriceMode'
-          },
-          {
-            title: '投放时间模式',
-            align: "center",
-            dataIndex: 'flowDateType'
-          },
-          {
-            title: '开始时间',
-            align: "center",
-            dataIndex: 'startDate'
-          },
-          {
-            title: '结束时间',
-            align: "center",
-            dataIndex: 'endDate'
-          },
-          {
-            title: '投放时间段方式',
-            align: "center",
-            dataIndex: 'dateQuantum'
-          },
-          {
-            title: '投放时间段',
-            align: "center",
-            dataIndex: 'dateQuantumRange'
-          },
-          {
-            title: '付费方式',
-            align: "center",
-            dataIndex: 'priceType'
-          },
-          {
-            title: '目标转化出价',
+            title: '模板名称',
             align: "center",
-            dataIndex: 'convertPrice'
+            dataIndex: 'name'
           },
           {
-            title: '过滤已转化用户',
+            title: '创建人',
             align: "center",
-            dataIndex: 'filterType'
+            dataIndex: 'createBy'
           },
           {
-            title: '状态',
+            title: '修改人',
             align: "center",
-            dataIndex: 'status'
+            dataIndex: 'updateBy'
           },
           {
             title: '操作',

+ 137 - 55
src/views/template/budget/modules/ByteDanceBudgetTemplateModal.vue

@@ -10,6 +10,13 @@
         <a-spin :spinning="confirmLoading">
           <a-form @submit="handleSubmit" :form="form">
             <a-form-item
+              label="模板名称"
+            :labelCol="labelCol"
+            :wrapperCol="wrapperCol">
+              <a-input v-model="name"  placeholder="请输入模板名称">
+              </a-input>
+            </a-form-item>
+            <a-form-item
               label="出价方式"
               :labelCol="labelCol"
               :wrapperCol="wrapperCol">
@@ -40,7 +47,6 @@
                 <a-select
                   slot="addonBefore"
                   v-model="budgetPriceMode"
-                  v-decorator="['prefix',{ initialValue: 'BUDGET_MODE_DAY' }]"
                   style="width: 100px">
                   <a-select-option value="BUDGET_MODE_DAY">日预算</a-select-option>
                   <a-select-option value="BUDGET_MODE_TOTAL">总预算</a-select-option>
@@ -60,28 +66,23 @@
               </a-radio-group>
             </a-form-item>
 
-            <a-form-item label="起始时间"
+            <a-form-item label="投放时间"
                          v-if="showDateFlowRange"
                          :labelCol="labelCol"
                          :wrapperCol="wrapperCol">
-              开始时间:
-              <a-date-picker v-model="startDate"
-                             format="YYYY-MM-DD"
-                             :disabledDate="disabledDate"
-              />
-              结束时间:
-              <a-date-picker v-model="endDate"
-                             format="YYYY-MM-DD"
-                             :disabledDate="disabledDate"
-              />
+              <a-range-picker
+                name="buildTime"
+                style="width: 100%"
+                v-model="time"/>
             </a-form-item>
             <a-form-item
               label="投放时段"
               :labelCol="labelCol"
               :wrapperCol="wrapperCol">
-              <a-radio-group @change="dateQuantumChange" v-model="dateQuantum">
+              <a-radio-group
+                v-model="dateQuantum" @change="dateQuantumChange">
                 <a-radio-button value="date_unlimited">不限</a-radio-button>
-                <a-radio-button value="date_appoint">指定时间段</a-radio-button>
+                <a-radio-button value="date_appoint">按时间段投放</a-radio-button>
               </a-radio-group>
             </a-form-item>
             <a-form-item
@@ -90,6 +91,7 @@
               :labelCol="labelCol"
               :wrapperCol="wrapperCol">
               <div id="table_time_selected1" class="table_time_selected1">
+
               </div>
             </a-form-item>
             <a-form-item
@@ -106,20 +108,20 @@
               label="目标转化出价"
               :labelCol="labelCol"
               :wrapperCol="wrapperCol">
-              <a-input-number v-model="convertPrice" :min="0" :max="10"/>
+              <a-input-number v-model="convertPrice" :min="0" :max="10000000"/>
             </a-form-item>
-            <a-form-item
-              label="过滤已转化用户"
-              :labelCol="labelCol"
-              :wrapperCol="wrapperCol">
-              <a-radio-group v-model="filterType">
-                <a-radio-button v-for="filterType in filterTypeList" :key="filterType.itemValue"
-                                :value="filterType.itemValue">
-                  {{filterType.itemText}}
-                </a-radio-button>
-              </a-radio-group>
-            </a-form-item>
+<!--            <a-form-item-->
+<!--              label="过滤已转化用户"-->
+<!--              :labelCol="labelCol"-->
+<!--              :wrapperCol="wrapperCol">-->
+<!--              <a-radio-group v-model="filterType">-->
+<!--                <a-radio-button v-for="filterType in filterTypeList" :key="filterType.itemValue"-->
+<!--                                :value="filterType.itemValue">-->
+<!--                  {{filterType.itemText}}-->
+<!--                </a-radio-button>-->
+<!--              </a-radio-group>-->
+<!--            </a-form-item>-->
           </a-form>
         </a-spin>
     </a-modal>
@@ -127,16 +129,20 @@
 
 <script>
     import {deleteAction, postAction, getAction} from '@/api/manage'
+    import pick from 'lodash.pick'
     import jq from 'jquery'
     import moment from 'moment';
-
+    import AFormItem from "ant-design-vue/es/form/FormItem";
+    let dateQuantumRangeConst = '';
     export default {
       name: 'ByteDanceBudgetTemplateModal',
+      components: {AFormItem},
       data() {
         return {
           title: "操作",
           visible: false,
           model: {},
+          time:[],
           labelCol: {
             xs: {span: 24},
             sm: {span: 5},
@@ -145,9 +151,20 @@
             xs: {span: 24},
             sm: {span: 16},
           },
+          // validatorRules: {
+          //   name: {rules: [{required: true, message: '请输入模板名称!'}]},
+          //   convertPrice: {rules: []},
+          //   priceType: {rules: []},
+          //   dateQuantum: {rules: []},
+          //   flowDateType: {rules: []},
+          //   budgetPrice:{rules:[]},
+          //   budgetPriceMode: {rules: []},
+          //   flowControlMode: {rules: []},
+          //   bidType: {rules: []},
+          //   time:{rules:[]}
+          // },
+          name:'',
           confirmLoading: false,
-          startDate:moment(new Date(), "YYYY-MM-dd"),
-          endDate:moment(new Date(), "YYYY-MM-dd"),
           convertPrice: 0,
           budgetPrice: 0,
           budgetPriceMode: 'BUDGET_MODE_DAY',
@@ -174,13 +191,64 @@
       },
       methods: {
         add() {
-          this.edit({});
+          this.edit({
+            id:null,
+            time:[],
+            convertPrice:0,
+            priceType:'PRICING_OCPM',
+            dateQuantum:'date_unlimited',
+            dateQuantumRange:'',
+            flowDateType:'SCHEDULE_FROM_NOW',
+            budgetPrice:0,
+            budgetPriceMode:'BUDGET_MODE_DAY',
+            flowControlMode:'FLOW_CONTROL_MODE_FAST',
+            bidType:'SMART_BID_CUSTOM',
+            filterType:'NO_EXCLUDE'
+          });
         },
         edit(record) {
           this.form.resetFields();
+
+          // this.time[0] = record.startDate
+          // this.time[1] = record.endDate
           this.model = Object.assign({}, record);
           this.visible = true;
-
+          this.id=record.id
+          this.name=record.name
+          this.convertPrice=record.convertPrice
+          this.budgetPrice=record.budgetPrice
+          this.budgetPriceMode=record.budgetPriceMode
+          this.flowControlMode=record.flowControlMode
+          this.flowDateType=record.flowDateType
+          this.dateQuantum=record.dateQuantum
+          if(record.dateQuantumRange != undefined){
+            this.dateQuantumRange=record.dateQuantumRange
+            dateQuantumRangeConst = record.dateQuantumRange
+          }
+          if(record.startDate != null && record.endDate != null){
+            this.time=[moment(record.startDate),moment(record.endDate)]
+          }
+          this.bidType=record.bidType
+          this.priceType=record.priceType
+          this.price=record.price
+          this.filterType=record.filterType
+          if (this.flowDateType == 'SCHEDULE_FROM_NOW') {
+            this.showDateFlowRange = false;
+          } else {
+            this.showDateFlowRange = true;
+          }
+          if (this.dateQuantum == 'date_unlimited') {
+            this.showDateQuantumRange = false;
+          } else {
+            this.showDateQuantumRange = true;
+            jq(function () {
+              load_time_table('table_time_selected1',dateQuantumRangeConst);
+            });
+          }
+          // this.$nextTick(() => {
+          //   this.form.setFieldsValue(pick(this.model, 'name', 'convertPrice', 'priceType', 'dateQuantum', 'flowDateType', 'budgetPriceMode', 'flowControlMode', 'bidType','budgetPrice','startDate','endDate'))
+          //   //时间格式化
+          // });
         },
         close() {
           this.$emit('close');
@@ -200,13 +268,17 @@
               console.log('Received values of form: ', values);
               let params = {};
               this.dateQuantumRange = jq("#table_time_selected1_time_num").val();
+              params.id=this.id;
+              params.name=this.name;
               params.bidType = this.bidType;
               params.flowControlMode = this.flowControlMode;
               params.budgetPrice = this.budgetPrice;
               params.budgetPriceMode = this.budgetPriceMode;
               params.flowDateType = this.flowDateType;
-              params.startDate = this.startDate;
-              params.endDate = this.endDate;
+              if(this.time != [] && this.time.length==2){
+                params.startDate = moment(this.time[0]).format('YYYY-MM-DD')
+                params.endDate = moment(this.time[1]).format('YYYY-MM-DD')
+              }
               params.dateQuantum = this.dateQuantum;
               params.priceType = this.priceType;
               params.convertPrice = this.convertPrice;
@@ -216,8 +288,14 @@
               postAction(this.url.insertUrl,params).then((res)=>{
                 console.log(res)
                 if(res.success){
-                  alert("预算模板创建成功");
+                  this.$message.success(res.message);
+                  this.$emit('ok');
+                  this.close();
+                }else {
+                  this.$message.warning(res.message);
                 }
+                this.confirmLoading = false;
+
               });
             }
           })
@@ -226,12 +304,13 @@
           console.log(value)
         },
         dateQuantumChange(value){
-          console.log(this.dateQuantum);
           if (this.dateQuantum == 'date_unlimited') {
             this.showDateQuantumRange = false;
           } else {
             this.showDateQuantumRange = true;
-            load_time_table('table_time_selected1');
+            jq(function () {
+              load_time_table('table_time_selected1',dateQuantumRangeConst);
+            });
           }
         },
         onChangeFlowDate() {
@@ -581,7 +660,6 @@
           }
         }
         arr_hour[i] = oDate_hour + ':' + oDate_minute;
-        // alert(oDate_hour + ':' + oDate.getMinutes());
       }
       return arr_hour;
     }
@@ -605,7 +683,7 @@
     function binary_selected(){
       var default_time_val = jq('#'+box_id+' .default_time_val').val();
       if (default_time_val) {
-        for(i=0 ; i<336; i++){
+        for(var i=0 ; i<336; i++){
           var td_selected = default_time_val.charAt(i);
           if (td_selected != 0 ) {
             jq('#' + box_id + ' table tbody tr td').eq(i).attr('class','Selected');
@@ -619,11 +697,12 @@
 
 
     //实例化程序
-    function load_time_table(id){
+    function load_time_table(id,value){
       //包住table的元素id
       box_id = id;
       var html;
-      html = '<table cellspacing="0" cellpadding="0" border="0" class="plug-timer-grid"  onselectstart="return false" onselect="document.selection.empty()">';
+      html = '<input type="hidden" class="default_time_val" value="'+value+'"/>';
+      html += '<table cellspacing="0" cellpadding="0" border="0" class="plug-timer-grid"  onselectstart="return false" onselect="document.selection.empty()">';
       html += '<thead>';
       html += '<tr>';
       html += '<th></th>';
@@ -636,15 +715,13 @@
       html += '</thead>';
       html += '<tbody></tbody>';
       html += '</table>';
-      html += '<input class="focus" style="opacity: 0;">';
-      html += '<div id="'+box_id+'_time_seled"></div>';
-      html += '<input v-model="dateQuantumRange" type="hidden" id="'+box_id+'_time_num" name="time" caption="每日投放时段" switchname="selectTime"  value="">';
-
+      html += '<input class="focus" type="hidden" style="opacity: 0;">';
+      html += '<div id="'+box_id+'_time_seled" style="line-height: 15px;font-size:10px;"></div>';
+      html += '<input type="hidden" id="'+box_id+'_time_num" name="time" caption="每日投放时段" switchname="selectTime"  value="'+value+'">';
+      jq('#'+box_id).html('');
       jq('#'+box_id).append(html);
-      console.log(jq('#table_time_selected1').html())
       var html_tbody_td = '';
       var html_thead_td = '';
-
       //创建表格
       for (var i = 0; i < 7; i++) {
         var week = i+1;
@@ -779,14 +856,19 @@
       return convert_date(binary);
     }
 
-    jq(function(){
-      load_time_table('table_time_selected1');
-    });
+    // jq(function(){
+    //   load_time_table('table_time_selected1',this.dateQuantumRange);
+    // });
 
 </script>
 <style type="text/css">
-  .plug-timer-grid{width: 80%;}
-  .plug-timer-grid td, .plug-timer-grid th{border: 1px solid #97B4D1;text-align: center; /*cursor:pointer;*/}
+  .plug-timer-grid{width: 100%;}
+  .plug-timer-grid td, .plug-timer-grid th{
+    border: 1px solid #97B4D1;
+    text-align: center; /*cursor:pointer;*/
+    font-size: 10px;
+    line-height: 10px;
+  }
   .Selected{background-color: rgb(102,162,243);opacity: 0.5;}
 
   .plug-timer-grid {
@@ -800,7 +882,7 @@
   }
 
   table td{
-    height: 30px;
+    height: 20px;
     max-width: 5px;
     border: 1px solid #dfe6ec;
     font-size: 12px;
@@ -817,7 +899,7 @@
   .plug-timer-grid tbody tr td{
     width: 2%;
   }
-  .clear{
-    margin:20px 0px 20px 0px;
-  }
+  /*.clear{*/
+  /*  margin:20px 0px 20px 0px;*/
+  /*}*/
 </style>

+ 1 - 1
src/views/template/campaign/modules/ByteDanceCampaignTemplateModal.vue

@@ -128,7 +128,7 @@
         console.log(value);
       },
       showBudgetStatusChange(){
-        if(this.campaignBudget == 'UNLIMITED'){
+        if(this.campaignBudget == 'BUDGET_MODE_INFINITE'){
           this.showBudgetDaily = false;
         }else{
           this.showBudgetDaily = true;