|
@@ -2,17 +2,17 @@
|
|
|
<template>
|
|
<template>
|
|
|
<app-table :data="dataList" v-model:columns="tableColumns" :loading="loading" :row-key="rowKey" :expand-row-keys="expandKeys" @row-click="rowClick">
|
|
<app-table :data="dataList" v-model:columns="tableColumns" :loading="loading" :row-key="rowKey" :expand-row-keys="expandKeys" @row-click="rowClick">
|
|
|
<template #header>
|
|
<template #header>
|
|
|
- <el-button type="danger" size="small" @click="showComponent('edit')">新增收货地址</el-button>
|
|
|
|
|
|
|
+ <el-button type="danger" size="small" @click="openComponent('edit')">新增收货地址</el-button>
|
|
|
</template>
|
|
</template>
|
|
|
<!-- 发票类型 -->
|
|
<!-- 发票类型 -->
|
|
|
<template #receipttype="{ value }">
|
|
<template #receipttype="{ value }">
|
|
|
{{ getReceiptTypeName(value) }}
|
|
{{ getReceiptTypeName(value) }}
|
|
|
</template>
|
|
</template>
|
|
|
<!-- 操作 -->
|
|
<!-- 操作 -->
|
|
|
- <template #expand="{ row }">
|
|
|
|
|
|
|
+ <template #expand>
|
|
|
<div class="buttonbar">
|
|
<div class="buttonbar">
|
|
|
- <el-button type="primary" size="small" @click="showComponent('edit', row)">编辑</el-button>
|
|
|
|
|
- <el-button type="danger" size="small" @click="showComponent('delete', row)">删除</el-button>
|
|
|
|
|
|
|
+ <el-button type="primary" size="small" @click="openComponent('edit')">编辑</el-button>
|
|
|
|
|
+ <el-button type="danger" size="small" @click="openComponent('delete')">删除</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
</app-table>
|
|
</app-table>
|
|
@@ -22,11 +22,11 @@
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
import { shallowRef, defineAsyncComponent } from 'vue'
|
|
import { shallowRef, defineAsyncComponent } from 'vue'
|
|
|
-import { ElMessage } from 'element-plus'
|
|
|
|
|
-import { useInvoice } from '@/business/user/invoice'
|
|
|
|
|
import { getReceiptTypeName } from '@/constants/receipt'
|
|
import { getReceiptTypeName } from '@/constants/receipt'
|
|
|
import { useComponent } from '@/hooks/component'
|
|
import { useComponent } from '@/hooks/component'
|
|
|
import { useComposeTable } from '@pc/components/base/table'
|
|
import { useComposeTable } from '@pc/components/base/table'
|
|
|
|
|
+import { useRequest } from '@/hooks/request'
|
|
|
|
|
+import { queryWrUserReceiptInfo } from '@/services/api/user'
|
|
|
import AppTable from '@pc/components/base/table/index.vue'
|
|
import AppTable from '@pc/components/base/table/index.vue'
|
|
|
|
|
|
|
|
const componentMap = new Map<string, unknown>([
|
|
const componentMap = new Map<string, unknown>([
|
|
@@ -34,17 +34,16 @@ const componentMap = new Map<string, unknown>([
|
|
|
['delete', defineAsyncComponent(() => import('./components/delete/index.vue'))],
|
|
['delete', defineAsyncComponent(() => import('./components/delete/index.vue'))],
|
|
|
])
|
|
])
|
|
|
|
|
|
|
|
-const { rowKey, expandKeys, rowClick } = useComposeTable<Model.WrUserReceiptInfoRsp>({ rowKey: 'autoid' })
|
|
|
|
|
-const selectedRow = shallowRef<Model.WrUserReceiptInfoRsp>()
|
|
|
|
|
|
|
+const { rowKey, expandKeys, rowClick, selectedRow } = useComposeTable<Model.WrUserReceiptInfoRsp>({ rowKey: 'autoid' })
|
|
|
|
|
|
|
|
defineProps({
|
|
defineProps({
|
|
|
code: String
|
|
code: String
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
-const { loading, dataList, getUserInvoiceList } = useInvoice()
|
|
|
|
|
|
|
+const { loading, dataList, run } = useRequest(queryWrUserReceiptInfo, {})
|
|
|
|
|
|
|
|
const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => {
|
|
const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => {
|
|
|
- getUserInvoiceList()
|
|
|
|
|
|
|
+ run()
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
const tableColumns = shallowRef<Model.TableColumn[]>([
|
|
const tableColumns = shallowRef<Model.TableColumn[]>([
|
|
@@ -55,10 +54,4 @@ const tableColumns = shallowRef<Model.TableColumn[]>([
|
|
|
{ prop: 'information', label: '企业信息' },
|
|
{ prop: 'information', label: '企业信息' },
|
|
|
])
|
|
])
|
|
|
|
|
|
|
|
-getUserInvoiceList().catch((err) => ElMessage.error(err))
|
|
|
|
|
-
|
|
|
|
|
-const showComponent = (componentName: string, row?: Model.WrUserReceiptInfoRsp) => {
|
|
|
|
|
- selectedRow.value = row
|
|
|
|
|
- openComponent(componentName)
|
|
|
|
|
-}
|
|
|
|
|
</script>
|
|
</script>
|