Authored by yyq

option

... ... @@ -367,15 +367,24 @@ module.exports = class extends global.yoho.BaseModel {
newOrder.time = _.get(order, 'create_time');
newOrder.payType = _.get(order, 'payment_type');
newOrder.title = _.get(order, 'order_title');
newOrder.invoiceType = '';
let issueType = +_.get(order, 'invoice.issueType');
// 补开发票订单
if (type === 8) {
let iop = _.get(order, 'links', []);
let issueType = +_.get(order, 'invoice.issueType');
newOrder.issueType = issueType === 2;
newOrder.invoiceSupplying = issueType === 1;
newOrder.invoiceType = '';
newOrder.issueType = issueType === 2;
newOrder.invoiceOperation = _.zipObject(iop, iop);
if (newOrder.issueType) {
newOrder.invoiceType = _.get(order, 'invoice.type', 0) === 2 ? '电子发票' : '纸质发票';
if (!newOrder.invoiceOperation || (!newOrder.invoiceOperation.invoiceDetail &&
!newOrder.invoiceOperation.supplyInvoice)) {
_.set(newOrder, 'invoiceOperation.invoiceSupplying', issueType === 1);
}
if (newOrder.issueType) {
newOrder.invoiceType = _.get(order, 'invoice.type', 0) === 2 ? '电子发票' : '纸质发票';
}
}
if (order.is_cancel === 'Y' || order.status === 6) {
... ...
... ... @@ -94,15 +94,19 @@
<span class="no-pay">{{#if issueType}}已开票{{^}}未开票{{/if}}</span>
</div>
<div class="operation">
{{#if issueType}}
<span class="op-item view-invoice" data-id="{{orderNum}}">查看发票</span>
{{^}}
{{# invoiceOperation}}
{{#if invoiceDetail}}
<span class="op-item view-invoice" data-id="{{../orderNum}}">查看发票</span>
{{/if}}
{{#if invoiceSupplying}}
<span class="op-item on-invoice" data-id="{{orderNum}}">开票中</span>
{{^}}
<span class="op-item supply-invoice" data-id="{{orderNum}}">申请补开</span>
<span class="op-item on-invoice" data-id="{{../orderNum}}">开票中</span>
{{/if}}
{{#if supplyInvoice}}
<span class="op-item supply-invoice" data-id="{{../orderNum}}">申请补开</span>
{{/if}}
{{/if}}
{{/ invoiceOperation}}
</div>
</div>
</div>
... ...