发票模块上传控件及关联合同选择体验优化
This commit is contained in:
parent
af42f6cb3b
commit
37c5326dc4
@ -78,8 +78,10 @@ class Api extends BaseController
|
|||||||
$param['check_status'] = 5;
|
$param['check_status'] = 5;
|
||||||
$param['open_admin_id'] = $this->uid;
|
$param['open_admin_id'] = $this->uid;
|
||||||
}
|
}
|
||||||
$param['open_time'] = isset($param['open_time']) ? strtotime(urldecode($param['open_time'])) : 0;
|
if(isset($param['open_time'])){
|
||||||
$res = Invoice::where('id', $param['id'])->strict(false)->field('code,check_status,open_time,open_admin_id,delivery')->update($param);
|
$param['open_time'] = strtotime(urldecode($param['open_time']));
|
||||||
|
}
|
||||||
|
$res = Invoice::where('id', $param['id'])->strict(false)->field('code,check_status,open_time,open_admin_id,delivery,other_file_ids')->update($param);
|
||||||
if ($res !== false) {
|
if ($res !== false) {
|
||||||
add_log('open', $param['id'],$param,'发票');
|
add_log('open', $param['id'],$param,'发票');
|
||||||
return to_assign();
|
return to_assign();
|
||||||
|
@ -378,6 +378,11 @@ class Invoice extends BaseController
|
|||||||
$fileArray = Db::name('File')->where('id','in',$detail['file_ids'])->select();
|
$fileArray = Db::name('File')->where('id','in',$detail['file_ids'])->select();
|
||||||
$detail['fileArray'] = $fileArray;
|
$detail['fileArray'] = $fileArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($detail['other_file_ids'] !=''){
|
||||||
|
$fileArrayOther = Db::name('File')->where('id','in',$detail['other_file_ids'])->select();
|
||||||
|
$detail['fileArrayOther'] = $fileArrayOther;
|
||||||
|
}
|
||||||
|
|
||||||
$is_check_admin = 0;
|
$is_check_admin = 0;
|
||||||
$is_create_admin = 0;
|
$is_create_admin = 0;
|
||||||
|
@ -86,7 +86,7 @@ class Invoice extends Model
|
|||||||
$detail['create_user'] = Db::name('Admin')->where(['id' => $detail['admin_id']])->value('name');
|
$detail['create_user'] = Db::name('Admin')->where(['id' => $detail['admin_id']])->value('name');
|
||||||
$detail['department'] = Db::name('Department')->where(['id' => $detail['did']])->value('title');
|
$detail['department'] = Db::name('Department')->where(['id' => $detail['did']])->value('title');
|
||||||
if ($detail['open_time'] > 0) {
|
if ($detail['open_time'] > 0) {
|
||||||
$detail['open_time'] = empty($detail['open_time']) ? '0' : date('Y-m-d H:i', $detail['open_time']);
|
$detail['open_time'] = empty($detail['open_time']) ? '0' : date('Y-m-d', $detail['open_time']);
|
||||||
$detail['open_admin'] = Db::name('Admin')->where(['id' => $detail['open_admin_id']])->value('name');
|
$detail['open_admin'] = Db::name('Admin')->where(['id' => $detail['open_admin_id']])->value('name');
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
@ -66,24 +66,29 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td class="layui-td-gray">关联合同</td>
|
<td class="layui-td-gray">关联合同</td>
|
||||||
<td colspan="5">
|
<td colspan="5">
|
||||||
<input type="text" class="layui-input contract-picker" name="contract_name" placeholder="请选择需要关联的合同" readonly value="">
|
<input type="text" class="layui-input picker-contract" name="contract_name" placeholder="请选择需要关联的合同" readonly value="">
|
||||||
<input type="hidden" class="layui-input" name="contract_id" value="0">
|
<input type="hidden" class="layui-input" name="contract_id" value="0">
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{/gt}
|
{/gt}
|
||||||
|
<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" id="fileBoxInput" name="file_ids" value="">
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="layui-td-gray">备注信息</td>
|
<td class="layui-td-gray">备注信息</td>
|
||||||
<td colspan="5"><textarea name="remark" placeholder="请输入备注信息" class="layui-textarea"></textarea></td>
|
<td colspan="5"><textarea name="remark" placeholder="请输入备注信息" class="layui-textarea"></textarea></td>
|
||||||
</tr>
|
</tr>
|
||||||
<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">
|
|
||||||
<div class="layui-row" id="fileList">
|
|
||||||
<input type="hidden" name="file_ids" value="">
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="layui-td-gray">审批流程<font>*</font></td>
|
<td class="layui-td-gray">审批流程<font>*</font></td>
|
||||||
<td colspan="5">
|
<td colspan="5">
|
||||||
<select name="flow_id" lay-verify="required" lay-filter="flowtype" lay-reqText="请选择审批流程">
|
<select name="flow_id" lay-verify="required" lay-filter="flowtype" lay-reqText="请选择审批流程">
|
||||||
@ -162,23 +167,24 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td class="layui-td-gray">关联合同</td>
|
<td class="layui-td-gray">关联合同</td>
|
||||||
<td colspan="5">
|
<td colspan="5">
|
||||||
<input type="text" class="layui-input contract-picker" name="contract_name" placeholder="请选择需要关联的合同" readonly value="{$detail.contract_name}">
|
<input type="text" class="layui-input picker-contract" name="contract_name" placeholder="请选择需要关联的合同" readonly value="{$detail.contract_name}">
|
||||||
<input type="hidden" class="layui-input" name="contract_id" value="{$detail.contract_id}">
|
<input type="hidden" class="layui-input" name="contract_id" value="{$detail.contract_id}">
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{/gt}
|
{/gt}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="layui-td-gray">备注信息</td>
|
<td class="layui-td-gray">
|
||||||
<td colspan="5"><textarea name="remark" placeholder="请输入备注信息" class="layui-textarea">{$detail.remark}</textarea></td>
|
<div class="layui-input-inline">关联附件</div>
|
||||||
</tr>
|
<div class="layui-input-inline">
|
||||||
<tr>
|
<button type="button" class="layui-btn layui-btn-xs" id="uploadBtn"><i class="layui-icon"></i></button>
|
||||||
<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>
|
</div>
|
||||||
|
</td>
|
||||||
<td colspan="5" style="line-height:inherit">
|
<td colspan="5" style="line-height:inherit">
|
||||||
<div class="layui-row" id="fileList">
|
<div class="layui-row" id="fileBox">
|
||||||
<input type="hidden" name="file_ids" value="{$detail.file_ids}">
|
<input type="hidden" id="fileBoxInput" name="file_ids" value="{$detail.file_ids}">
|
||||||
{notempty name="$detail.file_ids"}
|
{notempty name="$detail.file_ids"}
|
||||||
{volist name="$detail.fileArray" id="vo"}
|
{volist name="$detail.fileArray" id="vo"}
|
||||||
<div class="layui-col-md4" id="uploadImg{$vo.id}">
|
<div class="layui-col-md4" id="fileItem{$vo.id}">
|
||||||
<div class="file-card">
|
<div class="file-card">
|
||||||
<i class="file-icon iconfont icon-renwuguanli"></i>
|
<i class="file-icon iconfont icon-renwuguanli"></i>
|
||||||
<div class="file-title">{$vo.name}</div>
|
<div class="file-title">{$vo.name}</div>
|
||||||
@ -193,6 +199,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="layui-td-gray">备注信息</td>
|
||||||
|
<td colspan="5"><textarea name="remark" placeholder="请输入备注信息" class="layui-textarea">{$detail.remark}</textarea></td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="layui-td-gray">审批流程<font>*</font></td>
|
<td class="layui-td-gray">审批流程<font>*</font></td>
|
||||||
<td colspan="5">
|
<td colspan="5">
|
||||||
@ -231,26 +241,9 @@
|
|||||||
<!-- 脚本 -->
|
<!-- 脚本 -->
|
||||||
{block name="script"}
|
{block name="script"}
|
||||||
<script>
|
<script>
|
||||||
// 查找指定的元素在数组中的位置
|
const moduleInit = ['tool','employeepicker','oaTool'];
|
||||||
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'];
|
|
||||||
function gouguInit() {
|
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;
|
||||||
|
|
||||||
//选择抬头类型
|
//选择抬头类型
|
||||||
form.on('radio(type)', function (data) {
|
form.on('radio(type)', function (data) {
|
||||||
@ -262,60 +255,8 @@ function gouguInit() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//选择关联合同
|
//相关附件上传
|
||||||
$('.contract-picker').on('click', function () {
|
oaTool.addFile();
|
||||||
contractProject();
|
|
||||||
});
|
|
||||||
var contractTable;
|
|
||||||
function contractProject() {
|
|
||||||
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="contractTable"></div></div>',
|
|
||||||
success: function () {
|
|
||||||
contractTable = table.render({
|
|
||||||
elem: '#contractTable'
|
|
||||||
, url: '/contract/api/get_contract'
|
|
||||||
, page: true //开启分页
|
|
||||||
, limit: 10
|
|
||||||
, cols: [[
|
|
||||||
{ type: 'radio', title: '选择' }
|
|
||||||
, { field: 'id', width: 100, title: '编号', align: 'center' }
|
|
||||||
, { field: 'name', title: '合同名称' }
|
|
||||||
]]
|
|
||||||
});
|
|
||||||
//项目搜索提交
|
|
||||||
form.on('submit(search_form)', function (data) {
|
|
||||||
contractTable.reload({ where: { keywords: data.field.keywords }, page: { curr: 1 } });
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
btn: ['确定'],
|
|
||||||
btnAlign: 'c',
|
|
||||||
yes: function () {
|
|
||||||
var checkStatus = table.checkStatus(contractTable.config.id);
|
|
||||||
var data = checkStatus.data;
|
|
||||||
if (data.length > 0) {
|
|
||||||
$('[name="contract_name"]').val(data[0].name);
|
|
||||||
$('[name="contract_id"]').val(data[0].id);
|
|
||||||
layer.closeAll();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
layer.msg('请先选择合同');
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//监听提交
|
//监听提交
|
||||||
form.on('submit(webform)', function(data){
|
form.on('submit(webform)', function(data){
|
||||||
@ -404,49 +345,6 @@ function gouguInit() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$('#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>
|
</script>
|
||||||
{/block}
|
{/block}
|
||||||
|
@ -115,7 +115,7 @@
|
|||||||
{/notempty}
|
{/notempty}
|
||||||
{notempty name="$detail.file_ids"}
|
{notempty name="$detail.file_ids"}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="layui-td-gray">相关附件</td>
|
<td class="layui-td-gray">关联附件</td>
|
||||||
<td colspan="5" style="line-height:inherit">
|
<td colspan="5" style="line-height:inherit">
|
||||||
<div class="layui-row">
|
<div class="layui-row">
|
||||||
{volist name="$detail.fileArray" id="vo"}
|
{volist name="$detail.fileArray" id="vo"}
|
||||||
@ -220,6 +220,33 @@
|
|||||||
<td class="layui-td-gray">物流单号</td>
|
<td class="layui-td-gray">物流单号</td>
|
||||||
<td colspan="5">{$detail.delivery}</td>
|
<td colspan="5">{$detail.delivery}</td>
|
||||||
</tr>
|
</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="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" id="fileBoxInput" 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>
|
||||||
|
{/volist}
|
||||||
|
{/notempty}
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
{/if}
|
{/if}
|
||||||
</table>
|
</table>
|
||||||
<input type="hidden" name="id" value="{$detail.id}">
|
<input type="hidden" name="id" value="{$detail.id}">
|
||||||
@ -250,9 +277,26 @@
|
|||||||
<!-- 脚本 -->
|
<!-- 脚本 -->
|
||||||
{block name="script"}
|
{block name="script"}
|
||||||
<script>
|
<script>
|
||||||
const moduleInit = ['tool','employeepicker'];
|
const moduleInit = ['tool','employeepicker','oaTool'];
|
||||||
function gouguInit() {
|
function gouguInit() {
|
||||||
var form = layui.form,tool=layui.tool, employeepicker = layui.employeepicker,dropdown = layui.dropdown;
|
var form = layui.form,tool=layui.tool, oaTool = layui.oaTool,dropdown = layui.dropdown;
|
||||||
|
|
||||||
|
oaTool.addFile({
|
||||||
|
isSave: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();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
//获取审核信息
|
//获取审核信息
|
||||||
$.ajax({
|
$.ajax({
|
||||||
|
@ -37,6 +37,12 @@ CREATE TABLE `oa_admin` (
|
|||||||
`did` int(11) NOT NULL DEFAULT 0 COMMENT '部门id',
|
`did` int(11) NOT NULL DEFAULT 0 COMMENT '部门id',
|
||||||
`position_id` int(11) NOT NULL DEFAULT 0 COMMENT '职位id',
|
`position_id` int(11) NOT NULL DEFAULT 0 COMMENT '职位id',
|
||||||
`type` int(1) NOT NULL DEFAULT 0 COMMENT '员工类型:0未设置,1正式,2试用,3实习',
|
`type` int(1) NOT NULL DEFAULT 0 COMMENT '员工类型:0未设置,1正式,2试用,3实习',
|
||||||
|
`age` int(3) NOT NULL DEFAULT 0 COMMENT '年龄';
|
||||||
|
`native_place` varchar(255) NOT NULL DEFAULT '' COMMENT '籍贯';
|
||||||
|
`idcard` varchar(255) NOT NULL DEFAULT '' COMMENT '身份证';
|
||||||
|
`education` varchar(255) NOT NULL DEFAULT '' COMMENT '学历';
|
||||||
|
`bank_account` varchar(255) NOT NULL DEFAULT '' COMMENT '银行账号';
|
||||||
|
`bank_info` varchar(255) NOT NULL DEFAULT '' COMMENT '银行卡信息';
|
||||||
`desc` text NULL COMMENT '员工个人简介',
|
`desc` text NULL COMMENT '员工个人简介',
|
||||||
`entry_time` int(11) NOT NULL DEFAULT 0 COMMENT '员工入职日期',
|
`entry_time` int(11) NOT NULL DEFAULT 0 COMMENT '员工入职日期',
|
||||||
`create_time` int(11) NOT NULL DEFAULT 0 COMMENT '注册时间',
|
`create_time` int(11) NOT NULL DEFAULT 0 COMMENT '注册时间',
|
||||||
@ -45,7 +51,7 @@ CREATE TABLE `oa_admin` (
|
|||||||
`login_num` int(11) NOT NULL DEFAULT 0 COMMENT '登录次数',
|
`login_num` int(11) NOT NULL DEFAULT 0 COMMENT '登录次数',
|
||||||
`last_login_ip` varchar(64) NOT NULL DEFAULT '' COMMENT '最后登录IP',
|
`last_login_ip` varchar(64) NOT NULL DEFAULT '' COMMENT '最后登录IP',
|
||||||
`is_lock` int(1) NOT NULL DEFAULT 0 COMMENT '是否锁屏:1是0否',
|
`is_lock` int(1) NOT NULL DEFAULT 0 COMMENT '是否锁屏:1是0否',
|
||||||
`status` int(1) NOT NULL DEFAULT 1 COMMENT '状态:-1删除,0禁止登录,1正常,2离职',
|
`status` int(1) NOT NULL DEFAULT 1 COMMENT '状态:-1删除,0禁止登录,1正常,2离职',
|
||||||
PRIMARY KEY (`id`) USING BTREE,
|
PRIMARY KEY (`id`) USING BTREE,
|
||||||
UNIQUE INDEX `id`(`id`) USING BTREE
|
UNIQUE INDEX `id`(`id`) USING BTREE
|
||||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '员工表';
|
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '员工表';
|
||||||
@ -862,9 +868,9 @@ DROP TABLE IF EXISTS `oa_invoice`;
|
|||||||
CREATE TABLE `oa_invoice` (
|
CREATE TABLE `oa_invoice` (
|
||||||
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
|
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
`code` varchar(100) NOT NULL DEFAULT '' COMMENT '发票号码',
|
`code` varchar(100) NOT NULL DEFAULT '' COMMENT '发票号码',
|
||||||
`customer_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '关联客户ID,预设数据',
|
`customer_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '关联客户ID',
|
||||||
`contract_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '预定字段:关联合同协议ID',
|
`contract_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '关联合同协议ID',
|
||||||
`project_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '预定字段:关联项目ID',
|
`project_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '关联项目ID',
|
||||||
`cash_type` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '付款方式:1现金 2转账 3微信支付 4支付宝 5信用卡 6支票 7其他',
|
`cash_type` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '付款方式:1现金 2转账 3微信支付 4支付宝 5信用卡 6支票 7其他',
|
||||||
`is_cash` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '是否到账:0未到账 1部分到账 2全部到账',
|
`is_cash` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '是否到账:0未到账 1部分到账 2全部到账',
|
||||||
`amount` decimal(15, 2) NULL DEFAULT 0.00 COMMENT '发票金额',
|
`amount` decimal(15, 2) NULL DEFAULT 0.00 COMMENT '发票金额',
|
||||||
@ -891,6 +897,7 @@ CREATE TABLE `oa_invoice` (
|
|||||||
`flow_admin_ids` varchar(500) NOT NULL DEFAULT '' COMMENT '历史审批人ID,如:1,2,3',
|
`flow_admin_ids` varchar(500) NOT NULL DEFAULT '' COMMENT '历史审批人ID,如:1,2,3',
|
||||||
`copy_uids` varchar(500) NOT NULL DEFAULT '' COMMENT '抄送人ID,如:1,2,3',
|
`copy_uids` varchar(500) NOT NULL DEFAULT '' COMMENT '抄送人ID,如:1,2,3',
|
||||||
`file_ids` varchar(500) NOT NULL DEFAULT '' COMMENT '附件ID,如:1,2,3',
|
`file_ids` varchar(500) NOT NULL DEFAULT '' COMMENT '附件ID,如:1,2,3',
|
||||||
|
`other_file_ids` varchar(500) NOT NULL DEFAULT '' COMMENT '其他附件ID,如:1,2,3',
|
||||||
`check_status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '状态 0待审核,1审核中,2审核通过,3审核不通过,4已撤销,5已开具,10已作废',
|
`check_status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '状态 0待审核,1审核中,2审核通过,3审核不通过,4已撤销,5已开具,10已作废',
|
||||||
`last_admin_id` varchar(200) NOT NULL DEFAULT '0' COMMENT '上一审批人',
|
`last_admin_id` varchar(200) NOT NULL DEFAULT '0' COMMENT '上一审批人',
|
||||||
`check_remark` text NULL COMMENT '撤销的理由',
|
`check_remark` text NULL COMMENT '撤销的理由',
|
||||||
|
163
public/static/assets/gougu/module/oaTool.js
Normal file
163
public/static/assets/gougu/module/oaTool.js
Normal file
@ -0,0 +1,163 @@
|
|||||||
|
layui.define(['tool'], function (exports) {
|
||||||
|
const layer = layui.layer, tool = layui.tool,form=layui.form, table=layui.table, upload = layui.upload;
|
||||||
|
// 查找指定的元素在数组中的位置
|
||||||
|
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 obj = {
|
||||||
|
addFile: function (options) {
|
||||||
|
let that = this;
|
||||||
|
let settings = {
|
||||||
|
btn: 'uploadBtn',
|
||||||
|
box: 'fileBox',
|
||||||
|
url: "/api/index/upload",
|
||||||
|
accept: 'file', //普通文件
|
||||||
|
exts: 'png|jpg|gif|jpeg|doc|docx|ppt|pptx|xls|xlsx|pdf|zip|rar|7z', //只允许上传文件格式
|
||||||
|
colmd:4,
|
||||||
|
isSave:false,
|
||||||
|
ajaxSave:function(val){}
|
||||||
|
};
|
||||||
|
let opts = $.extend({}, settings, options);
|
||||||
|
|
||||||
|
//虚拟删除
|
||||||
|
$('#'+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(",");
|
||||||
|
}
|
||||||
|
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);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
|
||||||
|
//多附件上传
|
||||||
|
upload.render({
|
||||||
|
elem: '#'+opts.btn,
|
||||||
|
url: opts.url,
|
||||||
|
accept: opts.accept,
|
||||||
|
exts: opts.exts,
|
||||||
|
multiple: true,
|
||||||
|
done: function(res){
|
||||||
|
layer.msg(res.msg);
|
||||||
|
if (res.code == 0) {
|
||||||
|
//上传成功
|
||||||
|
let idsStr = $('#'+opts.box+'Input').val(),idsArray = [];
|
||||||
|
if (idsStr != '') {
|
||||||
|
idsArray = idsStr.split(",");
|
||||||
|
}
|
||||||
|
idsArray.push(res.data.id);
|
||||||
|
$('#'+opts.box+'Input').val(idsArray.join(','));
|
||||||
|
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>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>`;
|
||||||
|
$('#'+opts.box).append(temp);
|
||||||
|
|
||||||
|
if (typeof (opts.ajaxSave) == "function" && opts.isSave ==true) {
|
||||||
|
opts.ajaxSave(idsArray.join(','));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
contractPicker:function(callback){
|
||||||
|
var contractTable;
|
||||||
|
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="contractTable"></div></div>',
|
||||||
|
success: function () {
|
||||||
|
contractTable = table.render({
|
||||||
|
elem: '#contractTable'
|
||||||
|
, url: '/contract/api/get_contract'
|
||||||
|
, page: true //开启分页
|
||||||
|
, limit: 10
|
||||||
|
, cols: [[
|
||||||
|
{ type: 'radio', title: '选择' }
|
||||||
|
, { field: 'id', width: 100, title: '编号', align: 'center' }
|
||||||
|
, { field: 'name', title: '合同名称' }
|
||||||
|
]]
|
||||||
|
});
|
||||||
|
//项目搜索提交
|
||||||
|
form.on('submit(search_form)', function (data) {
|
||||||
|
contractTable.reload({ where: { keywords: data.field.keywords }, page: { curr: 1 } });
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
btn: ['确定'],
|
||||||
|
btnAlign: 'c',
|
||||||
|
yes: function () {
|
||||||
|
var checkStatus = table.checkStatus(contractTable.config.id);
|
||||||
|
var data = checkStatus.data;
|
||||||
|
if (data.length > 0) {
|
||||||
|
callback(data[0]);
|
||||||
|
layer.closeAll();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
layer.msg('请先选择合同');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
//选择合同
|
||||||
|
$('body').on('click','.picker-contract',function () {
|
||||||
|
let that = $(this);
|
||||||
|
let callback = function(data){
|
||||||
|
that.val(data[0].name);
|
||||||
|
that.next.val(data[0].id);
|
||||||
|
}
|
||||||
|
obj.contractPicker(callback);
|
||||||
|
});
|
||||||
|
|
||||||
|
exports('oaTool', obj);
|
||||||
|
});
|
Loading…
x
Reference in New Issue
Block a user