205 lines
9.3 KiB
HTML
205 lines
9.3 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
|
|
<head>
|
|
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
|
|
<link href="/jscss/style.css" rel="stylesheet" type="text/css" />
|
|
<script type="text/javascript" charset="utf-8" src="/jscss/theme.js"></script>
|
|
</head>
|
|
|
|
<body>
|
|
<div class="container">
|
|
<form class="search" onsubmit="table.search(this,'btn');return false;">
|
|
<ul></ul>
|
|
<div>
|
|
<div class="sinps"></div>
|
|
<div class="sbtns">
|
|
<button class="lang btn" type="submit">查询</button>
|
|
<a class="lang btn" onclick="exportxls()">导出</a>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
<div class="table">
|
|
<div class="loading col-24">Loading...</div>
|
|
<div class="list"></div>
|
|
<div>
|
|
<div class="btmbtn">
|
|
<a class="lang btn def" onclick="ciyfn.select_all(table)">全选</a>
|
|
<a class="lang btn def" onclick="ciyfn.select_diff(table)">反选</a>
|
|
|
|
|
<a class="lang btn dag" onclick="ciyfn.select_callfunc(table, this, 'del','已选{n}条,是否批量删除?', {},function(json){table.delline(json)})">批量删除</a>
|
|
</div>
|
|
<div class="page"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script type="text/javascript" src="/jscss/ciy.js"></script>
|
|
<script type="text/javascript" src="/jscss/ciycmp.js"></script>
|
|
<script type="text/javascript" src="/jscss/ciycmp2.js"></script>
|
|
<script type="text/javascript" src="/jscss/ciytable.js"></script>
|
|
<script type="text/javascript" src="../common.js"></script>
|
|
<script type="text/javascript">
|
|
'use strict';
|
|
var table;
|
|
var Glob = {};
|
|
ciyfn.pageload(function () {
|
|
//Glob.urlp = ciyfn.urlparam();
|
|
table = new ciyclass.table({
|
|
dom: '.table'
|
|
, url: 'list'
|
|
, pagecount: 10
|
|
, chkbox: true
|
|
, fn_beforedata: function (json) {
|
|
ciyfn.fillsearch({
|
|
searchdom: '.search'
|
|
, data: json
|
|
, liall: '全部'
|
|
, lidata: '20:未审核,90:驳回,95:撤回(冲红),100:通过'
|
|
, liclick: function (dom) {
|
|
table.search(dom, 'li');
|
|
}
|
|
});
|
|
return json;
|
|
}
|
|
, fn_tdcontent: function (key, datashow, field, data) {
|
|
if (key == '_btn') {
|
|
var html = '';
|
|
if (data.auditstatus == 20)
|
|
html += `<a class="lang btn" onclick="menubtn(this, 'review')">开票</a>`;
|
|
if (data.auditstatus == 100)
|
|
html += `<a class="lang btn def" onclick="menubtn(this, 'reback')">冲红</a>`;
|
|
return html;
|
|
}
|
|
}
|
|
, fn_done: function (json) {
|
|
// table.mergecol('auditstatus');
|
|
// table.mergefix('总计', 'center', 6, 0, 8, 1);
|
|
// table.footertotal();
|
|
}
|
|
});
|
|
table.callpage(1);
|
|
});
|
|
function menubtn(dom, btn) {
|
|
var id = $5(dom).parent('tr').attr('data-id');
|
|
if (btn == 'review') {
|
|
review(id);
|
|
}
|
|
if (btn == 'reback') {
|
|
ciyfn.callfastfunc(dom, '是否冲红(作废)发票?', 'reback', { id: id }, function (json){ table.updateline(json) });
|
|
}
|
|
}
|
|
|
|
function getdata(id, act, cb) {
|
|
cb({ data: id == 0 ? {} : table.data[id] });
|
|
}
|
|
|
|
function review(id) {
|
|
getdata(id, 'review', function (jsndat) {
|
|
var dat = jsndat.data;
|
|
var html = '<div class="char4 row gridline">';
|
|
html += '<div class="ciy-form col-24 col-sm-8">';
|
|
html += '<label>所属用户</label><div>';
|
|
html += ciyfn.tdshow('vuser', dat.vuser, table.field.vuser.ext, dat, table.json, true);
|
|
html += '</div></div>';
|
|
|
|
html += '<div class="ciy-form col-24 col-sm-8">';
|
|
html += '<label>所属明细</label><div>';
|
|
html += ciyfn.tdshow('invoicedetailid', dat.invoicedetailid, table.field.invoicedetailid.ext, dat, table.json, true);
|
|
html += '</div></div>';
|
|
|
|
html += '<div class="ciy-form col-24 col-sm-8">';
|
|
html += '<label>开票金额</label><div>';
|
|
html += ciyfn.tdshow('invoicemoney', dat.invoicemoney, table.field.invoicemoney.ext, dat, table.json, true);
|
|
html += '</div></div>';
|
|
|
|
html += '<div class="ciy-form col-24 col-sm-8">';
|
|
html += '<label>申请时间</label><div>';
|
|
html += ciyfn.tdshow('addtimes', dat.addtimes, table.field.addtimes.ext, dat, table.json, true);
|
|
html += '</div></div>';
|
|
|
|
html += '<div class="ciy-form col-24 col-sm-8">';
|
|
html += '<label>名称</label><div>';
|
|
html += ciyfn.tdshow('name', dat.name, table.field.name.ext, dat, table.json, true);
|
|
html += '</div></div>';
|
|
|
|
html += '<div class="ciy-form col-24 col-sm-8">';
|
|
html += '<label>税号</label><div>';
|
|
html += ciyfn.tdshow('taxnumber', dat.taxnumber, table.field.taxnumber.ext, dat, table.json, true);
|
|
html += '</div></div>';
|
|
|
|
html += '<div class="ciy-form col-24 col-sm-12">';
|
|
html += '<label>单位地址</label><div>';
|
|
html += ciyfn.tdshow('addr', dat.addr, table.field.addr.ext, dat, table.json, true);
|
|
html += '</div></div>';
|
|
|
|
html += '<div class="ciy-form col-24 col-sm-12">';
|
|
html += '<label>电话号码</label><div>';
|
|
html += ciyfn.tdshow('phone', dat.phone, table.field.phone.ext, dat, table.json, true);
|
|
html += '</div></div>';
|
|
|
|
html += '<div class="ciy-form col-24 col-sm-12">';
|
|
html += '<label>银行名称</label><div>';
|
|
html += ciyfn.tdshow('bankname', dat.bankname, table.field.bankname.ext, dat, table.json, true);
|
|
html += '</div></div>';
|
|
|
|
html += '<div class="ciy-form col-24 col-sm-12">';
|
|
html += '<label>银行账号</label><div>';
|
|
html += ciyfn.tdshow('bankaccount', dat.bankaccount, table.field.bankaccount.ext, dat, table.json, true);
|
|
html += '</div></div>';
|
|
|
|
html += '<div class="ciy-form col-24 col-sm-24">';
|
|
html += '<label class="lang">上传发票</label><div>';
|
|
html += '<ciy-upload com="invfile" num="1" type="jpg,png,webp,pdf,ofd,zip,rar" />';
|
|
html += '</div></div>';
|
|
html += '<div class="ciy-form col-24 col-sm-24">';
|
|
html += '<label class="lang">发票编号</label><div>';
|
|
html += '<input type="text" name="invcode"/> ';
|
|
html += '</div></div>';
|
|
|
|
html += '<div class="ciy-form col-24 col-sm-24">';
|
|
html += '<label>拒绝理由</label><div>';
|
|
html += '<input type="text" name="auditmsg" style="width:100%;" />';
|
|
html += '</div></div>';
|
|
html += '</div>';
|
|
ciyfn.alert({
|
|
title: '开票/拒开'
|
|
, width: 'pc'
|
|
, autoheight: true
|
|
, content: html
|
|
, fn_showed: function (doc, dom) {
|
|
var dat = jsndat.data;
|
|
var path = ciyfn.makeuploadpath('invoice', ciyfn.getstorage(ciy_vars.tokenfield));
|
|
ciycmp({ dom: $5('[com=invfile]', dom), path: path });
|
|
}
|
|
, cb: function (opn) {
|
|
if (opn.btn == "关闭")
|
|
return opn.close();
|
|
opn.inputs.ids = id;
|
|
opn.inputs.auditstatus = opn.btn == "开票" ? 100 : 90;
|
|
if (ciyfn.throttle(opn.dombtn)) return;
|
|
ciyfn.callfunc('audit', opn.inputs, function (json) {
|
|
table.updateline(json);
|
|
opn.close();
|
|
ciyfn.toast('提交成功');
|
|
});
|
|
}
|
|
, btns: ["开票", "!拒开", "*关闭"]
|
|
});
|
|
});
|
|
}
|
|
function exportxls() {
|
|
ciyfn.table_exportxls('exportxls', table, function (json) {
|
|
ciyfn.alert({
|
|
content: '<div style="text-align:center;"><span class="lang">导出数据已生成</span><br/><br/><a class="lang btn lg" href="' + json.url + '" target="_blank">下载数据</a></div>'
|
|
, btns: null
|
|
});
|
|
});
|
|
}
|
|
|
|
</script>
|
|
</body>
|
|
|
|
</html> |