Parcourir la Source

feat: 批量助推订单 - 新增"重复创建次数"

zhengxy il y a 7 mois
Parent
commit
1facb78681

+ 21 - 1
src/components/businessMoudle/dataManage/taskVideo/configDrawer.vue

@@ -8,6 +8,10 @@
8 8
           <el-input class="input-wrap" v-model="form.title" placeholder="请输入标题" clearable />
9 9
         </div>
10 10
         <div class="form-item">
11
+          <div class="item-lable">重复创建次数</div>
12
+          <el-input-number v-model="form.times" :min="1" @change="onChangeTimes" />
13
+        </div>
14
+        <div class="form-item">
11 15
           <div class="item-lable">推广场景</div>
12 16
           <el-select v-model="form.campaign_type" filterable @change="onChangeCampaignType" style="width: 300px;">
13 17
             <el-option v-for="(item) in campaignTypeOptions" :label="item.label" :value="item.value" />
@@ -168,6 +172,7 @@ const unitChargeTypeOptions50 = [
168 172
 
169 173
 const form = reactive({
170 174
   title: '', // 标题
175
+  times: 1, // 重复创建次数
171 176
   campaign_type: 20, // 推广场景
172 177
   unit_charge_type: '' as any, // 优化目标
173 178
   unit_price_type: 2, // 出价方式 2智能 1自定义
@@ -214,6 +219,7 @@ watch(() => props.drawerVisible, isShow => {
214 219
 function handleInitForm() {
215 220
   console.log('handleInitForm => ')
216 221
   form.title = ''
222
+  form.times = 1
217 223
   form.campaign_type = 20
218 224
   form.unit_charge_type = ''
219 225
   form.unit_price_type = 2
@@ -262,12 +268,17 @@ const onClickConfirm = async () => {
262 268
 // 表单判空校验
263 269
 const handleValidate = () => {
264 270
   return new Promise(async (resolve, reject) => {
265
-    const { title, unit_price_type, unit_price, promotion_duration, amount, create_type, exec_time } = form
271
+    const { title, times, unit_price_type, unit_price, promotion_duration, amount, create_type, exec_time } = form
266 272
     if (!title) {
267 273
       ElMessage.warning('请输入标题')
268 274
       reject('检验未通过')
269 275
       return false
270 276
     }
277
+    if (!times || times < 1) {
278
+      ElMessage.warning('请输入重复创建次数(最小值为1)')
279
+      reject('检验未通过')
280
+      return false
281
+    }
271 282
     if (unit_price_type == 1 && !unit_price) {
272 283
       ElMessage.warning('请输入自定义出价')
273 284
       reject('检验未通过')
@@ -304,6 +315,7 @@ const handleSubmit = async () => {
304 315
 function handleGetParams() {
305 316
   const params: any = {
306 317
     title: form.title,
318
+    times: form.times,
307 319
     campaign_type: form.campaign_type,
308 320
     unit_charge_type: form.unit_charge_type,
309 321
     unit_price_type: form.unit_price_type,
@@ -342,6 +354,14 @@ function handleClearForm() {
342 354
   console.log('handleClearForm => ')
343 355
 }
344 356
 
357
+const onChangeTimes = async (val) => {
358
+  console.log('onChangeTimes val => ', val)
359
+  if (!val || val < 1) {
360
+    await nextTick()
361
+    form.times = 1
362
+  }
363
+}
364
+
345 365
 const onChangeCampaignType = (val) => {
346 366
   console.log('onChangeCampaignType => ', val)
347 367
   handleInitUnitChargeType()