bootstrap常用方法
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'youpassword' WITH GRANT OPTION;
<li>
订单类型:<select name="status" th:with="type=${@dict.getType('st_order_type')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
//密码验证
confirm_password: {
required: true,
minlength: 5,
equalTo: "#password"
}
var orderTypeCode = [[${@dict.getType('st_order_type')}]];
{选择参数
field: 'status',
title: '状态',
align: "left",
formatter: function(value, item, index) {
return $.table.selectDictLabel(datas, item.status);
}
},
{//选择字典的值
field : 'orderType',
title : '订单类型',
sortable: false,
formatter: function(value, row, index) {
return $.table.selectDictLabel(orderTypeCode, value);
}
},
{链接
field : 'orderId',
title : '订单ID',
formatter: function(value, row, index) {
return '+ row.orderId + '\')">' + value + '';
}
},
{//鼠标悬停事件
field : 'scanData',
title : '扫描内容',
formatter: function(value, row, index) {
var actions = [];
actions.push('value+'">查看详细 ');
setTimeout(function(){ $("[data-toggle='popover']").popover(); }, 1000);
return actions.join('');
}
},
{//如果状态是“00”,返回值
field : 'cardNum',
title : '操作票卡数量',
sortable: false,
formatter: function(value, row, index) {
if(row["orderStatus"]!="00"){
return value;
}else{
return null;
}
}
},
{//订单处理/废弃/删除:如果状态不是“02”或者不是“03”,“处理按钮”
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
if(row["orderStatus"]!="02"&&row["orderStatus"]!="03")
{
actions.push('+ editFlag + '" href="#" onclick="submit(\'' + row.orderId + '\')">处理 ');
}else{
actions.push('+ editFlag + '" href="#" onclick="submit(\'' + row.orderId + '\')">查看 ');
}
if(row["orderStatus"]!="02"&&row["orderStatus"]!="03")
{
actions.push('+ removeFlag + '" href="#" onclick="abandon(\'' + row.orderId + '\')">废弃 ');
}
if(row["orderStatus"]=="00")
{
actions.push('+ removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.orderId + '\')">删除 ');
}
return actions.join('');
}
}],
**********************************************************************************
{//如果不是已处理,“生成订单按钮”
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
var isNotDeal=row["dealFlag"]!=1;
if(isNotDeal){
actions.push('+ editFlag + '" href="#" onclick="generateOrder(\'' + row.id + '\')">生成订单 ');
}
//actions.push('删除');
return actions.join('');
}
}]
@RequiresPermissions("stock:rfidScanRecord:edit")
@Log(title = "rfid扫描记录", businessType = BusinessType.DELETE)
@PostMapping("/generate/{id}")
@ResponseBody
public AjaxResult generateOrder(@PathVariable("id") Integer id) {
return orderGenerateService.generateOrder(id, ShiroUtils.getLoginName());
}
**********************************************************************************
$(function() {
$("input[name='orderStatus']").attr("disabled","disabled");//"disabled"不可选
var cardStatusType = [[${@dict.getType('st_card_status')}]];
$("input:radio[name='orderType']").on('ifChecked', function(event){
var type=$(this).val()
if(type=="00"){
$("[name='storageIdSelect']").show();
$("[name='stOrderSubTypeIn']").show();
$("[name='stOrderSubTypeOut']").hide();
$("#btnSelStorage").show();
}else{
$("[name='storageIdSelect']").hide();
$("[name='stOrderSubTypeIn']").hide();
$("[name='stOrderSubTypeOut']").show();
$("#btnSelStorage").hide();
}
});
******************************************************************
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
var isNotAuth=row["deviceStatus"]!="1";
if(isNotAuth){
actions.push('+ authFlag + '"href="#" onclick="authDevice(\'' + row.id + '\')">授权 ');
}
if(!isNotAuth){
actions.push('+ authFlag + '"href="#" onclick="authDevice(\'' + row.id + '\')">取消授权 ');
}
actions.push('+ editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')">编辑 ');
actions.push('+ removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')">删除');
return actions.join('');
}
}]
};
$.table.init(options);
);
//授权方法
function authDevice(id){
var url = prefix + "/authDevice";
var data = {"id":id};
$.operate.submit(url, "post", "json", data);
}
**********************************************************************************
<li class="select-time">//搜索时间
<label>创建时间: </label><input type="text" class="time-input" id="createBeginTime" placeholder="开始时间" name="params[createBeginTime]"/>
<span>-</span>
<input type="text" class="time-input" id="createEndTime" placeholder="结束时间" name="params[createEndTime]"/>
</li>
//XML文件:
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
AND date_format(scate_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
AND date_format(scate_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
</if>
**********************************************************************************
<textarea id="remark" name="remark" class="form-control">[[*{remark}]]</textarea>
visible: false 不显示
digits: true 输入整数
{//订单子类型
field : 'orderSubType',
title : '订单子类型',
sortable: false,
formatter: function(value, row, index) {
if(row["orderType"]=="00"){
return $.table.selectDictLabel(orderSubTypeIn, value);
}else{
return $.table.selectDictLabel(orderSubTypeOut, value);
}
}
},
.XML模糊查询:
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
select u.user_id, u.dept_id, u.login_name, u.user_name, u.email, u.phonenumber, u.password, u.idcard, u.sex, u.avatar, u.salt, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name from sys_user u
left join sys_dept d on u.dept_id = d.dept_id
where u.del_flag = '0'
<if test="loginName != null and loginName != ''">
AND u.login_name like concat('%', #{loginName}, '%')
</if>
<if test="status != null and status != ''">
AND u.status = #{status}
</if>
<if test="phonenumber != null and phonenumber != ''">
AND u.phonenumber like concat('%', #{phonenumber}, '%')
</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
AND date_format(u.create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
AND date_format(u.create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
</if>
<if test="deptId != null and deptId != 0">
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE FIND_IN_SET (#{deptId},ancestors) ))
</if>
<!-- 数据范围过滤 -->
${params.dataScope}
</select>
**********************************************************************************
/**
* 修改保存出入库订单明细
*/
@RequiresPermissions("stock:orderDetail:edit")
@Log(title = "批量更新库位", businessType = BusinessType.UPDATE)
@PostMapping("/batchEdit")
@ResponseBody
public AjaxResult batchEdit(String ids,String storageId){
String[] arr = Convert.toStrArray(ids);
for (String id : arr) {
OrderDetail orderDetail = new OrderDetail();
orderDetail.setDetailId(Integer.valueOf(id));
orderDetail.setStorageId(storageId);
orderDetailService.updateOrderDetail(orderDetail);
}
return AjaxResult.success();
}
//批量删除
<delete id="deleteRfidScanRecordByIds" parameterType="String">
delete from st_rfid_scan_record where id in
<foreach item="id" collection="array" open="(" separator="," close=")"> #{id} </foreach>
</delete>
**********************************************************************************
<a class="btn btn btn-primary btn-del disabled" id="btnSelStorage" onclick="batchUpdateStorage()" shiro:hasPermission="stock:orderDetail:edit">
<i class="fa fa-edit"></i> 批量选择库位
</a>
//批量选择库位
function batchUpdateStorage(){
var rows = $.common.isEmpty($.table._option.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns($.table._option.uniqueId);
if (rows.length == 0) {
$.modal.alertWarning("请至少选择一条记录");
return;
}
selectStorageTree(rows.join())
}
**********************************************************************************
$().ready(function() {
$("#signupForm").validate({
rules: {
firstname: "required",
email: {
required: true,
email: true
},
password: {
required: true,
minlength: 5
},
confirm_password: {
required: true,
minlength: 5,
equalTo: "#password"
}
},
messages: {
firstname: "请输入姓名",
email: {
required: "请输入Email地址",
email: "请输入正确的email地址"
},
password: {
required: "请输入密码",
minlength: jQuery.format("密码不能小于{0}个字符")
},
confirm_password: {
required: "请输入确认密码",
minlength: "确认密码不能小于5个字符",
equalTo: "两次输入密码不一致不一致"
}
}
});
});
//messages处,如果某个控件没有message,将调用默认的信息
********************************************************************
//选择项表格
function selectScenicNo() {
var options = {
title: '景区选择',
width: "600",
url: prefix + "/select/",
callBack: doSubmit
};
$.modal.openTable(options);
}
function doSubmit(index, layero){
var body = layer.getChildFrame('body', index);
var selectVal=body.find('#selectObject').val();
if(!selectVal){
alert("请选择数据");
}else{
var list = body.find('#selectObject').val();
var obj = JSON.parse(list);//将json字符串解析成对象,
var scenicNo = obj.scenicNo;//获取对象的属性
document.getElementById('scenicNo').value=(scenicNo);//设置input的值
//选择完scenicNo后查找对应的游玩项目
$.ajax({
url: ctx + "scenic/scenicAdminUser/add/" + scenicNo ,
type: "post",
dataType: "json",
success: function(result){
var resData = result.projectList;//projectList对象
var msgData = result.msg;
var str = "";
for(var i = 0 ; i < resData.length ; i ++){
str += " + resData[i].projectName + "";
}
str += "