From d536f51ef63e4cf589ae85aa79e7a7642d774355 Mon Sep 17 00:00:00 2001
From: 44323 <443237572@qq.com>
Date: 星期二, 12 三月 2024 09:40:19 +0800
Subject: [PATCH] Merge branch '2.0' of http://120.76.84.145:10101/gitblit/r/java/PlayPai into 2.0
---
cloud-server-management/src/main/webapp/static/modular/system/coursePackage/coursePackage_info.js | 376 +++++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 330 insertions(+), 46 deletions(-)
diff --git a/cloud-server-management/src/main/webapp/static/modular/system/coursePackage/coursePackage_info.js b/cloud-server-management/src/main/webapp/static/modular/system/coursePackage/coursePackage_info.js
index 24a5b26..d994f41 100644
--- a/cloud-server-management/src/main/webapp/static/modular/system/coursePackage/coursePackage_info.js
+++ b/cloud-server-management/src/main/webapp/static/modular/system/coursePackage/coursePackage_info.js
@@ -48,7 +48,9 @@
* 提交添加用户
*/
CoursePackageInfo.addSubmit = function () {
-
+ let objectType= $('#objectType').val();
+ console.log("看看角色类型")
+ console.log(objectType)
let province = $('#provinceCode option:checked').text();
let provinceCode = $('#provinceCode').val();
let city = $('#cityCode option:checked').text();
@@ -107,6 +109,9 @@
$('#price > .form-group').each(function (i, e) {
let classHours = $($(e).find(".classNumber_span input[class='classNumber']")[0]).val();
let cash = $($(e).find(".cash_span input[class='cash']")[0]).val();
+ if (typeof cash == "undefined"){
+ console.log("========进入===")
+ }
let paiCoin = $($(e).find(".paiCoin_span input[class='paiCoin']")[0]).val();
let counpons = $($(e).find(".counpons")).val();
price.push({
@@ -116,14 +121,18 @@
couponIds: typeof counpons == "undefined" ? 0 : counpons
});
});
- if(null == provinceCode || '' == provinceCode){
- Feng.error("所在省不能为空");
- return
+
+ if (objectType==1){
+ if(null == provinceCode || '' == provinceCode){
+ Feng.error("所在省不能为空");
+ return
+ }
+ if(null == cityCode || '' == cityCode){
+ Feng.error("所在市不能为空");
+ return
+ }
}
- if(null == cityCode || '' == cityCode){
- Feng.error("所在市不能为空");
- return
- }
+
if(null == storeId || '' == storeId){
Feng.error("所属门店不能为空");
return
@@ -144,32 +153,153 @@
Feng.error("授课教师不能为空");
return
}
- // if(null == maxSubscribeNumber || '' == maxSubscribeNumber){
- // Feng.error("最多预约人数不能为空");
- // return
- // }
- // if(null == codeTime || '' == codeTime){
- // Feng.error("扣除课时数不能为空不能为空");
- // return
- // }
- // if(null == classStartTime || '' == classStartTime){
- // Feng.error("上课时间不能为空");
- // return
- // }
- // if(null == classWeeks || '' == classWeeks){
- // Feng.error("上课时间不能为空");
- // return
- // }
- // if(null == detailDrawing || '' == detailDrawing){
- // Feng.error("详情页不能为空");
- // return
- // }
- // if(null == validDays || '' == validDays){
- // Feng.error("课时有效期不能为空");
- // return
- // }
+
+ var checkboxes1 = document.getElementsByName('payType');
+ var isChecked1 = false;
+
+ for (var i = 0; i < checkboxes1.length; i++) {
+ if (checkboxes1[i].checked) {
+ isChecked1 = true;
+ break;
+ }
+ }
+
+ console.log("看看选中")
+ console.log(isChecked1)
+ if (isChecked1) {
+ console.log("At least one checkbox is selected.");
+ } else {
+ Feng.error("请选择支付方式")
+ return;
+ }
+
+
+ var checkboxes = document.getElementsByName('payType');
+ var isChecked = false;
+ var isChecked1 = false;
+
+ for (var i = 0; i < checkboxes.length; i++) {
+ if (checkboxes[i].checked && checkboxes[i].value === '1') {
+ isChecked = true;
+ break;
+ }
+ }
+
+ for (var i = 0; i < checkboxes.length; i++) {
+ if (checkboxes[i].checked && checkboxes[i].value === '2') {
+ isChecked1 = true;
+ break;
+ }
+ }
+
+ if (isChecked1) {
+ var elements3 = document.getElementsByClassName('paiCoin');
+
+ for (var i = 0; i < elements3.length; i++) {
+ var value = elements3[i].value.trim();
+
+ if (value === '') {
+ Feng.error("请输入玩湃币价格")
+ return;
+ // Value is empty
+ // Perform your desired action
+ } else {
+ // Value is not empty
+ // Perform other actions
+ }
+ }
+
+
+ }
+
+
+
+ if (isChecked) {
+ var elements2 = document.getElementsByClassName('cash');
+
+ for (var i = 0; i < elements2.length; i++) {
+ var value = elements2[i].value.trim();
+
+ if (value === '') {
+ Feng.error("请输入现金价格")
+ return;
+ // Value is empty
+ // Perform your desired action
+ } else {
+ // Value is not empty
+ // Perform other actions
+ }
+ }
+
+
+ }
+
+ if (type == 1 ) {
+ var elements1 = document.getElementsByClassName('classNumber');
+
+ for (var i = 0; i < elements1.length; i++) {
+ var value = elements1[i].value.trim();
+
+ if (value === '') {
+ Feng.error("请输入课时数")
+ return;
+ // Value is empty
+ // Perform your desired action
+ } else {
+ // Value is not empty
+ // Perform other actions
+ }
+ }
+
+
+
+
+ var elements = document.querySelectorAll('[name="classStartTime"]');
+ var isEmpty = false;
+
+ for (var i = 0; i < elements.length; i++) {
+ if (elements[i].value.trim() === '') {
+ isEmpty = true;
+ break;
+ }
+ }
+
+ if (isEmpty) {
+ Feng.error("请输入上课时间")
+ return;
+ console.log("At least one element with the name 'yourName' is empty.");
+ } else {
+ console.log("All elements with the name 'yourName' are filled.");
+ }
+
+
+
+ if (null == maxSubscribeNumber || '' == maxSubscribeNumber) {
+ Feng.error("最多预约人数不能为空");
+ return
+ }
+ if (null == codeTime || '' == codeTime) {
+ Feng.error("扣除课时数不能为空");
+ return
+ }
+ if (null == classStartTime || '' == classStartTime) {
+ Feng.error("上课时间不能为空");
+ return
+ }
+ if (null == classWeeks || '' == classWeeks) {
+ Feng.error("上课时间不能为空");
+ return
+ }
+
+
+
+ if (null == validDays || '' == validDays) {
+ Feng.error("课时有效期不能为空");
+ return
+ }
+ }
classWeeks = classWeeks.substring(0, classWeeks.length - 1);
if(null == coverDrawing || '' == coverDrawing){
@@ -261,13 +391,13 @@
}
- let holitime = $('#holitime').val();
var inputElements = document.querySelectorAll('input[name="classStartTime"]');
- let classStartTime = JSON.stringify(Array.from(inputElements).map(function(element) {
+ var classStartTime = JSON.stringify(Array.from(inputElements).map(function(element) {
return element.value;
}))
-
+ console.log("看下修改后的时间");
+ console.log(classStartTime)
// let classStartTime = $('#classStartTime').val();
let classWeeks = '';
$('input[name="classWeeks"]:checked').each(function (index, e) {
@@ -287,6 +417,8 @@
let paiCoin = $($(e).find(".paiCoin_span input[class='paiCoin']")[0]).val();
let counpons = $($(e).find(".counpons")).val();
+
+
price.push({
classHours: classHours,
cashPayment: typeof cash == "undefined" ? 0 : cash,
@@ -295,14 +427,18 @@
})
});
- if(null == provinceCode || '' == provinceCode){
- Feng.error("所在省不能为空");
- return
+
+ if ($('#objectType').val() == 1) {
+ if (null == provinceCode || '' == provinceCode) {
+ Feng.error("所在省不能为空");
+ return
+ }
+ if (null == cityCode || '' == cityCode) {
+ Feng.error("所在市不能为空");
+ return
+ }
}
- if(null == cityCode || '' == cityCode){
- Feng.error("所在市不能为空");
- return
- }
+
if(null == storeId || '' == storeId){
Feng.error("所属门店不能为空");
return
@@ -339,6 +475,152 @@
// Feng.error("周不能为空");
// return
// }
+ if (type == 1 ) {
+
+ var checkboxes1 = document.getElementsByName('payType');
+ var isChecked1 = false;
+
+ for (var i = 0; i < checkboxes1.length; i++) {
+ if (checkboxes1[i].checked) {
+ isChecked1 = true;
+ break;
+ }
+ }
+
+ if (isChecked1) {
+ console.log("At least one checkbox is selected.");
+ } else {
+ Feng.error("请选择支付方式")
+ return;
+ }
+
+
+ var checkboxes = document.getElementsByName('payType');
+ var isChecked = false;
+ var isChecked1 = false;
+
+ for (var i = 0; i < checkboxes.length; i++) {
+ if (checkboxes[i].checked && checkboxes[i].value === '1') {
+ isChecked = true;
+ break;
+ }
+ }
+
+ for (var i = 0; i < checkboxes.length; i++) {
+ if (checkboxes[i].checked && checkboxes[i].value === '2') {
+ isChecked1 = true;
+ break;
+ }
+ }
+
+ if (isChecked1) {
+ var elements3 = document.getElementsByClassName('paiCoin');
+
+ for (var i = 0; i < elements3.length; i++) {
+ var value = elements3[i].value.trim();
+
+ if (value === '') {
+ Feng.error("请输入玩湃币价格")
+ return;
+ // Value is empty
+ // Perform your desired action
+ } else {
+ // Value is not empty
+ // Perform other actions
+ }
+ }
+
+
+ }
+
+
+
+ if (isChecked) {
+ var elements2 = document.getElementsByClassName('cash');
+
+ for (var i = 0; i < elements2.length; i++) {
+ var value = elements2[i].value.trim();
+
+ if (value === '') {
+ Feng.error("请输入现金价格")
+ return;
+ // Value is empty
+ // Perform your desired action
+ } else {
+ // Value is not empty
+ // Perform other actions
+ }
+ }
+
+
+ }
+
+
+ var elements1 = document.getElementsByClassName('classNumber');
+
+ for (var i = 0; i < elements1.length; i++) {
+ var value = elements1[i].value.trim();
+
+ if (value === '') {
+ Feng.error("请输入课时数")
+ return;
+ // Value is empty
+ // Perform your desired action
+ } else {
+ // Value is not empty
+ // Perform other actions
+ }
+ }
+
+
+
+
+ var elements = document.querySelectorAll('[name="classStartTime"]');
+ var isEmpty = false;
+
+ for (var i = 0; i < elements.length; i++) {
+ if (elements[i].value.trim() === '') {
+ isEmpty = true;
+ break;
+ }
+ }
+
+ if (isEmpty) {
+ Feng.error("请输入上课时间")
+ return;
+ console.log("At least one element with the name 'yourName' is empty.");
+ } else {
+ console.log("All elements with the name 'yourName' are filled.");
+ }
+
+
+
+ if (null == maxSubscribeNumber || '' == maxSubscribeNumber) {
+ Feng.error("最多预约人数不能为空");
+ return
+ }
+ if (null == codeTime || '' == codeTime) {
+ Feng.error("扣除课时数不能为空");
+ return
+ }
+ if (null == classStartTime || '' == classStartTime) {
+ Feng.error("上课时间不能为空");
+ return
+ }
+ if (null == classWeeks || '' == classWeeks) {
+ Feng.error("上课时间不能为空");
+ return
+ }
+
+
+
+ if (null == validDays || '' == validDays) {
+ Feng.error("课时有效期不能为空");
+ return
+ }
+ }
+
+
classWeeks = classWeeks.substring(0, classWeeks.length - 1);
if(null == coverDrawing || '' == coverDrawing){
@@ -357,7 +639,7 @@
// Feng.error("课时有效期不能为空");
// return
// }
-
+ let holitime = $('#holitime').val();
let obj = {
id: id,
province: province,
@@ -381,10 +663,12 @@
sort: sort,
validDays: validDays,
coursePackagePaymentConfig: JSON.stringify(price),
- holitime:holitime
+ holitime:$("#holitime").val()
}
-
- console.log("======="+obj)
+ console.log("看看")
+ console.log("======="+holitime)
+ console.log(holitime)
+ console.log($("#holitime").val())
//提交信息
var ajax = new $ax(Feng.ctxPath + "/coursePackage/updateCoursePackage", function (data) {
--
Gitblit v1.7.1