增加开票信息复制
This commit is contained in:
parent
1cf29cf091
commit
92e272664c
@ -53,7 +53,7 @@
|
||||
<textarea name="recharge" readonly style="max-height:40px;" id="recharge" placeholder="" class="layui-textarea"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<blockquote class="layui-elem-quote">发票信息</blockquote>
|
||||
<blockquote class="layui-elem-quote" id="copyTextClick" data-clipboard-action="copy" title="点此复制开票信息到剪切板" style="cursor:pointer">发票信息</blockquote>
|
||||
<div class="layui-row ">
|
||||
<div class="layui-col-md4">
|
||||
<div class="layui-form-item">
|
||||
@ -228,9 +228,11 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button id="copyText" style="opacity:0;"/>
|
||||
<script src="assets/js/vendor/wangEditor/wangEditor.min.js"></script>
|
||||
<script src="assets/js/vendor/ckplayer/ckplayer/ckplayer.js"></script>
|
||||
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
|
||||
<script src="assets/js/vendor/safety/copy/clipboard.min.js"></script>
|
||||
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||
<script>
|
||||
layui.config({
|
||||
@ -248,6 +250,34 @@
|
||||
var wangEditorObj = {};
|
||||
var viewerObj = {};
|
||||
|
||||
$("#copyTextClick").click(function (data) {
|
||||
|
||||
var clipboard = new Clipboard('#copyText', {
|
||||
text: function(trigger) {
|
||||
var textData = "公司名称 : " + $("#invoiceName").val();
|
||||
textData = textData + "\r\n" + "公司税号 : " + $("#invoiceNumber").val();
|
||||
textData = textData + "\r\n" + "发票类型 : " + $('input[name="invoiceClassify"]:checked').val();
|
||||
textData = textData + "\r\n" + "公司地址 : " + $("#invoiceOrgaddress").val();
|
||||
textData = textData + "\r\n" + "联系电话 : " + $("#invoiceOrgtel").val();
|
||||
textData = textData + "\r\n" + "开票内容 : " + $('input[name="invoicePurpose"]:checked').val();
|
||||
textData = textData + "\r\n" + "开户银行 : " + $("#invoiceBank").val();
|
||||
textData = textData + "\r\n" + "开户行账号 : " + $("#invoiceBanknumber").val();
|
||||
textData = textData + "\r\n" + "开票税率 : " + $('input[name="invoiceTaxrate"]:checked').val();
|
||||
textData = textData + "\r\n" + "发票金额 : " + $("#invoiceRechargeMoney").val() + "元";
|
||||
return textData;
|
||||
}
|
||||
});
|
||||
clipboard.on('success', function(e) {
|
||||
layer.msg("开票信息已复制到剪切板")
|
||||
e.clearSelection();
|
||||
});
|
||||
clipboard.on('error', function(e) {
|
||||
layer.msg("开票信息复制失败");
|
||||
});
|
||||
$("#copyText").click();
|
||||
});
|
||||
|
||||
|
||||
function initInvoicePurposeSelect(value) {
|
||||
top.restAjax.get(top.restAjax.path('[[${CopyrightUrl}]]app/data/listbyparentidrelease/e0251d55-cd52-4f57-be92-b2bef8a6dd62', []), {}, null, function(code, data, args) {
|
||||
laytpl(document.getElementById('invoicePurposeSelectTemplate').innerHTML).render(data, function(html) {
|
||||
|
Loading…
Reference in New Issue
Block a user