pansl 1 год назад
Родитель
Сommit
43d18e6980

BIN
src/assets/pay-config-bg.jpg


+ 1 - 1
src/views/pageLayout/channelPageManage/form/videoList.vue

@@ -179,7 +179,7 @@ const validateData = () => {
   const nameSet = new Set();
 
   for (const item of multipleSelection.value) {
-    if (item.sort === null || item.sort === undefined) {
+    if (item.sort === null || item.sort === undefined || !item.sort) {
       ElMessage.error(`${item.name}的排序不能为空`)
       return false;
     }

+ 1 - 1
src/views/pageLayout/homePageManage/form/videoList.vue

@@ -179,7 +179,7 @@ const validateData = () => {
   const nameSet = new Set();
 
   for (const item of multipleSelection.value) {
-    if (item.sort === null || item.sort === undefined) {
+    if (item.sort === null || item.sort === undefined || !item.sort) {
       ElMessage.error(`${item.name}的排序不能为空`)
       return false;
     }

+ 47 - 27
src/views/videoManage/videoLibraryList/detail.vue

@@ -91,24 +91,24 @@
             <span class="mr-1 text-red-600">*</span>充值模板配置
           </div>
         </template>
+        <div class="items-center w-full withdraw-popup-warn">
+          <div>如果没有目标充值模板,请前往<span class="text-lg font-bold text-blue-400 cursor-pointer"
+              @click="toCharge">充值管理</span>进行添加</div>
+        </div>
         <div class="flex flex-col">
           <div>
-            <el-select v-model="formDataForm.callback_config_id" filterable remote clearable :remote-method="remoteMethod"
-              placeholder="请选择首充模板">
+            <el-select v-model="formDataForm.first_charge_template_id" filterable remote clearable
+              :remote-method="(query) => { remoteMethod(query, 'firstCharge') }" placeholder="请选择首充模板">
               <el-option v-for="(item, index) in firstTemplateList" :key="index" :label="item.name" :value="item.id" />
             </el-select>
           </div>
           <div>
-            <el-select v-model="formDataForm.callback_config_id" filterable remote clearable :remote-method="remoteMethod"
-              placeholder="请选择非首充模板">
+            <el-select v-model="formDataForm.not_first_charge_template_id" filterable remote clearable
+              :remote-method="(query) => { remoteMethod(query, 'notFirstCharge') }" placeholder="请选择非首充模板">
               <el-option v-for="(item, index) in nofirstTemplate" :key="index" :label="item.name" :value="item.id" />
             </el-select>
           </div>
-          <div>
-            <el-button type="primary" link size="default" @click="addTemplate">新增模板</el-button>
-          </div>
         </div>
-
       </el-form-item>
       <div class="flex justify-end">
         <el-button type="primary" @click="submitForm(form)">{{
@@ -156,24 +156,35 @@ const play = (e: object) => {
   current.value = e;
   playVisible.value = true;
 }
-const init = (params?: object) => {
-  channelPaytemplateList({ limit: 666, type: 1, ...params }).then(res => {
-    firstTemplateList.value = res.data
-  })
-  channelPaytemplateList({ limit: 666, type: 2, ...params }).then(res => {
-    nofirstTemplate.value = res.data
-  })
-}
 
-const remoteMethod = (query: string) => {
-  if (query) {
-    init({ name: query })
-  } else {
-    init()
+const remoteMethod = (query: string, type: string,) => {
+  console.log(query, 'queryquery', type);
+  switch (type) {
+    case 'firstCharge':
+      initRemoteOption('firstCharge', { name: query })
+      break;
+    case 'notFirstCharge':
+      initRemoteOption('notFirstCharge', { name: query })
+      break;
   }
 }
-const addTemplate = () => {
-  router.push({ path: '/chargeManage/charge', query: { id: props.primary.id } })
+const toCharge = () => {
+  router.push({ path: '/chargeManage/charge' })
+}
+
+const initRemoteOption = (type: string, params?: object) => {
+  switch (type) {
+    case 'firstCharge':
+      channelPaytemplateList({ limit: 666, type: 1, ...params }).then(res => {
+        firstTemplateList.value = res.data
+      })
+      break;
+    case 'notFirstCharge':
+      channelPaytemplateList({ limit: 666, type: 2, ...params }).then(res => {
+        nofirstTemplate.value = res.data
+      })
+      break;
+  }
 }
 
 const createLink = (e: object) => {
@@ -183,7 +194,8 @@ const createLink = (e: object) => {
 }
 
 const submitForm = (formEl: FormInstance | undefined) => {
-  loading.value = true;
+  if (!formDataForm.value.first_charge_template_id) return ElMessage.error('请选择首充模板')
+  if (!formDataForm.value.not_first_charge_template_id) return ElMessage.error('请选择非首充模板')
   if (!formEl) return;
   formEl
     .validate(valid => {
@@ -191,12 +203,10 @@ const submitForm = (formEl: FormInstance | undefined) => {
         tuiguangPromotionAdd(formDataForm.value).then(res => {
           console.log(res, 'tuiguangPromotionAddtuiguangPromotionAdd');
           ElMessage.success(res.message)
-          loading.value = false;
           linkVisible.value = false;
           router.push({ path: '/promotion/promotionList', query: { tab: 0 } })
         })
       } else {
-        loading.value = false;
       }
     })
     .then(() => { });
@@ -204,7 +214,8 @@ const submitForm = (formEl: FormInstance | undefined) => {
 
 onMounted(() => {
   search();
-  init()
+  initRemoteOption('firstCharge')
+  initRemoteOption('notFirstCharge')
 });
 </script>
 
@@ -222,4 +233,13 @@ video#my-player.video-js {
   word-wrap: break-word;
   word-break: break-all;
 }
+
+.withdraw-popup-warn {
+  padding: 10px;
+  margin-bottom: 10px;
+  font-weight: 600;
+  line-height: 1.8;
+  padding-left: 30px;
+  background-color: #ffecf4;
+}
 </style>