作者 董瑞恩
1 个管道 的构建 通过 耗费 0 秒

cost

  1 +<include file="public@header"/>
  2 +<style type="text/css">
  3 + .pic-list li {
  4 + margin-bottom: 5px;
  5 + }
  6 +</style>
  7 +<script type="text/html" id="photos-item-tpl">
  8 + <li id="saved-image{id}">
  9 + <input id="photo-{id}" type="hidden" name="photo_urls[]" value="{filepath}">
  10 + <input class="form-control" id="photo-{id}-name" type="text" name="photo_names[]" value="{name}"
  11 + style="width: 200px;" title="图片名称">
  12 + <img id="photo-{id}-preview" src="{url}" style="height:36px;width: 36px;"
  13 + onclick="imagePreviewDialog(this.src);">
  14 + <a href="javascript:uploadOneImage('图片上传','#photo-{id}');">替换</a>
  15 + <a href="javascript:(function(){$('#saved-image{id}').remove();})();">移除</a>
  16 + </li>
  17 +</script>
  18 +<script type="text/html" id="files-item-tpl">
  19 + <li id="saved-file{id}">
  20 + <input id="file-{id}" type="hidden" name="file_urls[]" value="{filepath}">
  21 + <input class="form-control" id="file-{id}-name" type="text" name="file_names[]" value="{name}"
  22 + style="width: 200px;" title="文件名称">
  23 + <a id="file-{id}-preview" href="{preview_url}" target="_blank">下载</a>
  24 + <a href="javascript:uploadOne('图片上传','#file-{id}','file');">替换</a>
  25 + <a href="javascript:(function(){$('#saved-file{id}').remove();})();">移除</a>
  26 + </li>
  27 +</script>
  28 +</head>
  29 +<body>
  30 +<div class="wrap js-check-wrap">
  31 + <ul class="nav nav-tabs">
  32 + <li><a href="{:url('AdminTestInfo/index')}">检测报告</a></li>
  33 + <li class="active"><a href="{:url('AdminTestInfo/add')}">添加报告</a></li>
  34 + </ul>
  35 + <!--js-ajax-form margin-top-20-->
  36 + <form action="{:url('AdminTestInfo/addPost')}" method="post" class="form-horizontal js-ajax-form margin-top-20">
  37 + <div class="row">
  38 + <div class="col-md-3"></div>
  39 + <div class="col-md-6">
  40 + <table class="table table-bordered">
  41 + <tr>
  42 + <th width="80">检测编号<span class="form-required">*</span></th>
  43 + <td>
  44 + <input class="form-control" type="text" name="test_no"
  45 + id="test_no" required value="" placeholder="请输入检测编号"/>
  46 + </td>
  47 + <th width="80">油品名称<span class="form-required">*</span></th>
  48 + <td><input class="form-control" type="text" name="test_oil_name" id="test_oil_name" value=""
  49 + placeholder="请输入检测类型" required></td>
  50 + </tr>
  51 + <tr>
  52 + <th width="80">手机号1<span class="form-required">*</span></th>
  53 + <td>
  54 + <input class="form-control" type="text" name="test_phone1" id="test_phone1" value=""
  55 + placeholder="请输入手机号1" required>
  56 + </td>
  57 + <th width="80">手机号2</th>
  58 + <td>
  59 + <input class="form-control" type="text" name="test_phone2" id="test_phone2" value=""
  60 + placeholder="请输入手机号2">
  61 + </td>
  62 + </tr>
  63 + <tr>
  64 + <th width="80">所属公司<span class="form-required">*</span></th>
  65 + <td>
  66 + <input class="form-control" type="text" name="test_company" id="test_company"
  67 + placeholder="请填写所属公司" required>
  68 + </td>
  69 + <th width="80">送样人<span class="form-required">*</span></th>
  70 + <td>
  71 + <input class="form-control" name="test_people" id="test_people"
  72 + placeholder="请填写送样人" required>
  73 + </td>
  74 + </tr>
  75 + <tr>
  76 + <th width="80">设备标识</th>
  77 + <td>
  78 + <input class="form-control" type="text" name="test_facility_identify" id="test_facility_identify"
  79 + placeholder="请填写所属公司">
  80 + </td>
  81 + <th width="80">样品标识</th>
  82 + <td>
  83 + <input class="form-control" type="text" name="test_sample_identify" id="test_sample_identify"
  84 + placeholder="请填写所属城市">
  85 + </td>
  86 + </tr>
  87 + <!--<tr>-->
  88 + <!--<th width="80">检测状态<span class="form-required">*</span></th>-->
  89 + <!--<td>-->
  90 + <!--<input class="form-control" name=""-->
  91 + <!--placeholder="请填写摘要">-->
  92 + <!--</td>-->
  93 + <!--<th width="80">添加时间<span class="form-required">*</span></th>-->
  94 + <!--<td>-->
  95 + <!--<input class="form-control" name="post[post_excerpt]"-->
  96 + <!--placeholder="请填写摘要">-->
  97 + <!--</td>-->
  98 + <!--</tr>-->
  99 + <!--<tr>-->
  100 + <!--<th width="80">检测报告</th>-->
  101 + <!--<td colspan="3">-->
  102 + <!--<ul id="photos" class="pic-list list-unstyled form-inline"></ul>-->
  103 + <!--<a href="javascript:uploadMultiImage('图片上传','#photos','photos-item-tpl');"-->
  104 + <!--class="btn btn-default btn-sm">选择图片</a>-->
  105 + <!--</td>-->
  106 + <!--</tr>-->
  107 + </table>
  108 + <div class="form-group">
  109 + <div class="col-sm-offset-2 col-sm-10">
  110 + <!--js-ajax-submit-->
  111 + <button type="submit" class="btn btn-primary js-ajax-submit">{:lang('ADD')}</button>
  112 + <a class="btn btn-default" href="{:url('AdminTestInfo/index')}">{:lang('BACK')}</a>
  113 + </div>
  114 + </div>
  115 + </div>
  116 + </div>
  117 + </form>
  118 +</div>
  119 +<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
  120 +<script type="text/javascript">
  121 + //编辑器路径定义
  122 + var editorURL = GV.WEB_ROOT;
  123 +</script>
  124 +<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.config.js"></script>
  125 +<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.all.min.js"></script>
  126 +<script type="text/javascript">
  127 + $(function () {
  128 +
  129 + editorcontent = new baidu.editor.ui.Editor();
  130 + editorcontent.render('content');
  131 + try {
  132 + editorcontent.sync();
  133 + } catch (err) {
  134 + }
  135 +
  136 + $('.btn-cancel-thumbnail').click(function () {
  137 + $('#thumbnail-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
  138 + $('#thumbnail').val('');
  139 + });
  140 +
  141 + });
  142 +
  143 + function doSelectCategory() {
  144 + var selectedCategoriesId = $('#js-categories-id-input').val();
  145 + openIframeLayer("{:url('AdminCategory/select')}?ids=" + selectedCategoriesId, '请选择分类', {
  146 + area: ['700px', '400px'],
  147 + btn: ['确定', '取消'],
  148 + yes: function (index, layero) {
  149 + //do something
  150 +
  151 + var iframeWin = window[layero.find('iframe')[0]['name']];
  152 + var selectedCategories = iframeWin.confirm();
  153 + if (selectedCategories.selectedCategoriesId.length == 0) {
  154 + layer.msg('请选择分类');
  155 + return;
  156 + }
  157 + $('#js-categories-id-input').val(selectedCategories.selectedCategoriesId.join(','));
  158 + $('#js-categories-name-input').val(selectedCategories.selectedCategoriesName.join(' '));
  159 + //console.log(layer.getFrameIndex(index));
  160 + layer.close(index); //如果设定了yes回调,需进行手工关闭
  161 + }
  162 + });
  163 + }
  164 +</script>
  165 +</body>
  166 +</html>
@@ -109,7 +109,7 @@ @@ -109,7 +109,7 @@
109 109
110 function doAdd() { 110 function doAdd() {
111 openIframeLayer("{:url('AdminEquipment/add')}", '请选择分类', { 111 openIframeLayer("{:url('AdminEquipment/add')}", '请选择分类', {
112 - area: ['700px', '400px'], 112 + area: ['1000px', '800px'],
113 btn: ['确定', '取消'], 113 btn: ['确定', '取消'],
114 yes: function (index, layero) { 114 yes: function (index, layero) {
115 //do something 115 //do something