|
@@ -45,6 +45,9 @@
|
|
|
<span slot="acountRelax" slot-scope="text, record">
|
|
|
<a-switch :checked="text === 0" @change="handleSwitchChang($event, record)"/>
|
|
|
</span>
|
|
|
+ <span solt="accountBudget" slot-scope="text, record">
|
|
|
+ {{ record.accountBudgetMode === '1' ? '不限' : text }}
|
|
|
+ </span>
|
|
|
<span slot="action" slot-scope="text, record">
|
|
|
<a @click="handleEdit(record)">编辑</a>
|
|
|
<a-divider type="vertical"/>
|
|
@@ -52,23 +55,7 @@
|
|
|
<a-divider type="vertical"/>
|
|
|
<a @click="handleUpdateMod(record)">修改出价</a>
|
|
|
<a-divider type="vertical"/>
|
|
|
- <a-popover v-model="record.show" trigger="click">
|
|
|
- <template slot="content">
|
|
|
- <div><a-input v-model="budgetContent" placeholder="请输入" style="width: 140px;"/></div>
|
|
|
- <div style="margin-top: 10px;">
|
|
|
- <a-button
|
|
|
- size="small"
|
|
|
- type="primary"
|
|
|
- style="margin-left: 15px;margin-right: 15px;"
|
|
|
- @click="handlePopoverSure(record, 'budget')"
|
|
|
- >
|
|
|
- 确定
|
|
|
- </a-button>
|
|
|
- <a-button size="small" @click="handleBudgetPopover(record)">取消</a-button>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- <a>修改预算</a>
|
|
|
- </a-popover>
|
|
|
+ <a @click="handleUpdateBudget(record)">修改预算</a>
|
|
|
</span>
|
|
|
</a-table>
|
|
|
<a-pagination
|
|
@@ -83,6 +70,44 @@
|
|
|
/>
|
|
|
</div>
|
|
|
<a-modal
|
|
|
+ title="修改预算"
|
|
|
+ v-if="budgetVisible"
|
|
|
+ :visible="budgetVisible"
|
|
|
+ dialog-class="mode-modal-class"
|
|
|
+ @ok="handleBudgetSure"
|
|
|
+ @cancel="handleBudgetCancel"
|
|
|
+ >
|
|
|
+ <div>
|
|
|
+ <a-form-model
|
|
|
+ ref="budgetForm"
|
|
|
+ :model="budgetForm"
|
|
|
+ :rules="budgetRules"
|
|
|
+ :label-col="labelCol"
|
|
|
+ :wrapper-col="wrapperCol"
|
|
|
+ >
|
|
|
+ <a-form-model-item label="预算方式">
|
|
|
+ <a-radio-group
|
|
|
+ v-model="budgetForm.budgetType"
|
|
|
+ button-style="solid"
|
|
|
+ @change="handleAccountMode"
|
|
|
+ >
|
|
|
+ <a-radio-button value="1">不限预算</a-radio-button>
|
|
|
+ <a-radio-button value="2">指定预算</a-radio-button>
|
|
|
+ </a-radio-group>
|
|
|
+ </a-form-model-item>
|
|
|
+ <a-form-model-item v-if="budgetForm.budgetType === '2'" label="账户日预算" prop="budget">
|
|
|
+ <a-input-number
|
|
|
+ v-model="budgetForm.budget"
|
|
|
+ :min="1000"
|
|
|
+ :max="9999999.99"
|
|
|
+ :step="0.01"
|
|
|
+ @blur="handleAccountBudget"
|
|
|
+ /> 元
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-form-model>
|
|
|
+ </div>
|
|
|
+ </a-modal>
|
|
|
+ <a-modal
|
|
|
title="修改出价"
|
|
|
v-if="modeVisible"
|
|
|
:visible="modeVisible"
|
|
@@ -203,6 +228,16 @@ export default {
|
|
|
}
|
|
|
};
|
|
|
return {
|
|
|
+ budgetVisible: false,
|
|
|
+ budgetForm: {
|
|
|
+ budgetType: '1',
|
|
|
+ budget: 0
|
|
|
+ },
|
|
|
+ budgetRules: {
|
|
|
+ budget: [
|
|
|
+ {required: true, message: '请输入', trigger: 'blur'}
|
|
|
+ ]
|
|
|
+ },
|
|
|
labelCol: {span: 4},
|
|
|
wrapperCol: {span: 14},
|
|
|
configForm: {
|
|
@@ -268,7 +303,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
title: '账户日预算量(元)',
|
|
|
- dataIndex: 'adBudget',
|
|
|
+ dataIndex: 'accountBudget',
|
|
|
align: 'center'
|
|
|
},
|
|
|
{
|
|
@@ -298,6 +333,12 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
...mapGetters(['nickname', 'avatar', 'userInfo']),
|
|
|
+ handleAccountMode(e) {
|
|
|
+ this.budgetForm.budget = 0;
|
|
|
+ },
|
|
|
+ handleAccountBudget(e) {
|
|
|
+ this.budgetForm.budget = Number(Number(e.target.value).toFixed(2));
|
|
|
+ },
|
|
|
handleModeSure() {
|
|
|
let paramsData = new FormData();
|
|
|
if (this.updateModTxt.adBidCreateType === 'FIX') {
|
|
@@ -339,37 +380,31 @@ export default {
|
|
|
this.updateModTxt = record;
|
|
|
this.modeVisible = true;
|
|
|
},
|
|
|
- handlePopoverSure(record, type) {
|
|
|
- const defaultList = {
|
|
|
- accountId: record.accountId,
|
|
|
- bid: this.modContent,
|
|
|
- budget: this.budgetContent,
|
|
|
- adId: record.adId ? record.adId : '',
|
|
|
- id: record.id,
|
|
|
- cost: record.cost
|
|
|
- };
|
|
|
+ handleUpdateBudget(record) {
|
|
|
+ this.updateModTxt = record;
|
|
|
+ this.budgetVisible = true;
|
|
|
+ },
|
|
|
+ handleBudgetSure() {
|
|
|
let paramsData = new FormData();
|
|
|
- if (type === 'mod') {
|
|
|
- }
|
|
|
- else if (type === 'budget') {
|
|
|
- if (Number(defaultList.budget) >= record.adBudget && Number(defaultList.budget) < (record.adBudget + 100)) {
|
|
|
- this.$message.error('单次修改预算幅度, 不能低于100.0元');
|
|
|
- return;
|
|
|
+ paramsData.append('accountId', this.updateModTxt.accountId);
|
|
|
+ paramsData.append('adId', this.updateModTxt.adId);
|
|
|
+ paramsData.append('type', 2);
|
|
|
+ paramsData.append('budget', this.budgetForm.budget);
|
|
|
+ paramsData.append('budgetType', this.budgetForm.budgetType);
|
|
|
+ paramsData.append('id', this.updateModTxt.id);
|
|
|
+ paramsData.append('cost', this.updateModTxt.cost);
|
|
|
+ this.$refs.budgetForm.validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ this.handlePopoverChange(paramsData);
|
|
|
}
|
|
|
- if (Number(defaultList.budget) <= record.adBudget && Number(defaultList.budget) > (record.adBudget - 100)) {
|
|
|
- this.$message.error('单次修改预算幅度, 不能低于100.0元');
|
|
|
- return;
|
|
|
+ else {
|
|
|
+ console.log('error submit!!');
|
|
|
+ return false;
|
|
|
}
|
|
|
- record.show = false;
|
|
|
- this.budgetContent = '';
|
|
|
- paramsData.append('accountId', defaultList.accountId);
|
|
|
- paramsData.append('adId', defaultList.adId);
|
|
|
- paramsData.append('type', 2);
|
|
|
- paramsData.append('budget', defaultList.budget);
|
|
|
- paramsData.append('id', defaultList.id);
|
|
|
- paramsData.append('cost', defaultList.cost);
|
|
|
- }
|
|
|
- this.handlePopoverChange(paramsData);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleBudgetCancel() {
|
|
|
+ this.budgetVisible = false;
|
|
|
},
|
|
|
handlePopoverChange(data) {
|
|
|
putAction(urlAcount + '/bytedance-api/advertiser/aiBytedanceAdvertiserStrategy/updStaOrCpaOrBudgetById', data).then(result => {
|
|
@@ -380,6 +415,7 @@ export default {
|
|
|
this.adStepBid = undefined;
|
|
|
this.adCpaBid = undefined;
|
|
|
this.modeVisible = false;
|
|
|
+ this.budgetVisible = false;
|
|
|
this.handleInitTable();
|
|
|
}
|
|
|
else {
|
|
@@ -405,6 +441,9 @@ export default {
|
|
|
result.result.records.forEach(item => {
|
|
|
item.show = false;
|
|
|
item.visible = false;
|
|
|
+ if (item.accountBudgetMode === '1') {
|
|
|
+ item.accountBudget = '不限';
|
|
|
+ }
|
|
|
});
|
|
|
this.dataSource = result.result.records;
|
|
|
this.totalAll = result.result.total;
|