|
|
@@ -373,6 +373,9 @@ export default {
|
|
|
financial.viewBillingAccount(this.$route.params.id).then(res => {
|
|
|
if (res.data) {
|
|
|
this.form = res.data
|
|
|
+ if (!this.form.items || this.form.items.length == 0) {
|
|
|
+ this.addAdditionalItem();
|
|
|
+ }
|
|
|
}
|
|
|
}).catch(err => {
|
|
|
this.$message({
|
|
|
@@ -399,6 +402,9 @@ export default {
|
|
|
return false;
|
|
|
},
|
|
|
addAdditionalItem() {
|
|
|
+ if (!this.form.items) {
|
|
|
+ this.form.items = []
|
|
|
+ }
|
|
|
this.form.items.push({
|
|
|
itemName: "",
|
|
|
itemPrice: "",
|
|
|
@@ -450,6 +456,7 @@ export default {
|
|
|
this.$refs['detailForm'].validate(result => {
|
|
|
if (result) {
|
|
|
this.loading = true;
|
|
|
+ this.form.items = this.form.items.filter(item => (item.itemName && item.itemPrice && item.itemType));
|
|
|
if (this.isEdit) {
|
|
|
this.onUpdateBiling();
|
|
|
} else {
|