123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459 |
- {extend name='main'}
- {block name="button"}
- <button class="layui-btn" style="height: 30px;line-height:28px;background-color:#DC2219;color: #FFFFFF;border: 1px solid #C9C9C9 " type='button' onclick="window.history.back()">返 回</button>
- {/block}
- {block name="content"}
- <style>
- .layui-anim .layui-anim-fadein{
- display: none !important;
- }
- </style>
- <form onsubmit="return false;" id="GoodsForm" data-auto="true" method="post" class='layui-form layui-card' autocomplete="off">
- <div class="layui-card-body think-box-shadow padding-left-40">
- <div class="layui-form-item layui-row layui-col-space15">
- <label class="layui-col-xs3 relative">
- <span class="color-green">项目名称</span>
- <input name="project_name" required class="layui-input" placeholder="请输入项目名称" value="{$vo.project_name|default=''}">
- </label>
- <label class="layui-col-xs3 relative">
- <span class="color-green">造价类别</span>
- <select name="cost_categories" required class="province-selector layui-select" id="cost_categories" lay-verify="required" lay-search >
- <option value="">请选择</option>
- {if isset($vo.id) && $vo.id neq ''}
- {foreach ['投标价'=>'投标价','合同价'=>'合同价','结算价'=>'结算价','重计量'=>'重计量','清单控制价'=>'清单控制价','估算'=>'估算','概算'=>'概算','其他'=>'其他','目标成本'=>'目标成本'] as $k=>$v}
- {if $v eq $vo.cost_categories}
- <option selected value="{$k}">{$v}</option>
- {else}
- <option value="{$k}">{$v}</option>
- {/if}
- {/foreach}
- {else}
- {foreach ['投标价'=>'投标价','合同价'=>'合同价','结算价'=>'结算价','重计量'=>'重计量','清单控制价'=>'清单控制价','估算'=>'估算','概算'=>'概算','其他'=>'其他','目标成本'=>'目标成本'] as $k=>$v}
- <option value="{$k}">{$v}</option>
- {/foreach}
- {/if}
- </select>
- </label>
- <label class="layui-col-xs3 relative">
- <span class="color-green">编制日期</span>
- <input required type="text" class="layui-input" name="prepare_date" value="{$vo.prepare_date|default=''}" id="test1" placeholder="yyyy-MM-dd">
- </label>
- <label class="layui-col-xs3 relative">
- <span class="color-green">模板类型</span>
- <select name='template' class='layui-select' required lay-verify="required" lay-search>
- <option value=''>请选择</option>
- {if isset($vo.id)}
- <!--{foreach $template as $menu}-->
- <!--{eq name='menu.id' value='$vo.template'}-->
- <option selected value='{$menu.id}'>{$menu.title}</option>
- <!--{else}-->
- <option value='{$menu.id}'>{$menu.title}</option>
- <!--{/eq}-->
- <!--{/foreach}-->
- {else}
- <!--{foreach $template as $menu}-->
- <option value='{$menu.id}'>{$menu.title}</option>
- <!--{/foreach}-->
- {/if}
- </select>
- </label>
- </div>
- <div class="layui-form-item layui-row layui-col-space15">
- <label class="layui-col-xs3 relative">
- <span class="color-green">清单编制依据</span>
- <input name="basis_for_listing" class="layui-input" placeholder="请输入清单编制依据" value="{$vo.basis_for_listing|default=''}">
- </label>
- <label class="layui-col-xs3 relative">
- <span class="color-green">工程范围</span>
- <input name="project_scope" class="layui-input" placeholder="请输入工程范围" value="{$vo.project_scope|default=''}">
- </label>
- </div>
- <h3 style="margin-bottom: 15px">项目业态</h3>
- <div class="layui-form-item layui-row layui-col-space15">
- <label class="layui-col-xs3 relative">
- <span class="color-green">建筑分类</span>
- <select name='category_id' class='layui-select' required lay-verify="required" lay-search>
- <option value=''>请选择</option>
- {if isset($vo.id)}
- <!--{foreach $menus as $menu}-->
- <!--{eq name='menu.id' value='$vo.category_id'}-->
- <option selected value='{$menu.id}'>{$menu.spl|raw}{$menu.title}</option>
- <!--{else}-->
- <option value='{$menu.id}'>{$menu.spl|raw}{$menu.title}</option>
- <!--{/eq}-->
- <!--{/foreach}-->
- {else}
- <!--{foreach $menus as $menu}-->
- <option value='{$menu.id}'>{$menu.spl|raw}{$menu.title}</option>
- <!--{/foreach}-->
- {/if}
- </select>
- </label>
- <label class="layui-col-xs3 relative">
- <span class="color-green">工程类别</span>
- <select required name="engineering_category" class="province-selector" id="engineering_category" lay-verify="required" lay-search >
- <option value="">请选择</option>
- {if isset($vo.id) && $vo.id neq ''}
- {foreach ['新建工程'=>'新建工程','改扩建加固工程'=>'改扩建加固工程','其他'=>'其他'] as $k=>$v}
- {if $v eq $vo.engineering_category}
- <option selected value="{$k}">{$v}</option>
- {else}
- <option value="{$k}">{$v}</option>
- {/if}
- {/foreach}
- {else}
- {foreach ['新建工程'=>'新建工程','改扩建加固工程'=>'改扩建加固工程','其他'=>'其他'] as $k=>$v}
- <option value="{$k}">{$v}</option>
- {/foreach}
- {/if}
- </select>
- </label>
- <label class="layui-col-xs3 relative">
- <span class="color-green" required>建设地点</span>
- <div class="layui-form-item layui-row layui-col-space12">
- <label class="layui-col-xs4 relative">
- <select name="construction_site_province" class="province-selector" id="province" lay-filter="province" lay-verify="required" lay-search >
- <option value="">请选择省</option>
- {if isset($vo.id) && $vo.id neq ''}
- {foreach $province as $k=>$v}
- {if $v.name eq $vo.construction_site_province}
- <option selected value="{$v.name}">{$v.name}</option>
- {else}
- <option value="{$v.name}">{$v.name}</option>
- {/if}
- {/foreach}
- {else}
- {foreach $province as $k=>$v}
- <option value="{$v.name}">{$v.name}</option>
- {/foreach}
- {/if}
- </select>
- </label>
- <label class="layui-col-xs4 relative">
- <select name="construction_site_city" class="city-selector" data-value="" id="city" lay-filter="city" lay-verify="required" lay-search>
- <option value="">请选择市</option>
- {if isset($vo.id) && $vo.id neq ''}
- {foreach $city as $k=>$v}
- {if $v.name eq $vo.construction_site_city}
- <option selected value="{$v.name}">{$v.name}</option>
- {else}
- <option value="{$v.name}">{$v.name}</option>
- {/if}
- {/foreach}
- {/if}
- </select>
- </label>
- <label class="layui-col-xs4 relative">
- <select name="construction_site_area" class="county-selector" data-value="" id="area" lay-filter="area" lay-search>
- <option value="">请选择区</option>
- {if isset($vo.id) && $vo.id neq ''}
- {foreach $area as $k=>$v}
- {if $v.name eq $vo.construction_site_area}
- <option selected value="{$v.name}">{$v.name}</option>
- {else}
- <option value="{$v.name}">{$v.name}</option>
- {/if}
- {/foreach}
- {/if}
- </select>
- </label>
- </div>
- </label>
- <label class="layui-col-xs3 relative">
- <span class="color-green">标准(档次)</span>
- <input name="grade" class="layui-input" placeholder="请输入标准(档次)" value="{$vo.grade|default=''}">
- </label>
- </div>
- <h3 style="margin-bottom: 15px">项目总体特征</h3>
- <div class="layui-form-item layui-row layui-col-space15">
- <label class="layui-col-xs3 relative">
- <span class="color-green">建筑类别及组成</span>
- <input name="building_composition" class="layui-input" placeholder="请输入建筑类别及组成" value="{$vo.building_composition|default=''}">
- </label>
- <label class="layui-col-xs3 relative">
- <span class="color-green">总用地面积</span>
- <input name="total_land_area" class="layui-input" placeholder="请输入总用地面积" value="{$vo.total_land_area|default=''}">
- </label>
- <label class="layui-col-xs3 relative">
- <span class="color-green">总建筑面积</span>
- <input name="gross_floor_area" required class="layui-input" lay-verify="number" placeholder="请输入总建筑面积" value="{$vo.gross_floor_area|default=''}">
- </label>
- </div>
- <div class="layui-form-item layui-row layui-col-space15">
- <label class="layui-col-xs3 relative">
- <span class="color-green">地上面积</span>
- <input name="floor_area" required class="layui-input" lay-verify="number" placeholder="请输入地上面积" value="{$vo.floor_area|default=''}">
- </label>
- <label class="layui-col-xs3 relative">
- <span class="color-green">地下面积</span>
- <input name="underground_area" required class="layui-input" lay-verify="number" placeholder="请输入地下面积" value="{$vo.underground_area|default=''}">
- </label>
- <label class="layui-col-xs3 relative">
- <span class="color-green">建筑密度</span>
- <input name="building_density" class="layui-input" placeholder="请输入建筑密度" value="{$vo.building_density|default=''}">
- </label>
- <label class="layui-col-xs3 relative">
- <span class="color-green">绿化面积</span>
- <input name="green_area" class="layui-input" placeholder="请输入绿化面积" value="{$vo.green_area|default=''}">
- </label>
- </div>
- <div class="layui-form-item layui-row layui-col-space15">
- <label class="layui-col-xs3 relative">
- <span class="color-green">道路面积</span>
- <input name="road_area" class="layui-input" placeholder="请输入道路面积" value="{$vo.road_area|default=''}">
- </label>
- <label class="layui-col-xs3 relative">
- <span class="color-green">道路长度</span>
- <input name="road_length" class="layui-input" placeholder="请输入道路长度" value="{$vo.road_length|default=''}">
- </label>
- <label class="layui-col-xs3 relative">
- <span class="color-green">建筑分期或分期建设情况描述密度</span>
- <input name="case_description" class="layui-input" placeholder="请输入分期或分期建设情况描述" value="{$vo.case_description|default=''}">
- </label>
- <label class="layui-col-xs3 relative">
- <span class="color-green">功能参数</span>
- <input name="function_parameters" class="layui-input" placeholder="请输入功能参数" value="{$vo.function_parameters|default=''}">
- </label>
- </div>
- <div class="layui-form-item layui-row layui-col-space15">
- <label class="layui-col-xs3 relative">
- <span class="color-green">人防面积</span>
- <input name="defense" class="layui-input" placeholder="请输入人防面积" value="{$vo.defense|default=''}">
- </label>
- <label class="layui-col-xs3 relative">
- <span class="color-green">人防类型</span>
- <input name="defense_type" class="layui-input" placeholder="请输入人防类型" value="{$vo.defense_type|default=''}">
- </label>
- </div>
- <h3 style="margin-bottom: 15px">投融资模式</h3>
- <div class="layui-form-item layui-row layui-col-space15">
- <label class="layui-col-xs3 relative">
- <span class="color-green">投资主体</span>
- <input name="investment_subject" class="layui-input" placeholder="请输入投资主体" value="{$vo.investment_subject|default=''}">
- </label>
- <label class="layui-col-xs3 relative">
- <span class="color-green">资金来源</span>
- <input name="sources_funding" class="layui-input" placeholder="请输入资金来源" value="{$vo.sources_funding|default=''}">
- </label>
- <label class="layui-col-xs3 relative">
- <span class="color-green">承发包模式</span>
- <input name="contract_mode" class="layui-input" placeholder="请输入承发包模式" value="{$vo.contract_mode|default=''}">
- </label>
- <label class="layui-col-xs3 relative">
- <span class="color-green">组织管理模式</span>
- <input name="management_mode" class="layui-input" placeholder="请输入组织管理模式" value="{$vo.management_mode|default=''}">
- </label>
- </div>
- <h3 style="margin-bottom: 15px">项目主要参与单位</h3>
- <div class="layui-form-item layui-row layui-col-space15">
- <label class="layui-col-xs3 relative">
- <span class="color-green">业主</span>
- <input name="owner" class="layui-input" placeholder="请输入业主" value="{$vo.owner|default=''}">
- </label>
- <label class="layui-col-xs3 relative">
- <span class="color-green">总包</span>
- <input name="total_package" class="layui-input" placeholder="请输入总包" value="{$vo.total_package|default=''}">
- </label>
- </div>
- <h3 style="margin-bottom: 15px">日期</h3>
- <div class="layui-form-item layui-row layui-col-space15">
- <label class="layui-col-xs3 relative">
- <span class="color-green">开工时间</span>
- <input name="starting_time" readonly required class="layui-input" id="test2" placeholder="yyyy-MM-dd" value="{$vo.starting_time|default=''}">
- </label>
- <label class="layui-col-xs3 relative">
- <span class="color-green">竣工时间</span>
- <input name="ending_time" readonly required class="layui-input" id="test3" placeholder="yyyy-MM-dd" value="{$vo.ending_time|default=''}">
- </label>
- <label class="layui-col-xs3 relative">
- <span class="color-green">工期(单位:天)</span>
- <input name="project_time" readonly class="layui-input" id="project_time" placeholder="自动计算" value="{$vo.project_time|default=''}">
- </label>
- </div>
- <div class="layui-form-item layui-row layui-col-space15">
- <label class="layui-col-xs6 relative">
- <span class="color-green">获奖情况</span>
- <textarea placeholder="请输入" name="awards" class="layui-textarea">{$vo.awards|default=''}</textarea>
- </label>
- <label class="layui-col-xs6 relative">
- <span class="color-green">其他说明</span>
- <textarea placeholder="请输入" name="other_instructions" class="layui-textarea">{$vo.other_instructions|default=''}</textarea>
- </label>
- </div>
- <div class="layui-form-item text-center">
- {if isset($vo.id) && $vo.id neq ''}<input type='hidden' value="<?php echo date('Y-m-d H:i:s'); ?>" name='update_at'>{else}<input type='hidden' value="<?php echo date('Y-m-d H:i:s'); ?>" name='create_at'>{/if}
- {notempty name='vo.id'}<input type="hidden" name="id" value="{$vo.id}">{/notempty}
- <button class="layui-btn layui-btn-danger" ng-click="hsitoryBack()" onclick="window.history.back()" type="button">取消</button>
- <button class="layui-btn" type="submit" lay-submit >确定</button>
- </div>
- </div>
- </form>
- {/block}
- {block name='script'}
- <script>
- window.form.render();
- layui.config({
- base: 'static/modules/'
- }).extend({
- numinput: 'numinput/numinput'
- });
- layui.use(['form', 'layedit', 'laydate','numinput'], function(){
- var form = layui.form
- ,layer = layui.layer
- ,layedit = layui.layedit
- ,laydate = layui.laydate,
- numinp = layui.numinput;
- // numinp.init({
- // // 123:123键置顶, 789:789键置顶
- // topBtns: 789,
- // // 右侧功能按钮开关
- // rightBtns: false,
- // // 功能按钮提示开关
- // showTips: true,
- // // 是否监听键盘事件
- // listening: true,
- // // 批量配置默认小数精确度,默认 -1 不处理精确度,0 表示禁止输入小数
- // defaultPrec: -1,
- // // 初始化回调,无参
- // initEnd: $.noop,
- // // 触发显示回调,参数为当前输入框和数字键盘的 jQuery 对象
- // showEnd: $.noop,
- // // 隐藏键盘回调,参数为当前输入框的 jQuery 对象
- // hideEnd: $.noop,
- // // 自定义 z-index
- // zIndex: 19999999
- // });
- //常规用法
- laydate.render({
- elem: '#test1'
- });
- laydate.render({
- elem: '#test2',
- done:function (value,date) {
- var endtime = $("#test3").val()
- if (endtime!=''){
- changeday(value,endtime)
- }
- }
- });
- laydate.render({
- elem: '#test3',
- done:function (value,date) {
- var starttime = $("#test2").val()
- if (starttime!=''){
- changeday(starttime,value)
- }
- }
- });
- form.on('select(province)', function (data) {
- var val = data.value;
- console.log(val)
- $.ajax({
- type:"get",
- url:"{:url('MainProject/get_city')}", //数据传输的控制器方法
- data: {id:val},//这里data传递过去的是序列化以后的字符串
- success:function(data){
- //console.log(data)
- var arr = data.data;
- //console.log(arr)
- if (arr.length>0){
- //$("#tow").attr("style","display:block;");//显示div
- var options='<option value="">请选择市</option>';
- for (var i = 0; i < arr.length; i++) {
- var tag = arr[i];
- options+=' <option value="'+tag.name+'">'+tag.name+'</option>';
- }
- $("select[name='construction_site_city']").html(options)
- form.render('select');
- }else {
- var options='<option value="">请选择市</option>';
- $("select[name='construction_site_city']").html(options)
- form.render('select');
- }
- }
- });
- });
- form.on('select(city)', function (data) {
- var val = data.value;
- // console.log(val)
- $.ajax({
- type:"get",
- url:"{:url('MainProject/get_area')}", //数据传输的控制器方法
- data: {id:val},//这里data传递过去的是序列化以后的字符串
- success:function(data){
- //console.log(data)
- var arr = data.data;
- // console.log(arr)
- if (arr.length>0){
- var options='<option value="">请选择区</option>';
- for (var i = 0; i < arr.length; i++) {
- var tag = arr[i];
- options+=' <option value="'+tag.name+'">'+tag.name+'</option>';
- }
- $("select[name='construction_site_area']").html(options)
- form.render('select');
- }else {
- var options='<option value="">请选择区</option>';
- $("select[name='construction_site_area']").html(options)
- form.render('select');
- }
- }
- });
- });
- });
- function changeday(startdate,enddate) {
- var day = 0;
- if (startdate==enddate){
- day = 1;
- }else if (startdate>enddate){
- day = 0;
- }else {
- day = getDaysBetween(startdate,enddate) + 1
- }
- $("#project_time").attr("value",day);
- }
- //计算两个日期相差的天数
- function getDaysBetween(dateString1,dateString2){
- var startDate = Date.parse(dateString1);
- var endDate = Date.parse(dateString2);
- if (startDate>endDate){
- return 0;
- }
- if (startDate==endDate){
- return 1;
- }
- var days=(endDate - startDate)/(1*24*60*60*1000);
- return days;
- }
- </script>
- {/block}
|