重写上传文件的模板展示,及js方法,图片、PDF文件支持在线查看功能,其他文件下载查看,系统整体提升了文件更能的操作体验。

修复了客户模块的日志展示错误bug,发票到账模块支持上传附件功能,可以上传到账凭据等资料。
This commit is contained in:
hdm 2023-04-17 23:11:29 +08:00
parent 4282950058
commit 338038c8b4
80 changed files with 905 additions and 1205 deletions

View File

@ -76,7 +76,7 @@
</td>
<td colspan="5" style="line-height:inherit">
<div class="layui-row" id="fileBox">
<input type="hidden" id="fileBoxInput" name="file_ids" value="">
<input type="hidden" data-type="file" name="file_ids" value="">
</div>
</td>
</tr>

View File

@ -76,19 +76,10 @@
</td>
<td colspan="5" style="line-height:inherit">
<div class="layui-row" id="fileBox">
<input type="hidden" id="fileBoxInput" name="file_ids" value="{$article.file_ids}">
<input type="hidden" data-type="file" name="file_ids" value="{$article.file_ids}">
{notempty name="$article.file_ids"}
{volist name="$article.fileArray" id="vo"}
<div class="layui-col-md4" id="fileItem{$vo.id}">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title">{$vo.name}</div>
<div class="file-tool">
<a href="{$vo.filepath}" download="{$vo.name}" target="_blank" title="下载查看"><i class="iconfont icon-shujudaoru blue"></i></a>
<i class="btn-delete iconfont icon-shanchu red" data-id="{$vo.id}" title="删除"></i>
</div>
</div>
</div>
<div class="layui-col-md4" id="uploadImg{$vo.id}">{:file_card($vo)}</div>
{/volist}
{/notempty}
</div>

View File

@ -46,15 +46,7 @@
<h3 class="py-3">相关附件</h3>
<div class="layui-row" id="fileBox">
{volist name="$detail.fileArray" id="vo"}
<div class="layui-col-md4" id="fileItem{$vo.id}">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title file-title-view">{$vo.name}</div>
<div class="file-tool">
<a href="{$vo.filepath}" download="{$vo.name}" target="_blank" title="下载查看"><i class="iconfont icon-shujudaoru blue"></i></a>
</div>
</div>
</div>
<div class="layui-col-md4" id="uploadImg{$vo.id}">{:file_card($vo,'view')}</div>
{/volist}
</div>
{/notempty}
@ -88,7 +80,7 @@
{block name="script"}
<script src="{__GOUGU__}/third_party/prism/prism.js"></script>
<script>
const moduleInit = ['tool','tinymce'];
const moduleInit = ['tool','tinymce','oaTool'];
function gouguInit() {
var form = layui.form,tool=layui.tool;

View File

@ -427,6 +427,57 @@ function hidetel($phone)
}
}
/**
* @Method: 文件格式大小
* @param[type] $file_size [文件大小]
*/
function to_size($file_size){
$file_size = $file_size-1;
if ($file_size >= 1099511627776){
$show_filesize = number_format(($file_size / 1099511627776),2) . " TB";
}
elseif ($file_size >= 1073741824) {
$show_filesize = number_format(($file_size / 1073741824),2) . " GB";
}
elseif ($file_size >= 1048576) {
$show_filesize = number_format(($file_size / 1048576),2) . " MB";
}
elseif ($file_size >= 1024) {
$show_filesize = number_format(($file_size / 1024),2) . " KB";
}
elseif ($file_size > 0) {
$show_filesize = $file_size . " b";
}
elseif ($file_size == 0 || $file_size == -1) {
$show_filesize = "0 b";
}
return $show_filesize;
}
//格式化附件展示
function file_card($file,$view=''){
$image=['jpg','jpeg','png','gif'];
$type_icon = 'icon-sucaiziyuan';
$view_btn = '<a class="blue" href="'.$file['filepath'].'" download="'.$file['name'].'" target="_blank" title="下载查看"><i class="iconfont icon-tuiguangshezhi"></i></a>';
if($file['fileext'] == 'pdf'){
$type_icon = 'icon-lunwenguanli';
$view_btn = '<span class="file-view-pdf blue" data-href="'.$file['filepath'].'" title="在线查看"><i class="iconfont icon-yuejuan"></i></span>';
}
if(in_array($file['fileext'], $image)){
$type_icon = 'icon-sucaiguanli';
$view_btn = '<span class="file-view-img blue" data-href="'.$file['filepath'].'" title="在线查看"><i class="iconfont icon-tupianguanli"></i></span>';
}
$item = '<div class="file-card file-'.$view.'" id="fileItem'.$file['id'].'">
<i class="file-icon iconfont '.$type_icon.'"></i>
<div class="file-info">
<div class="file-title" title="'.$file['name'].'">'.$file['name'].'</div>
<div class="file-ops">'.to_size($file['filesize']).''.date('Y-m-d H:i',$file['create_time']).'</div>
</div>
<div class="file-tool">'.$view_btn.'<span class="btn-delete red" data-id="'.$file['id'].'" data-uid="'.$file['admin_id'].'" title="删除"><i class="iconfont icon-shanchu"></i></span></div>
</div>';
return $item;
}
//读取报销类型
function get_expense_cate()
{
@ -483,6 +534,17 @@ function get_work_cate()
return $work;
}
//读取所属地区
function get_region_name($id){
$region = Db::name('city')->where(['id'=>$id])->find();
if(empty($region)){
return '';
}
else{
return $region['name'];
}
}
/**
* 根据附件表的id返回url地址
* @param [type] $id [description]
@ -777,7 +839,7 @@ function send_email($to, $subject = '', $content = '')
* $prefix前缀
*/
function get_codeno($prefix=1){
$no = $prefix . date('ymdHis') . rand(10,99);
$no = $prefix . date('YmdHis') . rand(10,99);
return $no;
}
/**

View File

@ -268,7 +268,7 @@ class Index extends BaseController
}
$file_array_other = Db::name('ContractFile')
->field('cf.id,f.filepath,f.name,f.filesize,f.fileext')
->field('cf.id,f.filepath,f.name,f.filesize,f.fileext,f.create_time,f.admin_id')
->alias('cf')
->join('File f', 'f.id = cf.file_id', 'LEFT')
->order('cf.create_time asc')

View File

@ -61,6 +61,7 @@
},{
field: 'name',
title: '合同名称',
minWidth:240,
templet: '<div><a data-href="/contract/index/view/id/{{d.id}}.html" class="side-a">{{d.name}}</a></div>'
}, {
field: 'cate_title',

View File

@ -140,19 +140,10 @@
</td>
<td colspan="5" style="line-height:inherit">
<div class="layui-row" id="fileBox">
<input type="hidden" id="fileBoxInput" name="file_ids" value="{$detail.file_ids}">
<input type="hidden" data-type="file" name="file_ids" value="{$detail.file_ids}">
{notempty name="$detail.file_ids"}
{volist name="$detail.fileArray" id="vo"}
<div class="layui-col-md4" id="fileItem{$vo.id}">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title">{$vo.name}</div>
<div class="file-tool">
<a href="{$vo.filepath}" download="{$vo.name}" target="_blank" title="下载查看"><i class="iconfont icon-shujudaoru blue"></i></a>
<i class="btn-delete iconfont icon-shanchu red" data-id="{$vo.id}" title="删除"></i>
</div>
</div>
</div>
<div class="layui-col-md4" id="uploadImg{$vo.id}">{:file_card($vo)}</div>
{/volist}
{/notempty}
</div>

View File

@ -81,6 +81,7 @@
},{
field: 'name',
title: '合同名称',
minWidth:240,
templet: '<div><a data-href="/contract/index/view/id/{{d.id}}.html" class="side-a">{{d.name}}</a></div>'
}, {
field: 'cate_title',

View File

@ -146,15 +146,7 @@ html{background-color:#fff;}
<td colspan="7" style="line-height:inherit">
<div class="layui-row">
{volist name="$detail.fileArray" id="vo"}
<div class="layui-col-md4">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title file-title-view">{$vo.name}</div>
<div class="file-tool">
<a href="{$vo.filepath}" download="{$vo.name}" target="_blank" title="下载查看"><i class="iconfont icon-shujudaoru blue"></i></a>
</div>
</div>
</div>
<div class="layui-col-md4" id="uploadImg{$vo.id}">{:file_card($vo,'view')}</div>
{/volist}
</div>
</td>
@ -169,18 +161,8 @@ html{background-color:#fff;}
</td>
<td colspan="7" style="line-height:inherit">
<div id="fileBox">
<input type="hidden" id="fileBoxInput" name="file_ids" value="">
{volist name="$detail.file_array_other" id="vo"}
<div class="layui-col-md4" id="fileItem{$vo.id}">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title">{$vo.name}</div>
<div class="file-tool">
<a href="{$vo.filepath}" download="{$vo.name}" title="下载查看" target="_blank"><i class="iconfont icon-shujudaoru blue"></i></a>
<i class="ajax-delete iconfont icon-shanchu red" data-id="{$vo.id}" title="删除"></i>
</div>
</div>
</div>
<div class="layui-col-md4" id="fileItem{$vo.id}">{:file_card($vo)}</div>
{/volist}
</div>
</td>
@ -321,7 +303,7 @@ const contract_id = '{$detail.id}';
const contract_status = '{$detail.check_status}';
const moduleInit = ['tool','employeepicker','oaTool'];
function gouguInit() {
var form = layui.form,tool=layui.tool, upload = layui.upload,element = layui.element,employeepicker = layui.employeepicker,oaTool = layui.oaTool;
var form = layui.form,tool=layui.tool, element = layui.element,employeepicker = layui.employeepicker,oaTool = layui.oaTool;
element.on('tab(contract)', function(data){
let index = data.index;
if(index == 1){

View File

@ -146,15 +146,7 @@ html{background-color:#fff;}
<td colspan="7" style="line-height:inherit">
<div class="layui-row">
{volist name="$detail.fileArray" id="vo"}
<div class="layui-col-md4">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title file-title-view">{$vo.name}</div>
<div class="file-tool">
<a href="{$vo.filepath}" download="{$vo.name}" target="_blank" title="下载查看"><i class="iconfont icon-shujudaoru blue"></i></a>
</div>
</div>
</div>
<div class="layui-col-md4" id="uploadImg{$vo.id}">{:file_card($vo,'view')}</div>
{/volist}
</div>
</td>
@ -259,9 +251,9 @@ html{background-color:#fff;}
<script>
const contract_id = '{$detail.id}';
const contract_status = '{$detail.check_status}';
const moduleInit = ['tool','employeepicker'];
const moduleInit = ['tool','employeepicker','oaTool'];
function gouguInit() {
var form = layui.form,tool=layui.tool, upload = layui.upload,element = layui.element,employeepicker = layui.employeepicker,dropdown = layui.dropdown;
var form = layui.form,tool=layui.tool, oaTool = layui.oaTool,element = layui.element,employeepicker = layui.employeepicker,dropdown = layui.dropdown;
element.on('tab(contract)', function(data){
let index = data.index;
if(index == 1){

View File

@ -64,7 +64,7 @@ class Customer extends Model
$detail = Db::name('Customer')->where(['id' => $id])->find();
if (!empty($detail)) {
$file_array = Db::name('CustomerFile')
->field('cf.id,f.filepath,f.name,f.filesize,f.fileext')
->field('cf.id,f.filepath,f.name,f.filesize,f.fileext,f.create_time,f.admin_id')
->alias('cf')
->join('File f', 'f.id = cf.file_id', 'LEFT')
->order('cf.create_time asc')

View File

@ -14,7 +14,7 @@ use think\Model;
class CustomerLog extends Model
{
public static $Sourse = [
'status' => ['未设置', '新进客户', '跟进客户', '正式客户', '流失客户'],
'status' => ['未设置', '新进客户', '跟进客户', '正式客户', '流失客户','已成交客户'],
'intent_status' => ['未设置', '意向不明', '意向模糊', '意向一般', '意向强烈','已成交'],
'type' => ['其他','电话','微信','QQ','上门'],
'stage' => ['未设置','立项评估','初期沟通','需求分析','方案制定','商务谈判','合同签订','失单'],

View File

@ -102,6 +102,7 @@
},{
field: 'name',
title: '客户名称',
minWidth:240,
templet: '<div><a data-href="/customer/index/view/id/{{d.id}}.html" class="side-a">{{d.name}}</a></div>'
},{
field: 'intent_status_name',

View File

@ -68,6 +68,7 @@
},{
field: 'name',
title: '客户名称',
minWidth:240,
templet: '<div><a data-href="/customer/index/view/id/{{d.id}}.html" class="side-a">{{d.name}}</a></div>'
},{
field: 'user',

View File

@ -53,6 +53,7 @@
},{
field: 'name',
title: '客户名称',
minWidth:240,
templet: '<div><a data-href="/customer/index/view/id/{{d.id}}.html" class="side-a">{{d.name}}</a></div>'
},{
field: 'user',

View File

@ -95,21 +95,12 @@ html{background-color:#fff;}
<tr>
<td class="layui-td-gray">
<div class="layui-input-inline">相关附件</div>
{eq name="$detail.status" value="1" }<div class="layui-input-inline"><button type="button" class="layui-btn layui-btn-xs" id="upFile"><i class="layui-icon"></i></button></div>{/eq}
{eq name="$detail.status" value="1" }<div class="layui-input-inline"><button type="button" class="layui-btn layui-btn-xs" id="uploadBtn"><i class="layui-icon"></i></button></div>{/eq}
</td>
<td colspan="7" style="line-height:inherit">
<div id="fileList">
<div id="fileBox">
{volist name="$detail.file_array" id="vo"}
<div class="layui-col-md4" id="file_{$vo.id}">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title">{$vo.name}</div>
<div class="file-tool">
<a href="{$vo.filepath}" download="{$vo.name}" title="下载查看" target="_blank"><i class="iconfont icon-shujudaoru blue"></i></a>
<i class="btn-delete iconfont icon-shanchu red" data-id="{$vo.id}" title="删除"></i>
</div>
</div>
</div>
<div class="layui-col-md4" id="file_{$vo.id}">{:file_card($vo)}</div>
{/volist}
</div>
</td>
@ -184,9 +175,9 @@ html{background-color:#fff;}
<script>
const customer_id = '{$detail.id}';
const customer_status = '{$detail.status}';
const moduleInit = ['tool','employeepicker'];
const moduleInit = ['tool','employeepicker','oaTool'];
function gouguInit() {
var form = layui.form,tool=layui.tool, upload = layui.upload,element = layui.element,employeepicker = layui.employeepicker;
var form = layui.form,tool=layui.tool, upload = layui.upload,element = layui.element,oaTool = layui.oaTool;
trace();
element.on('tab(customer)', function(data){
@ -202,54 +193,39 @@ const moduleInit = ['tool','employeepicker'];
}
});
//删除附件
$('#fileList').on('click', '.btn-delete', function () {
var _id = $(this).data('id');
layer.confirm('确定要删除该附件吗?', {
icon: 3,
title: '提示'
}, function(index) {
oaTool.addFile({
isSave:true,
type:1,
ajaxSave:function(res){
$.ajax({
url: "/customer/api/add_file",
type:'post',
data:{
'customer_id':customer_id,
'file_id':res.data.id,
'file_name':res.data.name
},
success: function (e) {
layer.msg(e.msg);
if (e.code == 0) {
setTimeout(function(){
location.reload();
},1000)
}
}
})
},
ajaxDelete:function(file_id){
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
$('#file_' + _id).remove();
$('#file_' + file_id).remove();
}
}
tool.delete("/customer/api/delete_file", {id: _id}, callback);
layer.close(index);
});
})
//多附件上传
upload.render({
elem: '#upFile'
,url: "/api/index/upload"
,multiple: true
,accept: 'file' //普通文件
,exts: 'png|jpg|gif|jpeg|doc|docx|ppt|pptx|xls|xlsx|pdf|txt|zip|rar|7z' //只允许上传文件格式
,done: function(res){
if (res.code == 0) {
let callback = function (e) {
layer.msg(e.msg);
let temp = `<div class="layui-col-md4" id="file_${e.data}">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title">${res.data.name}</div>
<div class="file-tool">
<a href="${res.data.filepath}" download="${res.data.name}" title="下载查看" target="_blank"><i class="iconfont icon-shujudaoru blue"></i></a>
<i class="btn-delete iconfont icon-shanchu red" data-id="${e.data}" title="删除"></i>
</div>
</div>
</div>`;
$('#fileList').append(temp);
}
tool.post("/customer/api/add_file", {'customer_id':customer_id,'file_id':res.data.id,'file_name':res.data.name}, callback);
}
else{
layer.msg(res.msg);
}
tool.delete("/customer/api/delete_file", {id: file_id}, callback);
}
});
})
}
</script>

View File

@ -186,6 +186,15 @@ class Income extends BaseController
->where(['i.inid'=>$id,'i.status'=>1])
->order('i.enter_time desc')
->select();
if($detail['file_ids'] !=''){
$fileArray = Db::name('File')->where('id','in',$detail['file_ids'])->select();
$detail['fileArray'] = $fileArray;
}
if($detail['other_file_ids'] !=''){
$fileArrayOther = Db::name('File')->where('id','in',$detail['other_file_ids'])->select();
$detail['fileArrayOther'] = $fileArrayOther;
}
View::assign('uid', $this->uid);
View::assign('detail', $detail);
return view();

View File

@ -44,7 +44,7 @@
<tr>
<td class="layui-td-gray">关联的项目</td>
<td colspan="5">
<input type="text" class="layui-input project-picker" name="ptname" placeholder="请选择需要关联的项目" readonly value="">
<input type="text" class="layui-input picker-project" name="ptname" placeholder="请选择需要关联的项目" readonly value="">
<input type="hidden" class="layui-input" name="ptid" value="0">
</td>
</tr>
@ -79,9 +79,9 @@
</tr>
<tr>
<td class="layui-td-gray"><div class="layui-input-inline">附件</div> <div class="layui-input-inline"><button type="button" class="layui-btn layui-btn-xs" id="upFile"><i class="layui-icon"></i></button></div></td>
<td colspan="5">
<td colspan="5" style="line-height:inherit">
<div class="layui-row" id="fileList">
<input type="hidden" name="file_ids" value="">
<input type="hidden" data-type="file" name="file_ids" value="">
</div>
</td>
</tr>
@ -134,7 +134,7 @@
<tr>
<td class="layui-td-gray">关联的项目</td>
<td colspan="5">
<input type="text" class="layui-input project-picker" name="ptname" placeholder="请选择需要关联的项目" readonly value="{$expense.ptname}">
<input type="text" class="layui-input picker-project" name="ptname" placeholder="请选择需要关联的项目" readonly value="{$expense.ptname}">
<input type="hidden" class="layui-input" name="ptid" value="{$expense.ptid}">
</td>
</tr>
@ -171,21 +171,12 @@
</tr>
<tr>
<td class="layui-td-gray"><div class="layui-input-inline">附件</div> <div class="layui-input-inline"><button type="button" class="layui-btn layui-btn-xs" id="upFile"><i class="layui-icon"></i></button></div></td>
<td colspan="5">
<td colspan="5" style="line-height:inherit">
<div class="layui-row" id="fileList">
<input type="hidden" name="file_ids" value="{$expense.file_ids}">
<input type="hidden" name="file_ids" data-type="file" value="{$expense.file_ids}">
{notempty name="$expense.file_ids"}
{volist name="$expense.fileArray" id="vo"}
<div class="layui-col-md4" id="uploadImg{$vo.id}">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title">{$vo.name}</div>
<div class="file-tool">
<a href="{$vo.filepath}" download="{$vo.name}" target="_blank" title="下载查看"><i class="iconfont icon-shujudaoru blue"></i></a>
<i class="btn-delete iconfont icon-shanchu red" data-id="{$vo.id}" title="删除"></i>
</div>
</div>
</div>
<div class="layui-col-md4" id="uploadImg{$vo.id}">{:file_card($vo)}</div>
{/volist}
{/notempty}
</div>
@ -236,28 +227,14 @@
<!-- 脚本 -->
{block name="script"}
<script>
// 查找指定的元素在数组中的位置
Array.prototype.indexOf = function (val) {
for (var i = 0; i < this.length; i++) {
if (this[i] == val) {
return i;
}
}
return -1;
};
// 通过索引删除数组元素
Array.prototype.remove = function (val) {
var index = this.indexOf(val);
if (index > -1) {
this.splice(index, 1);
}
};
const moduleInit = ['tool','employeepicker'];
<script>
const moduleInit = ['tool','employeepicker','oaTool'];
function gouguInit() {
var form = layui.form,upload = layui.upload,tool=layui.tool,table=layui.table,employeepicker = layui.employeepicker,laydate = layui.laydate;
var form = layui.form,upload = layui.upload,tool=layui.tool,table=layui.table,oaTool = layui.oaTool,laydate = layui.laydate;
oaTool.addFile({
btn: 'upFile',
box: 'fileList'
});
laydate.render({
elem: '#income_month',
type:'month',
@ -314,60 +291,7 @@ const moduleInit = ['tool','employeepicker'];
that.parents(".more_interfix").remove();
}
});
//选择关联项目
$('.project-picker').on('click', function () {
selectProject();
});
var projectTable;
function selectProject() {
layer.open({
title: '选择项目',
area: ['600px', '580px'],
type: 1,
content: '<div class="picker-table">\
<form class="layui-form pb-2">\
<div class="layui-input-inline" style="width:480px;">\
<input type="text" name="keywords" placeholder="项目名称" class="layui-input" autocomplete="off" />\
</div>\
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="search_form">提交搜索</button>\
</form>\
<div id="projectTable"></div></div>',
success: function () {
projectTable = table.render({
elem: '#projectTable'
, url: '/project/api/get_project'
, page: true //开启分页
, limit: 10
, cols: [[
{ type: 'radio', title: '选择' }
, { field: 'id', width: 100, title: '编号', align: 'center' }
, { field: 'title', title: '项目名称' }
]]
});
//项目搜索提交
form.on('submit(search_form)', function (data) {
projectTable.reload({ where: { keywords: data.field.keywords }, page: { curr: 1 } });
return false;
});
},
btn: ['确定'],
yes: function () {
var checkStatus = table.checkStatus(projectTable.config.id);
var data = checkStatus.data;
if (data.length > 0) {
$('[name="ptname"]').val(data[0].title);
$('[name="ptid"]').val(data[0].id);
layer.closeAll();
}
else {
layer.msg('请先选择项目');
return false;
}
}
})
}
//监听提交
form.on('submit(webform)', function(data){
var interfix = $('.more_interfix');
@ -468,48 +392,6 @@ const moduleInit = ['tool','employeepicker'];
}
})
});
$('#fileList').on('click', '.btn-delete', function () {
var _id = $(this).data('id');
var idsStr = $('#fileList input').val(),idsArray = [];
if (idsStr != '') {
idsArray = idsStr.split(",");
}
idsArray.remove(_id);
$('#fileList input').attr('value', idsArray.join(','));
$('#uploadImg' + _id).remove();
})
//多附件上传
upload.render({
elem: '#upFile'
,url: "/api/index/upload"
,multiple: true
,accept: 'file' //普通文件
,exts: 'png|jpg|gif|jpeg|doc|docx|ppt|pptx|xls|xlsx|pdf|zip|rar|7z' //只允许上传文件格式
,done: function(res){
layer.msg(res.msg);
if (res.code == 0) {
//上传成功
var idsStr = $('#fileList input').val(),idsArray = [];
if (idsStr != '') {
idsArray = idsStr.split(",");
}
idsArray.push(res.data.id);
$('#fileList input').attr('value', idsArray.join(','));
let temp = `<div class="layui-col-md4" id="uploadImg${res.data.id}">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title">${res.data.name}</div>
<div class="file-tool">
<a href="${res.data.filepath}" download="${res.data.name}" title="下载查看" target="_blank"><i class="iconfont icon-shujudaoru blue"></i></a>
<i class="btn-delete iconfont icon-shanchu red" data-id="${res.data.id}" title="删除"></i>
</div>
</div>
</div>`;
$('#fileList').append(temp);
}
}
});
}
</script>
{/block}

View File

@ -91,22 +91,20 @@
<tr>
<td class="layui-td-gray">费用金额</td>
<td colspan="5">
<div>
<table class="layui-table layui-table-min">
<tr>
<th width="100">报销金额(元)</th>
<th width="150">报销类别</th>
<th>备注信息</th>
</tr>
{volist name="$detail.list" id="vo"}
<tr>
<td>{$vo.amount}</td>
<td>{$vo.cate_title}</td>
<td style="text-align:left">{$vo.remarks}</td>
</tr>
{/volist}
</table>
</div>
<table class="layui-table layui-table-min" style="margin:0">
<tr>
<th width="100">报销金额(元)</th>
<th width="150">报销类别</th>
<th>备注信息</th>
</tr>
{volist name="$detail.list" id="vo"}
<tr>
<td>{$vo.amount}</td>
<td>{$vo.cate_title}</td>
<td style="text-align:left">{$vo.remarks}</td>
</tr>
{/volist}
</table>
</td>
</tr>
{notempty name="$detail.file_ids"}
@ -115,15 +113,7 @@
<td colspan="5" style="line-height:inherit">
<div class="layui-row">
{volist name="$detail.fileArray" id="vo"}
<div class="layui-col-md4">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title file-title-view">{$vo.name}</div>
<div class="file-tool">
<a href="{$vo.filepath}" download="{$vo.name}" target="_blank" title="下载查看"><i class="iconfont icon-shujudaoru blue"></i></a>
</div>
</div>
</div>
<div class="layui-col-md4" id="uploadImg{$vo.id}">{:file_card($vo,'view')}</div>
{/volist}
</div>
</td>
@ -143,7 +133,7 @@
<table class="layui-table layui-table-form mt-4">
<tr>
<td class="layui-td-gray">审核状态</td>
<td class="layui-td-gray-2">审核状态</td>
<td>{eq name="$detail.check_status" value="0"}<span class="black">待审批</span>{/eq}
{eq name="$detail.check_status" value="1"}<span class="blue">审批中</span>{/eq}
{eq name="$detail.check_status" value="2"}<span class="green">已通过,待打款</span>{/eq}
@ -232,7 +222,7 @@
<!-- 脚本 -->
{block name="script"}
<script>
const moduleInit = ['tool','employeepicker'];
const moduleInit = ['tool','employeepicker','oaTool'];
function gouguInit() {
var form = layui.form,tool=layui.tool, employeepicker = layui.employeepicker,dropdown = layui.dropdown;

View File

@ -130,6 +130,36 @@
<td>{$detail.code}</td>
</tr>
{/if}
{notempty name="$detail.file_ids"}
<tr>
<td class="layui-td-gray">关联附件</td>
<td colspan="5" style="line-height:inherit">
<div class="layui-row">
{volist name="$detail.fileArray" id="vo"}
<div class="layui-col-md4" id="uploadImg{$vo.id}">{:file_card($vo,'view')}</div>
{/volist}
</div>
</td>
</tr>
{/notempty}
<tr>
<td class="layui-td-gray">
<div class="layui-input-inline">其他附件</div>
<div class="layui-input-inline">
<button type="button" class="layui-btn layui-btn-xs" id="uploadBtn"><i class="layui-icon"></i></button>
</div>
</td>
<td colspan="5" style="line-height:inherit">
<div class="layui-row" id="fileBox">
<input type="hidden" data-type="file" name="other_file_ids" value="{$detail.other_file_ids}">
{notempty name="$detail.other_file_ids"}
{volist name="$detail.fileArrayOther" id="vo"}
<div class="layui-col-md4" id="uploadImg{$vo.id}">{:file_card($vo)}</div>
{/volist}
{/notempty}
</div>
</td>
</tr>
</table>
<h3 class="py-3">到账信息</h3>
@ -154,7 +184,7 @@
<tr>
<td class="layui-td-gray">到账记录</td>
<td colspan="5">
<table id="interfix" class="layui-table layui-table-min">
<table id="interfix" class="layui-table layui-table-min" style="margin:0">
<tr>
<th style="width:200px;">到账日期</th>
<th style="width:200px;">到帐金额(元)</th>
@ -208,10 +238,39 @@
<!-- 脚本 -->
{block name="script"}
<script>
const moduleInit = ['tool'];
function gouguInit() {
var form = layui.form,tool=layui.tool,laydate = layui.laydate;
const moduleInit = ['tool','oaTool'];
function gouguInit() {
var form = layui.form,tool=layui.tool,laydate = layui.laydate,oaTool = layui.oaTool;
oaTool.addFile({
isSave:true,
uidDelete:true,
ajaxSave:function(val){
$.ajax({
url: "/finance/api/open",
type:'post',
data:{
id:$('[name="id"]').val(),
other_file_ids:val
},
success: function (e) {
//location.reload();
}
})
},
ajaxDelete:function(val){
$.ajax({
url: "/finance/api/open",
type:'post',
data:{
id:$('[name="id"]').val(),
//other_file_ids:val
},
success: function (e) {
location.reload();
}
})
}
})
//添加表格行
$('#addInterfix').on('click',function(){
var html = '';

View File

@ -95,6 +95,7 @@
width: 136
}, {
field: 'invoice_title',
minWidth: 240,
title: '发票抬头',
templet:function(d){
var html='';
@ -115,7 +116,7 @@
field: 'invoice_type',
title: '开票类型',
align: 'center',
width: 90,
width: 120,
templet:function(d){
var html='-';
if(d.invoice_type==1){

View File

@ -91,24 +91,34 @@
{/if}
{notempty name="$detail.file_ids"}
<tr>
<td class="layui-td-gray">关附件</td>
<td class="layui-td-gray">附件</td>
<td colspan="5" style="line-height:inherit">
<div class="layui-row">
{volist name="$detail.fileArray" id="vo"}
<div class="layui-col-md4">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title">{$vo.name}</div>
<div class="file-tool">
<a href="{$vo.filepath}" download="{$vo.name}" target="_blank" title="下载查看"><i class="iconfont icon-shujudaoru blue"></i></a>
</div>
</div>
</div>
<div class="layui-col-md4" id="uploadImg{$vo.id}">{:file_card($vo,'view')}</div>
{/volist}
</div>
</td>
</tr>
{/notempty}
<tr>
<td class="layui-td-gray">
<div class="layui-input-inline">其他附件</div>
<div class="layui-input-inline">
<button type="button" class="layui-btn layui-btn-xs" id="uploadBtn"><i class="layui-icon"></i></button>
</div>
</td>
<td colspan="5" style="line-height:inherit">
<div class="layui-row" id="fileBox">
<input type="hidden" data-type="file" name="other_file_ids" value="{$detail.other_file_ids}">
{notempty name="$detail.other_file_ids"}
{volist name="$detail.fileArrayOther" id="vo"}
<div class="layui-col-md4" id="uploadImg{$vo.id}">{:file_card($vo)}</div>
{/volist}
{/notempty}
</div>
</td>
</tr>
</table>
<h3 class="py-3">到账信息</h3>
@ -133,7 +143,7 @@
<tr>
<td class="layui-td-gray">到账记录</td>
<td colspan="5">
<table class="layui-table layui-table-min">
<table class="layui-table layui-table-min" style="margin:0">
<tr>
<th style="width:150px;">到账日期</th>
<th style="width:150px;">到帐金额(元)</th>
@ -167,5 +177,43 @@
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}{/block}
{block name="script"}
<script>
const moduleInit = ['tool','oaTool'];
function gouguInit() {
var form = layui.form,tool=layui.tool, oaTool = layui.oaTool;
oaTool.addFile({
isSave:true,
uidDelete:true,
ajaxSave:function(val){
$.ajax({
url: "/finance/api/open",
type:'post',
data:{
id:$('[name="id"]').val(),
other_file_ids:val
},
success: function (e) {
location.reload();
}
})
},
ajaxDelete:function(val){
$.ajax({
url: "/finance/api/open",
type:'post',
data:{
id:$('[name="id"]').val(),
other_file_ids:val
},
success: function (e) {
location.reload();
}
})
}
})
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -80,7 +80,7 @@
</td>
<td colspan="5" style="line-height:inherit">
<div class="layui-row" id="fileBox">
<input type="hidden" id="fileBoxInput" name="file_ids" value="">
<input type="hidden" data-type="file" name="file_ids" value="">
</div>
</td>
</tr>
@ -181,19 +181,10 @@
</td>
<td colspan="5" style="line-height:inherit">
<div class="layui-row" id="fileBox">
<input type="hidden" id="fileBoxInput" name="file_ids" value="{$detail.file_ids}">
<input type="hidden" data-type="file" name="file_ids" value="{$detail.file_ids}">
{notempty name="$detail.file_ids"}
{volist name="$detail.fileArray" id="vo"}
<div class="layui-col-md4" id="fileItem{$vo.id}">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title">{$vo.name}</div>
<div class="file-tool">
<a href="{$vo.filepath}" download="{$vo.name}" target="_blank" title="下载查看"><i class="iconfont icon-shujudaoru blue"></i></a>
<i class="btn-delete iconfont icon-shanchu red" data-id="{$vo.id}" title="删除"></i>
</div>
</div>
</div>
<div class="layui-col-md4" id="uploadImg{$vo.id}">{:file_card($vo)}</div>
{/volist}
{/notempty}
</div>

View File

@ -70,7 +70,7 @@
}, {
field: 'invoice_title',
title: '开票抬头',
minWidth: 300,
minWidth: 240,
templet:function(d){
var html='';
if(d.type==1){

View File

@ -55,6 +55,7 @@
}, {
field: 'invoice_title',
title: '开票抬头',
minWidth: 240,
templet:function(d){
var html='';
if(d.type==1){

View File

@ -73,6 +73,7 @@
}, {
field: 'invoice_title',
title: '开票抬头',
minWidth: 240,
templet:function(d){
var html='';
if(d.type==1){

View File

@ -51,6 +51,7 @@
}, {
field: 'invoice_title',
title: '开票抬头',
minWidth: 240,
templet:function(d){
var html='';
if(d.type==1){

View File

@ -119,15 +119,7 @@
<td colspan="5" style="line-height:inherit">
<div class="layui-row">
{volist name="$detail.fileArray" id="vo"}
<div class="layui-col-md4">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title file-title-view">{$vo.name}</div>
<div class="file-tool">
<a href="{$vo.filepath}" download="{$vo.name}" target="_blank" title="下载查看"><i class="iconfont icon-shujudaoru blue"></i></a>
</div>
</div>
</div>
<div class="layui-col-md4" id="uploadImg{$vo.id}">{:file_card($vo,'view')}</div>
{/volist}
</div>
</td>
@ -229,19 +221,10 @@
</td>
<td colspan="5" style="line-height:inherit">
<div class="layui-row" id="fileBox">
<input type="hidden" id="fileBoxInput" name="other_file_ids" value="{$detail.other_file_ids}">
<input type="hidden" data-type="file" name="other_file_ids" value="{$detail.other_file_ids}">
{notempty name="$detail.other_file_ids"}
{volist name="$detail.fileArrayOther" id="vo"}
<div class="layui-col-md4" id="fileItem${$vo.id}">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title">{$vo.name}</div>
<div class="file-tool">
<a href="{$vo.filepath}" download="{$vo.name}" target="_blank" title="下载查看"><i class="iconfont icon-shujudaoru blue"></i></a>
<span class="ajax-delete iconfont icon-shanchu red" data-id="{$vo.id}" title="删除"></span>
</div>
</div>
</div>
<div class="layui-col-md4" id="uploadImg{$vo.id}">{:file_card($vo)}</div>
{/volist}
{/notempty}
</div>
@ -283,6 +266,7 @@ function gouguInit() {
oaTool.addFile({
isSave:true,
uidDelete:true,
ajaxSave:function(val){
$.ajax({
url: "/finance/api/open",
@ -295,6 +279,19 @@ function gouguInit() {
location.reload();
}
})
},
ajaxDelete:function(val){
$.ajax({
url: "/finance/api/open",
type:'post',
data:{
id:$('[name="id"]').val(),
other_file_ids:val
},
success: function (e) {
location.reload();
}
})
}
})

View File

@ -352,7 +352,7 @@ class Index extends BaseController
} else {
$mid = $res;
}
add_log('save',$mid);
add_log('save',$mid,$basedata,'消息');
return to_assign(0, '保存成功', $mid);
} else {
return to_assign(1, '操作失败');
@ -407,7 +407,7 @@ class Index extends BaseController
if ($res!==false) {
//草稿消息变成已发消息
MessageList::where(['id' => $msg['id']])->update(['is_draft' => '1', 'send_time' => time(), 'update_time' => time()]);
add_log('send',$msg['id']);
add_log('send',$msg['id'],[],'消息');
return to_assign(0, '发送成功');
} else {
return to_assign(1, '发送失败');
@ -460,14 +460,14 @@ class Index extends BaseController
foreach ($list as $key => $v) {
if (MessageList::update($v) !== false) {
if ($type = 1) {
add_log('view', $v['id']);
add_log('view', $v['id'],[],'消息');
} else if ($type = 2) {
add_log('delete', $v['id']);
add_log('delete', $v['id'],[],'消息');
} else if ($type = 3) {
add_log('recovery', $v['id']);
add_log('recovery', $v['id'],[],'消息');
}
else if ($type = 4) {
add_log('clear', $v['id']);
add_log('clear', $v['id'],[],'消息');
}
}
}

View File

@ -38,7 +38,7 @@
<td class="layui-td-gray"><div class="layui-input-inline">附件</div> <div class="layui-input-inline"><button type="button" class="layui-btn layui-btn-xs" id="upFile"><i class="layui-icon"></i></button></div></td>
<td colspan="5">
<div class="layui-row" id="fileList">
<input type="hidden" name="file_ids" value="">
<input type="hidden" data-type="file" name="file_ids" value="">
</div>
</td>
</tr>
@ -113,19 +113,10 @@
<td class="layui-td-gray"><div class="layui-input-inline">附件</div> <div class="layui-input-inline"><button type="button" class="layui-btn layui-btn-xs" id="upFile"><i class="layui-icon"></i></button></div></td>
<td colspan="5" style="line-height:inherit">
<div class="layui-row" id="fileList">
<input type="hidden" name="file_ids" value="{$detail.file_ids}">
<input type="hidden" name="file_ids" data-type="file" value="{$detail.file_ids}">
{notempty name="$detail.file_ids"}
{volist name="$detail.file_array" id="vo"}
<div class="layui-col-md4" id="uploadImg{$vo.id}">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title">{$vo.name}</div>
<div class="file-tool">
<a href="{$vo.filepath}" download="{$vo.name}" target="_blank" title="下载查看"><i class="iconfont icon-shujudaoru blue"></i></a>
<i class="btn-delete iconfont icon-shanchu red" data-id="{$vo.id}" title="删除"></i>
</div>
</div>
</div>
<div class="layui-col-md4" id="uploadImg{$vo.id}">{:file_card($vo)}</div>
{/volist}
{/notempty}
</div>
@ -146,27 +137,13 @@
<!-- 脚本 -->
{block name="script"}
<script>
// 查找指定的元素在数组中的位置
Array.prototype.indexOf = function (val) {
for (var i = 0; i < this.length; i++) {
if (this[i] == val) {
return i;
}
}
return -1;
};
// 通过索引删除数组元素
Array.prototype.remove = function (val) {
var index = this.indexOf(val);
if (index > -1) {
this.splice(index, 1);
}
};
const moduleInit = ['tool','employeepicker','dtree'];
const moduleInit = ['tool','employeepicker','dtree','oaTool'];
function gouguInit() {
var form = layui.form,tool=layui.tool,table=layui.table,laydate = layui.laydate,employeepicker = layui.employeepicker,dtree = layui.dtree,upload = layui.upload;
var form = layui.form,tool=layui.tool,table=layui.table,laydate = layui.laydate,employeepicker = layui.employeepicker,dtree = layui.dtree,oaTool = layui.oaTool;
oaTool.addFile({
btn: 'upFile',
box: 'fileList'
});
//监听保存到草稿并发送
form.on('submit(webform)', function(data){
$.ajax({
@ -343,48 +320,6 @@ Array.prototype.remove = function (val) {
})
}
$('#fileList').on('click', '.btn-delete', function () {
var _id = $(this).data('id');
var idsStr = $('#fileList input').val(),idsArray = [];
if (idsStr != '') {
idsArray = idsStr.split(",");
}
idsArray.remove(_id);
$('#fileList input').attr('value', idsArray.join(','));
$('#uploadImg' + _id).remove();
})
//多附件上传
upload.render({
elem: '#upFile'
,url: "/api/index/upload"
,multiple: true
,accept: 'file' //普通文件
,exts: 'png|jpg|gif|jpeg|doc|docx|ppt|pptx|xls|xlsx|pdf|zip|rar|7z' //只允许上传文件格式
,done: function(res){
layer.msg(res.msg);
if (res.code == 0) {
//上传成功
var idsStr = $('#fileList input').val(),idsArray = [];
if (idsStr != '') {
idsArray = idsStr.split(",");
}
idsArray.push(res.data.id);
$('#fileList input').attr('value', idsArray.join(','));
let temp = `<div class="layui-col-md4" id="uploadImg${res.data.id}">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title">${res.data.name}</div>
<div class="file-tool">
<a href="${res.data.filepath}" download="${res.data.name}" title="下载查看" target="_blank"><i class="iconfont icon-shujudaoru blue"></i></a>
<i class="btn-delete iconfont icon-shanchu red" data-id="${res.data.id}" title="删除"></i>
</div>
</div>
</div>`;
$('#fileList').append(temp);
}
}
});
}
</script>
{/block}

View File

@ -42,15 +42,7 @@
<td class="layui-td-gray-2" style="vertical-align:top">引用消息附件</td>
<td style="line-height:inherit">
{volist name="$detail.from_file_array" id="vo"}
<div class="layui-col-md4" id="uploadImg{$vo.id}">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title">{$vo.name}</div>
<div class="file-tool">
<a href="{$vo.filepath}" download="{$vo.name}" target="_blank" title="下载查看"><i class="iconfont icon-shujudaoru blue"></i></a>
</div>
</div>
</div>
<div class="layui-col-md4" id="uploadImg{$vo.id}">{:file_card($vo,'view')}</div>
{/volist}
</td>
</tr>
@ -67,15 +59,7 @@
<td class="layui-td-gray" style="vertical-align:top">相关附件</td>
<td colspan="5" style="line-height:inherit">
{volist name="$detail.file_array" id="vo"}
<div class="layui-col-md4" id="uploadImg{$vo.id}">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title">{$vo.name}</div>
<div class="file-tool">
<a href="{$vo.filepath}" download="{$vo.name}" target="_blank" title="下载查看"><i class="iconfont icon-shujudaoru blue"></i></a>
</div>
</div>
</div>
<div class="layui-col-md4" id="uploadImg{$vo.id}">{:file_card($vo,'view')}</div>
{/volist}
</td>
</tr>
@ -97,7 +81,7 @@
<!-- /主体 -->
{block name="script"}
<script>
const moduleInit = ['tool'];
const moduleInit = ['tool','oaTool'];
function gouguInit() {
if (parent.layui.pageTable) {
parent.layui.pageTable.reload();

View File

@ -65,15 +65,7 @@
<td class="layui-td-gray-2" style="vertical-align:top">原消息附件</td>
<td style="line-height:inherit">
{volist name="$detail.from_file_array" id="vo"}
<div class="layui-col-md4" id="uploadImg{$vo.id}">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title">{$vo.name}</div>
<div class="file-tool">
<a href="{$vo.filepath}" download="{$vo.name}" target="_blank" title="下载查看"><i class="iconfont icon-shujudaoru blue"></i></a>
</div>
</div>
</div>
<div class="layui-col-md4" id="uploadImg{$vo.id}">{:file_card($vo,'view')}</div>
{/volist}
</td>
</tr>
@ -85,19 +77,10 @@
<td class="layui-td-gray"><div class="layui-input-inline">附件</div> <div class="layui-input-inline"><button type="button" class="layui-btn layui-btn-xs" id="upFile"><i class="layui-icon"></i></button></div></td>
<td colspan="5" style="line-height:inherit">
<div class="layui-row" id="fileList">
<input type="hidden" name="file_ids" value="{$detail.file_ids}">
<input type="hidden" name="file_ids" data-type="file" value="{$detail.file_ids}">
{notempty name="$detail.file_ids"}
{volist name="$detail.file_array" id="vo"}
<div class="layui-col-md4" id="uploadImg{$vo.id}">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title">{$vo.name}</div>
<div class="file-tool">
<a href="{$vo.filepath}" download="{$vo.name}" target="_blank" title="下载查看"><i class="iconfont icon-shujudaoru blue"></i></a>
<i class="btn-delete iconfont icon-shanchu red" data-id="{$vo.id}" title="删除"></i>
</div>
</div>
</div>
<div class="layui-col-md4" id="uploadImg{$vo.id}">{:file_card($vo)}</div>
{/volist}
{/notempty}
</div>
@ -117,25 +100,13 @@
<!-- 脚本 -->
{block name="script"}
<script>
// 查找指定的元素在数组中的位置
Array.prototype.indexOf = function (val) {
for (var i = 0; i < this.length; i++) {
if (this[i] == val) {
return i;
}
}
return -1;
};
// 通过索引删除数组元素
Array.prototype.remove = function (val) {
var index = this.indexOf(val);
if (index > -1) {
this.splice(index, 1);
}
};
const moduleInit = ['tool','employeepicker','dtree'];
const moduleInit = ['tool','employeepicker','dtree','oaTool'];
function gouguInit() {
var form = layui.form,tool=layui.tool,table=layui.table,laydate = layui.laydate,employeepicker = layui.employeepicker,dtree = layui.dtree,upload = layui.upload;
var form = layui.form,tool=layui.tool,table=layui.table,laydate = layui.laydate,employeepicker = layui.employeepicker,dtree = layui.dtree,oaTool = layui.oaTool;
oaTool.addFile({
btn: 'upFile',
box: 'fileList'
});
//监听保存到草稿并发送
form.on('submit(webform)', function(data){
$.ajax({
@ -309,37 +280,6 @@ Array.prototype.remove = function (val) {
}
})
}
//多附件上传
upload.render({
elem: '#upFile'
,url: "/api/index/upload"
,multiple: true
,accept: 'file' //普通文件
,exts: 'png|jpg|gif|jpeg|doc|docx|ppt|pptx|xls|xlsx|pdf|zip|rar|7z' //只允许上传文件格式
,done: function(res){
layer.msg(res.msg);
if (res.code == 0) {
//上传成功
var idsStr = $('#fileList input').val(),idsArray = [];
if (idsStr != '') {
idsArray = idsStr.split(",");
}
idsArray.push(res.data.id);
$('#fileList input').attr('value', idsArray.join(','));
let temp = `<div class="layui-col-md4" id="uploadImg${res.data.id}">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title">${res.data.name}</div>
<div class="file-tool">
<a href="${res.data.filepath}" download="${res.data.name}" title="下载查看" target="_blank"><i class="iconfont icon-shujudaoru blue"></i></a>
<i class="btn-delete iconfont icon-shanchu red" data-id="${res.data.id}" title="删除"></i>
</div>
</div>
</div>`;
$('#fileList').append(temp);
}
}
});
}
</script>
{/block}

View File

@ -57,6 +57,7 @@
}, {
field: 'title',
title: '公告标题',
minWidth:240,
templet: '<div><a data-href="/note/index/view/id/{{d.id}}.html" class="side-a">{{d.title}}</a></div>'
}, {
field: 'cate_title',

View File

@ -518,6 +518,7 @@ class Approve extends BaseController
$class = strtolower(app('request')->controller());
$action = strtolower(app('request')->action());
$template = $module . '/view/'. $class .'/view_'.$moban.'.html';
//var_dump($detail['fileArray']);
View::assign('is_create_admin', $is_create_admin);
View::assign('is_check_admin', $is_check_admin);
View::assign('check_record', $check_record);

View File

@ -146,7 +146,7 @@ class Work extends BaseController
$person_name = Db::name('Admin')->where('status', 1)->where('id', 'in', $detail['type_user'])->column('name');
$detail['person_name'] = implode(",", $person_name);
$file_array = Db::name('WorkFileInterfix')
->field('wf.id,wf.wid,wf.file_id,f.name,f.filesize,f.filepath')
->field('wf.id,wf.wid,wf.file_id,f.name,f.filesize,f.filepath,f.fileext,f.create_time,f.admin_id')
->alias('wf')
->join('file f', 'wf.file_id = f.id', 'LEFT')
->order('wf.create_time desc')
@ -193,7 +193,7 @@ class Work extends BaseController
$detail['send_time'] = date('Y-m-d H:i:s',$detail['create_time']);
//当前消息的附件
$file_array = Db::name('WorkFileInterfix')
->field('wf.id,wf.wid,wf.file_id,f.name,f.filesize,f.filepath')
->field('wf.id,wf.wid,wf.file_id,f.name,f.filesize,f.filepath,f.fileext,f.create_time,f.admin_id')
->alias('wf')
->join('file f', 'wf.file_id = f.id', 'LEFT')
->order('wf.create_time desc')

View File

@ -36,9 +36,9 @@
</tr>
<tr>
<td class="layui-td-gray"><div class="layui-input-inline">附件</div> <div class="layui-input-inline"><button type="button" class="layui-btn layui-btn-xs" id="upFile"><i class="layui-icon"></i></button></div></td>
<td colspan="5">
<td colspan="5" style="line-height:inherit">
<div class="layui-row" id="fileList">
<input type="hidden" name="file_ids" value="">
<input type="hidden" data-type="file" name="file_ids" value="">
</div>
</td>
</tr>
@ -75,19 +75,10 @@
<td class="layui-td-gray"><div class="layui-input-inline">附件</div> <div class="layui-input-inline"><button type="button" class="layui-btn layui-btn-xs" id="upFile"><i class="layui-icon"></i></button></div></td>
<td colspan="5" style="line-height:inherit">
<div class="layui-row" id="fileList">
<input type="hidden" name="file_ids" value="{$detail.file_ids}">
<input type="hidden" name="file_ids" data-type="file" value="{$detail.file_ids}">
{notempty name="$detail.file_ids"}
{volist name="$detail.fileArray" id="vo"}
<div class="layui-col-md4" id="uploadImg{$vo.id}">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title">{$vo.name}</div>
<div class="file-tool">
<a href="{$vo.filepath}" download="{$vo.name}" target="_blank" title="下载查看"><i class="iconfont icon-shujudaoru blue"></i></a>
<i class="btn-delete iconfont icon-shanchu red" data-id="{$vo.id}" title="删除"></i>
</div>
</div>
</div>
<div class="layui-col-md4" id="uploadImg{$vo.id}">{:file_card($vo)}</div>
{/volist}
{/notempty}
</div>
@ -103,13 +94,18 @@
<!-- 脚本 -->
{block name="script"}
<script>
const moduleInit = ['tool','employeepicker'];
const moduleInit = ['tool','employeepicker','oaTool'];
function gouguInit() {
var form = layui.form,
tool=layui.tool,
employeepicker = layui.employeepicker,
oaTool=layui.oaTool,
laydate = layui.laydate;
oaTool.addFile({
btn: 'upFile',
box: 'fileList'
});
if (typeof (flowStep) == "function") {
flowStep();
}

View File

@ -37,9 +37,9 @@
</tr>
<tr>
<td class="layui-td-gray"><div class="layui-input-inline">附件</div> <div class="layui-input-inline"><button type="button" class="layui-btn layui-btn-xs" id="upFile"><i class="layui-icon"></i></button></div></td>
<td colspan="5">
<td colspan="5" style="line-height:inherit">
<div class="layui-row" id="fileList">
<input type="hidden" name="file_ids" value="">
<input type="hidden" data-type="file" name="file_ids" value="">
</div>
</td>
</tr>
@ -77,19 +77,10 @@
<td class="layui-td-gray"><div class="layui-input-inline">附件</div> <div class="layui-input-inline"><button type="button" class="layui-btn layui-btn-xs" id="upFile"><i class="layui-icon"></i></button></div></td>
<td colspan="5" style="line-height:inherit">
<div class="layui-row" id="fileList">
<input type="hidden" name="file_ids" value="{$detail.file_ids}">
<input type="hidden" name="file_ids" data-type="file" value="{$detail.file_ids}">
{notempty name="$detail.file_ids"}
{volist name="$detail.fileArray" id="vo"}
<div class="layui-col-md4" id="uploadImg{$vo.id}">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title">{$vo.name}</div>
<div class="file-tool">
<a href="{$vo.filepath}" download="{$vo.name}" target="_blank" title="下载查看"><i class="iconfont icon-shujudaoru blue"></i></a>
<i class="btn-delete iconfont icon-shanchu red" data-id="{$vo.id}" title="删除"></i>
</div>
</div>
</div>
<div class="layui-col-md4" id="uploadImg{$vo.id}">{:file_card($vo)}</div>
{/volist}
{/notempty}
</div>
@ -105,12 +96,17 @@
<!-- 脚本 -->
{block name="script"}
<script>
const moduleInit = ['tool','employeepicker'];
const moduleInit = ['tool','employeepicker','oaTool'];
function gouguInit() {
var form = layui.form,
tool=layui.tool,
employeepicker = layui.employeepicker,
laydate = layui.laydate;
oaTool=layui.oaTool,
laydate = layui.laydate;
oaTool.addFile({
btn: 'upFile',
box: 'fileList'
});
//日期时间范围
lay('.select-time').each(function () {
laydate.render({

View File

@ -30,24 +30,6 @@
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
<script>
// 查找指定的元素在数组中的位置
Array.prototype.indexOf = function (val) {
for (var i = 0; i < this.length; i++) {
if (this[i] == val) {
return i;
}
}
return -1;
};
// 通过索引删除数组元素
Array.prototype.remove = function (val) {
var index = this.indexOf(val);
if (index > -1) {
this.splice(index, 1);
}
};
function flowStep(){
let tool=layui.tool,form = layui.form,upload = layui.upload,employeepicker = layui.employeepicker;
@ -141,49 +123,5 @@ function flowStep(){
})
return false;
});
$('#fileList').on('click', '.btn-delete', function () {
var _id = $(this).data('id');
var idsStr = $('#fileList input').val(),idsArray = [];
if (idsStr != '') {
idsArray = idsStr.split(",");
}
idsArray.remove(_id);
$('#fileList input').attr('value', idsArray.join(','));
$('#uploadImg' + _id).remove();
})
//多附件上传
upload.render({
elem: '#upFile'
,url: "/api/index/upload"
,multiple: true
,accept: 'file' //普通文件
,exts: 'png|jpg|gif|jpeg|doc|docx|ppt|pptx|xls|xlsx|pdf|zip|rar|7z' //只允许上传文件格式
,done: function(res){
layer.msg(res.msg);
if (res.code == 0) {
//上传成功
var idsStr = $('#fileList input').val(),idsArray = [];
if (idsStr != '') {
idsArray = idsStr.split(",");
}
idsArray.push(res.data.id);
$('#fileList input').attr('value', idsArray.join(','));
let temp = `<div class="layui-col-md4" id="uploadImg${res.data.id}">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title">${res.data.name}</div>
<div class="file-tool">
<a href="${res.data.filepath}" download="${res.data.name}" title="下载查看" target="_blank"><i class="iconfont icon-shujudaoru blue"></i></a>
<i class="btn-delete iconfont icon-shanchu red" data-id="${res.data.id}" title="删除"></i>
</div>
</div>
</div>`;
$('#fileList').append(temp);
}
}
});
}
</script>

View File

@ -53,9 +53,9 @@
</tr>
<tr>
<td class="layui-td-gray"><div class="layui-input-inline">附件</div> <div class="layui-input-inline"><button type="button" class="layui-btn layui-btn-xs" id="upFile"><i class="layui-icon"></i></button></div></td>
<td colspan="5">
<td colspan="5" style="line-height:inherit">
<div class="layui-row" id="fileList">
<input type="hidden" name="file_ids" value="">
<input type="hidden" data-type="file" name="file_ids" value="">
</div>
</td>
</tr>
@ -109,19 +109,10 @@
<td class="layui-td-gray"><div class="layui-input-inline">附件</div> <div class="layui-input-inline"><button type="button" class="layui-btn layui-btn-xs" id="upFile"><i class="layui-icon"></i></button></div></td>
<td colspan="5" style="line-height:inherit">
<div class="layui-row" id="fileList">
<input type="hidden" name="file_ids" value="{$detail.file_ids}">
<input type="hidden" name="file_ids" data-type="file" value="{$detail.file_ids}">
{notempty name="$detail.file_ids"}
{volist name="$detail.fileArray" id="vo"}
<div class="layui-col-md4" id="uploadImg{$vo.id}">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title">{$vo.name}</div>
<div class="file-tool">
<a href="{$vo.filepath}" download="{$vo.name}" target="_blank" title="下载查看"><i class="iconfont icon-shujudaoru blue"></i></a>
<i class="btn-delete iconfont icon-shanchu red" data-id="{$vo.id}" title="删除"></i>
</div>
</div>
</div>
<div class="layui-col-md4" id="uploadImg{$vo.id}">{:file_card($vo)}</div>
{/volist}
{/notempty}
</div>
@ -137,12 +128,17 @@
<!-- 脚本 -->
{block name="script"}
<script>
const moduleInit = ['tool','employeepicker'];
const moduleInit = ['tool','employeepicker','oaTool'];
function gouguInit() {
var form = layui.form,
tool=layui.tool,
employeepicker = layui.employeepicker,
laydate = layui.laydate;
oaTool=layui.oaTool,
laydate = layui.laydate;
oaTool.addFile({
btn: 'upFile',
box: 'fileList'
});
if (typeof (flowStep) == "function") {
flowStep();

View File

@ -45,9 +45,9 @@
</tr>
<tr>
<td class="layui-td-gray"><div class="layui-input-inline">附件</div> <div class="layui-input-inline"><button type="button" class="layui-btn layui-btn-xs" id="upFile"><i class="layui-icon"></i></button></div></td>
<td colspan="5">
<td colspan="5" style="line-height:inherit">
<div class="layui-row" id="fileList">
<input type="hidden" name="file_ids" value="">
<input type="hidden" data-type="file" name="file_ids" value="">
</div>
</td>
</tr>
@ -93,19 +93,10 @@
<td class="layui-td-gray"><div class="layui-input-inline">附件</div> <div class="layui-input-inline"><button type="button" class="layui-btn layui-btn-xs" id="upFile"><i class="layui-icon"></i></button></div></td>
<td colspan="5" style="line-height:inherit">
<div class="layui-row" id="fileList">
<input type="hidden" name="file_ids" value="{$detail.file_ids}">
<input type="hidden" name="file_ids" data-type="file" value="{$detail.file_ids}">
{notempty name="$detail.file_ids"}
{volist name="$detail.fileArray" id="vo"}
<div class="layui-col-md4" id="uploadImg{$vo.id}">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title">{$vo.name}</div>
<div class="file-tool">
<a href="{$vo.filepath}" download="{$vo.name}" target="_blank" title="下载查看"><i class="iconfont icon-shujudaoru blue"></i></a>
<i class="btn-delete iconfont icon-shanchu red" data-id="{$vo.id}" title="删除"></i>
</div>
</div>
</div>
<div class="layui-col-md4" id="uploadImg{$vo.id}">{:file_card($vo)}</div>
{/volist}
{/notempty}
</div>
@ -121,12 +112,17 @@
<!-- 脚本 -->
{block name="script"}
<script>
const moduleInit = ['tool','employeepicker'];
const moduleInit = ['tool','employeepicker','oaTool'];
function gouguInit() {
var form = layui.form,
tool=layui.tool,
employeepicker = layui.employeepicker,
oaTool=layui.oaTool,
laydate = layui.laydate;
oaTool.addFile({
btn: 'upFile',
box: 'fileList'
});
if (typeof (flowStep) == "function") {
flowStep();
}

View File

@ -30,9 +30,9 @@
</tr>
<tr>
<td class="layui-td-gray"><div class="layui-input-inline">附件</div> <div class="layui-input-inline"><button type="button" class="layui-btn layui-btn-xs" id="upFile"><i class="layui-icon"></i></button></div></td>
<td colspan="5">
<td colspan="5" style="line-height:inherit">
<div class="layui-row" id="fileList">
<input type="hidden" name="file_ids" value="">
<input type="hidden" data-type="file" name="file_ids" value="">
</div>
</td>
</tr>
@ -63,19 +63,10 @@
<td class="layui-td-gray"><div class="layui-input-inline">附件</div> <div class="layui-input-inline"><button type="button" class="layui-btn layui-btn-xs" id="upFile"><i class="layui-icon"></i></button></div></td>
<td colspan="5" style="line-height:inherit">
<div class="layui-row" id="fileList">
<input type="hidden" name="file_ids" value="{$detail.file_ids}">
<input type="hidden" name="file_ids" data-type="file" value="{$detail.file_ids}">
{notempty name="$detail.file_ids"}
{volist name="$detail.fileArray" id="vo"}
<div class="layui-col-md4" id="uploadImg{$vo.id}">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title">{$vo.name}</div>
<div class="file-tool">
<a href="{$vo.filepath}" download="{$vo.name}" target="_blank" title="下载查看"><i class="iconfont icon-shujudaoru blue"></i></a>
<i class="btn-delete iconfont icon-shanchu red" data-id="{$vo.id}" title="删除"></i>
</div>
</div>
</div>
<div class="layui-col-md4" id="uploadImg{$vo.id}">{:file_card($vo)}</div>
{/volist}
{/notempty}
</div>
@ -91,12 +82,17 @@
<!-- 脚本 -->
{block name="script"}
<script>
const moduleInit = ['tool','employeepicker'];
const moduleInit = ['tool','employeepicker','oaTool'];
function gouguInit() {
var form = layui.form,
tool=layui.tool,
employeepicker = layui.employeepicker,
laydate = layui.laydate;
oaTool=layui.oaTool,
laydate = layui.laydate;
oaTool.addFile({
btn: 'upFile',
box: 'fileList'
});
if (typeof (flowStep) == "function") {
flowStep();

View File

@ -55,9 +55,9 @@
</tr>
<tr>
<td class="layui-td-gray"><div class="layui-input-inline">附件</div> <div class="layui-input-inline"><button type="button" class="layui-btn layui-btn-xs" id="upFile"><i class="layui-icon"></i></button></div></td>
<td colspan="5">
<td colspan="5" style="line-height:inherit">
<div class="layui-row" id="fileList">
<input type="hidden" name="file_ids" value="">
<input type="hidden" data-type="file" name="file_ids" value="">
</div>
</td>
</tr>
@ -113,19 +113,10 @@
<td class="layui-td-gray"><div class="layui-input-inline">附件</div> <div class="layui-input-inline"><button type="button" class="layui-btn layui-btn-xs" id="upFile"><i class="layui-icon"></i></button></div></td>
<td colspan="5" style="line-height:inherit">
<div class="layui-row" id="fileList">
<input type="hidden" name="file_ids" value="{$detail.file_ids}">
<input type="hidden" name="file_ids" data-type="file" value="{$detail.file_ids}">
{notempty name="$detail.file_ids"}
{volist name="$detail.fileArray" id="vo"}
<div class="layui-col-md4" id="uploadImg{$vo.id}">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title">{$vo.name}</div>
<div class="file-tool">
<a href="{$vo.filepath}" download="{$vo.name}" target="_blank" title="下载查看"><i class="iconfont icon-shujudaoru blue"></i></a>
<i class="btn-delete iconfont icon-shanchu red" data-id="{$vo.id}" title="删除"></i>
</div>
</div>
</div>
<div class="layui-col-md4" id="uploadImg{$vo.id}">{:file_card($vo)}</div>
{/volist}
{/notempty}
</div>
@ -141,12 +132,17 @@
<!-- 脚本 -->
{block name="script"}
<script>
const moduleInit = ['tool','employeepicker'];
const moduleInit = ['tool','employeepicker','oaTool'];
function gouguInit() {
var form = layui.form,
tool=layui.tool,
employeepicker = layui.employeepicker,
laydate = layui.laydate;
oaTool=layui.oaTool,
laydate = layui.laydate;
oaTool.addFile({
btn: 'upFile',
box: 'fileList'
});
if (typeof (flowStep) == "function") {
flowStep();
}

View File

@ -58,7 +58,7 @@
<td class="layui-td-gray"><div class="layui-input-inline">附件</div> <div class="layui-input-inline"><button type="button" class="layui-btn layui-btn-xs" id="upFile"><i class="layui-icon"></i></button></div></td>
<td colspan="5" style="line-height:inherit">
<div class="layui-row" id="fileList">
<input type="hidden" name="file_ids" value="">
<input data-type="file" type="hidden" name="file_ids" value="">
</div>
</td>
</tr>
@ -115,19 +115,10 @@
<td class="layui-td-gray"><div class="layui-input-inline">附件</div> <div class="layui-input-inline"><button type="button" class="layui-btn layui-btn-xs" id="upFile"><i class="layui-icon"></i></button></div></td>
<td colspan="5" style="line-height:inherit">
<div class="layui-row" id="fileList">
<input type="hidden" name="file_ids" value="{$detail.file_ids}">
<input data-type="file" type="hidden" name="file_ids" value="{$detail.file_ids}">
{notempty name="$detail.file_ids"}
{volist name="$detail.fileArray" id="vo"}
<div class="layui-col-md4" id="uploadImg{$vo.id}">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title">{$vo.name}</div>
<div class="file-tool">
<a href="{$vo.filepath}" download="{$vo.name}" target="_blank" title="下载查看"><i class="iconfont icon-shujudaoru blue"></i></a>
<i class="btn-delete iconfont icon-shanchu red" data-id="{$vo.id}" title="删除"></i>
</div>
</div>
</div>
<div class="layui-col-md4" id="uploadImg{$vo.id}">{:file_card($vo)}</div>
{/volist}
{/notempty}
</div>
@ -209,12 +200,18 @@ function leaveTime() {
return hour;
}
const moduleInit = ['tool','employeepicker'];
const moduleInit = ['tool','employeepicker','oaTool'];
function gouguInit() {
var form = layui.form,
tool=layui.tool,
oaTool=layui.oaTool,
laydate = layui.laydate;
oaTool.addFile({
btn: 'upFile',
box: 'fileList'
});
if (typeof (flowStep) == "function") {
flowStep();
}

View File

@ -29,9 +29,9 @@
</tr>
<tr>
<td class="layui-td-gray"><div class="layui-input-inline">附件</div> <div class="layui-input-inline"><button type="button" class="layui-btn layui-btn-xs" id="upFile"><i class="layui-icon"></i></button></div></td>
<td colspan="5">
<td colspan="5" style="line-height:inherit">
<div class="layui-row" id="fileList">
<input type="hidden" name="file_ids" value="">
<input type="hidden" data-type="file" name="file_ids" value="">
</div>
</td>
</tr>
@ -61,19 +61,10 @@
<td class="layui-td-gray"><div class="layui-input-inline">附件</div> <div class="layui-input-inline"><button type="button" class="layui-btn layui-btn-xs" id="upFile"><i class="layui-icon"></i></button></div></td>
<td colspan="5" style="line-height:inherit">
<div class="layui-row" id="fileList">
<input type="hidden" name="file_ids" value="{$detail.file_ids}">
<input type="hidden" name="file_ids" data-type="file" value="{$detail.file_ids}">
{notempty name="$detail.file_ids"}
{volist name="$detail.fileArray" id="vo"}
<div class="layui-col-md4" id="uploadImg{$vo.id}">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title">{$vo.name}</div>
<div class="file-tool">
<a href="{$vo.filepath}" download="{$vo.name}" target="_blank" title="下载查看"><i class="iconfont icon-shujudaoru blue"></i></a>
<i class="btn-delete iconfont icon-shanchu red" data-id="{$vo.id}" title="删除"></i>
</div>
</div>
</div>
<div class="layui-col-md4" id="uploadImg{$vo.id}">{:file_card($vo)}</div>
{/volist}
{/notempty}
</div>
@ -89,11 +80,20 @@
<!-- 脚本 -->
{block name="script"}
<script>
const moduleInit = ['tool','employeepicker'];
function gouguInit() {
if (typeof (flowStep) == "function") {
flowStep();
}
const moduleInit = ['tool','employeepicker','oaTool'];
function gouguInit() {
var form = layui.form,
tool=layui.tool,
oaTool=layui.oaTool,
laydate = layui.laydate;
oaTool.addFile({
btn: 'upFile',
box: 'fileList'
});
if (typeof (flowStep) == "function") {
flowStep();
}
}
</script>
{/block}

View File

@ -43,9 +43,9 @@
</tr>
<tr>
<td class="layui-td-gray"><div class="layui-input-inline">附件</div> <div class="layui-input-inline"><button type="button" class="layui-btn layui-btn-xs" id="upFile"><i class="layui-icon"></i></button></div></td>
<td colspan="5">
<td colspan="5" style="line-height:inherit">
<div class="layui-row" id="fileList">
<input type="hidden" name="file_ids" value="">
<input type="hidden" data-type="file" name="file_ids" value="">
</div>
</td>
</tr>
@ -89,19 +89,10 @@
<td class="layui-td-gray"><div class="layui-input-inline">附件</div> <div class="layui-input-inline"><button type="button" class="layui-btn layui-btn-xs" id="upFile"><i class="layui-icon"></i></button></div></td>
<td colspan="5" style="line-height:inherit">
<div class="layui-row" id="fileList">
<input type="hidden" name="file_ids" value="{$detail.file_ids}">
<input type="hidden" name="file_ids" data-type="file" value="{$detail.file_ids}">
{notempty name="$detail.file_ids"}
{volist name="$detail.fileArray" id="vo"}
<div class="layui-col-md4" id="uploadImg{$vo.id}">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title">{$vo.name}</div>
<div class="file-tool">
<a href="{$vo.filepath}" download="{$vo.name}" target="_blank" title="下载查看"><i class="iconfont icon-shujudaoru blue"></i></a>
<i class="btn-delete iconfont icon-shanchu red" data-id="{$vo.id}" title="删除"></i>
</div>
</div>
</div>
<div class="layui-col-md4" id="uploadImg{$vo.id}">{:file_card($vo)}</div>
{/volist}
{/notempty}
</div>
@ -183,11 +174,17 @@ function leaveTime() {
return hour;
}
const moduleInit = ['tool','employeepicker'];
const moduleInit = ['tool','employeepicker','oaTool'];
function gouguInit() {
var form = layui.form,
tool=layui.tool,
oaTool=layui.oaTool,
laydate = layui.laydate;
oaTool.addFile({
btn: 'upFile',
box: 'fileList'
});
if (typeof (flowStep) == "function") {
flowStep();

View File

@ -37,9 +37,9 @@
</tr>
<tr>
<td class="layui-td-gray"><div class="layui-input-inline">附件</div> <div class="layui-input-inline"><button type="button" class="layui-btn layui-btn-xs" id="upFile"><i class="layui-icon"></i></button></div></td>
<td colspan="5">
<td colspan="5" style="line-height:inherit">
<div class="layui-row" id="fileList">
<input type="hidden" name="file_ids" value="">
<input type="hidden" data-type="file" name="file_ids" value="">
</div>
</td>
</tr>
@ -77,19 +77,10 @@
<td class="layui-td-gray"><div class="layui-input-inline">附件</div> <div class="layui-input-inline"><button type="button" class="layui-btn layui-btn-xs" id="upFile"><i class="layui-icon"></i></button></div></td>
<td colspan="5" style="line-height:inherit">
<div class="layui-row" id="fileList">
<input type="hidden" name="file_ids" value="{$detail.file_ids}">
<input type="hidden" name="file_ids" data-type="file" value="{$detail.file_ids}">
{notempty name="$detail.file_ids"}
{volist name="$detail.fileArray" id="vo"}
<div class="layui-col-md4" id="uploadImg{$vo.id}">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title">{$vo.name}</div>
<div class="file-tool">
<a href="{$vo.filepath}" download="{$vo.name}" target="_blank" title="下载查看"><i class="iconfont icon-shujudaoru blue"></i></a>
<i class="btn-delete iconfont icon-shanchu red" data-id="{$vo.id}" title="删除"></i>
</div>
</div>
</div>
<div class="layui-col-md4" id="uploadImg{$vo.id}">{:file_card($vo)}</div>
{/volist}
{/notempty}
</div>
@ -105,12 +96,17 @@
<!-- 脚本 -->
{block name="script"}
<script>
const moduleInit = ['tool','employeepicker'];
const moduleInit = ['tool','employeepicker','oaTool'];
function gouguInit() {
var form = layui.form,
tool=layui.tool,
employeepicker = layui.employeepicker,
oaTool=layui.oaTool,
laydate = layui.laydate;
oaTool.addFile({
btn: 'upFile',
box: 'fileList'
});
if (typeof (flowStep) == "function") {
flowStep();
}

View File

@ -53,9 +53,9 @@
</tr>
<tr>
<td class="layui-td-gray"><div class="layui-input-inline">附件</div> <div class="layui-input-inline"><button type="button" class="layui-btn layui-btn-xs" id="upFile"><i class="layui-icon"></i></button></div></td>
<td colspan="5">
<td colspan="5" style="line-height:inherit">
<div class="layui-row" id="fileList">
<input type="hidden" name="file_ids" value="">
<input type="hidden" data-type="file" name="file_ids" value="">
</div>
</td>
</tr>
@ -109,19 +109,10 @@
<td class="layui-td-gray"><div class="layui-input-inline">附件</div> <div class="layui-input-inline"><button type="button" class="layui-btn layui-btn-xs" id="upFile"><i class="layui-icon"></i></button></div></td>
<td colspan="5" style="line-height:inherit">
<div class="layui-row" id="fileList">
<input type="hidden" name="file_ids" value="{$detail.file_ids}">
<input type="hidden" name="file_ids" data-type="file" value="{$detail.file_ids}">
{notempty name="$detail.file_ids"}
{volist name="$detail.fileArray" id="vo"}
<div class="layui-col-md4" id="uploadImg{$vo.id}">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title">{$vo.name}</div>
<div class="file-tool">
<a href="{$vo.filepath}" download="{$vo.name}" target="_blank" title="下载查看"><i class="iconfont icon-shujudaoru blue"></i></a>
<i class="btn-delete iconfont icon-shanchu red" data-id="{$vo.id}" title="删除"></i>
</div>
</div>
</div>
<div class="layui-col-md4" id="uploadImg{$vo.id}">{:file_card($vo)}</div>
{/volist}
{/notempty}
</div>
@ -137,12 +128,18 @@
<!-- 脚本 -->
{block name="script"}
<script>
const moduleInit = ['tool','employeepicker'];
const moduleInit = ['tool','employeepicker','oaTool'];
function gouguInit() {
var form = layui.form,
tool=layui.tool,
oaTool=layui.oaTool,
laydate = layui.laydate;
oaTool.addFile({
btn: 'upFile',
box: 'fileList'
});
if (typeof (flowStep) == "function") {
flowStep();
}

View File

@ -52,9 +52,9 @@
</tr>
<tr>
<td class="layui-td-gray"><div class="layui-input-inline">附件</div> <div class="layui-input-inline"><button type="button" class="layui-btn layui-btn-xs" id="upFile"><i class="layui-icon"></i></button></div></td>
<td colspan="5">
<td colspan="5" style="line-height:inherit">
<div class="layui-row" id="fileList">
<input type="hidden" name="file_ids" value="">
<input type="hidden" data-type="file" name="file_ids" value="">
</div>
</td>
</tr>
@ -107,19 +107,10 @@
<td class="layui-td-gray"><div class="layui-input-inline">附件</div> <div class="layui-input-inline"><button type="button" class="layui-btn layui-btn-xs" id="upFile"><i class="layui-icon"></i></button></div></td>
<td colspan="5" style="line-height:inherit">
<div class="layui-row" id="fileList">
<input type="hidden" name="file_ids" value="{$detail.file_ids}">
<input type="hidden" name="file_ids" data-type="file" value="{$detail.file_ids}">
{notempty name="$detail.file_ids"}
{volist name="$detail.fileArray" id="vo"}
<div class="layui-col-md4" id="uploadImg{$vo.id}">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title">{$vo.name}</div>
<div class="file-tool">
<a href="{$vo.filepath}" download="{$vo.name}" target="_blank" title="下载查看"><i class="iconfont icon-shujudaoru blue"></i></a>
<i class="btn-delete iconfont icon-shanchu red" data-id="{$vo.id}" title="删除"></i>
</div>
</div>
</div>
<div class="layui-col-md4" id="uploadImg{$vo.id}">{:file_card($vo)}</div>
{/volist}
{/notempty}
</div>
@ -135,11 +126,17 @@
<!-- 脚本 -->
{block name="script"}
<script>
const moduleInit = ['tool','employeepicker'];
const moduleInit = ['tool','employeepicker','oaTool'];
function gouguInit() {
var form = layui.form,
tool=layui.tool,
laydate = layui.laydate;
oaTool=layui.oaTool,
laydate = layui.laydate;
oaTool.addFile({
btn: 'upFile',
box: 'fileList'
});
if (typeof (flowStep) == "function") {
flowStep();

View File

@ -75,9 +75,9 @@
</tr>
<tr>
<td class="layui-td-gray"><div class="layui-input-inline">附件</div> <div class="layui-input-inline"><button type="button" class="layui-btn layui-btn-xs" id="upFile"><i class="layui-icon"></i></button></div></td>
<td colspan="5">
<td colspan="5" style="line-height:inherit">
<div class="layui-row" id="fileList">
<input type="hidden" name="file_ids" value="">
<input type="hidden" data-type="file" name="file_ids" value="">
</div>
</td>
</tr>
@ -153,19 +153,10 @@
<td class="layui-td-gray"><div class="layui-input-inline">附件</div> <div class="layui-input-inline"><button type="button" class="layui-btn layui-btn-xs" id="upFile"><i class="layui-icon"></i></button></div></td>
<td colspan="5" style="line-height:inherit">
<div class="layui-row" id="fileList">
<input type="hidden" name="file_ids" value="{$detail.file_ids}">
<input type="hidden" name="file_ids" data-type="file" value="{$detail.file_ids}">
{notempty name="$detail.file_ids"}
{volist name="$detail.fileArray" id="vo"}
<div class="layui-col-md4" id="uploadImg{$vo.id}">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title">{$vo.name}</div>
<div class="file-tool">
<a href="{$vo.filepath}" download="{$vo.name}" target="_blank" title="下载查看"><i class="iconfont icon-shujudaoru blue"></i></a>
<i class="btn-delete iconfont icon-shanchu red" data-id="{$vo.id}" title="删除"></i>
</div>
</div>
</div>
<div class="layui-col-md4" id="uploadImg{$vo.id}">{:file_card($vo)}</div>
{/volist}
{/notempty}
</div>
@ -181,11 +172,17 @@
<!-- 脚本 -->
{block name="script"}
<script>
const moduleInit = ['tool','employeepicker'];
const moduleInit = ['tool','employeepicker','oaTool'];
function gouguInit() {
var form = layui.form,
tool=layui.tool,
laydate = layui.laydate;
oaTool=layui.oaTool,
laydate = layui.laydate;
oaTool.addFile({
btn: 'upFile',
box: 'fileList'
});
if (typeof (flowStep) == "function") {
flowStep();
}

View File

@ -47,9 +47,9 @@
</tr>
<tr>
<td class="layui-td-gray"><div class="layui-input-inline">附件</div> <div class="layui-input-inline"><button type="button" class="layui-btn layui-btn-xs" id="upFile"><i class="layui-icon"></i></button></div></td>
<td colspan="5">
<td colspan="5" style="line-height:inherit">
<div class="layui-row" id="fileList">
<input type="hidden" name="file_ids" value="">
<input type="hidden" data-type="file" name="file_ids" value="">
</div>
</td>
</tr>
@ -97,19 +97,10 @@
<td class="layui-td-gray"><div class="layui-input-inline">附件</div> <div class="layui-input-inline"><button type="button" class="layui-btn layui-btn-xs" id="upFile"><i class="layui-icon"></i></button></div></td>
<td colspan="5" style="line-height:inherit">
<div class="layui-row" id="fileList">
<input type="hidden" name="file_ids" value="{$detail.file_ids}">
<input type="hidden" name="file_ids" data-type="file" value="{$detail.file_ids}">
{notempty name="$detail.file_ids"}
{volist name="$detail.fileArray" id="vo"}
<div class="layui-col-md4" id="uploadImg{$vo.id}">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title">{$vo.name}</div>
<div class="file-tool">
<a href="{$vo.filepath}" download="{$vo.name}" target="_blank" title="下载查看"><i class="iconfont icon-shujudaoru blue"></i></a>
<i class="btn-delete iconfont icon-shanchu red" data-id="{$vo.id}" title="删除"></i>
</div>
</div>
</div>
<div class="layui-col-md4" id="uploadImg{$vo.id}">{:file_card($vo)}</div>
{/volist}
{/notempty}
</div>
@ -125,13 +116,18 @@
<!-- 脚本 -->
{block name="script"}
<script>
const moduleInit = ['tool','employeepicker'];
const moduleInit = ['tool','employeepicker','oaTool'];
function gouguInit() {
var form = layui.form,
tool=layui.tool,
employeepicker = layui.employeepicker,
oaTool=layui.oaTool,
laydate = layui.laydate;
oaTool.addFile({
btn: 'upFile',
box: 'fileList'
});
if (typeof (flowStep) == "function") {
flowStep();
}

View File

@ -2,7 +2,7 @@
<!-- 主体 -->
{block name="body"}
<div class="p-3">
<form class="layui-form gg-form-bar border-x" lay-filter="barsearchform" id="barsearchform">
<form class="layui-form gg-form-bar border-t border-x" lay-filter="barsearchform" id="barsearchform">
<div class="layui-input-inline" style="width:150px;">
<select name="type">
<option value="">选择审批类别</option>

View File

@ -33,15 +33,7 @@
<td colspan="3" style="line-height:inherit">
<div class="layui-row">
{volist name="$detail.fileArray" id="vo"}
<div class="layui-col-md4">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title">{$vo.name}</div>
<div class="file-tool">
<a href="{$vo.filepath}" download="{$vo.name}" target="_blank" title="下载查看"><i class="iconfont icon-shujudaoru blue"></i></a>
</div>
</div>
</div>
<div class="layui-col-md4" id="uploadImg{$vo.id}">{:file_card($vo,'view')}</div>
{/volist}
</div>
</td>

View File

@ -25,15 +25,7 @@
<td colspan="3" style="line-height:inherit">
<div class="layui-row">
{volist name="$detail.fileArray" id="vo"}
<div class="layui-col-md4">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title">{$vo.name}</div>
<div class="file-tool">
<a href="{$vo.filepath}" download="{$vo.name}" target="_blank" title="下载查看"><i class="iconfont icon-shujudaoru blue"></i></a>
</div>
</div>
</div>
<div class="layui-col-md4" id="uploadImg{$vo.id}">{:file_card($vo,'view')}</div>
{/volist}
</div>
</td>

View File

@ -42,18 +42,10 @@
{notempty name="$detail.file_ids"}
<tr>
<td class="layui-td-gray">相关附件</td>
<td colspan="3" style="line-height:inherit">
<td colspan="5" style="line-height:inherit">
<div class="layui-row">
{volist name="$detail.fileArray" id="vo"}
<div class="layui-col-md4">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title">{$vo.name}</div>
<div class="file-tool">
<a href="{$vo.filepath}" download="{$vo.name}" target="_blank" title="下载查看"><i class="iconfont icon-shujudaoru blue"></i></a>
</div>
</div>
</div>
<div class="layui-col-md4" id="uploadImg{$vo.id}">{:file_card($vo,'view')}</div>
{/volist}
</div>
</td>

View File

@ -38,9 +38,12 @@
<div class="layui-row">
{volist name="$detail.fileArray" id="vo"}
<div class="layui-col-md4">
<div class="file-card">
<div class="file-card file-view">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title">{$vo.name}</div>
<div class="file-info">
<div class="file-title">{$vo.name}</div>
<div class="file-ops">{:to_size($vo.filesize)}{$vo.create_time|date='Y-m-d H:i'}</div>
</div>
<div class="file-tool">
<a href="{$vo.filepath}" download="{$vo.name}" target="_blank" title="下载查看"><i class="iconfont icon-shujudaoru blue"></i></a>
</div>

View File

@ -29,15 +29,7 @@
<td colspan="5" style="line-height:inherit">
<div class="layui-row">
{volist name="$detail.fileArray" id="vo"}
<div class="layui-col-md4">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title">{$vo.name}</div>
<div class="file-tool">
<a href="{$vo.filepath}" download="{$vo.name}" target="_blank" title="下载查看"><i class="iconfont icon-shujudaoru blue"></i></a>
</div>
</div>
</div>
<div class="layui-col-md4" id="uploadImg{$vo.id}">{:file_card($vo,'view')}</div>
{/volist}
</div>
</td>

View File

@ -27,15 +27,7 @@
<td colspan="3" style="line-height:inherit">
<div class="layui-row">
{volist name="$detail.fileArray" id="vo"}
<div class="layui-col-md4">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title">{$vo.name}</div>
<div class="file-tool">
<a href="{$vo.filepath}" download="{$vo.name}" target="_blank" title="下载查看"><i class="iconfont icon-shujudaoru blue"></i></a>
</div>
</div>
</div>
<div class="layui-col-md4" id="uploadImg{$vo.id}">{:file_card($vo,'view')}</div>
{/volist}
</div>
</td>

View File

@ -43,15 +43,7 @@
<td colspan="3" style="line-height:inherit">
<div class="layui-row">
{volist name="$detail.fileArray" id="vo"}
<div class="layui-col-md4">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title">{$vo.name}</div>
<div class="file-tool">
<a href="{$vo.filepath}" download="{$vo.name}" target="_blank" title="下载查看"><i class="iconfont icon-shujudaoru blue"></i></a>
</div>
</div>
</div>
<div class="layui-col-md4" id="uploadImg{$vo.id}">{:file_card($vo,'view')}</div>
{/volist}
</div>
</td>

View File

@ -39,15 +39,7 @@
<td colspan="3" style="line-height:inherit">
<div class="layui-row">
{volist name="$detail.fileArray" id="vo"}
<div class="layui-col-md4">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title">{$vo.name}</div>
<div class="file-tool">
<a href="{$vo.filepath}" download="{$vo.name}" target="_blank" title="下载查看"><i class="iconfont icon-shujudaoru blue"></i></a>
</div>
</div>
</div>
<div class="layui-col-md4">{:file_card($vo,'view')}</div>
{/volist}
</div>
</td>

View File

@ -1,5 +1,5 @@
<script>
const moduleInit = ['tool','employeepicker'];
const moduleInit = ['tool','employeepicker','oaTool'];
function gouguInit() {
var form = layui.form,tool=layui.tool, employeepicker = layui.employeepicker,laydate = layui.laydate,dropdown = layui.dropdown;
//获取审核信息

View File

@ -10,9 +10,9 @@
<tr>
<td class="layui-td-gray">紧急程度</td>
<td>
{eq name="$detail.detail_type" value="1"}普通{/eq}
{eq name="$detail.detail_type" value="2"}紧急{/eq}
{eq name="$detail.detail_type" value="3"}特急{/eq}
{eq name="$detail.detail_type" value="1"}普通{/eq}
{eq name="$detail.detail_type" value="2"}紧急{/eq}
{eq name="$detail.detail_type" value="3"}特急{/eq}
</td>
<td class="layui-td-gray-2">审批内容</td>
<td>{$detail.name}</td>
@ -27,15 +27,7 @@
<td colspan="3" style="line-height:inherit">
<div class="layui-row">
{volist name="$detail.fileArray" id="vo"}
<div class="layui-col-md4">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title">{$vo.name}</div>
<div class="file-tool">
<a href="{$vo.filepath}" download="{$vo.name}" target="_blank" title="下载查看"><i class="iconfont icon-shujudaoru blue"></i></a>
</div>
</div>
</div>
<div class="layui-col-md4" id="uploadImg{$vo.id}">{:file_card($vo,'view')}</div>
{/volist}
</div>
</td>

View File

@ -31,15 +31,7 @@
<td colspan="3" style="line-height:inherit">
<div class="layui-row">
{volist name="$detail.fileArray" id="vo"}
<div class="layui-col-md4">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title">{$vo.name}</div>
<div class="file-tool">
<a href="{$vo.filepath}" download="{$vo.name}" target="_blank" title="下载查看"><i class="iconfont icon-shujudaoru blue"></i></a>
</div>
</div>
</div>
<div class="layui-col-md4" id="uploadImg{$vo.id}">{:file_card($vo,'view')}</div>
{/volist}
</div>
</td>

View File

@ -33,15 +33,7 @@
<td colspan="3" style="line-height:inherit">
<div class="layui-row">
{volist name="$detail.fileArray" id="vo"}
<div class="layui-col-md4">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title">{$vo.name}</div>
<div class="file-tool">
<a href="{$vo.filepath}" download="{$vo.name}" target="_blank" title="下载查看"><i class="iconfont icon-shujudaoru blue"></i></a>
</div>
</div>
</div>
<div class="layui-col-md4" id="uploadImg{$vo.id}">{:file_card($vo,'view')}</div>
{/volist}
</div>
</td>

View File

@ -44,15 +44,7 @@
<td colspan="3" style="line-height:inherit">
<div class="layui-row">
{volist name="$detail.fileArray" id="vo"}
<div class="layui-col-md4">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title">{$vo.name}</div>
<div class="file-tool">
<a href="{$vo.filepath}" download="{$vo.name}" target="_blank" title="下载查看"><i class="iconfont icon-shujudaoru blue"></i></a>
</div>
</div>
</div>
<div class="layui-col-md4" id="uploadImg{$vo.id}">{:file_card($vo,'view')}</div>
{/volist}
</div>
</td>

View File

@ -41,15 +41,7 @@
<td colspan="3" style="line-height:inherit">
<div class="layui-row">
{volist name="$detail.fileArray" id="vo"}
<div class="layui-col-md4">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title">{$vo.name}</div>
<div class="file-tool">
<a href="{$vo.filepath}" download="{$vo.name}" target="_blank" title="下载查看"><i class="iconfont icon-shujudaoru blue"></i></a>
</div>
</div>
</div>
<div class="layui-col-md4" id="uploadImg{$vo.id}">{:file_card($vo,'view')}</div>
{/volist}
</div>
</td>

View File

@ -57,15 +57,7 @@
<td colspan="3" style="line-height:inherit">
<div class="layui-row">
{volist name="$detail.fileArray" id="vo"}
<div class="layui-col-md4">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title">{$vo.name}</div>
<div class="file-tool">
<a href="{$vo.filepath}" download="{$vo.name}" target="_blank" title="下载查看"><i class="iconfont icon-shujudaoru blue"></i></a>
</div>
</div>
</div>
<div class="layui-col-md4" id="uploadImg{$vo.id}">{:file_card($vo,'view')}</div>
{/volist}
</div>
</td>

View File

@ -37,15 +37,7 @@
<td colspan="3" style="line-height:inherit">
<div class="layui-row">
{volist name="$detail.fileArray" id="vo"}
<div class="layui-col-md4">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title">{$vo.name}</div>
<div class="file-tool">
<a href="{$vo.filepath}" download="{$vo.name}" target="_blank" title="下载查看"><i class="iconfont icon-shujudaoru blue"></i></a>
</div>
</div>
</div>
<div class="layui-col-md4" id="uploadImg{$vo.id}">{:file_card($vo,'view')}</div>
{/volist}
</div>
</td>

View File

@ -60,22 +60,10 @@
</td>
</tr>
<tr>
<td class="layui-td-gray" style="vertical-align:top">相关附件</td>
<td colspan="3">
<div class="layui-upload" style="max-width: 800px;">
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm" id="testList">选择文件并上传</button> <span style="color:#FF5722;margin-left: 10px;">最大只能上传{:get_system_info('upload_max_filesize')}的文件,超过{:get_system_info('upload_max_filesize')}请压缩成多个文件上传。</span>
<div class="layui-upload-list" style="display:none;">
<table class="layui-table">
<thead>
<tr>
<th width="60%">文件名</th>
<th width="20%" style="text-align:center">文件大小</th>
<th width="20%" style="text-align:center">操作</th>
</tr>
</thead>
<tbody id="demoList"></tbody>
</table>
</div>
<td class="layui-td-gray"><div class="layui-input-inline">附件</div> <div class="layui-input-inline"><button type="button" class="layui-btn layui-btn-xs" id="upFile"><i class="layui-icon"></i></button></div></td>
<td colspan="3" style="line-height:inherit">
<div class="layui-row" id="fileList">
<input type="hidden" data-type="file" name="file_ids" value="">
</div>
</td>
</tr>
@ -142,34 +130,15 @@
</td>
</tr>
<tr>
<td class="layui-td-gray" style="vertical-align:top">相关附件</td>
<td colspan="3">
<div class="layui-upload" style="max-width: 800px;">
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm" id="testList">选择文件并上传</button> <span style="color:#FF5722;margin-left: 10px;">最大只能上传{:get_system_info('upload_max_filesize')}的文件,超过{:get_system_info('upload_max_filesize')}请压缩成多个文件上传。</span>
<div class="layui-upload-list" {empty name="$file_array"}style="display:none;"{/empty}>
<table class="layui-table">
<thead>
<tr>
<th width="60%">文件名</th>
<th width="20%" style="text-align:center">文件大小</th>
<th width="20%" style="text-align:center">操作</th>
</tr>
</thead>
<tbody id="demoList">
{notempty name="$file_array"}
{volist name="file_array" id="vo"}
<tr data-id="{$vo.file_id}" id="tr_{$vo.id}">
<td>{$vo.name}</td>
<td style="text-align: center;">{$vo.filesize/1048576|round=2}MB</td>
<td style="text-align: center;">
<a class="layui-btn layui-btn-xs layui-btn-danger demo-delete" data-id="{$vo.id}">删除</a>
</td>
</tr>
{/volist}
{/notempty}
</tbody>
</table>
</div>
<td class="layui-td-gray"><div class="layui-input-inline">附件</div> <div class="layui-input-inline"><button type="button" class="layui-btn layui-btn-xs" id="upFile"><i class="layui-icon"></i></button></div></td>
<td colspan="3" style="line-height:inherit">
<div class="layui-row" id="fileList">
<input type="hidden" name="file_ids" data-type="file" value="{$detail.file_ids}">
{notempty name="$file_array"}
{volist name="file_array" id="vo"}
<div class="layui-col-md4" id="uploadImg{$vo.id}">{:file_card($vo)}</div>
{/volist}
{/notempty}
</div>
</td>
</tr>
@ -186,25 +155,19 @@
<!-- 脚本 -->
{block name="script"}
<script>
const moduleInit = ['tool','formSelects','employeepicker'];
const moduleInit = ['tool','formSelects','employeepicker','oaTool'];
function gouguInit() {
var form = layui.form,tool=layui.tool, table = layui.table, employeepicker = layui.employeepicker,dtree = layui.dtree,upload = layui.upload;
var form = layui.form,tool=layui.tool, table = layui.table, employeepicker = layui.employeepicker, oaTool = layui.oaTool;
oaTool.addFile({
btn: 'upFile',
box: 'fileList'
});
//监听发送
form.on('submit(webform)', function(data){
if(data.field.uids==login_admin){
layer.msg('接收人不能是自己');
return false;
}
var file_ids = [];
var item_tr = $('#demoList').find('tr');
item_tr.each(function(index,item) {
var item_id = $(item).data('id');
if (item_id && item_id != '') {
file_ids.push(item_id);
}
});
console.log(file_ids.join(','));
data.field.file_ids = file_ids.join(',');
$.ajax({
url: "/oa/work/send",
type:'post',
@ -223,16 +186,6 @@ const moduleInit = ['tool','formSelects','employeepicker'];
//监听保存
form.on('submit(webform1)', function(data){
var file_ids = [];
var item_tr = $('#demoList').find('tr');
item_tr.each(function(index,item) {
var item_id = $(item).data('id');
if (item_id && item_id != '') {
file_ids.push(item_id);
}
});
console.log(file_ids.join(','));
data.field.file_ids = file_ids.join(',');
$.ajax({
url: "/oa/work/add",
type:'post',

View File

@ -42,25 +42,12 @@
{notempty name="$detail.file_array"}
<tr>
<td class="layui-td-gray" style="vertical-align:top">相关附件</td>
<td colspan="5">
<table class="layui-table" style="max-width: 800px;">
<thead>
<tr>
<th width="70%">文件名</th>
<th width="20%" style="text-align:center">文件大小</th>
<th width="10%" style="text-align:center">操作</th>
</tr>
</thead>
<tbody>
{volist name="detail.file_array" id="vo"}
<tr>
<td>{$vo.name}</td>
<td style="text-align: center;">{$vo.filesize/1048576|round=2}MB</td>
<td style="text-align: center;"><a class="layui-btn layui-btn-xs layui-btn-normal" href="{$vo.filepath}" target="_blank">下载</a></td>
</tr>
{/volist}
</tbody>
</table>
<td colspan="5" style="line-height:inherit">
<div class="layui-row" id="fileList">
{volist name="$detail.file_array" id="vo"}
<div class="layui-col-md4" id="uploadImg{$vo.id}">{:file_card($vo,'view')}</div>
{/volist}
</div>
</td>
</tr>
{/notempty}
@ -70,4 +57,10 @@
{/gt}
</form>
{/block}
<!-- /主体 -->
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
const moduleInit = ['tool','formSelects','employeepicker','oaTool'];
</script>
{/block}

View File

@ -337,7 +337,7 @@ class Index extends BaseController
//相关附件
$file_array = Db::name('ProjectFile')
->field('mf.id,mf.topic_id,mf.admin_id,f.name,f.filesize,f.filepath,a.name as admin_name')
->field('mf.id,mf.topic_id,mf.admin_id,f.name,f.filesize,f.filepath,f.fileext,f.create_time,f.admin_id,a.name as admin_name')
->alias('mf')
->join('File f', 'mf.file_id = f.id', 'LEFT')
->join('Admin a', 'mf.admin_id = a.id', 'LEFT')

View File

@ -117,7 +117,7 @@ class Task extends BaseController
$auth = isAuth($this->uid,'project_admin');
if (in_array($detail['project_id'], $project_ids) || in_array($this->uid, $role_uid) || in_array($this->uid, explode(",",$detail['assist_admin_ids'])) || ($auth==1&&$detail['project_id']>0)) {
$file_array = Db::name('ProjectFile')
->field('mf.id,mf.topic_id,mf.admin_id,f.name,f.filesize,f.filepath,a.name as admin_name')
->field('mf.id,mf.topic_id,mf.admin_id,f.name,f.filesize,f.filepath,f.fileext,f.create_time,f.admin_id,a.name as admin_name')
->alias('mf')
->join('File f', 'mf.file_id = f.id', 'LEFT')
->join('Admin a', 'mf.admin_id = a.id', 'LEFT')

View File

@ -59,7 +59,7 @@
}
}
, {
field: 'title', title: '文档主题', templet: function (d) {
field: 'title', title: '文档主题',minWidth:240, templet: function (d) {
var html = '<a class="side-a" data-href="/project/document/view/id/' + d.id + '">' + d.title + '</a>';
return html;
}

View File

@ -41,7 +41,7 @@
}
}
, {
field: 'name', title: '项目名称', rowspan: 2, templet: function (d) {
field: 'name', title: '项目名称',minWidth:240, rowspan: 2, templet: function (d) {
var html = '<a class="side-a" data-href="/project/index/view/id/' + d.id + '">' + d.name + '</a>';
return html;
}

View File

@ -512,7 +512,7 @@
return count;
}
const moduleInit = ['tool','oaEdit','oaSchedule','oaComment'];
const moduleInit = ['tool','oaEdit','oaSchedule','oaComment','oaTool'];
function gouguInit() {
var element = layui.element;

View File

@ -109,26 +109,13 @@
<strong>项目附件</strong>
</div>
<div class="layui-col-md6" style="text-align:right">
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm" id="fileBtn">上传附件</button>
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm" id="uploadBtn">上传附件</button>
</div>
</div>
</div>
<div class="layui-row p-2" id="fileList">
<div class="layui-row p-2" id="fileBox">
{volist name="file_array" id="vo"}
<div class="layui-col-md4">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title" title="上传人:{$vo.admin_name}">
{$vo.name}
</div>
<div class="file-tool">
<a href="{$vo.filepath}" download="{$vo.name}" data-id="{$vo.id}" target="_blank" title="大小:{$vo.filesize/1048576|round=2}MB">
<i class="iconfont icon-shujudaoru blue"></i>
</a>
<i class="btn-delete iconfont icon-shanchu red" data-id="{$vo.id}"></i>
</div>
</div>
</div>
<div class="layui-col-md4" id="fileItem{$vo.id}">{:file_card($vo)}</div>
{/volist}
{empty name="$file_array" }
<div class="layui-data-none">暂无附件</div>
@ -262,7 +249,7 @@
</div>
<script>
function overview(){
let form = layui.form,tool = layui.tool,table = layui.table, comment = layui.oaComment, edit = layui.oaEdit,upload = layui.upload;
let form = layui.form,tool = layui.tool,table = layui.table, comment = layui.oaComment, edit = layui.oaEdit,oaTool = layui.oaTool;
$('.hover-edit').hover(function () {
$(this).addClass('hover-on');
}, function () {
@ -428,49 +415,29 @@ function overview(){
}
});
upload.render({
elem: '#fileBtn'
, url: '/api/index/upload'
, accept: 'file' //普通文件
, exts: 'jpeg|jpg|png|gif|doc|docx|ppt|pptx|xls|xlsx|pdf|zip|rar|7z' //只允许上传文件
, before: function (obj) {
layer.msg('上传中...', { time: 3600000 });
}
, done: function (res, index, upload) {
oaTool.addFile({
type:1,
isSave:true,
ajaxDelete:function(file_id){
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
$('#fileItem' + file_id).remove();
}
}
tool.delete("/project/api/delete_file", {id: file_id}, callback);
},
ajaxSave:function(res){
let callback = function (e) {
layer.msg('上传成功');
setTimeout(function(){
location.reload();
},2000)
}
let postData = { 'topic_id': project_id, 'file_id': res.data.id, 'file_name': res.data.name, 'module': 'project' };
if(res.code>0){
layer.msg(res.msg);
}
else{
tool.post("/project/api/add_file", postData, callback);
}
}
, error: function (index, upload) {
layer.msg('上传失败');
tool.post("/project/api/add_file", { 'topic_id': project_id, 'file_id': res.data.id, 'file_name': res.data.name, 'module': 'project' }, callback);
}
});
$('#fileList').on('click', '.btn-delete', function () {
let id = $(this).data('id');
layer.confirm('确定要删除该附件吗?', { icon: 3, title: '提示' }, function (index) {
let callback = function (e) {
layer.closeAll();
layer.msg(e.msg);
setTimeout(function(){
location.reload();
},2000)
}
let postData = { "id": id };
tool.delete("/project/api/delete_file", postData, callback);
});
})
$('#linkBtn').on('click', function () {
comment.addLink(0, project_id, 'project', '', '');
})

View File

@ -100,12 +100,12 @@
}
, { field: 'cate_name', title: '工作类型', width: 90, align: 'center' }
,{
field: 'title', title: '任务主题', rowspan: 2, templet: function (d) {
field: 'title', title: '任务主题',minWidth:240, rowspan: 2, templet: function (d) {
var html = '<span class="layui-badge layui-bg-' + d.priority + '">' + d.priority_name + '</span> <a class="side-a" data-href="/project/task/view/id/' + d.id + '">' + d.title + '</a>';
return html;
}
}
, { field: 'project_name', title: '关联项目', width: 120 }
, { field: 'project_name', title: '关联项目', width: 200 }
, { field: 'director_name', title: '负责人', align: 'center', width: 80 }
, { field: 'assist_admin_names', title: '协作人', width: 200 }
, { field: 'plan_hours', title: '预估工时', align: 'center', width: 80 }

View File

@ -94,39 +94,11 @@
{$detail.content|raw}</div>
</div>
<div class="detail-file">
<h3 class="py-4">文件附件</h3>
<div>
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm" id="flieBtn">选择文件并上传</button>
<span
style="color:#FF5722; font-size:12px; margin-left: 8px;">上传前,请规范命名,最大只能上传{:get_system_info('upload_max_filesize')}的文件,超过请压缩成多个文件上传。</span>
<div class="layui-upload-list" {empty name="$file_array" }style="display:none;" {/empty}>
<table class="layui-table">
<thead>
<tr>
<th width="60%">文件名</th>
<th width="12%" style="text-align:center">文件大小</th>
<th width="12%" style="text-align:center">上传人</th>
<th width="15%" style="text-align:center">操作</th>
</tr>
</thead>
<tbody id="flieList">
{volist name="file_array" id="vo"}
<tr>
<td>{$vo.name}</td>
<td style="text-align: center;">{$vo.filesize/1048576|round=2}MB</td>
<td style="text-align: center;">{$vo.admin_name}</td>
<td style="text-align: center;">
<div class="layui-btn-group"><a class="layui-btn layui-btn-xs "
href="{$vo.filepath}" download="{$vo.name}" data-id="{$vo.id}">下载</a>
<span class="layui-btn layui-btn-xs layui-btn-danger file-delete"
data-uid="{$vo.admin_id}" data-id="{$vo.id}">删除</span>
</div>
</td>
</tr>
{/volist}
</tbody>
</table>
</div>
<h3 class="py-4">文件附件 <button type="button" class="layui-btn layui-btn-normal layui-btn-sm" id="uploadBtn">选择文件并上传</button></h3>
<div class="layui-row" id="fileBox">
{volist name="$file_array" id="vo"}
<div class="layui-col-md6" id="uploadImg{$vo.id}">{:file_card($vo)}</div>
{/volist}
</div>
</div>
</div>
@ -175,7 +147,7 @@
<script>
const admin_id = '{$detail.admin_id}';
const detail_id = '{$detail.id}';
const moduleInit = ['tool','employeepicker','oaEdit','oaSchedule','oaComment'];
const moduleInit = ['tool','employeepicker','oaEdit','oaSchedule','oaComment','oaTool'];
function gouguInit() {
const opsData = {
flow_status: [
@ -207,7 +179,7 @@
{ 'id': 100, 'title': '100%' }
]
}
const edit = layui.oaEdit,work = layui.oaSchedule,comment = layui.oaComment, upload = layui.upload, tool = layui.tool;
const edit = layui.oaEdit,work = layui.oaSchedule,comment = layui.oaComment, oaTool = layui.oaTool, tool = layui.tool;
$('.hover-edit').hover(function () {
$(this).addClass('hover-on');
@ -239,51 +211,29 @@
tool.delete("/project/task/delete", postData, callback);
});
})
upload.render({
elem: '#flieBtn'
, url: '/api/index/upload'
, accept: 'file' //普通文件
, exts: 'jpeg|jpg|png|gif|txt|doc|docx|ppt|pptx|xls|xlsx|pdf|zip|rar|7z' //只允许上传文件
, before: function (obj) {
layer.msg('上传中...', { time: 3600000 });
}
, done: function (res, index, upload) {
oaTool.addFile({
type:1,
isSave:true,
uidDelete:true,
colmd:6,
ajaxDelete:function(file_id){
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
$('#fileItem' + file_id).remove();
}
}
tool.delete("/project/api/delete_file", {id: file_id}, callback);
},
ajaxSave:function(res){
let callback = function (e) {
layer.msg('上传成功');
location.reload();
}
let postData = { 'topic_id': detail_id, 'file_id': res.data.id, 'file_name': res.data.name, 'module': 'task' };
if(res.code>0){
layer.msg(res.msg);
}
else{
tool.post("/project/api/add_file", postData, callback);
}
}
, error: function (index, upload) {
layer.msg('上传失败');
tool.post("/project/api/add_file", {'topic_id': detail_id, 'file_id': res.data.id, 'file_name': res.data.name, 'module': 'task' }, callback);
}
});
$('#flieList').on('click', '.file-delete', function () {
let id = $(this).data('id');
let uid = $(this).data('uid');
if (uid != login_admin) {
layer.msg('你不是该文件的上传人,无权限删除');
return false;
}
layer.confirm('确定要删除该附件吗?', { icon: 3, title: '提示' }, function (index) {
let callback = function (e) {
layer.closeAll();
layer.msg(e.msg);
location.reload();
}
let postData = { 'id': id };
tool.delete("/project/api/delete_file", postData, callback);
});
})
//工作记录相关
work.load(detail_id);
$('.add-schedule').on('click', function () {

View File

@ -276,7 +276,7 @@ div.layui-table-main::-webkit-scrollbar-thumb:active{background-color:rgba(0,0,0
.sub-menu li.sub-menu-li.active a{color:#4285F4; background-color:#F2F8FF}
.sub-menu li.sub-menu-li span.num{margin-left:4px}
.file-card {background: #fff;border: 1px solid #f1f1f1;border-radius: 2px; padding:0; margin:4px 6px;
.file-card {background: #fff;border: 1px solid #f1f1f1; border-radius: 2px; padding:0; margin:4px 6px;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
@ -284,10 +284,16 @@ div.layui-table-main::-webkit-scrollbar-thumb:active{background-color:rgba(0,0,0
display: -ms-flexbox;
display: flex;
}
.file-card .file-icon{font-size:36px; color:#646464; margin-right: 4px;}
.file-card .file-title {font-size: 12px; letter-spacing: 0; margin-right: 8px; line-height: 16px; word-break: break-all; overflow: hidden; text-overflow: ellipsis; display: -webkit-box;-webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical;width: calc(100% - 108px);}
.file-card .file-title-view{width: calc(100% - 80px);}
.file-card .file-tool .iconfont{font-size:18px; font-weight:600; padding:3px; cursor:pointer;}
.file-card .file-icon{font-size:44px; color:#646464; margin-right: 4px;}
.file-card .file-info {width: calc(100% - 110px); line-height:1.5}
.file-card.file-view .file-info{width: calc(100% - 82px);}
.file-card .file-title {font-size: 14px; word-break:keep-all; overflow: hidden; text-overflow: ellipsis; display: width: 100%;}
.file-card .file-ops{font-size:12px; color:#aaa;}
.file-card .file-tool .iconfont{font-size:20px; font-weight:600; padding:4px; display:inline-block; cursor:pointer;}
.file-card.file-view .btn-delete{display:none}
.file-hasdelete{background:url(../images/delete_icon.png) no-repeat 96% 0; background-size: auto 58px; color:#aaa}
.file-hasdelete .file-icon{color:#aaa;}
.file-hasdelete .file-tool{display:none}
.editormd,.editormd-toolbar,.editormd .CodeMirror,.CodeMirror-gutters{border-color:#eeeeee!important;}
.editormd{margin-bottom:0!important;}

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

@ -17,6 +17,20 @@ layui.define(['tool'], function (exports) {
}
};
//格式化文件大小
function renderSize(value){
if(null==value||value==''){
return "0 Bytes";
}
var unitArr = new Array("Bytes","KB","MB","GB","TB","PB","EB","ZB","YB");
var index=0;
var srcsize = parseFloat(value);
index=Math.floor(Math.log(srcsize)/Math.log(1024));
var size =srcsize/Math.pow(1024,index);
size=size.toFixed(2);//保留的小数位数
return size+unitArr[index];
}
const obj = {
addFile: function (options) {
let that = this;
@ -29,58 +43,48 @@ layui.define(['tool'], function (exports) {
exts: 'png|jpg|gif|jpeg|doc|docx|ppt|pptx|xls|xlsx|pdf|zip|rar|7z', //只允许上传文件格式
colmd:4,
isSave:false,
ajaxSave:function(val){},
ajaxDelete:function(val){}
uidDelete:false,
ajaxSave:null,
ajaxDelete:null
};
let opts = $.extend({}, settings, options);
if(opts.type==0){
//虚拟删除
$('#'+opts.box).on('click', '.btn-delete', function () {
let file_id = $(this).data('id');
let idsStr = $('#'+opts.box+'Input').val(),idsArray = [];
if (idsStr != '') {
idsArray = idsStr.split(",");
}
let box = $('#'+opts.box);
let boxInput = box.find('[data-type="file"]');
//删除
box.on('click', '.btn-delete', function () {
let file_id = $(this).data('id');
let id = $(this).data('id');
let uid = $(this).data('uid');
if (uid != login_admin && opts.uidDelete==true) {
layer.msg('你不是该文件的上传人,无权限删除');
return false;
}
let idsStr = boxInput.val(),idsArray = [];
if (typeof idsStr !== 'undefined' && idsStr != '') {
idsArray = idsStr.split(",");
idsArray.remove(file_id);
$('#'+opts.box+'Input').val(idsArray.join(','));
$('#fileItem' + file_id).remove();
})
//ajax删除
$('#'+opts.box).on('click', '.ajax-delete', function () {
let file_id = $(this).data('id');
let idsStr = $('#'+opts.box+'Input').val(),idsArray = [];
if (idsStr != '') {
idsArray = idsStr.split(",");
}
idsArray.remove(file_id);
layer.confirm('确定删除该附件吗?', {
icon: 3,
title: '提示'
}, function(index) {
if (typeof (opts.ajaxSave) == "function") {
opts.ajaxSave(idsArray.join(','));
}
layer.close(index);
});
})
}
if(opts.type==1){
//ajax删除
$('#'+opts.box).on('click', '.ajax-delete', function () {
let file_id = $(this).data('id');
layer.confirm('确定删除该附件吗?', {
icon: 3,
title: '提示'
}, function(index) {
if (typeof (opts.ajaxSave) == "function") {
}
layer.confirm('确定删除该附件吗?', {
icon: 3,
title: '提示'
}, function(index) {
if (typeof (opts.ajaxDelete) === "function") {
//ajax删除
if(opts.type==1){
opts.ajaxDelete(file_id);
}
layer.close(index);
});
})
}
else{
opts.ajaxDelete(idsArray.join(','));
}
}
else{
//虚拟删除
boxInput.val(idsArray.join(','));
$('#fileItem' + file_id).remove();
}
layer.close(index);
});
})
//多附件上传
upload.render({
@ -89,38 +93,56 @@ layui.define(['tool'], function (exports) {
accept: opts.accept,
exts: opts.exts,
multiple: true,
before: function(obj){
layer.msg('上传中...', {icon: 16, time: 0});
},
done: function(res){
layer.msg(res.msg);
if (res.code == 0) {
//上传成功
if(opts.type==0){
let idsStr = $('#'+opts.box+'Input').val(),idsArray = [];
if (idsStr != '') {
let idsStr = boxInput.val(),idsArray = [];
if (typeof idsStr !== 'undefined' && idsStr != '') {
idsArray = idsStr.split(",");
}
idsArray.push(res.data.id);
$('#'+opts.box+'Input').val(idsArray.join(','));
let filesize = renderSize(res.data.filesize);
let type_icon = 'icon-sucaiziyuan';
let view_btn = '<a class="blue" href="'+res.data.filepath+'" download="'+res.data.name+'" target="_blank" title="下载查看"><i class="iconfont icon-tuiguangshezhi"></i></a>';
if(res.data.fileext == 'pdf'){
type_icon = 'icon-lunwenguanli';
view_btn = '<span class="file-view-pdf blue" data-href="'+res.data.filepath+'" title="在线查看"><i class="iconfont icon-yuejuan"></i></span>';
}
if(res.data.fileext == 'jpg' || res.data.fileext == 'jpeg' || res.data.fileext == 'png' || res.data.fileext == 'gif'){
type_icon = 'icon-sucaiguanli';
view_btn = '<span class="file-view-img blue" data-href="'+res.data.filepath+'" title="在线查看"><i class="iconfont icon-tupianguanli"></i></span>';
}
let temp = `<div class="layui-col-md${opts.colmd}" id="fileItem${res.data.id}">
<div class="file-card">
<i class="file-icon iconfont icon-renwuguanli"></i>
<div class="file-title">${res.data.name}</div>
<div class="file-tool">
<a href="${res.data.filepath}" download="${res.data.name}" title="下载查看" target="_blank"><i class="iconfont icon-shujudaoru blue"></i></a>
<span class="btn-delete iconfont icon-shanchu red" data-id="${res.data.id}" title="删除"></span>
<i class="file-icon iconfont ${type_icon}"></i>
<div class="file-info">
<div class="file-title">${res.data.name}</div>
<div class="file-ops">${filesize}一分钟前</div>
</div>
<div class="file-tool">${view_btn}<span class="btn-delete red" data-id="${res.data.id}" title="删除"><i class="iconfont icon-shanchu"></i></span></div>
</div>
</div>`;
$('#'+opts.box).append(temp);
boxInput.val(idsArray.join(','));
box.append(temp);
if (typeof (opts.ajaxSave) == "function" && opts.isSave ==true) {
if (typeof (opts.ajaxSave) === "function" && opts.isSave ==true) {
opts.ajaxSave(idsArray.join(','));
}
else{
layer.msg(res.msg);
}
}
if(opts.type==1){
if (typeof (opts.ajaxSave) == "function" && opts.isSave ==true) {
if (typeof (opts.ajaxSave) === "function" && opts.isSave ==true) {
opts.ajaxSave(res);
}
}
}else{
layer.msg(res.msg);
}
}
});
@ -163,7 +185,7 @@ layui.define(['tool'], function (exports) {
})
},
//选择岗位
positionPicker:function(type,callback){
positionPicker:function(type,callback){
let select_type = type==1?'radio':'checkbox',positionTable;
layer.open({
title:'选择岗位',
@ -196,7 +218,43 @@ layui.define(['tool'], function (exports) {
}
}
})
},
},
//选择服务类型
servicePicker:function(type,callback){
let select_type = type==1?'radio':'checkbox',departmentTable;
var serviceTable;
layer.open({
title: '选择服务类型',
area: ['500px', '536px'],
type: 1,
content: '<div class="picker-table"><div id="serviceTable"></div></div>',
success: function () {
serviceTable = table.render({
elem: '#serviceTable'
, url: '/api/index/get_services'
,page: false
, cols: [[
{ type: select_type, title: '选择' }
, { field: 'id', width: 100, title: '编号', align: 'center' }
, { field: 'title', title: '服务名称' }
]]
});
},
btn: ['确定'],
btnAlign: 'c',
yes: function(){
var checkStatus = table.checkStatus(serviceTable.config.id);
var data = checkStatus.data;
if(data.length>0){
callback(data);
layer.closeAll();
}else{
layer.msg('请选择服务类型');
return;
}
}
})
},
//选择客户
customerPicker:function(callback){
var customeTable;
@ -251,11 +309,11 @@ layui.define(['tool'], function (exports) {
var contractTable;
layer.open({
title: '选择合同',
area: ['600px', '580px'],
area: ['720px', '580px'],
type: 1,
content: '<div class="picker-table">\
<form class="layui-form pb-2">\
<div class="layui-input-inline" style="width:480px;">\
<div class="layui-input-inline" style="width:600px;">\
<input type="text" name="keywords" placeholder="合同名称" class="layui-input" autocomplete="off" />\
</div>\
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="search_contract">提交搜索</button>\
@ -269,11 +327,12 @@ layui.define(['tool'], function (exports) {
, limit: 10
, cols: [[
{ type: 'radio', title: '选择' }
, { field: 'id', width: 100, title: '编号', align: 'center' }
, { field: 'code', width: 168, title: '合同编号', align: 'center' }
, { field: 'name', title: '合同名称' }
, { field: 'customer_name', title: '客户名称',width: 240}
]]
});
//项目搜索提交
//合同搜索提交
form.on('submit(search_contract)', function (data) {
contractTable.reload({ where: { keywords: data.field.keywords }, page: { curr: 1 } });
return false;
@ -294,9 +353,136 @@ layui.define(['tool'], function (exports) {
}
}
})
},
//选择项目
projectPicker:function(callback){
var projectTable;
let projectLayer = layer.open({
title: '选择项目',
area: ['600px', '580px'],
type: 1,
content: '<div class="picker-table">\
<form class="layui-form pb-2">\
<div class="layui-input-inline" style="width:480px;">\
<input type="text" name="keywords" placeholder="项目名称" class="layui-input" autocomplete="off" />\
</div>\
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="search_project">提交搜索</button>\
</form>\
<div id="projectTable"></div></div>',
success: function () {
projectTable = table.render({
elem: '#projectTable'
, url: '/project/api/get_project'
, page: true //开启分页
, limit: 10
, cols: [[
{ type: 'radio', title: '选择' }
, { field: 'id', width: 100, title: '编号', align: 'center' }
, { field: 'title', title: '项目名称' }
]]
});
//合同搜索提交
form.on('submit(search_project)', function (data) {
projectTable.reload({ where: { keywords: data.field.keywords }, page: { curr: 1 } });
return false;
});
},
btn: ['确定'],
btnAlign: 'c',
yes: function () {
var checkStatus = table.checkStatus(projectTable.config.id);
var data = checkStatus.data;
if (data.length > 0) {
callback(data[0]);
layer.close(projectLayer);
}
else {
layer.msg('请先选择项目');
return false;
}
}
})
},
//选择任务
taskPicker:function(project_id,callback){
var taskTable;
let taskLayer = layer.open({
title: '选择任务',
area: ['600px', '580px'],
type: 1,
content: '<div class="picker-table">\
<form class="layui-form pb-2">\
<div class="layui-input-inline" style="width:480px;">\
<input type="text" name="keywords" placeholder="任务主题" class="layui-input" autocomplete="off" />\
</div>\
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="task_project">提交搜索</button>\
</form>\
<div id="taskTable"></div></div>',
success: function () {
taskTable = table.render({
elem: '#taskTable'
, url: '/project/api/get_task'
, page: true //开启分页
, limit: 10
, where:{'project_id':project_id}
, cols: [[
{ type: 'radio', title: '选择' }
, { field: 'id', width: 100, title: '编号', align: 'center' }
, { field: 'title', title: '任务主题' }
]]
});
//合同搜索提交
form.on('submit(search_project)', function (data) {
taskTable.reload({ where: { keywords: data.field.keywords }, page: { curr: 1 } });
return false;
});
},
btn: ['确定'],
btnAlign: 'c',
yes: function () {
var checkStatus = table.checkStatus(taskTable.config.id);
var data = checkStatus.data;
if (data.length > 0) {
callback(data[0]);
layer.close(taskLayer);
}
else {
layer.msg('请先选择任务主题');
return false;
}
}
})
}
};
//查看图片文件
$('body').on('click','.file-view-img',function () {
let href = $(this).data('href');
if(href){
let photos = { "data": [{"src": href}]};
layer.photos({
photos: photos
,anim: 5 //0-6的选择指定弹出图片动画类型默认随机请注意3.0之前的版本用shift参数
});
}
});
//查看pdf文件
$('body').on('click','.file-view-pdf',function () {
let href = $(this).data('href');
if(href){
layer.open({
type: 2,
title: '查看PDF文件可以最大化看',
shadeClose: true,
shade: false,
maxmin: true, //开启最大化最小化按钮
area: ['900px', '600px'],
content: href
});
}
});
//选择部门
$('body').on('click','.picker-depament',function () {
let that = $(this);
@ -339,6 +525,28 @@ layui.define(['tool'], function (exports) {
that.next().val(ids.join(','));
}
obj.positionPicker(2,callback);
});
//选择服务
$('body').on('click','.picker-service',function () {
let that = $(this);
let callback = function(data){
that.val(data[0].title);
that.next().val(data[0].id);
}
obj.servicePicker(1,callback);
});
$('body').on('click','.picker-services',function () {
let that = $(this),ids = [],names=[];
let callback = function(data){
for ( var i = 0; i <data.length; i++){
ids.push(data[i].id);
names.push(data[i].title);
}
that.val(names.join(','));
that.next().val(ids.join(','));
}
obj.servicePicker(2,callback);
});
//选择客户
@ -349,8 +557,7 @@ layui.define(['tool'], function (exports) {
that.next().val(data.id);
}
obj.customerPicker(callback);
});
});
//选择合同
$('body').on('click','.picker-contract',function () {
@ -360,6 +567,16 @@ layui.define(['tool'], function (exports) {
that.next().val(data.id);
}
obj.contractPicker(callback);
});
//选择项目
$('body').on('click','.picker-project',function () {
let that = $(this);
let callback = function(data){
that.val(data.title);
that.next().val(data.id);
}
obj.projectPicker(callback);
});
exports('oaTool', obj);