123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047 |
- <style>
- .footer{
- width: 100%;
- height: 25px;
- text-align: center;
- margin-bottom: 0 !important;
- display: none;
- }
- .heading th {
- text-align: center;
- }
- .form td {
- text-align: center;
- }
- /* 日志 */
- .log_top {
- padding-left: 1vw;
- }
- .log_top span {
- margin: 0 0.5vw;
- }
- /* 1,1,1 */
- .log_commentary {
- color: rgb(0, 176, 80);
- }
- .log_company {
- color: rgb(255, 33, 0);
- }
- .log_content {
- width: fit-content;
- margin: 0.3vw 1.5vw 1vw 1.5vw;
- padding: 0.5vw 0vw;
- text-indent: 1.2em;
- line-height: 2.1vh;
- background-color: rgb(255, 255, 255);
- border-radius: 0.5vw;
- box-shadow: 0.19vw 0.16vw 0.4vw 0.03vw rgba(0, 0, 0, 0.13);
- }
- .log_content_color {
- /* background-color: rgb(250,250,250); */
- }
- .log_content_img img {
- /* width: 10%; */
- height: 150px;
- border-radius: 0.5vw;
- margin: 0.3vw 0;
- padding-right: 18px;
- padding-bottom: 7px;
- padding-left: 2px;
- }
- .log_item_top {
- height: 70%;
- overflow: scroll;
- }
- .log_item_top {
- height: 60vh;
- }
- .log_item_bottom {
- display: flex;
- /* height: 17vh; */
- /* border-top: 1px solid #eee; */
- margin: 0 1.5vw;
- /* background-color: rgb(250,250,250); */
- }
- .log_input input {
- width: 55vw;
- height: 10vh;
- border: #eee 1px solid;
- }
- .log_bottom_img {
- /* height: 5vh; */
- }
- .log_bottom_img img {
- height: 4vw;
- width: 6vw;
- border-radius: 0.5vw;
- margin: 0.5vw 0vw 0.5vw 0.3vw;
- }
- .log_bottom_left {
- width: 100%;
- margin-top: 1.5vh;
- }
- .log_bottom_right {
- width: 5%;
- }
- /* 上传图片 */
- .layui-upload-drag-self {
- background-color: #fbfdff;
- border: 1px dashed #c0ccda;
- border-radius: 6px;
- box-sizing: border-box;
- line-height: 4vw;
- vertical-align: top;
- display: inline-block;
- text-align: center;
- cursor: pointer;
- outline: 0;
- margin-right: 13px;
- float: left;
- }
- .layui-input-inlines-self {
- position: relative;
- margin-left: 90px;
- min-height: 36px;
- text-align: left;
- }
- .layui-upload-drag-self .layui-icon {
- font-size: 28px;
- color: #8c939d
- }
- .layui-upload-drag-self .img {
- position: relative;
- height: 148px;
- width: 148px;
- }
- .layui-upload-img {
- width: 148px;
- height: 148px;
- border-radius: 6px;
- margin-top: -3px;
- margin-left: -2px;
- }
- .handle {
- position: absolute;
- width: 148px;
- height: 100%;
- z-index: 100;
- border-radius: 6px;
- top: 0;
- background: rgba(59, 60, 61, 0.6);
- text-align: center;
- }
- .handle .icon-myself {
- z-index: 999;
- transition: all .3s;
- cursor: pointer;
- font-size: 25px;
- width: 25px;
- color: rgba(255, 255, 255, 0.91);
- margin: 0 4px;
- }
- .log_textarea {
- width: 89vw;
- height: 8vh;
- padding: 0.5vw;
- /* margin-right: 2vw; */
- margin: 1vw;
- }
- .log_button_img {
- width: 2vw;
- }
- .log_card {
- border: none !important;
- }
- /* 点击图片放大 */
- .content_img img {
- max-width: 100%;
- cursor: pointer;
- }
- .overlay {
- display: none;
- position: fixed;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- background-color: rgba(0, 0, 0, 0.7);
- justify-content: center;
- z-index: 1;
- }
- .overlay img {
- margin-top: 4%;
- max-width: 90%;
- max-height: 90%;
- object-fit: contain;
- }
- .p-4 {
- background-color: rgb(255, 255, 255);
- }
- /*表格*/
- #tabniubi {
- width: 100%;
- margin: 10px 0;
- background-color: #fff;
- color: #5f5f5f;
- }
- #tabniubi th {
- padding: 9px 15px;
- min-height: 20px;
- height: 40px;
- line-height: 40px;
- text-align: center;
- /* font-size: 14px; */
- border-width: 1px;
- border-style: solid;
- border-color: #e2e2e2;
- font: 14px Helvetica Neue, Helvetica, PingFang SC, Tahoma, Arial, sans-serif;
- }
- #tabniubi tr:first-child {
- padding: 0;
- min-height: 0;
- line-height: 0;
- border-width: 0;
- border-style: none;
- border-color: #fff;
- font-size: 0;
- }
- #tabniubi tr:first-child th {
- padding: 0;
- min-height: 0;
- line-height: 0;
- border-width: 0;
- border-style: none;
- border-color: #fff;
- font-size: 0;
- }
- .form-title {
- background-color: rgb(241, 241, 241);
- color: rgb(95, 95, 95);
- border-color: rgb(241, 241, 241);
- font-weight: 600;
- }
- .forleft {
- text-align: left !important;
- }
- /* .forright{
- text-align:right !important;
- } */
- .layui-form-select dl dd.layui-this {
- background-color: #f8f8f8;
- color: rgb(23, 145, 233);
- font-weight: 700;
- }
- .layui-input, .layui-textarea {
- /* padding-left: 3.75vw; */
- color: #5f5f5f;
- }
- .upimg {
- width: 250px;
- height: 250px;
- }
- .fujianimg img {
- height: 5.5vh;
- }
- .filelist{
- width: 100%;
- overflow: auto;
- justify-content:flex-start;
- align-content: space-between;
- flex-direction: column-reverse;
- flex-wrap: wrap;
- display: flex;
- }
- .filelist li{
- padding: 0.5vw 0.8vw 0.5vw 0.8vw;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- display: inline-block;
- border-right: 1px solid #e2e2e2;
- float: left;
- }
- .filelist p{
- margin: 3px 0 5px 0;
- width: 11vw;
- overflow: hidden;
- text-overflow: ellipsis;
- text-align: center;
- }
- #filesBox2 li{
- padding: 0.5vw 0.8vw 0.5vw 0.8vw;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- display: inline-block;
- border-right: 1px solid #e2e2e2;
- float: left;
- }
-
- #filesBox2 .layui-table-tool{
- display: none;
- }
-
- #filesBox2 .layui-table-view .layui-table{
- width: 100% !important;
- }
-
- #filesBox2 .layui-table-cell{
- display: flex;
- align-items: center;
- justify-content: center;
- }
-
- .laytable-cell-1-0-1, .laytable-cell-1-0-2{
- justify-content: flex-start !important;
- }
-
- .laytable-cell-1-0-0 span, .laytable-cell-1-0-1 span, .laytable-cell-1-0-2 span, .laytable-cell-1-0-3 span, .laytable-cell-1-0-4 span, th>.laytable-cell-1-0-5 span{
- display: flex;
- font: 14px red;
- font-weight: 600;
- color: #5f5f5f;
-
- }
- #tabniubi tr:first-child th{
- border-right: 1px solid #e2e2e2 !important;
- }
-
- #filesBox2 th:sixth-child{
- border-right: none !important;
- }
- </style>
- <form class="layui-form p-4" method="POST">
- <table id="tabniubi" cellpadding="1" cellspacing="1">
- <tr>
- <th style="width: 10%;height: 0;"></th>
- <th style="width: 10%;height: 0;"></th>
- <th style="width: 10%;height: 0;"></th>
- <th style="width: 10%;height: 0;"></th>
- <th style="width: 10%;height: 0;"></th>
- <th style="width: 10%;height: 0;"></th>
- <th style="width: 10%;height: 0;"></th>
- <th style="width: 10%;height: 0;"></th>
- <th style="width: 10%;height: 0;"></th>
- </tr>
- <tr border="1">
- {if $field.project_status == 1}
- <th class="form-title">项目状态</th>
- <th>
- {switch $detail.project_status}
- {case 1}立项中{/case}
- {case 2}审批中{/case}
- {case 3}待接收{/case}
- {case 4}待分配{/case}
- {case 5}作业中{/case}
- {case 6}归档中{/case}
- {case 7}退审中{/case}
- {case 8}已归档{/case}
- {case 9}已退审{/case}
- {default /}未知
- {/switch}
- </th>
- {/if}
- {if $field.project_name == 1}
- <th class="form-title">项目名称</th>
- <th colspan="3">{$detail.project_name}</th>
- {/if}
- {if $field.project_num == 1}
- <th class="form-title">项目编号</th>
- <th colspan="2">{$detail.project_num}</th>
- {/if}
- </tr>
- <tr>
- {if $field.project_time == 1}
- <th class="form-title">项目周期</th>
- <th colspan="8" style="text-align: left; padding-left: 3.5vw;">{$detail.project_start_time|date="Y-m-d"} 至
- {$detail.project_end_time|date="Y-m-d"}
- </th>
- {/if}
- </tr>
- <tr>
- {if $field.engineering_type == 1}
- <th class="form-title">项目类型</th>
- <th>
- <div>
- <select name="engineering_type1" lay-verify="required" lay-filter="aihao"
- {if $field_edit.engineering_type_edit != 1}
- disabled
- {/if}
- >
- <option value="1" {eq name="$detail.engineering_type1" value="1"} selected {/eq}>预算</option>
- <option value="2" {eq name="$detail.engineering_type1" value="2"} selected {/eq}>结算</option>
- <option value="3" {eq name="$detail.engineering_type1" value="3"} selected {/eq}>概算</option>
- <option value="4" {eq name="$detail.engineering_type1" value="4"} selected {/eq}>决算</option>
- <option value="5" {eq name="$detail.engineering_type1" value="5"} selected {/eq}>工程总承包(EPC)</option>
- </select>
- </div>
- </th>
- <th class="form-title">——</th>
- <th>
- <div>
- <select name="engineering_type2" lay-verify="required" lay-filter="aihao"
- {if $field_edit.engineering_type_edit != 1}
- disabled
- {/if}
- >
- <option value="1" {eq name="$detail.engineering_type2" value="1"} selected {/eq}>审核</option>
- <option value="2" {eq name="$detail.engineering_type2" value="2"} selected {/eq}>编制</option>
- </select>
- </div>
- </th>
- {/if}
- {if $field.engineering_category == 1}
- <th class="form-title">工程类别</th>
- <th>
- <div>
- <select name="engineering_category" lay-filter="engineering_category"
- {if $field_edit.engineering_category_edit != 1}
- disabled
- {/if}>
- <option value="">请选择工程类别</option>
- <option value="建筑物" {eq name="$detail.engineering_category" value="建筑物"} selected {/eq}>建筑物</option>
- <option value="交通" {eq name="$detail.engineering_category" value="交通"} selected {/eq}>交通</option>
- <option value="水利" {eq name="$detail.engineering_category" value="水利"} selected {/eq}>水利</option>
- <option value="土地整治" {eq name="$detail.engineering_category" value="土地整治"} selected {/eq}>土地整治</option>
- <option value="市政园林" {eq name="$detail.engineering_category" value="市政园林"} selected {/eq}>市政园林</option>
- <option value="信息网络" {eq name="$detail.engineering_category" value="信息网络"} selected {/eq}>信息网络</option>
- <option value="其他" {eq name="$detail.engineering_category" value="其他"} selected {/eq}>其他</option>
- </select>
- </div>
- </th>
- {/if}
- {if $field.project_region == 1}
- <th class="form-title">项目区域</th>
- <th colspan="2">
- <div>
- <div class="layui-form-item"
- style="margin-bottom: 0;display: flex;flex-direction: row;justify-content: space-between;">
- <div class="layui-input-inline" style="width: 6.5vw;">
- <select id="province" lay-filter="province" name="province"
- {if $field_edit.project_region_edit != 1}
- disabled
- {/if}
- ></select>
- </div>
- <div class="layui-input-inline area" style="width: 6.5vw;">
- <select id="city" lay-filter="city" name="city"
- {if $field_edit.project_region_edit != 1}
- disabled
- {/if}
- ></select>
- </div>
- <div class="layui-input-inline area" style="width: 6.5vw;">
- <select id="area" lay-filter="area" name="area"
- {if $field_edit.project_region_edit != 1}
- disabled
- {/if}
- ></select>
- </div>
- </div>
- </div>
- </th>
- {/if}
- </tr>
- <tr>
- {if $field.fiscal_nature == 1}
- <th class="form-title">资金性质</th>
- <th>
- <div>
- <select name="fiscal_nature" lay-filter="aihao"
- {if $field_edit.fiscal_nature_edit != 1}
- disabled
- {/if}
- >
- <option value="">请选择资金性质</option>
- <option value="财政资金" {eq name="$detail.fiscal_nature" value="财政资金"} selected {/eq}>财政资金</option>
- <option value="非财政资金" {eq name="$detail.fiscal_nature" value="非财政资金"} selected {/eq}>非财政资金</option>
- </select>
- </div>
- </th>
- {/if}
- {if $field.project_scale == 1}
- <th class="form-title">项目规模</th>
- <th colspan="3">
- <input type="text" name="project_scale" value="{$detail.project_scale}" autocomplete="off"
- placeholder="请输入项目规模"
- {if $field_edit.project_scale_edit != 1}
- readonly
- {/if}
- class="layui-input">
- </th>
- {/if}
- {if $field.charge_standard == 1}
- <th class="form-title">收费标准</th>
- <th colspan="2">
- <input type="text" name="charge_standard" value="{$detail.charge_standard}" autocomplete="off"
- placeholder="请输入收费标准"
- {if $field_edit.charge_standard_edit != 1}
- readonly
- {/if}
- class="layui-input">
- </th>
- {/if}
- </tr>
- {if $field.entrust_unit == 1 || $field.entrust_head == 1 || $field.sent_review_unit == 1 || $field.sent_review_head == 1
- || $field.review_unit == 1 || $field.review_head == 1 || $field.operate_name == 1 || $field.operate_team_names == 1}
- <tr>
- <th colspan="9" class="forleft">相关单位</th>
- </tr>
- <tr>
- {if $field.entrust_unit == 1}
- <th class="form-title">委托单位</th>
- <th>
- {$detail.entrust_unit_name}
- </th>
- {/if}
- {if $field.entrust_head == 1}
- <th class="form-title">负责人</th>
- <th>
- {$detail.entrust_maker_name}
- </th>
- {/if}
- {if $field.sent_review_unit == 1}
- <th class="form-title">送审单位</th>
- <th>
- {$detail.sent_review_unit_name}
- </th>
- {/if}
- {if $field.sent_review_head == 1}
- <th class="form-title">负责人</th>
- <th colspan="2">
- {$detail.sent_review_head_name}
- </th>
- {/if}
- </tr>
- <tr>
- {if $field.review_unit == 1}
- <th class="form-title">评审机构</th>
- <th>
- {$detail.review_unit_name}
- </th>
- {/if}
- {if $field.review_head == 1}
- <th class="form-title">项目负责人</th>
- <th>
- {$detail.review_head_name}
- </th>
- {/if}
- {if $field.operate_name == 1}
- <th class="form-title">作业负责人</th>
- <th>
- {$detail.operate_head_name}
- </th>
- {/if}
- {if $field.operate_team_names == 1}
- <th class="form-title">作业成员</th>
- <th colspan="2">
- {$detail.operate_team_names}
- </th>
- {/if}
- </tr>
- {/if}
- <tr>
- <th colspan="9" class="forleft">金额详情</th>
- </tr>
- <tr>
- {if $field.sent_review_amount == 1}
- <th class="form-title" colspan="1">送审金额(元)</th>
- <th colspan="2">
- <input type="text" id="sent_review_amount" name="sent_review_amount" onkeyup="Add()"
- value="{$detail.sent_review_amount}" autocomplete="off" placeholder="请输入送审金额"
- {if $field_edit.sent_review_amount_edit != 1}
- readonly
- {/if}
- class="layui-input">
- </th>
- {/if}
- {if $field.review_add_reduce_amount == 1}
- <th class="form-title" colspan="1">审增金额(元)</th>
- <th colspan="2">
- <input type="text" id="review_add_amount" name="review_add_amount" value="{$detail.review_add_amount}" onkeyup="Add()"
- autocomplete="off" placeholder="请输入审增额"
- {if $field_edit.authorize_amount_edit != 1}
- readonly
- {/if}
- class="layui-input">
- </th>
- {/if}
- {if $field.review_add_reduce_amount == 1}
- <th class="form-title" colspan="1">审减金额(元)</th>
- <th colspan="2">
- <input type="text" id="review_reduce_amount" name="review_reduce_amount" value="{$detail.review_reduce_amount}" onkeyup="Add()"
- autocomplete="off" placeholder="请输入审减额"
- {if $field_edit.authorize_amount_edit != 1}
- readonly
- {/if}
- class="layui-input">
- </th>
- {/if}
- </tr>
- <tr>
- {if $field.authorize_amount == 1}
- <th class="form-title" colspan="1">审定金额(元)</th>
- <th colspan="2" style="text-align: left;">
- <input type="text" id="authorize_amount" name="authorize_amount" value="{$detail.authorize_amount}" onkeyup="Add()"
- autocomplete="off" placeholder="请输入审定金额"
- {if $field_edit.authorize_amount_edit != 1}
- readonly
- {/if}
- class="layui-input">
- </th>
- {/if}
- {if $field.review_add_reduce_rate == 1}
- <th class="form-title" colspan="1">审增减率(%)</th>
- <th colspan="2">
- <span id="review_add_reduce_rate">{$detail.review_add_reduce_rate}</span>
- <input type="hidden" name="review_add_reduce_rate" value="{$detail.review_add_reduce_rate}" autocomplete="off" placeholder="请输入审增减率" class="layui-input">
- </th>
- {/if}
- {if $field.sent_review_cost == 1}
- <th class="form-title" colspan="1">送审服务费 (元)</th>
- <th colspan="2" style="text-align: left;">
- <input type="text" name="sent_review_cost" value="{$detail.sent_review_cost}" autocomplete="off" placeholder="请输入送审服务费"
- {if $field_edit.sent_review_cost_edit != 1}
- readonly
- {/if}
- class="layui-input">
- </th>
- {/if}
- </tr>
- <!-- <tr>
- <th class="form-title" colspan="1">报告时间</th>
- <th colspan="8" style="text-align: left;">{$detail.report_time}</th>
- </tr>-->
- <tr>
- <th colspan="9" class="forleft">相关附件
- <button type="button" class="layui-btn layui-btn-xs layui-btn-danger" lay-on="test-iframe-handle" style="float: right;">
- 上传附件
- <span id="ID-test-iframe-mark"></span>
- </button>
- </th>
- </tr>
- <tr>
- <th colspan="9" class="fujianimg" style="padding: 0px 0px;">
- <div id="filesBox2">
- <table class="layui-hide" id="get_file" lay-filter="get_file"></table>
- </div>
- </th>
- </tr>
- </table>
- <div class="py-3">
- <input type="hidden" name="id" value="{$detail.id}"/>
- <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="save">保存</button>
- </div>
- </form>
- <script>
- //审定金额=送审金额+审增金额+审减金额
- //(审定金额-送审金额)/送审金额*100%
- function Add(){
- var input1 = 0,input2 = 0,input3 = 0,input4 = 0;
- input1 = Number(document.getElementById("sent_review_amount").value).toFixed(2);
- input2 = Number(document.getElementById("authorize_amount").value).toFixed(2);
- // input3 = Number(document.getElementById("review_add_amount").value).toFixed(2);
- // input4 = Number(document.getElementById("review_reduce_amount").value).toFixed(2);
-
- if (input1!=="0.00" && input2!=="0.00") {
- var aa= (input2-input1).toFixed(2);
- var bb = aa/input1*100;
- bb = bb.toFixed(2);
- $('[name="review_add_reduce_rate"]').val(bb);
- $('#review_add_reduce_rate').html(bb)
- }else {
- $('[name="review_add_reduce_rate"]').val('0.00');
- $('#review_add_reduce_rate').html('0.00')
- }
- // 总审定金额-总送审金额
- }
- function first() {
- var form = layui.form, tool = layui.tool, oaTool = layui.oaTool;
- let table = layui.table;
- //附件表格
- var allcount;
- parent.layui.get_fileTable = table.render({
- elem: '#get_file',
- title: '文档列表',
- toolbar: '#toolbarget_file',
- cellMinWidth: 80,
- parseData: function (res) { // 数据解析回调函数
- // 在这里可以获取数据总数
- allcount = res.data.length;
- return {
- code: res.code, // 数据状态码
- msg: res.msg, // 状态信息
- count: res.count, // 数据总数
- data: res.data // 当前页数据
- };
- },
- // className: 'layui-table-testcss', // 用于给表格主容器追加 css 类名
- // lineStyle: 'height: 151px;', // 定义表格的多行样式
- url: "/admin/project.api/get_file",
- where: {'id': project_id},
- page: true, //开启分页
- limit: 20,
- cols: [[
- {field: 'id', title: '序号', width: 80, align: 'center',
- templet: function (d) {
- console.log(allcount,d.LAY_NUM)
- return allcount - (d.LAY_NUM - 1);
-
- }
- },
- {field: 'name', title: '附件名称', align: 'left',
- },
- {field: 'remark', title: '附件说明', align: 'left',
- },
- {field: 'admin_name', title: '上传人', align: 'center', width: 150},
- {field: 'create_time', title: '上传时间', align: 'center', width: 150,
- templet:"<div>{{layui.util.toDateString(d.create_time*1000, 'yyyy-MM-dd HH:mm:ss')}}</div>"},
- {field: 'right', fixed: 'right', title: '操作', width: 150, align: 'center',
- templet: function (d) {
- var html = '<div class="layui-btn-group">';
- var btn1 = `<a href="https://view.officeapps.live.com/op/view.aspx?src=${d.filepath}" target="_blank" class="layui-btn layui-btn-xs">预览</a>`;
- var btn2 = `<a class="layui-btn layui-btn-xs layui-bg-blue" href="${d.filepath}" download="${d.name}" lay-event="">下载</a>`;
- var btn3 = `<span data-id="${d.id}" class="layui-btn layui-btn-xs layui-btn-danger file-del ">删除</span>`;
- return html + btn1 + btn2 + btn3 +'</div>';
- }
- }
- ]]
- });
-
-
- //上传附件弹出窗
- layui.use(function(){
- var $ = layui.$;
- var layer = layui.layer;
- var upload = layui.upload;
- var util = layui.util;
-
- // 事件
- util.on('lay-on', {
- 'test-iframe-handle': function(){
- layer.open({
- type: 2,
- area: ['680px', '520px'],
- content: 'ceshi?id={$detail.id}',
- fixed: false, // 不固定
- maxmin: true,
- shadeClose: true,
- title: '上传附件',
- btnAlign: 'c',
- yes: function(index, layero){
- // 获取 iframe 的窗口对象
- var iframeWin = window[layero.find('iframe')[0]['name']];
- var elemMark = iframeWin.$('#mark'); // 获得 iframe 中某个输入框元素
- var value = elemMark.val();
-
-
-
- if($.trim(value) === '') return elemMark.focus();
- // 显示获得的值
- layer.msg('获得 iframe 中的输入框标记值:'+ value);
- }
- });
- },
- })
- });
-
-
- let adress;
- //日期选择
- layui.laydate.render({
- elem: '#date',
- range: ['#start_time', '#end_time'],
- rangeLinked: true
- });
- let c = 1;
- //监听提交
- form.on('submit(save)', function (data) {
- if(c){
- let callback = function (e) {
- c = 1
- layer.msg(e.msg);
- if (e.code == 0) {
- tool.sideClose(1000);
- }
- }
- var engineering_type1 ='';
- if(data.field.engineering_type1==1){
- engineering_type1 ='预算';
- }else if(data.field.engineering_type1==2){
- engineering_type1 ='结算';
- }else if(data.field.engineering_type1==3){
- engineering_type1 ='概算';
- }else if(data.field.engineering_type1==4){
- engineering_type1 ='决算';
- }else if(data.field.engineering_type1==5){
- engineering_type1 ='工程总承包(EPC)';
- }
-
- var engineering_type2 = '';
- if(data.field.engineering_type2==1){
- engineering_type2 ='审核';
- }else if(data.field.engineering_type2==2) {
- engineering_type2 = '编制';
- }
- if(engineering_type1!==""&&engineering_type2!==""){
- data.field.engineering_type = engineering_type1 + "-" + engineering_type2;
- }
- tool.post("/admin/project.cost_company/edit", data.field, callback);
- }
- c = 0
- return false;
- });
- oaTool.addFile({
- type: 1,
- isSave: true,
- ajaxSave: function (res) {
- let callback = function (e) {
- if(e.code == 202){
- layer.msg(e.msg);
- }else{
- layer.msg('上传成功!');
- }
- setTimeout(function () {
- $("#filesBox2").load(location.href+" #filesBox>*","type=2")
- }, 500)
- }
- // console.log(res,"{$detail.id}")
- tool.post("/admin/project.api/add_file_company", {
- 'topic_id': "{$detail.id}",
- 'file_id': res.data.id,
- 'file_name': res.data.name,
- 'module': 'project'
- }, callback);
- }
- });
- $('#filesBox2').on('click', '.file-del', function () {
- let id = $(this).parent().parent().data('id');
- layer.confirm('确定要删除该文件吗?请慎重', {icon: 3, title: '提示'}, function (index) {
- let callback = function (e) {
- $("#" + id + "").remove();
- layer.closeAll();
- layer.msg(e.msg);
- $('[lay-filter="webform"]').click();
- }
- tool.delete("/admin/project.api/delete_file_company", {id: id}, callback);
- });
- })
- layui.use(['form', 'jquery'], function () {
- var form = layui.form;
- const $ = layui.jquery;
- let adress;
- $.ajax({
- type: "get", //使用get方式
- url: "/static/assets/layui/adress.json", //json文件相对于这个HTML的路径
- dataType: "json",
- async: false,
- success: function (data) {
- //这个data就是json数据
- adress = data
- var province = Object.keys(adress)
- var proStrs = '<option value="">省</option>';
- for (var i = 0; i < province.length; i++) {
- proStrs += '<option value="' + province[i] + '">' + province[i] + '</option>';
- }
- $("#province").html(proStrs);
- layui.form.render("select")
- },
- error: function () {
- layer.alert("地址请求失败!! ");
- }
- });
- function getFirstAttr(obj) {
- for (var k in obj) return k;
- }
- function selectOption(selectedProvince, selectedCity = '', selectedArea = '') {
- var proStr = '<option value="">省</option>', cityStr = '<option value="">市</option>',
- areaStr = '<option value="">县</option>';
- var pro = adress[selectedProvince], ci = adress[selectedProvince][selectedCity];
- for (var province in adress) {
- if (province == selectedProvince) proStr += '<option value="' + province + '" selected>' + province + '</option>';
- else proStr += '<option value="' + province + '">' + province + '</option>';
- }
- $("#province").html(proStr);
- for (var city in pro) {
- if (city == selectedCity) cityStr += '<option value="' + city + '" selected>' + city + '</option>';
- else cityStr += '<option value="' + city + '">' + city + '</option>';
- }
- $("#city").html(cityStr);
- for (var area in ci) {
- if (area == "remove") {
- continue;
- }
- if (ci[area] == selectedArea) areaStr += '<option value="' + ci[area] + '" selected>' + ci[area] + '</option>';
- else areaStr += '<option value="' + ci[area] + '">' + ci[area] + '</option>';
- }
- $("#area").html(areaStr);
- form.render();
- }
- /*selectOption(1,2, 3);*/
- form.on('select(province)', function (data) {
- let thisProvince = data.value;
- let thisCity = getFirstAttr(adress[thisProvince]);
- selectOption(data.value);
- });
- form.on('select(city)', function (data) {
- selectOption($("#province").val(), data.value, getFirstAttr(data.value));
- });
- selectOption("{$detail.province}","{$detail.city}","{$detail.area}")
- })
- }
- </script>
- <script>
- // 获取具有指定 ID 的 <ul> 元素
- var ulElement = document.getElementById("filesBox");
- // 检查 <ul> 元素的子元素数量
- if (ulElement.children.length === 0) {
- // 如果子元素数量为 0,隐藏 <ul> 元素
- ulElement.style.display = "none";
- }
- </script>
|