...
|
...
|
@@ -36,7 +36,7 @@ |
|
|
</template>
|
|
|
</Form>
|
|
|
<div slot="footer" class="modal-footer">
|
|
|
<span v-if="formItem.status !== UNOPEN"><i>*</i>在第三方开票系统冲红或作废后更新保存发票信息</span>
|
|
|
<span v-if="formItem.status !== UNOPEN"><i>*</i> 在第三方开票系统冲红或作废后更新保存发票信息</span>
|
|
|
<Button type="primary" :loading="inLoading" @click="update">保存</Button>
|
|
|
<Button @click="close">关闭</Button>
|
|
|
</div>
|
...
|
...
|
@@ -144,6 +144,10 @@ export default { |
|
|
logisticsSwitch: this.LOGISTICS_YES,
|
|
|
...invoice,
|
|
|
};
|
|
|
// transfer CANCELLED state to invoice type
|
|
|
if (this.formItem.status === InvoiceStatusName2Id.CANCELLED) {
|
|
|
this.formItem.type = InvoiceStatusName2Id.CANCELLED;
|
|
|
}
|
|
|
this.visible = true;
|
|
|
},
|
|
|
/**
|
...
|
...
|
@@ -180,7 +184,7 @@ export default { |
|
|
const isCancled = invoice.status === InvoiceStatusName2Id.CANCELLED;
|
|
|
|
|
|
if (isCancled) {
|
|
|
if (currentStatus === isCancled) {
|
|
|
if (currentStatus === InvoiceStatusName2Id.CANCELLED) {
|
|
|
return false;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -216,16 +220,38 @@ export default { |
|
|
|
|
|
return true;
|
|
|
},
|
|
|
update() {
|
|
|
const params = { ...this.formItem };
|
|
|
validate(callback) {
|
|
|
if (this.$refs.modal.fields.length !== 0) {
|
|
|
return this.$refs.modal.validate(callback);
|
|
|
}
|
|
|
|
|
|
return callback(true);
|
|
|
},
|
|
|
update() {
|
|
|
// validate
|
|
|
this.$refs.modal.validate(valid => {
|
|
|
this.validate(valid => {
|
|
|
if (valid) {
|
|
|
// only whitelist
|
|
|
const params = _.pick(this.formItem, [
|
|
|
'shopId',
|
|
|
'orderCode',
|
|
|
'status',
|
|
|
'step',
|
|
|
// issueDate
|
|
|
'pdfUrl',
|
|
|
'type',
|
|
|
'logisticsId',
|
|
|
// logisticsCompanyName
|
|
|
'expressNumber',
|
|
|
'logisticsSwitch',
|
|
|
]);
|
|
|
|
|
|
// clean data?
|
|
|
if (!this.updateState(params)) {
|
|
|
this.close(true);
|
|
|
this.close();
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
this.inLoading = true;
|
|
|
this.invoiceAPI
|
|
|
.update(params)
|
...
|
...
|
@@ -241,13 +267,8 @@ export default { |
|
|
});
|
|
|
}
|
|
|
});
|
|
|
// TODO:
|
|
|
// update status
|
|
|
},
|
|
|
close(force) {
|
|
|
if (!force) {
|
|
|
// dirty check
|
|
|
}
|
|
|
close() {
|
|
|
this.visible = false;
|
|
|
},
|
|
|
onPDFUrlChang() {
|
...
|
...
|
|