Authored by zhangwenxue

refactor(finance/invoice): style

... ... @@ -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() {
... ...
... ... @@ -54,17 +54,6 @@ export default {
uploadList: [],
};
},
// watch: {
// value: {
// handler(newVal) {
// },
// },
// computed: {
// uploadList() {
// return this.$refs.upload.fileList;
// },
// },
mounted() {
this.clearFileList();
this.unwatch = this.$watch(
... ... @@ -99,17 +88,12 @@ export default {
},
methods: {
clearFileList() {
// const fileList = ;
// fileList.splice(0, fileList.length); // delete all
// return fileList;
this.uploadList = this.$refs.upload.fileList = [];
},
handleView() {
this.visible = true;
},
handleRemove() {
// const fileList = this.$refs.upload.fileList;
// this.$refs.upload.fileList.splice(fileList.indexOf(file), 1);
this.clearFileList();
this.$emit('input', null);
},
... ...
... ... @@ -220,9 +220,6 @@ export default {
.text-red {
color: #ed3f14;
}
.date-picker {
// width: 250px !important;
}
.layout-filter /deep/ {
.ivu-col-span-6:nth-child(2) {
width: 400px;
... ...