|
@@ -169,9 +169,7 @@ export default {
|
|
|
this.companyPop.show = true;
|
|
|
},
|
|
|
customBack() {
|
|
|
- this.$u.route({
|
|
|
- url: '/pages/invoiceModule/availableOrder/availableOrder'
|
|
|
- });
|
|
|
+ uni.navigateBack();
|
|
|
},
|
|
|
moreContent() {
|
|
|
this.moreContentPop.show = true;
|
|
@@ -184,30 +182,14 @@ export default {
|
|
|
const { code, data } = await this.$u.api.invoiceModuleApi.getInvoiceHeadSelectApi({ ...this.queryParams });
|
|
|
if (code === 200) {
|
|
|
this.companyPop.list = data;
|
|
|
- if (data.length) {
|
|
|
- if (data[0].invoStatus === 1) {
|
|
|
- this.form.invoName = data[0].invoName;
|
|
|
- this.form.invoCode = data[0].invoCode;
|
|
|
- this.form.invoHeadId = data[0].id;
|
|
|
- this.form.invoMail = data[0].invoMail;
|
|
|
- this.form.invoPhone = data[0].invoPhone;
|
|
|
- this.companyPop.form.name = data[0].id;
|
|
|
- } else {
|
|
|
- this.form.invoName = '';
|
|
|
- this.form.invoCode = '';
|
|
|
- this.form.invoHeadId = '';
|
|
|
- this.form.invoMail = '';
|
|
|
- this.form.invoPhone = '';
|
|
|
- this.companyPop.form.name = '';
|
|
|
- }
|
|
|
- } else {
|
|
|
- this.form.invoName = '';
|
|
|
- this.form.invoCode = '';
|
|
|
- this.form.invoHeadId = '';
|
|
|
- this.form.invoMail = '';
|
|
|
- this.form.invoPhone = '';
|
|
|
- this.companyPop.form.name = '';
|
|
|
- }
|
|
|
+ const { invoName, invoCode, id, invoMail, invoPhone, invoStatus } = data[0] || {};
|
|
|
+ const isEmpty = invoStatus !== 1;
|
|
|
+ this.form.invoName = isEmpty ? '' : invoName;
|
|
|
+ this.form.invoCode = isEmpty ? '' : invoCode;
|
|
|
+ this.form.invoHeadId = isEmpty ? '' : id;
|
|
|
+ this.form.invoMail = isEmpty ? '' : invoMail;
|
|
|
+ this.form.invoPhone = isEmpty ? '' : invoPhone;
|
|
|
+ this.companyPop.form.name = isEmpty ? '' : id;
|
|
|
}
|
|
|
},
|
|
|
/**
|