| | |
| | | <workItem from="1695255303249" duration="37521000" /> |
| | | <workItem from="1695342171677" duration="37810000" /> |
| | | <workItem from="1695430054273" duration="24454000" /> |
| | | <workItem from="1695461202457" duration="322000" /> |
| | | </task> |
| | | <task id="LOCAL-00001" summary="后台代码删除"> |
| | | <created>1690249807612</created> |
| | |
| | | <option name="project" value="LOCAL" /> |
| | | <updated>1695461057360</updated> |
| | | </task> |
| | | <option name="localTasksCounter" value="16" /> |
| | | <task id="LOCAL-00016" summary="学员2"> |
| | | <option name="closed" value="true" /> |
| | | <created>1695461216122</created> |
| | | <option name="number" value="00016" /> |
| | | <option name="presentableId" value="LOCAL-00016" /> |
| | | <option name="project" value="LOCAL" /> |
| | | <updated>1695461216122</updated> |
| | | </task> |
| | | <option name="localTasksCounter" value="17" /> |
| | | <servers /> |
| | | </component> |
| | | <component name="TypeScriptGeneratedFilesManager"> |
| | |
| | | <MESSAGE value="后台代码" /> |
| | | <MESSAGE value="9.15" /> |
| | | <MESSAGE value="学员" /> |
| | | <option name="LAST_COMMIT_MESSAGE" value="学员" /> |
| | | <MESSAGE value="学员2" /> |
| | | <option name="LAST_COMMIT_MESSAGE" value="学员2" /> |
| | | </component> |
| | | <component name="XDebuggerManager"> |
| | | <breakpoint-manager> |
New file |
| | |
| | | package com.dsh.account.entity; |
| | | |
| | | import io.swagger.models.auth.In; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class GiftSearchDto { |
| | | String name; |
| | | String phone; |
| | | Integer id; |
| | | } |
New file |
| | |
| | | package com.dsh.course.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.models.auth.In; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | |
| | | @Data |
| | | @TableName("t_course_consum") |
| | | public class CourseCounsum { |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | Integer id; |
| | | @TableField("changeType") |
| | | Integer changeType; |
| | | @TableField("num") |
| | | Integer num; |
| | | @TableField("reason") |
| | | String reason; |
| | | @TableField("paymentId") |
| | | Long paymentId; |
| | | @TableField("insertTime") |
| | | Date insertTime; |
| | | } |
New file |
| | |
| | | package com.dsh.course.entity; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class InsertBackDto { |
| | | Integer id; |
| | | String ids; |
| | | } |
New file |
| | |
| | | package com.dsh.course.entity; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @TableName("t_back_money") |
| | | public class MoneyBack { |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | Integer id; |
| | | @TableField("ids") |
| | | String ids; |
| | | @TableField("studentId") |
| | | Integer studentId; |
| | | @TableField("status") |
| | | Integer status; |
| | | @TableField("insertTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | Date insertTime; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.entity.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class ConsumeQuery { |
| | | |
| | | |
| | | Date start; |
| | | Date end; |
| | | Integer changeType; |
| | | |
| | | String reason; |
| | | |
| | | Integer payId; |
| | | } |
New file |
| | |
| | | package com.dsh.course.entity.dto; |
| | | |
| | | import io.swagger.models.auth.In; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | @Data |
| | | public class ToHoliDto { |
| | | Integer id; |
| | | Integer classId; |
| | | Integer classNum; |
| | | String[] ids; |
| | | } |
New file |
| | |
| | | package com.dsh.course.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dsh.course.entity.CourseCounsum; |
| | | import com.dsh.course.entity.CoursePackagePaymentConfig; |
| | | |
| | | public interface CourseCounsumMapper extends BaseMapper<CourseCounsum> { |
| | | } |
New file |
| | |
| | | package com.dsh.course.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dsh.course.entity.CourseCounsum; |
| | | import com.dsh.course.entity.MoneyBack; |
| | | |
| | | public interface MoneyBackMapper extends BaseMapper<MoneyBack> { |
| | | } |
New file |
| | |
| | | package com.dsh.course.model.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class ToClassDto { |
| | | Integer id; |
| | | Integer toStudentId; |
| | | } |
New file |
| | |
| | | package com.dsh.course.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.course.entity.CancelledClasses; |
| | | import com.dsh.course.entity.CourseCounsum; |
| | | |
| | | public interface CourseCounsumService extends IService<CourseCounsum> { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.course.entity.CourseCounsum; |
| | | import com.dsh.course.entity.MoneyBack; |
| | | |
| | | public interface MoneyBackService extends IService<MoneyBack> { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.course.entity.CancelledClasses; |
| | | import com.dsh.course.entity.CourseCounsum; |
| | | import com.dsh.course.mapper.CancelledClassesMapper; |
| | | import com.dsh.course.mapper.CourseCounsumMapper; |
| | | import com.dsh.course.service.CancelledClassesService; |
| | | import com.dsh.course.service.CourseCounsumService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class CourseCounsumServiceImpl extends ServiceImpl<CourseCounsumMapper, CourseCounsum> implements CourseCounsumService { |
| | | } |
New file |
| | |
| | | package com.dsh.course.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.course.entity.CourseCounsum; |
| | | import com.dsh.course.entity.MoneyBack; |
| | | import com.dsh.course.mapper.CourseCounsumMapper; |
| | | import com.dsh.course.mapper.MoneyBackMapper; |
| | | import com.dsh.course.service.CourseCounsumService; |
| | | import com.dsh.course.service.MoneyBackService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class MoneyBackServiceImpl extends ServiceImpl<MoneyBackMapper, MoneyBack> implements MoneyBackService { |
| | | } |
New file |
| | |
| | | package com.dsh.course.model; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.models.auth.In; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class MoneyBack { |
| | | |
| | | Integer id; |
| | | String ids; |
| | | Integer studentId; |
| | | Integer status; |
| | | @TableField("insertTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | Date insertTime; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.model.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class InsertBackDto { |
| | | Integer id; |
| | | String ids; |
| | | } |
New file |
| | |
| | | package com.dsh.course.util; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | |
| | | public class ChineseMoneyUtils { |
| | | /** |
| | | * 中文数字 |
| | | */ |
| | | final static private String[] CHINESE_NUMBER = { "零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖" }; |
| | | /** |
| | | * 中文数字单位 |
| | | */ |
| | | final static private String[] CHINESE_NUMBER_UNIT = { "", "拾", "佰", "仟", "万", "拾", "佰", "仟", "亿", "拾", "佰", "仟" }; |
| | | /** |
| | | * 人民币单位 |
| | | */ |
| | | final static private String[] CHINESE_MONEY_UNIT = { "圆", "角", "分" }; |
| | | |
| | | public static void main(String[] args) { |
| | | String chineseMoney = toChineseMoney(new BigDecimal("320")); |
| | | System.out.println("chineseMoney = " + chineseMoney); |
| | | } |
| | | |
| | | /** |
| | | * @param sourceMoney 要转换的数值,最多支持到亿 |
| | | * @return 结果 |
| | | */ |
| | | public static String toChineseMoney(BigDecimal sourceMoney) { |
| | | if (new BigDecimal("1000000000000").compareTo(sourceMoney) <= 0 |
| | | && BigDecimal.ZERO.compareTo(sourceMoney) >= 0) { |
| | | throw new RuntimeException("支持转换的金额范围为0~1万亿"); |
| | | } |
| | | StringBuilder sb = new StringBuilder(); |
| | | // 整数部分 |
| | | BigDecimal intPart = sourceMoney.setScale(0, RoundingMode.DOWN); |
| | | // 小数部分 |
| | | BigDecimal decimalPart = sourceMoney.subtract(intPart).multiply(new BigDecimal(100)).setScale(0, |
| | | RoundingMode.DOWN); |
| | | |
| | | // 处理整数部分圆 |
| | | if (intPart.compareTo(BigDecimal.ZERO) > 0) { |
| | | String intPartNumberString = intPart.toPlainString(); |
| | | int length = intPartNumberString.length(); |
| | | // 统计末尾的零,末尾零不做处理 |
| | | int zeroCount = 0; |
| | | for (int i = length - 1; i >= 0; i--) { |
| | | int number = Integer.parseInt(String.valueOf(intPartNumberString.charAt(i))); |
| | | if (number == 0) { |
| | | zeroCount++; |
| | | } else { |
| | | break; |
| | | } |
| | | } |
| | | for (int i = 0; i < length; i++) { |
| | | // 如果转换到末尾0,则停止转换 |
| | | if (i + zeroCount == length) { |
| | | break; |
| | | } |
| | | int number = Integer.parseInt(String.valueOf(intPartNumberString.charAt(i))); |
| | | // 获取中文数字 |
| | | String chineseNumber = CHINESE_NUMBER[number]; |
| | | // 获取中文数字单位 |
| | | String chineseNumberUnit = CHINESE_NUMBER_UNIT[length - i - 1]; |
| | | sb.append(chineseNumber).append(chineseNumberUnit); |
| | | } |
| | | // 统计完后加上金额单位 |
| | | sb.append(CHINESE_MONEY_UNIT[0]); |
| | | } else { |
| | | sb.append(CHINESE_NUMBER[0]).append(CHINESE_MONEY_UNIT[0]); |
| | | } |
| | | |
| | | // 处理小数部分 |
| | | if (decimalPart.compareTo(new BigDecimal(10)) >= 0) { |
| | | // 角 |
| | | String jiao = decimalPart.toPlainString(); |
| | | int number = Integer.parseInt(String.valueOf(jiao.charAt(0))); |
| | | if (number != 0) { |
| | | String chineseNumber = CHINESE_NUMBER[number]; |
| | | sb.append(chineseNumber).append(CHINESE_MONEY_UNIT[1]); |
| | | } |
| | | |
| | | // 分 |
| | | String fen = decimalPart.toPlainString(); |
| | | number = Integer.parseInt(String.valueOf(fen.charAt(1))); |
| | | if (number != 0) { |
| | | String chineseNumber = CHINESE_NUMBER[number]; |
| | | sb.append(chineseNumber).append(CHINESE_MONEY_UNIT[2]); |
| | | } |
| | | } else if (decimalPart.compareTo(BigDecimal.ZERO) > 0) { |
| | | // 分 |
| | | String fen = decimalPart.toPlainString(); |
| | | int number = Integer.parseInt(String.valueOf(fen.charAt(0))); |
| | | if (number != 0) { |
| | | String chineseNumber = CHINESE_NUMBER[number]; |
| | | sb.append(chineseNumber).append(CHINESE_MONEY_UNIT[2]); |
| | | } |
| | | } else { |
| | | sb.append("整"); |
| | | } |
| | | return sb.toString(); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.util; |
| | | |
| | | import com.itextpdf.html2pdf.ConverterProperties; |
| | | import com.itextpdf.html2pdf.HtmlConverter; |
| | | import com.itextpdf.kernel.events.PdfDocumentEvent; |
| | | import com.itextpdf.kernel.font.PdfFont; |
| | | import com.itextpdf.kernel.font.PdfFontFactory; |
| | | import com.itextpdf.kernel.geom.PageSize; |
| | | import com.itextpdf.kernel.pdf.PdfDocument; |
| | | import com.itextpdf.kernel.pdf.PdfWriter; |
| | | import com.itextpdf.layout.font.FontProvider; |
| | | |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.io.OutputStream; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/14 11:13 |
| | | */ |
| | | public class HtmlToPdfUtils { |
| | | |
| | | public static void convertToPdf(InputStream inputStream, String waterMark, OutputStream outputStream) throws IOException { |
| | | |
| | | PdfWriter pdfWriter = new PdfWriter(outputStream); |
| | | PdfDocument pdfDocument = new PdfDocument(pdfWriter); |
| | | //设置为A4大小 |
| | | pdfDocument.setDefaultPageSize(PageSize.A4); |
| | | //添加水印 |
| | | // pdfDocument.addEventHandler(PdfDocumentEvent.END_PAGE, new WaterMarkEventHandler(waterMark)); |
| | | |
| | | //添加页码 |
| | | //pdfDocument.addEventHandler(PdfDocumentEvent.END_PAGE,new PageEventHandler()); |
| | | //添加中文字体支持 |
| | | ConverterProperties properties = new ConverterProperties(); |
| | | FontProvider fontProvider = new FontProvider(); |
| | | |
| | | PdfFont sysFont = PdfFontFactory.createFont("STSongStd-Light", "UniGB-UCS2-H", false); |
| | | fontProvider.addFont(sysFont.getFontProgram(), "UniGB-UCS2-H"); |
| | | |
| | | //添加自定义字体,例如微软雅黑 |
| | | /*if (StringUtils.isNotBlank(fontPath)){ |
| | | PdfFont microsoft = PdfFontFactory.createFont(fontPath, PdfEncodings.IDENTITY_H, false); |
| | | fontProvider.addFont(microsoft.getFontProgram(), PdfEncodings.IDENTITY_H); |
| | | }*/ |
| | | |
| | | properties.setFontProvider(fontProvider); |
| | | HtmlConverter.convertToPdf(inputStream, pdfDocument, properties); |
| | | |
| | | pdfWriter.close(); |
| | | pdfDocument.close(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.models.auth.In; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | |
| | | @Data |
| | | public class CourseCounsum { |
| | | |
| | | Integer id; |
| | | Integer changeType; |
| | | Integer num; |
| | | String reason; |
| | | Long paymentId; |
| | | Date insertTime; |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.model.dto; |
| | | |
| | | import io.swagger.models.auth.In; |
| | | import lombok.Data; |
| | | import org.apache.catalina.util.Introspection; |
| | | |
| | | import java.util.Date; |
| | | @Data |
| | | public class ConsumeQuery { |
| | | |
| | | |
| | | Date start; |
| | | Date end; |
| | | Integer changeType; |
| | | |
| | | String reason; |
| | | |
| | | Integer payId; |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.model.dto; |
| | | |
| | | import io.swagger.models.auth.In; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class GiftSearchDto { |
| | | String name; |
| | | String phone; |
| | | Integer id; |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.model.dto; |
| | | |
| | | public class HoliSelect { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.model.dto; |
| | | |
| | | import io.swagger.models.auth.In; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class ToClassDto { |
| | | Integer id; |
| | | Integer toStudentId; |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.model.dto; |
| | | |
| | | import io.swagger.models.auth.In; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | @Data |
| | | public class ToHoliDto { |
| | | Integer id; |
| | | Integer classId; |
| | | Integer classNum; |
| | | String[] ids; |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.util; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | public class BigDecimalToChineseAmountUtil { |
| | | private static final String[] CN_UPPER_NUMBER = {"零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"}; |
| | | private static final String[] CN_UPPER_MONETRAY_UNIT = {"分", "角", "元", "拾", "佰", "仟", "万", "拾", "佰", "仟", "亿", "拾", "佰", "仟", "兆", "拾", "佰", "仟"}; |
| | | private static final String CN_FULL = "整"; |
| | | private static final String CN_NEGATIVE = "负"; |
| | | private static final int MONEY_PRECISION = 2; |
| | | |
| | | public static String convertToChineseAmount(BigDecimal number) { |
| | | StringBuilder builder = new StringBuilder(); |
| | | |
| | | if (number.compareTo(BigDecimal.ZERO) < 0) { |
| | | builder.append(CN_NEGATIVE); |
| | | number = number.abs(); |
| | | } |
| | | |
| | | long integralPart = number.longValue(); |
| | | BigDecimal decimalPart = number.subtract(BigDecimal.valueOf(integralPart)).multiply(BigDecimal.TEN.pow(MONEY_PRECISION)); |
| | | |
| | | if (decimalPart.compareTo(BigDecimal.ZERO) == 0) { |
| | | builder.append(CN_FULL); |
| | | } |
| | | |
| | | long integralPartTemp = integralPart; |
| | | int unit = 0; |
| | | boolean isZero = true; |
| | | boolean needZero = false; |
| | | |
| | | while (integralPartTemp > 0) { |
| | | long tempNumber = integralPartTemp % 10; |
| | | if (tempNumber > 0) { |
| | | if (needZero) { |
| | | builder.insert(0, CN_UPPER_NUMBER[0]); |
| | | } |
| | | builder.insert(0, CN_UPPER_MONETRAY_UNIT[unit]); |
| | | builder.insert(0, CN_UPPER_NUMBER[(int) tempNumber]); |
| | | isZero = false; |
| | | needZero = false; |
| | | } else { |
| | | if (!isZero) { |
| | | needZero = true; |
| | | } |
| | | if (unit == 2 || unit == 6 || unit == 10 || unit == 14) { |
| | | builder.insert(0, CN_UPPER_MONETRAY_UNIT[unit]); |
| | | isZero = true; |
| | | } |
| | | } |
| | | integralPartTemp = integralPartTemp / 10; |
| | | unit++; |
| | | } |
| | | |
| | | if (decimalPart.compareTo(BigDecimal.ZERO) > 0) { |
| | | builder.append(convertDecimalToChinese(decimalPart)); |
| | | } |
| | | |
| | | return builder.toString(); |
| | | } |
| | | |
| | | private static String convertDecimalToChinese(BigDecimal decimalPart) { |
| | | StringBuilder builder = new StringBuilder(); |
| | | |
| | | for (int i = 0; i < MONEY_PRECISION; i++) { |
| | | int num = decimalPart.intValue() % 10; |
| | | builder.insert(0, CN_UPPER_NUMBER[num]); |
| | | builder.append(CN_UPPER_MONETRAY_UNIT[i + 2]); |
| | | decimalPart = decimalPart.multiply(BigDecimal.TEN); |
| | | } |
| | | |
| | | return builder.toString(); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | BigDecimal number = new BigDecimal("12345.67"); |
| | | String chineseAmount = convertToChineseAmount(number); |
| | | System.out.println(chineseAmount); // Output: 壹万贰仟叁佰肆拾伍元陆角柒分 |
| | | } |
| | | } |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-title"> |
| | | <h5>优惠券管理</h5> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <div class="row"> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="name" name="优惠券名称" /> |
| | | <input type="hidden" id="index" value="${index}"> |
| | | </div> |
| | | <!-- <div class="col-sm-3">--> |
| | | <!-- <#SelectCon id="type" name="优惠券类型" >--> |
| | | <!-- <option value="">全部</option>--> |
| | | <!-- <option value="1">满减券</option>--> |
| | | <!-- <option value="2">折扣券</option>--> |
| | | <!-- <option value="3">体验券</option>--> |
| | | <!-- </#SelectCon>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="col-sm-3">--> |
| | | <!-- <#SelectCon id="distributionMethod" name="发放方式" >--> |
| | | <!-- <option value="">全部</option>--> |
| | | <!-- <option value="1">积分购买</option>--> |
| | | <!-- <option value="2">注册赠送</option>--> |
| | | <!-- <option value="3">自动发券</option>--> |
| | | <!-- </#SelectCon>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="col-sm-3">--> |
| | | <!-- <#SelectCon id="userPopulation" name="用户人群" >--> |
| | | <!-- <option value="">全部</option>--> |
| | | <!-- <option value="1">全部用户</option>--> |
| | | <!-- <option value="2">年度会员</option>--> |
| | | <!-- <option value="3">已有学员用户</option>--> |
| | | <!-- </#SelectCon>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="col-sm-3">--> |
| | | <!-- <#SelectCon id="status" name="活动状态" >--> |
| | | <!-- <option value="">全部</option>--> |
| | | <!-- <option value="1">未开始</option>--> |
| | | <!-- <option value="2">已开始</option>--> |
| | | <!-- <option value="3">已结束</option>--> |
| | | <!-- </#SelectCon>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="col-sm-3">--> |
| | | <!-- <#SelectCon id="state" name="可售状态" >--> |
| | | <!-- <option value="">全部</option>--> |
| | | <!-- <option value="1">已上架</option>--> |
| | | <!-- <option value="2">已下架</option>--> |
| | | <!-- </#SelectCon>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="col-sm-3">--> |
| | | <#button name="搜索" icon="fa-search" clickFun="TCoupon.search()"/> |
| | | <!-- <#button name="重置" icon="fa-trash" clickFun="TCoupon.resetSearch()"/>--> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="hidden-xs" id="TCouponTableToolbar" role="group">--> |
| | | <!-- <#button name="添加" icon="fa-plus" clickFun="TCoupon.backids(${index})" />--> |
| | | <!-- <#button name="编辑" icon="fa-edit" clickFun="TCoupon.openChange()" space="true" hidden='hidden'/>--> |
| | | <!-- <#button name="上架" icon="fa-remove" clickFun="TCoupon.onShelf(1)" space="true" hidden='hidden'/>--> |
| | | <!-- <#button name="下架" icon="fa-remove" clickFun="TCoupon.onShelf(2)" space="true" hidden='hidden'/>--> |
| | | <!-- <#button name="查看详情" icon="fa-remove" clickFun="TCoupon.openDetail()" space="true" hidden='hidden'/>--> |
| | | <!-- <#button name="领取记录" icon="fa-remove" clickFun="TCoupon.openCollectionRecord()" space="true" hidden='hidden'/>--> |
| | | <!-- </div>--> |
| | | <#table id="TCouponTable"/> |
| | | <div style="display: flex"> <#button name="添加" icon="fa-plus" clickFun="TCoupon.backids(${index})"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/coursePackage/TCoupon.js"></script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-title"> |
| | | <h5>优惠券管理</h5> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <div class="row"> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="name" name="优惠券名称" /> |
| | | <input type="text" id="conpund" value="${conpund}"> |
| | | <input type="text" id="index" value="${index}"> |
| | | |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#SelectCon id="type" name="优惠券类型" > |
| | | <option value="">全部</option> |
| | | <option value="1">满减券</option> |
| | | <option value="2">折扣券</option> |
| | | <option value="3">体验券</option> |
| | | </#SelectCon> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#SelectCon id="distributionMethod" name="发放方式" > |
| | | <option value="">全部</option> |
| | | <option value="1">积分购买</option> |
| | | <option value="2">注册赠送</option> |
| | | <option value="3">自动发券</option> |
| | | </#SelectCon> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#SelectCon id="userPopulation" name="用户人群" > |
| | | <option value="">全部</option> |
| | | <option value="1">全部用户</option> |
| | | <option value="2">年度会员</option> |
| | | <option value="3">已有学员用户</option> |
| | | </#SelectCon> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#SelectCon id="status" name="活动状态" > |
| | | <option value="">全部</option> |
| | | <option value="1">未开始</option> |
| | | <option value="2">已开始</option> |
| | | <option value="3">已结束</option> |
| | | </#SelectCon> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#SelectCon id="state" name="可售状态" > |
| | | <option value="">全部</option> |
| | | <option value="1">已上架</option> |
| | | <option value="2">已下架</option> |
| | | </#SelectCon> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#button name="搜索" icon="fa-search" clickFun="TCoupon.search()"/> |
| | | <#button name="重置" icon="fa-trash" clickFun="TCoupon.resetSearch()"/> |
| | | </div> |
| | | </div> |
| | | <div class="hidden-xs" id="TCouponTableToolbar" role="group"> |
| | | <#button name="添加" icon="fa-plus" clickFun="TCoupon.backids(${index})"/> |
| | | <#button name="编辑" icon="fa-edit" clickFun="TCoupon.openChange()" space="true"/> |
| | | <#button name="上架" icon="fa-remove" clickFun="TCoupon.onShelf(1)" space="true"/> |
| | | <#button name="下架" icon="fa-remove" clickFun="TCoupon.onShelf(2)" space="true"/> |
| | | <#button name="查看详情" icon="fa-remove" clickFun="TCoupon.openDetail()" space="true"/> |
| | | <#button name="领取记录" icon="fa-remove" clickFun="TCoupon.openCollectionRecord()" space="true"/> |
| | | </div> |
| | | <#table id="TCouponTable"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/coursePackage/TCouponEdit.js"></script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal"> |
| | | |
| | | <div class="row"> |
| | | <div class="col-sm-6 b-r"> |
| | | <#input id="id" name="主键" underline="true"/> |
| | | <#input id="name" name="优惠券名称" underline="true"/> |
| | | <#input id="type" name="优惠券类型(1=满减券,2=代金券,3=体验券)" underline="true"/> |
| | | <#input id="content" name="优惠券规则JSON |
| | | 格式: |
| | | { |
| | | "conditionalAmount": 5, |
| | | "deductionAmount": 6.8, |
| | | "experienceName": "" |
| | | }" underline="true"/> |
| | | <#input id="illustrate" name="优惠券说明" underline="true"/> |
| | | <#input id="distributionMethod" name="发放方式(1=积分购买,2=注册赠送,3=自动发券)" underline="true"/> |
| | | <#input id="redemptionMethod" name="兑换方式(1=积分,2=积分+现金)" underline="true"/> |
| | | <#input id="cash" name="所需现金" underline="true"/> |
| | | <#input id="integral" name="所属积分" underline="true"/> |
| | | <#input id="userPopulation" name="用户人群(1=全部用户,2=年度会员,3=已有学员用户)" underline="true"/> |
| | | <#input id="quantityIssued" name="发放数量" underline="true"/> |
| | | <#input id="pickUpQuantity" name="限领数量" underline="true"/> |
| | | <#input id="startTime" name="开始时间"/> |
| | | </div> |
| | | |
| | | <div class="col-sm-6"> |
| | | <#input id="endTime" name="结束时间" underline="true"/> |
| | | <#input id="useScope" name="使用范围(1=全国,2=指定城市,3=指定门店)" underline="true"/> |
| | | <#input id="auditStatus" name="审核状态(1=待审核,2=已通过,3=已拒绝)" underline="true"/> |
| | | <#input id="auditUserId" name="审核人id" underline="true"/> |
| | | <#input id="auditRemark" name="审核备注" underline="true"/> |
| | | <#input id="status" name="状态(1=未开始,2=已开始,3=已结束,4=已取消)" underline="true"/> |
| | | <#input id="state" name="状态(1=正常,2=冻结,3=删除)" underline="true"/> |
| | | <#input id="insertTime" name="添加时间" underline="true"/> |
| | | <#input id="cover" name="封面图" underline="true"/> |
| | | <#input id="productImages" name="图片" underline="true"/> |
| | | <#input id="publisherType" name="发布人类型 1=城市管理者 2=平台管理者3=门店" underline="true"/> |
| | | <#input id="cityManagerId" name="城市管理者id" underline="true"/> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10"> |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TCouponInfoDlg.addSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TCouponInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tCoupon/tCoupon_info.js"></script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal"> |
| | | |
| | | <div class="row"> |
| | | <div class="col-sm-6 b-r"> |
| | | <#input id="id" name="主键" value="${item.id}" underline="true"/> |
| | | <#input id="name" name="优惠券名称" value="${item.name}" underline="true"/> |
| | | <#input id="type" name="优惠券类型(1=满减券,2=代金券,3=体验券)" value="${item.type}" underline="true"/> |
| | | <#input id="content" name="优惠券规则JSON |
| | | 格式: |
| | | { |
| | | "conditionalAmount": 5, |
| | | "deductionAmount": 6.8, |
| | | "experienceName": "" |
| | | }" value="${item.content}" underline="true"/> |
| | | <#input id="illustrate" name="优惠券说明" value="${item.illustrate}" underline="true"/> |
| | | <#input id="distributionMethod" name="发放方式(1=积分购买,2=注册赠送,3=自动发券)" value="${item.distributionMethod}" underline="true"/> |
| | | <#input id="redemptionMethod" name="兑换方式(1=积分,2=积分+现金)" value="${item.redemptionMethod}" underline="true"/> |
| | | <#input id="cash" name="所需现金" value="${item.cash}" underline="true"/> |
| | | <#input id="integral" name="所属积分" value="${item.integral}" underline="true"/> |
| | | <#input id="userPopulation" name="用户人群(1=全部用户,2=年度会员,3=已有学员用户)" value="${item.userPopulation}" underline="true"/> |
| | | <#input id="quantityIssued" name="发放数量" value="${item.quantityIssued}" underline="true"/> |
| | | <#input id="pickUpQuantity" name="限领数量" value="${item.pickUpQuantity}" underline="true"/> |
| | | <#input id="startTime" name="开始时间" value="${item.startTime}" /> |
| | | </div> |
| | | |
| | | <div class="col-sm-6"> |
| | | <#input id="endTime" name="结束时间" value="${item.endTime}" underline="true"/> |
| | | <#input id="useScope" name="使用范围(1=全国,2=指定城市,3=指定门店)" value="${item.useScope}" underline="true"/> |
| | | <#input id="auditStatus" name="审核状态(1=待审核,2=已通过,3=已拒绝)" value="${item.auditStatus}" underline="true"/> |
| | | <#input id="auditUserId" name="审核人id" value="${item.auditUserId}" underline="true"/> |
| | | <#input id="auditRemark" name="审核备注" value="${item.auditRemark}" underline="true"/> |
| | | <#input id="status" name="状态(1=未开始,2=已开始,3=已结束,4=已取消)" value="${item.status}" underline="true"/> |
| | | <#input id="state" name="状态(1=正常,2=冻结,3=删除)" value="${item.state}" underline="true"/> |
| | | <#input id="insertTime" name="添加时间" value="${item.insertTime}" underline="true"/> |
| | | <#input id="cover" name="封面图" value="${item.cover}" underline="true"/> |
| | | <#input id="productImages" name="图片" value="${item.productImages}" underline="true"/> |
| | | <#input id="publisherType" name="发布人类型 1=城市管理者 2=平台管理者3=门店" value="${item.publisherType}" underline="true"/> |
| | | <#input id="cityManagerId" name="城市管理者id" value="${item.cityManagerId}" /> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10"> |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TCouponInfoDlg.editSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TCouponInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tCoupon/tCoupon_info.js"></script> |
| | | @} |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="zh"> |
| | | <head> |
| | | <meta charset="UTF-8" /> |
| | | <title>amis demo</title> |
| | | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
| | | <meta |
| | | name="viewport" |
| | | content="width=device-width, initial-scale=1, maximum-scale=1" |
| | | /> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=Edge" /> |
| | | <link rel="stylesheet" href="${ctxPath}/sdk/sdk.css" /> |
| | | <link rel="stylesheet" href="${ctxPath}/sdk/helper.css" /> |
| | | <link rel="stylesheet" href="${ctxPath}/sdk/iconfont.css" /> |
| | | <!-- 这是默认主题所需的,如果是其他主题则不需要 --> |
| | | <!-- 从 1.1.0 开始 sdk.css 将不支持 IE 11,如果要支持 IE11 请引用这个 css,并把前面那个删了 --> |
| | | <!-- <link rel="stylesheet" href="sdk-ie11.css" /> --> |
| | | <!-- 不过 amis 开发团队几乎没测试过 IE 11 下的效果,所以可能有细节功能用不了,如果发现请报 issue --> |
| | | <style> |
| | | html, |
| | | body, |
| | | .app-wrapper { |
| | | position: relative; |
| | | width: 100%; |
| | | height: 100%; |
| | | margin: 0; |
| | | padding: 0; |
| | | } |
| | | th { |
| | | background-color: white; |
| | | } |
| | | </style> |
| | | </head> |
| | | <body> |
| | | <div id="root" class="app-wrapper"></div> |
| | | <script src="${ctxPath}/sdk/sdk.js"></script> |
| | | <script type="text/javascript"> |
| | | (function () { |
| | | let amis = amisRequire('amis/embed'); |
| | | // 通过替换下面这个配置来生成不同页面 |
| | | let amisJSON = { |
| | | "type": "page", |
| | | "title": "", |
| | | "body": [ |
| | | { |
| | | "type": "form", |
| | | "title": "表单", |
| | | "body": [ |
| | | { |
| | | "label": "文本", |
| | | "type": "input-text", |
| | | "name": "id", |
| | | "id": "u:99d3d8869d55" |
| | | }, |
| | | { |
| | | "label": "文本", |
| | | "type": "input-text", |
| | | "name": "ids", |
| | | "id": "u:5b12dc7c90" |
| | | } |
| | | ], |
| | | "api": { |
| | | "url": "ttt", |
| | | "method": "post", |
| | | "requestAdaptor": "", |
| | | "adaptor": "", |
| | | "messages": {}, |
| | | "dataType": "form" |
| | | }, |
| | | "id": "u:285d560cf7ab" |
| | | }, |
| | | { |
| | | "type": "property", |
| | | "id": "u:844144d9d3d8", |
| | | "title": "学员课包退费申请表", |
| | | "items": [ |
| | | { |
| | | "label": "用户姓名", |
| | | "content": `${userName}`, |
| | | "span": 1 |
| | | }, |
| | | { |
| | | "label": "学员姓名", |
| | | "content": `${tStudentDto.name}`, |
| | | "span": 1 |
| | | }, |
| | | { |
| | | "label": "性别", |
| | | "content": `${tStudentDto.sex == 1 ? '男':'女'}`, |
| | | "span": 1 |
| | | }, |
| | | { |
| | | "label": "申请时间", |
| | | "content": `${reDate}`, |
| | | "span": 3 |
| | | }, |
| | | { |
| | | "label": "联系电话", |
| | | "content": `${tStudentDto.phone}`, |
| | | "span": 1 |
| | | }, |
| | | { |
| | | "label": "收款户名", |
| | | "content": "", |
| | | "span": 2 |
| | | }, |
| | | { |
| | | "label": "收款账号", |
| | | "content": "", |
| | | "span": 3 |
| | | }, |
| | | { |
| | | "label": "银行开户行", |
| | | "content": "", |
| | | "span": 8 |
| | | }, |
| | | { |
| | | "label": "申请推费原因", |
| | | "content": "", |
| | | "span": 8 |
| | | }, |
| | | { |
| | | "label": "课包项目明细", |
| | | "content": "", |
| | | "span": 8 |
| | | } |
| | | @for(pay in coursePackagePayments){ |
| | | , |
| | | { |
| | | "label": "", |
| | | "span": 1, |
| | | "content": '课包明细'+`${index++}` |
| | | }, |
| | | { |
| | | "label": "课包编号", |
| | | "content": `${pay.id}`, |
| | | "span": 2 |
| | | }, |
| | | { |
| | | "label": "课包名称", |
| | | "content": `${pay.name}`, |
| | | "span": 1 |
| | | }, |
| | | { |
| | | "label": "物品赠送", |
| | | "content": "", |
| | | "span": 2 |
| | | }, |
| | | { |
| | | "label": "", |
| | | "content": "", |
| | | "span": 1 |
| | | }, |
| | | { |
| | | "label": "课包总课时", |
| | | "content": `${pay.totalClassHours}`, |
| | | "span": 1 |
| | | }, |
| | | { |
| | | "label": "课包单价", |
| | | "content": `${pay.onePrice}`, |
| | | "span": 1 |
| | | }, |
| | | { |
| | | "label": "课包总金额", |
| | | "content": `${pay.cashPayment}`, |
| | | "span": 3 |
| | | }, |
| | | { |
| | | "label": "", |
| | | "content": "", |
| | | "span": 1 |
| | | }, |
| | | { |
| | | "label": "已学课时", |
| | | "content": `${pay.hasHours}`, |
| | | "span": 1 |
| | | }, |
| | | { |
| | | "label": "剩余课时", |
| | | "content": `${pay.laveClassHours}`, |
| | | "span": 1 |
| | | }, |
| | | { |
| | | "label": "剩余课时金额", |
| | | "content": `${pay.restPrice}`, |
| | | "span": 3 |
| | | }, |
| | | { |
| | | "label": "", |
| | | "content": "", |
| | | "span": 1 |
| | | }, |
| | | { |
| | | "label": "合计", |
| | | "content": `${countAll}`, |
| | | "span": 1 |
| | | }, |
| | | { |
| | | "label": "大写", |
| | | "content": `${allprice}`, |
| | | "span": 4 |
| | | } |
| | | |
| | | @} |
| | | , |
| | | { |
| | | "label": "", |
| | | "content": "申请退费", |
| | | "span": 1 |
| | | }, |
| | | { |
| | | "label": "申请退费金额", |
| | | "content": "${countAll}", |
| | | "span": 1 |
| | | }, |
| | | { |
| | | "label": "物品赠送", |
| | | "content": "", |
| | | "span": 1 |
| | | }, |
| | | { |
| | | "label": "手续费", |
| | | "content": "", |
| | | "span": 3 |
| | | }, |
| | | { |
| | | "label": "", |
| | | "content": "", |
| | | "span": 1 |
| | | }, |
| | | { |
| | | "label": "实际退费", |
| | | "content": "", |
| | | "span": 1 |
| | | }, |
| | | { |
| | | "label": "大写", |
| | | "content": "", |
| | | "span": 4 |
| | | }, |
| | | { |
| | | "label": "申请人签字", |
| | | "content": "", |
| | | "span": 2 |
| | | }, |
| | | { |
| | | "label": "店长意见及签字", |
| | | "content": { |
| | | "type": "tpl", |
| | | "tpl": "<br/><br/></pre>", |
| | | "id": "u:c14b6d167a7c" |
| | | }, |
| | | "span": 4 |
| | | }, |
| | | { |
| | | "label": "退费记录", |
| | | "content": { |
| | | "type": "tpl", |
| | | "tpl": "<br/><br/></pre>", |
| | | "id": "u:c14b6d167a7c" |
| | | }, |
| | | "span": 6 |
| | | }, |
| | | { |
| | | "label": "备注", |
| | | "content": { |
| | | "type": "tpl", |
| | | "tpl": "<br/><br/></pre>", |
| | | "id": "u:c14b6d167a7c" |
| | | }, |
| | | "span": 1 |
| | | } |
| | | ], |
| | | "column": 6, |
| | | "mode": "table", |
| | | |
| | | "className": "font-bold" |
| | | }, |
| | | { |
| | | "type": "flex", |
| | | "className": "p-1", |
| | | "items": [ |
| | | { |
| | | "type": "button", |
| | | "id": "u:6c0b8f917bf7", |
| | | "label": "关闭", |
| | | "onEvent": { |
| | | "click": { |
| | | "actions": [{ |
| | | "actionType": "custom", |
| | | "args": {}, |
| | | "script": "window.close()" |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | "type": "button", |
| | | "id": "u:6c0b8f917bf7", |
| | | "label": "导出", |
| | | "level":"info", |
| | | "onEvent": { |
| | | "click": { |
| | | "actions": [ |
| | | { |
| | | "script": "\r\nwindow.print()", |
| | | "actionType": "custom" |
| | | }, |
| | | { |
| | | "componentId": "u:285d560cf7ab", |
| | | "actionType": "submit" |
| | | }, |
| | | { |
| | | "actionType": "custom", |
| | | "args": {}, |
| | | "script": "window.close()" |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | } |
| | | ], |
| | | "style": { |
| | | "position": "relative" |
| | | }, |
| | | "id": "u:8254704349a2" |
| | | } |
| | | ], |
| | | "id": "u:fea3d370178c" |
| | | }; |
| | | let amisScoped = amis.embed('#root', amisJSON); |
| | | |
| | | |
| | | })(); |
| | | |
| | | function test(){ |
| | | console.log("测试成功") |
| | | } |
| | | |
| | | var myButton = document.getElementById("ttt"); |
| | | myButton.addEventListener("click",test); |
| | | </script> |
| | | |
| | | </body> |
| | | </html> |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="zh"> |
| | | <head> |
| | | <meta charset="UTF-8" /> |
| | | <title>amis demo</title> |
| | | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
| | | <meta |
| | | name="viewport" |
| | | content="width=device-width, initial-scale=1, maximum-scale=1" |
| | | /> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=Edge" /> |
| | | <link rel="stylesheet" href="${ctxPath}/sdk/sdk.css" /> |
| | | <link rel="stylesheet" href="${ctxPath}/sdk/helper.css" /> |
| | | <link rel="stylesheet" href="${ctxPath}/sdk/iconfont.css" /> |
| | | <!-- 这是默认主题所需的,如果是其他主题则不需要 --> |
| | | <!-- 从 1.1.0 开始 sdk.css 将不支持 IE 11,如果要支持 IE11 请引用这个 css,并把前面那个删了 --> |
| | | <!-- <link rel="stylesheet" href="sdk-ie11.css" /> --> |
| | | <!-- 不过 amis 开发团队几乎没测试过 IE 11 下的效果,所以可能有细节功能用不了,如果发现请报 issue --> |
| | | <style> |
| | | html, |
| | | body, |
| | | .app-wrapper { |
| | | position: relative; |
| | | width: 100%; |
| | | height: 100%; |
| | | margin: 0; |
| | | padding: 0; |
| | | } |
| | | </style> |
| | | </head> |
| | | <body> |
| | | <div id="root" class="app-wrapper"></div> |
| | | <script src="${ctxPath}/sdk/sdk.js"></script> |
| | | <script type="text/javascript"> |
| | | (function () { |
| | | let amis = amisRequire('amis/embed'); |
| | | // 通过替换下面这个配置来生成不同页面 |
| | | let amisJSON ={ |
| | | "type": "page", |
| | | "title": "", |
| | | "body": [ |
| | | { |
| | | "type": "form", |
| | | "title": "", |
| | | "body": [ |
| | | { |
| | | "type": "tpl", |
| | | "tpl": "                                            ", |
| | | "inline": true, |
| | | "wrapperComponent": "", |
| | | "id": "u:5b414d7db416" |
| | | }, |
| | | { |
| | | "type": "tpl", |
| | | "id": "u:5b414d7db416", |
| | | "inline": true, |
| | | "tpl": "                                            ", |
| | | "wrapperComponent": "" |
| | | }, |
| | | { |
| | | "type": "tpl", |
| | | "id": "u:5b414d7db416", |
| | | "tpl": "                                                                          ", |
| | | "inline": true, |
| | | "wrapperComponent": "" |
| | | }, |
| | | { |
| | | "type": "flex", |
| | | "items": [ |
| | | { |
| | | "type": "tpl", |
| | | "tpl": "课包种类", |
| | | "id": "u:55654c208e7a", |
| | | "inline": true, |
| | | "wrapperComponent": "h2" |
| | | } |
| | | ], |
| | | "id": "u:0623e832135d", |
| | | "style": { |
| | | "position": "static", |
| | | "flexWrap": "nowrap", |
| | | "flexDirection": "row", |
| | | "justifyContent": "center", |
| | | "overflowY": "auto" |
| | | }, |
| | | "isFixedHeight": false, |
| | | "isFixedWidth": false |
| | | }, |
| | | { |
| | | "type": "flex", |
| | | "items": [ |
| | | { |
| | | "type": "radios", |
| | | "id": "u:afa09262555b", |
| | | "inline": true, |
| | | "label": " 请选择:", |
| | | "name": "radios", |
| | | "options": [ |
| | | { |
| | | "label": "常规课程", |
| | | "value": "1" |
| | | }, |
| | | { |
| | | "label": "假期课程", |
| | | "value": "2" |
| | | }, |
| | | { |
| | | "label": "体验课程", |
| | | "value": "3" |
| | | } |
| | | ], |
| | | "mode": "inline", |
| | | "value": "A", |
| | | "horizontal": { |
| | | "left": 1, |
| | | "right": 11 |
| | | } |
| | | } |
| | | ], |
| | | "id": "u:f7852087ea18", |
| | | "style": { |
| | | "position": "static", |
| | | "flexWrap": "nowrap", |
| | | "flexDirection": "row", |
| | | "justifyContent": "center", |
| | | "overflowY": "auto" |
| | | }, |
| | | "isFixedHeight": false, |
| | | "isFixedWidth": false |
| | | }, |
| | | { |
| | | "type": "flex", |
| | | "items": [ |
| | | { |
| | | "type": "tpl", |
| | | "id": "u:5035e51732f1", |
| | | "inline": true, |
| | | "tpl": "1.常规课程:设置课时扣课的常规课程包。", |
| | | "wrapperComponent": "h3" |
| | | } |
| | | ], |
| | | "id": "u:ba0c4f9a5fc3", |
| | | "style": { |
| | | "position": "static", |
| | | "flexWrap": "nowrap", |
| | | "flexDirection": "row", |
| | | "justifyContent": "space-around", |
| | | "overflowY": "auto" |
| | | }, |
| | | "isFixedHeight": false, |
| | | "isFixedWidth": false |
| | | }, |
| | | { |
| | | "type": "flex", |
| | | "items": [ |
| | | { |
| | | "type": "tpl", |
| | | "id": "u:fc5edd1fd19a", |
| | | "inline": true, |
| | | "tpl": "                  2.假期课程:预设时间段上课,时间到期课程既结束。", |
| | | "wrapperComponent": "h3" |
| | | } |
| | | ], |
| | | "id": "u:d23c02e12b83", |
| | | "style": { |
| | | "position": "static", |
| | | "flexWrap": "nowrap", |
| | | "flexDirection": "row", |
| | | "justifyContent": "space-around", |
| | | "overflowY": "auto" |
| | | }, |
| | | "isFixedHeight": false, |
| | | "isFixedWidth": false |
| | | }, |
| | | { |
| | | "type": "flex", |
| | | "items": [ |
| | | { |
| | | "type": "tpl", |
| | | "id": "u:c519152df166", |
| | | "inline": true, |
| | | "tpl": "3.体验课程:单次购买的课程。                  ", |
| | | "wrapperComponent": "h3" |
| | | } |
| | | ], |
| | | "id": "u:c720cb31edf8", |
| | | "style": { |
| | | "position": "static", |
| | | "flexWrap": "nowrap", |
| | | "flexDirection": "row", |
| | | "justifyContent": "space-around", |
| | | "overflowY": "auto" |
| | | }, |
| | | "isFixedHeight": false, |
| | | "isFixedWidth": false |
| | | }, |
| | | { |
| | | "type": "flex", |
| | | "items": [ |
| | | { |
| | | "type": "button", |
| | | "id": "u:5b4f1fa2ae10", |
| | | "label": "确认", |
| | | "onEvent": { |
| | | "click": { |
| | | "actions": [ |
| | | { |
| | | "actionType": "url", |
| | | "args": { |
| | | "url": "/coursePackage/openAddCoursePackage?type=$radios", |
| | | "blank": false |
| | | } |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | } |
| | | ], |
| | | "id": "u:43e7d3d6e5f7", |
| | | "style": { |
| | | "position": "static", |
| | | "flexWrap": "nowrap", |
| | | "flexDirection": "row", |
| | | "justifyContent": "space-around", |
| | | "overflowY": "auto" |
| | | }, |
| | | "isFixedHeight": false, |
| | | "isFixedWidth": false |
| | | }, |
| | | { |
| | | "type": "tpl", |
| | | "id": "u:5b414d7db416", |
| | | "tpl": "                                                                                                  ", |
| | | "inline": true, |
| | | "wrapperComponent": "" |
| | | }, |
| | | { |
| | | "type": "button", |
| | | "label": "确认", |
| | | "onEvent": { |
| | | "click": { |
| | | "actions": [ |
| | | { |
| | | "actionType": "url", |
| | | "args": { |
| | | "url": "/coursePackage/openAddCoursePackage?type=$radios", |
| | | "blank": false |
| | | } |
| | | } |
| | | ] |
| | | } |
| | | }, |
| | | "id": "u:5b4f1fa2ae10" |
| | | } |
| | | ], |
| | | "id": "u:339c517e4f3c", |
| | | "api": { |
| | | "url": "/coursePackage/openAddCoursePackage?$radios", |
| | | "method": "get", |
| | | "requestAdaptor": "", |
| | | "adaptor": "", |
| | | "messages": { |
| | | } |
| | | } |
| | | } |
| | | ], |
| | | "id": "u:039339c3720d" |
| | | }; |
| | | let amisScoped = amis.embed('#root', amisJSON); |
| | | |
| | | |
| | | })(); |
| | | |
| | | function test(){ |
| | | console.log("测试成功") |
| | | } |
| | | |
| | | var myButton = document.getElementById("ttt"); |
| | | myButton.addEventListener("click",test); |
| | | </script> |
| | | |
| | | </body> |
| | | </html> |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="zh"> |
| | | <head> |
| | | <meta charset="UTF-8" /> |
| | | <title>amis demo</title> |
| | | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
| | | <meta |
| | | name="viewport" |
| | | content="width=device-width, initial-scale=1, maximum-scale=1" |
| | | /> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=Edge" /> |
| | | <link rel="stylesheet" href="${ctxPath}/sdk/sdk.css" /> |
| | | <link rel="stylesheet" href="${ctxPath}/sdk/helper.css" /> |
| | | <link rel="stylesheet" href="${ctxPath}/sdk/iconfont.css" /> |
| | | <!-- 这是默认主题所需的,如果是其他主题则不需要 --> |
| | | <!-- 从 1.1.0 开始 sdk.css 将不支持 IE 11,如果要支持 IE11 请引用这个 css,并把前面那个删了 --> |
| | | <!-- <link rel="stylesheet" href="sdk-ie11.css" /> --> |
| | | <!-- 不过 amis 开发团队几乎没测试过 IE 11 下的效果,所以可能有细节功能用不了,如果发现请报 issue --> |
| | | <style> |
| | | html, |
| | | body, |
| | | .app-wrapper { |
| | | position: relative; |
| | | width: 100%; |
| | | height: 100%; |
| | | margin: 0; |
| | | padding: 0; |
| | | } |
| | | </style> |
| | | </head> |
| | | <body> |
| | | <div id="root" class="app-wrapper"></div> |
| | | <script src="${ctxPath}/sdk/sdk.js"></script> |
| | | <script type="text/javascript"> |
| | | (function () { |
| | | let amis = amisRequire('amis/embed'); |
| | | // 通过替换下面这个配置来生成不同页面 |
| | | let amisJSON = { |
| | | "type": "page", |
| | | "title": "", |
| | | "body": [ |
| | | { |
| | | "type": "form", |
| | | "title": "", |
| | | "body": [ |
| | | { |
| | | "type": "form", |
| | | "title": "", |
| | | "body": [ |
| | | { |
| | | "type": "tpl", |
| | | "tpl": "                    报名假期班", |
| | | "inline": true, |
| | | "wrapperComponent": "h2", |
| | | "id": "u:194f160daab4" |
| | | }, |
| | | { |
| | | "type": "input-text", |
| | | "label": "id", |
| | | "name": "id", |
| | | "id": "u:d038053014ca", |
| | | "mode": "horizontal", |
| | | "size": "md" |
| | | }, |
| | | { |
| | | "type": "input-text", |
| | | "label": "ids", |
| | | "name": "ids", |
| | | "id": "u:223b7f2a1a5b", |
| | | "mode": "horizontal", |
| | | "size": "md" |
| | | }, |
| | | { |
| | | "label": "换课课程:", |
| | | "type": "select", |
| | | "name": "holiId", |
| | | "id": "u:e205156867e3", |
| | | "multiple": false, |
| | | "mode": "horizontal", |
| | | "source": { |
| | | "url": "/tStudent/getholi/$id", |
| | | "method": "get", |
| | | "requestAdaptor": "", |
| | | "adaptor": "", |
| | | "messages": { |
| | | } |
| | | }, |
| | | "value": "", |
| | | "labelField": "value", |
| | | "valueField": "id", |
| | | "size": "md", |
| | | "searchable": true |
| | | }, |
| | | { |
| | | "type": "input-text", |
| | | "label": "扣除课时数:", |
| | | "name": "classNum", |
| | | "id": "u:0333b5c5d05c", |
| | | "mode": "horizontal", |
| | | "size": "md" |
| | | } |
| | | ], |
| | | "api": { |
| | | "url": "/tStudent/Toholi", |
| | | "method": "post", |
| | | "requestAdaptor": "", |
| | | "adaptor": "", |
| | | "messages": { |
| | | }, |
| | | "dataType": "form-data" |
| | | }, |
| | | "id": "u:8860df492a12" |
| | | } |
| | | ], |
| | | "id": "u:710cbc62ec24", |
| | | "actions": [ |
| | | ] |
| | | } |
| | | ], |
| | | "id": "u:42603b55fcf2" |
| | | }; |
| | | let amisScoped = amis.embed('#root', amisJSON); |
| | | |
| | | |
| | | })(); |
| | | |
| | | function test(){ |
| | | console.log("测试成功") |
| | | } |
| | | |
| | | var myButton = document.getElementById("ttt"); |
| | | myButton.addEventListener("click",test); |
| | | </script> |
| | | |
| | | </body> |
| | | </html> |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="zh"> |
| | | <head> |
| | | <meta charset="UTF-8" /> |
| | | <title>amis demo</title> |
| | | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
| | | <meta |
| | | name="viewport" |
| | | content="width=device-width, initial-scale=1, maximum-scale=1" |
| | | /> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=Edge" /> |
| | | <link rel="stylesheet" href="${ctxPath}/sdk/sdk.css" /> |
| | | <link rel="stylesheet" href="${ctxPath}/sdk/helper.css" /> |
| | | <link rel="stylesheet" href="${ctxPath}/sdk/iconfont.css" /> |
| | | <!-- 这是默认主题所需的,如果是其他主题则不需要 --> |
| | | <!-- 从 1.1.0 开始 sdk.css 将不支持 IE 11,如果要支持 IE11 请引用这个 css,并把前面那个删了 --> |
| | | <!-- <link rel="stylesheet" href="sdk-ie11.css" /> --> |
| | | <!-- 不过 amis 开发团队几乎没测试过 IE 11 下的效果,所以可能有细节功能用不了,如果发现请报 issue --> |
| | | <style> |
| | | html, |
| | | body, |
| | | .app-wrapper { |
| | | position: relative; |
| | | width: 100%; |
| | | height: 100%; |
| | | margin: 0; |
| | | padding: 0; |
| | | } |
| | | </style> |
| | | </head> |
| | | <body> |
| | | <div id="root" class="app-wrapper"></div> |
| | | <script src="${ctxPath}/sdk/sdk.js"></script> |
| | | <script type="text/javascript"> |
| | | (function () { |
| | | let amis = amisRequire('amis/embed'); |
| | | // 通过替换下面这个配置来生成不同页面 |
| | | let amisJSON = { |
| | | "type": "page", |
| | | "title": "", |
| | | "body": [ |
| | | { |
| | | "type": "form", |
| | | "id": "u:710cbc62ec24", |
| | | "title": "", |
| | | "body": [ |
| | | { |
| | | "type": "form", |
| | | "title": "", |
| | | "body": [ |
| | | { |
| | | "type": "tpl", |
| | | "tpl": "                    换课", |
| | | "inline": true, |
| | | "wrapperComponent": "h2", |
| | | "id": "u:194f160daab4" |
| | | }, |
| | | { |
| | | "type": "input-text", |
| | | "label": "id", |
| | | "name": "id", |
| | | "id": "u:d038053014ca", |
| | | "mode": "horizontal", |
| | | "size": "md" |
| | | }, |
| | | { |
| | | "type": "input-text", |
| | | "label": "ids", |
| | | "name": "ids", |
| | | "id": "u:223b7f2a1a5b", |
| | | "mode": "horizontal", |
| | | "size": "md" |
| | | }, |
| | | { |
| | | "label": "换课课程:", |
| | | "type": "select", |
| | | "name": "holiId", |
| | | "id": "u:e205156867e3", |
| | | "multiple": false, |
| | | "mode": "horizontal", |
| | | "source": { |
| | | "url": "/tStudent/gettrans/$id", |
| | | "method": "get", |
| | | "requestAdaptor": "", |
| | | "adaptor": "", |
| | | "messages": { |
| | | } |
| | | }, |
| | | "value": "", |
| | | "labelField": "value", |
| | | "valueField": "id", |
| | | "size": "md", |
| | | "searchable": true |
| | | } |
| | | ], |
| | | "api": { |
| | | "url": "/tStudent/ToTrans", |
| | | "method": "post", |
| | | "requestAdaptor": "", |
| | | "adaptor": "", |
| | | "messages": { |
| | | }, |
| | | "dataType": "form-data" |
| | | }, |
| | | "id": "u:8860df492a12" |
| | | } |
| | | ], |
| | | "actions": [ |
| | | ] |
| | | } |
| | | ], |
| | | "id": "u:42603b55fcf2" |
| | | }; |
| | | let amisScoped = amis.embed('#root', amisJSON); |
| | | |
| | | |
| | | })(); |
| | | |
| | | function test(){ |
| | | console.log("测试成功") |
| | | } |
| | | |
| | | var myButton = document.getElementById("ttt"); |
| | | myButton.addEventListener("click",test); |
| | | </script> |
| | | |
| | | </body> |
| | | </html> |
New file |
| | |
| | | /** |
| | | * 管理初始化 |
| | | */ |
| | | var TCoupon = { |
| | | id: "TCouponTable", //表格id |
| | | seItem: null, //选中的条目 |
| | | table: null, |
| | | layerIndex: -1 |
| | | }; |
| | | |
| | | // console.log("父级页面"+window.parent.getElementById("counpons"+$("#index").val())); |
| | | console.log("父级页面" + window.parent.document.getElementById("counpons" + $("#index").val()).value); |
| | | console.log( $("#index").val()); |
| | | |
| | | var ids = window.parent.document.getElementById("counpons" + $("#index").val()).value; |
| | | |
| | | // console.log("==========radio=="+ids) |
| | | /** |
| | | * 初始化表格的列 |
| | | */ |
| | | TCoupon.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', checkbox: true, formatter: function (value,row) { |
| | | if(ids.indexOf(row.id)!= -1){ |
| | | return {checked:true}; |
| | | }}}, |
| | | {title: 'id', field: 'id', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '优惠券名称', field: 'name', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '适用范围', field: 'useScope', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row, index) { |
| | | return {1: "全国", 2: "指定城市", 3: "指定门店"}[value] |
| | | } |
| | | }, |
| | | {title: '优惠券类型', field: 'type', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row, index) { |
| | | return {1: "满减券", 2: "代金券", 3: "体验券"}[value] |
| | | }}, |
| | | {title: '发放方式', field: 'distributionMethod', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row, index) { |
| | | return {1: "积分购买", 2: "注册赠送", 3: "自动发券"}[value] |
| | | }}, |
| | | {title: '有效期', field: 'timeValue', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '用户人群', field: 'userPopulation', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row, index) { |
| | | return {1: "全部用户", 2: "年度会员", 3: "已有学员用户"}[value] |
| | | }}, |
| | | {title: '发放数量', field: 'quantityIssued', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '限领数量', field: 'pickUpQuantity', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '已领数量', field: 'hasPickQty', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '活动状态', field: 'status', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row, index) { |
| | | return {1: "未开始", 2: "已开始", 3: "已结束"}[value] |
| | | }}, |
| | | {title: '可售状态', field: 'state', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row, index) { |
| | | return {1: "上架", 2: "下架"}[value] |
| | | }}, |
| | | ]; |
| | | }; |
| | | |
| | | /** |
| | | * 检查是否选中 |
| | | */ |
| | | TCoupon.check = function () { |
| | | var selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | if(selected.length == 0){ |
| | | Feng.info("请先选中表格中的某一记录!"); |
| | | return false; |
| | | }else{ |
| | | TCoupon.seItem = selected[0]; |
| | | TCoupon.seItem1 = selected; |
| | | |
| | | return true; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 点击添加 |
| | | */ |
| | | TCoupon.openAdd = function () { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '添加', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tCouponManage/coupon_add' |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |
| | | |
| | | |
| | | |
| | | TCoupon.backids = function (i) { |
| | | console.log("aaaaaa"+i) |
| | | if (this.check()) { |
| | | |
| | | var ids = TCoupon.seItem1.map(function(item) { |
| | | return item.id; |
| | | }).join(","); |
| | | // console.log("aaaaaa"+TCoupon.seItem1.map(function(item) { |
| | | // return item.id; |
| | | // }).join(",")) |
| | | |
| | | |
| | | // if (window.parent.document.getElementById("counpons"+i).value==null||window.parent.document.getElementById("counpons"+i).value==""){ |
| | | window.parent.document.getElementById("counpons"+i).value = ids; |
| | | // }else { |
| | | // window.parent.document.getElementById("counpons"+i).value = window.parent.document.getElementById("counpons"+i).value + ','+TCoupon.seItem.id; |
| | | // |
| | | // } |
| | | window.parent.layer.closeAll(); |
| | | } |
| | | |
| | | }; |
| | | |
| | | /** |
| | | * 点击编辑 |
| | | */ |
| | | TCoupon.openChange = function () { |
| | | if (this.check()){ |
| | | let id = TCoupon.seItem.id |
| | | let name = TCoupon.seItem.name |
| | | let quantityIssued = TCoupon.seItem.quantityIssued |
| | | let pickUpQuantity = TCoupon.seItem.pickUpQuantity |
| | | let illustrate = TCoupon.seItem.illustrate |
| | | let hasPickQty = TCoupon.seItem.hasPickQty |
| | | var index = layer.load(1,{ |
| | | type: 1 |
| | | , title: '编辑优惠券' |
| | | , area: ['50%', '50%'] |
| | | , offset: 'auto' //具体配置参考:http://www.layui.com/doc/modules/layer.html#offset |
| | | , id: 'layerDemo' //防止重复弹出cge |
| | | , content: '<div class="form-horizontal">' + |
| | | ' <div class="col-sm-11" >' + |
| | | ' <div class="col-sm-11">' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-3 control-label">优惠券名称:</label>\n' + |
| | | ' <div class="col-sm-9">\n' + |
| | | ' <label class="form-control" id="name" >'+name+'</label> '+ |
| | | ' </div>\n' + |
| | | ' </div>\n'+ |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-3 control-label">发放数量:</label>\n' + |
| | | ' <div class="col-sm-9">\n' + |
| | | ' <input class="form-control" id="num" value="'+quantityIssued+'" > '+ |
| | | ' </div>\n' + |
| | | ' </div>\n' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-3 control-label">限领数量:</label>\n' + |
| | | ' <div class="col-sm-9">\n' + |
| | | ' <input class="form-control" id="num1" value="'+pickUpQuantity+'" > '+ |
| | | ' </div>\n' + |
| | | ' </div>\n' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-3 control-label">优惠券说明:</label>\n' + |
| | | ' <div class="col-sm-9">\n' + |
| | | ' <textarea class="form-control" id="text" >'+illustrate+'</textarea> '+ |
| | | ' </div>\n' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' </div>' + |
| | | '</div>' |
| | | , btn: ['关闭', '保存'] |
| | | , btnAlign: 'c' //按钮居中 |
| | | , shade: 0.5 //不显示遮罩 |
| | | ,load:1 |
| | | , yes: function () { |
| | | layer.closeAll(); |
| | | }, |
| | | btn2:function () { |
| | | let num = $("#num").val() |
| | | if(num==''){ |
| | | Feng.info("请输入发放数量") |
| | | return false; |
| | | } |
| | | let num1 = $("#num1").val() |
| | | if(num1==''){ |
| | | Feng.info("请输入限领数量") |
| | | return false; |
| | | } |
| | | let text = $("#text").val() |
| | | if(text==''){ |
| | | Feng.info("请输入优惠券说明") |
| | | return false; |
| | | } |
| | | |
| | | if(num<hasPickQty){ |
| | | Feng.info("发放数量不能小于已领取数量") |
| | | return false; |
| | | } |
| | | var ajax = new $ax(Feng.ctxPath + "/tCouponManage/update", function (data) { |
| | | if (data.code == 200) { |
| | | Feng.success("操作成功!"); |
| | | window.location.reload(); |
| | | window.parent.layer.closeAll(); |
| | | } else if(data=="repeat"){ |
| | | window.location.reload(); |
| | | window.parent.layer.closeAll(); |
| | | Feng.error("请勿重复操作"); |
| | | }else { |
| | | return Feng.error(data.msg); |
| | | } |
| | | }, function (data) { |
| | | Feng.error("操作失败!") |
| | | window.location.reload(); |
| | | window.parent.layer.closeAll(); |
| | | return Feng.error("操作失败!"); |
| | | }); |
| | | ajax.set("id", id); |
| | | ajax.set("num", num); |
| | | ajax.set("num1", num1); |
| | | ajax.set("text", text); |
| | | ajax.start(); |
| | | layer.closeAll(); |
| | | } |
| | | }); |
| | | |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 上架 |
| | | */ |
| | | |
| | | |
| | | /** |
| | | * 下架 |
| | | */ |
| | | TCoupon.offShelf = function () { |
| | | |
| | | |
| | | }; |
| | | |
| | | |
| | | /** |
| | | * 打开查看详情 |
| | | */ |
| | | TCoupon.openDetail = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '详情', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tCouponManage/coupon_detail/' + TCoupon.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 打开领取记录 |
| | | */ |
| | | TCoupon.openCollectionRecord = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '详情', |
| | | area: ['800px', '420px'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tCouponManage/coupon_record/' + TCoupon.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | TCoupon.onShelf = function (e) { |
| | | if (this.check()) { |
| | | var ajax = new $ax(Feng.ctxPath + "/tCouponManage/onShelf", function(data){ |
| | | if(data.code==200){ |
| | | Feng.success("操作成功!") |
| | | TCoupon.table.refresh(); |
| | | } |
| | | },function(data){ |
| | | Feng.error("操作失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id",TCoupon.seItem.id) |
| | | ajax.set("type",e) |
| | | ajax.start(); |
| | | } |
| | | }; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询列表 |
| | | */ |
| | | TCoupon.search = function () { |
| | | var queryData = {}; |
| | | queryData['name'] = $("#name").val(); |
| | | queryData['type'] = $("#type").val(); |
| | | queryData['distributionMethod'] = $("#distributionMethod").val(); |
| | | queryData['userPopulation'] = $("#userPopulation").val(); |
| | | queryData['status'] = $("#status").val(); |
| | | queryData['state'] = $("#state").val(); |
| | | TCoupon.table.refresh({query: queryData}); |
| | | }; |
| | | |
| | | |
| | | /** |
| | | * 重置搜索 |
| | | */ |
| | | TCoupon.resetSearch = function () { |
| | | $("#name").val(''); |
| | | $("#type").val(''); |
| | | $("#distributionMethod").val(''); |
| | | $("#userPopulation").val(''); |
| | | $("#status").val(''); |
| | | $("#state").val(''); |
| | | TCoupon.search(); |
| | | }; |
| | | |
| | | $(function () { |
| | | // console.log("父级"+window.parent.document.getElementById("cityCode").val()) |
| | | console.log("父级" + window.parent.document.getElementById("cityCode").value); |
| | | var defaultColunms = TCoupon.initColumn(); |
| | | var table = new BSTable(TCoupon.id, "/tCouponManage/list1", defaultColunms); |
| | | table.setPaginationType("client"); |
| | | // table.queryParams = function (params) { |
| | | // // 在这里添加您的自定义参数 |
| | | // params.cityCode = window.parent.document.getElementById("cityCode").value; |
| | | // params.customParam2 = window.parent.document.getElementById("cityCode").value; |
| | | // return params; |
| | | // }; |
| | | |
| | | table.queryParams = {'cityCode': window.parent.document.getElementById("cityCode").value,'storeId': window.parent.document.getElementById("storeId").value} |
| | | table.height=400 |
| | | TCoupon.table = table.init(); |
| | | }); |
New file |
| | |
| | | /** |
| | | * 管理初始化 |
| | | */ |
| | | var TCoupon = { |
| | | id: "TCouponTable", //表格id |
| | | seItem: null, //选中的条目 |
| | | table: null, |
| | | layerIndex: -1 |
| | | }; |
| | | |
| | | var ids = $("#conpund").val(); |
| | | |
| | | console.log("==========radio=="+ids) |
| | | /** |
| | | * 初始化表格的列 |
| | | */ |
| | | TCoupon.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', checkbox: true, formatter: function (value,row) { |
| | | if(ids.indexOf(row.id)!= -1){ |
| | | return {checked:true}; |
| | | }}}, |
| | | {title: 'id', field: 'id', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '优惠券名称', field: 'name', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '适用范围', field: 'useScope', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row, index) { |
| | | return {1: "全国", 2: "指定城市", 3: "指定门店"}[value] |
| | | } |
| | | }, |
| | | {title: '优惠券类型', field: 'type', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row, index) { |
| | | return {1: "满减券", 2: "代金券", 3: "体验券"}[value] |
| | | }}, |
| | | {title: '发放方式', field: 'distributionMethod', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row, index) { |
| | | return {1: "积分购买", 2: "注册赠送", 3: "自动发券"}[value] |
| | | }}, |
| | | {title: '有效期', field: 'timeValue', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '用户人群', field: 'userPopulation', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row, index) { |
| | | return {1: "全部用户", 2: "年度会员", 3: "已有学员用户"}[value] |
| | | }}, |
| | | {title: '发放数量', field: 'quantityIssued', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '限领数量', field: 'pickUpQuantity', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '已领数量', field: 'hasPickQty', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '活动状态', field: 'status', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row, index) { |
| | | return {1: "未开始", 2: "已开始", 3: "已结束"}[value] |
| | | }}, |
| | | {title: '可售状态', field: 'state', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row, index) { |
| | | return {1: "上架", 2: "下架"}[value] |
| | | }}, |
| | | ]; |
| | | }; |
| | | |
| | | /** |
| | | * 检查是否选中 |
| | | */ |
| | | TCoupon.check = function () { |
| | | var selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | if(selected.length == 0){ |
| | | Feng.info("请先选中表格中的某一记录!"); |
| | | return false; |
| | | }else{ |
| | | TCoupon.seItem = selected[0]; |
| | | TCoupon.seItem1 = selected; |
| | | |
| | | return true; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 点击添加 |
| | | */ |
| | | TCoupon.openAdd = function () { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '添加', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tCouponManage/coupon_add' |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |
| | | |
| | | |
| | | |
| | | TCoupon.backids = function (i) { |
| | | console.log("aaaaaa"+i) |
| | | if (this.check()) { |
| | | |
| | | var ids = TCoupon.seItem1.map(function(item) { |
| | | return item.id; |
| | | }).join(","); |
| | | |
| | | window.parent.document.getElementById("counpons"+i).value = ids; |
| | | |
| | | window.parent.layer.closeAll(); |
| | | } |
| | | |
| | | }; |
| | | |
| | | /** |
| | | * 点击编辑 |
| | | */ |
| | | TCoupon.openChange = function () { |
| | | if (this.check()){ |
| | | let id = TCoupon.seItem.id |
| | | let name = TCoupon.seItem.name |
| | | let quantityIssued = TCoupon.seItem.quantityIssued |
| | | let pickUpQuantity = TCoupon.seItem.pickUpQuantity |
| | | let illustrate = TCoupon.seItem.illustrate |
| | | let hasPickQty = TCoupon.seItem.hasPickQty |
| | | var index = layer.load(1,{ |
| | | type: 1 |
| | | , title: '编辑优惠券' |
| | | , area: ['50%', '50%'] |
| | | , offset: 'auto' //具体配置参考:http://www.layui.com/doc/modules/layer.html#offset |
| | | , id: 'layerDemo' //防止重复弹出cge |
| | | , content: '<div class="form-horizontal">' + |
| | | ' <div class="col-sm-11" >' + |
| | | ' <div class="col-sm-11">' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-3 control-label">优惠券名称:</label>\n' + |
| | | ' <div class="col-sm-9">\n' + |
| | | ' <label class="form-control" id="name" >'+name+'</label> '+ |
| | | ' </div>\n' + |
| | | ' </div>\n'+ |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-3 control-label">发放数量:</label>\n' + |
| | | ' <div class="col-sm-9">\n' + |
| | | ' <input class="form-control" id="num" value="'+quantityIssued+'" > '+ |
| | | ' </div>\n' + |
| | | ' </div>\n' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-3 control-label">限领数量:</label>\n' + |
| | | ' <div class="col-sm-9">\n' + |
| | | ' <input class="form-control" id="num1" value="'+pickUpQuantity+'" > '+ |
| | | ' </div>\n' + |
| | | ' </div>\n' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-3 control-label">优惠券说明:</label>\n' + |
| | | ' <div class="col-sm-9">\n' + |
| | | ' <textarea class="form-control" id="text" >'+illustrate+'</textarea> '+ |
| | | ' </div>\n' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' </div>' + |
| | | '</div>' |
| | | , btn: ['关闭', '保存'] |
| | | , btnAlign: 'c' //按钮居中 |
| | | , shade: 0.5 //不显示遮罩 |
| | | ,load:1 |
| | | , yes: function () { |
| | | layer.closeAll(); |
| | | }, |
| | | btn2:function () { |
| | | let num = $("#num").val() |
| | | if(num==''){ |
| | | Feng.info("请输入发放数量") |
| | | return false; |
| | | } |
| | | let num1 = $("#num1").val() |
| | | if(num1==''){ |
| | | Feng.info("请输入限领数量") |
| | | return false; |
| | | } |
| | | let text = $("#text").val() |
| | | if(text==''){ |
| | | Feng.info("请输入优惠券说明") |
| | | return false; |
| | | } |
| | | |
| | | if(num<hasPickQty){ |
| | | Feng.info("发放数量不能小于已领取数量") |
| | | return false; |
| | | } |
| | | var ajax = new $ax(Feng.ctxPath + "/tCouponManage/update", function (data) { |
| | | if (data.code == 200) { |
| | | Feng.success("操作成功!"); |
| | | window.location.reload(); |
| | | window.parent.layer.closeAll(); |
| | | } else if(data=="repeat"){ |
| | | window.location.reload(); |
| | | window.parent.layer.closeAll(); |
| | | Feng.error("请勿重复操作"); |
| | | }else { |
| | | return Feng.error(data.msg); |
| | | } |
| | | }, function (data) { |
| | | Feng.error("操作失败!") |
| | | window.location.reload(); |
| | | window.parent.layer.closeAll(); |
| | | return Feng.error("操作失败!"); |
| | | }); |
| | | ajax.set("id", id); |
| | | ajax.set("num", num); |
| | | ajax.set("num1", num1); |
| | | ajax.set("text", text); |
| | | ajax.start(); |
| | | layer.closeAll(); |
| | | } |
| | | }); |
| | | |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 上架 |
| | | */ |
| | | |
| | | |
| | | /** |
| | | * 下架 |
| | | */ |
| | | TCoupon.offShelf = function () { |
| | | |
| | | |
| | | }; |
| | | |
| | | |
| | | /** |
| | | * 打开查看详情 |
| | | */ |
| | | TCoupon.openDetail = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '详情', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tCouponManage/coupon_detail/' + TCoupon.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 打开领取记录 |
| | | */ |
| | | TCoupon.openCollectionRecord = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '详情', |
| | | area: ['800px', '420px'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tCouponManage/coupon_record/' + TCoupon.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | TCoupon.onShelf = function (e) { |
| | | if (this.check()) { |
| | | var ajax = new $ax(Feng.ctxPath + "/tCouponManage/onShelf", function(data){ |
| | | if(data.code==200){ |
| | | Feng.success("操作成功!") |
| | | TCoupon.table.refresh(); |
| | | } |
| | | },function(data){ |
| | | Feng.error("操作失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id",TCoupon.seItem.id) |
| | | ajax.set("type",e) |
| | | ajax.start(); |
| | | } |
| | | }; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询列表 |
| | | */ |
| | | TCoupon.search = function () { |
| | | var queryData = {}; |
| | | queryData['name'] = $("#name").val(); |
| | | queryData['type'] = $("#type").val(); |
| | | queryData['distributionMethod'] = $("#distributionMethod").val(); |
| | | queryData['userPopulation'] = $("#userPopulation").val(); |
| | | queryData['status'] = $("#status").val(); |
| | | queryData['state'] = $("#state").val(); |
| | | TCoupon.table.refresh({query: queryData}); |
| | | }; |
| | | |
| | | |
| | | /** |
| | | * 重置搜索 |
| | | */ |
| | | TCoupon.resetSearch = function () { |
| | | $("#name").val(''); |
| | | $("#type").val(''); |
| | | $("#distributionMethod").val(''); |
| | | $("#userPopulation").val(''); |
| | | $("#status").val(''); |
| | | $("#state").val(''); |
| | | TCoupon.search(); |
| | | }; |
| | | |
| | | $(function () { |
| | | var defaultColunms = TCoupon.initColumn(); |
| | | var table = new BSTable(TCoupon.id, "/tCouponManage/list", defaultColunms); |
| | | table.setPaginationType("client"); |
| | | TCoupon.table = table.init(); |
| | | }); |
New file |
| | |
| | | // 页面导出为pdf格式 |
| | | import html2Canvas from 'html2canvas'; |
| | | import jsPDF from 'jspdf'; |
| | | |
| | | const htmlToPdf = { |
| | | getPdf(title, loading) { |
| | | return html2Canvas(document.querySelector('#pdfDom'), { |
| | | allowTaint: false, |
| | | taintTest: false, |
| | | logging: false, |
| | | useCORS: true, |
| | | dpi: window.devicePixelRatio * 4, //将分辨率提高到特定的DPI 提高四倍 |
| | | scale: 4, //按比例增加分辨率 |
| | | }).then((canvas) => { |
| | | var pdf = new jsPDF('p', 'mm', 'a4'); //A4纸,纵向 |
| | | var ctx = canvas.getContext('2d'), |
| | | a4w = 190, |
| | | a4h = 272, //A4大小,210mm x 297mm,四边各保留10mm的边距,显示区域190x277 |
| | | // imgHeight = Math.floor((a4h * canvas.width) / a4w), //按A4显示比例换算一页图像的像素高度 |
| | | imgHeight = canvas.height, //按A4显示比例换算一页图像的像素高度 |
| | | |
| | | renderedHeight = 0; |
| | | |
| | | while (renderedHeight < canvas.height) { |
| | | var page = document.createElement('canvas'); |
| | | page.width = canvas.width; |
| | | page.height = Math.min(imgHeight, canvas.height - renderedHeight); //可能内容不足一页 |
| | | |
| | | //用getImageData剪裁指定区域,并画到前面创建的canvas对象中 |
| | | page |
| | | .getContext('2d') |
| | | .putImageData( |
| | | ctx.getImageData( |
| | | 0, |
| | | renderedHeight, |
| | | canvas.width, |
| | | Math.min(imgHeight, canvas.height - renderedHeight), |
| | | ), |
| | | 0, |
| | | 0, |
| | | ); |
| | | pdf.addImage( |
| | | page.toDataURL('image/jpeg', 1.0), |
| | | 'JPEG', |
| | | 10, |
| | | 10, |
| | | a4w, |
| | | Math.min(a4h, (a4w * page.height) / page.width), |
| | | ); //添加图像到页面,保留10mm边距 |
| | | |
| | | renderedHeight += imgHeight; |
| | | if (renderedHeight < canvas.height) { |
| | | pdf.addPage(); //如果后面还有内容,添加一个空页 |
| | | } |
| | | // delete page; |
| | | } |
| | | //保存文件 |
| | | // pdf.save(title + '.pdf'); |
| | | // loading = false; |
| | | // 删除本地存储的base64字段 |
| | | return pdf.output('datauristring')//获取base64Pdf |
| | | }); |
| | | }, |
| | | }; |
| | | |
| | | export default htmlToPdf; |
New file |
| | |
| | | package com.dsh.other.model.dto.siteDto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class GiftSearchDto { |
| | | String name; |
| | | String phone; |
| | | } |
New file |
| | |
| | | package com.dsh.other.model.dto.siteDto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class SelectDto { |
| | | Integer id; |
| | | String value; |
| | | } |