提交 2eb6ed77 编写于 作者: doc_wei's avatar doc_wei

问卷设置前后台对接完成

上级 c68018f9
此差异已折叠。
此差异已折叠。
...@@ -80,4 +80,20 @@ public class DwSurveyDirectoryController { ...@@ -80,4 +80,20 @@ public class DwSurveyDirectoryController {
dwSurveyDirectoryService.queryDwSurveyMationById(inputObject, outputObject); dwSurveyDirectoryService.queryDwSurveyMationById(inputObject, outputObject);
} }
/**
*
* @Title: editDwSurveyMationById
* @Description: 编辑调查问卷信息
* @param @param inputObject
* @param @param outputObject
* @param @throws Exception 参数
* @return void 返回类型
* @throws
*/
@RequestMapping("/post/DwSurveyDirectoryController/editDwSurveyMationById")
@ResponseBody
public void editDwSurveyMationById(InputObject inputObject, OutputObject outputObject) throws Exception{
dwSurveyDirectoryService.editDwSurveyMationById(inputObject, outputObject);
}
} }
...@@ -40,4 +40,6 @@ public interface DwSurveyDirectoryDao { ...@@ -40,4 +40,6 @@ public interface DwSurveyDirectoryDao {
public Map<String, Object> querySurveyMationById(Map<String, Object> map) throws Exception; public Map<String, Object> querySurveyMationById(Map<String, Object> map) throws Exception;
public int editDwSurveyMationById(Map<String, Object> map) throws Exception;
} }
...@@ -13,4 +13,6 @@ public interface DwSurveyDirectoryService { ...@@ -13,4 +13,6 @@ public interface DwSurveyDirectoryService {
public void queryDwSurveyMationById(InputObject inputObject, OutputObject outputObject) throws Exception; public void queryDwSurveyMationById(InputObject inputObject, OutputObject outputObject) throws Exception;
public void editDwSurveyMationById(InputObject inputObject, OutputObject outputObject) throws Exception;
} }
...@@ -157,4 +157,20 @@ public class DwSurveyDirectoryServiceImpl implements DwSurveyDirectoryService{ ...@@ -157,4 +157,20 @@ public class DwSurveyDirectoryServiceImpl implements DwSurveyDirectoryService{
outputObject.settotal(1); outputObject.settotal(1);
} }
/**
*
* @Title: editDwSurveyMationById
* @Description: 编辑调查问卷信息
* @param @param inputObject
* @param @param outputObject
* @param @throws Exception 参数
* @return void 返回类型
* @throws
*/
@Override
public void editDwSurveyMationById(InputObject inputObject, OutputObject outputObject) throws Exception {
Map<String, Object> map = inputObject.getParams();
dwSurveyDirectoryDao.editDwSurveyMationById(map);//编辑问卷信息
}
} }
...@@ -290,11 +290,29 @@ ...@@ -290,11 +290,29 @@
a.yn_end_num ynEndNum, a.yn_end_num ynEndNum,
a.end_num endNum, a.end_num endNum,
a.yn_end_time ynEndTime, a.yn_end_time ynEndTime,
a.end_time endTime, CONVERT(a.end_time, char) endTime,
a.view_answer viewAnswer a.view_answer viewAnswer
FROM FROM
dw_survey_directory a dw_survey_directory a
WHERE a.id = #{id} WHERE a.id = #{id}
</select> </select>
<update id="editDwSurveyMationById" parameterType="java.util.Map">
UPDATE dw_survey_directory
<set>
effective = #{effective},
effective_ip = #{effectiveIp},
rule = #{rule},
rule_code = #{ruleCode},
refresh = #{refresh},
yn_end_num = #{ynEndNum},
end_num = #{endNum},
yn_end_time = #{ynEndTime},
<if test="endTime != '' and endTime != null">
end_time = #{endTime},
</if>
</set>
WHERE id = #{id}
</update>
</mapper> </mapper>
\ No newline at end of file
...@@ -20,6 +20,18 @@ ...@@ -20,6 +20,18 @@
<url id="dwsurveydirectory004" path="/post/DwSurveyDirectoryController/queryDwSurveyMationById" val="获取调查问卷信息" allUse="1"> <url id="dwsurveydirectory004" path="/post/DwSurveyDirectoryController/queryDwSurveyMationById" val="获取调查问卷信息" allUse="1">
<property id="rowId" name="id" ref="required" var="问卷id"/> <property id="rowId" name="id" ref="required" var="问卷id"/>
</url> </url>
<url id="dwsurveydirectory005" path="/post/DwSurveyDirectoryController/editDwSurveyMationById" val="编辑调查问卷信息" allUse="1">
<property id="rowId" name="id" ref="required" var="问卷id"/>
<property id="effective" name="effective" ref="required,num" var="每台电脑或手机只能答一次"/>
<property id="effectiveIp" name="effectiveIp" ref="required,num" var="每个IP只能答一次"/>
<property id="rule" name="rule" ref="required,num" var="启用访问密码"/>
<property id="ruleCode" name="ruleCode" ref="" var="密码"/>
<property id="refresh" name="refresh" ref="required,num" var="有重复回答启用验证码"/>
<property id="ynEndNum" name="ynEndNum" ref="required,num" var="是否依据收到的份数结束 1是 0否"/>
<property id="endNum" name="endNum" ref="" var="依据收到的份数"/>
<property id="ynEndTime" name="ynEndTime" ref="required,num" var="是否依据收到的份数结束"/>
<property id="endTime" name="endTime" ref="" var="结束时间"/>
</url>
<!-- 问卷调查结束 --> <!-- 问卷调查结束 -->
</controller> </controller>
\ No newline at end of file
...@@ -391,6 +391,7 @@ ...@@ -391,6 +391,7 @@
,zIndex: null //控件层叠顺序 ,zIndex: null //控件层叠顺序
,done: null //控件选择完毕后的回调,点击清空/现在/确定也均会触发 ,done: null //控件选择完毕后的回调,点击清空/现在/确定也均会触发
,change: null //日期时间改变后的回调 ,change: null //日期时间改变后的回调
,choose: null
}; };
//多语言 //多语言
......
layui.config({ layui.config({
base: basePath, base: basePath,
version: skyeyeVersion version: skyeyeVersion
}).define(['jquery', 'winui'], function (exports) { }).define(['jquery', 'winui', 'laydate'], function (exports) {
winui.renderColor(); winui.renderColor();
layui.use(['form'], function (form) { layui.use(['form'], function (form) {
var index = parent.layer.getFrameIndex(window.name); //获取窗口索引 var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
var $ = layui.$, var $ = layui.$,
form = layui.form; form = layui.form,
laydate = layui.laydate;
showGrid({ showGrid({
id: "showForm", id: "showForm",
...@@ -29,9 +30,30 @@ layui.config({ ...@@ -29,9 +30,30 @@ layui.config({
return ""; return "";
} }
}); });
hdb.registerHelper('compare3', function(v1, v2, v3, options) {
if(v1 == v2){
return v3;
}else{
return "";
}
});
}, },
ajaxSendAfter:function(json){ ajaxSendAfter:function(json){
laydate.render({
elem: '#endTime', //指定元素
format: 'yyyy-MM-dd HH:mm:ss',
type: 'datetime',
min:minDate(),
theme: 'grid'
});
if(json.bean.ynEndTime == '1'){
$("#endTimeHide").hide();
}else{
$("#endTimeHide").show();
}
form.render('checkbox'); form.render('checkbox');
form.render(); form.render();
...@@ -58,8 +80,10 @@ layui.config({ ...@@ -58,8 +80,10 @@ layui.config({
form.on('checkbox(ynEndTime)', function (data) { form.on('checkbox(ynEndTime)', function (data) {
var check = data.elem.checked; var check = data.elem.checked;
if(check){//选中 if(check){//选中
$("#endTimeHide").hide();
$("#endTime").attr("readonly", false); $("#endTime").attr("readonly", false);
}else{ }else{
$("#endTimeHide").show();
$("#endTime").val(""); $("#endTime").val("");
$("#endTime").attr("readonly", true); $("#endTime").attr("readonly", true);
} }
...@@ -69,22 +93,83 @@ layui.config({ ...@@ -69,22 +93,83 @@ layui.config({
//表单验证 //表单验证
if (winui.verifyForm(data.elem)) { if (winui.verifyForm(data.elem)) {
var params = { var params = {
surveyName: $("#surveyName").val(), rowId: parent.parent.rowId
}; };
// AjaxPostUtil.request({url:reqBasePath + "dwsurveydirectory002", params:params, type:'json', callback:function(json){
// if(json.returnCode == 0){ if($('input[name=effective]').get(0).checked){
// parent.layer.close(index); params.effective = '4';
// parent.refreshCode = '0'; }else{
// }else{ params.effective = '1';
// top.winui.window.msg(json.returnMessage, {icon: 2,time: 2000}); }
// }
// }}); if($('input[name=effectiveIp]').get(0).checked){
params.effectiveIp = '1';
}else{
params.effectiveIp = '0';
}
if($('input[name=rule]').get(0).checked){
params.rule = '3';
params.ruleCode = $("#ruleCode").val();
if(isNull(params.ruleCode)){
top.winui.window.msg('请填写答卷密码', {icon: 2,time: 2000});
return false;
}
}else{
params.rule = '1';
params.ruleCode = '';
}
if($('input[name=refresh]').get(0).checked){
params.refresh = '1';
}else{
params.refresh = '0';
}
if($('input[name=ynEndNum]').get(0).checked){
params.ynEndNum = '1';
params.endNum = $("#endNum").val();
if(isNull(params.endNum)){
top.winui.window.msg('请填写答卷份数', {icon: 2,time: 2000});
return false;
}
}else{
params.ynEndNum = '0';
params.endNum = '0';
}
if($('input[name=ynEndTime]').get(0).checked){
params.ynEndTime = '1';
params.endTime = $("#endTime").val();
if(isNull(params.endTime)){
top.winui.window.msg('请填写答卷结束时间', {icon: 2,time: 2000});
return false;
}
}else{
params.ynEndTime = '0';
params.endTime = '';
}
AjaxPostUtil.request({url:reqBasePath + "dwsurveydirectory005", params:params, type:'json', callback:function(json){
if(json.returnCode == 0){
parent.layer.close(index);
parent.refreshCode = '0';
}else{
top.winui.window.msg(json.returnMessage, {icon: 2,time: 2000});
}
}});
} }
return false; return false;
}); });
} }
}); });
// 设置最小可选的日期
function minDate(){
var now = new Date();
return now.getFullYear()+"-" + (now.getMonth()+1) + "-" + now.getDate();
}
//取消 //取消
$("body").on("click", "#cancle", function(){ $("body").on("click", "#cancle", function(){
parent.layer.close(index); parent.layer.close(index);
......
...@@ -24,11 +24,12 @@ ...@@ -24,11 +24,12 @@
<div class="p_DialogContentRoot"> <div class="p_DialogContentRoot">
<div class="p_DialogContentItem"> <div class="p_DialogContentItem">
<input type="checkbox" name="ynEndNum" {{#compare1 ynEndNum '1'}}{{/compare1}} value="1" lay-filter="ynEndNum" /> 收集到&nbsp; <input type="checkbox" name="ynEndNum" {{#compare1 ynEndNum '1'}}{{/compare1}} value="1" lay-filter="ynEndNum" /> 收集到&nbsp;
<input type="text" size="12" class="inputSytle_1" id="endNum" name="endNum" value="{{endNum}}" {{#compare2 ynEndNum '1'}}{{/compare2}}>&nbsp;份答卷时结束 <input type="number" size="11" class="inputSytle_1" id="endNum" name="endNum" value="{{endNum}}" {{#compare2 ynEndNum '1'}}{{/compare2}}>&nbsp;份答卷时结束
</div> </div>
<div class="p_DialogContentItem"> <div class="p_DialogContentItem">
<input type="checkbox" name="ynEndTime" {{#compare1 ynEndTime '1'}}{{/compare1}} value="1" lay-filter="ynEndTime" />&nbsp; <input type="checkbox" name="ynEndTime" {{#compare1 ynEndTime '1'}}{{/compare1}} value="1" lay-filter="ynEndTime" />&nbsp;
<input type="text" size="20" class="inputSytle_1" id="endTime" name="endTime" value="{{endTime}}" {{#compare2 ynEndTime '1'}}{{/compare2}}>&nbsp;时结束 <input type="text" size="20" class="inputSytle_1" id="endTime" name="endTime" value="{{#compare3 ynEndTime '1' endTime}}{{/compare3}}" {{#compare2 ynEndTime '1'}}{{/compare2}}>&nbsp;时结束
<input type="text" size="20" class="inputSytle_1" id="endTimeHide" readonly style="position: absolute; margin-left: 68px; margin-top: -30px; display: block;"/>
</div> </div>
</div> </div>
</div> </div>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册