123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249 |
- {extend name="common/base"/}
- {block name="style"}
- <style>
- .footer{
- width: 100%;
- height: 25px;
- text-align: center;
- position: fixed;
- bottom: 0;
-
- }
- #imgdel {
- font-size: 30px;
- position: absolute;
- top: -30px;
- right: -12px;
- display: none;
- color: red;
- }
- </style>
- {/block}
- <!-- 主体 -->
- {block name="body"}
- <form class="layui-form p-4">
- <h3 class="pb-3">基础信息</h3>
- {if $unit_type==2}
- <table class="layui-table layui-table-form">
- <tr>
- <td class="layui-td-gray-2">公司名称</td>
- <td><input type="text" name="title" lay-verify="" lay-reqText="请完善名称" value="{$detail.title}" readonly
- autocomplete="off" placeholder="请输入名称" class="layui-input"></td>
- <td class="layui-td-gray-2">公司类型</td>
- <td><input type="text" name="company_type" lay-verify="" lay-reqText="请完善公司类型"
- value="{$detail.company_type}"
- autocomplete="off" placeholder="请输入公司类型" class="layui-input"></td>
- <td class="layui-td-gray-2">公司联系电话</td>
- <td>
- <input type="text" name="phone" value="{$detail.phone}" placeholder="请输入部门联系电话,可空"
- autocomplete="off" class="layui-input">
- </td>
- <td rowspan="3" class="layui-td-gray-2">公司logo</td>
- <td rowspan="3" valign="top" style="width: 160px;">
- <div class="layui-upload" style="width: 100px; margin:0 auto">
- <div class="layui-upload-list" id="demo1" style="width: 100%; height:100px;">
- <img src="{if empty($detail.thumb)}/static/home/images/upload.png{else}{$detail.thumb}{/if}"
- height="100" style="max-width: 100%; width: 100%;"/>
- <input type="hidden" name="thumb" value="">
- <i class="layui-icon layui-icon-clear" id="imgdel"></i>
- </div>
- <button type="button" class="layui-btn layui-btn-normal" style="width: 100%;" id="uploadBtn">
- 上传logo
- </button>
- </div>
- </td>
- </tr>
- <tr>
- <td class="layui-td-gray-2">公司联系座机</td>
- <td>
- <input type="text" name="landline" value="{$detail.landline}" placeholder="请输入公司联系座机,可空"
- autocomplete="off" class="layui-input">
- </td>
- <td class="layui-td-gray-2">公司联系邮箱</td>
- <td>
- <input type="text" name="email" value="{$detail.email}" placeholder="请输入公司联系邮箱,可空"
- autocomplete="off" class="layui-input">
- </td>
- <td class="layui-td-gray-4">公司地址</td>
- <td><input type="text" name="address" lay-verify="" lay-reqText="请完善公司地址" value="{$detail.address}"
- autocomplete="off" placeholder="请输入公司地址" 1 class="layui-input"></td>
- </tr>
- </table>
- <div class="pt-3">
- <input type="hidden" name="" value="0"/>
- <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
- </div>
- {elseif $unit_type==0 }
- <table class="layui-table layui-table-form">
- <tr>
- <td class="layui-td-gray-2">财政局名称</td>
- <td><input type="text" name="title" lay-verify="" lay-reqText="请完善名称" value="{$detail.title}" readonly
- autocomplete="off" placeholder="请输入名称" class="layui-input"></td>
- <td class="layui-td-gray-2">财政局联系电话</td>
- <td>
- <input type="text" name="phone" value="{$detail.phone}" placeholder="请输入部门联系电话,可空"
- autocomplete="off" class="layui-input">
- </td>
- <td class="layui-td-gray-2">财政局联系座机</td>
- <td>
- <input type="text" name="landline" value="{$detail.landline}" placeholder="请输入财政局联系座机,可空"
- autocomplete="off" class="layui-input">
- </td>
- <td rowspan="3" class="layui-td-gray-2">财政局logo</td>
- <td rowspan="3" valign="top" style="width: 160px;">
- <div class="layui-upload" style="width: 100px; margin:0 auto">
- <div class="layui-upload-list" id="demo1" style="width: 100%; height:100px;">
- <img src="{if empty($detail.thumb)}/static/home/images/upload.png{else}{$detail.thumb}{/if}"
- height="100" style="max-width: 100%; width: 100%;"/>
- <input type="hidden" name="thumb" value="">
- <i class="layui-icon layui-icon-clear" id="imgdel"></i>
- </div>
- <button type="button" class="layui-btn layui-btn-normal" style="width: 100%;" id="uploadBtn">
- 上传logo
- </button>
- </div>
- </td>
- </tr>
- <tr>
- <td class="layui-td-gray-2">财政局联系邮箱</td>
- <td>
- <input type="text" name="email" value="{$detail.email}" placeholder="请输入财政局联系邮箱,可空"
- autocomplete="off" class="layui-input">
- </td>
- <td class="layui-td-gray-4">财政局地址</td>
- <td><input type="text" name="address" lay-verify="" lay-reqText="请完善财政局地址" value="{$detail.address}"
- autocomplete="off" placeholder="请输入财政局地址" 1 class="layui-input"></td>
- </tr>
- </table>
- <div class="pt-3">
- <input type="hidden" name="" value="0"/>
- <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
- </div>
- {elseif $unit_type==1}
- <table class="layui-table layui-table-form">
- <tr>
- <td class="layui-td-gray-2">单位名称</td>
- <td><input type="text" name="title" lay-verify="" lay-reqText="请完善名称" value="{$detail.title}" readonly
- autocomplete="off" placeholder="请输入名称" class="layui-input"></td>
- <td class="layui-td-gray-2">单位联系电话</td>
- <td>
- <input type="text" name="phone" value="{$detail.phone}" placeholder="请输入单位联系电话,可空"
- autocomplete="off" class="layui-input">
- </td>
- <td class="layui-td-gray-2">单位联系座机</td>
- <td>
- <input type="text" name="landline" value="{$detail.landline}" placeholder="请输入单位联系座机,可空"
- autocomplete="off" class="layui-input">
- </td>
- <td rowspan="3" class="layui-td-gray-2">单位logo</td>
- <td rowspan="3" valign="top" style="width: 160px;">
- <div class="layui-upload" style="width: 100px; margin:0 auto">
- <div class="layui-upload-list" id="demo1" style="width: 100%; height:100px;">
- <img src="{if empty($detail.thumb)}/static/home/images/upload.png{else}{$detail.thumb}{/if}"
- height="100" style="max-width: 100%; width: 100%;"/>
- <input type="hidden" name="thumb" value="">
- <i class="layui-icon layui-icon-clear" id="imgdel"></i>
- </div>
- <button type="button" class="layui-btn layui-btn-normal" style="width: 100%;" id="uploadBtn">
- 上传logo
- </button>
- </div>
- </td>
- </tr>
- <tr>
- <td class="layui-td-gray-2">单位联系邮箱</td>
- <td>
- <input type="text" name="email" value="{$detail.email}" placeholder="请输入单位联系邮箱,可空"
- autocomplete="off" class="layui-input">
- </td>
- <td class="layui-td-gray-4">单位地址</td>
- <td><input type="text" name="address" lay-verify="" lay-reqText="请完善单位地址" value="{$detail.address}"
- autocomplete="off" placeholder="请输入单位地址" 1 class="layui-input"></td>
- </tr>
- </table>
- <div class="pt-3">
- <input type="hidden" name="" value="0"/>
- <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
- </div>
- {else}
- <div>无需设置</div>
- {/if}
- </form>
- {/block}
- <!-- /主体 -->
- <!-- 脚本 -->
- {block name="script"}
- <script>
- var moduleInit = ['tool', 'employeepicker'];
- function gouguInit() {
- var form = layui.form, tool = layui.tool, upload = layui.upload;
- var uploadInst = upload.render({
- elem: '#uploadBtn'
- , url: '/admin/api/upload'
- , done: function (e) {
- //如果上传失败
- if (e.code == 1) {
- return layer.msg('上传失败');
- }
- //上传成功
- $('#demo1 input').attr('value', e.data.filepath);
- $('#demo1 img').attr('src', e.data.filepath);
- $('#imgdel').show();
- }
- });
- $('#imgdel').click(() => {
- $('#demo1 input').attr('value', '');
- $('#demo1 img').attr('src', '/static/home/images/upload.png');
- $('#imgdel').hide();
- return false;
- })
- let a = 1;
- //监听提交
- form.on('submit(webform)', function (data) {
- console.log(data.field);
- delete data.field.file;
- let callback = function (e) {
- layer.msg(e.msg);
- if (e.code == 0) {
- setTimeout(function () {
- window.location.reload()
- a = 1
- }, 2000)
- }
- }
- tool.post('edit', data.field, callback)
- a = 0
- return false;
- });
- }
- </script>
- {/block}
- <!-- /脚本 -->
|