|
@@ -1,6 +1,20 @@
|
|
|
<!-- 新增发票抬头 -->
|
|
|
<template>
|
|
|
<view class="invoice-header u-skeleton">
|
|
|
+ <!-- 导航栏 -->
|
|
|
+ <u-navbar
|
|
|
+ title-color="#fff"
|
|
|
+ :custom-back="customBack"
|
|
|
+ :border-bottom="false"
|
|
|
+ back-icon-color="#CCE8FF"
|
|
|
+ :background="{ background: '#008CFF' }"
|
|
|
+ :title="navigationBarTitle"
|
|
|
+ class="invoice-navbar"
|
|
|
+ >
|
|
|
+ <view slot="right" class="invoice-header-right" v-if="form.id">
|
|
|
+ <u-icon name="trash-fill" size="40" color="#fa3534" @click="handleDelete"></u-icon>
|
|
|
+ </view>
|
|
|
+ </u-navbar>
|
|
|
<view class="invoice-header-form">
|
|
|
<u-form :model="form" ref="uForm" label-width="220" label-align="right">
|
|
|
<u-form-item label="抬 头:" prop="invoHeadType" class="u-skeleton-fillet">
|
|
@@ -60,15 +74,15 @@ export default {
|
|
|
invoCode: [{ required: true, message: '请输入税号', trigger: ['blur', 'change'] }]
|
|
|
},
|
|
|
loading: false,
|
|
|
- skeletonLoading: false
|
|
|
+ skeletonLoading: false,
|
|
|
+ navigationBarTitle: '新增抬头'
|
|
|
};
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
const { id } = options;
|
|
|
+ this.navigationBarTitle = '新增抬头';
|
|
|
if (id) {
|
|
|
- uni.setNavigationBarTitle({
|
|
|
- title: '编辑抬头'
|
|
|
- });
|
|
|
+ this.navigationBarTitle = '编辑抬头';
|
|
|
this.getInvoiceHeaderDetails(id);
|
|
|
}
|
|
|
},
|
|
@@ -76,6 +90,10 @@ export default {
|
|
|
this.$refs.uForm.setRules(this.rules);
|
|
|
},
|
|
|
methods: {
|
|
|
+ customBack() {
|
|
|
+ uni.navigateBack();
|
|
|
+ },
|
|
|
+ addInvoice() {},
|
|
|
/**
|
|
|
* @description: 获取发票抬头信息
|
|
|
* @param {*} id
|
|
@@ -99,6 +117,36 @@ export default {
|
|
|
this.skeletonLoading = false;
|
|
|
}
|
|
|
},
|
|
|
+ handleDelete() {
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '你确认要删除该条发票抬头吗?',
|
|
|
+ success: async (res) => {
|
|
|
+ if (res.confirm) {
|
|
|
+ try {
|
|
|
+ this.loading = true;
|
|
|
+ const { id } = this.form;
|
|
|
+ const { code } = await this.$u.api.invoiceModuleApi.deleteInvoiceHeaderApi({ id });
|
|
|
+ if (code === 200) {
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ title: '删除成功!',
|
|
|
+ type: 'success',
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ setTimeout(() => {
|
|
|
+ this.loading = false;
|
|
|
+ this.$u.route({
|
|
|
+ url: '/pages/invoiceModule/invoiceHeaderList/invoiceHeaderList'
|
|
|
+ });
|
|
|
+ }, 2000);
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ this.loading = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
/**
|
|
|
* @description: 提交发票
|
|
|
* @return {*}
|