123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400 |
- {extend name='main'}
- {block name="button"}
- {if auth("add")}
- <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>
- {/if}
- {/block}
- {block name="content"}
- <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>
- <select name='main_project_id' class='layui-select' required lay-verify="required" lay-search>
- <option value=''>请选择</option>
- {if isset($vo.id)}
- <!--{foreach $main_list as $menu}-->
- <!--{eq name='menu.id' value='$vo.main_project_id'}-->
- <option selected value='{$menu.id}'>{$menu.project_name}</option>
- <!--{else}-->
- <option value='{$menu.id}'>{$menu.project_name}</option>
- <!--{/eq}-->
- <!--{/foreach}-->
- {else}
- <!--{foreach $main_list as $menu}-->
- <option value='{$menu.id}'>{$menu.project_name}</option>
- <!--{/foreach}-->
- {/if}
- </select>
- </label>
- <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='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>
- <input name="building_height" required class="layui-input" placeholder="请输入建筑高度" value="{$vo.building_height|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="construction_layer" required class="layui-input" placeholder="请输入建筑层数" value="{$vo.construction_layer|default=''}">
- </label>
- <label class="layui-col-xs3 relative">
- <span class="color-green">地上层数</span>
- <input name="upper_number" required class="layui-input" placeholder="请输入地上层数" value="{$vo.upper_number|default=''}">
- </label>
- <label class="layui-col-xs3 relative">
- <span class="color-green">地下层数</span>
- <input name="underground" class="layui-input" placeholder="请输入地下层数" value="{$vo.underground|default=''}">
- </label>
- <label class="layui-col-xs3 relative">
- <span class="color-green">地下层高</span>
- <input name="underground_layer" class="layui-input" placeholder="请输入地下层高" value="{$vo.underground_layer|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="first_layer_high" class="layui-input" placeholder="请输入首层层高" value="{$vo.first_layer_high|default=''}">
- </label>
- <label class="layui-col-xs3 relative">
- <span class="color-green">标准层层高</span>
- <input name="standard_height" class="layui-input" placeholder="请输入标准层层高" value="{$vo.standard_height|default=''}">
- </label>
- <label class="layui-col-xs3 relative">
- <span class="color-green">结构类型</span>
- <select name="structure_type" required class="province-selector layui-select" id="structure_type" lay-verify="required" lay-search >
- <option value="">请选择</option>
- {if isset($vo.id) && $vo.id neq ''}
- {foreach ['框架结构'=>'框架结构','剪力墙结构'=>'剪力墙结构','框架剪力墙结构'=>'框架剪力墙结构','断肢剪力墙结构'=>'断肢剪力墙结构','砖混结构'=>'砖混结构','钢结构'=>'钢结构','装配式混泥土结构'=>'装配式混泥土结构','框架简体结构'=>'框架简体结构'] as $k=>$v}
- {if $v eq $vo.structure_type}
- <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>
- <select name="building_fortification_intensity" required class="province-selector layui-select" id="building_fortification_intensity" lay-verify="required" lay-search >
- <option value="">请选择</option>
- {if isset($vo.id) && $vo.id neq ''}
- {foreach ['6度'=>'6度','7度'=>'7度','8度'=>'8度','9度'=>'9度'] as $k=>$v}
- {if $v eq $vo.building_fortification_intensity}
- <option selected value="{$k}">{$v}</option>
- {else}
- <option value="{$k}">{$v}</option>
- {/if}
- {/foreach}
- {else}
- {foreach ['6度'=>'6度','7度'=>'7度','8度'=>'8度','9度'=>'9度'] as $k=>$v}
- <option value="{$k}">{$v}</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>
- <select name="seismic_grade" required class="province-selector layui-select" id="seismic_grade" lay-verify="required" lay-search >
- <option value="">请选择</option>
- {if isset($vo.id) && $vo.id neq ''}
- {foreach ['一级'=>'一级','二级'=>'二级','三级'=>'三级','四级'=>'四级'] as $k=>$v}
- {if $v eq $vo.seismic_grade}
- <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 name="design_life" class="layui-input" placeholder="请输入设计寿命" value="{$vo.design_life|default=''}">
- </label>
- <label class="layui-col-xs3 relative">
- <span class="color-green">基础类型</span>
- <select name="base_type" required class="province-selector layui-select" id="base_type" lay-verify="required" lay-search >
- <option value="">请选择</option>
- {if isset($vo.id) && $vo.id neq ''}
- {foreach ['不包含'=>'不包含','独立基础'=>'独立基础','条形基础'=>'条形基础','满堂基础'=>'满堂基础','桩基础'=>'桩基础','桩承台基础'=>'桩承台基础','混合基础'=>'混合基础','带形基础'=>'带形基础','筏板基础'=>'筏板基础','砖基础'=>'砖基础'] as $k=>$v}
- {if $v eq $vo.base_type}
- <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 name="decorate_standard" class="layui-input" placeholder="请输入装修标准" value="{$vo.decorate_standard|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="other_parameters" class="layui-input" placeholder="请输入其他参数" value="{$vo.other_parameters|default=''}">
- </label>
- <label class="layui-col-xs3 relative">
- <span class="color-green">建筑面积</span>
- <input name="construction_area" required class="layui-input" placeholder="请输入建筑面积" value="{$vo.construction_area|default=''}">
- </label>
- <label class="layui-col-xs3 relative">
- <span class="color-green">地上建筑面积</span>
- <input name="ground_floor_area" required class="layui-input" placeholder="请输入地上建筑面积" value="{$vo.ground_floor_area|default=''}">
- </label>
- <label class="layui-col-xs3 relative">
- <span class="color-green">地下建筑面积</span>
- <input name="underground_floor_area" required class="layui-input" placeholder="请输入地下建筑面积" value="{$vo.underground_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="building_floor_area" class="layui-input" placeholder="请输入建筑占地面积" value="{$vo.building_floor_area|default=''}">
- </label>
- <label class="layui-col-xs3 relative">
- <span class="color-green">钢结构受益面积</span>
- <input name="steel_benefit_area" class="layui-input" placeholder="请输入钢结构受益面积" value="{$vo.steel_benefit_area|default=''}">
- </label>
- <label class="layui-col-xs3 relative">
- <span class="color-green">木质构件面积</span>
- <input name="wood_area" class="layui-input" placeholder="请输入木质构件面积" value="{$vo.wood_area|default=''}">
- </label>
- <label class="layui-col-xs3 relative">
- <span class="color-green">可售面积</span>
- <input name="available_area" class="layui-input" placeholder="请输入可售面积" value="{$vo.available_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="number" class="layui-input" placeholder="请输入户数" value="{$vo.number|default=''}">
- </label>
- <label class="layui-col-xs3 relative">
- <span class="color-green">地下室底面积</span>
- <input name="basement_floor_area" class="layui-input" placeholder="请输入地下室底面积" value="{$vo.basement_floor_area|default=''}">
- </label>
- <label class="layui-col-xs3 relative">
- <span class="color-green">其他说明</span>
- <input name="other_instructions" class="layui-input" placeholder="请输入其他说明" value="{$vo.other_instructions|default=''}">
- </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 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.use(['form', 'layedit', 'laydate'], function(){
- var form = layui.form
- ,layer = layui.layer
- ,layedit = layui.layedit
- ,laydate = layui.laydate;
- //常规用法
- 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}
|