完成发票初始版本

This commit is contained in:
2024-04-25 16:53:38 +08:00
parent d1b2c89b1c
commit b7e831662e
23 changed files with 581 additions and 31 deletions

View File

@@ -1,4 +1,5 @@
import { getInvoiceInfo, updateInvoiceInfo } from "../../../../service/invoice"
import { getUserInfo } from "../../../../service/user";
import { alertInfo, alertSuccess } from "../../../../utils/index";
// pages/invoiceList/components/info/index.js
@@ -13,6 +14,7 @@ Component({
lifetimes: {
attached() {
this.getDetail();
this.getUser();
}
},
/**
@@ -33,6 +35,10 @@ Component({
this.setData({ detail: {...data, },editType: 'detail', formData: {} })
},
async getUser() {
const { code, message, data } = await getUserInfo()
this.setData({ user: data });
},
changeEditType() {
this.setData({ editType: 'edit', formData: this.data.detail })
},

View File

@@ -4,7 +4,7 @@
<view
slot="operate"
class="cardOperate"
wx:if="{{editType === 'detail'}}"
wx:if="{{editType === 'detail' && user.isAdmin}}"
bind:tap="changeEditType"
>
<van-icon name="edit" />