From 7fe6d026bcc8f993ce76437d01607e591cc671fe Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期六, 25 十一月 2023 17:20:02 +0800
Subject: [PATCH] 重写课包支付和排课逻辑
---
cloud-server-management/src/main/webapp/static/modular/system/tCoach/tCoach_add.js | 153 +++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 147 insertions(+), 6 deletions(-)
diff --git a/cloud-server-management/src/main/webapp/static/modular/system/tCoach/tCoach_add.js b/cloud-server-management/src/main/webapp/static/modular/system/tCoach/tCoach_add.js
index ca9fb56..a5ab2ea 100644
--- a/cloud-server-management/src/main/webapp/static/modular/system/tCoach/tCoach_add.js
+++ b/cloud-server-management/src/main/webapp/static/modular/system/tCoach/tCoach_add.js
@@ -21,7 +21,7 @@
TSite.initColumn = function () {
return [
{field: 'selectItem', checkbox: true},
- {title: '主键ID', field: 'id', visible: false, align: 'center', valign: 'middle'},
+ {title: '序号', field: 'id', visible: true, align: 'center', valign: 'middle'},
{title: '所在省', field: 'province', visible: objectType==1?true:false, align: 'center', valign: 'middle',width:'20%',
},
{title: '所在市', field: 'city', visible: objectType==1?true:false, align: 'center', valign: 'middle',
@@ -357,9 +357,12 @@
data.certificate = $('#certificate').val()
var temp = ""
- TSite.goodsPicArray.forEach(function (data) {
- temp = temp+","+data
- });
+
+ for (let i = 0; i < TSite.goodsPicArray.length; i++) {
+ console.log("循环")
+ console.log(TSite.goodsPicArray[i])
+ temp = temp+","+TSite.goodsPicArray[i];
+ }
data.certificateImg = temp
if($("#pCode").val()==''){
@@ -411,13 +414,151 @@
return;
}
if($("#img").val()==''){
+ if ($("#diploma").val()==""){
Feng.info("请输入毕业证图片")
- return;
+ return;
+
+ }
+
}
if($("#certificate").val()==''){
- Feng.info("请输入资格证书")
+
+ Feng.info("请输入资格证书")
+ return;
+ }
+ if(TSite.goodsPicArray.length === 0){
+ Feng.info("请上传资格证书图片")
return;
}
+ $.ajax({
+ url: Feng.ctxPath + "/tCoach/add" ,
+ type: "POST",
+ data: JSON.stringify(data),
+ contentType: "application/json",
+ success: function (response) {
+ window.parent.TSite.table.refresh();
+ TSite.close();
+ Feng.success("添加成功");
+
+ },
+ error: function (xhr, status, error) {
+ Feng.error("添加失败!" + error);
+ }
+ });
+};
+TSite.editSubmit = function(){
+
+
+ var data = {
+ id:null,
+ province:"",
+ provinceCode:"",
+ city:"",
+ cityCode:"",
+ cityManagerId:null,
+ coachTypeId:null,
+ name:"",
+ birthday:"",
+ gender:null,
+ phone:"",
+ idcard:"",
+ height:null,
+ weight:null,
+ graduateSchool:"",
+ diploma:"",
+ certificate:"",
+ certificateImg:"",
+ };
+ if ($("#dataId").val()!=="undefined"){
+ data.id = $("#dataId").val();
+ }
+ data.provinceCode = $("#pCode").val()
+ data.province = $('#pCode option:selected').text();
+ data.cityCode = $("#cCode").val()
+ data.city = $('#cCode option:selected').text();
+ data.cityManagerId = $("#account").val()
+ data.coachTypeId = $("#coachTypeId").val()
+ data.name = $("#name").val()
+ data.birthday = $("#birthday").val()
+ data.gender = $("#gender").val()
+ data.phone = $("#phone").val()
+ data.idcard = $("#idcard").val()
+ data.height = $("#height").val()
+ data.weight = $("#weight").val()
+ data.graduateSchool = $('#graduateSchool').val()
+ data.diploma = $('#img').val()
+ data.certificate = $('#certificate').val()
+
+ var temp = ""
+
+ for (let i = 0; i < TSite.goodsPicArray.length; i++) {
+ console.log("循环")
+ console.log(TSite.goodsPicArray[i][`fileName`])
+ temp = temp+","+TSite.goodsPicArray[i][`fileName`];
+ }
+ data.certificateImg = temp
+
+ if($("#pCode").val()==''){
+ Feng.info("请选择省")
+ return;
+ }
+ if($("#cCode").val()==''){
+ Feng.info("请选择市")
+ return;
+ }
+ if($("#account").val()=='' ){
+ Feng.info("请选择账号")
+ return;
+ }
+ if($("#coachTypeId").val()=='' ){
+ Feng.info("请选择教练类型")
+ return;
+ }
+ if($("#name").val()=='' ){
+ Feng.info("请输入教练名称")
+ return;
+ }
+ if($("#birthday").val()==''){
+ Feng.info("请输入教练生日")
+ return;
+ }
+ if($("#gender").val()=='' ){
+ Feng.info("请选择教练性别")
+ return;
+ }
+ if($("#phone").val()==''){
+ Feng.info("请输入教练电话")
+ return;
+ }
+ if($("#idcard").val()==''){
+ Feng.info("请输入教练身份证号")
+ return;
+ }
+ if($("#height").val()==''){
+ Feng.info("请输入教练身高")
+ return;
+ }
+ if($("#weight").val()==''){
+ Feng.info("请输入教练体重")
+ return;
+ }
+ if($("#graduateSchool").val()==''){
+ Feng.info("请输入毕业院校")
+ return;
+ }
+ if($("#img").val()==''){
+ if ($("#diploma").val()==""){
+ Feng.info("请输入毕业证图片")
+ return;
+
+ }
+
+ }
+ if($("#certificate").val()==''){
+
+ Feng.info("请输入资格证书")
+ return;
+ }
if(TSite.goodsPicArray.length === 0){
Feng.info("请上传资格证书图片")
return;
--
Gitblit v1.7.1