|  |  |  | 
|---|
|  |  |  | <div class="layui-input-inline"> | 
|---|
|  |  |  | <select name="state"> | 
|---|
|  |  |  | <option value="">请选择</option> | 
|---|
|  |  |  | <option value="0">未开票</option> | 
|---|
|  |  |  | <option value="1">开票中</option> | 
|---|
|  |  |  | <option value="0">待申请</option> | 
|---|
|  |  |  | <option value="1">待开票</option> | 
|---|
|  |  |  | <option value="2">已开票</option> | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="layui-btn layui-btn-sm layui-btn-primary febs-button-green-plain table-action" id="reset"> | 
|---|
|  |  |  | <i class="layui-icon"></i> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="layui-col-md10"> | 
|---|
|  |  |  | <label class="layui-form-label layui-form-label-sm">注意:</label> | 
|---|
|  |  |  | <div class="layui-inline"> | 
|---|
|  |  |  | <div class="layui-form-mid layui-word-aux"> | 
|---|
|  |  |  | <span style="color:red;">订单状态【已完成】,才能开具发票。</span> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="layui-form-mid layui-word-aux"> | 
|---|
|  |  |  | <span style="color:red;">开具发票之前,请先点击【更新抬头】按钮,确保用户提供了抬头信息。</span> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | 
|---|
|  |  |  | // 表格初始化 | 
|---|
|  |  |  | initInvoiceTable(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | upload.render({ | 
|---|
|  |  |  | elem: '#importDeliver' | 
|---|
|  |  |  | ,url: 'admin/order/importDeliver' //此处配置你自己的上传接口即可 | 
|---|
|  |  |  | ,accept: 'file' //普通文件 | 
|---|
|  |  |  | ,done: function(res){ | 
|---|
|  |  |  | console.log("123"); | 
|---|
|  |  |  | febs.alert.success('操作成功'); | 
|---|
|  |  |  | $query.click(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 初始化表格操作栏各个按钮功能 | 
|---|
|  |  |  | table.on('tool(invoiceTable)', function (obj) { | 
|---|
|  |  |  | var data = obj.data, | 
|---|
|  |  |  | layEvent = obj.event; | 
|---|
|  |  |  | if (layEvent === 'deliverGoods') { | 
|---|
|  |  |  | febs.modal.open('发货', 'modules/order/deliverGoods/' + data.id, { | 
|---|
|  |  |  | btn: ['确认','取消'], | 
|---|
|  |  |  | yes: function (index, layero) { | 
|---|
|  |  |  | $('#deliver-update').find('#submit').trigger('click'); | 
|---|
|  |  |  | // $query.click(); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | btn2: function () { | 
|---|
|  |  |  | layer.closeAll(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (layEvent === 'seeInvoiceDetail') { | 
|---|
|  |  |  | febs.modal.open('开票信息', 'modules/order/invoiceDetail/'+ data.id, { | 
|---|
|  |  |  | area:['100%','100%'], | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (layEvent === 'updateDeliver') { | 
|---|
|  |  |  | febs.modal.open('修改物流信息', 'modules/order/deliverGoods/' + data.id, { | 
|---|
|  |  |  | btn: ['确认','取消'], | 
|---|
|  |  |  | yes: function (index, layero) { | 
|---|
|  |  |  | $('#deliver-update').find('#deliverInfoSubmit').trigger('click'); | 
|---|
|  |  |  | // $query.click(); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | btn2: function () { | 
|---|
|  |  |  | layer.closeAll(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (layEvent === 'seeOrder') { | 
|---|
|  |  |  | febs.modal.open( '订单详情', 'modules/order/orderDetail/' + data.id, { | 
|---|
|  |  |  | maxmin: true, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (layEvent === 'cancelOrder') { | 
|---|
|  |  |  | febs.modal.confirm('取消订单', '确认取消订单?', function () { | 
|---|
|  |  |  | cancelOrder(data.id); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (layEvent === 'seePayImage') { | 
|---|
|  |  |  | var t = $view.find('#seePayImage'+data.id+''); | 
|---|
|  |  |  | //页面层 | 
|---|
|  |  |  | layer.open({ | 
|---|
|  |  |  | type: 1, | 
|---|
|  |  |  | title: "支付凭证", | 
|---|
|  |  |  | skin: 'layui-layer-rim', //加上边框 | 
|---|
|  |  |  | area: ['80%', '80%'], //宽高 | 
|---|
|  |  |  | shadeClose: true, //开启遮罩关闭 | 
|---|
|  |  |  | end: function (index, layero) { | 
|---|
|  |  |  | return false; | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | content: '<div style="text-align:center"><img src="' + $(t).attr('src') + '" /></div>' | 
|---|
|  |  |  | if (layEvent === 'updateInvoiceDetail') { | 
|---|
|  |  |  | febs.modal.confirm('更新', '是否更新用户的抬头信息?', function () { | 
|---|
|  |  |  | updateInvoiceDetail(data.id); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | function cancelOrder(id) { | 
|---|
|  |  |  | febs.get(ctx + 'admin/order/cancelOrder/' + id, null, function () { | 
|---|
|  |  |  | function updateInvoiceDetail(id) { | 
|---|
|  |  |  | febs.get(ctx + 'admin/order/updateInvoiceDetail/' + id, null, function () { | 
|---|
|  |  |  | febs.alert.success('操作成功'); | 
|---|
|  |  |  | $query.click(); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | 
|---|
|  |  |  | templet: function (d) { | 
|---|
|  |  |  | if (d.type === 'INDIVIDUAL') { | 
|---|
|  |  |  | return '<span style="color:red;">个人</span>' | 
|---|
|  |  |  | } else if (d.status === 'ORGANIZATION') { | 
|---|
|  |  |  | } else if (d.type === 'ORGANIZATION') { | 
|---|
|  |  |  | return '<span style="color:green;">单位</span>' | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | return '' | 
|---|
|  |  |  | 
|---|
|  |  |  | }, minWidth: 100,align:'center'}, | 
|---|
|  |  |  | {title: '操作', | 
|---|
|  |  |  | templet: function (d) { | 
|---|
|  |  |  | if(d.status === 2){ | 
|---|
|  |  |  | return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="seeOrder" shiro:hasPermission="user:update">详情</button>' | 
|---|
|  |  |  | +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="deliverGoods" shiro:hasPermission="user:update">发货</button>' | 
|---|
|  |  |  | }else if(d.status === 3){ | 
|---|
|  |  |  | return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="seeOrder" shiro:hasPermission="user:update">详情</button>' | 
|---|
|  |  |  | +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="updateDeliver" shiro:hasPermission="user:update">修改物流信息</button>' | 
|---|
|  |  |  | if(d.status === 4){ | 
|---|
|  |  |  | return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="seeInvoiceDetail" shiro:hasPermission="user:update">开票信息</button>' + | 
|---|
|  |  |  | '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="updateInvoiceDetail" shiro:hasPermission="user:update">更新抬头</button>' | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="seeOrder" shiro:hasPermission="user:update">详情</button>' | 
|---|
|  |  |  | return '' | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | },minWidth: 200,align:'center', fixed:'right'} | 
|---|
|  |  |  | },minWidth: 300,align:'center', fixed:'right'} | 
|---|
|  |  |  | ]] | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|