《河北省重大技术需求征集》之需求填报用例

《河北省重大技术需求征集》之需求填报用例

一、业务用例说明

用例编号:需求填报

执行者:河北省被征集需求单位

前置条件:用户登录成功

后置条件:系统保存填报信息,将需求信息添加入数据库。

涉众利益:形式审核员可以查看各单位的填报信息,并进行需求审核,传至对应的部门审核员。

基本路径:

1.普通用户进入需求填报界面

2.按需求要求提示内容完成需求填报

3.点击提交,完成需求填报

扩展字段列表:

列名

数据类型

可为空值

描述

列名

数据类型

WJID

INT

Not NULL

问卷编号(主码)

WJID

INT

SFSH

INT

NULL

形式审核是否审核通过标志(0:表示未通过,1表示通过,缺省取值为0

SFSH

INT

XSSCYJ

VARCHAR(500)

NULL

形式审核意见

XSSCYJ

VARCHAR(500)

BMSFSH

INT

NULL

部门审核是否审核通过标志(0:表示未通过,1表示通过,缺省取值为0

BMSFSH

INT

BMSHTYJ

VARCHAR(500)

NULL

部门审核意见

BMSHTYJ

VARCHAR(500)

GLCS

INT

NULL

管理处室编码

GLCS

INT

JGMC

VARCHAR(200)

NOT NULL

机构全称

JGMC

VARCHAR(200)

TXDZ

VARCHAR(200)

NOT NULL

通信地址

TXDZ

VARCHAR(200)

DWWZ

VARCHAR(200)

NULL

单位网址

DWWZ

VARCHAR(200)

DZYX

VARCHAR(200)

NULL

电子邮箱

DZYX

VARCHAR(200)

FRDB

VARCHAR(200)

NOT NULL

法人代表

FRDB

VARCHAR(200)

YZBM

VARCHAR(200)

NULL

邮政编码

YZBM

VARCHAR(200)

LXR

VARCHAR(200)

NOT NULL

联系人

LXR

VARCHAR(200)

GDDH

VARCHAR(200)

NULL

固定电话

GDDH

VARCHAR(200)

YDDH

VARCHAR(200)

NULL

移动电话

YDDH

VARCHAR(200)

CZ

VARCHAR(200)

NULL

传真

CZ

VARCHAR(200)

JGSX

VARCHAR(200)

NOT NULL

机构属性:1、企业2、高等院校3、研究机构4、其他

JGSX

VARCHAR(200)

JGJJ

TEXT

NULL

机构简介

JGJJ

TEXT

JSXQMC

VARCHAR(200)

NOT NULL

技术需求名称

JSXQMC

VARCHAR(200)

QSXQNF

INT

NOT NULL

起始需求年份

QSXQNF

INT

JZXQNF

INT

NOT NULL

截至需求年份

JZXQNF

INT

ZDKJXQGS

TEXT

NOT NULL

重大科技需求概述

ZDKJXQGS

TEXT

GJZ

VARCHAR(200)

NOT NULL

关键字

GJZ

VARCHAR(200)

YJLX

VARCHAR(200)

NOT NULL

研究类型:1、基础研究2、应用研究  3、试验发展4、研究发展与成果应用  5、技术推广与科技服务

YJLX

VARCHAR(200)

XKFL

VARCHAR(200)

NULL

学科分类(限基础研究填写)

XKFL

VARCHAR(200)

XQJSSSLY

VARCHAR(200)

NULL

需求技术所属领域(非基础研究填写):1、电子信息技术2、光机电一体化3、软件4、生物制药技术5、新材料及应用技术6、先进制造技术7、现代农业技术8、新能源与高效节能技术9、资源与环境保护新技术10其他技术(注明)

XQJSSSLY

VARCHAR(200)

QTJSMS

VARCHAR(200)

NULL

其他技术描述,当选择其他技术时,才要填写该项内容

QTJSMS

VARCHAR(200)

XQJSYYHY

VARCHAR(200)

NULL

需求技术应用行业(非基础研究填写)

XQJSYYHY

VARCHAR(200)

JSXQHZMS

VARCHAR(200)

NULL

技术需求合作模式:1、独立开发     2、技术转让3、技术入股4、合作开发5、其他

JSXQHZMS

VARCHAR(200)

NTRZJE

INT

NOT NULL

计划总投资(万元)

NTRZJE

INT

 

业务规则:1.*的不能为空

          2.邮箱、电话、网址、时间等按格式录入

非功能需求:系统响应时间不能超过3s

设计约束:如何快速录入需求信息?

待解决问题:录入信息的判断,例如:邮箱、电话、传真等

二、概要设计

画出技术需求征集表,并完成数据填报

三、详细设计说明书

*机构全称

 

归口管理部门

 

*通讯地址

 

*所在地域

 

网  址

 

*电子信箱

 

*法人代表

 

邮政编码

 

*联 系 人

 

固定电话

 

*手  机

 

传  真

 

*机构属性

○企业      ○高等院校   ○研究机构   ○其他

*机构简介(主要包括基本情况、现有研究基础等,500字以内)

*技术需求名称

 

*需求时限

年至     

*技术需求概述

1、主要问题(需要解决的重大技术问题,限500字以内)

2、技术关键(所需的关键技术、主要指标,限500字以内)

3、预期目标(技术创新性、经济社会效益,限500字以内)

*关键字:(1-5) 五个文本框(显示五个文本框,限制只能逐个顺序录入)

拟投入资金总额

万元

*技术需求解决方式

(位置调整)

独立研发     委托研发   合作研发     其他

合作意向单位                      (选填)

*科技活动类型

○基础研究  ○应用研究  ○试验发展

○研究与试验发展成果应用  ○技术推广与科技服务  ○生产性活动

*学科分类(限基础研究填写)

(参见学科分类)三级下拉文本框

*需求技术所属领域

(非基础研究填写)

□电子信息  □光机电一体化  □生物技术与制药  □新材料及应用 □ 现代农业 □新能源与高效节能  □资源与环境  □高技术服务业  □海洋  □社会公共事业  □医疗卫生  □其它(注明)

(可多选)

*需求技术应用行业

(非基础研究填写)

(参见国民经济行业分类)三级下拉文本框

 

 

具体要求:

1、 学科分类、需求技术所属领域、需求技术应用行业增加必填项标志*;

2、 需求时限要求判断 结束年份要大于开始年份,并且增加结束时间需要 大于等于 当前年份的判断条件

3、 技术需求解决方式  上下两个条形框 高度调整为一致 “其他”选项后面的文本框太窄,再调大一点。(整个框均匀美观一些)

4、 关键字(1-5个)后面填写框直接显示五个。但是需要从左到右顺序填写。(加入判断)

5、 填写项标题 字体 其后面的选择项的字体区分开。所需填写项标题 定义为黑体四号字体。后面的选项字体保持一致。

6、 信息填写完后,点击‘提交并保存’按钮后,弹出的提示框“确定提交吗 ”提示语改为“需求信息审核后不能修改! 确定提交吗”。点击确定后才算正式提交信息。

四、实现效果图

 

五、具体代码实现

填报界面代码:

<!DOCTYPE html>
<html>
<head>
    <title>征集页面</title>
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script>
        addEventListener("load", function () { setTimeout(hideURLbar, 0); }, false); function hideURLbar() { window.scrollTo(0, 1); }
    </script>
    <script src="../../static/admin/js/jquery-1.8.3.js" type="text/javascript"></script>
    <link href="../../static/admin/css/font-awesome.min.css" rel="stylesheet">
    <link href="../../static/admin/css/bootstrap.min.css" rel="stylesheet">

</head>
<style>
    input::-webkit-input-placeholder {
        /* placeholder颜色  */
        color: #ff0000;
    }
    #doc{
        margin-left: 200px;
        margin-right: 200px;
        padding-left: 50px;
        padding-right: 50px;
        padding-top: 0px;
    }
    td{
        font-family: '楷体';
        font-weight: bolder;
        font-size: 18px;
    }
    input[type=text]{
        width: 100%;
        height: 100%;
        border: 0;
        outline: none;
    }
    textarea{
        width: 100%;
        height: 100%;
        border: 0;
        outline: none;
    }
</style>
<script>
    $(function () {
        var username=localStorage.getItem("username");
        $.ajax({
            url: "../../getuser",
            type: "POST",
            data: {"username": username},
            dataType: "JSON",
            async: true,
            success: function (data) {
                var yzbm=data.yzbm;
                var jgqc=data.jgqc;
                $("#jgmc").val(jgqc);
                $("#yzbm").val(yzbm);
            },
            error: function (e) {
                alert("获取邮编等出现错误!!");
            }
        });
    });
</script>
<body>
<div id="doc">
    <h2 align="center">河北省重大技术需求征集表</h2>
        <table align="center" border="1px" bordercolor="black" cellspacing="0" cellpadding="10" width="90%">
            <tr>
                <td>机构全称<span style="color: red">*</span></td>
                <td colspan="2"><input  type="text" id="jgmc" ></td>
                <td>归口管理部门</td>
                <td colspan="2"><input  type="text" id="gkglbm" ></td>
            </tr>
            <tr>
                <td>通讯地址<span style="color: red">*</span></td>
                <td colspan="2"><input  type="text" id="txdz"></td>
                <td>所在地域<span style="color: red">*</span></td>
                <td colspan="2"><input  type="text" id="szdy"></td>
            </tr>
            <tr>
                <td>网址</td>
                <td colspan="2"><input type="text" id="dwwz" ></td>
                <td>电子邮箱<span style="color: red">*</span></td>
                <td colspan="2"><input type="text" style="width: 100%" id="dzyx"></td>
            </tr>

            <tr>
                <td>法人代表<span style="color: red">*</span></td>
                <td colspan="2"><input type="text" id="frdb"></td>
                <td>邮政编码</td>
                <td colspan="2"><input type="text" id="yzbm"></td>
            </tr>

            <tr >
                <td>联系人<span style="color: red">*</span></td>
                <td colspan="2"><input type="text" id="lxr" ></td>
                <td>固定电话</td>
                <td colspan="2"><input type="text" style="width: 100%"  id="gddh" placeholder="固定电话(选填)"></td>

            </tr>
            <tr>
                <td>移动电话<span style="color: #ff0000">*</span></td>
                <td colspan="2"><input type="text" style="width: 100%"  id="yddh" placeholder="移动电话"></td>
                <td>传真</td>
                <td colspan="2"><input type="text" style="width: 100%;" id="cz"></td>
            </tr>
            <tr>
                <td>机构属性<span style="color: red">*</span></td>
                <td colspan="5">
                    <input  type="radio" name="jgsx" value="企业" />企业
                    <input  type="radio" name="jgsx" value="高等院校"/>高等院校
                    <input  type="radio" name="jgsx" value="研究机构"/>研究机构
                    <input  type="radio" name="jgsx" value="其他"/>其他
                </td>
            </tr>
            <tr>
                <td colspan="6">
                    <textarea id="jgjj" placeholder="机构简介(单位基本情况,研究基础等,限500字)" style="width: 100%;height: 100px;"></textarea>
                </td>
            </tr>
            <tr>
                <td>技术需求名称<span style="color: red">*</span></td>
                <td colspan="2">
                    <input id="jsxqmc" type="text" style="width: 100%;"/>
                </td>
                <td>需求年限<span style="color: red">*</span></td>
                <td colspan="3">
                    <input id="qsxqnf" type="text"  style="width: 30%;"/> ---
                    <input id="jzxqnf" type="text" style="width: 30%;"/>
                </td>
            </tr>
            <tr>

            <tr>
                <td rowspan="3">技术需求概述</td>
                <td colspan="5" >
                    <textarea id="zywt" placeholder="主要问题(需要解决的重大技术问题,限500字以内)"  style="width: 100%;height: 100px;"></textarea>
                </td>
            <tr>
                <td colspan="5">
                    <textarea readonly="readonly" id="jsgj" placeholder="技术关键(所需的关键技术、主要指标,限500字以内)"  style="width: 100%;height: 100px;"></textarea>
                </td>
            </tr>
            <tr>
                <td colspan="5">
                <textarea readonly="readonly" id="yqmb" placeholder="预期目标(技术创新性、经济社会效益,限500字以内)"  style="width: 100%;height: 100px;"></textarea>
                </td>
            </tr>
            </tr>

            <tr>
                <td>关键词<span style="color: red">*</span></td>
                <td colspan="1">
                    <input  id="gjz1" style="width: 100%" type="text">
                </td>
                <td colspan="1">
                    <input  id="gjz2" style="width: 100%" type="text" readonly="readonly">
                </td>
                <td colspan="1">
                    <input  id="gjz3" style="width: 100%" type="text" readonly="readonly">
                </td>
                <td colspan="1">
                    <input  id="gjz4" style="width: 100%" type="text" readonly="readonly">
                </td>
                <td colspan="1">
                    <input  id="gjz5" style="width: 100%" type="text" readonly="readonly">
                </td>

            </tr>
            <tr>
                <td>拟投入资金总额<span style="color: red">*</span></td>
                <td colspan="5"><input  id="ntrjzze" style="width: 80%" type="text">万元</td>
            </tr>
            <tr>
                <td rowspan="2" colspan="">技术需求解决方式<span style="color: red">*</span></td>
                <td colspan="5">
                    <input name="jsxqhzms" type="checkbox" onchange="jsxqhzms()" value="独立研发"/>独立研发
                    <input name="jsxqhzms" type="checkbox" onchange="jsxqhzms()" value="委托研发"/>委托研发
                    <input name="jsxqhzms" type="checkbox" onchange="jsxqhzms()" value="合作开发"/>合作开发
                    <input name="jsxqhzms" type="checkbox" onchange="jsxqhzms()" id="qt" value="其他"/>其他
                </td>
            </tr>
            <tr>
                <td colspan="2">合作意向单位(选填)</td>
                <td colspan="3">
                    <input id="hzyxdw" type="text">
                </td>

            </tr>


            </tr>
            <tr>
                <td>科技活动类型<span style="color: red">*</span></td>
                <td colspan="5">
                    <input  name="yjlx" type="checkbox" value="基础研究" onchange="yjlx()"/>基础研究
                    <input  name="yjlx" type="checkbox" value="应用研究" onchange="yjlx()" />应用研究
                    <input  name="yjlx" type="checkbox" value="试验发展" onchange="yjlx()" />试验发展
                    <input  name="yjlx" type="checkbox" value="研究与试验发展成果应用" onchange="yjlx()" />研究与试验发展成果应用
                    <input  name="yjlx" type="checkbox" value="技术推广与科技服务" onchange="yjlx()" />技术推广与科技服务
                    <input  name="yjlx" type="checkbox" value="生产性活动" onchange="yjlx()" />生产性活动
                </td>
            </tr>
            <tr>
                <td>学科分类<span style="color: red">*</span></td>
                <td colspan="5">
                    <input id="xkfl" style="width: 100%;" type="text" placeholder="(参加学科分类,限基础研究填写)"/>
                </td>
            </tr>
            <tr>
                <td>需求技术所属领域(非基础研究填写)<span style="color: red">*</span></td>
                <td colspan="5">
                    <input name="xqjsssly" type="checkbox" value="电子信息技术" onchange="xqjsssly()" />电子信息技术
                    <input name="xqjsssly" type="checkbox" value="光机电一体化" onchange="xqjsssly()" />光机电一体化
                    <input name="xqjsssly" type="checkbox" value="软件" onchange="xqjsssly()" />软件
                    <input name="xqjsssly" type="checkbox" value="生物制药技术" onchange="xqjsssly()" />生物制药技术
                    <input name="xqjsssly" type="checkbox" value="新材料及应用技术" onchange="xqjsssly()" />新材料及应用技术
                    <input name="xqjsssly" type="checkbox" value="先进制造技术" onchange="xqjsssly()" />先进制造技术
                    <input name="xqjsssly" type="checkbox" value="现代农业技术" onchange="xqjsssly()" />现代农业技术
                    <input name="xqjsssly" type="checkbox" value="新能源与高效节能技术" onchange="xqjsssly()" />新能源与高效节能技术
                    <input name="xqjsssly" type="checkbox" value="资源与环境保护新技术" onchange="xqjsssly()" />资源与环境保护新技术
                    <input name="xqjsssly" type="checkbox" value="其他技术(注明)" id="qtjs" onchange="xqjsssly()" />其他技术(注明)
                </td>
            </tr>

            <tr id="qita"></tr>

            <tr>
                <td>需求技术应用行业<span style="color: red">*</span></td>
                <td colspan="5">
                    <input id="xqjsyyhy" type="text" placeholder="(参见国民经济行业分类,非基础研究填写)"/>
                </td>
            </tr>



            <tr id="qita2"></tr>

            <!--<tr>
                <td rowspan="2">项目资金需求及来源</td>
                <td colspan="2">
                        计划总投资<span style="color: red">*</span><input id="jhztz" style="width: auto;" type="text" readonly="readonly" />万元
                </td>
                <td colspan="2">
                    企业自筹<span style="color: red">*</span><input id="qyzc" style="width: auto;" onchange="qyzc()" type="text" />万元
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    银行贷款<span style="color: red">*</span><input id="yhdk" style="width: auto;" onchange="yhdk()" type="text" />万元
                </td>
                <td colspan="2">
                    其它融资<span style="color: red">*</span><input id="qtrz" style="width: auto;"  onchange="qtrz()" type="text" />万元
                </td>
            </tr>-->

        </table>
        <p style="text-align: center">
            <button type="button" id="btn" class="btn btn-success btn-lg" >保存并提交</button>
        </p>

 </div>
<script type="text/javascript">
    var flag = 1;
    $(function () {
        //非空判断
        $("#jgmc").blur(function () {
            if ($("#jgmc").val() == "")
            {
                $('#jgmc').attr('placeholder','此项不能为空').css('color','red')
                flag=0;
            }else{
                $('#jgmc').css('color','black');
                flag=1;
            }
        });
        //通讯地址
        $("#txdz").blur(function () {
            if ($("#txdz").val() == "")
            {
                $('#txdz').attr('placeholder','此项不能为空').css('color','red')
                flag=0;
            }else{
                $('#txdz').css('color','black');
                flag=1;
            }
        });
        //单位网址
        $("#dwwz").blur(function () {
            $("#dwwz").focus()  ;
            var url = $("#dwwz").val();
            var regExp = /^((https?|ftp|news):\/\/)?([a-z]([a-z0-9\-]*[\.])+([a-z]{2}|aero|arpa|biz|com|coop|edu|gov|info|int|jobs|mil|museum|name|nato|net|org|pro|travel)|(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))(\/[a-z0-9_\-\.~]+)*(\/([a-z0-9_\-\.]*)(\?[a-z0-9+_\-\.%=&]*)?)?(#[a-z][a-z0-9_]*)?$/;
            if (url!= "") {
                if(!(regExp.test(url))){
                    alert("网址不正确,请重新输入");
                    flag=0;
                }else{
                    flag=1;
                }
            }
        });
        //电子邮箱
        $("#dzyx").blur(function () {
            if ($("#dzyx").val()=="")
            {
                $("#dzyx").attr('placeholder','此项不能为空').css('color','red');
                flag=0;
            }
            else {
                $("#dwwz").css('color','black');
                flag=1;
            }
            var dzyx = $("#dzyx").val();
            var regExp = /^[a-z0-9][\w\.\-]*@[a-z0-9\-]+(\.[a-z]{2,5}){1,2}$/i;
            if(dzyx != ""){
                if(!(regExp.test(dzyx))){
                    alert("电子邮箱格式不正确");
                    flag=0;
                }else {
                    flag=1;
                }
            }
        })
        //法人代表
        $("#frdb").blur(function () {
            if ($("#frdb").val() == "")
            {
                $('#frdb').attr('placeholder','此项不能为空').css('color','red');
                flag=0;
            }else{
                $('#frdb').css('color','black');
                flag=1;
            }
        });
        //邮政编码
        $("#yzbm").blur(function () {
            var yzbm  = $("#yzbm").val();
            var regExp = /^\d{6}$/;
            if(yzbm != "")
            {
                if(!regExp.test(yzbm)){
                    alert("邮编格式有错误");
                    flag=0;
                }else{flag=1;}
            }
        })
        //联系人
        $("#lxr").blur(function () {
            if($("#lxr").val() == "")
            {
                $("#lxr").attr('placeholder', '此项不能为空').css('color', 'red');
                flag=0;
            }else {
                $("#lxr").css('color', 'black');
                flag=1;
            }
        });
        //移动电话
        $("#yddh").blur(function () {
            if($("#yddh").val() == "")
            {
                $("#yddh").attr('placeholder','此项不能为空').css('color','red');
                flag=0;
            }else{
                $("#yddh").css('color','black')
                flag=1;
            }
            var yddh = $("#yddh").val();
            var regExp = /^1(3|4|5|6|7|8|9)\d{9}$/ ;
            if(yddh != ""){
                if(!regExp.test(yddh))
                {
                    alert("移动电话格式不对")
                    flag=0;
                }else{flag=1;}
            }
        })
       /* //固定电话
        $("#gddh").blur(function () {
            if($("#gddh").val() == "")
            {
                $("#gddh").attr('placeholder','此项不能为空').css('color','red');
            }else{
                $("#gddh").css('color','black')
            }
            var gddh = $("#gddh").val();
            var regExp = /^((0\d{2,3})-)(\d{7,8})(-(\d{3,}))?$/ ;
            if(gddh != ""){
                if(!regExp.test(gddh))
                {
                    alert("固定电话格式不对")
                }
            }
        })*/
        //传真
        $("#cz").blur(function () {
            var cz = $("#cz").val();
            var regExp = /^((0\d{2,3})-)(\d{7,8})(-(\d{3,}))?$/ ;
            if(cz != ""){
                if(!regExp.test(cz))
                {
                    alert("传真格式不对");
                    flag=0;
                }else{flag=1;}
            }
        })
        //机构简介
        $("#jgjj").blur(function () {
            if($("#jgjj").val() == "")
            {
                $("#jgjj").attr('placeholder','此项不能为空').css('color','red');
                flag=0;
            }else{
                $("#jgjj").css('color','black');
                flag=1;
            }
            if($("#jgjj").val().length > 500)
            {
                alert("机构简介填写超过字数,请您重新填写!");
                flag=0;
            }else{flag=1;}
        });
        //技术需求名称
        $("#jsxqmc").blur(function () {
            if($("#jsxqmc").val() == "")
            {
                $("#jsxqmc").attr('placeholder','此项不能为空').css('color','red');
                flag=0;
            }else {
                $("#jsxqmc").css('color','black');
                flag=1;
            }
        });
        //起始需求年份
        $("#qsxqnf").blur(function () {
            if($("#qsxqnf").val() == "")
            {
                $("#qsxqnf").attr('placeholder','此项不能为空').css('color','red');
                flag=0;
            }else {
                $("#qsxqnf").css('color','black');
                flag=1;
            }
            var qsxqnf = $("#qsxqnf").val();
            var regExp1 = /^[0-9]+$/;
            //var regExp2 = /^(19\d\d|20\d\d|2021)$/;
            if(qsxqnf != "")
            {
                if(!regExp1.test(qsxqnf)){
                    alert("输入有误,请输入数字");
                    flag=0;
                }else {flag=1;}/*else if(!regExp2.test(qsxqnf)){
                    alert("请输入1900-2021年份之间的");
                }*/
            }
        });
        //截至需求年份
        $("#jzxqnf").blur(function () {
            if($("#jzxqnf").val() == "")
            {
                $("#jzxqnf").attr('placeholder','此项不能为空').css('color','red');
                flag=0;
            }else {
                $("#jzxqnf").css('color','black');
                flag=1;
            }
            var jzxqnf = $("#jzxqnf").val();
            var regExp1 = /^[0-9]+$/;
            //var regExp2 = /^(19\d\d|20\d\d|2021)$/;
            if(jzxqnf != "")
            {
                if(!regExp1.test(jzxqnf)){
                    alert("输入有误,请输入数字");
                    flag=0;
                }else {flag=1;}/*else if(!regExp2.test(jzxqnf)){
                    alert("请输入1900-2021年份之间的");
                }*/
            }
        });
        //重大科技需求概述
        $("#zywt").blur(function () {
            if($("#zywt").val() == "")
            {
                $("#zywt").attr('placeholder','此项不能为空').css('color','red');
                flag=0;
            }else {
                $("#zywt").css('color','black');
                $("#jsgj").removeAttr('readonly');
                flag=1;
            }
            if($("#zywt").val().length >500)
            {
                alert("重大科技需求概述填写超过500,请您重新填写!");
                flag=0;
            }else{flag=1;}

        });
        $("#jsgj").blur(function () {
            if($("#jsgj").val() == "")
            {
                $("#jsgj").attr('placeholder','此项不能为空').css('color','red');
                flag=0;

            }else {
                $("#jsgj").css('color','black');
                $("#yqmb").removeAttr('readonly')
                flag=1;
            }
            if($("#jsgj").val().length >500)
            {
                alert("重大科技需求概述填写超过500,请您重新填写!");
                flag=0;
            }else{flag=1;}

        });
        $("#yqmb").blur(function () {
            if($("#yqmb").val() == "")
            {
                $("#yqmb").attr('placeholder','此项不能为空').css('color','red');
                flag=0;
            }else {
                $("#yqmb").css('color','black');
                flag=1;
            }
            if($("#yqmb").val().length >500)
            {
                alert("重大科技需求概述填写超过500,请您重新填写!");
                flag=0;
            }else{flag=1;}

        });

        //关键字
        $("#gjz1").blur(function () {
            if($("#gjz1").val() == "")
            {
                $("#gjz1").attr('placeholder','此项不能为空').css('color','red');
                flag=0;
            }else {
                $("#gjz1").css('color','black');
                $("#gjz2").removeAttr('readonly');
                flag=1;
            }
        });
        $("#gjz2").blur(function () {
            if($("#gjz2").val() != "")
            {
                $("#gjz2").css('color','black');
                $("#gjz3").removeAttr('readonly');
            }
        });
        $("#gjz3").blur(function () {
            if($("#gjz3").val() != "")
            {
                $("#gjz3").css('color','black');
                $("#gjz4").removeAttr('readonly');
            }
        });
        $("#gjz4").blur(function () {
            if($("#gjz4").val() != "")
            {
                $("#gjz4").css('color','black');
                $("#gjz5").removeAttr('readonly');
            }
        });
        $("#gjz5").blur(function () {
            if($("#gjz5").val() != "")
            {
                $("#gjz5").css('color','black');
            }
        });

        $("#ntrjzze").blur(function () {
            if($("#ntrjzze").val() == "")
            {
                $("#ntrjzze").attr('placeholder','此项不能为空').css('color','red');
                flag=0;
            }else {
                $("#ntrjzze").css('color','black');
                flag=1;
            }
            var ntrjzze = $("#ntrjzze").val();
            var regExp1 = /^[0-9]+$/;
            if(ntrjzze != "")
            {
                if(!regExp1.test(ntrjzze)){
                    alert("拟投入资金总额项,请输入数字");
                    flag=0;
                }else {flag=1;}
            }
        })
    });
    function yjlx() {
        $("input[name='yjlx']:checkbox").each(function(){
            $(this).click(function(){
                if($(this).prop('checked')){
                    $('input[name="yjlx"]').prop('checked',false);
                    $(this).prop('checked',true);
                }
            });
        });
        var val = $('input[name="yjlx"]:checked').val();//获取选中的单选的值
        if (val == "基础研究") {
            $("#qita").empty();
            $("#xkfl").attr('disabled', false);
            var obj=document.getElementsByName("xqjsssly");
            for(i=0;i<obj.length;i++){
                obj[i].disabled=true;
                obj[i].checked=false;
            }
            $("#xqjsyyhy").attr("disabled",true);
            $("#xqjsyyhy").val("");
        } else {
            $("#xkfl").attr('disabled', 'disabled');
            $("#xkfl").val("");
            $("#xqjsyyhy").attr('disabled', false);
            var obj = document.getElementsByName("xqjsssly");
            for (i = 0; i < obj.length; i++) {
                obj[i].disabled = false;
            }
        }
    };
    function xqjsssly(){
        $('input[name="xqjsssly"]:checkbox').each(function () {
            var text = "<td>其他技术说明</td>\n" +
                "                <td colspan=\"5\">\n" +
                "                    <input type=\"text\" id=\"qitas\">\n" +
                "                </td>";
            var ischecked = $("#qtjs").prop('checked');
            if(ischecked == true)
            {
                $("#qita").html(text);
            }else{
                $("#qita").empty();
            }
        });
    };
    function jsxqhzms() {
        $("input[name='jsxqhzms']:checkbox").each(function(){
            $(this).click(function(){
                if($(this).prop('checked')){
                    $('input[name="jsxqhzms"]').prop('checked',false);
                    $(this).prop('checked',true);
                }
            });
        });
        /*$('input[name="jsxqhzms"]:checkbox').each(function () {
            var ischecked = $("#qt").prop('checked');
            var text = "<td>其他技术说明</td>\n" +
                "                <td colspan=\"5\">\n" +
                "                    <input type=\"text\" id=\"qitas2\">\n" +
                "                </td>";

            if(ischecked == true){
                $("#qita2").html(text);
            }
            else{
                $("#qita2").empty();
            }
        });*/
    }
    /*function qyzc() {
        var qyzc = $("#qyzc").val();
        var yhdk = $("#yhdk").val();
        var qtrz = $("#qtrz").val();
        var z =Number(qyzc)+Number(yhdk) + Number(qtrz);
        $("#jhztz").val(z)
    }
    function yhdk() {
        var qyzc = $("#qyzc").val();
        var yhdk = $("#yhdk").val();
        var qtrz = $("#qtrz").val();
        var z =Number(qyzc)+Number(yhdk) + Number(qtrz);
        $("#jhztz").val(z)
    }
    function qtrz() {
        var qyzc = $("#qyzc").val();
        var yhdk = $("#yhdk").val();
        var qtrz = $("#qtrz").val();
        var z =Number(qyzc)+Number(yhdk) + Number(qtrz);
        $("#jhztz").val(z)
    }*/

    $(function () {
        $("#btn").click(function () {
            

            var jgmc = $("#jgmc").val();
            var txdz = $("#txdz").val();
            var frdb = $("#frdb").val();
            var lxr = $("#lxr").val();
            var jgsx = $('input[name="jgsx"]:checked').val();
            var qsxqnf = $("#qsxqnf").val();
            var jzxqnf = $("#jzxqnf").val();
            /*var zdkjxqgs = $("#zdkjxqgs").val();*/
            var yjlx = $('input[name="yjlx"]:checked').val();//获取选中的单选的值
            /*var jhztz = $("#jhztz").val();*/
            /*var qyzc = $("#qyzc").val()
            var yhdk = $("#yhdk").val();
            var qtrz = $("#qtrz").val();*/

            var username=localStorage.getItem("username");

            var dwwz = $("#dwwz").val();
            var dzyx = $("#dzyx").val();
            var yzbm = $("#yzbm").val();
            var gddh = $("#gddh").val();
            var yddh = $("#yddh").val();
            var cz = $("#cz").val();
            var jgjj = $("#jgjj").val();
            var jsxqmc = $("#jsxqmc").val();
            var xkfl = "";
            var xqjsssly="";
            var qtjsms = "";
            var xqjsyyhy = "";

            var gkglbm = $("#gkglbm").val();
            var szdy = $("#szdy").val();
            var zywt = $("#zywt").val();
            var jsgj = $("#jsgj").val();
            var yqmb = $("#yqmb").val();
            var gjz1 = $("#gjz1").val();
            var gjz2 = $("#gjz2").val();
            var gjz3 = $("#gjz3").val();
            var gjz4 = $("#gjz4").val();
            var gjz5 = $("#gjz5").val();
            var gjz = gjz1+","+gjz2+","+gjz3+","+gjz4+","+gjz5;
            var ntrjzze  = $("#ntrjzze").val();
            var hzyxdw = $("#hzyxdw").val();

            var myDate = new Date();
            var tYear = myDate.getFullYear();

            if(parseInt(jzxqnf)<parseInt(qsxqnf))
            {
                alert("结束年份要大于开始年份!!!");
                return false;
            }
            if(parseInt(jzxqnf)<parseInt(tYear))
            {
                alert("结束时间按要大于等于当前年份");
                return false;
            }

            if(yjlx=="基础研究")
            {
                xkfl=$("#xkfl").val();
            }
            else
            {
                var count = 0;
                var obj = document.getElementsByName("xqjsssly");
                for (var i = 0; i < obj.length; i++) {
                    if (obj[i].checked) {
                        if(count!=0)
                            xqjsssly+=",";
                        //第三次需求更改变动
                        if(obj[i].value=="其他技术(注明)")
                            qtjsms=$("#qitas").val();
                        xqjsssly+=obj[i].value;
                        count += 1;
                    }
                }
                xqjsyyhy=$("#xqjsyyhy").val();
            }
            //第三次需求技术变动:将单选变多选
            var jsxqhzms="";
            var count = 0;
            var obj2 = document.getElementsByName("jsxqhzms");
            for (var j = 0; j < obj2.length; j++) {
                if (obj2[j].checked) {
                    if(count!=0)
                        jsxqhzms+=",";
                    jsxqhzms+=obj2[j].value;
                    count +=1;
                }
            }

            if(jgmc==""||txdz==""||dzyx==""||frdb==""||lxr==""||yddh==""||
                jgsx==""||jgjj==""||jsxqmc==""||qsxqnf==""||jzxqnf==""||gjz==""||ntrjzze=="")
            {
                alert("请将标注红*的地方填写完整!!!");
                return false;
            }

            if(yjlx=="基础研究")
            {
                if(xkfl=="")
                {
                    alert("学科分类不为空!!");
                    return false;
                }
            }
            if(jsxqhzms=="")
            {
                alert("请将技术需求解决方式填写完整!!");
                return false;
            }

            //alert(username+jgmc+txdz+dwwz+frdb+dzyx+yzbm+lxr+gddh+yddh+cz+jgsx);

            //20183521 人事局 邯郸  www. asd 12055 050000 asd 0378 173310  0379 企业
            if(flag==1)
            {
                var msg = "需求信息审核后不能修改! 确定提交吗";
                if(confirm(msg)==true)
                {
                    $.ajax({
                        url: "../../adddoc",
                        type: "POST",
                        data: {"username":username,"jgmc": jgmc, "txdz": txdz,"dwwz":dwwz,"frdb":frdb,"dzyx":dzyx,"yzbm":yzbm,"lxr":lxr,"gddh":gddh,"yddh":yddh,"cz":cz,"jgsx":jgsx,
                            "jgjj":jgjj,"jsxqmc":jsxqmc,"gjz":gjz,"yjlx":yjlx,"xkfl":xkfl,"xqjsssly":xqjsssly,"xqjsyyhy":xqjsyyhy,"jsxqhzms":jsxqhzms,"qsxqnf":qsxqnf,"jzxqnf":jzxqnf,
                            "qtjsms":qtjsms, "gkglbm":gkglbm,"szdy":szdy,"zywt":zywt,"jsgj":jsgj,"yqmb":yqmb,"ntrjzze":ntrjzze,"hzyxdw":hzyxdw},
                        dataType: "text",
                        async: true,
                        success: function (data) {
                            if(data=="yes")
                            {
                                alert("提交成功!!");
                            }
                        },
                        error: function (e) {
                            alert("表提交出现错误!!");
                        }
                    });
                }else{
                    return ;
                }
            }
            else {
                alert("当前问卷填写还存在错误,请更改后重新提交");
            }
        })
    })
</script>
</body>
</html>

 

posted @ 2020-12-01 15:07  Spongbob  阅读(360)  评论(0编辑  收藏  举报